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

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)
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>

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,10 +87,11 @@
</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'
let dataFrom = ref({
title: '使用方式', title: '使用方式',
englishTitle: 'USAGE', englishTitle: 'USAGE',
content: [ content: [
@ -113,13 +117,13 @@ let dataFrom = ref({
}, },
}, },
], ],
}) })
// //
const props = defineProps({ const props = defineProps({
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
}) })
const flag = ref(true) const flag = ref(true)
if (props.dataList.infoList) { if (props.dataList.infoList) {
let obj = props.dataList.infoList.filter( let obj = props.dataList.infoList.filter(
(item) => (item) =>
item.attrType === '技术文档' || item.attrType === '技术文档' ||
@ -151,8 +155,8 @@ if (props.dataList.infoList) {
} }
}) })
} }
} }
watch( watch(
() => props.dataList, () => props.dataList,
(val) => { (val) => {
if (val) { if (val) {
@ -189,8 +193,8 @@ watch(
} }
} }
} }
) )
function technical() { function technical() {
// //
// const type = pinyin(props.dataList.type, { // const type = pinyin(props.dataList.type, {
// pattern: 'initial', // pattern: 'initial',
@ -202,14 +206,20 @@ function technical() {
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 {
function technicalNew() { message.config({
top: '100px', //
})
message.error('暂无上传技术文档')
}
}
function technicalNew() {
// //
// const type = pinyin(props.dataList.type, { // const type = pinyin(props.dataList.type, {
// pattern: 'initial', // pattern: 'initial',
@ -221,16 +231,23 @@ function technicalNew() {
(item) => item.attrType === '使用手册' (item) => item.attrType === '使用手册'
)[0] )[0]
console.log('dataFrom.value.link', obj.attrValue) 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>
<style lang="less" scoped> <style lang="less" scoped>
.usage-mode { .usage-mode {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -243,7 +260,8 @@ function technicalNew() {
.content-left { .content-left {
height: 1.5rem; height: 1.5rem;
width: 6.2rem; width: 6.2rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png') no-repeat; background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png')
no-repeat;
background-position: center; background-position: center;
background-size: 100% 100%; background-size: 100% 100%;
border-radius: 0.1rem; border-radius: 0.1rem;
@ -309,7 +327,8 @@ function technicalNew() {
.content-right { .content-right {
height: 1.5rem; height: 1.5rem;
width: 6.2rem; width: 6.2rem;
background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png') no-repeat; background: url('~@/assets/detailsAll/business/business_usage_mode_bg.png')
no-repeat;
background-position: center; background-position: center;
background-size: 100% 100%; background-size: 100% 100%;
border-radius: 0.1rem; border-radius: 0.1rem;
@ -360,5 +379,5 @@ function technicalNew() {
} }
} }
} }
} }
</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,14 +21,14 @@
</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',
@ -52,15 +57,15 @@ const navList = ref([
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([]) const list = ref([])
// id // id
if (keyId) { if (keyId) {
queryPartAppByKeyId2({ keyId: keyId }).then((res) => { queryPartAppByKeyId2({ keyId: keyId }).then((res) => {
console.log('ressssssss', res) console.log('ressssssss', res)
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
@ -73,14 +78,14 @@ if (keyId) {
list.value.unshift('关联应用') list.value.unshift('关联应用')
} }
}) })
} }
const select = ref('layer-service-associated-ability') const select = ref('layer-service-associated-ability')
const selectNav = (key) => { const selectNav = (key) => {
select.value = key select.value = key
console.log(key, select.value) console.log(key, select.value)
mybus.emit('flyToView', select.value) mybus.emit('flyToView', select.value)
} }
if (props.dataList.infoList) { if (props.dataList.infoList) {
list.value = [] list.value = []
let arr = [ let arr = [
'图层缩略图', '图层缩略图',
@ -144,14 +149,14 @@ if (props.dataList.infoList) {
(item) => item.name === list.value[0] (item) => item.name === list.value[0]
)[0].key )[0].key
console.log('11111111111111111111111111', list.value, navList.value) console.log('11111111111111111111111111', list.value, navList.value)
} }
watch( watch(
() => props.selectNow, () => props.selectNow,
(newValue) => { (newValue) => {
select.value = newValue select.value = newValue
} }
) )
watch( watch(
() => props.dataList, () => props.dataList,
(val) => { (val) => {
if (val) { if (val) {
@ -215,18 +220,17 @@ watch(
item.show = true item.show = true
} }
}) })
if (list.value.length > 0) { if (navList.value.filter((item) => item.name === list.value[0])[0]) {
select.value = navList.value.filter( select.value = navList.value.filter(
(item) => item.name === list.value[0] (item) => item.name === list.value[0]
)[0].key )[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;
@ -259,5 +263,5 @@ watch(
background: #526aff; 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>