提交 d0308fdc authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 f5a609cd
...@@ -12,6 +12,16 @@ export function deleteDataset(data: { id: string }) { ...@@ -12,6 +12,16 @@ export function deleteDataset(data: { id: string }) {
} }
// 内置数据集列表 // 内置数据集列表
export function getDatasetList(params?: Partial<{ name: string; industry: string; page: number; 'per-page': number }>) { export function getDatasetList(
params?: Partial<{
name: string
industry: string
source: string
sensitivity_level: string
access_permissions: string
page: number
'per-page': number
}>
) {
return httpRequest.get('/api/bi/v1/data/built-in/list', { params }) return httpRequest.get('/api/bi/v1/data/built-in/list', { params })
} }
...@@ -78,11 +78,6 @@ export default function DataWriteBuilt() { ...@@ -78,11 +78,6 @@ export default function DataWriteBuilt() {
}, },
}, },
], ],
dataSource: [
{ id: 1, name: '《商务数据分析基础》数据集' },
{ id: 2, name: '智慧交通数据集' },
{ id: 3, name: '信用卡数字营销数据集' },
],
} }
return ( return (
<Card className="app-card" title="内置数据集管理"> <Card className="app-card" title="内置数据集管理">
......
import httpRequest from '@/utils/axios'
// 内置数据集列表
export function getDatasetList(
params?: Partial<{
name: string
industry: string
source: string
sensitivity_level: string
access_permissions: string
page: number
'per-page': number
}>
) {
return httpRequest.get('/api/bi/v1/data/built-in/list', { params })
}
...@@ -2,6 +2,7 @@ import { Button, Card, Input, Select } from 'antd' ...@@ -2,6 +2,7 @@ import { Button, Card, Input, Select } from 'antd'
import AppList, { AppListProps } from '@/components/AppList' import AppList, { AppListProps } from '@/components/AppList'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { lazy, useState } from 'react' import { lazy, useState } from 'react'
import { getDatasetList } from '../api'
const CopyModal = lazy(() => import('../components/CopyModal')) const CopyModal = lazy(() => import('../components/CopyModal'))
const ViewDataModal = lazy(() => import('@/components/data/ViewDataModal')) const ViewDataModal = lazy(() => import('@/components/data/ViewDataModal'))
...@@ -10,23 +11,6 @@ export default function DataWriteCopy() { ...@@ -10,23 +11,6 @@ export default function DataWriteCopy() {
const getMapValuesByKey = useMapStore((state) => state.getMapValuesByKey) const getMapValuesByKey = useMapStore((state) => state.getMapValuesByKey)
const industryList = getMapValuesByKey('bi_data_industry') const industryList = getMapValuesByKey('bi_data_industry')
const generateDataSource = (count: number) => {
return Array.from({ length: count }, (_, index) => ({
id: index,
key: index,
name: `数据集名称 ${index + 1}`,
count: Math.floor(Math.random() * 1000),
industry: `行业 ${index + 1}`,
source: `来源 ${index + 1}`,
level: `等级 ${index + 1}`,
auth: `权限 ${index + 1}`,
desc: `说明 ${index + 1}`,
create: `创建人 ${index + 1}`,
create_time: new Date().toLocaleString(),
update_time: new Date().toLocaleString(),
}))
}
const [viewModalIsOpen, setViewModalIsOpen] = useState(false) const [viewModalIsOpen, setViewModalIsOpen] = useState(false)
const handleView = (record: any) => { const handleView = (record: any) => {
...@@ -41,6 +25,10 @@ export default function DataWriteCopy() { ...@@ -41,6 +25,10 @@ export default function DataWriteCopy() {
} }
const listOptions: AppListProps = { const listOptions: AppListProps = {
fetchApi: async (params) => {
const { data } = await getDatasetList({ ...params, access_permissions: '1' })
return { ...data }
},
filters: [ filters: [
{ {
name: 'industry', name: 'industry',
...@@ -62,15 +50,15 @@ export default function DataWriteCopy() { ...@@ -62,15 +50,15 @@ export default function DataWriteCopy() {
align: 'center', align: 'center',
}, },
{ title: '数据集名称', dataIndex: 'name', align: 'center' }, { title: '数据集名称', dataIndex: 'name', align: 'center' },
{ title: '数据量', dataIndex: 'count', align: 'center' }, { title: '数据量', dataIndex: 'number', align: 'center' },
{ title: '所属行业', dataIndex: 'industry', align: 'center' }, { title: '所属行业', dataIndex: 'industry_name', align: 'center' },
{ title: '数据来源', dataIndex: 'source', align: 'center' }, { title: '数据来源', dataIndex: 'source_name', align: 'center' },
{ title: '敏感等级', dataIndex: 'level', align: 'center' }, { title: '敏感等级', dataIndex: 'sensitivity_level_name', align: 'center' },
{ title: '访问权限', dataIndex: 'auth', align: 'center' }, { title: '访问权限', dataIndex: 'access_permissions_name', align: 'center' },
{ title: '说明', dataIndex: 'desc', align: 'center' }, { title: '说明', dataIndex: 'describe', align: 'center' },
{ title: '创建人', dataIndex: 'create', align: 'center' }, { title: '创建人', dataIndex: 'created_operator_name', align: 'center' },
{ title: '创建时间', dataIndex: 'create_time', align: 'center' }, { title: '创建时间', dataIndex: 'created_time', align: 'center' },
{ title: '更新时间', dataIndex: 'update_time', align: 'center' }, { title: '更新时间', dataIndex: 'updated_time', align: 'center' },
{ {
title: '操作', title: '操作',
key: 'x', key: 'x',
...@@ -90,7 +78,6 @@ export default function DataWriteCopy() { ...@@ -90,7 +78,6 @@ export default function DataWriteCopy() {
}, },
}, },
], ],
dataSource: generateDataSource(20),
} }
return ( return (
<Card className="app-card" title="数据复制"> <Card className="app-card" title="数据复制">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论