From 9e716f3bd30820a08757845b592db73363faa48c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 25 四月 2022 14:53:37 +0800 Subject: [PATCH] 2022-04-25 --- src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx | 4 src/menu/components/card/cardcellcomponent/dragaction/index.scss | 21 ++++ src/menu/components/table/normal-table/options.jsx | 1 src/tabviews/zshare/normalTable/index.jsx | 16 ++ src/menu/components/form/formaction/actionform/index.jsx | 2 src/menu/components/card/cardcellcomponent/dragaction/action.jsx | 2 src/api/index.js | 10 + src/tabviews/custom/components/share/normalTable/index.jsx | 25 +++- src/views/billprint/index.jsx | 17 +++ src/tabviews/subtable/index.jsx | 28 +++-- src/tabviews/subtabtable/index.jsx | 24 ++-- src/tabviews/commontable/index.jsx | 22 ++-- src/tabviews/zshare/actionList/normalbutton/index.jsx | 2 src/tabviews/custom/components/card/data-card/index.jsx | 48 +++++--- src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 1 src/index.js | 4 src/menu/components/form/formaction/formconfig.jsx | 2 src/menu/components/card/data-card/options.jsx | 1 src/templates/zshare/formconfig.jsx | 2 src/menu/components/share/actioncomponent/formconfig.jsx | 7 + src/templates/sharecomponent/actioncomponent/actionform/index.jsx | 2 src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 2 src/tabviews/custom/components/table/normal-table/index.jsx | 21 ++- src/menu/components/share/actioncomponent/actionform/index.jsx | 2 src/tabviews/custom/components/card/cardcellList/index.scss | 21 ++++ src/menu/components/table/normal-table/columns/index.jsx | 3 26 files changed, 197 insertions(+), 93 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 6ae5789..a542dfc 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -671,7 +671,15 @@ } }) param.sign = md5(values) - param.t = new Date().getTime() + param.t = new Date().getTime(); + + ['arr_field', 'LText_field', 'custom_script', 'LText1', 'LText', 'LText2', 'DateCount'].forEach(key => { + if (param[key]) { + let val = param[key] + delete param[key] + param[key] = val + } + }) return param } diff --git a/src/index.js b/src/index.js index 65b760a..7383548 100644 --- a/src/index.js +++ b/src/index.js @@ -245,10 +245,6 @@ writable: false, value: GLOB.linkurl }) - Object.defineProperty(GLOB, 'dataFormat', { - writable: false, - value: GLOB.dataFormat - }) Object.defineProperty(window, 'GLOB', { writable: false, value: GLOB diff --git a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx index 663df88..8aa9cc2 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx @@ -46,7 +46,7 @@ if (card.OpenType === 'form') { if (card.formType === 'switch') { - btnElement = (<Switch style={_style} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>) + btnElement = (<Switch style={_style} className={card.size === 'large' ? 'ant-switch-large' : ''} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>) } else { btnElement = (<Checkbox style={_style}></Checkbox>) } diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.scss b/src/menu/components/card/cardcellcomponent/dragaction/index.scss index b851536..ab11c7e 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/index.scss +++ b/src/menu/components/card/cardcellcomponent/dragaction/index.scss @@ -122,4 +122,25 @@ background-position: center center; background-repeat: no-repeat; } + .ant-switch-large { + min-width: 60px; + height: 30px; + line-height: 28px; + + .ant-switch-inner { + margin-right: 5px; + margin-left: 30px; + font-size: 16px; + } + } + .ant-switch-large.ant-switch-checked { + .ant-switch-inner { + margin-right: 30px; + margin-left: 5px; + } + } + .ant-switch-large::after { + width: 26px; + height: 26px; + } } \ No newline at end of file diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index e7387f6..9e8f1b5 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -161,6 +161,7 @@ field: 'selected', label: '棣栬閫変腑', initval: wrap.selected || 'false', + tooltip: '褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆�', required: false, options: [ {value: 'false', label: '鏃�'}, diff --git a/src/menu/components/form/formaction/actionform/index.jsx b/src/menu/components/form/formaction/actionform/index.jsx index 3b9562c..4a4ecf1 100644 --- a/src/menu/components/form/formaction/actionform/index.jsx +++ b/src/menu/components/form/formaction/actionform/index.jsx @@ -221,7 +221,7 @@ message: this.props.dict['form.required.input'] + item.label + '!' } ] - })(<InputNumber min={0} max={10000} precision={0} />)} + })(<InputNumber min={0} max={10000} precision={0} onPressEnter={this.handleSubmit}/>)} </Form.Item> </Col> ) diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx index a66f6d7..01b6326 100644 --- a/src/menu/components/form/formaction/formconfig.jsx +++ b/src/menu/components/form/formaction/formconfig.jsx @@ -258,7 +258,7 @@ type: 'text', key: 'output', label: '杩斿洖鍊�', - tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��', + tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�備緥濡傦細@id', initVal: card.output || '', required: false }, diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 3dc91cf..ce4fea6 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -647,7 +647,7 @@ { required: item.required, message: dict['form.required.input'] + item.label + '!' } ] - content = <InputNumber min={item.min} max={item.max} precision={item.precision} /> + content = <InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/> } else if (item.type === 'select') { rules = [ { required: item.required, message: dict['form.required.select'] + item.label + '!' } diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 8714b32..171b5ef 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -669,7 +669,7 @@ type: 'text', key: 'output', label: '杩斿洖鍊�', - tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��', + tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�備緥濡傦細@id', initVal: card.output || '', required: false, forbid: viewType === 'popview' @@ -851,9 +851,12 @@ label: '寮�鍏冲昂瀵�', initVal: card.size || 'default', options: [{ - value: 'default', + value: 'large', text: '澶�' }, { + value: 'default', + text: '涓�' + }, { value: 'small', text: '灏�' }] 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 4f7ffb1..adbb88b 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -123,7 +123,6 @@ label: Formdict['model.sort'], initVal: card.IsSort || 'false', required: true, - forbidden: card.isSub, options: [{ value: 'true', text: Formdict['model.true'] 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 83d6271..d8a652f 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx @@ -152,9 +152,9 @@ type: 'radio', key: 'IsSort', label: Formdict['model.sort'], - initVal: card.IsSort || 'true', + initVal: card.IsSort || (card.isSub ? 'false' : 'true'), required: true, - forbidden: card.isSub, + // forbidden: card.isSub, options: [{ value: 'true', text: Formdict['model.true'] diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index 5ba095d..5d7552b 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -465,7 +465,8 @@ title: col.label, dataIndex: col.uuid, align: col.Align, - sorter: !isSub && col.IsSort === 'true', + // sorter: !isSub && col.IsSort === 'true', + sorter: col.IsSort === 'true', onCell: () => ({ column: col, width: col.Width, diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx index 170dbb0..b1ad632 100644 --- a/src/menu/components/table/normal-table/options.jsx +++ b/src/menu/components/table/normal-table/options.jsx @@ -133,6 +133,7 @@ field: 'selected', label: '棣栬閫変腑', initval: wrap.selected || 'false', + tooltip: '褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆�', required: false, options: [ {value: 'false', label: '鏃�'}, diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 2ab0cd1..3b32650 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -386,6 +386,8 @@ config.setting.selected = 'false' } else if (config.setting.selected === 'init' && config.setting.onload === 'false') { config.setting.selected = 'false' + } else { + config.setting.orisel = true } let autoMatic = null @@ -485,7 +487,7 @@ } } - loadData = () => { + loadData = (id) => { const { MenuID } = this.props const { setting, search, loadCustomApi, hasReqFields, ContainerId } = this.state @@ -521,10 +523,10 @@ this.loadOutResource() if (setting.execType === 'async') { - this.loadmaindata() + this.loadmaindata(id) } } else { - this.loadmaindata() + this.loadmaindata(id) } } @@ -698,7 +700,7 @@ /** * @description 涓昏〃鏁版嵁鍔犺浇 */ - async loadmaindata () { + async loadmaindata (id) { const { setting, arr_field, search, orderBy, BID, pageIndex, pageSize, absFields, autoMatic } = this.state this.setState({ @@ -718,9 +720,9 @@ start = pageSize * (pageIndex - 1) + 1 } - if (setting.selected !== 'false') { + if (setting.selected !== 'false' || (setting.orisel && id)) { setTimeout(() => { - MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID) + MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID, id) }, 200) if (setting.selected === 'init') { this.setState({setting: {...setting, selected: 'false'}}) @@ -952,17 +954,17 @@ /** * @description 琛ㄦ牸鍒锋柊 */ - reloadtable = (btn) => { + reloadtable = (btn, id = '') => { if (!btn || btn.resetPageIndex !== 'false') { MKEmitter.emit('resetTable', this.props.MenuID) // 鍒楄〃閲嶇疆 this.setState({ pageIndex: 1 }, () => { - this.loadData() + this.loadData(id) }) } else { MKEmitter.emit('resetTable', this.props.MenuID, 'false') // 鍒楄〃閲嶇疆 - this.loadData() + this.loadData(id) } } @@ -1078,7 +1080,7 @@ if (position === 'line' && lines && lines.length === 1) { this.loadmainLinedata(lines[0].$$uuid) } else { - this.reloadtable(btn) + this.reloadtable(btn, id) } } diff --git a/src/tabviews/custom/components/card/cardcellList/index.scss b/src/tabviews/custom/components/card/cardcellList/index.scss index f48154a..ec32d1f 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.scss +++ b/src/tabviews/custom/components/card/cardcellList/index.scss @@ -148,6 +148,27 @@ .ant-mk-picture.scale { cursor: zoom-in; } + .ant-switch-large { + min-width: 60px; + height: 30px; + line-height: 28px; + + .ant-switch-inner { + margin-right: 5px; + margin-left: 30px; + font-size: 16px; + } + } + .ant-switch-large.ant-switch-checked { + .ant-switch-inner { + margin-right: 30px; + margin-left: 5px; + } + } + .ant-switch-large::after { + width: 26px; + height: 26px; + } } .card-cell-list::after { content: ' '; diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 735190a..3176642 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -115,6 +115,8 @@ let selected = 'false' if (_config.wrap.selected === 'always' || _config.wrap.selected === 'init') { selected = _config.wrap.selected + } else { + _config.wrap.selected = 'false' } if (_data) { @@ -264,7 +266,7 @@ * @param {*} position // 鍒锋柊浣嶇疆 * @param {*} btn // 鎵ц鐨勬寜閽� */ - refreshByButtonResult = (menuId, position, btn, id, lines) => { + refreshByButtonResult = (menuId, position, btn, id = '', lines) => { const { config, BID, supComs, supNodes } = this.state if (config.uuid !== menuId) return @@ -290,16 +292,16 @@ if (lines && lines.length === 1) { this.loadLinedata(lines[0].$$uuid) } else { - this.loadData() + this.loadData(id) } } else if (!btn || btn.resetPageIndex !== 'false') { this.setState({ pageIndex: 1 }, () => { - this.loadData() + this.loadData(id) }) } else { - this.loadData() + this.loadData(id) } } } else { @@ -312,22 +314,22 @@ if (lines && lines.length === 1) { this.loadLinedata(lines[0].$$uuid) } else { - this.loadData() + this.loadData(id) } } else if (position === 'mainline' || position === 'popclose') { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� if (supModule && BID) { MKEmitter.emit('reloadData', supModule, BID) } else { - this.loadData() + this.loadData(id) } } else if (!btn || btn.resetPageIndex !== 'false') { this.setState({ pageIndex: 1 }, () => { - this.loadData() + this.loadData(id) }) } else { - this.loadData() + this.loadData(id) } } } @@ -337,7 +339,7 @@ } } - checkTopLine = () => { + checkTopLine = (id) => { const { config, data } = this.state if (!data || data.length === 0 || data[0].$disabled) { @@ -354,15 +356,23 @@ return } + let index = 0 + if (id) { + index = data.findIndex(item => item.$$uuid === id) + if (index === -1) { + index = 0 + } + } + this.setState({ - activeKey: 0, - selectKeys: [0], - selectedData: [data[0]] + activeKey: index, + selectKeys: [index], + selectedData: [data[index]] }) - MKEmitter.emit('resetSelectLine', config.uuid, data[0].$$uuid, data[0]) + MKEmitter.emit('resetSelectLine', config.uuid, data[index].$$uuid, data[index]) if (config.setting.$hasSyncModule) { - MKEmitter.emit('syncBalconyData', config.uuid, [data[0]], data.length === 1) + MKEmitter.emit('syncBalconyData', config.uuid, [data[index]], data.length === 1) } } @@ -468,7 +478,7 @@ }) } - async loadData () { + async loadData (id) { const { mainSearch, menuType } = this.props const { config, arr_field, pageIndex, search, BID, BData, selected } = this.state @@ -483,9 +493,9 @@ loading: false }) - if (selected !== 'false') { + if (selected !== 'false' || (id && config.wrap.selected !== 'false')) { setTimeout(() => { - this.checkTopLine() + this.checkTopLine(id) }, 200) if (selected === 'init') { this.setState({selected: 'false'}) @@ -528,9 +538,9 @@ start = config.setting.pageSize * (pageIndex - 1) + 1 } - if (selected !== 'false') { + if (selected !== 'false' || (id && config.wrap.selected !== 'false')) { setTimeout(() => { - this.checkTopLine() + this.checkTopLine(id) }, 200) if (selected === 'init') { this.setState({selected: 'false'}) diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index fe54374..0c6f9ad 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -527,18 +527,27 @@ MKEmitter.removeListener('resetTable', this.resetTable) } - mkCheckTopLine = (menuId) => { + mkCheckTopLine = (menuId, id) => { const { MenuID, data, setting } = this.props if (MenuID !== menuId || !data || data.length === 0) return - if (data[0].$disabled) return - this.changedata(0) - this.setState({ selectedRowKeys: [0], activeIndex: 0 }) - this.props.chgSelectData([data[0]]) + let index = 0 + if (id) { + index = data.findIndex(item => item.$$uuid === id) + if (index === -1) { + index = 0 + } + } + + if (data[index].$disabled) return + + this.changedata(index) + this.setState({ selectedRowKeys: [index], activeIndex: index }) + this.props.chgSelectData([data[index]]) if (setting.$hasSyncModule) { - MKEmitter.emit('syncBalconyData', MenuID, [data[0]], data.length === 1) + MKEmitter.emit('syncBalconyData', MenuID, [data[index]], data.length === 1) } } @@ -721,13 +730,13 @@ } changedata = (index) => { - const { MenuID, data, setting } = this.props + const { MenuID, data } = this.props let _id = '' let _data = '' if (data && data.length > 0 && index !== '') { - _id = data[index][setting.primaryKey] || '' + _id = data[index].$$uuid || '' _data = data[index] || '' } diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index 6f3ec15..8337aed 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -71,6 +71,8 @@ if (setting.selected !== 'always' && setting.selected !== 'init') { setting.selected = 'false' + } else { + setting.orisel = true } if (_config.setting.sync === 'true' && data) { @@ -171,7 +173,7 @@ * @param { Boolean } reset 琛ㄦ牸鏄惁閲嶇疆 * @param { String } repage 琛ㄦ牸鏄惁閲嶇疆椤电爜 */ - async loadmaindata (reset, repage) { + async loadmaindata (reset, repage, id) { const { mainSearch } = this.props const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize, BData } = this.state @@ -181,6 +183,7 @@ selectedData: [], total: 0 }) + MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 骞挎挱鏁版嵁鍒囨崲 reset && MKEmitter.emit('resetTable', config.uuid, repage) // 鍒楄〃閲嶇疆 if (setting.$hasSyncModule) { @@ -213,9 +216,9 @@ let result = await Api.genericInterface(param) if (result.status) { - if (setting.selected !== 'false' && result.data && result.data.length > 0) { + if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) { setTimeout(() => { - MKEmitter.emit('mkCheckTopLine', config.uuid) + MKEmitter.emit('mkCheckTopLine', config.uuid, id) }, 200) if (setting.selected === 'init') { this.setState({setting: {...setting, selected: 'false'}}) @@ -458,16 +461,16 @@ /** * @description 琛ㄦ牸鍒锋柊 */ - reloadtable = (btn) => { + reloadtable = (btn, id) => { if (!btn || btn.resetPageIndex !== 'false') { this.setState({ pageIndex: 1 }, () => { - this.loadmaindata(true, 'true') + this.loadmaindata(true, 'true', id) this.getStatFieldsValue() }) } else { - this.loadmaindata(true, 'false') + this.loadmaindata(true, 'false', id) this.getStatFieldsValue() } } @@ -547,16 +550,16 @@ if (lines && lines.length === 1) { this.loadmainLinedata(lines[0].$$uuid) } else { - this.reloadtable(btn) + this.reloadtable(btn, id) } } else if (position === 'mainline' || position === 'popclose') { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� if (supModule && BID) { MKEmitter.emit('reloadData', supModule, BID) } else { - this.reloadtable(btn) + this.reloadtable(btn, id) } } else { - this.reloadtable(btn) + this.reloadtable(btn, id) } } diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index 434ca1b..5f39261 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -319,6 +319,8 @@ config.setting.selected = 'false' } else if (config.setting.selected === 'init' && config.setting.onload === 'false') { config.setting.selected = 'false' + } else { + config.setting.orisel = true } if (config.setting.controlField) { @@ -365,7 +367,7 @@ } } - loadData = () => { + loadData = (id) => { const { mainSearch } = this.props const { setting, BID, search, loadCustomApi, hasReqFields } = this.state @@ -414,10 +416,10 @@ this.loadOutResource(searches) if (setting.execType === 'async') { - this.loadmaindata() + this.loadmaindata(id) } } else { - this.loadmaindata() + this.loadmaindata(id) } } @@ -591,7 +593,7 @@ /** * @description 瀛愯〃鏁版嵁鍔犺浇 */ - async loadmaindata () { + async loadmaindata (id) { const { mainSearch } = this.props const { setting, BID, arr_field, search, orderBy, pageIndex, pageSize, absFields } = this.state @@ -617,9 +619,9 @@ start = pageSize * (pageIndex - 1) + 1 } - if (setting.selected !== 'false') { + if (setting.selected !== 'false' || (setting.orisel && id)) { setTimeout(() => { - MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID) + MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID, id) }, 200) if (setting.selected === 'init') { this.setState({setting: {...setting, selected: 'false'}}) @@ -827,17 +829,17 @@ /** * @description 琛ㄦ牸鍒锋柊 */ - reloadtable = (btn) => { + reloadtable = (btn, id = '') => { if (!btn || btn.resetPageIndex !== 'false') { MKEmitter.emit('resetTable', this.props.Tab.uuid) // 鍒楄〃閲嶇疆 this.setState({ pageIndex: 1 }, () => { - this.loadData() + this.loadData(id) }) } else { MKEmitter.emit('resetTable', this.props.Tab.uuid, 'false') // 鍒楄〃閲嶇疆 - this.loadData() + this.loadData(id) } } @@ -918,19 +920,19 @@ if (lines && lines.length === 1) { this.loadmainLinedata(lines[0].$$uuid) } else { - this.reloadtable(btn) + this.reloadtable(btn, id) } } else if (position === 'grid' || position === 'view') { - this.reloadtable(btn) + this.reloadtable(btn, id) } else if (position === 'maingrid' || position === 'mainline') { - this.reloadtable(btn) + this.reloadtable(btn, id) if (Tab.supMenu && BID) { MKEmitter.emit('reloadData', Tab.supMenu, BID) // 涓昏〃閲嶇疆 } else if (!Tab.supMenu && Tab.level === 0 && BID) { MKEmitter.emit('reloadData', SupMenuID, BID) // 鏍戝舰缁撴瀯锛�0绾ф爣绛� } } else if (position === 'equaltab') { - this.reloadtable(btn) + this.reloadtable(btn, id) if (Tab.equalTab && Tab.equalTab.length > 0) { MKEmitter.emit('reloadData', Tab.equalTab.join(',')) // 鍚岀骇鏍囩閲嶇疆 } diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index b08b1e1..9343c02 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -280,6 +280,8 @@ config.setting.selected = 'false' } else if (config.setting.selected === 'init' && config.setting.onload === 'false') { config.setting.selected = 'false' + } else { + config.setting.orisel = true } if (config.setting.controlField) { @@ -321,7 +323,7 @@ } } - loadData = () => { + loadData = (id) => { const { setting, search, hasReqFields, loadCustomApi } = this.state let searches = fromJS(search).toJS() @@ -356,10 +358,10 @@ this.loadOutResource(searches) if (setting.execType === 'async') { - this.loadmaindata() + this.loadmaindata(id) } } else { - this.loadmaindata() + this.loadmaindata(id) } } @@ -534,7 +536,7 @@ /** * @description 瀛愯〃鏁版嵁鍔犺浇 */ - async loadmaindata () { + async loadmaindata (id) { const { BID } = this.props const { setting, arr_field, search, orderBy, pageIndex, pageSize, absFields } = this.state @@ -557,9 +559,9 @@ start = pageSize * (pageIndex - 1) + 1 } - if (setting.selected !== 'false') { + if (setting.selected !== 'false' || (setting.orisel && id)) { setTimeout(() => { - MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID) + MKEmitter.emit('mkTableCheckTopLine', this.props.MenuID, id) }, 200) if (setting.selected === 'init') { this.setState({setting: {...setting, selected: 'false'}}) @@ -762,17 +764,17 @@ /** * @description 琛ㄦ牸鍒锋柊 */ - reloadtable = (btn) => { + reloadtable = (btn, id) => { if (!btn || btn.resetPageIndex !== 'false') { MKEmitter.emit('resetTable', this.props.Tab.uuid) // 鍒楄〃閲嶇疆 this.setState({ pageIndex: 1 }, () => { - this.loadData() + this.loadData(id) }) } else { MKEmitter.emit('resetTable', this.props.Tab.uuid, 'false') // 鍒楄〃閲嶇疆 - this.loadData() + this.loadData(id) } } @@ -807,7 +809,7 @@ * @param {*} position // 鍒锋柊浣嶇疆 * @param {*} btn // 鎵ц鐨勬寜閽� */ - refreshByButtonResult = (menuId, position, btn, id, lines) => { + refreshByButtonResult = (menuId, position, btn, id = '', lines) => { const { MenuID } = this.props if (MenuID !== menuId) return @@ -815,7 +817,7 @@ if (position === 'line' && lines && lines.length === 1) { this.loadmainLinedata(lines[0].$$uuid) } else { - this.reloadtable(btn) + this.reloadtable(btn, id) } MKEmitter.emit('refreshPopButton', this.props.Tab.uuid) } diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 23ace02..ac2b71c 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -2093,7 +2093,7 @@ if (btn.OpenType === 'form') { if (btn.formType === 'switch') { - return <Switch loading={loading} checked={check} disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} onChange={(val,e) => {e.stopPropagation();this.actionTrigger()}} style={style} size={btn.size} checkedChildren={btn.openText || ''} unCheckedChildren={btn.closeText || ''}/> + return <Switch loading={loading} checked={check} disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} onChange={(val,e) => {e.stopPropagation();this.actionTrigger()}} style={style} className={btn.size === 'large' ? 'ant-switch-large' : ''} size={btn.size} checkedChildren={btn.openText || ''} unCheckedChildren={btn.closeText || ''}/> } else { return <Checkbox disabled={disabled || loading} title={disabled ? (btn.reason || '') : ''} checked={check} onChange={(e) => {e.stopPropagation();this.actionTrigger()}} style={style}></Checkbox> } diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 123c966..2481f06 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -278,12 +278,20 @@ MKEmitter.removeListener('mkTableCheckTopLine', this.mkTableCheckTopLine) } - mkTableCheckTopLine = (id) => { - if (id !== this.props.MenuID) return + mkTableCheckTopLine = (menuid, id) => { + const {MenuID, data} = this.props - if (this.props.data.length > 0) { - this.changeRow(this.props.data[0], 0) + if (menuid !== MenuID || data.length === 0) return + + let index = 0 + if (id) { + index = data.findIndex(item => item.$$uuid === id) + if (index === -1) { + index = 0 + } } + + this.changeRow(data[index], index) } autoSelectData = (id, index) => { diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx index d45b22d..d0ef468 100644 --- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx @@ -520,7 +520,7 @@ { required: item.required, message: dict['form.required.input'] + item.label + '!' } ] - content = <InputNumber min={item.min} max={item.max} precision={item.precision} /> + content = <InputNumber min={item.min} max={item.max} precision={item.precision} onPressEnter={this.handleSubmit}/> } else if (item.type === 'select') { rules = [ { required: item.required, message: dict['form.required.select'] + item.label + '!' } diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index e853a54..221db3c 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -700,7 +700,7 @@ </Col> {tableType !== '' ? <Col span={12}> <Form.Item label={ - <Tooltip placement="topLeft" title="鍦ㄥ惎鐢ㄦ棤浜哄�煎畧鍔熻兘鏃舵棤鏁堛��"> + <Tooltip placement="topLeft" title="褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆傛敞锛氬湪鍚敤鏃犱汉鍊煎畧鍔熻兘鏃舵棤鏁堛��"> <QuestionCircleOutlined className="mk-form-tip" /> 棣栬閫変腑 </Tooltip> diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 235e9be..5761a1e 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -1309,7 +1309,7 @@ type: 'text', key: 'output', label: '杩斿洖鍊�', - tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��', + tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�備緥濡傦細@id', initVal: card.output || '', required: false }, diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index e5eb488..d1e8084 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -142,6 +142,8 @@ MenuID: tempId } + window.GLOB.dataFormat = false // 鎵撳嵃鍘婚櫎姘村嵃 + if (window.GLOB.mainSystemApi) { // 浠庡崟鐐圭櫥褰曟湇鍔″櫒鍙栨墦鍗伴厤缃俊鎭� _param.rduri = window.GLOB.mainSystemApi } @@ -248,6 +250,21 @@ if (component.search) component.search = [] component.data = [] // 鍒濆鍖栨暟鎹负绌� + if (component.type === 'table' && component.subtype === 'normaltable') { + let getColumns = (cols) => { + return cols.map(item => { + if (item.type === 'colspan') { + item.subcols = getColumns(item.subcols) + } else { + item.IsSort = 'false' + } + + return item + }) + } + component.cols = getColumns(component.cols) + } + if (component.wrap.datatype === 'static') { component.format = '' } -- Gitblit v1.8.0