forked from drone/command-center-dashboard

罗广辉
2025-04-08 8561526609200b395f611f129c39ea63e78bd576
refactor: 多个字典查询重构
3 files modified
22 ■■■■ changed files
src/api/home/common.js 8 ●●●●● patch | view | raw | blame | history
src/api/system/dictbiz.js 7 ●●●●● patch | view | raw | blame | history
src/views/TaskManage/components/TaskAlgorithmBusiness.vue 7 ●●●●● patch | view | raw | blame | history
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({
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',
    })
}
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>
</script>