You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
5.1 KiB

1 year ago
<template>
<div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'normal'" :title="form.title">
<template v-slot:default>
<div class="article">
<div class="article-title">{{form.title}}</div>
<div v-if="form.tag_ids">
<!-- <el-tag></el-tag> -->
</div>
<div class="article-time">
<div v-if="form.date">{{form.date}}</div>
1 year ago
<div v-if="form.catalog_name">
<el-tag>{{form.catalog_name}}</el-tag>
</div>
1 year ago
<div v-if="form.area_ids">
9 months ago
<template v-if="form.area_ids_details && form.area_ids_details.length>0">
<template v-if="form.area_ids_details.length===areaList.length">
<el-tag style="margin-right:5px">全部区域</el-tag>
</template>
<template v-else v-for="(item,index) in form.area_ids_details">
1 year ago
<el-tag style="margin-right:5px">{{item.name}}</el-tag>
</template>
</template>
</div>
<div v-if="form.tag_ids">
<template v-if="form.area_ids_details && form.tag_ids_details.length>0">
<template v-for="(item,index) in form.tag_ids_details">
<el-tag style="margin-right:5px">{{item.name}}</el-tag>
</template>
</template>
1 year ago
</div>
</div>
10 months ago
<div class="article-files" v-if="form.files_details && form.files_details.length>0">
<el-link target="_blank" style="margin:0 10px;" @click="toViewDownLoadFile(form.files_details)" type="primary">
共有{{form.files_details.length}}条附件点击查看
</el-link>
<!-- <div v-for="(item,index) in form.files_details">
1 year ago
附件{{index+1}}
<a :href="item.url" target="_blank">{{item.original_name}}</a>
1 year ago
<el-link target="_blank" style="margin:0 10px;" @click="toshowFile(item)" type="primary">
1 year ago
预览
</el-link>
10 months ago
</div> -->
1 year ago
</div>
<div class="article-html" v-if="form.content">
<div v-html="form.content"></div>
</div>
</div>
</template>
<template v-slot:footerContent>
<Button ghost type="primary" @click='isShow=false'>关闭</Button>
</template>
</xy-dialog>
10 months ago
<viewFile ref="viewFile"></viewFile>
<viewDownload ref="viewDownload" :title="form.title"></viewDownload>
1 year ago
</div>
</template>
<script>
import {
show
} from "@/api/system/baseForm.js"
10 months ago
import viewFile from '@/components/viewFile/viewFile.vue'
import viewDownload from '@/components/viewFile/viewDownload.vue'
1 year ago
export default {
components: {
10 months ago
viewFile,
viewDownload
1 year ago
},
data() {
return {
isShow: false,
id: '',
table_name: 'records',
9 months ago
form: {},
areaList:[]
1 year ago
}
},
created() {
},
methods: {
getDetail() {
show({
id: this.id,
table_name: this.table_name,
1 year ago
json_data_fields: ['files', 'area_ids','tag_ids']
1 year ago
}).then(res => {
1 year ago
this.form = this.base.deepCopy(res)
console.log("this.form", this.form)
1 year ago
})
},
1 year ago
toshowFile(item) {
// 是视频的
if(item.url && this.base.containsVideoFormat(item.url)){
this.$refs.viewFile.typeName = 'video'
this.$refs.viewFile.url = item.url
}else{
this.$refs.viewFile.typeName = 'file'
10 months ago
if(item.url.includes('doc')||item.url.includes('DOC')){
this.$refs.viewFile.url = item.view_url
}else{
9 months ago
if(item.url.includes('pdf') || item.url.includes('PDF')){
window.open(item.url,item.original_name)
}else{
this.$refs.viewFile.url = item.url
}
10 months ago
}
1 year ago
}
1 year ago
this.$refs.viewFile.diaShow = true
10 months ago
},
// 打开 文件列表夹
toViewDownLoadFile(files){
this.$refs.viewDownload.files = files
this.$refs.viewDownload.isShow = true
}
1 year ago
},
watch: {
isShow(newVal) {
if (newVal) {
this.getDetail()
} else {
this.id = ''
this.form = {}
}
},
}
}
</script>
<style scoped lang="scss">
.article {
&>div {
1 year ago
margin:10px 30px;
1 year ago
}
&-title {
font-size: 24px;
text-align: center;
font-weight: bold;
color: #000;
}
&-time {
display: flex;
justify-content: center;
1 year ago
font-size: 16px;
1 year ago
color: rgba(0, 0, 0, 0.6);
1 year ago
align-items: center;
1 year ago
&>div {
margin: 0 10px;
}
}
&-files {
color: blue;
cursor: pointer;
text-decoration: underline;
1 year ago
// text-indent: 2em;
1 year ago
}
&-html {
line-height: 1.5;
1 year ago
font-size: 20px;
::v-deep video{
display:block!important;
margin:0 auto!important;
}
1 year ago
}
}
</style>