From 95afd40fc2741ac0ce59c2091f6cfce1f98877d4 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 24 六月 2021 09:15:45 +0800
Subject: [PATCH] 2021-06-24

---
 src/templates/zshare/formconfig.jsx | 1055 ++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 845 insertions(+), 210 deletions(-)

diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 8ec08e5..c5e049c 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -2,7 +2,7 @@
 import enUS from '@/locales/en-US/model.js'
 import { formRule } from '@/utils/option.js'
 
-const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
+const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
 
 /**
  * @description 鑾峰彇鏍戝舰椤甸潰璁剧疆琛ㄥ崟閰嶇疆淇℃伅
@@ -210,7 +210,7 @@
       key: 'mark',
       label: '椤剁骇鏍囪瘑',
       initVal: setting.mark || '',
-      tooltip: '鐖剁骇瀛楁鍊间笌椤剁骇鏍囪瘑锛堥粯璁ゅ�间负绌猴級鐩稿悓鏃讹紝瑙嗕负椤剁骇鑺傜偣銆�',
+      tooltip: '鐖剁骇瀛楁鍊间笌椤剁骇鏍囪瘑鐩稿悓鏃讹紝瑙嗕负椤剁骇鑺傜偣銆�',
       required: false,
       readonly: false,
       rules: [
@@ -284,10 +284,73 @@
 /**
  * @description 鑾峰彇鎼滅储鏉′欢琛ㄥ崟閰嶇疆淇℃伅
  * @param {object} card           // 鎼滅储鏉′欢瀵硅薄
- * @param {Array}  roleList       // 瑙掕壊鍒楄〃
  * @param {Array}  linkableFields // 鍙叧鑱斿瓧娈�
  */
-export function getSearchForm (card, roleList, linkableFields) {
+export function getSearchForm (card, linkableFields) {
+  let roleList = sessionStorage.getItem('sysRoles')
+  if (roleList) {
+    try {
+      roleList = JSON.parse(roleList)
+    } catch {
+      roleList = []
+    }
+  } else {
+    roleList = []
+  }
+
+  let typeOptions = []
+
+  if (sessionStorage.getItem('appType') === 'mob') {
+    typeOptions = [{
+      value: 'text',
+      text: Formdict['model.form.text']
+    }, {
+      value: 'checkcard',
+      text: '閫夐」鍗�'
+    }, {
+      value: 'date',
+      text: Formdict['model.form.dateday']
+    }, {
+      value: 'datemonth',
+      text: Formdict['model.form.datemonth']
+    }]
+    if (!['text', 'checkcard', 'date', 'datemonth'].includes(card.type)) {
+      card.type = 'text'
+    }
+  } else {
+    typeOptions = [{
+      value: 'text',
+      text: Formdict['model.form.text']
+    }, {
+      value: 'select',
+      text: Formdict['model.form.select']
+    }, {
+      value: 'multiselect',
+      text: Formdict['model.form.multiselect']
+    }, {
+      value: 'link',
+      text: Formdict['model.form.link']
+    }, {
+      value: 'checkcard',
+      text: '閫夐」鍗�'
+    }, {
+      value: 'date',
+      text: Formdict['model.form.dateday']
+    }, {
+      value: 'dateweek',
+      text: Formdict['model.form.dateweek']
+    }, {
+      value: 'datemonth',
+      text: Formdict['model.form.datemonth']
+    }, {
+      value: 'daterange',
+      text: Formdict['model.form.daterange']
+    }, {
+      value: 'group',
+      text: Formdict['model.form.dategroup']
+    }]
+  }
+
   return [
     {
       type: 'text',
@@ -312,34 +375,7 @@
       label: Formdict['model.form.type'],
       initVal: card.type,
       required: true,
-      options: [{
-        value: 'text',
-        text: Formdict['model.form.text']
-      }, {
-        value: 'select',
-        text: Formdict['model.form.select']
-      }, {
-        value: 'multiselect',
-        text: Formdict['model.form.multiselect']
-      }, {
-        value: 'link',
-        text: Formdict['model.form.link']
-      }, {
-        value: 'date',
-        text: Formdict['model.form.dateday']
-      }, {
-        value: 'dateweek',
-        text: Formdict['model.form.dateweek']
-      }, {
-        value: 'datemonth',
-        text: Formdict['model.form.datemonth']
-      }, {
-        value: 'daterange',
-        text: Formdict['model.form.daterange']
-      }, {
-        value: 'group',
-        text: Formdict['model.form.dategroup']
-      }]
+      options: typeOptions
     },
     {
       type: 'text',
@@ -375,7 +411,7 @@
       type: 'radio',
       key: 'setAll',
       label: Formdict['header.form.setAll'],
-      initVal: card.setAll || 'false',
+      initVal: card.setAll || 'true',
       options: [{
         value: 'true',
         text: Formdict['model.true']
@@ -383,6 +419,75 @@
         value: 'false',
         text: Formdict['model.false']
       }]
+    },
+    {
+      type: 'radio',
+      key: 'display',
+      label: '鏄剧ず',
+      initVal: card.display || 'text',
+      required: true,
+      options: [{
+        value: 'text',
+        text: '鏂囨湰'
+      }, {
+        value: 'picture',
+        text: '鍥剧墖'
+      }]
+    },
+    {
+      type: 'number',
+      key: 'width',
+      min: 1,
+      max: 24,
+      precision: 0,
+      label: '鍗$墖瀹藉害',
+      initVal: card.width || 4,
+      tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
+      required: true
+    },
+    {
+      type: 'text',
+      key: 'cardValField',
+      label: Formdict['header.form.valueField'],
+      initVal: card.cardValField || 'Value',
+      required: true,
+      readonly: false
+    },
+    {
+      type: 'text',
+      key: 'urlField',
+      label: '鍦板潃瀛楁',
+      initVal: card.urlField || '',
+      required: true,
+      readonly: false
+    },
+    {
+      type: 'radio',
+      key: 'picratio',
+      label: '鍥剧墖姣斾緥',
+      initVal: card.picratio || '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'
+      }]
+    },
+    {
+      type: 'fields',
+      key: 'fields',
+      label: '瀛楁闆�',
+      initVal: card.fields || [],
+      required: true,
+      readonly: false
     },
     {
       type: 'textarea',
@@ -395,7 +500,7 @@
     {
       type: 'options',
       key: 'options',
-      label: '',
+      label: '閫夐」',
       initVal: card.options || [],
       required: true,
       readonly: false
@@ -497,20 +602,6 @@
       }]
     },
     {
-      type: 'select',
-      key: 'display',
-      label: Formdict['header.form.display'],
-      initVal: card.display || 'dropdown',
-      required: true,
-      options: [{
-        value: 'dropdown',
-        text: Formdict['header.form.dropdown']
-      // }, {
-      //   value: 'button',
-      //   text: Formdict['header.form.button']
-      }]
-    },
-    {
       type: 'radio',
       key: 'database',
       label: Formdict['header.form.database'],
@@ -532,6 +623,20 @@
       tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
       initVal: card.ratio,
       required: false
+    },
+    {
+      type: 'radio',
+      key: 'multiple',
+      label: '鍙閫�',
+      initVal: card.multiple || 'false',
+      required: true,
+      options: [{
+        value: 'true',
+        text: '鏄�'
+      }, {
+        value: 'false',
+        text: '鍚�'
+      }]
     },
     {
       type: 'radio',
@@ -574,6 +679,46 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'labelShow',
+      label: '鏄剧ず鍚嶇О',
+      initVal: card.labelShow || 'true',
+      options: [{
+        value: 'true',
+        text: Formdict['model.true']
+      }, {
+        value: 'false',
+        text: Formdict['model.false']
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'advanced',
+      label: '楂樼骇鎼滅储',
+      initVal: card.advanced || 'false',
+      options: [{
+        value: 'true',
+        text: Formdict['model.true']
+      }, {
+        value: 'false',
+        text: Formdict['model.false']
+      }]
+    },
+    {
+      type: 'color',
+      key: 'backgroundColor',
+      label: '鑳屾櫙鑹�',
+      initVal: card.backgroundColor || '',
+      required: false
+    },
+    {
+      type: 'color',
+      key: 'borderColor',
+      label: '杈规棰滆壊',
+      initVal: card.borderColor || '',
+      required: false
+    },
+    {
       type: 'multiselect',
       key: 'blacklist',
       label: Formdict['header.form.blacklist'],
@@ -589,10 +734,12 @@
  * @param {*} card           缂栬緫鎸夐挳
  * @param {*} functip        鐢熸垚瀛樺偍杩囩▼鎻愮ず
  * @param {*} config         椤甸潰閰嶇疆
- * @param {*} permFuncField  瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈�
+ * @param {*} usefulFields   瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈�
  * @param {*} type           鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡
  */
-export function getActionForm (card, functip, config, permFuncField, type, menulist = []) {
+export function getActionForm (card, functip, config, usefulFields, type, menulist = [], printTemps = []) {
+  let columns = (config.columns || []).filter(col => col.field)
+
   let opentypes = [
     {
       value: 'pop',
@@ -633,17 +780,28 @@
     tabTems = []
   }
 
+  if (card.execSuccess === 'view' || card.execSuccess === 'refresh') { // refresh涓鸿〃鍗曟爣绛鹃〉
+    card.execSuccess = 'grid'
+  }
+  if (card.execError === 'view' || card.execSuccess === 'refresh') {
+    card.execError = 'grid'
+  }
+  if (card.popClose === 'view') {
+    card.popClose = 'grid'
+  }
+
   let refresh = []
+
   if (type === 'subtable') { // 瀛愯〃椤甸潰锛屽彲璁剧疆鍒锋柊涓昏〃鍙婂悓绾ф爣绛�
+    if (card.focus) {
+      card.popClose = 'maingrid'
+    }
     refresh.push({
       value: 'maingrid',
       text: Formdict['header.form.refresh.maingrid']
     }, {
       value: 'equaltab',
       text: Formdict['header.form.refresh.equaltab']
-    // }, {
-    //   value: 'mainline',
-    //   text: Formdict['header.form.refresh.mainline']
     })
   }
 
@@ -657,7 +815,7 @@
       options: opentypes
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'funcType',
       label: Formdict['header.form.funcType'],
       initVal: card.funcType || '',
@@ -667,7 +825,7 @@
         text: Formdict['header.form.func.changeuser']
       }, {
         value: 'print',
-        text: Formdict['header.form.func.print']
+        text: '鏍囩鎵撳嵃'
       }]
     },
     {
@@ -693,31 +851,29 @@
       label: Formdict['header.form.intertype'],
       initVal: card.intertype || 'system',
       required: true,
+      options: []
+    },
+    {
+      type: 'radio',
+      key: 'procMode',
+      label: '鍙傛暟澶勭悊',
+      initVal: card.procMode || 'system',
+      required: true,
       options: [{
         value: 'system',
-        text: Formdict['model.interface.system']
+        text: '绯荤粺鍑芥暟'
       }, {
         value: 'inner',
-        text: Formdict['model.interface.inner']
-      }, {
-        value: 'outer',
-        text: Formdict['model.interface.outer']
+        text: '鍐呴儴鍑芥暟'
       }]
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'sqlType',
       label: Formdict['header.form.action.type'],
       initVal: card.sqlType || '',
       required: true,
       options: []
-    },
-    {
-      type: 'text',
-      key: 'sql',
-      label: Formdict['model.form.tablename'],
-      initVal: card.sql || config.setting.tableName || '',
-      required: true
     },
     {
       type: 'text',
@@ -729,26 +885,33 @@
     },
     {
       type: 'text',
+      key: 'sql',
+      label: Formdict['model.form.tablename'],
+      initVal: card.sql || config.setting.tableName || '',
+      required: true
+    },
+    {
+      type: 'text',
       key: 'innerFunc',
       label: Formdict['header.form.innerFunc'],
       initVal: card.innerFunc || '',
       tooltip: functip,
-      fields: permFuncField,
+      fields: usefulFields,
       tooltipClass: 'middle',
       required: card.intertype === 'inner',
       readonly: false
     },
-    {
-      type: 'select',
-      key: 'tabType',
-      label: Formdict['model.form.tabType'],
-      initVal: card.tabType || 'SubTable',
-      required: true,
-      options: [{
-        value: 'SubTable',
-        text: Formdict['model.menu.tab.subtable']
-      }]
-    },
+    // {
+    //   type: 'select',
+    //   key: 'tabType',
+    //   label: Formdict['model.form.tabType'],
+    //   initVal: card.tabType || 'SubTable',
+    //   required: true,
+    //   options: [{
+    //     value: 'SubTable',
+    //     text: Formdict['model.menu.tab.subtable']
+    //   }]
+    // },
     {
       type: 'select',
       key: 'linkTab',
@@ -764,8 +927,14 @@
       initVal: card.pageTemplate || '',
       required: true,
       options: [{
-        value: 'print',
-        text: Formdict['header.menu.printTemplate']
+      //   value: 'print',
+      //   text: '鏍囩鎵撳嵃妯℃澘'
+      // }, {
+      //   value: 'billprintTemp',
+      //   text: '鍗曟嵁鎵撳嵃妯℃澘'
+      // }, {
+        value: 'billprint',
+        text: '鍗曟嵁鎵撳嵃'
       }, {
         value: 'pay',
         text: Formdict['model.pay']
@@ -775,9 +944,17 @@
       }]
     },
     {
+      type: 'select',
+      key: 'printTemp',
+      label: '鎵撳嵃妯℃澘',
+      initVal: card.printTemp || '',
+      required: true,
+      options: printTemps
+    },
+    {
       type: 'text',
       key: 'url',
-      label: Formdict['model.form.newpage.url'],
+      label: Formdict['model.pageUrl'],
       initVal: card.url || '',
       required: true
     },
@@ -804,12 +981,71 @@
       readonly: false
     },
     {
-      type: 'text',
+      type: 'textarea',
       key: 'interface',
-      label: Formdict['header.form.interface'],
+      label: '娴嬭瘯鍦板潃',
       initVal: card.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (card.interface || ''),
       required: true,
       readonly: card.sysInterface === 'true'
+    },
+    {
+      type: 'textarea',
+      key: 'proInterface',
+      label: '姝e紡鍦板潃',
+      initVal: card.proInterface || '',
+      tooltip: '姝e紡绯荤粺鎵�浣跨敤鐨勬帴鍙e湴鍧�銆�',
+      required: false
+    },
+    {
+      type: 'radio',
+      key: 'method',
+      label: '璇锋眰鏂瑰紡',
+      initVal: card.method || 'post',
+      required: true,
+      options: [{
+        value: 'get',
+        text: 'GET'
+      }, {
+        value: 'post',
+        text: 'POST'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'cross',
+      label: '璺ㄥ煙璇锋眰',
+      initVal: card.cross || 'true',
+      tooltip: '濡傛灉鑷畾涔夋帴鍙d笉鏀寔璺ㄥ煙璇锋眰锛屼細閫氳繃褰撳墠绯荤粺杞彂銆�',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '鏀寔'
+      }, {
+        value: 'false',
+        text: '涓嶆敮鎸�'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'callbackType',
+      label: '鍥炶皟鏂瑰紡',
+      initVal: card.callbackType || 'script',
+      tooltip: '浣跨敤鍚庡彴鑴氭湰鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��',
+      required: true,
+      options: [{
+        value: 'script',
+        text: '鑷畾涔夎剼鏈�'
+      }, {
+        value: 'default',
+        text: '鍚庡彴鑴氭湰'
+      }]
+    },
+    {
+      type: 'text',
+      key: 'cbTable',
+      label: '鍥炶皟琛ㄥ悕',
+      initVal: card.cbTable || '',
+      required: true
     },
     {
       type: 'text',
@@ -820,7 +1056,7 @@
       readonly: false
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'position',
       label: Formdict['header.form.position'],
       initVal: card.position || 'toolbar',
@@ -864,7 +1100,7 @@
       options: menulist
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'afterExecSuccess',
       label: Formdict['header.form.afterExecSuccess'],
       initVal: card.afterExecSuccess || 'close',
@@ -878,7 +1114,7 @@
       }]
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'afterExecError',
       label: Formdict['header.form.afterExecError'],
       initVal: card.afterExecError || 'notclose',
@@ -892,7 +1128,7 @@
       }]
     },
     {
-      type: 'select',
+      type: refresh.length === 0 ? 'radio' : 'select',
       key: 'execSuccess',
       label: Formdict['model.form.afterSuccess'],
       initVal: card.execSuccess || 'never',
@@ -903,14 +1139,11 @@
       }, {
         value: 'grid',
         text: Formdict['header.form.refresh.grid']
-      }, {
-        value: 'view',
-        text: Formdict['header.form.refresh.view']
       },
       ...refresh]
     },
     {
-      type: 'select',
+      type: refresh.length === 0 ? 'radio' : 'select',
       key: 'execError',
       label: Formdict['model.form.afterError'],
       initVal: card.execError || 'never',
@@ -921,13 +1154,11 @@
       }, {
         value: 'grid',
         text: Formdict['header.form.refresh.grid']
-      }, {
-        value: 'view',
-        text: Formdict['header.form.refresh.view']
-      }]
+      },
+      ...refresh]
     },
     {
-      type: 'select',
+      type: refresh.length === 0 ? 'radio' : 'select',
       key: 'popClose',
       label: Formdict['header.form.popClose'],
       initVal: card.popClose || 'never',
@@ -938,11 +1169,22 @@
       }, {
         value: 'grid',
         text: Formdict['header.form.refresh.grid']
-      }, {
-        value: 'view',
-        text: Formdict['header.form.refresh.view']
       },
       ...refresh]
+    },
+    {
+      type: 'radio',
+      key: 'resetPageIndex',
+      label: '鍒锋柊鏃�',
+      initVal: card.resetPageIndex || 'true',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '閲嶇疆椤电爜'
+      }, {
+        value: 'false',
+        text: '涓嶉噸缃�'
+      }]
     },
     {
       type: 'select',
@@ -1008,6 +1250,23 @@
         value: 'false',
         text: '闈炲繀濉�'
       }]
+    },
+    {
+      type: 'select',
+      key: 'controlField',
+      label: '鎺у埗瀛楁',
+      tooltip: '绂佺敤鎺у埗瀛楁锛屽彲鏍规嵁鏁版嵁鎺у埗鎸夐挳鏄惁绂佺敤銆�',
+      initVal: card.controlField || '',
+      required: false,
+      options: [{label: '鏃�', field: ''}, ...columns]
+    },
+    {
+      type: 'text',
+      key: 'controlVal',
+      label: '鎺у埗鍊�',
+      tooltip: '褰撻�夋嫨鎺у埗瀛楁锛屼笖瀛楁鍊间笌鎺у埗鍊肩浉绛夋椂锛屾寜閽細绂佺敤锛屽涓�肩敤閫楀彿鍒嗛殧銆�',
+      initVal: card.controlVal || '',
+      required: false
     }
   ]
 }
@@ -1015,10 +1274,24 @@
 /**
  * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭�
  * @param {object} card       // 鎼滅储鏉′欢瀵硅薄
- * @param {Array}  roleList   // 瑙掕壊鍒楄〃-榛戝悕鍗�
  * @param {Array}  menulist   // 鑿滃崟鍒楄〃-鐢ㄤ簬瀛楁閫忚
  */
-export function getColumnForm (card, roleList = [], menulist = []) {
+export function getColumnForm (card, menulist = [], fields = []) {
+  let roleList = sessionStorage.getItem('sysRoles')
+  if (roleList) {
+    try {
+      roleList = JSON.parse(roleList)
+    } catch {
+      roleList = []
+    }
+  } else {
+    roleList = []
+  }
+
+  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
+    card.perspective = ''
+  }
+
   return [
     {
       type: 'text',
@@ -1056,6 +1329,9 @@
       }, {
         value: 'textarea',
         text: Formdict['model.form.textarea']
+      }, {
+        value: 'index',
+        text: '搴忓彿'
       }]
     },
     {
@@ -1140,7 +1416,7 @@
       key: 'rowspan',
       label: '琛屽悎骞�',
       initVal: card.rowspan || 'false',
-      tooltip: '鐩搁偦琛屼俊鎭浉鍚屾椂锛屽崟鍏冩牸鍚堝苟銆傛敞锛氫负闃叉琛ㄦ牸淇℃伅閿欎贡锛岃鍚堝苟鍙兘娣诲姞涓�涓瓧娈点��',
+      tooltip: '鐩搁偦琛屼俊鎭浉鍚屾椂锛屽崟鍏冩牸鍚堝苟銆�',
       required: false,
       options: [{
         value: 'true',
@@ -1196,6 +1472,9 @@
       }, {
         value: 'percent',
         text: '鐧惧垎姣�'
+      }, {
+        value: 'abs',
+        text: '缁濆鍊�'
       }],
       required: false
     },
@@ -1260,12 +1539,43 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'perspective',
+      label: '瀛楁閫忚',
+      initVal: card.perspective || '',
+      options: [{
+        value: '',
+        text: '鏃�'
+      }, {
+        value: 'linkmenu',
+        text: '鑿滃崟'
+      }, {
+        value: 'linkurl',
+        text: '閾炬帴'
+      }]
+    },
+    {
       type: 'cascader',
       key: 'linkmenu',
-      label: Formdict['model.form.linkmenu'],
+      label: Formdict['model.menu'],
       initVal: card.linkmenu || [],
-      required: false,
+      required: true,
       options: menulist
+    },
+    {
+      type: 'textarea',
+      key: 'linkurl',
+      label: '閾炬帴鍦板潃',
+      initVal: card.linkurl || '',
+      required: true
+    },
+    {
+      type: 'multiselect',
+      key: 'linkfields',
+      label: '鍏宠仈瀛楁',
+      initVal: card.linkfields || [],
+      required: false,
+      options: fields
     },
     {
       type: 'multiselect',
@@ -1281,12 +1591,22 @@
 /**
  * @description 鑾峰彇鍥捐〃瑙嗗浘澶栭儴閰嶇疆琛ㄥ崟
  * @param {object} card         // 鎼滅储鏉′欢瀵硅薄
- * @param {Array}  roleList     // 瑙掕壊鍒楄〃-榛戝悕鍗�
  * @param {Array}  columns      // 鏄剧ず鍒�
  * @param {Array}  actions      // 鎸夐挳缁別xcel
  * @param {Array}  extraActions // 甯歌鎸夐挳
  */
-export function getChartViewForm (card, roleList = [], _columns, actions, extraActions) {
+export function getChartViewForm (card, _columns, actions, extraActions) {
+  let roleList = sessionStorage.getItem('sysRoles')
+  if (roleList) {
+    try {
+      roleList = JSON.parse(roleList)
+    } catch {
+      roleList = []
+    }
+  } else {
+    roleList = []
+  }
+
   let _charts = [{
     value: 'line',
     text: '鎶樼嚎鍥�'
@@ -1707,13 +2027,13 @@
       required: true
     }, {
       type: 'number',
-      key: 'correction',
-      label: '鏁版嵁淇',
-      tooltip: '褰撴暟鎹」灏戜簬璁剧疆鍊兼椂锛岀郴缁熶細鑷姩淇锛堥伩鍏嶆煴褰㈠浘杩囧锛�,鍦ㄨ嚜瀹氫箟涓紝璁剧疆涓烘姌绾垮浘鏃跺け鏁堛��',
+      key: 'barSize',
+      label: '鏌卞舰瀹藉害',
+      tooltip: '绌哄�兼椂锛屽搴﹁嚜閫傚簲銆�',
       min: 5,
-      max: 30,
+      max: 100,
       decimal: 0,
-      initVal: card.correction,
+      initVal: card.barSize,
       forbid: !['bar'].includes(card.chartType),
       required: false
     }
@@ -1724,24 +2044,153 @@
  * @description 鑾峰彇琛ㄥ崟閰嶇疆淇℃伅
  * @param {*} card            // 琛ㄥ崟瀵硅薄
  * @param {*} inputfields     // 鍙叧鑱旇〃鍗�
+ * @param {*} tabfields       // 鍙垏鎹㈣〃鍗�
  * @param {*} linkableFields  // 鍙叧鑱旇〃鍗�
  * @param {*} linksupFields   // 涓婄骇琛ㄥ崟
  * @param {*} subtable        // 鏄惁涓哄瓙琛ㄨ〃鍗�
- * @param {*} roleList        // 瑙掕壊鍒楄〃-榛戝悕鍗�
  */
-export function getModalForm (card, inputfields, linkableFields, linksupFields, subtable = false, roleList = []) {
-  let _openType = []
+export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, subtable = false) {
+  let appType = sessionStorage.getItem('appType')
+  let roleList = sessionStorage.getItem('sysRoles')
+  if (roleList) {
+    try {
+      roleList = JSON.parse(roleList)
+      roleList = roleList.map(role => {
+        return {
+          uuid: role.uuid,
+          field: role.value,
+          label: role.text
+        }
+      })
+    } catch {
+      roleList = []
+    }
+  } else {
+    roleList = []
+  }
+  
+  let _openType = [{
+    value: 'text',
+    text: Formdict['model.form.text']
+  }, {
+    value: 'number',
+    text: Formdict['model.form.number']
+  }, {
+    value: 'select',
+    text: Formdict['model.form.select']
+  }, {
+    value: 'multiselect',
+    text: Formdict['model.form.multiselect']
+  }, {
+    value: 'link',
+    text: Formdict['model.form.link']
+  }, {
+    value: 'switch',
+    text: '寮�鍏�'
+  }, {
+    value: 'checkbox',
+    text: '澶氶�夋'
+  }, {
+    value: 'radio',
+    text: '鍗曢�夋'
+  }, {
+    value: 'checkcard',
+    text: '閫夐」鍗�'
+  }, {
+    value: 'fileupload',
+    text: Formdict['header.form.fileupload']
+  }, {
+    value: 'date',
+    text: Formdict['model.form.dateday']
+  }, {
+    value: 'datemonth',
+    text: Formdict['model.form.datemonth']
+  }, {
+    value: 'datetime',
+    text: Formdict['model.form.datetime']
+  }, {
+    value: 'textarea',
+    text: Formdict['model.form.textarea']
+  }, {
+    value: 'color',
+    text: Formdict['model.form.color']
+  }, {
+    value: 'brafteditor',
+    text: '瀵屾枃鏈�'
+  }, {
+    value: 'funcvar',
+    text: Formdict['header.form.funcvar']
+  }, {
+    value: 'hint',
+    text: '鎻愮ず'
+  }, {
+    value: 'split',
+    text: '鍒嗛殧绾�'
+  }]
+
   let _fieldlength = 50
 
-  if (subtable) {
+  if (appType === 'mob') {
+    _openType = [{
+      value: 'text',
+      text: Formdict['model.form.text']
+    }, {
+      value: 'number',
+      text: Formdict['model.form.number']
+    }, {
+      value: 'select',
+      text: '閫夋嫨鍣�'
+    }, {
+      value: 'link',
+      text: Formdict['model.form.link']
+    }, {
+      value: 'switch',
+      text: '寮�鍏�'
+    }, {
+      value: 'checkbox',
+      text: '澶氶�夋'
+    }, {
+      value: 'radio',
+      text: '鍗曢�夋'
+    }, {
+      value: 'checkcard',
+      text: '閫夐」鍗�'
+    }, {
+      value: 'fileupload',
+      text: Formdict['header.form.fileupload']
+    }, {
+      value: 'date',
+      text: Formdict['model.form.dateday']
+    }, {
+      value: 'datemonth',
+      text: Formdict['model.form.datemonth']
+    }, {
+      value: 'datetime',
+      text: Formdict['model.form.datetime']
+    }, {
+      value: 'textarea',
+      text: Formdict['model.form.textarea']
+    }, {
+      value: 'funcvar',
+      text: Formdict['header.form.funcvar']
+    }, {
+      value: 'hint',
+      text: '鎻愮ず'
+    }, {
+      value: 'split',
+      text: '鍒嗛殧绾�'
+    }]
+  } else if (subtable) {
     _openType.push({
       value: 'linkMain',
       text: Formdict['header.form.linkMain']
     })
   }
 
-  if (card.type === 'textarea' || card.type === 'fileupload' || card.type === 'multiselect' || card.type === 'checkbox') {
+  if (['fileupload', 'multiselect', 'checkbox'].includes(card.type)) {
     _fieldlength = 512
+  } else if (['textarea', 'brafteditor'].includes(card.type)) {
+    _fieldlength = 8000
   }
 
   return [
@@ -1767,65 +2216,13 @@
       label: Formdict['model.form.type'],
       initVal: card.type,
       required: true,
-      options: [{
-        value: 'text',
-        text: Formdict['model.form.text']
-      }, {
-        value: 'number',
-        text: Formdict['model.form.number']
-      }, {
-        value: 'select',
-        text: Formdict['model.form.select']
-      }, {
-        value: 'multiselect',
-        text: Formdict['model.form.multiselect']
-      }, {
-        value: 'link',
-        text: Formdict['model.form.link']
-      }, {
-        value: 'switch',
-        text: '寮�鍏�'
-      }, {
-        value: 'checkbox',
-        text: '澶氶�夋'
-      }, {
-        value: 'radio',
-        text: '鍗曢�夋'
-      }, {
-        value: 'checkcard',
-        text: '閫夐」鍗�'
-      }, {
-        value: 'fileupload',
-        text: Formdict['header.form.fileupload']
-      }, {
-        value: 'date',
-        text: Formdict['model.form.dateday']
-      }, {
-        value: 'datemonth',
-        text: Formdict['model.form.datemonth']
-      }, {
-        value: 'datetime',
-        text: Formdict['model.form.datetime']
-      }, {
-        value: 'textarea',
-        text: Formdict['model.form.textarea']
-      }, {
-        value: 'hint',
-        text: '鎻愮ず'
-      }, {
-        value: 'color',
-        text: Formdict['model.form.color']
-      }, {
-        value: 'funcvar',
-        text: Formdict['header.form.funcvar']
-      },
-      ..._openType]
+      options: _openType
     },
     {
       type: 'text',
       key: 'initval',
       label: Formdict['header.form.initval'],
-      tooltip: '涓嬫媺澶氶�変笌澶氶�夋锛屾坊鍔犲涓垵濮嬪�艰浣跨敤鈥�,鈥濆彿鍒嗛殧銆�',
+      tooltip: '涓嬫媺澶氶�変笌澶氶�夋锛屾坊鍔犲涓垵濮嬪�艰浣跨敤鈥�,鈥濆彿鍒嗛殧銆傛敞锛氫笅鎷夐�夋嫨銆佽仈鍔ㄨ彍鍗曟垨鍗曢�夋涓�$first琛ㄧず閫夋嫨绗竴椤�',
       initVal: card.initval || '',
       required: false
     },
@@ -1842,14 +2239,30 @@
       key: 'openVal',
       label: '寮�鍚��',
       initVal: card.openVal || '',
-      required: true
+      required: false
     },
     {
       type: 'text',
       key: 'closeVal',
       label: '鍏抽棴鍊�',
       initVal: card.closeVal || '',
-      required: true
+      required: false
+    },
+    {
+      type: 'text',
+      key: 'openText',
+      label: '寮�鍚彁绀�',
+      initVal: card.openText || '',
+      required: false,
+      forbid: appType === 'mob'
+    },
+    {
+      type: 'text',
+      key: 'closeText',
+      label: '鍏抽棴鎻愮ず',
+      initVal: card.closeText || '',
+      required: false,
+      forbid: appType === 'mob'
     },
     {
       type: 'radio',
@@ -1882,6 +2295,9 @@
     {
       type: 'number',
       key: 'width',
+      min: 1,
+      max: 24,
+      precision: 0,
       label: '鍗$墖瀹藉害',
       initVal: card.width || 4,
       tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
@@ -1926,7 +2342,7 @@
     {
       type: 'radio',
       key: 'setAll',
-      label: Formdict['header.form.setAll'],
+      label: '璁剧疆绌哄��',
       initVal: card.setAll || 'false',
       options: [{
         value: 'true',
@@ -2023,6 +2439,9 @@
     {
       type: 'number',
       key: 'decimal',
+      min: 0,
+      max: 18,
+      precision: 0,
       label: Formdict['header.form.decimal'],
       initVal: card.decimal || 0,
       required: true
@@ -2044,6 +2463,9 @@
     {
       type: 'number',
       key: 'fieldlength',
+      min: 1,
+      max: 1000000,
+      precision: 0,
       label: Formdict['model.form.field'] + Formdict['model.length'],
       tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512',
       initVal: card.fieldlength || _fieldlength,
@@ -2052,8 +2474,12 @@
     {
       type: 'number',
       key: 'maxRows',
-      label: Formdict['header.form.maxRows'],
-      initVal: card.maxRows || 6,
+      min: 1,
+      max: 100,
+      precision: 0,
+      label: appType === 'mob' ? '琛屾暟' : Formdict['header.form.maxRows'],
+      tooltip: appType === 'mob' ? '琛屾暟涓虹┖鏃讹紝楂樺害鑷�傚簲' : '',
+      initVal: card.maxRows || (appType === 'mob' ? '' : 6),
       required: false
     },
     {
@@ -2079,24 +2505,41 @@
       type: 'select',
       key: 'fileType',
       label: '鏄剧ず鏂瑰紡',
-      initVal: card.fileType || 'text',
+      initVal: card.fileType || (appType === 'mob' ? 'picture-card' : 'text'),
       options: [{
+        value: 'text',
+        text: '鏂囦欢'
+      }, {
         value: 'picture',
         text: '鍥炬枃淇℃伅'
       }, {
         value: 'picture-card',
         text: '鍥剧墖鍗�'
-      }, {
-        value: 'text',
-        text: '鏂囦欢'
       }]
     },
     {
       type: 'number',
       key: 'maxfile',
+      min: 0,
+      max: 1000,
+      precision: 0,
       label: '鏈�澶ф枃浠舵暟',
       initVal: card.maxfile || '',
+      tooltip: '绛変簬0鏃朵笉鍋氶檺鍒躲��',
       required: false
+    },
+    {
+      type: 'radio',
+      key: 'hidelabel',
+      label: '闅愯棌鍚嶇О',
+      initVal: card.hidelabel || 'false',
+      options: [{
+        value: 'true',
+        text: Formdict['model.true']
+      }, {
+        value: 'false',
+        text: Formdict['model.false']
+      }]
     },
     {
       type: 'radio',
@@ -2152,6 +2595,34 @@
     },
     {
       type: 'radio',
+      key: 'cursor',
+      label: '鍏夋爣',
+      initVal: card.cursor || 'left',
+      options: [{
+        value: 'right',
+        text: '鍙冲榻�'
+      }, {
+        value: 'left',
+        text: '宸﹀榻�'
+      }],
+      forbid: appType !== 'mob'
+    },
+    {
+      type: 'radio',
+      key: 'scan',
+      label: '鎵爜',
+      initVal: card.scan || 'false',
+      options: [{
+        value: 'true',
+        text: '鍚敤'
+      }, {
+        value: 'false',
+        text: '涓嶅惎鐢�'
+      }],
+      forbid: appType !== 'mob'
+    },
+    {
+      type: 'radio',
       key: 'readin',
       label: Formdict['header.form.readin'],
       tooltip: Formdict['header.form.readin.tooltip'],
@@ -2179,24 +2650,130 @@
       }]
     },
     {
+      type: 'color',
+      key: 'backgroundColor',
+      label: '鑳屾櫙鑹�',
+      initVal: card.backgroundColor || '',
+      required: false
+    },
+    {
+      type: 'color',
+      key: 'borderColor',
+      label: '杈规棰滆壊',
+      initVal: card.borderColor || '',
+      required: false
+    },
+    {
       type: 'radio',
-      key: 'entireLine',
-      label: '鍗犳嵁鏁磋',
-      initVal: card.entireLine || 'false',
-      required: false,
+      key: 'declareType',
+      label: '鏁版嵁绫诲瀷',
+      tooltip: '澹版槑鍙橀噺鏃剁殑绫诲瀷锛屾椂闂存牸寮廳atetime鎴栨枃鏈牸寮弉varchar(50)銆�',
+      initVal: card.declareType || 'datetime',
+      options: [{
+        value: 'datetime',
+        text: 'datetime'
+      }, {
+        value: 'nvarchar(50)',
+        text: 'nvarchar(50)'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'mode',
+      label: '妯″紡',
+      initVal: card.mode || 'picker',
+      options: [{
+        value: 'picker',
+        text: '閫夋嫨鍣�'
+      }, {
+        value: 'calendar',
+        text: '鏃ュ巻'
+      }],
+      forbid: appType !== 'mob'
+    },
+    {
+      type: 'number',
+      key: 'span',
+      min: 1,
+      max: 24,
+      precision: 0,
+      label: '琛ㄥ崟瀹藉害',
+      initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12),
+      tooltip: '鏍呮牸甯冨眬鏁磋24绛夊垎銆�',
+      required: true,
+      forbid: appType === 'mob'
+    },
+    {
+      type: 'number',
+      key: 'labelwidth',
+      min: 1,
+      max: 100,
+      precision: 1,
+      label: '鍚嶇О瀹藉害',
+      initVal: card.labelwidth || 33.3,
+      tooltip: '鍚嶇О鍗犳嵁琛ㄥ崟瀹藉害鐨勭櫨鍒嗘瘮銆傛敞锛氬瓨鍦ㄥ鍒楄〃鍗曟椂锛屽綋鍓嶈〃鍗曞鏋滄兂瑕佸崰鎹暣琛屽彲鍙傜収浠ヤ笅姣斾緥锛屼袱鍒楋紙16.2锛夈�佷笁鍒楋紙10.5锛夈�佸洓鍒楋紙7.7锛�',
+      required: true,
+      forbid: appType === 'mob'
+    },
+    {
+      type: 'radio',
+      key: 'compress',
+      label: '鍘嬬缉',
+      initVal: card.compress || 'false',
+      tooltip: '鏂囦欢鍘嬬缉蹇呴』涓哄浘鐗囷紝鍥剧墖鏍煎紡涓簀pg銆乸ng銆乬if 鎴� jpeg',
       options: [{
         value: 'true',
-        text: '鏄�'
+        text: Formdict['model.true']
       }, {
         value: 'false',
-        text: '鍚�'
+        text: Formdict['model.false']
       }]
+    },
+    {
+      type: 'number',
+      key: 'limit',
+      min: 0.01,
+      max: 1000,
+      precision: 2,
+      label: '璧风偣锛圡锛�',
+      initVal: card.limit || 2,
+      tooltip: '鍘嬬缉璧风偣锛屽皬浜庤捣鐐瑰�肩殑鏂囦欢涓嶈繘琛屽帇缂┿��',
+      required: true
+    },
+    {
+      type: 'textarea',
+      key: 'rduri',
+      label: '杞瓨鎺ュ彛',
+      rows: 1,
+      initVal: card.rduri || '',
+      tooltip: '鍥剧墖杞瓨鍦ㄥ悓涓�鍗曠偣鏈嶅姟鍣ㄤ笅鐨勫叾浠栦笟鍔$郴缁熴��',
+      required: false,
+      readonly: false
+    },
+    {
+      type: 'textarea',
+      key: 'proRduri',
+      label: '姝e紡鎺ュ彛',
+      rows: 1,
+      initVal: card.proRduri || '',
+      tooltip: '姝e紡绯荤粺杞瓨鎺ュ彛锛屽浘鐗囪浆瀛樺湪鍚屼竴鍗曠偣鏈嶅姟鍣ㄤ笅鐨勫叾浠栦笟鍔$郴缁熴��',
+      required: false,
+      readonly: false
+    },
+    {
+      type: 'text',
+      key: 'suffix',
+      label: '鍚庣紑鍚�',
+      tooltip: '鍙互涓婁紶鏂囦欢鐨勫悗缂�鍚嶏紝澶氫釜绫诲瀷鐢ㄩ�楀彿鍒嗛殧锛岀┖鍊兼椂涓嶆牎楠屻��',
+      initVal: card.suffix || '',
+      required: false,
+      readonly: false
     },
     {
       type: 'radio',
       key: 'encryption',
       label: '鍔犲瘑浼犺緭',
-      initVal: card.encryption || 'false',
+      initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'),
       options: [{
         value: 'true',
         text: Formdict['model.true']
@@ -2208,7 +2785,7 @@
     {
       type: 'radio',
       key: 'interception',
-      label: '鎴彇',
+      label: '鎴彇绌烘牸',
       initVal: card.interception || 'false',
       tooltip: '鎻愪氦鏃讹紝鏄惁鎴彇棣栧熬鐨勭┖鐧藉瓧绗︺��',
       options: [{
@@ -2218,6 +2795,21 @@
         value: 'false',
         text: Formdict['model.false']
       }]
+    },
+    {
+      type: 'radio',
+      key: 'count',
+      label: '璁℃暟鍔熻兘',
+      initVal: card.count || 'false',
+      tooltip: '鏄剧ず杈撳叆鐨勫瓧绗︽暟锛岃缃鏁版椂鐢熸晥锛屾敞锛氬姞瀵嗕紶杈撴椂鏈�澶у�间笌瀛楁闀垮害涓嶇瓑銆�',
+      options: [{
+        value: 'true',
+        text: '寮�鍚�'
+      }, {
+        value: 'false',
+        text: '鍏抽棴'
+      }],
+      forbid: appType !== 'mob'
     },
     {
       type: 'select',
@@ -2239,20 +2831,63 @@
       readonly: false
     },
     {
-      type: 'multiselect',
-      key: 'linkSubField',
-      label: Formdict['model.form.linkform'],
-      tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑銆�',
-      initVal: card.linkSubField || [],
-      options: inputfields
+      type: 'text',
+      key: 'tooltip',
+      label: '鎮诞鎻愮ず',
+      tooltip: '榧犳爣鎮诞浜庢彁绀烘枃瀛椾笂鏂规椂锛屾樉绀烘彁绀轰俊鎭��',
+      initVal: card.tooltip || '',
+      required: false,
+      forbid: appType === 'mob'
     },
     {
       type: 'text',
-      key: 'tooltip',
-      label: '琛ㄥ崟娉ㄩ噴',
-      tooltip: '榧犳爣鎮诞浜庢彁绀烘枃瀛椾笂鏂规椂锛屾樉绀烘敞閲娿��',
-      initVal: card.tooltip || '',
+      key: 'extra',
+      label: '搴曢儴鎻愮ず',
+      tooltip: '鏄剧ず浜庤〃鍗曞簳閮ㄣ��',
+      initVal: card.extra || '',
+      required: false,
+      forbid: appType === 'mob'
+    },
+    {
+      type: 'text',
+      key: 'emptyText',
+      label: '绌哄�兼枃鏈�',
+      tooltip: '绌哄�肩殑鎻愮ず鏂囨湰锛岄�夋嫨璁剧疆绌哄�兼椂鏈夋晥锛岄粯璁ゅ�间负銆婄┖銆嬨��',
+      initVal: card.emptyText || '',
       required: false
+    },
+    {
+      type: 'radio',
+      key: 'enter',
+      label: '鍥炶溅浜嬩欢',
+      initVal: (card.type === 'text' || card.type === 'number') ? (card.enter || 'sub') : (card.enter || 'false'),
+      tooltip: '鐐瑰嚮Enter閿紝鎴栨枃鏈被琛ㄥ崟杈撳叆鍥炶溅绗︺��',
+      options: [{
+        value: 'sub',
+        text: '鎻愪氦'
+      }, {
+        value: 'tab',
+        text: '鍒囨崲'
+      }, {
+        value: 'false',
+        text: '鏃犲姩浣�'
+      }]
+    },
+    {
+      type: 'select',
+      key: 'tabField',
+      label: '鍒囨崲瀛楁',
+      initVal: card.tabField || '',
+      options: tabfields,
+      required: false
+    },
+    {
+      type: 'multiselect',
+      key: 'linkSubField',
+      label: Formdict['model.form.linkform'],
+      tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑銆傛敞锛氫娇鐢ㄩ�夐」鍗′笖璁句负鍙閫夋椂鏃犳晥銆�',
+      initVal: card.linkSubField || [],
+      options: inputfields
     },
     {
       type: 'multiselect',
@@ -2283,17 +2918,17 @@
       initVal: card.label || '',
       required: true
     },
-    {
-      type: 'select',
-      key: 'type',
-      label: Formdict['model.form.tabType'],
-      initVal: card.type || 'SubTable',
-      required: true,
-      options: [{
-        value: 'SubTable',
-        text: Formdict['model.menu.tab.subtable']
-      }]
-    },
+    // {
+    //   type: 'select',
+    //   key: 'type',
+    //   label: Formdict['model.form.tabType'],
+    //   initVal: card.type || 'SubTable',
+    //   required: true,
+    //   options: [{
+    //     value: 'SubTable',
+    //     text: Formdict['model.menu.tab.subtable']
+    //   }]
+    // },
     {
       type: 'select',
       key: 'linkTab',

--
Gitblit v1.8.0