diff --git a/src/api/TrainModelApi.ts b/src/api/TrainModelApi.ts new file mode 100644 index 0000000..2a0ec44 --- /dev/null +++ b/src/api/TrainModelApi.ts @@ -0,0 +1,189 @@ +import { api } from 'src/boot/axios'; +import { PageDto, PageQueryDto } from './ApiCommon'; + +const UriBase = '/api/v1/trainManage'; + +export class PagingQueryParams extends PageQueryDto { + name?: string; +} + +export interface ModelCreateParams { + name: string; +} + +export interface TrainModelItem extends ModelCreateParams { + id: number; + created_at: string; + update_at: string; +} + +/** + * 列车型号分页查询 + * @param params + * @returns + */ +export async function modelPageQuery( + params: PagingQueryParams +): Promise> { + const response = await api.get(`${UriBase}/model/paging`, { + params: params, + }); + return response.data; +} + +/** + * 创建列车型号 + * @param params + * @returns + */ +export function createTrainModel(data: ModelCreateParams) { + return api.post(`${UriBase}/model`, data); +} + +/** + * 删除列车型号 + * @param id 列车型号id + */ +export function deleteTrainModel(id: number) { + return api.delete(`${UriBase}/model/${id}`); +} + +/** + * 修改列车型号数据 + * @param id 列车型号id + */ +export function saveTrainModelData(id: number, data: ModelCreateParams) { + return api.put(`${UriBase}/model/${id}`, data); +} + +/** + * 获取列车型号数据详情 + * @param params + * @returns + */ +export async function getTrainModelInfo(id: number): Promise { + const response = await api.get(`${UriBase}/model/${id}`); + return response.data; +} + +export interface SizeCreateParams { + name: string; + carriage_length: number; + description: string; + total_length: number; +} + +export interface TrainSizeItem extends SizeCreateParams { + id: number; +} + +/** + * 列车尺寸分页查询 + * @param params + * @returns + */ +export async function sizePageQuery( + params: PagingQueryParams +): Promise> { + const response = await api.get(`${UriBase}/size/paging`, { + params: params, + }); + return response.data; +} + +/** + * 创建列车尺寸 + * @param params + * @returns + */ +export function createTrainSize(data: SizeCreateParams) { + return api.post(`${UriBase}/size`, data); +} + +/** + * 删除列车尺寸 + * @param id 列车尺寸id + */ +export function deleteTrainSize(id: number) { + return api.delete(`${UriBase}/size/${id}`); +} + +/** + * 修改列车尺寸数据 + * @param id 列车尺寸id + */ +export function saveTrainSizeData(id: number, data: SizeCreateParams) { + return api.put(`${UriBase}/size/${id}`, data); +} + +/** + * 获取列车尺寸数据详情 + * @param params + * @returns + */ +export async function getTrainSizeInfo(id: number): Promise { + const response = await api.get(`${UriBase}/size/${id}`); + return response.data; +} + +export interface WheelCreateParams { + name: string; + axial_position: number; + diameter: number; + install_direction: string; + max_diameter: number; + min_diameter: number; +} + +export interface TrainWheelItem extends WheelCreateParams { + id: number; +} + +/** + * 列车轮径分页查询 + * @param params + * @returns + */ +export async function wheelPageQuery( + params: PagingQueryParams +): Promise> { + const response = await api.get(`${UriBase}/wheelDiameter/paging`, { + params: params, + }); + return response.data; +} + +/** + * 创建列车轮径 + * @param params + * @returns + */ +export function createTrainWheel(data: WheelCreateParams) { + return api.post(`${UriBase}/wheelDiameter`, data); +} + +/** + * 删除列车轮径 + * @param id 列车轮径id + */ +export function deleteTrainWheel(id: number) { + return api.delete(`${UriBase}/wheelDiameter/${id}`); +} + +/** + * 修改列车轮径数据 + * @param id 列车轮径id + */ +export function saveTrainWheelData(id: number, data: WheelCreateParams) { + return api.put(`${UriBase}/wheelDiameter/${id}`, data); +} + +/** + * 获取列车轮径数据详情 + * @param params + * @returns + */ +export async function getTrainWheelInfo(id: number): Promise { + const response = await api.get(`${UriBase}/wheelDiameter/${id}`); + return response.data; +} diff --git a/src/components/SysMenu.vue b/src/components/SysMenu.vue index b903b13..1754200 100644 --- a/src/components/SysMenu.vue +++ b/src/components/SysMenu.vue @@ -67,12 +67,17 @@ const list = reactive([ { path: '/dataManage/publish', label: '发布管理', - icon: 'app_registration', + icon: 'playlist_add_check', }, { path: '/dataManage/categoryInfo', label: '厂家信息管理', - icon: 'app_registration', + icon: 'category', + }, + { + path: '/dataManage/trainModel', + label: '列车管理', + icon: 'train', }, ], }, diff --git a/src/pages/TrainModelManage.vue b/src/pages/TrainModelManage.vue new file mode 100644 index 0000000..5bcce8b --- /dev/null +++ b/src/pages/TrainModelManage.vue @@ -0,0 +1,935 @@ + + + diff --git a/src/router/routes.ts b/src/router/routes.ts index a2a3269..8d808d2 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -44,6 +44,11 @@ const routes: RouteRecordRaw[] = [ name: 'categoryInfo', component: () => import('pages/CategoryManage.vue'), }, + { + path: 'trainModel', + name: 'trainModel', + component: () => import('pages/TrainModelManage.vue'), + }, ], }, {