From cbeffcc0902631909c0373f274752a97ddaf2d4e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 06 八月 2022 01:41:54 +0800
Subject: [PATCH] 2022-08-06

---
 src/templates/zshare/formconfig.jsx |  818 +++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 583 insertions(+), 235 deletions(-)

diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index d57f0c6..d9700d5 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -1,6 +1,6 @@
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
-import { formRule } from '@/utils/option.js'
+import { formRule, btnClasses } from '@/utils/option.js'
 
 const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
 
@@ -13,6 +13,17 @@
 export function getTreeSettingForm (setting, usefulFields = [], MenuID) {
   let str = '^(' + usefulFields.join('|') + ')'
   let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
+  let rules = [{
+    max: formRule.func.max,
+    message: formRule.func.maxMessage
+  }]
+
+  if (usefulFields.length > 0) {
+    rules.push({
+      pattern: _patten,
+      message: formRule.func.innerMessage
+    })
+  }
 
   return [
     {
@@ -103,19 +114,11 @@
       key: 'innerFunc',
       label: Formdict['header.form.innerFunc'],
       initVal: setting.innerFunc || '',
-      tooltip: '寮�澶村彲鐢ㄥ瓧绗︼細' + usefulFields.join(', '),
+      tooltip: usefulFields.length ? '寮�澶村彲鐢ㄥ瓧绗︼細' + usefulFields.join(', ') : '',
       placement: 'bottomLeft',
       required: false,
       readonly: false,
-      rules: [
-        {
-          pattern: _patten,
-          message: formRule.func.innerMessage
-        }, {
-          max: formRule.func.max,
-          message: formRule.func.maxMessage
-        }
-      ]
+      rules: rules
     },
     {
       type: 'datasource',
@@ -286,7 +289,7 @@
  * @param {object} card           // 鎼滅储鏉′欢瀵硅薄
  * @param {Array}  linkableFields // 鍙叧鑱斿瓧娈�
  */
-export function getSearchForm (card, linkableFields) {
+export function getSearchForm (card, linkableFields, columns, position) {
   let roleList = sessionStorage.getItem('sysRoles')
   let appType = sessionStorage.getItem('appType')
   if (roleList) {
@@ -302,6 +305,14 @@
   let typeOptions = []
 
   if (appType === 'mob') {
+    // let adapters = sessionStorage.getItem('adapter')
+    // if (adapters) {
+    //   adapters = adapters.split(',')
+    // } else {
+    //   adapters = []
+    // }
+    // (adapters.includes('wxmini') ? '(灏忕▼搴忔殏涓嶆敮鎸�)' : '')
+
     typeOptions = [{
       value: 'range',
       text: '鏁板�硷紙鍖洪棿锛�'
@@ -310,7 +321,7 @@
       text: '閫夐」鍗�'
     }, {
       value: 'date',
-      text: Formdict['model.form.dateday']
+      text: '鏃ユ湡锛堝ぉ锛�'
     }, {
       value: 'datemonth',
       text: Formdict['model.form.datemonth']
@@ -318,6 +329,7 @@
     //   value: 'daterange',
     //   text: Formdict['model.form.daterange']
     }]
+
   } else {
     typeOptions = [{
       value: 'text',
@@ -336,10 +348,10 @@
       text: '閫夐」鍗�'
     }, {
       value: 'date',
-      text: Formdict['model.form.dateday']
+      text: '鏃ユ湡锛堝ぉ锛�'
     }, {
       value: 'dateweek',
-      text: Formdict['model.form.dateweek']
+      text: '鏃ユ湡锛堝懆锛�'
     }, {
       value: 'datemonth',
       text: Formdict['model.form.datemonth']
@@ -364,23 +376,31 @@
     }
   }
 
+  let options = card.options || []
+  if (['select', 'link'].includes(card.type) && card.setAll === 'true') { // 鍏煎
+    options.unshift({
+      key: 'empty',
+      Value: '',
+      Text: '鍏ㄩ儴',
+      ParentID: ''
+    })
+  }
+
   return [
     {
       type: 'text',
       key: 'label',
       label: Formdict['model.name'],
       initVal: card.label || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
       key: 'field',
       label: Formdict['model.form.field'],
       initVal: card.field || '',
-      tooltipClass: 'middle',
       required: true,
-      readonly: false
+      options: columns
     },
     {
       type: 'select',
@@ -395,8 +415,7 @@
       key: 'datefield',
       label: '鏃堕棿瀛楁',
       initVal: card.datefield || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
@@ -420,19 +439,19 @@
         text: Formdict['header.form.datasource']
       }]
     },
-    {
-      type: 'radio',
-      key: 'setAll',
-      label: '璁剧疆鍏ㄩ儴',
-      initVal: card.setAll || 'true',
-      options: [{
-        value: 'true',
-        text: Formdict['model.true']
-      }, {
-        value: 'false',
-        text: Formdict['model.false']
-      }]
-    },
+    // {
+    //   type: 'radio',
+    //   key: 'setAll',
+    //   label: '璁剧疆鍏ㄩ儴',
+    //   initVal: card.setAll || 'true',
+    //   options: [{
+    //     value: 'true',
+    //     text: Formdict['model.true']
+    //   }, {
+    //     value: 'false',
+    //     text: Formdict['model.false']
+    //   }]
+    // },
     {
       type: 'radio',
       key: 'display',
@@ -445,6 +464,9 @@
       }, {
         value: 'picture',
         text: '鍥剧墖'
+      }, {
+        value: 'color',
+        text: '鑹插潡'
       }]
     },
     {
@@ -463,16 +485,14 @@
       key: 'cardValField',
       label: '鍊悸峰瓧娈�',
       initVal: card.cardValField || 'Value',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
       key: 'urlField',
       label: '鍦板潃瀛楁',
       initVal: card.urlField || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'radio',
@@ -499,24 +519,21 @@
       key: 'fields',
       label: '瀛楁闆�',
       initVal: card.fields || [],
-      required: true,
-      readonly: false
+      required: true
     },
     {
-      type: 'textarea',
+      type: 'codemirror',
       key: 'dataSource',
       label: Formdict['header.form.datasource'],
       initVal: card.dataSource || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'options',
       key: 'options',
       label: '閫夐」',
-      initVal: card.options || [],
-      required: true,
-      readonly: false
+      initVal: options,
+      required: true
     },
     {
       type: 'checkbox',
@@ -524,7 +541,6 @@
       label: '閫夐」',
       initVal: card.items || ['day', 'week', 'month', 'quarter', 'year', 'customized'],
       required: true,
-      readonly: false,
       options: [{
         value: 'day',
         label: '鏃�'
@@ -546,12 +562,26 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'multiple',
+      label: '閫夋嫨褰㈠紡',
+      initVal: card.multiple || 'false',
+      required: true,
+      options: [{
+        value: 'false',
+        text: '鍗曢��'
+      }, {
+        value: 'true',
+        text: '澶氶��'
+      }]
+    },
+    {
       type: 'select',
       key: 'linkField',
       label: '鍏宠仈瀛楁',
       initVal: card.linkField || '',
       required: true,
-      readonly: false,
+      allowClear: true,
       options: linkableFields
     },
     {
@@ -559,24 +589,21 @@
       key: 'valueField',
       label: '鍊悸峰瓧娈�',
       initVal: card.valueField || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
       key: 'valueText',
       label: '鏂囨湰路瀛楁',
       initVal: card.valueText || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
       key: 'orderBy',
       label: '鎺掑簭路瀛楁',
       initVal: card.orderBy || '',
-      required: false,
-      readonly: false
+      required: false
     },
     {
       type: 'select',
@@ -639,17 +666,34 @@
       required: false
     },
     {
-      type: 'radio',
-      key: 'multiple',
-      label: '鍙閫�',
-      initVal: card.multiple || 'false',
+      type: 'number',
+      key: 'labelwidth',
+      min: 1,
+      max: 100,
+      precision: 1,
+      label: '鍚嶇О瀹藉害',
+      initVal: card.labelwidth || 33.3,
+      tooltip: '鍚嶇О鍗犳嵁鎼滅储鏉′欢瀹藉害鐨勭櫨鍒嗘瘮銆傛敞锛氬瓨鍦ㄥ鍒楁悳绱㈡椂锛屽綋鍓嶆悳绱㈠鏋滄兂瑕佸崰鎹暣琛屽彲鍙傜収浠ヤ笅姣斾緥锛屼袱鍒楋紙16.5锛夈�佷笁鍒楋紙10.8锛夈�佸洓鍒楋紙8锛�',
       required: true,
+      forbid: appType === 'mob'
+    },
+    {
+      type: 'radio',
+      key: 'precision',
+      label: '绮剧‘搴�',
+      initVal: card.precision || 'day',
       options: [{
-        value: 'true',
-        text: '鏄�'
+        value: 'day',
+        text: '澶�'
       }, {
-        value: 'false',
-        text: '鍚�'
+        value: 'hour',
+        text: '灏忔椂'
+      }, {
+        value: 'minute',
+        text: '鍒嗛挓'
+      }, {
+        value: 'second',
+        text: '绉�'
       }]
     },
     {
@@ -749,7 +793,8 @@
       key: 'advanced',
       label: '楂樼骇鎼滅储',
       initVal: card.advanced || 'false',
-      forbid: appType === 'mob',
+      tooltip: '鍦ㄩ珮绾ф悳绱互妯℃�佹鎴栨娊灞夊睍寮�鏃讹紝鎼滅储鏉′欢鍦ㄥ紑鍙戠晫闈㈠崰姣斾负6锛屽疄闄呮晥鏋滆鍦ㄨ繍琛屾椂鏌ョ湅銆�',
+      forbid: appType === 'mob' || position === 'header',
       options: [{
         value: 'true',
         text: Formdict['model.true']
@@ -788,19 +833,29 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'selectStyle',
+      label: '閫変腑鏁堟灉',
+      tooltip: '鑳屾櫙鍙婃枃瀛楀彉鍖栨椂浼氫娇鐢ㄧ郴缁熻壊銆�',
+      initVal: card.selectStyle || (card.backgroundColor ? 'custom' : 'background'),
+      options: [{
+        value: 'background',
+        text: '鑳屾櫙鍙樺寲'
+      }, {
+        value: 'font',
+        text: '鏂囧瓧鍙樺寲'
+      }, {
+        value: 'custom',
+        text: '鑷畾涔�'
+      }]
+    },
+    {
       type: 'color',
       key: 'backgroundColor',
       label: '鑳屾櫙鑹�',
       initVal: card.backgroundColor || '',
       tooltip: '璁剧疆鑳屾櫙鑹插悗锛岄�変腑鏁堟灉鐢辫儗鏅鑹叉帶鍒躲��',
-      required: false
-    },
-    {
-      type: 'color',
-      key: 'borderColor',
-      label: '杈规棰滆壊',
-      initVal: card.borderColor || '',
-      required: false
+      required: true
     },
     {
       type: 'multiselect',
@@ -808,7 +863,8 @@
       label: Formdict['header.form.blacklist'],
       initVal: card.blacklist || [],
       required: false,
-      options: roleList || []
+      options: roleList || [],
+      forbid: appType === 'mob'
     }
   ]
 }
@@ -820,7 +876,7 @@
  * @param {*} usefulFields   瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈�
  * @param {*} type           鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡
  */
-export function getActionForm (card, config, usefulFields, type, menulist = [], printTemps = []) {
+export function getActionForm (card, config, usefulFields, type, menulist = [], printTemps = [], tabs = []) {
   let columns = (config.columns || []).filter(col => col.field)
 
   let opentypes = [
@@ -864,6 +920,11 @@
     card.popClose = 'grid'
   }
 
+  if (card.OpenType === 'outerpage') {
+    card.pageTemplate = 'custom'
+    card.OpenType = 'innerpage'
+  }
+
   let refresh = []
 
   if (type === 'subtable') { // 瀛愯〃椤甸潰锛屽彲璁剧疆鍒锋柊涓昏〃鍙婂悓绾ф爣绛�
@@ -886,6 +947,10 @@
     card.control = 'disabled'
   }
 
+  if (card.intertype === 'outer' && !card.procMode && !card.innerFunc) { // 鍏煎澶栭儴鍑芥暟鐩翠紶绫诲瀷
+    card.procMode = 'none'
+  }
+
   return [
     {
       type: 'select',
@@ -894,6 +959,14 @@
       initVal: card.OpenType,
       required: true,
       options: opentypes
+    },
+    {
+      type: 'text',
+      key: 'label',
+      label: '鎸夐挳鍚嶇О',
+      initVal: card.label,
+      required: true,
+      readonly: false
     },
     {
       type: 'select',
@@ -910,7 +983,23 @@
       }, {
         value: 'closetab',
         text: '鏍囩鍏抽棴'
+      }, {
+        value: 'megvii',
+        text: '鏃疯闈㈡澘鏈�'
+      }, {
+        value: 'filezip',
+        text: '鏂囦欢鍘嬬缉鍖�'
       }]
+    },
+    { // 鏃疯闈㈡澘鏈烘帴鍙� 寰呮墿灞�
+      type: 'radio',
+      key: 'subFunc',
+      label: '鎺ュ彛鍚嶇О',
+      initVal: card.subFunc || 'addUser',
+      required: true,
+      options: [
+        { value: 'addUser', text: '娣诲姞鐢ㄦ埛' },
+      ]
     },
     {
       type: 'select',
@@ -941,7 +1030,8 @@
       type: 'radio',
       key: 'procMode',
       label: '鍙傛暟澶勭悊',
-      initVal: card.procMode || 'system',
+      initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'),
+      tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆�',
       required: true,
       options: [{
         value: 'system',
@@ -949,6 +1039,9 @@
       }, {
         value: 'inner',
         text: '鍐呴儴鍑芥暟'
+      }, {
+        value: 'none',
+        text: '鏃�'
       }]
     },
     {
@@ -958,14 +1051,6 @@
       initVal: card.sqlType || '',
       required: true,
       options: []
-    },
-    {
-      type: 'text',
-      key: 'label',
-      label: '鎸夐挳鍚嶇О',
-      initVal: card.label,
-      required: true,
-      readonly: false
     },
     {
       type: 'text',
@@ -979,10 +1064,18 @@
       key: 'innerFunc',
       label: Formdict['header.form.innerFunc'],
       initVal: card.innerFunc || '',
-      tooltip: `鍑芥暟鍚嶇О闇�浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬨�俙,
+      tooltip: usefulFields.length ? `鍑芥暟鍚嶇О闇�浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬨�俙 : '',
       fields: usefulFields,
-      tooltipClass: 'middle',
       required: card.intertype === 'inner',
+      readonly: false
+    },
+    {
+      type: 'text',
+      key: 'urlkey',
+      label: '鍦板潃瀛楁',
+      initVal: card.urlkey || '',
+      tooltip: '鍥剧墖锛堟枃浠讹級閾炬帴鐨勫瓧娈靛悕銆�',
+      required: false,
       readonly: false
     },
     {
@@ -991,7 +1084,13 @@
       label: '鍏宠仈鏍囩',
       initVal: card.linkTab || '',
       required: false,
-      options: []
+      options: [
+        {
+          value: '',
+          text: '鏂板缓'
+        },
+        ...tabs
+      ]
     },
     {
       type: 'select',
@@ -1102,7 +1201,7 @@
       type: 'radio',
       key: 'callbackType',
       label: '鍥炶皟鏂瑰紡',
-      initVal: card.callbackType || 'script',
+      initVal: card.callbackType || (card.callbackFunc ? 'func' : 'script'),
       tooltip: '浣跨敤鍚庡彴鑴氭湰鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��',
       required: true,
       options: [{
@@ -1111,6 +1210,12 @@
       }, {
         value: 'default',
         text: '鍚庡彴鑴氭湰'
+      }, {
+        value: 'func',
+        text: '鍥炶皟鍑芥暟'
+      }, {
+        value: 'none',
+        text: '鏃�'
       }]
     },
     {
@@ -1125,7 +1230,7 @@
       key: 'callbackFunc',
       label: Formdict['header.form.callbackFunc'],
       initVal: card.callbackFunc || '',
-      required: false,
+      required: true,
       readonly: false
     },
     {
@@ -1170,18 +1275,18 @@
       type: refresh.length === 0 ? 'radio' : 'select',
       key: 'execSuccess',
       label: Formdict['model.form.afterSuccess'],
-      initVal: card.execSuccess || 'never',
+      initVal: card.execSuccess || 'grid',
       tooltip: '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺��',
       required: true,
       options: [{
         value: 'never',
         text: '涓嶅埛鏂�'
       }, {
-        value: 'grid',
-        text: '鍒锋柊琛ㄦ牸'
-      }, {
         value: 'line',
         text: '鍒锋柊琛�'
+      }, {
+        value: 'grid',
+        text: '鍒锋柊琛ㄦ牸'
       },
       ...refresh]
     },
@@ -1196,11 +1301,11 @@
         value: 'never',
         text: '涓嶅埛鏂�'
       }, {
-        value: 'grid',
-        text: '鍒锋柊琛ㄦ牸'
-      }, {
         value: 'line',
         text: '鍒锋柊琛�'
+      }, {
+        value: 'grid',
+        text: '鍒锋柊琛ㄦ牸'
       },
       ...refresh]
     },
@@ -1246,7 +1351,7 @@
       label: Formdict['model.form.color'],
       initVal: card.class,
       required: false,
-      options: []
+      options: btnClasses
     },
     {
       type: 'cascader',
@@ -1261,8 +1366,16 @@
       type: 'text',
       key: 'output',
       label: '杩斿洖鍊�',
-      tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��',
+      tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�傜郴缁熷嚱鏁板彲鎸囧畾杩斿洖鐨勫彉閲忥紙浠绗﹀紑澶达紝濡侤id锛夛紱鑷畾涔夊嚱鏁板彲鎸囧畾杩斿洖瀛楁锛堝id锛夈��',
       initVal: card.output || '',
+      required: false
+    },
+    {
+      type: 'text',
+      key: 'tipTitle',
+      label: '纭鎻愮ず',
+      initVal: card.tipTitle || '',
+      tooltip: '娉細寮圭獥锛堣〃鍗曪級鍦ㄦ樉绀轰负鏄惁妗嗘椂鏈夋晥銆�',
       required: false
     },
     {
@@ -1332,11 +1445,11 @@
       type: 'number',
       key: 'ratio',
       min: 1,
-      max: 24,
+      max: 3000,
       precision: 0,
       label: '姣斾緥',
       initVal: card.ratio || 85,
-      tooltip: '灏忎簬100涓哄搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��',
+      tooltip: '妯℃�佹鎴栨娊灞夌殑瀹藉害锛屽皬浜�100涓虹獥鍙e搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��',
       required: true
     },
     {
@@ -1378,9 +1491,8 @@
       key: 'preFunc',
       label: '鍓嶇疆鍑芥暟',
       initVal: card.preFunc || '',
-      tooltip: `鍑芥暟鍚嶇О闇�浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬶紱鍓嶇疆鍑芥暟鎵ц瀹屾垚鍚庯紝缁撴灉浼氫紶鍏ュ唴閮ㄥ嚱鏁颁腑锛屾鏃跺唴閮ㄥ嚱鏁颁細寮傛鎵ц锛涘綋鍓嶇疆鍑芥暟杩斿洖涓璄rrCode绛変簬-1鏃讹紝灏嗕笉鍐嶆墽琛屽唴閮ㄥ嚱鏁般�俙,
+      tooltip: usefulFields.length ? `鍑芥暟鍚嶇О闇�浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬶紱鍓嶇疆鍑芥暟鎵ц瀹屾垚鍚庯紝缁撴灉浼氫紶鍏ュ唴閮ㄥ嚱鏁颁腑锛屾鏃跺唴閮ㄥ嚱鏁颁細寮傛鎵ц锛涘綋鍓嶇疆鍑芥暟杩斿洖涓璄rrCode绛変簬-1鏃讹紝灏嗕笉鍐嶆墽琛屽唴閮ㄥ嚱鏁般�俙 : '',
       fields: usefulFields,
-      tooltipClass: 'middle',
       required: false,
       readonly: false
     },
@@ -1418,6 +1530,42 @@
       initVal: card.controlVal || '',
       required: false
     },
+    {
+      type: 'text',
+      key: 'reason',
+      label: '绂佺敤鍘熷洜',
+      initVal: card.reason || '',
+      required: false
+    },
+    {
+      type: 'radio',
+      key: 'hidden',
+      label: '闅愯棌',
+      initVal: card.hidden || 'false',
+      tooltip: '闅愯棌鍚庢寜閽湪椤甸潰涓笉鏄剧ず锛屼笖涓嶅弬涓庢潈闄愬垎閰嶃��',
+      required: false,
+      options: [{
+        value: 'false',
+        text: '鍚�'
+      }, {
+        value: 'true',
+        text: '鏄�'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'progress',
+      label: '杩涘害鎻愮ず',
+      initVal: card.progress || 'number',
+      required: false,
+      options: [{
+        value: 'number',
+        text: '鍓╀綑鏁�'
+      }, {
+        value: 'progressbar',
+        text: '杩涘害鏉�'
+      }]
+    }
   ]
 }
 
@@ -1618,7 +1766,7 @@
         text: Formdict['model.empty']
       }, {
         value: 'thdSeparator',
-        text: Formdict['header.form.thdSeparator']
+        text: '鍗冨垎浣�'
       }, {
         value: 'percent',
         text: '鐧惧垎姣�'
@@ -2247,19 +2395,22 @@
     text: '閫夐」鍗�'
   }, {
     value: 'fileupload',
-    text: Formdict['header.form.fileupload']
+    text: '鏂囦欢涓婁紶'
   }, {
     value: 'date',
-    text: Formdict['model.form.dateday']
+    text: '鏃ユ湡锛堝ぉ锛�'
   }, {
     value: 'datemonth',
     text: Formdict['model.form.datemonth']
-  }, {
-    value: 'datetime',
-    text: Formdict['model.form.datetime']
+  // }, {
+  //   value: 'datetime',
+  //   text: '鏃ユ湡锛堝垎/绉掞級'
   }, {
     value: 'textarea',
     text: Formdict['model.form.textarea']
+  }, {
+    value: 'cascader',
+    text: '绾ц仈鑿滃崟'
   }, {
     value: 'rate',
     text: '璇勫垎'
@@ -2281,6 +2432,9 @@
   }, {
     value: 'linkMain',
     text: '鍏宠仈涓昏〃'
+  }, {
+    value: 'formula',
+    text: '鍏紡'
   }]
 
   let _fieldlength = 50
@@ -2312,19 +2466,22 @@
       text: '閫夐」鍗�'
     }, {
       value: 'fileupload',
-      text: Formdict['header.form.fileupload']
+      text: '鏂囦欢涓婁紶'
     }, {
       value: 'date',
-      text: Formdict['model.form.dateday']
+      text: '鏃ユ湡锛堝ぉ锛�'
     }, {
       value: 'datemonth',
       text: Formdict['model.form.datemonth']
-    }, {
-      value: 'datetime',
-      text: Formdict['model.form.datetime']
+    // }, {
+    //   value: 'datetime',
+    //   text: '鏃ユ湡锛堝垎/绉掞級'
     }, {
       value: 'textarea',
       text: Formdict['model.form.textarea']
+    }, {
+      value: 'cascader',
+      text: '绾ц仈鑿滃崟'
     }, {
       value: 'rate',
       text: '璇勫垎'
@@ -2337,6 +2494,12 @@
     }, {
       value: 'split',
       text: '鍒嗛殧绾�'
+    }, {
+      value: 'linkMain',
+      text: '鍏宠仈涓昏〃'
+    }, {
+      value: 'formula',
+      text: '鍏紡'
     }]
   }
 
@@ -2344,6 +2507,30 @@
     _fieldlength = 512
   } else if (['textarea', 'brafteditor'].includes(card.type)) {
     _fieldlength = 8000
+  } else if (card.type === 'datetime') {
+    card.type = 'date'
+    card.precision = 'second'
+  }
+
+  let options = card.options || []
+  if (['select', 'radio', 'link'].includes(card.type) && card.setAll === 'true') { // 鍏煎
+    options.unshift({
+      key: 'empty',
+      Value: '',
+      Text: card.emptyText || '绌�',
+      ParentID: ''
+    })
+  }
+
+  let initval = card.initval || ''
+  if (card.type === 'switch') {
+    initval = card.initval === true
+  } else if (card.type === 'number') {
+    initval = card.initval || 0
+  }
+
+  if (appType === 'mob' && ![24, 12, 8, 6].includes(card.span)) {
+    card.span = 24
   }
 
   return [
@@ -2375,8 +2562,7 @@
       type: 'text',
       key: 'initval',
       label: Formdict['header.form.initval'],
-      tooltip: '涓嬫媺澶氶�変笌澶氶�夋锛屾坊鍔犲涓垵濮嬪�艰浣跨敤鈥�,鈥濆彿鍒嗛殧銆傛敞锛氫笅鎷夐�夋嫨銆佽仈鍔ㄨ彍鍗曟垨鍗曢�夋涓�$first琛ㄧず閫夋嫨绗竴椤�',
-      initVal: card.initval || '',
+      initVal: initval,
       required: false
     },
     {
@@ -2406,16 +2592,14 @@
       key: 'openText',
       label: '寮�鍚彁绀�',
       initVal: card.openText || '',
-      required: false,
-      forbid: appType === 'mob'
+      required: false
     },
     {
       type: 'text',
       key: 'closeText',
       label: '鍏抽棴鎻愮ず',
       initVal: card.closeText || '',
-      required: false,
-      forbid: appType === 'mob'
+      required: false
     },
     {
       type: 'radio',
@@ -2425,10 +2609,10 @@
       required: true,
       options: [{
         value: '0',
-        text: Formdict['header.form.custom']
+        text: '鑷畾涔�'
       }, {
         value: '1',
-        text: Formdict['header.form.datasource']
+        text: '鏁版嵁婧�'
       }]
     },
     {
@@ -2443,6 +2627,9 @@
       }, {
         value: 'picture',
         text: '鍥剧墖'
+      }, {
+        value: 'color',
+        text: '鑹插潡'
       }]
     },
     {
@@ -2474,9 +2661,9 @@
     },
     {
       type: 'radio',
-      key: 'ratio',
+      key: 'picratio',
       label: '鍥剧墖姣斾緥',
-      initVal: card.ratio || '1:1',
+      initVal: card.picratio || card.ratio || '1:1',
       required: true,
       options: [{
         value: '1:1',
@@ -2492,19 +2679,19 @@
         text: '16:9'
       }]
     },
-    {
-      type: 'radio',
-      key: 'setAll',
-      label: '璁剧疆绌哄��',
-      initVal: card.setAll || 'false',
-      options: [{
-        value: 'true',
-        text: Formdict['model.true']
-      }, {
-        value: 'false',
-        text: Formdict['model.false']
-      }]
-    },
+    // {
+    //   type: 'radio',
+    //   key: 'setAll',
+    //   label: '璁剧疆绌哄��',
+    //   initVal: card.setAll || 'false',
+    //   options: [{
+    //     value: 'true',
+    //     text: Formdict['model.true']
+    //   }, {
+    //     value: 'false',
+    //     text: Formdict['model.false']
+    //   }]
+    // },
     {
       type: 'fields',
       key: 'fields',
@@ -2517,7 +2704,7 @@
       type: 'options',
       key: 'options',
       label: '閫夐」',
-      initVal: card.options || [],
+      initVal: options,
       required: true,
       readonly: false
     },
@@ -2530,13 +2717,36 @@
       readonly: false
     },
     {
+      type: 'radio',
+      key: 'multiple',
+      label: '閫夋嫨褰㈠紡',
+      initVal: card.multiple || 'false',
+      required: true,
+      options: [{
+        value: 'false',
+        text: '鍗曢��'
+      }, {
+        value: 'true',
+        text: '澶氶��'
+      }]
+    },
+    {
       type: 'select',
       key: 'linkField',
       label: '鍏宠仈瀛楁',
       initVal: card.linkField || '',
       required: true,
       readonly: false,
+      allowClear: true,
       options: linkableFields
+    },
+    {
+      type: 'text',
+      key: 'topmark',
+      label: '椤剁骇鏍囪瘑',
+      initVal: card.topmark || '',
+      tooltip: '鍏宠仈瀛楁鍊间笌椤剁骇鏍囪瘑鐩稿悓鏃讹紝瑙嗕负椤剁骇鑺傜偣銆�',
+      required: false
     },
     {
       type: 'text',
@@ -2583,30 +2793,6 @@
       tooltip: '璁剧疆绂佺敤瀛楁锛屼笖瀛楁鍊间负true鏃讹紝閫夐」涓嶅彲閫夈��',
       required: false,
       readonly: false
-    },
-    {
-      type: 'radio',
-      key: 'multiple',
-      label: '鍙閫�',
-      initVal: card.multiple || 'false',
-      required: true,
-      options: [{
-        value: 'true',
-        text: '鏄�'
-      }, {
-        value: 'false',
-        text: '鍚�'
-      }]
-    },
-    {
-      type: 'number',
-      key: 'decimal',
-      min: 0,
-      max: 18,
-      precision: 0,
-      label: Formdict['header.form.decimal'],
-      initVal: card.decimal || 0,
-      required: true
     },
     {
       type: 'number',
@@ -2723,15 +2909,81 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'precision',
+      label: '绮剧‘搴�',
+      initVal: card.precision || 'day',
+      options: [{
+        value: 'day',
+        text: '澶�'
+      }, {
+        value: 'hour',
+        text: '灏忔椂'
+      }, {
+        value: 'minute',
+        text: '鍒嗛挓'
+      }, {
+        value: 'second',
+        text: '绉�'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'declareType',
+      label: '鏁版嵁绫诲瀷',
+      tooltip: '澹版槑鍙橀噺鏃剁殑绫诲瀷锛屾椂闂存牸寮廳atetime鎴栨枃鏈牸寮弉varchar(50)銆�',
+      initVal: card.declareType || 'datetime',
+      options: [{
+        value: 'datetime',
+        text: 'datetime'
+      }, {
+        value: 'nvarchar(50)',
+        text: 'nvarchar(50)'
+      }]
+    },
+    {
+      type: 'text',
+      key: 'separator',
+      label: '杩炴帴绗�',
+      initVal: card.separator || card.separator === undefined ? '/' : '',
+      tooltip: '琛ㄥ崟鎻愪氦鏃朵俊鎭箣闂寸殑杩炴帴绗︺�傛敞锛氳繛鎺ョ涓虹┖鏃讹紝鍒濆鍖栨椂濉厖鍏朵粬琛ㄥ崟鏃犳晥銆�',
+      required: false,
+      readonly: false
+    },
+    {
+      type: 'radio',
+      key: 'declare',
+      label: '鏁版嵁绫诲瀷',
+      initVal: card.declare || 'nvarchar',
+      tooltip: '澹版槑鍙橀噺鏃剁殑绫诲瀷銆備娇鐢� decimal 鏃讹紝璇风‘璁alue涓烘暟鍊硷紝涓斾笉鍙负绌恒��',
+      options: [{
+        value: 'nvarchar',
+        text: 'nvarchar'
+      }, {
+        value: 'decimal',
+        text: 'decimal'
+      }]
+    },
+    {
+      type: 'number',
+      key: 'decimal',
+      min: 0,
+      max: 18,
+      precision: 0,
+      label: Formdict['header.form.decimal'],
+      initVal: card.decimal || 0,
+      required: true
+    },
+    {
       type: 'number',
       key: 'fieldlength',
       min: 1,
-      max: 1000000,
+      max: 100000,
       precision: 0,
       label: Formdict['model.form.field'] + Formdict['model.length'],
-      tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512',
+      // tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512',
       initVal: card.fieldlength || _fieldlength,
-      required: false
+      required: true
     },
     {
       type: 'number',
@@ -2751,19 +3003,22 @@
       initVal: card.regular || '',
       options: [{
         value: '',
-        text: Formdict['model.empty']
+        text: '绌�'
       }, {
         value: 'number',
-        text: Formdict['model.form.number']
+        text: '鏁板瓧'
       }, {
         value: 'letter',
-        text: Formdict['header.form.letter']
+        text: '瀛楁瘝'
       }, {
         value: 'letter&number',
-        text: '瀛楁瘝+鏁板瓧'
+        text: '鏁板瓧銆佸瓧姣嶄互鍙奯@_.'
       }, {
         value: 'phone',
         text: '鎵嬫満鍙�'
+      }, {
+        value: 'email',
+        text: '閭'
       }]
     },
     {
@@ -2983,33 +3238,29 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'selectStyle',
+      label: '閫変腑鏁堟灉',
+      tooltip: '鑳屾櫙鍙婃枃瀛楀彉鍖栨椂浼氫娇鐢ㄧ郴缁熻壊銆�',
+      initVal: card.selectStyle || (card.backgroundColor ? 'custom' : 'background'),
+      options: [{
+        value: 'background',
+        text: '鑳屾櫙鍙樺寲'
+      }, {
+        value: 'font',
+        text: '鏂囧瓧鍙樺寲'
+      }, {
+        value: 'custom',
+        text: '鑷畾涔�'
+      }]
+    },
+    {
       type: 'color',
       key: 'backgroundColor',
       label: '鑳屾櫙鑹�',
       initVal: card.backgroundColor || '',
       tooltip: '璁剧疆鑳屾櫙鑹插悗锛岄�変腑鏁堟灉鐢辫儗鏅鑹叉帶鍒躲��',
-      required: false
-    },
-    {
-      type: 'color',
-      key: 'borderColor',
-      label: '杈规棰滆壊',
-      initVal: card.borderColor || '',
-      required: false
-    },
-    {
-      type: 'radio',
-      key: 'declareType',
-      label: '鏁版嵁绫诲瀷',
-      tooltip: '澹版槑鍙橀噺鏃剁殑绫诲瀷锛屾椂闂存牸寮廳atetime鎴栨枃鏈牸寮弉varchar(50)銆�',
-      initVal: card.declareType || 'datetime',
-      options: [{
-        value: 'datetime',
-        text: 'datetime'
-      }, {
-        value: 'nvarchar(50)',
-        text: 'nvarchar(50)'
-      }]
+      required: true
     },
     // {
     //   type: 'radio',
@@ -3030,6 +3281,24 @@
       key: 'encryption',
       label: '鍔犲瘑浼犺緭',
       initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'),
+      tooltip: '浣跨敤md5鍔犲瘑鏃讹紝鍔犲瘑鍓嶅唴瀹逛細杞负灏忓啓锛屽姞瀵嗗悗鐨刴d5鍊间负32浣嶅ぇ鍐欍��',
+      options: [{
+        value: 'false',
+        text: '鏃�'
+      }, {
+        value: 'true',
+        text: 'base64鍔犲瘑'
+      }, {
+        value: 'md5',
+        text: 'md5鍔犲瘑'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'interception',
+      label: '鎴彇绌烘牸',
+      initVal: card.interception || 'true',
+      tooltip: '鎻愪氦鏃讹紝鏄惁鎴彇棣栧熬鐨勭┖鐧藉瓧绗︺��',
       options: [{
         value: 'true',
         text: Formdict['model.true']
@@ -3039,18 +3308,35 @@
       }]
     },
     {
+      type: 'textarea',
+      key: 'formula',
+      label: '鍏紡',
+      initVal: card.formula || '',
+      tooltip: '鍔ㄦ�佹浛鎹㈢浉搴旂殑瀛楁锛屽睍绀鸿幏寰楃殑缁撴灉銆傚彲浣跨敤JS鐨勪竴浜涜娉曪紝濡傦細涓夊厓琛ㄨ揪寮� @field1@ > @field2@ ? 0 : 1锛汳ath瀵硅薄锛屽彇缁濆鍊� Math.abs(@field@)銆佸洓鑸嶄簲鍏� Math.round(@field@)绛�',
+      rows: 2,
+      required: true
+    },
+    {
       type: 'radio',
-      key: 'interception',
-      label: '鎴彇绌烘牸',
-      initVal: card.interception || 'false',
-      tooltip: '鎻愪氦鏃讹紝鏄惁鎴彇棣栧熬鐨勭┖鐧藉瓧绗︺��',
+      key: 'eval',
+      label: '瑙f瀽',
+      initVal: card.eval || 'true',
+      tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��',
+      required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
+    },
+    {
+      type: 'text',
+      key: 'postfix',
+      label: '鍚庣紑',
+      initVal: card.postfix || '',
+      required: false
     },
     {
       type: 'radio',
@@ -3099,15 +3385,18 @@
     {
       type: 'radio',
       key: 'compress',
-      label: '鍘嬬缉',
+      label: '鏂囦欢澶勭悊',
       initVal: card.compress || 'false',
-      tooltip: '鏂囦欢鍘嬬缉蹇呴』涓哄浘鐗囷紝鍥剧墖鏍煎紡涓簀pg銆乸ng銆乬if 鎴� jpeg',
+      tooltip: '鏂囦欢鍘嬬缉鎴朾ase64蹇呴』涓哄浘鐗囷紝鍥剧墖鏍煎紡涓簀pg銆乸ng銆乬if 鎴� jpeg銆傛敞锛歜ase64鍙彲涓婁紶涓�寮犲浘鐗囥��',
       options: [{
-        value: 'true',
-        text: Formdict['model.true']
-      }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鏃�'
+      }, {
+        value: 'true',
+        text: '鍘嬬缉'
+      }, {
+        value: 'base64',
+        text: 'base64'
       }]
     },
     {
@@ -3132,6 +3421,46 @@
       tooltip: '鏍呮牸甯冨眬鏁磋24绛夊垎銆�',
       required: true,
       forbid: appType === 'mob'
+    },
+    {
+      type: 'radio',
+      key: 'span',
+      label: '琛ㄥ崟瀹藉害',
+      initVal: card.span || 24,
+      tooltip: '鏍呮牸甯冨眬鏁磋24绛夊垎銆�',
+      required: true,
+      forbid: appType !== 'mob',
+      options: [{
+        value: 24,
+        text: 24
+      }, {
+        value: 12,
+        text: 12
+      }, {
+        value: 8,
+        text: 8
+      }, {
+        value: 6,
+        text: 6
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'lenControl',
+      label: '闀垮害鎺у埗',
+      initVal: card.lenControl || 'limit',
+      tooltip: '鍦ㄨ缃瓧娈甸暱搴﹀悗锛屽闀垮害鐨勬帶鍒舵柟寮忋��',
+      required: false,
+      options: [{
+        value: 'limit',
+        text: '闄愬埗杈撳叆'
+      }, {
+        value: 'left',
+        text: '宸︽埅'
+      }, {
+        value: 'right',
+        text: '鍙虫埅'
+      }]
     },
     {
       type: 'number',
@@ -3179,19 +3508,21 @@
       type: 'select',
       key: 'supField',
       label: '涓婄骇琛ㄥ崟',
-      tooltip: '涓婄骇琛ㄥ崟涓轰笅鎷夐�夋嫨銆佽仈鍔ㄨ彍鍗曘�佸崟閫夋鍙婂閫夋锛屾坊鍔犲悗璇ヨ〃鍗曟樉绀哄強闅愯棌灏嗗彈涓婄骇琛ㄥ崟鎺у埗锛屾敞锛氬彈鎺у叧绯诲湪璇ヨ〃鍗曢殣钘忔椂澶辨晥銆�',
+      tooltip: '璇ヨ〃鍗曟樉绀烘垨闅愯棌鍙椾笂绾ц〃鍗曟帶鍒躲��',
       initVal: card.supField || '',
       required: false,
       readonly: false,
+      allowClear: true,
       options: linksupFields
     },
     {
       type: 'text',
       key: 'supvalue',
+      max: 512,
       label: '鏄剧ず鍊�',
       tooltip: '璇峰~鍐欐樉绀哄�硷紝鍙湁涓婄骇琛ㄥ崟鍊间笌鏄剧ず鍊肩浉鍚屾椂锛岃琛ㄥ崟鎵嶄細鏄剧ず锛屾敞锛�1銆佸涓�肩敤閫楀彿鍒嗛殧锛�2銆佷笂绾ц〃鍗曞垵濮嬪�间负$first鏃舵殏鏈鐞嗐��',
       initVal: card.supvalue || '',
-      required: true,
+      required: false,
       readonly: false
     },
     {
@@ -3213,6 +3544,22 @@
       forbid: appType === 'mob'
     },
     {
+      type: 'radio',
+      key: 'enterReplace',
+      label: '鍥炶溅绗︽浛鎹�',
+      tooltip: '鍥炶溅绗︿細鏇挎崲涓鸿嫳鏂囬�楀彿銆�',
+      initVal: card.enterReplace || 'false',
+      required: false,
+      forbid: appType !== 'mob',
+      options: [{
+        value: 'false',
+        text: '鍚�'
+      }, {
+        value: 'true',
+        text: '鏄�'
+      }]
+    },
+    {
       type: 'text',
       key: 'placeholder',
       label: '鎻愮ず淇℃伅',
@@ -3220,14 +3567,14 @@
       initVal: card.placeholder || '',
       required: false
     },
-    {
-      type: 'text',
-      key: 'emptyText',
-      label: '绌哄�兼枃鏈�',
-      tooltip: '绌哄�肩殑鎻愮ず鏂囨湰锛岄�夋嫨璁剧疆绌哄�兼椂鏈夋晥锛岄粯璁ゅ�间负銆婄┖銆嬨��',
-      initVal: card.emptyText || '',
-      required: false
-    },
+    // {
+    //   type: 'text',
+    //   key: 'emptyText',
+    //   label: '绌哄�兼枃鏈�',
+    //   tooltip: '绌哄�肩殑鎻愮ず鏂囨湰锛岄�夋嫨璁剧疆绌哄�兼椂鏈夋晥锛岄粯璁ゅ�间负銆婄┖銆嬨��',
+    //   initVal: card.emptyText || '',
+    //   required: false
+    // },
     {
       type: 'radio',
       key: 'enter',
@@ -3256,40 +3603,41 @@
     {
       type: 'multiselect',
       key: 'linkSubField',
-      label: Formdict['model.form.linkform'],
-      tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑銆傛敞锛氫娇鐢ㄩ�夐」鍗′笖璁句负鍙閫夋椂鏃犳晥銆�',
+      label: '濉厖琛ㄥ崟',
+      tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑銆�',
       initVal: card.linkSubField || [],
       options: inputfields
     },
-    {
-      type: 'number',
-      key: 'marginTop',
-      label: '涓婅竟璺濓紙px锛�',
-      initVal: card.marginTop || 0,
-      min: 0,
-      max: 1000,
-      precision: 0,
-      required: false,
-      forbid: appType !== 'mob'
-    },
-    {
-      type: 'number',
-      key: 'marginBottom',
-      label: '涓嬭竟璺濓紙px锛�',
-      initVal: card.marginBottom || 0,
-      min: 0,
-      max: 1000,
-      precision: 0,
-      required: false,
-      forbid: appType !== 'mob'
-    },
+    // {
+    //   type: 'number',
+    //   key: 'marginTop',
+    //   label: '涓婅竟璺濓紙px锛�',
+    //   initVal: card.marginTop || 0,
+    //   min: -100,
+    //   max: 1000,
+    //   precision: 0,
+    //   required: false,
+    //   forbid: appType !== 'mob'
+    // },
+    // {
+    //   type: 'number',
+    //   key: 'marginBottom',
+    //   label: '涓嬭竟璺濓紙px锛�',
+    //   initVal: card.marginBottom || 0,
+    //   min: -100,
+    //   max: 1000,
+    //   precision: 0,
+    //   required: false,
+    //   forbid: appType !== 'mob'
+    // },
     {
       type: 'multiselect',
       key: 'blacklist',
       label: Formdict['header.form.blacklist'],
       initVal: card.blacklist || [],
       required: false,
-      options: roleList
+      options: roleList,
+      forbid: appType === 'mob'
     }
   ]
 }

--
Gitblit v1.8.0