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

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
:formLabel="config.formLabel"
:routerParams="config.routerParams"
@queryList="queryList"
v-if="config.isFormShow"
>
@ -19,6 +20,10 @@
ref="tableRef"
select-on-indeterminate
@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
type="selection"
@ -27,6 +32,14 @@
:selectable="selectable"
v-if="config.isSelShow"
/>
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(pageParams.pageNum, pageParams.pageSize)
"
/>
<el-table-column
v-for="(item, v) in tableColumCheckProps"
:key="v"
@ -42,12 +55,18 @@
<slot :data="scope.row" :name="item.t_slot"></slot>
</template>
<template v-else>
{{ scope.row[item.t_props] || '-' }}
</template>
<!-- <template v-else>
{{
v === 0
? scope.$index + 1
? indexContinuation(
pageParams.pageNum,
pageParams.pageSize,
)
: scope.row[item.t_props] || '-'
}}
</template>
</template> -->
</template>
</el-table-column>
<el-table-column
@ -93,8 +112,8 @@
</template>
<script>
import FormModel from '../FormModel'
export default {
import FormModel from '../FormModel'
export default {
components: {
FormModel,
},
@ -140,6 +159,7 @@
},
/* 操作列显示隐藏数据源 */
columCheckList: [],
loading: false,
}
},
@ -177,15 +197,14 @@
},
/* 获取列表信息 */
async getList() {
this.pageParams = Object.assign(
this.pageParams,
this.sendParams,
)
this.pageParams = Object.assign(this.pageParams, this.sendParams)
this.loading = true
const res = await this.sendApi(this.pageParams)
this.loading = false
if (res.code == 200) {
this.tableList = res.rows
this.total = res.total
this.tableList = res.rows || res.data.rows
this.total = res.total || res.data.total
}
},
@ -198,20 +217,20 @@
this.$refs.tableRef.clearSelection()
},
},
}
}
</script>
<style>
.check-all {
.check-all {
margin-bottom: 5px;
cursor: pointer;
}
}
.handel-text {
.handel-text {
cursor: pointer;
}
.handel-text:hover {
}
.handel-text:hover {
text-decoration: underline;
color: #409eff;
}
}
</style>

View File

@ -15,7 +15,7 @@ export const config = {
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
],
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: '任务创建人' },

View File

@ -37,7 +37,7 @@ export const config = {
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
],
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: '', t_label: '报废来源', t_slot: 'source', },
{ 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: [] },
],
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: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '数量' },
@ -44,7 +44,7 @@ export const dialogConfig = {
],
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: '', t_label: '规格型号' },
{ t_width: '', t_props: '', t_label: '设备编码' },

View File

@ -40,7 +40,7 @@ export const config = {
},
],
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: '', t_label: '报废来源', t_slot: 'source' },
{ t_width: '', t_props: 'repairNum', t_label: '预报废单号' },
@ -74,7 +74,7 @@ export const dialogConfig = {
],
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: 'specificationType', 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' },
],
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: 'specificationType', 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' },
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
// { t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: 'scrapNum', t_label: '报废单号' },
{ t_props: 'scrapSource', t_label: '报废来源', t_slot: 'source' },
{ t_props: 'repairNum', t_label: '预报废单号' },
@ -43,7 +43,7 @@ export const dialogConfig = {
{ f_label: '类型名称', f_model: 'keywords', f_type: 'ipt' },
],
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: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' },