| | |
| | | <el-form-item> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | <el-button @click="handleReset">重置</el-button> |
| | | <el-button @click="addTask">新增任务</el-button> |
| | | <el-button type="text" @click="toggleExpand"> |
| | | {{ isExpand ? '收起' : '展开' }} |
| | | <el-icon class="el-icon--right"> |
| | |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="任务算法"> |
| | | <el-select v-model="searchForm.ai_type" placeholder="请选择算法" clearable> |
| | | <!-- <el-select v-model="searchForm.ai_types" 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"> |
| | |
| | | </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> |
| | |
| | | </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 = () => { |
| | |
| | | |
| | | const dateRange = ref([]); |
| | | const searchForm = reactive({ |
| | | ai_type: '', // 算法类型 |
| | | ai_types: [], // 算法类型 |
| | | area_code: '', // 区域code |
| | | create_dept: '', // 创建部门 |
| | | date_enum: '', // 日期枚举,可用值:TODAY,CURRENT_WEEK,CURRENT_MONTH,CURRENT_YEAR |
| | | device_sn: '', // 设备编号 |
| | | end_date: '', // 结束时间 |
| | | end_date: null, // 结束时间 |
| | | industry_type: '', // 行业key |
| | | key_word: '', // 模糊搜索关键词(匹配名称/昵称/设备sn) |
| | | start_date: '', // 开始时间 |
| | | start_date: null, // 开始时间 |
| | | status: '' // 作业状态 |
| | | }); |
| | | |
| | |
| | | { label: '执行失败', value: 5 } |
| | | ]; |
| | | |
| | | const emit = defineEmits(['search']); |
| | | const emit = defineEmits(['search','addTask']); |
| | | |
| | | const handleSearch = () => { |
| | | emit('search', { |
| | | ...searchForm, |
| | | start_date: `${dateRange.value[0]} 00:00:00`, |
| | | end_date: `${dateRange.value[1]} 23:59:59` |
| | | start_date: dateRange.value.length ? `${dateRange.value[0]} 00:00:00` : null, |
| | | end_date: dateRange.value.length ? `${dateRange.value[1]} 23:59:59` : null |
| | | }); |
| | | }; |
| | | |
| | |
| | | handleSearch(); |
| | | }; |
| | | |
| | | 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 addTask = () => { |
| | | emit('addTask'); |
| | | }; |
| | | |
| | | // 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 algorithmChange = (val) => { |
| | | searchForm.ai_types = val; |
| | | }; |
| | | |
| | | const businessChange = (val) => { |
| | | searchForm.industry_type = val; |
| | | }; |
| | | |
| | | let deptData = ref([]); |
| | | // 所属部门信息 |
| | |
| | | // 机巢 |
| | | let machineData = ref([]); |
| | | |
| | | // 处理部门数据为树形结构 |
| | | const handleDeptData = (data) => { |
| | | deptTreeData.value = []; // 初始化数组 |
| | | data.forEach(item => { |
| | | let treeNode = { |
| | | id: item.area_code, |
| | | name: item.area_name, |
| | | children: [] |
| | | }; |
| | | // 处理设备子节点 |
| | | if (item.devices && item.devices.length > 0) { |
| | | item.devices.forEach(device => { |
| | | treeNode.children.push({ |
| | | id: device.device_sn, |
| | | name: device.nickname |
| | | }); |
| | | }); |
| | | } |
| | | deptTreeData.value.push(treeNode); |
| | | }); |
| | | }; |
| | | // 部门下得机巢 |
| | | const requestDockInfo = () => { |
| | | getDockInfo().then((res) => { |
| | |
| | | |
| | | |
| | | onMounted(() => { |
| | | requestDictionary(); |
| | | // requestDictionary(); |
| | | getDeptsByAreaCode(); |
| | | requestDockInfo(); |
| | | }); |
| | |
| | | <style lang="scss" scoped> |
| | | .search-box { |
| | | position: absolute; |
| | | top: 120px; |
| | | left: 450px; |
| | | width: calc(100% - 400px - 400px - 100px); |
| | | top: 340px; |
| | | left: 40px; |
| | | width: calc(100% - 80px); |
| | | height: 60px; |
| | | line-height: 60px; |
| | | background: rgba(31, 62, 122, 0.95); |
| | | padding: 10px 20px; |
| | | // padding: 10px 20px; |
| | | transition: all 0.3s; |
| | | &.is-expand { |
| | | height: auto; |
| | | } |
| | | .search-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | // justify-content: space-between; |
| | | align-items: center; |
| | | |
| | | .search-items { |
| | |
| | | z-index: 10; |
| | | border-top: 1px solid rgba(255, 255, 255, 0.1); |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); |
| | | margin-bottom: 60px; // 为分页预留空间 |
| | | } |
| | | |
| | | :deep(.el-form) { |
| | |
| | | line-height: 18px; |
| | | } |
| | | } |
| | | :deep(.el-pagination) { |
| | | position: fixed; |
| | | bottom: 20px; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | background: rgba(31, 62, 122, 0.95); |
| | | padding: 15px 20px; |
| | | border-radius: 4px; |
| | | box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); |
| | | } |
| | | } |
| | | </style> |