BUG 26973

This commit is contained in:
aixianling
2022-01-25 17:06:41 +08:00
parent 2a43a20531
commit 48fa10a21b
11 changed files with 2160 additions and 2130 deletions

View File

@@ -9,7 +9,7 @@
<ai-card :title="detailObj.title" class="title">
<template #content>
<el-row type="flex" justify="space-between" class="info">
<span>时间{{detailObj.releaseTime}}</span>
<span>时间{{ detailObj.releaseTime }}</span>
<span style="display:flex">发布单位
<span v-text="detailObj.unitName"/>
</span>
@@ -25,7 +25,7 @@
<span class="Edit" @click="downFileAll"><i class="iconfont iconDownload"></i>下载全部</span>
</template>
<template #content>
<ai-file-list :fileList="detailObj.files" :fileOps="{ name: 'fileName', size: 'size' }" ></ai-file-list>
<ai-file-list :fileList="detailObj.files" :fileOps="{ name: 'fileName', size: 'size' }"></ai-file-list>
</template>
</ai-card>
</template>
@@ -35,24 +35,25 @@
<ai-search-bar>
<template #left>
<ai-select
v-model="search.readStatus"
@change="search.current=1,getList()"
placeholder="查阅状态"
:selectList="dict.getDict('announcementReadStatus')"
v-model="search.readStatus"
@change="search.current=1,getList()"
placeholder="查阅状态"
:selectList="dict.getDict('announcementReadStatus')"
></ai-select>
</template>
<template #right>
<el-input v-model="search.readUserName" @keyup.enter.native="getList()" placeholder="姓名"
size="small" suffix-icon="iconfont iconSearch" clearable @clear="search.current=1,getList()"></el-input>
size="small" suffix-icon="iconfont iconSearch" clearable
@clear="search.current=1,getList()"></el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="readUserName" label="姓名" align="center">
<template slot-scope="{ row }">
<span v-text="row.readUserName"/>
@@ -72,131 +73,132 @@
</template>
<script>
export default {
name: "manageDetail",
props: {
instance: Function,
dict: Object,
detail:Object
},
data() {
return {
index: 0,
tableData: [],
total: 0,
detailObj: {},
search: {
current: 1,
size: 10
}
export default {
name: "manageDetail",
props: {
instance: Function,
dict: Object,
detail: Object
},
data() {
return {
index: 0,
tableData: [],
total: 0,
detailObj: {},
search: {
current: 1,
size: 10
}
},
computed: {
tabTitle() {
return ["公告详情", "查询情况"];
},
colConfigs(){
return [
{slot:"readUserName"},
{prop:"readUserPhone",label:"手机号",align:"center"},
{slot:"unitName"},
{
prop:"readStatus",label:"查阅状态",align:"center",
render:(h,{row})=>[<span style={{color:this.dict.getColor("announcementReadStatus",row.readStatus)}}>{this.dict.getLabel("announcementReadStatus",row.readStatus)}</span>]
},
];
}
},
methods: {
downFileAll () {
if (this.detailObj.files.length > 0) {
this.instance.post('/app/appannouncement/downLoadAllFileForDetail', null, {
responseType: 'blob',
params: {
id: this.detailObj.id
}
}).then((res) => {
const link = document.createElement('a')
let blob = new Blob([res], { type: 'application/octet-stream' })
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
var num = ''
for (let i = 0; i < 10; i++) {
num += Math.ceil(Math.random() * 10)
}
link.setAttribute('download', '公告文件' + '.zip')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
} else {
this.$message.error('暂无附件提供下载')
}
},
onChange(val){
if(val==0){
this.getDetail();
}else {
this.getList();
}
},
getDetail() {
this.instance.post("/app/appannouncement/detail", null, {
params: {
id: this.detail.id
}
}).then(res => {
if (res && res.data) {
this.detailObj = res.data;
this.$initWxOpenData()
}
})
},
getList() {
this.instance.post("/app/appannouncementreader/list", null, {
params: {
announcementId: this.detail.id,
...this.search
}
}).then(res => {
if (res && res.data) {
this.tableData = res.data.records;
this.total = res.data.total;
}
})
},
},
created() {
this.dict.load("announcementReadStatus").then(this.getDetail);
}
},
computed: {
tabTitle() {
return ["公告详情", "查询情况"];
},
colConfigs() {
return [
{slot: "readUserName"},
{prop: "readUserPhone", label: "手机号", align: "center"},
{slot: "unitName"},
{
prop: "readStatus", label: "查阅状态", align: "center",
render: (h, {row}) => [<span
style={{color: this.dict.getColor("announcementReadStatus", row.readStatus)}}>{this.dict.getLabel("announcementReadStatus", row.readStatus)}</span>]
},
];
}
},
methods: {
downFileAll() {
if (this.detailObj.files.length > 0) {
this.instance.post('/app/appannouncement/downLoadAllFileForDetail', null, {
responseType: 'blob',
params: {
id: this.detailObj.id
}
}).then((res) => {
const link = document.createElement('a')
let blob = new Blob([res], {type: 'application/octet-stream'})
link.style.display = 'none'
link.href = URL.createObjectURL(blob)
var num = ''
for (let i = 0; i < 10; i++) {
num += Math.ceil(Math.random() * 10)
}
link.setAttribute('download', '公告文件' + '.zip')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
} else {
this.$message.error('暂无附件提供下载')
}
},
onChange(val) {
if (val == 0) {
this.getDetail();
} else {
this.getList();
}
},
getDetail() {
this.instance.post("/app/appannouncement/detail", null, {
params: {
id: this.detail.id
}
}).then(res => {
if (res && res.data) {
this.detailObj = res.data;
}
})
},
getList() {
this.instance.post("/app/appannouncementreader/list", null, {
params: {
announcementId: this.detail.id,
...this.search
}
}).then(res => {
if (res && res.data) {
this.tableData = res.data.records;
this.total = res.data.total;
}
})
},
},
created() {
this.dict.load("announcementReadStatus").then(this.getDetail);
}
}
</script>
<style lang="scss" scoped>
::v-deep .title {
.aibar-left {
width: 100%;
text-align: center;
}
::v-deep .title {
.aibar-left {
width: 100%;
text-align: center;
}
}
.file {
height: 40px;
line-height: 40px;
padding: 0 8px;
.file {
height: 40px;
line-height: 40px;
padding: 0 8px;
font-size: 14px;
color: #333;
background: #fff;
border-radius: 4px;
border: 1px solid #d0d4dc;
margin-bottom: 16px;
cursor: pointer;
}
.info {
& > span {
font-size: 14px;
color: #333;
background: #fff;
border-radius: 4px;
border: 1px solid #d0d4dc;
margin-bottom: 16px;
cursor: pointer;
}
.info {
& > span {
font-size: 14px;
color: #333;
}
}
}
</style>