From 58a28e1faa15f638a136fefdcfcd0b3106c1fa16 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 24 六月 2020 10:18:54 +0800 Subject: [PATCH] 2020-06-24 --- src/templates/menuconfig/editsecmenu/index.jsx | 60 +++++++++++++++++++++++++++++++++--------------------------- 1 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/templates/menuconfig/editsecmenu/index.jsx b/src/templates/menuconfig/editsecmenu/index.jsx index 3b40425..b4807aa 100644 --- a/src/templates/menuconfig/editsecmenu/index.jsx +++ b/src/templates/menuconfig/editsecmenu/index.jsx @@ -10,8 +10,8 @@ import DragElement from '../menuelement' import MenuForm from '../menuform' import Api from '@/api' -import zhCN from '@/locales/zh-CN/header.js' -import enUS from '@/locales/en-US/header.js' +import zhCN from '@/locales/zh-CN/model.js' +import enUS from '@/locales/en-US/model.js' import './index.scss' import card1 from '@/assets/img/card-bg2.jpg' @@ -51,20 +51,22 @@ } handleMenu = (menu) => { + const { dict } = this.state + // 鑿滃崟缂栬緫锛氫慨鏀广�佸垹闄わ紝濡傝彍鍗曢『搴忓凡鏀瑰彉锛屾彁绀轰繚瀛樿彍鍗曢『搴� const _this = this if (!is(fromJS(this.props.menulist), fromJS(this.state.menulist))) { notification.warning({ top: 92, - message: this.state.dict['header.menu.presave'], + message: dict['model.menu.presave'], duration: 5 }) } else if (menu.type === 'close') { confirm({ - title: this.state.dict['header.menu.close'].replace('@M', menu.card.text), + title: dict['model.menu.close'].replace('@M', menu.card.text), content: '', - okText: this.state.dict['header.confirm'], - cancelText: this.state.dict['header.cancel'], + okText: dict['model.confirm'], + cancelText: dict['model.cancel'], onOk() { let param = { func: 'sPC_MainMenu_Del', @@ -87,14 +89,14 @@ } else if (menu.type === 'edit') { this.setState({ visible: true, - title: this.state.dict['header.menu.editTitle'], + title: dict['model.edit'] + dict['model.menu'], type: 'edit', editMenu: menu.card, formlist: [ { // 鐖剁骇鑿滃崟 type: 'select', key: 'parentId', - label: this.state.dict['header.menu.supMenu'], + label: dict['model.super'] + dict['model.menu'], initVal: this.props.supMenu.MenuID, required: true, options: this.props.supMenuList @@ -102,7 +104,7 @@ { // 鑿滃崟鍚嶇О type: 'text', key: 'menuName', - label: this.state.dict['header.menu.menuName'], + label: dict['model.menu'] + dict['model.name'], initVal: menu.card.text, required: true, readonly: false @@ -110,7 +112,7 @@ { // 鑿滃崟鍥炬爣 type: 'select', key: 'icon', - label: this.state.dict['header.menu.icon'], + label: dict['model.icon'], initVal: menu.card.PageParam.Icon, required: true, options: [{ @@ -127,17 +129,19 @@ } handleSubBtn = (type) => { + const { dict } = this.state + // 鎿嶄綔鎸夐挳 if (type === 'add') { // 娣诲姞鏂拌彍鍗� this.setState({ visible: true, - title: this.state.dict['header.menu.addtitle'], + title: dict['model.add'] + dict['model.menu'], type: 'add', formlist: [ { // 鐖剁骇鑿滃崟 type: 'select', key: 'parentId', - label: this.state.dict['header.menu.supMenu'], + label: dict['model.super'] + dict['model.menu'], initVal: this.props.supMenu.MenuID, required: true, options: this.props.supMenuList @@ -145,7 +149,7 @@ { // 鑿滃崟鍚嶇О type: 'text', key: 'menuName', - label: this.state.dict['header.menu.menuName'], + label: dict['model.menu'] + dict['model.name'], initVal: '', required: true, readonly: false @@ -153,7 +157,7 @@ { // 鑿滃崟鍥炬爣 type: 'select', key: 'icon', - label: this.state.dict['header.menu.icon'], + label: dict['model.icon'], initVal: 'folder', required: true, options: [{ @@ -208,10 +212,10 @@ param.secretkey = Utils.encrypt(param.LText, param.timestamp) // md5瀵嗛挜 confirm({ - title: this.state.dict['header.menu.resetorder'], + title: this.state.dict['model.menu.resetorder'], content: '', - okText: this.state.dict['header.confirm'], - cancelText: this.state.dict['header.cancel'], + okText: this.state.dict['model.confirm'], + cancelText: this.state.dict['model.cancel'], onOk() { return Api.getSystemConfig(param).then(res => { if (res.status) { @@ -319,7 +323,7 @@ if (this.refs.trawmenu.state.targetKeys.length === 0) { notification.warning({ top: 92, - message: this.state.dict['header.menu.thawmenu.select'], + message: this.state.dict['form.required.select'] + this.state.dict['model.menu'], duration: 5 }) } else { @@ -382,6 +386,8 @@ } render () { + const { dict } = this.state + return ( <div className="second-edit-box"> <div className="mask"> @@ -415,14 +421,14 @@ <Icon type="plus" /> </div> <div className="menu-btn"> - <Button type="primary" onClick={() => {this.handleSubBtn('thaw')}}>{this.state.dict['header.thawmenu']}</Button> - <Button type="primary" onClick={() => {this.handleSubBtn('confirm')}}>{this.state.dict['header.confirm']}</Button> - <Button onClick={() => {this.handleSubBtn('close')}}>{this.state.dict['header.close']}</Button> + <Button type="primary" onClick={() => {this.handleSubBtn('thaw')}}>{dict['model.thaw'] + dict['model.menu']}</Button> + <Button type="primary" onClick={() => {this.handleSubBtn('confirm')}}>{dict['model.confirm']}</Button> + <Button onClick={() => {this.handleSubBtn('close')}}>{dict['model.close']}</Button> </div> <Modal title={this.state.title} - okText={this.state.dict['header.confirm']} - cancelText={this.state.dict['header.cancel']} + okText={dict['model.confirm']} + cancelText={dict['model.cancel']} visible={this.state.visible} onOk={this.memuHandleSubmit} confirmLoading={this.state.confirmLoading} @@ -430,15 +436,15 @@ > {this.state.formlist && <MenuForm - dict={this.state.dict} + dict={dict} formlist={this.state.formlist} wrappedComponentRef={(inst) => this.menuFormRef = inst} />} </Modal> <Modal - title={this.state.dict['header.thawmenu']} - okText={this.state.dict['header.confirm']} - cancelText={this.state.dict['header.cancel']} + title={dict['model.thaw'] + dict['model.menu']} + okText={dict['model.confirm']} + cancelText={dict['model.cancel']} visible={this.state.thawMvisible} onOk={this.thawMemuSubmit} confirmLoading={this.state.confirmLoading} -- Gitblit v1.8.0