| | |
| | | import TransferForm from '@/components/transferform' |
| | | import Utils from '@/utils/utils.js' |
| | | import DragElement from '../menuelement' |
| | | // import MenuForm from '../menuform' |
| | | // import ComTableConfig from '../comtableconfig' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/header.js' |
| | | import enUS from '@/locales/en-US/header.js' |
| | | import nortable from '@/assets/img/normaltable.jpg' |
| | | import './index.scss' |
| | | |
| | | const ComTableConfig = asyncComponent(() => import('../comtableconfig')) |
| | | const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig')) |
| | | const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig')) |
| | | const { confirm } = Modal |
| | | const { TabPane } = Tabs |
| | | const illust = { |
| | |
| | | tabview: '', // 选择模板窗口(template)、基础表格配置(CommonTable) |
| | | formlist: null, |
| | | editMenu: null, // 编辑菜单 |
| | | editMvisible: false, // 编辑菜单模态框 |
| | | thawMvisible: false, // 解除冻结模态框 |
| | | confirmLoading: false, // 提交中。。。 |
| | | dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, |
| | |
| | | } |
| | | } |
| | | _menu.LongParam = _LongParam |
| | | _menu.ParentID = this.props.supMenu.MenuID |
| | | // console.log(_menu) |
| | | // 检测模板是否存在 |
| | | let _Template = this.state.baseTemplates.filter(temp => temp.type === _menu.PageParam.Template) |
| | |
| | | } |
| | | } |
| | | |
| | | // memuHandleCancel = () => { |
| | | // this.setState({ |
| | | // editMvisible: false, |
| | | // visible: false |
| | | // }) |
| | | // this.resetFormlist() |
| | | // } |
| | | |
| | | thawMemuSubmit = () => { |
| | | // 三级菜单解除冻结 |
| | | if (this.refs.trawmenu.state.targetKeys.length === 0) { |
| | |
| | | text: '', |
| | | type: template.type, |
| | | PageParam: {OpenType: "newtab", Template: template.type}, |
| | | LongParam: '' |
| | | LongParam: '', |
| | | ParentID: this.props.supMenu.MenuID |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | } |
| | | document.getElementById('root').style.overflowY = 'hidden' |
| | | } |
| | | |
| | | // submitMenuConfig = () => { |
| | | // if (this.state.type !== 'edit') { |
| | | // this.setState({ |
| | | // visible: true, |
| | | // title: this.state.dict['header.menu.addtitle'], |
| | | // formlist: [ |
| | | // { |
| | | // type: 'text', |
| | | // key: 'parentId', |
| | | // label: this.state.dict['header.menu.supMenu'], |
| | | // initVal: this.props.supMenu.text, |
| | | // required: true, |
| | | // readonly: true |
| | | // }, |
| | | // { |
| | | // type: 'text', |
| | | // key: 'menuName', |
| | | // label: this.state.dict['header.menu.menuName'], |
| | | // initVal: '', |
| | | // required: true, |
| | | // readonly: false |
| | | // }, |
| | | // { |
| | | // type: 'text', |
| | | // key: 'menuNo', |
| | | // label: this.state.dict['header.menu.menuNo'], |
| | | // initVal: '', |
| | | // required: true, |
| | | // readonly: false |
| | | // }, |
| | | // { |
| | | // type: 'select', |
| | | // key: 'opentype', |
| | | // label: '打开方式', |
| | | // initVal: 'newtab', |
| | | // required: true, |
| | | // options: [{ |
| | | // MenuID: 'newtab', |
| | | // text: '新标签页' |
| | | // }, { |
| | | // MenuID: 'newpage', |
| | | // text: '新页面' |
| | | // }] |
| | | // } |
| | | // ] |
| | | // }) |
| | | // } else { |
| | | // console.log(this.state.editMenu) |
| | | // // confirm({ |
| | | // // title: this.state.dict['header.menu.update'].replace('@M', menu.card.text), |
| | | // // content: '', |
| | | // // okText: this.state.dict['header.confirm'], |
| | | // // cancelText: this.state.dict['header.cancel'], |
| | | // // onOk() { |
| | | // // let param = { |
| | | // // func: 'sPC_MainMenu_Del', |
| | | // // MenuID: menu.card.MenuID |
| | | // // } |
| | | // // return Api.getSystemConfig(param).then(res => { |
| | | // // if (res.status) { |
| | | // // _this.props.reload() |
| | | // // } else { |
| | | // // notification.warning({ |
| | | // // top: 92, |
| | | // // message: res.message, |
| | | // // duration: 10 |
| | | // // }) |
| | | // // } |
| | | // // }) |
| | | // // }, |
| | | // // onCancel() {} |
| | | // // }) |
| | | // this.setState({ |
| | | // tabview: this.state.selectTemp.type |
| | | // }) |
| | | // } |
| | | // } |
| | | |
| | | // changeTemp = () => { |
| | | // this.setState({ |
| | | // editMvisible: false, |
| | | // tabview: 'template' |
| | | // }) |
| | | // this.resetFormlist() |
| | | // } |
| | | |
| | | // changeConfig = () => { |
| | | // this.setState({ |
| | | // editMvisible: false, |
| | | // tabview: this.state.editMenu.PageParam.Template, |
| | | // menuConfig: window.atob(this.state.editMenu.LongParam) |
| | | // }) |
| | | // this.resetFormlist() |
| | | // } |
| | | |
| | | // resetFormlist = () => { |
| | | // setTimeout(() => { |
| | | // this.setState({formlist: null}) |
| | | // }, 300) |
| | | // } |
| | | |
| | | getUsedTemplate = () => { |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp'}).then(res => { |
| | |
| | | handleConfig = (type) => { |
| | | this.setState({tabview: type}) |
| | | document.getElementById('root').style.overflowY = 'unset' |
| | | } |
| | | |
| | | handleSubConfig = (item, originMenu, config) => { |
| | | if (item.OpenType === 'pop') { |
| | | // this.setState({ |
| | | // editMenu: originMenu, |
| | | // tabview: 'Modal' |
| | | // }) |
| | | } |
| | | console.log(item) |
| | | console.log(originMenu) |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | <ComTableConfig |
| | | type={this.state.type} |
| | | menu={this.state.editMenu} |
| | | supMenuList={this.props.supMenuList} |
| | | handleConfig={this.handleConfig} |
| | | handleSubConfig={this.handleSubConfig} |
| | | /> |
| | | } |
| | | {this.state.tabview === 'Modal' && |
| | | <ModalConfig |
| | | menu={this.state.editMenu} |
| | | supMenu={this.props.supMenu} |
| | | supMenuList={this.props.supMenuList} |
| | | handleConfig={this.handleConfig} |