From b3547d1c531e479021219fda5df153a11b9b52a3 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 31 八月 2020 17:28:09 +0800
Subject: [PATCH] 2020-08-31

---
 src/templates/sharecomponent/columncomponent/index.jsx |  106 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 97 insertions(+), 9 deletions(-)

diff --git a/src/templates/sharecomponent/columncomponent/index.jsx b/src/templates/sharecomponent/columncomponent/index.jsx
index 6b80c0a..30538c5 100644
--- a/src/templates/sharecomponent/columncomponent/index.jsx
+++ b/src/templates/sharecomponent/columncomponent/index.jsx
@@ -103,7 +103,7 @@
         let _param = {
           func: 'sPC_Get_FunMenu',
           ParentID: card.linkmenu[0],
-          systemType: options.systemType,
+          systemType: options.sysType,
           debug: 'Y'
         }
 
@@ -193,8 +193,8 @@
    */
   editModalCancel = () => {
     const { card } = this.state
-
-    if (card.focus) {
+    
+    if (card && card.focus) {
       let _columnlist = fromJS(this.state.columnlist).toJS()
 
       _columnlist = _columnlist.filter(item => item.uuid !== card.uuid)
@@ -270,12 +270,57 @@
             if (column.marks && column.marks.filter(mark => mark.field === card.field || mark.contrastField === card.field).length > 0) {
               refers.push(column.label)
             }
+            if (column.type === 'colspan') {
+              let _length = column.sublist.length
+              column.sublist = column.sublist.filter(cell => cell !== card.uuid)
+
+              if (column.sublist.length < _length) {
+                let subfield = []  // 鍚堝苟鍒楀瓧娈�
+                _columnlist.forEach(col => {
+                  if (col.field && column.sublist.includes(col.uuid)) {
+                    subfield.push(col.field)
+                  }
+                })
+                column.subfield = subfield.join(', ')
+              }
+            }
           })
 
           if (refers.length > 0) {
             notification.warning({
               top: 92,
-              message: '鏄剧ず鍒椼��' + refers.join('銆�') + '銆嬫爣璁颁腑鍚湁璇ュ瓧娈碉紝姝ゆ淇敼浼氬鑷存爣璁板け鏁堬紝璇蜂慨鏀广��' + refers.join('銆�') + '銆嬫爣璁拌缃紒',
+              message: '鏄剧ず鍒椼��' + refers.join('銆�') + '銆嬫爣璁颁腑鍚湁璇ュ瓧娈碉紝姝ゆ淇敼浼氬鑷存爣璁板け鏁堬紝璇蜂慨鏀圭浉搴旂殑鏍囪璁剧疆锛�',
+              duration: 5
+            })
+          }
+
+          let chartRefers = []
+          config.charts && config.charts.forEach((chart, index) => {
+            if (chart.chartType === 'card') {
+              if (chart.avatar && chart.avatar.field === card.field) {
+                chartRefers.push(chart.title || (index + 1))
+              } else if (chart.header && chart.header.datatype === 'dynamic' && chart.header.field === card.field) {
+                chartRefers.push(chart.title || (index + 1))
+              } else if (chart.details && chart.details.length > 0 && chart.details.filter(item => item.datatype === 'dynamic' && item.field === card.field).length > 0) {
+                chartRefers.push(chart.title || (index + 1))
+              }
+            } else if (['bar', 'line', 'pie'].includes(chart.chartType)) {
+              if (chart.Xaxis === card.field) {
+                chartRefers.push(chart.title || (index + 1))
+              } else if (Array.isArray(chart.Yaxis)) {
+                if (chart.Yaxis.includes(card.field)) {
+                  chartRefers.push(chart.title || (index + 1))
+                }
+              } else if (chart.Yaxis === card.field) {
+                chartRefers.push(chart.title || (index + 1))
+              }
+            }
+          })
+
+          if (chartRefers.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '鍥捐〃銆�' + chartRefers.join('銆�') + '銆嬩腑鍚湁璇ュ瓧娈碉紝姝ゆ淇敼浼氬鑷村浘琛ㄦ樉绀哄紓甯革紝璇蜂慨鏀圭浉搴旂殑鍥捐〃璁剧疆锛�',
               duration: 5
             })
           }
@@ -310,8 +355,6 @@
 
     confirm({
       content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋,
-      okText: dict['model.confirm'],
-      cancelText: this.state.dict['header.cancel'],
       onOk() {
         let _columnlist = fromJS(_this.state.columnlist).toJS()
 
@@ -323,12 +366,57 @@
             if (column.marks && column.marks.filter(mark => mark.field === card.field || mark.contrastField === card.field).length > 0) {
               refers.push(column.label)
             }
+            if (column.type === 'colspan') {
+              let _length = column.sublist.length
+              column.sublist = column.sublist.filter(cell => cell !== card.uuid)
+
+              if (column.sublist.length < _length) {
+                let subfield = []  // 鍚堝苟鍒楀瓧娈�
+                _columnlist.forEach(col => {
+                  if (col.field && column.sublist.includes(col.uuid)) {
+                    subfield.push(col.field)
+                  }
+                })
+                column.subfield = subfield.join(', ')
+              }
+            }
           })
 
           if (refers.length > 0) {
             notification.warning({
               top: 92,
-              message: '鏄剧ず鍒椼��' + refers.join('銆�') + '銆嬫爣璁颁腑鍚湁璇ュ瓧娈碉紝鍒犻櫎浼氬鑷存爣璁板け鏁堬紝璇蜂慨鏀广��' + refers.join('銆�') + '銆嬫爣璁拌缃紒',
+              message: '鏄剧ず鍒椼��' + refers.join('銆�') + '銆嬫爣璁颁腑鍚湁璇ュ瓧娈碉紝鍒犻櫎浼氬鑷存爣璁板け鏁堬紝璇蜂慨鏀圭浉搴旂殑鏍囪璁剧疆锛�',
+              duration: 5
+            })
+          }
+
+          let chartRefers = []
+          config.charts && config.charts.forEach((chart, index) => {
+            if (chart.chartType === 'card') {
+              if (chart.avatar && chart.avatar.field === card.field) {
+                chartRefers.push(chart.title || (index + 1))
+              } else if (chart.header && chart.header.datatype === 'dynamic' && chart.header.field === card.field) {
+                chartRefers.push(chart.title || (index + 1))
+              } else if (chart.details && chart.details.length > 0 && chart.details.filter(item => item.datatype === 'dynamic' && item.field === card.field).length > 0) {
+                chartRefers.push(chart.title || (index + 1))
+              }
+            } else if (['bar', 'line', 'pie'].includes(chart.chartType)) {
+              if (chart.Xaxis === card.field) {
+                chartRefers.push(chart.title || (index + 1))
+              } else if (Array.isArray(chart.Yaxis)) {
+                if (chart.Yaxis.includes(card.field)) {
+                  chartRefers.push(chart.title || (index + 1))
+                }
+              } else if (chart.Yaxis === card.field) {
+                chartRefers.push(chart.title || (index + 1))
+              }
+            }
+          })
+
+          if (chartRefers.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '鍥捐〃銆�' + chartRefers.join('銆�') + '銆嬩腑鍚湁璇ュ瓧娈碉紝鍒犻櫎浼氬鑷村浘琛ㄦ樉绀哄紓甯革紝璇蜂慨鏀圭浉搴旂殑鍥捐〃璁剧疆锛�',
               duration: 5
             })
           }
@@ -488,7 +576,7 @@
         </Modal>
         {/* 鍚堝苟鍒楃紪杈� */}
         <Modal
-          title={dict['model.modal.colspan'] + '-' + dict['model.edit']}
+          title={dict['model.form.colspan'] + '-' + dict['model.edit']}
           visible={modaltype === 'colspan'}
           width={800}
           maskClosable={false}
@@ -529,7 +617,7 @@
           width={'75vw'}
           maskClosable={false}
           style={{minWidth: '900px', maxWidth: '1200px'}}
-          okText={dict['header.submit']}
+          okText={dict['model.submit']}
           onOk={this.markSubmit}
           onCancel={() => { this.setState({ modaltype: '' }) }}
           destroyOnClose

--
Gitblit v1.8.0