fix: 列表查询pageNum设为1

This commit is contained in:
TsMask
2023-11-06 14:33:40 +08:00
parent de16c3d1f5
commit ca0913a8cf
42 changed files with 2652 additions and 199 deletions

View File

@@ -200,10 +200,13 @@ function fnRecordDelete(row: Record<string, any>) {
});
}
/**查询备份信息列表 */
function fnGetList() {
/**查询备份信息列表, pageNum初始页数 */
function fnGetList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
if(pageNum){
queryParams.pageNum = pageNum;
}
listNeBackup(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
@@ -347,7 +350,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList">
<a-button type="primary" @click.prevent="fnGetList(1)">
<template #icon><SearchOutlined /></template>
{{ t('common.search') }}
</a-button>
@@ -387,7 +390,7 @@ onMounted(() => {
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList">
<a-button type="text" @click.prevent="fnGetList(1)">
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>

View File

@@ -6,7 +6,7 @@ import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import {
getParamConfigTopTab,
getParamConfigInfo,
getParamConfigInfoTable,
updateParamConfigInfo,
updateNeConfigReload,
delParamConfigInfo,
@@ -53,7 +53,7 @@ function fnTabActiveTopTag(key: string | number) {
const neType = neTypeSelect.value[0];
const neId = neTypeSelect.value[1];
const topTag = tabState.tabActiveTopTag;
getParamConfigInfo(neType, topTag, neId)
getParamConfigInfoTable(neType, topTag, neId)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data.type) {
tableState.type = res.data.type;

View File

@@ -0,0 +1,64 @@
<script setup lang="ts">
import { reactive, toRaw, watch, ref } from 'vue';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import { ColumnsType } from 'ant-design-vue/lib/table';
import { listNeVersion } from '@/api/configManage/softwareManage';
import { parseDateToStr } from '@/utils/date-utils';
import useNeInfoStore from '@/store/modules/neinfo';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
const { t } = useI18n();
const emit = defineEmits(['ok', 'cancel', 'update:visible']);
const props = defineProps({
title: {
type: String,
default: '标题',
},
visible: {
type: Boolean,
default: false,
},
data: {
type: Object,
required: true,
},
});
/**弹框取消按钮事件 */
function fnModalCancel() {
emit('cancel');
}
/**显示弹框时初始数据 */
function init() {
console.log(props.data);
}
/**监听是否显示,初始数据 */
watch(
() => props.visible,
val => {
if (val) init();
}
);
</script>
<template>
<a-modal
width="800px"
:title="props.title"
:visible="props.visible"
:keyboard="false"
:mask-closable="false"
@cancel="fnModalCancel"
:footer="null"
>
{{ props }}
</a-modal>
</template>
<style lang="less" scoped>
.table :deep(.ant-pagination) {
padding: 0 24px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -125,10 +125,13 @@ function fnTableSize({ key }: MenuInfo) {
tableState.size = key as SizeType;
}
/**查询信息列表 */
function fnGetList() {
/**查询信息列表, pageNum初始页数 */
function fnGetList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
if(pageNum){
queryParams.pageNum = pageNum;
}
listLicense(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
@@ -325,7 +328,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList">
<a-button type="primary" @click.prevent="fnGetList(1)">
<template #icon><SearchOutlined /></template>
{{ t('common.search') }}
</a-button>
@@ -365,7 +368,7 @@ onMounted(() => {
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList">
<a-button type="text" @click.prevent="fnGetList()">
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>

View File

@@ -329,7 +329,7 @@ function fnModalOk() {
});
modalState.visibleByEdit = false;
modalStateFrom.resetFields();
fnGetList();
fnGetList(1);
} else {
message.error({
content: `${res.msg}`,
@@ -387,7 +387,7 @@ function fnImportModalOk() {
hide();
modalState.confirmLoading = false;
// 获取列表数据
fnGetList();
fnGetList(1);
});
})
.catch(e => {
@@ -600,10 +600,13 @@ function fnRecordMore(type: string | number, row: Record<string, any>) {
}
}
/**查询网元列表 */
function fnGetList() {
/**查询网元列表, pageNum初始页数 */
function fnGetList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
if(pageNum){
queryParams.pageNum = pageNum;
}
listNeInfo(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
@@ -682,7 +685,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList">
<a-button type="primary" @click.prevent="fnGetList(1)">
<template #icon><SearchOutlined /></template>
{{ t('common.search') }}
</a-button>
@@ -722,7 +725,7 @@ onMounted(() => {
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList">
<a-button type="text" @click.prevent="fnGetList()">
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>

View File

@@ -154,10 +154,13 @@ let tablePagination = reactive({
},
});
/**查询角色未授权用户列表 */
function fnGetList() {
/**查询角色未授权用户列表, pageNum初始页数 */
function fnGetList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
if(pageNum){
queryParams.pageNum = pageNum;
}
if (!queryRangePicker.value) {
queryRangePicker.value = ['', ''];
}
@@ -238,7 +241,7 @@ watch(
<a-col :lg="12" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList">
<a-button type="primary" @click.prevent="fnGetList(1)">
<template #icon><SearchOutlined /></template>
{{ t('common.search') }}
</a-button>

View File

@@ -370,10 +370,13 @@ function fnRecordDelete(row: Record<string, any>) {
});
}
/**查询信息列表 */
function fnGetList() {
/**查询信息列表, pageNum初始页数 */
function fnGetList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
if(pageNum){
queryParams.pageNum = pageNum;
}
listNeSoftware(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
@@ -614,7 +617,7 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24">
<a-form-item>
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList">
<a-button type="primary" @click.prevent="fnGetList(1)">
<template #icon><SearchOutlined /></template>
{{ t('common.search') }}
</a-button>
@@ -658,7 +661,7 @@ onMounted(() => {
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList">
<a-button type="text" @click.prevent="fnGetList()">
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>