From 2d3b8b9c63120819462fdc10c041eef6782a7d3f Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 09 六月 2026 10:03:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_新疆_大罗素马铃薯new' into dev_新疆_大罗素马铃薯new
---
src/views/collaborativeApproval/notificationManagement/summary/index.vue | 20 +-
src/views/collaborativeApproval/notificationManagement/meetExamine/index.vue | 20 +-
src/views/collaborativeApproval/notificationManagement/meetPublish/index.vue | 20 +-
src/views/collaborativeApproval/notificationManagement/meetSetting/index.vue | 5
src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue | 186 ++----------------------------
src/views/collaborativeApproval/notificationManagement/meetIndex/index.vue | 51 ++++----
6 files changed, 74 insertions(+), 228 deletions(-)
diff --git a/src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue b/src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue
index 873e62a..f36004f 100644
--- a/src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue
@@ -84,34 +84,24 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="寮�濮嬫椂闂�" prop="startTime">
- <el-select
+ <el-time-picker
v-model="meetingForm.startTime"
placeholder="璇烽�夋嫨寮�濮嬫椂闂�"
+ value-format="HH:mm"
+ format="HH:mm"
style="width: 100%"
- >
- <el-option
- v-for="time in startTimeOptions"
- :key="time.value"
- :label="time.label"
- :value="time.value"
- />
- </el-select>
+ />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="缁撴潫鏃堕棿" prop="endTime">
- <el-select
+ <el-time-picker
v-model="meetingForm.endTime"
placeholder="璇烽�夋嫨缁撴潫鏃堕棿"
+ value-format="HH:mm"
+ format="HH:mm"
style="width: 100%"
- >
- <el-option
- v-for="time in endTimeOptions"
- :key="time.value"
- :label="time.label"
- :value="time.value"
- />
- </el-select>
+ />
</el-form-item>
</el-col>
</el-row>
@@ -152,9 +142,9 @@
</template>
<script setup>
-import {ref, reactive, onMounted, computed, watch} from 'vue'
+import {ref, reactive, onActivated} from 'vue'
import {ElMessage} from 'element-plus'
-import {Plus, Document, Promotion, Bell} from '@element-plus/icons-vue'
+import {Document, Promotion, Bell} from '@element-plus/icons-vue'
import {getRoomEnum, saveMeetingApplication} from '@/api/collaborativeApproval/meeting.js'
import {userListNoPageByTenantId} from "@/api/system/user.js";
@@ -205,152 +195,16 @@
// 鍛樺伐鍒楄〃
const employees = ref([])
-// 鏃堕棿閫夐」锛堜互鍗婂皬鏃朵负闂撮殧锛�
-const timeOptions = ref([])
-
-const getTimeInMinutes = (time) => {
- if (!time) return -1
- const [hour, minute] = time.split(':').map(Number)
- return hour * 60 + minute
-}
-
-const isToday = (dateText) => {
- if (!dateText) return false
- const [year, month, day] = dateText.split('-').map(Number)
- const now = new Date()
- return year === now.getFullYear() && month === now.getMonth() + 1 && day === now.getDate()
-}
-
-const validateStartTime = (_rule, value, callback) => {
- if (!value) {
- callback()
- return
- }
-
- if (isToday(meetingForm.meetingDate)) {
- const now = new Date()
- const currentMinutes = now.getHours() * 60 + now.getMinutes()
- if (getTimeInMinutes(value) > currentMinutes) {
- callback(new Error('褰撳ぉ寮�濮嬫椂闂翠笉鑳芥櫄浜庡綋鍓嶆椂闂�'))
- return
- }
- }
-
- callback()
-}
-
-const validateEndTime = (_rule, value, callback) => {
- if (!value || !meetingForm.startTime) {
- callback()
- return
- }
-
- if (getTimeInMinutes(value) <= getTimeInMinutes(meetingForm.startTime)) {
- callback(new Error('缁撴潫鏃堕棿蹇呴』澶т簬寮�濮嬫椂闂�'))
- return
- }
-
- callback()
-}
-
// 琛ㄥ崟鏍¢獙瑙勫垯
const rules = {
title: [{required: true, message: '璇疯緭鍏ヤ細璁富棰�', trigger: 'blur'}],
roomId: [{required: true, message: '璇烽�夋嫨浼氳瀹�', trigger: 'change'}],
host: [{required: true, message: '璇疯緭鍏ヤ富鎸佷汉', trigger: 'blur'}],
meetingDate: [{required: true, message: '璇烽�夋嫨浼氳鏃ユ湡', trigger: 'change'}],
- startTime: [
- {required: true, message: '璇烽�夋嫨寮�濮嬫椂闂�', trigger: 'change'},
- {validator: validateStartTime, trigger: 'change'}
- ],
- endTime: [
- {required: true, message: '璇烽�夋嫨缁撴潫鏃堕棿', trigger: 'change'},
- {validator: validateEndTime, trigger: 'change'}
- ],
+ startTime: [{required: true, message: '璇烽�夋嫨寮�濮嬫椂闂�', trigger: 'change'}],
+ endTime: [{required: true, message: '璇烽�夋嫨缁撴潫鏃堕棿', trigger: 'change'}],
participants: [{required: true, message: '璇烽�夋嫨鍙備細浜哄憳', trigger: 'change'}]
}
-
-const startTimeOptions = computed(() => {
- if (!isToday(meetingForm.meetingDate)) {
- return timeOptions.value
- }
- const now = new Date()
- const currentMinutes = now.getHours() * 60 + now.getMinutes()
- return timeOptions.value.filter(item => getTimeInMinutes(item.value) <= currentMinutes)
-})
-
-const endTimeOptions = computed(() => {
- if (!meetingForm.startTime) {
- return timeOptions.value
- }
- const startMinutes = getTimeInMinutes(meetingForm.startTime)
- return timeOptions.value.filter(item => getTimeInMinutes(item.value) > startMinutes)
-})
-
-// 鍒濆鍖栨椂闂撮�夐」
-const initTimeOptions = () => {
- const options = []
- const now = new Date()
- const currentHour = now.getHours()
- const currentMinute = now.getMinutes()
- // meetingDate 鏄� "yyyy-MM-dd"
- const meetingDate = new Date(meetingForm.meetingDate)
-
- const isSameDay =
- now.getFullYear() === meetingDate.getFullYear() &&
- now.getMonth() === meetingDate.getMonth() &&
- now.getDate() === meetingDate.getDate()
-
- console.log('鏄惁鍚屼竴澶�:', isSameDay)
- for (let hour = 8; hour <= 18; hour++) {
- // 寮�濮嬫椂闂村繀椤绘櫄浜庡綋鍓嶆椂闂�
- if (hour < currentHour && isSameDay) {
- continue
- }
- if (hour === currentHour && currentMinute > 30 && isSameDay) {
- continue
- }
- // 姣忎釜灏忔椂娣诲姞涓や釜閫夐」锛氭暣鐐瑰拰鍗婄偣
- options.push({
- value: `${hour.toString().padStart(2, '0')}:00`,
- label: `${hour.toString().padStart(2, '0')}:00`
- })
-
- if (hour < 18) { // 18:00涔嬪悗娌℃湁鍗婄偣閫夐」
- options.push({
- value: `${hour.toString().padStart(2, '0')}:30`,
- label: `${hour.toString().padStart(2, '0')}:30`
- })
- }
- }
- timeOptions.value = options
-}
-
-watch(() => meetingForm.meetingDate, () => {
- if (meetingForm.startTime && !startTimeOptions.value.some(item => item.value === meetingForm.startTime)) {
- meetingForm.startTime = ''
- }
- if (meetingForm.endTime && !endTimeOptions.value.some(item => item.value === meetingForm.endTime)) {
- meetingForm.endTime = ''
- }
- if (meetingForm.startTime) {
- meetingFormRef.value?.validateField('startTime')
- }
- if (meetingForm.endTime) {
- meetingFormRef.value?.validateField('endTime')
- }
- initTimeOptions()
-})
-
-watch(() => meetingForm.startTime, () => {
- if (meetingForm.endTime && getTimeInMinutes(meetingForm.endTime) <= getTimeInMinutes(meetingForm.startTime)) {
- meetingForm.endTime = ''
- }
- if (meetingForm.endTime) {
- meetingFormRef.value?.validateField('endTime')
- }
-
-})
// 绂佺敤鏃ユ湡锛堢鐢ㄤ粖澶╀箣鍓嶇殑鏃ユ湡锛�
const disabledDate = (time) => {
@@ -389,19 +243,6 @@
// 妯℃嫙鎻愪氦鎿嶄綔
ElMessage.success(`${getCurrentTypeName()}鎻愪氦鎴愬姛`)
-
- // 鏍规嵁涓嶅悓绫诲瀷鎵ц涓嶅悓鎿嶄綔
- switch (currentType.value) {
- case 'approval':
- ElMessage.info('浼氳宸叉彁浜ゅ鎵规祦绋�')
- break
- case 'department':
- ElMessage.info('閮ㄩ棬绾т細璁敵璇峰凡鎻愪氦')
- break
- case 'notification':
- ElMessage.info('浼氳閫氱煡宸插彂甯�')
- break
- }
resetForm()
})
@@ -410,8 +251,7 @@
}
// 椤甸潰鍔犺浇鏃跺垵濮嬪寲
-onMounted(() => {
- initTimeOptions()
+onActivated(() => {
getRoomEnum().then(res => {
meetingRooms.value = res.data
})
diff --git a/src/views/collaborativeApproval/notificationManagement/meetExamine/index.vue b/src/views/collaborativeApproval/notificationManagement/meetExamine/index.vue
index 26e2c24..d4677b6 100644
--- a/src/views/collaborativeApproval/notificationManagement/meetExamine/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/meetExamine/index.vue
@@ -184,12 +184,12 @@
</template>
<script setup>
-import {ref, reactive, onMounted} from 'vue'
+import {ref, reactive, onMounted, onActivated} from 'vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import Pagination from '@/components/Pagination/index.vue'
import {getRoomEnum, getExamineList,saveMeetingApplication} from '@/api/collaborativeApproval/meeting.js'
import dayjs from "dayjs";
-import {staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
+import {userListNoPageByTenantId} from "@/api/system/user.js";
// 鏁版嵁鍒楄〃鍔犺浇鐘舵��
const loading = ref(false)
@@ -235,12 +235,12 @@
let room = roomEnum.value.find(room => it.roomId === room.id)
it.location = `${room.name}(${room.location})`
let staffs = JSON.parse(it.participants)
- it.staffCount = staffs.size
+ it.staffCount = staffs.length
it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format('HH:mm:ss')} ~ ${dayjs(it.endTime).format('HH:mm:ss')}`
- it.participants = staffList.value.filter(staff => staffs.some(id=>id === staff.id)).map(staff => {
+ it.participants = staffList.value.filter(staff => staffs.some(id => id == staff.userId)).map(staff => {
return {
- id: staff.id,
- name: `${staff.staffName}${staff.postName ? ` (${staff.postName})` : ''}`
+ id: staff.userId,
+ name: `${staff.nickName || staff.userName}${staff.dept?.deptName ? ` (${staff.dept.deptName})` : ''}`
}
})
@@ -342,11 +342,13 @@
// 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
onMounted(async () => {
- const [resp1, resp2]= await Promise.all([getRoomEnum(), staffOnJobListPage({current: -1, size: -1, staffState: 1})])
+ const [resp1, resp2]= await Promise.all([getRoomEnum(), userListNoPageByTenantId()])
roomEnum.value = resp1.data
- staffList.value = resp2.data.records
+ staffList.value = resp2.data || []
+})
- await getList()
+onActivated(() => {
+ getList()
})
</script>
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>
diff --git a/src/views/collaborativeApproval/notificationManagement/meetPublish/index.vue b/src/views/collaborativeApproval/notificationManagement/meetPublish/index.vue
index dace531..e2e7566 100644
--- a/src/views/collaborativeApproval/notificationManagement/meetPublish/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/meetPublish/index.vue
@@ -182,12 +182,12 @@
</template>
<script setup>
-import {ref, reactive, onMounted} from 'vue'
+import {ref, reactive, onMounted, onActivated} from 'vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import Pagination from '@/components/Pagination/index.vue'
import {getRoomEnum, getMeetingPublish,saveMeetingApplication} from '@/api/collaborativeApproval/meeting.js'
import dayjs from "dayjs";
-import {staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
+import {userListNoPageByTenantId} from "@/api/system/user.js";
// 鏁版嵁鍒楄〃鍔犺浇鐘舵��
const loading = ref(false)
@@ -233,13 +233,13 @@
let room = roomEnum.value.find(room => it.roomId === room.id)
it.location = `${room.name}(${room.location})`
let staffs = JSON.parse(it.participants)
- it.staffCount = staffs.size
+ it.staffCount = staffs.length
it.status = it.publishStatus
it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format('HH:mm:ss')} ~ ${dayjs(it.endTime).format('HH:mm:ss')}`
- it.participants = staffList.value.filter(staff => staffs.some(id=>id === staff.id)).map(staff => {
+ it.participants = staffList.value.filter(staff => staffs.some(id => id == staff.userId)).map(staff => {
return {
- id: staff.id,
- name: `${staff.staffName}${staff.postName ? ` (${staff.postName})` : ''}`
+ id: staff.userId,
+ name: `${staff.nickName || staff.userName}${staff.dept?.deptName ? ` (${staff.dept.deptName})` : ''}`
}
})
@@ -340,11 +340,13 @@
// 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
onMounted(async () => {
- const [resp1, resp2]= await Promise.all([getRoomEnum(), staffOnJobListPage({current: -1, size: -1, staffState: 1})])
+ const [resp1, resp2]= await Promise.all([getRoomEnum(), userListNoPageByTenantId()])
roomEnum.value = resp1.data
- staffList.value = resp2.data.records
+ staffList.value = resp2.data || []
+})
- await getList()
+onActivated(() => {
+ getList()
})
</script>
diff --git a/src/views/collaborativeApproval/notificationManagement/meetSetting/index.vue b/src/views/collaborativeApproval/notificationManagement/meetSetting/index.vue
index 636fd79..7ad8a7a 100644
--- a/src/views/collaborativeApproval/notificationManagement/meetSetting/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/meetSetting/index.vue
@@ -102,7 +102,7 @@
</template>
<script setup>
-import { ref, reactive, onMounted, getCurrentInstance } from 'vue'
+import { ref, reactive, onActivated, getCurrentInstance } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Plus } from '@element-plus/icons-vue'
import Pagination from '@/components/Pagination/index.vue'
@@ -276,8 +276,7 @@
proxy.download('/meeting/export', { ...searchForm }, '浼氳瀹よ缃�.xlsx')
}
-// 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
-onMounted(() => {
+onActivated(() => {
getList()
})
</script>
diff --git a/src/views/collaborativeApproval/notificationManagement/summary/index.vue b/src/views/collaborativeApproval/notificationManagement/summary/index.vue
index bf6e230..4f4abc2 100644
--- a/src/views/collaborativeApproval/notificationManagement/summary/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/summary/index.vue
@@ -155,13 +155,13 @@
</template>
<script setup>
-import { ref, reactive, onMounted } from 'vue'
+import { ref, reactive, onMounted, onActivated } from 'vue'
import { ElMessage } from 'element-plus'
import Pagination from '@/components/Pagination/index.vue'
import Editor from '@/components/Editor/index.vue'
import { getRoomEnum, getMeetingPublish ,getMeetingMinutesByMeetingId,saveMeetingMinutes} from '@/api/collaborativeApproval/meeting.js'
import dayjs from "dayjs"
-import {staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
+import {userListNoPageByTenantId} from "@/api/system/user.js";
// 鏁版嵁鍒楄〃鍔犺浇鐘舵��
const loading = ref(false)
@@ -209,12 +209,12 @@
let room = roomEnum.value.find(room => it.roomId === room.id)
it.location = `${room.name}(${room.location})`
let staffs = JSON.parse(it.participants)
- it.staffCount = staffs.size
+ it.staffCount = staffs.length
it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format('HH:mm:ss')} ~ ${dayjs(it.endTime).format('HH:mm:ss')}`
- it.participants = staffList.value.filter(staff => staffs.some(id => id === staff.id)).map(staff => {
+ it.participants = staffList.value.filter(staff => staffs.some(id => id == staff.userId)).map(staff => {
return {
- id: staff.id,
- name: `${staff.staffName}${staff.postName ? ` (${staff.postName})` : ''}`
+ id: staff.userId,
+ name: `${staff.nickName || staff.userName}${staff.dept?.deptName ? ` (${staff.dept.deptName})` : ''}`
}
})
@@ -337,11 +337,13 @@
// 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
onMounted(async () => {
- const [resp1, resp2] = await Promise.all([getRoomEnum(), staffOnJobListPage({current: -1, size: -1, staffState: 1})])
+ const [resp1, resp2] = await Promise.all([getRoomEnum(), userListNoPageByTenantId()])
roomEnum.value = resp1.data
- staffList.value = resp2.data.records
+ staffList.value = resp2.data || []
+})
- await getList()
+onActivated(() => {
+ getList()
})
</script>
--
Gitblit v1.9.3