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

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>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { message } from 'ant-design-vue'
import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue'
let dataFrom = ref({
@ -184,12 +185,19 @@
let obj = props.dataList.infoList.filter(
(item) => item.attrType === '技术文档'
)[0]
console.log('dataFrom.value.link', obj.attrValue)
// 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>

View File

@ -2,7 +2,10 @@
<!-- 使用方式 -->
<div class="usage-mode" v-if="flag">
<div class="tltle">
<DetalsTitle :title="dataFrom.title" :type="dataFrom.englishTitle"></DetalsTitle>
<DetalsTitle
:title="dataFrom.title"
:type="dataFrom.englishTitle"
></DetalsTitle>
</div>
<div class="content" v-for="item in dataFrom.content" :key="item.title">
<div class="content-left">
@ -84,10 +87,11 @@
</template>
<script setup>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue'
let dataFrom = ref({
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue'
import { message } from 'ant-design-vue'
let dataFrom = ref({
title: '使用方式',
englishTitle: 'USAGE',
content: [
@ -113,13 +117,13 @@ let dataFrom = ref({
},
},
],
})
//
const props = defineProps({
})
//
const props = defineProps({
dataList: { type: Object, default: null },
})
const flag = ref(true)
if (props.dataList.infoList) {
})
const flag = ref(true)
if (props.dataList.infoList) {
let obj = props.dataList.infoList.filter(
(item) =>
item.attrType === '技术文档' ||
@ -151,8 +155,8 @@ if (props.dataList.infoList) {
}
})
}
}
watch(
}
watch(
() => props.dataList,
(val) => {
if (val) {
@ -189,8 +193,8 @@ watch(
}
}
}
)
function technical() {
)
function technical() {
//
// const type = pinyin(props.dataList.type, {
// pattern: 'initial',
@ -202,14 +206,20 @@ function technical() {
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))
)
}
function technicalNew() {
} else {
message.config({
top: '100px', //
})
message.error('暂无上传技术文档')
}
}
function technicalNew() {
//
// const type = pinyin(props.dataList.type, {
// pattern: 'initial',
@ -221,16 +231,23 @@ function technicalNew() {
(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>
<style lang="less" scoped>
.usage-mode {
.usage-mode {
display: flex;
flex-direction: column;
align-items: center;
@ -243,7 +260,8 @@ function technicalNew() {
.content-left {
height: 1.5rem;
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-size: 100% 100%;
border-radius: 0.1rem;
@ -309,7 +327,8 @@ function technicalNew() {
.content-right {
height: 1.5rem;
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-size: 100% 100%;
border-radius: 0.1rem;
@ -360,5 +379,5 @@ function technicalNew() {
}
}
}
}
}
</style>

View File

@ -8,7 +8,12 @@
<template>
<div class="business-navigation" v-if="navList.length > 0">
<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 }}
<span class="line"></span>
</div>
@ -16,14 +21,14 @@
</div>
</template>
<script setup>
import { ref, defineProps, watch, getCurrentInstance } from 'vue'
import { useRouter } from 'vue-router'
import mybus from '@/myplugins/mybus'
import { queryPartAppByKeyId2 } from '@/api/home'
//
const router = useRouter()
const keyId = router.currentRoute.value.query.id
const navList = ref([
import { ref, defineProps, watch, getCurrentInstance } from 'vue'
import { useRouter } from 'vue-router'
import mybus from '@/myplugins/mybus'
import { queryPartAppByKeyId2 } from '@/api/home'
//
const router = useRouter()
const keyId = router.currentRoute.value.query.id
const navList = ref([
{
name: '图层展示',
key: 'service-presentation',
@ -52,15 +57,15 @@ const navList = ref([
name: '常见问题',
key: 'service-common-problem',
},
])
const props = defineProps({
])
const props = defineProps({
selectNow: { type: String, default: '' },
dataList: { type: Object, default: null },
associatedComponents: { type: Array, default: null },
})
const list = ref([])
// id
if (keyId) {
})
const list = ref([])
// id
if (keyId) {
queryPartAppByKeyId2({ keyId: keyId }).then((res) => {
console.log('ressssssss', res)
if (res.data.data.length > 0) {
@ -73,14 +78,14 @@ if (keyId) {
list.value.unshift('关联应用')
}
})
}
const select = ref('layer-service-associated-ability')
const selectNav = (key) => {
}
const select = ref('layer-service-associated-ability')
const selectNav = (key) => {
select.value = key
console.log(key, select.value)
mybus.emit('flyToView', select.value)
}
if (props.dataList.infoList) {
}
if (props.dataList.infoList) {
list.value = []
let arr = [
'图层缩略图',
@ -144,14 +149,14 @@ if (props.dataList.infoList) {
(item) => item.name === list.value[0]
)[0].key
console.log('11111111111111111111111111', list.value, navList.value)
}
watch(
}
watch(
() => props.selectNow,
(newValue) => {
select.value = newValue
}
)
watch(
)
watch(
() => props.dataList,
(val) => {
if (val) {
@ -215,18 +220,17 @@ watch(
item.show = true
}
})
if (list.value.length > 0) {
if (navList.value.filter((item) => item.name === list.value[0])[0]) {
select.value = navList.value.filter(
(item) => item.name === list.value[0]
)[0].key
}
console.log('11111111111111111111111111', list.value, navList.value)
}
}
)
)
</script>
<style lang="less" scoped>
.business-navigation {
.business-navigation {
width: 19.12rem;
height: 0.84rem;
line-height: 0.8rem;
@ -259,5 +263,5 @@ watch(
background: #526aff;
}
}
}
}
</style>

View File

@ -90,6 +90,7 @@
<script setup>
import DetalsTitle from '@/views/detailsAll/components/DetalsTitle'
import { message } from 'ant-design-vue'
import { pinyin } from 'pinyin-pro'
import { ref, defineProps, watch } from 'vue'
let dataFrom = ref({
@ -213,12 +214,18 @@
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('暂无上传技术文档')
}
}
function technicalNew() {
//
@ -231,12 +238,18 @@
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>