From 08f7aadb915f6cd5f709aa3aed02d7dc8000a0f6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 21 一月 2022 18:27:28 +0800
Subject: [PATCH] 2022-01-21

---
 src/menu/components/share/actioncomponent/formconfig.jsx |  161 ++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 110 insertions(+), 51 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index a5e48dd..2516398 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -15,7 +15,8 @@
 export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) {
   let appType = sessionStorage.getItem('appType')
   let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview
-  let printTemps = sessionStorage.getItem('printTemps') || []
+  let printTemps = sessionStorage.getItem('printTemps')
+  printTemps = printTemps ? JSON.parse(printTemps) : []
   let setting = config.setting || {}
   let columns = config.columns || []
   let appMenus = []
@@ -100,33 +101,32 @@
     } else {
       appMenus = []
     }
-
-    if (appType === 'mob') {
-      opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'].includes(item.value))
-      funTypes = [
-        { value: 'scan', text: '鎵爜' },
-        { value: 'logout', text: '閫�鍑�' },
-        { value: 'mkBinding', text: '寮�閫氭壂鐮佺櫥褰�' },
-        { value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' },
-        { value: 'reAuth', text: '鍒囨崲绯荤粺锛堟竻绌虹紦瀛�-灏忕▼搴忥級' },
-        { value: 'goBack', text: '杩斿洖' },
-      ]
-      pageTemps = [
-        { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
-        { value: 'custom', text: '閾炬帴' }
-      ]
-    } else {
-      pageTemps = [
-        { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
-        { value: 'billprint', text: '鍗曟嵁鎵撳嵃' },
-        { value: 'pay', text: Formdict['model.pay'] },
-        { value: 'custom', text: '閾炬帴' }
-      ]
-      funTypes = [
-        { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
-      ]
-      opentypes = opentypes.filter(item => item.value !== 'tab')
-    }
+  }
+  if (appType === 'mob') {
+    opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'].includes(item.value))
+    funTypes = [
+      { value: 'scan', text: '鎵爜' },
+      { value: 'logout', text: '閫�鍑�' },
+      { value: 'mkBinding', text: '寮�閫氭壂鐮佺櫥褰�' },
+      { value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' },
+      { value: 'reAuth', text: '鍒囨崲绯荤粺锛堟竻绌虹紦瀛�-灏忕▼搴忥級' },
+      { value: 'goBack', text: '杩斿洖' },
+    ]
+    pageTemps = [
+      { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
+      { value: 'custom', text: '閾炬帴' }
+    ]
+  } else if (appType === 'pc') {
+    opentypes = opentypes.filter(item => item.value !== 'tab')
+    funTypes = [
+      { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
+    ]
+    pageTemps = [
+      { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
+      { value: 'billprint', text: '鍗曟嵁鎵撳嵃' },
+      { value: 'pay', text: Formdict['model.pay'] },
+      { value: 'custom', text: '閾炬帴' }
+    ]
   }
   
   if (type === 'chart' && appType !== 'mob') {
@@ -143,6 +143,13 @@
     refresh.push({
       value: 'popclose',  // 鎵ц寮圭獥鍏抽棴鏃剁殑鍒锋柊
       text: '鍒锋柊婧愮粍浠�'
+    })
+  }
+
+  if (type === 'card') {
+    opentypes.push({
+      value: 'form',
+      text: '琛ㄥ崟'
     })
   }
 
@@ -169,6 +176,20 @@
       initVal: card.funcType || '',
       required: true,
       options: funTypes
+    },
+    {
+      type: 'radio',
+      key: 'formType',
+      label: '琛ㄥ崟绫诲瀷',
+      initVal: card.formType || 'switch',
+      required: true,
+      options: [{
+        value: 'switch',
+        text: '寮�鍏�'
+      }, {
+        value: 'radio',
+        text: '鍕鹃�夋'
+      }]
     },
     {
       type: 'select',
@@ -257,13 +278,12 @@
       options: printTemps
     },
     {
-      type: 'select',
+      type: isApp ? 'select' : 'cascader',
       key: 'linkmenu',
       label: '鍏宠仈鑿滃崟',
-      initVal: card.linkmenu || '',
+      initVal: card.linkmenu || (isApp ? '' : []),
       required: true,
-      forbid: !isApp,
-      options: appMenus
+      options: isApp ? appMenus : menulist
     },
     {
       type: 'textarea',
@@ -374,15 +394,6 @@
       initVal: card.Ot || (card.sqlType === 'insert' ? 'notRequired' : 'requiredSgl'),
       required: true,
       options: []
-    },
-    {
-      type: 'cascader',
-      key: 'linkmenu',
-      label: Formdict['model.form.linkmenu'],
-      initVal: card.linkmenu || [],
-      required: true,
-      forbid: isApp,
-      options: menulist
     },
     {
       type: 'select',
@@ -631,15 +642,6 @@
       options: menulist
     },
     {
-      type: 'cascader',
-      key: 'linkmenu',
-      label: Formdict['model.form.linkmenu'],
-      initVal: card.linkmenu || [],
-      required: true,
-      forbid: isApp,
-      options: menulist
-    },
-    {
       type: !appType ? 'cascader' : 'select',
       key: 'openmenu',
       label: '鎵撳紑鑿滃崟',
@@ -738,7 +740,7 @@
       key: 'reload',
       label: '杩斿洖鍚�',
       initVal: card.reload || 'false',
-      tooltip: '鎸夐挳鎴愬姛鍚庤繑鍥炰笂涓�椤甸潰鎴栦娇鐢ㄥ姛鑳芥寜閽�-杩斿洖鍔熻兘鏃讹紝杩斿洖鍚庢槸鍚﹀埛鏂版暟鎹�傛敞锛氬湪鏄庣浜慳pp涓紙搴旂敤妯″紡涓篴pp锛夋湁鏁堛��',
+      tooltip: '杩斿洖鍚庢槸鍚﹀埛鏂版暟鎹�傛敞锛氬湪鏄庣浜慉PP鎴栧皬绋嬪簭涓湁鏁堛��',
       forbid: appType !== 'mob',
       options: [{
         value: 'false',
@@ -785,6 +787,63 @@
       initVal: card.controlVal || '',
       required: false
     },
+    {
+      type: 'splitLine',
+      key: 'title',
+      label: '琛ㄥ崟',
+      initVal: ''
+    },
+    {
+      type: 'text',
+      key: 'field',
+      label: Formdict['model.form.field'],
+      initVal: card.field || '',
+      required: true,
+      readonly: false
+    },
+    {
+      type: 'radio',
+      key: 'size',
+      label: '寮�鍏冲昂瀵�',
+      initVal: card.size || 'default',
+      options: [{
+        value: 'default',
+        text: '澶�'
+      }, {
+        value: 'small',
+        text: '灏�'
+      }]
+    },
+    {
+      type: 'text',
+      key: 'openVal',
+      label: '寮�鍚��',
+      initVal: card.openVal === undefined ? '' : card.openVal + '',
+      tooltip: '褰撳紑鍚笌鍏抽棴鍊煎潎涓烘鏁存暟鏃讹紝榛樿杞崲涓篒NT绫诲瀷銆�',
+      required: false
+    },
+    {
+      type: 'text',
+      key: 'closeVal',
+      label: '鍏抽棴鍊�',
+      initVal: card.closeVal === undefined ? '' : card.closeVal + '',
+      tooltip: '褰撳紑鍚笌鍏抽棴鍊煎潎涓烘鏁存暟鏃讹紝榛樿杞崲涓篒NT绫诲瀷銆�',
+      required: false
+    },
+    {
+      type: 'text',
+      key: 'openText',
+      label: '寮�鍚彁绀�',
+      initVal: card.openText || '',
+      required: false,
+    },
+    {
+      type: 'text',
+      key: 'closeText',
+      label: '鍏抽棴鎻愮ず',
+      initVal: card.closeText || '',
+      required: false,
+    },
   ]
 
   return forms

--
Gitblit v1.8.0