From 81d0d7721bb14a34b1eef99fd9506c3eda4bda99 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 十月 2023 17:17:47 +0800 Subject: [PATCH] 2023-10-18 --- src/templates/zshare/formconfig.jsx | 324 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 305 insertions(+), 19 deletions(-) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index f82687b..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,19 +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', @@ -645,7 +707,7 @@ required: false }, { - type: 'select', + type: 'radio', key: 'orderType', label: '鎺掑簭鏂瑰紡', initVal: card.orderType || 'asc', @@ -2568,6 +2630,9 @@ value: 'link', text: '鑱斿姩鑿滃崟' }, { + value: 'popSelect', + text: '閫夋嫨鍣�' + }, { value: 'switch', text: '寮�鍏�' }, { @@ -2905,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', @@ -2921,14 +3184,33 @@ readonly: false }, { - type: 'codemirror', - key: 'dataSource', - label: '鏁版嵁婧�', - initVal: card.dataSource || '', - tooltip: '鏁版嵁鏉冮檺鏇挎崲绗� $@ -> /* 鎴� \'\'銆� @$ -> */ 鎴� \'\'', - 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', @@ -2987,7 +3269,7 @@ readonly: false }, { - type: 'select', + type: 'radio', key: 'orderType', label: '鎺掑簭鏂瑰紡', initVal: card.orderType || 'asc', @@ -4018,7 +4300,11 @@ initVal: card.regularExtra || '', tooltip: '姝e垯楠岃瘉鏃跺厑璁告坊鍔犵殑鑷畾涔夊瓧绗︼紝鍖呮嫭~!@#$%^&*()_+:;{}<>,.-', required: false, - readonly: false + readonly: false, + rules: [{ + pattern: /^[~!@#$%^&*()_+:;{}<>,.-]*$/, + message: '鎵╁睍绗﹀寘鎷瑍!@#$%^&*()_+:;{}<>,.-' + }] }, { type: 'text', -- Gitblit v1.8.0