详情
This commit is contained in:
@ -84,6 +84,19 @@ const COMPONENTS: AppRouteRecordRaw[] = [
|
||||
},
|
||||
component: () => import('@/views/property-marketing/assignment-management/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'management-detail/:id',
|
||||
name: 'managementDetail',
|
||||
meta: {
|
||||
locale: '任务详情',
|
||||
requiresAuth: true,
|
||||
requireLogin: true,
|
||||
roles: ['*'],
|
||||
hideInMenu: true,
|
||||
activeMenu: 'MediaAccountAccountDashboard',
|
||||
},
|
||||
component: () => import('@/views/property-marketing/assignment-management/managementDetail.vue'),
|
||||
},
|
||||
{
|
||||
path: 'detail/:id',
|
||||
name: 'MediaAccountAccountDetails',
|
||||
|
||||
@ -85,6 +85,8 @@ export const MENU_LIST = [
|
||||
'MediaAccountAccountManagement',
|
||||
'MediaAccountAccountDashboard',
|
||||
'MediaAccountAccountDetails',
|
||||
'assignmentManagement',
|
||||
'managementDetail',
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@ -349,63 +349,7 @@ class DateUtils {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期信息(增强版,包含年月信息)
|
||||
* @returns 包含各种格式的当前日期信息
|
||||
*/
|
||||
static getCurrentDateInfo() {
|
||||
const now = new Date();
|
||||
now.setHours(0, 0, 0, 0);
|
||||
|
||||
const monthRange = this.getMonthRange();
|
||||
const weekRange = this.getWeekRange();
|
||||
const yearMonth = this.getCurrentYearMonth();
|
||||
|
||||
return {
|
||||
current: {
|
||||
date: now,
|
||||
formatted: this.formatDate(now),
|
||||
dayOfWeek: this.getChineseDayOfWeek(now),
|
||||
day: now.getDate(),
|
||||
month: yearMonth.month,
|
||||
year: yearMonth.year,
|
||||
},
|
||||
month: {
|
||||
start: monthRange.start,
|
||||
end: monthRange.end,
|
||||
startFormatted: monthRange.startFormatted,
|
||||
endFormatted: monthRange.endFormatted,
|
||||
totalDays: this.getDaysInMonth(now.getFullYear(), now.getMonth() + 1),
|
||||
month: yearMonth.month,
|
||||
year: yearMonth.year,
|
||||
formatted: this.getFormattedYearMonth(),
|
||||
chinese: this.getChineseYearMonth(),
|
||||
},
|
||||
week: {
|
||||
start: weekRange.start,
|
||||
end: weekRange.end,
|
||||
startFormatted: weekRange.startFormatted,
|
||||
endFormatted: weekRange.endFormatted,
|
||||
weekNumber: this.getWeekNumber(now),
|
||||
},
|
||||
year: yearMonth.year,
|
||||
quarter: {
|
||||
number: this.getCurrentQuarter(),
|
||||
range: this.getCurrentQuarterRange(),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期所在的周数
|
||||
* @param date 日期对象
|
||||
* @returns 周数 (1-53)
|
||||
*/
|
||||
static getWeekNumber(date: Date): number {
|
||||
const firstDayOfYear = new Date(date.getFullYear(), 0, 1);
|
||||
const pastDaysOfYear = (date.getTime() - firstDayOfYear.getTime()) / 86400000;
|
||||
return Math.ceil((pastDaysOfYear + firstDayOfYear.getDay() + 1) / 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定年份的所有月份信息
|
||||
|
||||
@ -325,6 +325,11 @@
|
||||
{{ deleteContent }}
|
||||
</div>
|
||||
</a-modal>
|
||||
|
||||
<!-- 添加 TimePicker 组件 -->
|
||||
<a-modal v-model:visible="timePickerVisible" @ok="onTimeConfirm" @cancel="onTimeCancel" title="选择时间">
|
||||
<TimePicker />
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@ -344,6 +349,9 @@ import DateUtils from '@/utils/DateUtils';
|
||||
import TaskDetail from './components/TaskDetail.vue';
|
||||
import { useTableSelectionWithPagination } from '@/hooks/useTableSelectionWithPagination';
|
||||
import emptyIcon from '@/assets/img/media-account/icon-empty.png';
|
||||
import router from '@/router';
|
||||
import TimePicker from '@/components/TimePicker.vue';
|
||||
|
||||
const {
|
||||
dataSource,
|
||||
pageInfo,
|
||||
@ -406,7 +414,7 @@ const deleteContent = ref('');
|
||||
const showModal = ref(false);
|
||||
const modalVisible = ref(false);
|
||||
const selectedTask = ref<any>(null);
|
||||
|
||||
const timePickerVisible = ref(false);
|
||||
const choseType = ref('周');
|
||||
const dayModel = ref(new Date());
|
||||
const weekModel = ref(new Date());
|
||||
@ -455,7 +463,7 @@ const handleDelete = (task: any) => {
|
||||
showModal.value = true;
|
||||
};
|
||||
const handleGoToDetail = (task: any) => {
|
||||
console.log('跳转详情', task);
|
||||
router.push(`/media-account/management-detail/${task.id}`);
|
||||
};
|
||||
const handleOk = () => {
|
||||
showModal.value = false;
|
||||
@ -470,12 +478,22 @@ const handleCancel = () => {
|
||||
|
||||
const handleAddAccount = () => {};
|
||||
const handleModifyTime = (task: any) => {
|
||||
console.log('修改时间', task);
|
||||
// modalVisible.value = false;
|
||||
// // 重新获取数据
|
||||
// getTaskSchedules(query).then((res) => {
|
||||
// data.value = res.data;
|
||||
// });
|
||||
selectedTask.value = task;
|
||||
timePickerVisible.value = true;
|
||||
};
|
||||
|
||||
const onTimeConfirm = () => {
|
||||
if (selectedTask.value && selectedTask.value.execution_time) {
|
||||
// 更新任务的执行时间
|
||||
selectedTask.value.execution_time = new Date().getTime() / 1000; // 假设时间戳是秒级
|
||||
// 重新获取数据
|
||||
handleSearch();
|
||||
}
|
||||
timePickerVisible.value = false;
|
||||
};
|
||||
|
||||
const onTimeCancel = () => {
|
||||
timePickerVisible.value = false;
|
||||
};
|
||||
|
||||
// 计算当前日期范围内的所有日期,统一返回 number 数组
|
||||
|
||||
Reference in New Issue
Block a user