| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, watch } from "vue"; |
| | | import {ref, watch, nextTick} from "vue"; |
| | | import { addOrEditArchive } from "@/api/archiveManagement"; |
| | | import fileUpload from "@/components/FileUpload/index.vue"; |
| | | import { ElMessage } from "element-plus"; |
| | |
| | | const fileUploadRef = ref(null); |
| | | const initForm = () => { |
| | | ruleForm.value = {}; |
| | | nextTick(() => { |
| | | fileUploadRef.value.init(); |
| | | }); |
| | | }; |
| | | const editForm = (val) => { |
| | | ruleForm.value = copyForm.value; |
| | |
| | | // 调用 API |
| | | try { |
| | | const res = await addOrEditArchive(ruleForm.value); |
| | | ElMessage({ |
| | | type: "success", |
| | | message: res.msg || "操作成功", |
| | | }); |
| | | emit("submitForm", res); |
| | | } catch (error) { |
| | | ElMessage({ |
| | |
| | | // 发送 emit 事件 |
| | | |
| | | // 关闭对话框 |
| | | ElMessage.success("操作成功"); |
| | | centerDialogVisible.value = false; |
| | | } catch (error) { |
| | | ElMessage({ |