From a8507cc8c42d17d4fb854594dbf1e084d61912ac Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 18 十月 2022 12:44:22 +0800
Subject: [PATCH] 2022-10-18

---
 src/menu/components/table/base-table/columns/index.jsx |   66 +-------------------------------
 1 files changed, 3 insertions(+), 63 deletions(-)

diff --git a/src/menu/components/table/base-table/columns/index.jsx b/src/menu/components/table/base-table/columns/index.jsx
index f68b463..a928fa8 100644
--- a/src/menu/components/table/base-table/columns/index.jsx
+++ b/src/menu/components/table/base-table/columns/index.jsx
@@ -3,13 +3,11 @@
 import { is, fromJS } from 'immutable'
 import { DndProvider, DragSource, DropTarget } from 'react-dnd'
 import { Table, Popover, Modal, message } from 'antd'
-import { PlusOutlined, FileSyncOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons'
+import { PlusOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons'
 
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
 import Utils from '@/utils/utils.js'
-import zhCN from '@/locales/zh-CN/model.js'
-import enUS from '@/locales/en-US/model.js'
 import MKEmitter from '@/utils/events.js'
 import './index.scss'
 
@@ -194,7 +192,6 @@
   }
 
   state = {
-    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     appType: sessionStorage.getItem('appType'),
     tableId: '',
     data: [{uuid: Utils.getuuid()}],
@@ -501,61 +498,6 @@
     })
   }
 
-  syncfield = () => {
-    const { fields } = this.state
-    let columns = fromJS(this.state.columns).toJS()
-
-    columns = columns.filter(c => !c.origin)
-
-    let keys = columns.map(col => col.field)
-
-    fields.forEach(item => {
-      if (keys.includes(item.field)) return
-
-      let cell = { uuid: Utils.getuuid(), label: item.label, field: item.field, Align: 'left', Hide: 'false', IsSort: 'true', Width: 120, blacklist: [], postfix: '', prefix: '', linkmenu: [], marks: [], perspective: 'linkmenu' }
-      
-      if (/Nvarchar|date/ig.test(item.datatype)) {
-        cell.type = 'text'
-        cell.rowspan = 'false'
-        cell.textFormat = 'none'
-      } else {
-        cell.type = 'number'
-        cell.format = 'none'
-        cell.sum = 'false'
-        cell.decimal = item.decimal || 0
-        cell.Width = 80
-      }
-
-      columns.push(cell)
-    })
-
-    const _this = this
-
-    confirm({
-      content: '纭畾鍚屾瀛楁闆嗗悧锛�',
-      onOk() {
-        _this.setState({columns}, () => {
-          _this.props.updatecolumn({..._this.props.config, cols: columns})
-        })
-      },
-      onCancel() {}
-    })
-  }
-
-  clear = () => {
-    const _this = this
-
-    confirm({
-      content: '纭畾娓呯┖鏄剧ず鍒楀悧锛�',
-      onOk() {
-        _this.setState({columns: []}, () => {
-          _this.props.updatecolumn({..._this.props.config, cols: []})
-        })
-      },
-      onCancel() {}
-    })
-  }
-
   /**
    * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆
    */
@@ -567,7 +509,7 @@
 
   render() {
     const { config } = this.props
-    const { fields, card, lineMarks, dict, tableId, appType } = this.state
+    const { fields, card, lineMarks, tableId, appType } = this.state
     const components = {
       header: {
         cell: DragableHeaderCol
@@ -584,8 +526,6 @@
         <div className="col-control">
           <CopyOutlined title="澶嶅埗鏄剧ず鍒�" onClick={this.copycolumn} />
           <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} />
-          <FileSyncOutlined title="鍚屾瀛楁闆�" onClick={this.syncfield} />
-          <DeleteOutlined title="娓呯┖鏄剧ず鍒�" onClick={this.clear}/>
         </div>
         <DndProvider>
           <Table
@@ -608,7 +548,7 @@
           />
           {appType === 'mob' && config.setting.laypage !== 'fasle' ? <MobPagination /> : null}
         </DndProvider>
-        <EditColumn column={card} dict={dict} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/>
+        <EditColumn column={card} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/>
       </div>
     )
   }

--
Gitblit v1.8.0