|
@@ -0,0 +1,109 @@
|
|
|
+<script setup lang='ts'>
|
|
|
+import request from '@/utils/request';
|
|
|
+import { user } from '~/store/user';
|
|
|
+import { ref } from 'vue'
|
|
|
+import { updateUnreadNum } from '~/store/app'
|
|
|
+
|
|
|
+const loading = ref(false);
|
|
|
+
|
|
|
+const keyword = ref('');
|
|
|
+
|
|
|
+const tableData = ref([]);
|
|
|
+const total = ref(0);
|
|
|
+const currentPage = ref(1);
|
|
|
+
|
|
|
+function getListData() {
|
|
|
+ loading.value = true;
|
|
|
+ request({
|
|
|
+ url: '/jdbg/xxzx/index',
|
|
|
+ data: {
|
|
|
+ keyword: keyword.value,
|
|
|
+ page: currentPage.value,
|
|
|
+ limit: 10,
|
|
|
+ jsr_user_id: user.user_id
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === '1') {
|
|
|
+ tableData.value = res.data.page_data;
|
|
|
+ total.value = res.data.total_rows*1;
|
|
|
+ }
|
|
|
+ loading.value = false;
|
|
|
+ })
|
|
|
+}
|
|
|
+getListData()
|
|
|
+
|
|
|
+function handleCurrentChange() {
|
|
|
+ getListData()
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const dialogVisible_tz = ref(false);
|
|
|
+
|
|
|
+const currentRow = ref();
|
|
|
+function toReadMsg(row) {
|
|
|
+ currentRow.value = row;
|
|
|
+ dialogVisible_tz.value = true;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+function doReadMsg() {
|
|
|
+ request({
|
|
|
+ url: '/jdbg/xxzx/edit',
|
|
|
+ data: {
|
|
|
+ issubmit: '1',
|
|
|
+ id: currentRow.value.id,
|
|
|
+ jdbg_xxzx: {
|
|
|
+ status: '2'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === '1') {
|
|
|
+ ElMessage.success('消息确认成功!');
|
|
|
+ getListData();
|
|
|
+ updateUnreadNum();
|
|
|
+ dialogVisible_tz.value = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="flex space-x-4">
|
|
|
+ <el-input placeholder="请输入搜索关键字" v-model="keyword" clearable class="max-w-400px"></el-input>
|
|
|
+ <el-button type="primary" @click="getListData">搜索</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="tableData" tooltip-effect="dark" v-loading="loading">
|
|
|
+ <el-table-column prop="content" label="消息内容">
|
|
|
+ <template #="scope">
|
|
|
+ <div @click='goclick(scope.row)'>{{ scope.row.content }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="发送人" prop="fsr_user_realname" width="150"></el-table-column>
|
|
|
+ <el-table-column label="发送时间" width="200" prop="create_dateline_format"></el-table-column>
|
|
|
+ <el-table-column label="发送类型" width="150" prop="cate"></el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <template #="scope">
|
|
|
+ <el-text size="small" type="primary" @click="toReadMsg(scope.row)" v-if="scope.row.status_option_k === '1'">确认
|
|
|
+ </el-text>
|
|
|
+ <el-text size="small" disabled v-else>已阅</el-text>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="flex justify-end mt-10 py-4">
|
|
|
+ <el-pagination v-model:current-page="currentPage" :page-size="10" @current-change="handleCurrentChange" background
|
|
|
+ layout="total, prev, pager, next" :total="total" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog title="消息提示" v-model="dialogVisible_tz">
|
|
|
+ <div>{{ currentRow.content }}</div>
|
|
|
+ <div class="mt-10">
|
|
|
+ <el-button type="primary" @click="doReadMsg" v-if="currentRow.status_option_k === '1'">确认</el-button>
|
|
|
+ <el-button disabled v-else>已阅</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|