refactor: type/注释优化 去除大量any

This commit is contained in:
dap
2025-01-10 14:02:21 +08:00
parent 6e3b468303
commit 9f6bee86f0
81 changed files with 710 additions and 367 deletions

View File

@@ -1,3 +1,4 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { DescItem } from '#/components/description';
@@ -5,7 +6,6 @@ import { DictEnum } from '@vben/constants';
import { Tag } from 'ant-design-vue';
import { type FormSchemaGetter } from '#/adapter/form';
import { getDictOptions } from '#/utils/dict';
import {
renderDict,

View File

@@ -1,9 +1,11 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import type { VbenFormProps } from '@vben/common-ui';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { PageQuery } from '#/api/common';
import type { OperationLog } from '#/api/monitor/operlog/model';
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
import { Page, useVbenDrawer } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { Modal, Space } from 'ant-design-vue';
@@ -12,7 +14,6 @@ import {
addSortParams,
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps,
} from '#/adapter/vxe-table';
import {
operLogClean,
@@ -61,7 +62,7 @@ const gridOptions: VxeGridProps<OperationLog> = {
proxyConfig: {
ajax: {
query: async ({ page, sorts }, formValues = {}) => {
const params: any = {
const params: PageQuery = {
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
@@ -102,7 +103,7 @@ const [OperationPreviewDrawer, drawerApi] = useVbenDrawer({
* 预览
* @param record 操作日志记录
*/
function handlePreview(record: Recordable<any>) {
function handlePreview(record: OperationLog) {
drawerApi.setData({ record });
drawerApi.open();
}
@@ -123,7 +124,7 @@ function handleClear() {
*/
async function handleDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: any) => row.operId);
const ids = rows.map((row: OperationLog) => row.operId);
Modal.confirm({
title: '提示',
okType: 'danger',

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import type { OperationLog } from '#/api/monitor/operlog/model';
import { useVbenDrawer } from '@vben/common-ui';
@@ -20,7 +20,7 @@ function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
const { record } = drawerApi.getData() as { record: Recordable<any> };
const { record } = drawerApi.getData() as { record: OperationLog };
setDescProps({ data: record }, true);
}
</script>