|
@@ -68,22 +68,28 @@
|
|
|
:content="scope.row.title"
|
|
|
placement="top"
|
|
|
>
|
|
|
- <span>{{ scope.row.title.slice(0,12) }}</span><span v-if="scope.row.title.length > 12">..</span>
|
|
|
+ <div class="noticeData-title">{{ scope.row.title }}</div>
|
|
|
</el-tooltip>
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="businessType" label="类型" width="120">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.businessType === 0 ? '流程' : '业务' }}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="address" label="操作">
|
|
|
<template #default="scope">
|
|
|
- <span style="cursor: pointer" @click="readFn(scope)">未读</span>
|
|
|
+ <span style="cursor: pointer" @click="readFn(scope)">确认已读</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <div >
|
|
|
+ <el-pagination style="text-align: center;" :page-size="5" layout="prev, pager, next" :total="pushInfoReq.total" @current-change="handlePageChange" />
|
|
|
+ </div>
|
|
|
<div class="notice-btn-box" style="margin-top: 20px">
|
|
|
<!-- <el-button plain disabled>点击清空</el-button> -->
|
|
|
- <el-button type="primary" disabled>全部已读</el-button>
|
|
|
+ <el-button type="primary" @click="allReadFn" v-if="noticeData.length != 0">全部已读</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -105,28 +111,7 @@ const emit = defineEmits(["update:modelValue"],'changeNum');
|
|
|
const closeNoticeTableModal = () => {
|
|
|
emit("update:modelValue", false);
|
|
|
};
|
|
|
-let noticeData = ref([
|
|
|
- // {
|
|
|
- // 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 弄',
|
|
|
- // },
|
|
|
-])
|
|
|
+let noticeData = ref([])
|
|
|
let index = ref(0)
|
|
|
let data = ref([])
|
|
|
let value = ref(false)
|
|
@@ -134,6 +119,25 @@ const moreFn = () => {
|
|
|
noticeTableModal.value = true
|
|
|
}
|
|
|
|
|
|
+const allReadFn = () => {
|
|
|
+ ElMessageBox.confirm('此操作将会把所有未读消息标记为已读,是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ }).then(() => {
|
|
|
+ let arr = []
|
|
|
+ noticeData.value.filter(item=>{
|
|
|
+ arr.push(item.id)
|
|
|
+ })
|
|
|
+ commonRead(arr)
|
|
|
+ }).catch(() => {
|
|
|
+ ElMessage({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消操作'
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
const readFn = (item) => {
|
|
|
commonRead([item.row.id])
|
|
|
}
|
|
@@ -160,7 +164,7 @@ const confirm = () => {
|
|
|
// pageNum:1,
|
|
|
// pageSize:30,
|
|
|
// }).then(res=>{
|
|
|
-// data.value = res.rows
|
|
|
+// data.value = res.rows
|
|
|
// })
|
|
|
|
|
|
const socketInit = () => {
|
|
@@ -216,17 +220,19 @@ let pushInfoReq = ref({
|
|
|
type: '',
|
|
|
total:0,
|
|
|
})
|
|
|
+
|
|
|
+const handlePageChange = (val) => {
|
|
|
+ pushInfoReq.value.pageNum = val
|
|
|
+ getPushInfo()
|
|
|
+}
|
|
|
+
|
|
|
const loading = ref(false)
|
|
|
const getPushInfo = () => {
|
|
|
loading.value = true
|
|
|
- proxy.post('/pushInfo/page',{
|
|
|
- pageNum:1,
|
|
|
- pageSize:5,
|
|
|
- pushRead:0,
|
|
|
- type:2,
|
|
|
- }).then(res=>{
|
|
|
+ proxy.post('/pushInfo/page',pushInfoReq.value).then(res=>{
|
|
|
noticeData.value = res.rows
|
|
|
pushInfoReq.value.total = res.total
|
|
|
+ console.log(pushInfoReq)
|
|
|
setTimeout(() => {
|
|
|
loading.value = false
|
|
|
}, 500);
|
|
@@ -312,6 +318,14 @@ const openBottomBar = (type) => {
|
|
|
}
|
|
|
</style>
|
|
|
<style>
|
|
|
+
|
|
|
+.noticeData-title{
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
.commons-notice .el-table__row {
|
|
|
height: 50px;
|
|
|
}
|