From 5c53cabf22c47cfccb852abde21e99f3e1c19a5a Mon Sep 17 00:00:00 2001 From: qsh <> Date: Tue, 5 Aug 2025 17:15:53 +0800 Subject: [PATCH] sc --- src/views/OKR/Meeting/MeetingInfo.vue | 238 +++++++++++++++++++++++--- 1 file changed, 217 insertions(+), 21 deletions(-) diff --git a/src/views/OKR/Meeting/MeetingInfo.vue b/src/views/OKR/Meeting/MeetingInfo.vue index e98b981..a0740b5 100644 --- a/src/views/OKR/Meeting/MeetingInfo.vue +++ b/src/views/OKR/Meeting/MeetingInfo.vue @@ -3,7 +3,10 @@
{{ form.meetingId ? '修改会议' : '新增会议' }} - 保存 +
+ 保存至草稿 + 保存 +
@@ -114,26 +116,108 @@ - + + + + + +
+ +
+
+ +
- - -
{{ form.meetingSummary }}
- +
+ + + +
+ + + 创建待办 + 不创建待办 + + +
+
+ + + + +
+
+
+ +
+ 注:如果选择创建待办,请选择执行人及截止日期,默认每天9:00循环提醒,可于待办中修改 +
+
+ + + +
+
+
@@ -147,10 +231,12 @@ import * as MeetingApi from '@/api/okr/meeting' import { formatDate } from '@/utils/formatTime' import { getEmployeeSimpleList } from '@/api/pers/employee' import { useTagsViewStore } from '@/store/modules/tagsView' +import { useUserStore } from '@/store/modules/user' const route = useRoute() const message = useMessage() const tagsViewStore = useTagsViewStore() +const userStore = useUserStore() const defaultProps = { value: 'nodeId', @@ -159,6 +245,13 @@ const defaultProps = { } const isDetail = route.query.isDetail +const currentUserId = ref(undefined) +const currentContentId = ref('') // 默认选中第一个标签页 +const summaryIdx = ref(0) // 会议纪要的索引 + +const toolbarConfig = { + toolbarKeys: [] +} onMounted(async () => { await getOptions() @@ -166,7 +259,20 @@ onMounted(async () => { // 这里可以调用API获取会议详情数据 getMeetingInfo(route.params.id) } else { - console.error('会议不存在') + form.value.contentList = [ + { + id: userStore.getUser.id + '', + name: userStore.getUser.nickname, + contentArr: [ + { + id: crypto.randomUUID(), + title: '主要内容', + content: '' + } + ] + } + ] + currentContentId.value = form.value.contentList[0].contentArr[0].id } }) @@ -180,6 +286,8 @@ function getOptions() { children: 'children' }) userOptions.value = employeeResp.map((it) => ({ ...it, id: it.id + '' })) + form.value.expectUsers = [userStore.getUser.id + ''] // 默认添加当前用户为预约参会人员 + currentUserId.value = userStore.getUser.id + '' // 默认选中当前用户 // handleUserChange() }) .catch((error) => { @@ -211,7 +319,9 @@ const form = ref({ status: '1', meetingContent: '', meetingSummary: '', - absentReason: '' + absentReason: '', + contentList: [], + meetingList: [] }) const rules = { meetingSubject: [{ required: true, message: '请输入会议主题', trigger: 'blur' }], @@ -245,9 +355,17 @@ const getMeetingInfo = async (meetingId) => { startTime: formatDate(resp.startTime, 'YYYY-MM-DD HH:mm'), expectEndTime: formatDate(resp.expectEndTime, 'YYYY-MM-DD HH:mm'), expectUsers: resp.expectUsers || [], - actualUsers: resp.actualUsers || [] + actualUsers: resp.actualUsers || [], + meetingList: resp.meetingList || [ + { + meetingSummary: resp.meetingSummary || '', + userIdList: [], + endDate: '', + createWait: true + } + ] } - handleUserChange() + handleUserChange(resp.expectUsers) } } catch (error) { loading.value = false @@ -255,7 +373,65 @@ const getMeetingInfo = async (meetingId) => { } } -function handleUserChange() { +function userTabChange(val) { + currentContentId.value = val.contentArr[0].id +} + +function handleTabsEdit(targetName, action) { + if (action === 'add') { + form.value.contentList.forEach((item) => { + if (item.id === currentUserId.value) { + item.contentArr.push({ + id: crypto.randomUUID(), + title: '次要内容', + content: '' + }) + } + }) + } else if (action === 'remove') { + form.value.contentList.forEach((item) => { + if (item.id === currentUserId.value) { + const idx = item.contentArr.findIndex((item) => item.id == targetName) + item.contentArr.splice(idx, 1) + // 如果删除的是当前选中的标签页,则切换到下一个标签页 + if (currentContentId.value === targetName) { + currentContentId.value = item.contentArr[idx - 1]?.id || item.contentArr[idx + 1]?.id + } + } + }) + const tabs = editableTabs.value + let activeName = editableTabsValue.value + if (activeName === targetName) { + tabs.forEach((tab, index) => { + if (tab.name === targetName) { + const nextTab = tabs[index + 1] || tabs[index - 1] + if (nextTab) { + activeName = nextTab.name + } + } + }) + } + + editableTabsValue.value = activeName + editableTabs.value = tabs.filter((tab) => tab.name !== targetName) + } +} + +function meetingSummaryEdit(targetName, action) { + if (action === 'add') { + form.value.meetingList.push({ + meetingSummary: '', + userIdList: [], + endDate: '', + createWait: true + }) + } else if (action === 'remove') { + form.value.meetingList.splice(targetName, 1) + summaryIdx.value = 0 + } +} + +function handleUserChange(val) { // 当预约参会人员变化时,更新实际参会人员选项 expectUserOptions.value = userOptions.value.filter((user) => form.value.expectUsers.some((it) => it == user.id) @@ -263,6 +439,26 @@ function handleUserChange() { if (!isDetail) { form.value.actualUsers = [...form.value.expectUsers] } + // 先过滤掉不存在的参会人员 + form.value.contentList = form.value.contentList.filter((item) => { + return val.some((it) => it == item.id) + }) + // 再补充新增的 + val.map((item) => { + if (!form.value.contentList.some((it) => it.id == item)) { + form.value.contentList.push({ + id: item, + name: userOptions.value.find((it) => it.id == item).name, + contentArr: [ + { + id: crypto.randomUUID(), + title: '主要内容', + content: '' + } + ] + }) + } + }) } const router = useRouter()