From 5c509746d48f326157542a784fd6d645e2dc9ae6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 09 三月 2021 19:05:55 +0800
Subject: [PATCH] 2021-03-09

---
 src/views/pcdesign/index.jsx |  105 ++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 85 insertions(+), 20 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index be7a609..0f54908 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -29,7 +29,6 @@
 const BgController = asyncComponent(() => import('@/pc/bgcontroller'))
 const Quotecomponent = asyncComponent(() => import('@/pc/quotecomponent'))
 const PasteController = asyncComponent(() => import('@/menu/pastecontroller'))
-const PaddingController = asyncComponent(() => import('@/pc/padcontroller'))
 const StyleController = asyncComponent(() => import('@/menu/stylecontroller'))
 const SysInterface = asyncComponent(() => import('@/menu/sysinterface'))
 const PictureController = asyncComponent(() => import('@/menu/picturecontroller'))
@@ -311,10 +310,10 @@
   }
 
   delButtons = (items) => {
-    const { copyButtons } = this.state
+    const { copyButtons, delButtons } = this.state
 
     this.setState({
-      delButtons: [...this.state.delButtons, ...items],
+      delButtons: [...delButtons, ...items],
       copyButtons: copyButtons.filter(item => !items.includes(item.uuid))
     })
   }
@@ -756,20 +755,87 @@
               _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
               _param.secretkey = Utils.encrypt('', _param.timestamp)
 
-              Api.getSystemConfig(_param).then(res => {
-                if (!res.status) {
-                  notification.warning({
-                    top: 92,
-                    message: res.message,
-                    duration: 5
-                  })
-                  return
+              let appMenuParam = null
+              if (item.type === 'navbar') {
+                appMenuParam = {
+                  func: 's_appmenus_addupt',
+                  exec_type: 'y'
                 }
+  
+                appMenuParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+                appMenuParam.secretkey = Utils.encrypt('', _param.timestamp)
 
-                new_open_edition[item.uuid] = res.open_edition || ''
-                
-                resolve()
-              })
+                let LText = []
+                let app_param = []
+                let kei_no = sessionStorage.getItem('kei_no')
+                let userid = sessionStorage.getItem('CloudUserID') || ''
+
+                item.menus.forEach((fst, findex) => {
+                  // LText.push(`select '${fst.MenuID}','${fst.name}','','0','${sessionStorage.getItem('appId')}','0','${(findex + 1) * 10}','10','','${userid}','${window.GLOB.appkey}','${fst.MenuNo || ''}','${kei_no}','pc'`)
+                  LText.push(`select '${fst.MenuID}','${fst.name}','','0','0','0','${(findex + 1) * 10}','10','','${userid}','${window.GLOB.appkey}','${fst.MenuNo || ''}','${kei_no}','pc'`)
+                  app_param.push(`select '${window.GLOB.appkey}','${fst.MenuID}','${userid}','${(findex + 1) * 10}','','${fst.name}','${fst.MenuNo || ''}','0','10','${kei_no}','pc'`)
+                  if (fst.property === 'classify' && fst.sublist.length > 0) {
+                    fst.sublist.forEach(scd => {
+                      LText.push(`select '${scd.MenuID}','${scd.name}','','0','${fst.MenuID}','0','${(findex + 1) * 10}','20','','${userid}','${window.GLOB.appkey}','${scd.MenuNo || ''}','${kei_no}','pc'`)
+                      app_param.push(`select '${window.GLOB.appkey}','${scd.MenuID}','${userid}','${(findex + 1) * 10}','','${scd.name}','${scd.MenuNo || ''}','${fst.MenuID}','20','${kei_no}','pc'`)
+                    
+                      if (scd.property === 'classify' && scd.sublist.length > 0) {
+                        scd.sublist.forEach(thd => {
+                          LText.push(`select '${thd.MenuID}','${thd.name}','','0','${scd.MenuID}','0','${(findex + 1) * 10}','20','','${userid}','${window.GLOB.appkey}','${thd.MenuNo || ''}','${kei_no}','pc'`)
+                          app_param.push(`select '${window.GLOB.appkey}','${thd.MenuID}','${userid}','${(findex + 1) * 10}','','${thd.name}','${thd.MenuNo || ''}','${scd.MenuID}','20','${kei_no}','pc'`)
+                        })
+                      }
+                    })
+                  }
+                })
+                appMenuParam.LText = Utils.formatOptions(LText.join(' union '))
+                appMenuParam.LText1 = Utils.formatOptions(app_param.join(' union '))
+              }
+
+              if (appMenuParam) {
+                Api.getSystemConfig(appMenuParam).then(_res => {
+                  if (!_res.status) {
+                    notification.warning({
+                      top: 92,
+                      message: _res.message,
+                      duration: 5
+                    })
+                    this.setState({ menuloading: false })
+                    return
+                  }
+
+                  Api.getSystemConfig(_param).then(res => {
+                    if (!res.status) {
+                      notification.warning({
+                        top: 92,
+                        message: res.message,
+                        duration: 5
+                      })
+                      this.setState({ menuloading: false })
+                      return
+                    }
+    
+                    new_open_edition[item.uuid] = res.open_edition || ''
+                    
+                    resolve()
+                  })
+                })
+              } else {
+                Api.getSystemConfig(_param).then(res => {
+                  if (!res.status) {
+                    notification.warning({
+                      top: 92,
+                      message: res.message,
+                      duration: 5
+                    })
+                    this.setState({ menuloading: false })
+                    return
+                  }
+  
+                  new_open_edition[item.uuid] = res.open_edition || ''
+                  resolve()
+                })
+              }
             })
           })
           Promise.all(deffers).then(() => {
@@ -777,6 +843,7 @@
             appViewList = JSON.parse(appViewList)
             let _length = appViewList.length
             let appIndeList = appViewList.map(item => item.keys_id).join(',')
+            
 
             config.components = config.components.map(item => {
               if (item.type === 'navbar') {
@@ -819,6 +886,7 @@
                     message: result.message,
                     duration: 5
                   })
+                  this.setState({ menuloading: false })
                 } else {
                   sessionStorage.setItem('appViewList', JSON.stringify(appViewList))
                   resolve(true)
@@ -829,7 +897,7 @@
             }
           })
         }
-      }).then(res => { // 鎸夐挳鍒犻櫎
+      }).then(res => { // 鎸夐挳鎴栬彍鍗曞垹闄�
         if (!res) return
 
         if (delButtons.length === 0) {
@@ -1173,11 +1241,8 @@
                   {customComponents && customComponents.length ? <Panel header="鑷畾涔夌粍浠�" key="cuscomponent">
                     <SourceWrap components={customComponents} />
                   </Panel> : null}
-                  <Panel header={'椤甸潰鑳屾櫙'} key="background">
+                  <Panel header={'椤甸潰鏍峰紡'} key="background">
                     {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null}
-                  </Panel>
-                  <Panel header={'椤甸潰鍐呰竟璺�'} key="padding">
-                    {config ? <PaddingController config={config} updateConfig={this.updateConfig} /> : null}
                   </Panel>
                 </Collapse>
               </div>

--
Gitblit v1.8.0