fix(frontend): 修复 vue-tsc 类型检查报错(21 处)
- defineModel 对象默认值改为工厂函数,消除 art-form / art-search-bar 连锁泛型推断错误 - art-table 改用 element-plus 导出的 TableInstance 替代 InstanceType<typeof ElTable> - STATUS_TAG 收紧为 el-tag 合法字面量联合类型 - SidebarSubmenu 外部链接菜单 index 不再传 undefined
This commit is contained in:
@@ -235,7 +235,7 @@
|
||||
|
||||
const emit = defineEmits<FormEmits>()
|
||||
|
||||
const modelValue = defineModel<Record<string, any>>({ default: {} })
|
||||
const modelValue = defineModel<Record<string, any>>({ default: () => ({}) })
|
||||
const initialModelValue = ref<Record<string, any>>({})
|
||||
|
||||
// 保存组件初始化时的表单快照,用于 reset 时恢复默认值。
|
||||
|
||||
+1
-1
@@ -251,7 +251,7 @@
|
||||
|
||||
const emit = defineEmits<SearchBarEmits>()
|
||||
|
||||
const modelValue = defineModel<Record<string, any>>({ default: {} })
|
||||
const modelValue = defineModel<Record<string, any>>({ default: () => ({}) })
|
||||
const initialModelValue = ref<Record<string, any>>({})
|
||||
|
||||
// 保存组件初始化时的表单快照,用于 reset 时恢复默认筛选条件。
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
<ElMenuItem
|
||||
v-else
|
||||
:index="isExternalLink(item) ? undefined : item.path || item.meta.title"
|
||||
:index="isExternalLink(item) ? `__external-${index}` : item.path || item.meta.title || ''"
|
||||
:level-item="level + 1"
|
||||
@click="goPage(item)"
|
||||
>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, nextTick, watchEffect, getCurrentInstance, useAttrs } from 'vue'
|
||||
import type { ElTable, TableProps } from 'element-plus'
|
||||
import type { TableInstance, TableProps } from 'element-plus'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ColumnOption } from '@/types'
|
||||
import { useTableStore } from '@/store/modules/table'
|
||||
@@ -84,7 +84,7 @@
|
||||
defineOptions({ name: 'ArtTable' })
|
||||
|
||||
const { width } = useWindowSize()
|
||||
const elTableRef = ref<InstanceType<typeof ElTable> | null>(null)
|
||||
const elTableRef = ref<TableInstance | null>(null)
|
||||
const paginationRef = ref<HTMLElement>()
|
||||
const tableHeaderRef = ref<HTMLElement>()
|
||||
const tableStore = useTableStore()
|
||||
|
||||
@@ -45,7 +45,7 @@ const grantedRows = computed(() => {
|
||||
}))
|
||||
})
|
||||
|
||||
const STATUS_TAG: Record<string, string> = {
|
||||
const STATUS_TAG: Record<string, 'success' | 'primary' | 'warning' | 'danger' | 'info'> = {
|
||||
published: 'success', testing: 'primary', disabled: 'warning', revoked: 'danger'
|
||||
}
|
||||
const STATUS_LABEL: Record<string, string> = {
|
||||
|
||||
@@ -53,7 +53,7 @@ const recentPlugins = computed(() =>
|
||||
.slice(0, 6)
|
||||
)
|
||||
|
||||
const STATUS_TAG: Record<string, string> = {
|
||||
const STATUS_TAG: Record<string, 'success' | 'primary' | 'warning' | 'danger' | 'info'> = {
|
||||
published: 'success', testing: 'primary', disabled: 'warning', revoked: 'danger'
|
||||
}
|
||||
const STATUS_LABEL: Record<string, string> = {
|
||||
|
||||
Reference in New Issue
Block a user