reloaded 4 年 前
コミット
c7540cdbf8
2 ファイル変更11 行追加7 行削除
  1. 4 0
      src/views/pcenter/news.vue
  2. 7 7
      src/views/pcenter/parts/infoFrom.vue

+ 4 - 0
src/views/pcenter/news.vue

@@ -105,6 +105,7 @@ export default {
           type: 'success',
         });
         this.searchInfo();
+        this.activeName = 'second';
       } else {
         this.$message.error('信息修改失败');
       }
@@ -118,6 +119,7 @@ export default {
           type: 'success',
         });
         this.searchInfo();
+        this.activeName = 'second';
       }
     },
     // 添加
@@ -140,6 +142,7 @@ export default {
           this.form = {};
           this.display = 'list';
           this.searchInfo();
+          this.activeName = 'second';
         }
       } else {
         data.publisher = this.user.uid;
@@ -151,6 +154,7 @@ export default {
           });
           this.form = {};
           this.display = 'list';
+          this.activeName = 'second';
           this.searchInfo();
         }
       }

+ 7 - 7
src/views/pcenter/parts/infoFrom.vue

@@ -30,8 +30,7 @@
             <el-input :disabled="disabled" v-model="form.publish_unit" placeholder="请输入发布单位"></el-input>
           </el-form-item>
           <el-form-item label="图片" prop="img_url" v-if="form.type == '0' && form.col_name == '图片新闻'">
-            <el-image v-if="disabled" :src="form.img_url"></el-image>
-            <upload v-else :limit="9" :data="form.img_url" type="img_url" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
+            <upload :limit="9" :data="form.img_url" type="img_url" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
           </el-form-item>
           <el-form-item label="视频" prop="file_url" v-if="form.type == '0' && form.col_name == '科技培训'">
             <video v-if="disabled" :src="form.file_url" controls="controls" style="height: 395px; width: 100%;">
@@ -74,7 +73,9 @@
             </el-radio-group>
           </el-form-item>
           <el-col :span="24" style="text-align:center;">
-            <el-button type="primary" @click="submitDraft('form')">保存</el-button>
+            <el-button v-if="user.type == '0' || user.type == '1' || (user.type == '4' && form.status == '0')" type="primary" @click="submitDraft('form')"
+              >保存</el-button
+            >
             <el-button type="danger" @click="resetForm()">取消</el-button>
           </el-col>
         </el-form>
@@ -121,7 +122,6 @@ export default {
     ],
     // 发布
     form: {},
-    imgList: [],
     // 规则
     rules: {
       col_name: [{ required: true, message: '请选择栏目', trigger: 'blur' }],
@@ -143,13 +143,13 @@ export default {
   },
   methods: {
     search() {
-      if (this.newform) {
-        console.log(this.newform);
-
+      if (this.newform.id) {
         this.$set(this, `form`, this.newform);
         if (this.user.type == '4' && (this.newform.status == '1' || this.newform.status == '2')) {
           this.disabled = true;
         }
+      } else {
+        this.form = { type: '0' };
       }
     },
     resetForm() {