| | |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "qqq", |
| | | "externalDatabase": "", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mkindustry", |
| | |
| | | MKEmitter.emit('resetSelectLine', MenuID, _id, _data) |
| | | } |
| | | |
| | | resetTable = (id, repage) => { |
| | | resetTable = (id, repage, pageIndex) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (id !== MenuID) return |
| | |
| | | activeIndex: null, |
| | | pickup: false |
| | | }) |
| | | } else if (repage === 'repage') { |
| | | this.setState({ |
| | | pageIndex: pageIndex, |
| | | selectedRowKeys: [], |
| | | activeIndex: null, |
| | | pickup: false |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | pageIndex: 1, |
| | |
| | | }) |
| | | |
| | | 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) |
| | | } |
| | |
| | | |
| | | 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) |
| | |
| | | selectedData: [], |
| | | total: 0 |
| | | }) |
| | | reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置 |
| | | reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 列表重置 |
| | | return |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | 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) |
| | | } |
| | |
| | | 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(() => { |
| | |
| | | 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] |
| | |
| | | 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 |
| | | }) |
| | | |