From c0e1a2f76bb28ab71e54d30ac2dda945fa1e4a7e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 02 七月 2024 11:51:35 +0800
Subject: [PATCH] 2024-07-02

---
 src/menu/components/share/actioncomponent/formconfig.jsx |  163 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 104 insertions(+), 59 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index e9d1a30..4d90ee7 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -331,9 +331,21 @@
     extraParam.push('dataM')
   }
 
+  let apps = []
+  let merchs = []
   if (!appType) {
     if (typeof(card.openmenu) === 'string') {
       card.openmenu = []
+    }
+
+    if (window.GLOB.WXApps) {
+      window.GLOB.WXApps.forEach(item => {
+        if (item.appType === 'merchant') {
+          merchs.push({value: item.appId, text: item.appName})
+        } else {
+          apps.push({value: item.appId, text: item.appName})
+        }
+      })
     }
   } else {
     if (typeof(card.openmenu) !== 'string') {
@@ -509,10 +521,20 @@
       key: 'wxApp',
       label: '鍏宠仈搴旂敤',
       initVal: card.wxApp || '',
-      tooltip: '璇峰叧鑱旀敮浠橈紙鎴栭��娆撅級鐨勫叕浼楀彿鎴栧皬绋嬪簭銆�',
+      tooltip: '璇峰叧鑱旀敮浠樼殑鍏紬鍙锋垨灏忕▼搴忋��',
       required: true,
-      forbid: !!appType || !window.GLOB.WXApps,
-      options: window.GLOB.WXApps ? window.GLOB.WXApps.map(item => ({value: item.appId, text: item.appName})) : []
+      forbid: apps.length === 0,
+      options: apps
+    },
+    {
+      type: 'select',
+      key: 'wxMerch',
+      label: '鍏宠仈鍟嗘埛',
+      initVal: card.wxMerch || '',
+      tooltip: '璇峰叧鑱旀敮浠樼殑鍟嗘埛鍙枫��',
+      required: true,
+      forbid: merchs.length === 0,
+      options: merchs
     },
     {
       type: 'text',
@@ -1013,37 +1035,6 @@
       options: modules.length ? [...modules, {value: 'multiComponent', label: '澶氱粍浠�'}] : []
     },
     {
-      type: 'radio',
-      key: 'pagination',
-      label: '鍒嗛〉',
-      initVal: card.pagination || 'false',
-      tooltip: '瀵煎嚭鏁版嵁閲忚緝澶ф椂锛�1000+锛夛紝鍙缃垎椤佃姹傛暟鎹��',
-      required: false,
-      options: [{
-        value: 'true',
-        text: '鏄�'
-      }, {
-        value: 'false',
-        text: '鍚�'
-      }],
-      forbid: appType === 'mob'
-    },
-    {
-      type: 'radio',
-      key: 'search',
-      label: '鎼滅储鏉′欢',
-      initVal: card.search || 'false',
-      required: false,
-      options: [{
-        value: 'true',
-        text: '蹇呭~'
-      }, {
-        value: 'false',
-        text: '闈炲繀濉�'
-      }],
-      forbid: appType === 'mob'
-    },
-    {
       type: 'cascader',
       key: 'refreshTab',
       label: '鍒锋柊鑿滃崟',
@@ -1083,6 +1074,37 @@
       tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佽烦杞殑閿氱偣銆�' + (appType === 'mob' ? '娉細灏忕▼搴忎腑鏃犳晥' : ''),
       required: false,
       options: anchors
+    },
+    {
+      type: 'radio',
+      key: 'pagination',
+      label: '鍒嗛〉',
+      initVal: card.pagination || 'false',
+      tooltip: '瀵煎嚭鏁版嵁閲忚緝澶ф椂锛�1000+锛夛紝鍙缃垎椤佃姹傛暟鎹��',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '鏄�'
+      }, {
+        value: 'false',
+        text: '鍚�'
+      }],
+      forbid: appType === 'mob'
+    },
+    {
+      type: 'radio',
+      key: 'search',
+      label: '鎼滅储鏉′欢',
+      initVal: card.search || 'false',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '蹇呭~'
+      }, {
+        value: 'false',
+        text: '闈炲繀濉�'
+      }],
+      forbid: appType === 'mob'
     },
     {
       type: 'select',
@@ -1764,6 +1786,19 @@
     extraParam.push('dataM')
   }
 
+  let apps = []
+  let merchs = []
+
+  if (window.GLOB.WXApps) {
+    window.GLOB.WXApps.forEach(item => {
+      if (item.appType === 'merchant') {
+        merchs.push({value: item.appId, text: item.appName})
+      } else {
+        apps.push({value: item.appId, text: item.appName})
+      }
+    })
+  }
+
   let forms = [
     {
       type: 'select',
@@ -1911,10 +1946,20 @@
       key: 'wxApp',
       label: '鍏宠仈搴旂敤',
       initVal: card.wxApp || '',
-      tooltip: '璇峰叧鑱旀敮浠橈紙鎴栭��娆撅級鐨勫叕浼楀彿鎴栧皬绋嬪簭銆�',
+      tooltip: '璇峰叧鑱旀敮浠樼殑鍏紬鍙锋垨灏忕▼搴忋��',
       required: true,
-      forbid: !window.GLOB.WXApps,
-      options: window.GLOB.WXApps ? window.GLOB.WXApps.map(item => ({value: item.appId, text: item.appName})) : []
+      forbid: apps.length === 0,
+      options: apps
+    },
+    {
+      type: 'select',
+      key: 'wxMerch',
+      label: '鍏宠仈鍟嗘埛',
+      initVal: card.wxMerch || '',
+      tooltip: '璇峰叧鑱旀敮浠樼殑鍟嗘埛鍙枫��',
+      required: true,
+      forbid: merchs.length === 0,
+      options: merchs
     },
     {
       type: 'text',
@@ -2355,6 +2400,28 @@
       options: modules.length ? [...modules, {value: 'multiComponent', label: '澶氱粍浠�'}] : []
     },
     {
+      type: 'cascader',
+      key: 'refreshTab',
+      label: '鍒锋柊鑿滃崟',
+      initVal: card.refreshTab || [],
+      tooltip: '鎵ц鎴愬姛鍚庯紙鎴栨墽琛屽け璐ヤ笖瀛樺湪鍒锋柊椤规椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟',
+      required: false,
+      forbid: viewType === 'popview',
+      options: menulist
+    },
+    {
+      type: 'cascader',
+      key: 'openmenu',
+      label: '鎵撳紑鑿滃崟',
+      tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��',
+      initVal: card.openmenu || [],
+      extendName: 'MenuNo',
+      required: false,
+      allowClear: true,
+      options: menulist,
+      forbid: viewType === 'popview'
+    },
+    {
       type: 'radio',
       key: 'pagination',
       label: '鍒嗛〉',
@@ -2382,28 +2449,6 @@
         value: 'false',
         text: '闈炲繀濉�'
       }]
-    },
-    {
-      type: 'cascader',
-      key: 'refreshTab',
-      label: '鍒锋柊鑿滃崟',
-      initVal: card.refreshTab || [],
-      tooltip: '鎵ц鎴愬姛鍚庯紙鎴栨墽琛屽け璐ヤ笖瀛樺湪鍒锋柊椤规椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟',
-      required: false,
-      forbid: viewType === 'popview',
-      options: menulist
-    },
-    {
-      type: 'cascader',
-      key: 'openmenu',
-      label: '鎵撳紑鑿滃崟',
-      tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��',
-      initVal: card.openmenu || [],
-      extendName: 'MenuNo',
-      required: false,
-      allowClear: true,
-      options: menulist,
-      forbid: viewType === 'popview'
     },
     {
       type: 'text',

--
Gitblit v1.8.0