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) {
this.$http.get('/resourceMountApply/' + id).then(({ data: res }) => {
this.$http.get('/demandComment/' + id).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = res.data.resourceDTO
if (this.dataForm.type != '应用资源') {
this.shifoushizujian = false
} else {
this.shifoushizujian = true
}
this.dataForm = res.data
// this.dataForm = res.data.resourceDTO
// if (this.dataForm.type != '') {
// this.shifoushizujian = false
// } else {
// this.shifoushizujian = true
// }
console.log('this.dataForm', this.dataForm)
})
}

View File

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

View File

@ -598,16 +598,20 @@
const mockData = ref([])
const titles = ref(['未关联的应用名称', '已关联的应用名称'])
const titleName = ref('关联应用')
const targetKeys = ref([])
//
const targetKeysBack = ref([])
const sourceClick = () => {
mockData.value = []
visibleAssociatedApplication.value = true
props.dataFrom.infoList.forEach((val) => {
if (val.attrType === '来源应用' && val.attrValue != '') {
queryApplicationRelByResourceId({
referenceId: 0,
}).then((res) => {
// console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => {
// console.log(val, index)
mockData.value.push({
key: val.id,
title: val.name,
@ -615,6 +619,27 @@
})
})
})
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,
})
})
})
}
})
}
//
const componentsClick = () => {
@ -622,6 +647,29 @@
titleName.value = '关联组件'
mockData.value = []
visibleAssociatedApplication.value = true
props.dataFrom.infoList.forEach((val) => {
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,
})
})
})
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: '组件服务',
@ -629,7 +677,6 @@
}).then((res) => {
// console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => {
// console.log(val, index)
mockData.value.push({
key: val.id,
title: val.name,
@ -638,7 +685,8 @@
})
})
}
const targetKeys = ref([])
})
}
const selectedKeys = ref([])
const handleChange = (nextTargetKeys, direction, moveKeys) => {
@ -648,7 +696,7 @@
}
const handleSelectChange = (sourceSelectedKeys, targetSelectedKeys) => {
console.log('targetSelectedKeys: ', targetSelectedKeys)
console.log('targetSelectedKeys: ', targetSelectedKeys, sourceSelectedKeys)
}
const handleOk = (e) => {
@ -724,7 +772,7 @@
</script>
<style></style>
<style lang="less" scoped>
.put-on-the-shelf {
.put-on-the-shelf {
height: 680px;
overflow: scroll;
display: flex;
@ -881,9 +929,9 @@
& > div:nth-of-type(1) {
margin-top: 0;
}
}
}
.application-Area {
.application-Area {
width: 520px;
display: grid;
margin-top: -5px;
@ -909,68 +957,68 @@
background: #0087ff;
color: #fff;
}
}
}
:deep(.ant-image-img) {
:deep(.ant-image-img) {
width: 100%;
height: 100%;
object-fit: contain;
}
}
:deep(.ant-modal) {
:deep(.ant-modal) {
width: 960px;
}
}
:deep(.ant-transfer-list) {
:deep(.ant-transfer-list) {
width: 39.5%;
height: 520px;
}
}
:deep(.ant-transfer-operation) {
:deep(.ant-transfer-operation) {
flex-direction: row-reverse;
margin: 0 30px;
}
}
:deep(.ant-btn) {
:deep(.ant-btn) {
width: 56px;
height: 40px;
border-radius: 4px;
}
}
:deep(.ant-btn:first-child) {
:deep(.ant-btn:first-child) {
margin-left: 4px;
}
}
:deep(.ant-modal-footer) {
:deep(.ant-modal-footer) {
border: 0;
}
}
:deep(.ant-modal-header) {
:deep(.ant-modal-header) {
border: 0;
}
}
:deep(.ant-modal-title) {
:deep(.ant-modal-title) {
line-height: 24px;
font-size: 18px;
color: #303133;
}
}
:deep(.ant-transfer-list-header) {
:deep(.ant-transfer-list-header) {
background: #f5f7fa;
}
}
:deep(.ant-transfer-list-header-selected) {
: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) {
:deep(.ant-transfer-list-header-title) {
font-size: 16px;
color: #303133;
font-weight: 400;
text-align: left;
}
}
</style>

View File

@ -126,11 +126,13 @@
'props.dataList.infoList==============>',
navList.value.filter((item) => item.name === list.value[0])
)
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(

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: 'business-presentation',
@ -49,16 +54,16 @@ const navList = ref([
name: '常见问题',
key: 'common-problem',
},
])
const props = defineProps({
])
const props = defineProps({
associatedComponents: { type: Array, default: null },
selectNow: { type: String, default: '' },
dataList: { type: Object, default: null },
})
const select = ref('business-associated-ability')
const list = ref([])
// id
if (keyId) {
})
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) {
@ -72,13 +77,12 @@ if (keyId) {
console.log('navList', navList)
}
})
}
const selectNav = (key) => {
}
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 = [
'关联应用',
@ -128,14 +132,14 @@ if (props.dataList.infoList) {
}
}
console.log('11111111111111111111111111', list.value, navList.value)
}
watch(
}
watch(
() => props.selectNow,
(newValue) => {
select.value = newValue
}
)
watch(
)
watch(
() => props.dataList,
(val) => {
if (val) {
@ -192,10 +196,10 @@ watch(
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;
@ -228,5 +232,5 @@ watch(
background: #526aff;
}
}
}
}
</style>

View File

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

View File

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

View File

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

View File

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