优化列表序号,分页时延续问题

This commit is contained in:
BianLzhaoMin 2024-06-03 11:10:25 +08:00
parent e7e8c6da07
commit b1b42b9a78
7 changed files with 136 additions and 117 deletions

View File

@ -3,6 +3,7 @@
<!-- 查询表单 --> <!-- 查询表单 -->
<FormModel <FormModel
:formLabel="config.formLabel" :formLabel="config.formLabel"
:routerParams="config.routerParams"
@queryList="queryList" @queryList="queryList"
v-if="config.isFormShow" v-if="config.isFormShow"
> >
@ -19,6 +20,10 @@
ref="tableRef" ref="tableRef"
select-on-indeterminate select-on-indeterminate
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
v-loading="loading"
element-loading-text="数据正在加载,请稍后"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.6)"
> >
<el-table-column <el-table-column
type="selection" type="selection"
@ -27,6 +32,14 @@
:selectable="selectable" :selectable="selectable"
v-if="config.isSelShow" v-if="config.isSelShow"
/> />
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(pageParams.pageNum, pageParams.pageSize)
"
/>
<el-table-column <el-table-column
v-for="(item, v) in tableColumCheckProps" v-for="(item, v) in tableColumCheckProps"
:key="v" :key="v"
@ -42,12 +55,18 @@
<slot :data="scope.row" :name="item.t_slot"></slot> <slot :data="scope.row" :name="item.t_slot"></slot>
</template> </template>
<template v-else> <template v-else>
{{ scope.row[item.t_props] || '-' }}
</template>
<!-- <template v-else>
{{ {{
v === 0 v === 0
? scope.$index + 1 ? indexContinuation(
pageParams.pageNum,
pageParams.pageSize,
)
: scope.row[item.t_props] || '-' : scope.row[item.t_props] || '-'
}} }}
</template> </template> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -140,6 +159,7 @@
}, },
/* 操作列显示隐藏数据源 */ /* 操作列显示隐藏数据源 */
columCheckList: [], columCheckList: [],
loading: false,
} }
}, },
@ -177,15 +197,14 @@
}, },
/* 获取列表信息 */ /* 获取列表信息 */
async getList() { async getList() {
this.pageParams = Object.assign( this.pageParams = Object.assign(this.pageParams, this.sendParams)
this.pageParams, this.loading = true
this.sendParams,
)
const res = await this.sendApi(this.pageParams) const res = await this.sendApi(this.pageParams)
this.loading = false
if (res.code == 200) { if (res.code == 200) {
this.tableList = res.rows this.tableList = res.rows || res.data.rows
this.total = res.total this.total = res.total || res.data.total
} }
}, },

View File

@ -15,7 +15,7 @@ export const config = {
{ f_label: '创建时间', f_model: 'time', f_type: 'date' }, { f_label: '创建时间', f_model: 'time', f_type: 'date' },
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: '', t_label: '预报废单号' }, { t_props: '', t_label: '预报废单号' },
{ t_props: '', t_label: '机具类型' }, { t_props: '', t_label: '机具类型' },
{ t_props: '', t_label: '任务创建人' }, { t_props: '', t_label: '任务创建人' },

View File

@ -37,7 +37,7 @@ export const config = {
{ f_label: '创建时间', f_model: 'time', f_type: 'date' }, { f_label: '创建时间', f_model: 'time', f_type: 'date' },
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'scrapNum', t_label: '预报废单号', }, { t_width: '', t_props: 'scrapNum', t_label: '预报废单号', },
{ t_width: '', t_props: '', t_label: '报废来源', t_slot: 'source', }, { t_width: '', t_props: '', t_label: '报废来源', t_slot: 'source', },
{ t_width: '', t_props: 'repairNum', t_label: '单号', t_slot: 'code', }, { t_width: '', t_props: 'repairNum', t_label: '单号', t_slot: 'code', },

View File

@ -12,7 +12,7 @@ export const config = {
{ f_label: '规格型号', f_model: 'backPro', f_type: 'sel', f_selList: [] }, { f_label: '规格型号', f_model: 'backPro', f_type: 'sel', f_selList: [] },
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '类型名称' }, { t_width: '', t_props: 'demo', t_label: '类型名称' },
{ t_width: '', t_props: '', t_label: '规格型号' }, { t_width: '', t_props: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '数量' }, { t_width: '', t_props: '', t_label: '数量' },
@ -44,7 +44,7 @@ export const dialogConfig = {
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '设备类型' }, { t_width: '', t_props: 'demo', t_label: '设备类型' },
{ t_width: '', t_props: '', t_label: '规格型号' }, { t_width: '', t_props: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '设备编码' }, { t_width: '', t_props: '', t_label: '设备编码' },

View File

@ -40,7 +40,7 @@ export const config = {
}, },
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'scrapNum', t_label: '报废单号' }, { t_width: '', t_props: 'scrapNum', t_label: '报废单号' },
{ t_width: '', t_props: '', t_label: '报废来源', t_slot: 'source' }, { t_width: '', t_props: '', t_label: '报废来源', t_slot: 'source' },
{ t_width: '', t_props: 'repairNum', t_label: '预报废单号' }, { t_width: '', t_props: 'repairNum', t_label: '预报废单号' },
@ -74,7 +74,7 @@ export const dialogConfig = {
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'machineTypeName', t_label: '设备类型' }, { t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' }, { t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },

View File

@ -43,7 +43,7 @@ export const dialogConfig = {
{ f_label: '类型名称', f_model: 'keywords', f_type: 'ipt' }, { f_label: '类型名称', f_model: 'keywords', f_type: 'ipt' },
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'machineTypeName', t_label: '设备类型' }, { t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' }, { t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },

View File

@ -15,7 +15,7 @@ export const config = {
{ f_label: '创建时间', f_model: 'time', f_type: 'date' }, { f_label: '创建时间', f_model: 'time', f_type: 'date' },
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: 'scrapNum', t_label: '报废单号' }, { t_props: 'scrapNum', t_label: '报废单号' },
{ t_props: 'scrapSource', t_label: '报废来源', t_slot: 'source' }, { t_props: 'scrapSource', t_label: '报废来源', t_slot: 'source' },
{ t_props: 'repairNum', t_label: '预报废单号' }, { t_props: 'repairNum', t_label: '预报废单号' },
@ -43,7 +43,7 @@ export const dialogConfig = {
{ f_label: '类型名称', f_model: 'keywords', f_type: 'ipt' }, { f_label: '类型名称', f_model: 'keywords', f_type: 'ipt' },
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, // { t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'machineTypeName', t_label: '设备类型' }, { t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' }, { t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },