From 26e116c38af035db0908c3b6086841708ba2ddeb Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 09 三月 2025 22:27:44 +0800
Subject: [PATCH] 2025-03-09

---
 src/menu/components/card/cardcellcomponent/formconfig.jsx |  148 +++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 118 insertions(+), 30 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx
index 41265db..08054fd 100644
--- a/src/menu/components/card/cardcellcomponent/formconfig.jsx
+++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -1,3 +1,4 @@
+import React from 'react'
 import MenuUtils from '@/utils/utils-custom.js'
 
 /**
@@ -20,6 +21,7 @@
     { value: 'qrcode', text: '浜岀淮鐮�'},
     { value: 'currentDate', text: '褰撳墠鏃堕棿'},
     { value: 'formula', text: '鍏紡'},
+    { value: 'tag', text: '鏍囩'},
     { value: 'color', text: '棰滆壊'},
   ]
 
@@ -52,7 +54,7 @@
     _options = [{ value: 'text', text: '鏂囨湰'}]
   }
 
-  let width = card.width || 12
+  let width = card.width === undefined ? 12 : card.width
   if (/x/.test(card.width)) {
     width = +width.replace(/x/, '.5')
   }
@@ -122,7 +124,21 @@
     } else {
       appMenus = []
     }
+    // if (appType === 'mob') {
+    //   appMenus.push({value: 'sign', text: '绛惧悕锛堢郴缁熼〉锛�'})
+    // }
     appMenus.push({value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'})
+  }
+
+  let fields = []
+  let isStatic = (cards.subtype === 'propcard' || cards.type === 'balcony') && cards.wrap.datatype === 'static'
+  if (isStatic) {
+    if (cards.wrap.supModule && cards.wrap.supModule.length) {
+      let cell = MenuUtils.getComponent(cards.wrap.supModule[cards.wrap.supModule.length - 1])
+      if (cell && cell.columns) {
+        fields = cell.columns.map(col => ({ value: col.field }))
+      }
+    }
   }
 
   let forms = [
@@ -158,12 +174,17 @@
       ]
     },
     {
-      type: 'select',
+      type: isStatic ? 'text' : 'select',
       key: 'field',
       label: '瀛楁',
       initVal: card.field || '',
+      tooltip: isStatic ? '鍙粦瀹氫笂绾х粍浠跺瓧娈碉紝涓嶅瓨鍦ㄤ笂绾х粍浠舵椂鍙粦瀹歶rl鍙傛暟瀛楁銆�' : '',
       required: true,
-      options: []
+      options: fields,
+      rules: [{
+        pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig,
+        message: '瀛楁鍚嶅彧鍏佽鍖呭惈鏁板瓧銆佸瓧姣嶃�佹眽瀛椾互鍙奯-'
+      }]
     },
     {
       type: 'icon',
@@ -178,7 +199,7 @@
       min: 0,
       label: '鍐呭',
       initVal: card.value || '',
-      tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@銆丂fullName@銆丂mk_city@銆丂appname@銆丂bid@銆丂month@銆丂week@銆丂day@',
+      // tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@銆丂fullName@銆丂mk_city@銆丂appname@銆丂bid@銆丂month@銆丂week@銆丂day@',
       required: true
     },
     {
@@ -242,11 +263,12 @@
       required: true
     },
     {
-      type: 'select',
+      type: isStatic ? 'text' : 'select',
       key: 'posterField',
       label: '棰勮鍦板潃',
       initVal: card.posterField || '',
-      required: true
+      required: true,
+      options: fields
     },
     {
       type: 'radio',
@@ -441,12 +463,12 @@
     {
       type: 'number',
       key: 'width',
-      min: 0.5,
+      min: 0,
       max: 24,
       precision: 1,
       label: '鍏冪礌瀹藉害',
       initVal: width,
-      tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒楋紝鍙缃崐鍒楀嵆.5銆�',
+      tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒楋紝鍙缃崐鍒楀嵆.5銆傛敞锛氫负0鏃跺搴︿緷鎹唴瀹硅嚜閫傚簲锛堟枃鏈�佹暟鍊笺�佹彁绀猴紙鍥炬爣锛夈�佸綋鍓嶆椂闂淬�佸叕寮忥級銆�',
       required: true
     },
     {
@@ -460,14 +482,14 @@
       required: false
     },
     {
-      type: 'select',
+      type: isStatic ? 'text' : 'select',
       key: 'bgImage',
       label: '鍔ㄦ�佽儗鏅�',
       initVal: card.bgImage || '',
       tooltip: '缁戝畾鏁版嵁婧愬瓧娈碉紝鍙牴鎹繑鍥炲�兼敼鍙樿儗鏅浘銆�',
       required: false,
       allowClear: true,
-      options: [],
+      options: fields,
       forbid: isHeader
     },
     {
@@ -589,6 +611,16 @@
       ]
     },
     {
+      type: 'codemirror',
+      key: 'formula',
+      label: '鍏紡',
+      initVal: card.formula || '',
+      tooltip: '鎵ц鏃朵細浣跨敤鏌ヨ鍒扮殑鏁版嵁鏇挎崲鐩稿簲鐨勫瓧娈碉紝灞曠ず鑾峰緱鐨勭粨鏋滐紝鍦ㄤ笉浣跨敤瑙f瀽鏃舵崲琛岀鎴栫┖鏍间細鏇挎崲涓洪〉闈㈠厓绱犮�傚彲浣跨敤JS鐨勪竴浜涜娉曪紝濡傦細涓夊厓琛ㄨ揪寮� @field1@ > @field2@ ? 0 : 1锛汳ath瀵硅薄锛屽彇缁濆鍊� Math.abs(@field@)銆佸洓鑸嶄簲鍏� Math.round(@field@)绛夈�傛敞锛氫細鏇挎崲鍏紡涓殑@username@銆丂fullName@銆丂bid@銆�',
+      toolWidth: 450,
+      placeholder: '渚嬪锛欯price@ * @number@',
+      required: true
+    },
+    {
       type: 'radio',
       key: 'link',
       label: '閾炬帴',
@@ -626,6 +658,7 @@
       key: 'linkmenu',
       label: '鍏宠仈鑿滃崟',
       initVal: card.linkmenu || '',
+      tooltip: '琛屼俊鎭紙瀛楁闆嗕腑鍓�40涓暱搴︿笉瓒呰繃256鐨勫瓧娈碉級灏嗕紶閫掕嚦姝よ彍鍗曪紝鍙湪url鍙橀噺銆佽〃鍗曪紙鍏宠仈涓昏〃锛夈�侀潤鎬佸睘鎬у崱銆佹诞鍔ㄥ崱涓娇鐢ㄣ��',
       required: true,
       options: appMenus || [],
       forbid: !['pc', 'mob'].includes(appType)
@@ -635,18 +668,21 @@
       key: 'linkmenu',
       label: '鍏宠仈鑿滃崟',
       initVal: card.linkmenu || [],
+      tooltip: '琛屼俊鎭皢浼犻�掕嚦姝よ彍鍗曪紝鍙湪url鍙橀噺銆佽〃鍗曪紙鍏宠仈涓昏〃锛夈�侀潤鎬佸睘鎬у崱銆佹诞鍔ㄥ崱涓娇鐢ㄣ��',
       required: true,
       options: menulist,
       forbid: ['pc', 'mob'].includes(appType)
     },
     {
-      type: 'select',
+      type: isStatic ? 'text' : 'select',
+      defType: isStatic ? 'text' : 'select',
       key: 'linkurl',
       label: '閾炬帴鍦板潃',
       initVal: card.linkurl || '',
-      tooltip: ['pc', 'mob'].includes(appType) ? '褰撻摼鎺ョ被鍨嬩负鈥滃叾浠栤�濓紝涓旈摼鎺ュ湴鍧�浠menuid@寮�澶存椂锛屽叾鍚庡唴瀹瑰皢琚涓鸿彍鍗旾D銆�' : '',
+      tooltip: '鍦ㄩ摼鎺ヤ腑浠***@褰㈠紡鎷兼帴鐨勫瓧娈碉紙瀛楁鏉ユ簮浜庡瓧娈甸泦涓紝姝ゅ id銆乤ppkey銆乽serid銆丩oginUID 涓虹郴缁熷瓧娈碉級锛岃烦杞椂灏嗘浛鎹负瀵瑰簲鍊硷紝渚嬪锛歨ttp://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@锛屽叾涓璦ppkey涓嶭oginUID灏嗚鏇挎崲銆�' + (['pc', 'mob'].includes(appType) ? '褰撻摼鎺ョ被鍨嬩负鈥滃叾浠栤�濓紝涓旈摼鎺ュ湴鍧�浠menuid@寮�澶存椂锛屽叾鍚庡唴瀹瑰皢琚涓鸿彍鍗旾D銆�' : ''),
+      toolWidth: 350,
       required: true,
-      options: []
+      options: fields
     },
     {
       type: 'radio',
@@ -662,27 +698,19 @@
       ]
     },
     {
-      type: 'radio',
-      key: 'joint',
-      label: '鎷兼帴鍙傛暟',
-      initVal: card.joint || 'true',
+      type: 'checkbox',
+      key: 'evalchars',
+      label: '鏇挎崲瀛楃',
+      initVal: card.evalchars || ['enter', 'space'],
+      tooltip: '鍏紡瑙f瀽鍚庯紝鍙浛鎹㈠洖杞︺�佺┖鏍肩瓑瀛楃锛屽疄鐜版崲琛屻�佸瓧闂磋窛鎺у埗绛夐〉闈㈡晥鏋溿��',
       required: false,
       options: [{
-        value: 'true',
-        text: '鏄�'
+        value: 'enter',
+        text: '鍥炶溅绗�'
       }, {
-        value: 'false',
-        text: '鍚�'
+        value: 'space',
+        text: '绌烘牸'
       }]
-    },
-    {
-      type: 'codemirror',
-      key: 'formula',
-      label: '鍏紡',
-      initVal: card.formula || '',
-      tooltip: '鎵ц鏃朵細浣跨敤鏌ヨ鍒扮殑鏁版嵁鏇挎崲鐩稿簲鐨勫瓧娈碉紝灞曠ず鑾峰緱鐨勭粨鏋滐紝鍦ㄤ笉浣跨敤瑙f瀽鏃舵崲琛岀鎴栫┖鏍间細鏇挎崲涓洪〉闈㈠厓绱犮�傚彲浣跨敤JS鐨勪竴浜涜娉曪紝濡傦細涓夊厓琛ㄨ揪寮� @field1@ > @field2@ ? 0 : 1锛汳ath瀵硅薄锛屽彇缁濆鍊� Math.abs(@field@)銆佸洓鑸嶄簲鍏� Math.round(@field@)绛夈�傛敞锛氫細鏇挎崲鍏紡涓殑@username@銆丂fullName@銆丂bid@銆�',
-      placeholder: '渚嬪锛欯price@ * @number@',
-      required: true
     },
     {
       type: 'radio',
@@ -695,6 +723,16 @@
         { value: 'show', text: '鏄剧ず' },
         { value: 'hide', text: '闅愯棌' }
       ]
+    },
+    {
+      type: 'select',
+      key: 'noVField',
+      label: '绌哄�煎瓧娈�',
+      initVal: card.noVField || '',
+      tooltip: '鐢ㄤ簬鎺у埗姝ら潤鎬佸厓绱犵殑鏄剧ず/闅愯棌锛屽綋姝ゅ瓧娈典负绌烘椂锛堟暟鍊间负0锛夛紝闅愯棌褰撳墠鍏冪礌銆�',
+      required: false,
+      allowClear: true,
+      options: [],
     },
     {
       type: 'radio',
@@ -796,6 +834,56 @@
       options: [],
       forbid: !isHeader
     },
+    {
+      type: 'table',
+      key: 'signs',
+      label: '鏍囪',
+      initVal: card.signs || [],
+      tooltip: '鍙緷鎹爣绛惧唴瀹硅缃笉鍚屾牱寮忋��',
+      required: false,
+      actions: ['edit', 'del', 'add', 'move'],
+      columns: [
+        {
+          title: '鍊�',
+          dataIndex: 'value',
+          inputType: 'text',
+          editable: true,
+          required: true,
+          unique: true,
+          width: '20%'
+        },
+        {
+          title: '鑳屾櫙',
+          dataIndex: 'background',
+          inputType: 'color',
+          className: 'mini-color',
+          editable: true,
+          required: true,
+          width: '20%',
+          render: (text) => <span className="mk-color-value" style={{background: text}}></span>,
+        },
+        {
+          title: '鏂囧瓧',
+          dataIndex: 'color',
+          inputType: 'color',
+          className: 'mini-color',
+          editable: true,
+          required: true,
+          width: '20%',
+          render: (text) => <span className="mk-color-value" style={{background: text}}></span>,
+        },
+        {
+          title: '杈规',
+          dataIndex: 'border',
+          inputType: 'color',
+          className: 'mini-color',
+          editable: true,
+          required: true,
+          width: '20%',
+          render: (text) => <span className="mk-color-value" style={{background: text}}></span>,
+        },
+      ]
+    },
   ]
 
   return forms

--
Gitblit v1.8.0