| | |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle, getTables } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables, checkComponent } from '@/utils/utils-custom.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import getWrapForm from '../data-card/options' |
| | |
| | | return |
| | | } |
| | | |
| | | card.errors = [] |
| | | |
| | | // 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()) |
| | | |
| | | if (card.subcards.length === 0) { |
| | | card.errors.push({ level: 0, detail: '卡片不可为空!'}) |
| | | } |
| | | |
| | | if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) { |
| | | card.errors.push({ level: 0, detail: '未设置数据源!'}) |
| | | } else if (card.setting.interType === 'system' && card.setting.execute === 'false' && card.scripts.filter(script => script.status !== 'false').length === 0) { |
| | | card.errors.push({ level: 0, detail: '数据源中无可用脚本!'}) |
| | | } else if (!card.setting.primaryKey) { |
| | | card.errors.push({ level: 0, detail: '未设置主键!'}) |
| | | } else if (!columns.includes(card.setting.primaryKey)) { |
| | | card.errors.push({ level: 0, detail: '主键已失效!'}) |
| | | } else if (!card.setting.supModule) { |
| | | card.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | card.$c_ds = true |
| | | card.$c_ac = false |
| | | card.$c_sc = true |
| | | |
| | | card.errors = checkComponent(card) |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | card.subcards.forEach((item, i) => { |
| | | let linkbtn = item.setting.linkbtn || '' |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType === 'button') { |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | card.errors.push({ level: 1, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } |
| | | if (linkbtn && linkbtn === cell.uuid) { |
| | | linkbtn = '' |
| | | } |
| | | } else if (cell.datatype === 'dynamic' && cell.field && !columns.includes(cell.field)) { |
| | | card.errors.push({ level: 1, detail: `卡片中动态字段“${cell.field}”无效`}) |
| | | } |
| | | }) |
| | | |
| | | if (linkbtn) { |
| | | card.errors.push({ level: 1, detail: `第${i + 1}张卡片中绑定按钮已删除`}) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | card: card |
| | |
| | | res.setting = res.setting || {} |
| | | res.setting.width = res.setting.width || 6 |
| | | |
| | | let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'] |
| | | let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton', 'form'] |
| | | |
| | | let elements = [] |
| | | res.elements && res.elements.forEach(cell => { |
| | |
| | | <div className="center"> |
| | | <div className="title" onDoubleClick={() => { |
| | | let oInput = document.createElement('input') |
| | | oInput.value = card.uuid |
| | | oInput.value = 'anchor' + card.uuid |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |