Browse Source

chore: optimize types

main
刘凯 1 year ago
parent
commit
dfa9bf9281
  1. 2
      src/components/Cropper/src/CropperAvatar.vue
  2. 2
      src/components/Form/src/BasicForm.vue
  3. 7
      src/components/Form/src/components/ApiCascader.vue
  4. 9
      src/components/Form/src/components/ApiRadioGroup.vue
  5. 2
      src/components/Form/src/components/ApiTree.vue
  6. 2
      src/components/Form/src/components/ApiTreeSelect.vue
  7. 2
      src/components/Form/src/components/FileUpload.vue
  8. 3
      src/components/Form/src/components/ImageUpload.vue
  9. 18
      src/components/Form/src/types/form.ts
  10. 133
      src/components/Form/src/types/index.ts
  11. 1
      src/components/SimpleMenu/src/components/useSimpleMenuContext.ts
  12. 2
      src/components/Table/src/types/table.ts
  13. 2
      src/layouts/default/content/useContentViewHeight.ts
  14. 2
      src/layouts/default/header/components/Breadcrumb.vue
  15. 2
      src/layouts/default/sider/index.vue
  16. 2
      src/router/types.ts
  17. 2
      src/store/modules/permission.ts
  18. 7
      src/types/global.d.ts
  19. 2
      src/utils/auth/index.ts
  20. 2
      src/utils/dict.ts
  21. 4
      src/utils/domUtils.ts
  22. 2
      src/utils/http/axios/Axios.ts
  23. 2
      src/utils/http/axios/axiosRetry.ts
  24. 2
      src/utils/index.ts
  25. 4
      src/utils/tongji.ts
  26. 2
      src/views/base/profile/BaseSetting.vue
  27. 2
      src/views/bpm/group/GroupModal.vue
  28. 2
      src/views/bpm/group/group.data.ts
  29. 2
      src/views/bpm/model/ModelModal.vue
  30. 8
      src/views/bpm/model/model.data.ts
  31. 2
      src/views/bpm/oa/leave/create.vue
  32. 4
      src/views/bpm/oa/leave/leave.data.ts
  33. 2
      src/views/bpm/processInstance/processInstance.data.ts
  34. 2
      src/views/infra/apiAccessLog/apiAccessLog.data.ts
  35. 2
      src/views/infra/apiErrorLog/apiErrorLog.data.ts
  36. 2
      src/views/infra/codegen/codegen.data.ts
  37. 4
      src/views/infra/codegen/components/data.ts
  38. 2
      src/views/infra/config/ConfigModal.vue
  39. 6
      src/views/infra/config/config.data.ts
  40. 2
      src/views/infra/dataSourceConfig/DataSourceConfigModal.vue
  41. 4
      src/views/infra/fileConfig/ficleConfig.data.ts
  42. 2
      src/views/infra/job/JobModal.vue
  43. 2
      src/views/infra/job/job.data.ts
  44. 2
      src/views/infra/job/logger/jobLog.data.ts
  45. 2
      src/views/member/config/index.vue
  46. 2
      src/views/member/group/GroupModal.vue
  47. 4
      src/views/member/group/group.data.ts
  48. 2
      src/views/member/level/LevelModal.vue
  49. 4
      src/views/member/level/level.data.ts
  50. 2
      src/views/member/point/record/record.data.ts
  51. 2
      src/views/member/signin/config/config.data.ts
  52. 2
      src/views/member/tag/TagModal.vue
  53. 2
      src/views/member/user/UserModal.vue
  54. 2
      src/views/member/user/user.data.ts
  55. 2
      src/views/mp/message/message.data.ts
  56. 2
      src/views/pay/app/AppModal.vue
  57. 2
      src/views/pay/app/ChannelModal.vue
  58. 10
      src/views/pay/app/app.data.ts
  59. 2
      src/views/pay/demo/demo.data.ts
  60. 2
      src/views/pay/notify/notify.data.ts
  61. 2
      src/views/system/dept/DeptModal.vue
  62. 2
      src/views/system/dict/DictDataModal.vue
  63. 2
      src/views/system/dict/DictTypeModal.vue
  64. 2
      src/views/system/errorCode/ErrorCodeModal.vue
  65. 2
      src/views/system/menu/MenuModal.vue
  66. 2
      src/views/system/notice/NoticeModal.vue
  67. 2
      src/views/system/oauth2/client/ClientModal.vue
  68. 2
      src/views/system/role/RoleModal.vue
  69. 2
      src/views/system/role/RoleScopeModal.vue
  70. 2
      src/views/system/role/role.data.ts
  71. 2
      src/views/system/sensitiveWord/SensitiveWordModal.vue
  72. 2
      src/views/system/sms/channel/SmsChannelModal.vue
  73. 2
      src/views/system/sms/template/SmsTemplateModal.vue
  74. 2
      src/views/system/tenant/TenantModal.vue
  75. 2
      src/views/system/tenantPackage/TenantPackageModal.vue
  76. 1
      src/views/system/tenantPackage/tenantPackage.data.ts
  77. 2
      src/views/system/user/UserModal.vue
  78. 2
      tsconfig.json

2
src/components/Cropper/src/CropperAvatar.vue

@ -64,7 +64,7 @@ defineExpose({ openModal: openModal.bind(null, true), closeModal })
<template>
<div :class="getClass" :style="getStyle">
<div :class="`${prefixCls}-image-wrapper`" :style="getImageWrapperStyle" @click="openModal">
<div :class="`${prefixCls}-image-wrapper`" :style="getImageWrapperStyle" @click="openModal()">
<div :class="`${prefixCls}-image-mask`" :style="getImageWrapperStyle">
<Icon icon="ant-design:cloud-upload-outlined" :size="getIconWidth" :style="getImageWrapperStyle" color="#d6d6d6" />
</div>

2
src/components/Form/src/BasicForm.vue

@ -236,7 +236,7 @@ function handleEnterPress(e: KeyboardEvent) {
}
}
const formActionType: Partial<FormActionType> = {
const formActionType: FormActionType = {
getFieldsValue,
setFieldsValue,
resetFields,

7
src/components/Form/src/components/ApiCascader.vue

@ -10,11 +10,12 @@ import { useRuleFormItem } from '@/hooks/component/useFormItem'
import { useI18n } from '@/hooks/web/useI18n'
interface Option {
value: string
label: string
value?: string
label?: string
loading?: boolean
isLeaf?: boolean
children?: Option[]
[key: string]: any
}
defineOptions({ name: 'ApiCascader' })
@ -24,7 +25,7 @@ const props = defineProps({
type: Array,
},
api: {
type: Function as PropType<(arg?: Recordable<any>) => Promise<Option[]>>,
type: Function as PropType<(arg?: any) => Promise<Option[]>>,
default: null,
},
numberToString: propTypes.bool.def(false),

9
src/components/Form/src/components/ApiRadioGroup.vue

@ -11,13 +11,18 @@ import { useRuleFormItem } from '@/hooks/component/useFormItem'
import { useAttrs } from '@/hooks/core/useAttrs'
import { propTypes } from '@/utils/propTypes'
interface OptionsItem { label: string, value: string | number | boolean, disabled?: boolean, [name: string]: any }
interface OptionsItem {
label?: string
value?: string | number | boolean
disabled?: boolean
[key: string]: any
}
defineOptions({ name: 'ApiRadioGroup' })
const props = defineProps({
api: {
type: Function as PropType<(arg?: any | string) => Promise<OptionsItem[]>>,
type: Function as PropType<(arg?: any) => Promise<OptionsItem[]>>,
default: null,
},
params: {

2
src/components/Form/src/components/ApiTree.vue

@ -13,7 +13,7 @@ import { useRuleFormItem } from '@/hooks/component/useFormItem'
defineOptions({ name: 'ApiTree' })
const props = defineProps({
api: { type: Function as PropType<(arg?: Recordable<any>) => Promise<Recordable<any>>> },
api: { type: Function as PropType<(arg?: any) => Promise<Recordable<any>>> },
params: { type: Object },
immediate: propTypes.bool.def(true),
resultField: propTypes.string.def(''),

2
src/components/Form/src/components/ApiTreeSelect.vue

@ -11,7 +11,7 @@ import { handleTree as handleTreeFn } from '@/utils/tree'
defineOptions({ name: 'ApiTreeSelect' })
const props = defineProps({
api: { type: Function as PropType<(arg?: Recordable<any>) => Promise<Recordable<any>>> },
api: { type: Function as PropType<(arg?: any) => Promise<Recordable<any>>> },
params: { type: Object },
immediate: propTypes.bool.def(true),
async: propTypes.bool.def(false),

2
src/components/Form/src/components/FileUpload.vue

@ -147,7 +147,7 @@ function onBeforeUpload(file) {
//
function onRemove() {
if (props.removeConfirm) {
return new Promise((resolve) => {
return new Promise<boolean>((resolve) => {
createConfirm({
title: '删除',
content: `确定要删除这${isImageMode.value ? '张图片' : '个文件'}吗?`,

3
src/components/Form/src/components/ImageUpload.vue

@ -123,8 +123,9 @@ function changeFileValue(value: any) {
function handleCancel() {
previewOpen.value = false
}
/** 查看图片 */
async function handlePreview(file: UploadProps['fileList'][number]) {
async function handlePreview(file: Required<UploadFile<any>>) {
if (!file.url && !file.preview)
file.preview = (await getBase64(file.originFileObj)) as string

18
src/components/Form/src/types/form.ts

@ -2,7 +2,7 @@ import type { NamePath, RuleObject } from 'ant-design-vue/lib/form/interface'
import type { CSSProperties, VNode } from 'vue'
import type { RowProps } from 'ant-design-vue/lib/grid/Row'
import type { FormItem } from './formItem'
import type { ColEx, ComponentType } from './index'
import type { ColEx, ComponentProps, ComponentType } from './index'
import type { ButtonProps as AntdButtonProps } from '@/components/Button'
import type { TableActionType } from '@/components/Table/src/types/table'
@ -129,7 +129,7 @@ export interface RenderOpts {
[key: string]: any
}
interface BaseFormSchema {
interface BaseFormSchema<T extends ComponentType = any> {
// Field name
field: string
// Extra Fields name[]
@ -160,8 +160,8 @@ interface BaseFormSchema {
tableAction: TableActionType
formActionType: FormActionType
formModel: Recordable
}) => Recordable)
| object
}) => ComponentProps[T])
| ComponentProps[T]
// Required
required?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean)
@ -221,9 +221,9 @@ interface BaseFormSchema {
dynamicRules?: (renderCallbackParams: RenderCallbackParams) => Rule[]
}
export interface ComponentFormSchema extends BaseFormSchema {
export interface ComponentFormSchema<T extends ComponentType = any> extends BaseFormSchema<T> {
// render component
component: ComponentType
component: T
}
export interface SlotFormSchema extends BaseFormSchema {
@ -231,7 +231,11 @@ export interface SlotFormSchema extends BaseFormSchema {
slot: string
}
export type FormSchema = ComponentFormSchema | SlotFormSchema
type ComponentFormSchemaType<T extends ComponentType = ComponentType> = T extends any
? ComponentFormSchema<T>
: never
export type FormSchema = ComponentFormSchemaType | SlotFormSchema
export type FormSchemaInner = Partial<ComponentFormSchema> & Partial<SlotFormSchema> & BaseFormSchema

133
src/components/Form/src/types/index.ts

@ -1,3 +1,5 @@
import type { Component, VNodeProps } from 'vue'
type ColSpanType = number | string
export interface ColEx {
style?: any
@ -80,43 +82,94 @@ export interface ColEx {
xxl?: { span: ColSpanType, offset: ColSpanType } | ColSpanType
}
export type ComponentType =
| 'Input'
| 'InputGroup'
| 'InputPassword'
| 'InputSearch'
| 'InputTextArea'
| 'InputNumber'
| 'InputCountDown'
| 'Select'
| 'ApiSelect'
| 'TreeSelect'
| 'ApiTree'
| 'ApiTreeSelect'
| 'ApiRadioGroup'
| 'RadioButtonGroup'
| 'RadioGroup'
| 'Checkbox'
| 'CheckboxGroup'
| 'AutoComplete'
| 'ApiCascader'
| 'Cascader'
| 'DatePicker'
| 'MonthPicker'
| 'RangePicker'
| 'WeekPicker'
| 'TimePicker'
| 'TimeRangePicker'
| 'Switch'
| 'StrengthMeter'
| 'Upload'
| 'ImageUpload'
| 'IconPicker'
| 'Render'
| 'Slider'
| 'Rate'
| 'Divider'
| 'ApiTransfer'
| 'Editor'
| 'FileUpload'
| 'CronTab'
export type ComponentType = keyof ComponentProps
type MethodsNameToCamelCase<
T extends string,
M extends string = '',
> = T extends `${infer F}-${infer N}${infer Tail}`
? MethodsNameToCamelCase<Tail, `${M}${F}${Uppercase<N>}`>
: `${M}${T}`
type MethodsNameTransform<T> = {
[K in keyof T as K extends `on${string}` ? MethodsNameToCamelCase<K> : never]: T[K];
}
type ExtractPropTypes<T extends Component> = T extends new (...args: any) => any
? Omit<InstanceType<T>['$props'], keyof VNodeProps>
: never
interface _CustomComponents {
ApiSelect: ExtractPropTypes<(typeof import('../components/ApiSelect.vue'))['default']>
ApiTree: ExtractPropTypes<(typeof import('../components/ApiTree.vue'))['default']>
ApiTreeSelect: ExtractPropTypes<(typeof import('../components/ApiTreeSelect.vue'))['default']>
ApiRadioGroup: ExtractPropTypes<(typeof import('../components/ApiRadioGroup.vue'))['default']>
RadioButtonGroup: ExtractPropTypes<
(typeof import('../components/RadioButtonGroup.vue'))['default']
>
ApiCascader: ExtractPropTypes<(typeof import('../components/ApiCascader.vue'))['default']>
StrengthMeter: ExtractPropTypes<
(typeof import('@/components/StrengthMeter/src/StrengthMeter.vue'))['default']
>
Upload: ExtractPropTypes<(typeof import('@/components/Upload/src/BasicUpload.vue'))['default']>
ImageUpload: ExtractPropTypes<
(typeof import('@/components/Upload/src/components/ImageUpload.vue'))['default']
>
IconPicker: ExtractPropTypes<(typeof import('@/components/Icon/src/IconPicker.vue'))['default']>
ApiTransfer: ExtractPropTypes<(typeof import('../components/ApiTransfer.vue'))['default']>
InputCountDown: ExtractPropTypes<
(typeof import('@/components/CountDown/src/CountdownInput.vue'))['default']
>
FileUpload: ExtractPropTypes<(typeof import('../components/FileUpload.vue'))['default']>
Editor: ExtractPropTypes<(typeof import('@/components/Tinymce/src/Editor.vue'))['default']>
CronTab: ExtractPropTypes<(typeof import('@/components/CronTab/src/CronTabInput.vue'))['default']>
}
type CustomComponents<T = _CustomComponents> = {
[K in keyof T]: T[K] & MethodsNameTransform<T[K]>;
}
export interface ComponentProps {
Input: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['default']>
InputGroup: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['InputGroup']>
InputPassword: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['InputPassword']>
InputSearch: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['InputSearch']>
InputTextArea: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['Textarea']>
InputNumber: ExtractPropTypes<(typeof import('ant-design-vue/es/input-number'))['default']>
InputCountDown: CustomComponents['InputCountDown'] & ComponentProps['Input']
Select: ExtractPropTypes<(typeof import('ant-design-vue/es/select'))['default']>
ApiSelect: CustomComponents['ApiSelect'] & ComponentProps['Select']
TreeSelect: ExtractPropTypes<(typeof import('ant-design-vue/es/tree-select'))['default']>
ApiTree: CustomComponents['ApiTree'] &
ExtractPropTypes<(typeof import('ant-design-vue/es/tree'))['default']>
ApiTreeSelect: CustomComponents['ApiTreeSelect'] & ComponentProps['TreeSelect']
ApiRadioGroup: CustomComponents['ApiRadioGroup'] & ComponentProps['RadioGroup']
RadioButtonGroup: CustomComponents['RadioButtonGroup'] & ComponentProps['RadioGroup']
RadioGroup: ExtractPropTypes<(typeof import('ant-design-vue/es/radio'))['RadioGroup']>
Checkbox: ExtractPropTypes<(typeof import('ant-design-vue/es/checkbox'))['default']>
CheckboxGroup: ExtractPropTypes<(typeof import('ant-design-vue/es/checkbox'))['CheckboxGroup']>
AutoComplete: ExtractPropTypes<(typeof import('ant-design-vue/es/auto-complete'))['default']>
ApiCascader: CustomComponents['ApiCascader'] & ComponentProps['Cascader']
Cascader: ExtractPropTypes<(typeof import('ant-design-vue/es/cascader'))['default']>
DatePicker: ExtractPropTypes<(typeof import('ant-design-vue/es/date-picker'))['default']>
MonthPicker: ExtractPropTypes<(typeof import('ant-design-vue/es/date-picker'))['MonthPicker']>
RangePicker: ExtractPropTypes<(typeof import('ant-design-vue/es/date-picker'))['RangePicker']>
WeekPicker: ExtractPropTypes<(typeof import('ant-design-vue/es/date-picker'))['WeekPicker']>
TimePicker: ExtractPropTypes<(typeof import('ant-design-vue/es/time-picker'))['TimePicker']>
TimeRangePicker: ExtractPropTypes<
(typeof import('ant-design-vue/es/time-picker'))['TimeRangePicker']
>
Switch: ExtractPropTypes<(typeof import('ant-design-vue/es/switch'))['default']>
StrengthMeter: CustomComponents['StrengthMeter'] & ComponentProps['InputPassword']
Upload: CustomComponents['Upload']
ImageUpload: CustomComponents['ImageUpload']
IconPicker: CustomComponents['IconPicker']
Render: Record<string, any>
Slider: ExtractPropTypes<(typeof import('ant-design-vue/es/slider'))['default']>
Rate: ExtractPropTypes<(typeof import('ant-design-vue/es/rate'))['default']>
Divider: ExtractPropTypes<(typeof import('ant-design-vue/es/divider'))['default']>
ApiTransfer: CustomComponents['ApiTransfer'] & ExtractPropTypes<(typeof import('ant-design-vue/es/transfer'))['default']>
FileUpload: CustomComponents['FileUpload'] & ExtractPropTypes<(typeof import('ant-design-vue/es/upload'))['default']>
Editor: CustomComponents['Editor']
CronTab: CustomComponents['CronTab']
}

1
src/components/SimpleMenu/src/components/useSimpleMenuContext.ts

@ -16,6 +16,7 @@ export interface MenuEmitterEvents {
opened: boolean
}
'on-update-active-name:submenu': number[]
[key: string | symbol]: unknown
}
export interface SimpleRootMenuContextProps {

2
src/components/Table/src/types/table.ts

@ -416,7 +416,7 @@ export type CellFormat =
| ((text: string, record: Recordable, index: number) => string | number)
| Map<string | number, any>
export interface BasicColumn extends ColumnProps<Recordable> {
export interface BasicColumn extends Omit<ColumnProps<Recordable>, 'filters'> {
children?: BasicColumn[]
filters?: {
text: string

2
src/layouts/default/content/useContentViewHeight.ts

@ -29,7 +29,7 @@ export function useContentViewHeight() {
{ wait: 100, immediate: true },
)
function setPageHeight(height: number) {
async function setPageHeight(height: number) {
pageHeight.value = height
}

2
src/layouts/default/header/components/Breadcrumb.vue

@ -1,4 +1,6 @@
<script lang="ts" setup>
// eslint-disable-next-line ts/ban-ts-comment
// @ts-nocheck TODO: Breadcrumb type error
import type { RouteLocationMatched } from 'vue-router'
import { useRouter } from 'vue-router'
import { ref, watchEffect } from 'vue'

2
src/layouts/default/sider/index.vue

@ -26,7 +26,7 @@ function handleClose() {
placement="left"
:class="prefixCls"
:width="getMenuWidth"
:get-container="null"
:get-container="false"
:open="!getCollapsed"
@close="handleClose"
>

2
src/router/types.ts

@ -4,7 +4,7 @@ import type { RoleEnum } from '@/enums/roleEnum'
export type Component<T = any> = ReturnType<typeof defineComponent> | (() => Promise<typeof import('*.vue')>) | (() => Promise<T>)
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta' | 'children'> {
keepAlive?: boolean
visible?: boolean
icon?: string

2
src/store/modules/permission.ts

@ -102,7 +102,7 @@ export const usePermissionStore = defineStore('app-permission', {
},
// 构建路由
buildRoutesAction(): Promise<AppRouteRecordRaw[]> {
async buildRoutesAction(): Promise<AppRouteRecordRaw[]> {
const { t } = useI18n()
const userStore = useUserStore()
const appStore = useAppStoreWithOut()

7
src/types/global.d.ts vendored

@ -10,10 +10,9 @@ declare global {
}
lastBuildTime: string
}
// declare interface Window {
// // Global vue app instance
// __APP__: App<Element>;
// }
declare interface Window {
_hmt: [string, string][]
}
interface Document {
mozFullScreenElement?: Element

2
src/utils/auth/index.ts

@ -22,7 +22,7 @@ export function setRefreshToken(value: string) {
return setAuthCache(REFRESH_TOKEN_KEY, value)
}
export function getTenantId() {
export function getTenantId(): string {
return getAuthCache(TENANT_ID_KEY)
}

2
src/utils/dict.ts

@ -39,7 +39,7 @@ export function getDictOpts(dictType: string) {
return getDictDatas(dictType)
}
export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean') {
export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean'): any {
const dictOption: DictDataType[] = []
const dictOptions: DictDataType[] = getDictDatas(dictType)
if (dictOptions && dictOptions.length > 0) {

4
src/utils/domUtils.ts

@ -158,11 +158,15 @@ export function once(el: HTMLElement, event: string, fn: EventListener): void {
export function useRafThrottle<T extends FunctionArgs>(fn: T): T {
let locked = false
// eslint-disable-next-line ts/ban-ts-comment, ts/prefer-ts-expect-error
// @ts-ignore
return (...args: any[]) => {
if (locked)
return
locked = true
window.requestAnimationFrame(() => {
// eslint-disable-next-line ts/ban-ts-comment, ts/prefer-ts-expect-error
// @ts-ignore
fn.apply(this, args)
locked = false
})

2
src/utils/http/axios/Axios.ts

@ -55,7 +55,7 @@ export class VAxios {
}
refreshToken() {
axios.defaults.headers.common['tenant-id'] = getTenantId() as number
axios.defaults.headers.common['tenant-id'] = getTenantId()
const refreshToken = getRefreshToken()
return axios.post(`${globSetting.apiUrl}/system/auth/refresh-token?refreshToken=${refreshToken}`)
}

2
src/utils/http/axios/axiosRetry.ts

@ -9,6 +9,8 @@ export class AxiosRetry {
*
*/
retry(axiosInstance: AxiosInstance, error: AxiosError) {
// eslint-disable-next-line ts/ban-ts-comment, ts/prefer-ts-expect-error
// @ts-ignore
const { config } = error.response
const { waitTime, count } = config?.requestOptions?.retryRequest ?? {}
config.__retryCount = config.__retryCount || 0

2
src/utils/index.ts

@ -167,6 +167,8 @@ export function simpleDebounce(fn, delay = 100) {
clearTimeout(timer)
timer = setTimeout(() => {
// eslint-disable-next-line ts/ban-ts-comment, ts/prefer-ts-expect-error
// @ts-ignore
fn.apply(this, args)
}, delay)
}

4
src/utils/tongji.ts

@ -12,12 +12,12 @@ const HM_ID = import.meta.env.VITE_APP_BAIDU_CODE
const hm = document.createElement('script')
hm.src = `https://hm.baidu.com/hm.js?${HM_ID}`
const s = document.getElementsByTagName('script')[0]
s.parentNode.insertBefore(hm, s)
s.parentNode?.insertBefore(hm, s)
})()
router.afterEach((to) => {
if (!HM_ID)
return
_hmt.push(['_trackPageview', to.fullPath])
window._hmt.push(['_trackPageview', to.fullPath])
})

2
src/views/base/profile/BaseSetting.vue

@ -39,7 +39,7 @@ async function updateAvatar({ data }) {
async function handleSubmit() {
try {
const values = await validate()
await updateUserProfileApi(values)
await updateUserProfileApi(values as any)
}
finally {
createMessage.success('更新成功!')

2
src/views/bpm/group/GroupModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateUserGroup(values)

2
src/views/bpm/group/group.data.ts

@ -80,7 +80,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
colProps: { span: 8 },
},

2
src/views/bpm/model/ModelModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateModel(values)

8
src/views/bpm/model/model.data.ts

@ -87,7 +87,7 @@ export const columns: BasicColumn[] = [
onChange(checked: boolean) {
const newStatus = checked ? 0 : 1
const { createMessage } = useMessage()
updateModelState({ id: record.id, state: newStatus })
updateModelState(record.id, newStatus)
.then(() => {
record.status = newStatus
createMessage.success('已成功修改流程状态')
@ -134,7 +134,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'category',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY),
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY) as any,
},
colProps: { span: 8 },
},
@ -166,7 +166,7 @@ export const formSchema: FormSchema[] = [
field: 'category',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY),
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY) as any,
},
},
{
@ -180,7 +180,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
ifShow: ({ values }) => !!values.id,
componentProps: {
options: getDictOptions(DICT_TYPE.BPM_MODEL_FORM_TYPE),
options: getDictOptions(DICT_TYPE.BPM_MODEL_FORM_TYPE) as any,
},
},
{

2
src/views/bpm/oa/leave/create.vue

@ -22,7 +22,7 @@ const [registerForm, { resetFields, validate }] = useForm({
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
await createLeave(values)
}
finally {

4
src/views/bpm/oa/leave/leave.data.ts

@ -62,7 +62,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE),
options: getDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE) as any,
},
colProps: { span: 8 },
},
@ -96,7 +96,7 @@ export const formSchema: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE),
options: getDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE) as any,
},
},
{

2
src/views/bpm/processInstance/processInstance.data.ts

@ -87,7 +87,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'category',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY),
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY) as any,
},
colProps: { span: 8 },
},

2
src/views/infra/apiAccessLog/apiAccessLog.data.ts

@ -78,7 +78,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'userType',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.USER_TYPE),
options: getDictOptions(DICT_TYPE.USER_TYPE) as any,
},
colProps: { span: 8 },
},

2
src/views/infra/apiErrorLog/apiErrorLog.data.ts

@ -80,7 +80,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'userType',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.USER_TYPE),
options: getDictOptions(DICT_TYPE.USER_TYPE) as any,
},
colProps: { span: 8 },
},

2
src/views/infra/codegen/codegen.data.ts

@ -103,7 +103,7 @@ export const formSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
},
{

4
src/views/infra/codegen/components/data.ts

@ -60,7 +60,7 @@ export const basicInfoSchemas: FormSchema[] = [
component: 'Select',
defaultValue: '30',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE),
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE) as any,
},
colProps: { span: 12 },
},
@ -70,7 +70,7 @@ export const basicInfoSchemas: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_FRONT_TYPE),
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_FRONT_TYPE) as any,
},
colProps: { span: 12 },
},

2
src/views/infra/config/ConfigModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateConfig(values)

6
src/views/infra/config/config.data.ts

@ -77,7 +77,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_CONFIG_TYPE),
options: getDictOptions(DICT_TYPE.INFRA_CONFIG_TYPE) as any,
},
colProps: { span: 8 },
},
@ -126,8 +126,8 @@ export const formSchema: FormSchema[] = [
component: 'RadioGroup',
componentProps: {
options: [
{ key: true, label: '是', value: true },
{ key: false, label: '否', value: false },
{ label: '是', value: true },
{ label: '否', value: false },
],
},
},

2
src/views/infra/dataSourceConfig/DataSourceConfigModal.vue

@ -32,7 +32,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateDataSourceConfig(values)

4
src/views/infra/fileConfig/ficleConfig.data.ts

@ -56,7 +56,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'storage',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE),
options: getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE) as any,
},
colProps: { span: 8 },
},
@ -88,7 +88,7 @@ export const formSchema: FormSchema[] = [
required: true,
dynamicDisabled: ({ values }) => !!values.id,
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE),
options: getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE) as any,
},
},
{

2
src/views/infra/job/JobModal.vue

@ -57,7 +57,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateJob(values)

2
src/views/infra/job/job.data.ts

@ -55,7 +55,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_JOB_STATUS),
options: getDictOptions(DICT_TYPE.INFRA_JOB_STATUS) as any,
},
colProps: { span: 8 },
},

2
src/views/infra/job/logger/jobLog.data.ts

@ -83,7 +83,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_JOB_STATUS),
options: getDictOptions(DICT_TYPE.INFRA_JOB_STATUS) as any,
},
colProps: { span: 8 },
},

2
src/views/member/config/index.vue

@ -75,7 +75,7 @@ async function getConfigPage() {
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
await saveConfig(values)
}
finally {

2
src/views/member/group/GroupModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateGroup(values)

4
src/views/member/group/group.data.ts

@ -49,7 +49,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
colProps: { span: 8 },
},
@ -73,7 +73,7 @@ export const formSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
},
{

2
src/views/member/level/LevelModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateLevel(values)

4
src/views/member/level/level.data.ts

@ -65,7 +65,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
colProps: { span: 8 },
},
@ -125,7 +125,7 @@ export const formSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
},
{

2
src/views/member/point/record/record.data.ts

@ -63,7 +63,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'bizType',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.MEMBER_POINT_BIZ_TYPE),
options: getDictOptions(DICT_TYPE.MEMBER_POINT_BIZ_TYPE) as any,
},
colProps: { span: 8 },
},

2
src/views/member/signin/config/config.data.ts

@ -78,7 +78,7 @@ export const formSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
},
]

2
src/views/member/tag/TagModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateMemberTag(values)

2
src/views/member/user/UserModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateUser(values)

2
src/views/member/user/user.data.ts

@ -156,7 +156,7 @@ export const formSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
},
{

2
src/views/mp/message/message.data.ts

@ -145,7 +145,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.MP_MESSAGE_TYPE, 'string'),
options: getDictOptions(DICT_TYPE.MP_MESSAGE_TYPE, 'string') as any,
},
colProps: { span: 8 },
},

2
src/views/pay/app/AppModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateApp(values)

2
src/views/pay/app/ChannelModal.vue

@ -63,7 +63,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
values.config = JSON.stringify(values.payConfig)
if (unref(isUpdate))

10
src/views/pay/app/app.data.ts

@ -132,7 +132,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
colProps: { span: 8 },
},
@ -162,7 +162,7 @@ export const formSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
options: getDictOptions(DICT_TYPE.COMMON_STATUS) as any,
},
},
{
@ -232,7 +232,7 @@ export const aliPayFormSchema: FormSchema[] = [
component: 'RadioGroup',
componentProps: {
options: [
{ value: 'RSA2', label: 'RSA2', key: 'RSA2' },
{ value: 'RSA2', label: 'RSA2' },
],
},
},
@ -244,8 +244,8 @@ export const aliPayFormSchema: FormSchema[] = [
component: 'RadioGroup',
componentProps: {
options: [
{ value: 1, label: '公钥模式', key: '1' },
{ value: 2, label: '证书模式', key: '2' },
{ value: 1, label: '公钥模式' },
{ value: 2, label: '证书模式' },
],
},
},

2
src/views/pay/demo/demo.data.ts

@ -85,7 +85,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'payed',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING),
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING) as any,
},
colProps: { span: 8 },
},

2
src/views/pay/notify/notify.data.ts

@ -90,7 +90,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.PAY_NOTIFY_TYPE, 'number'),
options: getDictOptions(DICT_TYPE.PAY_NOTIFY_TYPE, 'number') as any,
},
colProps: { span: 8 },
},

2
src/views/system/dept/DeptModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateDept(values)

2
src/views/system/dict/DictDataModal.vue

@ -39,7 +39,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateDictData(values)

2
src/views/system/dict/DictTypeModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateDictType(values)

2
src/views/system/errorCode/ErrorCodeModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateErrorCode(values)

2
src/views/system/menu/MenuModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateMenu(values)

2
src/views/system/notice/NoticeModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateNotice(values)

2
src/views/system/oauth2/client/ClientModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateOAuth2Client(values)

2
src/views/system/role/RoleModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateRole(values)

2
src/views/system/role/RoleScopeModal.vue

@ -41,7 +41,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
await assignRoleDataScope(values)
closeModal()

2
src/views/system/role/role.data.ts

@ -143,7 +143,6 @@ export const menuScopeFormSchema: FormSchema[] = [
{
label: '菜单权限',
field: 'menuIds',
component: 'Input',
slot: 'menuIds',
},
]
@ -180,7 +179,6 @@ export const dataScopeFormSchema: FormSchema[] = [
label: '数据权限',
field: 'dataScopeDeptIds',
ifShow: ({ values }) => values.dataScope === SystemDataScopeEnum.DEPT_CUSTOM,
component: 'Input',
slot: 'dataScopeDeptIds',
},
]

2
src/views/system/sensitiveWord/SensitiveWordModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateSensitiveWord(values)

2
src/views/system/sms/channel/SmsChannelModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateSmsChannel(values)

2
src/views/system/sms/template/SmsTemplateModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateSmsTemplate(values)

2
src/views/system/tenant/TenantModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateTenant(values)

2
src/views/system/tenantPackage/TenantPackageModal.vue

@ -67,7 +67,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
values.menuIds = [...menuKeys.value, ...menuHalfKeys.value]
setModalProps({ confirmLoading: true })
if (unref(isUpdate))

1
src/views/system/tenantPackage/tenantPackage.data.ts

@ -77,7 +77,6 @@ export const formSchema: FormSchema[] = [
label: '菜单权限',
field: 'menuIds',
slot: 'menuIds',
component: 'Input',
},
{
label: '状态',

2
src/views/system/user/UserModal.vue

@ -34,7 +34,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
async function handleSubmit() {
try {
const values = await validate()
const values = await validate() as any
setModalProps({ confirmLoading: true })
if (unref(isUpdate))
await updateUser(values)

2
tsconfig.json

@ -37,5 +37,5 @@
"build/**/*.d.ts",
"vite.config.ts"
],
"exclude": ["node_modules", "dist"]
"exclude": ["node_modules", "dist", "./src/components/FormDesign/*"]
}