From fb64bcf1fab18b33d21470c83f28d4cda8d309ce Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 26 十月 2022 12:15:59 +0800
Subject: [PATCH] 2022-10-26

---
 src/views/pcdesign/index.jsx |  114 ---------------------------------------------------------
 1 files changed, 0 insertions(+), 114 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 24039b6..5ce06e7 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -59,8 +59,6 @@
     MenuId: '',
     MenuName: '',
     MenuNo: '',
-    delButtons: [],
-    copyButtons: [],
     activeKey: 'basedata',
     menuloading: false,
     oriConfig: null,
@@ -125,8 +123,6 @@
       document.getElementById('mk-pc-design-view').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh; height: 100vh; background: #fff;">鏈簲鐢ㄦ病鏈塒C绔〉闈㈢殑缂栬緫鏉冮檺锛岃鑱旂郴绠$悊鍛橈紒</div>'
       return
     }
-    MKEmitter.addListener('delButtons', this.delButtons)
-    MKEmitter.addListener('copyButtons', this.copyButtons)
     MKEmitter.addListener('changePopview', this.initPopview)
     MKEmitter.addListener('changeEditMenu', this.changeEditMenu)
     MKEmitter.addListener('triggerMenuSave', this.triggerMenuSave)
@@ -210,8 +206,6 @@
     this.setState = () => {
       return
     }
-    MKEmitter.removeListener('delButtons', this.delButtons)
-    MKEmitter.removeListener('copyButtons', this.copyButtons)
     MKEmitter.removeListener('changePopview', this.initPopview)
     MKEmitter.removeListener('changeEditMenu', this.changeEditMenu)
     MKEmitter.removeListener('triggerMenuSave', this.triggerMenuSave)
@@ -484,14 +478,6 @@
       })
     })
     this.setState({customComponents: coms})
-  }
-
-  delButtons = (items) => {
-    this.setState({ delButtons: [...this.state.delButtons, ...items] })
-  }
-
-  copyButtons = (items) => {
-    this.setState({copyButtons: [...this.state.copyButtons, ...items]})
   }
 
   initPopview = (card, btn) => {
@@ -1145,7 +1131,6 @@
   }
 
   submitConfig = () => {
-    const { delButtons, copyButtons } = this.state
     let config = fromJS(this.state.config).toJS()
 
     if (!config.MenuName || !config.MenuNo || (config.cacheUseful === 'true' && !config.cacheTime)) {
@@ -1414,15 +1399,6 @@
       }).then(res => { // 鎸夐挳鎴栬彍鍗曞垹闄�
         if (!res) return
 
-        if (delButtons.length === 0) {
-          return { status: true, nonexec: true }
-        } else {
-          let _param = {
-            func: 'sPC_MainMenu_Del',
-            MenuID: delButtons.join(',')
-          }
-          return Api.getSystemConfig(_param)
-        }
       }).then(res => { // 椤甸潰淇濆瓨
         if (!res) return
 
@@ -1468,99 +1444,9 @@
           })
           return false
         }
-
-        if (copyButtons.length === 0) {
-          return {
-            status: true
-          }
-        } else {
-          return new Promise(resolve => {
-            let deffers = copyButtons.map(item => {
-              return new Promise(resolve => {
-                if (delButtons.includes(item.uuid)) { // 澶嶅埗鐨勬寜閽凡鍒犻櫎
-                  resolve({
-                    status: true
-                  })
-                  return
-                }
-
-                Api.getSystemConfig({
-                  func: 'sPC_Get_LongParam',
-                  MenuID: item.$originUuid,
-                  TypeCharOne: sessionStorage.getItem('kei_no'),
-                  typename: 'pc',
-                }).then(result => {
-                  if (result.status) {
-                    let _conf = ''
-              
-                    try {
-                      _conf = result.LongParam ? JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) : ''
-                    } catch (e) {
-                      console.warn('Parse Failure')
-                      _conf = ''
-                    }
-                    
-                    if (_conf) {
-                      _conf.components = MenuUtils.resetConfig(_conf.components)
-                      _conf.uuid = item.uuid
-                      _conf.MenuID = item.uuid
-                      _conf.Template = 'webPage'
-                      _conf.enabled = false
-                    } else {
-                      resolve({
-                        status: true
-                      })
-                      return
-                    }
-
-                    let _param = {
-                      func: 'sPC_ButtonParam_AddUpt',
-                      ParentID: config.uuid,
-                      MenuID: item.uuid,
-                      MenuNo: '',
-                      Template: 'webPage',
-                      MenuName: item.label,
-                      PageParam: JSON.stringify({Template: 'webPage'}),
-                      LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_conf))),
-                      TypeCharOne: sessionStorage.getItem('kei_no'),
-                      Typename: 'pc',
-                    }
-            
-                    Api.getSystemConfig(_param).then(response => {
-                      resolve(response)
-                    })
-                  }
-                })
-              })
-            })
-            Promise.all(deffers).then(result => {
-              let error = null
-              result.forEach(response => {
-                if (!response.status) {
-                  error = response
-                }
-              })
-    
-              if (error) {
-                notification.warning({
-                  top: 92,
-                  message: error.message,
-                  duration: 5
-                })
-                resolve(false)
-              } else {
-                resolve({
-                  status: true
-                })
-              }
-            })
-          })
-        }
       }).then(res => {
         if (res && res.status) {
           this.setState({
-            delButtons: [],
-            copyButtons: [],
             menuloading: false
           })
           notification.success({

--
Gitblit v1.8.0