Files
dvcp_v2_webapp/packages/wxwork/AppNotification/components/detail.vue

96 lines
2.1 KiB
Vue
Raw Normal View History

2021-12-14 18:36:19 +08:00
<template>
<ai-detail>
<template slot="title">
<ai-title title="公告详情" isShowBack isShowBottomBorder @onBackClick="$parent.goBack"></ai-title>
</template>
<template #content>
<ai-card :title="detailObj.title" class="title">
<template #content>
<el-row type="flex" justify="space-between" class="info">
2022-01-25 17:06:41 +08:00
<span>时间{{ detailObj.releaseTime }}</span>
2021-12-14 18:36:19 +08:00
<span style="display:flex">发布单位
2022-01-04 10:25:31 +00:00
<span v-text="detailObj.unitName"/>
2021-12-14 18:36:19 +08:00
</span>
<span style="display:flex">发布人
2022-01-04 10:25:31 +00:00
<span v-text="detailObj.releaseUserName"/>
2021-12-14 18:36:19 +08:00
</span>
</el-row>
<div v-html="detailObj.content" style="margin: 20px 0;"></div>
</template>
</ai-card>
<ai-card title="附件" v-if="detailObj.files && detailObj.files.length">
<template #content>
2022-01-25 17:06:41 +08:00
<el-row type="flex" justify="space-between" class="file" v-for="(item,index) in detailObj.files" :key="index"
@click.native="open(item)">
<span>{{ item.fileName }}</span>
<span>{{ (item.size / 1024).toFixed(2) }}KB</span>
2021-12-14 18:36:19 +08:00
</el-row>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
2022-01-25 17:06:41 +08:00
export default {
name: "detail",
props: {
instance: Function,
dict: Object,
detail: Object
},
data() {
return {
detailObj: {},
}
},
methods: {
open(item) {
window.open(item.url);
}
},
mounted() {
this.instance.post("/app/appannouncement/detail", null, {
params: {
id: this.detail.id
2021-12-14 18:36:19 +08:00
}
2022-01-25 17:06:41 +08:00
}).then(res => {
if (res && res.data) {
this.detailObj = res.data;
2021-12-14 18:36:19 +08:00
}
2022-01-25 17:06:41 +08:00
})
2021-12-14 18:36:19 +08:00
}
2022-01-25 17:06:41 +08:00
}
2021-12-14 18:36:19 +08:00
</script>
<style lang="scss" scoped>
2022-01-25 17:06:41 +08:00
::v-deep .title {
.aibar-left {
width: 100%;
text-align: center;
2021-12-14 18:36:19 +08:00
}
2022-01-25 17:06:41 +08:00
}
2021-12-14 18:36:19 +08:00
2022-01-25 17:06:41 +08:00
.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 {
2021-12-14 18:36:19 +08:00
font-size: 14px;
color: #333;
}
2022-01-25 17:06:41 +08:00
}
2021-12-14 18:36:19 +08:00
</style>