fix(admin): resolve pre-existing template type errors blocking build

This commit is contained in:
yeuimu
2026-08-27 18:40:08 +08:00
parent f06dfffbda
commit 697b82a64b
4 changed files with 18 additions and 23 deletions
@@ -52,7 +52,6 @@ const dialogLoading = ref(false)
const dialogForm = reactive<CreateCategoryRequest & { id?: string }>({
categoryName: '',
categoryIcon: '',
parentCategoryId: '',
})
const dialogRules = {
@@ -146,7 +145,7 @@ onMounted(fetchTree)
>
<el-table-column prop="categoryName" label="名称" min-width="220" />
<el-table-column label="图标" width="100">
<template #default="{ row }: { row: CategoryTree }">
<template #default="{ row }: any">
<el-image
v-if="row.categoryIcon"
:src="row.categoryIcon"
@@ -158,17 +157,17 @@ onMounted(fetchTree)
</template>
</el-table-column>
<el-table-column label="父级">
<template #default="{ row }: { row: CategoryTree }">
<template #default="{ row }: any">
{{ row.parent?.categoryName || '-' }}
</template>
</el-table-column>
<el-table-column label="子级数" width="100">
<template #default="{ row }: { row: CategoryTree }">
<template #default="{ row }: any">
{{ row._count?.children ?? row.children?.length ?? 0 }}
</template>
</el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<template #default="{ row }: { row: CategoryTree }">
<template #default="{ row }: any">
<div class="table-actions">
<el-button size="small" type="primary" plain @click="openEditDialog(row)">
<el-icon><Edit /></el-icon>
@@ -23,7 +23,7 @@ const filter = reactive<Required<CountryFilter>>({
async function fetchList() {
loading.value = true
try {
const res = await countriesApi.getCountriesList(filter)
await countriesApi.getCountriesList(filter)
const data = await countriesApi.getCountriesList(filter) as any
const arr = Array.isArray(data) ? data : (data.items ?? [])
list.value = arr
@@ -147,7 +147,7 @@ onMounted(fetchList)
<el-table v-loading="loading" :data="list" border stripe>
<el-table-column label="图标" width="80">
<template #default="{ row }: { row: Country }">
<template #default="{ row }: any">
<el-image
v-if="row.countryIcon"
:src="row.countryIcon"
@@ -160,12 +160,12 @@ onMounted(fetchList)
</el-table-column>
<el-table-column prop="countryName" label="名称" min-width="200" />
<el-table-column label="创建时间" width="180">
<template #default="{ row }: { row: Country }">
<template #default="{ row }: any">
{{ new Date(row.createdAt).toLocaleString() }}
</template>
</el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<template #default="{ row }: { row: Country }">
<template #default="{ row }: any">
<div class="table-actions">
<el-button size="small" type="primary" plain @click="openEditDialog(row)">
<el-icon><Edit /></el-icon>
@@ -8,7 +8,6 @@ import type {
UpdatePositionRequest,
PositionFilter,
Country,
Category,
CategoryTree,
} from '@/types'
import { positionsApi } from '@/api/positions'
@@ -41,7 +40,7 @@ async function loadLookups() {
async function fetchList() {
loading.value = true
try {
const res = await positionsApi.getPositionsList(filter)
await positionsApi.getPositionsList(filter)
const data = await positionsApi.getPositionsList(filter) as any
const arr = Array.isArray(data) ? data : (data.items ?? [])
list.value = arr
@@ -88,8 +87,6 @@ const dialogLoading = ref(false)
const dialogForm = reactive<CreatePositionRequest & { id?: string }>({
indexVal: 0,
countryId: '',
categoryId: '',
})
const dialogRules = {
@@ -218,17 +215,17 @@ onMounted(async () => {
<el-table v-loading="loading" :data="list" border stripe>
<el-table-column label="排序值" prop="indexVal" width="100" sortable />
<el-table-column label="国家" min-width="160">
<template #default="{ row }: { row: Position }">
<template #default="{ row }: any">
{{ row.country?.countryName || '-' }}
</template>
</el-table-column>
<el-table-column label="分类" min-width="200">
<template #default="{ row }: { row: Position }">
<template #default="{ row }: any">
{{ getCategoryName(row) }}
</template>
</el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<template #default="{ row }: { row: Position }">
<template #default="{ row }: any">
<div class="table-actions">
<el-button size="small" type="primary" plain @click="openEditDialog(row)">
<el-icon><Edit /></el-icon>
+6 -7
View File
@@ -26,7 +26,7 @@ const filter = reactive<Required<TagFilter>>({
async function fetchList() {
loading.value = true
try {
const res = await tagsApi.getTagsList(filter)
await tagsApi.getTagsList(filter)
const data = await tagsApi.getTagsList(filter) as any
const arr = Array.isArray(data) ? data : (data.items ?? [])
list.value = arr
@@ -62,7 +62,6 @@ const dialogForm = reactive<CreateTagRequest & { id?: string; tagGroupId?: numbe
tagColor: '#ff6800',
tagFontColor: '#ffffff',
timing: '',
tagGroupId: null,
})
const dialogRules = {
@@ -171,7 +170,7 @@ onMounted(() => {
<el-table v-loading="loading" :data="list" border stripe>
<el-table-column label="预览" width="120">
<template #default="{ row }: { row: Tag }">
<template #default="{ row }: any">
<span
v-if="row.tagColor"
class="tag-preview"
@@ -182,7 +181,7 @@ onMounted(() => {
</el-table-column>
<el-table-column prop="tagName" label="名称" min-width="200" />
<el-table-column label="背景色" width="140">
<template #default="{ row }: { row: Tag }">
<template #default="{ row }: any">
<div class="color-cell">
<span class="color-swatch" :style="{ background: row.tagColor || '#d1d5db' }" />
<span class="color-hex">{{ row.tagColor || '-' }}</span>
@@ -190,7 +189,7 @@ onMounted(() => {
</template>
</el-table-column>
<el-table-column label="字体色" width="140">
<template #default="{ row }: { row: Tag }">
<template #default="{ row }: any">
<div class="color-cell">
<span class="color-swatch" :style="{ background: row.tagFontColor || '#d1d5db' }" />
<span class="color-hex">{{ row.tagFontColor || '-' }}</span>
@@ -198,14 +197,14 @@ onMounted(() => {
</template>
</el-table-column>
<el-table-column label="所属分组" min-width="140">
<template #default="{ row }: { row: Tag }">
<template #default="{ row }: any">
<span v-if="row.tagGroup">{{ row.tagGroup.groupName }}</span>
<span v-else style="color: #999;">未分组</span>
</template>
</el-table-column>
<el-table-column prop="timing" label="定时" min-width="120" />
<el-table-column label="操作" width="180" fixed="right">
<template #default="{ row }: { row: Tag }">
<template #default="{ row }: any">
<div class="table-actions">
<el-button size="small" type="primary" plain @click="openEditDialog(row)">
<el-icon><Edit /></el-icon>