feat : 表格分页时序号连续

This commit is contained in:
2024-08-17 11:24:43 +08:00
parent 09c51f13fc
commit b6b1c8a3ff
14 changed files with 79 additions and 28 deletions

View File

@@ -109,7 +109,10 @@ const tableConfig = reactive({
type: 'index', type: 'index',
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85 width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'affiliatedCompany', prop: 'affiliatedCompany',

View File

@@ -101,7 +101,10 @@ const tableConfig = reactive({
type: 'index', type: 'index',
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85 width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'shareName', prop: 'shareName',

View File

@@ -17,14 +17,14 @@
</el-row> </el-row>
<el-tabs v-model="activeName" class="demo-tabs"> <el-tabs v-model="activeName" class="demo-tabs">
<el-tab-pane :label="'待办('+todoNum +''" name="first" v-loading="loading"> <el-tab-pane :label="'待办('+todoNum +''" name="first" v-loading="loading">
<fvTable ref="tableIns" class="home-table" :tableConfig="tableConfigBacklog" @getTotal="getTotal"> <fvTable ref="tableConfigBacklogRef" class="home-table" :tableConfig="tableConfigBacklog" @getTotal="getTotal">
<template #empty> <template #empty>
<el-empty description="暂无待办"/> <el-empty description="暂无待办"/>
</template> </template>
</fvTable> </fvTable>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="'待上报(' + reportNum + ''" name="second"> <el-tab-pane :label="'待上报(' + reportNum + ''" name="second">
<fvTable ref="tableIns" :tableConfig="tableConfigReport" @getTotal="getReportNumTotal"> <fvTable ref="tableConfigReportRef" :tableConfig="tableConfigReport" @getTotal="getReportNumTotal">
<template #empty> <template #empty>
<el-empty description="暂无数据"/> <el-empty description="暂无数据"/>
</template> </template>
@@ -68,6 +68,8 @@ import {useAuthStore} from '@/stores/userstore.js'
const AuthStore = useAuthStore() const AuthStore = useAuthStore()
const router = useRouter() const router = useRouter()
const activeName = ref('first') const activeName = ref('first')
const tableConfigBacklogRef=ref()
const tableConfigReportRef=ref()
const list = ref([ const list = ref([
{ {
title: '待立项', title: '待立项',
@@ -129,6 +131,9 @@ const tableConfigBacklog = reactive({
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85, width:85,
index: index => {
return (tableConfigBacklogRef.value.getQuery().pageNum - 1) * tableConfigBacklogRef.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'targetName', prop: 'targetName',
@@ -194,6 +199,9 @@ const tableConfigReport = reactive({
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85, width:85,
index: index => {
return (tableConfigReportRef.value.getQuery().pageNum - 1) * tableConfigReportRef.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'requirementName', prop: 'requirementName',

View File

@@ -35,7 +35,10 @@ const tableConfig = reactive({
type: 'index', type: 'index',
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85 width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'annualPlanName', prop: 'annualPlanName',

View File

@@ -1,14 +1,16 @@
<template> <template>
<el-form ref="formRef" :model="selectForm" class="search-form select-form" style="margin-top: 18px;margin-left: 16px"> <el-form ref="formRef" :model="selectForm" class="search-form select-form" style="margin-top: 18px;margin-left: 16px">
<el-row > <el-row>
<el-col :span="5"> <el-col :span="5">
<el-form-item prop="requirementName" label="征集名称" > <el-form-item prop="requirementName" label="征集名称">
<el-input v-model="selectForm.requirementName" placeholder="请输入征集名称" clearable @keyup.enter.native="getList" style="width: 100%"/> <el-input v-model="selectForm.requirementName" placeholder="请输入征集名称" clearable @keyup.enter.native="getList"
style="width: 100%"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5" :offset="1"> <el-col :span="5" :offset="1">
<el-form-item prop="collectType" label="征集类型"> <el-form-item prop="collectType" label="征集类型">
<el-select v-model="selectForm.collectType" ref="collectTypeSelectRef" placeholder="请选择征集类型" clearable filterable remote <el-select v-model="selectForm.collectType" ref="collectTypeSelectRef" placeholder="请选择征集类型" clearable
filterable remote
@change="getList"> @change="getList">
<el-option <el-option
v-for="item in cacheStore.getDict('collect_type')" v-for="item in cacheStore.getDict('collect_type')"
@@ -21,7 +23,8 @@
</el-col> </el-col>
<el-col :span="5" :offset="1"> <el-col :span="5" :offset="1">
<el-form-item prop="state" label="状态"> <el-form-item prop="state" label="状态">
<el-select v-model="selectForm.state" placeholder="请选择状态" clearable filterable @change="getList" remote @visible-change="selectOptionVisibleChange"> <el-select v-model="selectForm.state" placeholder="请选择状态" clearable filterable @change="getList" remote
@visible-change="selectOptionVisibleChange">
<el-option <el-option
v-for="item in stateOption" v-for="item in stateOption"
:key="item.value" :key="item.value"
@@ -83,7 +86,10 @@ const tableConfig = reactive({
type: 'index', type: 'index',
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85, width: 85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'requirementName', prop: 'requirementName',
@@ -115,9 +121,9 @@ const tableConfig = reactive({
align: 'center', align: 'center',
width: 120, width: 120,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
if(row.state=='1'){ if (row.state == '1') {
return <span>{row.approveName}</span> return <span>{row.approveName}</span>
}else { } else {
return <span>{row.taskNode}</span> return <span>{row.taskNode}</span>
} }
} }
@@ -181,12 +187,12 @@ const tableConfig = reactive({
params: {} params: {}
}) })
const selectOptionVisibleChange=(value)=>{ const selectOptionVisibleChange = (value) => {
console.log('value',value) console.log('value', value)
} }
const getStatePerm = () => { const getStatePerm = () => {
getRequirementStatePerm().then(res => { getRequirementStatePerm().then(res => {
stateOption.value=res.data stateOption.value = res.data
}) })
} }
getStatePerm() getStatePerm()
@@ -257,10 +263,10 @@ const headBtnClick = (key) => {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.select-form{ .select-form {
.el-select { .el-select {
.el-select__wrapper{ .el-select__wrapper {
.el-select__suffix::before { .el-select__suffix::before {
content: ""; content: "";
width: 6px; width: 6px;
@@ -270,12 +276,13 @@ const headBtnClick = (key) => {
transform: translate(-50%, -50%) rotate(-45deg); transform: translate(-50%, -50%) rotate(-45deg);
} }
} }
.is-focused { .is-focused {
.el-select__suffix::before { .el-select__suffix::before {
margin-top: 10px; margin-top: 10px;
transform:translate(-50%, -50%) rotate(-225deg)!important; transform: translate(-50%, -50%) rotate(-225deg) !important;
} }
} }
} }
} }
</style> </style>

View File

@@ -168,6 +168,9 @@ const tableConfig = reactive({
label: '序号', label: '序号',
align: 'center', align: 'center',
width:60, width:60,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'requirementName', prop: 'requirementName',

View File

@@ -162,6 +162,9 @@ const tableConfig = reactive({
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85, width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'affiliatedCompany', prop: 'affiliatedCompany',

View File

@@ -374,7 +374,10 @@ const tableConfig = reactive({
type: 'index', type: 'index',
label: '序号', label: '序号',
width: '80', width: '80',
align: 'center' align: 'center',
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'time', prop: 'time',

View File

@@ -165,6 +165,9 @@ const tableConfig = reactive({
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85, width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'affiliatedCompany', prop: 'affiliatedCompany',

View File

@@ -247,7 +247,10 @@ const tableConfig = reactive({
type: 'index', type: 'index',
label: '序号', label: '序号',
align: 'center', align: 'center',
width:'80' width:'80',
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'time', prop: 'time',

View File

@@ -159,6 +159,9 @@ const tableConfig = reactive({
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85, width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'affiliatedCompany', prop: 'affiliatedCompany',

View File

@@ -73,6 +73,9 @@ const tableConfig = reactive({
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85, width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'name', prop: 'name',

View File

@@ -119,7 +119,10 @@ const tableConfig = reactive({
type: 'index', type: 'index',
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85 width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'roleName', prop: 'roleName',

View File

@@ -98,7 +98,10 @@ const tableConfig = reactive({
type: 'index', type: 'index',
label: '序号', label: '序号',
align: 'center', align: 'center',
width:85 width:85,
index: index => {
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
}
}, },
{ {
prop: 'userName', prop: 'userName',