| | |
| | | node-key="id" |
| | | :props="treeDeptProps" |
| | | clearable |
| | | @change="(id) => handleDeptNodeClick({id})" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="任务状态:" v-if="isExpand"> |
| | |
| | | // 机巢 |
| | | 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 = { |
| | |
| | | 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(); |
| | | }; |
| | | |
| | | // 新增任务 |
| | |
| | | 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> |