From a02fc6a77fa1b35c6516b2d37108d80e260c6c85 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 十一月 2024 22:05:08 +0800
Subject: [PATCH] 2024-11-07

---
 src/menu/components/table/edit-table/columns/index.jsx |   33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx
index b410cc8..fcf33b1 100644
--- a/src/menu/components/table/edit-table/columns/index.jsx
+++ b/src/menu/components/table/edit-table/columns/index.jsx
@@ -22,12 +22,12 @@
 
 class HeaderCol extends Component {
   deleteCol = () => {
-    const _this = this
+    const that = this
 
     confirm({
       content: '纭畾鍒犻櫎鏄剧ず鍒楀悧锛�',
       onOk() {
-        _this.props.deleteCol(_this.props.column)
+        that.props.deleteCol(that.props.column)
       },
       onCancel() {}
     })
@@ -47,7 +47,7 @@
       cols: [column]
     }
 
-    let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId')
+    let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId')
     if (srcid) {
       val.$srcId = srcid
     }
@@ -195,10 +195,10 @@
         val = '$Index'
       } else if (column.type === 'formula') {
         val = column.formula
-        if (column.eval === 'false') {
-          val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, '&nbsp;')
-          val = <span style={{fontWeight: 'inherit'}} dangerouslySetInnerHTML={{__html: val}}></span>
-        }
+        // if (column.eval === 'false') {
+        //   val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, '&nbsp;')
+        //   val = <span style={{fontWeight: 'inherit'}} dangerouslySetInnerHTML={{__html: val}}></span>
+        // }
       }
       return (
         <td style={style} className={className}>
@@ -553,7 +553,7 @@
       cols: columns.filter(col => !col.origin)
     }
 
-    let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId')
+    let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId')
     if (srcid) {
       val.$srcId = srcid
     }
@@ -597,13 +597,13 @@
       columns.push(cell)
     })
 
-    const _this = this
+    const that = this
 
     confirm({
       content: '纭畾鍚屾瀛楁闆嗗悧锛�',
       onOk() {
-        _this.setState({columns}, () => {
-          _this.props.updatecolumn({..._this.props.config, cols: columns})
+        that.setState({columns}, () => {
+          that.props.updatecolumn({...that.props.config, cols: columns})
         })
       },
       onCancel() {}
@@ -611,13 +611,13 @@
   }
 
   clear = () => {
-    const _this = this
+    const that = this
 
     confirm({
       content: '纭畾娓呯┖鏄剧ず鍒楀悧锛�',
       onOk() {
-        _this.setState({columns: []}, () => {
-          _this.props.updatecolumn({..._this.props.config, cols: []})
+        that.setState({columns: []}, () => {
+          that.props.updatecolumn({...that.props.config, cols: []})
         })
       },
       onCancel() {}
@@ -637,10 +637,6 @@
     })
   }
 
-  componentDidMount () {
-    MKEmitter.addListener('submitStyle', this.getStyle)
-  }
-
   /**
    * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆
    */
@@ -648,7 +644,6 @@
     this.setState = () => {
       return
     }
-    MKEmitter.removeListener('submitStyle', this.getStyle)
   }
 
   handlecolumns = (columns, fields, config, pId) => {

--
Gitblit v1.8.0