Merge remote-tracking branch 'origin/feature_dev_20221025_message' into feature_dev_20221025_message

This commit is contained in:
CD
2022-10-25 14:02:24 +08:00
3 changed files with 109 additions and 33 deletions
+11 -3
View File
@@ -15,7 +15,7 @@
<a-list-item :key="index" v-for="(record, index) in announcement1" v-if="index <= 4"> <a-list-item :key="index" v-for="(record, index) in announcement1" v-if="index <= 4">
<div style="margin-left: 5%;width: 80%;"> <div style="margin-left: 5%;width: 80%;">
<p style="overflow: hidden; text-overflow: ellipsis;white-space: nowrap;color:#00B3BE"> <p style="overflow: hidden; text-overflow: ellipsis;white-space: nowrap;color:#00B3BE">
<a :title="record.titile" @click="showAnnouncement(record)">{{ record.titile }}</a> <a :title="record.msgContent" @click="showAnnouncement(record)">{{ record.msgContent }}</a>
</p> </p>
</div> </div>
</a-list-item> </a-list-item>
@@ -110,6 +110,11 @@
// clearInterval(this.timer) // clearInterval(this.timer)
// }, // },
methods: { methods: {
getText(str) {
let words = str.replace(/<[^<>]+>/g, '').replace(/&nbsp;/gi, '') //这里是去除标签
//.replace(/\s/g, '') //这里是去除空格
return words
},
loadData() { loadData() {
getAction(this.url.listCementByUser).then((res) => { getAction(this.url.listCementByUser).then((res) => {
if (res.success) { if (res.success) {
@@ -134,9 +139,12 @@
showAnnouncement(record) { showAnnouncement(record) {
getAction(this.url.readAllMsg, { ids: record.id }).then((res) => { getAction(this.url.readAllMsg, { ids: record.id }).then((res) => {
}) })
localStorage.setItem('msgContent', record.msgContent)
this.$router.push({ this.$router.push({
path: '/system/MessageDetails', path: '/isps/userAnnouncement',
query: record query: {
Date: Date.now()
}
}) })
}, },
toMyAnnouncement() { toMyAnnouncement() {
@@ -11,8 +11,8 @@
<div class="myNews-box-content-box" v-for="(item,index) in dataSource" :key="index" @click="magClick(item)"> <div class="myNews-box-content-box" v-for="(item,index) in dataSource" :key="index" @click="magClick(item)">
<img src="../../../assets/wdxx.png" alt=""> <img src="../../../assets/wdxx.png" alt="">
<div class="content-box"> <div class="content-box">
<div class="top" :title="item.titile"> <div class="top" :title="item.msgContent">
{{item.titile}} {{item.msgContent}}
</div> </div>
<div class="botton"> <div class="botton">
{{item.sendTime}} {{item.sendTime}}
@@ -69,9 +69,12 @@
magClick(row) { magClick(row) {
getAction(this.url.readAllMsg, { ids: row.id }).then((res) => { getAction(this.url.readAllMsg, { ids: row.id }).then((res) => {
}) })
localStorage.setItem('msgContent', row.msgContent)
this.$router.push({ this.$router.push({
path: '/system/MessageDetails', path: '/isps/userAnnouncement',
query: row query: {
Date: Date.now()
}
}) })
}, },
moreClick() { moreClick() {
@@ -6,12 +6,12 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="8" style="line-height: 48px"> <a-col :md="6" :sm="8" style="line-height: 48px">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text" :title="$t('MessageTitle')"> <div class="title-text" :title="$t('MessageContent')">
<span>{{this.$t('MessageTitle')}}</span> <span>{{this.$t('MessageContent')}}</span>
</div> </div>
<a-input class="box-input" <a-input class="box-input"
:placeholder="$t('pleaseEnter')+$t('MessageTitle')" :placeholder="$t('pleaseEnter')+$t('MessageContent')"
v-model="queryParam.titile"> v-model="queryParam.msgContent">
</a-input> </a-input>
</div> </div>
</a-col> </a-col>
@@ -63,18 +63,28 @@
:dataSource="dataSource" :dataSource="dataSource"
:scroll="{x: '100%'}" :scroll="{x: '100%'}"
:pagination="ipagination" :pagination="ipagination"
:expandIconAsCell='false'
:expandIconColumnIndex="5"
:expandIcon="expandIcon"
:loading="loading" :loading="loading"
@expand="expandChange"
@change="handleTableChange"> @change="handleTableChange">
<span slot="msgTitile" slot-scope="text,scope"> <span slot="msgTitile" slot-scope="text,scope">
<a :style="{'color':scope.readFlag == 0 ? 'red':'#00A0E9'}" :title="text" @click="msgContentClick(scope)"> <!-- @click="msgContentClick(scope)"-->
<a :style="{'color':scope.readFlag == 0 ? 'red':'#00A0E9'}" :title="text">
{{text}} {{text}}
</a> </a>
</span> </span>
<span slot="msgCategory" slot-scope="text,scope"> <span slot="msgCategory" slot-scope="text,scope">
<a :style="{'color':scope.readFlag == 0 ? 'red':'#00A0E9'}" @click="msgContentClick(scope)"> <!-- :style="{'color':scope.readFlag == 0 ? 'red':'#00A0E9'}" @click="msgContentClick(scope)"-->
<span :title="msgCategoryQuery[text]">
{{msgCategoryQuery[text]}} {{msgCategoryQuery[text]}}
</a> </span>
</span> </span>
<p slot="expandedRowRender" slot-scope="record" style="margin: 0;padding-left: 58px;">
<span v-html="record.msgContentInfo">
</span>
</p>
</a-table> </a-table>
<show-announcement ref="ShowAnnouncement"></show-announcement> <show-announcement ref="ShowAnnouncement"></show-announcement>
<dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/> <dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
@@ -104,8 +114,8 @@
msgCategoryQuery: { msgCategoryQuery: {
'1': this.$t('SubscriptionNotification'), '1': this.$t('SubscriptionNotification'),
'2': this.$t('warningInformation'), '2': this.$t('warningInformation'),
'3': this.$t('ForwardPush'), '3': this.$t('ForwardPush')
'4': this.$t('CollectinguthenticationParameters'), // '4': this.$t('CollectinguthenticationParameters'),
// '6':this.$t('RegulationListConfirmationTask'), // '6':this.$t('RegulationListConfirmationTask'),
// '7':this.$t('RegulationListConfirmationNotification'), // '7':this.$t('RegulationListConfirmationNotification'),
// '8':this.$t('RegulationTaskConfirmation'), // '8':this.$t('RegulationTaskConfirmation'),
@@ -115,39 +125,48 @@
// '12':this.$t('DesignComplianceNotification'), // '12':this.$t('DesignComplianceNotification'),
// '13':this.$t('PreHomoNotification'), // '13':this.$t('PreHomoNotification'),
// '14':this.$t('ValidationComplianceNotification'), // '14':this.$t('ValidationComplianceNotification'),
'15':this.$t('RegulationTaskConfirmationNotification'), // '15':this.$t('RegulationTaskConfirmationNotification'),
'17':this.$t('listConfirmation'), // '17':this.$t('listConfirmation'),
'18':this.$t('taskAffirm'), // '18':this.$t('taskAffirm'),
'19':this.$t('complianceConfirmation'), // '19':this.$t('complianceConfirmation'),
'20':this.$t('collectionLegislativeComments'), // '20':this.$t('collectionLegislativeComments'),
'21':this.$t('regulatoryAndTechnicalAssessment'), // '21':this.$t('regulatoryAndTechnicalAssessment'),
}, },
columns: [ columns: [
{ {
title: this.$t('MessageTitle'), title: this.$t('MessageContent'),
align: 'center', align: 'left',
dataIndex: 'titile', dataIndex: 'msgContent',
ellipsis: true, ellipsis: true,
scopedSlots: { customRender: 'msgTitile' } scopedSlots: { customRender: 'msgTitile' }
}, },
{ {
title: this.$t('Sponsor'), title: this.$t('Sponsor'),
align: 'center', align: 'left',
ellipsis: true,
dataIndex: 'initiator', dataIndex: 'initiator',
width: 200, width: 200
}, },
{ {
title: this.$t('MessageType'), title: this.$t('MessageType'),
align: 'center', align: 'left',
ellipsis: true,
dataIndex: 'msgCategory', dataIndex: 'msgCategory',
width: 200, width: 200,
scopedSlots: { customRender: 'msgCategory' } scopedSlots: { customRender: 'msgCategory' }
}, },
{ {
title: this.$t('NotificationTime'), title: this.$t('NotificationTime'),
align: 'center', align: 'left',
ellipsis: true,
width: 200, width: 200,
dataIndex: 'sendTime' dataIndex: 'sendTime'
},
{
title:'',
align: 'left',
ellipsis: true,
width: 50,
} }
], ],
url: { url: {
@@ -161,7 +180,42 @@
formData: '' formData: ''
} }
}, },
watch: {
$route: function(res) {
console.log(res)
this.loadData()
}
},
methods: { methods: {
expandIcon(props) {
if (props.expanded) {
return <a-icon type='down' onClick={e => {
props.onExpand(props.record, e);
}}/>;
} else {
return <a-icon type='right' onClick={e => {
props.onExpand(props.record, e);
}}/>;
}
},
getQueryParams() {
//获取查询条件
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
if (localStorage.getItem('msgContent')) {
this.queryParam.msgContent = localStorage.getItem('msgContent')
this.queryParam = { ...this.queryParam }
localStorage.removeItem('msgContent')
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters)
param.field = this.getQueryField()
param.pageNo = this.ipagination.current
param.pageSize = this.ipagination.pageSize
return filterObj(param)
},
showAnnouncement(record) { showAnnouncement(record) {
putAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => { putAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => {
if (res.success) { if (res.success) {
@@ -177,6 +231,13 @@
this.$refs.ShowAnnouncement.detail(record) this.$refs.ShowAnnouncement.detail(record)
} }
}, },
expandChange(isTrue, val) {
if (isTrue) {
if (val.readFlag == '0') {
this.msgContentClick(val)
}
}
},
readAll() { readAll() {
var that = this var that = this
if (this.selectedRowKeys.length > 0) { if (this.selectedRowKeys.length > 0) {
@@ -204,11 +265,12 @@
}, },
msgContentClick(row) { msgContentClick(row) {
getAction(this.url.readAllMsg, { ids: row.id }).then((res) => { getAction(this.url.readAllMsg, { ids: row.id }).then((res) => {
// this.loadData()
}) })
this.$router.push({ // this.$router.push({
path: '/system/MessageDetails', // path: '/system/MessageDetails',
query: row // query: row
}) // })
}, },
handleDel() { handleDel() {
var that = this var that = this
@@ -297,6 +359,9 @@
height: 38px; height: 38px;
/*margin-top: 2px;*/ /*margin-top: 2px;*/
} }
::v-deep .ant-table .ant-table-row-indent + .ant-table-row-expand-icon{
margin-right: 0;
}
</style> </style>
<style> <style>
.box-input .ant-select-selection { .box-input .ant-select-selection {