1
lzhe
2024-10-10 d1b6cd8e5270b15546c94587fe2648453d525eee
src/views/notification/notice/newsmail.vue
@@ -9,25 +9,45 @@
<template>
   <div class="newsmail-main">
      <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick">
          <el-tab-pane label="全部公告" name="A">
             <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef">
               <el-table-column prop="categoryName" label="title"></el-table-column>
               <el-table-column prop="businessName" label="content"></el-table-column>
               <el-table-column prop="notifyTime" label="date"></el-table-column>
               <el-table-column fixed="right" label="操作">
                  <template #default="scope">
                     <el-button text type="primary" size="small" @click="table_view(scope.row, scope.$index)">查看更多&gt&gt</el-button>
                  </template>
               </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="发布公告" name="B">Config</el-tab-pane>
          <el-tab-pane label="任免公告" name="C">Role</el-tab-pane>
          <el-tab-pane label="转发公告" name="D">Task</el-tab-pane>
          <el-tab-pane label="指示公告" name="E">Task</el-tab-pane>
          <el-tab-pane label="事务公告" name="F">Task</el-tab-pane>
          <el-tab-pane label="全部公告" name="A"></el-tab-pane>
          <el-tab-pane label="发布公告" name="B"></el-tab-pane>
          <el-tab-pane label="任免公告" name="C"></el-tab-pane>
          <el-tab-pane label="转发公告" name="D"></el-tab-pane>
          <el-tab-pane label="指示公告" name="E"></el-tab-pane>
          <el-tab-pane label="事务公告" name="F"></el-tab-pane>
      </el-tabs>
      <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef">
         <el-table-column prop="categoryName" label="title">
            <template #default="scope">
               <span class="spanDot" :style="{'background-color': scope.row.status != 1?'red':''}"></span>
               <span>{{scope.row.categoryName}}</span>
            </template>
         </el-table-column>
         <el-table-column prop="businessName" label="content"></el-table-column>
         <el-table-column prop="notifyTime" label="date"></el-table-column>
         <el-table-column fixed="right" label="操作">
            <template #default="scope">
               <el-button text type="primary" size="small" @click="table_view(scope.row, scope.$index)">查看更多&gt&gt</el-button>
            </template>
         </el-table-column>
      </el-table>
   </div>
   <el-dialog title="详情" v-model="visible" :width="500" destroy-on-close>
      <el-row>
         <el-col :span="24" style="margin-bottom:12px;">
            <span style="font-weight: bold;">{{detailForm.businessName}}</span>
         </el-col>
         <el-col :span="24" style="margin-bottom:12px;font-size: 12px;color: #666;">
            <span>{{detailForm.notifyTime}}</span>
         </el-col>
         <el-col :span="24">
            <span v-html="detailForm.message"></span>
         </el-col>
      </el-row>
      <template #footer>
         <el-button @click="visible=false" >关闭</el-button>
      </template>
   </el-dialog>
</template>
<script>
   export default {
@@ -35,7 +55,13 @@
      data(){
         return {
            tableData: [],
            activeName: "A"
            activeName: "A",
            visible: false,
            detailForm: {
               businessName: "",
               notifyTime: "",
               message: ""
            }
         }
      },
      created(){
@@ -48,14 +74,33 @@
         
      },
      methods: {
         table_view() {
         table_view(row) {
            this.$HTTP.get(`/api/blade-notify/notify-system/get/${row.id}`).then(res=> {
               if(res.code == 200) {
                  this.detailForm = res.data;
                  this.visible = true;
               }
            })
         },
         handleClick(TabPaneName) {
            this.getcategoryList();
         },
         getcategoryList() {
            this.$HTTP.get(`/api/blade-notify/notify-system/page?size=10&notifyType=2&current=1`).then(res=> {
            if(this.activeName == "A") {
               var url = `/api/blade-notify/notify-system/page?size=10&notifyType=2&current=1`;
            }else if(this.activeName == "B") {
               var url = `/api/blade-notify/notify-system/page?size=10&notifyType=2&category=1&current=1`;
            }else if(this.activeName == "C") {
               var url = `/api/blade-notify/notify-system/page?size=10&notifyType=2&category=5&current=1`;
            }else if(this.activeName == "D") {
               var url = `/api/blade-notify/notify-system/page?size=10&notifyType=2&category=3&current=1`;
            }else if(this.activeName == "E") {
               var url = `/api/blade-notify/notify-system/page?size=10&notifyType=2&category=4&current=1`;
            }else if(this.activeName == "F") {
               var url = `/api/blade-notify/notify-system/page?size=10&notifyType=2&category=6&current=1`;
            }
            this.$HTTP.get(url).then(res=> {
               if(res.code == 200) {
                  this.tableData = res.data.records;
               }
@@ -75,4 +120,12 @@
.multipleTableRef /deep/ .el-table__header-wrapper{
   display: none;
}
.spanDot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    display: inline-block;
    margin-right:12px;
    font-size: 14px;
}
</style>