diff --git a/src/api/AuthApi.ts b/src/api/AuthApi.ts index 3f996fd..3ce2134 100644 --- a/src/api/AuthApi.ts +++ b/src/api/AuthApi.ts @@ -24,7 +24,7 @@ export interface editRoleParams extends createRoleParams { export interface RoleInfo { id: number; name: string; - paths: PathItem[]; + resList: number[]; } /** diff --git a/src/configs/UrlManage.ts b/src/configs/UrlManage.ts index 7407725..089474a 100644 --- a/src/configs/UrlManage.ts +++ b/src/configs/UrlManage.ts @@ -16,7 +16,7 @@ export function getWebsocketUrl() { export function getShowSetAlarmTextButton() { let show = false; const host = window.location.hostname; - if (process.env.NODE_ENV == 'development' || host == '192.168.3.233') { + if (process.env.NODE_ENV == 'development' || host == '192.168.33.233') { show = true; } return show; diff --git a/src/graphics/turnout/TurnoutDrawAssistant.ts b/src/graphics/turnout/TurnoutDrawAssistant.ts index d0492b5..b23ba52 100644 --- a/src/graphics/turnout/TurnoutDrawAssistant.ts +++ b/src/graphics/turnout/TurnoutDrawAssistant.ts @@ -200,7 +200,9 @@ class DragMoveAbsorbablePoint extends AbsorbablePoint { pointC: [C], } = dragTarget.datas; this.moveTarget = { - position: dragTarget.getGlobalPosition(), + position: dragTarget + .getGraphicApp() + .toCanvasCoordinates(dragTarget.getGlobalPosition()), portPos: [ dragTarget.localToCanvasPoint(A), dragTarget.localToCanvasPoint(B), @@ -235,7 +237,9 @@ class DragMoveAbsorbablePoint extends AbsorbablePoint { } else { if (this.moveTarget == undefined) { this.moveTarget = { - position: dragTarget.getGlobalPosition(), + position: dragTarget + .getGraphicApp() + .toCanvasCoordinates(dragTarget.getGlobalPosition()), portPos: [ dragTarget.localToCanvasPoint(dragTarget.getStartPoint()), dragTarget.localToCanvasPoint(dragTarget.getEndPoint()), @@ -432,6 +436,9 @@ export class TurnoutPointsInteractionPlugin extends GraphicInteractionPlugin { Array.from(cpMap.entries()).forEach(([cpDatas, dataPoints], i) => { cpDatas.forEach((cpData, j) => { const dp = new DraggablePoint(cpData); - dp.on('transforming', (e: GraphicTransformEvent) => { + dp.on('transforming', () => { const localPoint = this.graphic.canvasToLocalPoint(dp.position); dataPoints[j].x = localPoint.x; dataPoints[j].y = localPoint.y; diff --git a/src/pages/AuthPathManage.vue b/src/pages/AuthPathManage.vue index 8b5361e..6c520d1 100644 --- a/src/pages/AuthPathManage.vue +++ b/src/pages/AuthPathManage.vue @@ -108,7 +108,6 @@ import { useQuasar, type QTableColumn, QForm } from 'quasar'; import { createPath, deletePath, - getPathInfo, pageQueryPath, PathItem, savePathData, @@ -239,19 +238,17 @@ const options = computed(() => { //编辑 function edieAuthData(row: PathItem) { - getPathInfo(row.id).then((res) => { - pathInfo.id = res.id + ''; - pathInfo.name = res.name; - pathInfo.path = res.path; - let list: MethodType[] = []; - if (res.method == '*') { - list = options.value.map((item) => item.value as MethodType); - } else { - list = res.method.split(',') as MethodType[]; - } - pathInfo.methodList = list; - editFormShow.value = true; - }); + pathInfo.id = row.id + ''; + pathInfo.name = row.name; + pathInfo.path = row.path; + let list: MethodType[] = []; + if (row.method == '*') { + list = options.value.map((item) => item.value as MethodType); + } else { + list = row.method.split(',') as MethodType[]; + } + pathInfo.methodList = list; + editFormShow.value = true; } const myForm = ref(null); diff --git a/src/pages/RoleManage.vue b/src/pages/RoleManage.vue index 67a3779..2651690 100644 --- a/src/pages/RoleManage.vue +++ b/src/pages/RoleManage.vue @@ -74,7 +74,7 @@ @@ -97,7 +97,6 @@ import { createRole, createRoleParams, deleteRole, - getRoleInfo, pageQueryRole, saveRoleData, } from 'src/api/AuthApi'; @@ -182,25 +181,25 @@ const editFormShow = ref(false); interface RoleItemInfo extends Omit { id: string; - editPaths: number[]; + editPaths: { id: number }[]; } const roleInfo = reactive({ id: '', editPaths: [], name: '', - paths: [], + resList: [], }); //编辑 function edieRoleData(row: RoleInfo) { - getRoleInfo(row.id).then((res) => { - roleInfo.id = res.id + ''; - roleInfo.name = res.name; - const list = res.paths || []; - roleInfo.paths = list; - roleInfo.editPaths = list.map((item) => item.id); - editFormShow.value = true; + roleInfo.id = row.id + ''; + roleInfo.name = row.name; + const list = row.resList || []; + roleInfo.resList = list; + roleInfo.editPaths = list.map((item) => { + return { id: item }; }); + editFormShow.value = true; } const myForm = ref(null); @@ -213,7 +212,7 @@ async function edieRolePath() { try { const params: createRoleParams = { name: roleInfo.name, - resList: roleInfo.editPaths, + resList: roleInfo.resList, }; if (roleInfo.id) { const cloneParams = Object.assign(params, { id: +roleInfo.id }); @@ -266,11 +265,11 @@ function onReset() { roleInfo.id = ''; roleInfo.name = ''; roleInfo.editPaths = []; - roleInfo.paths = []; + roleInfo.resList = []; myForm.value?.resetValidation(); } function pathSelectsed(val: PathItem[]) { - roleInfo.editPaths = val.map((item) => item.id); + roleInfo.resList = val.map((item) => item.id); }