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/tabledesign/index.jsx | 42 ++++++++++++++++++++++++++++++------------ 1 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx index 3880a3d..6dd9642 100644 --- a/src/views/tabledesign/index.jsx +++ b/src/views/tabledesign/index.jsx @@ -4,15 +4,15 @@ 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 } from 'antd' +import { notification, Modal, Collapse, Card, Switch, Button, Typography } from 'antd' import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons' 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 SourceElement from '@/templates/zshare/dragsource' import asyncComponent from '@/utils/asyncComponent' import Source from './source' @@ -23,7 +23,6 @@ const { Panel } = Collapse const { confirm } = Modal const { Paragraph } = Typography -const _locale = antdZhCN const MenuForm = asyncComponent(() => import('./menuform')) const PopView = asyncComponent(() => import('./popview')) @@ -59,6 +58,7 @@ comloading: false, settingshow: sessionStorage.getItem('settingshow') !== 'false', view: null, + langName: '', popConfig: null } @@ -93,6 +93,7 @@ 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() }) @@ -425,8 +426,8 @@ window.GLOB.urlFields = config.urlFields || [] this.setState({ - oriConfig: config, - config: fromJS(config).toJS() + oriConfig: config.components[0].isNew ? {} : fromJS(config).toJS(), + config: config }) window.GLOB.customMenu = config } else { @@ -532,6 +533,18 @@ if (!this.checkBase()) { 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({ @@ -582,6 +595,7 @@ let interfaces = getFuncsAndInters(config) let urlFields = config.urlFields ? config.urlFields.join(',') : '' + let langSql = getLangTrans(config) let param = { func: 'sPC_TrdMenu_AddUpt', @@ -595,12 +609,16 @@ MenuName: config.MenuName || '', PageParam: JSON.stringify({Template: 'BaseTable', 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') @@ -841,11 +859,11 @@ } render () { - const { view, activeKey, comloading, MenuId, config, settingshow, ParentId, menuloading } = this.state + const { view, activeKey, comloading, MenuId, config, settingshow, ParentId, menuloading, 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-table-view"> <div className="menu-body"> @@ -921,7 +939,7 @@ </DndProvider> <StyleController /> <ModalController /> - </ConfigProvider> + </> ) } } -- Gitblit v1.8.0