添加风机属性编辑表单

This commit is contained in:
walker 2023-05-22 09:48:32 +08:00
parent 118e96eed2
commit 547f32c31c
3 changed files with 58 additions and 3 deletions

View File

@ -26,8 +26,13 @@
</q-card-section>
</template>
<template v-else-if="drawStore.selectedGraphics.length === 1">
<q-card-section v-if="drawStore.selectedGraphicType === Link.Type">
<link-property></link-property>
<q-card-section>
<link-property
v-if="drawStore.selectedGraphicType === Link.Type"
></link-property>
<iscs-fan-property
v-else-if="drawStore.selectedGraphicType === IscsFan.Type"
></iscs-fan-property>
</q-card-section>
</template>
</q-card>
@ -38,8 +43,10 @@
import LinkTemplate from './templates/LinkTemplate.vue';
import CanvasProperty from './properties/CanvasProperty.vue';
import LinkProperty from './properties/LinkProperty.vue';
import IscsFanProperty from './properties/IscsFanProperty.vue';
import { Link } from 'src/graphics/link/Link';
import { useDrawStore } from 'src/stores/draw-store';
import { IscsFan } from 'src/graphics/iscs-fan/IscsFan';
const drawStore = useDrawStore();
</script>

View File

@ -0,0 +1,42 @@
<template>
<q-form>
<q-input outlined readonly v-model="model.id" label="id" :rules="[]" />
</q-form>
</template>
<script setup lang="ts">
import { IscsFanData } from 'src/examples/app/graphics/IscsFanInteraction';
import { IscsFan } from 'src/graphics/iscs-fan/IscsFan';
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, reactive, watch } from 'vue';
const drawStore = useDrawStore();
const model = reactive(new IscsFanData());
drawStore.$subscribe;
watch(
() => drawStore.selectedGraphic,
(val) => {
if (val && val.type == IscsFan.Type) {
// console.log('Iscs');
model.copyFrom(val.saveData() as IscsFanData);
}
}
);
onMounted(() => {
// console.log('Iscs mounted');
const g = drawStore.selectedGraphic as IscsFan;
if (g) {
model.copyFrom(g.saveData());
}
});
function onUpdate() {
console.log('Iscs风机 属性更新');
const g = drawStore.selectedGraphic as IscsFan;
if (g) {
drawStore.getDrawApp().updateGraphicAndRecord(g, model);
}
}
</script>

View File

@ -1,6 +1,12 @@
<template>
<q-form>
<q-input outlined readonly v-model="linkModel.id" label="id" :rules="[]" />
<q-input
outlined
readonly
v-model="linkModel.id"
label="id"
:rules="[(val) => val || '']"
/>
<q-input
outlined
v-model.number="linkModel.lineWidth"