| | |
| | | <!-- <div class="btn add" @click="addTask"><img src="@/assets/images/task/add.png"/>新增</div> --> |
| | | </div> |
| | | <el-form-item label="任务算法:" v-if="isExpand" class="taskAlgorithm"> |
| | | <TaskAlgorithmBusiness |
| | | <!-- <TaskAlgorithmBusiness |
| | | ref="algorithmRef" |
| | | :setWidth="160" |
| | | :showAlgorithm="true" |
| | | @algorithmChange="algorithmChange" |
| | | /> --> |
| | | <el-tree-select |
| | | popper-class="custom-tree-select" |
| | | :style="{ width: pxToRem(186) }" |
| | | v-model="dictKey" |
| | | :data="dataList" |
| | | :default-expanded-keys="[dictKey]" |
| | | check-strictly |
| | | node-key="id" |
| | | :props="treePropsSF" |
| | | @node-click="handleSFNodeClick" |
| | | clearable |
| | | @clear="handleClear" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="所属部门:" v-if="isExpand"> |
| | |
| | | <script setup> |
| | | import { pxToRem } from '@/utils/rem'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { deptsByAreaCode } from '@/api/job/task'; |
| | | import TaskAlgorithmBusiness from './TaskAlgorithmBusiness.vue'; |
| | | import { deptsByAreaCode, getSFDictionaryTree } from '@/api/job/task'; |
| | | // import TaskAlgorithmBusiness from './TaskAlgorithmBusiness.vue'; |
| | | import dayjs from 'dayjs'; |
| | | import { useStore } from 'vuex'; |
| | | import { getRegionTreeAll } from '@/api/job/task'; |
| | |
| | | handleNodeClick({ id: userAreaCode.value }); |
| | | }); |
| | | }; |
| | | |
| | | // 算法 |
| | | const treePropsSF = { |
| | | label: 'dictValue', |
| | | value: 'id', |
| | | children: 'children', |
| | | } |
| | | const dictKey = ref('') |
| | | const dataList = ref([]) |
| | | function getAlgorithmList() { |
| | | getSFDictionaryTree({code:'SF'}).then((res) => { |
| | | if (res.data.code === 200) { |
| | | const result = res.data.data[0].children |
| | | // 过滤第一层数据 |
| | | const filteredData = result.map(item => { |
| | | // 过滤第二层数据 |
| | | const children = item.children?.map(child => ({ |
| | | ...child, |
| | | children: [] // 清空第三层数据 |
| | | })) |
| | | return { |
| | | ...item, |
| | | children: children || [] |
| | | } |
| | | }) |
| | | dataList.value = filteredData |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function handleSFNodeClick(data) { |
| | | if (data.children && data.children.length) { |
| | | // 获取子节点dictKey |
| | | const childDictKeys = data.children.map(child => child.dictKey) |
| | | searchForm.ai_types = childDictKeys |
| | | } else { |
| | | searchForm.ai_types = [data.dictKey] |
| | | } |
| | | // 更新列表 |
| | | handleSearch() |
| | | } |
| | | function handleClear() { |
| | | dictKey.value = '' |
| | | searchForm.ai_types = [] |
| | | handleSearch() |
| | | } |
| | | |
| | | const handleNodeClick = async data => { |
| | | // 处理机巢数据 |
| | |
| | | |
| | | onMounted(() => { |
| | | requestDockInfo(); |
| | | getAlgorithmList(); |
| | | // 日历传值 |
| | | const calendarday = ref(route.query.day); |
| | | |