forked from drone/command-center-dashboard

罗广辉
2025-04-21 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7
src/views/TaskManage/components/TaskAlgorithmBusiness.vue
@@ -1,19 +1,21 @@
<!-- 关联算法和综合业务 -->
<template>
  <div class="task-algorithm" v-if="showAlgorithm">
    <el-select v-model="ai_types" multiple collapse-tags collapse-tags-tooltip placeholder="请选择算法" clearable @change="handleAlgorithmChange">
    <el-select :teleported="false" class="ztzf-select" :style="{ width: pxToRem(setWidth) }" v-model="ai_types" multiple collapse-tags collapse-tags-tooltip placeholder="请选择算法" clearable @change="handleAlgorithmChange">
      <el-option v-for="item in taskAlgorithm" :key="item.id" :label="item.dictValue" :value="item.dictKey" />
    </el-select>
  </div>
  <div class="task-business" v-if="showBusiness">
    <el-select v-model="industry_type" placeholder="请选择类型" clearable @change="handleBusinessChange">
    <el-select :teleported="false" class="ztzf-select" :style="{ width: pxToRem(setWidth) }" v-model="industry_type" placeholder="请选择类型" clearable @change="handleBusinessChange">
      <el-option v-for="item in taskBusiness" :key="item.id" :label="item.dictValue" :value="item.dictKey" />
    </el-select>
  </div>
</template>
<script setup>
import { getDictionary } from '@/api/home/common';
import { getMultipleDictionary } from '@/api/system/dictbiz';
import { pxToRem } from '@/utils/rem'
// 接收父组件传参
const props = defineProps({
@@ -24,6 +26,10 @@
  showBusiness: {
    type: Boolean,
    default: false
  },
  setWidth: {
    type: Number,
    default: '100%'
  }
});
@@ -36,7 +42,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 +63,4 @@
onMounted(() => {
  requestDictionary();
});
</script>
</script>