冀北项目添加表格导出功能 技术监督添加下载模版上传功能

This commit is contained in:
GGJ
2025-03-28 16:05:03 +08:00
parent 76f41e9a24
commit ef04022f14
153 changed files with 4208 additions and 3480 deletions

View File

@@ -1,10 +1,10 @@
<template>
<div>
<TableHeader ref="TableHeaderRef">
<TableHeader ref="TableHeaderRef" showExport>
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable maxlength="32" show-word-limit></el-input>
clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
@@ -16,8 +16,7 @@
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate"
:loading="loading">模板下载</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">模板下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
@@ -61,16 +60,15 @@ const tableStore = new TableStore({
url: '/supervision-boot/userReport/getInterferenceUserPage',
publicHeight: 65,
method: 'POST',
filename:'干扰源用户台账',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{ field: 'projectName', title: '项目名称', minWidth: 170 },
@@ -261,20 +259,20 @@ const deleteEven = () => {
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
@@ -346,9 +344,9 @@ const getUserTypeName = (userType: any) => {
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
const exportExcelTemplate = async() => {
loading.value = true
await downloadSensitiveReportTemplate().then((res: any) => {
await downloadSensitiveReportTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
@@ -362,7 +360,7 @@ const exportExcelTemplate = async () => {
})
await setTimeout(() => {
loading.value = false
}, 0)
},0)
}
//批量导入用户数据