From da34633b25d16359cd91a656acad5e811f9972b7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 14 三月 2023 18:09:54 +0800
Subject: [PATCH] 2023-03-14

---
 src/menu/components/card/cardcellcomponent/formconfig.jsx |  100 +++++++++++++++++++++----------------------------
 1 files changed, 43 insertions(+), 57 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx
index ab7b202..859dc58 100644
--- a/src/menu/components/card/cardcellcomponent/formconfig.jsx
+++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -1,14 +1,11 @@
-import zhCN from '@/locales/zh-CN/model.js'
-import enUS from '@/locales/en-US/model.js'
-
-const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
+import MenuUtils from '@/utils/utils-custom.js'
 
 /**
  * @description 鑾峰彇鍏冪礌閰嶇疆淇℃伅
  * @param {*} card
  * @param {*} type
  */
-export function getCardCellForm (card, type, subtype, cardCell, anchors) {
+export function getCardCellForm (card, cards, cardCell) {
   let _options = [
     { value: 'text', text: '鏂囨湰'},
     { value: 'number', text: '鏁板��'},
@@ -21,29 +18,25 @@
     { value: 'qrcode', text: '浜岀淮鐮�'},
     { value: 'currentDate', text: '褰撳墠鏃堕棿'},
     { value: 'formula', text: '鍏紡'},
+    { value: 'color', text: '棰滆壊'},
   ]
 
-  if (type === 'table' || (type === 'card' && subtype === 'datacard')) {
+  let anchors = []
+  if (window.GLOB.customMenu.Template === 'BaseTable') {
+    anchors = null
+  } else {
+    anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, cards.uuid) || []
+  }
+
+  if (cards.type === 'table' || (cards.type === 'card' && cards.subtype !== 'propcard')) {
     _options.push({value: 'sequence', text: '搴忓彿'})
   } else if (card.eleType === 'sequence') { // 鎷栨嫿娣诲姞绫诲瀷杞崲
     card.eleType = 'text'
   }
-
-  let appMenus = []
-  const isApp = sessionStorage.getItem('appType') === 'pc'
-
-  if (isApp) {
-    appMenus = sessionStorage.getItem('appMenus')
-    if (appMenus) {
-      try {
-        appMenus = JSON.parse(appMenus)
-      } catch (e) {
-        appMenus = []
-      }
-    } else {
-      appMenus = []
-    }
+  if (card.eleType === 'icon' && card.datatype === 'dynamic' && !card.field) { // 鎷栨嫿娣诲姞绫诲瀷杞崲
+    card.datatype = 'static'
   }
+  let appType = sessionStorage.getItem('appType')
 
   let tooltip = ''
   if (cardCell.$cardType === 'extendCard') {
@@ -58,13 +51,6 @@
       initVal: card.eleType,
       required: true,
       options: _options
-    },
-    {
-      type: 'icon',
-      key: 'icon',
-      label: '鍥炬爣',
-      initVal: card.icon,
-      required: true
     },
     {
       type: 'radio',
@@ -85,6 +71,13 @@
       initVal: card.field || '',
       required: true,
       options: []
+    },
+    {
+      type: 'icon',
+      key: 'icon',
+      label: '鍥炬爣',
+      initVal: card.icon,
+      required: true
     },
     {
       type: 'text',
@@ -230,7 +223,8 @@
       key: 'tooltip',
       label: '鎻愮ず淇℃伅',
       initVal: card.tooltip || '',
-      tooltip: '榧犳爣鎮诞鏃舵樉绀恒��',
+      tooltip: '榧犳爣鎮诞鏃舵樉绀恒�傛敞锛氬浣跨敤鍔ㄦ�佷俊鎭紝璇峰湪姝ゅ濉啓鐩稿簲鐨勫瓧娈靛悕銆�',
+      forbid: appType === 'mob',
       required: false
     },
     {
@@ -369,7 +363,8 @@
       initVal: card.anchors || [],
       tooltip: sessionStorage.getItem('appType') === 'mob' ? '娉細灏忕▼搴忎腑鏃犳晥' : '',
       required: false,
-      options: anchors
+      options: anchors,
+      forbid: !anchors
     },
     {
       type: 'number',
@@ -445,6 +440,18 @@
         { value: '9:16', text: '9:16' },
       ]
     },
+    // {
+    //   type: 'radio',
+    //   key: 'backgroundSize',
+    //   label: '鍥惧儚澶у皬',
+    //   initVal: card.backgroundSize || 'cover',
+    //   required: false,
+    //   options: [
+    //     { value: 'cover', text: '瑕嗙洊' },
+    //     { value: 'contain', text: '鍖呭惈' },
+    //     { value: 'auto', text: '鑷�傚簲' },
+    //   ]
+    // },
     {
       type: 'number',
       key: 'maxWidth',
@@ -505,27 +512,6 @@
     },
     {
       type: 'select',
-      key: 'linkmenu',
-      label: '鍏宠仈鑿滃崟',
-      initVal: card.linkmenu || '',
-      required: true,
-      forbid: !isApp,
-      options: appMenus
-    },
-    // {
-    //   type: 'radio',
-    //   key: 'open',
-    //   label: '鎵撳紑鏂瑰紡',
-    //   initVal: card.open || 'blank',
-    //   required: false,
-    //   forbid: !isApp,
-    //   options: [
-    //     { value: 'blank', text: '鏂伴〉闈�' },
-    //     { value: 'self', text: '褰撳墠椤甸潰' }
-    //   ]
-    // },
-    {
-      type: 'select',
       key: 'linkurl',
       label: '閾炬帴鍦板潃',
       initVal: card.linkurl || '',
@@ -535,15 +521,15 @@
     {
       type: 'radio',
       key: 'joint',
-      label: Formdict['model.form.paramJoint'],
+      label: '鎷兼帴鍙傛暟',
       initVal: card.joint || 'true',
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
@@ -555,10 +541,10 @@
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
@@ -575,7 +561,7 @@
       key: 'noValue',
       label: '绌哄��',
       initVal: card.noValue || 'show',
-      tooltip: '褰撳厓绱犲唴瀹逛负绌烘椂锛屾槸鍚︽樉绀哄綋鍓嶅厓绱犮��',
+      tooltip: '褰撳厓绱犲唴瀹逛负绌烘椂锛屾槸鍚︽樉绀哄綋鍓嶅厓绱犮�傛敞锛氭暟鍊肩被鍨嬪厓绱犲寘鎷暟瀛�0锛堥潪鏂囨湰锛夈��',
       required: false,
       options: [
         { value: 'show', text: '鏄剧ず' },

--
Gitblit v1.8.0