| | |
| | | min: 1, |
| | | max: 10, |
| | | label: '高度(行)', |
| | | initVal: card.height, |
| | | initVal: card.height !== undefined ? card.height : 1, |
| | | tooltip: '内容显示行数,值为空时高度自适应,注:自适应高度仅在设置卡片高度后有效。', |
| | | required: false |
| | | }, |
| | |
| | | menulist = [] |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, cards.uuid) || [] |
| | | let supId = '' |
| | | if (cards.setting && cards.setting.supModule) { |
| | | let pid = cards.setting.supModule[cards.setting.supModule.length - 1] |
| | | if (pid && pid !== 'empty') { |
| | | supId = pid |
| | | } else { |
| | | supId = '' |
| | | } |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, cards.uuid, supId) || [] |
| | | let anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, cards.uuid) || [] |
| | | |
| | | this.setState({ |
| | |
| | | } else if (card.type === 'next') { |
| | | return ['type', 'label', 'enable'] |
| | | } |
| | | let _options = ['type', 'label', 'intertype', 'syncComponent', 'anchors', 'linkmenu', 'open', 'enable', 'output', 'reload'] // 选项列表 |
| | | let _options = ['type', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'open', 'enable', 'output', 'reload'] // 选项列表 |
| | | |
| | | if (_intertype === 'custom') { |
| | | _options.pop() |
| | |
| | | } else { |
| | | menulist = [] |
| | | } |
| | | if (appType === 'mob') { |
| | | menulist.push({value: 'goback', text: '返回(上一页)'}) |
| | | } |
| | | menulist.push({value: 'goback', text: '返回(上一页)'}) |
| | | } else { |
| | | menulist = sessionStorage.getItem('fstMenuList') |
| | | if (menulist) { |
| | |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'Ot', |
| | | label: '行设置', |
| | | initVal: card.Ot, |
| | | required: true, |
| | | options: [{ |
| | | value: 'notRequired', |
| | | text: '不选择行' |
| | | }, { |
| | | value: 'requiredSgl', |
| | | text: '选择单行' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'execSuccess', |
| | | label: '成功后', |
| | | initVal: card.execSuccess || 'grid', |
| | | required: true, |
| | | options: [{ |
| | | value: 'never', |
| | | text: '不刷新' |
| | | }, { |
| | | value: 'grid', |
| | | text: '刷新当前组件' |
| | | }, { |
| | | value: 'mainline', |
| | | text: '刷新上级组件 - 行' |
| | | }] |
| | | }, |
| | | { |
| | | type: (appType === 'pc' || appType === 'mob') ? 'select' : 'cascader', |
| | | key: 'linkmenu', |
| | | label: '下一步操作', |
| | | tooltip: '执行成功后需要打开的菜单。', |
| | | initVal: card.linkmenu, |
| | | help: '可返回上一页。', |
| | | help: appType === 'pc' || appType === 'mob' ? '可返回上一页。' : null, |
| | | required: false, |
| | | allowClear: true, |
| | | options: menulist |
| | |
| | | key: 'syncComponent', |
| | | label: '同步刷新', |
| | | initVal: card.syncComponent, |
| | | tooltip: '执行成功后需要刷新的组件。', |
| | | tooltip: '执行成功后需要刷新的组件。注:选择当前组件的上级组件无效。', |
| | | required: false, |
| | | options: modules |
| | | }, |
| | |
| | | <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> |
| | | </div> |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid) || [] |
| | | let supId = '' |
| | | if (config.wrap.linkType === 'sup') { |
| | | supId = config.wrap.supModule[config.wrap.supModule.length - 1] |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid, supId) || [] |
| | | let anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, config.uuid) || [] |
| | | |
| | | if (card.type === 'submit' && !card.Ot) { |
| | | card.Ot = config.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | | } |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | |
| | | style: {}, |
| | | fields: [], |
| | | prevButton: {label: '上一步', type: 'prev', enable: 'false', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | subButton: {label: '提交', type: 'submit', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | subButton: {label: '提交', type: 'submit', Ot: 'notRequired', execSuccess: 'never', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | nextButton: {label: '跳过', type: 'next', enable: 'false', style: {paddingTop: '5px', paddingBottom: '5px'}} |
| | | }] |
| | | } |
| | |
| | | sort: 1, |
| | | style: {}, |
| | | fields: [], |
| | | subButton: {label: '提交', type: 'submit', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | subButton: {label: '提交', type: 'submit', Ot: 'notRequired', execSuccess: 'never', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | }, { |
| | | uuid: Utils.getuuid(), |
| | | setting: {title: '分组2', align: 'left_right'}, |
| | | sort: 1, |
| | | style: {}, |
| | | fields: [], |
| | | subButton: {label: '提交', type: 'submit', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | subButton: {label: '提交', type: 'submit', Ot: 'notRequired', execSuccess: 'never', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | }, { |
| | | uuid: Utils.getuuid(), |
| | | setting: {title: '分组3', align: 'left_right'}, |
| | | sort: 1, |
| | | style: {}, |
| | | fields: [], |
| | | subButton: {label: '提交', type: 'submit', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | subButton: {label: '提交', type: 'submit', Ot: 'notRequired', execSuccess: 'never', enable: 'true', style: {backgroundColor: '#1890ff', color: '#ffffff', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px'}}, |
| | | }] |
| | | } |
| | | |
| | |
| | | const { TextArea } = Input |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const acTyOptions = { |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'open', 'refreshTab', 'position', 'tipTitle', 'hidden'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'open', 'refreshTab', 'position', 'tipTitle', 'hidden'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'open', 'refreshTab', 'hidden'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'hidden'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'hidden'], |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'], |
| | | prompt: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hidden'], |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'hidden'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'hidden'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'open', 'hidden'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], |
| | | form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'width', 'open', 'refreshTab', 'title', 'hidden'] |
| | | form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'width', 'refreshTab', 'title', 'hidden'] |
| | | } |
| | | |
| | | class ActionForm extends Component { |
| | |
| | | if (Ot === 'required') { |
| | | shows.push('progress') |
| | | } |
| | | if (this.record.openmenu && this.record.openmenu !== 'goback') { |
| | | shows.push('open') |
| | | } |
| | | if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { |
| | | shows.push('resetPageIndex') |
| | | } |
| | | |
| | | if (this.record.sqlType === 'insert') { |
| | | reOptions.Ot = requireOptions.filter(op => op.value === 'notRequired') |
| | |
| | | if (this.record.execSuccess === 'goback') { |
| | | shows.push('reload') |
| | | } |
| | | if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { |
| | | shows.push('resetPageIndex') |
| | | } |
| | | |
| | | reOptions.Ot = requireOptions |
| | | reOptions.sqlType = [{ |
| | |
| | | shows.push('innerFunc') |
| | | reRequired.innerFunc = true |
| | | } |
| | | if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { |
| | | shows.push('resetPageIndex') |
| | | } |
| | | } else if (openType === 'excelOut') { |
| | | reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom') |
| | | |
| | |
| | | shows.push('innerFunc') |
| | | reRequired.innerFunc = true |
| | | } |
| | | if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { |
| | | shows.push('resetPageIndex') |
| | | } |
| | | } else if (openType === 'popview') { |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | |
| | | if (this.record.display === 'drawer') { |
| | | shows.push('placement') |
| | | } |
| | | if (this.record.popClose === 'grid') { |
| | | shows.push('resetPageIndex') |
| | | } |
| | | } else if (openType === 'tab') { |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | |
| | | let _funcType = this.record.funcType |
| | | |
| | | if (_funcType === 'print') { |
| | | shows.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex') |
| | | shows.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError') |
| | | if (this.record.intertype === 'outer') { |
| | | shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') |
| | | reRequired.innerFunc = false |
| | |
| | | } else if (this.record.intertype === 'inner') { |
| | | shows.push('innerFunc') |
| | | reRequired.innerFunc = true |
| | | } |
| | | if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { |
| | | shows.push('resetPageIndex') |
| | | } |
| | | } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') { |
| | | shows.push('execSuccess', 'execError') |
| | |
| | | } else if (_funcType === 'megvii') { |
| | | shows.push('subFunc', 'progress') |
| | | } else if (_funcType === 'pay') { |
| | | shows.push('payType', 'Ot') |
| | | shows.push('payType', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu') |
| | | reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | } |
| | | } |
| | |
| | | |
| | | fields.push( |
| | | <Col span={span} key={index}> |
| | | <Form.Item className={className} label={item.tooltip ? |
| | | <Form.Item className={className} help={item.help || null} label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | |
| | | card.control = '' |
| | | } |
| | | |
| | | if (card.execSuccess === 'goback') { |
| | | card.openmenu = 'goback' |
| | | card.execSuccess = 'never' |
| | | } |
| | | |
| | | let closetab = [] |
| | | if (!appType) { |
| | | closetab = [{ |
| | | value: 'closetab', |
| | | text: '关闭标签' |
| | | }] |
| | | } |
| | | |
| | | let forms = [ |
| | | { |
| | | type: 'select', |
| | |
| | | }, { |
| | | value: 'mainline', |
| | | text: '刷新上级组件 - 行' |
| | | }, { |
| | | value: !appType ? 'closetab' : 'goback', |
| | | text: !appType ? '关闭标签' : '返回(上一个页面)' |
| | | }, |
| | | }, |
| | | ...closetab, |
| | | ...refresh] |
| | | }, |
| | | { |
| | |
| | | key: 'syncComponent', |
| | | label: '刷新组件', |
| | | initVal: card.syncComponent || [], |
| | | tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件', |
| | | tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效。', |
| | | required: false, |
| | | options: modules |
| | | }, |
| | |
| | | label: '打开菜单', |
| | | tooltip: '执行成功后需要打开的菜单。', |
| | | initVal: card.openmenu || (!appType ? [] : ''), |
| | | help: appType === 'mob' || appType === 'pc' ? '可返回上一页。' : null, |
| | | required: false, |
| | | allowClear: true, |
| | | options: appType === 'mob' ? [...appMenus, {value: 'goback', text: '返回(上一页)'}] : (appType === 'pc' ? appMenus : menulist), |
| | | options: appType === 'mob' || appType === 'pc' ? [...appMenus, {value: 'goback', text: '返回(上一页)'}] : menulist, |
| | | forbid: viewType === 'popview' |
| | | }, |
| | | { |
| | |
| | | key: 'open', |
| | | label: '打开方式', |
| | | initVal: card.open || 'blank', |
| | | tooltip: '菜单打开方式。注:移动端只在小程序或app中有效。', |
| | | required: true, |
| | | forbid: appType !== 'pc', |
| | | forbid: appType !== 'pc' && appType !== 'mob', |
| | | options: [{ |
| | | value: 'blank', |
| | | text: '新窗口' |
| | |
| | | } else { |
| | | menulist = [] |
| | | } |
| | | |
| | | let supId = '' |
| | | if (config.setting && config.setting.supModule) { |
| | | let pid = config.setting.supModule[config.setting.supModule.length - 1] |
| | | if (pid && pid !== 'empty') { |
| | | supId = pid |
| | | } else { |
| | | supId = '' |
| | | } |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid) || [] |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid, supId) || [] |
| | | let anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, config.uuid) || [] |
| | | |
| | | this.setState({ |
| | |
| | | export default function (wrap) { |
| | | let menulist = sessionStorage.getItem('appMenus') |
| | | let searchable = true |
| | | let adapters = sessionStorage.getItem('adapter') |
| | | if (adapters) { |
| | | adapters = adapters.split(',') |
| | | } else { |
| | | adapters = [] |
| | | } |
| | | |
| | | window.GLOB.customMenu.components.forEach(item => { |
| | | if (item.type === 'search') { |
| | | searchable = false |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'minishow', |
| | | label: '小程序中', |
| | | initval: wrap.minishow || 'false', |
| | | tooltip: '导航栏在小程序中是否显示。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '显示'}, |
| | | {value: 'false', label: '隐藏'}, |
| | | ], |
| | | forbid: !adapters.includes('wxmini') |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'menuPosition', |
| | | label: '自定义菜单位置', |
| | | initval: wrap.menuPosition || 'right', |
| | |
| | | } |
| | | return item |
| | | }) |
| | | } else if (_config.wrap.linkType === 'sup') { |
| | | _config.wrap.supModule = _config.wrap.supModule.pop() |
| | | if (_config.wrap.supControl === 'hidden') { |
| | | show = false |
| | | } |
| | | } else if (_config.wrap.linkType === 'sup' && _config.wrap.supControl === 'hidden') { |
| | | show = false |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | |
| | | this.loadData() |
| | | } else { |
| | | let supModule = config.wrap.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.wrap.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.wrap.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 标签关闭刷新 |
| | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | if (supComs) { |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (position === 'mainline' || position === 'popclose') { // 主表刷新,去除同步刷新组件 |
| | | let supNode = supNodes[supNodes.length - 1] |
| | | supComs.forEach((item, i) => { |
| | | if (item === btn.syncComponentId) return |
| | | |
| | | setTimeout(() => { |
| | | if (supNode && supNode.key === item) { |
| | | MKEmitter.emit('reloadData', item, supNode.value) |
| | |
| | | } |
| | | }, i * 10) |
| | | }) |
| | | } else if (!btn.syncComponentId || !supComs.includes(btn.syncComponentId)) { |
| | | } else { |
| | | if (position === 'line') { |
| | | if (lines && lines.length === 1) { |
| | | this.loadLinedata(lines[0].$$uuid) |
| | |
| | | } else { |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'line') { |
| | | if (lines && lines.length === 1) { |
| | | this.loadLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.loadData(id) |
| | | } |
| | | } else if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData(id) |
| | | } |
| | | } else if (!btn || btn.resetPageIndex !== 'false') { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData(id) |
| | | }) |
| | | if (position === 'line') { |
| | | if (lines && lines.length === 1) { |
| | | this.loadLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.loadData(id) |
| | | } |
| | | } else if ((position === 'mainline' || position === 'popclose') && supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else if (!btn || btn.resetPageIndex !== 'false') { |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | | this.loadData(id) |
| | | }) |
| | | } else { |
| | | this.loadData(id) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | import { Spin, notification, Button } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | |
| | | } |
| | | } |
| | | |
| | | let roleId = sessionStorage.getItem('role_id') || '' |
| | | |
| | | config.subcards = config.subcards.map((group, i) => { |
| | | if (i === 0) { |
| | | group.prevButton.enable = 'false' |
| | | } |
| | | if (i + 1 === config.subcards.length) { |
| | | group.nextButton.enable = 'false' |
| | | } |
| | | |
| | | group.subButton.uuid = group.uuid |
| | | group.subButton.$menuId = group.uuid |
| | | group.subButton.Ot = config.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | | group.subButton.$forbid = true |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.execError = 'never' |
| | | |
| | | group.subButton.syncComponentId = group.subButton.syncComponent ? group.subButton.syncComponent.pop() : '' |
| | | |
| | | if (group.subButton.syncComponentId === config.uuid) { |
| | | group.subButton.syncComponentId = '' |
| | | } |
| | | |
| | | if (group.subButton.enable === 'false') { |
| | |
| | | if (group.prevButton.enable === 'false' && group.subButton.enable === 'false' && group.nextButton.enable === 'false') { |
| | | group.$button = 'no-button' |
| | | } |
| | | |
| | | group.fields = group.fields.map(cell => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { |
| | | let _option = Utils.getSelectQueryOptions(cell) |
| | | |
| | | cell.data_sql = Utils.formatOptions(_option.sql) |
| | | cell.base_sql = window.btoa(window.encodeURIComponent(_option.sql)) |
| | | cell.arr_field = _option.field |
| | | } |
| | | |
| | | // 字段权限黑名单 |
| | | if (!cell.blacklist || !roleId || cell.blacklist.length === 0) return cell |
| | | if (cell.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | cell.hidden = 'true' |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | |
| | | return group |
| | | }) |
| | |
| | | * @param {*} btn // 执行的按钮 |
| | | */ |
| | | refreshByButtonResult = (menuId, position, btn, id) => { |
| | | const { config, group } = this.state |
| | | const { config, group, BID } = this.state |
| | | |
| | | if (group.uuid !== menuId) return |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== config.setting.supModule) { |
| | | if (config.wrap.datatype !== 'static' && config.setting) { |
| | | this.loadData() |
| | | } |
| | | if (position === 'mainline' && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (id) { |
| | |
| | | import { Spin, notification } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | |
| | | } |
| | | } |
| | | |
| | | let roleId = sessionStorage.getItem('role_id') || '' |
| | | |
| | | config.subcards = config.subcards.map(group => { |
| | | group.subButton.uuid = group.uuid |
| | | group.subButton.$menuId = group.uuid |
| | | group.subButton.Ot = config.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | | group.subButton.$forbid = true |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.execError = 'never' |
| | | |
| | | group.subButton.syncComponentId = group.subButton.syncComponent ? group.subButton.syncComponent.pop() : '' |
| | | |
| | | if (group.subButton.syncComponentId === config.uuid) { |
| | | group.subButton.syncComponentId = '' |
| | | } |
| | | |
| | | if (group.subButton.enable === 'false') { |
| | | group.subButton.style.display = 'none' |
| | | group.$button = 'no-button' |
| | | } |
| | | |
| | | group.fields = group.fields.map(cell => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { |
| | | let _option = Utils.getSelectQueryOptions(cell) |
| | | |
| | | cell.data_sql = Utils.formatOptions(_option.sql) |
| | | cell.base_sql = window.btoa(window.encodeURIComponent(_option.sql)) |
| | | cell.arr_field = _option.field |
| | | } |
| | | |
| | | // 字段权限黑名单 |
| | | if (!cell.blacklist || !roleId || cell.blacklist.length === 0) return cell |
| | | if (cell.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | cell.hidden = 'true' |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | |
| | | return group |
| | | }) |
| | |
| | | * @param {*} btn // 执行的按钮 |
| | | */ |
| | | refreshByButtonResult = (menuId, position, btn, id) => { |
| | | const { config, group } = this.state |
| | | const { config, group, BID } = this.state |
| | | |
| | | if (group.uuid !== menuId) return |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== config.setting.supModule) { |
| | | if (config.wrap.datatype !== 'static' && config.setting) { |
| | | this.loadData() |
| | | } |
| | | if (position === 'mainline' && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (id) { |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'line') { |
| | | if (lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | } |
| | | } else if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | } |
| | | if (position === 'line') { |
| | | if (lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | } |
| | | } else if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.reloadtable(btn) |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'line') { |
| | | if (lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn, id) |
| | | } |
| | | } else if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.reloadtable(btn, id) |
| | | } |
| | | if (position === 'line') { |
| | | if (lines && lines.length === 1) { |
| | | this.loadmainLinedata(lines[0].$$uuid) |
| | | } else { |
| | | this.reloadtable(btn, id) |
| | | } |
| | | } else if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.reloadtable(btn, id) |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | let supModule = config.setting.supModule |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (!btn.syncComponentId || btn.syncComponentId !== supModule) { |
| | | if (position === 'mainline' || position === 'popclose') { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | if (supModule && BID) { |
| | | MKEmitter.emit('reloadData', supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 刷新源组件时,附带刷新上级行与当前组件 |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | |
| | | if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项 |
| | |
| | | } |
| | | } |
| | | |
| | | if (item.wrap && item.wrap.supType === 'multi') { // 数据卡多上级组件 |
| | | if (item.supNodes && item.supNodes[0]) { |
| | | item.setting.supModule = item.supNodes[0].componentId |
| | | } else { |
| | | item.wrap.supType = 'single' |
| | | item.supNodes = null |
| | | item.setting.supModule = '' |
| | | } |
| | | } else if (item.setting && item.setting.supModule) { |
| | | let pid = item.setting.supModule.pop() |
| | | if (pid && pid !== 'empty') { |
| | | item.setting.supModule = pid |
| | | } else { |
| | | item.setting.supModule = '' |
| | | } |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | if (item.search && item.search.length > 0) { |
| | | item.search = Utils.initSearchVal(item.search) |
| | |
| | | item.statFields = statFields |
| | | } |
| | | |
| | | let mutil = false |
| | | if (item.wrap && item.wrap.supType === 'multi') { // 数据卡多上级组件 |
| | | mutil = true |
| | | item.setting.supModule = item.supNodes[0].componentId |
| | | } else if (item.setting && item.setting.supModule) { |
| | | let pid = item.setting.supModule.pop() |
| | | if (pid && pid !== 'empty') { |
| | | item.setting.supModule = pid |
| | | } else { |
| | | item.setting.supModule = '' |
| | | } |
| | | } |
| | | |
| | | // 权限过滤 |
| | | let tabId = this.props.Tab ? this.props.Tab.uuid : '' // 弹窗标签按钮Id |
| | | if (item.action && item.action.length > 0) { |
| | |
| | | cell.$view = 'CustomPage' |
| | | cell.$toolbtn = true |
| | | |
| | | if (cell.syncComponentId === item.uuid) { |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | } |
| | | |
| | |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.syncComponentId === item.uuid) { |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | } |
| | | |
| | |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.syncComponentId === item.uuid) { |
| | | if (!mutil && cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | } |
| | | |
| | |
| | | if (item.wrap.linkType === 'sync') { |
| | | item.wrap.syncModuleId = item.wrap.syncModule.pop() |
| | | balMap.set(item.wrap.syncModuleId, true) |
| | | } else if (item.wrap.linkType === 'sup') { |
| | | item.wrap.supModule = item.wrap.supModule.pop() |
| | | } |
| | | item.elements = item.elements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.syncComponentId === item.uuid) { |
| | | if (cell.syncComponentId === item.wrap.supModule) { |
| | | cell.syncComponentId = '' |
| | | } |
| | | |
| | |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.syncComponentId === item.uuid) { |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | } |
| | | |
| | |
| | | cell.$tabId = tabId |
| | | cell.$view = 'CustomPage' |
| | | |
| | | if (cell.syncComponentId === item.uuid) { |
| | | if (cell.syncComponentId === item.setting.supModule) { |
| | | cell.syncComponentId = '' |
| | | } |
| | | |
| | |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | | item.submit.$menuId = item.uuid |
| | | } |
| | | } |
| | | } else if (item.type === 'form') { |
| | | item.subcards = item.subcards.map(group => { |
| | | group.subButton.uuid = group.uuid |
| | | group.subButton.$menuId = group.uuid |
| | | // group.subButton.$forbid = true // 不声明数据源变量 |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.execError = 'never' |
| | | |
| | | // if (item.wrap && item.wrap.doubleClick) { |
| | | // let index = item.action.findIndex((btn) => btn.uuid === item.wrap.doubleClick) |
| | | // if (index === -1) { |
| | | // item.wrap.doubleClick = '' |
| | | // } |
| | | // } |
| | | if (!group.subButton.Ot) { |
| | | group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | | } |
| | | |
| | | group.subButton.syncComponentId = group.subButton.syncComponent ? group.subButton.syncComponent.pop() : '' |
| | | |
| | | if (group.subButton.syncComponentId === item.setting.supModule) { |
| | | group.subButton.syncComponentId = '' |
| | | } |
| | | |
| | | group.fields = group.fields.map(cell => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { |
| | | let _option = Utils.getSelectQueryOptions(cell) |
| | | |
| | | cell.data_sql = Utils.formatOptions(_option.sql) |
| | | cell.base_sql = window.btoa(window.encodeURIComponent(_option.sql)) |
| | | cell.arr_field = _option.field |
| | | } |
| | | |
| | | // 字段权限黑名单 |
| | | if (!cell.blacklist || !roleId || cell.blacklist.length === 0) return cell |
| | | if (cell.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | cell.hidden = 'true' |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | |
| | | return group |
| | | }) |
| | | } |
| | | |
| | | return true |
| | | }) |
| | |
| | | MKEmitter.emit('popclose') |
| | | } else if (btn.execSuccess !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, '', this.state.selines) |
| | | } else { |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | | let id = btn.switchTab[btn.switchTab.length - 1] |
| | | let node = document.getElementById('tab' + id) |
| | |
| | | MKEmitter.emit('popclose') |
| | | } else if (btn.execSuccess !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, '', []) |
| | | } else { |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | | let id = btn.switchTab[btn.switchTab.length - 1] |
| | | let node = document.getElementById('tab' + id) |
| | |
| | | MKEmitter.emit('popclose') |
| | | } else if (btn.execSuccess !== 'never') { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, id, this.state.selines) |
| | | } else { |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | | |
| | | btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId, 'table') |
| | |
| | | node && node.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'nearest'}) |
| | | } |
| | | |
| | | if (btn.openmenu && btn.openmenu.length > 0 && btn.MenuID) { |
| | | if (btn.MenuID && Array.isArray(btn.openmenu) && btn.openmenu.length > 0) { |
| | | let newtab = { |
| | | MenuID: btn.MenuID, |
| | | MenuName: btn.MenuName, |
| | |
| | | |
| | | if (!btnconfig || !btnconfig.setting) return null |
| | | |
| | | let title = btnconfig.setting.title |
| | | let title = btn.label |
| | | let width = btnconfig.setting.width > 100 ? btnconfig.setting.width : btnconfig.setting.width + 'vw' |
| | | let clickouter = btnconfig.setting.clickouter === 'close' |
| | | |
| | |
| | | |
| | | if (!this.state.visible || !btnconfig || !btnconfig.setting) return null |
| | | |
| | | let title = btnconfig.setting.title |
| | | let title = btn.label |
| | | let width = btnconfig.setting.width > 100 ? btnconfig.setting.width : btnconfig.setting.width + 'vw' |
| | | let clickouter = false |
| | | let container = document.body |
| | |
| | | import { Form, Row, Col, Input, Radio, InputNumber, Select, Tooltip } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | | // import { formRule } from '@/utils/option.js' |
| | | import StyleInput from '@/menu/stylecontroller/styleInput' |
| | | // import './index.scss' |
| | | import './index.scss' |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | state = { |
| | | fields: null, |
| | | display: this.props.config.setting.display, |
| | | appType: sessionStorage.getItem('appType') |
| | | display: this.props.config.setting.display || 'modal', |
| | | appType: sessionStorage.getItem('appType'), |
| | | dialogInput: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config } = this.props |
| | | const { appType, display } = this.state |
| | | let fields = [] |
| | | let dialogInput = null |
| | | |
| | | config.fields.forEach(f => { |
| | | if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | } |
| | | if (f.field && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | if (dialogInput === null) { |
| | | dialogInput = ['text', 'number'].includes(f.type) |
| | | } else { |
| | | dialogInput = false |
| | | } |
| | | } |
| | | }) |
| | | |
| | | let _display = display |
| | | if (appType === 'mob' && display !== 'prompt' && display !== 'drawer') { |
| | | let _display = display |
| | | if (appType === 'mob' && display === 'modal') { |
| | | _display = 'drawer' |
| | | } |
| | | |
| | | this.setState({ |
| | | fields: fields, |
| | | display: _display |
| | | display: _display, |
| | | dialogInput |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout}> |
| | | <Form {...formItemLayout} className="form-setting-wrap"> |
| | | <Row gutter={24}> |
| | | <Col span={12}> |
| | | {/* <Col span={12}> |
| | | <Form.Item label="标题"> |
| | | {getFieldDecorator('title', { |
| | | initialValue: config.setting.title, |
| | |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | {/* {appType !== 'mob' ? <Col span={12}> |
| | | <Form.Item label="宽度(%)"> |
| | | {getFieldDecorator('width', { |
| | | initialValue: config.setting.width |
| | | })(<InputNumber min={10} max={2000} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | </Col> */} |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对话框在仅有一个可输入表单(非隐藏、非只读的文本或数字)时有效。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 显示方式 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('display', { |
| | | initialValue: display || 'modal' |
| | | })( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({display: e.target.value})}> |
| | | {appType !== 'mob' ? <Radio value="modal">模态框</Radio> : null} |
| | | <Radio value="drawer">抽屉</Radio> |
| | | <Radio value="prompt">是否框</Radio> |
| | | <Radio value="exec">直接执行</Radio> |
| | | {/* <Radio value="dialog" disabled={dialogInput !== true}>对话框</Radio> */} |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} */} |
| | | <Col span={12}> |
| | | </Col> |
| | | {display === 'drawer' || display === 'modal' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="宽度小于100时为百分率,大于100时为绝对值。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('width', { |
| | | initialValue: config.setting.width |
| | | initialValue: config.setting.width || (appType !== 'mob' ? 60 : 100) |
| | | })(<InputNumber min={10} max={2000} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | </Col> : null} |
| | | {display === 'drawer' || display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="初始焦点"> |
| | | {getFieldDecorator('focus', { |
| | | initialValue: config.setting.focus || '' |
| | |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | </Col> : null} |
| | | {display === 'drawer' || display === 'modal' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="执行失败时需要聚焦的表单。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {appType !== 'mob' ? <Col span={12}> |
| | | <Form.Item label="表单排列"> |
| | | {getFieldDecorator('align', { |
| | | initialValue: config.setting.align || 'left_right' |
| | | </Col> : null} |
| | | {appType === 'mob' && display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="表单元素与左侧边界的距离。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 左边距 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('paddingLeft', { |
| | | initialValue: config.setting.paddingLeft || '10px' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="left_right">左右</Radio> |
| | | <Radio value="up_down">上下</Radio> |
| | | </Radio.Group> |
| | | <StyleInput options={['px', '%']} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | {appType === 'mob' && display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="表单元素与右侧边界的距离。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 右边距 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('paddingRight', { |
| | | initialValue: config.setting.paddingRight || '10px' |
| | | })( |
| | | <StyleInput options={['px', '%']} /> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType === 'mob' && display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label="按钮名称"> |
| | | {getFieldDecorator('btnName', { |
| | | initialValue: config.setting.btnName || '确定' |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType === 'mob' && display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label="按钮位置"> |
| | | {getFieldDecorator('btnPosition', { |
| | | initialValue: config.setting.btnPosition || 'bottom' |
| | | })( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}}> |
| | | <Radio value="bottom">下侧</Radio> |
| | | <Radio value="top">上侧</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {display === 'drawer' || display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="完成后"> |
| | | {getFieldDecorator('finish', { |
| | | initialValue: config.setting.finish || 'close' |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="点击蒙层"> |
| | | {getFieldDecorator('clickouter', { |
| | | initialValue: config.setting.clickouter || 'unclose' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="unclose">不关闭</Radio> |
| | | <Radio value="close">关闭</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | </Col> : null} |
| | | {display === 'drawer' || display === 'modal' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="需要通过数据源查询的选项,是否使用缓存。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | <Radio.Group> |
| | | <Radio value="true">缓存</Radio> |
| | | <Radio value="false">实时</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="打印按钮中无效。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 显示方式 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('display', { |
| | | initialValue: display || 'modal' |
| | | })( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({display: e.target.value})}> |
| | | {appType !== 'mob' ? <Radio value="modal">模态框</Radio> : null} |
| | | <Radio value="drawer">抽屉</Radio> |
| | | <Radio value="prompt">是否框</Radio> |
| | | <Radio value="exec">直接执行</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {!this.props.isSubTab && !appType && display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="挂载对象"> |
| | | {getFieldDecorator('container', { |
| | | initialValue: config.setting.container || 'tab' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="view">页面</Radio> |
| | | <Radio value="tab">标签页</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType !== 'mob' && (display === 'drawer' || display === 'modal') ? <Col span={12}> |
| | | <Form.Item label="表单排列"> |
| | | {getFieldDecorator('align', { |
| | | initialValue: config.setting.align || 'left_right' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="left_right">左右</Radio> |
| | | <Radio value="up_down">上下</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {display === 'drawer' && appType !== 'mob' ? <Col span={12}> |
| | | <Form.Item label="表单类型"> |
| | | {getFieldDecorator('formType', { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType === 'mob' ? <Col span={12}> |
| | | <Form.Item label="左边距"> |
| | | {getFieldDecorator('paddingLeft', { |
| | | initialValue: config.setting.paddingLeft || '10px' |
| | | {!this.props.isSubTab && !appType && display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="挂载对象"> |
| | | {getFieldDecorator('container', { |
| | | initialValue: config.setting.container || 'tab' |
| | | })( |
| | | <StyleInput options={['px', '%']} /> |
| | | <Radio.Group> |
| | | <Radio value="view">页面</Radio> |
| | | <Radio value="tab">标签页</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType === 'mob' ? <Col span={12}> |
| | | <Form.Item label="右边距"> |
| | | {getFieldDecorator('paddingRight', { |
| | | initialValue: config.setting.paddingRight || '10px' |
| | | {display === 'drawer' || display === 'modal' ? <Col span={12}> |
| | | <Form.Item label="点击蒙层"> |
| | | {getFieldDecorator('clickouter', { |
| | | initialValue: config.setting.clickouter || 'unclose' |
| | | })( |
| | | <StyleInput options={['px', '%']} /> |
| | | <Radio.Group> |
| | | <Radio value="unclose">不关闭</Radio> |
| | | <Radio value="close">关闭</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType === 'mob' ? <Col span={12}> |
| | | <Form.Item label="按钮名称"> |
| | | {getFieldDecorator('btnName', { |
| | | initialValue: config.setting.btnName || '确定' |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {appType === 'mob' ? <Col span={12}> |
| | | <Form.Item label="按钮位置"> |
| | | {getFieldDecorator('btnPosition', { |
| | | initialValue: config.setting.btnPosition || 'bottom' |
| | | })( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}}> |
| | | <Radio value="bottom">下侧</Radio> |
| | | <Radio value="top">上侧</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | |
| | | .form-setting-wrap { |
| | | min-height: 100px; |
| | | .ant-col-24 { |
| | | .ant-form-item-label { |
| | | width: 16.5%; |
| | | } |
| | | } |
| | | } |
| | |
| | | * @description 获取下级模块 |
| | | * @return {String} selfId 当前组件id |
| | | */ |
| | | static getSubModules (components, selfId) { |
| | | static getSubModules (components, selfId, supId) { |
| | | let modules = components.map(item => { |
| | | if (item.uuid === selfId) { |
| | | if (item.uuid === selfId || item.type === 'navbar') { |
| | | return { |
| | | children: null |
| | | } |
| | | } else if (item.format) { // 数据格式,存在数据源 |
| | | return { |
| | | value: item.uuid, |
| | | label: item.name |
| | | label: item.name, |
| | | disabled: supId === item.uuid |
| | | } |
| | | } else if (item.type === 'tabs') { |
| | | let _item = { |
| | |
| | | } |
| | | |
| | | // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过) |
| | | if (data && !btn.$forbid && btn.Ot !== 'notRequired' && btn.Ot !== 'requiredOnce') { |
| | | if (data && btn.Ot !== 'notRequired' && btn.Ot !== 'requiredOnce') { |
| | | datavars = {...data, ...datavars} |
| | | |
| | | const setField = (col) => { |
| | |
| | | loading: false, |
| | | menulist: [], |
| | | columns: [ |
| | | { title: '菜单名称', dataIndex: 'MenuName', key: 'MenuName', align: 'center' }, |
| | | { title: '菜单名称', dataIndex: 'MenuName', key: 'MenuName', align: 'center', render: (text, record) => { |
| | | if (record.extra) { |
| | | return <span style={{color: '#1890ff'}}>{text}</span> |
| | | } |
| | | return text |
| | | } }, |
| | | { |
| | | title: '操作', |
| | | key: 'action', |
| | |
| | | delete item.menus_rolelist |
| | | } |
| | | |
| | | if (!ub && app.userbind === item.MenuID) { |
| | | if (app.userbind === item.MenuID) { |
| | | item.extra = true |
| | | ub = true |
| | | } |
| | | if (!im && app.instantMessage === item.MenuID) { |
| | | if (app.instantMessage === item.MenuID) { |
| | | item.extra = true |
| | | im = true |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | if (!im) { |
| | | menus.push({nodes: '', type: 'none', MenuID: app.instantMessage, MenuName: '即时通信'}) |
| | | menus.push({nodes: '', type: 'none', extra: true, MenuID: app.instantMessage, MenuName: '即时通信'}) |
| | | } |
| | | if (!ub) { |
| | | menus.push({nodes: '', type: 'none', MenuID: app.userbind, MenuName: '用户绑定'}) |
| | | menus.push({nodes: '', type: 'none', extra: true, MenuID: app.userbind, MenuName: '用户绑定'}) |
| | | } |
| | | |
| | | this.setState({ |