fireAlaram

This commit is contained in:
joylink_fanyuhong 2024-09-14 15:43:04 +08:00
parent f6a28fad10
commit 2b180e5bec
8 changed files with 37 additions and 24 deletions

View File

@ -37,10 +37,10 @@
</template>
<script setup lang="ts">
import { useDrawStore } from 'src/stores/draw-store';
import { useFireAlarmDrawStore } from 'src/stores/fire-alarm-draw-store';
import CanvasProperty from './properties/CanvasProperty.vue';
import IscsTextProperty from './properties/IscsTextProperty.vue';
import { TextContent } from 'src/graphics/textContent/TextContent';
const drawStore = useDrawStore();
const drawStore = useFireAlarmDrawStore();
</script>

View File

@ -47,9 +47,9 @@
</template>
<script setup lang="ts">
import { useDrawStore } from 'src/stores/draw-store';
import { useFireAlarmDrawStore } from 'src/stores/fire-alarm-draw-store';
import { onMounted, onUnmounted, reactive } from 'vue';
const drawStore = useDrawStore();
const drawStore = useFireAlarmDrawStore();
const canvas = reactive({
width: 1920,

View File

@ -6,7 +6,7 @@ import {
KeyListener,
newDrawApp,
} from 'jl-graphic';
import { useDrawStore } from 'src/stores/draw-store';
import { useFireAlarmDrawStore } from 'src/stores/fire-alarm-draw-store';
import { CCTVGraphicData } from 'src/protos/cctv_graphic_data';
import { fromUint8Array } from 'js-base64';
import {
@ -42,10 +42,7 @@ export function initDrawApp(): IDrawApp {
});
const app = drawApp;
initCommonDrawApp(app);
new CCTVButtonDraw(
app,
new CCTVButtonTemplate(new CCTVButtonData())
);
new CCTVButtonDraw(app, new CCTVButtonTemplate(new CCTVButtonData()));
app.addKeyboardListener(
new KeyListener({
@ -61,7 +58,7 @@ export function initDrawApp(): IDrawApp {
}
export async function loadDrawDatas(): Promise<IGraphicStorage> {
const drawStore = useDrawStore();
const drawStore = useFireAlarmDrawStore();
const id = drawStore.draftId;
if (!id) {
throw new Error('获取数据异常为获取到草稿地图ID');

View File

@ -4,7 +4,7 @@ import {
IDrawApp,
MenuItemOptions,
} from 'jl-graphic';
import { useDrawStore } from 'src/stores/draw-store';
import { useFireAlarmDrawStore } from 'src/stores/fire-alarm-draw-store';
import { toStorageTransform } from './graphics/GraphicDataBase';
import { Arrow, ArrowTemplate } from 'src/graphics/arrow/Arrow';
import { ArrowData } from './graphics/ArrowInteraction';
@ -104,7 +104,7 @@ export function saveCommonDrawDatas(app: IDrawApp, storage: ICommonStorage) {
}
export function saveDrawToServer(base64: string) {
const drawStore = useDrawStore();
const drawStore = useFireAlarmDrawStore();
const id = drawStore.draftId;
if (!id) {
return;

View File

@ -6,14 +6,17 @@ import {
KeyListener,
newDrawApp,
} from 'jl-graphic';
import { useDrawStore } from 'src/stores/draw-store';
import { iscsGraphicData } from 'src/protos/iscs_graphic_data';
import { useFireAlarmDrawStore } from 'src/stores/fire-alarm-draw-store';
import { FireAlarmGraphicData } from 'src/protos/fire_alarm_graphic_data';
import { fromUint8Array } from 'js-base64';
import {
initCommonDrawApp,
saveCommonDrawDatas,
saveDrawToServer,
} from './commonApp';
// import { CCTVButtonData } from './graphics/CCTV/CCTVButtonInteraction';
// import { CCTVButtonDraw } from 'src/graphics/CCTV/cctvButton/CCTVButtonDrawAssistant';
// import { CCTVButtonTemplate } from 'src/graphics/CCTV/cctvButton/CCTVButton';
let drawApp: IDrawApp | null = null;
@ -39,6 +42,7 @@ export function initDrawApp(): IDrawApp {
});
const app = drawApp;
initCommonDrawApp(app);
// new CCTVButtonDraw(app, new CCTVButtonTemplate(new CCTVButtonData()));
app.addKeyboardListener(
new KeyListener({
@ -54,7 +58,7 @@ export function initDrawApp(): IDrawApp {
}
export async function loadDrawDatas(): Promise<IGraphicStorage> {
const drawStore = useDrawStore();
const drawStore = useFireAlarmDrawStore();
const id = drawStore.draftId;
if (!id) {
throw new Error('获取数据异常为获取到草稿地图ID');
@ -71,11 +75,11 @@ export async function loadDrawDatas(): Promise<IGraphicStorage> {
}
export function saveDrawDatas(app: IDrawApp) {
let storage = new iscsGraphicData.IscsGraphicStorage();
let storage = new FireAlarmGraphicData.FireAlarmGraphicStorage();
storage = saveCommonDrawDatas(
app,
storage
) as iscsGraphicData.IscsGraphicStorage;
) as FireAlarmGraphicData.FireAlarmGraphicStorage;
const graphics = app.queryStore.getAllGraphics();
/* graphics.forEach((g) => {
if (TrackSection.Type === g.type) {

View File

@ -67,7 +67,7 @@
<q-drawer show-if-above bordered v-model="rightDrawerOpen" side="right">
<q-resize-observer @resize="onRightResize" />
<draw-properties></draw-properties>
<fire-alarm-draw-properties></fire-alarm-draw-properties>
</q-drawer>
<q-page-container>
@ -105,12 +105,12 @@
</template>
<script setup lang="ts">
import DrawProperties from 'src/components/draw-app/DrawProperties.vue';
import FireAlarmDrawProperties from 'src/components/draw-app/FireAlarmDrawProperties.vue';
import { onMounted, reactive, ref, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { successNotify } from 'src/utils/CommonNotify';
import { useQuasar } from 'quasar';
import { useDrawStore } from 'src/stores/draw-store';
import { useFireAlarmDrawStore } from 'src/stores/fire-alarm-draw-store';
import { Arrow } from 'src/graphics/arrow/Arrow';
import { TextContent } from 'src/graphics/textContent/TextContent';
@ -119,7 +119,7 @@ const route = useRoute();
const router = useRouter();
const searchId = ref(0);
const drawStore = useDrawStore();
const drawStore = useFireAlarmDrawStore();
watch(
() => drawStore.drawMode,

View File

@ -34,6 +34,14 @@ const routes: RouteRecordRaw[] = [
},
component: () => import('layouts/CCTVDrawLayout.vue'),
},
{
path: '/fireAlarmPaint',
name: 'fireAlarmPaint',
meta: {
label: '火灾报警绘制',
},
component: () => import('layouts/FireAlarmDrawLayout.vue'),
},
];
export default routes;

View File

@ -1,6 +1,10 @@
import { defineStore } from 'pinia';
import { QTable } from 'quasar';
import { initDrawApp, destroyDrawApp, getDrawApp } from 'src/drawApp/drawApp';
import {
initDrawApp,
destroyDrawApp,
getDrawApp,
} from 'src/drawApp/fireAlarmApp';
import {
DrawAssistant,
GraphicData,
@ -10,7 +14,7 @@ import {
} from 'jl-graphic';
import { markRaw } from 'vue';
export const useDrawStore = defineStore('draw', {
export const useFireAlarmDrawStore = defineStore('FireAlarmDraw', {
state: () => ({
drawAssistant: null as DrawAssistant | null,
selectedGraphics: null as JlGraphic[] | null,