diff --git a/src/api/CategoryInfoApi.ts b/src/api/CategoryInfoApi.ts new file mode 100644 index 0000000..9c2dbca --- /dev/null +++ b/src/api/CategoryInfoApi.ts @@ -0,0 +1,79 @@ +import { api } from 'src/boot/axios'; +import { PageDto, PageQueryDto } from './ApiCommon'; + +const UriBase = '/api/v1/category'; + +export interface createParams { + name: string; + id?: number; + config?: string; +} + +export interface CategoryItem extends createParams { + id: number; + created_at: string; + update_at: string; +} + +export class PagingQueryParams extends PageQueryDto { + name?: string; +} + +/** + * 分页查询 + * @param params + * @returns + */ +export async function pageQuery( + params: PagingQueryParams +): Promise> { + const response = await api.get(`${UriBase}/paging`, { + params: params, + }); + return response.data; +} + +/** + * 创建厂家 + * @param params + * @returns + */ +export function createCategory(data: createParams) { + return api.post(`${UriBase}`, data); +} + +/** + * 删除厂家 + * @param id 厂家id + */ +export function deleteCategory(id: number) { + return api.delete(`${UriBase}/${id}`); +} + +/** + * 修改厂家数据 + * @param id 草稿id + */ +export function saveCategoryData(id: number, data: createParams) { + return api.put(`${UriBase}/${id}`, data); +} + +/** + * 获取厂家数据详情 + * @param params + * @returns + */ +export async function getCategoryInfo(id: number): Promise { + const response = await api.get(`${UriBase}/${id}`); + return response.data; +} + +/** + * 获取厂家信息列表 + * @param params + * @returns + */ +export async function getCategoryList(): Promise> { + const response = await api.get(`${UriBase}/list`); + return response.data; +} diff --git a/src/api/DraftApi.ts b/src/api/DraftApi.ts index 0f83bfe..16fb9e3 100644 --- a/src/api/DraftApi.ts +++ b/src/api/DraftApi.ts @@ -3,14 +3,15 @@ import { PageDto, PageQueryDto } from './ApiCommon'; const DraftUriBase = '/api/v1/drafting'; -interface Item { +export interface DraftItem { id: number; name: string; proto: string; type: string; - createdAt: string; - updateAt: string; + created_at: string; + update_at: string; creatorId?: number; + category?: number; } export class PagingQueryParams extends PageQueryDto { @@ -24,7 +25,7 @@ export class PagingQueryParams extends PageQueryDto { */ export async function pageQuery( params: PagingQueryParams -): Promise> { +): Promise> { const response = await api.get(`${DraftUriBase}/paging`, { params: params, }); @@ -36,7 +37,7 @@ export async function pageQuery( * @param params * @returns */ -export function createDraft(draftData: { name: string; type: string }) { +export function createDraft(draftData: { name: string; category: number }) { return api.post(`${DraftUriBase}`, draftData); } @@ -53,7 +54,7 @@ export function deleteDraft(id: number) { * @param params * @returns */ -export async function getDraft(id: number): Promise { +export async function getDraft(id: number): Promise { const response = await api.get(`${DraftUriBase}/${id}`); return response.data; } @@ -80,7 +81,7 @@ export function saveDraft( export async function saveAsDraft( id: number, data: { name: string; proto: string } -): Promise { +): Promise { const response = await api.post(`${DraftUriBase}/${id}/saveAs`, data); return response.data; } diff --git a/src/api/PublishApi.ts b/src/api/PublishApi.ts index 679af58..cc4dd24 100644 --- a/src/api/PublishApi.ts +++ b/src/api/PublishApi.ts @@ -3,13 +3,13 @@ import { PageDto, PageQueryDto } from './ApiCommon'; const PublishUriBase = '/api/v1/publishedGi'; -interface Item { +export interface PublishItem { id: number; name: string; proto: string; - createdAt: string; - updateAt: string; - creatorId?: number; + note: string; + publishAt: string; + userID: number; } export class PagingQueryParams extends PageQueryDto { @@ -18,11 +18,12 @@ export class PagingQueryParams extends PageQueryDto { /** * 草稿图发布 - * @param id 草稿id + * @param draftId 草稿id + * @param note 备注 */ export function publishDraft(data: { name: string; - lineId?: number; + note: string; draftId: number; }) { return api.post(`${PublishUriBase}/publish`, data); @@ -33,7 +34,7 @@ export function publishDraft(data: { * @param params * @returns */ -export async function getDraft(): Promise { +export async function getDraft(): Promise { const response = await api.get(`${PublishUriBase}/list`); return response.data; } @@ -45,7 +46,7 @@ export async function getDraft(): Promise { */ export async function pageQuery( params: PagingQueryParams -): Promise> { +): Promise> { const response = await api.get(`${PublishUriBase}/paging`, { params: params, }); @@ -54,7 +55,7 @@ export async function pageQuery( /** * 删除发布图 - * @param id 草稿id + * @param id 发布id */ export function deletePublish(id: number) { return api.delete(`${PublishUriBase}/${id}`); @@ -63,14 +64,14 @@ export function deletePublish(id: number) { * 获取发布地图详细信息 * @param id 发布地图id */ -export async function getPublishMapInfoById(id: number): Promise { +export async function getPublishMapInfoById(id: number): Promise { const response = await api.get(`${PublishUriBase}/${id}`); return response.data; } /** * 获取已发布的线路地图数据 */ -export async function getPublishLineNet(): Promise { +export async function getPublishLineNet(): Promise { const response = await api.get(`${PublishUriBase}/publish/lineNetwork/info`); return response.data; } @@ -79,7 +80,22 @@ export async function getPublishLineNet(): Promise { * 获取发布地图详细信息 * @param id 发布地图线路ID */ -export async function getPublishMapInfoByLineId(lineId: string): Promise { +export async function getPublishMapInfoByLineId( + lineId: string +): Promise { const response = await api.get(`${PublishUriBase}/${lineId}`); return response.data; } + +/** + * 另存到草稿 + * @param id 发布id + */ +export function saveToDraft( + id: number, + data: { + name: string; + } +) { + return api.post(`${PublishUriBase}/saveAsDrafting/${id}`, data); +} diff --git a/src/components/SysMenu.vue b/src/components/SysMenu.vue index 1f32531..b903b13 100644 --- a/src/components/SysMenu.vue +++ b/src/components/SysMenu.vue @@ -69,11 +69,11 @@ const list = reactive([ label: '发布管理', icon: 'app_registration', }, - // { - // path: '/dataManage/lineInfo', - // label: '线路信息管理', - // icon: 'app_registration', - // }, + { + path: '/dataManage/categoryInfo', + label: '厂家信息管理', + icon: 'app_registration', + }, ], }, ]); diff --git a/src/components/draw-app/DrawProperties.vue b/src/components/draw-app/DrawProperties.vue index eda9a2e..570548a 100644 --- a/src/components/draw-app/DrawProperties.vue +++ b/src/components/draw-app/DrawProperties.vue @@ -99,6 +99,9 @@ + @@ -148,6 +151,8 @@ import EsbButtonProperty from './properties/EsbButtonProperty.vue'; import { EsbButton } from 'src/graphics/esbButton/EsbButton'; import KiloMarkerProperty from './properties/KiloMarkerProperty.vue'; import { SlopeKiloMarker } from 'src/graphics/slopeKiloMarker/SlopeKiloMarker'; +import { Slope } from 'src/graphics/slope/Slope'; +import SlopeProperty from './properties/SlopeProperty.vue'; const drawStore = useDrawStore(); diff --git a/src/components/draw-app/dialogs/LayerControlDialog.vue b/src/components/draw-app/dialogs/LayerControlDialog.vue index a8b7425..53bdf16 100644 --- a/src/components/draw-app/dialogs/LayerControlDialog.vue +++ b/src/components/draw-app/dialogs/LayerControlDialog.vue @@ -1,6 +1,6 @@ diff --git a/src/components/draw-app/properties/StopPositionProperty.vue b/src/components/draw-app/properties/StopPositionProperty.vue index da72175..6317a02 100644 --- a/src/components/draw-app/properties/StopPositionProperty.vue +++ b/src/components/draw-app/properties/StopPositionProperty.vue @@ -42,25 +42,42 @@ @blur="onUpdate" label="公里标(mm):" /> + diff --git a/src/layouts/LineLayout.vue b/src/layouts/LineLayout.vue index 595d7f5..63ab4fa 100644 --- a/src/layouts/LineLayout.vue +++ b/src/layouts/LineLayout.vue @@ -21,7 +21,13 @@
- + @@ -35,6 +41,7 @@ import StateProperties from 'src/components/line-app/StateProperties.vue'; // import { Train } from 'src/graphics/train/Train'; // import { Turnout } from 'src/graphics/turnout/Turnout'; import LayerControlDialog from 'src/components/draw-app/dialogs/LayerControlDialog.vue'; +import { layerList } from 'src/drawApp/lineApp'; const canvasWidth = ref(0); const canvasHeight = ref(0); @@ -103,4 +110,20 @@ watch( } } ); + +function setShowLayer(val: string[]) { + lineStore.setShowLayer(val); + const lineApp = lineStore.getLineApp(); + const alllGraphic = lineApp.queryStore.getAllGraphics(); + alllGraphic.forEach((g) => { + if (val.includes(g.type)) { + g.visible = true; + } else { + g.visible = false; + } + }); +} +function onDialogClose() { + lineStore.setShowLayerDialog(false); +} diff --git a/src/pages/CategoryManage.vue b/src/pages/CategoryManage.vue new file mode 100644 index 0000000..7c969c3 --- /dev/null +++ b/src/pages/CategoryManage.vue @@ -0,0 +1,271 @@ + + + diff --git a/src/pages/DraftManage.vue b/src/pages/DraftManage.vue index 6bdba87..79e5439 100644 --- a/src/pages/DraftManage.vue +++ b/src/pages/DraftManage.vue @@ -58,30 +58,32 @@ transition-hide="scale" > - - + +
新建草稿图
-
- - - - -
+ + + + + +
@@ -93,11 +95,8 @@ > -
草稿发布
-
- - - + +
草稿发布
- -
+ :rules="[(val) => val.length > 0 || '请输入备注!']" + /> - - - - -
+ + + + + +
@@ -136,10 +132,20 @@ diff --git a/src/pages/PublishManage.vue b/src/pages/PublishManage.vue index 4b462b9..a331839 100644 --- a/src/pages/PublishManage.vue +++ b/src/pages/PublishManage.vue @@ -32,6 +32,11 @@ label="创建仿真" @click="create(props.row)" /> + + + + + +
另存到草稿
+ + + + + + + +
+
+
+
diff --git a/src/router/routes.ts b/src/router/routes.ts index c19f1d2..c803ffd 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -35,9 +35,9 @@ const routes: RouteRecordRaw[] = [ component: () => import('pages/PublishManage.vue'), }, { - path: 'lineInfo', - name: 'lineInfo', - component: () => import('pages/LineInfoManage.vue'), + path: 'categoryInfo', + name: 'categoryInfo', + component: () => import('pages/CategoryManage.vue'), }, ], }, diff --git a/src/stores/line-store.ts b/src/stores/line-store.ts index 99559de..68079ec 100644 --- a/src/stores/line-store.ts +++ b/src/stores/line-store.ts @@ -10,8 +10,8 @@ export const useLineStore = defineStore('line', { simulationId: null as string | null, socketStates: null as GraphicState[] | null, stateProCount: 0, - showLayer: [] as string[], // 显示的图层 - showLayerDialog: false, // 显示图层控制弹窗 + showLayer: [] as string[], // 显示的图层(草稿和发布图公用) + showLayerDialog: false, // 显示图层控制弹窗(草稿和发布图公用) }), getters: { selectedGraphicType: (state) => {