| | |
| | | { |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mk", |
| | | "defaultApp": "mkindustry", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "debugger": false, |
| | |
| | | "probation": "", |
| | | "keepPassword": "true", |
| | | "platforms": ["H5", "wechat", "android", "ios"], |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "MKWMS/" |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | } |
| | |
| | | type: 'cascader', |
| | | field: 'supModule', |
| | | label: '上级组件', |
| | | initval: wrap.supModule || '', |
| | | initval: wrap.supModule || [], |
| | | // tooltip: '当上级组件不存在或没有权限时,当前组件不显示。', |
| | | required: true, |
| | | options: supmodules |
| | |
| | | updateWrap = (res) => { |
| | | let _card = {...this.state.card, wrap: res} |
| | | |
| | | if (res.supModule && res.supModule.length > 0) { |
| | | _card.setting.supModule = res.supModule |
| | | if (res.datatype === 'static') { |
| | | if (res.supModule && res.supModule.length > 0) { |
| | | _card.setting.supModule = res.supModule |
| | | } else { |
| | | _card.setting.supModule = '' |
| | | } |
| | | } |
| | | if (res.layout === 'flex') { |
| | | _card.wrap.pagestyle = 'page' |
| | |
| | | import './index.scss' |
| | | |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | |
| | | const Card = ({ id, card, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => { |
| | | const originalIndex = findCard(id).index |
| | |
| | | <NormalForm title="分组编辑" width={850} update={updateSetting} getForms={getForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="formgroup" card={card}/> |
| | | <CloseOutlined className="close" type="close" onClick={close} /> |
| | | </div> |
| | | } trigger="hover"> |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : '' |
| | | if (supModule === 'empty') { |
| | | supModule = '' |
| | | } |
| | | let columns = card.columns.map(c => c.field) |
| | | let lowcols = card.columns.map(c => c.field.toLowerCase()) |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | | card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中关联主表表单“${m.label}”无效`}) |
| | | } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) { |
| | | card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中表单“${m.label}”大小写与字段集不一致`}) |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : '' |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | | card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中关联主表表单“${m.label}”无效`}) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | pasteForm = (res) => { |
| | | if (res.subButton) { |
| | | let card = fromJS(this.state.card).toJS() |
| | | |
| | | res.uuid = Utils.getuuid() |
| | | res.sort = card.subcards.length + 1 |
| | | |
| | | res.fields.forEach(item => { |
| | | item.uuid = Utils.getuuid() |
| | | }) |
| | | |
| | | if (!res.prevButton) { |
| | | res.prevButton = {label: '上一步', type: 'prev', enable: 'false', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}} |
| | | } |
| | | if (!res.nextButton) { |
| | | res.nextButton = {label: '跳过', type: 'next', enable: 'false', style: {paddingTop: '5px', paddingBottom: '5px'}} |
| | | } |
| | | |
| | | card.subcards.push(res) |
| | | |
| | | this.setState({ |
| | | group: res |
| | | }) |
| | | this.updateComponent(card) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let _config = fromJS(this.state.group).toJS() |
| | | let fieldrepet = false // 字段重复 |
| | | |
| | |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | let _card = {...this.state.card, wrap: res} |
| | | |
| | | if (res.datatype === 'static') { |
| | | if (res.supModule && res.supModule.length > 0) { |
| | | _card.setting.supModule = res.supModule |
| | | } else { |
| | | _card.setting.supModule = '' |
| | | } |
| | | } |
| | | |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="stepform" card={card}/> |
| | | <PasteComponent config={card} options={['form']} updateConfig={this.pasteForm} /> |
| | | <PasteComponent config={card} options={['form', 'formgroup']} updateConfig={this.pasteForm} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | | <UserComponent config={card}/> |
| | | <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | |
| | | import { fromJS } from 'immutable' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | let modules = [] |
| | | let menu = fromJS(window.GLOB.customMenu).toJS() |
| | | modules = MenuUtils.getSupModules(menu.components, config.uuid) || [] |
| | | |
| | | const wrapForm = [ |
| | | { |
| | |
| | | options: [ |
| | | {value: 'dynamic', label: '动态'}, |
| | | {value: 'static', label: '静态'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'supModule', values: ['static']}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | forbid: !appType |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | field: 'supModule', |
| | | label: '上级组件', |
| | | initval: wrap.supModule || [], |
| | | required: false, |
| | | options: modules, |
| | | allowClear: true |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | |
| | | let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : '' |
| | | if (supModule === 'empty') { |
| | | supModule = '' |
| | | } |
| | | let columns = card.columns.map(c => c.field) |
| | | let lowcols = card.columns.map(c => c.field.toLowerCase()) |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | | card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中关联主表表单“${m.label}”无效`}) |
| | | } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) { |
| | | card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中表单“${m.label}”大小写与字段集不一致`}) |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : '' |
| | | |
| | | card.subcards.forEach(item => { |
| | | item.fields.forEach(m => { |
| | | if (m.type === 'linkMain' && !supModule) { |
| | | card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中关联主表表单“${m.label}”无效`}) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | pasteForm = (res) => { |
| | | if (res.subButton) { |
| | | let card = fromJS(this.state.card).toJS() |
| | | |
| | | res.uuid = Utils.getuuid() |
| | | res.sort = card.subcards.length + 1 |
| | | |
| | | res.fields.forEach(item => { |
| | | item.uuid = Utils.getuuid() |
| | | }) |
| | | |
| | | delete res.prevButton |
| | | delete res.nextButton |
| | | |
| | | card.subcards.push(res) |
| | | |
| | | this.setState({ |
| | | group: res |
| | | }) |
| | | this.updateComponent(card) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '粘贴成功!', |
| | | duration: 2 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let _config = fromJS(this.state.group).toJS() |
| | | let fieldrepet = false // 字段重复 |
| | | |
| | |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | let _card = {...this.state.card, wrap: res} |
| | | |
| | | if (res.datatype === 'static') { |
| | | if (res.supModule && res.supModule.length > 0) { |
| | | _card.setting.supModule = res.supModule |
| | | } else { |
| | | _card.setting.supModule = '' |
| | | } |
| | | } |
| | | |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | | clearGroup = () => { |
| | |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="tabform" card={card}/> |
| | | <PasteComponent config={card} options={['form']} updateConfig={this.pasteForm} /> |
| | | <PasteComponent config={card} options={['form', 'formgroup']} updateConfig={this.pasteForm} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | | <UserComponent config={card}/> |
| | | <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | BID: '', // 上级ID |
| | | config: null, // 图表配置信息 |
| | | loading: false, // 数据加载状态 |
| | | sync: false, // 是否统一请求数据 |
| | | data: null, // 数据 |
| | | BID: '', |
| | | config: null, |
| | | loading: false, |
| | | sync: false, |
| | | data: null, |
| | | group: null, |
| | | BData: '', |
| | | step: 0 |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, BID } = this.props |
| | | const { data, BID, BData } = this.props |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = null |
| | |
| | | group: _group, |
| | | step: _group.sort - 1, |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | config: config, |
| | | arr_field: config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | } |
| | | |
| | | if (config.wrap.statusControl && _data[config.wrap.statusControl]) { |
| | | let _status = _data[config.wrap.statusControl] |
| | | let _groups = config.subcards.filter(item => item.setting.status === _status)[0] |
| | |
| | | this.execSuccess(btn, id) |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id) => { |
| | | resetParentParam = (MenuID, id, data) => { |
| | | const { config } = this.state |
| | | |
| | | if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | | if (config.wrap.datatype === 'static' || (config.setting.supModule && !id)) { |
| | | this.setState({ |
| | | data: null, |
| | | BID: id, |
| | | BData: data |
| | | }, () => { |
| | | this.setState({ |
| | | data: {$$empty: true} |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setState({ BID: id, BData: data }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, BID, data, group, dict, step } = this.state |
| | | const { config, loading, BID, BData, data, group, dict, step } = this.state |
| | | |
| | | return ( |
| | | <div className="custom-normal-form-box" id={'anchor' + config.uuid} style={{...config.style}}> |
| | |
| | | </div> : null} |
| | | {group && data ? <MutilForm |
| | | BID={BID} |
| | | BData={BData} |
| | | dict={dict} |
| | | data={data} |
| | | action={group} |
| | |
| | | config: null, // 图表配置信息 |
| | | loading: false, // 数据加载状态 |
| | | sync: false, // 是否统一请求数据 |
| | | data: null, // 数据 |
| | | data: null, |
| | | BData: '', |
| | | group: null, |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { data, BID } = this.props |
| | | const { data, BID, BData } = this.props |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let _data = null |
| | |
| | | data: _data, |
| | | group: config.subcards[0], |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | config: config, |
| | | arr_field: config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | |
| | | this.execSuccess(btn, id) |
| | | } |
| | | |
| | | resetParentParam = (MenuID, id) => { |
| | | resetParentParam = (MenuID, id, data) => { |
| | | const { config } = this.state |
| | | if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | if (!config.setting.supModule || config.setting.supModule !== MenuID) return |
| | | |
| | | if (id !== this.state.BID || id !== '') { |
| | | this.setState({ BID: id }, () => { |
| | | this.loadData() |
| | | }) |
| | | if (config.wrap.datatype === 'static' || (config.setting.supModule && !id)) { |
| | | this.setState({ |
| | | data: null, |
| | | BID: id, |
| | | BData: data |
| | | }, () => { |
| | | this.setState({ |
| | | data: {$$empty: true} |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setState({ BID: id, BData: data }, () => { |
| | | this.loadData() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, BID, data, group, dict } = this.state |
| | | const { config, loading, BID, BData, data, group, dict } = this.state |
| | | |
| | | return ( |
| | | <div className="custom-tab-form-box" id={'anchor' + config.uuid} style={{...config.style}}> |
| | |
| | | </div> : null} |
| | | {group && data ? <MutilForm |
| | | BID={BID} |
| | | BData={BData} |
| | | dict={dict} |
| | | data={data} |
| | | action={group} |
| | |
| | | } else if (item.type === 'form' && item.subtype === 'stepform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <NormalForm config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | <NormalForm config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'form' && item.subtype === 'tabform') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <TabForm config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} /> |
| | | <TabForm config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'tree') { |
| | |
| | | balMap.set(item.wrap.syncModuleId, true) |
| | | } else if (item.wrap.linkType === 'sup') { |
| | | item.wrap.supModule = item.wrap.supModule.pop() |
| | | item.setting.supModule = item.wrap.supModule |
| | | } |
| | | item.elements = item.elements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | |
| | | triggerPrint = (data, formlist = []) => { |
| | | const { btn } = this.props |
| | | let formdata = {} |
| | | let baseCount = 1 |
| | | let baseType = '' |
| | | let baseTemp = btn.verify.Template || '' |
| | | |
| | | formlist.forEach(_data => { |
| | | formdata[_data.key] = _data.value |
| | | |
| | | if (!_data.value) return |
| | | |
| | | if (_data.key.toLowerCase() === 'printcount') { |
| | | baseCount = +_data.value |
| | | } else if (_data.key.toLowerCase() === 'printtype') { |
| | | baseType = _data.value |
| | | } else if (_data.key.toLowerCase() === 'templateid') { |
| | | baseTemp = _data.value |
| | | } |
| | | }) |
| | | |
| | | let printlist = [] |
| | | let templates = [] |
| | | let printCount = +(formdata.printCount || formdata.PrintCount || formdata.printcount || formdata.Printcount || 1) |
| | | |
| | | if (isNaN(printCount) || printCount < 1) { |
| | | printCount = 1 |
| | | if (isNaN(baseCount) || baseCount < 1) { |
| | | baseCount = 1 |
| | | } |
| | | |
| | | new Promise(resolve => { |
| | | if (btn.intertype === 'system') { // 使用系统时,直接从表格或表单中选取数据 |
| | | let printcell = {} |
| | | |
| | | printcell.printType = formdata.printType || formdata.PrintType || formdata.printtype || formdata.Printtype || '' |
| | | printcell.printCount = printCount |
| | | printcell.templateID = btn.verify.Template || '' |
| | | |
| | | if (btn.Ot === 'notRequired') { |
| | | let printcell = {} |
| | | |
| | | printcell.printType = baseType |
| | | printcell.printCount = baseCount |
| | | printcell.templateID = baseTemp |
| | | printcell.data = [formdata] |
| | | |
| | | templates.push(printcell.templateID) |
| | | |
| | | printlist.push(printcell) |
| | | } else { |
| | | printcell.data = data.map(cell => { |
| | | return {...cell, ...formdata} |
| | | data.forEach(cell => { |
| | | let _cell = {...cell, ...formdata} |
| | | |
| | | let printcell = {data: [_cell]} |
| | | |
| | | printcell.templateID = baseTemp |
| | | printcell.printType = baseType |
| | | printcell.printCount = 0 |
| | | |
| | | Object.keys(_cell).forEach(key => { |
| | | if (!_cell[key]) return |
| | | |
| | | let _key = key.toLowerCase() |
| | | |
| | | if (_key === 'templateid') { |
| | | printcell.templateID = _cell[key] |
| | | } else if (_key === 'printtype') { |
| | | printcell.printType = _cell[key] |
| | | } else if (_key === 'printcount') { |
| | | printcell.printCount = +_cell[key] |
| | | } |
| | | }) |
| | | |
| | | if (isNaN(printcell.printCount) || printcell.printCount < 1) { |
| | | printcell.printCount = baseCount |
| | | } |
| | | |
| | | templates.push(printcell.templateID) |
| | | |
| | | printlist.push(printcell) |
| | | }) |
| | | } |
| | | |
| | | templates.push(printcell.templateID) |
| | | |
| | | printlist.push(printcell) |
| | | |
| | | resolve(true) |
| | | } else { |
| | |
| | | // 系统打印数据,校验data字段 |
| | | if (btn.verify.printMode !== 'custom' && (!cell.data || cell.data.length === 0)) return |
| | | |
| | | cell.templateID = cell.templateID || cell.TemplateID || cell.Templateid || cell.templateid || btn.verify.Template |
| | | cell.printType = cell.printType || cell.PrintType || cell.printtype || cell.Printtype || formdata.printType || formdata.PrintType || formdata.printtype || formdata.Printtype || '' |
| | | cell.templateID = baseTemp |
| | | cell.printType = baseType |
| | | cell.printCount = 0 |
| | | |
| | | let _printCount = +(cell.printCount || cell.PrintCount || cell.printcount || cell.Printcount || 0) |
| | | Object.keys(cell).forEach(key => { |
| | | if (!cell[key]) return |
| | | |
| | | if (isNaN(_printCount) || _printCount < 1) { |
| | | _printCount = printCount |
| | | let _key = key.toLowerCase() |
| | | |
| | | if (_key === 'templateid') { |
| | | cell.templateID = cell[key] |
| | | } else if (_key === 'printtype') { |
| | | cell.printType = cell[key] |
| | | } else if (_key === 'printcount') { |
| | | cell.printCount = +cell[key] |
| | | } |
| | | }) |
| | | |
| | | if (isNaN(cell.printCount) || cell.printCount < 1) { |
| | | cell.printCount = baseCount |
| | | } |
| | | |
| | | cell.printCount = _printCount |
| | | |
| | | templates.push(cell.templateID) |
| | | |
| | |
| | | <Col span={24} className="print-tip"> |
| | | <Form.Item label={'提示'}> |
| | | 如果此按钮涉及多种数据类型的打印,需要设置不同的打印机时,请添加打印类型控制信息,用户在自定义设置中,可根据打印类型设置对应的打印机。 |
| | | 打印时,数据的打印类型取决于返回值(内部或外部接口)中的 printType 字段。 |
| | | 注:返回值中的 printCount、templateID 字段,可分别控制打印数量和打印模板。 |
| | | 打印时,打印类型取决于数据中的 printType 字段。 |
| | | 注:数据中的 printCount、templateID 字段,可分别控制打印数量和打印模板。 |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |