Files
laws_weilai/jero-web/src/views/businessSupport/problemKnowledgeBase/components/countryCardView.vue
T
2022-10-09 20:49:04 +08:00

532 lines
18 KiB
Java

<template>
<div class="doc-detail">
<div class="doc-detail-wrap">
<div class="doc-detail-header" style="position: fixed;top: 0">
<div class="doc-detail-title">
<!-- <span style="line-height: 66px;display: inline-block;float: left">-->
<!-- <a-icon type="arrow-left" style="margin-right: 6px;"/>-->
<!-- </span>-->
{{header_text}}
</div>
</div>
<div style="padding-top: 68px;background: #fff">
<div class="detail-content" style="padding: 24px;white-space: nowrap">
<div class="box-content-right">
<div @click="displayInformationClick" class="operator-text">
<a-icon type="eye"/>
{{$t('displayInformation')}}
</div>
<div @click="newlyAddedClick" class="operator-text">
<a-icon type="plus"/>
{{$t('addComparison')}}
</div>
</div>
<div style="overflow: auto;height: calc(100vh - 160px);">
<div class="content-box" :style="{'width':clientWidth}" v-if="isTrue">
<div style="width: 100%" v-for="(item1,index) in contentList" class="content-box-top">
<div v-for="(item2,index2) in item1.list" style="width: 340px;display: inline-block"
class="content-box-left">
<div class="content-box-box-top" style="cursor: default" v-if="index == 0">
<span class="content-box-box-img content-box-box-img-text" v-if="index2 == 0"></span>
<span class="content-box-box-img-index" v-else>
<img :src="item2.img" class="content-box-box-img" alt="">
</span>
<span v-if="index2 == 0" class="content-box-box-text"></span>
<div v-else class="content-box-box-text">
{{item2.applyMarket_dictText}}
</div>
</div>
<div class="content-box-box" :class="{'content-box-box-color':index % 2 == 1 ? true : false}" v-else>
<a v-if="index2 == 0 && item2.relevantUrl"
style="color: rgb(33, 201, 204);font-weight: bold"
:class="{'content-box-box-text-admin':!item2.lableName || item2.lableName == 'null' || item2.lableName == 'undefined'? true : false}"
class="content-box-box-text content-box-box-text-index"
:href="item2.relevantUrl" target="_blank">{{item2.lableName}}</a>
<span v-else-if="index2 == 0"
:class="{'content-box-box-text-admin':!item2.lableName || item2.lableName == 'null' || item2.lableName == 'undefined'? true : false}"
class="content-box-box-text content-box-box-text-index"
style="color: #040B29;font-weight: bold">
{{item2.lableName}}
</span>
<span style="color: #21c9cc"
:class="{'content-box-box-text-admin':!item2.lableName || item2.lableName == 'null' || item2.lableName == 'undefined'? true : false}"
class="content-box-box-text content-box-box-text-index"
v-else-if="item2.lableType == 7 && item2.lableName && index2 != 0">
<span v-if="item2.lableName && item2.lableName.split(',').length == 1">
<span class="file-text" @click="pdfPreview(item2)" :title="item2.contentFileName">
{{item2.contentFileName}}
</span>
<a-icon @click="download(item2)" type="download" class="icon-text"/>
</span>
<span v-else :title="$t('viewFile')"
@click="viewFileClick(item2.lableName)">
{{$t('viewFile')}}
</span>
</span>
<span class="content-box-box-text content-box-box-text-index"
v-else-if="item2.lableType != 7 && !item2.lableName && index2 != 0"
style="cursor: default"
:title="item2.lableName"
:class="{'content-box-box-text-admin':!item2.lableName || item2.lableName == 'null' || item2.lableName == 'undefined'? true : false}">
{{item2.lableName}}
</span>
<span class="content-box-box-text content-box-box-text-index"
v-else
style="cursor: default"
:title="item2.lableName"
:class="{'content-box-box-text-admin':!item2.lableName || item2.lableName == 'null' || item2.lableName == 'undefined'? true : false}">
{{item2.lableName}}
</span>
<!-- <img src="../../../../assets/mobileHome.png" class="content-box-box-img" alt="">-->
<!-- <span class="content-box-box-text">-->
<!-- 中国-->
<!-- </span>-->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<displayInformationModel ref="displayInformationModelRef"
@displayInformationModelForm="displayInformationModelForm"/>
<countryCardViewAdd ref="countryCardViewAddRef" @countryCardViewAddForm="countryCardViewAddForm"/>
<JLoading :loading="loading">{{$t('dataLoading')}}</JLoading>
<viewFileModel ref="viewFileModelRef"/>
</div>
</template>
<script>
import { getAction, postAction, downloadFile } from '@/api/manage'
import displayInformationModel from './displayInformationModel'
import countryCardViewAdd from './countryCardViewAdd'
import viewFileModel from '@/components/viewFileModel/index'
import { mapGetters } from 'vuex'
import { Base64 } from 'js-base64'
export default {
name: 'countryCardView',
components: {
displayInformationModel,
countryCardViewAdd,
viewFileModel
},
data() {
return {
clientWidth: '',
isTrue: false,
loading: false,
dataList: [],
contentList: [],
displayList: [],
queryCountryList: [],
countryCardViewList: [],
applyMarkets: '',
header_text: '',
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download',
url: {
list: '/problemKnowledgeBase/countryCardTempEO/list',
deleteOne: ''
},
list: '/problemKnowledgeBase/countryCardManageReleaseEO/queryCountryCardManageReleaseByApplyMarkets'
}
},
mounted() {
document.title = 'Country Card' + '-' + this.$t('details')
this.queryCountry(() => {
this.replacePage()
})
},
methods: {
...mapGetters(['userInfo']),
pdfPreview(fileQuery) {
let fileName = fileQuery.contentFileName
fileQuery.id = fileQuery.lableName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx' || fileSuffix == '.doc') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
}else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', fileQuery.contentFileName, { id: fileQuery.id })
}
},
displayInformationClick() {
this.$refs.displayInformationModelRef.getData(JSON.parse(JSON.stringify(this.displayList)))
},
displayInformationModelForm(data) {
this.displayList = data
this.displayList = [...this.displayList]
this.consolidateData()
},
newlyAddedClick() {
this.$refs.countryCardViewAddRef.add(this.countryCardViewList)
},
download(item) {
downloadFile('/sys/common/downLoadFile', item.contentFileName, { id: item.lableName, userName: this.userInfo().username })
},
countryCardViewAddForm(val) {
this.countryCardViewList = JSON.parse(JSON.stringify(val))
let content = []
if (val && val.length > 0) {
val.forEach(res => {
if (res.applyMarket) {
content.push(res.applyMarket)
}
})
}
this.applyMarkets = content.join(',')
this.queryCountry()
},
replacePage() {
getAction(this.url.list, {}).then((res) => {
if (res.success) {
this.displayList = res.result || []
this.displayList.forEach(val => {
val.showOrNot = true
})
this.$nextTick(() => {
this.$refs.displayInformationModelRef.dataListOne = JSON.parse(JSON.stringify(this.displayList))
})
this.consolidateData()
this.loading = false
} else {
this.displayList = []
this.loading = false
}
})
},
consolidateData() {
let content = []
this.contentList = []
this.contentList.push({})
if (this.displayList && this.displayList.length > 0) {
this.displayList.forEach(res => {
if (res.showOrNot) {
content.push(res)
}
})
}
if (this.queryCountryList && this.queryCountryList.length > 0) {
this.contentList[0].list = []
this.contentList[0].list.push({})
this.queryCountryList.forEach(val => {
this.contentList[0].name = 'tou'
this.contentList[0].list.push({
applyMarket_dictText: val.applyMarket_dictText,
img: val.countryNationalFlag
})
})
}
if (content && content.length > 0) {
content.forEach((res, index) => {
this.contentList[index + 1] = { name: res.lableName }
this.contentList[index + 1].list = []
this.contentList[index + 1].list.push({
lableName: res.lableName,
lableType: res.lableType,
relevantUrl: res.relevantUrl
})
})
}
this.queryCountryList.forEach((res, index) => {
res.countryCardManageReleaseDetailEOList.forEach((val, index1) => {
this.contentList.forEach(res1 => {
if (res1.name == val.lableName) {
if (val.lableType == 3) {
res1.list.push({
lableName: val.contentDropDownValue,
lableType: val.lableType,
contentFileName:val.contentFileName || ''
})
} else {
res1.list.push({
lableName: val.content,
lableType: val.lableType,
contentFileName:val.contentFileName || ''
})
}
}
})
})
})
},
queryCountry(callback) {
this.loading = true
let applyMarkets = this.$route.query.applyMarket
if (this.applyMarkets) {
applyMarkets = applyMarkets + ',' + this.applyMarkets
}
let query = {
applyMarkets: applyMarkets
}
postAction(this.list, query).then((res) => {
if (res.success) {
this.queryCountryList = []
applyMarkets.split(',').forEach(val => {
res.result.forEach(ol => {
if (val == ol.applyMarket) {
this.queryCountryList.push(ol)
}
})
})
// this.queryCountryList = res.result || []
this.isTrue = false
this.$nextTick(() => {
this.clientWidth = 340 * (this.queryCountryList.length + 1) + 'px'
this.isTrue = true
})
let content = []
this.queryCountryList.forEach(val => {
content.push(val.applyMarket_dictText)
})
this.header_text = content.join('-')
callback && callback()
if (!callback) {
this.consolidateData()
this.loading = false
}
} else {
callback && callback()
this.contentList = []
this.loading = false
}
})
},
viewFileClick(item) {
this.$refs.viewFileModelRef.clickButtonToUpload(item)
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.doc-detail {
background: #fff;
height: 100%;
.doc-detail-wrap {
.doc-detail-header {
width: 100%;
height: 68px;
line-height: 68px;
padding: 0 0 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
z-index: 1000;
background: #fff;
.doc-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 68px;
}
.doc-detail-right {
width: 800px;
line-height: 68px;
display: flex;
.doc-detail-btn {
margin-left: 10px;
}
}
}
.header-text {
font-size: 16px;
font-weight: 400;
height: 80px;
color: #000F16;
line-height: 80px;
}
.processBackground-text {
font-size: 16px;
color: #000F16;
}
}
}
.box-content-right {
width: 100%;
text-align: right;
margin-bottom: 20px;
}
.operator-text {
cursor: pointer;
margin-right: 53px;
font-size: 14px;
font-weight: 400;
color: #040B29;
display: inline-block;
}
.operator-text:last-child {
margin-right: 13px;
}
.content-box {
position: relative;
background: #fff;
}
.content-box-box-top {
width: 340px;
height: 115px;
display: inline-block;
cursor: pointer;
background: #fff;
position: relative;
border-right: 1px #d9d9d9 solid;
border-top: 1px #d9d9d9 solid;
border-bottom: 1px #d9d9d9 solid;
.content-box-box-img {
width: 169px;
/*height: 100%;*/
}
.content-box-box-text {
display: inline-block;
width: calc(100% - 169px);
text-align: center;
font-size: 18px;
font-weight: 500;
color: #040B29;
word-break: break-word;
white-space: pre-line;
position: absolute;
top: 50%;
transform: translateY(-66%);
}
}
.content-box-left:first-child .content-box-box-top {
border-left: 1px #d9d9d9 solid;
}
.content-box-box {
width: 340px;
display: inline-block;
height: 60px;
line-height: 60px;
text-align: center;
background: #fff;
border-right: 1px #d9d9d9 solid;
border-bottom: 1px #d9d9d9 solid;
cursor: pointer;
.content-box-box-img {
width: 238px;
height: 100%;
}
.content-box-box-text {
display: inline-block;
width: calc(100% - 169px);
text-align: center;
font-size: 18px;
font-weight: 500;
color: #040B29;
word-break: break-word;
}
}
.content-box-left:first-child .content-box-box {
border-left: 1px #d9d9d9 solid;
}
.content-box-left:first-child {
position: sticky;
left: 0;
z-index: 110;
background: #fff;
}
.content-box-top {
height: 60px;
}
.content-box-top:first-child {
position: sticky;
top: 0;
height: 115px;
z-index: 111;
background: #fff;
}
.content-box-box-text-index {
width: 100% !important;
padding: 0 12px;
box-sizing: border-box;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.content-box-box-text-admin {
height: 60px !important;
}
.content-box-box-color {
background: #f2f2f2;
}
.content-box-box-img-text {
width: auto !important;
display: inline-block;
height: 112px;
vertical-align: middle;
border-style: none;
}
.content-box-box-img-index {
width: 169px;
height: 112px;
display: inline-block;
vertical-align: middle;
border-style: none;
}
.file-text {
width: calc(100% - 30px);
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
float: left;
color: #040B29
}
.icon-text {
width: 30px;
display: inline-block;
overflow: hidden;
float: left;
margin-top: 21px;
}
</style>