|
|
|
@ -9,26 +9,34 @@
|
|
|
|
|
<div v-for="(item, index) in newclueList" :key="index" class="listItem">
|
|
|
|
|
<div class="listItemTop">
|
|
|
|
|
<div class="type">
|
|
|
|
|
【{{ item.type === 1 ? '系统公告' : '导出通知' }}】{{ item.title }}
|
|
|
|
|
【{{ item.messageType === 1 ? '系统公告' : '导出通知' }}】{{ item.title }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="time">{{ item.createTime }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="listItemCenter">
|
|
|
|
|
<span ref="contentRef" class="content" :class="{ expanded: item.show }">{{
|
|
|
|
|
item.content
|
|
|
|
|
}}</span>
|
|
|
|
|
<div class="iconContainer" @click="toggleShowAll(item)">
|
|
|
|
|
<div :style="item.show ? 'max-height:44px;overflow:hidden' : ''">
|
|
|
|
|
<!-- :class="{ expanded: item.show }" -->
|
|
|
|
|
<span
|
|
|
|
|
ref="contentRef"
|
|
|
|
|
class="content"
|
|
|
|
|
:class="{ expanded: item.show }"
|
|
|
|
|
@click="toggleShowAll(item)"
|
|
|
|
|
>{{ item.content }}</span
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- v-if="item.content.length > 48" -->
|
|
|
|
|
<!-- <div v-if="item.showBtn" class="iconContainer" @click="toggleShowAll(item)">
|
|
|
|
|
<div v-if="item.show" class="openOrClose">
|
|
|
|
|
<span><down-outlined /></span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else class="openOrClose">
|
|
|
|
|
<up-outlined />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="listItemBottom">
|
|
|
|
|
<a key="list-loadmore-edit" style="margin-right: 8px">{{
|
|
|
|
|
<a key="list-loadmore-edit" style="margin-right: 8px" @click="readConfirmation(item)">{{
|
|
|
|
|
item.state === 1 ? '已读' : '确认'
|
|
|
|
|
}}</a>
|
|
|
|
|
<a
|
|
|
|
@ -106,15 +114,17 @@ import type { ProTableInstanceExpose, TableRequest, ProColumns } from '#/table'
|
|
|
|
|
import { mergePageParam } from '@/utils/page-utils'
|
|
|
|
|
import { messageAccessLogs } from '@/api/customermanagement/customerList'
|
|
|
|
|
import type { CustomerListQO } from '@/api/customermanagement/customerList/types'
|
|
|
|
|
import { confirmToRead } from '@/api/message/index'
|
|
|
|
|
import MessageSearch from '@/components/Message/messageSearch.vue'
|
|
|
|
|
import type { DistributeTaskManagementPageParam } from '@/api/controlcenterstation/distributionTaskManagement/types'
|
|
|
|
|
import router from '@/router'
|
|
|
|
|
import { doRequest } from '@/utils/axios/request'
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'MessagePage' })
|
|
|
|
|
|
|
|
|
|
interface DataItem {
|
|
|
|
|
id: number | undefined
|
|
|
|
|
type: number
|
|
|
|
|
messageType: number
|
|
|
|
|
createTime: string
|
|
|
|
|
content: string
|
|
|
|
|
messageKey: string
|
|
|
|
@ -192,9 +202,9 @@ const columns: ProColumns[] = [
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
align: 'center',
|
|
|
|
|
customRender: function ({ record }: any) {
|
|
|
|
|
if (record.type === 1) {
|
|
|
|
|
if (record.messageType === 1) {
|
|
|
|
|
return '系统公告'
|
|
|
|
|
} else if (record.type === 2) {
|
|
|
|
|
} else if (record.messageType === 2) {
|
|
|
|
|
return '导出通知'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -244,14 +254,29 @@ const handleOk = (e: MouseEvent) => {
|
|
|
|
|
|
|
|
|
|
//定位
|
|
|
|
|
const positioning = (messageKey: string) => {
|
|
|
|
|
localStorage.setItem('clueId', messageKey)
|
|
|
|
|
emits('click-success', false)
|
|
|
|
|
router.push({ path: '/task/customerlist', query: { clueId: messageKey } }) // 跳转到 /task/customerlist 页面
|
|
|
|
|
const randomClueId = Math.random().toString(36).substring(2, 15) // 生成一个随机的ID值
|
|
|
|
|
router.push({ path: '/task/customerlist', query: { clueId: randomClueId } }) // 跳转到 /task/customerlist 页面
|
|
|
|
|
}
|
|
|
|
|
//展开收起
|
|
|
|
|
const toggleShowAll = (itemShow: DataItem) => {
|
|
|
|
|
itemShow.show = !itemShow.show
|
|
|
|
|
}
|
|
|
|
|
const contentRef = ref<HTMLElement | null>(null)
|
|
|
|
|
|
|
|
|
|
//点击确认变成已读事件
|
|
|
|
|
const readConfirmation = (item: any) => {
|
|
|
|
|
if (item.state === 1) {
|
|
|
|
|
// 如果当前状态为已读,不执行任何操作
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// 执行标记为已读的逻辑
|
|
|
|
|
item.state = 1
|
|
|
|
|
// 发送请求将状态更新到后端
|
|
|
|
|
doRequest(confirmToRead(toRaw(item.id)), {
|
|
|
|
|
onSuccess: (res: any) => {}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.ms-container {
|
|
|
|
@ -345,10 +370,10 @@ const contentRef = ref<HTMLElement | null>(null)
|
|
|
|
|
margin: 5px 0;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
}
|
|
|
|
|
.iconContainer {
|
|
|
|
|
display: inline-block; /* 让容器内的内容水平排列 */
|
|
|
|
|
vertical-align: middle; /* 垂直居中对齐 */
|
|
|
|
|
}
|
|
|
|
|
// .iconContainer {
|
|
|
|
|
// display: inline-block; /* 让容器内的内容水平排列 */
|
|
|
|
|
// vertical-align: middle; /* 垂直居中对齐 */
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
white-space: normal; /* 不换行 */
|
|
|
|
@ -364,11 +389,11 @@ const contentRef = ref<HTMLElement | null>(null)
|
|
|
|
|
-webkit-box-orient: vertical; /* 设置伸缩盒子的子元素垂直排列 */
|
|
|
|
|
-webkit-line-clamp: 2; /* 设置显示的行数 */
|
|
|
|
|
}
|
|
|
|
|
.openOrClose {
|
|
|
|
|
display: inline;
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
float: right;
|
|
|
|
|
}
|
|
|
|
|
// .openOrClose {
|
|
|
|
|
// display: inline;
|
|
|
|
|
// margin-left: 4px;
|
|
|
|
|
// float: right;
|
|
|
|
|
// }
|
|
|
|
|
.listItemBottom {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|