From 8561526609200b395f611f129c39ea63e78bd576 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Tue, 08 Apr 2025 14:26:33 +0800
Subject: [PATCH] refactor: 多个字典查询重构
---
src/api/home/common.js | 8 --------
src/api/system/dictbiz.js | 7 +++++++
src/views/TaskManage/components/TaskAlgorithmBusiness.vue | 7 ++++---
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/api/home/common.js b/src/api/home/common.js
index 9a56796..0ebc986 100644
--- a/src/api/home/common.js
+++ b/src/api/home/common.js
@@ -1,13 +1,5 @@
import request from '@/axios'
-// 字典查询 行业 算法 工单类型
-export const getDictionary = params => {
- return request({
- url: `/blade-system/dict-biz/listByCodes?codes=${params}`,
- method: 'get',
- })
-}
-
// 区域
export const deptsByAreaCode = params => {
return request({
diff --git a/src/api/system/dictbiz.js b/src/api/system/dictbiz.js
index 5488f55..2b00ea2 100644
--- a/src/api/system/dictbiz.js
+++ b/src/api/system/dictbiz.js
@@ -86,3 +86,10 @@
params,
})
}
+// 多个字典查询
+export const getMultipleDictionary = params => {
+ return request({
+ url: `/blade-system/dict-biz/listByCodes?codes=${params}`,
+ method: 'get',
+ })
+}
diff --git a/src/views/TaskManage/components/TaskAlgorithmBusiness.vue b/src/views/TaskManage/components/TaskAlgorithmBusiness.vue
index 2dcd44a..8878c26 100644
--- a/src/views/TaskManage/components/TaskAlgorithmBusiness.vue
+++ b/src/views/TaskManage/components/TaskAlgorithmBusiness.vue
@@ -13,7 +13,8 @@
</template>
<script setup>
-import { getDictionary } from '@/api/home/common';
+
+import { getMultipleDictionary } from '@/api/system/dictbiz'
// 接收父组件传参
const props = defineProps({
@@ -36,7 +37,7 @@
// 请求字典字段
const requestDictionary = () => {
- getDictionary('SF,HYLB').then((res) => {
+ getMultipleDictionary('SF,HYLB').then((res) => {
if (res.code !== 0) {
// 处理数据
taskAlgorithm.value = res.data.data['SF'];
@@ -57,4 +58,4 @@
onMounted(() => {
requestDictionary();
});
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.9.3