From d1cd5af5adb53e91efdd278328e1b6f8ad834fb5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 06 二月 2025 21:11:56 +0800
Subject: [PATCH] Merge branch 'positec' into dms

---
 src/menu/components/chart/antv-scatter/index.jsx |   62 +++++++------------------------
 1 files changed, 14 insertions(+), 48 deletions(-)

diff --git a/src/menu/components/chart/antv-scatter/index.jsx b/src/menu/components/chart/antv-scatter/index.jsx
index 7061641..41bf3bd 100644
--- a/src/menu/components/chart/antv-scatter/index.jsx
+++ b/src/menu/components/chart/antv-scatter/index.jsx
@@ -8,7 +8,7 @@
 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'
 
@@ -18,7 +18,6 @@
 const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
 const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
 const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent'))
-const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
 const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
 
 class antvScatterChart extends Component {
@@ -71,28 +70,6 @@
         search: [],
         action: [],
         plot: _plot,
-      }
-
-      if (card.config) {
-        let config = fromJS(card.config).toJS()
-
-        _card.plot = config.plot
-        _card.plot.name = card.name
-        _card.style = config.style
-        _card.headerStyle = config.headerStyle
-
-        _card.setting = config.setting
-        _card.columns = config.columns
-        _card.scripts = config.scripts
-
-        _card.action = config.action.map(col => {
-          col.uuid = Utils.getuuid()
-          return col
-        })
-        _card.search = config.search.map(col => {
-          col.uuid = Utils.getuuid()
-          return col
-        })
       }
 
       this.updateComponent(_card, true)
@@ -253,22 +230,12 @@
 
     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)
     }
@@ -276,11 +243,11 @@
     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杞村湪瀛楁闆嗕腑涓嶅瓨鍦�'})
       }
     }
 
@@ -311,12 +278,12 @@
 
   plusSearch = (uuid, search, type) => {
     const { card } = this.state
-    if (card.uuid !== uuid || type !== 'simple') return
+    if (card.uuid !== uuid || (type !== 'simple' && type !== 'replace')) return
 
     search.uuid = Utils.getuuid()
     search.focus = true
 
-    MKEmitter.emit('addSearch', card.uuid, search)
+    MKEmitter.emit('addSearch', card.uuid, search, type === 'replace' ? 'replace' : '')
   }
 
   addButton = () => {
@@ -383,11 +350,10 @@
             {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> : null}
             {appType !== 'mob' ? <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton}/> : null}
             <ChartCompileForm config={card} plotchange={this.updateComponent}/>
-            <CopyComponent type="line" card={card}/>
+            <CopyComponent type="scatter" card={card}/>
             <PasteComponent config={card} options={['action', 'search']} updateConfig={this.updateComponent}/>
             <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/>
             <ClockComponent config={card} updateConfig={this.updateComponent}/>
-            <UserComponent config={card}/>
             <DeleteOutlined className="close" title="delete" onClick={() => this.props.deletecomponent(card.uuid)}/>
             <SettingComponent config={card} updateConfig={this.updateComponent}/>
           </div>
@@ -395,7 +361,7 @@
           <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">

--
Gitblit v1.8.0