From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 07 四月 2021 23:25:29 +0800
Subject: [PATCH] 2021-04-07

---
 src/menu/components/card/cardcellcomponent/formconfig.jsx |  105 ++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 84 insertions(+), 21 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx
index c103921..b81da36 100644
--- a/src/menu/components/card/cardcellcomponent/formconfig.jsx
+++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -1,7 +1,7 @@
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 
-const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
+const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
 
 /**
  * @description 鑾峰彇鎸夐挳琛ㄥ崟閰嶇疆淇℃伅
@@ -24,6 +24,22 @@
 
   if (type === 'table') {
     _options.push({value: 'sequence', text: '搴忓彿'})
+  }
+  let appMenus = []
+  const isApp = sessionStorage.getItem('appType') === 'pc'
+
+  if (isApp) {
+    appMenus = sessionStorage.getItem('appMenus')
+    if (appMenus) {
+      try {
+        appMenus = JSON.parse(appMenus)
+        appMenus = appMenus.map(item => ({value: item.MenuID, text: item.MenuName}))
+      } catch {
+        appMenus = []
+      }
+    } else {
+      appMenus = []
+    }
   }
 
   let forms = [
@@ -101,6 +117,7 @@
       min: 0,
       label: '鍐呭',
       initVal: card.value || '',
+      tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@銆丂fullName@銆丂login_city@銆�',
       required: true
     },
     {
@@ -132,26 +149,6 @@
         { value: 'true', text: '鏄�' },
         { value: 'false', text: '鍚�' }
       ]
-    },
-    {
-      type: 'radio',
-      key: 'link',
-      label: '閾炬帴',
-      initVal: card.link || '',
-      required: false,
-      options: [
-        { value: '', text: '鏃�' },
-        { value: 'dynamic', text: '鍔ㄦ��' },
-        { value: 'static', text: '闈欐��' }
-      ]
-    },
-    {
-      type: 'select',
-      key: 'linkurl',
-      label: '閾炬帴鍦板潃',
-      initVal: card.linkurl || '',
-      required: true,
-      options: []
     },
     {
       type: 'select',
@@ -314,6 +311,64 @@
     },
     {
       type: 'radio',
+      key: 'link',
+      label: '閾炬帴',
+      initVal: card.link || '',
+      tooltip: '鍔ㄦ�佸湴鍧�涓虹粦瀹氬瓧娈靛�笺��',
+      required: false,
+      forbid: isApp,
+      options: [
+        { value: '', text: '鏃�' },
+        { value: 'dynamic', text: '鍔ㄦ��' },
+        { value: 'static', text: '闈欐��' }
+      ]
+    },
+    {
+      type: 'select',
+      key: 'link',
+      label: '閾炬帴',
+      initVal: card.link || '',
+      required: false,
+      forbid: !isApp,
+      options: [
+        { value: '', text: '鏃�' },
+        { value: 'page', text: '鑿滃崟' },
+        { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
+        { value: 'custom', text: '閾炬帴' }
+      ]
+    },
+    {
+      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: 'copyMenuId',
+      label: '澶嶅埗鑿滃崟',
+      initVal: card.copyMenuId || '',
+      required: false,
+      forbid: !isApp,
+      options: appMenus
+    },
+    {
+      type: 'radio',
       key: 'joint',
       label: Formdict['model.form.paramJoint'],
       initVal: card.joint || 'true',
@@ -326,6 +381,14 @@
         text: Formdict['model.false']
       }]
     },
+    {
+      type: 'select',
+      key: 'linkurl',
+      label: '閾炬帴鍦板潃',
+      initVal: card.linkurl || '',
+      required: true,
+      options: []
+    },
   ]
 
   return forms

--
Gitblit v1.8.0