修改表格序号以及分页序号数字问题

This commit is contained in:
GGJ
2024-12-09 09:22:43 +08:00
parent b0d71b41dc
commit 9b952f2016
94 changed files with 336 additions and 261 deletions

View File

@@ -45,7 +45,11 @@ const tableStore = new TableStore({
publicHeight: 65,
method: 'POST',
column: [
/* { title: '序号', type: 'seq', width: 80 },*/
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'areaName',
title: '省公司',

View File

@@ -4,7 +4,7 @@
<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 maxlength="32" show-word-limit></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
@@ -16,7 +16,8 @@
<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>
@@ -65,7 +66,11 @@ const tableStore = new TableStore({
width: '60',
type: 'checkbox'
},
{ title: '序号', type: 'seq', width: 80 },
{
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 },
@@ -256,20 +261,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()
})
})
}
}
@@ -341,9 +346,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'
})
@@ -357,7 +362,7 @@ const exportExcelTemplate = async() => {
})
await setTimeout(() => {
loading.value = false
},0)
}, 0)
}
//批量导入用户数据

View File

@@ -4,16 +4,14 @@
<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" maxlength="32" show-word-limit
clearable></el-input>
</el-form-item>
</template>
@@ -46,7 +44,11 @@ const tableStore = new TableStore({
isWebPaging: true,
method: 'POST',
column: [
/* { title: '序号', type: 'seq', width: 80 },*/
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'areaName',
@@ -134,7 +136,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]
@@ -145,12 +147,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(() => {

View File

@@ -34,6 +34,11 @@ const tableStore = new TableStore({
isWebPaging: true,
paramsPOST: true,
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 },