From 9cf5fc474d2159aad973e3208fbef670f325307f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 25 十一月 2020 17:57:41 +0800 Subject: [PATCH] 2020-11-25 --- src/index.js | 1 src/tabviews/zshare/actionList/tabbutton/index.jsx | 27 +- src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx | 76 ++++++++ src/components/header/index.jsx | 6 src/store/reducer.js | 4 src/tabviews/zshare/normalTable/index.jsx | 18 - src/templates/sharecomponent/actioncomponent/actionform/index.jsx | 23 -- src/menu/components/chart/antv-pie/chartcompile/index.jsx | 9 src/menu/actioncomponent/actionform/index.jsx | 27 -- src/menu/actioncomponent/index.jsx | 26 -- src/tabviews/custom/components/chart/antv-pie/index.jsx | 77 +++++++ src/templates/subtableconfig/index.jsx | 19 + src/views/menudesign/menuform/index.jsx | 10 + src/menu/components/chart/antv-pie/index.jsx | 2 src/templates/sharecomponent/actioncomponent/index.jsx | 2 src/tabviews/subtable/index.jsx | 5 src/tabviews/subtabtable/index.jsx | 31 ++ src/tabviews/commontable/index.jsx | 7 src/menu/components/share/normalform/index.jsx | 29 ++ src/menu/components/table/normal-table/index.jsx | 87 +-------- src/templates/sharecomponent/columncomponent/columnform/index.jsx | 19 -- 21 files changed, 270 insertions(+), 235 deletions(-) diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index c41a04f..9b0daf0 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -253,7 +253,7 @@ this.props.modifyMenuTree(res.menulist) this.props.modifyMainMenu(mainMenu) - this.props.initMenuPermission(res.permMenus) + this.props.initMenuPermission(res.thdMenuList) resolve(_menu) }) @@ -278,7 +278,6 @@ getMenulist = (result) => { let thdMenuList = [] - let permMenus = {} let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt'] let menulist = result.fst_menu.map(fst => { let fstItem = { @@ -383,7 +382,6 @@ } } - permMenus[trd.MenuID] = true thdMenuList.push(trdItem) return trdItem @@ -397,7 +395,7 @@ return fstItem }) - return { menulist, thdMenuList, permMenus} + return { menulist, thdMenuList } } reload = () => { diff --git a/src/index.js b/src/index.js index 9cdc192..4ca1c39 100644 --- a/src/index.js +++ b/src/index.js @@ -54,7 +54,6 @@ sessionStorage.removeItem('isEditState') sessionStorage.removeItem('loginError') -// fetch(`./${process.env.NODE_ENV === 'production' ? 'build/' : ''}options.json`) fetch(`./options.json`) .then(response => response.json()) .catch(() => { diff --git a/src/menu/actioncomponent/actionform/index.jsx b/src/menu/actioncomponent/actionform/index.jsx index a9758c6..3c00ca0 100644 --- a/src/menu/actioncomponent/actionform/index.jsx +++ b/src/menu/actioncomponent/actionform/index.jsx @@ -79,7 +79,6 @@ UNSAFE_componentWillMount () { const { card, type } = this.props - let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' let _opentype = card.OpenType // 鎵撳紑鏂瑰紡 let _intertype = card.intertype || 'system' // 鎺ュ彛绫诲瀷 let _funcType = card.funcType || 'print' // 鍔熻兘鎸夐挳榛樿绫诲瀷 @@ -92,7 +91,6 @@ this.setState({ openType: _opentype, - menulist: _menulist.options || [], interType: _intertype, funcType: _funcType, formlist: this.props.formlist.map(item => { @@ -544,10 +542,7 @@ } ] })( - <Cascader - options={this.state.menulist} - placeholder="" - /> + <Cascader options={item.options || []} placeholder=""/> )} </Form.Item> </Col> @@ -571,7 +566,6 @@ handleConfirm = () => { const { setting } = this.props - const { menulist } = this.state // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { @@ -609,25 +603,6 @@ } else if (this.props.card.Ot === 'requiredOnce' && ['notRequired', 'requiredSgl', 'required'].includes(values.Ot)) { values.verify.uniques = [] } - } - - // 鍏宠仈涓夌骇鑿滃崟 - if (values.OpenType === 'tab' && values.linkmenu && values.linkmenu.length > 0) { - let linkThdMenu = '' - menulist.forEach(menu => { - if (menu.value === values.linkmenu[0]) { - menu.children.forEach(item => { - if (item.value === values.linkmenu[1]) { - item.children.forEach(cell => { - if (cell.value === values.linkmenu[2]) { - linkThdMenu = cell - } - }) - } - }) - } - }) - values.linkThdMenu = linkThdMenu } resolve(values) diff --git a/src/menu/actioncomponent/index.jsx b/src/menu/actioncomponent/index.jsx index 14507c5..56c3f6d 100644 --- a/src/menu/actioncomponent/index.jsx +++ b/src/menu/actioncomponent/index.jsx @@ -177,31 +177,7 @@ <p>{this.state.dict['model.tooltip.func.outface']}</p> </div> - let menulist = [] - - if (menu.fstMenuList) { - let trees = fromJS(menu.fstMenuList).toJS() - - menulist = trees.map(fst => { - fst.value = fst.MenuID - fst.label = fst.MenuName - fst.isLeaf = false - fst.children = fst.children.map(snd => { - snd.value = snd.MenuID - snd.label = snd.MenuName - - snd.children = snd.children.map(thd => { - thd.value = thd.MenuID - thd.label = thd.MenuName - thd.disabled = thd.MenuID === menu.MenuID - return thd - }) - return snd - }) - return fst - }) - } - + let menulist = menu.fstMenuList ? menu.fstMenuList : [] let modules = this.getModules(menu.components, config.uuid) this.setState({ diff --git a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx index ccb8b2b..c9d6fc6 100644 --- a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx @@ -8,6 +8,82 @@ * @param {object} card // 鍥捐〃瀵硅薄 * @param {Array} columns // 鏄剧ず鍒� */ +export function getBaseForm (card, MenuType, fstMenuList = []) { + let roleList = sessionStorage.getItem('sysRoles') + if (roleList) { + try { + roleList = JSON.parse(roleList) + } catch { + roleList = [] + } + } else { + roleList = [] + } + + return [ + { + type: 'text', + key: 'title', + label: '鏍囬', + initVal: card.title, + required: false + }, + { + type: 'text', + key: 'name', + label: '缁勪欢鍚嶇О', + initVal: card.name, + tooltip: '鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�', + required: true + }, + { + type: 'number', + key: 'width', + label: '瀹藉害', + initVal: card.width, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + min: 1, + max: 24, + decimal: 0, + required: true + }, + { + type: 'number', + key: 'height', + label: '楂樺害', + initVal: card.height, + min: 100, + max: 1000, + decimal: 0, + required: true + }, + { + type: 'select', + key: 'blacklist', + label: '榛戝悕鍗�', + initVal: card.blacklist || [], + multi: true, + required: false, + forbid: MenuType === 'billPrint', + options: roleList + }, + { + type: 'cascader', + key: 'linkmenu', + label: '鍏宠仈鑿滃崟', + initVal: card.linkmenu || [], + tooltip: '鍙屽嚮楗煎浘锛屼細鎵撳紑鍏宠仈鐨勮彍鍗曘��', + required: false, + forbid: MenuType === 'billPrint', + options: fstMenuList + } + ] +} +/** + * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟 + * @param {object} card // 鍥捐〃瀵硅薄 + * @param {Array} columns // 鏄剧ず鍒� + */ export function getOptionForm (card, columns) { let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype)) let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype)) diff --git a/src/menu/components/chart/antv-pie/chartcompile/index.jsx b/src/menu/components/chart/antv-pie/chartcompile/index.jsx index e54f4a5..7678833 100644 --- a/src/menu/components/chart/antv-pie/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-pie/chartcompile/index.jsx @@ -4,8 +4,7 @@ import { Modal, Form, Row, Col, Select, Icon, Radio, Tooltip, Input, InputNumber, Tabs, Button } from 'antd' import Utils from '@/utils/utils.js' -import { getOptionForm } from './formconfig' -import { getBaseForm } from '../../antv-bar/chartcompile/formconfig' +import { getBaseForm, getOptionForm } from './formconfig' import asyncComponent from '@/utils/asyncComponent' import ColorSketch from '@/mob/colorsketch' import './index.scss' @@ -17,7 +16,7 @@ class LineChartDrawerForm extends Component { static propTpyes = { - MenuType: PropTypes.any, + menu: PropTypes.any, dict: PropTypes.object, plot: PropTypes.object, config: PropTypes.object, @@ -52,13 +51,13 @@ } showDrawer = () => { - const { config, MenuType } = this.props + const { config, menu } = this.props this.setState({ visible: true, view: 'normal', plot: fromJS(config.plot).toJS(), - baseFormlist: getBaseForm(config.plot, MenuType), + baseFormlist: getBaseForm(config.plot, menu.MenuType, menu.fstMenuList), formlist: getOptionForm(config.plot, config.columns) }) } diff --git a/src/menu/components/chart/antv-pie/index.jsx b/src/menu/components/chart/antv-pie/index.jsx index e65d64a..496f25d 100644 --- a/src/menu/components/chart/antv-pie/index.jsx +++ b/src/menu/components/chart/antv-pie/index.jsx @@ -426,7 +426,7 @@ <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> {menu && menu.MenuType !== 'billPrint' ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle" /> : null} - {menu ? <ChartCompileForm config={card} MenuType={menu.MenuType} dict={this.state.dict} plotchange={this.updateComponent}/> : null} + <ChartCompileForm config={card} menu={menu} dict={this.state.dict} plotchange={this.updateComponent}/> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> <Icon className="close" title="delete" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> <SettingComponent config={card} updateConfig={this.updateComponent}/> diff --git a/src/menu/components/share/normalform/index.jsx b/src/menu/components/share/normalform/index.jsx index 0a52226..eec77c9 100644 --- a/src/menu/components/share/normalform/index.jsx +++ b/src/menu/components/share/normalform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Radio } from 'antd' +import { Form, Row, Col, Input, Tooltip, Icon, InputNumber, Select, Radio, Cascader } from 'antd' import './index.scss' @@ -104,8 +104,8 @@ })( <Select mode={item.multi ? 'multiple' : ''}> {item.options.map((option, index) => - <Select.Option key={index} value={option.field}> - {option.label} + <Select.Option key={index} value={option.field || option.value}> + {option.label || option.text} </Select.Option> )} </Select> @@ -142,6 +142,29 @@ </Form.Item> </Col> ) + } else if (item.type === 'cascader') { + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" title={item.tooltip}> + <Icon type="question-circle" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: item.initVal || [], + rules: [ + { + required: !!item.required, + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <Cascader options={item.options} placeholder=""/> + )} + </Form.Item> + </Col> + ) } }) return fields diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index 4f408e0..bf244ea 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -38,29 +38,6 @@ const { card } = this.props if (card.isNew) { - let subcards = null - - if (card.config) { - subcards = JSON.parse(card.config) - subcards = subcards.map(scard => { - scard.uuid = Utils.getuuid() - scard.elements = scard.elements.map(elem => { - elem.uuid = Utils.getuuid() - return elem - }) - return scard - }) - } else { - subcards = [{ - uuid: Utils.getuuid(), - setting: { width: 24, type: 'simple'}, - style: { - paddingTop: '5px', paddingBottom: '5px', paddingLeft: '15px', paddingRight: '15px', - }, - elements: [] - }] - } - let _card = { uuid: card.uuid, type: card.type, @@ -80,8 +57,7 @@ style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, headerStyle: { fontSize: '16px' }, columns: [], - scripts: [], - subcards: subcards + scripts: [] } this.setState({ @@ -127,34 +103,17 @@ this.props.updateConfig(component) } - /** - * @description 鍗曚釜鍗$墖淇℃伅鏇存柊 - */ - updateCard = (cell) => { - let card = fromJS(this.state.card).toJS() - - card.subcards = card.subcards.map(item => { - if (item.uuid === cell.uuid) return cell - return item - }) - - this.setState({card}) - - this.props.updateConfig(card) - } /** * @description 鍗曚釜鍗$墖淇℃伅鏇存柊 */ - deleteCard = (cell) => { + deleteCard = () => { let card = fromJS(this.state.card).toJS() let _this = this confirm({ content: '纭畾鍒犻櫎鍗$墖鍚楋紵', onOk() { - card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) - _this.setState({card}) _this.props.updateConfig(card) }, @@ -198,25 +157,14 @@ addCard = () => { let card = fromJS(this.state.card).toJS() - let newcard = { - uuid: Utils.getuuid(), - setting: { width: 6, type: 'simple'}, - style: { - paddingTop: '5px', paddingBottom: '5px', paddingLeft: '15px', paddingRight: '15px', - }, - elements: [] - } - - if (card.subcards.length > 0) { - newcard = fromJS(card.subcards[card.subcards.length - 1]).toJS() - newcard.uuid = Utils.getuuid() - newcard.elements = newcard.elements.map(elem => { - elem.uuid = Utils.getuuid() - return elem - }) - } - - card.subcards.push(newcard) + // let newcard = { + // uuid: Utils.getuuid(), + // setting: { width: 6, type: 'simple'}, + // style: { + // paddingTop: '5px', paddingBottom: '5px', paddingLeft: '15px', paddingRight: '15px', + // }, + // elements: [] + // } this.setState({card}) this.props.updateConfig(card) @@ -257,20 +205,7 @@ return ( <div className="menu-normal-table-edit-box" style={{...card.style, height: card.wrap.height}}> - <SearchComponent - config={card} - updatesearch={this.updatesearch} - /> - <div className="table-header" style={card.headerStyle}> - <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ - <div className="mk-popover-control"> - <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeTitleStyle} type="font-colors" /> - </div> - } trigger="hover"> - <span className="table-title">{card.wrap.title || ''}</span> - </Popover> - {/* <SearchComponent config={card} updatesearch={this.updateComponent}/> */} - </div> + <SearchComponent config={card} updatesearch={this.updatesearch}/> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> <Icon className="plus" title="娣诲姞鍗$墖" onClick={this.addCard} type="plus" /> diff --git a/src/store/reducer.js b/src/store/reducer.js index 16613ce..1349b8f 100644 --- a/src/store/reducer.js +++ b/src/store/reducer.js @@ -27,7 +27,7 @@ editLevel: null, // 缂栬緫鑿滃崟绾у埆锛屽�间负level1銆乴evel2銆乴evel3銆丠S permRoles: [], // 鐢ㄦ埛瑙掕壊鍒楄〃 permAction: {}, // 鐢ㄦ埛鎸夐挳鏉冮檺 - permMenus: {}, // 鐢ㄦ埛涓夌骇鑿滃崟鏉冮檺 + permMenus: [], // 鐢ㄦ埛涓夌骇鑿滃崟鍒楄〃 dataManager: false, // 鏁版嵁绠$悊鍛� memberLevel: _level, // 浼氬憳绛夌骇 customMenu: null // 缂栬緫涓殑鑿滃崟锛堣嚜瀹氫箟椤甸潰锛� @@ -145,7 +145,7 @@ editState: false, editLevel: null, permAction: {}, - permMenus: {}, + permMenus: [], customMenu: null } default: diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 0541d72..5f3e6cb 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -318,8 +318,11 @@ // 鐢熸垚鏄剧ず鍒楋紝澶勭悊鍚堝苟鍒椾腑鐨勫瓧娈� config.columns.forEach((col, index) => { if (_hideCol.includes(col.uuid)) return - - if (col.linkThdMenu && !permMenus[col.linkThdMenu.MenuID]) { + + if (col.linkmenu && col.linkmenu.length > 0) { + let menu_id = col.linkmenu[col.linkmenu.length - 1] + col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' + } else { col.linkThdMenu = '' } diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 4f7ce11..2cedfda 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -2,17 +2,19 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Chart } from '@antv/g2' +import { connect } from 'react-redux' import DataSet from '@antv/data-set' import { Spin, Empty, notification } from 'antd' // import searchLine from '../../share/searchLine' import Api from '@/api' import Utils from '@/utils/utils.js' +import { modifyTabview } from '@/store/action' import { chartColors } from '@/utils/option.js' import UtilsDM from '@/utils/utils-datamanage.js' import './index.scss' -class LineChart extends Component { +class PieChart extends Component { static propTpyes = { BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 @@ -329,18 +331,14 @@ chart.legend(X_axis, { position: plot.legend, itemName: { - style: { - fill: color, - } + style: { fill: color } } }) } else { chart.legend({ position: plot.legend, itemName: { - style: { - fill: color, - } + style: { fill: color } } }) } @@ -476,6 +474,55 @@ }) } } + + if (plot.linkmenu && plot.linkmenu.length > 0) { + let menu_id = plot.linkmenu[plot.linkmenu.length - 1] + let menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' + + chart.on('element:dblclick', (ev) => { + if (!menu) { + notification.warning({ + top: 92, + message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�', + duration: 5 + }) + return + } + + try { + let data = ev.data.data + let primaryId = '' + if (this.state.config.setting.primaryKey && data) { + primaryId = data[this.state.config.setting.primaryKey] || '' + } + + let newtab = { + ...menu, + selected: true, + param: { + BID: primaryId, + data: data + } + } + + let tabs = this.props.tabviews.filter(tab => { + tab.selected = false + return tab.MenuID !== newtab.MenuID + }) + + if (this.props.tabviews.length !== tabs.length) { + this.props.modifyTabview(fromJS(tabs).toJS()) + } + + this.setState({}, () => { + tabs.push(newtab) + this.props.modifyTabview(tabs) + }) + } catch { + console.warn('鑿滃崟鎵撳紑澶辫触锛�') + } + }) + } chart.render() } @@ -504,4 +551,18 @@ } } -export default LineChart \ No newline at end of file + +const mapStateToProps = (state) => { + return { + tabviews: state.tabviews, + permMenus: state.permMenus, + } +} + +const mapDispatchToProps = (dispatch) => { + return { + modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) + } +} + +export default connect(mapStateToProps, mapDispatchToProps)(PieChart) \ No newline at end of file diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index f59e1da..0f73c96 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -247,7 +247,10 @@ config.columns.forEach((col, index) => { if (_hideCol.includes(col.uuid)) return - if (col.linkThdMenu && !permMenus[col.linkThdMenu.MenuID]) { + if (col.linkmenu && col.linkmenu.length > 0) { + let menu_id = col.linkmenu[col.linkmenu.length - 1] + col.linkThdMenu = permMenus.filter(m => m.MenuID === menu_id)[0] || '' + } else { col.linkThdMenu = '' } diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 9d8409f..7c85792 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -114,11 +114,34 @@ config = UtilsUpdate.updateSubTable(config) // 浠呮敮鎸乪xec銆乸rompt銆乸op 涓夌绫诲瀷鎸夐挳 + let labels = [] if (type === 'calendar') { - config.action = config.action.filter(item => ['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType)) + config.action = config.action.filter(item => { + if (['exec', 'prompt', 'pop', 'tab', 'excelIn', 'excelOut'].includes(item.OpenType)) return true + + labels.push(item.label) + + return false + }) + } else { - config.action = config.action.filter(item => ['exec', 'prompt', 'pop'].includes(item.OpenType)) + config.action = config.action.filter(item => { + if (['exec', 'prompt', 'pop'].includes(item.OpenType)) return true + + labels.push(item.label) + + return false + }) } + + if (window.GLOB.systemType !== 'production' && labels.length > 0) { + notification.warning({ + top: 92, + message: `涓嶆敮鎸佹寜閽紙${labels.join('銆�')}锛夌殑鎵撳紑鏂瑰紡锛乣, + duration: 5 + }) + } + // 鏉冮檺杩囨护 if (this.props.menuType !== 'HS') { @@ -200,9 +223,7 @@ config.columns.forEach(col => { if (_hideCol.includes(col.uuid)) return - if (col.linkThdMenu) { - col.linkThdMenu = '' - } + col.linkThdMenu = '' // 寮圭獥涓笉鍙娇鐢ㄥ瓧娈甸�忚 if (col.type === 'colspan' && col.sublist) { let _col = JSON.parse(JSON.stringify(col)) diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index 389be69..26220ab 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -97,20 +97,24 @@ } } } else if (btn.tabTemplate === 'ThdMenu') { - let _type = 'CommonTable' - if (btn.linkThdMenu && btn.linkThdMenu.PageParam) { - try { - _type = JSON.parse(btn.linkThdMenu.PageParam).Template - } catch { - _type = 'CommonTable' - } + let menu = null + + if (btn.linkmenu && btn.linkmenu.length > 0) { + let menu_id = btn.linkmenu[btn.linkmenu.length - 1] + menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' + } + + if (!menu) { + notification.warning({ + top: 92, + message: '鑿滃崟宸插垹闄ゆ垨娌℃湁璁块棶鏉冮檺锛�', + duration: 5 + }) + return } newtab = { - MenuNo: btn.linkThdMenu.MenuNo, - MenuID: btn.linkThdMenu.MenuID, - MenuName: btn.linkThdMenu.MenuName, - type: _type, + ...menu, selected: true, param: { BID: primaryId, @@ -174,6 +178,7 @@ const mapStateToProps = (state) => { return { tabviews: state.tabviews, + permMenus: state.permMenus, } } diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 1de6ca6..bfe9cc6 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -214,23 +214,7 @@ if (item.linkThdMenu) { let tabmenu = item.linkThdMenu - let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt'] - - if (tabmenu.LinkUrl === 'CommonTable') { - tabmenu.type = 'CommonTable' - } else if (tabmenu.LinkUrl && iframes.includes(tabmenu.LinkUrl.split('?')[0])) { - tabmenu.type = 'iframe' - } - - if (tabmenu.type !== 'iframe') { - try { - tabmenu.PageParam = JSON.parse(tabmenu.PageParam) - } catch (e) { - tabmenu.PageParam = {} - } - tabmenu.type = tabmenu.PageParam.Template || tabmenu.type - } - + tabmenu.param = { searchkey: item.field, searchval: record[item.field] || '', diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx index 6d94404..d934b69 100644 --- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx @@ -76,7 +76,6 @@ UNSAFE_componentWillMount () { const { card } = this.props - let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' let _opentype = card.OpenType // 鎵撳紑鏂瑰紡 let _tabType = card.tabType || 'SubTable' // 鎸夐挳涓哄脊绐楋紙鏍囩锛夋椂锛屾爣绛剧殑绫诲瀷 let _intertype = card.intertype || 'system' // 鎺ュ彛绫诲瀷 @@ -99,7 +98,6 @@ this.setState({ openType: _opentype, pageTemplate: _pageTemplate, - menulist: _menulist.options || [], interType: _intertype, position: card.position || 'toolbar', funcType: _funcType, @@ -627,7 +625,7 @@ } ] })( - <Cascader options={this.state.menulist} placeholder="" /> + <Cascader options={item.options || []} placeholder="" /> )} </Form.Item> </Col> @@ -639,7 +637,6 @@ handleConfirm = () => { const { setting } = this.props - const { menulist } = this.state // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { @@ -677,24 +674,6 @@ } } - // 鍏宠仈涓夌骇鑿滃崟 - if (values.OpenType === 'tab' && values.linkmenu && values.linkmenu.length > 0) { - let linkThdMenu = '' - menulist.forEach(menu => { - if (menu.value === values.linkmenu[0]) { - menu.children.forEach(item => { - if (item.value === values.linkmenu[1]) { - item.children.forEach(cell => { - if (cell.value === values.linkmenu[2]) { - linkThdMenu = cell - } - }) - } - }) - } - }) - values.linkThdMenu = linkThdMenu - } resolve(values) } else { reject(err) diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx index a0190f0..c7ccd61 100644 --- a/src/templates/sharecomponent/actioncomponent/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/index.jsx @@ -839,7 +839,7 @@ * @description 鎸夐挳鍙屽嚮瑙﹀彂瀛愰厤缃� */ btnDoubleClick = (element) => { - if (!element.origin && (element.OpenType === 'pop' || element.OpenType === 'popview' || element.OpenType === 'blank' || element.OpenType === 'tab')) { + if (!element.origin && (element.OpenType === 'pop' || element.OpenType === 'popview' || element.OpenType === 'blank')) { this.props.setSubConfig(element) } else { notification.warning({ diff --git a/src/templates/sharecomponent/columncomponent/columnform/index.jsx b/src/templates/sharecomponent/columncomponent/columnform/index.jsx index c7ff675..71f3e5a 100644 --- a/src/templates/sharecomponent/columncomponent/columnform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/columnform/index.jsx @@ -300,31 +300,12 @@ } handleConfirm = () => { - const { menulist } = this.state // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { values.uuid = this.props.card.uuid values.marks = this.props.card.marks || '' - - if ((values.type === 'text' || values.type === 'number') && values.linkmenu && values.linkmenu.length > 0) { - let linkThdMenu = '' - menulist.forEach(menu => { - if (menu.value === values.linkmenu[0]) { - menu.children.forEach(item => { - if (item.value === values.linkmenu[1]) { - item.children.forEach(cell => { - if (cell.value === values.linkmenu[2]) { - linkThdMenu = cell - } - }) - } - }) - } - }) - values.linkThdMenu = linkThdMenu - } resolve(values) } else { diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index a5e680a..eb3f3da 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -751,10 +751,6 @@ duration: 5 }) } else { - this.setState({ - loading: true - }) - // 瀛愯彍鍗曚俊鎭獙璇侀�氳繃鍚庯紝璺宠浆瀛愭寜閽厤缃〉闈� let _view = '' let _subtab = editSubTab @@ -764,6 +760,15 @@ } else if (btn.OpenType === 'popview') { _view = btn.tabType // 鏂板脊绐楁爣绛炬ā鏉� _subtab = btn + + if (editSubTab) { + notification.warning({ + top: 92, + message: '寮圭獥(鏍囩)涓笉鏀寔姝ゆ寜閽墦寮�鏂瑰紡锛�', + duration: 5 + }) + return + } } if (editSubTab) { @@ -786,6 +791,10 @@ subConfig: '', tabview: _view } + + this.setState({ + loading: true + }) Api.getSystemConfig({ func: 'sPC_Get_LongParam', @@ -1001,7 +1010,7 @@ render () { const { activeKey, config, chartview } = this.state - const confActions = config.action.filter(_action => !_action.origin && ['pop', 'popview', 'blank', 'tab'].includes(_action.OpenType)) + const confActions = config.action.filter(_action => !_action.origin && ['pop', 'popview', 'blank'].includes(_action.OpenType)) return ( <div className="model-subtable-board"> diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx index 8944632..a1d10bf 100644 --- a/src/views/menudesign/menuform/index.jsx +++ b/src/views/menudesign/menuform/index.jsx @@ -40,6 +40,9 @@ let fstItem = { MenuID: fst.MenuID, MenuName: fst.MenuName, + value: fst.MenuID, + label: fst.MenuName, + isLeaf: false, children: [] } @@ -49,6 +52,8 @@ ParentId: fst.MenuID, MenuID: snd.MenuID, MenuName: snd.MenuName, + value: snd.MenuID, + label: snd.MenuName, children: [] } @@ -60,7 +65,10 @@ MenuID: trd.MenuID, MenuName: trd.MenuName, MenuNo: trd.MenuNo, - EasyCode: trd.EasyCode + EasyCode: trd.EasyCode, + value: trd.MenuID, + label: trd.MenuName, + disabled: trd.MenuID === MenuId } if (MenuId === trd.MenuID) { -- Gitblit v1.8.0