mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: 数据集管理
This commit is contained in:
parent
d9cc20bdd3
commit
98681964d7
|
|
@ -14,7 +14,6 @@ import { useRoute } from 'vue-router'
|
|||
|
||||
const route = useRoute()
|
||||
const cachedViews: any = ref([])
|
||||
|
||||
onBeforeUpdate(() => {
|
||||
let isCached = route.meta?.cache
|
||||
let name = route.name
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ defineProps<{
|
|||
padding: 13px 12px 13px 16px !important;
|
||||
font-weight: 500;
|
||||
border-radius: 4px;
|
||||
&:hover {
|
||||
background: none;
|
||||
color: var(--el-menu-active-color);
|
||||
}
|
||||
}
|
||||
|
||||
.el-menu-item.is-active {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div class="sidebar">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-menu :default-active="activeMenu">
|
||||
<el-menu :default-active="activeMenu" router>
|
||||
<sidebar-item
|
||||
:menu="menu"
|
||||
v-hasPermission="menu.meta?.permission"
|
||||
v-for="(menu, index) in subMenuList"
|
||||
:key="index"
|
||||
:menu="menu"
|
||||
>
|
||||
</sidebar-item>
|
||||
</el-menu>
|
||||
|
|
@ -21,16 +21,14 @@ import { getChildRouteListByPathAndName } from '@/router/index'
|
|||
import SidebarItem from './SidebarItem.vue'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const subMenuList = computed(() => {
|
||||
return getChildRouteListByPathAndName(route.path, route.name)
|
||||
return getChildRouteListByPathAndName(route.meta.parentPath, route.meta.parentName)
|
||||
})
|
||||
|
||||
const activeMenu = computed(() => {
|
||||
const { meta, path } = route
|
||||
if (meta.activeMenu) {
|
||||
return meta.activeMenu
|
||||
}
|
||||
return path
|
||||
const { path, meta } = route
|
||||
return meta.active || path
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ router.beforeEach(
|
|||
}
|
||||
)
|
||||
|
||||
export const getChildRouteListByPathAndName = (path: string, name?: RouteRecordName | null | undefined) => {
|
||||
export const getChildRouteListByPathAndName = (path: any, name?: RouteRecordName | any) => {
|
||||
return getChildRouteList(routes, path, name)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,24 +18,35 @@ const datasetRouter = {
|
|||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/dataset/doc',
|
||||
name: 'DatasetDoc',
|
||||
meta: { icon: 'House', title: '文档', activeMenu: '/dataset' },
|
||||
path: '/dataset/:id',
|
||||
name: 'DatasetDetail',
|
||||
meta: { title: '文档', activeMenu: '/dataset' },
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: '/dataset/doc',
|
||||
children: [
|
||||
{
|
||||
path: '/dataset/doc',
|
||||
path: 'doc',
|
||||
name: 'DatasetDoc',
|
||||
meta: { icon: 'House', title: '文档' },
|
||||
meta: {
|
||||
icon: 'Document',
|
||||
title: '文档',
|
||||
active: 'doc',
|
||||
parentPath: '/dataset/:id',
|
||||
parentName: 'DatasetDetail'
|
||||
},
|
||||
component: () => import('@/views/dataset/DatasetDoc.vue')
|
||||
},
|
||||
{
|
||||
path: '/dataset/doc',
|
||||
name: 'DatasetDoc',
|
||||
meta: { icon: 'House', title: '设置' },
|
||||
component: () => import('@/views/dataset/DatasetDoc.vue')
|
||||
path: 'setting',
|
||||
name: 'DatasetSetting',
|
||||
meta: {
|
||||
icon: 'Setting',
|
||||
title: '设置',
|
||||
active: 'setting',
|
||||
parentPath: '/dataset/:id',
|
||||
parentName: 'DatasetDetail'
|
||||
},
|
||||
component: () => import('@/views/dataset/DatasetSetting.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,12 @@ const settingRouter = {
|
|||
{
|
||||
path: '/setting',
|
||||
name: 'setting',
|
||||
meta: { icon: 'app-team', title: '团队管理' },
|
||||
meta: {
|
||||
icon: 'app-team',
|
||||
title: '团队管理',
|
||||
parentPath: '/setting',
|
||||
parentName: 'setting'
|
||||
},
|
||||
component: () => import('@/views/setting/index.vue')
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
<template>
|
||||
<div>dataset 文档</div>
|
||||
<LayoutContainer header="文档">
|
||||
<div class="main-calc-height">
|
||||
<div class="p-24">
|
||||
1111
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</LayoutContainer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<template>
|
||||
<LayoutContainer header="设置">
|
||||
<div class="main-calc-height">
|
||||
<div class="p-24">
|
||||
<BaseForm />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</LayoutContainer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import BaseForm from '@/views/dataset/component/BaseForm.vue'
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
@ -28,7 +28,12 @@
|
|||
:key="index"
|
||||
class="mt-8"
|
||||
>
|
||||
<CardBox :title="item.name" :description="item.desc" class="cursor">
|
||||
<CardBox
|
||||
:title="item.name"
|
||||
:description="item.desc"
|
||||
class="cursor"
|
||||
@click="router.push({ path: `/dataset/${item.id}/doc` })"
|
||||
>
|
||||
<template #mouseEnter>
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<el-button text @click.stop="deleteDateset(item)" class="delete-button">
|
||||
|
|
@ -59,7 +64,7 @@ import datasetApi from '@/api/dataset'
|
|||
import type { datasetListRequest } from '@/api/type/dataset'
|
||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { numberFormat } from '@/utils/utils';
|
||||
import { numberFormat } from '@/utils/utils'
|
||||
const router = useRouter()
|
||||
|
||||
const loading = ref(false)
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
<template>
|
||||
<el-input v-model="filterText" placeholder="搜索" prefix-icon="Search" class="mb-16" />
|
||||
<el-input v-model="filterText" placeholder="搜索" prefix-icon="Search" class="mb-16" />
|
||||
|
||||
<el-table :data="data" :max-height="tableHeight">
|
||||
<el-table-column prop="name" label="数据集名称" />
|
||||
<el-table-column label="管理" align="center">
|
||||
<template #header>
|
||||
<!-- <template #header>
|
||||
<el-checkbox
|
||||
v-model="allChecked[MANAGE]"
|
||||
label="管理"
|
||||
@change="handleCheckAllChange($event, MANAGE)"
|
||||
/>
|
||||
</template>
|
||||
</template> -->
|
||||
<template #default="{ row }">
|
||||
<el-checkbox v-model="row.operate[MANAGE]" @change="checkedOperateChange(MANAGE, row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用" align="center">
|
||||
<template #header>
|
||||
<!-- <template #header>
|
||||
<el-checkbox
|
||||
v-model="allChecked[USE]"
|
||||
label="使用"
|
||||
@change="handleCheckAllChange($event, USE)"
|
||||
/>
|
||||
</template>
|
||||
</template> -->
|
||||
<template #default="{ row }">
|
||||
<el-checkbox v-model="row.operate[USE]" @change="checkedOperateChange(USE, row)" />
|
||||
</template>
|
||||
|
|
@ -78,7 +78,7 @@ function handleCheckAllChange(val: string | number | boolean, Name: string | num
|
|||
}
|
||||
}
|
||||
function checkedOperateChange(Name: string | number, row: any) {
|
||||
if (Name === MANAGE) {
|
||||
if (Name === MANAGE && row.operate[MANAGE]) {
|
||||
props.data.map((item: any) => {
|
||||
if (item.id === row.id) {
|
||||
item.operate[USE] = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue