From 97d1d36d67c0cc29bd21c2575dd8a61a757adaa5 Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期五, 17 五月 2024 09:24:36 +0800
Subject: [PATCH] fix:文件上传删除问题

---
 src/views/onlineStudy/file.vue |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/views/onlineStudy/file.vue b/src/views/onlineStudy/file.vue
index a393cc3..69fc203 100644
--- a/src/views/onlineStudy/file.vue
+++ b/src/views/onlineStudy/file.vue
@@ -61,7 +61,7 @@
     <pagination v-show="total > 0" :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize"
       @pagination="page" />
 
-    <el-dialog title="娣诲姞瀛︿範鍐呭" :visible.sync="open" width="600px" :close-on-click-modal="false"
+    <el-dialog :title="dialogTitle" :visible.sync="open" width="600px" :close-on-click-modal="false"
       :before-close="handleClose">
       <el-form label-position="left" label-width="120px" ref="form" :rules="rules" :model="form">
         <el-form-item label="涓婚" prop="subject">
@@ -112,6 +112,7 @@
   },
   data() {
     return {
+      dialogTitle: '娣诲姞瀛︿範鍐呭',
       ids: [],
       typeList: [],
       searchForm: {
@@ -124,6 +125,7 @@
       open: false,
       form: {
         contentType: 'video',
+        contentUrl: [],
         attachment: [],
         temp: []
       },
@@ -159,14 +161,13 @@
       }
     },
     clearFile() {
-      this.form.contentUrl = null;
+      this.form.contentUrl = [];
       this.$refs.upload.clearFile();
     },
     removeFile() {
-      this.form.contentUrl = null;
+      this.form.contentUrl = [];
     },
     removeAttachmentFile(fileList, fileName) {
-      console.log(fileList, fileName, "dddddddd");
       this.form.attachment = fileList.filter(item => item.name !== fileName);
     },
     getUploadAttachmentUrl(uploadData) {
@@ -226,6 +227,7 @@
     handlerAdd() {
       this.form = {};
       this.open = true;
+      this.dialogTitle = '娣诲姞瀛︿範鍐呭';
     },
     page() {
       OnlineStudyAPI.page(this.searchForm).then(res => {
@@ -242,7 +244,7 @@
       this.form.attachment = row.attachment || [];
       this.form.subject = row.subject;
       this.form.belongType = row.belongType;
-      console.log(row, "dfddddddd");
+      this.dialogTitle = '淇敼瀛︿範鍐呭';
       this.open = true;
     }
   },

--
Gitblit v1.8.0