数据资源左侧列表

This commit is contained in:
a0049873 2022-12-06 17:48:58 +08:00
parent 7a096d5dc1
commit 1eb4e4f46e
3 changed files with 99 additions and 71 deletions

View File

@ -2,7 +2,7 @@
* @Author: hisense.wuhongjian
* @Date: 2022-04-01 19:19:40
* @LastEditors: Light
* @LastEditTime: 2022-12-01 17:53:16
* @LastEditTime: 2022-12-06 11:43:03
* @Description: 告诉大家这是什么
*/
import request from '@/utils/request'
@ -302,7 +302,7 @@ export function workdynamicsDetails(params) {
params,
})
}
//
//
export function selectDeptList(data) {
return request({
url: '/resource/selectDeptList',
@ -310,7 +310,15 @@ export function selectDeptList(data) {
data,
})
}
//
//
export function getDataResourceDeptList(data) {
return request({
url: '/resource/getDataResourceDeptList',
method: 'post',
data,
})
}
export function updateRes(data) {
return request({
url: '/resource/update',

View File

@ -2,10 +2,17 @@
<!-- 青岛 -->
<div class="details-pageconetent" v-if="whoShow1 && whoShow1.itShowQingDao">
<home-header></home-header>
<div class="details-pageconetent-left" v-if="Cardsname != '基础设施'">
<div
class="details-pageconetent-left"
v-if="
Cardsname === '应用资源' ||
Cardsname === '组件服务' ||
Cardsname === '数据资源'
"
>
<detailsPageconetentTree />
</div>
<div class="details-pageconetent-left" v-else>
<div class="details-pageconetent-left" v-else-if="Cardsname === '基础设施'">
<detailsPageInfrastructureTree v-if="flag == '1'" />
</div>
<div class="top" v-if="Cardsname != '知识库' && Cardsname != '基础设施'">

View File

@ -113,7 +113,7 @@
<script>
import { defineComponent, ref, watch } from 'vue'
import { selectDeptList } from '@/api/home.js'
import { selectDeptList, getDataResourceDeptList } from '@/api/home.js'
import mybus from '@/myplugins/mybus'
import { useRouter } from 'vue-router'
import { UpOutlined, DownOutlined } from '@ant-design/icons-vue'
@ -135,28 +135,8 @@
})
const showKey = ref(0)
const treeData = ref([])
const init = () => {
treeData.value = []
console.log(
'router.currentRoute.value.query.select',
router.currentRoute.value.query.select
)
let select = router.currentRoute.value.query.select
if (select === '123') {
select = ''
}
console.log(
'获取url中的select=====================>',
router.currentRoute.value.query.select
)
if (
select !== '基础设施' &&
select !== '数据资源' &&
select !== '知识库'
) {
selectDeptList({ type: select }).then((res) => {
// console.log('=========================>', res.data.data)
//
const processingData = (res) => {
res.data.data.forEach((val) => {
if (val.type !== '全部能力目录') {
let obj = {
@ -214,6 +194,41 @@
console.log('左侧树结构数据======================>', treeData.value)
showKey.value++
}
const init = () => {
treeData.value = []
console.log(
'router.currentRoute.value.query.select',
router.currentRoute.value.query.select
)
let select = router.currentRoute.value.query.select
if (select === '123') {
select = ''
}
console.log(
'获取url中的select=====================>',
router.currentRoute.value.query.select
)
if (
select !== '基础设施' &&
select !== '数据资源' &&
select !== '知识库'
) {
selectDeptList({ type: select }).then((res) => {
// console.log('=========================>', res.data.data)
if (res.data.msg !== 'success') {
return
}
processingData(res)
})
} else if (select === '数据资源') {
getDataResourceDeptList({ type: select }).then((res) => {
// console.log('=========================>', res.data.data)
if (res.data.msg !== 'success') {
return
}
processingData(res)
})
}
}
@ -222,7 +237,6 @@
})
// children
const generateChildren = (val, obj) => {
if (val.dataList.length > 0) {
val.dataList.forEach((child) => {
let children = {
@ -239,7 +253,6 @@
}
//
const generateChildren2 = (val, obj) => {
if (val.dataList.length > 0) {
val.dataList.forEach((dis) => {
let children = {