91c38661 by zrj

8.25 sjs

1 parent 87869823
......@@ -42,20 +42,22 @@
</template>
</el-tab-pane>
</el-tabs>
<div v-loading="loading" class="infoPart">
<div v-loading="loading" class="infoPart" style="position: relative">
<h3 class="leftboderTT">{{ nowTab.name }}</h3>
<div class="content">
<div style="padding-left: 30px">
<el-link v-for="v in fileList" :href="fillImgUrl(v.url)" :underline="false" class="link" target="_blank"
type="primary">
<span style="border-bottom: 1px solid var(--el-color-primary)">
{{ v.name }}
<el-icon style="margin-left: 10px;position: relative;bottom: -2px">
<Download/>
</el-icon>
</span>
<el-button style="position: absolute; top: 20px; right: 50px" type="primary" @click="downloadUrl(fileList)">{{language===0?'下载文档':'Download Document'}}</el-button>
<!-- <el-link v-for="v in fileList" :href="fillImgUrl(v.url)" :underline="false" class="link" target="_blank"-->
<!-- type="primary">-->
<!-- <span style="border-bottom: 1px solid var(&#45;&#45;el-color-primary)">-->
<!-- {{ v.name }}-->
<!-- <el-icon style="margin-left: 10px;position: relative;bottom: -2px">-->
<!-- <Download/>-->
<!-- </el-icon>-->
<!-- </span>-->
</el-link>
<!-- </el-link>-->
</div>
<div v-if="content" v-html="content" />
<div v-else>
......@@ -95,6 +97,7 @@ import {onMounted, ref} from "vue";
import {getppInfo} from "@/apiPc/match";
import {useRoute} from "vue-router";
import {fillImgUrl} from "/@/utils/ruoyi";
import {ElMessage} from "element-plus";
const route = useRoute()
const language = useStorage('language', 0)
......@@ -181,6 +184,31 @@ const changeTab = (n) => {
})
}
const downloadUrl = function (data) {
if(data && data.length > 0) {
let filePath = fillImgUrl(data[0].url)
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>-->
......
......@@ -43,7 +43,7 @@ const title = ref('')
const cptName = ref('')
const show = ref(false)
const form = ref({})
const hotelType = ref('1')
const hotelType = ref('')
let matchId = ''
let type = ''
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!