| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | | import { resetStyle, getTables, getHeight } from '@/utils/utils-custom.js' |
| | | import { resetStyle, getTables, getHeight, checkComponent } from '@/utils/utils-custom.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | |
| | | |
| | | card.width = card.plot.width |
| | | card.name = card.plot.name |
| | | 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.$c_ds = true |
| | | card.$c_ac = this.state.appType !== 'mob' |
| | | |
| | | card.errors = checkComponent(card) |
| | | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | |
| | | if (!card.plot.Xaxis) { |
| | | card.errors.push({ level: 0, detail: '坐标轴尚未设置!'}) |
| | | } else { |
| | | let columns = card.columns.map(c => c.field) |
| | | if (!columns.includes(card.plot.Xaxis)) { |
| | | card.errors.push({ level: 1, detail: 'X轴在字段集中不存在'}) |
| | | } |
| | | if (!columns.includes(card.plot.Yaxis)) { |
| | | card.errors.push({ level: 1, detail: 'Y轴在字段集中不存在'}) |
| | | card.errors.push({ level: 0, detail: 'X轴在字段集中不存在'}) |
| | | } else if (!columns.includes(card.plot.Yaxis)) { |
| | | card.errors.push({ level: 0, detail: 'Y轴在字段集中不存在'}) |
| | | } |
| | | } |
| | | |
| | |
| | | <ToolOutlined/> |
| | | </Popover> |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <div className="canvas" id={card.uuid + 'canvas'}></div> |
| | | <div className="canvas" style={{minHeight: card.plot.height}} id={card.uuid + 'canvas'}></div> |
| | | {appType !== 'mob' ? <ActionComponent config={card} updateaction={this.updateComponent}/> : null} |
| | | <div className="component-name"> |
| | | <div className="center"> |