From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 四月 2025 12:18:03 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/views/design/header/editfirstmenu/index.jsx |   58 ++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 34 insertions(+), 24 deletions(-)

diff --git a/src/views/design/header/editfirstmenu/index.jsx b/src/views/design/header/editfirstmenu/index.jsx
index f167ddb..add92a2 100644
--- a/src/views/design/header/editfirstmenu/index.jsx
+++ b/src/views/design/header/editfirstmenu/index.jsx
@@ -10,7 +10,7 @@
 import MenuForm from './menuform'
 import Utils from '@/utils/utils.js'
 import Api from '@/api'
-import './index.scss'
+// import './index.scss'
 
 const { confirm } = Modal
 
@@ -37,19 +37,20 @@
   editMenuModal = (Menu) => {
     // 鑿滃崟缂栬緫锛氫慨鏀�
     const menu = fromJS(Menu).toJS()
-    if (!is(fromJS(this.state.menulist), fromJS(this.props.menulist))) {
+    if (this.state.change) {
       notification.warning({
         top: 92,
         message: '鑿滃崟椤哄簭宸茶皟鏁达紝璇蜂繚瀛橈紒',
         duration: 5
       })
-    } else {
-      this.setState({
-        visible: true,
-        editMenu: menu.card,
-        loading: false
-      })
+      return
     }
+
+    this.setState({
+      visible: true,
+      editMenu: menu.card,
+      loading: false
+    })
   }
 
   editMemuSubmit = () => {
@@ -59,7 +60,7 @@
       this.setState({
         loading: true
       })
-      Api.getSystemConfig(param).then(res => {
+      Api.getCloudConfig(param).then(res => {
         if (res.status) {
           this.setState({
             loading: false,
@@ -82,7 +83,16 @@
   }
 
   deleteMemu = (item) => {
-    let _this = this
+    if (this.state.change) {
+      notification.warning({
+        top: 92,
+        message: '鑿滃崟椤哄簭宸茶皟鏁达紝璇蜂繚瀛橈紒',
+        duration: 5
+      })
+      return
+    }
+    
+    let that = this
     confirm({
       title: `纭畾鍒犻櫎鑿滃崟銆�${item.MenuName}銆嬪悧锛焋,
       content: '',
@@ -91,9 +101,9 @@
           func: 'sPC_MainMenu_Del',
           MenuID: item.MenuID
         }
-        return Api.getSystemConfig(param).then(res => {
+        return Api.getCloudConfig(param).then(res => {
           if (res.status) {
-            _this.props.reload()
+            that.props.reload()
           } else {
             notification.warning({
               top: 92,
@@ -108,30 +118,32 @@
   }
   
   handleButton = (type) => {
+    const that = this
     // 鑿滃崟缂栬緫锛氭坊鍔狅紝纭畾锛屽彇娑�
     let _menuchange = !is(fromJS(this.state.menulist), fromJS(this.props.menulist))
 
     if (type === 'confirm' && _menuchange) {
-      let _this = this
       let param  = {
         func: 'sPC_Menu_SortUpt',
+        exec_type: 'x',
         LText: this.state.menulist.map((item, index) => {
           return 'select \'' + item.MenuID + '\' as Menuid,' + (index + 1) * 10 + ' as sort'
         })
       }
 
-      param.LText = param.LText.join(' union ') // sql鎷兼帴
-      param.LText = Utils.formatOptions(param.LText) // 鍏抽敭瀛楃鏇挎崲锛宐ase64鍔犲瘑
-      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') // 鏃堕棿鎴�
-      param.secretkey = Utils.encrypt(param.LText, param.timestamp) // md5瀵嗛挜
+      param.LText = param.LText.join(' union ')
+      param.LText = Utils.formatOptions(param.LText, 'x')
+      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+      param.secretkey = Utils.encrypt('', param.timestamp)
 
       confirm({
         title: '纭璋冩暣鑿滃崟椤哄簭鍚楋紵',
         content: '',
         onOk() {
-          return Api.getSystemConfig(param).then(res => {
+          return Api.getCloudConfig(param).then(res => {
             if (res.status) {
-              _this.props.reload()
+              that.setState({ change: false })
+              that.props.reload()
             } else {
               notification.warning({
                 top: 92,
@@ -144,13 +156,11 @@
         onCancel() {}
       })
     } else if (type === 'cancel' && _menuchange) {
-      let _this = this
-
       confirm({
         title: '鑿滃崟椤哄簭宸茶皟鏁达紝鏀惧純淇濆瓨鍚楋紵',
         content: '',
         onOk() {
-          _this.props.exitEdit()
+          that.props.exitEdit()
         },
         onCancel() {}
       })
@@ -173,7 +183,7 @@
     const { menulist, change } = this.state
 
     return (
-      <div className="header-edit-box">
+      <>
         <DndProvider backend={HTML5Backend}>
           <DragElement
             change={change}
@@ -199,7 +209,7 @@
             wrappedComponentRef={(inst) => this.editMenuFormRef = inst}
           />
         </Modal>
-      </div>
+      </>
     )
   }
 }

--
Gitblit v1.8.0