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

---
 src/views/menudesign/index.jsx |   77 ++++++++++++++++++++++++++++++++++----
 1 files changed, 68 insertions(+), 9 deletions(-)

diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index 4b8f4d2..41ba0b2 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -13,7 +13,7 @@
 import Utils from '@/utils/utils.js'
 import { langs } from '@/store/options'
 import MKEmitter from '@/utils/events.js'
-import { getTables, getFuncsAndInters, getLangTrans } from '@/utils/utils-custom.js'
+import { getTables, getFuncsAndInters, getOutMessage, getLangTrans, getAllSqls } from '@/utils/utils-custom.js'
 import asyncComponent from '@/utils/asyncComponent'
 
 import '@/assets/css/design.scss'
@@ -780,6 +780,8 @@
     } else if (this.checklog()) {
       if (sessionStorage.getItem('langList') && !config.trans) {
 
+      } else if (config.enabled && !config.allSqls) {
+
       } else {
         notification.success({
           top: 92,
@@ -806,12 +808,62 @@
         delete config.force
       }
 
-      if (config.cacheUseful !== 'true') {
-        config.components = this.resetSyncQuery(config.components)
+      if (config.MenuID === 'home_page_id' || MenuType === 'billPrint') {
+        config.permission = 'false'
       }
 
-      if (config.MenuID === 'home_page_id') {
-        config.permission = 'false'
+      let long_data = ''
+      if (config.enabled) {
+        let sqls = getAllSqls(config)
+        let _t = moment().format('YYYYMMDDHHmmss')
+        let getguid = () => {
+          let uuid = ''
+          for (let i = 0; i < 18; i++) {
+            uuid += String.fromCharCode(Math.floor(Math.random() * 26) + 65)
+          }
+          uuid = uuid.replace(/minke/ig, 'MNKIE')
+          return uuid
+        }
+
+        long_data = []
+        // let oriIds = {}
+        // if (config.allSqls) {
+        //   config.allSqls.forEach(item => {
+        //     if (!item.md5) return
+        //     oriIds[item.uuid + item.md5] = item.v_id
+        //   })
+        // }
+        let perm = true
+        if (config.permission === 'false' || config.sqlperm === 'false') {
+          perm = false
+        }
+        
+        config.allSqls = sqls.map(item => {
+          let v_id = _t + getguid()
+
+          // if (oriIds[item.uuid + item.md5]) {
+          //   v_id = oriIds[item.uuid + item.md5]
+          // }
+
+          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))},${perm ? item.roleId || '' : ''}`)
+          
+          return {
+            uuid: item.uuid,
+            v_id: v_id,
+            type: item.type,
+            reps: item.reps,
+            // md5: item.md5 || '',
+            luser: item.luser === true
+          }
+        })
+
+        long_data = long_data.join(';')
+      } else {
+        delete config.allSqls
+      }
+
+      if (config.cacheUseful !== 'true') {
+        config.components = this.resetSyncQuery(config.components)
       }
 
       let tbs = []
@@ -852,8 +904,16 @@
       }
 
       let interfaces = getFuncsAndInters(config)
+      let msg = getOutMessage(config)
       let urlFields = config.urlFields ? config.urlFields.join(',') : ''
       let langSql = getLangTrans(config)
+      let pds = 'false'
+      if (config.interfaces) {
+        config.interfaces.forEach(item => {
+          if (item.status !== 'true') return
+          pds = 'true'
+        })
+      }
 
       let param = {
         func: 'sPC_TrdMenu_AddUpt',
@@ -865,10 +925,9 @@
         EasyCode: config.easyCode || '',
         Template: 'CustomPage',
         MenuName: config.MenuName || '',
-        PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces, urlFields}),
+        PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces, msg, pds, backend: 'level1', urlFields}),
         open_edition: config.open_edition,
-        // LText: '',
-        // LTexttb: '',
+        long_data: long_data,
         debug_md5: key,
         debug_url: url,
         debug_list: window.btoa(tbs),
@@ -1276,7 +1335,7 @@
                     <StyleCombControlButton menu={config} />
                     <PasteController insert={this.insert} />
                     {config ? <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config.enabled} onChange={this.onEnabledChange} /> : null}
-                    <Button type="primary" id="save-config" className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>淇濆瓨</Button>
+                    <Button type="primary" id="save-config" disabled={!config} className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>淇濆瓨</Button>
                     <Button type="default" disabled={menuloading} onClick={this.closeView}>鍏抽棴</Button>
                   </div>
                 } style={{ width: '100%' }}>

--
Gitblit v1.8.0