diff --git a/src/api/doc/type.ts b/src/api/doc/type.ts index 28499e7..7472d70 100644 --- a/src/api/doc/type.ts +++ b/src/api/doc/type.ts @@ -49,8 +49,9 @@ export interface createShare{ matterUuids:string; expireInfinity:boolean; expireTime:string; - permitList:string - len:number + permitList:string; + permitInfos:string; + len:number; } export interface respCreateShare{ diff --git a/src/api/hr/people/share_ctrol.ts b/src/api/hr/people/share_ctrol.ts index 1b5b4c3..c9dae72 100644 --- a/src/api/hr/people/share_ctrol.ts +++ b/src/api/hr/people/share_ctrol.ts @@ -30,6 +30,7 @@ export interface memberInfo{ state:number, keystr:string, positionname :string, + maindeparmentname:string } export type shareArchivesList = PageResult @@ -59,7 +60,7 @@ export type shareArchivesList = PageResult /** * 获取文档成员权限列表 */ -export function getPermitedList(uid:string,data:{uuid:string}): AxiosPromise { +export function getPermitedList(uid:string,data:{uuid:string}): AxiosPromise<{permited:string[],infos:string[]}> { return request({ url: '/hxpan/api/share/permits', method: 'post', @@ -74,7 +75,7 @@ export function getPermitedList(uid:string,data:{uuid:string}): AxiosPromise([]) const searchname=ref("") -const newdir=ref("") -const currentHoverRow=ref("") -const selectedValue = ref("sixhour") -const tabSelected=ref([]) +const newdir=ref("") //创建新目录时的目录名 +const currentHoverRow=ref("") //table 行的按钮控制 +const selectedValue = ref("sixhour") //分享弹窗的世间变量 +const tabSelected=ref([]) //table组件多选数据维护 //to support tree mode refactor const treeData=ref([{name:'root',uuid:'root',children:[]}]) const treeRef = ref(); @@ -69,6 +69,7 @@ const fileList=ref([])//upload files function onShareMatter(row?:matterInfo){ const showSharePermission=ref(false) let permited ="" + let infos="" let _len=0 ElMessageBox({ title: row?.name+' 请选择分享有效时间', @@ -103,13 +104,11 @@ function onShareMatter(row?:matterInfo){ uid: uid, uuid: row?.uuid ?? "", modelValue: showSharePermission.value, - // "onUpdate:modelValue": (val: boolean) => { - // showSharePermission.value = val - // }, - confirmFunc: (_list: string[]) => { + confirmFunc: (_list: string[],_infos:string[]) => { // 组织权限数据 _len=_list.length permited = btoa(_list.join("|")) + infos=_infos.join("|"), showSharePermission.value = false }, closeFunc: () => { @@ -122,9 +121,11 @@ function onShareMatter(row?:matterInfo){ }).then(() => { let param; if (row){ - param={matterUuids:row.uuid,expireInfinity:false,expireTime:"",permitList:permited,len:_len} + param={matterUuids:row.uuid,expireInfinity:false,expireTime:"", + permitList:permited,len:_len,permitInfos:infos} }else if (tabSelected.value.length>1){ - param={matterUuids:tabSelected.value.map((item:matterInfo)=>item.uuid).join(","),expireInfinity:false,expireTime:"",permitList:permited,len:_len} + param={matterUuids:tabSelected.value.map((item:matterInfo)=>item.uuid).join(","),expireInfinity:false,expireTime:"", + permitList:permited,len:_len,permitInfos:infos} } if(param){ diff --git a/src/views/doc/share.vue b/src/views/doc/share.vue index 318bfad..c9b30ab 100644 --- a/src/views/doc/share.vue +++ b/src/views/doc/share.vue @@ -17,8 +17,8 @@ import { Share, Avatar, } from '@element-plus/icons-vue' -import {ElDialog, ElText } from "element-plus"; -import { getExpirTime, getFileIcon,checkExpirTime } from "./tools" +import {ElText } from "element-plus"; +import {getFileIcon,checkExpirTime } from "./tools" import sharePermission from './sharePermission.vue'; const route = useRoute() @@ -26,13 +26,14 @@ const userStore = useUserStore(); const uid=btoa("p0"+userStore.userInfoCont.userId); const siteHost=document.location.origin; const apiURL=import.meta.env.VITE_APP_BASE_API+"/hxpan/api" -const matterList = ref() +const matterList = ref() //文件列表 const browerMode=ref(false) //share模式 1)self-list(default) 2)brower -const currentHoverRow=ref("") - +const currentHoverRow=ref("") //当前选择的table行 +const drawerModel=ref(false) //右侧隐藏抽屉组件的状态控制 +const permitListRef=ref("") //右侧抽屉组件中文档成员列表的key数组字符串 import type { VNode } from 'vue' -const dynamicVNode = ref(null) +const dynamicVNode = ref(null) //permission 组件的父组件 @@ -86,8 +87,13 @@ function onShareMember(row:matterInfo){ dynamicVNode.value=h(sharePermission,{ uid:uid, uuid:row.uuid, - closeFunc:()=>{ + closeFunc:(refresh?:boolean)=>{ dynamicVNode.value=null + if (refresh) { + permitListRef.value="" + drawerModel.value=false + onLoadShareList() + } } }) } @@ -150,7 +156,7 @@ onMounted(() => {