From d53daa4223fb256a89aa2d21ca4e85f2bed9d2b3 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期五, 08 三月 2024 16:05:30 +0800
Subject: [PATCH] 11

---
 src/views/project/message/index.vue         |    3 
 src/views/project/indexstatistics/index.vue |  173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 src/components/Pagination/index.vue         |    2 
 src/api/project/message.js                  |    1 
 4 files changed, 167 insertions(+), 12 deletions(-)

diff --git a/src/api/project/message.js b/src/api/project/message.js
index d36d238..39c4989 100644
--- a/src/api/project/message.js
+++ b/src/api/project/message.js
@@ -13,7 +13,6 @@
     return request({
       url: `/project/systemmessage/${id}`,
       method: 'get',
-     
     })
   }
 // 淇敼绯荤粺娑堟伅
diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue
index 5e5d890..acf2d39 100644
--- a/src/components/Pagination/index.vue
+++ b/src/components/Pagination/index.vue
@@ -46,7 +46,7 @@
     },
     layout: {
       type: String,
-      default: 'total, sizes, prev, pager, next, jumper'
+      default: 'total, sizes, prev, pager, next'
     },
     background: {
       type: Boolean,
diff --git a/src/views/project/indexstatistics/index.vue b/src/views/project/indexstatistics/index.vue
index f6057db..03b53dd 100644
--- a/src/views/project/indexstatistics/index.vue
+++ b/src/views/project/indexstatistics/index.vue
@@ -475,17 +475,86 @@
           </el-col>
         </el-row>
       </div>
-      <div style="width: 24%; margin-top: 10px; padding-left: 10px;">
-        <el-card class="box-card" style="padding: 0; font-weight: bold; height: 780px">
+      <div style="width: 24%; margin-top: 10px; padding-left: 10px; ">
+        <el-card
+          class="box-card"
+          style="padding: 0; font-weight: bold; height: 780px; "
+        >
           <div slot="header" class="clearfix">
-            <span style="font-size: 18px; color: #566f94; font-weight: bold">娑堟伅鍒楄〃</span>
-            <el-button style="float: right; padding: 3px 0" type="text"
-              >鍏ㄩ儴宸茶</el-button
+            <span style="font-size: 18px; color: #566f94; font-weight: bold"
+              >娑堟伅鍒楄〃</span
+            >
+            <el-button
+              v-if="ReadState == 1"
+              style="float: right; padding: 6px "
+              type="danger"
+              plain
+              @click="FnReadState"
+              >鏌ョ湅鏈娑堟伅</el-button
+            >
+            <el-button
+              v-else
+              style="float: right; padding: 6px "
+              type="info"
+              plain
+              @click="FnReadState"
+              >鏌ョ湅宸茶娑堟伅</el-button
             >
           </div>
-          <div v-for="o in 4" :key="o" class="text item">
-            {{ "鍒楄〃鍐呭 " + o }}
+          <div style="height: 606px;overflow: auto;">
+            <el-table :data="tableData" v-loading="loading" style="width: 100%">
+              <el-table-column label="閫氱煡鏃ユ湡">
+                <template slot-scope="scope">
+                  <i class="el-icon-time"></i>
+                  <span style="margin-left: 10px">{{
+                    scope.row.createTime
+                  }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="姒傝">
+                <template slot-scope="scope">
+                  <el-popover trigger="hover" placement="top">
+                    <div class="dialog-class" style="margin: 20px;">
+                      <div>{{ scope.row.messagecontent }}</div>
+                      <div style=" height: 100px;margin-top: 40px;">
+                        <span>{{ "澶勭悊浜猴細" + scope.row.sendusername }}</span>
+                        <div>{{ "澶勭悊鏃堕棿锛�" + scope.row.updateTime }}</div>
+                      </div>
+                      <div style="text-align: right; ; margin: 0">
+                        <el-button
+                          type="primary"
+                          size="mini"
+                          @click="clickMessageDetailed(scope.row)"
+                          >纭畾</el-button
+                        >
+                      </div>
+                    </div>
+                    <div slot="reference" class="name-wrapper">
+                      <el-tag size="medium">{{
+                        scope.row.messagetitle
+                      }}</el-tag>
+                    </div>
+                  </el-popover>
+                </template>
+              </el-table-column>
+              <el-table-column label="鐘舵��" align="center" prop="paystatus">
+                <template slot-scope="scope">
+                  <dict-tag
+                    :options="dict.type.sys_messagestatus"
+                    :value="scope.row.isread"
+                  />
+                </template>
+              </el-table-column>
+            </el-table>
           </div>
+
+          <pagination
+            v-show="total > 0"
+            :total="total"
+            :page.sync="searchData.pageNum"
+            :limit.sync="searchData.pageSize"
+            @pagination="GetMessageList"
+          />
         </el-card>
       </div>
     </div>
@@ -557,6 +626,13 @@
   getOrgansOfHospitalByMonth,
   getDonateorganSum
 } from "@/api/project/donateorgan";
+import { getUserProfile } from "@/api/system/user";
+import {
+  listSystemmessageList,
+  listSystemmessageCount,
+  updateSystemmessage
+} from "@/api/project/message";
+
 import Li_area_select from "@/components/Address";
 
 const DEF_TABLE_CONFIG = {
@@ -569,6 +645,7 @@
 
 export default {
   name: "home",
+  dicts: ["sys_messagestatus"],
   components: {
     RankChart,
     OrganNumChart,
@@ -597,7 +674,18 @@
         { label: "鍙板窞甯�", value: "A" },
         { label: "涓芥按甯�", value: "B" }
       ],
+      ReadState: 1,
+      searchData: {
+        del_flag: 0,
+        receiveuserno: "",
+        isread: null,
+        pageNum: 1,
+        pageSize: 10
+      },
+      total: 0,
+      loading: false,
       value: "",
+      userID: "",
       //鏃堕棿閫夐」
       timeoption: "",
       //璧峰鏃堕棿
@@ -696,6 +784,28 @@
         //   value: 0,
         // },
       ],
+      tableData: [
+        {
+          date: "2016-05-02",
+          name: "鐜嬪皬铏�",
+          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�"
+        },
+        {
+          date: "2016-05-04",
+          name: "鐜嬪皬铏�",
+          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�"
+        },
+        {
+          date: "2016-05-01",
+          name: "鐜嬪皬铏�",
+          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�"
+        },
+        {
+          date: "2016-05-03",
+          name: "鐜嬪皬铏�",
+          address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�"
+        }
+      ],
       //缁熻鎸囨爣鏁版嵁
       qualirtData: {
         dbcddgfrate: 0,
@@ -760,6 +870,7 @@
   // listnewEthicalreviewopinions
   created() {
     // this.listnewMedicalevaluation()
+    this.GetUser();
   },
   mounted() {
     this.$nextTick(() => {
@@ -773,7 +884,53 @@
   },
   methods: {
     getprovincedata() {},
-
+    GetUser() {
+      this.loading = true;
+      getUserProfile()
+        .then(res => {
+          this.searchData.receiveuserno = res.data.userName;
+          this.GetMessageList();
+        })
+        .catch(error => {
+          this.$message.error(error);
+        });
+    },
+    GetMessageList() {
+      listSystemmessageList(this.searchData).then(res => {
+        if (res.code == 200) {
+          this.tableData = res.rows;
+          this.loading = false;
+          this.total = res.total;
+        }
+      });
+    },
+    // 纭畾宸茶
+    clickMessageDetailed(item) {
+      let data = item;
+      if (data.isread == 0) {
+        item.isread = 1;
+        updateSystemmessage(item)
+          .then(res => {
+            this.$message.success("宸茶");
+            this.GetMessageList();
+          })
+          .catch(error => {});
+      } else {
+        this.$message.info("姝ゆ秷鎭凡璇�");
+      }
+    },
+    // 鍒囨崲璇诲彇鐘舵��
+    FnReadState() {
+      if (this.ReadState == 1) {
+        this.searchData.isread = 0;
+        this.ReadState = 0;
+        this.GetMessageList();
+      } else {
+        this.searchData.isread = 1;
+        this.ReadState = 1;
+        this.GetMessageList();
+      }
+    },
     get_unix_time(dateStr) {
       var newstr = dateStr.replace(/-/g, "/");
       var date = new Date(newstr);
diff --git a/src/views/project/message/index.vue b/src/views/project/message/index.vue
index 5af5853..bca9682 100644
--- a/src/views/project/message/index.vue
+++ b/src/views/project/message/index.vue
@@ -208,8 +208,7 @@
         ...this.searchData,
         pageNum: this.pageNum,
         pageSize: this.pageSize,
-        orderByColumn:"createTime",
-        isAsc:'desc'
+
       })
         .then((res) => {
        

--
Gitblit v1.9.3