From a02fc6a77fa1b35c6516b2d37108d80e260c6c85 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 十一月 2024 22:05:08 +0800
Subject: [PATCH] 2024-11-07

---
 src/menu/components/editor/braft-editor/options.jsx |   54 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx
index c746b12..d3f260f 100644
--- a/src/menu/components/editor/braft-editor/options.jsx
+++ b/src/menu/components/editor/braft-editor/options.jsx
@@ -4,15 +4,18 @@
 export default function (wrap, columns) {
   let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
+  let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
+  let ispop = sessionStorage.getItem('editMenuType') === 'popview'
   let menu = window.GLOB.customMenu
-
   let interfaces = []
+
   if (menu.interfaces) {
     menu.interfaces.forEach(item => {
       if (item.status === 'true') {
         interfaces.push({
           value: item.uuid,
-          label: item.name
+          label: item.name,
+          columns: JSON.parse(JSON.stringify(item.columns))
         })
       }
     })
@@ -80,14 +83,26 @@
       label: '鏁版嵁婧�',
       initval: wrap.publicId || '',
       required: true,
-      options: interfaces
+      options: interfaces,
+      reset_source: true,
+      callback: (record) => {
+        if (!record.publicId) return
+
+        let d = interfaces.filter(m => m.value === record.publicId)[0]
+
+        if (!d || !d.columns) return
+
+        return {
+          field: d.columns
+        }
+      }
     },
     {
       type: 'select',
       field: 'field',
       label: '鏂囨湰瀛楁',
       initval: wrap.field || '',
-      tooltip: '閫夋嫨鍔ㄦ�佸�兼椂锛岄渶璁剧疆鏂囨湰瀛楁鎵嶅彲鐢熸晥锛屼娇鐢ㄥ叕鍏辨暟鎹簮鏃讹紝闇�鍏堜繚瀛樻暟鎹簮鍚庡啀閫夊彇鏂囨湰瀛楁銆�',
+      timestamp: new Date().getTime(),
       required: false,
       options: columns
     },
@@ -110,24 +125,35 @@
       initval: wrap.empty || 'show',
       tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
       required: false,
-      skip: true,
       options: [
         {value: 'show', label: '鍚�'},
         {value: 'hidden', label: '鏄�'},
       ],
     },
     {
-      type: 'radio',
-      field: 'firstTr',
-      label: '琛ㄦ牸棣栬',
-      initval: wrap.firstTr || 'deep',
-      tooltip: '瀵屾枃鏈腑table鐨勯琛岃儗鏅鑹层��',
+      type: 'checkbox',
+      field: 'tbStyle',
+      label: '琛ㄦ牸鏍峰紡',
+      initval: wrap.tbStyle ? wrap.tbStyle.split(' ') : [],
       required: false,
       options: [
-        {value: 'deep', label: '娣辫壊'},
-        {value: 'light', label: '娴呰壊'},
+        {value: 'th-light', label: '琛ㄥご閫忔槑'},
+        {value: 'no-border', label: '鏃犺竟妗�'},
+        {value: 'tb-flex', label: '鍒楃瓑瀹�'},
       ]
     },
+    // {
+    //   type: 'radio',
+    //   field: 'firstTr',
+    //   label: '琛ㄦ牸棣栬',
+    //   initval: wrap.firstTr || 'deep',
+    //   tooltip: '瀵屾枃鏈腑table鐨勯琛岃儗鏅鑹层��',
+    //   required: false,
+    //   options: [
+    //     {value: 'deep', label: '娣辫壊'},
+    //     {value: 'light', label: '娴呰壊'},
+    //   ]
+    // },
     {
       type: 'radio',
       field: 'permission',
@@ -138,7 +164,7 @@
         {value: 'true', label: '鍚敤'},
         {value: 'false', label: '绂佺敤'},
       ],
-      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
+      forbid: !appType || ispop || isprint
     },
     {
       type: 'multiselect',
@@ -147,7 +173,7 @@
       initval: wrap.blacklist || [],
       required: false,
       options: roleList,
-      forbid: !!appType
+      forbid: !!appType || isprint
     },
   ]
 

--
Gitblit v1.8.0