冀北项目添加表格导出功能 技术监督添加下载模版上传功能
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader area ref='TableHeaderRef'>
|
||||
<TableHeader area ref='TableHeaderRef' showExport>
|
||||
<template #select>
|
||||
<el-form-item label='运行状态'>
|
||||
<el-select v-model="tableStore.table.params.runF" clearable placeholder="请选择运行状态">
|
||||
@@ -13,7 +13,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='信息查询'>
|
||||
<el-input style="width:200px;" placeholder="电站名称,终端编号,型号" v-model='tableStore.table.params.searchValue' maxlength="32" show-word-limit clearable></el-input>
|
||||
<el-input style="width:200px;" placeholder="电站名称,终端编号,型号" v-model='tableStore.table.params.searchValue' clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</template>
|
||||
@@ -44,12 +44,11 @@ const tableStore = new TableStore({
|
||||
url: '/device-boot/runManage/getDeviceLedger',
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
filename:'终端台账',
|
||||
column: [
|
||||
{
|
||||
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: 'areaName',
|
||||
title: '省公司',
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
//批量导入用户数据
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader area ref="TableHeaderRef">
|
||||
<TableHeader area ref="TableHeaderRef" showExport>
|
||||
<template #select>
|
||||
<el-form-item label='运行状态'>
|
||||
<el-select v-model="tableStore.table.params.runF" clearable placeholder="请选择运行状态">
|
||||
<el-option v-for="item in runFlagList" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
<el-option
|
||||
v-for="item in runFlagList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息查询">
|
||||
<el-input style="width:240px;" placeholder="电站名称,终端编号,监测点名称"
|
||||
v-model="tableStore.table.params.searchValue" maxlength="32" show-word-limit
|
||||
clearable></el-input>
|
||||
<el-input style="width:240px;" placeholder="电站名称,终端编号,监测点名称" v-model="tableStore.table.params.searchValue" clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</template>
|
||||
@@ -43,12 +45,11 @@ const tableStore = new TableStore({
|
||||
publicHeight: 65,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename:'监测点台账',
|
||||
column: [
|
||||
{
|
||||
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: 'areaName',
|
||||
@@ -136,7 +137,7 @@ const tableStore = new TableStore({
|
||||
tableStore.table.params.serverName = 'harmonic-boot'
|
||||
|
||||
tableStore.table.params.runFlag = []
|
||||
if (tableStore.table.params.runF != null) {
|
||||
if(tableStore.table.params.runF!=null){
|
||||
tableStore.table.params.runFlag = [tableStore.table.params.runF]
|
||||
}
|
||||
tableStore.table.params.comFlag = [0, 1]
|
||||
@@ -147,12 +148,12 @@ const tableStore = new TableStore({
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.runF = null
|
||||
tableStore.table.params.runFlag = []
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.runF=null
|
||||
tableStore.table.params.runFlag=[]
|
||||
tableStore.table.params.searchValue=''
|
||||
|
||||
|
||||
const runFlagList = [{ id: 0, name: '运行' }, { id: 1, name: '检修' }, { id: 2, name: '停运' }, { id: 3, name: '调试' }, { id: 4, name: '退运' }]
|
||||
const runFlagList = [{id:0,name:'运行'},{id:1,name:'检修'},{id:2,name:'停运'},{id:3,name:'调试'},{id:4,name:'退运'}]
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
draggable
|
||||
class='cn-operate-dialog'
|
||||
v-model='eventDataUploadVisible'
|
||||
:title='title'
|
||||
style='width: 415px'
|
||||
top='25vh'
|
||||
class="cn-operate-dialog"
|
||||
v-model="eventDataUploadVisible"
|
||||
:title="title"
|
||||
style="width: 415px"
|
||||
top="25vh"
|
||||
>
|
||||
<el-scrollbar>
|
||||
<el-form :inline='false' :model='form' label-width='120px' ref='formRef'>
|
||||
<el-form-item label='用户数据文件'>
|
||||
<el-form :inline="false" :model="form" label-width="120px" ref="formRef">
|
||||
<el-form-item label="用户数据文件">
|
||||
<el-upload
|
||||
v-model:file-list='fileList'
|
||||
ref='uploadEventData'
|
||||
action=''
|
||||
:limit='1'
|
||||
:on-exceed='handleExceed'
|
||||
:auto-upload='false'
|
||||
:on-change='choose'
|
||||
v-model:file-list="fileList"
|
||||
ref="uploadEventData"
|
||||
action=""
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
:auto-upload="false"
|
||||
:on-change="choose"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type='primary'>选择数据文件</el-button>
|
||||
<el-button type="primary">选择数据文件</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<span class='dialog-footer'>
|
||||
<el-button @click='eventDataUploadVisible = false'>取消</el-button>
|
||||
<el-button type='primary' @click='submit'>确认</el-button>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="eventDataUploadVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang='ts'>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, inject } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@@ -95,11 +95,6 @@ const submit = async () => {
|
||||
if (valid) {
|
||||
let data = new FormData()
|
||||
data.append('file', form.file)
|
||||
const allowedTypes = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
|
||||
if (!allowedTypes.includes(form.file.type)) {
|
||||
return ElMessage.warning('只能上传 Excel 文件 (.xls 或 .xlsx)!')
|
||||
}
|
||||
|
||||
if (title.value === '导入干扰源用户') {
|
||||
await importSensitiveReportData(data)
|
||||
.then(res => handleImportResponse(title.value, res))
|
||||
|
||||
@@ -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="请选择所在地市">
|
||||
@@ -56,6 +56,7 @@ const tableStore = new TableStore({
|
||||
url: '/supervision-boot/userReport/getSensitiveUserPage',
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
filename:'敏感及重要用户台账',
|
||||
column: [
|
||||
{
|
||||
width: '60',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader datePicker area nextFlag theCurrentTime ref="TableHeaderRef">
|
||||
<TableHeader datePicker area nextFlag theCurrentTime ref="TableHeaderRef" showExport>
|
||||
<template #select>
|
||||
<el-form-item label="信息查询">
|
||||
<el-input
|
||||
@@ -8,7 +8,6 @@
|
||||
placeholder="请输入变电站/监测点名称"
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
maxlength="32" show-word-limit
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -33,12 +32,8 @@ const tableStore = new TableStore({
|
||||
method: 'POST',
|
||||
isWebPaging: true,
|
||||
paramsPOST: true,
|
||||
filename:'变电站台账',
|
||||
column: [
|
||||
{
|
||||
title: '序号', width: 80, formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'deptName', title: '所在地市', minWidth: 100 },
|
||||
{ field: 'substationName', title: '变电站名称', minWidth: 100 },
|
||||
|
||||
@@ -47,7 +42,7 @@ const tableStore = new TableStore({
|
||||
title: '电网侧监测点名称',
|
||||
minWidth: 150,
|
||||
formatter: (obj: any) => {
|
||||
return obj.cellValue.length == 0 ? '/' : obj.cellValue.join('\n')
|
||||
return obj.cellValue.length == 0 ? '/' : obj.cellValue.join('\n ')
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -55,7 +50,7 @@ const tableStore = new TableStore({
|
||||
title: '非电网侧监测点名称',
|
||||
minWidth: 150,
|
||||
formatter: (obj: any) => {
|
||||
return obj.cellValue.length == 0 ? '/' : obj.cellValue.join('\n')
|
||||
return obj.cellValue.length == 0 ? '/' : obj.cellValue.join('\n ')
|
||||
}
|
||||
},
|
||||
{ field: 'alarmFreq', title: '告警频次', minWidth: 80 },
|
||||
|
||||
Reference in New Issue
Block a user