Jelajahi Sumber

😎调整优化日程相关代码及更新接口请求文件

zuohuaijun 1 tahun lalu
induk
melakukan
9714f1ed44

+ 6 - 2
Admin.NET/Admin.NET.Core/Entity/SysSchedule.cs

@@ -24,25 +24,29 @@ public class SysSchedule : EntityTenant
     /// </summary>
     [SugarColumn(ColumnDescription = "日程日期")]
     public DateTime? ScheduleTime { get; set; }
+
     /// <summary>
     /// 开始时间
     /// </summary>
     [SugarColumn(ColumnDescription = "开始时间", Length = 10)]
-    public string? StarTime { get; set; }
+    public string? StartTime { get; set; }
+
     /// <summary>
     /// 结束时间
     /// </summary>
     [SugarColumn(ColumnDescription = "结束时间", Length = 10)]
     public string? EndTime { get; set; }
+
     /// <summary>
     /// 日程内容
     /// </summary>
     [SugarColumn(ColumnDescription = "日程内容", Length = 256)]
     [Required, MaxLength(256)]
     public virtual string Content { get; set; }
+
     /// <summary>
     /// 完成状态
     /// </summary>
     [SugarColumn(ColumnDescription = "完成状态")]
-    public FinishStatusEnum Status { get; set; } =  FinishStatusEnum.UnFinish;
+    public FinishStatusEnum Status { get; set; } = FinishStatusEnum.UnFinish;
 }

+ 2 - 4
Admin.NET/Admin.NET.Core/Entity/FinishStatusEnum.cs → Admin.NET/Admin.NET.Core/Enum/FinishStatusEnum.cs

@@ -4,8 +4,8 @@
 //
 // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
 
-
 namespace Admin.NET.Core;
+
 /// <summary>
 /// 完成状态枚举
 /// </summary>
@@ -23,6 +23,4 @@ public enum FinishStatusEnum
     /// </summary>
     [Description("未完成")]
     UnFinish = 0,
-}
-
-
+}

+ 1 - 0
Admin.NET/Admin.NET.Core/Service/Schedule/Dto/ScheduleInput.cs

@@ -13,6 +13,7 @@ public class ScheduleInput : BaseIdInput
     /// </summary>
     public virtual FinishStatusEnum Status { get; set; }
 }
+
 public class ListScheduleInput
 {
     public DateTime? StartTime { get; set; }

+ 2 - 1
Admin.NET/Admin.NET.Core/Service/Schedule/SysScheduleService.cs

@@ -33,7 +33,7 @@ public class SysScheduleService : IDynamicApiController, ITransient
             .Where(u => u.UserId == _userManager.UserId)
             .WhereIF(!string.IsNullOrWhiteSpace(input.StartTime.ToString()), u => u.ScheduleTime >= input.StartTime)
             .WhereIF(!string.IsNullOrWhiteSpace(input.EndTime.ToString()), u => u.ScheduleTime <= input.EndTime)
-            .OrderBy(u => u.StarTime, OrderByType.Asc)
+            .OrderBy(u => u.StartTime, OrderByType.Asc)
             .ToListAsync();
     }
 
@@ -84,6 +84,7 @@ public class SysScheduleService : IDynamicApiController, ITransient
     {
         await _sysSchedule.DeleteAsync(u => u.Id == input.Id);
     }
+
     /// <summary>
     /// 设置日程状态
     /// </summary>

+ 3 - 3
Web/package.json

@@ -2,7 +2,7 @@
 	"name": "admin.net",
 	"type": "module",
 	"version": "2.4.33",
-	"lastBuildTime": "2024.07.17",
+	"lastBuildTime": "2024.07.20",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
 	"author": "zuohuaijun",
 	"license": "MIT",
@@ -54,7 +54,7 @@
 		"splitpanes": "^3.1.5",
 		"vcrontab-3": "^3.3.22",
 		"vform3-builds": "^3.0.10",
-		"vue": "^3.4.32",
+		"vue": "^3.4.33",
 		"vue-clipboard3": "^2.0.0",
 		"vue-demi": "^0.14.8",
 		"vue-grid-layout": "3.0.0-beta1",
@@ -77,7 +77,7 @@
 		"@typescript-eslint/parser": "^7.16.1",
 		"@vitejs/plugin-vue": "^5.0.5",
 		"@vitejs/plugin-vue-jsx": "^4.0.0",
-		"@vue/compiler-sfc": "^3.4.32",
+		"@vue/compiler-sfc": "^3.4.33",
 		"code-inspector-plugin": "^0.14.2",
 		"eslint": "^8.57.0",
 		"eslint-plugin-vue": "^9.27.0",

+ 1 - 1
Web/src/api-services/models/add-schedule-input.ts

@@ -115,7 +115,7 @@ export interface AddScheduleInput {
      * @type {string}
      * @memberof AddScheduleInput
      */
-    starTime?: string | null;
+    startTime?: string | null;
 
     /**
      * 结束时间

+ 2 - 0
Web/src/api-services/models/index.ts

@@ -186,6 +186,7 @@ export * from './file-output';
 export * from './filter';
 export * from './filter-logic-enum';
 export * from './filter-operator-enum';
+export * from './finish-status-enum';
 export * from './gen-auth-url-input';
 export * from './gender-enum';
 export * from './generate-signature-input';
@@ -204,6 +205,7 @@ export * from './job-detail-input';
 export * from './job-detail-output';
 export * from './job-trigger-input';
 export * from './layout-kind';
+export * from './list-schedule-input';
 export * from './log-input';
 export * from './log-level';
 export * from './login-input';

+ 1 - 1
Web/src/api-services/models/sys-schedule.ts

@@ -115,7 +115,7 @@ export interface SysSchedule {
      * @type {string}
      * @memberof SysSchedule
      */
-    starTime?: string | null;
+    startTime?: string | null;
 
     /**
      * 结束时间

+ 1 - 1
Web/src/api-services/models/update-schedule-input.ts

@@ -115,7 +115,7 @@ export interface UpdateScheduleInput {
      * @type {string}
      * @memberof UpdateScheduleInput
      */
-    starTime?: string | null;
+    startTime?: string | null;
 
     /**
      * 结束时间

+ 290 - 287
Web/src/views/home/widgets/components/schedule.vue

@@ -24,21 +24,18 @@
 		</div>
 		<div class="schedule-list">
 			<div class="item" v-for="(item, index) in state.TodayScheduleData" :key="index">
-				<el-icon v-if="item.status==1" class="icon" @click="changeStatus(item)"> <ele-CircleCheck /> </el-icon>
-				<el-icon v-else class=" icon" @click="changeStatus(item)"> <ele-Edit /> </el-icon>
+				<el-icon v-if="item.status == 1" class="icon" @click="changeStatus(item)"> <ele-CircleCheck /> </el-icon>
+				<el-icon v-else class="icon" @click="changeStatus(item)"> <ele-Edit /> </el-icon>
 
 				<span class="content" style="padding-left: 10px" @click="openEditSchedule(item)">
-					<span>
-						{{ item.starTime }} - {{ item.endTime }}
-					</span>
-					<span :class="item.status==1?'finish':'no'" style="padding-left: 15px; font-weight: 600; color: var(--el-color-primary)">
+					<span> {{ item.startTime }} - {{ item.endTime }} </span>
+					<span :class="item.status == 1 ? 'finish' : 'no'" style="padding-left: 15px; font-weight: 600; color: var(--el-color-primary)">
 						{{ item.content }}
 					</span>
 				</span>
-				<span style="float: right;">
+				<span style="float: right">
 					<el-icon class="icon" @click="delItem(item)"> <ele-CircleClose /> </el-icon>
 				</span>
-
 			</div>
 		</div>
 
@@ -47,297 +44,303 @@
 </template>
 
 <script lang="ts">
-	export default {
-		title: '日程',
-		icon: 'ele-Odometer',
-		description: '日程演示',
-	};
+export default {
+	title: '日程',
+	icon: 'ele-Odometer',
+	description: '日程演示',
+};
 </script>
 
 <script setup lang="ts">
-	import { reactive, onMounted, ref } from 'vue';
-	import { dayjs, ElMessage, ElMessageBox } from 'element-plus';
-	import calendar from '/@/utils/calendar.js';
-
-	import EditSchedule from '/@/views/home/widgets/components/scheduleEdit.vue';
-
-	import { getAPI } from '/@/utils/axios-utils';
-	import { SysScheduleApi } from '/@/api-services/api';
-	import { SysSchedule } from '/@/api-services/models';
-	import { stringify } from 'querystring';
-
-	const editScheduleRef = ref<InstanceType<typeof EditSchedule>>();
-	const state = reactive({
-		ScheduleData: [] as Array<SysSchedule>, // 日程列表数据
-		TodayScheduleData: [] as Array<SysSchedule>, // 当天列表数据
-		calendarValue: new Date(),
-		queryParams: {
-			startTime: new Date(),
-			endTime: new Date(),
-		},
-		editTitle: '',
-	});
-
-	// 页面初始化
-	onMounted(async () => {
-		await handleQuery();
-	});
-
-	// 查询操作
-	const handleQuery = async () => {
-		// debugger;
-		state.queryParams.startTime = GetMonthFirstDay(state.calendarValue);
-		state.queryParams.endTime = GetMonthLastDay(state.calendarValue);
-
-		let params = Object.assign(state.queryParams);
-		var res = await getAPI(SysScheduleApi).apiSysSchedulePagePost(params);
-		state.ScheduleData = res.data.result ?? [];
-		if (state.ScheduleData.length > 0) {
-			state.TodayScheduleData = state.ScheduleData.filter((item) => {
-				return FormatDate(item.scheduleTime) == FormatDate(state.calendarValue);
-			});
-		}
-	};
-	// 删除
-	const delItem = (row: any) => {
-		ElMessageBox.confirm(`确定删日程:【${row.startTime}-${row.endTime}(${row.content})})】?`, '提示', {
-			confirmButtonText: '确定',
-			cancelButtonText: '取消',
-			type: 'warning',
+import { reactive, onMounted, ref } from 'vue';
+import { dayjs, ElMessage, ElMessageBox } from 'element-plus';
+import calendar from '/@/utils/calendar.js';
+
+import EditSchedule from '/@/views/home/widgets/components/scheduleEdit.vue';
+
+import { getAPI } from '/@/utils/axios-utils';
+import { SysScheduleApi } from '/@/api-services/api';
+import { SysSchedule } from '/@/api-services/models';
+
+const editScheduleRef = ref<InstanceType<typeof EditSchedule>>();
+const state = reactive({
+	ScheduleData: [] as Array<SysSchedule>, // 日程列表数据
+	TodayScheduleData: [] as Array<SysSchedule>, // 当天列表数据
+	calendarValue: new Date(),
+	queryParams: {
+		startTime: new Date(),
+		endTime: new Date(),
+	},
+	editTitle: '',
+});
+
+// 页面初始化
+onMounted(async () => {
+	await handleQuery();
+});
+
+// 查询操作
+const handleQuery = async () => {
+	// debugger;
+	state.queryParams.startTime = GetMonthFirstDay(state.calendarValue);
+	state.queryParams.endTime = GetMonthLastDay(state.calendarValue);
+
+	let params = Object.assign(state.queryParams);
+	var res = await getAPI(SysScheduleApi).apiSysSchedulePagePost(params);
+	state.ScheduleData = res.data.result ?? [];
+	if (state.ScheduleData.length > 0) {
+		state.TodayScheduleData = state.ScheduleData.filter((item) => {
+			return FormatDate(item.scheduleTime) == FormatDate(state.calendarValue);
+		});
+	}
+};
+
+// 删除
+const delItem = (row: any) => {
+	console.log(row);
+	ElMessageBox.confirm(`确定删日程:${row.startTime}-${row.endTime}【${row.content}】?`, '提示', {
+		confirmButtonText: '确定',
+		cancelButtonText: '取消',
+		type: 'warning',
+	})
+		.then(async () => {
+			await getAPI(SysScheduleApi).apiSysScheduleDeletePost(row);
+			await handleQuery();
+			ElMessage.success('删除成功');
 		})
-			.then(async () => {
-				await getAPI(SysScheduleApi).apiSysScheduleDeletePost(row);
-				await handleQuery();
-				ElMessage.success('删除成功');
-			})
-			.catch(() => {});
-	};
-	// 修改状态
-	const changeStatus = async (row: any) => {
-		await getAPI(SysScheduleApi)
-			.apiSysScheduleSetStatusPost({ id: row.id, status: row.status == 1 ? 0 : 1 })
-			.then(() => {
-				row.status = row.status == 1 ? 0 : 1;
-				ElMessage.success('日程状态设置成功');
-			})
-			.catch(() => {
-				ElMessage.success('日程状态设置异常');
-			});
-	};
-	// 农历转换
-	const solarDate2lunar = (solarDate: any) => {
-		var solar = solarDate.split('-');
-		var lunar = calendar.solar2lunar(solar[0], solar[1], solar[2]);
-		// return solar[1] + '-' + solar[2] + '\n' + lunar.IMonthCn + lunar.IDayCn;
-		return lunar.IMonthCn + lunar.IDayCn;
-	};
-
-	// 按天查询
-	const handleQueryByDate = async (date: any) => {
-		state.queryParams.startTime = FormatDateDelHMS(date);
-		state.queryParams.endTime = FormatDateEndHMS(date);
-		let params = Object.assign(state.queryParams);
-		var res = await getAPI(SysScheduleApi).apiSysSchedulePagePost(params);
-		state.TodayScheduleData = res.data.result ?? [];
-	};
-
-	// 打开新增页面
-	const openAddSchedule = () => {
-		var timerange = GetRecentTime();
-
-		state.editTitle = '添加日程';
-		editScheduleRef.value?.openDialog({ id: undefined, status: 0, orderNo: 100, starTime: timerange.starTime, endTime: timerange.endTime });
-	};
-
-	// 打开编辑页面
-	const openEditSchedule = async (row: any) => {
-		if (row.status == 1) return;
-		state.editTitle = '编辑日程';
-		editScheduleRef.value?.openDialog(row, true);
-	};
-
-	// 点击日历中的日期
-	const handleClickDate = async (data: any) => {
-		await handleQueryByDate(data.day);
-	};
-	// 获取当月第一天
-	const GetMonthFirstDay = (date: any) => {
-		var newDate = new Date(date);
-		newDate.setDate(1);
-		newDate.setHours(0);
-		newDate.setMinutes(0);
-		newDate.setSeconds(0);
-		return newDate;
-	};
-	// 获取当月最后一天
-	const GetMonthLastDay = (date: any) => {
-		var newDate = new Date(date);
-		newDate.setMonth(newDate.getMonth() + 1);
-		newDate.setDate(0);
-		newDate.setHours(0);
-		newDate.setMinutes(0);
-		newDate.setSeconds(0);
-		return newDate;
-	};
-
-	// 去掉时分秒的日期
-	const FormatDateDelHMS = (date: any) => {
-		var newDate = new Date(date);
-		newDate.setHours(0);
-		newDate.setMinutes(0);
-		newDate.setSeconds(0);
-		return newDate;
-	};
-
-	const FormatDateEndHMS = (date: any) => {
-		var newDate = new Date(date);
-		newDate.setHours(23);
-		newDate.setMinutes(59);
-		newDate.setSeconds(59);
-		return newDate;
-	};
-
-	// 格式化日期
-	const FormatDate = (date: any) => {
-		return dayjs(date).format('YYYY-MM-DD');
-	};
-	//获取最近的初始时间  EndTime默认为StarTime + 1(hour)
-	const GetRecentTime = () => {
-		var date = new Date();
-		//计算最近的开始时间
-		var currentHour = date.getHours();
-		var currentMin = date.getMinutes();
-
-		var starHour = dayjs(date).format('HH');
-		var endHour = dayjs(date).format('HH');
-		var starMin = '00';
-		var endMin = '00';
-		//如果当前时间已经23 那么starHour和endHour都是23
-		if (currentHour == 23) {
-			starHour = '23';
-			endHour = '23';
-			starMin = '00';
+		.catch(() => {});
+};
+
+// 修改状态
+const changeStatus = async (row: any) => {
+	await getAPI(SysScheduleApi)
+		.apiSysScheduleSetStatusPost({ id: row.id, status: row.status == 1 ? 0 : 1 })
+		.then(() => {
+			row.status = row.status == 1 ? 0 : 1;
+			ElMessage.success('日程状态设置成功');
+		})
+		.catch(() => {
+			ElMessage.success('日程状态设置异常');
+		});
+};
+
+// 农历转换
+const solarDate2lunar = (solarDate: any) => {
+	var solar = solarDate.split('-');
+	var lunar = calendar.solar2lunar(solar[0], solar[1], solar[2]);
+	// return solar[1] + '-' + solar[2] + '\n' + lunar.IMonthCn + lunar.IDayCn;
+	return lunar.IMonthCn + lunar.IDayCn;
+};
+
+// 按天查询
+const handleQueryByDate = async (date: any) => {
+	state.queryParams.startTime = FormatDateDelHMS(date);
+	state.queryParams.endTime = FormatDateEndHMS(date);
+	let params = Object.assign(state.queryParams);
+	var res = await getAPI(SysScheduleApi).apiSysSchedulePagePost(params);
+	state.TodayScheduleData = res.data.result ?? [];
+};
+
+// 打开新增页面
+const openAddSchedule = () => {
+	var timerange = GetRecentTime();
+
+	state.editTitle = '添加日程';
+	editScheduleRef.value?.openDialog({ id: undefined, status: 0, orderNo: 100, startTime: timerange.startTime, endTime: timerange.endTime });
+};
+
+// 打开编辑页面
+const openEditSchedule = async (row: any) => {
+	if (row.status == 1) return;
+	state.editTitle = '编辑日程';
+	editScheduleRef.value?.openDialog(row, true);
+};
+
+// 点击日历中的日期
+const handleClickDate = async (data: any) => {
+	await handleQueryByDate(data.day);
+};
+
+// 获取当月第一天
+const GetMonthFirstDay = (date: any) => {
+	var newDate = new Date(date);
+	newDate.setDate(1);
+	newDate.setHours(0);
+	newDate.setMinutes(0);
+	newDate.setSeconds(0);
+	return newDate;
+};
+
+// 获取当月最后一天
+const GetMonthLastDay = (date: any) => {
+	var newDate = new Date(date);
+	newDate.setMonth(newDate.getMonth() + 1);
+	newDate.setDate(0);
+	newDate.setHours(0);
+	newDate.setMinutes(0);
+	newDate.setSeconds(0);
+	return newDate;
+};
+
+// 去掉时分秒的日期
+const FormatDateDelHMS = (date: any) => {
+	var newDate = new Date(date);
+	newDate.setHours(0);
+	newDate.setMinutes(0);
+	newDate.setSeconds(0);
+	return newDate;
+};
+
+const FormatDateEndHMS = (date: any) => {
+	var newDate = new Date(date);
+	newDate.setHours(23);
+	newDate.setMinutes(59);
+	newDate.setSeconds(59);
+	return newDate;
+};
+
+// 格式化日期
+const FormatDate = (date: any) => {
+	return dayjs(date).format('YYYY-MM-DD');
+};
+
+// 获取最近的初始时间  EndTime默认为StartTime + 1(hour)
+const GetRecentTime = () => {
+	var date = new Date();
+	// 计算最近的开始时间
+	var currentHour = date.getHours();
+	var currentMin = date.getMinutes();
+
+	var starHour = dayjs(date).format('HH');
+	var endHour = dayjs(date).format('HH');
+	var starMin = '00';
+	var endMin = '00';
+	// 如果当前时间已经23 那么starHour和endHour都是23
+	if (currentHour == 23) {
+		starHour = '23';
+		endHour = '23';
+		starMin = '00';
+		endMin = '45';
+	} else {
+		// 判断分钟数属于那个层级
+		if (currentMin < 15) {
+			starMin = '15';
+			endMin = '15';
+			// 计算结束时间
+			date.setHours(date.getHours() + 1);
+			endHour = dayjs(date).format('HH');
+		} else if (currentMin >= 15 && currentMin < 30) {
+			starMin = '30';
+			endMin = '30';
+
+			// 计算结束时间
+			date.setHours(date.getHours() + 1);
+			endHour = dayjs(date).format('HH');
+		} else if (currentMin >= 30 && currentMin < 45) {
+			starMin = '45';
 			endMin = '45';
-		} else {
-			//判断分钟数属于那个层级
-			if (currentMin < 15) {
-				starMin = '15';
-				endMin = '15';
-				//计算结束时间
-				date.setHours(date.getHours() + 1);
-				endHour = dayjs(date).format('HH');
-			} else if (currentMin >= 15 && currentMin < 30) {
-				starMin = '30';
-				endMin = '30';
-
-				//计算结束时间
-				date.setHours(date.getHours() + 1);
-				endHour = dayjs(date).format('HH');
-			} else if (currentMin >= 30 && currentMin < 45) {
-				starMin = '45';
-				endMin = '45';
-				//计算结束时间
-				date.setHours(date.getHours() + 1);
-				endHour = dayjs(date).format('HH');
-			} else if (currentMin >= 45) {
-				//分钟 : 00
-				starMin = '00';
-				endMin = '00';
-
-				//开始时间+1
-				date.setHours(date.getHours() + 1);
-				starHour = dayjs(date).format('HH');
-				//计算结束时间
-				date.setHours(date.getHours() + 1);
-				endHour = dayjs(date).format('HH');
-			}
+			// 计算结束时间
+			date.setHours(date.getHours() + 1);
+			endHour = dayjs(date).format('HH');
+		} else if (currentMin >= 45) {
+			// 分钟 : 00
+			starMin = '00';
+			endMin = '00';
+
+			// 开始时间+1
+			date.setHours(date.getHours() + 1);
+			starHour = dayjs(date).format('HH');
+			// 计算结束时间
+			date.setHours(date.getHours() + 1);
+			endHour = dayjs(date).format('HH');
 		}
-		return { starTime: starHour + ':' + starMin, endTime: endHour + ':' + endMin };
-	};
+	}
+	return { startTime: starHour + ':' + starMin, endTime: endHour + ':' + endMin };
+};
 </script>
 
 <style lang="scss" scoped>
-	.custome-canlendar {
-		position: relative;
-		text-align: center;
-
-		:deep(.el-calendar) {
-			.el-calendar-table .el-calendar-day {
-				width: 100%;
-				height: 100%;
-			}
-
-			.el-calendar__body {
-				padding: 5px 0;
-			}
-
-			.el-calendar-table .el-calendar-day {
-				position: relative;
-			}
-
-			td .spandate {
-				margin: auto;
-				width: 26px;
-				height: 26px;
-				line-height: 26px;
-				border-radius: 50%;
-			}
-			td.is-selected .spandate {
-				width: 26px;
-				height: 26px;
-				line-height: 26px;
-				border-radius: 50%;
-				color: #fff;
-				background-color: var(--el-color-primary);
-			}
-			/*小红点样式*/
-			.el-badge {
-				position: absolute;
-				left: 0;
-				bottom: -8px;
-				width: 100%;
-			}
+.custome-canlendar {
+	position: relative;
+	text-align: center;
+
+	:deep(.el-calendar) {
+		.el-calendar-table .el-calendar-day {
+			width: 100%;
+			height: 100%;
 		}
-	}
 
-	// 日程列表
-	.schedule-list {
-		overflow-y: auto;
-		height: 150px;
-		.item {
+		.el-calendar__body {
+			padding: 5px 0;
+		}
+
+		.el-calendar-table .el-calendar-day {
 			position: relative;
-			margin-bottom: 5px;
-			padding: 0 11px;
-			line-height: 24px;
-			background-color: #f1f1f1;
-			cursor: pointer;
-
-			&::before {
-				position: absolute;
-				left: 0;
-				top: 0;
-				height: 100%;
-				content: '';
-				width: 3px;
-				background: var(--el-color-primary);
-			}
-
-			.date {
-				margin-right: 5px;
-				font-size: 14px;
-			}
-			.content {
-				color: #666;
-				font-size: 14px;
-			}
-			.icon {
-				display: inline;
-				vertical-align: middle;
-				color: var(--el-color-primary);
-			}
-			.finish {
-				text-decoration: 3px solid line-through gray !important;
-			}
+		}
+
+		td .spandate {
+			margin: auto;
+			width: 26px;
+			height: 26px;
+			line-height: 26px;
+			border-radius: 50%;
+		}
+		td.is-selected .spandate {
+			width: 26px;
+			height: 26px;
+			line-height: 26px;
+			border-radius: 50%;
+			color: #fff;
+			background-color: var(--el-color-primary);
+		}
+		/*小红点样式*/
+		.el-badge {
+			position: absolute;
+			left: 0;
+			bottom: -8px;
+			width: 100%;
+		}
+	}
+}
+
+// 日程列表
+.schedule-list {
+	overflow-y: auto;
+	height: 150px;
+	.item {
+		position: relative;
+		margin-bottom: 5px;
+		padding: 0 11px;
+		line-height: 24px;
+		background-color: #f1f1f1;
+		cursor: pointer;
+
+		&::before {
+			position: absolute;
+			left: 0;
+			top: 0;
+			height: 100%;
+			content: '';
+			width: 3px;
+			background: var(--el-color-primary);
+		}
+
+		.date {
+			margin-right: 5px;
+			font-size: 14px;
+		}
+		.content {
+			color: #666;
+			font-size: 14px;
+		}
+		.icon {
+			display: inline;
+			vertical-align: middle;
+			color: var(--el-color-primary);
+		}
+		.finish {
+			text-decoration: line-through 2px var(--el-color-danger) !important;
 		}
 	}
+}
 </style>

+ 99 - 97
Web/src/views/home/widgets/components/scheduleEdit.vue

@@ -15,14 +15,14 @@
 						</el-form-item>
 					</el-col>
 					<el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5" class="mb20 time-padding">
-						<el-form-item prop="starTime" :rules="[{ required: true, message: '开始时间不能为空', trigger: 'blur' }]">
-							<el-time-select v-model="state.ruleForm.starTime" format="HH:mm" start="00:00" end="23:45" step="00:15" class="w100" clearable @change="ChangeEndTime()" />
+						<el-form-item prop="startTime" :rules="[{ required: true, message: '开始时间不能为空', trigger: 'blur' }]">
+							<el-time-select v-model="state.ruleForm.startTime" format="HH:mm" start="00:00" end="23:45" step="00:15" class="w100" clearable @change="ChangeEndTime()" />
 						</el-form-item>
 					</el-col>
 					<span>至</span>
 					<el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5" class="mb20 time-padding">
 						<el-form-item prop="endTime" :rules="[{ required: true, message: '结束时间不能为空', trigger: 'blur' }]">
-							<el-time-select v-model="state.ruleForm.endTime" :min-time="state.ruleForm.starTime" format="HH:mm" start="00:00" end="23:45" step="00:15" class="w100" clearable />
+							<el-time-select v-model="state.ruleForm.endTime" :min-time="state.ruleForm.startTime" format="HH:mm" start="00:00" end="23:45" step="00:15" class="w100" clearable />
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
@@ -44,113 +44,115 @@
 </template>
 
 <script lang="ts" setup name="editSchedule">
-	import { onMounted, reactive, ref } from 'vue';
-	import { dayjs, ElMessageBox, ElMessage } from 'element-plus';
+import { onMounted, reactive, ref } from 'vue';
+import { dayjs, ElMessageBox, ElMessage } from 'element-plus';
 
-	import { getAPI } from '/@/utils/axios-utils';
-	import { SysScheduleApi } from '/@/api-services/api';
-	import { SysSchedule, UpdateScheduleInput } from '/@/api-services/models';
+import { getAPI } from '/@/utils/axios-utils';
+import { SysScheduleApi } from '/@/api-services/api';
+import { SysSchedule, UpdateScheduleInput } from '/@/api-services/models';
 
-	const props = defineProps({
-		title: String,
-		userScheduleData: Array<SysSchedule>,
-	});
-	const emits = defineEmits(['handleQuery']);
-	const ruleFormRef = ref();
-	const state = reactive({
-		isShowDialog: false,
-		showRemove: false,
-		ruleForm: {} as any,
-	});
+const props = defineProps({
+	title: String,
+	userScheduleData: Array<SysSchedule>,
+});
+const emits = defineEmits(['handleQuery']);
+const ruleFormRef = ref();
+const state = reactive({
+	isShowDialog: false,
+	showRemove: false,
+	ruleForm: {} as any,
+});
 
-	// 页面初始化
-	onMounted(async () => {});
+// 页面初始化
+onMounted(() => {});
 
-	// 打开弹窗
-	const openDialog = (row: any, showRemove: boolean = false) => {
-		ruleFormRef.value?.resetFields();
-		state.showRemove = showRemove;
+// 打开弹窗
+const openDialog = (row: any, showRemove: boolean = false) => {
+	ruleFormRef.value?.resetFields();
+	state.showRemove = showRemove;
 
-		state.ruleForm = JSON.parse(JSON.stringify(row));
-		state.ruleForm.scheduleTime = dayjs(state.ruleForm.scheduleTime ?? new Date()).format('YYYY-MM-DD HH:mm:ss');
-		state.isShowDialog = true;
-	};
+	state.ruleForm = JSON.parse(JSON.stringify(row));
+	state.ruleForm.scheduleTime = dayjs(state.ruleForm.scheduleTime ?? new Date()).format('YYYY-MM-DD HH:mm:ss');
+	state.isShowDialog = true;
+};
 
-	// 关闭弹窗
-	const closeDialog = () => {
-		emits('handleQuery', true);
-		state.isShowDialog = false;
-	};
+// 关闭弹窗
+const closeDialog = () => {
+	emits('handleQuery', true);
+	state.isShowDialog = false;
+};
 
-	// 取消
-	const cancel = () => {
-		state.isShowDialog = false;
-	};
+// 取消
+const cancel = () => {
+	state.isShowDialog = false;
+};
 
-	// 提交
-	const submit = () => {
-		ruleFormRef.value.validate(async (valid: boolean) => {
-			if (!valid) return;
-			if (state.ruleForm.id != undefined && state.ruleForm.id > 0) {
-				await getAPI(SysScheduleApi).apiSysScheduleUpdatePost(state.ruleForm);
-			} else {
-				await getAPI(SysScheduleApi).apiSysScheduleAddPost(state.ruleForm);
-			}
-			closeDialog();
-		});
-	};
+// 提交
+const submit = () => {
+	ruleFormRef.value.validate(async (valid: boolean) => {
+		if (!valid) return;
+		if (state.ruleForm.id != undefined && state.ruleForm.id > 0) {
+			await getAPI(SysScheduleApi).apiSysScheduleUpdatePost(state.ruleForm);
+		} else {
+			await getAPI(SysScheduleApi).apiSysScheduleAddPost(state.ruleForm);
+		}
+		closeDialog();
+	});
+};
 
-	// 删除
-	const remove = () => {
-		ElMessageBox.confirm(`确定删除吗?`, '提示', {
-			confirmButtonText: '确定',
-			cancelButtonText: '取消',
-			type: 'warning',
+// 删除
+const remove = () => {
+	ElMessageBox.confirm(`确定删除吗?`, '提示', {
+		confirmButtonText: '确定',
+		cancelButtonText: '取消',
+		type: 'warning',
+	})
+		.then(async () => {
+			await getAPI(SysScheduleApi).apiSysScheduleDeletePost(state.ruleForm);
+			closeDialog();
+			ElMessage.success('操作成功');
 		})
-			.then(async () => {
-				await getAPI(SysScheduleApi).apiSysScheduleDeletePost(state.ruleForm);
-				closeDialog();
-				ElMessage.success('操作成功');
-			})
-			.catch(() => {});
-	};
-	//开始时间改变
-	const ChangeEndTime = () => {
-		//转成日期
-		var timeStr = state.ruleForm.starTime;
-		var parts = timeStr.split(':');
-		var hours = parseInt(parts[0], 10);
-		var minutes = parseInt(parts[1], 10);
+		.catch(() => {});
+};
 
-		var starTime = new Date();
-		starTime.setHours(hours);
-		starTime.setMinutes(minutes);
+// 开始时间改变
+const ChangeEndTime = () => {
+	// 转成日期
+	var timeStr = state.ruleForm.startTime;
+	var parts = timeStr.split(':');
+	var hours = parseInt(parts[0], 10);
+	var minutes = parseInt(parts[1], 10);
 
-		if (starTime.getHours() < 23) {
-			starTime.setHours(starTime.getHours() + 1);
-			state.ruleForm.endTime = dayjs(starTime).format('HH:mm');
-		} else {
-			state.ruleForm.endTime = '23:45';
-		}
-	};
-	// 导出对象
-	defineExpose({ openDialog });
+	var startTime = new Date();
+	startTime.setHours(hours);
+	startTime.setMinutes(minutes);
+
+	if (startTime.getHours() < 23) {
+		startTime.setHours(startTime.getHours() + 1);
+		state.ruleForm.endTime = dayjs(startTime).format('HH:mm');
+	} else {
+		state.ruleForm.endTime = '23:45';
+	}
+};
+
+// 导出对象
+defineExpose({ openDialog });
 </script>
 
 <style lang="scss" scoped>
-	.editSchedule-container {
-		.no-pre-icon {
-			color: red;
-		}
-	}
-	:v-deep(.el-select__prefix) {
-		display: none !important;
-	}
-	.time-padding-right {
-		padding-right: 1px !important;
-	}
-	.time-padding {
-		padding-left: 10px !important;
-		padding-right: 10px !important;
+.editSchedule-container {
+	.no-pre-icon {
+		color: red;
 	}
-</style>
+}
+:v-deep(.el-select__prefix) {
+	display: none !important;
+}
+.time-padding-right {
+	padding-right: 1px !important;
+}
+.time-padding {
+	padding-left: 10px !important;
+	padding-right: 10px !important;
+}
+</style>