Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
|
65672708be | |
|
91b6deeb0d | |
|
a4876971a4 |
|
@ -0,0 +1,126 @@
|
||||||
|
// @/apis/bussiness/bussiness.js - 根据后端接口重新编写
|
||||||
|
import http from '@/utils/http';
|
||||||
|
|
||||||
|
const { request } = http;
|
||||||
|
|
||||||
|
// 获取文件夹列表(分页)
|
||||||
|
export function getFolderListApi(params) {
|
||||||
|
return request({
|
||||||
|
url: '/businessData/folder/list',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
page: params?.page || 1,
|
||||||
|
pageSize: params?.pageSize || 10,
|
||||||
|
folderName: params?.folderName
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取文件列表(分页)
|
||||||
|
export function getFilesApi(params) {
|
||||||
|
return request({
|
||||||
|
url: '/businessData/file/list',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
page: params?.page || 1,
|
||||||
|
pageSize: params?.pageSize || 10,
|
||||||
|
folderId: params?.folderId || 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建文件夹
|
||||||
|
export function createFolderApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/businessData/folder/creatFolder',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
name: data.name,
|
||||||
|
parentId: data.parentId || 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重命名文件夹
|
||||||
|
export function updateFolderApi(folderId, newName) {
|
||||||
|
return request({
|
||||||
|
url: '/businessData/folder/rename',
|
||||||
|
method: 'put',
|
||||||
|
params: {
|
||||||
|
folderId: folderId,
|
||||||
|
newName: newName
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除文件夹
|
||||||
|
export function deleteFolderApi(folderId) {
|
||||||
|
return request({
|
||||||
|
url: '/businessData/folder/delete',
|
||||||
|
method: 'delete',
|
||||||
|
params: {
|
||||||
|
folderId: folderId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传文件
|
||||||
|
export function uploadFileApi(file, folderId, onUploadProgress, cancelToken) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
|
||||||
|
return request({
|
||||||
|
url: '/businessData/file/add',
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
folderId: folderId
|
||||||
|
},
|
||||||
|
data: formData,
|
||||||
|
onUploadProgress,
|
||||||
|
cancelToken,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载文件
|
||||||
|
export function downloadFileApi(fileId) {
|
||||||
|
return request({
|
||||||
|
url: '/businessData/file/download',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
fileId: fileId
|
||||||
|
},
|
||||||
|
responseType: 'blob'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除文件
|
||||||
|
export function deleteFileApi(fileId) {
|
||||||
|
return request({
|
||||||
|
url: '/businessData/file/delete',
|
||||||
|
method: 'delete',
|
||||||
|
params: {
|
||||||
|
fileId: fileId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预览文件(后端没有提供预览接口,使用下载接口)
|
||||||
|
export function previewFileApi(fileId) {
|
||||||
|
return request({
|
||||||
|
url: '/businessData/file/download',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
fileId: fileId
|
||||||
|
},
|
||||||
|
responseType: 'blob'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重命名文件(后端没有提供重命名接口,需要先删除再上传)
|
||||||
|
export function updateFileNameApi(fileId, data) {
|
||||||
|
// 注意:后端没有提供文件重命名接口,这里返回一个Promise.reject
|
||||||
|
return Promise.reject(new Error('后端暂不支持文件重命名功能'));
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
import http from '@/utils/http'
|
||||||
|
|
||||||
|
const { request } = http
|
||||||
|
|
||||||
|
// 文件信息
|
||||||
|
export interface KnowledgeFile {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
size: string
|
||||||
|
type: string
|
||||||
|
uploadTime: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文件夹信息
|
||||||
|
export interface KnowledgeFolder {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
children?: KnowledgeFolder[]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取文件夹树
|
||||||
|
export function getFolderTreeApi() {
|
||||||
|
return request<KnowledgeFolder[]>({
|
||||||
|
url: '/knowledge/folders',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取文件列表(按文件夹)
|
||||||
|
export function getFilesApi(folderId: string) {
|
||||||
|
return request<KnowledgeFile[]>({
|
||||||
|
url: '/knowledge/files',
|
||||||
|
method: 'get',
|
||||||
|
params: { folderId },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建文件夹
|
||||||
|
export function createFolderApi(data: { name: string; parentId?: string }) {
|
||||||
|
return request({
|
||||||
|
url: '/knowledge/create-folder',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除文件
|
||||||
|
export function deleteFileApi(fileId: string) {
|
||||||
|
return request({
|
||||||
|
url: `/knowledge/delete-file/${fileId}`,
|
||||||
|
method: 'delete',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载文件
|
||||||
|
export function downloadFileApi(fileId: string) {
|
||||||
|
return request<Blob>({
|
||||||
|
url: `/knowledge/download/${fileId}`,
|
||||||
|
method: 'get',
|
||||||
|
responseType: 'blob',
|
||||||
|
})
|
||||||
|
}
|
53
src/main.ts
53
src/main.ts
|
@ -1,43 +1,46 @@
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import ArcoVue, { Card, Drawer, Modal } from '@arco-design/web-vue'
|
|
||||||
import '@/styles/arco-ui/index.less'
|
|
||||||
// import '@arco-themes/vue-gi-demo/index.less'
|
|
||||||
// import '@arco-design/web-vue/dist/arco.css'
|
|
||||||
|
|
||||||
// 额外引入 Arco Design Icon图标库
|
|
||||||
import ArcoVueIcon from '@arco-design/web-vue/es/icon'
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
import pinia from '@/stores'
|
||||||
|
|
||||||
// 使用动画库
|
// UI框架 - Arco Design
|
||||||
import 'animate.css/animate.min.css'
|
import ArcoVue, { Card, Drawer, Modal } from '@arco-design/web-vue'
|
||||||
|
import ArcoVueIcon from '@arco-design/web-vue/es/icon'
|
||||||
|
import '@/styles/arco-ui/index.less' // 自定义Arco样式
|
||||||
|
|
||||||
// 自定义过渡动画
|
// UI框架 - Element Plus
|
||||||
import '@/styles/css/transition.css'
|
import ElementPlus from 'element-plus'
|
||||||
|
import 'element-plus/dist/index.css'
|
||||||
|
|
||||||
// 导入全局scss主文件
|
// 动画相关
|
||||||
|
import 'animate.css/animate.min.css' // 第三方动画库
|
||||||
|
import '@/styles/css/transition.css' // 自定义过渡动画
|
||||||
|
|
||||||
|
// 样式主文件
|
||||||
import '@/styles/index.scss'
|
import '@/styles/index.scss'
|
||||||
|
|
||||||
// 支持SVG
|
// SVG支持
|
||||||
import 'virtual:svg-icons-register'
|
import 'virtual:svg-icons-register'
|
||||||
|
|
||||||
// 自定义指令
|
// 自定义指令
|
||||||
import directives from './directives'
|
import directives from './directives'
|
||||||
|
|
||||||
// 状态管理
|
// 初始化应用
|
||||||
import pinia from '@/stores'
|
|
||||||
|
|
||||||
// 对特定组件进行默认配置
|
|
||||||
Card.props.bordered = false
|
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
Modal._context = app._context
|
|
||||||
Drawer._context = app._context
|
|
||||||
|
|
||||||
|
// 配置Arco组件全局属性
|
||||||
|
Card.props.bordered = false // 设置Card组件默认不显示边框
|
||||||
|
Modal._context = app._context // 修复Modal组件上下文问题
|
||||||
|
Drawer._context = app._context // 修复Drawer组件上下文问题
|
||||||
|
|
||||||
|
// 安装插件
|
||||||
app.use(router)
|
app.use(router)
|
||||||
app.use(pinia)
|
.use(pinia)
|
||||||
app.use(ArcoVue)
|
.use(ArcoVue)
|
||||||
app.use(ArcoVueIcon)
|
.use(ArcoVueIcon)
|
||||||
app.use(directives)
|
.use(ElementPlus)
|
||||||
|
.use(directives)
|
||||||
|
|
||||||
app.mount('#app')
|
// 挂载应用
|
||||||
|
app.mount('#app')
|
|
@ -911,14 +911,32 @@ export const systemRoutes: RouteRecordRaw[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// ],
|
// 添加商务知识库
|
||||||
// },
|
{
|
||||||
|
path: '/bussiness-knowledge',
|
||||||
|
name: 'bussinesskonwledge',
|
||||||
|
component: Layout,
|
||||||
|
redirect: '/bussiness-knowledge/data',
|
||||||
|
meta: { title: '商务资料知识库', icon: 'message', hidden: false, sort: 6 },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '/bussiness-konwledge/data',
|
||||||
|
name: 'bussiness-knowledge',
|
||||||
|
component: () => import('@/views/bussiness-data/bussiness.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '商务数据库信息',
|
||||||
|
icon: 'info-circle',
|
||||||
|
hidden: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/chat-platform',
|
path: '/chat-platform',
|
||||||
name: 'ChatPlatform',
|
name: 'ChatPlatform',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/chat-platform/options',
|
redirect: '/chat-platform/options',
|
||||||
meta: { title: '聊天平台', icon: 'message', hidden: false, sort: 6 },
|
meta: { title: '聊天平台', icon: 'message', hidden: false, sort: 7 },
|
||||||
children: [
|
children: [
|
||||||
// {
|
// {
|
||||||
// path: '/chat-platform/options',
|
// path: '/chat-platform/options',
|
||||||
|
@ -937,7 +955,7 @@ export const systemRoutes: RouteRecordRaw[] = [
|
||||||
name: 'EnterpriseSettings',
|
name: 'EnterpriseSettings',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/enterprise-settings/company-info',
|
redirect: '/enterprise-settings/company-info',
|
||||||
meta: { title: '企业设置', icon: 'setting', hidden: false, sort: 7 },
|
meta: { title: '企业设置', icon: 'setting', hidden: false, sort: 8 },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/enterprise-settings/company-info',
|
path: '/enterprise-settings/company-info',
|
||||||
|
@ -986,7 +1004,7 @@ export const systemRoutes: RouteRecordRaw[] = [
|
||||||
name: 'EnterpriseDashboard',
|
name: 'EnterpriseDashboard',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/enterprise-dashboard/overview',
|
redirect: '/enterprise-dashboard/overview',
|
||||||
meta: { title: '企业看板', icon: 'dashboard', hidden: false, sort: 8 },
|
meta: { title: '企业看板', icon: 'dashboard', hidden: false, sort: 9},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/enterprise-dashboard/overview',
|
path: '/enterprise-dashboard/overview',
|
||||||
|
@ -1035,7 +1053,7 @@ export const systemRoutes: RouteRecordRaw[] = [
|
||||||
name: 'SystemResource',
|
name: 'SystemResource',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/system-resource/device-management/warehouse',
|
redirect: '/system-resource/device-management/warehouse',
|
||||||
meta: { title: '关于平台', icon: 'server', hidden: false, sort: 9 },
|
meta: { title: '关于平台', icon: 'server', hidden: false, sort: 10 },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/system-resource/device-management/warehouse',
|
path: '/system-resource/device-management/warehouse',
|
||||||
|
|
|
@ -70,6 +70,6 @@ declare global {
|
||||||
// for type re-export
|
// for type re-export
|
||||||
declare global {
|
declare global {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
|
||||||
import('vue')
|
import('vue')
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue