Преглед на файлове

feat: 编辑内容时,删除壁纸,点击保存,显示保存成功

332777428@qq.com преди 6 месеца
родител
ревизия
25c88c5e65
променени са 2 файла, в които са добавени 12 реда и са изтрити 5 реда
  1. 1 1
      src/components/Upload/index.vue
  2. 11 4
      src/views/operation/piano/index.vue

+ 1 - 1
src/components/Upload/index.vue

@@ -261,7 +261,7 @@ export default {
     onDelete() {
       this.form.file = "";
       this.percentage = 0;
-      // this.$emit("upload", this.form);
+      this.$emit("upload", this.form);
     },
 
     // 如果上传失败 重新上传

+ 11 - 4
src/views/operation/piano/index.vue

@@ -17,12 +17,14 @@
 
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
-      <el-table-column
+      <!-- <el-table-column
         label="排序"
         align="center"
         type="index"
         show-overflow-tooltip
-      />
+      /> -->
+
+      <el-table-column label="排序" align="center" width="200px" prop="sort" />
 
       <el-table-column label="图片" align="center" width="100px">
         <template slot-scope="scope">
@@ -130,6 +132,7 @@ export default {
       // 弹窗
       dialogVisible: false,
       dialogTitle: "新增",
+      picTemp: "",
       dialogData: {
         sort: 1,
       },
@@ -233,13 +236,17 @@ export default {
 
     // 上传
     uploadCode(e) {
-      this.dialogData.pic = e.file;
+      this.picTemp = e.file;
+      if (e != null && e.file != "") {
+        this.dialogData.pic = e.file;
+      }
     },
 
     // 提交分类表单
     getDialogSubmit() {
       var that = this;
-      var pic = that.dialogData.pic;
+      var pic = this.picTemp;
+      // var pic = that.dialogData.pic;
       if (pic == null || pic == "") {
         that.$message.success("请上传图片");
         return;