|
|
|
|
@ -78,7 +78,7 @@
|
|
|
|
|
</el-row> |
|
|
|
|
</el-form> |
|
|
|
|
<div class="mb-25 flex between"> |
|
|
|
|
<div> |
|
|
|
|
<div class="flex gap"> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="handleAdd" |
|
|
|
|
@ -89,6 +89,37 @@
|
|
|
|
|
</template> |
|
|
|
|
新增警员</el-button |
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
<el-upload |
|
|
|
|
:multiple="false" |
|
|
|
|
:show-file-list="false" |
|
|
|
|
:action="`${BASE_PATH}/police/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/数字督察警员权限导入模板.xlsx`" |
|
|
|
|
target="__blank" |
|
|
|
|
style="padding: 8px" |
|
|
|
|
v-perms="['police:import']" |
|
|
|
|
>数字督察警员权限导入模板</a |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" @click="getList"> |
|
|
|
|
@ -445,6 +476,8 @@
|
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
<script setup> |
|
|
|
|
import { BASE_PATH } from "@/api/request"; |
|
|
|
|
import { getToken } from "@/utils/token"; |
|
|
|
|
import { UserFilled } from "@element-plus/icons-vue"; |
|
|
|
|
import { |
|
|
|
|
listPolice, |
|
|
|
|
@ -584,6 +617,24 @@ async function handleDel(row) {
|
|
|
|
|
feedback.msgSuccess("操作成功"); |
|
|
|
|
getList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
getList() |
|
|
|
|
} |
|
|
|
|
function handleError(result) { |
|
|
|
|
importLoading.close(); |
|
|
|
|
feedback.msgError(result.msg || "上传失败!"); |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
</style> |