Commit e85221d6 authored by 罗超's avatar 罗超

分享列表

parent fe95c51f
......@@ -175,7 +175,7 @@ class ConfigService{
return Api.Post("triptemplate_SetTemplateConfigData",params)
}
static async SetShareAsync(params:{ShareFileId:number,ShareList:{ShareType:number,ShareTargetIds:string,EditType:string}[]}):Promise<HttpResponse>{
static async SetShareAsync(params:{ShareFileId:number,FileType:number,ShareList:{ShareType:number,ShareTargetIds:string,EditType:string}[]}):Promise<HttpResponse>{
return Api.Post("triptemplate_SetTripShare",params)
}
......@@ -202,5 +202,9 @@ class ConfigService{
params.pageIndex=1
return Api.Post("triptemplate_HomeQuery",params)
}
static async QueryGiveMeShareDocumentAsync(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_GetShareMyFile",params)
}
}
export default ConfigService;
\ No newline at end of file
......@@ -79,9 +79,12 @@ export const formatDateTimeToRead = (dateStr:string,prefix:string='') =>{
let dayC =diffValue/day;
let hourC =diffValue/hour;
let minC =diffValue/minute;
if(monthC>=1){
if(monthC>=1 && monthC<=12){
result=parseInt(monthC.toString()) + "月前";
}
else if(monthC>12){
result=dateStr
}
else if(weekC>=1){
result=parseInt(weekC.toString()) + "周前";
}
......
<template>
<div class="q-px-md q-pt-lg column full-height">
<div class="q-pl-lg row q-mb-lg">
<div class="col row items-center q-pl-md">
<h5 class="row items-center">
<span class="pointer" v-if="queryObj.FileId > 0" @click="backInquireHandler">
<el-icon class="q-pt-md" size="20">
<ArrowLeft />
</el-icon>
</span>
<span class="q-pl-md" :class="[queryObj.FileId == 0 ? '' : 'row items-center']">
<span class="pointer" @click="(queryObj.FileId = 0), refreshHandler()">分享</span>
<breadPeeling v-if="queryObj.FileId" :navigations="navigations" @Inquire="breadPeelingInquire">
</breadPeeling>
</span>
</h5>
<div class="select-btn q-pl-lg pointer q-mt-sm">
<el-icon>
<RefreshRight v-if="!refreshLoading" @click="() => refreshHandler()" />
<Refresh v-else />
</el-icon>
</div>
</div>
<div></div>
</div>
<div class="col full-width">
<el-table class="sample-table" :data="data" style="width: 100%" height="100%" v-loading="loading">
<el-table-column type="selection" width="20" />
<el-table-column label="文档名称" className="indentLeft">
<template #default="scope">
<div class="row items-center full-width" style="padding-left: 12px;">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708337830000_43.png" height="25" v-if="scope.row.FileType==1" />
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708250377000_777.png" height="25" v-else-if="scope.row.FileType==2" />
<img src="@/assets/img/file.png" height="25" v-else />
<div class="temp-tr col q-ml-md file-name" :class="{'cusor-pointer':scope.row.FileType==0}">
<el-tooltip effect="dark" :content="scope.row.FileName">
{{ scope.row.FileName }}
</el-tooltip>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="最近修改" width="150">
<template #default="scope">
{{ formatDateTimeToRead(scope.row.UpdateTime&&scope.row.UpdateTime!=''?scope.row.UpdateTime:scope.row.CreateTime) }}
</template>
</el-table-column>
<el-table-column label="分享人" prop="CreateName" width="100" />
<el-table-column label="操作" width="120">
<template #default="scope">
<div class="row items-center" :class="{'hover':showItemId!=scope.row.FileId}">
<el-button type="primary" icon="View" size="small" @click.stop="openFileDocument(scope.row)" v-if="scope.row.FileType!=0">查看</el-button>
<el-dropdown class="q-pl-md cusor-pointer" trigger="click" @visible-change="(val:boolean)=>dropdownChange(val,scope.row.FileId)">
<el-icon size="16" color="#b1b7cf"><MoreFilled /></el-icon>
<template #dropdown>
<el-dropdown-menu class="q-pa-md">
<el-dropdown-item v-if="scope.row.IsEditor && scope.row.FileType!=0" icon="EditPen">编辑</el-dropdown-item>
<el-dropdown-item v-if="scope.row.IsDownload && scope.row.FileType!=0" icon="Download">导出</el-dropdown-item>
<el-dropdown-item icon="Copy" v-if="scope.row.IsView">复制到</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</template>
</el-table-column>
<template #empty>
<el-empty :image-size="150" v-if="(!data || data.length==0) && !loading" description="没有分享给我的文档" />
</template>
</el-table>
</div>
</div>
</template>
<script setup lang="ts">
import { ApiResult } from "@/configs/axios";
import ConfigService from "@/services/ConfigService";
import { ElMessage } from "element-plus";
import { reactive, ref } from "vue";
import {formatDateTimeToRead, query} from '@/utils/common'
import { Download,View } from "@element-plus/icons-vue";
const queryObj = reactive<any>({
pageIndex: 1,
pageSize: 50,
pageCount: 0, //总页数
FileType: 0,
FileId: 0,
});
const refreshLoading = ref(false);
const navigations = ref<{ FileId: number; FileName: string }[]>([]);
const selectAll = ref(false);
const selectedDatas = ref<any[]>();
const data = ref<any[]>([])
const loading = ref(false)
const pageCount = ref(0)
const showItemId = ref(0)
const backInquireHandler = () => {
let Navigation = navigations.value[navigations.value.length - 2];
if (Navigation && Navigation.FileId) breadPeelingInquire(Navigation.FileId, navigations.value.length - 2);
else breadPeelingInquire(0, 0);
};
const breadPeelingInquire = (FileId: number, index: number) => {
selectAll.value = false;
selectedDatas.value = [];
navigations.value.splice(index + 1, navigations.value.length - 1);
queryObj.FileId = FileId;
refreshHandler();
}
const getDocumentData = async () => {
if(loading.value) return
loading.value=true
try {
const response = await ConfigService.QueryGiveMeShareDocumentAsync(queryObj)
if(response.data.resultCode == ApiResult.SUCCESS){
pageCount.value = response.data.data.pageCount
data.value = data.value.concat(response.data.data.pageData)
}
} catch (error) {
ElMessage.error({
message:'数据加载异常,请刷新页面'
})
}
loading.value=false
refreshLoading.value=false
}
const openFileDocument = (item:any) => {
let param = query()
const url = `${process.env.VUE_APP_SHARE_URL}/?uid=${param.uid}&sellId=${item.FileId}&ViewSlideshow=1`
window.open(url);
}
const exportDocument = (item:any) => {
let url = `http://fileservice.oytour.com/api/img/${item.FileId}/1/png/1`
if(item.FileType==1) url = `http://fileservice.oytour.com/api/pdf/${item.FileId}`
window.open(url);
}
const dropdownChange = (val:boolean,id:number) => {
showItemId.value = val?id:0
}
const refreshHandler = () => {
};
getDocumentData()
</script>
<style>
.sample-table{
font-size: 12px !important;
font-family: microsoft yahei !important;
}
.sample-table .el-table-column--selection{
border: none !important;
}
.sample-table .el-table-column--selection .cell{
padding: 0 !important;
padding-right: 5px !important;
padding-left: 5px !important;
}
.sample-table th .cell{
font-weight: normal !important;
}
.sample-table td, .sample-table th {
border-bottom: 1px solid #f6f6f6 !important;
}
.sample-table td{
/* color:#000; */
}
.sample-table tr td .el-checkbox,
.sample-table tr td .hover{
visibility: hidden !important;
}
.sample-table tr:hover td .el-checkbox,
.sample-table tr td .is-checked,
.sample-table tr:hover td .hover{
visibility: visible !important;
}
.sample-table .indentLeft{
border:none !important;
padding: 0 !important;
}
.sample-table .indentLeft .cell{
padding: 0 !important;
}
.sample-table .temp-tr,
.sample-table th.indentLeft{
border-bottom: 1px solid #f6f6f6 !important;
padding: 8px 0 !important;
}
.sample-table th.indentLeft .cell{
padding: 0 12px !important;
}
.sample-table .file-name{
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
width: 0;
}
/* .sample-table th:nth-child(2) .cell{
padding-left: 0 !important;
} */
</style>
......@@ -78,6 +78,7 @@
<div class="col">
<BrowsingHistory :current-menu="currentMenu" v-if="currentMenu==0"></BrowsingHistory>
<journeyAds :position="position" :current-menu="currentMenu" v-if="currentMenu==3||currentMenu==4" @destroy-position="()=>position=null"></journeyAds>
<ShareList v-if="currentMenu==2"></ShareList>
</div>
</div>
</div>
......@@ -89,6 +90,7 @@ import { storeToRefs } from 'pinia';
import { ref,reactive,provide,inject } from 'vue';
import SearchDocument from './components/SearchDocument.vue'
import BrowsingHistory from './components/BrowsingHistory.vue'
import ShareList from './Share.vue';
import journeyAds from './components/journeyAds.vue'
import { Plus,ArrowDown,Clock,Star,Share,Picture,Management,Delete,RefreshRight,Refresh,Loading } from '@element-plus/icons-vue';
......
......@@ -12,7 +12,7 @@
<el-select v-model="selectedCompnays" collapse-tags multiple placeholder="请选择公司" class="full-width" v-if="currentType==1">
<el-option :label="x.BName" :value="x.Id" v-for="x in allBranchs" />
</el-select>
<el-select v-model="selectedPeoples" filterable collapse-tags multiple placeholder="请选择员工" class="full-width" v-if="currentType==3">
<el-select v-model="selectedPeoples" filterable collapse-tags multiple placeholder="请选择员工" class="full-width" v-if="currentType==4">
<el-option :label="x.name" :value="x.empId" v-for="x in allPeoples" />
</el-select>
<el-tree-select
......@@ -109,7 +109,11 @@ const props = defineProps({
id:{
type:Number,
required:true
}
},
fileType:{
type:Number,
required:true
},
})
const emit = defineEmits<{
(event: 'close'): void
......@@ -265,6 +269,7 @@ const saveShareHandler = async ()=>{
try {
let response = await ConfigService.SetShareAsync({
ShareFileId: props.id,
FileType:props.fileType,
ShareList: [{
ShareType: currentType.value,
ShareTargetIds: ids,
......
......@@ -149,7 +149,7 @@
<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 icon="Position" @click.stop="()=>shareId=item.FileId">分享</el-dropdown-item>
<el-dropdown-item icon="Position" @click.stop="()=>setFileShareHandler(item)">分享</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 v-if="item.FileType" icon="CopyDocument" @click.stop="CopyTo(item)">复制到</el-dropdown-item>
......@@ -192,6 +192,7 @@
</div>
<ShareForm
:id="shareId"
:file-type="shareFileType"
v-if="shareId > 0"
@close="() => (shareId = 0,refreshHandler())"
></ShareForm>
......@@ -259,6 +260,7 @@ const props = defineProps({
const PopoverVisibleControls = ref(false);
const shareId = ref(0);
const shareFileType = ref(0)
const journeyAdsDetails = ref('');
const isHistoricalVersion = ref(false);
const isCopyTo = ref(false);
......@@ -711,6 +713,10 @@ const checkPositionHandler = (n:any)=>{
emit('destroy-position')
}
}
const setFileShareHandler=(item:any)=>{
shareFileType.value=item.FileType
shareId.value =item.FileId
}
watch(
() => searchData.value.SellTemplateType,
......
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