feat: 数据集
This commit is contained in:
parent
64284b18db
commit
4ad2d1657d
@ -24,7 +24,17 @@ const getAllDateset: (param?: String) => Promise<Result<any[]>> = (param) => {
|
|||||||
return get(`${prefix}`, param && { search_text: param })
|
return get(`${prefix}`, param && { search_text: param })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据集
|
||||||
|
* @param 参数 dataset_id
|
||||||
|
*/
|
||||||
|
const delDateset: (dataset_id: String) => Promise<Result<boolean>> = (dataset_id) => {
|
||||||
|
return del(`${prefix}/${dataset_id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getDateset,
|
getDateset,
|
||||||
getAllDateset
|
getAllDateset,
|
||||||
|
delDateset
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
<el-card shadow="hover" class="card-box" @mouseenter="cardEnter()" @mouseleave="cardLeave()">
|
<el-card shadow="hover" class="card-box" @mouseenter="cardEnter()" @mouseleave="cardLeave()">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<slot name="header">
|
<slot name="header">
|
||||||
<div class="title flex">
|
<div class="title flex align-center">
|
||||||
<AppAvatar class="mr-10">
|
<AppAvatar class="mr-10">
|
||||||
<el-icon><Document /></el-icon>
|
<el-icon><Document /></el-icon>
|
||||||
</AppAvatar>
|
</AppAvatar>
|
||||||
<h3>{{ title }}</h3>
|
<h4>{{ title }}</h4>
|
||||||
</div>
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
@ -50,14 +50,6 @@ function cardLeave() {
|
|||||||
position: relative;
|
position: relative;
|
||||||
min-height: 150px;
|
min-height: 150px;
|
||||||
|
|
||||||
.card-header {
|
|
||||||
.title {
|
|
||||||
align-items: center;
|
|
||||||
h3 {
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.description {
|
.description {
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="top-menu-container flex h-full">
|
<div class="top-menu-container flex align-center h-full">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
:menu="menu"
|
:menu="menu"
|
||||||
v-hasPermission="menu.meta?.permission"
|
v-hasPermission="menu.meta?.permission"
|
||||||
@ -20,7 +20,6 @@ const topMenuList = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scope>
|
<style lang="scss" scope>
|
||||||
.top-menu-container {
|
.top-menu-container {
|
||||||
align-items: center;
|
|
||||||
margin-bottom: -1px;
|
margin-bottom: -1px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ body {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
|
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei',
|
||||||
'微软雅黑', Arial, sans-serif;
|
'微软雅黑', Arial, sans-serif;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -67,6 +67,22 @@ ul {
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.w-full {
|
.w-full {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@ -74,6 +90,9 @@ ul {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mt-8 {
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
.mt-10 {
|
.mt-10 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
@ -81,6 +100,9 @@ ul {
|
|||||||
.ml-10 {
|
.ml-10 {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
.ml-16 {
|
||||||
|
margin-left: 16px;
|
||||||
|
}
|
||||||
.mr-10 {
|
.mr-10 {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
@ -112,9 +134,13 @@ ul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.align-center {
|
.align-center {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.align-right {
|
.text-right {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +158,7 @@ ul {
|
|||||||
border-bottom: 1px solid var(--el-border-color-lighter);
|
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cursor{
|
.cursor {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
:root {
|
:root {
|
||||||
--el-menu-item-height: 45px;
|
--el-menu-item-height: 45px;
|
||||||
|
--el-text-color-primary: '#1F2329';
|
||||||
}
|
}
|
||||||
.el-avatar {
|
.el-avatar {
|
||||||
--el-avatar-bg-color: var(--el-color-primary);
|
--el-avatar-bg-color: var(--el-color-primary);
|
||||||
@ -24,6 +25,63 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-message-box {
|
||||||
|
padding-bottom: 24px;
|
||||||
|
.app-confirm {
|
||||||
|
.app-confirm-title {
|
||||||
|
color: var(--el-text-color-primary);
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
font-size: 24px;
|
||||||
|
color: var(--el-color-warning);
|
||||||
|
}
|
||||||
|
.app-confirm-decription {
|
||||||
|
margin-left: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.el-message-box__content {
|
||||||
|
padding: 24px;
|
||||||
|
color: var(--el-text-color-primary);
|
||||||
|
}
|
||||||
|
.el-message-box__btns {
|
||||||
|
padding: 5px 24px 0;
|
||||||
|
button {
|
||||||
|
min-width: 80px;
|
||||||
|
&:nth-child(2) {
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
button.danger {
|
||||||
|
background: var(--el-color-danger);
|
||||||
|
border: var(--el-color-danger);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 1200px) {
|
||||||
|
.el-col-lg-5 {
|
||||||
|
display: block;
|
||||||
|
max-width: 25%;
|
||||||
|
flex: 0 0 25%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 1400px) {
|
||||||
|
.el-col-lg-5 {
|
||||||
|
display: block;
|
||||||
|
max-width: 20.8333333333%;
|
||||||
|
flex: 0 0 20.8333333333%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 1920px) {
|
||||||
|
.el-col-xl-4 {
|
||||||
|
display: block;
|
||||||
|
max-width: 16.6666666667%;
|
||||||
|
flex: 0 0 16.6666666667%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 抽屉样式整体修改
|
// 抽屉样式整体修改
|
||||||
.el-drawer {
|
.el-drawer {
|
||||||
.el-drawer__header {
|
.el-drawer__header {
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
import { h } from 'vue'
|
||||||
|
import { ElMessageBox, ElMessage, ElIcon } from 'element-plus'
|
||||||
|
import { WarningFilled } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
export const MsgSuccess = (message: string) => {
|
export const MsgSuccess = (message: string) => {
|
||||||
ElMessage.success({
|
ElMessage.success({
|
||||||
@ -36,10 +38,25 @@ export const MsgError = (message: string) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MsgConfirm = (message: string, options = {}) => {
|
/**
|
||||||
|
* 删除数据集
|
||||||
|
* @param 参数 message: {title, decription,type}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const MsgConfirm = ({ title, decription }: any, options?: any) => {
|
||||||
|
const message: any = h('div', { class: 'app-confirm' }, [
|
||||||
|
h('h4', { class: 'app-confirm-title flex align-center' }, [
|
||||||
|
h(ElIcon, { class: 'icon' }, [h(WarningFilled)]),
|
||||||
|
h('span', { class: 'ml-16' }, title)
|
||||||
|
]),
|
||||||
|
h('div', { class: 'app-confirm-decription mt-8' }, decription)
|
||||||
|
])
|
||||||
|
|
||||||
const defaultOptions: Object = {
|
const defaultOptions: Object = {
|
||||||
type: 'warning',
|
showCancelButton: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
...options
|
...options
|
||||||
}
|
}
|
||||||
return ElMessageBox.confirm(message, '确认', defaultOptions)
|
return ElMessageBox({ message, ...defaultOptions })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<LayoutContent header="数据集">
|
<LayoutContent header="数据集">
|
||||||
<div class="dataset-list-container p-15">
|
<div class="dataset-list-container p-15">
|
||||||
<div class="align-right">
|
<div class="text-right">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="filterText"
|
v-model="filterText"
|
||||||
placeholder="搜索内容"
|
placeholder="搜索内容"
|
||||||
@ -15,14 +15,14 @@
|
|||||||
v-infinite-scroll="loadDataset"
|
v-infinite-scroll="loadDataset"
|
||||||
:infinite-scroll-disabled="disabledScroll"
|
:infinite-scroll-disabled="disabledScroll"
|
||||||
>
|
>
|
||||||
<el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="4" class="mt-10">
|
<el-col :xs="24" :sm="12" :md="6" :lg="5" :xl="4" class="mt-10">
|
||||||
<CardAdd title="创建数据集" />
|
<CardAdd title="创建数据集" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col
|
<el-col
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:sm="12"
|
:sm="12"
|
||||||
:md="6"
|
:md="6"
|
||||||
:lg="6"
|
:lg="5"
|
||||||
:xl="4"
|
:xl="4"
|
||||||
v-for="(item, index) in datasetList"
|
v-for="(item, index) in datasetList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<CardBox :title="item.name" :description="item.desc" class="cursor">
|
<CardBox :title="item.name" :description="item.desc" class="cursor">
|
||||||
<template #mouseEnter>
|
<template #mouseEnter>
|
||||||
<div class="delete-button">
|
<div class="delete-button">
|
||||||
<el-button type="primary" link>
|
<el-button type="primary" link @click.stop="deleteDateset(item)">
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -54,6 +54,7 @@
|
|||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import datasetApi from '@/api/dataset'
|
import datasetApi from '@/api/dataset'
|
||||||
import type { datasetListRequest } from '@/api/type/dataset'
|
import type { datasetListRequest } from '@/api/type/dataset'
|
||||||
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const filterText = ref('')
|
const filterText = ref('')
|
||||||
@ -65,7 +66,30 @@ const pageConfig = ref<datasetListRequest>({
|
|||||||
search_text: ''
|
search_text: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
function loadDataset() {}
|
function loadDataset() { }
|
||||||
|
|
||||||
|
|
||||||
|
function deleteDateset(row: any) {
|
||||||
|
MsgConfirm({
|
||||||
|
title: `是否删除数据集:${row.name}?`,
|
||||||
|
decription: '此数据集关联2个应用,删除后无法恢复,请谨慎操作。',
|
||||||
|
confirmButtonText: '删除',
|
||||||
|
}, {
|
||||||
|
confirmButtonClass: 'danger',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true
|
||||||
|
datasetApi.delDateset(row.id)
|
||||||
|
.then(() => {
|
||||||
|
MsgSuccess('删除成功')
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
}
|
||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<login-layout>
|
<login-layout>
|
||||||
<LoginContainer>
|
<LoginContainer>
|
||||||
<h3 class="mb-20">忘记密码</h3>
|
<h4 class="mb-20">忘记密码</h4>
|
||||||
<el-form
|
<el-form
|
||||||
class="register-form"
|
class="register-form"
|
||||||
ref="resetPasswordFormRef"
|
ref="resetPasswordFormRef"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<login-layout>
|
<login-layout>
|
||||||
<LoginContainer>
|
<LoginContainer>
|
||||||
<h3 class="mb-20">注册</h3>
|
<h4 class="mb-20">注册</h4>
|
||||||
<el-form class="register-form" :model="registerForm" :rules="rules" ref="registerFormRef">
|
<el-form class="register-form" :model="registerForm" :rules="rules" ref="registerFormRef">
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input
|
<el-input
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<login-layout>
|
<login-layout>
|
||||||
<LoginContainer>
|
<LoginContainer>
|
||||||
<h3 class="mb-20">修改密码</h3>
|
<h4 class="mb-20">修改密码</h4>
|
||||||
<el-form
|
<el-form
|
||||||
class="reset-password-form"
|
class="reset-password-form"
|
||||||
ref="resetPasswordFormRef"
|
ref="resetPasswordFormRef"
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
<LayoutContent header="团队管理">
|
<LayoutContent header="团队管理">
|
||||||
<div class="team-manage flex main-calc-height">
|
<div class="team-manage flex main-calc-height">
|
||||||
<div class="team-member p-15 border-r">
|
<div class="team-member p-15 border-r">
|
||||||
<h3>团队成员</h3>
|
<h4>团队成员</h4>
|
||||||
<div class="align-right">
|
<div class="text-right">
|
||||||
<el-button type="primary" link @click="addMember">
|
<el-button type="primary" link @click="addMember">
|
||||||
<AppIcon iconName="app-add-users" class="add-user-icon" />添加成员
|
<AppIcon iconName="app-add-users" class="add-user-icon" />添加成员
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -25,18 +25,20 @@
|
|||||||
<el-tag effect="dark" v-if="isManage(item.type)">所有者</el-tag>
|
<el-tag effect="dark" v-if="isManage(item.type)">所有者</el-tag>
|
||||||
<el-tag effect="dark" type="warning" v-else>用户</el-tag>
|
<el-tag effect="dark" type="warning" v-else>用户</el-tag>
|
||||||
</div>
|
</div>
|
||||||
|
<span @click.stop>
|
||||||
<el-dropdown trigger="click" v-if="!isManage(item.type)">
|
<el-dropdown trigger="click" v-if="!isManage(item.type)">
|
||||||
<span class="cursor">
|
<span class="cursor">
|
||||||
<el-icon><MoreFilled /></el-icon>
|
<el-icon><MoreFilled /></el-icon>
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click.prevent="deleteMember(item.id)"
|
<el-dropdown-item @click.prevent="deleteMember(item)"
|
||||||
>移除</el-dropdown-item
|
>移除</el-dropdown-item
|
||||||
>
|
>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
@ -46,7 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="permission-setting flex" v-loading="rLoading">
|
<div class="permission-setting flex" v-loading="rLoading">
|
||||||
<div class="team-manage__table p-15">
|
<div class="team-manage__table p-15">
|
||||||
<h3>权限设置</h3>
|
<h4>权限设置</h4>
|
||||||
<el-tabs v-model="activeName" class="demo-tabs">
|
<el-tabs v-model="activeName" class="demo-tabs">
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-for="item in settingTags"
|
v-for="item in settingTags"
|
||||||
@ -74,7 +76,7 @@ import TeamApi from '@/api/team'
|
|||||||
import type { TeamMember } from '@/api/type/team'
|
import type { TeamMember } from '@/api/type/team'
|
||||||
import CreateMemberDialog from './component/CreateMemberDialog.vue'
|
import CreateMemberDialog from './component/CreateMemberDialog.vue'
|
||||||
import PermissionSetting from './component/PermissionSetting.vue'
|
import PermissionSetting from './component/PermissionSetting.vue'
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
|
|
||||||
const DATASET = 'DATASET'
|
const DATASET = 'DATASET'
|
||||||
|
|
||||||
@ -151,9 +153,17 @@ function MemberPermissions(id: String) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteMember(id: String) {
|
function deleteMember(row: TeamMember) {
|
||||||
|
MsgConfirm({
|
||||||
|
title: `是否移除成员:${row.username}`,
|
||||||
|
decription: '移除后将会取消成员拥有的数据集和应用权限。',
|
||||||
|
confirmButtonText: '移除',
|
||||||
|
}, {
|
||||||
|
confirmButtonClass: 'danger',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
TeamApi.delTeamMember(id)
|
TeamApi.delTeamMember(row.id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
MsgSuccess('删除成功')
|
MsgSuccess('删除成功')
|
||||||
getMember()
|
getMember()
|
||||||
@ -161,6 +171,8 @@ function deleteMember(id: String) {
|
|||||||
.catch(() => {
|
.catch(() => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
function isManage(type: String) {
|
function isManage(type: String) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user