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,16 +598,20 @@
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
props.dataFrom.infoList.forEach((val) => {
if (val.attrType === '来源应用' && val.attrValue != '') {
queryApplicationRelByResourceId({ queryApplicationRelByResourceId({
referenceId: 0, referenceId: 0,
}).then((res) => { }).then((res) => {
// console.log(res.data.data.notLinked) // console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => { res.data.data.notLinked.forEach((val, index) => {
// console.log(val, index)
mockData.value.push({ mockData.value.push({
key: val.id, key: val.id,
title: val.name, 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 = () => { const componentsClick = () => {
@ -622,6 +647,29 @@
titleName.value = '关联组件' titleName.value = '关联组件'
mockData.value = [] mockData.value = []
visibleAssociatedApplication.value = true 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({ queryResourceRelByKeyId({
keyId: 0, keyId: 0,
type: '组件服务', type: '组件服务',
@ -629,7 +677,6 @@
}).then((res) => { }).then((res) => {
// console.log(res.data.data.notLinked) // console.log(res.data.data.notLinked)
res.data.data.notLinked.forEach((val, index) => { res.data.data.notLinked.forEach((val, index) => {
// console.log(val, index)
mockData.value.push({ mockData.value.push({
key: val.id, key: val.id,
title: val.name, title: val.name,
@ -638,7 +685,8 @@
}) })
}) })
} }
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,7 +772,7 @@
</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;
@ -881,9 +929,9 @@
& > div:nth-of-type(1) { & > div:nth-of-type(1) {
margin-top: 0; margin-top: 0;
} }
} }
.application-Area { .application-Area {
width: 520px; width: 520px;
display: grid; display: grid;
margin-top: -5px; margin-top: -5px;
@ -909,68 +957,68 @@
background: #0087ff; background: #0087ff;
color: #fff; color: #fff;
} }
} }
:deep(.ant-image-img) { :deep(.ant-image-img) {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
} }
:deep(.ant-modal) { :deep(.ant-modal) {
width: 960px; width: 960px;
} }
:deep(.ant-transfer-list) { :deep(.ant-transfer-list) {
width: 39.5%; width: 39.5%;
height: 520px; height: 520px;
} }
:deep(.ant-transfer-operation) { :deep(.ant-transfer-operation) {
flex-direction: row-reverse; flex-direction: row-reverse;
margin: 0 30px; margin: 0 30px;
} }
:deep(.ant-btn) { :deep(.ant-btn) {
width: 56px; width: 56px;
height: 40px; height: 40px;
border-radius: 4px; border-radius: 4px;
} }
:deep(.ant-btn:first-child) { :deep(.ant-btn:first-child) {
margin-left: 4px; margin-left: 4px;
} }
:deep(.ant-modal-footer) { :deep(.ant-modal-footer) {
border: 0; border: 0;
} }
:deep(.ant-modal-header) { :deep(.ant-modal-header) {
border: 0; border: 0;
} }
:deep(.ant-modal-title) { :deep(.ant-modal-title) {
line-height: 24px; line-height: 24px;
font-size: 18px; font-size: 18px;
color: #303133; color: #303133;
} }
:deep(.ant-transfer-list-header) { :deep(.ant-transfer-list-header) {
background: #f5f7fa; background: #f5f7fa;
} }
:deep(.ant-transfer-list-header-selected) { :deep(.ant-transfer-list-header-selected) {
display: flex; display: flex;
width: 90%; width: 90%;
flex-direction: row-reverse; flex-direction: row-reverse;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
:deep(.ant-transfer-list-header-title) { :deep(.ant-transfer-list-header-title) {
font-size: 16px; font-size: 16px;
color: #303133; color: #303133;
font-weight: 400; font-weight: 400;
text-align: left; text-align: left;
} }
</style> </style>

View File

@ -126,11 +126,13 @@
'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 (list.value.length > 0) {
if (navList.value.filter((item) => item.name === list.value[0])[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 === '关联应用') | (item.name === list.value[0]) (item) => (item.name === '关联应用') | (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(

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: 'business-presentation', key: 'business-presentation',
@ -49,16 +54,16 @@ const navList = ref([
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 select = ref('business-associated-ability')
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) {
@ -72,13 +77,12 @@ if (keyId) {
console.log('navList', navList) console.log('navList', navList)
} }
}) })
} }
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) {
list.value = [] list.value = []
let arr = [ let arr = [
'关联应用', '关联应用',
@ -128,14 +132,14 @@ if (props.dataList.infoList) {
} }
} }
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) {
@ -192,10 +196,10 @@ watch(
console.log('11111111111111111111111111', list.value, navList.value) 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;
@ -228,5 +232,5 @@ watch(
background: #526aff; 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 @@
// } // }
} }
}) })
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 === '关联应用') | (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(
@ -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
} }
}) })
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 === '关联应用') | (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(