From e1cee96b38805bcccf48e7bcb9d296f2bc54c720 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 24 一月 2025 11:10:32 +0800
Subject: [PATCH] 2025-01-24

---
 src/menu/components/card/balcony/options.jsx |  196 ++++++++++++++++--------------------------------
 1 files changed, 65 insertions(+), 131 deletions(-)

diff --git a/src/menu/components/card/balcony/options.jsx b/src/menu/components/card/balcony/options.jsx
index 95227ce..519d5b1 100644
--- a/src/menu/components/card/balcony/options.jsx
+++ b/src/menu/components/card/balcony/options.jsx
@@ -1,28 +1,20 @@
 import React from 'react'
-import MenuUtils from '@/utils/utils-custom.js'
+import MenuUtils, { getLinkModules, getInterfaces } from '@/utils/utils-custom.js'
 
 /**
  * @description Wrap琛ㄥ崟閰嶇疆淇℃伅
  */
 export default function (wrap, buttons, columns) {
   let menu = window.GLOB.customMenu
+  let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
+  let ispop = sessionStorage.getItem('editMenuType') === 'popview'
 
-  let modules = MenuUtils.getLinkModules(menu.components) || []
+  let modules = getLinkModules(menu.components) || []
   let supmodules = MenuUtils.getSupModules(menu.components, '', menu.interfaces)
   let roleList = sessionStorage.getItem('sysRoles')
   let appType = sessionStorage.getItem('appType')
 
-  let interfaces = []
-  if (menu.interfaces) {
-    menu.interfaces.forEach(item => {
-      if (item.status === 'true') {
-        interfaces.push({
-          value: item.uuid,
-          label: item.name
-        })
-      }
-    })
-  }
+  let interfaces = getInterfaces()
 
   if (roleList) {
     try {
@@ -59,7 +51,7 @@
       field: 'datatype',
       label: '鏁版嵁鏉ユ簮',
       initval: wrap.datatype || 'static',
-      tooltip: '閫夋嫨闈欐�佸�硷紝鏃犻渶閰嶇疆鏁版嵁婧愩��',
+      tooltip: '閫夋嫨闈欐�佹椂锛屾棤闇�閰嶇疆鏁版嵁婧愶紝鍙睍绀轰笂绾х粍浠舵垨url鍙傛暟瀛楁銆�',
       required: false,
       options: [
         {value: 'dynamic', label: '鍔ㄦ��'},
@@ -80,23 +72,15 @@
       required: true,
       options: interfaces,
       reset_source: true,
-      callback: (map, record) => {
+      callback: (record) => {
         if (!record.publicId) return
 
-        let interfaces = window.GLOB.customMenu.interfaces || []
-
-        let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0]
+        let d = interfaces.filter(m => m.value === record.publicId)[0]
 
         if (!d || !d.columns) return
 
-        let columns = JSON.parse(JSON.stringify(d.columns))
-
-        let _bgField = map.get('bgField')
-
-        if (_bgField && !_bgField.forbid) {
-          _bgField.options = columns
-          _bgField.oriOptions = columns
-          map.set('bgField', _bgField)
+        return {
+          bgField: d.columns
         }
       }
     },
@@ -106,14 +90,13 @@
       label: '鍙楁帶绫诲瀷',
       initval: wrap.linkType || 'static',
       tooltip: <div>
-        <div>缁勪欢涓庡叾浠栫粍浠朵箣闂寸殑鎺у埗绫诲瀷: </div>
-        <div>1銆佺嫭绔嬭〃绀轰笌鍏朵粬缁勪欢娌℃湁鍏宠仈銆�</div>
-        <div>2銆佸悓姝ョ被鍨嬩腑鍏紡銆佹寜閽互鍙婂叏閫夊厓绱犳瘮杈冪壒娈婏紝鎿嶄綔鏁版嵁涓哄叾鍚屾缁勪欢鐨勬暟鎹��</div>
-        <div>3銆佷笂绾х被鍨嬮渶娣诲姞褰撳墠缁勪欢鐨勪笂绾х粍浠讹紝骞跺彲璁剧疆褰撳墠缁勪欢涓哄缁堟樉绀猴紝杩樻槸鍙湁鍦ㄤ笂绾х粍浠堕�夎鍚庢墠鏄剧ず銆�</div>
+        <div>鍚屾绫诲瀷锛氭绫诲瀷鏃跺叕寮忋�佹寜閽互鍙婂叏閫夊厓绱犳瘮杈冪壒娈婏紝鎿嶄綔鏁版嵁涓哄叾鍚屾缁勪欢閫変腑鐨勬暟鎹��</div>
+        <div>涓婄骇绫诲瀷锛氬彲璁剧疆褰撳墠缁勪欢鐨勬樉绀烘潯浠讹紙濮嬬粓鏄剧ず鎴栦笂绾ч�夎鏃舵樉绀猴級锛屼笌闈欐�佹暟鎹簮閰嶅悎涔熷彲鐢ㄤ簬灞曠ず涓婄骇缁勪欢閫変腑鐨勪俊鎭��</div>
       </div>,
+      toolWidth: 400,
       required: false,
       options: [
-        {value: 'static', label: '鐙珛'},
+        {value: 'static', label: '鏃�'},
         {value: 'sync', label: '鍚屾'},
         {value: 'sup', label: '涓婄骇'},
       ],
@@ -122,16 +105,17 @@
         {field: 'supControl', values: ['sup']},
         {field: 'syncModule', values: ['sync']},
         {field: 'checkAll', values: ['sync']},
-      ]
+      ],
+      forbid: isprint
     },
     {
       type: 'cascader',
       field: 'supModule',
       label: '涓婄骇缁勪欢',
       initval: wrap.supModule || [],
-      // tooltip: '褰撲笂绾х粍浠朵笉瀛樺湪鎴栨病鏈夋潈闄愭椂锛屽綋鍓嶇粍浠朵笉鏄剧ず銆�',
       required: true,
-      options: supmodules
+      options: supmodules,
+      forbid: isprint
     },
     {
       type: 'radio',
@@ -143,7 +127,8 @@
       options: [
         {value: 'hidden', label: '閫夎'},
         {value: 'show', label: '濮嬬粓'},
-      ]
+      ],
+      forbid: isprint
     },
     {
       type: 'cascader',
@@ -152,7 +137,18 @@
       initval: wrap.syncModule || '',
       tooltip: '褰撳悓姝ョ粍浠朵笉瀛樺湪鎴栨病鏈夋潈闄愭椂锛屽綋鍓嶇粍浠朵笉鏄剧ず銆�',
       required: true,
-      options: modules
+      options: modules,
+      forbid: isprint
+    },
+    {
+      type: 'cascader',
+      field: 'syncModule',
+      label: '鍚屾缁勪欢',
+      initval: wrap.syncModule || '',
+      tooltip: '褰撳悓姝ョ粍浠朵笉瀛樺湪鎴栨病鏈夋潈闄愭椂锛屽綋鍓嶇粍浠朵笉鏄剧ず銆�',
+      required: true,
+      options: modules,
+      forbid: isprint
     },
     {
       type: 'radio',
@@ -164,97 +160,9 @@
       options: [
         {value: 'hidden', label: '闅愯棌'},
         {value: 'show', label: '鏄剧ず'},
-      ]
+      ],
+      forbid: isprint
     },
-    // {
-    //   type: 'radio',
-    //   field: 'position',
-    //   label: '浣嶇疆',
-    //   initval: wrap.position || 'relative',
-    //   tooltip: '鐩稿瀹氫綅鏄浉瀵瑰叾姝e父浣嶇疆鐨勫亸绉伙紱缁濆瀹氫綅鏄浉瀵逛簬鍘熺粍浠剁殑鍋忕Щ锛屽師缁勪欢楂樺害鍙涓�0锛涘浐瀹氬畾浣嶆槸鐩稿浜庣獥鍙g殑浣嶇疆锛屽畾浣嶆晥鏋滄祴璇曠幆澧冧腑鏌ョ湅銆�',
-    //   required: false,
-    //   options: [
-    //     {value: 'relative', label: '鐩稿瀹氫綅'},
-    //     {value: 'absolute', label: '缁濆瀹氫綅'},
-    //     {value: 'fixed', label: '鍥哄畾瀹氫綅'},
-    //   ],
-    //   controlFields: [
-    //     {field: 'quick', values: ['fixed']},
-    //     {field: 'realwidth', values: ['fixed', 'absolute']},
-    //     {field: 'transform', values: ['fixed', 'absolute']},
-    //   ]
-    // },
-    // {
-    //   type: 'select',
-    //   field: 'quick',
-    //   label: '蹇嵎閫夋嫨',
-    //   initval: '',
-    //   required: false,
-    //   subFields: ['top', 'left', 'right', 'bottom', 'transform'],
-    //   options: [
-    //     {value: 'top', label: '涓�', top: '0px', left: '0px', right: '0px', bottom: '', transform: ''},
-    //     {value: 'top-left', label: '宸︿笂', top: '0px', left: '0px', right: '', bottom: '', transform: ''},
-    //     {value: 'top-right', label: '鍙充笂', top: '0px', left: '', right: '0px', bottom: '', transform: ''},
-    //     {value: 'left-middle', label: '宸︿腑', top: '50%', left: '0px', right: '', bottom: '', transform: 'translateY(-50%)'},
-    //     {value: 'right-middle', label: '鍙充腑', top: '50%', left: '', right: '0px', bottom: '', transform: 'translateY(-50%)'},
-    //     {value: 'bottom-left', label: '宸︿笅', top: '', left: '0px', right: '', bottom: '0px', transform: ''},
-    //     {value: 'bottom-right', label: '鍙充笅', top: '', left: '', right: '0px', bottom: '0px', transform: ''},
-    //     {value: 'bottom', label: '涓�', top: '', left: '0px', right: '0px', bottom: '0px', transform: ''},
-    //     {value: 'middle', label: '涓棿', top: '50%', left: '50%', right: '', bottom: '', transform: 'translate(-50%, -50%)'}
-    //   ]
-    // },
-    // {
-    //   type: 'styleInput',
-    //   field: 'top',
-    //   label: '璺濅笂',
-    //   initval: wrap.top || '',
-    //   required: false
-    // },
-    // {
-    //   type: 'styleInput',
-    //   field: 'right',
-    //   label: '璺濆彸',
-    //   initval: wrap.right || '',
-    //   required: false
-    // },
-    // {
-    //   type: 'styleInput',
-    //   field: 'bottom',
-    //   label: '璺濅笅',
-    //   initval: wrap.bottom || '',
-    //   required: false
-    // },
-    // {
-    //   type: 'styleInput',
-    //   field: 'left',
-    //   label: '璺濆乏',
-    //   initval: wrap.left || '',
-    //   required: false
-    // },
-    // {
-    //   type: 'styleInput',
-    //   field: 'realwidth',
-    //   label: '瀹為檯瀹藉害',
-    //   initval: wrap.realwidth || '',
-    //   required: false
-    // },
-    // {
-    //   type: 'select',
-    //   field: 'transform',
-    //   label: '鍙樻崲',
-    //   initval: wrap.transform || '',
-    //   required: false,
-    //   options: [
-    //     {value: 'translateY(-50%)', label: '涓婄Щ50%'},
-    //     {value: 'translateY(50%)', label: '涓嬬Щ50%'},
-    //     {value: 'translateX(-50%)', label: '宸︾Щ50%'},
-    //     {value: 'translateX(50%)', label: '鍙崇Щ50%'},
-    //     {value: 'translate(-50%, -50%)', label: '宸︿笂绉�50%'},
-    //     {value: 'translate(-50%, 50%)', label: '宸︿笅绉�50%'},
-    //     {value: 'translate(50%, -50%)', label: '鍙充笂绉�50%'},
-    //     {value: 'translate(50%, 50%)', label: '鍙充笅绉�50%'},
-    //   ]
-    // },
     {
       type: 'radio',
       field: 'empty',
@@ -262,7 +170,6 @@
       initval: wrap.empty || 'show',
       tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
       required: false,
-      skip: true,
       options: [
         {value: 'show', label: '鍚�'},
         {value: 'hidden', label: '鏄�'},
@@ -274,8 +181,22 @@
       label: '鑳屾櫙鍥�',
       initval: wrap.bgField || '',
       tooltip: '鍔ㄦ�佽儗鏅紝鑳屾櫙鍥剧墖鐢卞瓧娈靛�兼帶鍒躲�傝娉ㄦ剰璋冩暣鑳屾櫙鏍峰紡銆�',
+      timestamp: new Date().getTime(),
       required: false,
       options: columns
+    },
+    {
+      type: 'radio',
+      field: 'printType',
+      label: '缁勪欢绫诲瀷',
+      initval: wrap.printType || 'content',
+      tooltip: '閫夋嫨绫诲瀷涓恒�婇〉鐪�/椤佃剼銆嬫椂锛屾墦鍗扮殑姣忛〉閲岄兘浼氬甫鏈夎缁勪欢銆傛敞锛氶〉鐪夐〉鑴氫腑鏂囨湰鍏冪礌灏嗘浛鎹� @pageIndex@锛堥〉鐮侊級銆丂total@锛堟�绘暟锛夈�丂date@锛堝綋鍓嶆棩鏈燂級銆丂datetime@锛堝綋鍓嶆椂闂达級锛屼娇鐢ㄥ垎椤靛弬鏁版椂娉ㄦ剰鎵撳嵃妯℃澘鐨勯〉闈㈠竷灞�浣跨敤鍒嗛〉銆�',
+      required: false,
+      options: [
+        {value: 'content', label: '娴姩鍗�'},
+        {value: 'headerOrfooter', label: '椤电湁/椤佃剼'},
+      ],
+      forbid: !isprint
     },
     {
       type: 'radio',
@@ -284,10 +205,22 @@
       initval: wrap.permission || (!appType ? 'true' : 'false'),
       required: false,
       options: [
-        {value: 'true', label: '鍚敤'},
+        {value: 'true', label: !appType ? '缁ф壙鑿滃崟' : '鍚敤'},
         {value: 'false', label: '绂佺敤'},
       ],
-      forbid: sessionStorage.getItem('editMenuType') === 'popview'
+      forbid: ispop || isprint
+    },
+    {
+      type: 'radio',
+      field: 'cacheLocal',
+      label: '鏈湴缂撳瓨',
+      initval: wrap.cacheLocal || 'true',
+      required: false,
+      options: [
+        {value: 'true', label: '缁ф壙鑿滃崟'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: ispop || isprint
     },
     {
       type: 'select',
@@ -295,7 +228,8 @@
       label: '鍏宠仈鎸夐挳',
       initval: wrap.linkbtn || '',
       required: false,
-      options: buttons
+      options: buttons,
+      forbid: isprint
     },
     {
       type: 'multiselect',
@@ -304,7 +238,7 @@
       initval: wrap.blacklist || [],
       required: false,
       options: roleList,
-      forbid: !!appType
+      forbid: !!appType || isprint
     },
   ]
 

--
Gitblit v1.8.0