From 0eb129a9beddbb86ae74d7106a8e60823206b8d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 14 十二月 2023 11:29:15 +0800 Subject: [PATCH] 2023-12-14 --- src/templates/comtableconfig/index.jsx | 750 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 375 insertions(+), 375 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 7c55fb4..fc3b441 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/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, Col } from 'antd' +import { Button, Card, Collapse, notification, Spin, Tooltip, Col } from 'antd' import { QuestionCircleOutlined, RedoOutlined } from '@ant-design/icons' -import moment from 'moment' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -22,14 +21,13 @@ import './index.scss' const { Panel } = Collapse -const { confirm } = Modal -const Versions = asyncComponent(() => import('@/menu/versions')) +// const Versions = asyncComponent(() => import('@/menu/versions')) const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) // const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) const UpdateTable = asyncComponent(() => import('./updatetable')) const Unattended = asyncComponent(() => import('@/templates/zshare/unattended')) -const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) +// const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent')) const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) @@ -290,426 +288,428 @@ /** * @description 涓夌骇鑿滃崟淇濆瓨 */ - submitConfig = () => { - const { menu } = this.props - const { delActions, openEdition } = this.state + // submitConfig = () => { + // const { menu } = this.props + // const { delActions, 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.search = _config.search.filter(item => !item.origin) - _config.action = _config.action.filter(item => !item.origin) - _config.columns = _config.columns.filter(item => !item.origin) - _config.tabgroups[0].sublist = _config.tabgroups[0].sublist.filter(item => !item.origin) - } + // // 鏂板缓鑿滃崟锛屾竻闄ら粯璁ら」 + // if (_config.isAdd) { + // _config.search = _config.search.filter(item => !item.origin) + // _config.action = _config.action.filter(item => !item.origin) + // _config.columns = _config.columns.filter(item => !item.origin) + // _config.tabgroups[0].sublist = _config.tabgroups[0].sublist.filter(item => !item.origin) + // } - // 浣跨敤宸叉湁鑿滃崟鏃讹紝榛樿娣诲姞鍏宠仈鏍囩id - if (_config.type === 'user') { - _config.action = _config.action.map(item => { - if (item.OpenType === 'popview' && !item.linkTab) { - item.linkTab = Utils.getuuid() - } - return item - }) + // // 浣跨敤宸叉湁鑿滃崟鏃讹紝榛樿娣诲姞鍏宠仈鏍囩id + // if (_config.type === 'user') { + // _config.action = _config.action.map(item => { + // if (item.OpenType === 'popview' && !item.linkTab) { + // item.linkTab = Utils.getuuid() + // } + // return item + // }) - _config.tabgroups.forEach(group => { - group.sublist = group.sublist.map(tab => { - if (!tab.linkTab) { - tab.linkTab = Utils.getuuid() - } - return tab - }) - }) - } + // _config.tabgroups.forEach(group => { + // group.sublist = group.sublist.map(tab => { + // if (!tab.linkTab) { + // tab.linkTab = Utils.getuuid() + // } + // return tab + // }) + // }) + // } - // 鎸夐挳涓嶅瓨鍦ㄦ椂锛屽幓鎺夌粦瀹氱殑鍙屽嚮鎸夐挳 - if (_config.setting.doubleClick && _config.action.findIndex((item) => item.uuid === _config.setting.doubleClick) === -1) { - _config.setting.doubleClick = '' - } + // // 鎸夐挳涓嶅瓨鍦ㄦ椂锛屽幓鎺夌粦瀹氱殑鍙屽嚮鎸夐挳 + // if (_config.setting.doubleClick && _config.action.findIndex((item) => item.uuid === _config.setting.doubleClick) === -1) { + // _config.setting.doubleClick = '' + // } - // 鏈缃暟鎹簮鎴栨爣绛句笉鍚堟硶鏃讹紝鍚敤鐘舵�佷负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 + // }) + // } - let _LongParam = '' + // let _LongParam = '' - // 淇濆瓨鏃跺垹闄ら厤缃被鍨嬶紝system 銆乽ser - delete _config.type - delete _config.isAdd + // // 淇濆瓨鏃跺垹闄ら厤缃被鍨嬶紝system 銆乽ser + // delete _config.type + // delete _config.isAdd - 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 btnParam = { // 娣诲姞鑿滃崟鎸夐挳 - func: 'sPC_Button_AddUpt', - Type: 40, // 娣诲姞鑿滃崟涓嬬殑鎸夐挳type涓�40锛屾寜閽笅鐨勬寜閽畉ype涓�60 - ParentID: menu.MenuID, - MenuNo: _config.MenuNo, - Template: _config.Template || '', - PageParam: '', - LongParam: '', - LText: [] - } + // let btnParam = { // 娣诲姞鑿滃崟鎸夐挳 + // func: 'sPC_Button_AddUpt', + // Type: 40, // 娣诲姞鑿滃崟涓嬬殑鎸夐挳type涓�40锛屾寜閽笅鐨勬寜閽畉ype涓�60 + // ParentID: menu.MenuID, + // MenuNo: _config.MenuNo, + // Template: _config.Template || '', + // PageParam: '', + // LongParam: '', + // LText: [] + // } - _config.action.forEach(item => { - if (item.hidden === 'true') return - _sort++ - // if (item.OpenType === 'popview') { - // btntabs.push({ - // uuid: item.uuid, - // linkTab: item.linkTab, - // label: item.label, - // sort: _sort - // }) - // } + // _config.action.forEach(item => { + // if (item.hidden === 'true') return + // _sort++ + // // if (item.OpenType === 'popview') { + // // btntabs.push({ + // // uuid: item.uuid, + // // linkTab: item.linkTab, + // // label: item.label, + // // sort: _sort + // // }) + // // } - btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${_sort * 10}' as Sort`) - }) + // btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${_sort * 10}' as Sort`) + // }) - btnParam.LText = btnParam.LText.join(' union all ') - btnParam.LText = Utils.formatOptions(btnParam.LText) - btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) + // btnParam.LText = btnParam.LText.join(' union all ') + // btnParam.LText = Utils.formatOptions(btnParam.LText) + // btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + // btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) - // 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 ') - // 娓呯┖鑿滃崟涓嬪叧鑱旂殑鏍囩 - // if (!_LText) { - // _LText = `select '${menu.MenuID}' as MenuID ,'' as Tabid,'' as TabName ,'0' as Sort` - // } + // // 娓呯┖鑿滃崟涓嬪叧鑱旂殑鏍囩 + // // if (!_LText) { + // // _LText = `select '${menu.MenuID}' as MenuID ,'' as Tabid,'' as TabName ,'0' as Sort` + // // } - // 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 _vals = this.getFuncNames(_config) + // let _vals = this.getFuncNames(_config) - 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, hidden: _config.hidden || 'false'}), - LongParam: _LongParam, - LText: _vals.func.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`), - LTexttb: _vals.table.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, hidden: _config.hidden || 'false'}), + // LongParam: _LongParam, + // LText: _vals.func.map(item => `select '${menu.MenuID}' as MenuID,'${item.func}' as ProcName,'${item.label}' as MenuName`), + // LTexttb: _vals.table.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 + // } - setTimeout(() => { - // 鏈夋寜閽垨鏍囩鍒犻櫎鏃讹紝鍏堣繘琛屽垹闄ゆ搷浣� - // 鍒犻櫎鎴愬姛鍚庯紝淇濆瓨椤甸潰閰嶇疆 - new Promise(resolve => { - if (delActions.length > 0) { - let deffers = delActions.map(item => { - let _param = { - func: 'sPC_MainMenu_Del', - MenuID: item.card ? item.card.uuid : item.uuid - } + // setTimeout(() => { + // // 鏈夋寜閽垨鏍囩鍒犻櫎鏃讹紝鍏堣繘琛屽垹闄ゆ搷浣� + // // 鍒犻櫎鎴愬姛鍚庯紝淇濆瓨椤甸潰閰嶇疆 + // new Promise(resolve => { + // if (delActions.length > 0) { + // let deffers = delActions.map(item => { + // let _param = { + // func: 'sPC_MainMenu_Del', + // MenuID: item.card ? item.card.uuid : item.uuid + // } - if (item.type === 'action') { - let _ParentParam = null + // if (item.type === 'action') { + // let _ParentParam = null - try { - _ParentParam = window.btoa(window.encodeURIComponent(JSON.stringify(item.card))) - } catch (e) { - console.warn('Stringify Failure') - _ParentParam = null - } + // try { + // _ParentParam = window.btoa(window.encodeURIComponent(JSON.stringify(item.card))) + // } catch (e) { + // console.warn('Stringify Failure') + // _ParentParam = null + // } - if (_ParentParam) { // 鍒犻櫎鎸夐挳鏃讹紝淇濆瓨鎸夐挳閰嶇疆淇℃伅锛岀敤浜庢仮澶嶆寜閽� - _param.ParentParam = _ParentParam - } - } + // if (_ParentParam) { // 鍒犻櫎鎸夐挳鏃讹紝淇濆瓨鎸夐挳閰嶇疆淇℃伅锛岀敤浜庢仮澶嶆寜閽� + // _param.ParentParam = _ParentParam + // } + // } - 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({ - delActions: [] - }) - resolve(true) - } - }) - } else if (delActions.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({ + // delActions: [] + // }) + // resolve(true) + // } + // }) + // } else if (delActions.length === 0) { + // resolve(true) + // } + // }).then(resp => { + // if (resp === false) return - return true - }).then(res => { - if (res === true || res === false) return res + // return true + // }).then(res => { + // if (res === true || res === false) return res - let msg = res.filter(Boolean)[0] - if (msg) { - notification.warning({ - top: 92, - message: msg, - duration: 5 - }) - return false - } else { - return 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() - }) + // let msg = res.filter(Boolean)[0] + // if (msg) { + // notification.warning({ + // top: 92, + // message: msg, + // duration: 5 + // }) + // return false + // } else { + // return 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() + // }) - this.submitAction(btnParam) - } else { - this.setState({ - menuloading: false, - menucloseloading: false - }) - notification.warning({ - top: 92, - message: response.message, - duration: 5 - }) - } - }) - }) - }, +sessionStorage.getItem('mkDelay')) - } + // this.submitAction(btnParam) + // } else { + // this.setState({ + // menuloading: false, + // menucloseloading: false + // }) + // notification.warning({ + // top: 92, + // message: response.message, + // duration: 5 + // }) + // } + // }) + // }) + // }, +sessionStorage.getItem('mkDelay')) + // } /** * @description 淇濆瓨鎴栦慨鏀硅彍鍗曟寜閽泦 */ - submitAction = (btnParam) => { - const { config } = this.state + // submitAction = (btnParam) => { + // const { config } = this.state - new Promise(resolve => { - if (btnParam.LText) { - Api.getCloudConfig(btnParam).then(result => { - if (result.status) { - this.setState({ // 淇濆瓨鎴愬姛鍚庢竻绌哄鍒跺垪琛� - copyActions: [] - }) - resolve(result) - } else { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - resolve(false) - } - }) - } else { - resolve(true) - } - }).then(response => { - if (response === false) return response + // new Promise(resolve => { + // if (btnParam.LText) { + // Api.getCloudConfig(btnParam).then(result => { + // if (result.status) { + // this.setState({ // 淇濆瓨鎴愬姛鍚庢竻绌哄鍒跺垪琛� + // copyActions: [] + // }) + // resolve(result) + // } else { + // notification.warning({ + // top: 92, + // message: result.message, + // duration: 5 + // }) + // resolve(false) + // } + // }) + // } else { + // resolve(true) + // } + // }).then(response => { + // if (response === false) return response - if (!this.state.originActions || this.state.originActions.length === 0) return 'true' + // if (!this.state.originActions || this.state.originActions.length === 0) return 'true' - let oriActions = [] - this.state.originActions.forEach(item => { - let curBtn = config.action.filter(cell => item.curuuid === cell.uuid)[0] // 鏌ョ湅鍒濆鍖栨寜閽槸鍚﹀瓨鍦� - if (!curBtn) return - if (curBtn.OpenType !== item.prebtn.OpenType) return - if (curBtn.OpenType === 'funcbutton' && curBtn.execMode !== 'pop') return + // let oriActions = [] + // this.state.originActions.forEach(item => { + // let curBtn = config.action.filter(cell => item.curuuid === cell.uuid)[0] // 鏌ョ湅鍒濆鍖栨寜閽槸鍚﹀瓨鍦� + // if (!curBtn) return + // if (curBtn.OpenType !== item.prebtn.OpenType) return + // if (curBtn.OpenType === 'funcbutton' && curBtn.execMode !== 'pop') return - oriActions.push({ - prebtn: item.prebtn, - curBtn: curBtn - }) - }) + // oriActions.push({ + // prebtn: item.prebtn, + // curBtn: curBtn + // }) + // }) - if (oriActions.length === 0) return 'true' + // if (oriActions.length === 0) return 'true' - oriActions.forEach(action => { - if (!action.prebtn || !action.prebtn.uuid) return + // oriActions.forEach(action => { + // if (!action.prebtn || !action.prebtn.uuid) return - Api.getCloudConfig({ - func: 'sPC_Get_LongParam', - MenuID: action.prebtn.uuid - }).then(result => { - if (result.status && result.LongParam) { - let _temp = '' + // Api.getCloudConfig({ + // func: 'sPC_Get_LongParam', + // MenuID: action.prebtn.uuid + // }).then(result => { + // if (result.status && result.LongParam) { + // let _temp = '' - let _subconfig = '' - try { - _subconfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) - _temp = _subconfig.type - } catch (e) { - console.warn('Parse Failure') - _subconfig = '' - } + // let _subconfig = '' + // try { + // _subconfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) + // _temp = _subconfig.type + // } catch (e) { + // console.warn('Parse Failure') + // _subconfig = '' + // } - if (!_subconfig) return + // if (!_subconfig) return - let param = { - func: 'sPC_ButtonParam_AddUpt', - ParentID: this.props.menu.MenuID, - MenuID: action.curBtn.uuid, - MenuNo: config.MenuNo, - Template: _temp, - MenuName: action.curBtn.label, - PageParam: JSON.stringify({Template: _temp}), - LongParam: result.LongParam - } - Api.getCloudConfig(param).then(() => {}) - } - }) - }) - return 'true' - }).then(response => { - if (response === 'true') { - notification.success({ - top: 92, - message: '淇濆瓨鎴愬姛', - duration: 2 - }) - if (this.state.closeVisible) { - this.props.handleView() - } else { - this.setState({ - originActions: [], - menuloading: false, - menucloseloading: false - }) - } - this.props.reloadmenu() - } else { - this.setState({ - menuloading: false, - menucloseloading: false - }) - } - }) - } + // let param = { + // func: 'sPC_ButtonParam_AddUpt', + // ParentID: this.props.menu.MenuID, + // MenuID: action.curBtn.uuid, + // MenuNo: config.MenuNo, + // Template: _temp, + // MenuName: action.curBtn.label, + // PageParam: JSON.stringify({Template: _temp}), + // LongParam: result.LongParam + // } + // Api.getCloudConfig(param).then(() => {}) + // } + // }) + // }) + // return 'true' + // }).then(response => { + // if (response === 'true') { + // notification.success({ + // top: 92, + // message: '淇濆瓨鎴愬姛', + // duration: 2 + // }) + // if (this.state.closeVisible) { + // this.props.handleView() + // } else { + // this.setState({ + // originActions: [], + // menuloading: false, + // menucloseloading: false + // }) + // } + // this.props.reloadmenu() + // } else { + // this.setState({ + // menuloading: false, + // menucloseloading: false + // }) + // } + // }) + // } /** * @description 鐐瑰嚮杩斿洖鏃讹紝鍒ゆ柇閰嶇疆淇濆瓨鐘舵�� */ cancelConfig = () => { - const { config, originMenu } = this.state + // const { config, originMenu } = this.state - let _this = this + // 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() } /** @@ -1072,7 +1072,7 @@ render () { const { menu } = this.props - const { activeKey, config, chartview, openEdition } = this.state + const { activeKey, config, chartview } = this.state if (!config) return null @@ -1187,12 +1187,12 @@ } bordered={false} extra={ <div> <Unattended config={config} updateConfig={this.updateconfig}/> - <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> + {/* <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> */} {/* <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> */} - <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} refresh={this.editConfig}/> + {/* <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} refresh={this.editConfig}/> */} <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%' }}> @@ -1281,7 +1281,7 @@ </div> </DndProvider> {/* 杩斿洖鏃舵湭淇濆瓨鎻愮ず */} - <Modal + {/* <Modal bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}} closable={false} maskClosable={false} @@ -1295,7 +1295,7 @@ destroyOnClose > 閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛� - </Modal> + </Modal> */} {this.state.loading && <Spin size="large" />} </div> ) -- Gitblit v1.8.0