From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 27 八月 2023 18:37:36 +0800
Subject: [PATCH] 2023-08-27

---
 src/views/pcdesign/index.jsx |   89 +++++++-------------------------------------
 1 files changed, 15 insertions(+), 74 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index a8dcca3..79bb8c8 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -4,7 +4,7 @@
 import { is, fromJS } from 'immutable'
 import HTML5Backend from 'react-dnd-html5-backend'
 import { ConfigProvider, notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd'
-import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, RedoOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'
+import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'
 import moment from 'moment'
 import md5 from 'md5'
 
@@ -48,8 +48,6 @@
 const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton'))
 const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent'))
 
-sessionStorage.setItem('isEditState', 'true')
-
 sessionStorage.setItem('appType', 'pc')        // 搴旂敤绫诲瀷
 sessionStorage.setItem('typename', 'pc')
 document.body.className = ''
@@ -84,7 +82,6 @@
     }
     
     if (!sessionStorage.getItem('UserID')) {
-      sessionStorage.removeItem('isEditState')
       sessionStorage.removeItem('appType')
       this.props.history.replace('/login')
       return
@@ -149,7 +146,6 @@
     MKEmitter.addListener('triggerMenuSave', this.triggerMenuSave)
 
     setTimeout(() => {
-      this.getAppPictures()
       this.getRoleFields()
       setGLOBFuncs()
     }, 1000)
@@ -262,7 +258,7 @@
   }
 
   getAppMessage = (MenuID) => {
-    Api.getSystemConfig({
+    Api.getCloudConfig({
       func: 's_get_keyids',
       bid: sessionStorage.getItem('appId')
     }).then(res => {
@@ -312,7 +308,7 @@
         param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
         param.secretkey = Utils.encrypt('', param.timestamp)
 
-        Api.getSystemConfig(param).then(result => {
+        Api.getCloudConfig(param).then(result => {
           if (!result.status) {
             notification.warning({
               top: 92,
@@ -328,43 +324,6 @@
         sessionStorage.setItem('appViewList', JSON.stringify(appViewList))
         this.props.history.replace('/pcdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: MenuID || homeId, type: 'view'}))))
       }
-    })
-  }
-
-  getAppPictures = () => {
-    if (sessionStorage.getItem('app_pictures')) return
-    
-    let deffers = []
-    let param = {
-      func: 's_url_db_adduptdel',
-      PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
-      PageSize: 0,   // 0 浠h〃鍏ㄩ儴
-      type: 'search'
-    }
-    deffers = [new Promise(resolve => {
-      setTimeout(() => {
-        Api.getSystemConfig({...param, typecharone: 'image'}).then(res => {
-          resolve(res.data)
-        })
-      }, 500)
-    }), new Promise(resolve => {
-      setTimeout(() => {
-        Api.getSystemConfig({...param, typecharone: 'video'}).then(res => {
-          resolve(res.data)
-        })
-      }, 1000)
-    }), new Promise(resolve => {
-      setTimeout(() => {
-        Api.getSystemConfig({...param, typecharone: 'color'}).then(res => {
-          resolve(res.data)
-        })
-      }, 1500)
-    })]
-
-    Promise.all(deffers).then(response => {
-      sessionStorage.setItem('app_pictures', JSON.stringify(response[0] || []))
-      sessionStorage.setItem('app_videos', JSON.stringify(response[1] || []))
-      sessionStorage.setItem('app_colors', JSON.stringify(response[2] || []))
     })
   }
 
@@ -532,7 +491,7 @@
       MenuID: MenuId
     }
 
-    Api.getSystemConfig(param).then(result => {
+    Api.getCloudConfig(param).then(result => {
       if (!result.status) {
         notification.warning({
           top: 92,
@@ -679,7 +638,7 @@
 
     _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
 
-    Api.getSystemConfig(_param).then(res => {
+    Api.getCloudConfig(_param).then(res => {
       if (!res.status) {
         notification.warning({
           top: 92,
@@ -718,7 +677,7 @@
       MenuID: urlParam.copyMenuId
     }
 
-    Api.getSystemConfig(param).then(result => {
+    Api.getCloudConfig(param).then(result => {
       if (!result.status) {
         notification.warning({
           top: 92,
@@ -804,7 +763,7 @@
   }
 
   jointComponents = (config, navItem) => {
-    Api.getSystemConfig({
+    Api.getCloudConfig({
       func: 'sPC_Get_LongParam',
       TypeCharOne: sessionStorage.getItem('kei_no'),
       typename: 'pc',
@@ -1355,7 +1314,7 @@
             _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
             _param.secretkey = Utils.encrypt('', _param.timestamp)
 
-            Api.getSystemConfig(_param).then(res => {
+            Api.getCloudConfig(_param).then(res => {
               if (res.status) {
                 NavBar.open_edition = res.open_edition || ''
                 window.GLOB.CacheIndependent.set(NavBar.uuid, fromJS(NavBar).toJS())
@@ -1400,7 +1359,7 @@
                   kparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
                   kparam.secretkey = Utils.encrypt('', kparam.timestamp)
         
-                  Api.getSystemConfig(kparam).then(result => {
+                  Api.getCloudConfig(kparam).then(result => {
                     if (result.status) {
                       sessionStorage.setItem('appViewList', viewList)
                     }
@@ -1419,7 +1378,7 @@
       }).then(res => { // 椤甸潰淇濆瓨
         if (!res || !res.status) return res
 
-        return Api.getSystemConfig(param)
+        return Api.getCloudConfig(param)
       }).then(res => {
         this.setState({
           menuloading: false
@@ -1443,7 +1402,6 @@
             message: '淇濆瓨鎴愬姛',
             duration: 2
           })
-          MKEmitter.emit('completeSave')
         } else {
           notification.warning({
             top: 92,
@@ -1451,6 +1409,7 @@
             duration: 5
           })
         }
+        MKEmitter.emit('completeSave')
       }, this.netError)
     }, 300 + (+sessionStorage.getItem('mkDelay')))
   }
@@ -1467,11 +1426,12 @@
         duration: 5
       })
     }
+    MKEmitter.emit('completeSave')
   }
 
   getRoleFields = () => {
     if (sessionStorage.getItem('sysRoles') || sessionStorage.getItem('permFuncField')) return
-    Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
+    Api.getCloudConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
       if (res.status) {
         let _permFuncField = []
         let _sysRoles = []
@@ -1594,24 +1554,6 @@
     })
   }
 
-  refreshView = () => {
-    if (!is(fromJS(this.state.oriConfig || {}), fromJS(this.state.config || {}))) {
-      notification.warning({
-        top: 92,
-        message: '閰嶇疆淇℃伅鏈繚瀛橈紒',
-        duration: 5
-      })
-      return
-    }
-
-    sessionStorage.removeItem('sysRoles')
-    sessionStorage.removeItem('permFuncField')
-    sessionStorage.removeItem('app_videos')
-    sessionStorage.removeItem('app_pictures')
-    
-    window.location.reload()
-  }
-
   setHomeView = () => {
     const { config } = this.state
 
@@ -1655,7 +1597,7 @@
       title: '纭畾璁剧疆鏈〉闈负棣栭〉鍚楋紵',
       content: '',
       onOk() {
-        Api.getSystemConfig(param).then(result => {
+        Api.getCloudConfig(param).then(result => {
           if (!result.status) {
             notification.warning({
               top: 92,
@@ -1716,7 +1658,7 @@
       title: '纭畾璁剧疆鏈〉闈负鐧诲綍椤靛悧锛�',
       content: hasLogin ? '' : '褰撳墠椤甸潰灏氭湭娣诲姞鐧诲綍缁勪欢銆�',
       onOk() {
-        Api.getSystemConfig(param).then(result => {
+        Api.getCloudConfig(param).then(result => {
           if (!result.status) {
             notification.warning({
               top: 92,
@@ -1797,7 +1739,6 @@
                 <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/>
                 <Transfer MenuID={MenuId} />
                 <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''}/>
-                <Button className="mk-border-danger" onClick={this.refreshView}><RedoOutlined /> 寮哄埗鍒锋柊</Button>
                 <Button type="default" onClick={this.closeView}>鍏抽棴</Button>
               </div>
             </div>

--
Gitblit v1.8.0