From 7c86b549b27bd54f6bd5de81c13f8242f91c87ff Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期一, 16 六月 2025 18:03:27 +0800
Subject: [PATCH] 优化文件上传组件及表格显示

---
 src/views/archiveManagement/mould/archiveDialog.vue |   68 +++++++++++++++++++--------------
 1 files changed, 39 insertions(+), 29 deletions(-)

diff --git a/src/views/archiveManagement/mould/archiveDialog.vue b/src/views/archiveManagement/mould/archiveDialog.vue
index c976722..521ae1a 100644
--- a/src/views/archiveManagement/mould/archiveDialog.vue
+++ b/src/views/archiveManagement/mould/archiveDialog.vue
@@ -1,5 +1,5 @@
 <template>
-  <el-dialog v-model="centerDialogVisible" title="Warning" width="500" center>
+  <el-dialog v-model="centerDialogVisible" title="鏂囨。绠$悊" width="500" center>
     <el-form
       ref="ruleFormRef"
       style="max-width: 600px"
@@ -8,7 +8,7 @@
       label-width="auto"
     >
       <el-form-item label="鍚嶇О" prop="name">
-        <el-input v-model="ruleForm.name" placeholder="璇疯緭鍏ユ枃妗e悕绉�"/>
+        <el-input v-model="ruleForm.name" placeholder="璇疯緭鍏ユ枃妗e悕绉�" />
       </el-form-item>
       <el-form-item label="璇疯緭鍏ユ枃妗g被鍨�" prop="type">
         <el-select v-model="ruleForm.type" placeholder="璇疯緭鍏ユ枃妗g被鍨�">
@@ -18,24 +18,36 @@
       </el-form-item>
       <el-form-item label="璇疯緭鍏ユ枃妗g姸鎬�" prop="status">
         <el-select v-model="ruleForm.status" placeholder="璇疯緭鍏ユ枃妗g姸鎬�">
-          <el-option v-for="option in options" :key="option.value" :label="option.label" :value="option.value" />
+          <el-option
+            v-for="option in options"
+            :key="option.value"
+            :label="option.label"
+            :value="option.value"
+          />
         </el-select>
       </el-form-item>
     </el-form>
     <template #footer>
-      <div class="dialog-footer">
-        <el-button @click="centerDialogVisible = false">Cancel</el-button>
-        <el-button type="primary" @click="submit">
-          Confirm
-        </el-button>
-      </div>
+      <el-row>
+        <el-col :span="24" style="text-align: right">
+          <el-button @click="centerDialogVisible = false">鍙� 娑�</el-button>
+          <el-button type="primary" @click="submit"> 纭� 瀹� </el-button>
+        </el-col>
+      </el-row>
     </template>
+    <fileUpload
+    v-model="ruleForm.file"
+    :fileSize="1024"
+    :fileType="['pdf', 'docx', 'txt', 'xlsx', 'pptx....']"
+    :limit="10"
+    />
   </el-dialog>
 </template>
 
 <script setup>
 import { ref, watch } from "vue";
-import { addOrEditArchive } from "@/api/archiveManagement"
+import { addOrEditArchive } from "@/api/archiveManagement";
+import fileUpload from "@/components/FileUpload/index.vue";
 
 const centerDialogVisible = defineModel("centerDialogVisible", {
   type: Boolean,
@@ -66,22 +78,20 @@
 // 鍒濆鍖栬〃鍗曟暟鎹�
 const ruleFormRef = ref(null);
 const ruleForm = ref(initFormData(props.row));
-const copyForm = ref()
+const copyForm = ref();
 // 鐩戝惉 row 鐨勫彉鍖栵紝鏇存柊 ruleForm
-watch(() => props.row, (newRow) => {
-  copyForm.value = initFormData(newRow);
-  ruleForm.value = JSON.parse(JSON.stringify(copyForm.value));
-}, { deep: true });
+watch(
+  () => props.row,
+  (newRow) => {
+    copyForm.value = initFormData(newRow);
+    ruleForm.value = JSON.parse(JSON.stringify(copyForm.value));
+  },
+  { deep: true }
+);
 const rules = {
-  name: [
-    { required: true, message: "Please input activity name", trigger: "blur" },
-  ],
-  type: [
-    { required: true, message: "Please select activity zone", trigger: "change" },
-  ],
-  status: [
-    { required: true, message: "Please select activity count", trigger: "change" },
-  ],
+  name: [{ required: true, message: "璇疯緭鍏ユ枃妗e悕绉�", trigger: "blur" }],
+  type: [{ required: true, message: "璇烽�夋嫨鏂囨。绫诲瀷", trigger: "blur" }],
+  status: [{ required: true, message: "璇烽�夋嫨鏂囨。鐘舵��", trigger: "blur" }],
 };
 
 const options = [
@@ -93,27 +103,27 @@
 const submit = async () => {
   // 楠岃瘉琛ㄥ崟
   if (!ruleFormRef.value) return;
-  
+
   try {
     const valid = await ruleFormRef.value.validate();
     if (!valid) {
       return;
     }
-    
+
     // 璋冪敤 API
     let res = await addOrEditArchive(ruleForm.value);
     console.log("API 鍝嶅簲:", res);
-    
+
     // 鍙戦�� emit 浜嬩欢
     emit("submitForm", res);
     console.log("emit submitForm 宸插彂閫�");
-    
+
     // 鍏抽棴瀵硅瘽妗�
     centerDialogVisible.value = false;
   } catch (error) {
     console.error("琛ㄥ崟楠岃瘉澶辫触鎴朅PI璋冪敤澶辫触:", error);
   }
-}
+};
 </script>
 
 <style lang="less" scoped></style>

--
Gitblit v1.9.3