From cc1a76df575c18f0d0ee96e8658461efdce3a918 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 17 一月 2023 18:01:01 +0800 Subject: [PATCH] 2023-01-17 --- public/options.json | 2 src/tabviews/custom/components/table/edit-table/index.jsx | 2 src/tabviews/custom/components/table/base-table/index.jsx | 19 +++++++++ src/tabviews/custom/components/share/normalTable/index.jsx | 9 ++++ src/tabviews/custom/components/table/normal-table/index.jsx | 19 +++++++++ src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 6 +++ src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 9 ++++ 7 files changed, 61 insertions(+), 5 deletions(-) diff --git a/public/options.json b/public/options.json index 39ac1e9..bedcbee 100644 --- a/public/options.json +++ b/public/options.json @@ -3,7 +3,7 @@ "appkey": "20210831212235413F287EC3BF489424496C8", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", - "externalDatabase": "qqq", + "externalDatabase": "", "lineColor": "", "filter": "false", "defaultApp": "mkindustry", diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 5c7df59..328ccb5 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -837,7 +837,7 @@ MKEmitter.emit('resetSelectLine', MenuID, _id, _data) } - resetTable = (id, repage) => { + resetTable = (id, repage, pageIndex) => { const { MenuID } = this.props if (id !== MenuID) return @@ -848,6 +848,13 @@ activeIndex: null, pickup: false }) + } else if (repage === 'repage') { + this.setState({ + pageIndex: pageIndex, + selectedRowKeys: [], + activeIndex: null, + pickup: false + }) } else { this.setState({ pageIndex: 1, diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx index 5114db7..f8f7454 100644 --- a/src/tabviews/custom/components/table/base-table/index.jsx +++ b/src/tabviews/custom/components/table/base-table/index.jsx @@ -126,7 +126,7 @@ }) MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 骞挎挱鏁版嵁鍒囨崲 - reset && MKEmitter.emit('resetTable', config.uuid, repage) // 鍒楄〃閲嶇疆 + reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 鍒楄〃閲嶇疆 if (setting.$hasSyncModule) { MKEmitter.emit('syncBalconyData', config.uuid, [], false) } @@ -157,6 +157,23 @@ let result = await Api.genericInterface(param) if (result.status) { + if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) { + let _pageIndex = Math.ceil(result.total / pageSize) + + if (_pageIndex < pageIndex) { + MKEmitter.emit('resetTable', config.uuid, 'repage', _pageIndex) + this.setState({ + pageIndex: _pageIndex, + data: [], + selectedData: [], + total: result.total + }, () => { + this.loadmaindata() + }) + return + } + } + if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) { setTimeout(() => { MKEmitter.emit('mkCheckTopLine', config.uuid, id, setting.selected) diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index 03baac5..49dae01 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -186,7 +186,7 @@ selectedData: [], total: 0 }) - reset && MKEmitter.emit('resetTable', config.uuid, repage) // 鍒楄〃閲嶇疆 + reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 鍒楄〃閲嶇疆 return } diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index 8369017..0ffafaa 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -204,7 +204,7 @@ }) MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 骞挎挱鏁版嵁鍒囨崲 - reset && MKEmitter.emit('resetTable', config.uuid, repage) // 鍒楄〃閲嶇疆 + reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 鍒楄〃閲嶇疆 if (setting.$hasSyncModule) { MKEmitter.emit('syncBalconyData', config.uuid, [], false) } @@ -243,6 +243,23 @@ if (config.$cache && pageIndex === 1) { Api.writeCacheConfig(config.uuid, result.data || '') } + + if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) { + let _pageIndex = Math.ceil(result.total / pageSize) + + if (_pageIndex < pageIndex) { + MKEmitter.emit('resetTable', config.uuid, 'repage', _pageIndex) + this.setState({ + pageIndex: _pageIndex, + data: [], + selectedData: [], + total: result.total + }, () => { + this.loadmaindata() + }) + return + } + } if ((setting.selected !== 'false' || (setting.orisel && id)) && result.data && result.data.length > 0) { setTimeout(() => { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 947413b..5973e2d 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -250,6 +250,12 @@ col.type = col.type || 'Nvarchar(50)' col.import = col.import || 'true' col.required = col.required || 'true' + + if (col.type === 'text' || col.type === 'image') { + col.type = 'Nvarchar(50)' + } else if (col.type === 'number') { + col.type = 'Decimal(18,2)' + } if (/^Nvarchar/ig.test(col.type)) { col.limit = col.type.match(/\d+/)[0] diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index ff8e714..8f566d2 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -231,6 +231,15 @@ col.type = col.type || 'text' col.output = col.output || 'true' col.required = col.required || 'false' + + if (!['text', 'image', 'number'].includes(col.type)) { + if (/^Decimal/ig.test(col.type)) { + col.type = 'number' + } else { + col.type = 'text' + } + } + return col }) -- Gitblit v1.8.0