| | |
| | | uuid: btn.uuid, |
| | | MenuID: btn.uuid, |
| | | ParentId: tab.components[0].uuid, |
| | | enabled: false, |
| | | MenuName: btn.label, |
| | | tables: _config.tables || [], |
| | | Template: 'BaseTable', |
| | |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | | |
| | | btn.config.enabled = this.setEnabled(btn.config) |
| | | } else { |
| | | errors.push(tab.label + '中按钮《' + btn.label + '》配置信息丢失') |
| | | } |
| | |
| | | uuid: btn.uuid, |
| | | MenuID: btn.uuid, |
| | | ParentId: tab.components[0].uuid, |
| | | enabled: false, |
| | | MenuName: btn.label, |
| | | tables: _config.tables || [], |
| | | Template: 'BaseTable', |
| | |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | | |
| | | btn.config.enabled = this.setEnabled(btn.config) |
| | | } else { |
| | | errors.push(tab.label + '中按钮《' + btn.label + '》配置信息丢失') |
| | | } |
| | |
| | | uuid: btn.uuid, |
| | | MenuID: btn.uuid, |
| | | ParentId: item.uuid, |
| | | enabled: false, |
| | | MenuName: btn.label, |
| | | tables: _config.tables || [], |
| | | Template: 'BaseTable', |
| | |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | | |
| | | btn.config.enabled = this.setEnabled(btn.config) |
| | | } else { |
| | | errors.push('主表中按钮《' + btn.label + '》配置信息丢失') |
| | | } |
| | |
| | | uuid: btn.uuid, |
| | | MenuID: btn.uuid, |
| | | ParentId: item.uuid, |
| | | enabled: false, |
| | | MenuName: btn.label, |
| | | tables: _config.tables || [], |
| | | Template: 'BaseTable', |
| | |
| | | viewType: 'popview', |
| | | style: { backgroundColor: '#ffffff', backgroundImage: '', paddingTop: '16px', paddingBottom: '40px', paddingLeft: '16px', paddingRight: '16px' } |
| | | } |
| | | |
| | | btn.config.enabled = this.setEnabled(btn.config) |
| | | } else { |
| | | errors.push('主表中按钮《' + btn.label + '》配置信息丢失') |
| | | } |
| | |
| | | } else { |
| | | this.setPopForm(_resolve, _config, formActions, formTabs, errors) |
| | | } |
| | | } |
| | | |
| | | setEnabled = (config) => { |
| | | let enabled = true |
| | | config.components.forEach(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | if (tab.components[0].errors.length > 0) { |
| | | enabled = false |
| | | } |
| | | }) |
| | | } else { |
| | | if (item.errors.length > 0) { |
| | | enabled = false |
| | | } |
| | | } |
| | | }) |
| | | |
| | | return enabled |
| | | } |
| | | |
| | | setPopForm = (_resolve, _config, formActions, formTabs, errors) => { |
| | |
| | | }) |
| | | |
| | | tab.components[0].$tables = getTables(tab.components[0]) |
| | | |
| | | tab.components[0].errors = [] |
| | | let columns = tab.components[0].columns.map(c => c.field) |
| | | if (tab.components[0].setting.interType === 'system' && tab.components[0].setting.execute !== 'false' && !tab.components[0].setting.dataresource) { |
| | | tab.components[0].errors.push({ level: 0, detail: '未设置数据源!'}) |
| | | } else if (tab.components[0].setting.interType === 'system' && tab.components[0].setting.execute === 'false' && tab.components[0].scripts.filter(script => script.status !== 'false').length === 0) { |
| | | tab.components[0].errors.push({ level: 0, detail: '数据源中无可用脚本!'}) |
| | | } else if (!tab.components[0].setting.primaryKey) { |
| | | tab.components[0].errors.push({ level: 0, detail: '未设置主键!'}) |
| | | } else if (!columns.includes(tab.components[0].setting.primaryKey)) { |
| | | tab.components[0].errors.push({ level: 0, detail: '主键已失效!'}) |
| | | } else if (!tab.components[0].setting.supModule) { |
| | | tab.components[0].errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | }) |
| | | } else { |
| | | item.action.forEach(btn => { |
| | |
| | | }) |
| | | |
| | | item.$tables = getTables(item) |
| | | |
| | | item.errors = [] |
| | | let columns = item.columns.map(c => c.field) |
| | | if (item.setting.interType === 'system' && item.setting.execute !== 'false' && !item.setting.dataresource) { |
| | | item.errors.push({ level: 0, detail: '未设置数据源!'}) |
| | | } else if (item.setting.interType === 'system' && item.setting.execute === 'false' && item.scripts.filter(script => script.status !== 'false').length === 0) { |
| | | item.errors.push({ level: 0, detail: '数据源中无可用脚本!'}) |
| | | } else if (!item.setting.primaryKey) { |
| | | item.errors.push({ level: 0, detail: '未设置主键!'}) |
| | | } else if (!columns.includes(item.setting.primaryKey)) { |
| | | item.errors.push({ level: 0, detail: '主键已失效!'}) |
| | | } else if (!item.setting.supModule) { |
| | | item.errors.push({ level: 0, detail: '未设置上级组件!'}) |
| | | } |
| | | } |
| | | }) |
| | | |
| | |
| | | _card.wrap.doubleClick = '' |
| | | } |
| | | |
| | | _card.errors = [] |
| | | let columns = _card.columns.map(c => c.field) |
| | | 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.action.forEach(cell => { |
| | | if (cell.hidden === 'true') return |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | _card.errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | _card.errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | _card.errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } |
| | | }) |
| | | |
| | | _card.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | |
| | | col.elements.forEach(cell => { |
| | | if (cell.hidden === 'true') return |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | _card.errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | _card.errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | _card.errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | return _card |
| | | } |
| | | |