From 2e3bf38aced62c8ecf4af58ca2685f09d3d47dde Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 17 二月 2023 00:09:04 +0800
Subject: [PATCH] 2023-02-17

---
 src/menu/datasource/verifycard/index.jsx |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index 0bf8108..3df5979 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -759,16 +759,7 @@
 
   copyDatasource = () => {
     const { config } = this.props
-    const { columns, scripts } = this.state
-
-    if (columns.length === 0) {
-      notification.warning({
-        top: 92,
-        message: '璇锋坊鍔犲瓧娈甸泦!',
-        duration: 5
-      })
-      return
-    }
+    const { columns, subColumns, scripts } = this.state
 
     this.settingForm.handleConfirm().then(res => {
       delete res.supModule
@@ -777,7 +768,7 @@
       let source = {
         key: 'interface',
         type: 'line',
-        data: {setting: res, columns, scripts, pageable: false, format: 'array', name: res.name, status: 'false', type: 'interface', uuid: '' }
+        data: {setting: res, columns, subColumns, scripts, pageable: false, format: 'array', name: res.name, status: 'false', type: 'interface', uuid: '' }
       }
 
       try {
@@ -825,6 +816,15 @@
       }
 
       if (config.subtype !== 'basetable') {
+        let subColumns = []
+
+        if (config.subtype === 'dualdatacard' && res.data.subColumns) {
+          subColumns = res.data.subColumns.map(col => {
+            col.uuid = Utils.getuuid()
+            return col
+          })
+        }
+
         this.setState({
           scripts: res.data.scripts.map(col => {
             col.uuid = Utils.getuuid()
@@ -834,6 +834,7 @@
             col.uuid = Utils.getuuid()
             return col
           }),
+          subColumns: subColumns,
           setting: res.data.setting,
           median: res.data.setting,
           reload: true,
@@ -926,6 +927,7 @@
             {!reload ? <SettingForm
               config={config}
               columns={columns}
+              subColumns={subColumns}
               setting={setting}
               scripts={scripts}
               updateStatus={(res) => this.setState({median: {...res}})}

--
Gitblit v1.8.0