From 6781ba45775af16872ac68f7e459b1072b16c4cc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 18 十月 2023 17:33:47 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/templates/zshare/formconfig.jsx |  350 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 325 insertions(+), 25 deletions(-)

diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 752c7ec..6e13fc6 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -1,3 +1,4 @@
+import React from 'react'
 import { formRule, btnClasses } from '@/utils/option.js'
 
 /**
@@ -549,18 +550,80 @@
       }]
     },
     {
-      type: 'fields',
-      key: 'fields',
-      label: '瀛楁闆�',
-      initVal: card.fields || [],
-      required: true
-    },
-    {
       type: 'codemirror',
       key: 'dataSource',
       label: '鏁版嵁婧�',
       initVal: card.dataSource || '',
+      tooltip: '鏁版嵁鏉冮檺鏇挎崲绗� $@ -> /* 鎴� \'\'銆� @$ -> */ 鎴� \'\'',
       required: true
+    },
+    {
+      type: 'fields',
+      key: 'fields',
+      label: '瀛楁闆�',
+      initVal: card.fields || [],
+      required: true,
+      columns: [
+        {
+          title: '瀛楁鍚�',
+          dataIndex: 'field',
+          inputType: 'input',
+          editable: true,
+          unique: true,
+          strict: true,
+          forbids: ['value', 'parentid', 'pid'],
+          initval: 'field',
+          rules: [{
+            pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig,
+            message: '璇蜂娇鐢ㄦ暟瀛椼�佸瓧姣嶃�佹眽瀛椾互鍙奯-'
+          }],
+          width: '20%'
+        },
+        {
+          title: '瀛椾綋棰滆壊',
+          dataIndex: 'color',
+          inputType: 'color',
+          editable: true,
+          initval: 'rgba(0, 0, 0, 0.85)',
+          width: '20%',
+          render: (text, record) => {
+            return <span style={{color: text}}>绀轰緥</span>
+          }
+        },
+        {
+          title: '瀛椾綋澶у皬',
+          dataIndex: 'fontSize',
+          inputType: 'number',
+          min: 12,
+          max: 50,
+          editable: true,
+          initval: 14,
+          width: '20%',
+        },
+        {
+          title: '瀵归綈鏂瑰紡',
+          dataIndex: 'align',
+          inputType: 'select',
+          editable: true,
+          width: '20%',
+          initval: 'left',
+          options: [
+            {value: 'left', text: '灞呭乏'},
+            {value: 'center', text: '灞呬腑'},
+            {value: 'right', text: '灞呭彸'},
+            // {value: 'justify', text: 'justify'}
+          ],
+          render: (text, record) => {
+            if (text === 'center') {
+              return '灞呬腑'
+            } else if (text === 'right') {
+              return '灞呭彸'
+            } else {
+              return '灞呭乏'
+            }
+          }
+        }
+      ]
     },
     {
       type: 'options',
@@ -644,7 +707,7 @@
       required: false
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'orderType',
       label: '鎺掑簭鏂瑰紡',
       initVal: card.orderType || 'asc',
@@ -2567,6 +2630,9 @@
     value: 'link',
     text: '鑱斿姩鑿滃崟'
   }, {
+    value: 'popSelect',
+    text: '閫夋嫨鍣�'
+  }, {
     value: 'switch',
     text: '寮�鍏�'
   }, {
@@ -2904,12 +2970,210 @@
     //   }]
     // },
     {
+      type: 'codemirror',
+      key: 'dataSource',
+      label: '鏁版嵁婧�',
+      initVal: card.dataSource || '',
+      tooltip: '鏁版嵁鏉冮檺鏇挎崲绗� $@ -> /* 鎴� \'\'銆� @$ -> */ 鎴� \'\'',
+      placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆傚叕鍏卞�硷細@ID@銆丂BID@銆�',
+      required: true,
+      readonly: false
+    },
+    {
       type: 'fields',
       key: 'fields',
       label: '瀛楁闆�',
       initVal: card.fields || [],
       required: true,
-      readonly: false
+      readonly: false,
+      columns: [
+        {
+          title: '瀛楁鍚�',
+          dataIndex: 'field',
+          inputType: 'input',
+          editable: true,
+          unique: true,
+          strict: true,
+          forbids: ['value', 'parentid', 'pid'],
+          initval: 'field',
+          rules: [{
+            pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig,
+            message: '璇蜂娇鐢ㄦ暟瀛椼�佸瓧姣嶃�佹眽瀛椾互鍙奯-'
+          }],
+          width: '20%'
+        },
+        {
+          title: '瀛椾綋棰滆壊',
+          dataIndex: 'color',
+          inputType: 'color',
+          editable: true,
+          initval: 'rgba(0, 0, 0, 0.85)',
+          width: '20%',
+          render: (text, record) => {
+            return <span style={{color: text}}>绀轰緥</span>
+          }
+        },
+        {
+          title: '瀛椾綋澶у皬',
+          dataIndex: 'fontSize',
+          inputType: 'number',
+          min: 12,
+          max: 50,
+          editable: true,
+          initval: 14,
+          width: '20%',
+        },
+        {
+          title: '瀵归綈鏂瑰紡',
+          dataIndex: 'align',
+          inputType: 'select',
+          editable: true,
+          width: '20%',
+          initval: 'left',
+          options: [
+            {value: 'left', text: '灞呭乏'},
+            {value: 'center', text: '灞呬腑'},
+            {value: 'right', text: '灞呭彸'},
+            // {value: 'justify', text: 'justify'}
+          ],
+          render: (text, record) => {
+            if (text === 'center') {
+              return '灞呬腑'
+            } else if (text === 'right') {
+              return '灞呭彸'
+            } else {
+              return '灞呭乏'
+            }
+          }
+        }
+      ]
+    },
+    {
+      type: 'fields',
+      key: 'columns',
+      label: '瀛楁闆�',
+      initVal: card.columns || [],
+      required: true,
+      readonly: false,
+      columns: [
+        {
+          title: '鍚嶇О',
+          dataIndex: 'label',
+          inputType: 'input',
+          editable: true,
+          initval: 'label',
+          width: '20%'
+        },
+        {
+          title: '瀛楁',
+          dataIndex: 'field',
+          inputType: 'input',
+          editable: true,
+          unique: true,
+          strict: true,
+          copy: true,
+          initval: 'field',
+          rules: [{
+            pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig,
+            message: '璇蜂娇鐢ㄦ暟瀛椼�佸瓧姣嶃�佹眽瀛椾互鍙奯-'
+          }],
+          width: '20%'
+        },
+        {
+          title: '闅愯棌',
+          dataIndex: 'Hide',
+          inputType: 'radio',
+          editable: true,
+          width: '20%',
+          initval: 'false',
+          options: [
+            {value: 'true', text: '鏄�'},
+            {value: 'false', text: '鍚�'},
+          ],
+          render: (text, record) => {
+            if (text === 'true') {
+              return '鏄�'
+            } else {
+              return '鍚�'
+            }
+          }
+        },
+        {
+          title: '鎺掑簭',
+          dataIndex: 'IsSort',
+          inputType: 'radio',
+          editable: true,
+          width: '20%',
+          initval: 'false',
+          options: [
+            {value: 'true', text: '鏄�'},
+            {value: 'false', text: '鍚�'},
+          ],
+          render: (text, record) => {
+            if (text === 'true') {
+              return '鏄�'
+            } else {
+              return '鍚�'
+            }
+          }
+        }
+      ]
+    },
+    {
+      type: 'select',
+      key: 'primaryKey',
+      label: '涓婚敭',
+      initVal: card.primaryKey || '',
+      required: true,
+      readonly: false,
+      options: 'columns'
+    },
+    {
+      type: 'text',
+      key: 'order',
+      label: '榛樿鎺掑簭',
+      initVal: card.order || '',
+      placeholder: 'ID asc',
+      required: true
+    },
+    {
+      type: 'select',
+      key: 'showField',
+      label: '鏄剧ず瀛楁',
+      initVal: card.showField || '',
+      tooltip: '鐢ㄤ簬鎺у埗閫夋嫨妗嗕腑鐨勬樉绀哄唴瀹广��',
+      required: true,
+      options: 'columns'
+    },
+    {
+      type: 'select',
+      key: 'controlField',
+      label: '绂佺敤瀛楁',
+      initVal: card.controlField || '',
+      tooltip: '鐢ㄤ簬鎺у埗琛屾暟鎹槸鍚﹀彲閫夋嫨銆傚瓧娈靛�间负true鏃讹紝閫夐」涓嶅彲閫夈��',
+      required: false,
+      allowClear: true,
+      options: 'columns'
+    },
+    {
+      type: 'text',
+      key: 'searchKey',
+      label: '鎼滅储瀛楁',
+      initVal: card.searchKey || '',
+      tooltip: '澶氫釜鍊艰鐢ㄩ�楀彿鍒嗛殧銆�',
+      required: false,
+      rules: [{
+        pattern: /^[0-9a-zA-Z,_-]*$/ig,
+        message: '瀛楁鍚嶅彧鍏佽鍖呭惈鏁板瓧銆佸瓧姣嶄互鍙奯-',
+      }]
+    },
+    {
+      type: 'number',
+      key: 'popWidth',
+      label: '寮圭獥瀹藉害',
+      initVal: card.popWidth || 60,
+      tooltip: '灏忎簬100鏃朵负鐧惧垎鐜囷紝澶т簬100鏃朵负缁濆鍊笺��',
+      required: true
     },
     {
       type: 'options',
@@ -2920,13 +3184,33 @@
       readonly: false
     },
     {
-      type: 'codemirror',
-      key: 'dataSource',
-      label: '鏁版嵁婧�',
-      initVal: card.dataSource || '',
-      placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆傚叕鍏卞�硷細@ID@銆丂BID@銆�',
-      required: true,
-      readonly: false
+      type: 'radio',
+      key: 'laypage',
+      label: '鍒嗛〉',
+      initVal: card.laypage || 'true',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '鏄�'
+      }, {
+        value: 'false',
+        text: '鍚�'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'onload',
+      label: '鍒濆鍖�',
+      initVal: card.onload || 'true',
+      tooltip: '褰撴病鏈夎缃悳绱㈠瓧娈垫椂锛屽垵濮嬪寲鍔犺浇鏁版嵁銆�',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '鍔犺浇'
+      }, {
+        value: 'false',
+        text: '涓嶅姞杞�'
+      }]
     },
     {
       type: 'radio',
@@ -2985,7 +3269,7 @@
       readonly: false
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'orderType',
       label: '鎺掑簭鏂瑰紡',
       initVal: card.orderType || 'asc',
@@ -3615,16 +3899,28 @@
     {
       type: 'radio',
       key: 'interception',
-      label: '鎴彇绌烘牸',
+      label: '鎴彇鏂瑰紡',
       initVal: card.interception || 'true',
-      tooltip: '鎻愪氦鏃讹紝鏄惁鎴彇棣栧熬鐨勭┖鐧藉瓧绗︺��',
+      tooltip: '鎻愪氦鏃剁殑鏂囨湰澶勭悊鏂瑰紡锛岀┖鐧藉瓧绗︽寚寮�澶存垨缁撳熬鐨勭┖鐧藉瓧绗︺��',
       options: [{
-        value: 'true',
-        text: '鏄�'
-      }, {
         value: 'false',
-        text: '鍚�'
+        text: '鏃�'
+      }, {
+        value: 'true',
+        text: '绌虹櫧瀛楃'
+      }, {
+        value: 'func',
+        text: '鑷畾涔夊嚱鏁�'
       }]
+    },
+    {
+      type: 'textarea',
+      key: 'func',
+      label: '鍑芥暟',
+      initVal: card.func || '',
+      tooltip: '鍑芥暟鏈変袱涓叆鍙�(value, data)锛岀涓�涓负褰撳墠琛ㄥ崟鍊硷紝绗簩涓负琛ㄥ崟鎵�鏈夊瓧娈�-鍊肩殑瀵硅薄锛岃杩斿洖澶勭悊鍚庣殑鍊笺��',
+      rows: 2,
+      required: true
     },
     {
       type: 'textarea',
@@ -3858,7 +4154,7 @@
       type: 'radio',
       key: 'constant',
       label: 'Unicode甯搁噺',
-      tooltip: '浣跨敤鏃跺皢鍦ㄦ彁浜ゅ唴瀹瑰墠鍔犱笂 N锛屼唬琛ㄥ瓨鍏ユ暟鎹簱鏃朵互 Unicode 鏍煎紡瀛樺偍銆�',
+      tooltip: `浣跨敤鏃跺皢鍦ㄦ彁浜ゅ唴瀹瑰墠鍔犱笂 N锛屼唬琛ㄥ瓨鍏ユ暟鎹簱鏃朵互 Unicode 鏍煎紡瀛樺偍銆備緥濡傦細@nvarchar=N'脴W30041'銆俙,
       initVal: card.constant || 'false',
       options: [{
         value: 'true',
@@ -4004,7 +4300,11 @@
       initVal: card.regularExtra || '',
       tooltip: '姝e垯楠岃瘉鏃跺厑璁告坊鍔犵殑鑷畾涔夊瓧绗︼紝鍖呮嫭~!@#$%^&*()_+:;{}<>,.-',
       required: false,
-      readonly: false
+      readonly: false,
+      rules: [{
+        pattern: /^[~!@#$%^&*()_+:;{}<>,.-]*$/,
+        message: '鎵╁睍绗﹀寘鎷瑍!@#$%^&*()_+:;{}<>,.-'
+      }]
     },
     {
       type: 'text',

--
Gitblit v1.8.0