feat: 优化 GiTable(同步 GiDemo 更新)

This commit is contained in:
2025-03-18 21:34:58 +08:00
parent 348c497876
commit eaabe47546
23 changed files with 199 additions and 125 deletions

View File

@@ -123,7 +123,6 @@ import { Message } from '@arco-design/web-vue'
import { useWindowSize } from '@vueuse/core'
import { type FieldConfigResp, type GeneratorConfigResp, getGenConfig, listFieldConfig, listFieldConfigDict, saveGenConfig } from '@/apis/code/generator'
import type { LabelValueState } from '@/types/global'
import type { TableInstanceColumns } from '@/components/GiTable/type'
import { type ColumnItem, GiForm } from '@/components/GiForm'
import { useResetReactive } from '@/hooks'
import { useDict } from '@/hooks/app'
@@ -222,7 +221,7 @@ const getDataList = async (tableName: string, requireSync: boolean) => {
}
// Table 字段配置
const columns: TableInstanceColumns[] = [
const columns: TableInstance['columns'] = [
{ title: '名称', slotName: 'fieldName' },
{ title: '类型', slotName: 'fieldType' },
{ title: '描述', slotName: 'comment', width: 170 },

View File

@@ -61,10 +61,10 @@
</template>
<script setup lang="ts">
import type { TableInstance } from '@arco-design/web-vue'
import { Message } from '@arco-design/web-vue'
import GenConfigDrawer from './GenConfigDrawer.vue'
import { downloadCode, generateCode, listGenConfig } from '@/apis/code/generator'
import type { TableInstanceColumns } from '@/components/GiTable/type'
import { useTable } from '@/hooks'
import { isMobile } from '@/utils'
@@ -84,7 +84,7 @@ const {
selectAll,
search,
} = useTable((page) => listGenConfig({ ...queryForm, ...page }), { immediate: true, formatResult: (data) => data.map((i) => ({ ...i, disabled: !i.createTime })) })
const columns: TableInstanceColumns[] = [
const columns: TableInstance['columns'] = [
{
title: '序号',
width: 66,