From cdd5b449130ea4d7223fde4f414a11a7d0c33d6d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 三月 2024 17:52:16 +0800
Subject: [PATCH] 2024-03-07

---
 src/tabviews/custom/components/code/sand-box/index.jsx |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx
index 4119dea..bc158d3 100644
--- a/src/tabviews/custom/components/code/sand-box/index.jsx
+++ b/src/tabviews/custom/components/code/sand-box/index.jsx
@@ -48,7 +48,7 @@
         _data = window.GLOB.SyncData.get(_config.dataName) || []
   
         if (_config.$cache) {
-          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS())
+          Api.writeCacheConfig(_config.uuid, fromJS(_data).toJS(), BID)
         }
   
         _config.setting.sync = 'false'
@@ -72,8 +72,7 @@
     this.setState({
       data: _data,
       BID: BID || '',
-      config: _config,
-      arr_field: _config.columns.map(col => col.field).join(',')
+      config: _config
     })
   }
 
@@ -107,13 +106,13 @@
   }
 
   initExec = () => {
-    const { config } = this.state
+    const { config, BID } = this.state
 
     if (config.wrap.datatype !== 'static') {
       if (config.$cache) {
         if (config.$time) {
           if (!this.loaded) {
-            Api.getLCacheConfig(config.uuid, config.$time).then(res => {
+            Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
               if (!res.valid && config.setting.onload === 'true') {
                 setTimeout(() => {
                   this.loadData('init')
@@ -131,7 +130,7 @@
           }
         } else {
           if (!this.loaded) {
-            Api.getLCacheConfig(config.uuid, 0).then(res => {
+            Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
               if (!res.data || this.loaded) return
       
               this.setState({data: res.data}, () => {
@@ -161,14 +160,14 @@
   }
 
   transferSyncData = (syncId) => {
-    const { config } = this.state
+    const { config, BID } = this.state
 
     if (config.$syncId !== syncId) return
 
     let _data = window.GLOB.SyncData.get(config.dataName) || []
 
     if (config.$cache) {
-      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
+      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
     }
 
     if (!is(fromJS(this.state.data), fromJS(_data))) {
@@ -205,7 +204,7 @@
   }
 
   async loadData (type) {
-    const { config, arr_field, BID } = this.state
+    const { config, BID } = this.state
 
     if (config.wrap.datatype === 'static') {
       this.setState({
@@ -236,7 +235,7 @@
     })
 
     let _orderBy = config.setting.order || ''
-    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, 1, BID)
+    let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, 1, 1, BID)
 
     let result = await Api.genericInterface(param)
     if (result.status) {
@@ -244,7 +243,7 @@
 
       this.loaded = true
       if (config.$cache && type === 'init') {
-        Api.writeCacheConfig(config.uuid, result.data || [])
+        Api.writeCacheConfig(config.uuid, result.data || [], BID)
       }
 
       if (!is(fromJS(this.state.data), fromJS(_data))) {
@@ -319,8 +318,8 @@
       if (js) {
         try {
           // eslint-disable-next-line
-          let evalfunc = eval('(true && function (data, result, Api, notification) {' + js + '})')
-          evalfunc(data, result, Api, notification)
+          let evalfunc = eval('(true && function (data, result, Api, notification, systemType) {' + js + '})')
+          evalfunc(data, result, Api, notification, window.GLOB.systemType)
         } catch (e) {
           console.warn(e)
         }

--
Gitblit v1.8.0