From 79e1455e4ba4f4a7d04a483dda1a354e53921a69 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 04 十一月 2020 19:04:14 +0800
Subject: [PATCH] 2020-11-04

---
 src/tabviews/custom/index.jsx |   48 ++++++++++++++++++++----------------------------
 1 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index a3a5325..9541ee1 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -10,19 +10,19 @@
 import zhCN from '@/locales/zh-CN/main.js'
 import enUS from '@/locales/en-US/main.js'
 import Utils from '@/utils/utils.js'
-import asyncSpinComponent from '@/utils/asyncSpinComponent'
+import asyncComponent from '@/utils/asyncComponent'
 import { refreshTabView } from '@/store/action'
 
 import NotFount from '@/components/404'
 import './index.scss'
 
 // 閫氱敤缁勪欢
-const AntvBarAndLine = asyncSpinComponent(() => import('./components/chart/antv-bar-line'))
-const AntvPie = asyncSpinComponent(() => import('./components/chart/antv-pie'))
-const AntvTabs = asyncSpinComponent(() => import('./components/tabs/antv-tabs'))
-const DataCard = asyncSpinComponent(() => import('./components/card/data-card'))
-const PropCard = asyncSpinComponent(() => import('./components/card/prop-card'))
-const MainSearch = asyncSpinComponent(() => import('./components/search/main-search'))
+const AntvBarAndLine = asyncComponent(() => import('./components/chart/antv-bar-line'))
+const AntvPie = asyncComponent(() => import('./components/chart/antv-pie'))
+const AntvTabs = asyncComponent(() => import('./components/tabs/antv-tabs'))
+const DataCard = asyncComponent(() => import('./components/card/data-card'))
+const PropCard = asyncComponent(() => import('./components/card/prop-card'))
+const MainSearch = asyncComponent(() => import('./components/search/main-search'))
 
 class CustomPage extends Component {
   static propTpyes = {
@@ -66,6 +66,12 @@
       let config = ''
       let userConfig = null
 
+      setTimeout(() => { // 寤舵椂鍔犺浇鐘舵��
+        this.setState({
+          loadingview: false
+        })
+      }, 1500)
+
       try { // 閰嶇疆淇℃伅瑙f瀽
         config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
       } catch (e) {
@@ -86,7 +92,6 @@
       // 椤甸潰閰嶇疆瑙f瀽閿欒鏃舵彁绀�
       if (!config) {
         this.setState({
-          loadingview: false,
           viewlost: true
         })
         return
@@ -95,7 +100,6 @@
       // 椤甸潰鏈惎鐢ㄦ椂锛屾樉绀烘湭鍚敤椤甸潰
       if (!config.enabled) {
         this.setState({
-          loadingview: false,
           viewlost: true,
           lostmsg: this.state.dict['main.view.unenabled']
         })
@@ -140,7 +144,6 @@
 
       this.setState({
         BID: param && param.BID ? param.BID : '',
-        loadingview: false,
         userConfig: userConfig,
         setting: config.setting,
         config,
@@ -222,7 +225,7 @@
       if (component.floor === 1 && component.dataName && !component.pageable && component.setting.interType === 'system' && component.setting.onload === 'true' && component.setting.sync === 'true') {
         let param = this.getDefaultParam(component, mainSearch)
         params.push(param)
-      } else {
+      } else if (component.floor === 1) {
         component.setting.sync = 'false'
       }
 
@@ -307,22 +310,11 @@
       let _sql = item.sql
       let _script = item.script
 
-      // if (index === 0) {
-      //   _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg =''
-      //     ${_script}
-      //   `
-      // }
-      
-      // if (params.length === index + 1) {
-      //   _sql = `${_sql}
-      //     aaa:
-      //       if @ErrorCode!=''
-      //       begin
-      //         insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ 
-      //         goto bbb
-      //       end
-      //   `
-      // }
+      if (index === 0) {
+        _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg =''
+          ${_script}
+        `
+      }
 
       item.columns.forEach(cell => {
         LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`)
@@ -335,7 +327,7 @@
       LText: LText.join(' union all '),
       LText_field: LText_field.join(' union all ')
     }
-    
+
     param.LText = Utils.formatOptions(param.LText)
     param.LText_field = Utils.formatOptions(param.LText_field)
     param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')

--
Gitblit v1.8.0