Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-front
Overview
Overview
Details
Activity
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
platform
hg-front
Commits
1a486554
Commit
1a486554
authored
Sep 03, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
细节优化
parent
c8afd4b9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
17 deletions
+47
-17
edit.vue
pages/document/edit.vue
+45
-15
list.vue
pages/document/list.vue
+2
-2
HGAPP81.png
static/HGAPP81.png
+0
-0
No files found.
pages/document/edit.vue
View file @
1a486554
...
...
@@ -49,7 +49,7 @@
<view
class=
"flex-row"
>
<text
class=
"text-gray part-1"
>
版本
</text>
<text
class=
"text-gray part-2"
>
:
</text>
<text
class=
"text-title"
>
V
{{
orderInfo
.
docVersion
}}
</text>
<text
v-if=
"orderInfo&&orderInfo.docVersion"
class=
"text-title"
>
{{
'v'
+
orderInfo
.
docVersion
}}
</text>
</view>
<view
class=
"flex-row"
>
<text
class=
"text-gray part-1"
>
附件名称
</text>
...
...
@@ -78,13 +78,20 @@
</view>
</view>
<view
v-if=
"previewStatus"
class=
"preview-box"
>
<view
v-if=
"previewStatus
&& ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(orderInfo.fileSuffix)
"
class=
"preview-box"
>
<view
class=
"text-box"
>
<text
class=
"text-title"
>
图片预览
</text>
</view>
<image
:src=
"assetsPath+'/hggp/file/download/'+orderInfo.docId"
mode=
"widthFix"
@
tap=
"onPre"
></image>
</view>
<view
v-if=
"previewStatus && ['mp4','3gp','avi'].includes(orderInfo.fileSuffix)"
class=
"preview-box"
>
<view
class=
"text-box"
>
<text
class=
"text-title"
>
视频预览
</text>
</view>
<video
:src=
"assetsPath+'/hggp/file/download/'+orderInfo.docId"
></video>
</view>
<!--
<view
class=
"flex-col content-part-1"
>
<view
class=
"footer-content"
>
...
...
@@ -123,7 +130,9 @@
data
()
{
return
{
assetsPath
:
config
.
assetsPath
,
hostUrl
:
config
.
hostUrl
,
id
:
''
,
fileId
:
''
,
minDate
:
moment
().
subtract
(
1
,
'M'
).
format
(
"YYYY-MM-DD"
),
content
:
""
,
addStatus
:
false
,
...
...
@@ -131,14 +140,17 @@
orderInfo
:
{},
fileTypeEnum
:
{},
previewStatus
:
false
,
imgUrl
:
''
imgUrl
:
''
,
};
},
onLoad
(
option
)
{
if
(
option
&&
option
.
id
)
{
this
.
id
=
option
.
id
this
.
onLoading
()
}
if
(
option
&&
option
.
docId
)
{
this
.
docId
=
option
.
docId
}
this
.
onLoading
()
},
methods
:
{
onPre
()
{
...
...
@@ -150,41 +162,57 @@
},
islmage
(
filename
)
{
const
extension
=
filename
.
split
(
'.'
).
pop
().
toLowerCase
();
console
.
log
(
extension
,
9999
)
const
imageExtensions
=
[
'jpg'
,
'jpeg'
,
'png'
,
'gif'
,
'bmp'
,
'webp'
,
'svg'
]
const
imageExtensions
=
[
'jpg'
,
'jpeg'
,
'png'
,
'gif'
,
'bmp'
,
'webp'
,
'svg'
,
'mp4'
,
'3gp'
,
'avi'
]
return
imageExtensions
.
includes
(
extension
);
},
onNavToPreview
()
{
addPreview
(
this
.
orderInfo
).
then
(
res
=>
{
console
.
log
(
res
,
99999
);
if
(
res
.
data
.
__sys__
.
status
===
1
)
{
this
.
imgUrl
=
""
if
(
this
.
islmage
(
this
.
orderInfo
.
docName
)){
this
.
previewStatus
=
true
;
}
else
{
let
urlStr
=
this
.
assetsPath
+
'/hggp/file/download/'
+
this
.
orderInfo
.
docId
;
uni
.
downloadFile
({
url
:
urlStr
,
success
:
(
res
)
=>
{
console
.
log
(
res
,
999999
)
let
filePath
=
res
.
tempFilePath
;
uni
.
openDocument
({
filePath
:
filePath
,
showMenu
:
true
,
success
:
(
res
)
=>
{
console
.
log
(
'打开文档成功'
);
}
});
}
});
}
}
this
.
onGetList
();
})
},
onDownLoad
()
{
addDownLoad
(
this
.
orderInfo
).
then
(
res
=>
{
console
.
log
(
res
,
99999
);
if
(
res
.
data
.
__sys__
.
status
===
1
)
{
uni
.
showLoading
({
title
:
"文件下载中..."
})
let
url
=
this
.
assetsPath
+
'/hggp/file/download/'
+
this
.
orderInfo
.
docId
;
// #ifdef H5
window
.
open
(
url
)
uni
.
hideLoading
()
// #endif
// #ifndef H5
uni
.
showLoading
({
title
:
"文件下载中..."
})
uni
.
downloadFile
({
url
,
success
:
(
res2
)
=>
{
console
.
log
(
res2
,
999999
)
uni
.
hideLoading
()
uni
.
saveFile
({
tempFilePath
:
res2
.
tempFilePath
,
success
:
(
result
)
=>
{
console
.
log
(
result
)
console
.
log
(
result
,
99999
)
}
})
}
...
...
@@ -209,7 +237,9 @@
},
onGetList
()
{
getList
({
id
:
this
.
id
id
:
this
.
id
,
docId
:
this
.
docId
,
bizType
:
"WD"
}).
then
(
res
=>
{
if
(
res
.
data
.
__sys__
.
status
===
0
)
{
let
list
=
toJsonData
(
res
.
data
.
__blocks__
.
result
.
rows
,
res
.
data
.
__blocks__
.
result
.
meta
...
...
@@ -218,12 +248,12 @@
if
(
list
&&
list
.
length
)
{
this
.
orderInfo
=
{
...
list
[
0
],
fileSuffix
:
list
[
0
].
docName
.
split
(
'.'
).
pop
().
toLowerCase
(),
previewStatus
:
this
.
islmage
(
list
[
0
].
docName
),
releaseDate
:
updatedTime
.
length
>=
13
?
`
${
updatedTime
[
0
]}${
updatedTime
[
1
]}${
updatedTime
[
2
]}${
updatedTime
[
3
]}
/
${
updatedTime
[
4
]}${
updatedTime
[
5
]}
/
${
updatedTime
[
6
]}${
updatedTime
[
7
]}
${
updatedTime
[
8
]}${
updatedTime
[
9
]}
:
${
updatedTime
[
10
]}${
updatedTime
[
11
]}
:
${
updatedTime
[
12
]}${
updatedTime
[
13
]}
`
:
''
};
console
.
log
(
this
.
orderInfo
,
"this.orderInfo"
)
}
}
})
...
...
pages/document/list.vue
View file @
1a486554
...
...
@@ -72,7 +72,7 @@
<view
class=
"flex-row"
>
<text
class=
"text-gray part-1"
>
版本
</text>
<text
class=
"text-gray part-2"
>
:
</text>
<text
class=
"text-title"
>
V
{{
item
.
docVersion
}}
</text>
<text
class=
"text-title"
>
{{
'v'
+
item
.
docVersion
}}
</text>
</view>
<!--
<view
class=
"flex-row"
>
<text
class=
"text-gray part-1"
>
附件名称
</text>
...
...
@@ -294,7 +294,7 @@
},
onNavToOrderInfo
(
val
)
{
uni
.
navigateTo
({
url
:
`/pages/document/edit?id=
${
val
.
id
}
`
url
:
`/pages/document/edit?id=
${
val
.
id
}
&docId=
${
val
.
docId
}
`
})
}
}
...
...
static/HGAPP81.png
0 → 100644
View file @
1a486554
9.28 KB
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