| | |
| | | check-strictly |
| | | node-key="id" |
| | | :props="treeProps" |
| | | @node-click="handleNodeClick" |
| | | clearable |
| | | @change="handleNodeClick" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="所属机巢:"> |
| | |
| | | <div class="more" v-if="isExpand" @click="toggleExpand">收起</div> |
| | | <div class="more" v-else @click="toggleExpand">更多</div> |
| | | <div class="search-btn" :style="{ bottom: isExpand ? '5px' : '-3px' }"> |
| | | |
| | | |
| | | <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" @click="handleReset">清空</el-button> |
| | | </div> |
| | |
| | | collapse-tags |
| | | collapse-tags-tooltip |
| | | clearable |
| | | @node-click="handleNodeClick" |
| | | @check="handleCheck" |
| | | @clear="handleClear" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="所属部门:" v-if="isExpand"> |
| | | <el-select |
| | | :teleported="false" |
| | | <el-form-item label="所属部门:" v-if="isExpand"> |
| | | <el-tree-select |
| | | popper-class="custom-tree-select" |
| | | v-model="searchForm.create_dept" |
| | | placeholder="请选择" |
| | | :data="deptData" |
| | | :default-expanded-keys="[searchForm.create_dept]" |
| | | check-strictly |
| | | node-key="id" |
| | | :props="treeDeptProps" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in deptData" |
| | | :key="item.id" |
| | | :label="item.deptName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | @change="(id) => handleDeptNodeClick({id})" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="任务状态:" v-if="isExpand"> |
| | | <el-select |
| | | style="z-index: 1000" |
| | |
| | | import { pxToRem } from '@/utils/rem'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { deptsByAreaCode, getSFDictionaryTree } from '@/api/job/task'; |
| | | import { getDeptLazyTree } from '@/api/system/dept' |
| | | // import TaskAlgorithmBusiness from './TaskAlgorithmBusiness.vue'; |
| | | import dayjs from 'dayjs'; |
| | | import { useStore } from 'vuex'; |
| | |
| | | let deptData = ref([]); |
| | | // 所属部门信息 |
| | | const getDeptsByAreaCode = () => { |
| | | deptsByAreaCode(searchForm.area_code).then(res => { |
| | | if (res.code !== 0) { |
| | | deptData.value = res.data.data; |
| | | } |
| | | getDeptLazyTree({ parentId: 0, level: 0 }).then(res => { |
| | | deptData.value = res.data.data; |
| | | }); |
| | | }; |
| | | |
| | |
| | | // 机巢 |
| | | let machineData = ref([]); |
| | | |
| | | // 记录选中行政区划值 |
| | | let area_code_log = ref('') |
| | | // 记录选中部门 |
| | | let dept_id_log = ref('') |
| | | |
| | | // 部门下得机巢 |
| | | const requestDockInfo = () => { |
| | | getRegionTreeAll({ parentCode: userAreaCode.value }).then(res => { |
| | | deptTreeData.value = res.data.data ? [res.data.data] : []; |
| | | |
| | | handleNodeClick({ id: userAreaCode.value }); |
| | | area_code_log.value = userAreaCode.value |
| | | roadDroneList() |
| | | }); |
| | | }; |
| | | |
| | | function handleNodeClick(data) { |
| | | area_code_log.value = data?.id |
| | | roadDroneList() |
| | | } |
| | | |
| | | // 筛选部门管理 |
| | | function handleDeptNodeClick(data) { |
| | | dept_id_log.value = data.id |
| | | roadDroneList() |
| | | } |
| | | |
| | | // 算法 |
| | | const treePropsSF = { |
| | | label: 'dictValue', |
| | | value: 'id', |
| | | children: 'children', |
| | | } |
| | | // 部门 |
| | | const treeDeptProps = { |
| | | label: 'title', |
| | | value: 'id', |
| | | children: 'children', |
| | | } |
| | | const dictKey = ref('') |
| | | const dataList = ref([]) |
| | |
| | | handleSearch() |
| | | } |
| | | |
| | | const handleNodeClick = async data => { |
| | | async function roadDroneList() { |
| | | // 处理机巢数据 |
| | | searchForm.device_sn = ''; |
| | | machineData.value = ''; |
| | | searchForm.device_sn = '' |
| | | machineData.value = '' |
| | | const droneList = await getDeviceRegion({ area_code: area_code_log.value, dept_id: dept_id_log.value }) |
| | | |
| | | const droneList = await getDeviceRegion({ areaCode: data.id }); |
| | | |
| | | machineData.value = droneList?.data?.data; |
| | | machineData.value = droneList?.data?.data |
| | | // 默认选中值 |
| | | if (signDevice_sn.value) { |
| | | searchForm.device_sn = signDevice_sn.value; |
| | | searchForm.device_sn = signDevice_sn.value |
| | | } |
| | | // 所属部门重新请求值 |
| | | searchForm.create_dept = ''; |
| | | deptData.value = []; |
| | | getDeptsByAreaCode(); |
| | | handleSearch(); |
| | | }; |
| | | handleSearch() |
| | | } |
| | | |
| | | // 日期 和周期 |
| | | let timeList = ['today', 'week', 'month', 'year']; |
| | | let timeListStr = ['今日', '本周', '本月', '本年']; |
| | | let timeListEnum = ['TODAY', 'CURRENT_WEEK', 'CURRENT_MONTH', 'CURRENT_YEAR']; |
| | | let checked = ref('month'); |
| | | let checked = ref(''); |
| | | |
| | | // 根据 周期 获取时间段 |
| | | function getDateRange(date_enum) { |
| | | // 设置对应的日期范围 |
| | | switch (date_enum) { |
| | | case 'today': |
| | | dateRange.value = [dayjs().startOf('day').format(timeFormat), dayjs().endOf('day').format(timeFormat)] |
| | | break |
| | | case 'week': |
| | | dateRange.value = [dayjs().startOf('week').format(timeFormat), dayjs().format(timeFormat)] |
| | | break |
| | | case 'month': |
| | | dateRange.value = [dayjs().startOf('month').format(timeFormat), dayjs().format(timeFormat)] |
| | | break |
| | | case 'year': |
| | | dateRange.value = [dayjs().startOf('year').format(timeFormat), dayjs().format(timeFormat)] |
| | | break |
| | | } |
| | | } |
| | | |
| | | let timeClick = (item, index) => { |
| | | if (checked.value === item){ |
| | | if (checked.value === item) { |
| | | checked.value = null |
| | | searchForm.date_enum = undefined |
| | | }else{ |
| | | dateRange.value = [] |
| | | } else { |
| | | checked.value = item |
| | | searchForm.date_enum = timeListEnum[index] |
| | | getDateRange(item) |
| | | } |
| | | dateRange.value = [] |
| | | handleSearch() |
| | | }; |
| | | } |
| | | // 搜索 |
| | | const handleSearch = () => { |
| | | if (!dateRange.value) { |
| | | dateRange.value = []; |
| | | } |
| | | if (dateRange.value && dateRange.value.length) { |
| | | // 有值时 清除 日 本周 本月 本年状态 |
| | | checked.value = ''; |
| | | searchForm.date_enum = ''; |
| | | } |
| | | // if (dateRange.value && dateRange.value.length) { |
| | | // // 有值时 清除 日 本周 本月 本年状态 |
| | | // checked.value = ''; |
| | | // searchForm.date_enum = ''; |
| | | // } |
| | | // 提交至store |
| | | let params = { |
| | | ...searchForm, |
| | |
| | | // 清除算法 |
| | | dictKey.value = ''; |
| | | // algorithmRef.value?.clear() |
| | | handleNodeClick({ id: userAreaCode.value }); |
| | | handleSearch(); |
| | | area_code_log.value = userAreaCode.value |
| | | dept_id_log.value = '' |
| | | roadDroneList() |
| | | // handleSearch(); |
| | | }; |
| | | |
| | | // 新增任务 |
| | |
| | | |
| | | onMounted(() => { |
| | | requestDockInfo(); |
| | | getDeptsByAreaCode() |
| | | getAlgorithmList(); |
| | | // 日历传值 |
| | | const calendarday = ref(route.query.day); |
| | |
| | | const dateArray = [date, date]; |
| | | |
| | | dateRange.value = dateArray; |
| | | searchForm.date_enum = '' |
| | | const find = store.state.tags.bsTagList.find(i => i.path === '/job/jobstatistics') |
| | | find && (find.query = {}) |
| | | } else { |
| | | checked.value = 'month' |
| | | getDateRange('month') |
| | | } |
| | | // 查询一次 |
| | | handleSearch() |
| | | // 查询一次 |
| | | // handleSearch() |
| | | }); |
| | | </script> |
| | | <style lang="scss"></style> |