From c1f9e05741e64087ebbfa5e1185bfd0beeb4eeb5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 07 一月 2022 17:50:18 +0800 Subject: [PATCH] 2022-01-07 --- src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx | 5 src/tabviews/custom/components/tree/antd-tree/index.jsx | 43 +++++++- src/tabviews/zshare/actionList/popupbutton/index.jsx | 9 + src/tabviews/zshare/normalTable/index.jsx | 4 src/menu/components/card/cardcellcomponent/index.scss | 2 src/menu/components/card/cardcellcomponent/dragaction/action.jsx | 3 src/menu/components/card/cardcellcomponent/elementform/index.jsx | 8 src/tabviews/zshare/actionList/excelInbutton/index.jsx | 9 + src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 11 + src/locales/zh-CN/model.js | 1 src/locales/en-US/model.js | 1 src/tabviews/custom/components/share/normalTable/index.jsx | 2 src/tabviews/zshare/actionList/newpagebutton/index.jsx | 9 + src/tabviews/subtable/index.jsx | 2 src/tabviews/subtabtable/index.jsx | 2 src/menu/stylecombcontroller/index.jsx | 16 --- src/tabviews/commontable/index.jsx | 2 src/tabviews/zshare/actionList/normalbutton/index.jsx | 9 + src/menu/components/table/edit-table/index.jsx | 15 +++ src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 2 src/tabviews/zshare/actionList/changeuserbutton/index.jsx | 9 + src/views/menudesign/index.jsx | 7 + src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 5 src/tabviews/custom/components/card/cardcellList/index.jsx | 28 +++- src/tabviews/zshare/actionList/tabbutton/index.jsx | 9 + src/menu/components/card/cardcellcomponent/index.jsx | 10 + src/menu/stylecontroller/index.jsx | 10 +- src/views/pcdesign/index.jsx | 7 + src/templates/zshare/formconfig.jsx | 2 src/tabviews/custom/components/table/normal-table/index.jsx | 4 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 2 src/tabviews/zshare/actionList/printbutton/index.jsx | 9 + src/menu/components/card/cardcellcomponent/formconfig.jsx | 1 src/tabviews/custom/index.jsx | 12 +- src/menu/components/table/normal-table/index.jsx | 28 +++++ 35 files changed, 229 insertions(+), 69 deletions(-) diff --git a/src/locales/en-US/model.js b/src/locales/en-US/model.js index 721ed17..4421fbf 100644 --- a/src/locales/en-US/model.js +++ b/src/locales/en-US/model.js @@ -108,7 +108,6 @@ 'header.form.initval': 'Initial Value', 'header.form.decimal': '灏忔暟浣�', 'header.form.format': '鏍煎紡鍖�', - 'header.form.thdSeparator': '鍗冨垎浣�', 'header.form.prefix': '鍓嶇紑', 'header.form.postfix': '鍚庣紑', 'header.form.isRequired': '琛岃缃�', diff --git a/src/locales/zh-CN/model.js b/src/locales/zh-CN/model.js index ce68156..0cc3079 100644 --- a/src/locales/zh-CN/model.js +++ b/src/locales/zh-CN/model.js @@ -108,7 +108,6 @@ 'header.form.initval': '鍒濆鍊�', 'header.form.decimal': '灏忔暟浣�', 'header.form.format': '鏍煎紡鍖�', - 'header.form.thdSeparator': '鍗冨垎浣�', 'header.form.prefix': '鍓嶇紑', 'header.form.postfix': '鍚庣紑', 'header.form.isRequired': '琛岃缃�', diff --git a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx index 346ad40..364400e 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx @@ -40,6 +40,7 @@ let btnElement = null let _style = resetStyle(card.style) + if (card.OpenType === 'form') { if (card.formType === 'switch') { btnElement = (<Switch style={_style} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>) @@ -65,7 +66,7 @@ </div> } trigger="hover"> <div ref={node => drag(drop(node))} className={'ant-col card-button-cell ant-col-' + card.width} onDoubleClick={(e) => {e.stopPropagation(); doubleClickCard(id)}}> - <div style={{opacity: isDragging ? 0 : 1}}> + <div style={{opacity: isDragging ? 0 : 1, ...card.wrapStyle}}> {btnElement} </div> </div> diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index d547367..5a4fad8 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -79,9 +79,9 @@ item.label = '鍊�' } else if (item.key === 'format') { if (card.eleType === 'text') { - item.options = item.oriOptions.filter(op => op.value !== 'percent' && op.value !== 'thdSeparator') + item.options = item.oriOptions.filter(op => !['percent', 'thdSeparator', 'abs'].includes(op.value)) } else if (card.eleType === 'number') { - item.options = item.oriOptions.filter(op => !op.value || op.value === 'percent' || op.value === 'thdSeparator') + item.options = item.oriOptions.filter(op => !op.value || ['percent', 'thdSeparator', 'abs'].includes(op.value)) } } else if (item.key === 'url') { item.required = card.eleType !== 'qrcode' @@ -173,9 +173,9 @@ } } else if (item.key === 'format') { if (value === 'text') { - item.options = item.oriOptions.filter(op => op.value !== 'percent' && op.value !== 'thdSeparator') + item.options = item.oriOptions.filter(op => !['percent', 'thdSeparator', 'abs'].includes(op.value)) } else if (value === 'number') { - item.options = item.oriOptions.filter(op => !op.value || op.value === 'percent' || op.value === 'thdSeparator') + item.options = item.oriOptions.filter(op => !op.value || ['percent', 'thdSeparator', 'abs'].includes(op.value)) } } else if (item.key === 'url') { item.required = value !== 'qrcode' diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 8ff1383..c101166 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -136,6 +136,7 @@ { value: '', text: '鏃�' }, { value: 'percent', text: '鐧惧垎鏁�' }, { value: 'thdSeparator', text: '鍗冨垎浣�' }, + { value: 'abs', text: '缁濆鍊�' }, { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' }, { value: 'MM鏈圖D鏃�', text: 'MM鏈圖D鏃�' }, { value: 'YYYY骞碝M鏈圖D鏃�', text: 'YYYY骞碝M鏈圖D鏃�' }, diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 8239471..0b6e36c 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -150,6 +150,9 @@ } else { options.push('width', 'float') } + if (element.wrapStyle) { + _style.float = element.wrapStyle.textAlign || 'left' + } } else if (element.eleType === 'picture') { options = ['border', 'margin'] } else if (element.eleType === 'slider') { @@ -233,7 +236,12 @@ _card.innerHeight = _card.barHeight + (_card.displayValue === 'true' ? fontSize + 2 : 0) } else if (_card.eleType === 'button') { // 鎷嗗垎style - _card.style = style + _card.style = fromJS(style).toJS() + + if (style.float) { + _card.wrapStyle = {textAlign: style.float} + delete _card.style.float + } } else { _card.style = style } diff --git a/src/menu/components/card/cardcellcomponent/index.scss b/src/menu/components/card/cardcellcomponent/index.scss index 5478f4a..e394fe5 100644 --- a/src/menu/components/card/cardcellcomponent/index.scss +++ b/src/menu/components/card/cardcellcomponent/index.scss @@ -25,6 +25,6 @@ } } .card-cell:hover, .card-button-cell:hover { - box-shadow: 0px 0px 1px #1890ff; + box-shadow: 0px 0px 2px #1890ff; } } diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index 77e5d53..dc695ac 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -252,10 +252,13 @@ text: Formdict['model.empty'] }, { value: 'thdSeparator', - text: Formdict['header.form.thdSeparator'] + text: '鍗冨垎浣�' }, { value: 'percent', text: '鐧惧垎姣�' + }, { + value: 'abs', + text: '缁濆鍊�' }], required: false }, diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx index 02340f4..5ac87be 100644 --- a/src/menu/components/table/edit-table/index.jsx +++ b/src/menu/components/table/edit-table/index.jsx @@ -133,6 +133,7 @@ componentDidMount () { MKEmitter.addListener('submitStyle', this.getStyle) MKEmitter.addListener('submitModal', this.handleSave) + MKEmitter.addListener('completeSave', this.completeSave) } shouldComponentUpdate (nextProps, nextState) { @@ -148,6 +149,20 @@ } MKEmitter.removeListener('submitStyle', this.getStyle) MKEmitter.removeListener('submitModal', this.handleSave) + MKEmitter.removeListener('completeSave', this.completeSave) + } + + completeSave = () => { + const { card } = this.state + + if (card.isNew) { + let item = fromJS(card).toJS() + item.cols = item.cols.filter(a => !a.origin) + + delete item.isNew + + this.setState({card: item}) + } } filterOrigin = (component) => { diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx index dc56d65..b861cf1 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx @@ -230,10 +230,13 @@ text: Formdict['model.empty'] }, { value: 'thdSeparator', - text: Formdict['header.form.thdSeparator'] + text: '鍗冨垎浣�' }, { value: 'percent', text: '鐧惧垎姣�' + }, { + value: 'abs', + text: '缁濆鍊�' }], required: false }, diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index f57cc32..17a55c8 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -151,6 +151,7 @@ MKEmitter.addListener('submitStyle', this.getStyle) MKEmitter.addListener('submitModal', this.handleSave) MKEmitter.addListener('logButton', this.logButton) + MKEmitter.addListener('completeSave', this.completeSave) } shouldComponentUpdate (nextProps, nextState) { @@ -167,6 +168,22 @@ MKEmitter.removeListener('submitStyle', this.getStyle) MKEmitter.removeListener('submitModal', this.handleSave) MKEmitter.removeListener('logButton', this.logButton) + MKEmitter.removeListener('completeSave', this.completeSave) + } + + completeSave = () => { + const { card } = this.state + + if (card.isNew) { + let item = fromJS(card).toJS() + item.search = item.search.filter(a => !a.origin) + item.action = item.action.filter(a => !a.origin) + item.cols = item.cols.filter(a => !a.origin) + + delete item.isNew + + this.setState({card: item}, () => { MKEmitter.emit('revert') }) + } } loopCol = (col) => { @@ -387,9 +404,16 @@ } getWrapForms = () => { - const { wrap, action, columns } = this.state.card + const { wrap, action, columns, cols } = this.state.card - return getWrapForm(wrap, action, columns) + let _actions = [...action] + + cols.forEach(col => { + if (col.type !== 'action') return + _actions.push(...col.elements) + }) + + return getWrapForm(wrap, _actions, columns) } updateWrap = (res) => { diff --git a/src/menu/stylecombcontroller/index.jsx b/src/menu/stylecombcontroller/index.jsx index e9b5f91..c26c17d 100644 --- a/src/menu/stylecombcontroller/index.jsx +++ b/src/menu/stylecombcontroller/index.jsx @@ -27,7 +27,6 @@ ArrowDownOutlined, ArrowLeftOutlined, ArrowRightOutlined, - SwapOutlined, } from '@ant-design/icons' import MKEmitter from '@/utils/events.js' @@ -558,21 +557,6 @@ labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > <StyleInput defaultValue={''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingRight')}/> - </Form.Item> - </Col> - </Panel> : null} - {options.includes('float') ? <Panel header="娴姩" key="float"> - <Col span={24}> - <Form.Item - colon={false} - label={<SwapOutlined title="娴姩"/>} - labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } - > - <Radio.Group defaultValue={''} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> - <Radio value="left">宸︽诞鍔�</Radio> - <Radio value="right">鍙虫诞鍔�</Radio> - <Radio value="none">涓嶆诞鍔�</Radio> - </Radio.Group> </Form.Item> </Col> </Panel> : null} diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index f3e7bef..35a78aa 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -780,17 +780,17 @@ </Form.Item> </Col> </Panel> : null} - {options.includes('float') ? <Panel header="娴姩" key="float"> + {options.includes('float') ? <Panel header="瀵归綈鏂瑰紡" key="float"> <Col span={24}> <Form.Item colon={false} - label={<SwapOutlined title="娴姩"/>} + label={<SwapOutlined title="瀵归綈"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.float || 'left'} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> - <Radio value="left">宸︽诞鍔�</Radio> - <Radio value="right">鍙虫诞鍔�</Radio> - <Radio value="none">涓嶆诞鍔�</Radio> + <Radio value="left">宸�</Radio> + <Radio value="center">灞呬腑</Radio> + <Radio value="right">鍙�</Radio> </Radio.Group> </Form.Item> </Col> diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 7a8fb75..c11195d 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -740,6 +740,7 @@ item.key = index item.$$uuid = item[setting.primaryKey] || '' + item.$$key = '' + item.key + item.$$uuid item.$$BID = BID || '' item.$Index = start + index + '' @@ -813,6 +814,7 @@ data = data.map(item => { if (item.$$uuid === _data.$$uuid) { _data.key = item.key + _data.$$key = '' + item.key + item.$$uuid _data.$Index = item.$Index return _data } else { diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index e3da235..5608b31 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -328,9 +328,11 @@ val = data[card.field] } - if (val !== '' && typeof(val) === 'number') { + if (typeof(val) === 'number') { if (card.format === 'percent') { val = val * 100 + } else if (card.format === 'abs') { + val = Math.abs(val) } if (card.col && card.col.type === 'number') { @@ -667,11 +669,12 @@ if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { return ( - <Col key={card.uuid} className="mk-cell-btn" span={card.width}> + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> <NormalButton BID={data.$$BID} BData={data.$$BData || ''} disabled={data.$disabled} + lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} @@ -683,11 +686,12 @@ ) } else if (card.OpenType === 'excelIn') { return ( - <Col key={card.uuid} className="mk-cell-btn" span={card.width}> + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> <ExcelInButton BID={data.$$BID} BData={data.$$BData || ''} disabled={data.$disabled} + lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} @@ -698,10 +702,11 @@ ) } else if (card.OpenType === 'excelOut') { return ( - <Col key={card.uuid} className="mk-cell-btn" span={card.width}> + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> <ExcelOutButton BID={data.$$BID} BData={data.$$BData || ''} + lineId={data.$$key || ''} disabled={data.$disabled} btn={card} show={card.show} @@ -712,11 +717,12 @@ ) } else if (card.OpenType === 'popview') { return ( - <Col key={card.uuid} className="mk-cell-btn" span={card.width}> + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> <PopupButton BID={data.$$BID} BData={data.$$BData || ''} disabled={data.$disabled} + lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} @@ -727,10 +733,11 @@ ) } else if (card.OpenType === 'tab') { return ( - <Col key={card.uuid} className="mk-cell-btn" span={card.width}> + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> <TabButton BData={data.$$BData || ''} disabled={data.$disabled} + lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} @@ -741,10 +748,11 @@ ) } else if (card.OpenType === 'innerpage') { return ( - <Col key={card.uuid} className="mk-cell-btn" span={card.width}> + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> <NewPageButton BData={data.$$BData || ''} disabled={data.$disabled} + lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} @@ -756,11 +764,12 @@ } else if (card.OpenType === 'funcbutton') { if (card.funcType === 'changeuser' || card.funcType === 'closetab') { return ( - <Col key={card.uuid} className="mk-cell-btn" span={card.width}> + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> <ChangeUserButton BID={data.$$BID} BData={data.$$BData || ''} disabled={data.$disabled} + lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} @@ -771,11 +780,12 @@ ) } else if (card.funcType === 'print') { return ( - <Col key={card.uuid} className="mk-cell-btn" span={card.width}> + <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> <PrintButton BID={data.$$BID} BData={data.$$BData || ''} disabled={data.$disabled} + lineId={data.$$key || ''} btn={card} show={card.show} style={card.style} diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 6ff2056..4a50717 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -175,6 +175,8 @@ if (col.format === 'percent') { content = content * 100 decimal = decimal > 2 ? decimal - 2 : 0 + } else if (col.format === 'abs') { + content = Math.abs(content) } content = content.toFixed(decimal) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 21c8d6d..1464bfa 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -267,6 +267,8 @@ if (col.format === 'percent') { content = content * 100 decimal = decimal > 2 ? decimal - 2 : 0 + } else if (col.format === 'abs') { + content = Math.abs(content) } content = content.toFixed(decimal) diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index 1d24d3d..72585ec 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -85,6 +85,7 @@ _data = _data.map((item, index) => { item.key = index item.$$uuid = item[_config.setting.primaryKey] || '' + item.$$key = '' + item.key + item.$$uuid item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = index + 1 + '' @@ -234,6 +235,7 @@ data: result.data.map((item, index) => { item.key = index item.$$uuid = item[setting.primaryKey] || '' + item.$$key = '' + item.key + item.$$uuid item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = start + index + '' @@ -299,6 +301,7 @@ data = data.map(item => { if (item.$$uuid === _data.$$uuid) { _data.key = item.key + _data.$$key = '' + item.key + item.$$uuid _data.$Index = item.$Index return _data } else { @@ -559,6 +562,7 @@ _data = _data.map((item, index) => { item.key = index item.$$uuid = item[config.setting.primaryKey] || '' + item.$$key = '' + item.key + item.$$uuid item.$$BID = BID || '' item.$$BData = BData || '' item.$Index = index + 1 + '' diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index c711cb6..e9d7bc7 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -34,6 +34,7 @@ treeNodes: null, // 鍒楄〃鏁版嵁闆� expandedKeys: [], // 灞曞紑鐨勬爲鑺傜偣 selectedKeys: [], // 閫変腑鐨勬爲鑺傜偣 + selected: false // 閫変腑棣栬 } UNSAFE_componentWillMount () { @@ -53,6 +54,7 @@ _config.wrap.contentHeight = config.wrap.title || config.wrap.searchable === 'true' ? 'calc(100% - 45px)' : '100%' this.setState({ + selected: _config.wrap.selected === 'true', config: _config, data: _data, BID: BID || '', @@ -60,9 +62,9 @@ sync: _sync }, () => { if (config.setting.sync !== 'true' && config.setting.onload === 'true') { - this.loadData(null, 'init') + this.loadData(null) } else if (config.setting.sync === 'true' && _data) { - this.handleData('init') + this.handleData() } }) } @@ -80,7 +82,7 @@ } this.setState({sync: false, data: _data}, () => { - this.handleData('init') + this.handleData() }) } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { this.setState({}, () => { @@ -183,7 +185,7 @@ /** * @description 鏁版嵁鍔犺浇 */ - async loadData (hastimer, type) { + async loadData (hastimer) { const { mainSearch, menuType } = this.props const { config, arr_field, BID } = this.state @@ -218,7 +220,7 @@ data: result.data, loading: false }, () => { - this.handleData(type) + this.handleData() }) } else { this.setState({ @@ -233,24 +235,41 @@ } } - handleData = (type) => { - const { data, searchkey, config } = this.state + handleData = () => { + const { data, searchkey, config, selectedKeys, selected } = this.state if (!data || data.length === 0) { this.setState({ + selectedKeys: [], + expandedKeys: [], treedata: [], treeNodes: [], }) + + MKEmitter.emit('resetSelectLine', config.uuid, '', '') return } let parentNodes = [] let _options = [] let logMap = new Map() + let selectKey = selectedKeys[0] || '' + let selectData = '' + let hasSelectKey = false data.forEach(item => { let pval = item[config.wrap.parentField] let val = item[config.wrap.valueField] if (!val || logMap.has(val)) return + + if (selectKey && selectKey === val) { + hasSelectKey = true + selectData = { + ...item, + $title: item[config.wrap.labelField] || '', + $key: val, + $parentId: '' + } + } logMap.set(val, true) if (pval === config.wrap.mark) { @@ -285,7 +304,7 @@ treeNodes: _treeNodes, }) - if (type === 'init' && _treeNodes[0] && config.wrap.selected === 'true') { + if (selected && !hasSelectKey && _treeNodes[0]) { this.setState({ selectedKeys: [_treeNodes[0].$key] }) @@ -293,6 +312,14 @@ setTimeout(() => { MKEmitter.emit('resetSelectLine', config.uuid, _treeNodes[0].$key, _treeNodes[0]) }, 200) + } else if (!hasSelectKey && selectKey) { + this.setState({ + selectedKeys: [] + }) + + MKEmitter.emit('resetSelectLine', config.uuid, '', '') + } else if (hasSelectKey) { + MKEmitter.emit('resetSelectLine', config.uuid, selectKey, selectData) } } diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 2070009..b7262d9 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -754,12 +754,12 @@ } } - if (item.wrap && item.wrap.doubleClick) { - let index = item.action.findIndex((btn) => btn.uuid === item.wrap.doubleClick) - if (index === -1) { - item.wrap.doubleClick = '' - } - } + // if (item.wrap && item.wrap.doubleClick) { + // let index = item.action.findIndex((btn) => btn.uuid === item.wrap.doubleClick) + // if (index === -1) { + // item.wrap.doubleClick = '' + // } + // } return true }) diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 31c67cd..d872d45 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -638,6 +638,7 @@ } item.key = index item.$$uuid = item[setting.primaryKey] || '' + item.$$key = '' + item.key + item.$$uuid item.$$BID = BID || '' item.$Index = start + index + '' @@ -709,6 +710,7 @@ data = data.map(item => { if (item.$$uuid === _data.$$uuid) { _data.key = item.key + _data.$$key = '' + item.key + item.$$uuid _data.$Index = item.$Index return _data } else { diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 63ebd78..2daa24c 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -578,6 +578,7 @@ } item.key = index item.$$uuid = item[setting.primaryKey] || '' + item.$$key = '' + item.key + item.$$uuid item.$$BID = BID || '' item.$Index = start + index + '' @@ -688,6 +689,7 @@ data = data.map(item => { if (item.$$uuid === _data.$$uuid) { _data.key = item.key + _data.$$key = '' + item.key + item.$$uuid _data.$Index = item.$Index return _data } else { diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx index 4997a05..f04d337 100644 --- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx +++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx @@ -22,6 +22,7 @@ selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� + lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� } state = { @@ -117,7 +118,13 @@ const { setting, selectedData, btn, MenuID } = this.props const { loading, disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return + if (loading || disabled) return + if (triggerId) { + if (btn.uuid !== triggerId) return + if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { + return + } + } if (btn.funcType === 'closetab') { MKEmitter.emit('closeTabView', MenuID || btn.$MenuID) diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index 56d2659..dc4e82e 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -25,6 +25,7 @@ btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� + lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� } state = { @@ -122,7 +123,13 @@ const { setting, Tab, BID, btn, selectedData } = this.props const { loading, disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return + if (loading || disabled) return + if (triggerId) { + if (btn.uuid !== triggerId) return + if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { + return + } + } if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 66b4f90..891cd34 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -25,6 +25,7 @@ setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 updateStatus: PropTypes.func, // 鎸夐挳鐘舵�佹洿鏂� disabled: PropTypes.any, // 琛屾寜閽鐢� + lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� } state = { @@ -116,11 +117,17 @@ /** * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ - actionTrigger = (triggerId) => { + actionTrigger = (triggerId, record) => { const { setting, Tab, BID, btn } = this.props const { loading, disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return + if (loading || disabled) return + if (triggerId) { + if (btn.uuid !== triggerId) return + if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { + return + } + } if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx index dc49137..8914d39 100644 --- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx +++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx @@ -19,6 +19,7 @@ selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� + lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� } state = { @@ -114,7 +115,13 @@ const { setting, btn, selectedData } = this.props const { disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || disabled) return + if (disabled) return + if (triggerId) { + if (btn.uuid !== triggerId) return + if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { + return + } + } if (type === 'linkbtn' && selectedData && selectedData.length === 1) { if (record[0].$Index !== selectedData[0].$Index) { diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index c21546b..4b71efb 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -33,6 +33,7 @@ setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 ContainerId: PropTypes.any, // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒� disabled: PropTypes.any, // 琛屾寜閽鐢� + lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� } state = { @@ -198,7 +199,13 @@ const { Tab, BID, btn, selectedData, setting } = this.props const { loading, disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return + if (loading || disabled) return + if (triggerId) { + if (btn.uuid !== triggerId) return + if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { + return + } + } if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx index 19e2982..f1b9b3b 100644 --- a/src/tabviews/zshare/actionList/popupbutton/index.jsx +++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx @@ -24,6 +24,7 @@ btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� + lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� } state = { @@ -156,7 +157,13 @@ const { setting, Tab, BID, btn, selectedData } = this.props const { loading, disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return + if (loading || disabled) return + if (triggerId) { + if (btn.uuid !== triggerId) return + if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { + return + } + } if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index f48e538..90ae0dd 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -32,6 +32,7 @@ setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 ContainerId: PropTypes.any, // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒� disabled: PropTypes.any, // 琛屾寜閽鐢� + lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� } state = { @@ -148,7 +149,13 @@ const { Tab, BID, btn, selectedData, setting } = this.props const { loading, disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return + if (loading || disabled) return + if (triggerId) { + if (btn.uuid !== triggerId) return + if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { + return + } + } if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { notification.warning({ diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index 94d5724..42774f4 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -19,6 +19,7 @@ selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� + lineId: PropTypes.any, // 琛岀储寮�+涓婚敭鍊硷紝鐢ㄤ簬琛屾寜閽弻鍑� } state = { @@ -114,7 +115,13 @@ const { setting, btn, selectedData } = this.props const { disabled } = this.state - if ((triggerId && btn.uuid !== triggerId) || disabled) return + if (disabled) return + if (triggerId) { + if (btn.uuid !== triggerId) return + if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { + return + } + } if (type === 'linkbtn' && selectedData && selectedData.length === 1) { if (record[0].$Index !== selectedData[0].$Index) { diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 88e69c8..bc497d5 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -726,6 +726,7 @@ btn={btn} BID={record.$$BID} disabled={record.$disabled} + lineId={record.$$key || ''} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} @@ -740,6 +741,7 @@ btn={btn} BID={record.$$BID} disabled={record.$disabled} + lineId={record.$$key || ''} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} @@ -751,6 +753,7 @@ key={btn.uuid} btn={btn} disabled={record.$disabled} + lineId={record.$$key || ''} selectedData={[record]} BData={this.props.BData} MenuID={this.props.MenuID} @@ -763,6 +766,7 @@ key={btn.uuid} btn={btn} disabled={record.$disabled} + lineId={record.$$key || ''} selectedData={[record]} BData={this.props.BData} setting={this.props.setting} diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 2681e29..c2bf0ab 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -246,6 +246,8 @@ _columns = _columns.map(col => { col.required = col.required || 'true' col.type = col.type || 'Nvarchar(50)' + col.import = col.import || 'true' + col.required = col.required || 'true' if (/^Nvarchar/ig.test(col.type)) { col.limit = col.type.match(/\d+/)[0] diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index b8f5a45..dfcd692 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -1624,7 +1624,7 @@ text: Formdict['model.empty'] }, { value: 'thdSeparator', - text: Formdict['header.form.thdSeparator'] + text: '鍗冨垎浣�' }, { value: 'percent', text: '鐧惧垎姣�' diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index e093335..822ab39 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -957,7 +957,12 @@ } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { error = `缁勪欢銆�${item.name}銆嬪熀鏈俊鎭皻鏈缃紒` } else if (item.type === 'table' && item.wrap.doubleClick) { - if (item.action.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { + let _actions = [...item.action] + item.cols.forEach(col => { + if (col.type !== 'action') return + _actions.push(...col.elements) + }) + if (_actions.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { error = `缁勪欢銆�${item.name}銆嬬粦瀹氱殑鍙屽嚮鎸夐挳宸插垹闄わ紒` } } diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index 94cd024..d78d938 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -1502,7 +1502,12 @@ } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { error = `缁勪欢銆�${item.name}銆嬪熀鏈俊鎭皻鏈缃紒` } else if (item.type === 'table' && item.wrap.doubleClick) { - if (item.action.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { + let _actions = [...item.action] + item.cols.forEach(col => { + if (col.type !== 'action') return + _actions.push(...col.elements) + }) + if (_actions.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { error = `缁勪欢銆�${item.name}銆嬬粦瀹氱殑鍙屽嚮鎸夐挳宸插垹闄わ紒` } } -- Gitblit v1.8.0