| | |
| | | |
| | | export function getActionForm (card, functip, tableName, usefulFields, modules, anchors) { |
| | | const appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let _type = '提交' |
| | | if (card.type === 'prev') { |
| | | _type = '上一步' |
| | |
| | | } else { |
| | | menulist = [] |
| | | } |
| | | } |
| | | |
| | | let refresh = [] |
| | | if (!appType && viewType === 'popview') { // 弹窗标签 |
| | | refresh.push({ |
| | | value: 'closepoptab', // 关闭弹窗标签 |
| | | text: '关闭弹窗' |
| | | }) |
| | | refresh.push({ |
| | | value: 'popclose', // 执行弹窗关闭时的刷新 |
| | | text: '刷新源组件' |
| | | }) |
| | | } |
| | | |
| | | return [ |
| | |
| | | }, { |
| | | value: 'mainline', |
| | | text: '刷新上级组件 - 行' |
| | | }] |
| | | }, ...refresh] |
| | | }, |
| | | { |
| | | type: (appType === 'pc' || appType === 'mob') ? 'select' : 'cascader', |
| | |
| | | shows.push('placement') |
| | | } else if (this.record.display === 'drawer') { |
| | | shows.push('placement') |
| | | } else if (this.record.display === 'modal') { |
| | | shows.push('popshow') |
| | | } |
| | | if (this.record.popClose === 'grid') { |
| | | shows.push('resetPageIndex') |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'popshow', |
| | | label: '弹窗展示', |
| | | initVal: card.popshow || 'default', |
| | | tooltip: '小窗口展示将隐藏标题及底部按钮。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'default', |
| | | text: '默认' |
| | | }, { |
| | | value: 'miniview', |
| | | text: '小窗口' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'maskStyle', |
| | | label: '蒙层样式', |
| | | initVal: card.maskStyle || 'default', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'popshow', |
| | | label: '弹窗展示', |
| | | initVal: card.popshow || 'default', |
| | | tooltip: '小窗口展示将隐藏标题及底部按钮。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'default', |
| | | text: '默认' |
| | | }, { |
| | | value: 'miniview', |
| | | text: '小窗口' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'preFunc', |
| | | label: '前置函数', |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Select, Radio, Row, Col } from 'antd' |
| | | import { Select, Radio, Row, Col, Popover, Badge } from 'antd' |
| | | import moment from 'moment' |
| | | import 'moment/locale/zh-cn' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const { Option } = Select |
| | |
| | | let monthlist = datelist.filter(item => item.month === selectMonth)[0].children.filter(cell => !cell.children[0].$disable || !cell.children[6].$disable) |
| | | |
| | | this.setState({ selectYear: value, datelist, monthlist }) |
| | | |
| | | this.props.yearChange(value) |
| | | } |
| | | |
| | | monthChange = (value) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | triggerDay = (d) => { |
| | | const { config } = this.props |
| | | |
| | | if (!config.setting.linkbtn) return |
| | | |
| | | let id = d.time + '' |
| | | id = id.substr(0, 4) + '-' + id.substr(4, 2) + '-' + id.substr(6) |
| | | |
| | | MKEmitter.emit('triggerBtnId', config.setting.linkbtn, [{$$uuid: id}]) |
| | | } |
| | | |
| | | openView = (data, e) => { |
| | | const { config } = this.props |
| | | |
| | | if (!config.wrap.click) return |
| | | |
| | | e && e.stopPropagation() |
| | | |
| | | if (config.wrap.click === 'menus') { |
| | | let menu = null |
| | | |
| | | if (config.wrap.menus && config.wrap.menus.length > 0) { |
| | | let s = data[config.wrap.menuType] + '' |
| | | config.wrap.menus.forEach(m => { |
| | | if (s !== m.sign) return |
| | | menu = m |
| | | }) |
| | | } |
| | | if (!menu) return |
| | | |
| | | let newtab = { |
| | | MenuID: menu.MenuID, |
| | | MenuName: menu.MenuName, |
| | | MenuNo: menu.MenuNo || '', |
| | | type: menu.tabType, |
| | | param: {$BID: data.$$uuid || ''} |
| | | } |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } else if (config.wrap.click === 'menu') { |
| | | let menuId = config.wrap.MenuID || config.wrap.menu.slice(-1)[0] |
| | | let menu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0] |
| | | |
| | | if (!menu && config.wrap.MenuName && config.wrap.tabType) { |
| | | menu = { |
| | | MenuID: menuId, |
| | | MenuName: config.wrap.MenuName, |
| | | MenuNo: config.wrap.MenuNo || '', |
| | | type: config.wrap.tabType |
| | | } |
| | | } |
| | | |
| | | if (!menu) return |
| | | |
| | | let newtab = { |
| | | ...menu, |
| | | param: {$BID: data.$$uuid || ''} |
| | | } |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { level, selectYear, selectMonth, yearlist, levels, datelist, monthlist } = this.state |
| | | const _levelName = {day: '日', month: '月', year: '年'} |
| | | |
| | | return ( |
| | | <div className="mk-calendar"> |
| | | <div className={'mk-calendar' + (config.setting.linkbtn ? ' open-pop' : '') + (config.wrap.click ? ' open-menu' : '')}> |
| | | <div className="mk-calendar-control"> |
| | | <Select value={selectYear} onChange={this.yearChange}> |
| | | {yearlist.map(item => (<Option key={item} value={item}>{item}年</Option>))} |
| | |
| | | <tr key={m}> |
| | | {cell.children.map((d, i) => ( |
| | | <td key={i}> |
| | | <div style={d.style} className={'day-wrap' + (d.$disable ? ' disabled' : '')}> |
| | | {d.label} |
| | | <div style={d.style} className={'day-wrap' + (d.$disable ? ' disabled' : '')} onClick={() => !d.$disable && this.triggerDay(d)}> |
| | | {d.subData.length > 0 ? <Popover mouseEnterDelay={0.3} overlayClassName={'calendar-day-pop' + (config.wrap.click ? ' open-menu' : '')} content={ |
| | | <div onClick={(e) => e.stopPropagation()}> |
| | | {d.subData.map((data, index) => ( |
| | | <div key={index} className="message" onClick={() => this.openView(data)}> |
| | | <Badge color={data.$color} text={ |
| | | <span> |
| | | {data.$message} |
| | | <span style={{color: 'rgba(0,0,0,.45)'}}>({data.$startTime + ' ~ ' + data.$endTime})</span> |
| | | </span>} |
| | | /> |
| | | </div> |
| | | ))} |
| | | </div> |
| | | } trigger="hover"> |
| | | {d.label} |
| | | </Popover> : d.label} |
| | | </div> |
| | | </td> |
| | | ))} |
| | |
| | | <tr key={m}> |
| | | {cell.children.map((d, i) => ( |
| | | <td key={i}> |
| | | <div className={'month-wrap' + (d.$disable ? ' disabled' : '')}> |
| | | <div className={'month-wrap' + (d.$disable ? ' disabled' : '')} onClick={() => !d.$disable && this.triggerDay(d)}> |
| | | <div className="header"> |
| | | <div className="message"> |
| | | {d.label} |
| | |
| | | <span className="right">{d.jr}</span> |
| | | </div> |
| | | </div> |
| | | <ul className="content"></ul> |
| | | <ul className="content"> |
| | | {d.subData.map((data, index) => ( |
| | | <li key={index} className="message" onClick={(e) => this.openView(data, e)}> |
| | | <Badge color={data.$color} text={data.$message} /> |
| | | </li> |
| | | ))} |
| | | </ul> |
| | | </div> |
| | | </td> |
| | | ))} |
| | |
| | | <div className="header"> |
| | | {item.label} |
| | | </div> |
| | | <ul className="content"></ul> |
| | | <ul className="content"> |
| | | {item.subData.map((data, index) => ( |
| | | <li key={index} className="message" onClick={() => this.openView(data)}> |
| | | <Badge color={data.$color} text={`${data.$message} (${data.$startTime} ~ ${data.$endTime})`}/> |
| | | </li> |
| | | ))} |
| | | </ul> |
| | | </div> |
| | | </Col> |
| | | ))} |
| | |
| | | } |
| | | .content { |
| | | padding: 0 10px 10px; |
| | | height: 70px; |
| | | height: 55px; |
| | | overflow-y: auto; |
| | | position: absolute; |
| | | left: 0; |
| | | right: 0; |
| | | .message { |
| | | width: 100%; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | .ant-badge { |
| | | width: 100%; |
| | | } |
| | | .ant-badge-status-text { |
| | | color: inherit; |
| | | font-size: 13px; |
| | | width: calc(100% - 15px); |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | height: 21px; |
| | | display: inline-block; |
| | | vertical-align: top; |
| | | } |
| | | } |
| | | } |
| | |
| | | .year-wrap { |
| | | width: calc(100% - 2px); |
| | | box-shadow: 0px 0px 3px var(--mk-sys-color2); |
| | | cursor: pointer; |
| | | transition: background 0.1s; |
| | | .header { |
| | | text-align: center; |
| | |
| | | width: 100%; |
| | | overflow: hidden; |
| | | margin-bottom: 5px; |
| | | text-overflow: ellipsis; |
| | | .ant-badge { |
| | | width: 100%; |
| | | } |
| | | .ant-badge-status-text { |
| | | font-size: 13px; |
| | | width: calc(100% - 15px); |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | height: 21px; |
| | | display: inline-block; |
| | | vertical-align: top; |
| | | } |
| | | } |
| | | } |
| | | .content::-webkit-scrollbar { |
| | |
| | | } |
| | | } |
| | | } |
| | | .mk-calendar:not(.open-pop) { |
| | | .day-wrap { |
| | | cursor: default!important; |
| | | } |
| | | .month-wrap { |
| | | cursor: default!important; |
| | | } |
| | | } |
| | | .mk-calendar.open-menu { |
| | | .month-wrap, .year-wrap { |
| | | .content { |
| | | .message { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .calendar-day-pop.open-menu { |
| | | .message { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .calendar-day-pop { |
| | | .message { |
| | | .ant-badge-status-text { |
| | |
| | | _config.wrap.colorField = '' |
| | | } |
| | | |
| | | if (_config.action[0] && _config.action[0].config && _config.action[0].config.enabled) { |
| | | _config.setting.linkbtn = _config.action[0].uuid |
| | | } else { |
| | | _config.action = [] |
| | | } |
| | | |
| | | this.setState({ |
| | | BID: BData ? (BData.$BID || '') : '', |
| | | BData: BData, |
| | |
| | | }) |
| | | } |
| | | |
| | | yearChange = (value) => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.setting.$re_year) return |
| | | |
| | | this.setState({ |
| | | year: value |
| | | }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, data, BID, BData } = this.state |
| | | |
| | |
| | | {config.action[0] ? |
| | | <PopupButton disabled={false} BID={BID} btn={config.action[0]} BData={BData} setting={config.setting} selectedData={[]}/> : null |
| | | } |
| | | <CalendarBoard config={config} data={data}/> |
| | | <CalendarBoard config={config} data={data} yearChange={this.yearChange}/> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | |
| | | if (group.uuid !== menuId) return |
| | | |
| | | if (position === 'mainline' && config.setting.supModule && BID) { |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | |
| | | } |
| | | |
| | | this.execSuccess(btn, id) |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id, data) => { |
| | |
| | | |
| | | if (group.uuid !== menuId) return |
| | | |
| | | if (position === 'mainline' && config.setting.supModule && BID) { |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | |
| | | } |
| | | |
| | | this.execSuccess(btn, id) |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id, data) => { |
| | |
| | | |
| | | if (group.uuid !== menuId) return |
| | | |
| | | if (position === 'mainline' && config.setting.supModule && BID) { |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | |
| | | } |
| | | |
| | | this.execSuccess(btn, id) |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | | btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) |
| | | } |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id, data) => { |
| | |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.execError = 'never' |
| | | group.subButton.logLabel = item.$menuname + '-' + group.subButton.label |
| | | group.subButton.$tabId = Tab.uuid |
| | | |
| | | if (!group.subButton.Ot) { |
| | | group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | |
| | | |
| | | if (btn.Ot === 'requiredSgl' && setting.primaryKey) { |
| | | _data = data[0] |
| | | primaryId = _data[setting.primaryKey] || '' |
| | | primaryId = _data.$$uuid || _data[setting.primaryKey] || '' |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | ratio = ratio + 'vw' |
| | | } |
| | | return <Modal |
| | | wrapClassName={'popview-modal ' + (!btn.$view ? '' : 'custom-popview')} |
| | | wrapClassName={'popview-modal ' + (!btn.$view ? '' : 'custom-popview ') + (btn.popshow || '')} |
| | | title={btn.label} |
| | | width={ratio} |
| | | maskClosable={btn.clickouter === 'close'} |
| | |
| | | .custom-popview.popview-modal { |
| | | >.ant-modal-content >.ant-modal-body { |
| | | .ant-modal-content .ant-modal-body { |
| | | padding: 0; |
| | | .custom-page-wrap { |
| | | min-height: 200px; |
| | |
| | | } |
| | | } |
| | | } |
| | | .custom-popview.popview-modal.miniview { |
| | | .ant-modal-header { |
| | | display: none; |
| | | } |
| | | .ant-modal-footer { |
| | | display: none; |
| | | } |
| | | .ant-modal-body { |
| | | padding: 0px; |
| | | border-radius: 4px; |
| | | max-height: calc(100vh - 110px); |
| | | } |
| | | } |
| | | .table-drawer-popview { |
| | | .close-drawer { |
| | | position: absolute; |