gks 1 year ago
parent
commit
480bf07cb2

+ 11 - 0
src/components/editor.vue

@@ -12,6 +12,10 @@ export default {
     },
     value: {
       default: ''
+    },
+    edits:{
+      type:Boolean,
+      default:false
     }
   },
   data() {
@@ -20,6 +24,7 @@ export default {
       contentValue: this.value,
       baseUrl: process.env.VUE_APP_BASE_API,
       setting: {
+        readonly: true,
         menubar: false,
         ProgressState: true,
         toolbar:
@@ -88,6 +93,7 @@ export default {
       }
     };
   },
+  
   watch: {
     value(newValue) {
       if (newValue) {
@@ -96,8 +102,13 @@ export default {
     },
     contentValue(newValue) {
       this.$emit('input', newValue);
+
+    },
+    edits(newValue){
+      this.setting.readonly = newValue
     }
   },
+ 
   mounted() {
     setTimeout(() => {
       this.open = true;

+ 16 - 6
src/views/COUNSELINGMESSAGE/edit.vue

@@ -1,14 +1,14 @@
 <template>
   <div class="cmain">
-    <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+    <el-form ref="form" :model="form" :rules="rules" :disabled="edits" label-width="80px">
       <el-form-item label="标题" prop="title">
         <el-input v-model="form.title" placeholder="请输入标题"></el-input>
       </el-form-item>
 <!--      <el-form-item label="图片上传">-->
 <!--        <cropper v-model="form.fileUrl" :fixed_number="[4, 2]"></cropper>-->
 <!--      </el-form-item>-->
-      <el-form-item label="内容" prop="content">
-        <editor v-model="form.content" />
+      <el-form-item label="内容" prop="content" >
+        <editor v-model="form.content" :edits="edits" />
       </el-form-item>
 
 <!--      <el-form-item label="图片上传">-->
@@ -30,8 +30,8 @@
     </el-form>
 
     <div slot="footer" class="mfooter">
-      <el-button type="info" @click="submitzc" v-if="checkPermi(['business:COUNSELINGMESSAGE:confirm'])">暂存草稿</el-button>
-      <el-button type="primary" @click="submitForm" v-if="checkPermi(['business:COUNSELINGMESSAGE:confirm'])">提交审核</el-button>
+      <el-button type="info" @click="submitzc" v-if="checkPermi(['business:COUNSELINGMESSAGE:confirm']) && !edits">暂存草稿</el-button>
+      <el-button type="primary" @click="submitForm" v-if="checkPermi(['business:COUNSELINGMESSAGE:confirm'])&& !edits">提交审核</el-button>
       <el-button @click="$layer.close(layerid)">取 消</el-button>
     </div>
     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" fullscreen append-to-body @close="dialogVisible = false">
@@ -52,6 +52,7 @@ export default {
       dialogVisible:false,
       disabled: false,
       fileList: [],
+      edits: null,
       // 表单参数
       form: {content:''},
       // 表单校验
@@ -63,11 +64,20 @@ export default {
       }
     }
   },
+  created(){
+  },
   mounted() {
+    this.edits = this.param.edit;
     if (this.param.id) {
       getCOUNSELINGMESSAGE(this.param.id).then(response => {
         this.form = response.data;
-        this.form.content = response.data.content.replace(new RegExp('/profile/upload/', 'g'), this.baseUrl + '/profile/upload/');
+        if(this.form.content.includes(process.env.VUE_APP_BASE_API)){
+          this.form.content = response.data.content
+        }else{
+          this.form.content = response.data.content.replace(
+          new RegExp("/profile/upload/", "g"),
+          this.baseUrl + "/profile/upload/")
+        }
       });
     }
   },

+ 9 - 3
src/views/COUNSELINGMESSAGE/index.vue

@@ -31,17 +31,17 @@
       <el-table-column label="标题信息" width="260" show-overflow-tooltip align="center" prop="title"/>
       <el-table-column label="创建时间" align="center" prop="createTime" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+          <span>{{ scope.row.createTime }}</span>
         </template>
       </el-table-column>
       <el-table-column label="更新时间" align="center" prop="updateTime" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
+          <span>{{ scope.row.updateTime}}</span>
         </template>
       </el-table-column>
       <el-table-column label="审核日期" align="center" prop="auditTime" >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
+          <span>{{ scope.row.auditTime}}</span>
         </template>
       </el-table-column>
       <el-table-column label="信息状态" align="center" prop="status">
@@ -62,6 +62,7 @@
           <el-button v-if="scope.row.status == 0 || scope.row.status == 2 ||scope.row.status ==null" size="mini" type="text" @click="handleCommit(scope.row)">提交审核</el-button>
           <el-button v-if="scope.row.status == 3" size="mini" type="text"  @click="handleDownOrUp(scope.row)">上报</el-button>
           <el-button v-if="scope.row.status == 6 || scope.row.status == 4" size="mini" type="text" @click="handleDownOrUp(scope.row)">发布</el-button>
+          <el-button size="mini" type="text"  @click="handleDetail(scope.row)">详情</el-button>
           <el-button v-if="scope.row.status == 0 || scope.row.status == 2 || scope.row.status == 3 ||  scope.row.status == 6 ||scope.row.status ==null && scope.row.status != 4" size="mini" type="text" @click="handleUpdate(scope.row)">修改</el-button>
           <el-button v-if="scope.row.status != 5 && scope.row.status != 1" size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button>
         </template>
@@ -247,6 +248,11 @@ export default {
         })
         .catch(() => {});
     },
+    // 详情
+    handleDetail(row) {
+      const id = row.id || this.ids;
+      this.iframe({ obj: edit, param: { id: id, edit:true }, title: '资讯详情', width: '1050px', height: '750px' });
+    },
     /** 导出按钮操作 */
     handleExport() {
       this.download(