修改部分按钮重复点击
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
</template>
|
||||
<template #operation>
|
||||
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button> -->
|
||||
<el-button icon="el-icon-Download" @click="exportEvent" type="primary">下载报告</el-button>
|
||||
<el-button icon="el-icon-Download" :loading="loading" @click="exportEvent" type="primary">下载报告</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :radio-config="{
|
||||
@@ -42,7 +42,7 @@
|
||||
}" :tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }" :scroll-y="{ enabled: true }" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import { ref, onMounted, provide, reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
@@ -155,6 +155,7 @@ const tableStore = new TableStore({
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
const loading = ref(false)
|
||||
|
||||
tableStore.table.params.statisticalType = classificationData.filter(item => item.name == '电网拓扑')[0]
|
||||
tableStore.table.params.monitorFlag = 2
|
||||
@@ -197,6 +198,7 @@ const exportEvent = () => {
|
||||
})
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
let form = new FormData()
|
||||
form.append('isUrl', false)
|
||||
form.append('lineIndex', line.id)
|
||||
@@ -224,6 +226,9 @@ const exportEvent = () => {
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
loading.value = false
|
||||
}).catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user