| | |
| | | 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 + '》配置信息丢失') |
| | | } |
| | | } |
| | | }) |
| | | tab.components[0].cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.eleType !== 'button') return |
| | | if (btn.OpenType === 'popview') { |
| | | if (menus[btn.uuid]) { |
| | | let mainTb = {name: '主表', uuid: Utils.getuuid(), useMSearch: 'false'} |
| | |
| | | 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 + '》配置信息丢失') |
| | | } |
| | | } |
| | | }) |
| | | item.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.eleType !== 'button') return |
| | | if (btn.OpenType === 'popview') { |
| | | if (menus[btn.uuid]) { |
| | | let mainTb = {name: '主表', uuid: Utils.getuuid(), useMSearch: 'false'} |
| | |
| | | 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].cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.eleType !== 'button') return |
| | | if (btn.OpenType === 'popview' && btn.config && btn.config.components[0]) { |
| | | this.setTbForm(btn.config.components[0], menus, errors, tab.components[0].name + '-' + btn.label) |
| | | } else if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.funcType === 'print' && btn.execMode === 'pop')) { |
| | |
| | | } |
| | | }) |
| | | item.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.eleType !== 'button') return |
| | | if (btn.OpenType === 'popview' && btn.config && btn.config.components[0]) { |
| | | this.setTbForm(btn.config.components[0], menus, errors, item.name + '-' + btn.label) |
| | | } else if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.funcType === 'print' && btn.execMode === 'pop')) { |
| | |
| | | } |
| | | }) |
| | | item.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.eleType !== 'button') return |
| | | if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.funcType === 'print' && btn.execMode === 'pop')) { |
| | | if (menus[btn.uuid]) { |
| | | btn.modal = { |
| | |
| | | } |
| | | }) |
| | | tab.components[0].cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.eleType !== 'button') return |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.$tables = getTables(btn.config.components[0]) |
| | | } |
| | |
| | | }) |
| | | |
| | | 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.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.eleType !== 'button') return |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.$tables = getTables(btn.config.components[0]) |
| | | } |
| | |
| | | }) |
| | | |
| | | 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: '未设置上级组件!'}) |
| | | } |
| | | } |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | let colbtns = [] |
| | | let colors = { primary: '#1890ff', yellow: '#c49f47', orange: 'orange', danger: '#ff4d4f', green: '#26C281', dgreen: '#32c5d2', purple: '#8E44AD', cyan: '#13c2c2', gray: '#666666', default: 'rgba(0, 0, 0, 0.65)' } |
| | | let colors = { primary: '#1890ff', yellow: '#c49f47', orange: 'orange', danger: '#ff4d4f', green: '#26C281', dgreen: '#32c5d2', purple: '#8E44AD', cyan: '#13c2c2', gray: '#E7E7EF', default: 'rgba(0, 0, 0, 0.65)' } |
| | | |
| | | let uuids = {} |
| | | config.action.forEach(btn => { |
| | |
| | | } else if (btn.class.indexOf('border') > -1) { |
| | | _btn.style = {color: color, backgroundColor: '#fff', borderColor: color, marginRight: '15px'} |
| | | } else { |
| | | _btn.style = {color: '#fff', backgroundColor: color, borderColor: color, marginRight: '15px'} |
| | | _btn.style = {color: btn.class === 'gray' ? 'rgba(0, 0, 0, 0.65)' : '#fff', backgroundColor: color, borderColor: color, marginRight: '15px'} |
| | | } |
| | | _card.action.push(_btn) |
| | | } |
| | |
| | | marks: [], |
| | | isSub: false, |
| | | uuid: Utils.getuuid(), |
| | | type: 'action', |
| | | type: 'custom', |
| | | Width: 120, |
| | | elements: colbtns, |
| | | style: {paddingTop: '12px', paddingLeft: '8px', paddingBottom: '12px', paddingRight: '8px'} |
| | |
| | | _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 !== 'custom') return |
| | | |
| | | col.elements.forEach(cell => { |
| | | if (cell.hidden === 'true' || cell.eleType !== 'button') 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 |
| | | } |
| | | |