|
|
@@ -44,6 +44,9 @@
|
|
|
<a-button :disabled="!dateRange" class="action-btn" @click="selectWorkdays">
|
|
|
选择区间内的工作日
|
|
|
</a-button>
|
|
|
+ <a-button :disabled="!dateRange" class="action-btn" @click="selectAllDates">
|
|
|
+ 选择区间内的所有日期
|
|
|
+ </a-button>
|
|
|
<a-button type="primary" :disabled="isCalendarDisabled" class="action-btn" @click="selectWorkdaysOfYear">
|
|
|
选择年度剩余工作日
|
|
|
</a-button>
|
|
|
@@ -665,6 +668,60 @@ const selectWorkdays = async () => {
|
|
|
message.success(`本次共选择了 ${currentDates.value.length} 个工作日`);
|
|
|
};
|
|
|
|
|
|
+// 选择区间内的所有日期
|
|
|
+const selectAllDates = async () => {
|
|
|
+ if (!dateRange.value || !dateRange.value[0] || !dateRange.value[1]) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const startDate = dateRange.value[0];
|
|
|
+ const endDate = dateRange.value[1];
|
|
|
+
|
|
|
+ // 生成日期范围内的所有日期
|
|
|
+ const allDates = [];
|
|
|
+ let currentDate = startDate.clone();
|
|
|
+ console.log('currentDate',startDate, currentDate, endDate);
|
|
|
+
|
|
|
+ while (currentDate <= endDate) {
|
|
|
+ allDates.push(currentDate.format('YYYY-MM-DD'));
|
|
|
+ currentDate = currentDate.add(1, 'day');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将选中的日期添加到当前日期列表(避免重复)
|
|
|
+ allDates.forEach(dateStr => {
|
|
|
+ if (
|
|
|
+ !currentDates.value.includes(dateStr) &&
|
|
|
+ !preDates.value.includes(dateStr)
|
|
|
+ ) {
|
|
|
+ currentDates.value.push(dateStr);
|
|
|
+ } else if (
|
|
|
+ preDates.value.includes(dateStr) &&
|
|
|
+ canceledDates.value.includes(dateStr)
|
|
|
+ ) {
|
|
|
+ // 如果日期在历史数据中且被取消了,从取消列表中移除
|
|
|
+ canceledDates.value = canceledDates.value.filter(d => d !== dateStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 对当前日期列表排序
|
|
|
+ currentDates.value.sort();
|
|
|
+
|
|
|
+ // 重新构建总选中列表
|
|
|
+ const filteredPreDates = preDates.value.filter(
|
|
|
+ d => !canceledDates.value.includes(d),
|
|
|
+ );
|
|
|
+ selectedDates.value = [
|
|
|
+ ...new Set([...filteredPreDates, ...currentDates.value]),
|
|
|
+ ];
|
|
|
+ selectedDates.value.sort();
|
|
|
+
|
|
|
+ // 更新日历视图为开始日期所在的月份
|
|
|
+ currentMonth.value = startDate.month();
|
|
|
+ currentYear.value = startDate.year();
|
|
|
+
|
|
|
+ message.success(`本次共选择了 ${currentDates.value.length} 个日期`);
|
|
|
+};
|
|
|
+
|
|
|
// 保存选择
|
|
|
const saveSelections = () => {
|
|
|
if (isCalendarDisabled.value) {
|
|
|
@@ -957,7 +1014,7 @@ const fetchAllDeviceIds = async () => {
|
|
|
};
|
|
|
|
|
|
const url =
|
|
|
- 'DeviceManagementResource/queryDeviceManagementDtoByScreenAndRfid';
|
|
|
+ 'DeviceManagementResource/queryDeviceManagementDtoByScreen';
|
|
|
|
|
|
await ajaxApi(url, params).then(
|
|
|
success => {
|
|
|
@@ -1004,7 +1061,7 @@ const fetchDevices = async (search = '', reset = false) => {
|
|
|
};
|
|
|
|
|
|
const url =
|
|
|
- 'DeviceManagementResource/queryDeviceManagementDtoByScreenAndRfid';
|
|
|
+ 'DeviceManagementResource/queryDeviceManagementDtoByScreen';
|
|
|
|
|
|
await ajaxApi(url, params).then(
|
|
|
success => {
|