Browse Source

系统消息

LAPTOP-FO2T5SIU\35838 5 months ago
parent
commit
439c14dff4

+ 5 - 5
src/components/QuillEditor/index.vue

@@ -10,7 +10,7 @@
     />
     <quill-editor
       ref="myQuillEditor"
-      v-model="content"
+      v-model="value"
       :options="editorOption"
       @change="onEditorChange($event)"
     />
@@ -57,7 +57,7 @@ export default {
     },
     data() {
         return {
-            content: this.value,
+            content: '',
             once: true,
             serverUrl: this.$constant.BASE_URI + '/FileController/upload',
             myQuillEditor: 'vue-quill-' + +new Date() + ((Math.random() * 1000).toFixed(0) + ''),
@@ -99,10 +99,10 @@ export default {
         }
     },
     watch: {
-        value() {
+        value(val) {
             // this.content = val
-            // this.$emit('input', val)
-            this.content = this.value
+            this.$emit('input', val)
+            // this.content = this.value
         }
     },
     mounted() {

+ 24 - 23
src/views/dashpanel/systemMessages.vue

@@ -9,7 +9,7 @@
           <el-col :span="24">
             <el-table v-loading="loading" :data="AllData" stripe row-class-name="g_table_row">
               <el-table-column type="index" width="30" align="center" />
-              <el-table-column label="主题" prop="title" >
+              <el-table-column label="主题" prop="title">
                 <template slot-scope="scope">
                   <span style="color: blue" @click="showSysMsg(scope.row)">{{ scope.row.title }}</span>
                 </template>
@@ -40,34 +40,35 @@
         </el-row>
       </el-collapse-item>
     </el-collapse>
-<!--    <el-my-dialog-->
-<!--      title="系统消息详情"-->
-<!--      :visible.sync="dialogSysMsg"-->
-<!--      width="70%"-->
-<!--      top="50px"-->
-<!--      :close-on-click-modal="false"-->
-<!--      :close-on-press-escape="false"-->
-<!--    >-->
-<!--      <sys-msg-detial-->
-<!--        :key="msgShowKey"-->
-<!--        :msg-id="msgId"-->
-<!--        :close-on-click-modal="false"-->
-<!--        :close-on-press-escape="false"-->
-<!--      />-->
-<!--      <div class="el-dialog__footer">-->
-<!--        <el-button @click="dialogSysMsg = false">取 消</el-button>-->
-<!--      </div>-->
-<!--    </el-my-dialog>-->
+    <el-dialog
+      title="系统消息详情"
+      :visible.sync="dialogSysMsg"
+      width="70%"
+      top="50px"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      append-to-body
+    >
+      <sys-msg-detial
+        :key="msgShowKey"
+        :msg-id="msgId"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+      />
+      <div class="el-dialog__footer">
+        <el-button @click="dialogSysMsg = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
 import Base from '@/views/base/base'
 import BaseData from '@/views/base/baseData'
-// import sysMsgDetial from '@/views/sysMsg/sysMsgDetial'
+import sysMsgDetial from '@/views/sysMsg/sysMsgDetial'
 export default {
     name: 'MyInfo',
     components: {
-        // sysMsgDetial
+        sysMsgDetial
     },
     mixins: [Base, BaseData],
     data() {
@@ -89,7 +90,7 @@ export default {
                 pageNum: _this.currentPage,
                 pageSize: 15
             }
-            this.baseRequest('myInReadlist', postData).then(res => {
+            this.baseRequest('getAllList', postData).then(res => {
                 if (res.data.rows) {
                     res.data.rows.forEach(function(item) {
                         _this.AllData.push(item)
@@ -108,7 +109,7 @@ export default {
         },
 
         baseRequest(opUrl, postData) {
-            return this.$channel.globeRequest('SysMessageController', opUrl, postData, 'project')
+            return this.$channel.globeRequest('SysMessageWorkController', opUrl, postData, 'project')
         }
     }
 }

+ 55 - 42
src/views/sysMsg/index.vue

@@ -2,23 +2,32 @@
   <div>
     <el-row class="handle-box" style="margin-bottom: 10px">
       <el-col :span="24">
-        <el-input v-model="seachFrom.keywords" class="ch-input ch-input-size" placeholder="主题/发布人/更改人/版本号" size="small" @keyup.enter.native="handleSearch()" />
+        <el-input v-model="seachFrom.keywords" placeholder="主题/发布人/更改人/版本号" size="small" class="ch-input ch-input-size" @keyup.enter.native="handleSearch()" />
         <el-select v-model="seachFrom.state" placeholder="状态" size="small">
           <el-option label="全部" value="" />
           <el-option label="待发布" value="1" />
           <el-option label="已发布" value="0" />
           <el-option label="已撤回" value="2" />
         </el-select>
-        <el-date-picker v-model="seachFrom.times" end-placeholder="结束日期" range-separator="至" size="small" start-placeholder="开始日期" type="daterange" value-format="yyyy-MM-dd" @change="clickTimeFun" />
+        <el-date-picker
+          v-model="seachFrom.times"
+          type="daterange"
+          size="small"
+          value-format="yyyy-MM-dd"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          @change="clickTimeFun"
+        />
 
         <el-button class="ch-button-warning" size="small" @click="handleReset()"><i class="el-icon-refresh" />&nbsp;重置</el-button>
         <el-button class="ch-button" size="small" @click="handleSearch()"><i class="el-icon-search" />&nbsp;搜索</el-button>
-        <el-button class="ch-button" size="small" style="float: right;margin-top: 4px" @click="handleAdd()"><i class="el-icon-document-add" />&nbsp;新增</el-button>
+        <el-button size="small" class="ch-button-add" style="float: right;margin-top: 4px" @click="handleAdd()"><i class="el-icon-document-add" />&nbsp;新增</el-button>
       </el-col>
     </el-row>
     <el-row class="handle-box">
       <el-col :span="24">
-        <el-table v-loading="loading" :data="AllData" row-class-name="g_table_row" stripe>
+        <el-table v-loading="loading" :data="AllData" stripe row-class-name="g_table_row">
           <el-table-column type="index" width="60" />
           <el-table-column label="主题" prop="title" />
           <el-table-column label="版本号" prop="versionNo" />
@@ -32,12 +41,12 @@
               {{ scope.row.state==0?"已发布":scope.row.state==1?"待发布":scope.row.state==2?"已撤回":"" }}
             </template>
           </el-table-column>
-          <el-table-column align="center" header-align="center" label="操作" width="220">
+          <el-table-column label="操作" header-align="center" align="center" width="260">
             <template scope="scope">
-              <el-button v-if="scope.row.state == 0" class="ch-button-warning" size="mini" @click="pushMsg(scope.row, '2')">撤回</el-button>
-              <el-button v-if="scope.row.state != 0" class="ch-button-warning" size="mini" @click="pushMsg(scope.row, '0')">发布</el-button>
-              <el-button size="mini" type="primary" @click="handleEdit(scope.row)">编辑</el-button>
-              <el-button size="mini" type="danger" @click="handleDel(scope.row)">删除</el-button>
+              <el-button v-if="scope.row.state == 0" size="mini" class="ch-button-warning" @click="pushMsg(scope.row, '2')">撤回</el-button>
+              <el-button v-if="scope.row.state != 0" size="mini" class="ch-button-warning" @click="pushMsg(scope.row, '0')">发布</el-button>
+              <el-button size="mini" type="primary" class="editButton" @click="handleEdit(scope.row)">编辑</el-button>
+              <el-button size="mini" type="danger" class="deleButton" @click="handleDel(scope.row)">删除</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -45,16 +54,16 @@
           <el-pagination
             :current-page.sync="currentPage"
             :page-size="pageSize"
-            :total="allpage"
             background
             layout="total, prev, pager, next"
+            :total="allpage"
             @current-change="handleCurrentChange"
           />
         </div>
       </el-col>
     </el-row>
-    <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" top="50px" width="70%" @open="dlgOpen">
-      <el-form ref="form" :model="form" :rules="rules" style="width: 100%;padding: 5px">
+    <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="70%" top="50px" append-to-body @open="dlgOpen">
+      <el-form ref="form" :model="form" style="width: 100%;padding: 5px" :rules="rules">
         <el-row>
           <el-col style="padding-bottom: 10px">
             <span class="card_title">基本信息</span>
@@ -87,11 +96,11 @@
                   <el-form-item>
                     <!-- <el-input v-model="form.annex" /> -->
                     <el-upload
+                      class="upload-demo"
+                      action="#"
+                      :http-request="upload"
                       :before-remove="uploadRemove"
                       :file-list="fileList"
-                      :http-request="upload"
-                      action="#"
-                      class="upload-demo"
                     >
                       <el-button size="small" type="primary">点击上传</el-button>
                       <div slot="tip" class="el-upload__tip">请上传50MB以内的文件</div>
@@ -124,12 +133,13 @@ import BaseData from '@/views/base/baseData'
 import axios from 'axios'
 import channel from '../../static/utils/channel'
 import Constant from '../../static/utils/constant'
-// import QuillEditor from '@/components/QuillEditor'
+import QuillEditor from '@/components/QuillEditor'
+import common from '@/static/utils/common'
 
 export default {
     name: 'PendingAudit',
     components: {
-        // QuillEditor
+        QuillEditor
     },
     mixins: [Base, BaseData],
     data() {
@@ -216,12 +226,15 @@ export default {
             this.fileList = []
         },
         getContent(content) {
+            console.log('content', content)
+
             // this.content = content
             this.form.content = content
+            console.log('this.form.content', this.form.content)
         },
         confirmSubmit: function() {
-            //console.log('fileList_:', this.fileList)
-            //console.log('fileList_:', JSON.stringify(this.fileList))
+            console.log('fileList_:', this.fileList)
+            console.log('fileList_:', JSON.stringify(this.fileList))
             const _this = this
             this.$refs.form.validate(valid => {
                 if (valid) {
@@ -236,7 +249,7 @@ export default {
                     postData.annex = JSON.stringify(_this.fileList)
                     this.opRecord(postData, soaUrl)
                 } else {
-                    //console.log('error submit!!')
+                    console.log('error submit!!')
                     return false
                 }
             })
@@ -248,7 +261,7 @@ export default {
                     id: this.form.id
                 }
                 this.baseRequest('getById', postData).then((res) => {
-                    //console.log('dlgOpen_:', res)
+                    console.log('dlgOpen_:', res)
                     if (res.data) {
                         const { data } = res
                         _this.form = Object.assign({}, _this.form, res.data)
@@ -357,7 +370,7 @@ export default {
                 })
         },
         baseRequest(opUrl, postData) {
-            return channel.globeRequest('SysMessageController', opUrl, postData, 'project')
+            return channel.globleRequest('sysMessageController', opUrl, postData, 'project')
         },
         uploadRemove(file, fileList) {
             this.fileList = fileList
@@ -367,24 +380,24 @@ export default {
 </script>
 
 <style scoped>
-    .ch-input .el-input__inner {
-        border-radius: 0px;
-        border-color: #32323A;
-    }
-    .ch-input-size {
-        width: 150px;
-    }
-    .ch-button {
-        border-radius: 0px;
-        border-color: #32323A;
-        background-color: #32323A;
-        color: #fff;
-    }
-    .ch-button-warning {
-        margin-left: 10px;
-        border-radius: 0px;
-        border-color: #E6A23C;
-        background-color: #E6A23C;
-        color: #fff;
-    }
+.ch-input .el-input__inner {
+    border-radius: 0px;
+    border-color: #32323A;
+}
+.ch-input-size {
+    width: 150px;
+}
+.ch-button {
+    border-radius: 0px;
+    border-color: #32323A;
+    background-color: #32323A;
+    color: #fff;
+}
+.ch-button-warning {
+    margin-left: 10px;
+    border-radius: 0px;
+    border-color: #E6A23C;
+    background-color: #E6A23C;
+    color: #fff;
+}
 </style>

+ 45 - 47
src/views/sysMsg/sysMsgDetial.vue

@@ -23,8 +23,8 @@
               <el-col :span="3" class="col-txt"><span>内容</span></el-col>
               <el-col :span="20" class="col-input">
                 <el-form-item style="border-radius: 4px; border: 1px solid #DCDFE6;">
-                    <el-input v-if="!fromData.content" readonly type="hidden" />
-                    <div v-viewer="{}" v-html="fromData.content" />
+                  <el-input v-if="!fromData.content" type="hidden" readonly />
+                  <div v-viewer="{}" v-html="fromData.content" />
                 </el-form-item>
               </el-col>
               <el-col :span="3" class="col-txt"><span>发布时间</span></el-col>
@@ -39,7 +39,7 @@
               <el-col :span="20" class="col-input">
                 <el-form-item>
                   <div v-for="file in fromData.fileUrlList" :key="file.url">
-                    <a style="color: blue"  @click="fileDowload(file.url)">{{ file.name }}</a>
+                    <a style="color: blue" @click="fileDowload(file.url)">{{ file.name }}</a>
                   </div>
                 </el-form-item>
               </el-col>
@@ -53,9 +53,8 @@
 <script>
 import Base from '../base/base'
 import BaseData from '../base/baseData'
-
 export default {
-    name: 'sysMsgDetial',
+    name: 'SysMsgDetial',
     mixins: [Base, BaseData],
     props: {
         msgId: {
@@ -71,82 +70,81 @@ export default {
     watch: {
     },
     created() {
-        this.readMsg(this.msgId);
-        this.getInfoData(this.msgId);
+        this.readMsg(this.msgId)
+        this.getInfoData(this.msgId)
     },
     destroyed() {
     },
     methods: {
-        getInfoData(msgId){
+        getInfoData(msgId) {
             const postData = {
                 id: msgId
             }
             this.baseRequest('getById', postData).then((res) => {
-                //console.log("dlgOpen_:", res)
+                console.log('dlgOpen_:', res)
                 if (res.data) {
                     const { data } = res
-                    this.fromData = Object.assign({}, this.fromData, res.data);
-                    if(this.fromData.annex)
-                        this.fromData.fileUrlList = JSON.parse(this.fromData.annex);
-                    //console.log("this.fromData.fileUrlList_:", this.fromData.fileUrlList)
+                    this.fromData = Object.assign({}, this.fromData, res.data)
+                    if (this.fromData.annex) { this.fromData.fileUrlList = JSON.parse(this.fromData.annex) }
+                    console.log('this.fromData.fileUrlList_:', this.fromData.fileUrlList)
                 }
             }).catch(() => {
             })
         },
 
         // 阅读消息
-        readMsg: function(msgId){
+        readMsg: function(msgId) {
             const postData = {
                 id: msgId
             }
             this.workRequest('readMsg', postData).then((res) => {
-                //console.log("阅读消息_:", res)
+                console.log('阅读消息_:', res)
             }).catch(() => {
             })
         },
 
-        fileDowload(url){
+        fileDowload(url) {
             // alert(url);
-            location.href = url;
+            location.href = url
         },
 
         baseRequest(opUrl, postData) {
-            return this.$channel.globeRequest('SysMessageController', opUrl, postData, 'project')
+            return this.$channel.globleRequest('sysMessageController', opUrl, postData, 'project')
         },
 
         workRequest(opUrl, postData) {
-            return this.$channel.globeRequest('SysMessageController', opUrl, postData, 'project')
-        },
+            return this.$channel.globleRequest('SysMessageWorkController', opUrl, postData, 'project')
+        }
     }
 }
 </script>
 
 <style scoped>
-    .ch-input .el-input__inner {
-        border-radius: 0px;
-        border-color: #32323A;
-    }
-    .ch-input-size {
-        width: 150px;
-    }
-    .ch-button {
-        border-radius: 0px;
-        border-color: #32323A;
-        background-color: #32323A;
-        color: #fff;
-    }
-    .ch-button-warning {
-        margin-left: 10px;
-        border-radius: 0px;
-        border-color: #E6A23C;
-        background-color: #E6A23C;
-        color: #fff;
-    }
-    .ch-button-export {
-        margin-left: 10px;
-        border-radius: 0px;
-        border-color: #98CC1F;
-        background-color: #98CC1F;
-        color: #fff;
-    }
+.ch-input .el-input__inner {
+    border-radius: 0px;
+    border-color: #32323A;
+}
+.ch-input-size {
+    width: 150px;
+}
+.ch-button {
+    border-radius: 0px;
+    border-color: #32323A;
+    background-color: #32323A;
+    color: #fff;
+}
+.ch-button-warning {
+    margin-left: 10px;
+    border-radius: 0px;
+    border-color: #E6A23C;
+    background-color: #E6A23C;
+    color: #fff;
+}
+.ch-button-export {
+    margin-left: 10px;
+    border-radius: 0px;
+    border-color: #98CC1F;
+    background-color: #98CC1F;
+    color: #fff;
+}
 </style>