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/share/actioncomponent/formconfig.jsx |  127 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 111 insertions(+), 16 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index 135daca..9d6f7b7 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -1,4 +1,4 @@
-import { btnCustomClasses, btnClasses } from '@/utils/option.js'
+import { btnClasses } from '@/utils/option.js'
 
 
 /**
@@ -9,13 +9,13 @@
  * @param {*} usefulFields   瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈�
  * @param {*} type           鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡
  */
-export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = []) {
+export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side) {
   let appType = sessionStorage.getItem('appType')
   let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview
   let printTemps = sessionStorage.getItem('printTemps')
   printTemps = printTemps ? JSON.parse(printTemps) : []
   let setting = config.setting || {}
-  let columns = config.columns || []
+  let columns = side === 'sub' && config.subColumns ? config.subColumns : (config.columns || [])
   let appMenus = []
   let menulist = []
   let type = ''
@@ -97,7 +97,6 @@
     { value: 'print', text: '鏍囩鎵撳嵃' },
     { value: 'refund', text: '閫�娆�' },
     { value: 'closetab', text: '鏍囩鍏抽棴' },
-    { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
     { value: 'megvii', text: '鏃疯闈㈡澘鏈�' },
     { value: 'filezip', text: '鏂囦欢鍘嬬缉鍖�' },
   ]
@@ -113,6 +112,7 @@
     } else {
       appMenus = []
     }
+    appMenus.push({value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'})
   } else {
     menulist = sessionStorage.getItem('fstMenuList')
     if (menulist) {
@@ -150,7 +150,6 @@
     opentypes = opentypes.filter(item => item.value !== 'tab')
     funTypes = [
       { value: 'print', text: '鏍囩鎵撳嵃' },
-      { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
     ]
     pageTemps = [
       { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
@@ -158,6 +157,25 @@
       { value: 'pay', text: '鏀粯' },
       { value: 'custom', text: '閾炬帴' }
     ]
+  } else {
+    if (card.pageTemplate === 'print') { // 鍘熺被鍨嬫敮鎸�
+      pageTemps.unshift({ value: 'print', text: '鏍囩鎵撳嵃妯℃澘' })
+    } else if (card.pageTemplate === 'billprintTemp') { // 鍘熺被鍨嬫敮鎸�
+      pageTemps.unshift({ value: 'billprintTemp', text: '鍗曟嵁鎵撳嵃妯℃澘' })
+    }
+  }
+
+  if (card.funcType === 'changeuser') { // 鍘熺被鍨嬫敮鎸�
+    funTypes.unshift({ value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' })
+  }
+
+  if (config.subtype === 'editable') { // 缂栬緫琛ㄧ殑娣诲姞銆佸垹闄�
+    funTypes.push(
+      { value: 'addline', text: '澧炲姞琛岋紙缂栬緫琛級' },
+      { value: 'delline', text: '鍒犻櫎琛岋紙缂栬緫琛級' }
+    )
+  } else if (card.funcType === 'addline' || card.funcType === 'delline') {
+    card.funcType = ''
   }
   
   if (type === 'chart' && appType !== 'mob') {
@@ -170,7 +188,10 @@
 
   let refresh = []
   if (viewType === 'popview') { // 寮圭獥鏍囩
-    opentypes = opentypes.filter(item => item.value !== 'popview' && item.value !== 'funcbutton')
+    opentypes = opentypes.filter(item => item.value !== 'popview')
+
+    funTypes = funTypes.filter(item => item.value !== 'print')
+
     refresh.push({
       value: 'closepoptab', // 鍏抽棴寮圭獥鏍囩
       text: '鍏抽棴寮圭獥'
@@ -535,7 +556,7 @@
       key: 'execSuccess',
       label: '鎴愬姛鍚�',
       initVal: card.execSuccess || 'grid',
-      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��',
+      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��',
       required: true,
       options: [{
         value: 'never',
@@ -558,7 +579,7 @@
       key: 'execError',
       label: '澶辫触鍚�',
       initVal: card.execError || 'never',
-      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��',
+      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��',
       required: true,
       options: [{
         value: 'never',
@@ -671,7 +692,7 @@
       tooltip: '姝ら鑹蹭负鎸夐挳鍒濆鍖栭鑹诧紝鍙湪鏍峰紡璋冩暣涓慨鏀广��',
       required: false,
       forbid: type === 'datacard' && appType === 'mob', // 绉诲姩绔紝婊戝姩鏄剧ず鐨勬寜閽笉璁剧疆閫氱敤棰滆壊
-      options: btnCustomClasses
+      options: btnClasses
     },
     {
       type: 'radio',
@@ -695,6 +716,9 @@
       }, {
         value: 'light',
         text: '鐏�'
+      }, {
+        value: 'system',
+        text: '绯荤粺'
       }]
     },
     {
@@ -725,7 +749,7 @@
       initVal: card.syncComponent || [],
       tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧脊绐楁爣绛惧叧闂椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢銆傛敞锛氶�夋嫨褰撳墠缁勪欢鐨勪笂绾х粍浠舵棤鏁堬紝鍒锋柊涓婄骇缁勪欢璇烽�夋嫨鎴愬姛鍚庘�滃埛鏂颁笂绾х粍浠� - 琛屸�濄��',
       required: false,
-      options: modules
+      options: modules.length ? [...modules, {value: 'multiComponent', label: '澶氱粍浠�'}] : []
     },
     {
       type: 'radio',
@@ -796,7 +820,7 @@
       extendName: 'MenuNo',
       required: false,
       allowClear: true,
-      options: appType === 'mob' || appType === 'pc' ? [...appMenus, {value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'}] : menulist,
+      options: appType === 'mob' || appType === 'pc' ? appMenus : menulist,
       forbid: viewType === 'popview'
     },
     {
@@ -949,6 +973,15 @@
         value: 'bottom',
         text: '搴曢儴'
       }]
+    },
+    {
+      type: 'text',
+      key: 'preFunc',
+      label: '鍓嶇疆鍑芥暟',
+      initVal: card.preFunc || '',
+      tooltip: '鍓嶇疆鍑芥暟鎵ц瀹屾垚鍚庯紝缁撴灉浼氫紶鍏ュ唴閮ㄥ嚱鏁颁腑锛屾鏃跺唴閮ㄥ嚱鏁颁細寮傛鎵ц锛涘綋鍓嶇疆鍑芥暟杩斿洖涓璄rrCode绛変簬-1鏃讹紝灏嗕笉鍐嶆墽琛屽唴閮ㄥ嚱鏁般��',
+      required: false,
+      forbid: appType === 'mob'
     },
     {
       type: 'radio',
@@ -1135,6 +1168,27 @@
         value: 'progressbar',
         text: '杩涘害鏉�'
       }]
+    },
+    {
+      type: 'table',
+      key: 'syncComponents',
+      label: '缁勪欢鍒楄〃',
+      initVal: card.syncComponents || [],
+      required: true,
+      actions: [],
+      columns: [
+        {
+          title: '缁勪欢',
+          dataIndex: 'syncComId',
+          inputType: 'cascader',
+          editable: true,
+          required: true,
+          extends: [{key: 'label', value: 'label'}],
+          width: '70%',
+          render: (text, record) => record.label,
+          options: modules
+        }
+      ]
     }
   ]
 
@@ -1194,14 +1248,23 @@
     { value: 'custom', text: '鑷畾涔�' }
   ]
 
+  if (card.pageTemplate === 'print') { // 鍘熺被鍨嬫敮鎸�
+    pageTemps.unshift({ value: 'print', text: '鏍囩鎵撳嵃妯℃澘' })
+  } else if (card.pageTemplate === 'billprintTemp') { // 鍘熺被鍨嬫敮鎸�
+    pageTemps.unshift({ value: 'billprintTemp', text: '鍗曟嵁鎵撳嵃妯℃澘' })
+  }
+
   let funTypes = [
     { value: 'print', text: '鏍囩鎵撳嵃' },
     { value: 'refund', text: '閫�娆�' },
     { value: 'closetab', text: '鏍囩鍏抽棴' },
-    { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
     { value: 'megvii', text: '鏃疯闈㈡澘鏈�' },
     { value: 'filezip', text: '鏂囦欢鍘嬬缉鍖�' },
   ]
+
+  if (card.funcType === 'changeuser') { // 鍘熺被鍨嬫敮鎸�
+    funTypes.unshift({ value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' })
+  }
 
   let menulist = sessionStorage.getItem('fstMenuList')
   if (menulist) {
@@ -1216,7 +1279,10 @@
 
   let refresh = []
   if (viewType === 'popview') { // 寮圭獥鏍囩
-    opentypes = opentypes.filter(item => item.value !== 'popview' && item.value !== 'funcbutton')
+    opentypes = opentypes.filter(item => item.value !== 'popview')
+
+    funTypes = funTypes.filter(item => item.value !== 'print')
+
     refresh.push({
       value: 'closepoptab', // 鍏抽棴寮圭獥鏍囩
       text: '鍏抽棴寮圭獥'
@@ -1516,7 +1582,7 @@
       key: 'execSuccess',
       label: '鎴愬姛鍚�',
       initVal: card.execSuccess || 'grid',
-      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��',
+      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傛敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��',
       required: true,
       options: [{
         value: 'never',
@@ -1538,7 +1604,7 @@
       key: 'execError',
       label: '澶辫触鍚�',
       initVal: card.execError || 'never',
-      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��',
+      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊鍝竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��' : '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍硷紝娉細涓婄骇缁勪欢鍦ㄦ暟鎹簮涓坊鍔犮�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓�傝繑鍥炰俊鎭腑鍖呭惈@close_tab@銆丂close_popup@銆丂goback@ 浼氭墽琛岋紙鍏抽棴鏍囩-绠$悊绯荤粺锛夈�侊紙鍏抽棴寮圭獥锛夈�侊紙杩斿洖涓婁竴椤�-瀛愬簲鐢級绛夊姩浣溿��',
       required: true,
       options: [{
         value: 'never',
@@ -1659,7 +1725,7 @@
       initVal: card.syncComponent || [],
       tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧脊绐楁爣绛惧叧闂椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢銆傛敞锛氶�夋嫨褰撳墠缁勪欢鐨勪笂绾х粍浠舵棤鏁堬紝鍒锋柊涓婄骇缁勪欢璇烽�夋嫨鎴愬姛鍚庘�滃埛鏂颁笂绾х粍浠� - 琛屸�濄��',
       required: false,
-      options: modules
+      options: modules.length ? [...modules, {value: 'multiComponent', label: '澶氱粍浠�'}] : []
     },
     {
       type: 'radio',
@@ -1789,6 +1855,14 @@
       }]
     },
     {
+      type: 'text',
+      key: 'preFunc',
+      label: '鍓嶇疆鍑芥暟',
+      initVal: card.preFunc || '',
+      tooltip: '鍓嶇疆鍑芥暟鎵ц瀹屾垚鍚庯紝缁撴灉浼氫紶鍏ュ唴閮ㄥ嚱鏁颁腑锛屾鏃跺唴閮ㄥ嚱鏁颁細寮傛鎵ц锛涘綋鍓嶇疆鍑芥暟杩斿洖涓璄rrCode绛変簬-1鏃讹紝灏嗕笉鍐嶆墽琛屽唴閮ㄥ嚱鏁般��',
+      required: false
+    },
+    {
       type: 'radio',
       key: 'control',
       label: '鎸夐挳鎺у埗',
@@ -1878,6 +1952,27 @@
         value: 'progressbar',
         text: '杩涘害鏉�'
       }]
+    },
+    {
+      type: 'table',
+      key: 'syncComponents',
+      label: '缁勪欢鍒楄〃',
+      initVal: card.syncComponents || [],
+      required: true,
+      actions: [],
+      columns: [
+        {
+          title: '缁勪欢',
+          dataIndex: 'syncComId',
+          inputType: 'cascader',
+          editable: true,
+          required: true,
+          extends: [{key: 'label', value: 'label'}],
+          width: '70%',
+          render: (text, record) => record.label,
+          options: modules
+        }
+      ]
     }
   ]
 

--
Gitblit v1.8.0