diff --git a/.env.development b/.env.development index 3bcdb99..98cfc98 100644 --- a/.env.development +++ b/.env.development @@ -10,4 +10,7 @@ VITE_APP_BASE_URL = 'http://myvuetest.net' VITE_APP_TOKEN_KEY = 'offlineAccessSystemAppToken' VITE_APP_SJZT_URL = 'http://172.20.5.86/prod-api' VITE_APP_SYSTEM_APP = 'stzl' -VITE_APP_AGAIN = 1 \ No newline at end of file +VITE_APP_AGAIN = 1 +VITE_OFFICE_HOST='http://myvuetest.net/kkapi' +VITE_ONLYOFFICE_HOST = 'http://myvuetest.net/onlyoffice' +VITE_DEFAULT_AI_AGENT = '5bd9b0e9-d3f4-4089-670a-880009e925a8' \ No newline at end of file diff --git a/.env.production b/.env.production index 1d53655..3acaff3 100644 --- a/.env.production +++ b/.env.production @@ -6,4 +6,6 @@ VITE_APP_BASE_API = '' VITE_APP_TOKEN_KEY = 'onlineAccessSystemAppToken' VITE_APP_SJZT_URL = 'http://120.224.6.6:29911/prod-api' VITE_APP_SYSTEM_APP = 'stzl' -VITE_APP_AGAIN = 1 \ No newline at end of file +VITE_APP_AGAIN = 1 +VITE_ONLYOFFICE_HOST = 'https://gyhlw.hxgk.group/onlyoffice' +VITE_DEFAULT_AI_AGENT = '23a3c2c5-2de1-40df-59fa-a9206b11861d' \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d823b8a..bba360a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@element-plus/icons-vue": "^2.3.1", "@nutui/nutui": "^4.0.0", + "@onlyoffice/document-editor-vue": "^1.6.1", "@tinymce/tinymce-vue": "^6.1.0", "@vueup/vue-quill": "^1.2.0", "@wangeditor/editor": "^5.1.23", @@ -996,6 +997,18 @@ "resolved": "https://registry.npmmirror.com/@one-ini/wasm/-/wasm-0.1.1.tgz", "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==" }, + "node_modules/@onlyoffice/document-editor-vue": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@onlyoffice/document-editor-vue/-/document-editor-vue-1.6.1.tgz", + "integrity": "sha512-sdU7h684ESSdXvGNDcMf73UmToiZGMVO5QRIazTmGfm+bKOnT5ildomeagYFdnQaHQH0J28EJqc4jqXOcQbicA==", + "license": "Apache-2.0", + "dependencies": { + "lodash": "^4.17.21" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/@parcel/watcher": { "version": "2.4.1", "resolved": "https://registry.npmmirror.com/@parcel/watcher/-/watcher-2.4.1.tgz", diff --git a/package.json b/package.json index 2385fa4..8709db7 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "dependencies": { "@element-plus/icons-vue": "^2.3.1", "@nutui/nutui": "^4.0.0", + "@onlyoffice/document-editor-vue": "^1.6.1", "@tinymce/tinymce-vue": "^6.1.0", "@vueup/vue-quill": "^1.2.0", "@wangeditor/editor": "^5.1.23", diff --git a/src/api/doc/index.ts b/src/api/doc/index.ts new file mode 100644 index 0000000..5748dbb --- /dev/null +++ b/src/api/doc/index.ts @@ -0,0 +1,191 @@ +/** +* @ 作者: han2015 +* @ 时间: 2025-05-12 15:39:13 +* @ 备注: 文档管理API +*/ + +import request from '@/utils/axios/index'; +import { AxiosPromise } from 'axios'; +import { matterPage,matterResutList,createDir,createShare,respCreateShare,matterTreeList} from './type'; + + +/** + * 获取分享列表 + */ +export function getShareList( uid:string,data?: matterPage): AxiosPromise { + return request({ + url: '/hxpan/api/share/page', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 创建空间 + */ +export function doCreateSpace( uid:string,_name:string) { + return request({ + url: '/hxpan/api/space/create', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: {name:_name} + }); +} + +/** + * 获取我的空间列表 + */ +export function getMySpaces(uid:string,data?: any){ + return request({ + url: '/hxpan/api/space/list', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * share browse + */ +export function getShareBrowse( uid:string,data?: matterPage): AxiosPromise { + return request({ + url: '/hxpan/api/share/browse', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * share delete + */ +export function postShareDelete( uid:string,data?: matterPage): AxiosPromise { + return request({ + url: '/hxpan/api/share/delete', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 获取目录文件 + */ +//export function getMatterList( uid:string,data?: matterPage): AxiosPromise { +export function getMatterList( uid:string,data?: matterPage): AxiosPromise { + return request({ + url: '/hxpan/api/matter/page', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 获取回收站文件 + */ +//export function getMatterList( uid:string,data?: matterPage): AxiosPromise { +export function getRecyclingList( uid:string,data?: matterPage): AxiosPromise { + return request({ + url: '/hxpan/api/matter/recycling', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 新建目录 + */ +export function postCreateDir(uid:string,data?: createDir){ + return request({ + url: '/hxpan/api/matter/create/directory', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 删除文件或目录 + */ +export function postDelMatter(uid:string,data?: any){ + return request({ + url: '/hxpan/api/matter/delete', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} +/** + * 批量删除文件或目录 + */ +export function postDelMatBatch(uid:string,data?: any){ + return request({ + url: '/hxpan/api/matter/delete/batch', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 分享单个文件 + */ +export function postCreateShare(uid:string,data?: createShare): AxiosPromise{ + return request({ + url: '/hxpan/api/share/create', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 更改文件名 + */ +export function postMatterRename(uid:string,data?: {uuid:string;name:string}){ + return request({ + url: '/hxpan/api/matter/rename', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} \ No newline at end of file diff --git a/src/api/doc/space.ts b/src/api/doc/space.ts new file mode 100644 index 0000000..73630ae --- /dev/null +++ b/src/api/doc/space.ts @@ -0,0 +1,223 @@ +import request from '@/utils/axios/index'; +import { AxiosPromise } from 'axios'; +import { matterPage,createDir,matterTreeList,matterInfo} from './type'; + +/** + * 获取空间目录文件 + */ +export function getSpaceMatterList( uid:string,data?: matterPage): AxiosPromise { + return request({ + url: '/hxpan/api/space/page', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 新建目录 + */ +export function doCreateSpaceDir(uid:string,data?: createDir){ + return request({ + url: '/hxpan/api/space/directory', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +export function doCreateAiagent(uid:string,data?: {space:string,matter:string}){ + return request({ + url: '/hxpan/api/space/aiagent', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 空间权限控制管理 + */ +export function doAccessManage(uid:string,data?: any){ + return request({ + url: '/hxpan/api/space/access', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 删除空间 + */ +export function doDelSpace(uid:string,data?: any){ + return request({ + url: '/hxpan/api/space/delete', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 重命名 + */ +export function spaceMatterRename(uid:string,data?: any){ + return request({ + url: '/hxpan/api/space/rename', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + + +/** + * 删除文件或目录 + */ +export function doDelSpaceMatter(uid:string,data?: any){ + return request({ + url: '/hxpan/api/space/materdelete', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +//-------------------AI backend APIs--------------- +/** + * 文档训练 + */ +export function doAiTraining(_url:string,data?: any){ + return request({ + url: '/aibot'+_url, + method: 'post', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +export interface aiChatData{ + inputs:object; + query?:string; + response_mode:string; + conversation_id?:string; + user:string, + file?:[] +} + + +/** + * 问答api + */ +export function doAiChat(_url:string,data: aiChatData,sig?:AbortSignal){ + return fetch( + _url,{ + method: 'post', + headers: { + 'Content-Type': 'application/json' + }, + signal:sig, + body: JSON.stringify(data) + } + ) +} + +/** + * 工作流 + */ +export function doAiWorkflow(_url:string,data: aiChatData){ + return fetch( + _url,{ + method: 'post', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(data) + } + ) +} +/** + * 通过userid获取记录列表 + * @requires userid + */ +export function getAiChatList(data:any){ + return request({ + url: '/aibot/chat/list', + method: 'post', + data: data + }); +} + +/** + * 获取单个会话 + * @requires userid + * @requires uuid + */ +export function getAiChat(data: any){ + return request({ + url: '/aibot/chat', + method: 'post', + data: data + }); +} + +/** + * 删除单个会话 + * @requires userid + * @requires uuid + */ +export function delAiChat(data: any){ + return request({ + url: '/aibot/chat/del', + method: 'post', + data: data + }); +} + +/** + * 更新会话 + * @requires userid + * @requires uuid + */ +export function setAiChat(data: any){ + return request({ + url: '/aibot/chat/update', + method: 'post', + data: data + }); +} + +/** + * 获取智能体 + */ +export function getAiagentList(data?: any){ + return request({ + url: '/aibot/agent/list', + method: 'post', + data: data + }); +} \ No newline at end of file diff --git a/src/api/doc/type.ts b/src/api/doc/type.ts new file mode 100644 index 0000000..6afc9d9 --- /dev/null +++ b/src/api/doc/type.ts @@ -0,0 +1,101 @@ +/** +* @ 作者: han2015 +* @ 时间: 2025-05-12 15:39:13 +* @ 备注: 文档管理api 结构定义 +*/ +import request from '@/utils/axios/index'; +import { AxiosPromise } from 'axios'; +/** + * 拉去首页文件列表 + */ +export interface matterPage{ + page?:number; + pageSize?:number; + puuid?:string; + deleted?:boolean; + orderDir?:string; + name?:string; + space?:string; + orderCreateTime?:string; +} + +export interface matterInfo{ + name?:string; + updateTime?:string; + uuid:string; //文件uuid + userUuid?:string; //owner uuid + puuid?:string; // parent dir uuid + path?:string; + size?:number; + agent?:boolean; + dir?:boolean; + deleted?:boolean; + expireInfinity?:boolean; + expireTime?:string; + permitVal?:number; //该值是当前用户permits的解析结果 + permits?:matterPermit; +} +export interface matterPermit{ + id:number; + MatterUuid:string; + data:string; +} +export interface shareItem{ + name?:string; + updateTime?:string; + uuid:string; //文件uuid + code:string; + userUuid?:string; //owner uuid + puuid?:string; // parent dir uuid + path?:string; + expireInfinity?:boolean; + expireTime?:string; + permitList?:string; +} + +export interface matterTree extends matterInfo { + manager?:boolean; + children:matterTree[] +} + +export type matterTreeList = PageResult + +export type matterResutList = PageResult + +export interface createDir{ + userUuid?:string; + puuid:string; + name:string; + space?:string; +} + +export interface createShare{ + matterUuids:string; + expireInfinity:boolean; + expireTime:string; + permitList:string; + permitInfos:string; + len:number; +} + +export interface respCreateShare{ + code?:string; + shareType?:string; + expireTime?:string; + name?:string; + uuid?:string; +} + +/** + * 文件上传 + */ +export function doFileUpload(params:FormData,_url:string): AxiosPromise { + return request({ + url: _url, + method: 'post', + data: params, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +} \ No newline at end of file diff --git a/src/api/hr/user/share_ctrol.ts b/src/api/hr/user/share_ctrol.ts new file mode 100644 index 0000000..58acc21 --- /dev/null +++ b/src/api/hr/user/share_ctrol.ts @@ -0,0 +1,152 @@ +import request from '@/utils/axios/index'; +import { AxiosPromise } from 'axios'; + +export interface shareOrgInfo{ + id:number + name:string + superior:number + level:number + status:boolean + child :shareOrgInfo[] +} + +/** + * 搜索条件 + */ +export interface parsArchList extends PageQuery{ + page:number, + pagesize:number + adminorg?:number; //行政组织 + keywords?:string; +} + +export interface memberInfo{ + id:number, + name:string, + icon:string, + company:number, + maindeparment:number, + sunmaindeparment:number, + adminorg:number, + state:number, + keystr:string, + positionname :string, + maindeparmentname:string +} + +export type shareArchivesList = PageResult + +/** + * 获取行政组织树 + */ + export function getOrgTreeList(data: {orgid?:number}): AxiosPromise{ + return request({ + url: '/hrapi/org/govnewthreeing', + method: 'post', + data: data + }); +} + +/** + * 获取人员档案 + */ + export function getArchivesListPage(data?: parsArchList): AxiosPromise { + return request({ + url: '/hrapi/staff/archiveslistcont', + method: 'post', + data: data + }); +} + +/** + * 获取文档成员权限列表 + */ +export function getPermitedList(uid:string,data:{uuid:string}): AxiosPromise<{permited:string[],infos:string[]}> { + return request({ + url: '/hxpan/api/share/permits', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} +/** + * 获取空间成员列表 + */ +export function getSpaceMemberList(uid:string,data:{space?:string,matter:string}): AxiosPromise<{ + members:string[], + dprts:string[], + managers:string, + permits:Object, +}> { + return request({ + url: '/hxpan/api/space/members', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 添加空间管理员 + */ +export function addSpaceManager(uid:string,data:{space:string,mangers:string}): AxiosPromise<{members:string[],dprts:string[]}> { + return request({ + url: '/hxpan/api/space/addmanagers', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 更新matter权限 + */ +export function updateSpaceMetterPermit(uid:string,data:{space:string,matter:string,permits:Object}): AxiosPromise<{members:string[],dprts:string[]}> { + return request({ + url: '/hxpan/api/space/permit/update', + method: 'post', + headers: { + 'Identifier':uid, + }, + data: data + }); +} + +/** + * 重置matter特定权限 + */ +export function resetSpaceMatterPermit(uid:string,data:{space:string,matter:string}): AxiosPromise<{members:string[],dprts:string[]}> { + return request({ + url: '/hxpan/api/space/permit/reset', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} + +/** + * 保存文档成员权限修改 + */ +export function postPermitedList(uid:string,data?:{permitList:string,permitInfos:string, update:string,uid:string,uuid:string,len:number}){ + return request({ + url: '/hxpan/api/share/permits', + method: 'post', + headers: { + 'Identifier':uid, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data: data + }); +} diff --git a/src/assets/icons/cell-icon.svg b/src/assets/icons/cell-icon.svg new file mode 100644 index 0000000..5d973e9 --- /dev/null +++ b/src/assets/icons/cell-icon.svg @@ -0,0 +1,2 @@ + +file_type_excel2 \ No newline at end of file diff --git a/src/assets/icons/file-icon.svg b/src/assets/icons/file-icon.svg new file mode 100644 index 0000000..6780166 --- /dev/null +++ b/src/assets/icons/file-icon.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/folder-icon.svg b/src/assets/icons/folder-icon.svg new file mode 100644 index 0000000..12dc47d --- /dev/null +++ b/src/assets/icons/folder-icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/assets/icons/img-icon.svg b/src/assets/icons/img-icon.svg new file mode 100644 index 0000000..61a2a01 --- /dev/null +++ b/src/assets/icons/img-icon.svg @@ -0,0 +1,2 @@ + +file_type_image \ No newline at end of file diff --git a/src/assets/icons/pdf-icon.svg b/src/assets/icons/pdf-icon.svg new file mode 100644 index 0000000..c7c3550 --- /dev/null +++ b/src/assets/icons/pdf-icon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/slide-icon.svg b/src/assets/icons/slide-icon.svg new file mode 100644 index 0000000..b9f1fb6 --- /dev/null +++ b/src/assets/icons/slide-icon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/word-icon.svg b/src/assets/icons/word-icon.svg new file mode 100644 index 0000000..b128e9f --- /dev/null +++ b/src/assets/icons/word-icon.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/utils/pinia/stores/modules/orgMember.ts b/src/utils/pinia/stores/modules/orgMember.ts new file mode 100644 index 0000000..efd46a9 --- /dev/null +++ b/src/utils/pinia/stores/modules/orgMember.ts @@ -0,0 +1,37 @@ +import { defineStore } from 'pinia' +import { ref} from 'vue'; +import request from "@/utils/axios/index"; + +export const useOrgMemberStore = defineStore('orgMember', () => { + interface OrgMemberItem { + id: string; + name: string; + child?:OrgMemberItem[]; + } + + const listMap = ref>({}) + const dataTree = ref({ id: '', name: '', child: [] }) + + async function init() { + await request({ + url: "/systemapi/app/get_org_everyone_people",//"172.20.2.87:39168", + method: "post", + data:{id:"313",all: 1} + }).then((response) => { + // assuming response.data is an array of OrgMemberItem + dataTree.value={id:"313",name:"集团公司",child:response.data} + handleChildren(response.data) + }); + } + + function handleChildren(childs:any[]){ + childs.forEach(item => { + listMap.value[item.id] = item.name; + if(item.child){ + handleChildren(item.child) + } + }); + } + init() + return { listMap,dataTree } +}) \ No newline at end of file diff --git a/src/utils/router/index.ts b/src/utils/router/index.ts index 7740ef6..da835de 100644 --- a/src/utils/router/index.ts +++ b/src/utils/router/index.ts @@ -75,6 +75,28 @@ export const staticRouting : RouteRecordRaw[] = [ path: '/work_wechat', component: () => import('@/views/lookCodePage/index.vue'), meta: { hidden: true }, + }, + { + path: '/doc', + component: () => import('@/views/doc/index.vue'), + meta: { hidden: true }, + }, + { + path: '/mysapce', + component: () => import('@/views/doc/manage.vue'), + meta: { hidden: true }, + }, + { + path: '/onlyoffice', + component: () => import('@/views/doc/onlyoffice.vue'), + meta: { hidden: true }, + }, + { + path: '/spaces/:spaceid', + name: 'spaces', + props: route => ({ spaceid: route.params.spaceid}), + component: () => import('@/views/doc/space.vue'), + meta: { hidden: true }, } ] diff --git a/src/views/common/bottom/index.vue b/src/views/common/bottom/index.vue index 2253037..cfea5d0 100644 --- a/src/views/common/bottom/index.vue +++ b/src/views/common/bottom/index.vue @@ -29,6 +29,9 @@ const openPage = (val:number) => { case 5: router.push({ path: "/user",query:{fa:5}}); break; + case 6: + router.push({ path: "/doc",query:{fa:6}}); + break; default: router.push({ path: "/"}); } @@ -48,10 +51,10 @@ const openPage = (val:number) => {
应用
-
-
-
动态
-
+
+
+
云盘
+
我的
diff --git a/src/views/doc/agent.vue b/src/views/doc/agent.vue new file mode 100644 index 0000000..ad59e20 --- /dev/null +++ b/src/views/doc/agent.vue @@ -0,0 +1,427 @@ + + + + + + + \ No newline at end of file diff --git a/src/views/doc/index.vue b/src/views/doc/index.vue new file mode 100644 index 0000000..644db6b --- /dev/null +++ b/src/views/doc/index.vue @@ -0,0 +1,350 @@ + + + + + \ No newline at end of file diff --git a/src/views/doc/manage.vue b/src/views/doc/manage.vue new file mode 100644 index 0000000..9f40367 --- /dev/null +++ b/src/views/doc/manage.vue @@ -0,0 +1,776 @@ + + + + + + + \ No newline at end of file diff --git a/src/views/doc/onlyoffice.vue b/src/views/doc/onlyoffice.vue new file mode 100644 index 0000000..fdc187d --- /dev/null +++ b/src/views/doc/onlyoffice.vue @@ -0,0 +1,93 @@ + + + + \ No newline at end of file diff --git a/src/views/doc/popup.vue b/src/views/doc/popup.vue new file mode 100644 index 0000000..73c3102 --- /dev/null +++ b/src/views/doc/popup.vue @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/src/views/doc/preview.vue b/src/views/doc/preview.vue new file mode 100644 index 0000000..0c19591 --- /dev/null +++ b/src/views/doc/preview.vue @@ -0,0 +1,35 @@ + + + + \ No newline at end of file diff --git a/src/views/doc/sharePermission.vue b/src/views/doc/sharePermission.vue new file mode 100644 index 0000000..23e5d5f --- /dev/null +++ b/src/views/doc/sharePermission.vue @@ -0,0 +1,203 @@ + + + \ No newline at end of file diff --git a/src/views/doc/space.vue b/src/views/doc/space.vue new file mode 100644 index 0000000..908dccd --- /dev/null +++ b/src/views/doc/space.vue @@ -0,0 +1,867 @@ + + + + + + + + \ No newline at end of file diff --git a/src/views/doc/spacePermission.vue b/src/views/doc/spacePermission.vue new file mode 100644 index 0000000..860e053 --- /dev/null +++ b/src/views/doc/spacePermission.vue @@ -0,0 +1,382 @@ + + + + + diff --git a/src/views/doc/tools.ts b/src/views/doc/tools.ts new file mode 100644 index 0000000..f80e6ed --- /dev/null +++ b/src/views/doc/tools.ts @@ -0,0 +1,97 @@ +import { + Document, + Picture, + VideoPlay, + Headset, + Files, + Tickets, + } from '@element-plus/icons-vue' + import { matterInfo } from "@/api/doc/type" + +export function getExpirTime(val:string){ + let now= Date.now() //haomiao + switch(val){ + case "sixhour": + now+=6*3600*1000 + break + case "oneday": + now+=24*3600*1000 + break + case "threeday": + now+=3*24*3600*1000 + break + case "oneweek": + now+=7*24*3600*1000 + break + case "onemonth": + now+=30*24*3600*1000 + break + case "threemonth": + now+=90*24*3600*1000 + break + default: + now+=6*3600*1000 + } + let nt=new Date(now) + + return nt.toISOString().slice(0,10)+" "+nt.toLocaleTimeString() + } +export function checkExpirTime(val:matterInfo){ + if (val.expireInfinity) return false + if (val.expireTime) { + let now = Date.now() //haomiao + let expireTime = new Date(val.expireTime).getTime() + if (expireTime > now) return false + } + return true +} + +export const getFileIcon = (fileName:string) => { + const extension = fileName?.split('.').pop()?.toLowerCase()??''; + if (".doc, .docx, .html, .md, .txt, .wps, .xml".includes(extension)){ + return "word" + } else if(".csv, .xls, .xlsb, .xlsm, .xlsx".includes(extension)){ + return "cell" + }else if(".jpg, .jpeg, .png, .gif".includes(extension)){ + return "img" + }else if (extension==="pdf"){ + return "pdf" + }else if(".ppt, .pptm, .pptx".includes(extension)){ + return "slide" + }else if(".mp4, .mov, avi".includes(extension)){ + return "video" + }else if(".mp3, .wav".includes(extension)){ + return "audio" + } + + return "file" +} + +export function readableSize(val:matterInfo){ + if(val.size<1024) return "1 Kb" + //1024*1024 + if(val.size<1048576) return (val.size/1024).toFixed(1)+"Kb" + //1024*1024*1024 + if(val.size<1073741824) return (val.size/1048576).toFixed(1)+"Mb" + //1024*1024*1024*1024 + if(val.size<1099511627776) return (val.size/1073741824).toFixed(1)+"Gb" + + return "BIG" + } + + +export function fileType(name:string){ + const suffix=name.match(/(\.[a-zA-Z]+$)/) + if(suffix==null){ return ""} + + if (".doc, .docx, .html, .md, .txt, .wps, .xml".includes(suffix[0])){ + return "word" + } else if(".csv, .xls, .xlsb, .xlsm, .xlsx".includes(suffix[0])){ + return "cell" + }else if(".ppt, .pptm, .pptx".includes(suffix[0])){ + return "slide" + }else if (suffix[0]===".pdf"){ + return "pdf" + } + return "" +} \ No newline at end of file