src/components.d.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/components/list-item/ItemSubTask.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/fysp/task/TaskManage.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/fysp/task/components/CompMonitorPlan.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/views/fysp/task/components/CompSubTaskList.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/components.d.ts
@@ -19,6 +19,7 @@ ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCalendar: typeof import('element-plus/es')['ElCalendar'] ElCard: typeof import('element-plus/es')['ElCard'] ElCascader: typeof import('element-plus/es')['ElCascader'] @@ -47,6 +48,7 @@ ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup'] ElOption: typeof import('element-plus/es')['ElOption'] ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] @@ -65,7 +67,6 @@ ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] ElText: typeof import('element-plus/es')['ElText'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] ElUpload: typeof import('element-plus/es')['ElUpload'] Footer: typeof import('./components/core/Footer.vue')['default'] src/components/list-item/ItemSubTask.vue
@@ -1,20 +1,29 @@ <template> <div class="wrapper"> <div> <el-text truncated class="w-250px" size="large">{{ item.name }}</el-text> <div class="text-title"> {{ item.name }} </div> <div> <el-text truncated class="w-250px" size="small">{{ item.scenseaddress }}</el-text> <div class="text-info"> <div class="text-label"> <el-icon class="m-r-4" size="16"><LocationInformation /></el-icon> <span>任务地址:</span> </div> <div> <el-text truncated size="small">{{ $fm.formatYMDH(item.planstarttime) }}</el-text> {{ item.scenseaddress }} </div> <div> <el-text truncated class="w-250px" size="small">{{ item.executorrealtimes }}</el-text> <div class="text-info"> <div class="text-label"> <!-- <el-icon><Clock /></el-icon> --> <el-icon class="m-r-4" size="16"><AlarmClock /></el-icon> <span>任务时间:</span> </div> {{ $fm.formatYMD(item.planstarttime) }} </div> <div class="text-info"> <div class="text-label"> <el-icon class="m-r-4" size="16"><User /></el-icon> 任务人员: </div> {{ item.executorrealtimes }} </div> <el-row justify="end" style="margin-top: 4px"> <slot :item="item"></slot> @@ -35,8 +44,28 @@ <style scoped> .wrapper { /* width: 300px; */ width: 100%; border: 1px solid var(--el-border-color); border-radius: var(--el-border-radius-base); padding: 4px 8px; } .text-title { font-weight: var(--el-font-weight-primary); color: var(--el-text-color-primary); font-size: var(--el-font-size-medium); } .text-info { display: flex; align-items: flex-start; color: var(--el-text-color-secondary); font-size: var(--el-font-size-small); } .text-label { display: flex; align-items: center; white-space: nowrap; } </style> src/views/fysp/task/TaskManage.vue
@@ -39,24 +39,26 @@ <el-tabs model-value="first"> <el-tab-pane label="监管计划" name="first"> <el-row> <el-col :span="curSubTaskList.length > 0 ? 16 : 24"> <el-col :span="curSubTaskList ? 16 : 24"> <CompMonitorPlan :task="curTask.data" @date-change="onDateChange" ></CompMonitorPlan> </el-col> <el-col v-if="curSubTaskList.length > 0" :span="8"> <el-col v-if="curSubTaskList" :span="8"> <CompSubTaskList create :data="curSubTaskList" :loading="subTaskLoading" height="56vh" @add="subTaskDrawer = true" ></CompSubTaskList> </el-col> </el-row> </el-tab-pane> <el-tab-pane label="监管地图" name="second"> <!-- <el-tab-pane label="监管地图" name="second"> <CompTaskMap></CompTaskMap> </el-tab-pane> </el-tab-pane> --> </el-tabs> </el-row> <el-divider></el-divider> @@ -177,7 +179,8 @@ // 当前选择的日任务 curDayTask: {}, // 当前选择的日任务下的子任务 curSubTaskList: [], curSubTaskList: undefined, subTaskLoading: false, // 总任务新增弹出框 topTaskAddVisible: false }; @@ -238,7 +241,7 @@ this.task = task; this.sideLoading = false; this.mainLoading = true; this.curSubTaskList = [] this.curSubTaskList = undefined; taskApi .fetchMonitorObjectVersion(task.data.tguid) .then((res) => { @@ -268,11 +271,19 @@ }); }, onDateChange(dayTask) { if (dayTask) { this.subTaskLoading = true; // this.subTaskDrawer = true; this.curDayTask = dayTask; taskApi.fetchSubtaskByDayTask(dayTask.guid).then((res) => { taskApi .fetchSubtaskByDayTask(dayTask.guid) .then((res) => { this.curSubTaskList = res; }); }) .finally(() => (this.subTaskLoading = false)); } else { this.curSubTaskList = []; } }, navToTaskCreate(value) { this.topTaskAddVisible = false; src/views/fysp/task/components/CompMonitorPlan.vue
@@ -55,7 +55,7 @@ default: () => {} } }); const emit = defineEmits(['dateChange']) const emit = defineEmits(['dateChange']); // 选中日期 const dateValue = ref(new Date()); // 日历标题 @@ -70,18 +70,27 @@ // 日历范围 const startDay = computed(() => dayjs(props.task.starttime)); const endDay = computed(() => dayjs(props.task.endtime)); const dateRange = computed(() => [startDay.value.toDate(), endDay.value.toDate()]); const dateRange = computed(() => [ startDay.value.toDate(), endDay.value.toDate() ]); // const dateRange = computed(() => [new Date(2024, 4, 27), new Date(2024, 5, 30)]); // 日期是否在任务范围内 function isDayEnable(day) { const _day = dayjs(day); return _day.isSameOrAfter(startDay.value, 'day') && _day.isSameOrBefore(endDay.value, 'day'); return ( _day.isSameOrAfter(startDay.value, 'day') && _day.isSameOrBefore(endDay.value, 'day') ); } /********************** 日期样式 *********************************/ function calendarDayClz(day) { return 'calendar-day ' + (isDayEnable(day) ? 'calendar-day-enable' : 'calendar-day-disable'); return ( 'calendar-day ' + (isDayEnable(day) ? 'calendar-day-enable' : 'calendar-day-disable') ); } function getDay(day) { return day.split('-').splice(1, 2).join('-'); @@ -119,11 +128,11 @@ } function onDateChange(e) { const day = dayjs(e).format('YYYY-MM-DD') const t = computeDayTask(day) console.log(t); emit('dateChange', t) if (isDayEnable(e)) { const day = dayjs(e).format('YYYY-MM-DD'); const t = computeDayTask(day); emit('dateChange', t); } } // 总任务统计 @@ -185,7 +194,7 @@ border: 1px solid rgb(172, 165, 165); border-radius: 50%; */ padding: 8px; height: var(--el-calendar-cell-width); /* min-height: var(--el-calendar-cell-width); */ } .calendar-day-enable { src/views/fysp/task/components/CompSubTaskList.vue
@@ -1,12 +1,24 @@ <template> <el-row justify="space-between"> <el-text>单日计划</el-text> <el-button type="success" size="small" @click="add">新增</el-button> <el-button v-show="create && data && data.length > 0" type="success" size="small" @click="add" >任务调整</el-button > </el-row> <el-divider /> <div> <el-scrollbar :height="height"> <el-space fill direction="vertical"> <el-scrollbar v-loading="loading" :height="height"> <el-space v-if="data && data.length > 0" fill :fill-ratio="100" direction="vertical" style="width: 100%" > <ItemSubTask v-for="s in data" :key="s.guid" :item="s"> <template #default="{ item }"> <el-button type="danger" size="small" @click="remove(item)" @@ -15,6 +27,14 @@ </template> </ItemSubTask> </el-space> <div v-else> <el-empty description="无任务记录" /> <el-row justify="center"> <el-button type="success" size="small" @click="add" >添加任务</el-button > </el-row> </div> </el-scrollbar> </div> </template> @@ -26,7 +46,10 @@ height: { type: String, default: '70vh' } }, // 是否显示添加任务按钮 create: Boolean, loading: Boolean }); const curSubTaskList = ref([]);