From b91c28df2f734b680198e755b7828666e238cea0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 21 六月 2024 16:43:44 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/views/menudesign/index.jsx |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index ad11d1f..f453d28 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -4,16 +4,16 @@
 import { is, fromJS } from 'immutable'
 import moment from 'moment'
 import HTML5Backend from 'react-dnd-html5-backend'
-import { ConfigProvider, notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd'
+import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd'
 import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'
 import html2canvas from 'html2canvas'
 import md5 from 'md5'
 
 import Api from '@/api'
 import Utils, { setGLOBFuncs } from '@/utils/utils.js'
-import antdZhCN from 'antd/es/locale/zh_CN'
+import { langs } from '@/store/options'
 import MKEmitter from '@/utils/events.js'
-import { getTables, getFuncsAndInters } from '@/utils/utils-custom.js'
+import { getTables, getFuncsAndInters, getLangTrans } from '@/utils/utils-custom.js'
 import asyncComponent from '@/utils/asyncComponent'
 
 import '@/assets/css/design.scss'
@@ -22,7 +22,6 @@
 const { Panel } = Collapse
 const { confirm } = Modal
 const { Paragraph } = Typography
-const _locale = antdZhCN
 
 const MenuForm = asyncComponent(() => import('./menuform'))
 const HomeForm = asyncComponent(() => import('./homeform'))
@@ -67,6 +66,7 @@
     eyeopen: false,
     view: '',
     popConfig: null,
+    langName: '',
     needUpdate: false
   }
 
@@ -98,12 +98,17 @@
 
       sessionStorage.setItem('MenuType', param.MenuType || 'custom')
 
+      if (param.MenuType === 'billPrint' && param.lang) {
+        sessionStorage.setItem('lang', param.lang)
+      }
+
       this.setState({
         MenuType: param.MenuType,
         MenuId: param.MenuId || param.MenuID,
         ParentId: param.ParentId || '',
         MenuName: param.MenuName || '',
         MenuNo: param.MenuNo || '',
+        langName: sessionStorage.getItem('lang') !== 'zh-CN' && langs[sessionStorage.getItem('lang')] ? `锛�${langs[sessionStorage.getItem('lang')]}锛塦 : ''
       }, () => {
         this.getMenuParam()
       })
@@ -772,6 +777,18 @@
         duration: 5
       })
       return
+    } else if (this.checklog()) {
+      if (sessionStorage.getItem('langList') && !config.trans) {
+
+      } else {
+        notification.success({
+          top: 92,
+          message: '褰撳墠閰嶇疆鏈慨鏀癸紝鏃犻渶淇濆瓨銆�',
+          duration: 5
+        })
+        MKEmitter.emit('completeSave')
+        return
+      }
     }
 
     this.setState({
@@ -834,6 +851,7 @@
 
       let interfaces = getFuncsAndInters(config)
       let urlFields = config.urlFields ? config.urlFields.join(',') : ''
+      let langSql = getLangTrans(config)
 
       let param = {
         func: 'sPC_TrdMenu_AddUpt',
@@ -847,12 +865,16 @@
         MenuName: config.MenuName || '',
         PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces, urlFields}),
         open_edition: config.open_edition,
-        LText: '',
-        LTexttb: '',
+        // LText: '',
+        // LTexttb: '',
         debug_md5: key,
         debug_url: url,
         debug_list: window.btoa(tbs),
         LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config)))
+      }
+
+      if (langSql) {
+        param.lang_translation = window.btoa(window.encodeURIComponent(langSql))
       }
 
       param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
@@ -1185,11 +1207,11 @@
   }
 
   render () {
-    const { view, comloading, MenuType, MenuId, config, settingshow, ParentId, menuloading, eyeopen, needUpdate } = this.state
+    const { view, comloading, MenuType, MenuId, config, settingshow, ParentId, menuloading, eyeopen, needUpdate, langName } = this.state
 
     return (
-      <ConfigProvider locale={_locale}>
-        <Header menuName={config ? config.MenuName : ''}/>
+      <>
+        <Header menuName={config ? config.MenuName + langName : ''}/>
         <DndProvider backend={HTML5Backend}>
           {view !== 'popview' ? <div className={'pc-menu-view ' + (MenuType || '')}>
             <div className="menu-body">
@@ -1265,7 +1287,7 @@
         <ModalController />
         <StyleController />
         <StyleCombController />
-      </ConfigProvider>
+      </>
     )
   }
 }

--
Gitblit v1.8.0