作者 王勇

功能基本完善

... ... @@ -31,9 +31,9 @@
<!-- 显示区域 -->
<el-row :gutter="24" style="margin-top: 30px">
<el-col :span="11" style="margin-top: 10px">
<el-progress :text-inside="true" :stroke-width="15" :percentage="proportion"
:color="customColors"
style="width: 455px"></el-progress>
<!-- <el-progress :text-inside="true" :stroke-width="15" :percentage="proportion"-->
<!-- :color="customColors"-->
<!-- style="width: 455px"></el-progress>-->
<el-input v-model="message" type="textarea"
:autosize="{ minRows: 6, maxRows: 10}"
style="width: 455px;height: 400px"
... ... @@ -69,7 +69,10 @@
resultStatus: '0',
message: '',
proportion: 0,
/**
* 返回结果
*/
socketResponse: {
socketMessage: '',
socketStatus: '',
... ... @@ -90,6 +93,15 @@
/* 列表加载 */
listLoading: false,
downloadLoading: false,
/**
* 百分比例
*/
proportion: 0,
/**
* 百分比例,颜色
*/
customColors: [
{color: '#6f7ad3', percentage: 20},
{color: '#f56c6c', percentage: 40},
... ... @@ -121,9 +133,11 @@
*/
downLoadExcel() {
downExcel().then((response) => {
this.downloadLoading = true;
let res = response.data;
if (res.code !== '200') {
return this.$message.error('下载失败');
this.downloadLoading = false;
}
// console.log(res.msg)
//获取地址
... ... @@ -132,7 +146,9 @@
console.log(this.url)
// console.log(this.ipAddress)
this.down();
this.downloadLoading = false;
}).catch(error => {
this.downloadLoading = false;
console.log(error.toString())
this.$message.error(error.toString());
});
... ... @@ -140,12 +156,13 @@
},
down() {
// 创建a标签
const link = document.createElement('a')
const link = document.createElement('a');
// download属性
link.setAttribute('download', 'excel.xls')
link.setAttribute('download', 'excel.xls');
// href链接
link.setAttribute('href', this.url)
document.body.appendChild(link)
link.setAttribute('href', this.url);
document.body.appendChild(link);
// 自执行点击事件
link.click()
},
... ...