From da34633b25d16359cd91a656acad5e811f9972b7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 14 三月 2023 18:09:54 +0800
Subject: [PATCH] 2023-03-14

---
 src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx |   95 ++++++++++++++++++++++++++++-------------------
 1 files changed, 56 insertions(+), 39 deletions(-)

diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
index 4f7ffb1..6120716 100644
--- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
+++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
@@ -1,8 +1,3 @@
-import zhCN from '@/locales/zh-CN/model.js'
-import enUS from '@/locales/en-US/model.js'
-
-const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
-
 /**
  * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭�
  * @param {object} card       // 鎼滅储鏉′欢瀵硅薄
@@ -19,25 +14,29 @@
     roleList = []
   }
 
-  if (['picture', 'link', 'colspan'].includes(card.type)) {
+  // if (['picture', 'link', 'colspan'].includes(card.type)) {
+  if (['picture', 'link'].includes(card.type)) {
     card.type = 'text'
   }
 
   let options = [{
     value: 'text',
-    text: Formdict['model.form.text']
+    text: '鏂囨湰'
   }, {
     value: 'number',
-    text: Formdict['model.form.number']
+    text: '鏁板瓧'
   }, {
     value: 'textarea',
-    text: Formdict['model.form.textarea']
+    text: '澶氳鏂囨湰'
   }, {
     value: 'custom',
     text: '鑷畾涔夊垪'
   }, {
-    value: 'action',
-    text: '鎿嶄綔'
+    value: 'colspan',
+    text: '鍚堝苟鍒�'
+  // }, {
+  //   value: 'action',
+  //   text: '鎿嶄綔'
   }, {
     value: 'formula',
     text: '鍏紡'
@@ -45,6 +44,13 @@
     value: 'index',
     text: '搴忓彿'
   }]
+
+  if (!card.isSub) {
+    options.push({
+      value: 'action',
+      text: '鎿嶄綔'
+    })
+  }
 
   let editCols = [
     {
@@ -66,6 +72,15 @@
         field: col.uuid,
         label: col.label
       })
+    } else if (col.type === 'colspan') {
+      col.subcols.forEach(subcol => {
+        if (subcol.editable === 'true' && subcol.uuid !== card.uuid) {
+          editCols.push({
+            field: subcol.uuid,
+            label: col.label + '-' + subcol.label
+          })
+        }
+      })
     }
   })
 
@@ -80,7 +95,7 @@
     {
       type: 'select',
       key: 'type',
-      label: Formdict['model.form.type'],
+      label: '绫诲瀷',
       initVal: card.type,
       required: true,
       options: options
@@ -88,7 +103,7 @@
     {
       type: 'select',
       key: 'field',
-      label: Formdict['model.form.field'],
+      label: '瀛楁',
       initVal: card.field,
       required: true,
       options: fields
@@ -99,54 +114,53 @@
       min: 20,
       max: 1000,
       precision: 0,
-      label: Formdict['model.form.columnWidth'],
+      label: '鍒楀',
       initVal: card.Width || 120,
       required: true
     },
     {
       type: 'radio',
       key: 'Hide',
-      label: Formdict['model.hidden'],
+      label: '闅愯棌',
       initVal: card.Hide || 'false',
       required: true,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
       type: 'radio',
       key: 'IsSort',
-      label: Formdict['model.sort'],
-      initVal: card.IsSort || 'false',
+      label: '鎺掑簭',
+      initVal: card.IsSort || (card.isSub ? 'false' : 'true'),
       required: true,
-      forbidden: card.isSub,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
       type: 'radio',
       key: 'Align',
-      label: Formdict['model.form.align'],
+      label: '瀵归綈鏂瑰紡',
       initVal: card.Align || 'left',
       required: true,
       options: [{
         value: 'left',
-        text: Formdict['model.form.alignLeft']
+        text: '宸﹀榻�'
       }, {
         value: 'center',
-        text: Formdict['model.form.alignCenter']
+        text: '灞呬腑'
       }, {
         value: 'right',
-        text: Formdict['model.form.alignRight']
+        text: '鍙冲榻�'
       }]
     },
     {
@@ -158,10 +172,10 @@
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
@@ -297,10 +311,10 @@
       initVal: card.orderType || 'asc',
       options: [{
         value: 'asc',
-        text: Formdict['header.form.asc']
+        text: '姝e簭'
       }, {
         value: 'desc',
-        text: Formdict['header.form.desc']
+        text: '鍊掑簭'
       }]
     },
     {
@@ -383,9 +397,9 @@
       min: 0,
       max: 18,
       precision: 0,
-      label: Formdict['header.form.decimal'],
+      label: '灏忔暟浣�',
       initVal: card.decimal || 0,
-      required: true
+      required: false
     },
     {
       type: 'number',
@@ -406,11 +420,11 @@
     {
       type: 'select',
       key: 'format',
-      label: Formdict['header.form.format'],
+      label: '鏍煎紡鍖�',
       initVal: card.format || 'none',
       options: [{
         value: 'none',
-        text: Formdict['model.empty']
+        text: '鏃�'
       }, {
         value: 'thdSeparator',
         text: '鍗冨垎浣�'
@@ -426,11 +440,14 @@
     {
       type: 'select',
       key: 'textFormat',
-      label: Formdict['header.form.format'],
+      label: '鏍煎紡鍖�',
       initVal: card.textFormat || 'none',
       options: [{
         value: 'none',
-        text: Formdict['model.empty']
+        text: '鏃�'
+      }, {
+        value: 'encryption',
+        text: '鍔犲瘑'
       }, {
         value: 'YYYY-MM-DD',
         text: 'YYYY-MM-DD'
@@ -443,14 +460,14 @@
     {
       type: 'text',
       key: 'prefix',
-      label: Formdict['header.form.prefix'],
+      label: '鍓嶇紑',
       initVal: card.prefix || '',
       required: false,
     },
     {
       type: 'text',
       key: 'postfix',
-      label: Formdict['header.form.postfix'],
+      label: '鍚庣紑',
       initVal: card.postfix || '',
       required: false,
     },
@@ -486,7 +503,7 @@
     {
       type: 'multiselect',
       key: 'blacklist',
-      label: Formdict['header.form.blacklist'],
+      label: '榛戝悕鍗�',
       initVal: card.blacklist || [],
       required: false,
       options: roleList

--
Gitblit v1.8.0