From 10f5efae1624c89d9a8f04ac331e07c895ea282a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 25 五月 2024 18:22:58 +0800
Subject: [PATCH] 2024-05-25

---
 src/templates/zshare/formconfig.jsx |  130 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 119 insertions(+), 11 deletions(-)

diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 6f2c88b..621dd29 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -74,6 +74,9 @@
       value: 'group',
       text: '鏃ユ湡锛堢粍鍚堬級'
     }, {
+      value: 'range',
+      text: '鏁板�硷紙鍖洪棿锛�'
+    }, {
       value: 'switch',
       text: '寮�鍏�'
     }, {
@@ -258,6 +261,7 @@
       label: '鏁版嵁婧�',
       initVal: card.dataSource || '',
       tooltip: '鏁版嵁鏉冮檺鏇挎崲绗� $@ -> /* 鎴� \'\'銆� @$ -> */ 鎴� \'\'',
+      placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆�',
       required: true
     },
     {
@@ -727,13 +731,8 @@
 
 /**
  * @description 鑾峰彇琛ㄥ崟閰嶇疆淇℃伅
- * @param {*} card            // 琛ㄥ崟瀵硅薄
- * @param {*} inputfields     // 鍙啓鍏ヨ〃鍗�
- * @param {*} tabfields       // 鍙垏鎹㈣〃鍗�
- * @param {*} linkableFields  // 鍙叧鑱旇〃鍗�
- * @param {*} linksupFields   // 涓婄骇琛ㄥ崟
  */
-export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, columns = []) {
+export function getModalForm (card, fields, columns = []) {
   let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
   if (roleList) {
@@ -768,6 +767,64 @@
     }
   } else {
     msgTemps = []
+  }
+
+  let inputfields = []
+  let tabfields = []
+  let linkableFields = []
+  let linksupFields = []
+
+  fields.forEach(item => {
+    if (!item.field || card.field === item.field) return
+
+    if (['text', 'number', 'textarea', 'select'].includes(item.type)) {
+      inputfields.push({
+        field: item.field,
+        label: item.label
+      })
+    }
+    if (item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) {
+      tabfields.push({
+        field: item.field,
+        label: item.label
+      })
+    }
+
+    if (['switch', 'check', 'popSelect'].includes(item.type)) {
+      linksupFields.push({
+        field: item.field,
+        label: item.label
+      })
+    }
+    
+    if (['select', 'link', 'radio', 'checkcard', 'multiselect'].includes(item.type)) {
+      linksupFields.push({
+        field: item.field,
+        label: item.label
+      })
+    }
+
+    if (['select', 'link', 'radio', 'popSelect'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) {
+      linkableFields.push({
+        field: item.field,
+        label: item.label + '-琛ㄥ崟'
+      })
+    }
+  })
+
+  let _fields = linkableFields.map(cell => cell.field)
+  columns.forEach(col => {
+    if (col.field && !_fields.includes(col.field)) {
+      linkableFields.push({
+        field: col.field,
+        label: col.label + '-鏄剧ず鍒�'
+      })
+    }
+  })
+
+  if (card.linkSubField && card.linkSubField.length > 0) {
+    let fields = inputfields.map(item => item.field)
+    card.linkSubField = card.linkSubField.filter(item => fields.includes(item))
   }
 
   inputfields = inputfields.map((item, index) => {
@@ -1791,6 +1848,19 @@
     },
     {
       type: 'radio',
+      key: 'notZero',
+      label: "涓嶅彲涓�0",
+      initVal: card.notZero || 'false',
+      options: [{
+        value: 'true',
+        text: '鏄�'
+      }, {
+        value: 'false',
+        text: '鍚�'
+      }]
+    },
+    {
+      type: 'radio',
       key: 'database',
       label: '鏁版嵁搴�',
       initVal: card.database || 'local',
@@ -1862,6 +1932,21 @@
       }, {
         value: 'false',
         text: '鍚�'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'format',
+      label: '鏍煎紡鍖�',
+      tooltip: '浣跨敤鍗冨垎浣嶆椂锛屾暟鍊煎皢浠ュ崈鍒嗕綅鏍煎紡鏄剧ず锛屾彁浜ゆ椂涓哄師鏁板�笺��',
+      initVal: card.format || '',
+      forbid: appType === 'mob',
+      options: [{
+        value: '',
+        text: '鏃�'
+      }, {
+        value: 'thdSeparator',
+        text: '鍗冨垎浣�'
       }]
     },
     {
@@ -2061,6 +2146,7 @@
       key: 'inputType',
       label: '鍔犲瘑鏄剧ず',
       initVal: card.inputType || 'text',
+      tooltip: '杈撳叆妗嗗唴瀹逛互 ****** 鏄剧ず銆�',
       required: false,
       options: [{
         value: 'text',
@@ -2071,17 +2157,23 @@
       }]
     },
     {
-      type: 'radio',
+      type: 'select',
       key: 'interception',
-      label: '鎴彇鏂瑰紡',
+      label: '鏂囨湰棰勫鐞�',
       initVal: card.interception || 'true',
-      tooltip: '鎻愪氦鏃剁殑鏂囨湰澶勭悊鏂瑰紡锛岀┖鐧藉瓧绗︽寚寮�澶存垨缁撳熬鐨勭┖鐧藉瓧绗︺��',
+      tooltip: '鎻愪氦鏃剁殑鏂囨湰澶勭悊鏂瑰紡銆傛敞锛氬叏瑙掕浆鍗婅鏃朵細鍘婚櫎棣栧熬绌烘牸',
       options: [{
         value: 'false',
         text: '鏃�'
       }, {
         value: 'true',
-        text: '绌虹櫧瀛楃'
+        text: '鍘绘帀棣栧熬绌烘牸'
+      // }, {
+      //   value: 'char',
+      //   text: '鍏ㄨ杞崐瑙�'
+      }, {
+        value: 'charTure',
+        text: '鍏ㄨ杞崐瑙�'
       }, {
         value: 'func',
         text: '鑷畾涔夊嚱鏁�'
@@ -2485,6 +2577,22 @@
       readonly: false
     },
     {
+      type: 'radio',
+      key: 'opacity',
+      label: '鏄惁鍙',
+      initVal: card.opacity || 'true',
+      tooltip: '涓嶅彲瑙佹椂浠呯敤浣滆〃鍗曞垎闅旓紝涓嶆樉绀哄悕绉般��',
+      required: false,
+      forbid: appType === 'mob',
+      options: [{
+        value: 'true',
+        text: '鍙'
+      }, {
+        value: 'false',
+        text: '涓嶅彲瑙�'
+      }]
+    },
+    {
       type: 'text',
       key: 'regularExtra',
       label: '姝e垯鎵╁睍绗�',
@@ -2561,7 +2669,7 @@
       key: 'enter',
       label: '鍥炶溅浜嬩欢',
       initVal: (card.type === 'text' || card.type === 'number') ? (card.enter || 'sub') : (card.enter || 'false'),
-      tooltip: '1銆佺偣鍑籈nter閿垨鏂囨湰绫昏〃鍗曡緭鍏ュ洖杞︾锛�2銆佷笅鎷夐�夋嫨鎴栧紑鍏崇殑閫夐」鍒囨崲銆�',
+      tooltip: '1銆佺偣鍑籈nter閿垨鏂囨湰绫昏〃鍗曡緭鍏ュ洖杞︾锛�2銆佷笅鎷夐�夋嫨銆佹椂闂淬�佸紑鍏崇殑閫夐」鍒囨崲銆�',
       options: [{
         value: 'sub',
         text: '鎻愪氦'

--
Gitblit v1.8.0