| | |
| | | card.width = card.wrap.width |
| | | card.name = card.wrap.name |
| | | card.errors = [] |
| | | let idCtrl = false |
| | | |
| | | card.$c_fc = true |
| | | if (card.wrap.datatype === 'dynamic') { |
| | | let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : '' |
| | | if (supModule === 'empty') { |
| | | supModule = '' |
| | | } |
| | | |
| | | card.$c_ds = true |
| | | card.errors = checkComponent(card) |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach(item => { |
| | | if (item.subButton.intertype === 'system' && !item.subButton.sqlType) { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`}) |
| | | } |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | item.fields.forEach(m => { |
| | | if (m.dataSource && /@ID@/ig.test(m.dataSource)) { |
| | | idCtrl = true |
| | | } |
| | | if (m.type === 'linkMain' && !supModule) { |
| | | card.errors.push({ level: 1, detail: `请检查关联主表“${m.label}”是否有效`}) |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | let supModule = '' |
| | | if (card.wrap.datatype === 'static') { |
| | | supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : '' |
| | | } |
| | | |
| | | card.$tables = getTables(card) |
| | | |
| | | card.subcards.forEach(item => { |
| | | if (item.subButton.intertype === 'system' && !item.subButton.sqlType) { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`}) |
| | | } |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | card.errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | item.fields.forEach(m => { |
| | | if (m.dataSource && /@ID@/ig.test(m.dataSource)) { |
| | | idCtrl = true |
| | | } |
| | | if (m.type === 'linkMain' && !supModule && card.wrap.datatype === 'static') { |
| | | card.errors.push({ level: 1, detail: `请检查关联主表“${m.label}”是否有效`}) |
| | | } |
| | | }) |
| | | }) |
| | | delete card.$c_ds |
| | | } |
| | | |
| | | card.idCtrl = idCtrl |
| | | card.errors = checkComponent(card) |
| | | card.$tables = getTables(card) |
| | | |
| | | delete card.$c_ds |
| | | delete card.$c_fc |
| | | |
| | | this.setState({ |
| | | card: card |