+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.value }}
+
+
+
+
+
+
+
+
@@ -157,7 +244,7 @@
import DrawProperties from 'src/components/draw-app/IscsDrawProperties.vue';
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
-import { useQuasar } from 'quasar';
+import { date, useQuasar } from 'quasar';
import { useDrawStore } from 'src/stores/draw-store';
import { CCTVButton } from 'src/graphics/CCTV/cctvButton/CCTVButton';
import { Arrow } from 'src/graphics/arrow/Arrow';
@@ -248,6 +335,7 @@ onMounted(() => {
console.log('绘制应用layout mounted');
const dom = document.getElementById('draw-app-container');
initMunuOption();
+ intervalId = setInterval(updateTime, 1000);
if (dom) {
drawStore.setDraftId(+route.params.id as number);
const drawApp = drawStore.initDrawApp();
@@ -255,7 +343,6 @@ onMounted(() => {
drawApp.reload();
const _record = drawApp.opRecord.record;
drawApp.opRecord.record = function (op) {
- console.log(op, '---', drawApp);
handleRecordData(op);
_record.call(drawApp.opRecord, op);
};
@@ -356,18 +443,21 @@ async function saveAs(name: string) {
}
}
-function forceReloadDate() {
- const drawApp = drawStore.getDrawApp();
- const graphics = drawApp.queryStore.getAllGraphics();
- graphics.forEach((graphic) => (graphic.visible = false));
- drawApp.updateSelected();
- drawApp.forceReload();
-}
+//日期
+let intervalId = null;
+const currentData = ref(date.formatDate(new Date(), 'YYYY-MM-DD'));
+const currentTime = ref(date.formatDate(new Date(), 'HH:mm:ss'));
+
+const updateTime = () => {
+ currentData.value = date.formatDate(new Date(), 'YYYY-MM-DD');
+ currentTime.value = date.formatDate(new Date(), 'HH:mm:ss');
+};
//目录车站切换
const selectMenuName = ref('');
let menuOption = [];
function selectedMenu(menuName: string) {
+ selectMenuName.value = menuName;
for (let i = 0; i < iscsTypeConfig.length; i++) {
if (iscsTypeConfig[i].menuName == menuName) {
subMenuOption.value = iscsTypeConfig[i].sunMenu.map((sunMenu) => {
@@ -387,18 +477,29 @@ function selectedSubMenu(subName: string) {
forceReloadDate();
}
-let iscsTypeConfig: { menuName: string; sunMenu: { sunMenuName: string }[] }[] =
- [];
+let iscsTypeConfig: {
+ menuName: string;
+ icon: string;
+ activeIcon: string;
+ sunMenu: { sunMenuName: string }[];
+}[] = [];
function initMunuOption() {
iscsTypeConfig = getIscsStyleConfig(route.query.iscsStyle as IscsStyle);
menuOption = iscsTypeConfig.map((menu) => {
- return { label: menu.menuName, value: menu.menuName };
+ return {
+ label: menu.menuName,
+ value: menu.menuName,
+ icon: menu.icon,
+ activeIcon: menu.activeIcon,
+ };
});
selectMenuName.value = menuOption[0].value;
subMenuOption.value = iscsTypeConfig[0].sunMenu.map((sunMenu) => {
return { label: sunMenu.sunMenuName, value: sunMenu.sunMenuName };
});
selectSubMenuName.value = subMenuOption.value[0].value;
+ drawStore.selectSubmenuAndStation.submenu = selectSubMenuName.value;
+ drawStore.selectSubmenuAndStation.station = stationOption[0].value;
}
const selectStationName = ref('会展中心');
@@ -406,14 +507,26 @@ const stationOption = [
{ label: '会展中心', value: '会展中心' },
{ label: '火车站', value: '火车站' },
{ label: '丈八一路', value: '丈八一路' },
+ { label: '会展中心', value: '会展中心' },
+ { label: '火车站', value: '火车站' },
+ { label: '丈八一路', value: '丈八一路' },
+ { label: '会展中心', value: '会展中心' },
+ { label: '火车站', value: '火车站' },
+ { label: '丈八一路', value: '丈八一路' },
+ { label: '会展中心', value: '会展中心' },
+ { label: '火车站', value: '火车站' },
+ { label: '丈八一路', value: '丈八一路' },
+ { label: '会展中心', value: '会展中心' },
+ { label: '火车站', value: '火车站' },
+ { label: '丈八一路', value: '丈八一路' },
];
function selectedStation(name: string) {
+ selectStationName.value = name;
drawStore.selectSubmenuAndStation.station = name;
forceReloadDate();
}
function handleRecordData(op) {
- console.log('handleRecordData', op, op.type);
const drawApp = drawStore.getDrawApp();
const syncData = {
operationType: op.type,
@@ -435,10 +548,260 @@ function handleRecordData(op) {
'/rtss_simulation/draft/iscs/7',
new sync_data_message.SyncData({ ...syncData }).serialize()
);
- console.log(syncData, 'syncData');
+}
+function forceReloadDate() {
+ const drawApp = drawStore.getDrawApp();
+ const graphics = drawApp.queryStore.getAllGraphics();
+ graphics.forEach((graphic) => (graphic.visible = false));
+ drawApp.updateSelected();
+ drawApp.forceReload();
+}
+
+const clickOCC = ref(false);
+function clickOCCFn() {
+ clickOCC.value = !clickOCC.value;
+}
+
+const clickStationListRightName = ref('');
+const stationListRightOption = [
+ '车辆段',
+ '火车南主所',
+ '皂角树主所',
+ '红星停车场',
+ '香山主所',
+];
+
+function clickStationListRighrOrOcc(buttonLabel: string) {
+ clickStationListRightName.value = buttonLabel;
}
onUnmounted(() => {
drawStore.destroy();
+ clearInterval(intervalId);
});
+
diff --git a/src/protos/sync_data_message.ts b/src/protos/sync_data_message.ts
index 91fd625..ec6694c 100644
--- a/src/protos/sync_data_message.ts
+++ b/src/protos/sync_data_message.ts
@@ -12,6 +12,7 @@ export namespace sync_data_message {
datas?: UpdataData[];
submenu?: string;
station?: string;
+ userId?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
@@ -28,6 +29,9 @@ export namespace sync_data_message {
if ("station" in data && data.station != undefined) {
this.station = data.station;
}
+ if ("userId" in data && data.userId != undefined) {
+ this.userId = data.userId;
+ }
}
}
get operationType() {
@@ -54,11 +58,18 @@ export namespace sync_data_message {
set station(value: string) {
pb_1.Message.setField(this, 4, value);
}
+ get userId() {
+ return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
+ }
+ set userId(value: number) {
+ pb_1.Message.setField(this, 5, value);
+ }
static fromObject(data: {
operationType?: string;
datas?: ReturnType
[];
submenu?: string;
station?: string;
+ userId?: number;
}): SyncData {
const message = new SyncData({});
if (data.operationType != null) {
@@ -73,6 +84,9 @@ export namespace sync_data_message {
if (data.station != null) {
message.station = data.station;
}
+ if (data.userId != null) {
+ message.userId = data.userId;
+ }
return message;
}
toObject() {
@@ -81,6 +95,7 @@ export namespace sync_data_message {
datas?: ReturnType[];
submenu?: string;
station?: string;
+ userId?: number;
} = {};
if (this.operationType != null) {
data.operationType = this.operationType;
@@ -94,6 +109,9 @@ export namespace sync_data_message {
if (this.station != null) {
data.station = this.station;
}
+ if (this.userId != null) {
+ data.userId = this.userId;
+ }
return data;
}
serialize(): Uint8Array;
@@ -108,6 +126,8 @@ export namespace sync_data_message {
writer.writeString(3, this.submenu);
if (this.station.length)
writer.writeString(4, this.station);
+ if (this.userId != 0)
+ writer.writeUint32(5, this.userId);
if (!w)
return writer.getResultBuffer();
}
@@ -129,6 +149,9 @@ export namespace sync_data_message {
case 4:
message.station = reader.readString();
break;
+ case 5:
+ message.userId = reader.readUint32();
+ break;
default: reader.skipField();
}
}
diff --git a/src/stores/draw-store.ts b/src/stores/draw-store.ts
index a976659..adf467e 100644
--- a/src/stores/draw-store.ts
+++ b/src/stores/draw-store.ts
@@ -20,7 +20,7 @@ export const useDrawStore = defineStore('draw', {
selectedGraphics: null as JlGraphic[] | null,
draftId: null as number | null,
drawPictureType: null as PictureType | null,
- selectSubmenuAndStation: { submenu: '站台报警', station: '会展中心' },
+ selectSubmenuAndStation: { submenu: '', station: '' },
}),
getters: {
drawMode: (state) => state.drawAssistant != null,
@@ -100,11 +100,7 @@ export const useDrawStore = defineStore('draw', {
// console.log('绘制状态清空,绘制应用销毁');
this.drawAssistant = null;
this.selectedGraphics = null;
- (this.selectSubmenuAndStation = {
- submenu: '站台报警',
- station: '会展中心',
- }),
- destroyIscsDrawApp();
+ destroyIscsDrawApp();
},
setDraftId(id: number | null) {
this.draftId = id;