数据资源左侧列表

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

View File

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

View File

@ -113,7 +113,7 @@
<script> <script>
import { defineComponent, ref, watch } from 'vue' 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 mybus from '@/myplugins/mybus'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { UpOutlined, DownOutlined } from '@ant-design/icons-vue' import { UpOutlined, DownOutlined } from '@ant-design/icons-vue'
@ -135,28 +135,8 @@
}) })
const showKey = ref(0) const showKey = ref(0)
const treeData = ref([]) const treeData = ref([])
const init = () => { //
treeData.value = [] const processingData = (res) => {
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)
res.data.data.forEach((val) => { res.data.data.forEach((val) => {
if (val.type !== '全部能力目录') { if (val.type !== '全部能力目录') {
let obj = { let obj = {
@ -214,6 +194,41 @@
console.log('左侧树结构数据======================>', treeData.value) console.log('左侧树结构数据======================>', treeData.value)
showKey.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 // children
const generateChildren = (val, obj) => { const generateChildren = (val, obj) => {
if (val.dataList.length > 0) { if (val.dataList.length > 0) {
val.dataList.forEach((child) => { val.dataList.forEach((child) => {
let children = { let children = {
@ -239,7 +253,6 @@
} }
// //
const generateChildren2 = (val, obj) => { const generateChildren2 = (val, obj) => {
if (val.dataList.length > 0) { if (val.dataList.length > 0) {
val.dataList.forEach((dis) => { val.dataList.forEach((dis) => {
let children = { let children = {