diff --git a/src/api/table/index.ts b/src/api/table/index.ts index 6628b80..c870f25 100644 --- a/src/api/table/index.ts +++ b/src/api/table/index.ts @@ -1,45 +1,8 @@ import request from '@/axios' import type { TableData } from './types' -interface Result { - list: TableData[] - total: number -} - -// 生成模拟数据的辅助函数 -const generateMockData = (count: number): TableData[] => { - const stages = ['开发阶段', '测试阶段', '生产阶段', '验证阶段', '量产阶段'] - const carTypes = ['SUV', '轿车', 'MPV', '跑车', '新能源'] - const creators = ['张三', '李四', '王五', '赵六', '钱七'] - - return Array.from({ length: count }, (_, index) => ({ - ProjectId: `PRJ${String(index + 1).padStart(3, '0')}`, - ProjectStage: stages[Math.floor(Math.random() * stages.length)], - CarType: carTypes[Math.floor(Math.random() * carTypes.length)], - Creator: creators[Math.floor(Math.random() * creators.length)], - CreateTime: new Date(Date.now() - Math.floor(Math.random() * 90) * 24 * 60 * 60 * 1000) - .toISOString() - .split('T')[0], - id: index + 1 - })) -} - -export const getTableListApi = (params: any): Promise> => { - const mockData = generateMockData(100) - const { pageIndex = 1, pageSize = 10 } = params - const start = (pageIndex - 1) * pageSize - const end = start + pageSize - - return Promise.resolve({ - code: 0, - data: { - list: mockData.slice(start, end), - total: mockData.length - } - }) - - // 如果要切换到真实API,只需取消注释下面的代码 - // return request.get({ url: '/mock/example/list', params }) +export const getTableListApi = (params: any) => { + return request.get({ url: '/mock/example/list', params }) } export const getCardTableListApi = (params: any) => { diff --git a/src/api/table/types.ts b/src/api/table/types.ts index 7c18179..876c111 100644 --- a/src/api/table/types.ts +++ b/src/api/table/types.ts @@ -1,8 +1,9 @@ -export interface TableData { - ProjectId: string - ProjectStage: string - CarType: string - Creator: string - CreateTime: string - id?: number +export type TableData = { + id: string + author: string + title: string + content: string + importance: number + display_time: string + pageviews: number } diff --git a/src/views/Level/Menu2.vue b/src/views/Level/Menu2.vue index 4312668..72e2abb 100644 --- a/src/views/Level/Menu2.vue +++ b/src/views/Level/Menu2.vue @@ -1,125 +1,20 @@ - - - diff --git a/src/views/Level/modules/TableColumn.ts b/src/views/Level/modules/TableColumn.ts deleted file mode 100644 index f65e991..0000000 --- a/src/views/Level/modules/TableColumn.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ElTag } from 'element-plus' - -const columns = [ - { - field: 'ProjectId', - label: '項目ID' - }, - { - field: 'ProjectStage', - label: '項目階段' - }, - { - field: 'CarType', - label: '車輛類型' - }, - { - field: 'Creator', - label: '創建人' - }, - { - field: 'CreateTime', - label: '創建時間' - } -] - -export default columns diff --git a/src/views/ProjectMenu/ProjectMenu.vue b/src/views/ProjectMenu/ProjectMenu.vue deleted file mode 100644 index 1d9124a..0000000 --- a/src/views/ProjectMenu/ProjectMenu.vue +++ /dev/null @@ -1,105 +0,0 @@ - - -