Files
dvcp_v2_wxcp_app/src/project/pidu/AppSensitive/AppSensitive.vue

256 lines
6.6 KiB
Vue
Raw Normal View History

2023-03-14 10:37:35 +08:00
<template>
2023-06-21 08:57:45 +08:00
<div class="AppSensitive">
2023-03-14 10:37:35 +08:00
<AiTopFixed>
<div class="top-search">
<div class="left">
2023-06-19 15:47:05 +08:00
<AiPagePicker type="dept" :selected.sync="deptUserList" nodeKey="id" single @select="deptSelect">
<span class="label" v-if="deptUserList.length">{{deptUserList[0].name}}</span>
<span v-else style="color:#999;">部门名称</span>
2023-06-20 14:32:28 +08:00
<div class="clear-btn" v-if="deptUserList.length" @click.stop="clearDept">
<img src="./img/del-icon.png" alt="" class="del-icon">
</div>
<u-icon name="arrow-down" color="#999" size="24" style="margin-left:8px;" v-else />
2023-06-19 15:47:05 +08:00
</AiPagePicker>
</div>
<div class="right">
<u-search v-model="keyword" :clearabled="true" placeholder="触发敏感词" :show-action="false" bg-color="#F5F5F5"
2023-03-14 10:37:35 +08:00
search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="getListInit">
</u-search>
</div>
</div>
</AiTopFixed>
<div class="user-list">
2023-06-19 15:47:05 +08:00
<div class="item" v-for="(item, index) in list" :key="index" @click="toConversationRecord(item)">
<img src="./img/group-img.png" alt="" v-if="item.type == 1">
<img :src="item.userAvatar" alt="" v-if="item.type != 1 && item.userAvatar">
<img src="./img/user-img.png" alt="" v-if="item.type != 1 && !item.userAvatar">
2023-03-14 10:37:35 +08:00
<div class="item-right">
2023-06-19 15:47:05 +08:00
<div class="name-flex">
<p>{{item.userName}}</p>
<div class="time">{{item.createTime.substring(0, 16)}}</div>
2023-03-14 10:37:35 +08:00
</div>
2023-06-19 15:47:05 +08:00
<div v-html="item.text" class="item-content"></div>
2023-03-14 10:37:35 +08:00
</div>
</div>
</div>
</div>
</template>
<script>
export default {
2023-06-21 08:57:45 +08:00
name: "AppSensitive",
appName: "敏感词触发记录",
2023-03-14 10:37:35 +08:00
data() {
return {
keyword: '',
2023-06-19 15:47:05 +08:00
current: 1,
pages: 2,
list: [],
deptUserList: []
2023-03-14 10:37:35 +08:00
};
},
2023-06-19 15:47:05 +08:00
onLoad() {
this.getListInit()
},
2023-03-14 10:37:35 +08:00
onShow() {
document.title = '触发记录'
},
methods: {
2023-06-20 14:32:28 +08:00
clearDept() {
this.deptUserList = []
this.getListInit()
},
2023-03-14 10:37:35 +08:00
getListInit() {
2023-06-19 15:47:05 +08:00
this.current = 1
this.pages = 2
this.list = []
this.getList()
},
getList() {
if(this.current > this.pages) return
this.$http.post(`/app/appsessionarchivekeywordrecord/list`, null, {
params: {
current: this.current,
size: 10,
content: this.keyword,
departmentId: this.deptUserList.length ? this.deptUserList[0].id : ''
}
}).then(res=> {
if(res?.data) {
res.data.records.map((item) => {
item.text = this.changeKeyRed(item.content, item.wordName)
})
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
toConversationRecord(row) {
uni.navigateTo({url: `./conversationRecord?userId=${row.userId}&toUserId=${row.toUserId}&toName=${row.toName}&type=${row.type}&seq=${row.seq}`})
2023-03-14 10:37:35 +08:00
},
2023-06-19 15:47:05 +08:00
deptSelect(e) {
this.deptUserList = e
2023-03-14 10:37:35 +08:00
this.getListInit()
2023-06-19 15:47:05 +08:00
},
changeKeyRed (str, keyWord) {
if (str != null && keyWord != null) {
var substr = "/" + keyWord + "/g";
var replaceStr = str.replace(eval(substr), "<span style='color:#e6736e'>" + keyWord + "</span>")
return replaceStr;
} else {
return str;
}
2023-03-14 10:37:35 +08:00
},
},
2023-06-21 09:52:04 +08:00
onReachBottom() {
this.current ++
this.getList()
}
2023-03-14 10:37:35 +08:00
};
</script>
<style lang="scss" scoped>
2023-06-21 08:57:45 +08:00
.AppSensitive {
2023-03-14 10:37:35 +08:00
height: 100%;
::v-deep .AiTopFixed {
.placeholder {
.content {
padding: 0 !important;
}
}
.fixed {
margin: 0 !important;
.content {
padding: 0 !important;
}
}
}
.top-search {
padding: 20px 32px;
display: flex;
.left {
2023-06-19 15:47:05 +08:00
width: 350px;
line-height: 64px;
2023-06-20 14:32:28 +08:00
.clear-btn {
display: inline-block;
padding: 0 16px;
}
.del-icon {
width: 32px;
height: 32px;
vertical-align: middle;
}
2023-06-19 15:47:05 +08:00
}
.right {
width: calc(100% - 350px);
2023-03-14 10:37:35 +08:00
}
}
.top-select {
display: flex;
padding: 28px 0;
border-bottom: 1px solid #eee;
.item {
flex: 1;
padding: 0 8px;
text-align: center;
span {
display: inline-block;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28px;
color: #666;
line-height: 40px;
}
}
}
.user-list {
background-color: #fff;
.item {
padding: 24px 0 0 32px;
display: flex;
2023-06-19 15:47:05 +08:00
box-sizing: border-box;
2023-03-14 10:37:35 +08:00
img {
width: 80px;
height: 80px;
margin-right: 32px;
2023-06-19 15:47:05 +08:00
border-radius: 50%;
2023-03-14 10:37:35 +08:00
}
.item-right {
width: calc(100% - 112px);
border-bottom: 1px solid #eee;
2023-06-19 15:47:05 +08:00
padding: 0 32px 20px 0;
2023-03-14 10:37:35 +08:00
box-sizing: border-box;
2023-06-19 15:47:05 +08:00
// display: flex;
// justify-content: space-between;
// border-bottom: 1px solid #eee;
// padding-right: 32px;
// box-sizing: border-box;
// .user {
// width: calc(100% - 240px);
// p {
// line-height: 44px;
// font-family: PingFangSC-Medium;
// font-weight: 500;
// font-size: 32px;
// color: #333;
// letter-spacing: 0.3px;
// margin-bottom: 8px;
// }
// div {
// color: #666;
// font-size: 28px;
// font-family: PingFangSC;
// line-height: 40px;
// padding-bottom: 20px;
// span {
// color: #e6736e;
// }
// }
// }
// .time {
// font-family: PingFangSC-Regular;
// font-size: 26px;
// color: #999;
// }
.name-flex {
display: flex;
justify-content: space-between;
width: 100%;
2023-03-14 10:37:35 +08:00
p {
2023-06-19 15:47:05 +08:00
width: calc(100% - 240px);
2023-03-14 10:37:35 +08:00
line-height: 44px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 32px;
color: #333;
margin-bottom: 8px;
}
2023-06-19 15:47:05 +08:00
.time {
font-family: PingFangSC-Regular;
font-size: 26px;
color: #999;
2023-03-14 10:37:35 +08:00
}
}
2023-06-19 15:47:05 +08:00
.content {
color: #666;
font-size: 28px;
font-family: PingFangSC;
line-height: 40px;
padding-bottom: 20px;
word-break: break-all;
span {
color: #e6736e;
}
2023-03-14 10:37:35 +08:00
}
}
}
.item:nth-last-child(1) {
p {
border-bottom: 0;
}
}
}
}
</style>