From 19e156d67e400bff8883425f3511812bb4f9d193 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 10 七月 2023 12:46:00 +0800 Subject: [PATCH] 2023-07-10 --- src/tabviews/custom/components/carousel/data-card/index.jsx | 47 +++++++++++++++++++++++++++++++++-------------- 1 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index f67af54..50fdeb2 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -222,10 +222,6 @@ } else { this.loadData() } - - if (position === 'popclose') { // 鎵ц鍚姩寮圭獥鐨勬寜閽墍閫夋嫨鐨勫埛鏂伴」 - btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId) - } } resetParentParam = (MenuID, id, data) => { @@ -290,34 +286,57 @@ let result = await Api.genericInterface(param) if (result.status) { this.loaded = true - if (config.$cache) { + if (config.$cache && config.setting.onload !== 'false') { Api.writeCacheConfig(config.uuid, result.data || '') } + let data = result.data.map((item, index) => { + item.key = index + item.$$uuid = item[config.setting.primaryKey] || '' + item.$$BID = BID || '' + item.$$BData = BData || '' + item.$Index = index + 1 + return item + }) + this.setState({ - data: result.data.map((item, index) => { - item.key = index - item.$$uuid = item[config.setting.primaryKey] || '' - item.$$BID = BID || '' - item.$$BData = BData || '' - item.$Index = index + 1 - return item - }), + data: data, loading: false }, () => { this.openModal(result.ErrCode) }) + + if (config.timer && config.clearField && result.data && result.data[0]) { + let vals = (config.clearValue || '').split(',') + if (vals.includes(result.data[0][config.clearField])) { + this.timer && this.timer.stop() + } + } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, -- Gitblit v1.8.0