fixbug: 🐛 修改用户分页查询问题

This commit is contained in:
Bunny 2024-10-04 17:24:12 +08:00
parent 3342c0a07f
commit e9112177d4
9 changed files with 30 additions and 132 deletions

View File

@ -16,7 +16,7 @@
import { Plus } from '@element-plus/icons-vue';
import { ElMessage, UploadRawFile, UploadRequestOptions } from 'element-plus';
import { onMounted, ref } from 'vue';
import { SystemEnum } from '@/enum/upload';
import { SystemEnum } from '@/enums/upload';
import { fetchUploadFIle } from '@/api/v1/system';
const props = defineProps({

View File

@ -1,30 +0,0 @@
import type { Option } from '@/types/enum/options';
/**
* *
*/
export const isDefaultOptions: Option[] = [
{ value: true, label: '是' },
{ value: false, label: '否' },
];
/**
* *
*/
export const isDefaultVisibleOptions: Option[] = [
{ value: true, label: '显示' },
{ value: false, label: '不显示' },
];
/**
* *
*/
export const sexConstant: Option[] = [
{ value: 1, label: '男' },
{ value: 0, label: '女' },
];
/**
* *
*/
export const pageSizes: number[] = [15, 30, 50, 100, 150, 200, 300];

View File

@ -1,29 +0,0 @@
// ? 表单选项
import type { Option } from '../../types/enum/options';
/**
* *
*/
export const defaultStatus: Option[] = [
{ value: '', label: '' },
{ value: 1, label: '启用' },
{ value: 0, label: '禁用' },
];
/**
* *
*/
export const isErrorStatus: Option[] = [
{ value: '', label: '' },
{ value: false, label: '未出错' },
{ value: true, label: '错误' },
];
/**
* *
*/
export const statusConstant: Option[] = [
{ value: '', label: '' },
{ value: 1, label: '是' },
{ value: 0, label: '否' },
];

View File

@ -1,10 +0,0 @@
import type { Option } from '@/types/enum/options';
/**
*
*/
export const faviconCategory: Option[] = [
{ value: '', label: '' },
{ value: 'web', label: 'web 前台' },
{ value: 'admin', label: 'admin 后台' },
];

View File

@ -1,21 +0,0 @@
import type { Option } from '@/types/enum/options';
/**
* *
*/
export const feedback: Option[] = [
{ value: '', label: '' },
{ value: 1, label: '已处理' },
{ value: 0, label: '未处理' },
{ value: -1, label: '其它问题' },
];
/**
* *
*/
export const feedbackTypeOptions: Option[] = [
{ label: '优化建议', value: '优化建议' },
{ label: 'bug反馈', value: 'bug反馈' },
{ label: '新增功能建议', value: '新增功能建议' },
{ label: '其它', value: '其它' },
];

View File

@ -1,25 +0,0 @@
import type { Option } from '@/types/enum/options';
/**
* *
*/
export const layoutConstant: Option[] = [
{ value: 'ltr', label: '从左到右' },
{ value: 'rtl', label: '从右到左' },
];
/**
* *
*/
export const articleModeConstant: Option[] = [
{ value: 'album', label: '相册模式' },
{ value: 'list', label: '列表模式' },
];
/**
* *
*/
export const userStatus: Option[] = [
{ value: 0, label: '启用' },
{ value: 1, label: '禁用' },
];

View File

@ -22,6 +22,14 @@ export const sexConstant = [
{ value: 0, label: '女' },
];
/**
* *
*/
export const userStatus = [
{ value: 0, label: '启用' },
{ value: 1, label: '禁用' },
];
/**
* *
*/

View File

@ -7,16 +7,3 @@ export enum SystemEnum {
// Base64
Base64 = 'data:text/plain;base64,',
}
/**
*
*/
export enum UploadFileEnum {
Favicon = 'favicon',
Avatar = 'avatar',
Article = 'article',
Carousel = 'carousel',
Feedback = 'feedback',
ArticleCovers = 'articleCovers',
ArticleAttachment = 'articleAttachment',
}

View File

@ -17,7 +17,7 @@ import Role from '@iconify-icons/ri/admin-line';
import Password from '@iconify-icons/ri/lock-password-line';
import More from '@iconify-icons/ep/more-filled';
import { useAdminUserStore } from '@/store/system/adminUser';
import { ErrorTypes } from 'xgplayer/es/error';
import { sexConstant, userStatus } from '@/enums/baseConstant';
const tableRef = ref();
const formRef = ref();
@ -59,27 +59,45 @@ onMounted(() => {
<template>
<div class="main">
<el-form ref="formRef" :inline="true" :model="adminUserStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
<!-- 查询用户名 -->
<el-form-item :label="$t('adminUser_username')" prop="username">
<el-input v-model="adminUserStore.form.username" :placeholder="`${$t('input')}${$t('adminUser_username')}`" class="!w-[180px]" clearable />
</el-form-item>
<!-- 查询昵称 -->
<el-form-item :label="$t('adminUser_nickName')" prop="nickName">
<el-input v-model="adminUserStore.form.nickName" :placeholder="`${$t('input')}${$t('adminUser_nickName')}`" class="!w-[180px]" clearable />
</el-form-item>
<!-- 查询邮箱 -->
<el-form-item :label="$t('adminUser_email')" prop="email">
<el-input v-model="adminUserStore.form.email" :placeholder="`${$t('input')}${$t('adminUser_email')}`" class="!w-[180px]" clearable />
</el-form-item>
<!-- 查询手机号 -->
<el-form-item :label="$t('adminUser_phone')" prop="phone">
<el-input v-model="adminUserStore.form.phone" :placeholder="`${$t('input')}${$t('adminUser_phone')}`" class="!w-[180px]" clearable />
</el-form-item>
<!-- 查询性别 -->
<el-form-item :label="$t('adminUser_sex')" prop="sex">
<el-input v-model="adminUserStore.form.sex" :placeholder="`${$t('input')}${$t('adminUser_sex')}`" class="!w-[180px]" clearable />
<el-select v-model="adminUserStore.form.sex" :placeholder="`${$t('input')}${$t('adminUser_sex')}`" class="!w-[180px]" clearable filterable>
<el-option v-for="(item, index) in sexConstant" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
</el-select>
</el-form-item>
<!-- 查询简介 -->
<el-form-item :label="$t('adminUser_summary')" prop="summary">
<el-input v-model="adminUserStore.form.summary" :placeholder="`${$t('input')}${$t('adminUser_summary')}`" class="!w-[180px]" clearable />
</el-form-item>
<!-- 查询状态 -->
<el-form-item :label="$t('adminUser_status')" prop="status">
<el-input v-model="adminUserStore.form.status" :placeholder="`${$t('input')}${$t('adminUser_status')}`" class="!w-[180px]" clearable />
<el-select v-model="adminUserStore.form.status" :placeholder="`${$t('input')}${$t('adminUser_status')}`" class="!w-[180px]" clearable filterable>
<el-option v-for="(item, index) in userStatus" :key="index" :label="item.label" :navigationBar="false" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button :icon="useRenderIcon('ri:search-line')" :loading="adminUserStore.loading" type="primary" @click="onSearch"> {{ $t('search') }} </el-button>
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>