详情页技术文档添加暂无上传提示

This commit is contained in:
851673013@qq.com 2022-07-07 11:37:05 +08:00
parent 4774431110
commit 617373eb8e
4 changed files with 545 additions and 501 deletions

View File

@ -65,6 +65,7 @@
<script setup> <script setup>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle' import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { message } from 'ant-design-vue'
import { pinyin } from 'pinyin-pro' import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue' import { ref, defineProps, watch } from 'vue'
let dataFrom = ref({ let dataFrom = ref({
@ -184,12 +185,19 @@
let obj = props.dataList.infoList.filter( let obj = props.dataList.infoList.filter(
(item) => item.attrType === '技术文档' (item) => item.attrType === '技术文档'
)[0] )[0]
console.log('dataFrom.value.link', obj.attrValue) // console.log('dataFrom.value.link', obj.attrValue)
window.open( if (obj) {
window.SITE_CONFIG.previewUrl + window.open(
'hisense_office/onlinePreview?url=' + window.SITE_CONFIG.previewUrl +
btoa(encodeURI(obj.attrValue)) 'hisense_office/onlinePreview?url=' +
) btoa(encodeURI(obj.attrValue))
)
} else {
message.config({
top: '100px', //
})
message.error('暂无上传技术文档')
}
} }
</script> </script>

View File

@ -2,7 +2,10 @@
<!-- 使用方式 --> <!-- 使用方式 -->
<div class="usage-mode" v-if="flag"> <div class="usage-mode" v-if="flag">
<div class="tltle"> <div class="tltle">
<DetalsTitle :title="dataFrom.title" :type="dataFrom.englishTitle"></DetalsTitle> <DetalsTitle
:title="dataFrom.title"
:type="dataFrom.englishTitle"
></DetalsTitle>
</div> </div>
<div class="content" v-for="item in dataFrom.content" :key="item.title"> <div class="content" v-for="item in dataFrom.content" :key="item.title">
<div class="content-left"> <div class="content-left">
@ -84,281 +87,297 @@
</template> </template>
<script setup> <script setup>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle' import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { pinyin } from 'pinyin-pro' import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue' import { ref, defineProps, watch } from 'vue'
let dataFrom = ref({ import { message } from 'ant-design-vue'
title: '使用方式', let dataFrom = ref({
englishTitle: 'USAGE', title: '使用方式',
content: [ englishTitle: 'USAGE',
{ content: [
title: '组件地址', {
link: { title: '组件地址',
name: '接口地址:', link: {
name: '接口地址:',
},
linkValue: '',
contact: '归属部门',
facilitator: { name: '归属部门:', value: '' },
people: { name: '部门联系人:', value: '' },
phone: {
name: '联系人电话:',
value: '',
},
contact2: '服务商',
facilitator2: { name: '服务商:', value: '' },
people2: { name: '服务商联系人:', value: '' },
phone2: {
name: '联系人电话:',
value: '',
},
}, },
linkValue: '', ],
contact: '归属部门', })
facilitator: { name: '归属部门:', value: '' }, //
people: { name: '部门联系人:', value: '' }, const props = defineProps({
phone: { dataList: { type: Object, default: null },
name: '联系人电话:', })
value: '', const flag = ref(true)
}, if (props.dataList.infoList) {
contact2: '服务商', let obj = props.dataList.infoList.filter(
facilitator2: { name: '服务商:', value: '' }, (item) =>
people2: { name: '服务商联系人:', value: '' }, item.attrType === '技术文档' ||
phone2: { item.attrType === '服务商' ||
name: '联系人电话:', item.attrType === '服务商联系人' ||
value: '', item.attrType === '使用手册' ||
}, item.attrType === '服务地址' ||
}, item.attrType === '样式服务地址' ||
], item.attrType === '服务商联系电话'
}) )[0]
// if (!obj) {
const props = defineProps({ flag.value = false
dataList: { type: Object, default: null }, } else {
}) // eslint-disable-next-line vue/no-setup-props-destructure
const flag = ref(true) dataFrom.value.content[0].link.value = props.dataList.apiUrl
if (props.dataList.infoList) { dataFrom.value.content[0].facilitator.value = props.dataList.deptName
let obj = props.dataList.infoList.filter( dataFrom.value.content[0].people.value = props.dataList.deptContacts
(item) => dataFrom.value.content[0].phone.value = props.dataList.deptPhone
item.attrType === '技术文档' || console.log('dataList', props.dataList)
item.attrType === '服务商' || props.dataList.infoList.map((item) => {
item.attrType === '服务商联系人' || if (item.attrType === '组件地址') {
item.attrType === '使用手册' || dataFrom.value.content[0].linkValue = item.attrValue || '--'
item.attrType === '服务地址' || } else if (item.attrType === '服务商') {
item.attrType === '样式服务地址' || dataFrom.value.content[0].facilitator2.value = item.attrValue || '--'
item.attrType === '服务商联系电话' } else if (item.attrType === '服务商联系人') {
)[0] dataFrom.value.content[0].people2.value = item.attrValue || '--'
if (!obj) { } else if (item.attrType === '服务商联系电话') {
flag.value = false dataFrom.value.content[0].phone2.value = item.attrValue || '--'
} else { }
// eslint-disable-next-line vue/no-setup-props-destructure })
dataFrom.value.content[0].link.value = props.dataList.apiUrl
dataFrom.value.content[0].facilitator.value = props.dataList.deptName
dataFrom.value.content[0].people.value = props.dataList.deptContacts
dataFrom.value.content[0].phone.value = props.dataList.deptPhone
console.log('dataList', props.dataList)
props.dataList.infoList.map((item) => {
if (item.attrType === '组件地址') {
dataFrom.value.content[0].linkValue = item.attrValue || '--'
} else if (item.attrType === '服务商') {
dataFrom.value.content[0].facilitator2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系人') {
dataFrom.value.content[0].people2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系电话') {
dataFrom.value.content[0].phone2.value = item.attrValue || '--'
}
})
}
}
watch(
() => props.dataList,
(val) => {
if (val) {
let obj = val.infoList.filter(
(item) =>
item.attrType === '技术文档' ||
item.attrType === '服务商' ||
item.attrType === '服务商联系人' ||
item.attrType === '使用手册' ||
item.attrType === '服务地址' ||
item.attrType === '样式服务地址' ||
item.attrType === '服务商联系电话'
)[0]
if (!obj) {
flag.value = false
} else {
dataFrom.value.content[0].link.value = val.apiUrl
dataFrom.value.content[0].facilitator.value = val.deptName
dataFrom.value.content[0].people.value = val.deptContacts
dataFrom.value.content[0].phone.value = val.deptPhone
console.log('dataList', val)
val.infoList.map((item) => {
if (item.attrType === '组件地址') {
dataFrom.value.content[0].linkValue = item.attrValue || '--'
} else if (item.attrType === '服务商') {
dataFrom.value.content[0].facilitator2.value =
item.attrValue || '--'
} else if (item.attrType === '服务商联系人') {
dataFrom.value.content[0].people2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系电话') {
dataFrom.value.content[0].phone2.value = item.attrValue || '--'
}
})
}
} }
} }
) watch(
function technical() { () => props.dataList,
// (val) => {
// const type = pinyin(props.dataList.type, { if (val) {
// pattern: 'initial', let obj = val.infoList.filter(
// }).replace(/\s*/g, '') (item) =>
// // item.attrType === '技术文档' ||
// const id = props.dataList.id item.attrType === '服务商' ||
// window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank') item.attrType === '服务商联系人' ||
// console.log('dataFrom.value.link', dataFrom.value.link) item.attrType === '使用手册' ||
let obj = props.dataList.infoList.filter( item.attrType === '服务地址' ||
(item) => item.attrType === '技术文档' item.attrType === '样式服务地址' ||
)[0] item.attrType === '服务商联系电话'
console.log('dataFrom.value.link', obj.attrValue) )[0]
window.open( if (!obj) {
window.SITE_CONFIG.previewUrl + flag.value = false
'hisense_office/onlinePreview?url=' + } else {
btoa(encodeURI(obj.attrValue)) dataFrom.value.content[0].link.value = val.apiUrl
dataFrom.value.content[0].facilitator.value = val.deptName
dataFrom.value.content[0].people.value = val.deptContacts
dataFrom.value.content[0].phone.value = val.deptPhone
console.log('dataList', val)
val.infoList.map((item) => {
if (item.attrType === '组件地址') {
dataFrom.value.content[0].linkValue = item.attrValue || '--'
} else if (item.attrType === '服务商') {
dataFrom.value.content[0].facilitator2.value =
item.attrValue || '--'
} else if (item.attrType === '服务商联系人') {
dataFrom.value.content[0].people2.value = item.attrValue || '--'
} else if (item.attrType === '服务商联系电话') {
dataFrom.value.content[0].phone2.value = item.attrValue || '--'
}
})
}
}
}
) )
} function technical() {
function technicalNew() { //
// // const type = pinyin(props.dataList.type, {
// const type = pinyin(props.dataList.type, { // pattern: 'initial',
// pattern: 'initial', // }).replace(/\s*/g, '')
// }).replace(/\s*/g, '') // //
// // // const id = props.dataList.id
// const id = props.dataList.id // window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank')
// window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank') // console.log('dataFrom.value.link', dataFrom.value.link)
let obj = props.dataList.infoList.filter( let obj = props.dataList.infoList.filter(
(item) => item.attrType === '使用手册' (item) => item.attrType === '技术文档'
)[0] )[0]
console.log('dataFrom.value.link', obj.attrValue) if (obj) {
window.open( window.open(
window.SITE_CONFIG.previewUrl + window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' + 'hisense_office/onlinePreview?url=' +
btoa(encodeURI(obj.attrValue)) btoa(encodeURI(obj.attrValue))
) )
} } else {
message.config({
top: '100px', //
})
message.error('暂无上传技术文档')
}
}
function technicalNew() {
//
// const type = pinyin(props.dataList.type, {
// pattern: 'initial',
// }).replace(/\s*/g, '')
// //
// const id = props.dataList.id
// window.open(window.SITE_CONFIG.frontUrl + type + '/' + id + '.md', '_blank')
let obj = props.dataList.infoList.filter(
(item) => item.attrType === '使用手册'
)[0]
console.log('dataFrom.value.link', obj.attrValue)
if (obj) {
window.open(
window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' +
btoa(encodeURI(obj.attrValue))
)
} else {
message.config({
top: '100px', //
})
message.error('暂无上传使用手册')
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.usage-mode { .usage-mode {
display: flex;
flex-direction: column;
align-items: center;
padding: 0.8rem 0;
.content {
margin-top: 0.3rem;
display: flex; display: flex;
flex-direction: column;
align-items: center;
padding: 0.8rem 0;
.content-left { .content {
height: 1.5rem; margin-top: 0.3rem;
width: 6.2rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png') no-repeat;
background-position: center;
background-size: 100% 100%;
border-radius: 0.1rem;
margin-right: 0.6rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex; display: flex;
align-items: center;
padding: 0 0.35rem;
.left { .content-left {
.content-left-title { height: 1.5rem;
font-size: 0.26rem; width: 6.2rem;
line-height: 0.26rem; background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png')
color: #212956; no-repeat;
margin-bottom: 0.2rem; background-position: center;
background-size: 100% 100%;
border-radius: 0.1rem;
margin-right: 0.6rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
align-items: center;
padding: 0 0.35rem;
span:first-child { .left {
margin-right: 0.1rem; .content-left-title {
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.2rem;
span:first-child {
margin-right: 0.1rem;
}
}
.content-left-content {
width: 4.2rem;
font-size: 0.2rem;
color: rgba(33, 41, 86, 0.8);
line-height: 0.2rem;
p {
display: -webkit-box;
margin-bottom: 0.1rem;
span:last-of-type {
width: 298px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
} }
} }
.content-left-content { .right {
width: 4.2rem; div {
font-size: 0.2rem; height: 0.4rem;
width: 1.3rem;
background: #ffffff;
border-radius: 0.2rem;
color: #526aff;
font-size: 0.2rem;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
div:first-child {
margin-bottom: 0.2rem;
}
}
}
.content-right {
height: 1.5rem;
width: 6.2rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png')
no-repeat;
background-position: center;
background-size: 100% 100%;
border-radius: 0.1rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 0.3rem;
.content-right-left {
border-right: 0.01rem solid #707fe0;
padding-right: 0.1rem;
margin-right: 0.1rem;
}
.content-right-title {
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.15rem;
}
.content-right-content {
display: flex;
font-size: 0.16rem;
color: rgba(33, 41, 86, 0.8); color: rgba(33, 41, 86, 0.8);
line-height: 0.2rem; line-height: 0.2rem;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
flex-direction: column;
p { p {
// width: 1.60rem;
height: 0.2rem;
display: -webkit-box; display: -webkit-box;
margin-bottom: 0.1rem; // overflow: hidden;
margin-bottom: 0.08rem;
white-space: nowrap;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
margin-right: 0.15rem;
span:last-of-type { span {
width: 298px; cursor: pointer;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
} }
} }
} }
} }
.right {
div {
height: 0.4rem;
width: 1.3rem;
background: #ffffff;
border-radius: 0.2rem;
color: #526aff;
font-size: 0.2rem;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
div:first-child {
margin-bottom: 0.2rem;
}
}
}
.content-right {
height: 1.5rem;
width: 6.2rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png') no-repeat;
background-position: center;
background-size: 100% 100%;
border-radius: 0.1rem;
box-shadow: 0rem 0.05rem 0.15rem rgba(82, 106, 255, 0.4);
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 0.3rem;
.content-right-left {
border-right: 0.01rem solid #707fe0;
padding-right: 0.1rem;
margin-right: 0.1rem;
}
.content-right-title {
font-size: 0.26rem;
line-height: 0.26rem;
color: #212956;
margin-bottom: 0.15rem;
}
.content-right-content {
display: flex;
font-size: 0.16rem;
color: rgba(33, 41, 86, 0.8);
line-height: 0.2rem;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
flex-direction: column;
p {
// width: 1.60rem;
height: 0.2rem;
display: -webkit-box;
// overflow: hidden;
margin-bottom: 0.08rem;
white-space: nowrap;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
margin-right: 0.15rem;
span {
cursor: pointer;
}
}
}
} }
} }
}
</style> </style>

View File

@ -8,7 +8,12 @@
<template> <template>
<div class="business-navigation" v-if="navList.length > 0"> <div class="business-navigation" v-if="navList.length > 0">
<template v-for="nav in navList" :key="nav.key"> <template v-for="nav in navList" :key="nav.key">
<div class="nav" :class="{ select: nav.key == select }" v-if="nav.show" @click="selectNav(nav.key)"> <div
class="nav"
:class="{ select: nav.key == select }"
v-if="nav.show"
@click="selectNav(nav.key)"
>
{{ nav.name }} {{ nav.name }}
<span class="line"></span> <span class="line"></span>
</div> </div>
@ -16,248 +21,247 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, defineProps, watch, getCurrentInstance } from 'vue' import { ref, defineProps, watch, getCurrentInstance } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import { queryPartAppByKeyId2 } from '@/api/home' import { queryPartAppByKeyId2 } from '@/api/home'
// //
const router = useRouter() const router = useRouter()
const keyId = router.currentRoute.value.query.id const keyId = router.currentRoute.value.query.id
const navList = ref([ const navList = ref([
{ {
name: '图层展示', name: '图层展示',
key: 'service-presentation', key: 'service-presentation',
}, },
{ {
name: '图层信息', name: '图层信息',
key: 'service-information', key: 'service-information',
}, },
{ {
name: '应用场景', name: '应用场景',
key: 'service-application-scenarios', key: 'service-application-scenarios',
}, },
{ {
name: '应用案例', name: '应用案例',
key: 'service-application-case', key: 'service-application-case',
}, },
{ {
name: '图层预览', name: '图层预览',
key: 'service-preview', key: 'service-preview',
}, },
{ {
name: '使用方式', name: '使用方式',
key: 'service-usage-mode', key: 'service-usage-mode',
}, },
{ {
name: '常见问题', name: '常见问题',
key: 'service-common-problem', key: 'service-common-problem',
}, },
]) ])
const props = defineProps({ const props = defineProps({
selectNow: { type: String, default: '' }, selectNow: { type: String, default: '' },
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
associatedComponents: { type: Array, default: null }, associatedComponents: { type: Array, default: null },
})
const list = ref([])
// id
if (keyId) {
queryPartAppByKeyId2({ keyId: keyId }).then((res) => {
console.log('ressssssss', res)
if (res.data.data.length > 0) {
//
navList.value.unshift({
name: '关联应用',
key: 'layer-service-associated-ability',
show: true,
})
list.value.unshift('关联应用')
}
}) })
} const list = ref([])
const select = ref('layer-service-associated-ability') // id
const selectNav = (key) => { if (keyId) {
select.value = key queryPartAppByKeyId2({ keyId: keyId }).then((res) => {
console.log(key, select.value) console.log('ressssssss', res)
mybus.emit('flyToView', select.value) if (res.data.data.length > 0) {
} //
if (props.dataList.infoList) { navList.value.unshift({
list.value = [] name: '关联应用',
let arr = [ key: 'layer-service-associated-ability',
'图层缩略图', show: true,
'坐标系', })
'应用场景', list.value.unshift('关联应用')
'应用案例',
'是否可预览',
'使用方式',
'常见问题',
]
//
// eslint-disable-next-line vue/no-mutating-props
props.dataList.infoList.sort((a, b) => {
return arr.indexOf(a.attrType) - arr.indexOf(b.attrType)
})
props.dataList.infoList.map((item) => {
if (
item.attrType === '常见问题' ||
item.attrType === '应用场景' ||
item.attrType === '应用案例'
) {
list.value.push(item.attrType)
} else if (item.attrType === '图层缩略图') {
list.value.push('图层展示')
} else if (item.attrType === '是否可预览') {
if (item.attrValue === '是') {
list.value.push('图层预览')
} }
} else if ( })
item.attrType === '服务类型' ||
item.attrType === '覆盖区域' ||
item.attrType === '切片策略' ||
item.attrType === '坐标系' ||
item.attrType === '切片尺寸' ||
item.attrType === '最小级别' ||
item.attrType === '数据范围' ||
item.attrType === '图层类型' ||
item.attrType === '最大级别'
) {
list.value.push('图层信息')
} else if (
item.attrType === '技术文档' ||
item.attrType === '服务商' ||
item.attrType === '服务商联系人' ||
item.attrType === '使用手册' ||
item.attrType === '服务地址' ||
item.attrType === '样式服务地址' ||
item.attrType === '服务商联系电话'
) {
list.value.push('使用方式')
}
})
list.value.unshift('关联应用')
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
item.show = true
}
})
select.value = navList.value.filter(
(item) => item.name === list.value[0]
)[0].key
console.log('11111111111111111111111111', list.value, navList.value)
}
watch(
() => props.selectNow,
(newValue) => {
select.value = newValue
} }
) const select = ref('layer-service-associated-ability')
watch( const selectNav = (key) => {
() => props.dataList, select.value = key
(val) => { console.log(key, select.value)
if (val) { mybus.emit('flyToView', select.value)
list.value = [] }
let arr = [ if (props.dataList.infoList) {
'图层缩略图', list.value = []
'坐标系', let arr = [
'应用场景', '图层缩略图',
'应用案例', '坐标系',
'是否可预览', '应用场景',
'使用方式', '应用案例',
'常见问题', '是否可预览',
] '使用方式',
// '常见问题',
// eslint-disable-next-line vue/no-mutating-props ]
props.dataList.infoList.sort((a, b) => { //
// console.log('==============>', a, b) // eslint-disable-next-line vue/no-mutating-props
return arr.indexOf(a.attrType) - arr.indexOf(b.attrType) props.dataList.infoList.sort((a, b) => {
}) return arr.indexOf(a.attrType) - arr.indexOf(b.attrType)
val.infoList.map((item) => { })
if ( props.dataList.infoList.map((item) => {
item.attrType === '常见问题' || if (
item.attrType === '应用场景' || item.attrType === '常见问题' ||
item.attrType === '应用案例' item.attrType === '应用场景' ||
) { item.attrType === '应用案例'
list.value.push(item.attrType) ) {
} else if (item.attrType === '图层缩略图') { list.value.push(item.attrType)
list.value.push('图层展示') } else if (item.attrType === '图层缩略图') {
} else if (item.attrType === '是否可预览') { list.value.push('图层展示')
if (item.attrValue === '是') { } else if (item.attrType === '是否可预览') {
list.value.push('图层预览') if (item.attrValue === '是') {
list.value.push('图层预览')
}
} else if (
item.attrType === '服务类型' ||
item.attrType === '覆盖区域' ||
item.attrType === '切片策略' ||
item.attrType === '坐标系' ||
item.attrType === '切片尺寸' ||
item.attrType === '最小级别' ||
item.attrType === '数据范围' ||
item.attrType === '图层类型' ||
item.attrType === '最大级别'
) {
list.value.push('图层信息')
} else if (
item.attrType === '技术文档' ||
item.attrType === '服务商' ||
item.attrType === '服务商联系人' ||
item.attrType === '使用手册' ||
item.attrType === '服务地址' ||
item.attrType === '样式服务地址' ||
item.attrType === '服务商联系电话'
) {
list.value.push('使用方式')
}
})
list.value.unshift('关联应用')
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
item.show = true
}
})
select.value = navList.value.filter(
(item) => item.name === list.value[0]
)[0].key
console.log('11111111111111111111111111', list.value, navList.value)
}
watch(
() => props.selectNow,
(newValue) => {
select.value = newValue
}
)
watch(
() => props.dataList,
(val) => {
if (val) {
list.value = []
let arr = [
'图层缩略图',
'坐标系',
'应用场景',
'应用案例',
'是否可预览',
'使用方式',
'常见问题',
]
//
// eslint-disable-next-line vue/no-mutating-props
props.dataList.infoList.sort((a, b) => {
// console.log('==============>', a, b)
return arr.indexOf(a.attrType) - arr.indexOf(b.attrType)
})
val.infoList.map((item) => {
if (
item.attrType === '常见问题' ||
item.attrType === '应用场景' ||
item.attrType === '应用案例'
) {
list.value.push(item.attrType)
} else if (item.attrType === '图层缩略图') {
list.value.push('图层展示')
} else if (item.attrType === '是否可预览') {
if (item.attrValue === '是') {
list.value.push('图层预览')
}
} else if (
item.attrType === '服务类型' ||
item.attrType === '覆盖区域' ||
item.attrType === '切片策略' ||
item.attrType === '坐标系' ||
item.attrType === '切片尺寸' ||
item.attrType === '最小级别' ||
item.attrType === '数据范围' ||
item.attrType === '图层类型' ||
item.attrType === '最大级别'
) {
list.value.push('图层信息')
} else if (
item.attrType === '技术文档' ||
item.attrType === '服务商' ||
item.attrType === '服务商联系人' ||
item.attrType === '使用手册' ||
item.attrType === '服务地址' ||
item.attrType === '样式服务地址' ||
item.attrType === '服务商联系电话'
) {
list.value.push('使用方式')
} }
} else if ( })
item.attrType === '服务类型' || list.value.unshift('关联应用')
item.attrType === '覆盖区域' || navList.value.forEach((item) => {
item.attrType === '切片策略' || console.log(item)
item.attrType === '坐标系' || if (list.value.indexOf(item.name) > -1) {
item.attrType === '切片尺寸' || item.show = true
item.attrType === '最小级别' || }
item.attrType === '数据范围' || })
item.attrType === '图层类型' || if (navList.value.filter((item) => item.name === list.value[0])[0]) {
item.attrType === '最大级别' select.value = navList.value.filter(
) { (item) => item.name === list.value[0]
list.value.push('图层信息') )[0].key
} else if (
item.attrType === '技术文档' ||
item.attrType === '服务商' ||
item.attrType === '服务商联系人' ||
item.attrType === '使用手册' ||
item.attrType === '服务地址' ||
item.attrType === '样式服务地址' ||
item.attrType === '服务商联系电话'
) {
list.value.push('使用方式')
} }
})
list.value.unshift('关联应用')
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
item.show = true
}
})
if (list.value.length > 0) {
select.value = navList.value.filter(
(item) => item.name === list.value[0]
)[0].key
} }
console.log('11111111111111111111111111', list.value, navList.value)
} }
} )
)
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.business-navigation { .business-navigation {
width: 19.12rem; width: 19.12rem;
height: 0.84rem; height: 0.84rem;
line-height: 0.8rem; line-height: 0.8rem;
display: flex;
justify-content: space-around;
font-size: 0.24rem;
color: #666;
background: #fff;
padding: 0 3rem;
box-shadow: 0rem 0.05rem 0.1rem #f2f3fb;
position: relative;
.nav {
cursor: pointer;
display: flex; display: flex;
flex-direction: column; justify-content: space-around;
justify-content: space-between; font-size: 0.24rem;
align-items: center; color: #666;
background: #fff;
padding: 0 3rem;
box-shadow: 0rem 0.05rem 0.1rem #f2f3fb;
position: relative;
.line { .nav {
width: 0.4rem; cursor: pointer;
height: 0.04rem; display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
.line {
width: 0.4rem;
height: 0.04rem;
}
}
.select {
color: #526aff;
.line {
background: #526aff;
}
} }
} }
.select {
color: #526aff;
.line {
background: #526aff;
}
}
}
</style> </style>

View File

@ -90,6 +90,7 @@
<script setup> <script setup>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle' import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { message } from 'ant-design-vue'
import { pinyin } from 'pinyin-pro' import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue' import { ref, defineProps, watch } from 'vue'
let dataFrom = ref({ let dataFrom = ref({
@ -213,12 +214,18 @@
let obj = props.dataList.infoList.filter( let obj = props.dataList.infoList.filter(
(item) => item.attrType === '技术文档' (item) => item.attrType === '技术文档'
)[0] )[0]
console.log('dataFrom.value.link', obj.attrValue) if (obj) {
window.open( window.open(
window.SITE_CONFIG.previewUrl + window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' + 'hisense_office/onlinePreview?url=' +
btoa(encodeURI(obj.attrValue)) btoa(encodeURI(obj.attrValue))
) )
} else {
message.config({
top: '100px', //
})
message.error('暂无上传技术文档')
}
} }
function technicalNew() { function technicalNew() {
// //
@ -231,12 +238,18 @@
let obj = props.dataList.infoList.filter( let obj = props.dataList.infoList.filter(
(item) => item.attrType === '使用手册' (item) => item.attrType === '使用手册'
)[0] )[0]
console.log('dataFrom.value.link', obj.attrValue) if (obj) {
window.open( window.open(
window.SITE_CONFIG.previewUrl + window.SITE_CONFIG.previewUrl +
'hisense_office/onlinePreview?url=' + 'hisense_office/onlinePreview?url=' +
btoa(encodeURI(obj.attrValue)) btoa(encodeURI(obj.attrValue))
) )
} else {
message.config({
top: '100px', //
})
message.error('暂上传使用手册')
}
} }
</script> </script>