数字督察一体化平台-前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

59 lines
1.9 KiB

<template>
<div class="container">
<header>
<div class="flex gap">
<el-upload
:multiple="false"
:show-file-list="false"
:action="`${BASE_PATH}/negative/import`"
:headers="{ Authorization: getToken() }"
:before-upload="beforeUpload"
@success="handleSuccess"
@error="handleError"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
v-perms="['police:import']"
>
<el-button type="primary">
<template #icon>
<icon name="el-icon-Upload" />
</template>
黄赌毒历史问题下发</el-button
>
</el-upload>
<a
class="link"
:href="`${BASE_PATH}/templates/黄赌问题问题下发模板.xls`"
target="__blank"
style="padding: 8px"
v-perms="['police:import']"
>黄赌毒历史问题模板下载</a
>
</div>
</header>
</div>
</template>
<script setup>
import { BASE_PATH } from "@/api/request";
import { getToken } from "@/utils/token";
import feedback from "@/utils/feedback";
import { ElLoading } from "element-plus";
let importLoading;
function beforeUpload() {
importLoading = ElLoading.service({
lock: true,
text: "数据导入中",
background: "rgba(0, 0, 0, 0.7)",
});
}
function handleSuccess(result) {
importLoading.close();
if (result.code !== 200) {
feedback.msgError(result.message);
return;
}
feedback.msgSuccess('下发成功');
}
</script>
<style lang="scss" scoped>
</style>