Compare commits
2 Commits
bd73f65860
...
2517ab5e8d
Author | SHA1 | Date | |
---|---|---|---|
|
2517ab5e8d | ||
|
f4ed04eed3 |
@ -1 +1 @@
|
||||
Subproject commit 78f0ddfd2413bdac81d33ea2b199edaa4de9e6fb
|
||||
Subproject commit ee7cf291112f13273080ee430588e9a9b9a72d04
|
@ -17,10 +17,19 @@
|
||||
<q-input
|
||||
outlined
|
||||
class="q-mt-sm"
|
||||
mask="#"
|
||||
v-model.number="carWashingModel.duanNum"
|
||||
@blur="onUpdate"
|
||||
label="段数"
|
||||
/>
|
||||
<q-input
|
||||
outlined
|
||||
class="q-mt-sm"
|
||||
mask="#"
|
||||
v-model.number="carWashingModel.width"
|
||||
@blur="onUpdate"
|
||||
label="宽度"
|
||||
/>
|
||||
<q-select
|
||||
outlined
|
||||
style="margin-top: 10px"
|
||||
|
@ -99,7 +99,6 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
function getNameFormat() {
|
||||
console.log(code.value, '1111111');
|
||||
return code.value;
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,12 @@ export class CarWashingData extends GraphicDataBase implements ICarWashingData {
|
||||
set duanNum(v: number) {
|
||||
this.data.duanNum = v;
|
||||
}
|
||||
get width(): number {
|
||||
return this.data.width;
|
||||
}
|
||||
set width(v: number) {
|
||||
this.data.width = v;
|
||||
}
|
||||
clone(): CarWashingData {
|
||||
return new CarWashingData(this.data.cloneMessage());
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ export interface ICarWashingData extends GraphicData {
|
||||
set centralizedStations(v: number[]);
|
||||
get duanNum(): number;
|
||||
set duanNum(v: number);
|
||||
get width(): number;
|
||||
set width(v: number);
|
||||
clone(): ICarWashingData;
|
||||
copyFrom(data: ICarWashingData): void;
|
||||
eq(other: ICarWashingData): boolean;
|
||||
@ -51,19 +53,23 @@ const carWashingConsts = {
|
||||
codeColor: 0xffffff,
|
||||
bodyRectLineColor: 0xffffff,
|
||||
bodyRectLineWidth: 2,
|
||||
bodyRectWidth: 10,
|
||||
bodyRectHeight: 20,
|
||||
bodyColor: 0x000000,
|
||||
bodyRectWidth: 60,
|
||||
bodyRectHeight: 40,
|
||||
bodyColor: 0xffffff,
|
||||
};
|
||||
export class CarWashing extends JlGraphic {
|
||||
static Type = 'carWashing';
|
||||
codeGraph: VectorText = new VectorText('');
|
||||
rectBody: Graphics = new Graphics();
|
||||
stopText: VectorText = new VectorText('');
|
||||
stateText: VectorText = new VectorText('');
|
||||
|
||||
constructor() {
|
||||
super(CarWashing.Type);
|
||||
this.addChild(this.codeGraph);
|
||||
this.addChild(this.rectBody);
|
||||
this.addChild(this.stopText);
|
||||
this.addChild(this.stateText);
|
||||
this.codeGraph.name = 'carw_code';
|
||||
}
|
||||
get code(): string {
|
||||
@ -93,18 +99,49 @@ export class CarWashing extends JlGraphic {
|
||||
codeGraph.position.set(0, -30);
|
||||
}
|
||||
this.rectBody.clear();
|
||||
this.rectBody.beginFill(carWashingConsts.bodyColor, 0);
|
||||
this.rectBody.lineStyle(
|
||||
carWashingConsts.bodyRectLineWidth,
|
||||
carWashingConsts.bodyRectLineColor
|
||||
);
|
||||
this.rectBody.beginFill(carWashingConsts.bodyColor, 1);
|
||||
const width = this.datas.width || carWashingConsts.bodyRectWidth;
|
||||
this.rectBody.drawRect(
|
||||
-carWashingConsts.bodyRectWidth / 2,
|
||||
-width / 2,
|
||||
-carWashingConsts.bodyRectHeight / 2,
|
||||
carWashingConsts.bodyRectWidth,
|
||||
width,
|
||||
carWashingConsts.bodyRectHeight
|
||||
);
|
||||
this.rectBody.endFill();
|
||||
if (this.states.jtj) {
|
||||
this.stopText.text = '紧';
|
||||
this.stopText.style.fill = carWashingConsts.codeColor;
|
||||
this.stopText.setVectorFontSize(carWashingConsts.codeFontSize);
|
||||
this.stopText.anchor.set(0.5);
|
||||
this.stopText.position.set(width / 2 + 20, -15);
|
||||
}
|
||||
let stateText = '';
|
||||
if (this.states.xcjxj) {
|
||||
stateText = '就绪';
|
||||
} else if (this.states.xcyxj) {
|
||||
stateText = '洗车';
|
||||
} else if (this.states.tgyxj) {
|
||||
stateText = '通过';
|
||||
} else if (this.states.cfjList.length === 2) {
|
||||
if (this.states.cfjList[0]) {
|
||||
stateText = '头部';
|
||||
} else if (this.states.cfjList[1]) {
|
||||
stateText = '尾部';
|
||||
}
|
||||
} else if (this.states.cfjList.length === 3) {
|
||||
if (this.states.cfjList[1]) {
|
||||
stateText = '尾部';
|
||||
} else if (this.states.cfjList[2]) {
|
||||
stateText = '中部';
|
||||
} else if (this.states.cfjList[0]) {
|
||||
stateText = '头部';
|
||||
}
|
||||
}
|
||||
this.stateText.text = stateText;
|
||||
this.stateText.style.fill = carWashingConsts.codeColor;
|
||||
this.stateText.setVectorFontSize(carWashingConsts.codeFontSize);
|
||||
this.stateText.anchor.set(0.5);
|
||||
this.stateText.position.set(width / 2 + 15, 15);
|
||||
}
|
||||
buildRelation() {
|
||||
const sections = this.queryStore
|
||||
|
@ -9,6 +9,7 @@ import {
|
||||
JlGraphic,
|
||||
} from 'jl-graphic';
|
||||
import { CarWashing, CarWashingTemplate, ICarWashingData } from './CarWashing';
|
||||
import { Section } from '../section/Section';
|
||||
|
||||
export interface ICarWashingDataDrawOptions {
|
||||
newData: () => ICarWashingData;
|
||||
@ -61,24 +62,15 @@ function buildAbsorbablePositions(
|
||||
carWashing: CarWashing
|
||||
): AbsorbablePosition[] {
|
||||
const aps: AbsorbablePosition[] = [];
|
||||
const carWashings = carWashing.queryStore.queryByType<CarWashing>(
|
||||
CarWashing.Type
|
||||
);
|
||||
const canvas = carWashing.getCanvas();
|
||||
carWashings.forEach((item) => {
|
||||
if (item.id === carWashing.id) {
|
||||
return;
|
||||
}
|
||||
const sections = carWashing.queryStore.queryByType<Section>(Section.Type);
|
||||
sections.forEach((item) => {
|
||||
const p1 = item.localToCanvasPoint(item.getStartPoint());
|
||||
const p2 = item.localToCanvasPoint(item.getEndPoint());
|
||||
const ala = new AbsorbableLine(
|
||||
new Point(item.x, 0),
|
||||
new Point(item.x, canvas.height)
|
||||
);
|
||||
const alb = new AbsorbableLine(
|
||||
new Point(0, item.y),
|
||||
new Point(canvas.width, item.y)
|
||||
new Point(p1.x, p1.y),
|
||||
new Point(p2.x, p2.y)
|
||||
);
|
||||
aps.push(ala);
|
||||
aps.push(alb);
|
||||
});
|
||||
return aps;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user