From 9e716f3bd30820a08757845b592db73363faa48c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 25 四月 2022 14:53:37 +0800
Subject: [PATCH] 2022-04-25

---
 src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx |  111 ++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 93 insertions(+), 18 deletions(-)

diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
index 46484ca..d8a652f 100644
--- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
+++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
@@ -6,18 +6,36 @@
 /**
  * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭�
  * @param {object} card       // 鎼滅储鏉′欢瀵硅薄
- * @param {Array}  menulist   // 鑿滃崟鍒楄〃-鐢ㄤ簬瀛楁閫忚
  */
-export function getColumnForm (card, menulist = [], fields = []) {
+export function getColumnForm (card, fields = []) {
+  let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
   if (roleList) {
     try {
       roleList = JSON.parse(roleList)
-    } catch {
+    } catch (e) {
       roleList = []
     }
   } else {
     roleList = []
+  }
+
+  let menulist = []
+
+  if (appType === 'pc') {
+    menulist = sessionStorage.getItem('appMenus')
+  } else if (!appType) {
+    menulist = sessionStorage.getItem('fstMenuList')
+  }
+
+  if (menulist) {
+    try {
+      menulist = JSON.parse(menulist)
+    } catch (e) {
+      menulist = []
+    }
+  } else {
+    menulist = []
   }
 
   let options = [{
@@ -41,6 +59,12 @@
   }, {
     value: 'colspan',
     text: '鍚堝苟鍒�'
+  }, {
+    value: 'formula',
+    text: '鍏紡'
+  }, {
+    value: 'index',
+    text: '搴忓彿'
   }]
 
   if (!card.isSub) {
@@ -128,9 +152,9 @@
       type: 'radio',
       key: 'IsSort',
       label: Formdict['model.sort'],
-      initVal: card.IsSort || 'true',
+      initVal: card.IsSort || (card.isSub ? 'false' : 'true'),
       required: true,
-      forbidden: card.isSub,
+      // forbidden: card.isSub,
       options: [{
         value: 'true',
         text: Formdict['model.true']
@@ -206,10 +230,13 @@
         text: Formdict['model.empty']
       }, {
         value: 'thdSeparator',
-        text: Formdict['header.form.thdSeparator']
+        text: '鍗冨垎浣�'
       }, {
         value: 'percent',
         text: '鐧惧垎姣�'
+      }, {
+        value: 'abs',
+        text: '缁濆鍊�'
       }],
       required: false
     },
@@ -243,21 +270,32 @@
       key: 'postfix',
       label: Formdict['header.form.postfix'],
       initVal: card.postfix || '',
-      tooltipClass: 'middle',
       required: false,
       readonly: false
     },
     {
-      type: 'radio',
+      type: 'select',
       key: 'lenWidRadio',
       label: '闀垮姣�',
       initVal: card.lenWidRadio || '1:1',
       required: true,
       options: [
         { value: '1:1', text: '1:1' },
-        { value: '3:2', text: '3:2' },
         { value: '4:3', text: '4:3' },
-        { value: '16:9', text: '16:9' }
+        { value: '3:2', text: '3:2' },
+        { value: '16:9', text: '16:9' },
+        { value: '2:1', text: '2:1' },
+        { value: '3:1', text: '3:1' },
+        { value: '4:1', text: '4:1' },
+        { value: '5:1', text: '5:1' },
+        { value: '6:1', text: '6:1' },
+        { value: '7:1', text: '7:1' },
+        { value: '8:1', text: '8:1' },
+        { value: '9:1', text: '9:1' },
+        { value: '10:1', text: '10:1' },
+        { value: '3:4', text: '3:4' },
+        { value: '2:3', text: '2:3' },
+        { value: '9:16', text: '9:16' },
       ]
     },
     {
@@ -284,8 +322,8 @@
     {
       type: 'radio',
       key: 'scale',
-      label: Formdict['header.form.clickscale'],
-      initVal: card.scale || 'false',
+      label: '鐐瑰嚮缂╂斁',
+      initVal: card.scale || 'true',
       required: false,
       options: [{
         value: 'true',
@@ -309,22 +347,25 @@
       }, {
         value: 'linkurl',
         text: '閾炬帴'
-      }]
+      }],
+      forbidden: appType === 'mob'
     },
     {
-      type: 'cascader',
+      type: appType === 'pc' ? 'select' : 'cascader',
       key: 'linkmenu',
       label: Formdict['model.menu'],
-      initVal: card.linkmenu || [],
+      initVal: card.linkmenu || (appType === 'pc' ? '' : []),
       required: true,
-      options: menulist
+      options: menulist,
+      forbidden: appType === 'mob'
     },
     {
       type: 'textarea',
       key: 'linkurl',
       label: '閾炬帴鍦板潃',
       initVal: card.linkurl || '',
-      required: true
+      required: true,
+      forbidden: appType === 'mob'
     },
     {
       type: 'multiselect',
@@ -332,7 +373,41 @@
       label: '鍏宠仈瀛楁',
       initVal: card.linkfields || [],
       required: false,
-      options: fields
+      options: fields,
+      forbidden: appType === 'mob'
+    },
+    {
+      type: 'radio',
+      key: 'open',
+      label: '鎵撳紑鏂瑰紡',
+      initVal: card.open || 'blank',
+      required: false,
+      forbid: appType !== 'pc',
+      options: [
+        { value: 'blank', text: '鏂扮獥鍙�' },
+        { value: 'self', text: '褰撳墠绐楀彛' }
+      ]
+    },
+    {
+      type: 'radio',
+      key: 'eval',
+      label: '瑙f瀽',
+      initVal: card.eval || 'true',
+      tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��',
+      required: false,
+      options: [
+        { value: 'true', text: '鏄�' },
+        { value: 'false', text: '鍚�' }
+      ]
+    },
+    {
+      type: 'textarea',
+      key: 'formula',
+      label: '鍏紡',
+      initVal: card.formula || '',
+      tooltip: '鎵ц鏃朵細浣跨敤鏌ヨ鍒扮殑鏁版嵁鏇挎崲鐩稿簲鐨勫瓧娈碉紝灞曠ず鑾峰緱鐨勭粨鏋滐紝鍦ㄤ笉浣跨敤瑙f瀽鏃舵崲琛岀鎴栫┖鏍间細鏇挎崲涓洪〉闈㈠厓绱犮�傚彲浣跨敤JS鐨勪竴浜涜娉曪紝濡傦細涓夊厓琛ㄨ揪寮� @field1@ > @field2@ ? 0 : 1锛汳ath瀵硅薄锛屽彇缁濆鍊� Math.abs(@field@)銆佸洓鑸嶄簲鍏� Math.round(@field@)绛�',
+      placeholder: '渚嬪锛欯price@ * @number@',
+      required: true
     },
     {
       type: 'multiselect',

--
Gitblit v1.8.0