Merge branch 'master' of https://git.code.tencent.com/beijing-rtss-test/bj-rtss-client
This commit is contained in:
commit
622200a090
@ -206,6 +206,12 @@ export class TrainState extends GraphicStateBase implements ITrainState {
|
||||
set runDirection(v: boolean) {
|
||||
this.states.runDirection = v;
|
||||
}
|
||||
get headDirection(): boolean {
|
||||
return this.states.headDirection;
|
||||
}
|
||||
set headDirection(v: boolean) {
|
||||
this.states.headDirection = v;
|
||||
}
|
||||
clone(): TrainState {
|
||||
return new TrainState(this.states.cloneMessage());
|
||||
}
|
||||
|
@ -80,6 +80,8 @@ export interface ITrainState extends GraphicState {
|
||||
set pointTo(v: boolean);
|
||||
get runDirection(): boolean;
|
||||
set runDirection(v: boolean);
|
||||
get headDirection(): boolean;
|
||||
set headDirection(v: boolean);
|
||||
}
|
||||
|
||||
interface bodyWH {
|
||||
@ -136,8 +138,8 @@ export const trainConsts = {
|
||||
};
|
||||
|
||||
export class TrainHead extends Container {
|
||||
arrow: Graphics; // 箭头
|
||||
pause: Graphics; // 停止
|
||||
arrow: Graphics; // 运行方向
|
||||
pause: Graphics; // 车头
|
||||
train: Train;
|
||||
constructor(train: Train) {
|
||||
super();
|
||||
@ -152,15 +154,8 @@ export class TrainHead extends Container {
|
||||
this.pause.clear();
|
||||
}
|
||||
doRepaint() {
|
||||
let direction = 'left'; // 箭头在左边(方向向右)
|
||||
const states = this.train.states;
|
||||
if (states.runDirection) {
|
||||
direction = 'right';
|
||||
}
|
||||
this.clear();
|
||||
if (!direction) {
|
||||
return;
|
||||
}
|
||||
const bodyWH = this.train.trainbody.getBodyWH();
|
||||
const marginX = trainConsts.marginX;
|
||||
const pauseW = trainConsts.pauseW;
|
||||
@ -180,7 +175,7 @@ export class TrainHead extends Container {
|
||||
-marginX - pauseW / 2 - codeWidth / 2,
|
||||
codeHeight / 2,
|
||||
];
|
||||
if (direction != 'left') {
|
||||
if (states.runDirection) {
|
||||
const aP: Array<number> = [];
|
||||
arrowPoint.forEach((item, index) => {
|
||||
if (index % 2 == 1) {
|
||||
@ -190,6 +185,8 @@ export class TrainHead extends Container {
|
||||
}
|
||||
});
|
||||
arrowPoint = aP;
|
||||
}
|
||||
if (states.headDirection) {
|
||||
const pP: Array<number> = [];
|
||||
pausePoint.forEach((item, index) => {
|
||||
if (index % 2 == 1) {
|
||||
|
@ -3,6 +3,12 @@
|
||||
<q-header reveal class="bg-primary text-white">
|
||||
<q-toolbar>
|
||||
<q-toolbar-title> {{ mapName }} </q-toolbar-title>
|
||||
<q-btn
|
||||
color="info"
|
||||
label="销毁仿真"
|
||||
class="q-mr-md"
|
||||
@click="destroySimAndBack"
|
||||
/>
|
||||
<q-btn color="info" label="返回" @click="backConfirm" />
|
||||
</q-toolbar>
|
||||
<q-resize-observer @resize="onHeaderResize" />
|
||||
@ -90,11 +96,8 @@ onUnmounted(() => {
|
||||
if (dialogInstance.value && lineStore.showLayerDialog) {
|
||||
dialogInstance.value.hide();
|
||||
}
|
||||
if (simulationId) {
|
||||
lineStore.setSimulationId(null);
|
||||
lineStore.destroy();
|
||||
destroySimulation({ simulationId });
|
||||
}
|
||||
});
|
||||
watch(
|
||||
[() => lineStore.stateProCount, () => lineStore.selectedGraphics],
|
||||
@ -129,4 +132,10 @@ watch(
|
||||
});
|
||||
}
|
||||
);
|
||||
function destroySimAndBack() {
|
||||
if (simulationId) {
|
||||
destroySimulation({ simulationId });
|
||||
}
|
||||
backConfirm();
|
||||
}
|
||||
</script>
|
||||
|
@ -3,9 +3,14 @@ import { RouteRecordRaw } from 'vue-router';
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: () => import('layouts/MainLayout.vue'),
|
||||
children: [{ path: '', component: () => import('pages/IndexPage.vue') }],
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'home',
|
||||
component: () => import('pages/IndexPage.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user