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
c9f02bb5
Commit
c9f02bb5
authored
Feb 23, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成搜索和文件位置打开功能
parent
c6067e8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
8 deletions
+61
-8
Workspace.vue
src/views/SellTemplate/Workspace.vue
+8
-4
SearchDocument.vue
src/views/SellTemplate/components/SearchDocument.vue
+26
-1
journeyAds.vue
src/views/SellTemplate/components/journeyAds.vue
+27
-3
No files found.
src/views/SellTemplate/Workspace.vue
View file @
c9f02bb5
...
...
@@ -3,7 +3,7 @@
<div
class=
"row q-pa-md items-center"
style=
"padding-bottom: 15px;"
>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708239425000_437.png"
style=
"height: 30px;"
/>
<div
class=
"col text-center"
>
<SearchDocument></SearchDocument>
<SearchDocument
@
open-position=
"openFilePosition"
></SearchDocument>
</div>
<div
class=
"user"
>
<el-avatar
:size=
"30"
:src=
"userInfo.Icon"
v-if=
"userInfo.Icon"
/>
...
...
@@ -77,7 +77,7 @@
</div>
<div
class=
"col"
>
<BrowsingHistory
:current-menu=
"currentMenu"
v-if=
"currentMenu==0"
></BrowsingHistory>
<journeyAds
:
current-menu=
"currentMenu"
v-if=
"currentMenu==3||currentMenu==4
"
></journeyAds>
<journeyAds
:
position=
"position"
:current-menu=
"currentMenu"
v-if=
"currentMenu==3||currentMenu==4"
@
destroy-position=
"()=>position=null
"
></journeyAds>
</div>
</div>
</div>
...
...
@@ -97,6 +97,7 @@ import { useSellTemplateStore, useScreenStore, useSlidesStore } from '@/store'
const
{
userInfo
}
=
storeToRefs
(
userStore
())
const
currentMenu
=
ref
<
number
>
(
0
)
const
position
=
ref
<
{
FileId
:
number
,
FileType
:
1
|
2
,
Position
:{
FileId
:
number
,
FileName
:
string
}[]}
|
null
>
(
null
)
const
searchData
=
ref
({}
as
any
)
searchData
.
value
=
inject
(
injectKeyTemplate
)
...
...
@@ -116,8 +117,11 @@ const sellAdd = (type:number) =>{
marketStore
.
setMarket
(
true
)
}
const
openFilePosition
=
(
playload
:{
FileId
:
number
,
FileType
:
1
|
2
,
Position
:{
FileId
:
number
,
FileName
:
string
}[]})
=>
{
const
openFilePosition
=
(
playload
:
any
)
=>
{
position
.
value
=
playload
currentMenu
.
value
=
playload
.
FileType
==
1
?
3
:
4
searchData
.
value
.
currentMenu
=
currentMenu
.
value
searchData
.
value
.
SellTemplateType
=
playload
.
FileType
}
const
setCurrentMenuHandler
=
(
i
:
number
)
=>
{
...
...
src/views/SellTemplate/components/SearchDocument.vue
View file @
c9f02bb5
...
...
@@ -36,7 +36,7 @@
<
/template
>
<
el
-
menu
mode
=
"vertical"
>
<
el
-
menu
-
item
index
=
"1"
@
click
=
"editorFileHandler(item)"
>
打开文件
<
/el-menu-item
>
<
el
-
menu
-
item
index
=
"2-4-1"
>
打开文件所在位置
<
/el-menu-item
>
<
el
-
menu
-
item
index
=
"2-4-1"
@
click
=
"openFilePositionHandler(item)"
>
打开文件所在位置
<
/el-menu-item
>
<
/el-menu
>
<
/el-popover
>
...
...
@@ -56,6 +56,11 @@ import { storeToRefs } from 'pinia';
import
{
formatDateTimeToRead
}
from
'@/utils/common'
import
{
useScreenStore
,
useSellTemplateStore
,
useSlidesStore
}
from
'@/store'
;
import
{
injectKeyTemplate
}
from
'@/types/injectKey'
;
import
{
pl
}
from
'element-plus/es/locale'
;
const
emit
=
defineEmits
<
{
(
event
:
'open-position'
,
playload
:
any
):
void
}
>
()
const
{
userInfo
}
=
storeToRefs
(
userStore
())
const
searchKey
=
ref
<
string
>
(
''
)
...
...
@@ -130,6 +135,26 @@ const changeSearchType = (val:string='')=>{
if
(
val
!=
''
)
searchType
.
value
=
val
searchHandler
()
}
const
openFilePositionHandler
=
(
item
:
any
)
=>
{
let
playload
=
{
FileId
:
item
.
FileId
,
FileType
:
item
.
FileType
,
Position
:[]
}
if
(
item
.
FolderPath
&&
item
.
FolderPath
!=
'/'
){
let
fp
=
item
.
FolderPath
.
split
(
'/'
)
let
fn
=
item
.
FolderName
.
split
(
'/'
)
let
posis
:
any
[]
=
[]
fp
.
forEach
((
x
:
string
,
i
:
number
)
=>
{
posis
.
push
({
FileId
:
x
,
FileName
:
fn
[
i
]
}
)
}
)
playload
.
Position
=
posis
}
emit
(
'open-position'
,
playload
)
}
<
/script
>
<
style
>
.
search
-
area
{
...
...
src/views/SellTemplate/components/journeyAds.vue
View file @
c9f02bb5
...
...
@@ -251,7 +251,7 @@ const props = defineProps({
type
:
Number
,
default
:
3
,
},
P
osition
:{
p
osition
:{
type
:
Object
as
PropType
<
{
FileId
:
number
,
FileType
:
1
|
2
,
Position
:{
FileId
:
number
,
FileName
:
string
}[]}
|
null
>
,
default
:
null
}
...
...
@@ -295,7 +295,9 @@ const folderObj = ref<{
let
TemplateType
=
0
;
if
(
searchData
.
value
.
SellTemplateType
)
TemplateType
=
searchData
.
value
.
SellTemplateType
;
const
emit
=
defineEmits
<
{
(
event
:
'destroy-position'
):
void
}
>
()
const
queryObj
=
reactive
({
pageIndex
:
1
,
pageSize
:
50
,
...
...
@@ -695,6 +697,20 @@ const operaFolder = (id: number, name: string) => {
folderObj
.
value
.
name
=
name
;
folderObj
.
value
.
type
=
queryObj
.
FileType
;
};
const
checkPositionHandler
=
(
n
:
any
)
=>
{
if
(
n
){
if
(
n
.
Position
&&
n
.
Position
.
length
>
0
){
Navigations
.
value
=
n
.
Position
queryObj
.
FileId
=
n
.
Position
[
n
.
Position
.
length
-
1
].
FileId
queryObj
.
FileType
=
0
}
else
{
Navigations
.
value
=
[]
queryObj
.
FileId
=
0
queryObj
.
FileType
=
n
.
FileType
}
emit
(
'destroy-position'
)
}
}
watch
(
()
=>
searchData
.
value
.
SellTemplateType
,
...
...
@@ -712,9 +728,17 @@ watch(() => queryObj.FileId,(n, o) => {
if
(
!
n
)
Navigations
.
value
=
[]
}
);
watch
(()
=>
props
.
position
,(
n
,
o
)
=>
{
if
(
n
){
checkPositionHandler
(
n
)
refreshHandler
()
}
},{
deep
:
true
})
onMounted
(()
=>
{});
checkPositionHandler
(
props
.
position
)
querySearchHandler
();
</
script
>
...
...
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