bug修改

This commit is contained in:
gaoyuanwei 2022-07-16 15:25:49 +08:00
parent 4568d28b6a
commit c9cda03deb
9 changed files with 552 additions and 465 deletions

View File

@ -72,16 +72,17 @@ export default {
}) })
}, },
getInfo (id) { getInfo (id) {
this.$http.get('/resourceMountApply/' + id).then(({ data: res }) => { this.$http.get('/demandComment/' + id).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.dataForm = res.data.resourceDTO this.dataForm = res.data
if (this.dataForm.type != '应用资源') { // this.dataForm = res.data.resourceDTO
this.shifoushizujian = false // if (this.dataForm.type != '') {
} else { // this.shifoushizujian = false
this.shifoushizujian = true // } else {
} // this.shifoushizujian = true
// }
console.log('this.dataForm', this.dataForm) console.log('this.dataForm', this.dataForm)
}) })
} }

View File

@ -110,9 +110,24 @@
:pagination="false" :pagination="false"
> >
<template #bodyCell="{ column, text }"> <template #bodyCell="{ column, text }">
<template v-if="column.dataIndex !== 'name'"> <template
v-if="
column.dataIndex !== 'name' &&
(column.title === '组件服务' || column.title === '应用资源')
"
>
{{ text || 0 }} {{ text || 0 }}
</template> </template>
<template
v-else-if="
column.dataIndex !== 'name' &&
(column.title === '知识库' ||
column.title === '基础设施' ||
column.title === '数据资源')
"
>
--
</template>
</template> </template>
</a-table> </a-table>
</div> </div>

View File

@ -598,22 +598,47 @@
const mockData = ref([]) const mockData = ref([])
const titles = ref(['未关联的应用名称', '已关联的应用名称']) const titles = ref(['未关联的应用名称', '已关联的应用名称'])
const titleName = ref('关联应用') const titleName = ref('关联应用')
const targetKeys = ref([])
//
const targetKeysBack = ref([])
const sourceClick = () => { const sourceClick = () => {
mockData.value = [] mockData.value = []
visibleAssociatedApplication.value = true visibleAssociatedApplication.value = true
queryApplicationRelByResourceId({ props.dataFrom.infoList.forEach((val) => {
referenceId: 0, if (val.attrType === '来源应用' && val.attrValue != '') {
}).then((res) => { queryApplicationRelByResourceId({
// console.log(res.data.data.notLinked) referenceId: 0,
res.data.data.notLinked.forEach((val, index) => { }).then((res) => {
// console.log(val, index) // console.log(res.data.data.notLinked)
mockData.value.push({ res.data.data.notLinked.forEach((val, index) => {
key: val.id, mockData.value.push({
title: val.name, key: val.id,
description: val.id, title: val.name,
description: val.id,
})
})
}) })
}) targetKeys.value = []
val.attrValue.split(',').forEach((item) => {
targetKeys.value.push(item)
})
console.log(targetKeys.value)
// console.log('wowowo')
} else if (val.attrType === '来源应用' && val.attrValue == '') {
queryApplicationRelByResourceId({
referenceId: 0,
}).then((res) => {
// console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => {
mockData.value.push({
key: val.id,
title: val.name,
description: val.id,
})
})
})
}
}) })
} }
// //
@ -622,23 +647,46 @@
titleName.value = '关联组件' titleName.value = '关联组件'
mockData.value = [] mockData.value = []
visibleAssociatedApplication.value = true visibleAssociatedApplication.value = true
queryResourceRelByKeyId({ props.dataFrom.infoList.forEach((val) => {
keyId: 0, if (val.attrType === '关联组件信息' && val.attrValue != '') {
type: '组件服务', queryResourceRelByKeyId({
referenceName: '', keyId: 0,
}).then((res) => { type: '组件服务',
// console.log(res.data.data.notLinked) referenceName: '',
res.data.data.notLinked.forEach((val, index) => { }).then((res) => {
// console.log(val, index) // console.log(res.data.data.notLinked)
mockData.value.push({ res.data.data.notLinked.forEach((val, index) => {
key: val.id, mockData.value.push({
title: val.name, key: val.id,
description: val.id, title: val.name,
description: val.id,
})
})
}) })
}) targetKeys.value = []
val.attrValue.split(',').forEach((item) => {
targetKeys.value.push(item)
})
console.log(targetKeys.value)
// console.log('wowowo')
} else if (val.attrType === '关联组件信息' && val.attrValue == '') {
queryResourceRelByKeyId({
keyId: 0,
type: '组件服务',
referenceName: '',
}).then((res) => {
// console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => {
mockData.value.push({
key: val.id,
title: val.name,
description: val.id,
})
})
})
}
}) })
} }
const targetKeys = ref([])
const selectedKeys = ref([]) const selectedKeys = ref([])
const handleChange = (nextTargetKeys, direction, moveKeys) => { const handleChange = (nextTargetKeys, direction, moveKeys) => {
@ -648,7 +696,7 @@
} }
const handleSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { const handleSelectChange = (sourceSelectedKeys, targetSelectedKeys) => {
console.log('targetSelectedKeys: ', targetSelectedKeys) console.log('targetSelectedKeys: ', targetSelectedKeys, sourceSelectedKeys)
} }
const handleOk = (e) => { const handleOk = (e) => {
@ -724,253 +772,253 @@
</script> </script>
<style></style> <style></style>
<style lang="less" scoped> <style lang="less" scoped>
.put-on-the-shelf { .put-on-the-shelf {
height: 680px; height: 680px;
overflow: scroll; overflow: scroll;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding: 50px 100px 25px; padding: 50px 100px 25px;
.Technical-text { .Technical-text {
height: 30px; height: 30px;
width: 100px; width: 100px;
border: 1px solid #bbd3ef; border: 1px solid #bbd3ef;
border-radius: 6px; border-radius: 6px;
background: #edf4fc; background: #edf4fc;
color: #0087ff; color: #0087ff;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
} }
.Technical-text:hover { .Technical-text:hover {
cursor: pointer; cursor: pointer;
}
& > div {
width: 100%;
margin-top: 60px;
.top {
color: #333333;
font-size: 22px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 25px;
div:first-child,
div:last-child {
width: 245px;
height: 1px;
background: #f0f0f0;
}
div:nth-child(2) {
margin: 0 30px;
}
} }
.bottom { & > div {
margin-top: 25px; width: 100%;
margin-top: 60px;
.items { .top {
background: #fafafa; color: #333333;
padding: 10px; font-size: 22px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 25px;
p { div:first-child,
div:last-child {
width: 245px;
height: 1px;
background: #f0f0f0;
}
div:nth-child(2) {
margin: 0 30px;
}
}
.bottom {
margin-top: 25px;
.items {
background: #fafafa;
padding: 10px;
p {
display: flex;
justify-content: space-between;
span:nth-of-type(1) {
width: 200px;
}
span:nth-of-type(2) {
width: 100%;
font-weight: 600;
}
}
p:nth-of-type(1) > span:nth-of-type(1) {
font-size: 18px;
font-weight: 600;
}
.del {
display: flex;
justify-content: flex-end;
align-items: center;
.delImg {
cursor: pointer;
display: inline-block;
width: 16px;
height: 18px;
background: url(~@/assets/home/sf_del.png) no-repeat;
margin-right: 5px;
}
div {
cursor: pointer;
}
}
}
.add {
margin-top: 10px;
font-size: 16px;
color: #007efb;
}
.form {
margin-top: 20px;
display: flex; display: flex;
justify-content: space-between; justify-content: flex-start;
align-items: center;
span:nth-of-type(1) { span:first-child {
width: 120px;
}
:deep(.ant-input-textarea) {
width: 520px;
}
:deep(.ant-radio-group) {
width: 520px;
}
:deep(.ant-input-number) {
width: 200px; width: 200px;
} }
span:nth-of-type(2) { :deep(.ant-input) {
width: 100%; resize: none;
font-weight: 600; width: 520px;
}
.ant-btn {
width: 160px;
height: 32px;
text-align: center;
background: #edf4fc;
color: #0087ff;
border: 1px solid #bbd3ef;
border-radius: 6px;
} }
} }
p:nth-of-type(1) > span:nth-of-type(1) { .submit {
font-size: 18px; margin-top: 40px;
font-weight: 600;
}
.del {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center;
.delImg { .ant-btn {
cursor: pointer; width: 80px;
display: inline-block; height: 28px;
width: 16px; text-align: center;
height: 18px; background: #d9ebff;
background: url(~@/assets/home/sf_del.png) no-repeat; color: #0087ff;
margin-right: 5px; border: 1px solid #0087ff;
border-radius: 6px;
} }
div {
cursor: pointer;
}
}
}
.add {
margin-top: 10px;
font-size: 16px;
color: #007efb;
}
.form {
margin-top: 20px;
display: flex;
justify-content: flex-start;
align-items: center;
span:first-child {
width: 120px;
}
:deep(.ant-input-textarea) {
width: 520px;
}
:deep(.ant-radio-group) {
width: 520px;
}
:deep(.ant-input-number) {
width: 200px;
}
:deep(.ant-input) {
resize: none;
width: 520px;
}
.ant-btn {
width: 160px;
height: 32px;
text-align: center;
background: #edf4fc;
color: #0087ff;
border: 1px solid #bbd3ef;
border-radius: 6px;
}
}
.submit {
margin-top: 40px;
display: flex;
justify-content: flex-end;
.ant-btn {
width: 80px;
height: 28px;
text-align: center;
background: #d9ebff;
color: #0087ff;
border: 1px solid #0087ff;
border-radius: 6px;
} }
} }
} }
& > div:nth-of-type(1) {
margin-top: 0;
}
} }
& > div:nth-of-type(1) { .application-Area {
margin-top: 0; width: 520px;
display: grid;
margin-top: -5px;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
.application-Area-son {
cursor: pointer;
font-size: 14px;
width: 90px;
height: 26px;
border-radius: 13px;
color: #333333;
background: #f5f5f5;
border: 1px #cccccc solid;
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px;
font-weight: 500;
}
.application-Area-down {
background: #0087ff;
color: #fff;
}
} }
}
.application-Area { :deep(.ant-image-img) {
width: 520px; width: 100%;
display: grid; height: 100%;
margin-top: -5px; object-fit: contain;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; }
.application-Area-son { :deep(.ant-modal) {
cursor: pointer; width: 960px;
font-size: 14px; }
width: 90px;
height: 26px; :deep(.ant-transfer-list) {
border-radius: 13px; width: 39.5%;
color: #333333; height: 520px;
background: #f5f5f5; }
border: 1px #cccccc solid;
:deep(.ant-transfer-operation) {
flex-direction: row-reverse;
margin: 0 30px;
}
:deep(.ant-btn) {
width: 56px;
height: 40px;
border-radius: 4px;
}
:deep(.ant-btn:first-child) {
margin-left: 4px;
}
:deep(.ant-modal-footer) {
border: 0;
}
:deep(.ant-modal-header) {
border: 0;
}
:deep(.ant-modal-title) {
line-height: 24px;
font-size: 18px;
color: #303133;
}
:deep(.ant-transfer-list-header) {
background: #f5f7fa;
}
:deep(.ant-transfer-list-header-selected) {
display: flex; display: flex;
justify-content: center; width: 90%;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center; align-items: center;
margin-top: 10px;
font-weight: 500;
} }
.application-Area-down { :deep(.ant-transfer-list-header-title) {
background: #0087ff; font-size: 16px;
color: #fff; color: #303133;
font-weight: 400;
text-align: left;
} }
}
:deep(.ant-image-img) {
width: 100%;
height: 100%;
object-fit: contain;
}
:deep(.ant-modal) {
width: 960px;
}
:deep(.ant-transfer-list) {
width: 39.5%;
height: 520px;
}
:deep(.ant-transfer-operation) {
flex-direction: row-reverse;
margin: 0 30px;
}
:deep(.ant-btn) {
width: 56px;
height: 40px;
border-radius: 4px;
}
:deep(.ant-btn:first-child) {
margin-left: 4px;
}
:deep(.ant-modal-footer) {
border: 0;
}
:deep(.ant-modal-header) {
border: 0;
}
:deep(.ant-modal-title) {
line-height: 24px;
font-size: 18px;
color: #303133;
}
:deep(.ant-transfer-list-header) {
background: #f5f7fa;
}
:deep(.ant-transfer-list-header-selected) {
display: flex;
width: 90%;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center;
}
:deep(.ant-transfer-list-header-title) {
font-size: 16px;
color: #303133;
font-weight: 400;
text-align: left;
}
</style> </style>

View File

@ -126,10 +126,12 @@
'props.dataList.infoList==============>', 'props.dataList.infoList==============>',
navList.value.filter((item) => item.name === list.value[0]) navList.value.filter((item) => item.name === list.value[0])
) )
if (navList.value.filter((item) => item.name === list.value[0])[0]) { if (list.value.length > 0) {
select.value = navList.value.filter( if (navList.value.filter((item) => item.name === list.value[0])[0]) {
(item) => (item.name === '关联应用') | (item.name === list.value[0]) select.value = navList.value.filter(
)[0].key (item) => (item.name === '关联应用') | (item.name === list.value[0])
)[0].key
}
} }
console.log('11111111111111111111111111', list.value, navList.value) console.log('11111111111111111111111111', list.value, navList.value)
} }

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,217 +21,216 @@
</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: 'business-presentation', key: 'business-presentation',
}, },
{ {
name: '功能介绍', name: '功能介绍',
key: 'function-introduction', key: 'function-introduction',
}, },
{ {
name: '应用场景', name: '应用场景',
key: 'application-scenarios', key: 'application-scenarios',
}, },
{ {
name: '应用案例', name: '应用案例',
key: 'application-case', key: 'application-case',
}, },
{ {
name: '使用方式', name: '使用方式',
key: 'business-usage-mode', key: 'business-usage-mode',
}, },
{ {
name: '常见问题', name: '常见问题',
key: 'common-problem', key: 'common-problem',
}, },
]) ])
const props = defineProps({ const props = defineProps({
associatedComponents: { type: Array, default: null }, associatedComponents: { type: Array, default: null },
selectNow: { type: String, default: '' }, selectNow: { type: String, default: '' },
dataList: { type: Object, default: null }, dataList: { type: Object, default: null },
})
const select = ref('business-associated-ability')
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: 'business-associated-ability',
show: true,
})
// list.value.push('')
console.log('navList', navList)
}
}) })
} const select = ref('business-associated-ability')
const selectNav = (key) => { const list = ref([])
select.value = key // id
console.log(key, select.value) if (keyId) {
mybus.emit('flyToView', select.value) queryPartAppByKeyId2({ keyId: keyId }).then((res) => {
} console.log('ressssssss', res)
if (props.dataList.infoList) { if (res.data.data.length > 0) {
list.value = [] //
let arr = [ navList.value.unshift({
'关联应用', name: '关联应用',
'组件视频介绍', key: 'business-associated-ability',
'功能介绍', show: true,
'应用场景', })
'应用案例', // list.value.push('')
'使用方式', console.log('navList', navList)
'常见问题',
]
//
// 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 === '应用场景' ||
item.attrType === '应用案例'
) {
list.value.push(item.attrType)
} else if (item.attrType === '组件视频介绍') {
list.value.push('组件展示')
}
})
list.value.unshift('关联应用')
list.value.push('使用方式')
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
if (item.name == '关联应用') {
if (props.associatedComponents[0].dataList.length != 0) {
item.show = true
}
} else {
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 === '关联应用') | (item.name === list.value[0])
)[0].key
}
} }
console.log('11111111111111111111111111', list.value, navList.value) const selectNav = (key) => {
} select.value = key
watch( mybus.emit('flyToView', select.value)
() => props.selectNow,
(newValue) => {
select.value = newValue
} }
) if (props.dataList.infoList) {
watch( list.value = []
() => props.dataList, let arr = [
(val) => { '关联应用',
if (val) { '组件视频介绍',
list.value = [] '功能介绍',
let arr = [ '应用场景',
'关联应用', '应用案例',
'组件视频介绍', '使用方式',
'功能介绍', '常见问题',
'应用场景', ]
'应用案例', //
'使用方式', // eslint-disable-next-line vue/no-mutating-props
'常见问题', props.dataList.infoList.sort((a, b) => {
] return arr.indexOf(a.attrType) - arr.indexOf(b.attrType)
// })
// eslint-disable-next-line vue/no-mutating-props props.dataList.infoList.map((item) => {
props.dataList.infoList.sort((a, b) => { if (
// console.log('==============>', a, b) item.attrType === '常见问题' ||
return arr.indexOf(a.attrType) - arr.indexOf(b.attrType) item.attrType === '功能介绍' ||
}) item.attrType === '应用场景' ||
val.infoList.map((item) => { item.attrType === '应用案例'
if ( ) {
item.attrType === '常见问题' || list.value.push(item.attrType)
item.attrType === '功能介绍' || } else if (item.attrType === '组件视频介绍') {
item.attrType === '应用场景' || list.value.push('组件展示')
item.attrType === '应用案例' }
) { })
list.value.push(item.attrType) list.value.unshift('关联应用')
} else if (item.attrType === '组件视频介绍') { list.value.push('使用方式')
list.value.push('组件展示') navList.value.forEach((item) => {
} console.log(item)
}) if (list.value.indexOf(item.name) > -1) {
list.value.unshift('关联应用') if (item.name == '关联应用') {
list.value.push('使用方式') if (props.associatedComponents[0].dataList.length != 0) {
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
if (item.name == '关联应用') {
if (props.associatedComponents[0].dataList.length != 0) {
item.show = true
}
} else {
item.show = true item.show = true
} }
} } else {
}) 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 === '关联应用') | (item.name === list.value[0])
)[0].key
} }
} }
console.log('11111111111111111111111111', list.value, navList.value) })
if (list.value.length > 0) {
if (navList.value.filter((item) => item.name === list.value[0])[0]) {
select.value = navList.value.filter(
(item) => (item.name === '关联应用') | (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 === '应用场景' ||
item.attrType === '应用案例'
) {
list.value.push(item.attrType)
} else if (item.attrType === '组件视频介绍') {
list.value.push('组件展示')
}
})
list.value.unshift('关联应用')
list.value.push('使用方式')
navList.value.forEach((item) => {
console.log(item)
if (list.value.indexOf(item.name) > -1) {
if (item.name == '关联应用') {
if (props.associatedComponents[0].dataList.length != 0) {
item.show = true
}
} else {
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 === '关联应用') | (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

@ -164,6 +164,9 @@
businessArea.value = props.dataList.infoList.filter( businessArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域' (val) => val.attrType === '应用领域'
)[0].attrValue )[0].attrValue
let obj = props.dataList.infoList.filter(
(val) => val.attrType === '组件类型'
)[0]
if ( if (
props.dataList.infoList.filter((val) => val.attrType === '部署位置')[0] props.dataList.infoList.filter((val) => val.attrType === '部署位置')[0]
) { ) {

View File

@ -96,6 +96,8 @@
list.value.push(item.attrType) list.value.push(item.attrType)
} else if (item.attrType === '组件视频介绍') { } else if (item.attrType === '组件视频介绍') {
list.value.push('组件展示') list.value.push('组件展示')
} else if (item.attrType === '是否支持试用' && item.attrValue === '是') {
list.value.push('组件试用')
} }
}) })
list.value.unshift('关联应用') list.value.unshift('关联应用')
@ -111,9 +113,12 @@
// } // }
} }
}) })
select.value = navList.value.filter( if (navList.value.filter((item) => item.name === list.value[0])[0]) {
(item) => item.name === list.value[0] select.value = navList.value.filter(
)[0].key (item) => (item.name === '关联应用') | (item.name === list.value[0])
// (item) => item.name === list.value[0]
)[0].key
}
console.log('11111111111111111111111111', list.value, navList.value) console.log('11111111111111111111111111', list.value, navList.value)
} }
watch( watch(
@ -137,10 +142,15 @@
list.value.push(item.attrType) list.value.push(item.attrType)
} else if (item.attrType === '组件视频介绍') { } else if (item.attrType === '组件视频介绍') {
list.value.push('组件展示') list.value.push('组件展示')
} else if (
item.attrType === '是否支持试用' &&
item.attrValue === '是'
) {
list.value.push('组件试用')
} }
}) })
list.value.unshift('关联应用') list.value.unshift('关联应用')
list.value.push('组件试用') // list.value.push('')
list.value.push('使用方式') list.value.push('使用方式')
navList.value.forEach((item) => { navList.value.forEach((item) => {
console.log(item) console.log(item)

View File

@ -49,7 +49,7 @@
}) })
if (props.dataList.infoList) { if (props.dataList.infoList) {
let obj = props.dataList.infoList.filter( let obj = props.dataList.infoList.filter(
(item) => item.attrType === '试用地址' (item) => item.attrType === '是否支持试用' && item.attrValue === '是'
)[0] )[0]
if (!obj) { if (!obj) {
flag.value = false flag.value = false
@ -94,7 +94,9 @@
() => props.dataList, () => props.dataList,
(val) => { (val) => {
if (val) { if (val) {
let obj = val.infoList.filter((item) => item.attrType === '试用地址')[0] let obj = val.infoList.filter(
(item) => item.attrType === '是否支持试用' && item.attrValue === '是'
)[0]
if (!obj) { if (!obj) {
flag.value = false flag.value = false
} else { } else {

View File

@ -82,7 +82,6 @@
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)
mybus.emit('flyToView', select.value) mybus.emit('flyToView', select.value)
} }
if (props.dataList.infoList) { if (props.dataList.infoList) {
@ -145,9 +144,12 @@
item.show = true item.show = true
} }
}) })
select.value = navList.value.filter( if (navList.value.filter((item) => item.name === list.value[0])[0]) {
(item) => item.name === list.value[0] select.value = navList.value.filter(
)[0].key (item) => (item.name === '关联应用') | (item.name === list.value[0])
// (item) => item.name === list.value[0]
)[0].key
}
console.log('11111111111111111111111111', list.value, navList.value) console.log('11111111111111111111111111', list.value, navList.value)
} }
watch( watch(