You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
3.0 KiB
Vue

3 months ago
<template>
<div class="param-container" style="padding: 5vw 10vw;background-color: #fff">
<h2 class="title1" style="line-height: 40px">资料下载</h2>
<div>
<div v-for="i in data.fileList" class="fileCard" style="text-align: left">
<div class="cardTitle">{{ i.name }}</div>
<div class="cardValue">{{ i.value }}</div>
3 months ago
<el-button @click="downFile( i)" type="primary" class="downIcon" icon="el-icon-download "
3 months ago
circle></el-button>
</div>
</div>
3 months ago
<el-dialog title="输入密码" :modal-append-to-body="false" :visible.sync="getPasswordVisible">
<el-form :model="form" label-width="50px">
<el-form-item label="密码">
<el-input v-model="form.secretKey" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="downFile1"> </el-button>
</div>
</el-dialog>
3 months ago
</div>
</template>
<script>
3 months ago
import {getSecureDocumentAddress} from "@/api/hwWebDocument";
3 months ago
export default {
name: 'PlatformFeatures',
props: ['data'],
computed: {},
data() {
3 months ago
return {
getPasswordVisible: false,
form: {}
}
3 months ago
},
mounted() {
},
methods: {
3 months ago
async downFile(e) {
console.log(e)
getSecureDocumentAddress({documentId: e.uuid}).then((res) => {
if (res.code === 200) {
console.log('下载地址', res.data)
} else {
this.form = {
documentId: e.uuid,
secretKey: ''
}
this.getPasswordVisible = true
this.$message.error('请输入密钥')
}
})
},
downFile1() {
if (!this.form.secretKey) {
this.$message.error('请输入密码')
return
3 months ago
}
3 months ago
getSecureDocumentAddress(this.form).then((res) => {
if (res.code === 200) {
console.log('下载地址', res.data)
} else {
this.$message.error('密钥错误')
}
})
3 months ago
}
}
}
</script>
<style lang="less" scoped>
@import "~@/style.less";
.fileCard {
vertical-align: top;
display: inline-block;
width: 40%;
height: 100px;
border: 1px solid #ccc;
border-radius: 10px;
margin-top: 1vw;
position: relative;
.cardTitle {
position: absolute;
top: 10px;
left: 20px;
font-size: 22px;
font-weight: 700;
line-height: 45px;
width: calc(100% - 80px);
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.cardValue {
position: absolute;
top: 55px;
width: calc(100% - 80px);
left: 20px;
font-size: 14px;
line-height: 45px;
color: #aaa;
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.downIcon {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
}
&:nth-child(2n) {
margin-left: 5%;
}
}
</style>
3 months ago