|
@@ -15,11 +15,12 @@
|
|
v-if="data.length > 0"
|
|
v-if="data.length > 0"
|
|
style="margin-top: 10px"
|
|
style="margin-top: 10px"
|
|
>
|
|
>
|
|
- {{ data[index].content }}
|
|
|
|
|
|
+ <h3>{{ data[index].title }}</h3>
|
|
|
|
+ {{ data[index].businessData }}
|
|
</div>
|
|
</div>
|
|
<template #footer>
|
|
<template #footer>
|
|
<span class="dialog-footer">
|
|
<span class="dialog-footer">
|
|
- <!-- <el-button
|
|
|
|
|
|
+ <el-button
|
|
size="small"
|
|
size="small"
|
|
@click="index--"
|
|
@click="index--"
|
|
:disabled="data.length < 2 || index == 0"
|
|
:disabled="data.length < 2 || index == 0"
|
|
@@ -30,14 +31,14 @@
|
|
@click="index++"
|
|
@click="index++"
|
|
:disabled="data.length == index + 1"
|
|
:disabled="data.length == index + 1"
|
|
>下一条</el-button
|
|
>下一条</el-button
|
|
- > -->
|
|
|
|
- <!-- <el-button
|
|
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
type="primary"
|
|
type="primary"
|
|
size="small"
|
|
size="small"
|
|
- :disabled="data.length == 0"
|
|
|
|
|
|
+ :disabled="data.length == 0 || data[index].isRead"
|
|
@click="confirm"
|
|
@click="confirm"
|
|
>确认已读</el-button
|
|
>确认已读</el-button
|
|
- > -->
|
|
|
|
|
|
+ >
|
|
<!-- <span class="more" @click="moreFn">查看更多 ></span> -->
|
|
<!-- <span class="more" @click="moreFn">查看更多 ></span> -->
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
@@ -47,30 +48,41 @@
|
|
:class="modelValue ? 'notice-table-warp-open' : ''"
|
|
:class="modelValue ? 'notice-table-warp-open' : ''"
|
|
@click.stop="closeNoticeTableModal"
|
|
@click.stop="closeNoticeTableModal"
|
|
>
|
|
>
|
|
- <div class="notice-table" @click.stop>
|
|
|
|
|
|
+ <div class="notice-table" @click.stop v-loading="loading" >
|
|
<div class="tabs">
|
|
<div class="tabs">
|
|
<ul>
|
|
<ul>
|
|
- <li style="padding-left: 0; border: none" @click="tableTagType = 1" :class="tableTagType == 1 ? 'active' : ''">
|
|
|
|
- 全部(0)
|
|
|
|
|
|
+ <li style="padding-left: 0; border: none" @click="pushInfoReq.type = '';getPushInfo()" :class="pushInfoReq.type == '' ? 'active' : ''">
|
|
|
|
+ 全部({{pushInfoReq.total}})
|
|
</li>
|
|
</li>
|
|
- <li @click="tableTagType = 2" :class="tableTagType == 2 ? 'active' : ''">待办(0)</li>
|
|
|
|
- <li @click="tableTagType = 3" :class="tableTagType == 3 ? 'active' : ''">通知(0)</li>
|
|
|
|
|
|
+ <li @click="pushInfoReq.type = 1;getPushInfo()" :class="pushInfoReq.type == 1 ? 'active' : ''">流程(0)</li>
|
|
|
|
+ <li @click="pushInfoReq.type = 2;getPushInfo()" :class="pushInfoReq.type == 2 ? 'active' : ''">业务(0)</li>
|
|
</ul>
|
|
</ul>
|
|
- <div class="more">查看更多></div>
|
|
|
|
|
|
+ <!-- <div class="more">查看更多></div> -->
|
|
</div>
|
|
</div>
|
|
<el-table :data="noticeData" style="width: 100%">
|
|
<el-table :data="noticeData" style="width: 100%">
|
|
- <el-table-column prop="date" label="标题内容" width="250">
|
|
|
|
|
|
+ <el-table-column prop="title" label="标题内容" width="250">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-tooltip
|
|
|
|
+ class="box-item"
|
|
|
|
+ effect="dark"
|
|
|
|
+ :content="scope.row.title"
|
|
|
|
+ placement="top"
|
|
|
|
+ >
|
|
|
|
+ <span>{{ scope.row.title.slice(0,12) }}</span><span v-if="scope.row.title.length > 12">..</span>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="name" label="类型" width="120">
|
|
|
|
|
|
+ <el-table-column prop="businessType" label="类型" width="120">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="address" label="操作">
|
|
<el-table-column prop="address" label="操作">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <span style="cursor: pointer">未读</span>
|
|
|
|
|
|
+ <span style="cursor: pointer" @click="readFn(scope)">未读</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<div class="notice-btn-box" style="margin-top: 20px">
|
|
<div class="notice-btn-box" style="margin-top: 20px">
|
|
- <el-button plain disabled>点击清空</el-button>
|
|
|
|
|
|
+ <!-- <el-button plain disabled>点击清空</el-button> -->
|
|
<el-button type="primary" disabled>全部已读</el-button>
|
|
<el-button type="primary" disabled>全部已读</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -78,7 +90,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
-import { ElMessageBox, ElNotification } from 'element-plus'
|
|
|
|
|
|
+import { ElMessageBox, ElNotification,ElMessage } from 'element-plus'
|
|
import {
|
|
import {
|
|
getToken
|
|
getToken
|
|
} from '@/utils/auth'
|
|
} from '@/utils/auth'
|
|
@@ -89,11 +101,10 @@ defineProps({
|
|
default: false,
|
|
default: false,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
-const emit = defineEmits(["update:modelValue"]);
|
|
|
|
|
|
+const emit = defineEmits(["update:modelValue"],'changeNum');
|
|
const closeNoticeTableModal = () => {
|
|
const closeNoticeTableModal = () => {
|
|
emit("update:modelValue", false);
|
|
emit("update:modelValue", false);
|
|
};
|
|
};
|
|
-const tableTagType = ref(1)
|
|
|
|
let noticeData = ref([
|
|
let noticeData = ref([
|
|
// {
|
|
// {
|
|
// date: '2016-05-02',
|
|
// date: '2016-05-02',
|
|
@@ -123,8 +134,27 @@ const moreFn = () => {
|
|
noticeTableModal.value = true
|
|
noticeTableModal.value = true
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const readFn = (item) => {
|
|
|
|
+ commonRead([item.row.id])
|
|
|
|
+}
|
|
|
|
+const commonRead = (ids,type) => {
|
|
|
|
+ proxy.post('/pushInfo/read',{idList:ids}).then(res=>{
|
|
|
|
+ console.log(res)
|
|
|
|
+ ElMessage({
|
|
|
|
+ message: '已读成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ if(type == 'confirm'){
|
|
|
|
+ data.value[index].isRead = true
|
|
|
|
+ }else{
|
|
|
|
+ getPushInfo()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
const confirm = () => {
|
|
const confirm = () => {
|
|
value.value = false
|
|
value.value = false
|
|
|
|
+ commonRead([data.value[index.value].id],'confirm')
|
|
|
|
+
|
|
}
|
|
}
|
|
// proxy.post('sendMeg/page',{
|
|
// proxy.post('sendMeg/page',{
|
|
// pageNum:1,
|
|
// pageNum:1,
|
|
@@ -147,11 +177,27 @@ const socketInit = () => {
|
|
window.ws.onmessage = function (e) {
|
|
window.ws.onmessage = function (e) {
|
|
//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
|
|
//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
|
|
//在data.value前面插入
|
|
//在data.value前面插入
|
|
- console.log(JSON.parse(e.data).data)
|
|
|
|
- data.value.unshift({title:"最新公告",content:JSON.parse(e.data).data})
|
|
|
|
- index.value = 0
|
|
|
|
- value.value = true
|
|
|
|
|
|
+ const res = JSON.parse(e.data)
|
|
|
|
+ console.log(res)
|
|
|
|
+
|
|
|
|
|
|
|
|
+ if(res.type == 1) {
|
|
|
|
+ index.value = 0
|
|
|
|
+ data.value = res.list
|
|
|
|
+ if(res.list.length > 0) value.value = true
|
|
|
|
+ }
|
|
|
|
+ if(res.type == 2) {
|
|
|
|
+ emit('changeNum',res.count * 1)
|
|
|
|
+ getPushInfo()
|
|
|
|
+ }
|
|
|
|
+ if(res.type == 3) {
|
|
|
|
+ ElNotification({
|
|
|
|
+ title: '提示',
|
|
|
|
+ message: res.title,
|
|
|
|
+ position: 'bottom-right',
|
|
|
|
+ duration:0,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
window.ws.onclose = function (e) {
|
|
window.ws.onclose = function (e) {
|
|
@@ -163,6 +209,29 @@ const socketInit = () => {
|
|
console.log(error)
|
|
console.log(error)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+let pushInfoReq = ref({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 5,
|
|
|
|
+ pushRead: 0,
|
|
|
|
+ type: '',
|
|
|
|
+ total:0,
|
|
|
|
+})
|
|
|
|
+const loading = ref(false)
|
|
|
|
+const getPushInfo = () => {
|
|
|
|
+ loading.value = true
|
|
|
|
+ proxy.post('/pushInfo/page',{
|
|
|
|
+ pageNum:1,
|
|
|
|
+ pageSize:5,
|
|
|
|
+ pushRead:0,
|
|
|
|
+ type:2,
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ noticeData.value = res.rows
|
|
|
|
+ pushInfoReq.value.total = res.total
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ loading.value = false
|
|
|
|
+ }, 500);
|
|
|
|
+ })
|
|
|
|
+}
|
|
socketInit()
|
|
socketInit()
|
|
const handleClose = () => {
|
|
const handleClose = () => {
|
|
value.value = false
|
|
value.value = false
|