From b5e70973340bf912b733acd737f55f90653dece8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 03 七月 2021 09:48:25 +0800
Subject: [PATCH] 2021-07-03

---
 src/views/pcdesign/index.jsx |  130 ++++++++++++++++++++++--------------------
 1 files changed, 68 insertions(+), 62 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index bc7ea8b..5f24390 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -935,72 +935,72 @@
               _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
               _param.secretkey = Utils.encrypt('', _param.timestamp)
 
-              let appMenuParam = null
-              if (item.type === 'navbar') {
-                appMenuParam = {
-                  func: 's_appmenus_addupt',
-                  exec_type: 'y'
-                }
+              // 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)
+              //   appMenuParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+              //   appMenuParam.secretkey = Utils.encrypt('', _param.timestamp)
 
-                let LText = []
-                let app_param = []
-                let kei_no = sessionStorage.getItem('kei_no')
-                let userid = sessionStorage.getItem('CloudUserID') || ''
+              //   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'`)
+              //   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 (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
-                  }
+              // 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
-                    }
+              //     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 || ''
+              //       new_open_edition[item.uuid] = res.open_edition || ''
                     
-                    resolve()
-                  })
-                })
-              } else {
+              //       resolve()
+              //     })
+              //   })
+              // } else {
                 Api.getSystemConfig(_param).then(res => {
                   if (!res.status) {
                     notification.warning({
@@ -1015,15 +1015,14 @@
                   new_open_edition[item.uuid] = res.open_edition || ''
                   resolve()
                 })
-              }
+              // }
             })
           })
           Promise.all(deffers).then(() => {
             let appViewList = sessionStorage.getItem('appViewList')
             appViewList = JSON.parse(appViewList)
-            let _length = appViewList.length
+            let _appViewList = fromJS(appViewList).toJS()
             let appIndeList = appViewList.map(item => item.keys_id).join(',')
-            
 
             config.components = config.components.map(item => {
               if (item.type === 'navbar') {
@@ -1039,12 +1038,19 @@
                     keys_type: 'navbar',
                     remark: item.name
                   })
+                } else {
+                  appViewList = appViewList.map(view => {
+                    if (view.keys_id === item.uuid) {
+                      view.remark = item.name
+                    }
+                    return view
+                  })
                 }
               }
               return item
             })
 
-            if (appViewList.length > _length) {
+            if (!is(fromJS(appViewList), fromJS(_appViewList))) {
               let kparam = {
                 func: 's_kei_link_keyids_addupt',
                 BID: sessionStorage.getItem('appId'),

--
Gitblit v1.8.0