10 changed files with 238 additions and 68 deletions
-
2.env
-
8src/router/index.ts
-
12src/services/matrix/craft.ts
-
27src/services/matrix/manage.ts
-
20src/services/matrix/type.ts
-
15src/views/matrixCraft/index.vue
-
114src/views/matrixManage/matrixList.vue
-
6src/views/matrixManage/type.ts
-
2vite.config.ts
@ -1,3 +1,3 @@ |
|||||
VITE_API_HOST=192.168.1.199 |
|
||||
|
VITE_API_HOST=192.168.1.130 |
||||
VITE_API_PORT=8090 |
VITE_API_PORT=8090 |
||||
VITE_WS_PATH=/ws |
VITE_WS_PATH=/ws |
@ -0,0 +1,12 @@ |
|||||
|
import httpRequest, { type BaseResponse } from "../httpRequest"; |
||||
|
type ResponseParams = { |
||||
|
pageNum: number; |
||||
|
pageSize: number; |
||||
|
} |
||||
|
export function getList(params:ResponseParams){ |
||||
|
return httpRequest<BaseResponse<string>>({ |
||||
|
url: "/api/matrixCraft/list", |
||||
|
params: { ...params }, |
||||
|
method: "GET", |
||||
|
}); |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
import httpRequest, { type BaseResponse } from "../httpRequest"; |
||||
|
import type { MatrixItem } from './type'; |
||||
|
|
||||
|
|
||||
|
export function getList(params: { pageNum: number; pageSize: number }){ |
||||
|
return httpRequest<BaseResponse<{ list: MatrixItem[]; total: number }>>({ |
||||
|
url: "/api/matrix/list", |
||||
|
params: { ...params }, |
||||
|
method: "GET", |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function add(params:{name: string}){ |
||||
|
return httpRequest<BaseResponse>({ |
||||
|
url: "/api/matrix/add", |
||||
|
params: { ...params }, |
||||
|
method: "POST", |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function updateMatrix(params:{name: string, id: number}){ |
||||
|
return httpRequest<BaseResponse>({ |
||||
|
url: "/api/matrix", |
||||
|
params: { ...params }, |
||||
|
method: "PUT", |
||||
|
}); |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
export type ResponseParams = { |
||||
|
pageNum: number; |
||||
|
pageSize: number; |
||||
|
} |
||||
|
|
||||
|
export const defaultParams = { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10 |
||||
|
} |
||||
|
|
||||
|
export type MatrixItem = { |
||||
|
id: number; |
||||
|
name: string; |
||||
|
isSelected?: boolean; |
||||
|
}; |
||||
|
|
||||
|
export type MatrixItemList = { |
||||
|
list:MatrixItem, |
||||
|
total:number |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
export type MatrixItem = { |
||||
|
id: number; |
||||
|
name: string; |
||||
|
isSelected?: boolean; |
||||
|
}; |
||||
|
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue