From 547e5fe219ee7bee309ecd67db74bc8df66b5433 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 23 八月 2023 11:47:45 +0800
Subject: [PATCH] 2023-08-23

---
 src/menu/components/card/balcony/options.jsx |  158 ++++++++++++++++++++--------------------------------
 1 files changed, 61 insertions(+), 97 deletions(-)

diff --git a/src/menu/components/card/balcony/options.jsx b/src/menu/components/card/balcony/options.jsx
index 1946423..5ae1c32 100644
--- a/src/menu/components/card/balcony/options.jsx
+++ b/src/menu/components/card/balcony/options.jsx
@@ -1,15 +1,15 @@
 import React from 'react'
-import { fromJS } from 'immutable'
 import MenuUtils from '@/utils/utils-custom.js'
 
 /**
  * @description Wrap琛ㄥ崟閰嶇疆淇℃伅
  */
-export default function (wrap) {
-  let menu = fromJS(window.GLOB.customMenu).toJS()
+export default function (wrap, buttons, columns) {
+  let menu = window.GLOB.customMenu
+  let MenuType = menu.parentId === 'BillPrintTemp' ? 'billPrint' : ''
 
   let modules = MenuUtils.getLinkModules(menu.components) || []
-  let supmodules = MenuUtils.getSupModules(menu.components, '')
+  let supmodules = MenuUtils.getSupModules(menu.components, '', menu.interfaces)
   let roleList = sessionStorage.getItem('sysRoles')
   let appType = sessionStorage.getItem('appType')
 
@@ -70,6 +70,7 @@
       controlFields: [
         {field: 'empty', values: ['dynamic']},
         {field: 'publicId', values: ['public']},
+        {field: 'bgField', values: ['dynamic', 'public']},
       ]
     },
     {
@@ -78,7 +79,27 @@
       label: '鏁版嵁婧�',
       initval: wrap.publicId || '',
       required: true,
-      options: interfaces
+      options: interfaces,
+      reset_source: true,
+      callback: (map, record) => {
+        if (!record.publicId) return
+
+        let interfaces = window.GLOB.customMenu.interfaces || []
+
+        let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[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)
+        }
+      }
     },
     {
       type: 'radio',
@@ -102,7 +123,8 @@
         {field: 'supControl', values: ['sup']},
         {field: 'syncModule', values: ['sync']},
         {field: 'checkAll', values: ['sync']},
-      ]
+      ],
+      forbid: MenuType === 'billPrint'
     },
     {
       type: 'cascader',
@@ -148,95 +170,6 @@
     },
     {
       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',
       label: '绌哄�奸殣钘�',
       initval: wrap.empty || 'show',
@@ -249,16 +182,47 @@
       ],
     },
     {
+      type: 'select',
+      field: 'bgField',
+      label: '鑳屾櫙鍥�',
+      initval: wrap.bgField || '',
+      tooltip: '鍔ㄦ�佽儗鏅紝鑳屾櫙鍥剧墖鐢卞瓧娈靛�兼帶鍒躲�傝娉ㄦ剰璋冩暣鑳屾櫙鏍峰紡銆�',
+      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: MenuType !== 'billPrint'
+    },
+    {
       type: 'radio',
       field: 'permission',
       label: '鏉冮檺楠岃瘉',
-      initval: wrap.permission || 'false',
+      initval: wrap.permission || (!appType ? 'true' : 'false'),
       required: false,
       options: [
         {value: 'true', label: '鍚敤'},
         {value: 'false', label: '绂佺敤'},
       ],
-      forbid: !appType
+      forbid: sessionStorage.getItem('editMenuType') === 'popview'
+    },
+    {
+      type: 'select',
+      field: 'linkbtn',
+      label: '鍏宠仈鎸夐挳',
+      initval: wrap.linkbtn || '',
+      required: false,
+      options: buttons,
+      forbid: MenuType === 'billPrint'
     },
     {
       type: 'multiselect',

--
Gitblit v1.8.0