From f2f059007551e01399f4df1afc82ec0abc489a43 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 08 十一月 2023 21:44:19 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/templates/treepageconfig/index.jsx | 444 +++++++++++++++++++++++++++--------------------------- 1 files changed, 222 insertions(+), 222 deletions(-) diff --git a/src/templates/treepageconfig/index.jsx b/src/templates/treepageconfig/index.jsx index 318adf1..af0d67b 100644 --- a/src/templates/treepageconfig/index.jsx +++ b/src/templates/treepageconfig/index.jsx @@ -3,9 +3,8 @@ import { is, fromJS } from 'immutable' import { DndProvider } from 'react-dnd' import HTML5Backend from 'react-dnd-html5-backend' -import { Button, Card, Modal, Collapse, notification, Spin, Switch, Tooltip, Row, Col, Tree } from 'antd' +import { Button, Card, Collapse, notification, Spin, Tooltip, Row, Col, Tree } from 'antd' import { QuestionCircleOutlined, RedoOutlined, SearchOutlined, FileOutlined, FolderOpenOutlined } from '@ant-design/icons' -import moment from 'moment' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -17,7 +16,7 @@ import './index.scss' const { Panel } = Collapse -const { confirm } = Modal +// const { confirm } = Modal const { TreeNode } = Tree const UpdateTable = asyncComponent(() => import('./updatetable')) @@ -215,255 +214,256 @@ /** * @description 涓夌骇鑿滃崟淇濆瓨 */ - submitConfig = () => { - const { menu } = this.props - const { delTabs, openEdition } = this.state + // submitConfig = () => { + // const { menu } = this.props + // const { delTabs, openEdition } = this.state - let _config = fromJS(this.state.config).toJS() + // let _config = fromJS(this.state.config).toJS() - // 鍩烘湰淇℃伅楠岃瘉 - if (!_config.fstMenuId || !_config.ParentId || !_config.MenuName || !_config.MenuNo) { - notification.warning({ - top: 92, - message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', - duration: 5 - }) - this.setState({activeKey: '0'}) - return - } + // // 鍩烘湰淇℃伅楠岃瘉 + // if (!_config.fstMenuId || !_config.ParentId || !_config.MenuName || !_config.MenuNo) { + // notification.warning({ + // top: 92, + // message: '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', + // duration: 5 + // }) + // this.setState({activeKey: '0'}) + // return + // } - // 鏂板缓楠岃瘉 - if (_config.isAdd) { - _config.tabgroups[0].sublist = _config.tabgroups[0].sublist.filter(item => !item.origin) - } + // // 鏂板缓楠岃瘉 + // if (_config.isAdd) { + // _config.tabgroups[0].sublist = _config.tabgroups[0].sublist.filter(item => !item.origin) + // } - // 浣跨敤宸叉湁鑿滃崟鏃讹紝榛樿娣诲姞鍏宠仈鏍囩id - if (_config.type === 'user') { - _config.tabgroups.forEach(group => { - group.sublist = group.sublist.map(tab => { - if (!tab.linkTab) { - tab.linkTab = Utils.getuuid() - } - return tab - }) - }) - } + // // 浣跨敤宸叉湁鑿滃崟鏃讹紝榛樿娣诲姞鍏宠仈鏍囩id + // if (_config.type === 'user') { + // _config.tabgroups.forEach(group => { + // group.sublist = group.sublist.map(tab => { + // if (!tab.linkTab) { + // tab.linkTab = Utils.getuuid() + // } + // return tab + // }) + // }) + // } - // 鏈缃暟鎹簮鎴栨爣绛句笉鍚堟硶鏃讹紝鍚敤鐘舵�佷负false - let vresult = this.verifyconfig(_config) - if (vresult !== true) { - _config.enabled = false - } + // // 鏈缃暟鎹簮鎴栨爣绛句笉鍚堟硶鏃讹紝鍚敤鐘舵�佷负false + // let vresult = this.verifyconfig(_config) + // if (vresult !== true) { + // _config.enabled = false + // } - if (this.state.closeVisible) { // 鏄剧ず鍏抽棴瀵硅瘽妗嗘椂锛屾ā鎬佹涓繚瀛樻寜閽紝鏄剧ず淇濆瓨涓姸鎬� - this.setState({ - menucloseloading: true - }) - } else { - this.setState({ - menuloading: true - }) - } + // if (this.state.closeVisible) { // 鏄剧ず鍏抽棴瀵硅瘽妗嗘椂锛屾ā鎬佹涓繚瀛樻寜閽紝鏄剧ず淇濆瓨涓姸鎬� + // this.setState({ + // menucloseloading: true + // }) + // } else { + // this.setState({ + // menuloading: true + // }) + // } - // 淇濆瓨鏃跺垹闄ら厤缃被鍨嬶紝system 銆乽ser - delete _config.type - delete _config.isAdd + // // 淇濆瓨鏃跺垹闄ら厤缃被鍨嬶紝system 銆乽ser + // delete _config.type + // delete _config.isAdd - let _LongParam = '' + // let _LongParam = '' - try { - _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config))) - } catch (e) { - notification.warning({ - top: 92, - message: '缂栬瘧閿欒', - duration: 5 - }) - this.setState({ - menucloseloading: false, - menuloading: false - }) - return - } + // try { + // _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config))) + // } catch (e) { + // notification.warning({ + // top: 92, + // message: '缂栬瘧閿欒', + // duration: 5 + // }) + // this.setState({ + // menucloseloading: false, + // menuloading: false + // }) + // return + // } - // let _sort = 0 - // let btntabs = [] + // // let _sort = 0 + // // let btntabs = [] - // let tabParam = { // 娣诲姞鑿滃崟tab椤� - // func: 'sPC_sMenusTab_AddUpt', - // MenuID: menu.MenuID - // } + // // let tabParam = { // 娣诲姞鑿滃崟tab椤� + // // func: 'sPC_sMenusTab_AddUpt', + // // MenuID: menu.MenuID + // // } - // let _LText = [] + // // let _LText = [] - // btntabs.forEach(item => { - // _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`) - // }) - // _config.tabgroups.forEach(group => { - // group.sublist.forEach(item => { - // _sort++ - // _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`) - // }) - // }) + // // btntabs.forEach(item => { + // // _LText.push(`select '${item.uuid}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${item.sort * 10}' as Sort`) + // // }) + // // _config.tabgroups.forEach(group => { + // // group.sublist.forEach(item => { + // // _sort++ + // // _LText.push(`select '${menu.MenuID}' as MenuID ,'${item.linkTab}' as Tabid,'${item.label}' as TabName ,'${_sort * 10}' as Sort`) + // // }) + // // }) - // _LText = _LText.join(' union all ') + // // _LText = _LText.join(' union all ') - // tabParam.LText = Utils.formatOptions(_LText) - // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp) + // // tabParam.LText = Utils.formatOptions(_LText) + // // tabParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + // // tabParam.secretkey = Utils.encrypt(tabParam.LText, tabParam.timestamp) - let _funcs = [] - let _tables = [] + // let _funcs = [] + // let _tables = [] - if (_config.setting.tableName) { - _tables.push(_config.setting.tableName) - } - if (_config.setting.innerFunc) { - _funcs.push({func: _config.setting.innerFunc, label: _config.MenuName || ''}) - } - if (_config.setting.outerFunc) { - _funcs.push({func: _config.setting.outerFunc, label: _config.MenuName || ''}) - } + // if (_config.setting.tableName) { + // _tables.push(_config.setting.tableName) + // } + // if (_config.setting.innerFunc) { + // _funcs.push({func: _config.setting.innerFunc, label: _config.MenuName || ''}) + // } + // if (_config.setting.outerFunc) { + // _funcs.push({func: _config.setting.outerFunc, label: _config.MenuName || ''}) + // } - let param = { - func: 'sPC_TrdMenu_AddUpt', - FstID: _config.fstMenuId, - SndID: _config.ParentId, - ParentID: _config.ParentId, - MenuID: menu.MenuID, - MenuNo: _config.MenuNo, - EasyCode: _config.easyCode, - Template: _config.Template, - MenuName: _config.MenuName, - PageParam: JSON.stringify({...menu.PageParam, Template: _config.Template, OpenType: _config.OpenType}), - LongParam: _LongParam, - LText: _funcs.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`), - LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`) - } + // let param = { + // func: 'sPC_TrdMenu_AddUpt', + // FstID: _config.fstMenuId, + // SndID: _config.ParentId, + // ParentID: _config.ParentId, + // MenuID: menu.MenuID, + // MenuNo: _config.MenuNo, + // EasyCode: _config.easyCode, + // Template: _config.Template, + // MenuName: _config.MenuName, + // PageParam: JSON.stringify({...menu.PageParam, Template: _config.Template, OpenType: _config.OpenType}), + // LongParam: _LongParam, + // LText: _funcs.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`), + // LTexttb: _tables.map(item => `select '${menu.MenuID}' as MenuID,'${item}' as tbName`) + // } - if (menu.menuSort) { // 鑿滃崟鏂板缓鏃惰缃帓搴� - param.Sort = menu.menuSort - } + // if (menu.menuSort) { // 鑿滃崟鏂板缓鏃惰缃帓搴� + // param.Sort = menu.menuSort + // } - param.LText = param.LText.join(' union all ') - param.LText = Utils.formatOptions(param.LText) - param.LTexttb = param.LTexttb.join(' union all ') - param.LTexttb = Utils.formatOptions(param.LTexttb) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) + // param.LText = param.LText.join(' union all ') + // param.LText = Utils.formatOptions(param.LText) + // param.LTexttb = param.LTexttb.join(' union all ') + // param.LTexttb = Utils.formatOptions(param.LTexttb) + // param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + // param.secretkey = Utils.encrypt(param.LText, param.timestamp) - if (openEdition) { // 鐗堟湰绠$悊 - param.open_edition = openEdition - } + // if (openEdition) { // 鐗堟湰绠$悊 + // param.open_edition = openEdition + // } - // 鏈夋寜閽垨鏍囩鍒犻櫎鏃讹紝鍏堣繘琛屽垹闄ゆ搷浣� - // 鍒犻櫎鎴愬姛鍚庯紝淇濆瓨椤甸潰閰嶇疆 - new Promise(resolve => { - if (delTabs.length > 0) { - let deffers = delTabs.map(item => { - let _param = { - func: 'sPC_MainMenu_Del', - MenuID: item.uuid - } + // // 鏈夋寜閽垨鏍囩鍒犻櫎鏃讹紝鍏堣繘琛屽垹闄ゆ搷浣� + // // 鍒犻櫎鎴愬姛鍚庯紝淇濆瓨椤甸潰閰嶇疆 + // new Promise(resolve => { + // if (delTabs.length > 0) { + // let deffers = delTabs.map(item => { + // let _param = { + // func: 'sPC_MainMenu_Del', + // MenuID: item.uuid + // } - return new Promise(resolve => { - Api.getCloudConfig(_param).then(response => { - resolve(response) - }) - }) - }) - Promise.all(deffers).then(result => { - let error = null - result.forEach(response => { - if (!response.status) { - error = response - } - }) + // return new Promise(resolve => { + // Api.getCloudConfig(_param).then(response => { + // resolve(response) + // }) + // }) + // }) + // Promise.all(deffers).then(result => { + // let error = null + // result.forEach(response => { + // if (!response.status) { + // error = response + // } + // }) - if (error) { - this.setState({ - menuloading: false, - menucloseloading: false - }) - notification.warning({ - top: 92, - message: error.message, - duration: 5 - }) - resolve(false) - } else { - this.setState({ - delTabs: [] - }) - resolve(true) - } - }) - } else if (delTabs.length === 0) { - resolve(true) - } - }).then(resp => { - if (resp === false) return + // if (error) { + // this.setState({ + // menuloading: false, + // menucloseloading: false + // }) + // notification.warning({ + // top: 92, + // message: error.message, + // duration: 5 + // }) + // resolve(false) + // } else { + // this.setState({ + // delTabs: [] + // }) + // resolve(true) + // } + // }) + // } else if (delTabs.length === 0) { + // resolve(true) + // } + // }).then(resp => { + // if (resp === false) return - Api.getCloudConfig(param).then(response => { - if (response.status) { - this.setState({ - config: _config, - openEdition: response.open_edition || '', - originMenu: fromJS(_config).toJS(), - menuloading: false, - menucloseloading: false - }) + // Api.getCloudConfig(param).then(response => { + // if (response.status) { + // this.setState({ + // config: _config, + // openEdition: response.open_edition || '', + // originMenu: fromJS(_config).toJS(), + // menuloading: false, + // menucloseloading: false + // }) - notification.success({ - top: 92, - message: '淇濆瓨鎴愬姛', - duration: 2 - }) + // notification.success({ + // top: 92, + // message: '淇濆瓨鎴愬姛', + // duration: 2 + // }) - this.props.reloadmenu() + // this.props.reloadmenu() - if (this.state.closeVisible) { - this.props.handleView() - } - } else { - this.setState({ - menuloading: false, - menucloseloading: false - }) - notification.warning({ - top: 92, - message: response.message, - duration: 5 - }) - } - }) - }) - } + // if (this.state.closeVisible) { + // this.props.handleView() + // } + // } else { + // this.setState({ + // menuloading: false, + // menucloseloading: false + // }) + // notification.warning({ + // top: 92, + // message: response.message, + // duration: 5 + // }) + // } + // }) + // }) + // } /** * @description 鐐瑰嚮杩斿洖鏃讹紝鍒ゆ柇閰嶇疆淇濆瓨鐘舵�� */ cancelConfig = () => { - const { config, originMenu } = this.state - let _this = this + // const { config, originMenu } = this.state + // let _this = this - if (config.isAdd) { - confirm({ - content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', - onOk() { - _this.props.handleView() - }, - onCancel() {} - }) - } else { - if (!is(fromJS(originMenu), fromJS(config))) { - this.setState({ - closeVisible: true - }) - } else { - this.props.handleView() - } - } + // if (config.isAdd) { + // confirm({ + // content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', + // onOk() { + // _this.props.handleView() + // }, + // onCancel() {} + // }) + // } else { + // if (!is(fromJS(originMenu), fromJS(config))) { + // this.setState({ + // closeVisible: true + // }) + // } else { + // this.props.handleView() + // } + // } + this.props.handleView() } /** @@ -710,8 +710,8 @@ } bordered={false} extra={ <div> <UpdateTable config={config}/> - <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> - <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> + {/* <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> */} + {/* <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> */} <Button onClick={this.cancelConfig}>鍏抽棴</Button> </div> } style={{ width: '100%' }}> @@ -765,7 +765,7 @@ </div> </DndProvider> {/* 杩斿洖鏃舵湭淇濆瓨鎻愮ず */} - <Modal + {/* <Modal bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}} closable={false} maskClosable={false} @@ -779,7 +779,7 @@ destroyOnClose > 閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛� - </Modal> + </Modal> */} {this.state.loading && <Spin size="large" />} </div> ) -- Gitblit v1.8.0