From deb2536eaaa559d6c8ec94f81afb94b6c7806b4d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 29 三月 2024 16:15:14 +0800 Subject: [PATCH] 2024-03-29 --- src/utils/utils-datamanage.js | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 91dfd4a..1291a36 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -1,16 +1,13 @@ import md5 from 'md5' import moment from 'moment' +import { notification, Modal } from 'antd' + +import MKEmitter from '@/utils/events.js' import Utils from './utils.js' export default class DataUtils { /** - * @description 鏁版嵁婧愬悕绉帮紝鐢ㄤ簬缁熶竴鏌ヨ - * @param {Object} setting 鏁版嵁婧愯缃� - * @param {Array} search 鎼滅储鏉′欢 - * @param {String} orderBy 鎺掑簭鏂瑰紡 - * @param {Number} pageIndex 椤电爜 - * @param {Number} pageSize 姣忛〉鏁伴噺 - * @param {String} BID 涓婄骇ID + * @description 鏁版嵁婧愮粺涓�鏌ヨ */ static getQueryDataParams (setting, search = [], orderBy = '', pageIndex = 1, pageSize = 10, BID, id, year) { let param = null @@ -442,6 +439,46 @@ return param } + + /** + * @description 鏁版嵁鑾峰彇鎴愬姛 + */ + static querySuccess (result) { + if (!result.message) return + + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } + + /** + * @description 鏁版嵁鑾峰彇澶辫触 + */ + static queryFail (result) { + if (!result.message && result.ErrCode !== 'version_up') return + + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else if (result.ErrCode === 'version_up') { + MKEmitter.emit('reloadTabs') + } else if (result.ErrCode !== '-2') { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } + } } /** -- Gitblit v1.8.0