Commit a805b73d authored by 罗超's avatar 罗超

完成分享功能

parent d4fb8556
......@@ -168,6 +168,11 @@ class ConfigService{
return Api.Post("triptemplate_RemoveTripShare",msg)
}
static async RemoveFileShareAsync(FileIdList:number[]):Promise<HttpResponse>{
let msg = {FileIdList}
return Api.Post("triptemplate_RemoveTripShareBatch",msg)
}
static async UpdateShareAsync(params:{ShareId:number,ShareTargetIds:string,EditType:string}):Promise<HttpResponse>{
return Api.Post("triptemplate_EditTripShare",params)
}
......
......@@ -149,7 +149,8 @@
<el-dropdown-menu class="q-pa-md" @click.stop="OffEdit">
<el-dropdown-item v-if="item.FileType" icon="EditPen" @click.stop="startEditTitle(item)">重命名</el-dropdown-item>
<el-dropdown-item v-if="item.FileType" icon="Clock" @click.stop="history(item)">历史版本</el-dropdown-item>
<el-dropdown-item v-if="item.FileType" icon="Position" @click.stop="()=>shareId=item.FileId">分享</el-dropdown-item>
<el-dropdown-item icon="Position" @click.stop="()=>shareId=item.FileId">分享</el-dropdown-item>
<el-dropdown-item v-if="item.IsShare" icon="Hide" @click.stop="removeShareHandler(item)">取消分享</el-dropdown-item>
<el-dropdown-item icon="Expand" @click.stop="MoveFile(item)">移动至</el-dropdown-item>
<el-dropdown-item icon="Delete" @click="editDelete(item,1)">删除</el-dropdown-item>
</el-dropdown-menu>
......@@ -191,7 +192,7 @@
<ShareForm
:id="shareId"
v-if="shareId > 0"
@close="() => (shareId = 0)"
@close="() => (shareId = 0,refreshHandler())"
></ShareForm>
<Folder
:folder-id="folderObj?.id"
......@@ -236,6 +237,7 @@ import Folder from "./Folder.vue";
import HistoricalVersion from "./HistoricalVersion.vue";
import TreeFile from "./TreeFile.vue";
import breadPeeling from "./breadPeeling.vue";
import { ApiResult } from "@/configs/axios";
const SalesEditorStore = useSellTemplateStore();
const marketStore = useScreenStore();
......@@ -260,6 +262,7 @@ const NewDataList = ref([] as Array<any>);
const searchData = ref({} as any);
searchData.value = inject(injectKeyTemplate);
const deleteLoading = ref<any>(null);
const removeShareLoading = ref<any>(null);
const datas = reactive({
Sort: 0,
selectedDatas: [] as Array,
......@@ -424,6 +427,32 @@ const startEditTitle = (row: any) => {
editObj.value = JSON.parse(JSON.stringify(row));
};
const removeShareHandler= async (item:any) =>{
if(removeShareLoading.value) return
removeShareLoading.value=ElLoading.service({
lock: true,
text: "正在处理",
})
let errmsg=''
try {
let response = await ConfigService.RemoveFileShareAsync([item.FileId])
if(response.data.resultCode==ApiResult.SUCCESS){
ElMessage.success({
message:'设置成功'
})
item.IsShare=false
} else errmsg='取消分享失败,请刷新重试'
} catch (error) {
errmsg = '取消分享失败,请刷新重试'
}
if(errmsg!='') {
ElMessage.error({
message:errmsg
})
}
removeShareLoading.value.close();
removeShareLoading.value = null;
}
// 全选按钮
const clickSelectAll = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment