From 08cce3334a2dc81d690b518136b0aaea64e48b0b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 14 六月 2023 09:55:50 +0800
Subject: [PATCH] 2023-06-14

---
 src/menu/components/card/data-card/options.jsx |  141 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 124 insertions(+), 17 deletions(-)

diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx
index c750cfc..9f2edb2 100644
--- a/src/menu/components/card/data-card/options.jsx
+++ b/src/menu/components/card/data-card/options.jsx
@@ -3,7 +3,7 @@
 /**
  * @description Wrap琛ㄥ崟閰嶇疆淇℃伅
  */
-export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting) {
+export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting, buttons = []) {
   let appType = sessionStorage.getItem('appType')
   let MenuType = ''
   let menu = window.GLOB.customMenu
@@ -103,9 +103,11 @@
       ],
       linkFields: ['priKeyType'],
       controlFields: [
-        {field: 'goback', values: ['dynamic']},
+        {field: 'goback', values: ['dynamic', 'public']},
         {field: 'empty', values: ['dynamic', 'public']},
-        {field: 'jump', values: ['dynamic']},
+        {field: 'jump', values: ['dynamic', 'public']},
+        {field: 'broadcast', values: ['dynamic', 'public']},
+        {field: 'autoExec', values: ['dynamic', 'public']},
         {field: 'supModule', values: ['static']},
         {field: 'publicId', values: ['public']},
       ],
@@ -118,7 +120,42 @@
       initval: wrap.publicId || '',
       required: true,
       options: interfaces,
-      forbid: subtype !== 'propcard'
+      reset_source: true,
+      forbid: subtype !== 'propcard',
+      callback: (map, record) => {
+        if (!record.publicId) return
+        
+        let interfaces = window.GLOB.customMenu.interfaces || []
+        
+        let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0]
+        
+        if (!d || !d.columns) return
+        let columns = JSON.parse(JSON.stringify(d.columns))
+
+        let _broadcast = map.get('broadcast')
+
+        if (_broadcast && !_broadcast.forbid) {
+          _broadcast.options = columns
+          _broadcast.oriOptions = columns
+          map.set('broadcast', _broadcast)
+        }
+        
+        let _jumpField = map.get('jumpField')
+
+        if (_jumpField && !_jumpField.forbid) {
+          _jumpField.options = columns
+          _jumpField.oriOptions = columns
+          map.set('jumpField', _jumpField)
+        }
+
+        let _link = map.get('link')
+
+        if (_link && !_link.forbid) {
+          _link.options = columns
+          _link.oriOptions = columns
+          map.set('link', _link)
+        }
+      }
     },
     {
       type: 'radio',
@@ -148,7 +185,7 @@
       options: [
         {value: 'page', label: '椤电爜'},
         {value: 'switch', label: '宸﹀彸鍒囨崲', forbid: appType === 'mob' || subtype === 'tablecard'},
-        {value: 'slide', label: '婊戝姩鍔犺浇', forbid: appType !== 'mob'},
+        {value: 'slide', label: '婊戝姩鍔犺浇', forbid: appType !== 'mob' || sessionStorage.getItem('editMenuType') === 'popview'},
         {value: 'more', label: '鏌ョ湅鏇村'},
       ],
       controlFields: [
@@ -195,18 +232,33 @@
       forbid: subtype !== 'propcard'
     },
     {
+      type: 'select',
+      field: 'selected',
+      label: '鏁版嵁閫変腑',
+      initval: wrap.selected || 'false',
+      tooltip: '鍒濆鍖栵細鏁版嵁鍔犺浇鏃堕�変腑棣栬鏁版嵁锛屼粎鎵ц涓�娆°�傛暟鎹姞杞斤細姣忔鏁版嵁鍔犺浇鏃跺潎閫変腑棣栬锛堝綋鎸夐挳鎵ц瀹屾垚骞惰繑鍥炰富閿�兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇锛夈�傞�変腑鏍囪锛氳繑鍥炴暟鎹腑瀛樺湪 selected 瀛楁锛屼笖鍊间负 true 鐨勬暟鎹閫変腑銆�',
+      required: false,
+      options: [
+        {value: 'false', label: '鏃�'},
+        {value: 'init', label: '鍒濆鍖�'},
+        {value: 'always', label: '鏁版嵁鍔犺浇'},
+        {value: 'sign', label: '閫変腑鏍囪'}
+      ],
+      forbid: subtype !== 'datacard'
+    },
+    {
       type: 'radio',
       field: 'selected',
-      label: '棣栬閫変腑',
+      label: '鏁版嵁閫変腑',
       initval: wrap.selected || 'false',
-      tooltip: '褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆�',
+      tooltip: '鍒濆鍖栵細鏁版嵁鍔犺浇鏃堕�変腑棣栬鏁版嵁锛屼粎鎵ц涓�娆°�傛暟鎹姞杞斤細姣忔鏁版嵁鍔犺浇鏃跺潎閫変腑棣栬銆�',
       required: false,
       options: [
         {value: 'false', label: '鏃�'},
         {value: 'init', label: '鍒濆鍖�'},
         {value: 'always', label: '鏁版嵁鍔犺浇'},
       ],
-      forbid: subtype === 'tablecard'
+      forbid: subtype !== 'propcard'
     },
     {
       type: 'select',
@@ -221,7 +273,10 @@
         {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'},
         {value: 'font', label: '鏂囧瓧'},
         {value: 'tabs', label: '鏍囩椤�'},
-        ...(subtype === 'datacard' && appType === 'mob' ? [{value: 'check', label: '鍕鹃��'}] : [])
+        ...(subtype === 'datacard' ? [
+          {value: 'check', label: '鍕鹃�夛紙鍦嗘锛�'},
+          {value: 'check square', label: '鍕鹃�夛紙鏂规锛�'}
+        ] : [])
       ],
       forbid: subtype === 'tablecard'
     },
@@ -266,6 +321,19 @@
     },
     {
       type: 'radio',
+      field: 'parity',
+      label: '濂囧伓鑳屾櫙',
+      initval: wrap.parity || 'false',
+      tooltip: '鍋舵暟琛屼細娣诲姞鑳屾櫙鑹层��',
+      required: false,
+      options: [
+        {value: 'false', label: '鏃�'},
+        {value: 'true', label: '鏈�'},
+      ],
+      forbid: subtype === 'propcard'
+    },
+    {
+      type: 'radio',
       field: 'printType',
       label: '缁勪欢绫诲瀷',
       initval: wrap.printType || 'content',
@@ -294,7 +362,7 @@
       field: 'broadcast',
       label: '璇煶鎾姤',
       initval: wrap.broadcast || '',
-      tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧapp涓湁鏁堛�傛敞锛氫娇鐢ㄨ闊虫挱鎶ユ椂锛屾暟鎹簮涓嶈浣跨敤鍚屾鏌ヨ锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�',
+      tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧ鏈夋晥銆傛敞锛氬湪H5涓浣跨敤闊抽閾炬帴锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�',
       required: false,
       options: columns,
       forbid: !columns || appType !== 'mob' || subtype !== 'propcard'
@@ -302,15 +370,31 @@
     {
       type: 'radio',
       field: 'goback',
-      label: '绌哄�艰繑鍥�',
+      label: appType === 'mob' ? '绌哄�艰繑鍥�' : '绌哄�煎叧闂�',
       initval: wrap.goback || 'false',
-      tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岃繑鍥炰笂涓�鐣岄潰銆�',
+      tooltip: appType === 'mob' ? '褰撴煡璇㈡暟鎹负绌烘椂锛岃繑鍥炰笂涓�鐣岄潰銆�' : '褰撴煡璇㈡暟鎹负绌烘椂锛屽叧闂綋鍓嶆爣绛鹃〉銆�',
       required: false,
       options: [
-        {value: 'true', label: '鏄�'},
         {value: 'false', label: '鍚�'},
+        {value: 'true', label: '鏄�'},
       ],
-      forbid: subtype !== 'propcard' || appType !== 'mob'
+      forbid: subtype !== 'propcard' || appType === 'pc'
+    },
+    {
+      type: 'radio',
+      field: 'display',
+      label: '鏄剧ず鎺у埗',
+      initval: wrap.display || 'normal',
+      tooltip: '褰撲娇鐢ㄥ睘鎬у崱杩涜鏌愪簺涓氬姟鎿嶄綔锛屼笖涓嶉渶瑕佸睍绀哄崱鐗囦俊鎭椂锛屽彲璁剧疆涓轰笉鍙銆�',
+      required: false,
+      options: [
+        {value: 'normal', label: '姝e父鏄剧ず'},
+        {value: 'hidden', label: '涓嶅彲瑙�'},
+      ],
+      controlFields: [
+        {field: 'empty', values: ['normal']},
+      ],
+      forbid: subtype !== 'propcard'
     },
     {
       type: 'radio',
@@ -324,6 +408,16 @@
         {value: 'show', label: '鍚�'},
         {value: 'hidden', label: '鏄�'},
       ],
+    },
+    {
+      type: 'select',
+      field: 'autoExec',
+      label: '鑷姩鎵ц',
+      initval: wrap.autoExec || '',
+      tooltip: '鏁版嵁鏇存柊鏃惰嚜鍔ㄦ墽琛屾寜閽�傛敞锛氭鎸夐挳鎵ц鎴愬姛鍚庤皑鎱庨�夋嫨鍒锋柊椤癸紝閬垮厤閫犳垚寰幆鎵ц銆�',
+      required: false,
+      options: buttons,
+      forbid: subtype !== 'propcard'
     },
     {
       type: 'radio',
@@ -340,6 +434,7 @@
       controlFields: [
         {field: 'jumpField', values: ['menu', 'link']},
         {field: 'joint', values: ['menu', 'link']},
+        {field: 'open', values: ['menu', 'link']},
         {field: 'menu', values: ['menu']},
         {field: 'link', values: ['link']},
       ],
@@ -350,7 +445,7 @@
       field: 'jumpField',
       label: '鎺у埗瀛楁',
       initval: wrap.jumpField || '',
-      tooltip: '褰撳瓧娈靛�间负true鏃�',
+      tooltip: '褰撳瓧娈靛�间负true鏃惰Е鍙戣烦杞��',
       required: true,
       options: columns,
       forbid: subtype !== 'propcard' || appType !== 'mob'
@@ -383,6 +478,18 @@
       options: [
         {value: 'true', label: '鏄�'},
         {value: 'false', label: '鍚�'},
+      ],
+      forbid: subtype !== 'propcard' || appType !== 'mob'
+    },
+    {
+      type: 'radio',
+      field: 'open',
+      label: '鎵撳紑鏂瑰紡',
+      initval: wrap.open || 'blank',
+      required: false,
+      options: [
+        {value: 'blank', label: '鏂扮獥鍙�'},
+        {value: 'self', label: '褰撳墠绐楀彛'},
       ],
       forbid: subtype !== 'propcard' || appType !== 'mob'
     },
@@ -452,13 +559,13 @@
       type: 'radio',
       field: 'permission',
       label: '鏉冮檺楠岃瘉',
-      initval: wrap.permission || 'false',
+      initval: wrap.permission || (!appType ? 'true' : 'false'),
       required: false,
       options: [
         {value: 'true', label: '鍚敤'},
         {value: 'false', label: '绂佺敤'},
       ],
-      forbid: !appType
+      forbid: sessionStorage.getItem('editMenuType') === 'popview'
     },
     {
       type: 'multiselect',

--
Gitblit v1.8.0