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

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

@@ -3,16 +3,12 @@
<TableHeader datePicker nextFlag theCurrentTime ref='TableHeaderRef'>
<template #select>
<el-form-item label='项目名称'>
<el-input v-model='tableStore.table.params.projectName' placeholder='请输入项目名称' clearable maxlength="32" show-word-limit></el-input>
<el-input v-model='tableStore.table.params.projectName' placeholder='请输入项目名称' 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='请选择所在地市'>
<el-option
v-for='item in areaOptionList'
:key='item.id'
:label='item.name'
:value='item.name'
></el-option>
<el-option v-for='item in areaOptionList' :key='item.id' :label='item.name' :value='item.name'></el-option>
</el-select>
</el-form-item>
</template>
@@ -20,51 +16,39 @@
<!-- <el-button icon='el-icon-Download' type='primary'>导出</el-button> -->
</template>
</TableHeader>
<Table ref='tableRef'/>
<Table ref='tableRef' />
</div>
<el-dialog
title='干扰源用户详细信息'
v-if='dialogVisible'
v-model='dialogVisible'
width='65%'
:append-to-body='true'
:close-on-click-modal='false'
draggable
>
<el-dialog title='干扰源用户详细信息' v-if='dialogVisible' v-model='dialogVisible' width='65%' :append-to-body='true'
:close-on-click-modal='false' draggable>
<BpmUserReportDetail :id='interId' ref='detailsRef'></BpmUserReportDetail>
</el-dialog>
<!-- 查看详情 detail 新增/修改 create-->
<addForm
ref='addForms'
@onSubmit='tableStore.index()'
:update='update'
:normalizedControl='true'
openType='create'
></addForm>
<addForm ref='addForms' @onSubmit='tableStore.index()' :update='update' :normalizedControl='true' openType='create'>
</addForm>
</template>
<script setup lang='ts'>
defineOptions({
name: 'supervision/interferenceUserTable'
})
import {ref, onMounted, provide, watch} from 'vue'
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import {useDictData} from '@/stores/dictData'
import { useDictData } from '@/stores/dictData'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import {getUserReportById, getUserReportByFangAnId} from '@/api/supervision-boot/interfere'
import { getUserReportById, getUserReportByFangAnId } from '@/api/supervision-boot/interfere'
import BpmUserReportDetail from '../../components/undocumented/detail.vue'
import {useAdminInfo} from '@/stores/adminInfo'
import {ElMessage, ElMessageBox} from 'element-plus'
import {userReportRenewalCancel} from '@/api/process-boot/generalTest'
import { useAdminInfo } from '@/stores/adminInfo'
import { ElMessage, ElMessageBox } from 'element-plus'
import { userReportRenewalCancel } from '@/api/process-boot/generalTest'
const dictData = useDictData()
const flag = ref(false)
const areaOptionList = dictData
.getBasicData('jibei_area')
.filter(item => !(item.name == '超高压' || item.name == '风光储'))
.getBasicData('jibei_area')
.filter(item => !(item.name == '超高压' || item.name == '风光储'))
const statusSelect = dictData.statusSelect()
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
@@ -73,27 +57,31 @@ const jb_dky = ref(false)
const update = ref(false)
const addForms = ref()
jb_pl.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
}).length != 0
? true
: false
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
}).length != 0
? true
: false
jb_dky.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_dky'
}).length != 0
? true
: false
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_dky'
}).length != 0
? true
: false
const {push, options, currentRoute} = useRouter()
const { push, options, currentRoute } = useRouter()
const TableHeaderRef = ref()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getNormalUserPage',
publicHeight: 65,
method: 'POST',
column: [
{title: '序号', type: 'seq', width: 80},
{field: 'city', title: '所在地市', minWidth: 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: '厂站名称',
@@ -103,7 +91,7 @@ const tableStore = new TableStore({
return row.cellValue
}
},
{field: 'projectName', title: '项目名称', minWidth: 170},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
@@ -113,7 +101,7 @@ const tableStore = new TableStore({
return getUserTypeName(userType)
}
},
{field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
@@ -212,8 +200,8 @@ const tableStore = new TableStore({
render: 'basicButton',
showDisabled: row => {
return (
row.createBy != adminInfo.$state.id ||
!(row.status == 0 || row.status == 2 || row.status == null)
row.createBy != adminInfo.$state.id ||
!(row.status == 0 || row.status == 2 || row.status == null)
)
},
disabled: row => {
@@ -239,7 +227,7 @@ const tableStore = new TableStore({
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({title: '重新发起', row: row})
addForms.value.open({ title: '重新发起', row: row })
}
},
{
@@ -336,7 +324,7 @@ const handleAudit = (instanceId: string, historyInstanceId: string) => {
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const {value} = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
@@ -365,10 +353,10 @@ const toFangAn = (row: any, typeNo: number) => {
if (res.data.userType == '0' || res.data.userType == '1') {
needGovernance.value = res.data.userReportProjectPO?.needGovernance
} else if (
res.data.userType == '2' ||
res.data.userType == '3' ||
res.data.userType == '4' ||
res.data.userType == '5'
res.data.userType == '2' ||
res.data.userType == '3' ||
res.data.userType == '4' ||
res.data.userType == '5'
) {
needGovernance.value = res.data.userReportSubstationPO?.needGovernance
} else if (res.data.userType == '6') {
@@ -395,10 +383,10 @@ const toFangAnById = (id: string, typeNo: number) => {
userId = res.data.userReportProjectPO?.id
needGovernance.value = res.data.userReportProjectPO?.needGovernance
} else if (
res.data.userType == '2' ||
res.data.userType == '3' ||
res.data.userType == '4' ||
res.data.userType == '5'
res.data.userType == '2' ||
res.data.userType == '3' ||
res.data.userType == '4' ||
res.data.userType == '5'
) {
userId = res.data.userReportSubstationPO?.id
needGovernance.value = res.data.userReportSubstationPO?.needGovernance
@@ -445,16 +433,16 @@ const getUserTypeName = (userType: any) => {
return '新建电网工程'
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
//初始进来时如果有id就直接打开重新发起
@@ -489,7 +477,7 @@ watch(() => props.id, async (newValue, oldValue) => {
})
}
}, {immediate: true})
}, { immediate: true })
</script>

View File

@@ -16,37 +16,26 @@
</el-select>
</el-form-item>
</template>
<template #operation>
<template #operation>
<el-button icon='' type='primary' @click='toGoNet()'>{{ titleButton }}</el-button>
<el-button style='margin-left: 50px' :icon='Back' @click='go(-1)'>返回</el-button>
</template>
</TableHeader> -->
</TableHeader> -->
<div class="header_btn">
<el-button v-if="bussType == 0 && !(jb_pl || jb_dky)" icon="" type="primary" @click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button
v-if="bussType == 1 && needGovernance != '0' && !(jb_pl || jb_dky)"
icon=""
type="primary"
@click="toGoNet()"
>
<el-button v-if="bussType == 1 && needGovernance != '0' && !(jb_pl || jb_dky)" icon="" type="primary"
@click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button style="margin-left: 50px" :icon="Back" @click="go(-1)">返回</el-button>
</div>
<Table ref="tableRef"/>
<Table ref="tableRef" />
<addForm
v-if="dialogVisible"
ref="addForms"
:id="bussId"
:bussType="bussType"
:title="titleButton1"
openType="detail"
@onSubmit="tableStore.index()"
></addForm>
<addForm v-if="dialogVisible" ref="addForms" :id="bussId" :bussType="bussType" :title="titleButton1"
openType="detail" @onSubmit="tableStore.index()"></addForm>
</div>
</template>
@@ -55,20 +44,20 @@ defineOptions({
name: 'ProgramReview'
})
import {ref, onMounted, provide, nextTick, onUnmounted} from 'vue'
import { ref, onMounted, provide, nextTick, onUnmounted } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import {cancel, userReportGoNetById} from '@/api/supervision-boot/interfere/index'
import {useDictData} from '@/stores/dictData'
import { cancel, userReportGoNetById } from '@/api/supervision-boot/interfere/index'
import { useDictData } from '@/stores/dictData'
import addForm from './addForm.vue'
import {useRouter, useRoute} from 'vue-router'
import {Back} from '@element-plus/icons-vue'
import {useAdminInfo} from '@/stores/adminInfo'
import { useRouter, useRoute } from 'vue-router'
import { Back } from '@element-plus/icons-vue'
import { useAdminInfo } from '@/stores/adminInfo'
const {go, currentRoute, push} = useRouter()
const {query} = useRoute() // 查询参数
import {ElMessage} from 'element-plus'
import {ElMessageBox} from 'element-plus/es'
const { go, currentRoute, push } = useRouter()
const { query } = useRoute() // 查询参数
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
const needGovernance = query.needGovernance as unknown as string // 从 URL 传递过来的 是否需要治理
const dictData = useDictData()
@@ -77,24 +66,28 @@ const adminInfo = useAdminInfo()
const jb_pl = ref(false)
const jb_dky = ref(false)
jb_pl.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
}).length != 0
? true
: false
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
}).length != 0
? true
: false
jb_dky.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_dky'
}).length != 0
? true
: false
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_dky'
}).length != 0
? true
: false
const tableStore = new TableStore({
url: '/supervision-boot/userReportNormal/userReportGoNetPage',
method: 'POST',
column: [
{title: '序号', type: 'seq', width: 80},
{field: 'projectName', title: '用户名称', minWidth: 170},
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'projectName', title: '用户名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
@@ -104,8 +97,8 @@ const tableStore = new TableStore({
return getUserTypeName(userType)
}
},
{field: 'city', title: '所在地市', minWidth: 80},
{field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130},
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
@@ -124,7 +117,7 @@ const tableStore = new TableStore({
3: '退运'
}
},
{field: 'substation', title: '厂站名称', minWidth: 100},
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{
field: 'status',
title: '流程状态',
@@ -153,7 +146,7 @@ const tableStore = new TableStore({
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{field: 'createTime', title: '创建时间', minWidth: 100},
{ field: 'createTime', title: '创建时间', minWidth: 100 },
{
title: '操作',
minWidth: 180,
@@ -261,7 +254,7 @@ onMounted(async () => {
document.addEventListener('visibilitychange', handleVisibilityChange)
if (query.fangAnId) {
//根据id查询待编辑的数据
await userReportGoNetById({id: query.fangAnId}).then(res => {
await userReportGoNetById({ id: query.fangAnId }).then(res => {
if (res && res.code == 'A0000') {
dialogVisible.value = true
titleButton1.value = '重新发起'
@@ -281,7 +274,7 @@ onUnmounted(() => {
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const {value} = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',

View File

@@ -71,7 +71,9 @@ 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: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'city',