修改优化点

This commit is contained in:
高嵩
2022-11-22 15:55:26 +08:00
parent e1a971fa71
commit 6529b4ed52
@@ -36,7 +36,8 @@
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons"> <span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-button class="box-button" type="primary" @click="searchQuery">{{ $t('query') }}</a-button> <a-button class="box-button" type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button> <a-button class="box-button" style="margin-left: 8px"
@click="searchReset">{{ $t('reset') }}</a-button>
</a-col> </a-col>
</span> </span>
@@ -63,7 +64,7 @@
:dataSource="dataSource" :dataSource="dataSource"
:scroll="{x: '100%'}" :scroll="{x: '100%'}"
:pagination="ipagination" :pagination="ipagination"
:expandIconAsCell='false' :expandIconAsCell="false"
:expandIconColumnIndex="5" :expandIconColumnIndex="5"
:expandIcon="expandIcon" :expandIcon="expandIcon"
:expandRowByClick="true" :expandRowByClick="true"
@@ -99,6 +100,8 @@
import ShowAnnouncement from '@/components/tools/ShowAnnouncement' import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
import { JeroListMixin } from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import DynamicNotice from '../../components/tools/DynamicNotice' import DynamicNotice from '../../components/tools/DynamicNotice'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default { export default {
name: 'UserAnnouncementList', name: 'UserAnnouncementList',
@@ -195,21 +198,67 @@
methods: { methods: {
expandIcon(props) { expandIcon(props) {
if (props.expanded) { if (props.expanded) {
return <a-icon type = 'down'onClick = { e=> return <a-icon type="down" onClick={e => {
{
props.onExpand(props.record, e) props.onExpand(props.record, e)
} }
} }
/>; />
} else { } else {
return <a-icon type = 'right' onClick = { e => return <a-icon type="right" onClick={e => {
{
props.onExpand(props.record, e) props.onExpand(props.record, e)
} }
} }
/>; />
} }
}, },
loadData(arg) {
if (!this.url.list) {
this.$message.error('请设置url.list属性!')
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
var params = this.getQueryParams()//查询条件
this.loading = true
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
if (res.result.current > 1 && res.result.records.length == 0) {
this.loadData(1)
return
}
this.dataSource = res.result.records || res.result
if (this.dataSource && this.dataSource.length > 0) {
this.dataSource.forEach(val => {
if (val.msgContentInfoCn && val.msgContentInfoCn.includes('/common/downLoadFile')) {
let index = val.msgContentInfoCn.indexOf('target')
val.msgContentInfoCn = val.msgContentInfoCn.slice(0, index - 2) + '&token=' + Vue.ls.get(ACCESS_TOKEN) + '\' '
+ val.msgContentInfoCn.slice(index)
}
if (val.msgContentInfo && val.msgContentInfo.includes('/common/downLoadFile')) {
let index = val.msgContentInfo.indexOf('target')
val.msgContentInfo = val.msgContentInfo.slice(0, index - 2) + '&token=' + Vue.ls.get(ACCESS_TOKEN) + '\' '
+ val.msgContentInfo.slice(index)
}
})
}
if (res.result.total) {
this.ipagination.total = res.result.total
} else {
this.ipagination.total = 0
}
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
}
if (res.code === 510) {
this.$message.warning(res.message)
}
this.loading = false
})
},
getQueryParams() { getQueryParams() {
//获取查询条件 //获取查询条件
let sqp = {} let sqp = {}