| | |
| | | <template> |
| | | <BaseContentLayout> |
| | | <BaseContentLayout asideWidth="0"> |
| | | <template #header> |
| | | <!-- <FYSearchBar @search="search"> |
| | | <template #options> |
| | | <FYOptionLocation |
| | | :allOption="true" |
| | | :level="3" |
| | | :checkStrictly="false" |
| | | v-model:value="formSearch.locations" |
| | | ></FYOptionLocation> |
| | | </template> |
| | | </FYSearchBar> --> |
| | | <div class="task-switcher"> |
| | | <el-button @click="switchTask(-1)" icon="ArrowLeft">前一个</el-button> |
| | | <el-select |
| | | v-model="curTaskTitle" |
| | | @change="(t) => chooseTask(tasks.find((e) => e.title == t))" |
| | | style="width: 260px" |
| | | > |
| | | <el-option v-for="s in tasks" :key="s.title" :label="s.title" :value="s.title" /> |
| | | </el-select> |
| | | <el-button @click="switchTask(1)" icon="ArrowRight">后一个</el-button> |
| | | </div> |
| | | </template> |
| | | <template #aside> |
| | | <SideList :items="tasks" :loading="sideLoading" @item-click="chooseTask"></SideList> |
| | | <!-- <SideList :items="tasks" :loading="sideLoading" @item-click="chooseTask"></SideList> --> |
| | | </template> |
| | | <template #main> |
| | | <ToolBar |
| | |
| | | :loading="mainLoading" |
| | | ></ToolBar> |
| | | <div v-if="curMonitorObjList.length > 0" v-loading="mainLoading"> |
| | | <!-- <div><el-text>监管计划</el-text></div> |
| | | <el-button type="warning" size="small" @click="editPlan" |
| | | >计划调整</el-button |
| | | > --> |
| | | <!-- <el-tabs model-value="first"> |
| | | <el-tab-pane label="巡查计划" name="first"> --> |
| | | <el-space justify="" :size="30" style="padding: 16px 0px 16px 16px"> |
| | | <el-text size="large">巡查计划</el-text> |
| | | <el-radio-group v-model="selectedSceneType" fill="#409eff"> |
| | |
| | | // 当前任务的展示中的监管对象 |
| | | showMonitorObjList: [], |
| | | //当前选中的任务 |
| | | curTaskTitle: '', |
| | | curTask: {}, |
| | | // 当前任务索引 |
| | | currentTaskIndex: 0, |
| | | //当前选中的日任务 |
| | | curDayTaskList: [], |
| | | daytaskLoading: false, |
| | |
| | | data: r, |
| | | } |
| | | }) |
| | | this.tasks = list |
| | | this.tasks = list.filter((e) => { |
| | | return ( |
| | | e.data.districtname == '徐汇区' && dayjs(e.data.starttime).isBefore(dayjs('2023-12-31')) |
| | | ) |
| | | }) |
| | | if (list.length == 0) { |
| | | this.sideLoading = false |
| | | this.mainLoading = false |
| | | } else { |
| | | this.curTaskTitle = this.tasks[this.currentTaskIndex].title |
| | | this.chooseTask(this.tasks[this.currentTaskIndex]) |
| | | } |
| | | }) |
| | | }, |
| | | // 切换任务 |
| | | switchTask(direction) { |
| | | if (this.tasks.length === 0) return |
| | | |
| | | this.currentTaskIndex = |
| | | (this.currentTaskIndex + direction + this.tasks.length) % this.tasks.length |
| | | this.chooseTask(this.tasks[this.currentTaskIndex]) |
| | | }, |
| | | //获取任务的完成情况 |
| | | getTaskType(s) { |
| | |
| | | return type |
| | | }, |
| | | chooseTask(task) { |
| | | // const task = this.tasks.find((e) => e.title == taskTitle) |
| | | this.curTaskTitle = task.title |
| | | this.task = task |
| | | this.sideLoading = false |
| | | this.mainLoading = true |
| | |
| | | taskApi |
| | | .fetchMonitorObjectVersion(task.data.tguid) |
| | | .then((res) => { |
| | | this.curMonitorObjList = res |
| | | this.curMonitorObjList = res.filter((item) => { |
| | | return item.scene.type == '餐饮' |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | this.mainLoading = false |
| | |
| | | .el-drawer__custom { |
| | | padding: 0px !important; |
| | | } |
| | | .task-switcher { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 10px; |
| | | padding: 10px; |
| | | } |
| | | </style> |