Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
dance-pc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b4d86fc7
authored
2025-10-10 09:40:37 +0800
by
zrj
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
10.9 世锦赛详情增加 下载文件功能
1 parent
c4285d0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
src/viewsPc/match/detail_en.vue
vite.config.js
src/viewsPc/match/detail_en.vue
View file @
b4d86fc
...
...
@@ -192,6 +192,7 @@
<el-col
:span=
"24"
>
<el-tabs
v-model=
"activeName"
class=
"match-tabs"
>
<el-tab-pane
v-for=
"tab in tabList"
:label=
"tab.customTitle"
:name=
"tab.id"
>
<el-button
v-if=
"tab.fileUrl&&tab.fileUrl.length>0"
style=
"float: right"
type=
"primary"
@
click=
"downloadUrl(tab.fileUrl)"
>
{{language===0?'下载文档':'Download Document'}}
</el-button>
<div
class=
"richContent"
v-html=
"tab.customText"
></div>
</el-tab-pane>
</el-tabs>
...
...
@@ -240,6 +241,7 @@ import SubstationList from "@/viewsPc/match/components/substation-list";
import
MatchInfoProjectList
from
"@/viewsPc/match/components/matchInfo-projectList"
;
import
QuickRow
from
"@/viewsPc/match/components/quick-row"
;
import
Pickup
from
'@/viewsPc/components/pickup'
import
{
fillImgUrl
}
from
"/@/utils/ruoyi"
;
import
{
getCurrentInstance
,
ref
}
from
'vue'
import
{
reactive
,
onMounted
}
from
'@vue/runtime-core'
import
{
useRoute
,
useRouter
}
from
'vue-router'
...
...
@@ -321,6 +323,12 @@ onMounted(() => {
function
getTab
()
{
match
.
getLabelList
().
then
(
res
=>
{
tabList
.
value
=
res
.
data
tabList
.
value
.
forEach
(
item
=>
{
if
(
item
.
fileUrl
)
{
item
.
fileUrl
=
JSON
.
parse
(
item
.
fileUrl
)
}
})
if
(
route
.
query
.
tabId
){
activeName
.
value
=
route
.
query
.
tabId
}
else
{
...
...
@@ -670,6 +678,33 @@ const openPickup = () => {
}
proxy
.
$refs
[
'pickupRef'
].
open
(
obj
)
}
const
downloadUrl
=
function
(
data
)
{
if
(
data
&&
data
.
length
>
0
)
{
console
.
log
(
data
[
0
])
let
filePath
=
fillImgUrl
(
data
[
0
].
url
)
console
.
log
(
filePath
)
let
x
=
new
XMLHttpRequest
();
x
.
open
(
"GET"
,
filePath
,
true
);
x
.
responseType
=
'blob'
;
x
.
onload
=
function
()
{
let
url
=
window
.
URL
.
createObjectURL
(
x
.
response
)
let
link
=
document
.
createElement
(
'a'
)
// 创建a标签
link
.
style
.
display
=
'none'
link
.
target
=
'_target'
link
.
href
=
url
// 设置下载地址
link
.
download
=
data
[
0
].
name
||
''
// 添加downLoad属性
document
.
body
.
appendChild
(
link
)
link
.
click
()
}
x
.
send
()
}
else
{
ElMessage
.
warning
({
message
:
'没有可以下载的文件'
,
})
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -1077,6 +1112,7 @@ const openPickup = () => {
overflow
:
hidden
;
display
:
flex
;
justify-content
:
center
;
width
:
100%
;
}
.richContent
img
{
...
...
vite.config.js
View file @
b4d86fc
...
...
@@ -89,9 +89,8 @@ export default defineConfig(({ mode, command }) => {
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
dev-api
\/
ztx-webSite/
,
''
)
},
'/dev-api'
:
{
target
:
'http://192.168.1.118:8082'
,
// target: 'http://192.168.1.22:8082',
//
target: 'https://tk005.wxjylt.com/stage-api',
target
:
'https://tk005.wxjylt.com/stage-api'
,
// target: 'http://124.70.181.90:1880/stage-api',
// target: 'https://sys.2025wtcwuxi.com/stage-api/',
changeOrigin
:
true
,
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment