From 072227ec43346c50c93cda3bf21c346f463eb551 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 19 十月 2023 22:28:56 +0800
Subject: [PATCH] 2023-10-19

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

diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx
index 9a107bb..796a764 100644
--- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx
+++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx
@@ -18,7 +18,7 @@
   text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'editable', 'initval', 'blacklist'],
   number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'editable', 'initval', 'sum', 'blacklist'],
   textarea: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'prefix', 'initval', 'postfix', 'blacklist'],
-  custom: ['label', 'type', 'Align', 'Width', 'blacklist'],
+  custom: ['label', 'type', 'Align', 'Width', 'blacklist', 'IsSort'],
   colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'],
   action: ['label', 'type', 'Align', 'Width'],
   formula: ['label', 'type', 'Align', 'Hide', 'Width', 'prefix', 'postfix', 'eval', 'formula', 'blacklist'],
@@ -90,6 +90,8 @@
     }
     if (this.record.type === 'formula' && this.record.eval === 'true') {
       _options.push('decimal')
+    } else if (this.record.type === 'custom' && this.record.IsSort === 'true') {
+      _options.push('sortField')
     }
     if (['number', 'formula'].includes(this.record.type) && this.record.Hide !== 'true') {
       _options.push('noValue')
@@ -142,6 +144,10 @@
     this.record[key] = value
 
     if (key === 'type') {
+      if (['textarea', 'custom'].includes(value)) {
+        this.record.IsSort = 'false'
+      }
+
       let _options = this.getOptions()
 
       let _field = ''
@@ -161,7 +167,9 @@
           return item
         })
       }, () => {
-        if (value === 'colspan') {
+        if (['textarea', 'custom'].includes(value)) {
+          this.props.form.setFieldsValue({IsSort: 'false'})
+        } else if (value === 'colspan') {
           this.props.form.setFieldsValue({Align: 'center'})
         } else if (value === 'formula' && _field) {
           this.props.form.setFieldsValue({formula: '@' + _field + '@'})
@@ -203,7 +211,7 @@
       }
     } else if (key === 'format' && value === 'percent') {
       this.props.form.setFieldsValue({postfix: '%'})
-    } else if (['editable', 'editType', 'resourceType', 'ctrlField', 'eval', 'Hide'].includes(key)) {
+    } else if (['editable', 'editType', 'resourceType', 'ctrlField', 'eval', 'Hide', 'IsSort'].includes(key)) {
       let _options = this.getOptions()
 
       this.setState({

--
Gitblit v1.8.0