mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-10-31 00:57:11 +08:00 
			
		
		
		
	refactor: 优化 queryForm 的 Query 类型使用
This commit is contained in:
		| @@ -4,7 +4,7 @@ import type * as Monitor from './type' | |||||||
| const BASE_URL = '/monitor/online' | const BASE_URL = '/monitor/online' | ||||||
|  |  | ||||||
| /** @desc 查询在线用户列表 */ | /** @desc 查询在线用户列表 */ | ||||||
| export function listOnlineUser(query: Monitor.OnlineUserQuery) { | export function listOnlineUser(query: Monitor.OnlineUserPageQuery) { | ||||||
|   return http.get<PageRes<Monitor.OnlineUserResp[]>>(`${BASE_URL}`, query) |   return http.get<PageRes<Monitor.OnlineUserResp[]>>(`${BASE_URL}`, query) | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -13,10 +13,12 @@ export interface OnlineUserResp { | |||||||
|   createUserString: string |   createUserString: string | ||||||
|   createTime: string |   createTime: string | ||||||
| } | } | ||||||
| export interface OnlineUserQuery extends PageQuery { | export interface OnlineUserQuery { | ||||||
|   nickname?: string |   nickname?: string | ||||||
|   loginTime?: string |   loginTime?: string | ||||||
|  |   sort: Array<string> | ||||||
| } | } | ||||||
|  | export interface OnlineUserPageQuery extends OnlineUserQuery, PageQuery {} | ||||||
|  |  | ||||||
| /** 系统日志类型 */ | /** 系统日志类型 */ | ||||||
| export interface LogResp { | export interface LogResp { | ||||||
| @@ -52,4 +54,4 @@ export interface LogQuery { | |||||||
|   status?: number |   status?: number | ||||||
|   sort: Array<string> |   sort: Array<string> | ||||||
| } | } | ||||||
| export interface LogPageQuery extends PageQuery, LogQuery {} | export interface LogPageQuery extends LogQuery, PageQuery {} | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import type * as System from './type' | |||||||
| const BASE_URL = '/system/dict' | const BASE_URL = '/system/dict' | ||||||
|  |  | ||||||
| /** @desc 查询字典列表 */ | /** @desc 查询字典列表 */ | ||||||
| export function listDict(query: System.DictQuery) { | export function listDict(query: System.DictPageQuery) { | ||||||
|   return http.get<PageRes<System.DictResp[]>>(`${BASE_URL}`, query) |   return http.get<PageRes<System.DictResp[]>>(`${BASE_URL}`, query) | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -29,7 +29,7 @@ export function deleteDict(id: string) { | |||||||
| } | } | ||||||
|  |  | ||||||
| /** @desc 查询字典项列表 */ | /** @desc 查询字典项列表 */ | ||||||
| export function listDictItem(query: System.DictItemQuery) { | export function listDictItem(query: System.DictItemPageQuery) { | ||||||
|   return http.get<PageRes<System.DictItemResp[]>>(`${BASE_URL}/item`, query) |   return http.get<PageRes<System.DictItemResp[]>>(`${BASE_URL}/item`, query) | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import type * as System from './type' | |||||||
| const BASE_URL = '/system/file' | const BASE_URL = '/system/file' | ||||||
|  |  | ||||||
| /** @desc 查询文件列表 */ | /** @desc 查询文件列表 */ | ||||||
| export function listFile(query: System.FileQuery) { | export function listFile(query: System.FilePageQuery) { | ||||||
|   return http.get<PageRes<System.FileItem[]>>(`${BASE_URL}`, query) |   return http.get<PageRes<System.FileItem[]>>(`${BASE_URL}`, query) | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import type * as System from './type' | |||||||
| const BASE_URL = '/system/notice' | const BASE_URL = '/system/notice' | ||||||
|  |  | ||||||
| /** @desc 查询公告列表 */ | /** @desc 查询公告列表 */ | ||||||
| export function listNotice(query: System.NoticeQuery) { | export function listNotice(query: System.NoticePageQuery) { | ||||||
|   return http.get<PageRes<System.NoticeResp[]>>(`${BASE_URL}`, query) |   return http.get<PageRes<System.NoticeResp[]>>(`${BASE_URL}`, query) | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import type * as System from './type' | |||||||
| const BASE_URL = '/system/role' | const BASE_URL = '/system/role' | ||||||
|  |  | ||||||
| /** @desc 查询角色列表 */ | /** @desc 查询角色列表 */ | ||||||
| export function listRole(query: System.RoleQuery) { | export function listRole(query: System.RolePageQuery) { | ||||||
|   return http.get<PageRes<System.RoleResp[]>>(`${BASE_URL}`, query) |   return http.get<PageRes<System.RoleResp[]>>(`${BASE_URL}`, query) | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ import type * as System from './type' | |||||||
| const BASE_URL = '/system/storage' | const BASE_URL = '/system/storage' | ||||||
|  |  | ||||||
| /** @desc 查询存储列表 */ | /** @desc 查询存储列表 */ | ||||||
| export function listStorage(query: System.StorageQuery) { | export function listStorage(query: System.StoragePageQuery) { | ||||||
|   return http.get<PageRes<System.StorageResp[]>>(`${BASE_URL}`, query) |   return http.get<PageRes<System.StorageResp[]>>(`${BASE_URL}`, query) | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -29,7 +29,7 @@ export interface UserQuery { | |||||||
|   deptId?: string |   deptId?: string | ||||||
|   sort: Array<string> |   sort: Array<string> | ||||||
| } | } | ||||||
| export interface UserPageQuery extends PageQuery, UserQuery {} | export interface UserPageQuery extends UserQuery, PageQuery {} | ||||||
|  |  | ||||||
| /** 系统角色类型 */ | /** 系统角色类型 */ | ||||||
| export interface RoleResp { | export interface RoleResp { | ||||||
| @@ -62,9 +62,11 @@ export interface RoleDetailResp { | |||||||
|   updateTime: string |   updateTime: string | ||||||
|   disabled: boolean |   disabled: boolean | ||||||
| } | } | ||||||
| export interface RoleQuery extends PageQuery { | export interface RoleQuery { | ||||||
|   description?: string |   description?: string | ||||||
|  |   sort: Array<string> | ||||||
| } | } | ||||||
|  | export interface RolePageQuery extends RoleQuery, PageQuery {} | ||||||
|  |  | ||||||
| /** 系统菜单类型 */ | /** 系统菜单类型 */ | ||||||
| export interface MenuResp { | export interface MenuResp { | ||||||
| @@ -116,25 +118,6 @@ export interface DeptQuery { | |||||||
|   sort: Array<string> |   sort: Array<string> | ||||||
| } | } | ||||||
|  |  | ||||||
| /** 系统公告类型 */ |  | ||||||
| export interface NoticeResp { |  | ||||||
|   id: string |  | ||||||
|   title: string |  | ||||||
|   content: string |  | ||||||
|   status: number |  | ||||||
|   type: string |  | ||||||
|   effectiveTime: string |  | ||||||
|   terminateTime: string |  | ||||||
|   createUserString: string |  | ||||||
|   createTime: string |  | ||||||
|   updateUserString: string |  | ||||||
|   updateTime: string |  | ||||||
| } |  | ||||||
| export interface NoticeQuery extends PageQuery { |  | ||||||
|   title?: string |  | ||||||
|   type?: string |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /** 系统字典类型 */ | /** 系统字典类型 */ | ||||||
| export interface DictResp { | export interface DictResp { | ||||||
|   id: string |   id: string | ||||||
| @@ -147,9 +130,11 @@ export interface DictResp { | |||||||
|   updateUserString: string |   updateUserString: string | ||||||
|   updateTime: string |   updateTime: string | ||||||
| } | } | ||||||
| export interface DictQuery extends PageQuery { | export interface DictQuery { | ||||||
|   description?: string |   description?: string | ||||||
|  |   sort: Array<string> | ||||||
| } | } | ||||||
|  | export interface DictPageQuery extends DictQuery, PageQuery {} | ||||||
| export type DictItemResp = { | export type DictItemResp = { | ||||||
|   id: string |   id: string | ||||||
|   label: string |   label: string | ||||||
| @@ -164,11 +149,34 @@ export type DictItemResp = { | |||||||
|   updateUserString: string |   updateUserString: string | ||||||
|   updateTime: string |   updateTime: string | ||||||
| } | } | ||||||
| export interface DictItemQuery extends PageQuery { | export interface DictItemQuery { | ||||||
|   description?: string |   description?: string | ||||||
|   status?: number |   status?: number | ||||||
|  |   sort: Array<string> | ||||||
|   dictId: string |   dictId: string | ||||||
| } | } | ||||||
|  | export interface DictItemPageQuery extends DictItemQuery, PageQuery {} | ||||||
|  |  | ||||||
|  | /** 系统公告类型 */ | ||||||
|  | export interface NoticeResp { | ||||||
|  |   id: string | ||||||
|  |   title: string | ||||||
|  |   content: string | ||||||
|  |   status: number | ||||||
|  |   type: string | ||||||
|  |   effectiveTime: string | ||||||
|  |   terminateTime: string | ||||||
|  |   createUserString: string | ||||||
|  |   createTime: string | ||||||
|  |   updateUserString: string | ||||||
|  |   updateTime: string | ||||||
|  | } | ||||||
|  | export interface NoticeQuery { | ||||||
|  |   title?: string | ||||||
|  |   type?: string | ||||||
|  |   sort: Array<string> | ||||||
|  | } | ||||||
|  | export interface NoticePageQuery extends NoticeQuery, PageQuery {} | ||||||
|  |  | ||||||
| /** 系统文件类型 */ | /** 系统文件类型 */ | ||||||
| export type FileItem = { | export type FileItem = { | ||||||
| @@ -184,18 +192,19 @@ export type FileItem = { | |||||||
|   updateUserString: string |   updateUserString: string | ||||||
|   updateTime: string |   updateTime: string | ||||||
| } | } | ||||||
| export interface FileQuery extends PageQuery { | /** 文件资源统计信息 */ | ||||||
|   name?: string |  | ||||||
|   type?: string |  | ||||||
| } |  | ||||||
| /** 文件资源统计 */ |  | ||||||
| export interface FileStatisticsResp { | export interface FileStatisticsResp { | ||||||
|   type: string |   type: string | ||||||
|   size: number |   size: number | ||||||
|   formattedSize: string |  | ||||||
|   number: number |   number: number | ||||||
|   data: Array<FileStatisticsResp> |   data: Array<FileStatisticsResp> | ||||||
| } | } | ||||||
|  | export interface FileQuery { | ||||||
|  |   name?: string | ||||||
|  |   type?: string | ||||||
|  |   sort: Array<string> | ||||||
|  | } | ||||||
|  | export interface FilePageQuery extends FileQuery, PageQuery {} | ||||||
|  |  | ||||||
| /** 系统存储类型 */ | /** 系统存储类型 */ | ||||||
| export type StorageResp = { | export type StorageResp = { | ||||||
| @@ -217,10 +226,12 @@ export type StorageResp = { | |||||||
|   updateUserString: string |   updateUserString: string | ||||||
|   updateTime: string |   updateTime: string | ||||||
| } | } | ||||||
| export interface StorageQuery extends PageQuery { | export interface StorageQuery { | ||||||
|   description?: string |   description?: string | ||||||
|   status?: number |   status?: number | ||||||
|  |   sort: Array<string> | ||||||
| } | } | ||||||
|  | export interface StoragePageQuery extends StorageQuery, PageQuery {} | ||||||
|  |  | ||||||
| /** 系统参数类型 */ | /** 系统参数类型 */ | ||||||
| export interface OptionResp { | export interface OptionResp { | ||||||
| @@ -232,7 +243,6 @@ export interface OptionResp { | |||||||
| export interface OptionQuery { | export interface OptionQuery { | ||||||
|   code: Array<string> |   code: Array<string> | ||||||
| } | } | ||||||
|  |  | ||||||
| /** 基础配置类型 */ | /** 基础配置类型 */ | ||||||
| export interface BasicConfigResp { | export interface BasicConfigResp { | ||||||
|   site_favicon: string |   site_favicon: string | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								src/types/api.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								src/types/api.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -17,5 +17,4 @@ interface PageRes<T> { | |||||||
| interface PageQuery { | interface PageQuery { | ||||||
|   page: number |   page: number | ||||||
|   size: number |   size: number | ||||||
|   sort: Array<string> |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -133,8 +133,11 @@ const onOauth = async (source: string) => { | |||||||
|     &-logo { |     &-logo { | ||||||
|       width: 100%; |       width: 100%; | ||||||
|       height: 104px; |       height: 104px; | ||||||
|  |       font-weight: 700; | ||||||
|  |       font-size: 20px; | ||||||
|  |       line-height: 32px; | ||||||
|       display: flex; |       display: flex; | ||||||
|       padding: 0px 20px; |       padding: 0 20px; | ||||||
|       align-items: center; |       align-items: center; | ||||||
|       justify-content: start; |       justify-content: start; | ||||||
|       background-image: url('/src/assets/images/login_h5.jpg'); |       background-image: url('/src/assets/images/login_h5.jpg'); | ||||||
| @@ -175,10 +178,7 @@ const onOauth = async (source: string) => { | |||||||
|       } |       } | ||||||
|       :deep(.arco-tabs-tab) { |       :deep(.arco-tabs-tab) { | ||||||
|         color: var(--color-text-2); |         color: var(--color-text-2); | ||||||
|         margin-right: 20px; |         margin: 0 20px 0 0; | ||||||
|         margin-top: 0px; |  | ||||||
|         margin-left: 0px; |  | ||||||
|         margin-bottom: 0px; |  | ||||||
|       } |       } | ||||||
|       :deep(.arco-tabs-tab-title) { |       :deep(.arco-tabs-tab-title) { | ||||||
|         font-size: 16px; |         font-size: 16px; | ||||||
|   | |||||||
| @@ -45,7 +45,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { exportLoginLog, listLog } from '@/apis' | import { exportLoginLog, listLog, type LogQuery } from '@/apis' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| import DateRangePicker from '@/components/DateRangePicker/index.vue' | import DateRangePicker from '@/components/DateRangePicker/index.vue' | ||||||
| import { useTable, useDownload } from '@/hooks' | import { useTable, useDownload } from '@/hooks' | ||||||
| @@ -90,15 +90,12 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   { title: '终端系统', dataIndex: 'os', ellipsis: true, tooltip: true } |   { title: '终端系统', dataIndex: 'os', ellipsis: true, tooltip: true } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<LogQuery>({ | ||||||
|   module: '登录', |   module: '登录', | ||||||
|   ip: undefined, |  | ||||||
|   createUserString: undefined, |  | ||||||
|   createTime: [ |   createTime: [ | ||||||
|     dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), |     dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), | ||||||
|     dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') |     dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') | ||||||
|   ], |   ], | ||||||
|   status: undefined, |  | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -56,7 +56,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { listLog, exportOperationLog, type LogResp } from '@/apis' | import { listLog, exportOperationLog, type LogResp, type LogQuery } from '@/apis' | ||||||
| import OperationLogDetailDrawer from './OperationLogDetailDrawer.vue' | import OperationLogDetailDrawer from './OperationLogDetailDrawer.vue' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| import DateRangePicker from '@/components/DateRangePicker/index.vue' | import DateRangePicker from '@/components/DateRangePicker/index.vue' | ||||||
| @@ -102,15 +102,11 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   { title: '终端系统', dataIndex: 'os', ellipsis: true, tooltip: true } |   { title: '终端系统', dataIndex: 'os', ellipsis: true, tooltip: true } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<LogQuery>({ | ||||||
|   description: undefined, |  | ||||||
|   ip: undefined, |  | ||||||
|   createUserString: undefined, |  | ||||||
|   createTime: [ |   createTime: [ | ||||||
|     dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), |     dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), | ||||||
|     dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') |     dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') | ||||||
|   ], |   ], | ||||||
|   status: undefined, |  | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -44,7 +44,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { listOnlineUser, kickout } from '@/apis' | import { listOnlineUser, kickout, type OnlineUserQuery } from '@/apis' | ||||||
| import { Message } from '@arco-design/web-vue' | import { Message } from '@arco-design/web-vue' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| import DateRangePicker from '@/components/DateRangePicker/index.vue' | import DateRangePicker from '@/components/DateRangePicker/index.vue' | ||||||
| @@ -79,9 +79,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<OnlineUserQuery>({ | ||||||
|   nickname: undefined, |  | ||||||
|   loginTime: undefined, |  | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -112,9 +112,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<DeptQuery>({ | ||||||
|   description: undefined, |  | ||||||
|   status: undefined, |  | ||||||
|   sort: ['parentId,asc', 'sort,asc', 'createTime,desc'] |   sort: ['parentId,asc', 'sort,asc', 'createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -52,7 +52,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { listDict, deleteDict, type DictResp } from '@/apis' | import { listDict, deleteDict, type DictResp, type DictQuery } from '@/apis' | ||||||
| import DictAddModal from './DictAddModal.vue' | import DictAddModal from './DictAddModal.vue' | ||||||
| import DictItemModal from '@/views/system/dict/item/index.vue' | import DictItemModal from '@/views/system/dict/item/index.vue' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| @@ -87,8 +87,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<DictQuery>({ | ||||||
|   description: undefined, |  | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -63,7 +63,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||||
| import { listDictItem, deleteDictItem, type DictItemResp } from '@/apis' | import { listDictItem, deleteDictItem, type DictItemResp, type DictItemQuery } from '@/apis' | ||||||
| import DictItemAddModal from './DictItemAddModal.vue' | import DictItemAddModal from './DictItemAddModal.vue' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| import { useTable } from '@/hooks' | import { useTable } from '@/hooks' | ||||||
| @@ -97,9 +97,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   { title: '操作', slotName: 'action', width: 130, align: 'center', fixed: !isMobile() ? 'right' : undefined } |   { title: '操作', slotName: 'action', width: 130, align: 'center', fixed: !isMobile() ? 'right' : undefined } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<DictItemQuery>({ | ||||||
|   description: undefined, |  | ||||||
|   status: undefined, |  | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -94,7 +94,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { listFile, uploadFile, deleteFile, type FileItem, type FileQuery } from '@/apis' | import { listFile, uploadFile, deleteFile, type FileItem, type FileQuery, type FilePageQuery } from '@/apis' | ||||||
| import { Message, Modal, type RequestOption } from '@arco-design/web-vue' | import { Message, Modal, type RequestOption } from '@arco-design/web-vue' | ||||||
| import FileGrid from './FileGrid.vue' | import FileGrid from './FileGrid.vue' | ||||||
| import { | import { | ||||||
| @@ -108,6 +108,7 @@ import { ImageTypes } from '@/constant/file' | |||||||
| import { api as viewerApi } from 'v-viewer' | import { api as viewerApi } from 'v-viewer' | ||||||
| import 'viewerjs/dist/viewer.css' | import 'viewerjs/dist/viewer.css' | ||||||
| import { downloadByUrl } from '@/utils/downloadFile' | import { downloadByUrl } from '@/utils/downloadFile' | ||||||
|  |  | ||||||
| const FileList = defineAsyncComponent(() => import('./FileList.vue')) | const FileList = defineAsyncComponent(() => import('./FileList.vue')) | ||||||
| onMounted(() => { | onMounted(() => { | ||||||
|   const fileMainDom = document.getElementById('fileMain') |   const fileMainDom = document.getElementById('fileMain') | ||||||
| @@ -138,7 +139,7 @@ const handleScroll = (event) => { | |||||||
| const route = useRoute() | const route = useRoute() | ||||||
| const { mode, selectedFileIds, toggleMode, addSelectedFileItem } = useFileManage() | const { mode, selectedFileIds, toggleMode, addSelectedFileItem } = useFileManage() | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<FileQuery>({ | ||||||
|   name: undefined, |   name: undefined, | ||||||
|   type: route.query.type?.toString() || undefined, |   type: route.query.type?.toString() || undefined, | ||||||
|   sort: ['updateTime,desc'] |   sort: ['updateTime,desc'] | ||||||
| @@ -151,7 +152,7 @@ const fileList = ref<FileItem[]>([]) | |||||||
| const isBatchMode = ref(false) | const isBatchMode = ref(false) | ||||||
| const loading = ref(false) | const loading = ref(false) | ||||||
| // 查询文件列表 | // 查询文件列表 | ||||||
| const getFileList = async (query: FileQuery = { ...queryForm, page: pagination.page, size: pagination.size }) => { | const getFileList = async (query: FilePageQuery = { ...queryForm, page: pagination.page, size: pagination.size }) => { | ||||||
|   try { |   try { | ||||||
|     loading.value = true |     loading.value = true | ||||||
|     isBatchMode.value = false |     isBatchMode.value = false | ||||||
|   | |||||||
| @@ -129,9 +129,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<MenuQuery>({ | ||||||
|   title: undefined, |  | ||||||
|   status: undefined, |  | ||||||
|   sort: ['parentId,asc', 'sort,asc', 'createTime,desc'] |   sort: ['parentId,asc', 'sort,asc', 'createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -57,7 +57,7 @@ | |||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||||
| import { listNotice, deleteNotice, type NoticeResp } from '@/apis' | import { listNotice, deleteNotice, type NoticeResp, type NoticeQuery } from '@/apis' | ||||||
| import NoticeAddModal from './NoticeAddModal.vue' | import NoticeAddModal from './NoticeAddModal.vue' | ||||||
| import NoticeDetailModal from './NoticeDetailModal.vue' | import NoticeDetailModal from './NoticeDetailModal.vue' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| @@ -94,9 +94,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<NoticeQuery>({ | ||||||
|   title: undefined, |  | ||||||
|   type: undefined, |  | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -57,7 +57,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { listRole, deleteRole, type RoleResp } from '@/apis' | import { listRole, deleteRole, type RoleResp, type RoleQuery } from '@/apis' | ||||||
| import RoleAddModal from './RoleAddModal.vue' | import RoleAddModal from './RoleAddModal.vue' | ||||||
| import RoleDetailDrawer from './RoleDetailDrawer.vue' | import RoleDetailDrawer from './RoleDetailDrawer.vue' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| @@ -97,8 +97,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<RoleQuery>({ | ||||||
|   description: undefined, |  | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -68,7 +68,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { listStorage, deleteStorage, type StorageResp } from '@/apis' | import { listStorage, deleteStorage, type StorageResp, type StorageQuery } from '@/apis' | ||||||
| import StorageAddModal from './StorageAddModal.vue' | import StorageAddModal from './StorageAddModal.vue' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| import { useTable } from '@/hooks' | import { useTable } from '@/hooks' | ||||||
| @@ -111,9 +111,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive({ | const queryForm = reactive<StorageQuery>({ | ||||||
|   description: undefined, |  | ||||||
|   status: undefined, |  | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -107,7 +107,7 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { listUser, deleteUser, exportUser, type UserResp } from '@/apis' | import { listUser, deleteUser, exportUser, type UserResp, type UserQuery } from '@/apis' | ||||||
| import UserAddModal from './UserAddModal.vue' | import UserAddModal from './UserAddModal.vue' | ||||||
| import UserDetailDrawer from './UserDetailDrawer.vue' | import UserDetailDrawer from './UserDetailDrawer.vue' | ||||||
| import UserResetPwdModal from './UserResetPwdModal.vue' | import UserResetPwdModal from './UserResetPwdModal.vue' | ||||||
| @@ -121,12 +121,7 @@ import has from '@/utils/has' | |||||||
| import { DisEnableStatusList } from '@/constant/common' | import { DisEnableStatusList } from '@/constant/common' | ||||||
|  |  | ||||||
| defineOptions({ name: 'SystemUser' }) | defineOptions({ name: 'SystemUser' }) | ||||||
| interface queryFormType { |  | ||||||
|   description?: string |  | ||||||
|   status?: number |  | ||||||
|   deptId?: string |  | ||||||
|   sort: ['createTime,desc'] |  | ||||||
| } |  | ||||||
| const columns: TableInstanceColumns[] = [ | const columns: TableInstanceColumns[] = [ | ||||||
|   { |   { | ||||||
|     title: '序号', |     title: '序号', | ||||||
| @@ -165,7 +160,7 @@ const columns: TableInstanceColumns[] = [ | |||||||
|   } |   } | ||||||
| ] | ] | ||||||
|  |  | ||||||
| const queryForm = reactive<queryFormType>({ | const queryForm = reactive<UserQuery>({ | ||||||
|   sort: ['createTime,desc'] |   sort: ['createTime,desc'] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user