From fe21d23b147ed5cec22b4f76a88840b05495d4ad Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 18 六月 2022 22:33:59 +0800
Subject: [PATCH] 2022-06-18

---
 src/templates/zshare/formconfig.jsx |  309 +++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 250 insertions(+), 59 deletions(-)

diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 1d50873..8574f2e 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -286,7 +286,7 @@
  * @param {object} card           // 鎼滅储鏉′欢瀵硅薄
  * @param {Array}  linkableFields // 鍙叧鑱斿瓧娈�
  */
-export function getSearchForm (card, linkableFields) {
+export function getSearchForm (card, linkableFields, columns) {
   let roleList = sessionStorage.getItem('sysRoles')
   let appType = sessionStorage.getItem('appType')
   if (roleList) {
@@ -302,6 +302,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: '鏁板�硷紙鍖洪棿锛�'
@@ -318,6 +326,7 @@
     //   value: 'daterange',
     //   text: Formdict['model.form.daterange']
     }]
+
   } else {
     typeOptions = [{
       value: 'text',
@@ -387,7 +396,8 @@
       key: 'field',
       label: Formdict['model.form.field'],
       initVal: card.field || '',
-      required: true
+      required: true,
+      options: columns
     },
     {
       type: 'select',
@@ -506,7 +516,7 @@
       required: true
     },
     {
-      type: 'textarea',
+      type: 'codemirror',
       key: 'dataSource',
       label: Formdict['header.form.datasource'],
       initVal: card.dataSource || '',
@@ -650,6 +660,37 @@
       required: 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: 'day',
+        text: '澶�'
+      }, {
+        value: 'hour',
+        text: '灏忔椂'
+      }, {
+        value: 'minute',
+        text: '鍒嗛挓'
+      }, {
+        value: 'second',
+        text: '绉�'
+      }]
+    },
+    {
       type: 'radio',
       key: 'required',
       label: Formdict['model.required'],
@@ -746,6 +787,7 @@
       key: 'advanced',
       label: '楂樼骇鎼滅储',
       initVal: card.advanced || 'false',
+      tooltip: '鍦ㄩ殣钘忔悳绱㈡寜閽椂锛岄珮绾ф悳绱㈡棤鏁堛��',
       forbid: appType === 'mob',
       options: [{
         value: 'true',
@@ -805,7 +847,8 @@
       label: Formdict['header.form.blacklist'],
       initVal: card.blacklist || [],
       required: false,
-      options: roleList || []
+      options: roleList || [],
+      forbid: appType === 'mob'
     }
   ]
 }
@@ -912,7 +955,20 @@
       }, {
         value: 'closetab',
         text: '鏍囩鍏抽棴'
+      }, {
+        value: 'megvii',
+        text: '鏃疯闈㈡澘鏈�'
       }]
+    },
+    { // 鏃疯闈㈡澘鏈烘帴鍙� 寰呮墿灞�
+      type: 'radio',
+      key: 'subFunc',
+      label: '鎺ュ彛鍚嶇О',
+      initVal: card.subFunc || 'addUser',
+      required: true,
+      options: [
+        { value: 'addUser', text: '娣诲姞鐢ㄦ埛' },
+      ]
     },
     {
       type: 'select',
@@ -1177,18 +1233,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]
     },
@@ -1203,11 +1259,11 @@
         value: 'never',
         text: '涓嶅埛鏂�'
       }, {
-        value: 'grid',
-        text: '鍒锋柊琛ㄦ牸'
-      }, {
         value: 'line',
         text: '鍒锋柊琛�'
+      }, {
+        value: 'grid',
+        text: '鍒锋柊琛ㄦ牸'
       },
       ...refresh]
     },
@@ -1268,8 +1324,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
     },
     {
@@ -1343,7 +1407,7 @@
       precision: 0,
       label: '姣斾緥',
       initVal: card.ratio || 85,
-      tooltip: '灏忎簬100涓哄搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��',
+      tooltip: '妯℃�佹鎴栨娊灞夌殑瀹藉害锛屽皬浜�100涓虹獥鍙e搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��',
       required: true
     },
     {
@@ -1424,6 +1488,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: '杩涘害鏉�'
+      }]
+    }
   ]
 }
 
@@ -1624,7 +1724,7 @@
         text: Formdict['model.empty']
       }, {
         value: 'thdSeparator',
-        text: Formdict['header.form.thdSeparator']
+        text: '鍗冨垎浣�'
       }, {
         value: 'percent',
         text: '鐧惧垎姣�'
@@ -2260,9 +2360,9 @@
   }, {
     value: 'datemonth',
     text: Formdict['model.form.datemonth']
-  }, {
-    value: 'datetime',
-    text: Formdict['model.form.datetime']
+  // }, {
+  //   value: 'datetime',
+  //   text: '鏃ユ湡锛堝垎/绉掞級'
   }, {
     value: 'textarea',
     text: Formdict['model.form.textarea']
@@ -2325,9 +2425,9 @@
     }, {
       value: 'datemonth',
       text: Formdict['model.form.datemonth']
-    }, {
-      value: 'datetime',
-      text: Formdict['model.form.datetime']
+    // }, {
+    //   value: 'datetime',
+    //   text: '鏃ユ湡锛堝垎/绉掞級'
     }, {
       value: 'textarea',
       text: Formdict['model.form.textarea']
@@ -2343,6 +2443,9 @@
     }, {
       value: 'split',
       text: '鍒嗛殧绾�'
+    }, {
+      value: 'linkMain',
+      text: '鍏宠仈涓昏〃'
     }]
   }
 
@@ -2350,6 +2453,9 @@
     _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 || []
@@ -2367,6 +2473,10 @@
     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 [
@@ -2428,16 +2538,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',
@@ -2746,6 +2854,25 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'precision',
+      label: '绮剧‘搴�',
+      initVal: card.precision || 'day',
+      options: [{
+        value: 'day',
+        text: '澶�'
+      }, {
+        value: 'hour',
+        text: '灏忔椂'
+      }, {
+        value: 'minute',
+        text: '鍒嗛挓'
+      }, {
+        value: 'second',
+        text: '绉�'
+      }]
+    },
+    {
       type: 'number',
       key: 'fieldlength',
       min: 1,
@@ -2754,7 +2881,7 @@
       label: Formdict['model.form.field'] + Formdict['model.length'],
       // tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512',
       initVal: card.fieldlength || _fieldlength,
-      required: false
+      required: true
     },
     {
       type: 'number',
@@ -2774,19 +2901,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: '閭'
       }]
     },
     {
@@ -3065,7 +3195,7 @@
       type: 'radio',
       key: 'interception',
       label: '鎴彇绌烘牸',
-      initVal: card.interception || 'false',
+      initVal: card.interception || 'true',
       tooltip: '鎻愪氦鏃讹紝鏄惁鎴彇棣栧熬鐨勭┖鐧藉瓧绗︺��',
       options: [{
         value: 'true',
@@ -3122,15 +3252,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'
       }]
     },
     {
@@ -3155,6 +3288,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',
@@ -3212,6 +3385,7 @@
     {
       type: 'text',
       key: 'supvalue',
+      max: 512,
       label: '鏄剧ず鍊�',
       tooltip: '璇峰~鍐欐樉绀哄�硷紝鍙湁涓婄骇琛ㄥ崟鍊间笌鏄剧ず鍊肩浉鍚屾椂锛岃琛ㄥ崟鎵嶄細鏄剧ず锛屾敞锛�1銆佸涓�肩敤閫楀彿鍒嗛殧锛�2銆佷笂绾ц〃鍗曞垵濮嬪�间负$first鏃舵殏鏈鐞嗐��',
       initVal: card.supvalue || '',
@@ -3235,6 +3409,22 @@
       initVal: card.extra || '',
       required: false,
       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',
@@ -3285,35 +3475,36 @@
       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