| | |
| | | supId = '' |
| | | } |
| | | } |
| | | let menu = window.GLOB.customMenu |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, cards.uuid, supId, true) |
| | | let modules = MenuUtils.getSubModules(menu.components, cards.uuid, supId, menu.interfaces || null) |
| | | |
| | | if (cards.subtype === 'basetable') { |
| | | this.setState({ |
| | |
| | | formlist: getBaseTableActionForm(card, functip, cards, usefulFields, modules) |
| | | }) |
| | | } else { |
| | | let anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, cards.uuid) || [] |
| | | let anchors = MenuUtils.getAnchors(menu.components, cards.uuid) || [] |
| | | |
| | | this.setState({ |
| | | actvisible: true, |
| | |
| | | |
| | | getWrapForms = () => { |
| | | const { card } = this.state |
| | | |
| | | let buttons = [] |
| | | |
| | | card.action && card.action.forEach(n => { |
| | | buttons.push({ |
| | | value: n.uuid, |
| | | label: n.label |
| | | }) |
| | | }) |
| | | |
| | | card.subcards.forEach(m => { |
| | | if (m.$cardType !== 'extendCard') return |
| | | |
| | | m.elements.forEach(n => { |
| | | if (n.eleType === 'button') { |
| | | buttons.push({ |
| | | value: n.uuid, |
| | | label: n.label |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid, card.supNodes, card.setting) |
| | | return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid, card.supNodes, card.setting, buttons) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | field: 'autoExec', |
| | | label: '自动执行', |
| | | initval: wrap.autoExec || '', |
| | | tooltip: '数据更新时自动执行按钮。注:此按钮执行成功后谨慎选择刷新项,避免造成循环执行。', |
| | | tooltip: subtype === 'propcard' ? '数据更新时自动执行按钮。注:此按钮执行成功后谨慎选择刷新项,避免造成循环执行。' : '初始化自动执行按钮。', |
| | | required: false, |
| | | options: buttons, |
| | | forbid: subtype !== 'propcard', |
| | | forbid: subtype !== 'propcard' && subtype !== 'datacard', |
| | | controlFields: [ |
| | | {field: 'emptyExec', notNull: true}, |
| | | ] |
| | |
| | | |
| | | getWrapForms = () => { |
| | | const { card } = this.state |
| | | |
| | | let buttons = [] |
| | | |
| | | card.action && card.action.forEach(n => { |
| | | buttons.push({ |
| | | value: n.uuid, |
| | | label: n.label |
| | | }) |
| | | }) |
| | | |
| | | card.subcards.forEach(m => { |
| | | if (m.$cardType !== 'extendCard') return |
| | | |
| | | m.elements.forEach(n => { |
| | | if (n.eleType === 'button') { |
| | | buttons.push({ |
| | | value: n.uuid, |
| | | label: n.label |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | return getWrapForm(card.wrap, card.columns, card.setting) |
| | | return getWrapForm(card.wrap, card.columns, card.setting, buttons) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, columns = [], setting) { |
| | | export default function (wrap, columns = [], setting, buttons = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let laypage = setting && setting.laypage !== 'false' |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'autoExec', |
| | | label: '自动执行', |
| | | initval: wrap.autoExec || '', |
| | | tooltip: '初始化自动执行按钮。', |
| | | required: false, |
| | | options: buttons |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'minWidth', |
| | | label: '最小宽度', |
| | |
| | | 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) || [] |
| | | let menu = window.GLOB.customMenu |
| | | |
| | | let modules = MenuUtils.getSubModules(menu.components, config.uuid, supId, menu.interfaces || null) |
| | | let anchors = MenuUtils.getAnchors(menu.components, config.uuid) || [] |
| | | |
| | | if (card.type === 'submit' && !card.Ot) { |
| | | card.Ot = config.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' |
| | |
| | | supId = '' |
| | | } |
| | | } |
| | | |
| | | let menu = window.GLOB.customMenu |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid, supId, config.subtype !== 'basetable') |
| | | let modules = MenuUtils.getSubModules(menu.components, config.uuid, supId, menu.interfaces || null) |
| | | |
| | | if (config.subtype === 'basetable') { |
| | | delete card.eleType // 区分按钮位置 |
| | |
| | | formlist: getBaseTableActionForm(card, functip, config, usefulFields, modules) |
| | | }) |
| | | } else { |
| | | let anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, config.uuid) || [] |
| | | let anchors = MenuUtils.getAnchors(menu.components, config.uuid) || [] |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | |
| | | getWrapForms = () => { |
| | | const { wrap, action, columns, cols } = this.state.card |
| | | |
| | | let _actions = [...action] |
| | | let _actions = [] |
| | | |
| | | cols.forEach(col => { |
| | | if (col.type === 'custom') { |
| | |
| | | } |
| | | }) |
| | | |
| | | return getWrapForm(wrap, _actions, columns) |
| | | return getWrapForm(wrap, _actions, columns, action) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, action = [], columns = []) { |
| | | export default function (wrap, action = [], columns = [], toolBtns = []) { |
| | | const wrapForm = [ |
| | | { |
| | | type: 'radio', |
| | |
| | | tooltip: '双击表格中行,触发的按钮。', |
| | | required: false, |
| | | allowClear: true, |
| | | options: action.map(item => ({value: item.uuid, label: item.label})), |
| | | options: [...toolBtns, ...action].map(item => ({value: item.uuid, label: item.label})), |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'autoExec', |
| | | label: '自动执行', |
| | | initval: wrap.autoExec || '', |
| | | tooltip: '初始化自动执行按钮。', |
| | | required: false, |
| | | options: toolBtns.map(item => ({value: item.uuid, label: item.label})) |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | supId = '' |
| | | } |
| | | } |
| | | |
| | | let menu = window.GLOB.customMenu |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, uuid, supId) |
| | | let modules = MenuUtils.getSubModules(menu.components, uuid, supId, menu.interfaces || null) |
| | | |
| | | this.setState({ |
| | | fields: fromJS(columns).toJS().filter(item => item.field !== setting.primaryKey), |
| | |
| | | getWrapForms = () => { |
| | | const { wrap, action, columns, cols } = this.state.card |
| | | |
| | | let _actions = [...action] |
| | | let _actions = [] |
| | | |
| | | cols.forEach(col => { |
| | | if (col.type === 'custom') { |
| | |
| | | } |
| | | }) |
| | | |
| | | return getWrapForm(wrap, _actions, columns) |
| | | return getWrapForm(wrap, _actions, columns, action) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | <PlusOutlined className="plus" title="添加列" onClick={() => this.addColumns()}/> |
| | | {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="添加搜索" onClick={this.addSearch}/> : null} |
| | | <PlusSquareOutlined className="plus" title="添加按钮" onClick={this.addButton}/> |
| | | <NormalForm title="表格设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <NormalForm title="表格设置" width={850} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="normaltable" card={card}/> |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, action = [], columns = []) { |
| | | export default function (wrap, action = [], columns = [], toolBtns) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | |
| | | tooltip: '双击表格中行,触发的按钮。', |
| | | required: false, |
| | | allowClear: true, |
| | | options: action.map(item => ({value: item.uuid, label: item.label})), |
| | | options: [...toolBtns, ...action].map(item => ({value: item.uuid, label: item.label})), |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'autoExec', |
| | | label: '自动执行', |
| | | initval: wrap.autoExec || '', |
| | | tooltip: '初始化自动执行按钮。', |
| | | required: false, |
| | | options: toolBtns.map(item => ({value: item.uuid, label: item.label})) |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'tipField', |
| | | label: '信息提示', |
| | | initval: wrap.tipField || '', |
| | |
| | | } |
| | | |
| | | this.initExec() |
| | | |
| | | this.autoExec() |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | } |
| | | |
| | | autoExec = (times) => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.wrap.autoExec) return |
| | | |
| | | let btn = document.getElementById('button' + config.wrap.autoExec) |
| | | |
| | | this.autoTimer && clearTimeout(this.autoTimer) |
| | | |
| | | if (btn) { |
| | | MKEmitter.emit('triggerBtnId', config.wrap.autoExec, []) |
| | | } else if (!times || times < 20) { |
| | | times = times ? times + 1 : 1 |
| | | this.autoTimer = setTimeout(() => { |
| | | this.autoExec(times) |
| | | }, 1000) |
| | | } |
| | | } |
| | | |
| | | transferSyncData = (syncId) => { |
| | | const { config } = this.state |
| | | |
| | |
| | | if (config.setting.onload === 'true') { |
| | | this.initExec() |
| | | } |
| | | |
| | | this.autoExec() |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | } |
| | | |
| | | autoExec = (times) => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.wrap.autoExec) return |
| | | |
| | | let btn = document.getElementById('button' + config.wrap.autoExec) |
| | | |
| | | this.autoTimer && clearTimeout(this.autoTimer) |
| | | |
| | | if (btn) { |
| | | MKEmitter.emit('triggerBtnId', config.wrap.autoExec, []) |
| | | } else if (!times || times < 20) { |
| | | times = times ? times + 1 : 1 |
| | | this.autoTimer = setTimeout(() => { |
| | | this.autoExec(times) |
| | | }, 1000) |
| | | } |
| | | } |
| | | |
| | | searchRefresh = (searchId) => { |
| | | const { config } = this.state |
| | | |
| | |
| | | |
| | | let btn = document.getElementById('button' + config.wrap.autoExec) |
| | | |
| | | clearTimeout(this.autoTimer) |
| | | this.autoTimer && clearTimeout(this.autoTimer) |
| | | |
| | | if (btn) { |
| | | MKEmitter.emit('triggerBtnId', config.wrap.autoExec, data.$$empty ? [] : [data]) |
| | |
| | | }) |
| | | } |
| | | |
| | | autoExec = (times) => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.wrap.autoExec) return |
| | | |
| | | let btn = document.getElementById('button' + config.wrap.autoExec) |
| | | |
| | | this.autoTimer && clearTimeout(this.autoTimer) |
| | | |
| | | if (btn) { |
| | | MKEmitter.emit('triggerBtnId', config.wrap.autoExec, []) |
| | | } else if (!times || times < 20) { |
| | | times = times ? times + 1 : 1 |
| | | this.autoTimer = setTimeout(() => { |
| | | this.autoExec(times) |
| | | }, 1000) |
| | | } |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | this.autoExec() |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | this.initExec() |
| | | |
| | | this.autoExec() |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | autoExec = (times) => { |
| | | const { config } = this.state |
| | | |
| | | if (!config.wrap.autoExec) return |
| | | |
| | | let btn = document.getElementById('button' + config.wrap.autoExec) |
| | | |
| | | this.autoTimer && clearTimeout(this.autoTimer) |
| | | |
| | | if (btn) { |
| | | MKEmitter.emit('triggerBtnId', config.wrap.autoExec, []) |
| | | } else if (!times || times < 20) { |
| | | times = times ? times + 1 : 1 |
| | | this.autoTimer = setTimeout(() => { |
| | | this.autoExec(times) |
| | | }, 1000) |
| | | } |
| | | } |
| | | |
| | | transferSyncData = (syncId) => { |
| | | const { config } = this.state |
| | | |
| | |
| | | return <> |
| | | <Button |
| | | type={type} |
| | | id={'button' + btn.uuid} |
| | | title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')} |
| | | loading={loading} |
| | | disabled={disabled} |
| | |
| | | * @description 获取下级模块 |
| | | * @return {String} selfId 当前组件id |
| | | */ |
| | | static getSubModules (components, selfId, supId, has) { |
| | | static getSubModules (components, selfId, supId, interfaces) { |
| | | let modules = [] |
| | | components.forEach(item => { |
| | | if (item.uuid === selfId || item.type === 'navbar') { |
| | |
| | | type: 'tab', |
| | | value: f_tab.uuid, |
| | | label: f_tab.label, |
| | | children: this.getSubModules(f_tab.components, selfId, supId, has) |
| | | children: this.getSubModules(f_tab.components, selfId, supId) |
| | | } |
| | | |
| | | if (subItem.children.length === 0) { |
| | |
| | | } |
| | | }) |
| | | |
| | | if (interfaces && interfaces.length > 0) { |
| | | interfaces.forEach(item => { |
| | | modules.push({ |
| | | value: item.uuid, |
| | | label: item.name |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | return modules |
| | | } |
| | | |