From a119e5a86c626cc6175cbfdbb236c34270fbe90c Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 07 Apr 2025 20:41:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/TaskManage/SearchBox.vue |   46 +++++++++++++++++++++++++++-------------------
 1 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/src/views/TaskManage/SearchBox.vue b/src/views/TaskManage/SearchBox.vue
index 181cfd9..c96de38 100644
--- a/src/views/TaskManage/SearchBox.vue
+++ b/src/views/TaskManage/SearchBox.vue
@@ -53,9 +53,10 @@
           />
         </el-form-item>
         <el-form-item label="任务算法">
-          <el-select v-model="searchForm.ai_type" placeholder="请选择算法" clearable>
+          <!-- <el-select v-model="searchForm.ai_type" placeholder="请选择算法" clearable>
             <el-option v-for="item in taskAlgorithm" :key="item.id" :label="item.dictValue" :value="item.dictKey" />
-          </el-select>
+          </el-select> -->
+          <TaskAlgorithmBusiness :showAlgorithm="true" @algorithmChange="algorithmChange"/>
         </el-form-item>
       </div>
       <div class="search-row">
@@ -70,9 +71,10 @@
           </el-select>
         </el-form-item>
         <el-form-item label="任务类型">
-          <el-select v-model="searchForm.industry_type" placeholder="请选择类型" clearable>
+          <!-- <el-select v-model="searchForm.industry_type" placeholder="请选择类型" clearable>
             <el-option v-for="item in taskBusiness" :key="item.id" :label="item.dictValue" :value="item.dictKey" />
-          </el-select>
+          </el-select> -->
+          <TaskAlgorithmBusiness :showBusiness="true" @businessChange="businessChange"/>
         </el-form-item>
       </div>
     </div>
@@ -80,7 +82,8 @@
   </div>
 </template>
 <script setup>
-import { getDictionary, deptsByAreaCode, getDockInfo } from '@/api/home/common';
+import { deptsByAreaCode, getDockInfo } from '@/api/home/common';
+import TaskAlgorithmBusiness from './components/TaskAlgorithmBusiness.vue';
 
 const isExpand = ref(false);
 const toggleExpand = () => {
@@ -109,7 +112,7 @@
   { label: '执行失败', value: 5 }
 ];
 
-const emit = defineEmits(['search']);
+const emit = defineEmits(['search','addTask']);
 
 const handleSearch = () => {
   emit('search', {
@@ -129,24 +132,29 @@
 
 // 新增任务
 const addTask = () => {
-  // 跳转新增任务页面
-  window.open('/#/task/add');
+  emit('addTask');
 };
 
-let taskAlgorithm = ref([]);
-let taskBusiness = ref([]);
+// let taskAlgorithm = ref([]);
+// let taskBusiness = ref([]);
 
 // 请求字典字段
-const requestDictionary = () => {
-  getDictionary('SF,HYLB').then((res) => {
-    if (res.code !== 0) {
-      // 处理数据
-      taskAlgorithm.value = res.data.data['SF'];
-      taskBusiness.value = res.data.data['HYLB'];
-    }
-  });
+// const requestDictionary = () => {
+//   getDictionary('SF,HYLB').then((res) => {
+//     if (res.code !== 0) {
+//       // 处理数据
+//       taskAlgorithm.value = res.data.data['SF'];
+//       taskBusiness.value = res.data.data['HYLB'];
+//     }
+//   });
+// };
+const algorithmChange = (val) => {
+  searchForm.ai_type = val;
 };
 
+const businessChange = (val) => {
+  searchForm.industry_type = val;
+};
 
 let deptData = ref([]);
 // 所属部门信息
@@ -183,7 +191,7 @@
 
 
 onMounted(() => {
-  requestDictionary();
+  // requestDictionary();
   getDeptsByAreaCode();
   requestDockInfo();
 });

--
Gitblit v1.9.3