From 5046d0d13dc6a8563b8e54e31913bc44cfa1072f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 四月 2022 19:23:18 +0800
Subject: [PATCH] 2022-04-26

---
 src/menu/components/card/data-card/options.jsx |  130 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 125 insertions(+), 5 deletions(-)

diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx
index 33b8ebc..913aba8 100644
--- a/src/menu/components/card/data-card/options.jsx
+++ b/src/menu/components/card/data-card/options.jsx
@@ -29,6 +29,21 @@
     roleList = []
   }
 
+  let menulist = []
+
+  if (appType === 'mob') {
+    menulist = sessionStorage.getItem('appMenus')
+    if (menulist) {
+      try {
+        menulist = JSON.parse(menulist)
+      } catch (e) {
+        menulist = []
+      }
+    } else {
+      menulist = []
+    }
+  }
+
   const cardWrapForm = [
     {
       type: 'text',
@@ -70,9 +85,28 @@
       linkFields: ['priKeyType'],
       controlFields: [
         {field: 'goback', values: ['dynamic']},
+        {field: 'empty', values: ['dynamic']},
+        {field: 'jump', values: ['dynamic']},
         {field: 'supModule', values: ['static']},
       ],
       forbid: subtype !== 'propcard'
+    },
+    {
+      type: 'radio',
+      field: 'layout',
+      label: '鍗$墖甯冨眬',
+      initval: wrap.layout || 'grid',
+      tooltip: appType === 'mob' ? '寮规�у竷灞�鏃讹紝婊戝姩鍔犺浇鏃犳晥' : '寮规�у竷灞�鏃讹紝宸﹀彸鍒囨崲鏃犳晥',
+      required: false,
+      options: [
+        {value: 'grid', label: '鏍呮牸甯冨眬'},
+        {value: 'flex', label: '寮规�у竷灞�'},
+      ],
+      controlFields: subtype !== 'propcard' ? [
+        {field: 'printHeight', values: ['flex']},
+        {field: 'cardFloat', values: ['grid']},
+      ] : [{field: 'cardFloat', values: ['grid']}],
+      forbid: subtype === 'tablecard'
     },
     {
       type: 'radio',
@@ -128,6 +162,7 @@
       field: 'selected',
       label: '棣栬閫変腑',
       initval: wrap.selected || 'false',
+      tooltip: '褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆�',
       required: false,
       options: [
         {value: 'false', label: '鏃�'},
@@ -168,7 +203,7 @@
       field: 'cardFloat',
       label: '瀵归綈鏂瑰紡',
       initval: wrap.cardFloat || 'left',
-      tooltip: '璁剧疆涓哄眳涓榻愭垨鍙冲榻愶紝鍙湪鍗$墖涓�1琛屾椂鏈夋晥銆�',
+      tooltip: '璁剧疆鍗$墖鐨勫榻愭柟寮忋��',
       required: false,
       options: [
         {value: 'left', label: '宸﹀榻�'},
@@ -201,7 +236,19 @@
         {value: 'content', label: '鍐呭'},
         {value: 'headerOrfooter', label: '椤电湁/椤佃剼'},
       ],
+      controlFields: [
+        {field: 'printHeight', values: ['content']},
+      ],
       forbid: subtype !== 'propcard' || MenuType !== 'billPrint'
+    },
+    {
+      type: 'number',
+      field: 'printHeight',
+      label: '鎹㈢畻楂樺害',
+      initval: wrap.printHeight || '',
+      tooltip: subtype !== 'propcard' ? '褰撳墠鏁版嵁鍗¢珮搴︾浉褰撲簬鍑犳潯鏁版嵁銆�' : '褰撳墠灞炴�у崱楂樺害鐩稿綋浜庡嚑鏉℃暟鎹��',
+      required: false,
+      forbid: subtype === 'tablecard' || MenuType !== 'billPrint'
     },
     {
       type: 'select',
@@ -211,7 +258,7 @@
       tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧapp涓湁鏁堛�傛敞锛氫娇鐢ㄨ闊虫挱鎶ユ椂锛屾暟鎹簮涓嶈浣跨敤鍚屾鏌ヨ锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�',
       required: false,
       options: columns,
-      forbid: !columns || appType !== 'mob'
+      forbid: !columns || appType !== 'mob' || subtype !== 'propcard'
     },
     {
       type: 'radio',
@@ -233,11 +280,72 @@
       initval: wrap.empty || 'show',
       tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
       required: false,
+      skip: true,
       options: [
         {value: 'show', label: '鍚�'},
         {value: 'hidden', label: '鏄�'},
       ],
-      forbid: subtype !== 'datacard'
+    },
+    {
+      type: 'radio',
+      field: 'jump',
+      label: '椤甸潰璺宠浆',
+      initval: wrap.jump || '',
+      tooltip: '閫氳繃鏌ヨ杩斿洖鍊煎垽鏂〉闈㈡槸鍚﹁璺宠浆銆�',
+      required: false,
+      options: [
+        {value: '', label: '鏃�'},
+        {value: 'menu', label: '鑿滃崟'},
+        {value: 'link', label: '閾炬帴'},
+      ],
+      controlFields: [
+        {field: 'jumpField', values: ['menu', 'link']},
+        {field: 'joint', values: ['menu', 'link']},
+        {field: 'menu', values: ['menu']},
+        {field: 'link', values: ['link']},
+      ],
+      forbid: subtype !== 'propcard' || appType !== 'mob'
+    },
+    {
+      type: 'select',
+      field: 'jumpField',
+      label: '鎺у埗瀛楁',
+      initval: wrap.jumpField || '',
+      tooltip: '褰撳瓧娈靛�间负true鏃�',
+      required: true,
+      options: columns,
+      forbid: subtype !== 'propcard' || appType !== 'mob'
+    },
+    {
+      type: 'select',
+      field: 'menu',
+      label: '鑿滃崟',
+      initval: wrap.menu || '',
+      required: true,
+      options: menulist,
+      forbid: subtype !== 'propcard' || appType !== 'mob'
+    },
+    {
+      type: 'select',
+      field: 'link',
+      label: '閾炬帴瀛楁',
+      initval: wrap.link || '',
+      tooltip: '璺宠浆閾炬帴涓烘煡璇㈡暟鎹殑杩斿洖鍊笺��',
+      required: true,
+      options: columns,
+      forbid: subtype !== 'propcard' || appType !== 'mob'
+    },
+    {
+      type: 'radio',
+      field: 'joint',
+      label: '鍙傛暟鎷兼帴',
+      initval: wrap.joint || 'true',
+      required: false,
+      options: [
+        {value: 'true', label: '鏄�'},
+        {value: 'false', label: '鍚�'},
+      ],
+      forbid: subtype !== 'propcard' || appType !== 'mob'
     },
     {
       type: 'radio',
@@ -302,6 +410,18 @@
       ]
     },
     {
+      type: 'radio',
+      field: 'permission',
+      label: '鏉冮檺楠岃瘉',
+      initval: wrap.permission || 'false',
+      required: false,
+      options: [
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: !appType
+    },
+    {
       type: 'multiselect',
       field: 'blacklist',
       label: '榛戝悕鍗�',
@@ -341,11 +461,11 @@
     }
   ]
 
-  return cardWrapForm.map(item => {
+  return cardWrapForm.filter(item => {
     if (['pagestyle'].includes(item.field)) {
       item.options = item.options.filter(option => !option.forbid)
     }
 
-    return item
+    return !item.forbid
   })
 } 
\ No newline at end of file

--
Gitblit v1.8.0