From a29d9d644a2a30e9ef4afcc6d728c20c218dc359 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 15 六月 2023 14:25:28 +0800 Subject: [PATCH] 2023-06-15 --- src/menu/components/chart/antv-dashboard/index.jsx | 36 ++++++++++++++++-------------------- 1 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/menu/components/chart/antv-dashboard/index.jsx b/src/menu/components/chart/antv-dashboard/index.jsx index 33c7c2e..f74d260 100644 --- a/src/menu/components/chart/antv-dashboard/index.jsx +++ b/src/menu/components/chart/antv-dashboard/index.jsx @@ -1,14 +1,14 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Popover } from 'antd' +import { Popover, message } from 'antd' import { ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' import { Chart, registerShape } from '@antv/g2' 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 './index.scss' const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) @@ -473,30 +473,18 @@ card.width = card.plot.width card.name = card.plot.name - card.errors = [] - - let columns = card.columns.map(c => c.field) + card.$c_ds = true + card.errors = checkComponent(card) - 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: '鏈缃笂绾х粍浠讹紒'}) - } - if (card.errors.length === 0) { card.$tables = getTables(card) } + let columns = card.columns.map(c => c.field) if (!card.plot.valueField) { card.errors.push({ level: 0, detail: '鏄剧ず鍊煎皻鏈缃紒'}) } else if (!columns.includes(card.plot.valueField)) { - card.errors.push({ level: 1, detail: '鏄剧ず鍊煎湪瀛楁闆嗕腑涓嶅瓨鍦�'}) + card.errors.push({ level: 0, detail: '鏄剧ず鍊煎湪瀛楁闆嗕腑涓嶅瓨鍦�'}) } this.setState({ @@ -550,10 +538,18 @@ <ToolOutlined/> </Popover> <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/> - <div className="canvas" id={card.uuid + 'dashboard'}></div> + <div className="canvas" style={{minHeight: card.plot.height}} id={card.uuid + 'dashboard'}></div> <div className="component-name"> <div className="center"> - <div className="title">{card.name}</div> + <div className="title" onDoubleClick={() => { + let oInput = document.createElement('input') + oInput.value = 'anchor' + card.uuid + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + message.success('澶嶅埗鎴愬姛銆�') + }}>{card.name}</div> <div className="content"> {card.errors && card.errors.map((err, index) => { if (err.level === 0) { -- Gitblit v1.8.0