From 3cd8628d8f9cb5918e04c755d305216865790287 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 08 六月 2026 17:53:04 +0800
Subject: [PATCH] 新疆大罗素 1.会议列表展示不出来 2.会议申请时间选不了 2.会议审批参会人数一直是0人
---
src/views/collaborativeApproval/notificationManagement/meetIndex/index.vue | 51 ++++++++++++++++++++++++++-------------------------
1 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/src/views/collaborativeApproval/notificationManagement/meetIndex/index.vue b/src/views/collaborativeApproval/notificationManagement/meetIndex/index.vue
index 9b5325f..98ad616 100644
--- a/src/views/collaborativeApproval/notificationManagement/meetIndex/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/meetIndex/index.vue
@@ -45,7 +45,7 @@
<div
class="cell content-cell"
:class="[cell.type, `status-${cell.meeting?.status || '0'}`]"
- :style="{ flex: cell.span-0.2 }"
+ :style="{ flex: cell.span }"
@click="viewMeetingDetails(cell)"
>
<div v-if="cell.type === 'meeting'" class="meeting-content">
@@ -89,7 +89,7 @@
</template>
<script setup>
-import {ref, reactive, onMounted} from 'vue'
+import {ref, reactive, onMounted, onActivated} from 'vue'
import {ElMessage} from 'element-plus'
import {getMeetingUseList} from "@/api/collaborativeApproval/meeting.js"
import dayjs from "dayjs";
@@ -111,17 +111,17 @@
// 鏄惁鏄剧ず璇︽儏瀵硅瘽妗�
const detailDialogVisible = ref(false)
-// 鍒濆鍖栨椂闂存Ы锛堜互鍗婂皬鏃朵负闂撮殧锛屼粠8:00鍒�18:00锛�
+// 鍒濆鍖栨椂闂存Ы锛堜互鍗婂皬鏃朵负闂撮殧锛屼粠8:00鍒�19:00锛�
const initTimeSlots = () => {
const slots = []
- for (let hour = 8; hour < 18; hour++) {
+ for (let hour = 8; hour < 19; hour++) {
// 姣忎釜灏忔椂娣诲姞涓や釜鏃堕棿娈碉細鏁寸偣鍜屽崐鐐�
slots.push({
label: `${hour.toString().padStart(2, '0')}:00`,
value: `${hour.toString().padStart(2, '0')}:00`
})
- if (hour < 18) { // 鍒�17:30涓烘
+ if (hour < 19) { // 鍒�18:30涓烘
slots.push({
label: `${hour.toString().padStart(2, '0')}:30`,
value: `${hour.toString().padStart(2, '0')}:30`
@@ -131,28 +131,36 @@
timeSlots.value = slots
}
+const toMinutes = (time) => {
+ if (!time) return 0
+ const [h, m] = time.split(':').map(Number)
+ return h * 60 + m
+}
+
// 鐢熸垚浼氳瀹ょ殑鏃堕棿鍗曞厓鏍�
const generateMeetingCells = (room) => {
const cells = []
const meetings = room.meetings || []
const occupiedSlots = new Set()
- // 澶勭悊姣忎釜浼氳
for (const meeting of meetings) {
+ const startMin = toMinutes(meeting.startTime)
+ const endMin = toMinutes(meeting.endTime)
- const startIdx = timeSlots.value.findIndex(slot => slot.value === meeting.startTime)
- let endIdx = timeSlots.value.findIndex(slot => slot.value === meeting.endTime)
- if (endIdx === -1) {
- endIdx = timeSlots.value.length
- }
- console.log('endIdx111', endIdx)
- if (startIdx !== -1 && endIdx !== -1) {
- // 鏍囪琚崰鐢ㄧ殑鏃堕棿娈�
+ // 鎵惧埌绗竴涓椂闂� > startMin 鐨勬Ы浣嶏紝鍐嶅線鍓嶉��涓�鏍�
+ let startIdx = timeSlots.value.findIndex(slot => toMinutes(slot.value) > startMin)
+ if (startIdx === -1) startIdx = timeSlots.value.length
+ startIdx = Math.max(0, startIdx - 1)
+
+ // 鎵惧埌绗竴涓椂闂� >= endMin 鐨勬Ы浣嶏紝娌℃壘鍒板垯寤朵几鍒版湯灏�
+ let endIdx = timeSlots.value.findIndex(slot => toMinutes(slot.value) >= endMin)
+ if (endIdx === -1) endIdx = timeSlots.value.length
+
+ if (startIdx < endIdx) {
for (let i = startIdx; i < endIdx; i++) {
occupiedSlots.add(timeSlots.value[i].value)
}
- // 鍒涘缓浼氳鍗曞厓鏍�
cells.push({
type: 'meeting',
meeting: meeting,
@@ -163,11 +171,9 @@
}
}
- // 澶勭悊绌洪棽鏃堕棿娈�
for (let i = 0; i < timeSlots.value.length; i++) {
const slot = timeSlots.value[i]
if (!occupiedSlots.has(slot.value)) {
- // 鏌ユ壘杩炵画鐨勭┖闂叉椂闂存
let span = 1
while (i + span < timeSlots.value.length &&
!occupiedSlots.has(timeSlots.value[i + span].value)) {
@@ -183,14 +189,11 @@
}
}
- // 鎸夋椂闂存帓搴�
cells.sort((a, b) => {
const timeA = a.startTime || a.time
const timeB = b.startTime || b.time
- return timeSlots.value.findIndex(s => s.value === timeA) -
- timeSlots.value.findIndex(s => s.value === timeB)
+ return toMinutes(timeA) - toMinutes(timeB)
})
- console.log('cells', cells)
return cells
}
@@ -219,12 +222,10 @@
// 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
onMounted(() => {
- // 鍒濆鍖栨椂闂存Ы
initTimeSlots()
+})
- // 榛樿鏌ヨ浠婂ぉ鐨勬暟鎹�
- const today = new Date()
- queryForm.date = today.toISOString().split('T')[0]
+onActivated(() => {
handleSearch()
})
</script>
--
Gitblit v1.9.3