Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
e85221d6
Commit
e85221d6
authored
Feb 23, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分享列表
parent
fe95c51f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
224 additions
and
5 deletions
+224
-5
ConfigService.ts
src/services/ConfigService.ts
+5
-1
common.ts
src/utils/common.ts
+4
-1
Share.vue
src/views/SellTemplate/Share.vue
+199
-0
Workspace.vue
src/views/SellTemplate/Workspace.vue
+2
-0
ShareForm.vue
src/views/SellTemplate/components/ShareForm.vue
+7
-2
journeyAds.vue
src/views/SellTemplate/components/journeyAds.vue
+7
-1
No files found.
src/services/ConfigService.ts
View file @
e85221d6
...
...
@@ -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
src/utils/common.ts
View file @
e85221d6
...
...
@@ -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
())
+
"周前"
;
}
...
...
src/views/SellTemplate/Share.vue
0 → 100644
View file @
e85221d6
<
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
>
src/views/SellTemplate/Workspace.vue
View file @
e85221d6
...
...
@@ -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'
;
...
...
src/views/SellTemplate/components/ShareForm.vue
View file @
e85221d6
...
...
@@ -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
,
...
...
src/views/SellTemplate/components/journeyAds.vue
View file @
e85221d6
...
...
@@ -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=
"()=>s
hareId=item.FileId
"
>
分享
</el-dropdown-item>
<el-dropdown-item
icon=
"Position"
@
click
.
stop=
"()=>s
etFileShareHandler(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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment