Browse Source

开发者展示上传图片处理

zweizhao 7 years ago
parent
commit
22b8cc6786
1 changed files with 4 additions and 15 deletions
  1. 4 15
      src/module/main/components/dev_show.vue

+ 4 - 15
src/module/main/components/dev_show.vue

@@ -38,13 +38,6 @@
         </el-table-column>
       </el-table>
     </div>
-    <!-- <el-pagination
-      @current-change="getTableData"
-      :current-page.sync="currentPage"
-      :page-size="20"
-      layout="total, prev, pager, next"
-      :total="totalCount"
-    ></el-pagination> -->
     <el-dialog title="添加展示" :visible.sync="centerDialogVisible" width="50%" center>
       <el-form
         :model="ruleForm"
@@ -141,12 +134,13 @@ export default {
     },
     // 点击添加
     clickAdd() {
-      if(this.isEdit) this.ruleForm = {};
+      this.ruleForm = {};
       this.isEdit = false;
       this.centerDialogVisible = true;
     },
     handleAvatarSuccess(res, file) {
-      this.ruleForm.url = res.data.file_url_abs;
+      // this.ruleForm.url = res.data.file_url_abs;
+      this.$set(this.ruleForm, 'url', res.data.file_url_abs);
     },
     beforeAvatarUpload(file) {
       const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
@@ -187,12 +181,7 @@ export default {
       // 获取编辑信息, 现在自带的全, 暂时不用了
       // 接口:/api/admin/developer/getRecommendDeveloper
       // 参数:id int 列表每条记录的id(不是uid)
-      if(!this.isEdit) this.ruleForm = {
-        uid,
-        order,
-        url,
-        id,
-      };
+      this.ruleForm = { uid, order, url, id };
       this.isEdit = true;
       this.centerDialogVisible = true;
     },