新增数据管理模块,将智能商务模块业务copy到数据管理模块
This commit is contained in:
parent
c568370e54
commit
092ab7eb2c
|
@ -0,0 +1,188 @@
|
||||||
|
// @/apis/data/index.ts - 数据管理API
|
||||||
|
import http from '@/utils/http'
|
||||||
|
import type {
|
||||||
|
FolderInfo,
|
||||||
|
FileInfo,
|
||||||
|
FolderListParams,
|
||||||
|
FileListParams,
|
||||||
|
FolderListResponse,
|
||||||
|
FileListResponse,
|
||||||
|
CreateFolderParams,
|
||||||
|
RenameFolderParams,
|
||||||
|
DeleteFolderParams,
|
||||||
|
UploadFileParams,
|
||||||
|
DownloadFileParams,
|
||||||
|
DeleteFileParams,
|
||||||
|
PreviewFileParams,
|
||||||
|
RenameFileParams
|
||||||
|
} from './type'
|
||||||
|
|
||||||
|
const { request, requestRaw } = http
|
||||||
|
|
||||||
|
// 导出类型定义
|
||||||
|
export type {
|
||||||
|
FolderInfo,
|
||||||
|
FileInfo,
|
||||||
|
FolderListParams,
|
||||||
|
FileListParams,
|
||||||
|
FolderListResponse,
|
||||||
|
FileListResponse,
|
||||||
|
CreateFolderParams,
|
||||||
|
RenameFolderParams,
|
||||||
|
DeleteFolderParams,
|
||||||
|
UploadFileParams,
|
||||||
|
DownloadFileParams,
|
||||||
|
DeleteFileParams,
|
||||||
|
PreviewFileParams,
|
||||||
|
RenameFileParams
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取文件夹列表(分页)
|
||||||
|
export function getFolderListApi(params?: FolderListParams) {
|
||||||
|
return request<FolderListResponse>({
|
||||||
|
url: '/data/folder/list',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
page: params?.page || 1,
|
||||||
|
pageSize: params?.pageSize || 10,
|
||||||
|
folderName: params?.folderName
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取文件列表(分页)
|
||||||
|
export function getFilesApi(params?: FileListParams) {
|
||||||
|
return request<FileListResponse>({
|
||||||
|
url: '/data/file/list',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
page: params?.page || 1,
|
||||||
|
pageSize: params?.pageSize || 10,
|
||||||
|
folderId: params?.folderId || '0',
|
||||||
|
fileName: params?.fileName,
|
||||||
|
sortField: params?.sortField,
|
||||||
|
sortOrder: params?.sortOrder
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建文件夹
|
||||||
|
export function createFolderApi(data: CreateFolderParams) {
|
||||||
|
return request({
|
||||||
|
url: '/data/folder/creatFolder',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
name: data.name,
|
||||||
|
parentId: data.parentId || '0'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重命名文件夹
|
||||||
|
export function updateFolderApi(folderId: string, newName: string) {
|
||||||
|
return request({
|
||||||
|
url: '/data/folder/rename',
|
||||||
|
method: 'put',
|
||||||
|
params: {
|
||||||
|
folderId: folderId,
|
||||||
|
newName: newName
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除文件夹
|
||||||
|
export function deleteFolderApi(folderId: string) {
|
||||||
|
return request({
|
||||||
|
url: '/data/folder/delete',
|
||||||
|
method: 'delete',
|
||||||
|
params: {
|
||||||
|
folderId: folderId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
export function uploadFileApi(
|
||||||
|
file: File,
|
||||||
|
folderId: string,
|
||||||
|
onUploadProgress?: (progressEvent: any) => void,
|
||||||
|
cancelToken?: any
|
||||||
|
) {
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('file', file)
|
||||||
|
|
||||||
|
return requestRaw({
|
||||||
|
url: '/data/file/add',
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
folderId: folderId
|
||||||
|
},
|
||||||
|
data: formData,
|
||||||
|
onUploadProgress,
|
||||||
|
cancelToken,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}).then(response => response.data)
|
||||||
|
.catch(error => {
|
||||||
|
// 确保错误不会抛出,而是返回一个错误对象
|
||||||
|
console.error('上传文件API错误:', error)
|
||||||
|
return {
|
||||||
|
code: 500,
|
||||||
|
msg: error.message || '上传失败',
|
||||||
|
success: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载文件
|
||||||
|
export function downloadFileApi(fileId: string) {
|
||||||
|
return request({
|
||||||
|
url: '/data/file/download',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
fileId: fileId
|
||||||
|
},
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除文件
|
||||||
|
export function deleteFileApi(fileId: string) {
|
||||||
|
return request({
|
||||||
|
url: '/data/file/delete',
|
||||||
|
method: 'delete',
|
||||||
|
params: {
|
||||||
|
fileId: fileId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预览文件
|
||||||
|
export function previewFileApi(fileId: string) {
|
||||||
|
return request({
|
||||||
|
url: '/data/file/preview',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
fileId: fileId
|
||||||
|
},
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重命名文件
|
||||||
|
export function renameFileApi(fileId: string, newFileName: string) {
|
||||||
|
return request({
|
||||||
|
url: '/data/file/rename',
|
||||||
|
method: 'put',
|
||||||
|
params: {
|
||||||
|
fileId: fileId,
|
||||||
|
newFileName: newFileName
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重命名文件(兼容旧接口)
|
||||||
|
export function updateFileNameApi(fileId: string, data: RenameFileParams) {
|
||||||
|
return renameFileApi(fileId, data.newFileName)
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
/** 文件夹信息接口 */
|
||||||
|
export interface FolderInfo {
|
||||||
|
folderId: string
|
||||||
|
name: string
|
||||||
|
parentId: string
|
||||||
|
createTime?: string
|
||||||
|
updateTime?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件信息接口 */
|
||||||
|
export interface FileInfo {
|
||||||
|
fileId: string
|
||||||
|
fileName: string
|
||||||
|
fileSize: number
|
||||||
|
fileType: string
|
||||||
|
folderId: string
|
||||||
|
createTime?: string
|
||||||
|
updateTime?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件夹列表查询参数 */
|
||||||
|
export interface FolderListParams {
|
||||||
|
page?: number
|
||||||
|
pageSize?: number
|
||||||
|
folderName?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件列表查询参数 */
|
||||||
|
export interface FileListParams {
|
||||||
|
page?: number
|
||||||
|
pageSize?: number
|
||||||
|
folderId?: string
|
||||||
|
fileName?: string
|
||||||
|
sortField?: string
|
||||||
|
sortOrder?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件夹列表响应 */
|
||||||
|
export interface FolderListResponse {
|
||||||
|
data: FolderInfo[]
|
||||||
|
total: number
|
||||||
|
current: number
|
||||||
|
size: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件列表响应 */
|
||||||
|
export interface FileListResponse {
|
||||||
|
data: FileInfo[]
|
||||||
|
total: number
|
||||||
|
current: number
|
||||||
|
size: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 创建文件夹请求参数 */
|
||||||
|
export interface CreateFolderParams {
|
||||||
|
name: string
|
||||||
|
parentId?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重命名文件夹请求参数 */
|
||||||
|
export interface RenameFolderParams {
|
||||||
|
folderId: string
|
||||||
|
newName: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除文件夹请求参数 */
|
||||||
|
export interface DeleteFolderParams {
|
||||||
|
folderId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 上传文件请求参数 */
|
||||||
|
export interface UploadFileParams {
|
||||||
|
file: File
|
||||||
|
folderId: string
|
||||||
|
onUploadProgress?: (progressEvent: any) => void
|
||||||
|
cancelToken?: any
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 下载文件请求参数 */
|
||||||
|
export interface DownloadFileParams {
|
||||||
|
fileId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除文件请求参数 */
|
||||||
|
export interface DeleteFileParams {
|
||||||
|
fileId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 预览文件请求参数 */
|
||||||
|
export interface PreviewFileParams {
|
||||||
|
fileId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重命名文件请求参数 */
|
||||||
|
export interface RenameFileParams {
|
||||||
|
fileId: string
|
||||||
|
newFileName: string
|
||||||
|
}
|
|
@ -20,6 +20,7 @@ export * as RegulationAPI from './regulation'
|
||||||
export * as TrainingAPI from './training'
|
export * as TrainingAPI from './training'
|
||||||
export * as EquipmentAPI from './equipment'
|
export * as EquipmentAPI from './equipment'
|
||||||
export * as BussinessAPI from './bussiness/bussiness'
|
export * as BussinessAPI from './bussiness/bussiness'
|
||||||
|
export * as DataAPI from './data'
|
||||||
|
|
||||||
export * from './area/type'
|
export * from './area/type'
|
||||||
export * from './auth/type'
|
export * from './auth/type'
|
||||||
|
|
|
@ -1184,7 +1184,7 @@ export const systemRoutes: RouteRecordRaw[] = [
|
||||||
name: 'bussinesskonwledge',
|
name: 'bussinesskonwledge',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/bussiness-knowledge/data',
|
redirect: '/bussiness-knowledge/data',
|
||||||
meta: { title: '商务资料知识库', icon: 'database', hidden: false, sort: 5.5 },
|
meta: { title: '智能商务', icon: 'database', hidden: false, sort: 5.5 },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/bussiness-konwledge/data',
|
path: '/bussiness-konwledge/data',
|
||||||
|
@ -1198,6 +1198,26 @@ export const systemRoutes: RouteRecordRaw[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
// 数据管理模块
|
||||||
|
{
|
||||||
|
path: '/data-management',
|
||||||
|
name: 'dataManagement',
|
||||||
|
component: Layout,
|
||||||
|
redirect: '/data-management/data',
|
||||||
|
meta: { title: '数据管理', icon: 'database', hidden: false, sort: 5.6 },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '/data-management/data',
|
||||||
|
name: 'data-management',
|
||||||
|
component: () => import('@/views/data/data.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '数据管理',
|
||||||
|
icon: 'database',
|
||||||
|
hidden: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/image-detection',
|
path: '/image-detection',
|
||||||
name: 'ImageDetection',
|
name: 'ImageDetection',
|
||||||
|
|
|
@ -7,7 +7,70 @@ export {}
|
||||||
|
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
|
ApprovalAssistant: typeof import('./../components/ApprovalAssistant/index.vue')['default']
|
||||||
|
ApprovalMessageItem: typeof import('./../components/NotificationCenter/ApprovalMessageItem.vue')['default']
|
||||||
|
Avatar: typeof import('./../components/Avatar/index.vue')['default']
|
||||||
|
Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default']
|
||||||
|
CellCopy: typeof import('./../components/CellCopy/index.vue')['default']
|
||||||
|
Chart: typeof import('./../components/Chart/index.vue')['default']
|
||||||
|
CircularProgress: typeof import('./../components/CircularProgress/index.vue')['default']
|
||||||
|
ColumnSetting: typeof import('./../components/GiTable/src/components/ColumnSetting.vue')['default']
|
||||||
|
CronForm: typeof import('./../components/GenCron/CronForm/index.vue')['default']
|
||||||
|
CronModal: typeof import('./../components/GenCron/CronModal/index.vue')['default']
|
||||||
|
DateRangePicker: typeof import('./../components/DateRangePicker/index.vue')['default']
|
||||||
|
DayForm: typeof import('./../components/GenCron/CronForm/component/day-form.vue')['default']
|
||||||
|
FilePreview: typeof import('./../components/FilePreview/index.vue')['default']
|
||||||
|
GiCellAvatar: typeof import('./../components/GiCell/GiCellAvatar.vue')['default']
|
||||||
|
GiCellGender: typeof import('./../components/GiCell/GiCellGender.vue')['default']
|
||||||
|
GiCellStatus: typeof import('./../components/GiCell/GiCellStatus.vue')['default']
|
||||||
|
GiCellTag: typeof import('./../components/GiCell/GiCellTag.vue')['default']
|
||||||
|
GiCellTags: typeof import('./../components/GiCell/GiCellTags.vue')['default']
|
||||||
|
GiCodeView: typeof import('./../components/GiCodeView/index.vue')['default']
|
||||||
|
GiDot: typeof import('./../components/GiDot/index.tsx')['default']
|
||||||
|
GiEditTable: typeof import('./../components/GiEditTable/GiEditTable.vue')['default']
|
||||||
|
GiFooter: typeof import('./../components/GiFooter/index.vue')['default']
|
||||||
|
GiForm: typeof import('./../components/GiForm/src/GiForm.vue')['default']
|
||||||
|
GiIconBox: typeof import('./../components/GiIconBox/index.vue')['default']
|
||||||
|
GiIconSelector: typeof import('./../components/GiIconSelector/index.vue')['default']
|
||||||
|
GiIframe: typeof import('./../components/GiIframe/index.vue')['default']
|
||||||
|
GiOption: typeof import('./../components/GiOption/index.vue')['default']
|
||||||
|
GiOptionItem: typeof import('./../components/GiOptionItem/index.vue')['default']
|
||||||
|
GiPageLayout: typeof import('./../components/GiPageLayout/index.vue')['default']
|
||||||
|
GiSpace: typeof import('./../components/GiSpace/index.vue')['default']
|
||||||
|
GiSplitButton: typeof import('./../components/GiSplitButton/index.vue')['default']
|
||||||
|
GiSplitPane: typeof import('./../components/GiSplitPane/index.vue')['default']
|
||||||
|
GiSplitPaneFlexibleBox: typeof import('./../components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue')['default']
|
||||||
|
GiSvgIcon: typeof import('./../components/GiSvgIcon/index.vue')['default']
|
||||||
|
GiTable: typeof import('./../components/GiTable/src/GiTable.vue')['default']
|
||||||
|
GiTag: typeof import('./../components/GiTag/index.tsx')['default']
|
||||||
|
GiThemeBtn: typeof import('./../components/GiThemeBtn/index.vue')['default']
|
||||||
|
HourForm: typeof import('./../components/GenCron/CronForm/component/hour-form.vue')['default']
|
||||||
|
Icon403: typeof import('./../components/icons/Icon403.vue')['default']
|
||||||
|
Icon404: typeof import('./../components/icons/Icon404.vue')['default']
|
||||||
|
Icon500: typeof import('./../components/icons/Icon500.vue')['default']
|
||||||
|
IconBorders: typeof import('./../components/icons/IconBorders.vue')['default']
|
||||||
|
IconTableSize: typeof import('./../components/icons/IconTableSize.vue')['default']
|
||||||
|
IconTreeAdd: typeof import('./../components/icons/IconTreeAdd.vue')['default']
|
||||||
|
IconTreeReduce: typeof import('./../components/icons/IconTreeReduce.vue')['default']
|
||||||
|
ImageImport: typeof import('./../components/ImageImport/index.vue')['default']
|
||||||
|
ImageImportWizard: typeof import('./../components/ImageImportWizard/index.vue')['default']
|
||||||
|
IndustrialImageList: typeof import('./../components/IndustrialImageList/index.vue')['default']
|
||||||
|
JsonPretty: typeof import('./../components/JsonPretty/index.vue')['default']
|
||||||
|
MinuteForm: typeof import('./../components/GenCron/CronForm/component/minute-form.vue')['default']
|
||||||
|
MonthForm: typeof import('./../components/GenCron/CronForm/component/month-form.vue')['default']
|
||||||
|
NotificationCenter: typeof import('./../components/NotificationCenter/index.vue')['default']
|
||||||
|
ParentView: typeof import('./../components/ParentView/index.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
|
SecondForm: typeof import('./../components/GenCron/CronForm/component/second-form.vue')['default']
|
||||||
|
SplitPanel: typeof import('./../components/SplitPanel/index.vue')['default']
|
||||||
|
TextCopy: typeof import('./../components/TextCopy/index.vue')['default']
|
||||||
|
TurbineGrid: typeof import('./../components/TurbineGrid/index.vue')['default']
|
||||||
|
UserSelect: typeof import('./../components/UserSelect/index.vue')['default']
|
||||||
|
Verify: typeof import('./../components/Verify/index.vue')['default']
|
||||||
|
VerifyPoints: typeof import('./../components/Verify/Verify/VerifyPoints.vue')['default']
|
||||||
|
VerifySlide: typeof import('./../components/Verify/Verify/VerifySlide.vue')['default']
|
||||||
|
WeekForm: typeof import('./../components/GenCron/CronForm/component/week-form.vue')['default']
|
||||||
|
YearForm: typeof import('./../components/GenCron/CronForm/component/year-form.vue')['default']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue