无人机管理后台前端(已迁走)
罗广辉
2025-08-14 1dbfed01c8b1349a29796b20641ad0c77db1e313
feat: 算法下拉不出现
1 files modified
32 ■■■■ changed files
src/views/tickets/ticket.vue 32 ●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue
@@ -273,7 +273,7 @@
                  :disabled="!form.type"
                >
                  <el-option
                    v-for="item in algorithms"
                    v-for="item in algorithms2"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
@@ -464,7 +464,7 @@
                  class="required-input"
                >
                  <el-option
                    v-for="item in algorithms"
                    v-for="item in algorithms2"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
@@ -956,6 +956,7 @@
      ],
      algorithms: [],
      algorithms2: [],
      statuses: [
        { label: '待审核', value: '2' },
        { label: '待处理', value: '0' },
@@ -1558,14 +1559,16 @@
        console.log('工单类型',this.types);
        console.log('关联算法',this.allAlgorithms );
        // 确保算法数据的映射一致
        // this.algorithms =
        //   ai_type?.map(item => ({
        //     dict_key: item.dict_key,
        //     dict_value: item.dict_value,
        //     // 同时添加 label 和 value 以兼容两处使用
        //     label: item.dict_value,
        //     value: item.dict_key,
        //   })) || [];
        this.algorithms =
          ai_type?.map(item => ({
            dict_key: item.dict_key,
            dict_value: item.dict_value,
            // 同时添加 label 和 value 以兼容两处使用
            label: item.dict_value,
            value: item.dict_key,
          })) || [];
        this.algorithms2 = _.cloneDeep(this.algorithms)
        // 构建用户ID和名称的映射关系
        this.userNameToIdMap = {};
@@ -1580,9 +1583,10 @@
    },
    // 工单类型变化时触发
    handleTypeChange(typeValue) {
      this.form.algorithm = []
      if (!typeValue) {
        // 未选择类型时清空算法列表
        this.algorithms = [];
        this.algorithms2 = [];
        return;
      }
@@ -1592,13 +1596,11 @@
      if (!matchedCategory || !matchedCategory.algorithms || matchedCategory.algorithms.length === 0) {
        // 无匹配的算法时清空
        this.algorithms = [];
        this.algorithms2 = [];
        this.$message.info('该工单类型暂无关联算法');
        return;
      }
// console.log('matchedCategory',matchedCategory);
      this.algorithms = matchedCategory.algorithms.map(algo => ({
      this.algorithms2 = matchedCategory.algorithms.map(algo => ({
        label: algo.dict_value, 
        value: algo.dict_key,
        dict_key: algo.dict_key,