From c10fc10d5fd307a7b334bcde6af5c1175aaa0410 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 28 八月 2024 17:47:28 +0800
Subject: [PATCH] 2024-08-28

---
 src/views/tabledesign/index.jsx |   44 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx
index 3fae1b5..26510b9 100644
--- a/src/views/tabledesign/index.jsx
+++ b/src/views/tabledesign/index.jsx
@@ -9,10 +9,10 @@
 import md5 from 'md5'
 
 import Api from '@/api'
-import Utils, { setGLOBFuncs } from '@/utils/utils.js'
+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, getLangTrans, getAllSqls } from '@/utils/utils-custom.js'
 import SourceElement from '@/templates/zshare/dragsource'
 import asyncComponent from '@/utils/asyncComponent'
 import Source from './source'
@@ -121,7 +121,7 @@
     MKEmitter.addListener('triggerMenuSave', this.triggerMenuSave)
     setTimeout(() => {
       this.getRoleFields()
-      setGLOBFuncs()
+      // setGLOBFuncs()
     }, 1000)
 
     document.onkeydown = (event) => {
@@ -540,6 +540,8 @@
     } else if (this.checklog()) {
       if (sessionStorage.getItem('langList') && !config.trans) {
 
+      } else if (window.backend && config.enabled && !config.allSqls) {
+
       } else {
         notification.success({
           top: 92,
@@ -564,6 +566,37 @@
       } else if (!config.enabled && config.force && _pass) {
         config.enabled = true
         delete config.force
+      }
+
+      let long_data = ''
+      delete config.allSqls
+      if (window.backend && 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)
+          }
+          return uuid
+        }
+
+        long_data = []
+        
+        config.allSqls = sqls.map(item => {
+          let v_id = _t + getguid()
+          long_data.push(`${md5(window.GLOB.appkey + v_id)},${item.uuid},${v_id},${window.btoa(window.encodeURIComponent(item.LText))}`)
+          
+          return {
+            uuid: item.uuid,
+            v_id: v_id,
+            type: item.type,
+            reps: item.reps,
+            sql: item.LText
+          }
+        })
+
+        long_data = long_data.join(';')
       }
 
       let tbs = []
@@ -615,8 +648,7 @@
         MenuName: config.MenuName || '',
         PageParam: JSON.stringify({Template: 'BaseTable', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces, urlFields}),
         open_edition: config.open_edition,
-        // LText: '',
-        // LTexttb: '',
+        long_data: long_data,
         debug_md5: key,
         debug_url: url,
         debug_list: window.btoa(tbs),
@@ -934,7 +966,7 @@
                     <PasteBaseTable type="page" insert={this.insert}/>
                     {config ? <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config.enabled} onChange={this.onEnabledChange} /> : null}
                     <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>淇濆瓨</Button>
-                    <Button type="default" onClick={this.closeView}>鍏抽棴</Button>
+                    <Button type="default" disabled={menuloading} onClick={this.closeView}>鍏抽棴</Button>
                   </div>
                 } style={{ width: '100%' }}>
                   {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null}

--
Gitblit v1.8.0