From 5333935ae59999c47653122a669f4326f0173c1c Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 08 一月 2026 14:47:02 +0800
Subject: [PATCH] 确认按钮在左边

---
 src/views/collaborativeApproval/notificationManagement/meetDraft/index.vue |  769 ++++++++++++++++++++++++++++++----------------------------
 1 files changed, 402 insertions(+), 367 deletions(-)

diff --git a/src/views/collaborativeApproval/notificationManagement/meetDraft/index.vue b/src/views/collaborativeApproval/notificationManagement/meetDraft/index.vue
index 0c62b8b..68d77ee 100644
--- a/src/views/collaborativeApproval/notificationManagement/meetDraft/index.vue
+++ b/src/views/collaborativeApproval/notificationManagement/meetDraft/index.vue
@@ -3,139 +3,174 @@
     <!-- 椤甸潰鏍囬 -->
     <div class="page-header">
       <h2>浼氳鑽夌</h2>
-      <el-button type="primary" @click="handleAdd">
-        <el-icon><Plus /></el-icon>
+      <el-button type="primary"
+                 @click="handleAdd">
+        <el-icon>
+          <Plus />
+        </el-icon>
         鏂板缓鑽夌
       </el-button>
     </div>
-
     <!-- 鎼滅储鍖哄煙 -->
     <el-card class="search-card">
-      <el-form :model="searchForm" label-width="100px" inline>
+      <el-form :model="searchForm"
+               label-width="100px"
+               inline>
         <el-form-item label="浼氳涓婚">
-          <el-input v-model="searchForm.title" placeholder="璇疯緭鍏ヤ細璁富棰�" clearable />
+          <el-input v-model="searchForm.title"
+                    placeholder="璇疯緭鍏ヤ細璁富棰�"
+                    clearable />
         </el-form-item>
         <el-form-item label="浼氳鏃ユ湡">
-          <el-date-picker
-            v-model="searchForm.meetingDate"
-            type="date"
-            placeholder="璇烽�夋嫨浼氳鏃ユ湡"
-            value-format="YYYY-MM-DD"
-            format="YYYY-MM-DD"
-            style="width: 100%"
-          />
+          <el-date-picker v-model="searchForm.meetingDate"
+                          type="date"
+                          placeholder="璇烽�夋嫨浼氳鏃ユ湡"
+                          value-format="YYYY-MM-DD"
+                          format="YYYY-MM-DD"
+                          style="width: 100%" />
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="handleSearch">鎼滅储</el-button>
+          <el-button type="primary"
+                     @click="handleSearch">鎼滅储</el-button>
           <el-button @click="resetSearch">閲嶇疆</el-button>
         </el-form-item>
       </el-form>
     </el-card>
-
     <!-- 鑽夌鍒楄〃 -->
     <el-card>
-      <el-table v-loading="loading" :data="draftList" border>
-        <el-table-column prop="title" label="浼氳涓婚" align="center" min-width="200" show-overflow-tooltip />
-        <el-table-column prop="room" label="浼氳瀹�" align="center" width="120" />
-        <el-table-column prop="host" label="涓绘寔浜�" align="center" width="120" />
-        <el-table-column prop="meetingTime" label="浼氳鏃堕棿" align="center" width="180">
+      <el-table v-loading="loading"
+                :data="draftList"
+                border>
+        <el-table-column prop="title"
+                         label="浼氳涓婚"
+                         align="center"
+                         min-width="200"
+                         show-overflow-tooltip />
+        <el-table-column prop="room"
+                         label="浼氳瀹�"
+                         align="center"
+                         width="120" />
+        <el-table-column prop="host"
+                         label="涓绘寔浜�"
+                         align="center"
+                         width="120" />
+        <el-table-column prop="meetingTime"
+                         label="浼氳鏃堕棿"
+                         align="center"
+                         width="180">
           <template #default="scope">
             {{ formatDateTime(scope.row.meetingTime) }}
           </template>
         </el-table-column>
-        <el-table-column prop="participants" label="鍙備細浜烘暟" align="center" width="100">
+        <el-table-column prop="participants"
+                         label="鍙備細浜烘暟"
+                         align="center"
+                         width="100">
           <template #default="scope">
             {{ scope.row.participants }}浜�
           </template>
         </el-table-column>
-        <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" align="center" width="180" />
-        <el-table-column label="鎿嶄綔" align="center" width="200" fixed="right">
+        <el-table-column prop="createTime"
+                         label="鍒涘缓鏃堕棿"
+                         align="center"
+                         width="180" />
+        <el-table-column label="鎿嶄綔"
+                         align="center"
+                         width="200"
+                         fixed="right">
           <template #default="scope">
-            <el-button type="primary" link @click="viewDraft(scope.row)">鏌ョ湅</el-button>
-            <el-button type="primary" link @click="editDraft(scope.row)">缂栬緫</el-button>
-            <el-button type="danger" link @click="deleteDraft(scope.row)">鍒犻櫎</el-button>
+            <el-button type="primary"
+                       link
+                       @click="viewDraft(scope.row)">鏌ョ湅</el-button>
+            <el-button type="primary"
+                       link
+                       @click="editDraft(scope.row)">缂栬緫</el-button>
+            <el-button type="danger"
+                       link
+                       @click="deleteDraft(scope.row)">鍒犻櫎</el-button>
           </template>
         </el-table-column>
       </el-table>
-
       <!-- 鍒嗛〉 -->
-      <pagination
-        v-show="total > 0"
-        :total="total"
-        v-model:page="queryParams.current"
-        v-model:limit="queryParams.size"
-        @pagination="getList"
-      />
+      <pagination v-show="total > 0"
+                  :total="total"
+                  v-model:page="queryParams.current"
+                  v-model:limit="queryParams.size"
+                  @pagination="getList" />
     </el-card>
-
     <!-- 浼氳鑽夌璇︽儏瀵硅瘽妗� -->
-    <el-dialog
-      title="浼氳鑽夌璇︽儏"
-      v-model="detailDialogVisible"
-      width="800px"
-    >
+    <el-dialog title="浼氳鑽夌璇︽儏"
+               v-model="detailDialogVisible"
+               width="800px">
       <div v-if="currentDraft">
-        <el-descriptions :column="2" border>
+        <el-descriptions :column="2"
+                         border>
           <el-descriptions-item label="浼氳涓婚">{{ currentDraft.title }}</el-descriptions-item>
           <el-descriptions-item label="浼氳缂栧彿">{{ currentDraft.meetingId }}</el-descriptions-item>
           <el-descriptions-item label="浼氳瀹�">{{ currentDraft.room }}</el-descriptions-item>
           <el-descriptions-item label="涓绘寔浜�">{{ currentDraft.host }}</el-descriptions-item>
-          <el-descriptions-item label="浼氳鏃堕棿" :span="2">
+          <el-descriptions-item label="浼氳鏃堕棿"
+                                :span="2">
             {{ formatDateTime(currentDraft.meetingTime) }}
           </el-descriptions-item>
           <el-descriptions-item label="鍒涘缓鏃堕棿">{{ currentDraft.createTime }}</el-descriptions-item>
         </el-descriptions>
-
         <div class="content-section mt-20">
           <h4>鍙備細浜哄憳</h4>
           <div class="participants-list">
             {{ currentDraft.participantList }}
           </div>
         </div>
-
         <div class="content-section mt-20">
           <h4>浼氳璇存槑</h4>
           <div class="meeting-description">{{ currentDraft.description }}</div>
         </div>
       </div>
-
       <template #footer>
         <div class="dialog-footer">
           <el-button @click="detailDialogVisible = false">鍏� 闂�</el-button>
         </div>
       </template>
     </el-dialog>
-
     <!-- 鏂板缓/缂栬緫鑽夌瀵硅瘽妗� -->
-    <el-dialog
-      :title="dialogTitle"
-      v-model="editDialogVisible"
-      width="700px"
-    >
-      <el-form :model="meetingForm" :rules="rules" ref="meetingFormRef" label-width="100px">
-        <el-form-item label="浼氳涓婚" prop="title">
-          <el-input v-model="meetingForm.title" placeholder="璇疯緭鍏ヤ細璁富棰�" />
+    <el-dialog :title="dialogTitle"
+               v-model="editDialogVisible"
+               width="700px">
+      <el-form :model="meetingForm"
+               :rules="rules"
+               ref="meetingFormRef"
+               label-width="100px">
+        <el-form-item label="浼氳涓婚"
+                      prop="title">
+          <el-input v-model="meetingForm.title"
+                    placeholder="璇疯緭鍏ヤ細璁富棰�" />
         </el-form-item>
-        <el-form-item label="浼氳瀹�" prop="room">
-          <el-select v-model="meetingForm.roomId" placeholder="璇烽�夋嫨浼氳瀹�" style="width: 100%">
-            <el-option v-for="(v,k) in roomList" :label="v.name" :value="v.id" />
+        <el-form-item label="浼氳瀹�"
+                      prop="room">
+          <el-select v-model="meetingForm.roomId"
+                     placeholder="璇烽�夋嫨浼氳瀹�"
+                     style="width: 100%">
+            <el-option v-for="(v,k) in roomList"
+                       :label="v.name"
+                       :value="v.id" />
           </el-select>
         </el-form-item>
-        <el-form-item label="涓绘寔浜�" prop="host">
-          <el-input v-model="meetingForm.host" placeholder="璇疯緭鍏ヤ富鎸佷汉" />
+        <el-form-item label="涓绘寔浜�"
+                      prop="host">
+          <el-input v-model="meetingForm.host"
+                    placeholder="璇疯緭鍏ヤ富鎸佷汉" />
         </el-form-item>
         <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item label="浼氳鏃ユ湡" prop="meetingDate">
-              <el-date-picker
-                v-model="meetingForm.meetingDate"
-                type="date"
-                placeholder="璇烽�夋嫨浼氳鏃ユ湡"
-                value-format="YYYY-MM-DD"
-                format="YYYY-MM-DD"
-                :disabled-date="disabledDate"
-                style="width: 100%"
-              />
+            <el-form-item label="浼氳鏃ユ湡"
+                          prop="meetingDate">
+              <el-date-picker v-model="meetingForm.meetingDate"
+                              type="date"
+                              placeholder="璇烽�夋嫨浼氳鏃ユ湡"
+                              value-format="YYYY-MM-DD"
+                              format="YYYY-MM-DD"
+                              :disabled-date="disabledDate"
+                              style="width: 100%" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -144,67 +179,57 @@
         </el-row>
         <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item label="寮�濮嬫椂闂�" prop="startTime">
-              <el-select
-                v-model="meetingForm.startTime"
-                placeholder="璇烽�夋嫨寮�濮嬫椂闂�"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="time in timeOptions"
-                  :key="time.value"
-                  :label="time.label"
-                  :value="time.value"
-                />
+            <el-form-item label="寮�濮嬫椂闂�"
+                          prop="startTime">
+              <el-select v-model="meetingForm.startTime"
+                         placeholder="璇烽�夋嫨寮�濮嬫椂闂�"
+                         style="width: 100%">
+                <el-option v-for="time in timeOptions"
+                           :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
-                v-model="meetingForm.endTime"
-                placeholder="璇烽�夋嫨缁撴潫鏃堕棿"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="time in timeOptions"
-                  :key="time.value"
-                  :label="time.label"
-                  :value="time.value"
-                />
+            <el-form-item label="缁撴潫鏃堕棿"
+                          prop="endTime">
+              <el-select v-model="meetingForm.endTime"
+                         placeholder="璇烽�夋嫨缁撴潫鏃堕棿"
+                         style="width: 100%">
+                <el-option v-for="time in timeOptions"
+                           :key="time.value"
+                           :label="time.label"
+                           :value="time.value" />
               </el-select>
             </el-form-item>
           </el-col>
         </el-row>
-        <el-form-item label="鍙備細浜烘暟" prop="participants">
-          <el-input
-              v-model="meetingForm.participants"
-              type="number"
-              placeholder="璇疯緭鍏ュ弬浼氫汉鏁�"
-          />
+        <el-form-item label="鍙備細浜烘暟"
+                      prop="participants">
+          <el-input v-model="meetingForm.participants"
+                    type="number"
+                    placeholder="璇疯緭鍏ュ弬浼氫汉鏁�" />
         </el-form-item>
-        <el-form-item label="鍙備細浜哄憳" prop="participants">
-          <el-input
-            v-model="meetingForm.participantList"
-            type="textarea"
-            :rows="3"
-            placeholder="璇疯緭鍏ュ弬浼氫汉鍛橈紝鐢ㄩ�楀彿鍒嗛殧"
-          />
+        <el-form-item label="鍙備細浜哄憳"
+                      prop="participants">
+          <el-input v-model="meetingForm.participantList"
+                    type="textarea"
+                    :rows="3"
+                    placeholder="璇疯緭鍏ュ弬浼氫汉鍛橈紝鐢ㄩ�楀彿鍒嗛殧" />
         </el-form-item>
         <el-form-item label="浼氳璇存槑">
-          <el-input
-            v-model="meetingForm.description"
-            type="textarea"
-            :rows="4"
-            placeholder="璇疯緭鍏ヤ細璁鏄�"
-          />
+          <el-input v-model="meetingForm.description"
+                    type="textarea"
+                    :rows="4"
+                    placeholder="璇疯緭鍏ヤ細璁鏄�" />
         </el-form-item>
       </el-form>
-
       <template #footer>
         <div class="dialog-footer">
+          <el-button type="primary"
+                     @click="submitForm">淇� 瀛�</el-button>
           <el-button @click="editDialogVisible = false">鍙� 娑�</el-button>
-          <el-button type="primary" @click="submitForm">淇� 瀛�</el-button>
         </div>
       </template>
     </el-dialog>
@@ -212,284 +237,294 @@
 </template>
 
 <script setup>
-import { ref, reactive, onMounted } from 'vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { Plus } from '@element-plus/icons-vue'
-import Pagination from '@/components/Pagination/index.vue'
-import {getRoomEnum,getDraftList,saveDraft,delDraft} from '@/api/collaborativeApproval/meeting.js'
-import dayjs from "dayjs";
-// 鏁版嵁鍒楄〃鍔犺浇鐘舵��
-const loading = ref(false)
+  import { ref, reactive, onMounted } from "vue";
+  import { ElMessage, ElMessageBox } from "element-plus";
+  import { Plus } from "@element-plus/icons-vue";
+  import Pagination from "@/components/Pagination/index.vue";
+  import {
+    getRoomEnum,
+    getDraftList,
+    saveDraft,
+    delDraft,
+  } from "@/api/collaborativeApproval/meeting.js";
+  import dayjs from "dayjs";
+  // 鏁版嵁鍒楄〃鍔犺浇鐘舵��
+  const loading = ref(false);
 
-// 鎬绘潯鏁�
-const total = ref(0)
+  // 鎬绘潯鏁�
+  const total = ref(0);
 
-// 鑽夌鍒楄〃鏁版嵁
-const draftList = ref([])
+  // 鑽夌鍒楄〃鏁版嵁
+  const draftList = ref([]);
 
-// 鏌ヨ鍙傛暟
-const queryParams = reactive({
-  current: 1,
-  size: 10
-})
+  // 鏌ヨ鍙傛暟
+  const queryParams = reactive({
+    current: 1,
+    size: 10,
+  });
 
-// 鎼滅储琛ㄥ崟
-const searchForm = reactive({
-  title: '',
-  meetingDate: ''
-})
+  // 鎼滅储琛ㄥ崟
+  const searchForm = reactive({
+    title: "",
+    meetingDate: "",
+  });
 
-// 鏄惁鏄剧ず瀵硅瘽妗�
-const detailDialogVisible = ref(false)
-const editDialogVisible = ref(false)
+  // 鏄惁鏄剧ず瀵硅瘽妗�
+  const detailDialogVisible = ref(false);
+  const editDialogVisible = ref(false);
 
-const roomList = ref([])
+  const roomList = ref([]);
 
-// 瀵硅瘽妗嗘爣棰�
-const dialogTitle = ref('')
+  // 瀵硅瘽妗嗘爣棰�
+  const dialogTitle = ref("");
 
-// 褰撳墠鏌ョ湅鐨勮崏绋�
-const currentDraft = ref(null)
+  // 褰撳墠鏌ョ湅鐨勮崏绋�
+  const currentDraft = ref(null);
 
-// 琛ㄥ崟寮曠敤
-const meetingFormRef = ref(null)
+  // 琛ㄥ崟寮曠敤
+  const meetingFormRef = ref(null);
 
-// 鏃堕棿閫夐」锛堜互鍗婂皬鏃朵负闂撮殧锛屽伐浣滄椂闂�8:00-18:00锛�
-const timeOptions = ref([])
+  // 鏃堕棿閫夐」锛堜互鍗婂皬鏃朵负闂撮殧锛屽伐浣滄椂闂�8:00-18:00锛�
+  const timeOptions = ref([]);
 
-// 琛ㄥ崟鏁版嵁
-const meetingForm = reactive({
-  id: '',
-  meetingId: '',
-  title: '',
-  roomId: '',
-  host: '',
-  meetingDate: '',
-  startTime: '',
-  endTime: '',
-  participants: 0,
-  participantList: '',
-  description: '',
-  createTime: ''
-})
-
-// 琛ㄥ崟鏍¢獙瑙勫垯
-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' }],
-  endTime: [{ required: true, message: '璇烽�夋嫨缁撴潫鏃堕棿', trigger: 'change' }]
-}
-
-// 鍒濆鍖栨椂闂撮�夐」锛堜互鍗婂皬鏃朵负闂撮殧锛屽伐浣滄椂闂�8:00-18:00锛�
-const initTimeOptions = () => {
-  const options = []
-  for (let hour = 8; hour <= 18; hour++) {
-    // 姣忎釜灏忔椂娣诲姞涓や釜閫夐」锛氭暣鐐瑰拰鍗婄偣
-    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
-}
-
-// 绂佺敤鏃ユ湡锛堢鐢ㄤ粖澶╀箣鍓嶇殑鏃ユ湡锛�
-const disabledDate = (time) => {
-  // 绂佺敤浠婂ぉ涔嬪墠鐨勬棩鏈�
-  return time.getTime() < Date.now() - 86400000
-}
-
-// 鏌ヨ鏁版嵁
-const getList = async () => {
-  loading.value = true
-
-  let resp = await getDraftList({...queryParams,...searchForm})
-  queryParams.current = resp.data.current
-  draftList.value = resp.data.records.map(it=>{
-    it.room = roomList.value.find(room=>it.roomId===room.id).name ?? ""
-    it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format("HH:mm")} ~ ${dayjs(it.endTime).format("HH:mm")}`
-    return it
-  })
-
-  loading.value = false
-
-}
-
-// 鎼滅储鎸夐挳鎿嶄綔
-const handleSearch = () => {
-  queryParams.pageNum = 1
-  getList()
-}
-
-// 閲嶇疆鎼滅储琛ㄥ崟
-const resetSearch = () => {
-  Object.assign(searchForm, {
-    title: '',
-    createTime: []
-  })
-  handleSearch()
-}
-
-// 娣诲姞鎸夐挳鎿嶄綔
-const handleAdd = () => {
-  dialogTitle.value = '鏂板缓鑽夌'
-  resetForm()
-  editDialogVisible.value = true
-}
-
-// 鏌ョ湅鑽夌璇︽儏
-const viewDraft = (row) => {
-  currentDraft.value = row
-  detailDialogVisible.value = true
-}
-
-// 缂栬緫鑽夌
-const editDraft = (row) => {
-  dialogTitle.value = '缂栬緫鑽夌'
-  Object.assign(meetingForm, {
-    id: row.id,
-    meetingId: row.meetingId,
-    title: row.title,
-    room: row.room,
-    roomId: row.id,
-    host: row.host,
-    meetingDate: row.meetingTime.split(' ')[0],
-    startTime: row.meetingTime.split(' ')[1],
-    endTime: row.meetingTime.split(' ')[3],
-    participants: row.participants,
-    participantList: row.participantList,
-    description: row.description,
-    createTime: row.createTime
-  })
-  editDialogVisible.value = true
-}
-
-// 鍒犻櫎鑽夌
-const deleteDraft = (row) => {
-  ElMessageBox.confirm(
-    `纭鍒犻櫎浼氳鑽夌 "${row.title}"?`,
-    '鍒犻櫎鑽夌',
-    {
-      confirmButtonText: '纭畾',
-      cancelButtonText: '鍙栨秷',
-      type: 'warning'
-    }
-  ).then(() => {
-    delDraft(row.id).then(resp=>{
-      ElMessage.success('鑽夌鍒犻櫎鎴愬姛')
-      getList()
-    })
-
-  }).catch(() => {})
-}
-
-// 閲嶇疆琛ㄥ崟
-const resetForm = () => {
-  Object.assign(meetingForm, {
-    id: '',
-    meetingId: '',
-    title: '',
-    room: '',
-    host: '',
-    meetingDate: '',
-    startTime: '',
-    endTime: '',
+  // 琛ㄥ崟鏁版嵁
+  const meetingForm = reactive({
+    id: "",
+    meetingId: "",
+    title: "",
+    roomId: "",
+    host: "",
+    meetingDate: "",
+    startTime: "",
+    endTime: "",
     participants: 0,
-    participantList: '',
-    description: '',
-    createTime: ''
-  })
-}
+    participantList: "",
+    description: "",
+    createTime: "",
+  });
 
-// 鎻愪氦琛ㄥ崟
-const submitForm = () => {
-  meetingFormRef.value.validate((valid) => {
-    if (valid) {
-      let formData = {...meetingForm}
-      formData.startTime = dayjs(meetingForm.meetingDate + ' ' + meetingForm.startTime).format("YYYY-MM-DD HH:mm:ss")
-      formData.endTime = dayjs(meetingForm.meetingDate + ' ' + meetingForm.endTime).format("YYYY-MM-DD HH:mm:ss")
-      saveDraft(formData).then(()=>{
-        ElMessage.success('淇濆瓨鎴愬姛')
-        editDialogVisible.value = false
-        getList()
-      })
+  // 琛ㄥ崟鏍¢獙瑙勫垯
+  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" }],
+    endTime: [{ required: true, message: "璇烽�夋嫨缁撴潫鏃堕棿", trigger: "change" }],
+  };
+
+  // 鍒濆鍖栨椂闂撮�夐」锛堜互鍗婂皬鏃朵负闂撮殧锛屽伐浣滄椂闂�8:00-18:00锛�
+  const initTimeOptions = () => {
+    const options = [];
+    for (let hour = 8; hour <= 18; hour++) {
+      // 姣忎釜灏忔椂娣诲姞涓や釜閫夐」锛氭暣鐐瑰拰鍗婄偣
+      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;
+  };
 
-// 鏍煎紡鍖栨棩鏈熸椂闂�
-const formatDateTime = (dateTime) => {
-  if (!dateTime) return ''
-  return dateTime.replace(' ', '\n')
-}
+  // 绂佺敤鏃ユ湡锛堢鐢ㄤ粖澶╀箣鍓嶇殑鏃ユ湡锛�
+  const disabledDate = time => {
+    // 绂佺敤浠婂ぉ涔嬪墠鐨勬棩鏈�
+    return time.getTime() < Date.now() - 86400000;
+  };
 
-// 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
-onMounted(() => {
-  initTimeOptions()
-  getList()
-  getRoomEnum().then((res) => {
-    roomList.value = res.data
-  })
-})
+  // 鏌ヨ鏁版嵁
+  const getList = async () => {
+    loading.value = true;
+
+    let resp = await getDraftList({ ...queryParams, ...searchForm });
+    queryParams.current = resp.data.current;
+    draftList.value = resp.data.records.map(it => {
+      it.room = roomList.value.find(room => it.roomId === room.id).name ?? "";
+      it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format(
+        "HH:mm"
+      )} ~ ${dayjs(it.endTime).format("HH:mm")}`;
+      return it;
+    });
+
+    loading.value = false;
+  };
+
+  // 鎼滅储鎸夐挳鎿嶄綔
+  const handleSearch = () => {
+    queryParams.pageNum = 1;
+    getList();
+  };
+
+  // 閲嶇疆鎼滅储琛ㄥ崟
+  const resetSearch = () => {
+    Object.assign(searchForm, {
+      title: "",
+      createTime: [],
+    });
+    handleSearch();
+  };
+
+  // 娣诲姞鎸夐挳鎿嶄綔
+  const handleAdd = () => {
+    dialogTitle.value = "鏂板缓鑽夌";
+    resetForm();
+    editDialogVisible.value = true;
+  };
+
+  // 鏌ョ湅鑽夌璇︽儏
+  const viewDraft = row => {
+    currentDraft.value = row;
+    detailDialogVisible.value = true;
+  };
+
+  // 缂栬緫鑽夌
+  const editDraft = row => {
+    dialogTitle.value = "缂栬緫鑽夌";
+    Object.assign(meetingForm, {
+      id: row.id,
+      meetingId: row.meetingId,
+      title: row.title,
+      room: row.room,
+      roomId: row.id,
+      host: row.host,
+      meetingDate: row.meetingTime.split(" ")[0],
+      startTime: row.meetingTime.split(" ")[1],
+      endTime: row.meetingTime.split(" ")[3],
+      participants: row.participants,
+      participantList: row.participantList,
+      description: row.description,
+      createTime: row.createTime,
+    });
+    editDialogVisible.value = true;
+  };
+
+  // 鍒犻櫎鑽夌
+  const deleteDraft = row => {
+    ElMessageBox.confirm(`纭鍒犻櫎浼氳鑽夌 "${row.title}"?`, "鍒犻櫎鑽夌", {
+      confirmButtonText: "纭畾",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        delDraft(row.id).then(resp => {
+          ElMessage.success("鑽夌鍒犻櫎鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {});
+  };
+
+  // 閲嶇疆琛ㄥ崟
+  const resetForm = () => {
+    Object.assign(meetingForm, {
+      id: "",
+      meetingId: "",
+      title: "",
+      room: "",
+      host: "",
+      meetingDate: "",
+      startTime: "",
+      endTime: "",
+      participants: 0,
+      participantList: "",
+      description: "",
+      createTime: "",
+    });
+  };
+
+  // 鎻愪氦琛ㄥ崟
+  const submitForm = () => {
+    meetingFormRef.value.validate(valid => {
+      if (valid) {
+        let formData = { ...meetingForm };
+        formData.startTime = dayjs(
+          meetingForm.meetingDate + " " + meetingForm.startTime
+        ).format("YYYY-MM-DD HH:mm:ss");
+        formData.endTime = dayjs(
+          meetingForm.meetingDate + " " + meetingForm.endTime
+        ).format("YYYY-MM-DD HH:mm:ss");
+        saveDraft(formData).then(() => {
+          ElMessage.success("淇濆瓨鎴愬姛");
+          editDialogVisible.value = false;
+          getList();
+        });
+      }
+    });
+  };
+
+  // 鏍煎紡鍖栨棩鏈熸椂闂�
+  const formatDateTime = dateTime => {
+    if (!dateTime) return "";
+    return dateTime.replace(" ", "\n");
+  };
+
+  // 椤甸潰鍔犺浇鏃惰幏鍙栨暟鎹�
+  onMounted(() => {
+    initTimeOptions();
+    getList();
+    getRoomEnum().then(res => {
+      roomList.value = res.data;
+    });
+  });
 </script>
 
 <style scoped>
-.app-container {
-  padding: 20px;
-}
+  .app-container {
+    padding: 20px;
+  }
 
-.page-header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 20px;
-}
+  .page-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
+  }
 
-.page-header h2 {
-  margin: 0;
-  color: #303133;
-}
+  .page-header h2 {
+    margin: 0;
+    color: #303133;
+  }
 
-.search-card {
-  margin-bottom: 20px;
-}
+  .search-card {
+    margin-bottom: 20px;
+  }
 
-.dialog-footer {
-  display: flex;
-  justify-content: flex-end;
-  gap: 10px;
-}
+  .dialog-footer {
+    display: flex;
+    justify-content: flex-end;
+    gap: 10px;
+  }
 
-.content-section h4 {
-  margin: 0 0 15px 0;
-  color: #303133;
-}
+  .content-section h4 {
+    margin: 0 0 15px 0;
+    color: #303133;
+  }
 
-.mt-20 {
-  margin-top: 20px;
-}
+  .mt-20 {
+    margin-top: 20px;
+  }
 
-.participants-list {
-  min-height: 40px;
-  padding: 15px;
-  border-radius: 4px;
-  line-height: 1.6;
-}
+  .participants-list {
+    min-height: 40px;
+    padding: 15px;
+    border-radius: 4px;
+    line-height: 1.6;
+  }
 
-.meeting-description {
-  padding: 15px;
-  border-radius: 4px;
-  line-height: 1.6;
-  white-space: pre-wrap;
-}
+  .meeting-description {
+    padding: 15px;
+    border-radius: 4px;
+    line-height: 1.6;
+    white-space: pre-wrap;
+  }
 </style>

--
Gitblit v1.9.3