Compare commits

...

6 Commits

Author SHA1 Message Date
joylink_fanyuhong
181a3dae51 合并代码
All checks were successful
local-test分支构建发布 / Docker-Build (push) Successful in 2m20s
2024-09-06 15:06:06 +08:00
joylink_zhaoerwei
acaf3d1f11 权限调整+绘制吸附同步 2024-09-06 14:39:48 +08:00
joylink_zhaoerwei
6296877798 权限代码备用 2024-09-06 11:08:37 +08:00
joylink_zhaoerwei
be4df53219 同步北京部分计轴 2024-07-15 16:10:30 +08:00
joylink_zhaoerwei
20d39f9f4a 同步区段复制控制-A键直接复制到端点 2024-07-15 15:41:09 +08:00
joylink_zhaoerwei
d345a1dc87 前端框架版本升级+同步北京区段道岔移动时端点吸附 2024-07-15 15:17:30 +08:00
5 changed files with 36 additions and 33 deletions

View File

@ -24,7 +24,7 @@ export interface editRoleParams extends createRoleParams {
export interface RoleInfo {
id: number;
name: string;
paths: PathItem[];
resList: number[];
}
/**

View File

@ -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;

View File

@ -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<Tur
tep = new TurnoutEditPlugin(turnout, { onEditPointCreate });
turnout.addAssistantAppend(tep);
}
tep.editPoints = [[], [], []];
tep.removeChildren();
tep.initEditPoints();
// tep.reset();
tep.showAll();
tep.setRelatedDrag();
@ -571,7 +578,7 @@ export class TurnoutEditPlugin extends GraphicEditPlugin<Turnout> {
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;

View File

@ -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<QForm | null>(null);

View File

@ -74,7 +74,7 @@
</div>
<AuthPathManage
:sizeHeight="600"
:selects="roleInfo.paths || []"
:selects="roleInfo.editPaths || []"
@selectsed="pathSelectsed"
/>
<q-card-actions align="right">
@ -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<RoleInfo, 'id'> {
id: string;
editPaths: number[];
editPaths: { id: number }[];
}
const roleInfo = reactive<RoleItemInfo>({
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<QForm | null>(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);
}
</script>