Squashed commit of the following:
All checks were successful
local-test-CICD / Docker-Build (push) Successful in 2m29s

commit 888bbc83d6
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Thu Sep 26 13:08:07 2024 +0800

    用户管理+绘制管理的userName

commit 320c1e92cc
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Wed Sep 25 14:54:46 2024 +0800

    新的ISCS数据结构实现加载赞提

commit dede7f400f
Author: joylink_fanyuhong <18706759286@163.com>
Date:   Wed Sep 25 10:37:26 2024 +0800

    绘图工具调整

commit 4adcfacc12
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Tue Sep 24 16:42:11 2024 +0800

    增加更多筛选项

commit 5888422322
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Tue Sep 24 14:22:31 2024 +0800

    Squashed commit of the following:

    commit 27fb1ee4ea
    Author: joylink_fanyuhong <18706759286@163.com>
    Date:   Tue Sep 24 14:05:41 2024 +0800

        报错调整

    commit 069615d05d
    Author: joylink_fanyuhong <18706759286@163.com>
    Date:   Tue Sep 24 14:04:30 2024 +0800

        代码调整

    commit 66c4ac33b3
    Merge: 107d8a5 b267859
    Author: shengxuqiang <shengxuqiang@joylink.club>
    Date:   Tue Sep 24 12:09:11 2024 +0800

        Merge pull request '修改打包目录配置' (#3) from develop into local-test

        Reviewed-on: joylink/rtss-simulation-app-client#3

    commit 107d8a50f1
    Merge: 75797eb b01ee7c
    Author: shengxuqiang <shengxuqiang@joylink.club>
    Date:   Tue Sep 24 11:59:24 2024 +0800

        Merge pull request '添加local-test环境打包配置' (#2) from develop into local-test

        Reviewed-on: joylink/rtss-simulation-app-client#2

    commit 75797ebc40
    Merge: ff65d38 1a4ae38
    Author: shengxuqiang <shengxuqiang@joylink.club>
    Date:   Tue Sep 24 11:52:28 2024 +0800

        Merge pull request '添加local-test分支CICD配置' (#1) from develop into local-test

        Reviewed-on: joylink/rtss-simulation-app-client#1

commit 4f7ba40f3e
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Tue Sep 24 13:21:29 2024 +0800

    目录调整
This commit is contained in:
joylink_zhaoerwei 2024-09-26 13:15:16 +08:00
parent 27fb1ee4ea
commit 6eb65ce531
14 changed files with 999 additions and 194 deletions

View File

@ -21,6 +21,14 @@ export const iscsStyleOption = [
}, },
]; ];
export const searchTscsStyleOption = [
{
label: '全部',
value: IscsStyle.UNKNOWN,
},
...iscsStyleOption,
];
export interface DraftItem { export interface DraftItem {
id: number; id: number;
name: string; name: string;
@ -33,8 +41,11 @@ export interface DraftItem {
createdAt: string; createdAt: string;
updatedAt: string; updatedAt: string;
defaultReleaseDataName: string; defaultReleaseDataName: string;
userName: string;
}
export interface IscsDataOptions {
style: IscsStyle;
} }
export interface PagingQueryParams { export interface PagingQueryParams {
paging: { paging: {
page: number; page: number;
@ -42,9 +53,10 @@ export interface PagingQueryParams {
}; };
query: { query: {
dataType: DraftDataType; dataType: DraftDataType;
userId?: number; options?: IscsDataOptions;
name?: string; name?: string;
isShared?: boolean; isShared?: boolean;
userId?: number;
}; };
} }
export interface DraftIscsDataDto { export interface DraftIscsDataDto {
@ -52,9 +64,6 @@ export interface DraftIscsDataDto {
options: IscsDataOptions; options: IscsDataOptions;
} }
export interface IscsDataOptions {
style: IscsStyle;
}
export async function draftPageQuery( export async function draftPageQuery(
params: PagingQueryParams params: PagingQueryParams
): Promise<PageDto<DraftIscsDataDto>> { ): Promise<PageDto<DraftIscsDataDto>> {
@ -63,7 +72,7 @@ export async function draftPageQuery(
userDraftIscsDataPaging(paging: $paging, query: $query) { userDraftIscsDataPaging(paging: $paging, query: $query) {
total total
items { items {
draftData {id name dataType userId defaultReleaseDataId createdAt updatedAt isShared defaultReleaseDataName} draftData {id name dataType userName defaultReleaseDataId createdAt updatedAt isShared defaultReleaseDataName}
options {style} options {style}
} }
} }
@ -84,7 +93,7 @@ export async function sharedDraftPageQuery(
sharedDraftIscsDataPaging(paging: $paging, query: $query) { sharedDraftIscsDataPaging(paging: $paging, query: $query) {
total total
items { items {
draftData {id name dataType userId defaultReleaseDataId createdAt updatedAt isShared defaultReleaseDataName} draftData {id name dataType userName defaultReleaseDataId createdAt updatedAt isShared defaultReleaseDataName}
options {style} options {style}
} }
} }
@ -208,10 +217,7 @@ export function saveDraft(variables: { id: number; data: string }) {
* @param variables * @param variables
* @returns * @returns
*/ */
export async function saveAsDraft(variables: { export async function saveAsDraft(variables: { id: number; name: string }) {
id: number;
name: string;
}) {
const mutation = ` const mutation = `
mutation saveAsNewDraftData($id: Int,$name: String) { mutation saveAsNewDraftData($id: Int,$name: String) {
saveAsNewDraftData(id: $id,name: $name){ saveAsNewDraftData(id: $id,name: $name){

View File

@ -14,6 +14,7 @@ export interface PublishItem {
createdAt: string; createdAt: string;
updatedAt: string; updatedAt: string;
description: string; description: string;
userName: string;
} }
interface PagingQueryParams { interface PagingQueryParams {
@ -26,6 +27,7 @@ interface PagingQueryParams {
userId?: number; userId?: number;
name?: string; name?: string;
isPublished?: boolean; isPublished?: boolean;
options?: IscsDataOptions;
}; };
} }
export interface PublishIscsDataDto { export interface PublishIscsDataDto {
@ -110,7 +112,7 @@ export async function publishPageQuery(
releaseIscsDataPaging(page: $page, query: $query) { releaseIscsDataPaging(page: $page, query: $query) {
total total
items { items {
releaseData {id name dataType usedVersionId userId isPublished createdAt updatedAt description } releaseData {id name dataType usedVersionId userName isPublished createdAt updatedAt description }
options {style} options {style}
} }
} }
@ -162,7 +164,7 @@ export async function getPublishHistoryById(variables: {
releaseDataVersionPaging(dataId: $dataId, page: $page) { releaseDataVersionPaging(dataId: $dataId, page: $page) {
total total
items { items {
id releaseDataId description userId createdAt id releaseDataId description userName createdAt
} }
} }
} }

83
src/api/UserApi.ts Normal file
View File

@ -0,0 +1,83 @@
import { api } from 'src/boot/axios';
import { PageDto } from './ApiCommon';
export interface User {
id: string;
name: string;
mobile: string;
email: string;
roles: [];
createdAt: string;
updatedAt: string;
}
export interface PagingQueryParams {
page: {
page: number;
itemsPerPage: number;
};
query: {
id?: string;
name?: string;
mobile?: string;
email?: string;
roles?: [];
};
}
/**
*
* @param params
* @returns
*/
export async function userPageQuery(
params: PagingQueryParams
): Promise<PageDto<User>> {
const query = `
query userPaging($page: PageQueryDto, $query: UserQueryDto) {
userPaging(page: $page, query: $query) {
total
items {
id name mobile email roles createdAt updatedAt
}
}
}
`;
const response = await api.post('', {
query,
variables: params,
});
return response.data.data.userPaging;
}
/**
*
*/
export async function getLoginUserInfo() {
const query = `
query loginUserInfo {
loginUserInfo{
id
}
}
`;
const response = await api.post('', {
query,
});
return response.data.data;
}
/**
*
*/
export async function syncUsersInfo() {
const mutation = `
mutation syncUser {
syncUser
}
`;
const response = await api.post('', {
query: mutation,
});
return response.data.data;
}

View File

@ -84,7 +84,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { QBar, useDialogPluginComponent } from 'quasar'; import { QBar, useDialogPluginComponent } from 'quasar';
import { ref, onMounted, onUnmounted, reactive } from 'vue'; import { ref, onMounted, onUnmounted, reactive, watch } from 'vue';
import ResizableDivWidth from './ResizableDivWidth.vue'; import ResizableDivWidth from './ResizableDivWidth.vue';
import ResizableDivHeight from './ResizableDivHeight.vue'; import ResizableDivHeight from './ResizableDivHeight.vue';
@ -121,6 +121,14 @@ const props = withDefaults(
} }
); );
watch(
() => props.height,
() => {
dialogHeight.value = props.height;
lastDialogHeight = props.height;
}
);
const { dialogRef, onDialogHide /* , onDialogCancel, onDialogOK */ } = const { dialogRef, onDialogHide /* , onDialogCancel, onDialogOK */ } =
useDialogPluginComponent(); useDialogPluginComponent();

View File

@ -57,26 +57,68 @@ export function initIscsDrawApp(): IDrawApp {
}, },
}) })
); );
app.on('destroy', async () => {
resetData();
});
return drawApp; return drawApp;
} }
let hasLoadData = false;
let base64 = '';
export async function loadDrawDatas(): Promise<IGraphicStorage> { export async function loadDrawDatas(): Promise<IGraphicStorage> {
const drawStore = useDrawStore(); const drawStore = useDrawStore();
const id = drawStore.draftId; const id = drawStore.draftId;
if (!id) { if (!id) {
throw new Error('获取数据异常为获取到草稿地图ID'); throw new Error('获取数据异常为获取到草稿地图ID');
} }
const { data: base64 } = await getDraft(id);
if (!hasLoadData) {
base64 = (await getDraft(id)).data;
hasLoadData = true;
}
if (base64) { if (base64) {
const storage = iscsGraphicData.IscsGraphicStorage.deserialize( storage = iscsGraphicData.IscsGraphicStorage.deserialize(
toUint8Array(base64) toUint8Array(base64)
); );
const datas = loadCommonDrawDatas(storage);
storage.cctvButtons.forEach((cctvButton) => { let datas = [];
datas.push(new CCTVButtonData(cctvButton)); let canvasProperty;
});
switch (drawStore.selectSubmenuAndStation.submenu) {
case '站台报警':
for (let i = 0; i < storage.fasPlatformAlarmStorages.length; i++) {
const fasPlatformAlarm = storage.fasPlatformAlarmStorages[i];
if (
fasPlatformAlarm.stationName ==
drawStore.selectSubmenuAndStation.station
) {
canvasProperty = fasPlatformAlarm.canvas;
datas = loadCommonDrawDatas(fasPlatformAlarm);
break;
}
}
break;
case '车站控制':
for (let i = 0; i < storage.cctvOfStationControlStorages.length; i++) {
const ctvOfStationControl = storage.cctvOfStationControlStorages[i];
if (
ctvOfStationControl.stationName ==
drawStore.selectSubmenuAndStation.station
) {
canvasProperty = ctvOfStationControl.canvas;
datas = loadCommonDrawDatas(ctvOfStationControl);
ctvOfStationControl.cctvButtons.forEach((cctvButton) => {
datas.push(new CCTVButtonData(cctvButton));
});
break;
}
}
default:
break;
}
return { return {
canvasProperty: storage.canvas, canvasProperty,
datas: datas, datas: datas,
}; };
} else { } else {
@ -86,12 +128,69 @@ export async function loadDrawDatas(): Promise<IGraphicStorage> {
} }
} }
const stationOption = ['会展中心', '火车站', '丈八一路'];
let storage: iscsGraphicData.IscsGraphicStorage;
export function saveDrawDatas(app: IDrawApp) { export function saveDrawDatas(app: IDrawApp) {
let storage = new iscsGraphicData.IscsGraphicStorage(); const drawStore = useDrawStore();
storage = saveCommonDrawDatas( if (!storage) {
app, storage = new iscsGraphicData.IscsGraphicStorage();
storage }
) as iscsGraphicData.IscsGraphicStorage; if (!storage?.fasPlatformAlarmStorages.length) {
stationOption.forEach((station) =>
storage?.fasPlatformAlarmStorages.push(
new iscsGraphicData.FASPlatformAlarmStorage({
stationName: station,
})
)
);
}
if (!storage?.cctvOfStationControlStorages.length) {
stationOption.forEach((station) =>
storage?.cctvOfStationControlStorages.push(
new iscsGraphicData.CCTVOfStationControlStorage({
stationName: station,
})
)
);
}
switch (drawStore.selectSubmenuAndStation.submenu) {
case '站台报警':
for (let i = 0; i < storage.fasPlatformAlarmStorages.length; i++) {
const asPlatformAlarm = storage.fasPlatformAlarmStorages[i];
if (
asPlatformAlarm.stationName ==
drawStore.selectSubmenuAndStation.station
) {
const fasStorage = saveCommonDrawDatas(
app,
asPlatformAlarm
) as iscsGraphicData.FASPlatformAlarmStorage;
storage.fasPlatformAlarmStorages[i] = fasStorage;
break;
}
}
break;
case '车站控制':
for (let i = 0; i < storage.cctvOfStationControlStorages.length; i++) {
const cctvOfStationControl = storage.cctvOfStationControlStorages[i];
if (
cctvOfStationControl.stationName ==
drawStore.selectSubmenuAndStation.station
) {
const cctvStorage = saveCommonDrawDatas(
app,
cctvOfStationControl
) as iscsGraphicData.CCTVOfStationControlStorage;
storage.cctvOfStationControlStorages[i] = cctvStorage;
break;
}
}
break;
default:
break;
}
const graphics = app.queryStore.getAllGraphics(); const graphics = app.queryStore.getAllGraphics();
/* graphics.forEach((g) => { /* graphics.forEach((g) => {
if (TrackSection.Type === g.type) { if (TrackSection.Type === g.type) {
@ -102,3 +201,9 @@ export function saveDrawDatas(app: IDrawApp) {
const base64 = fromUint8Array(storage.serialize()); const base64 = fromUint8Array(storage.serialize());
return base64; return base64;
} }
function resetData() {
storage = new iscsGraphicData.IscsGraphicStorage();
hasLoadData = false;
base64 = '';
}

View File

@ -35,6 +35,12 @@
</q-list> </q-list>
</q-btn-dropdown> </q-btn-dropdown>
</template> </template>
<q-btn-toggle
v-model="selectStationName"
toggle-color="orange"
:options="stationOption"
@update:model-value="selectedStation"
/>
</q-toolbar-title> </q-toolbar-title>
<q-btn square color="purple" style="margin-right: 10px" icon="search"> <q-btn square color="purple" style="margin-right: 10px" icon="search">
<q-popup-edit <q-popup-edit
@ -103,12 +109,12 @@
<draggable-dialog <draggable-dialog
seamless seamless
title="绘制工具" title="绘制工具"
:width="230" :width="130"
:height="50" :height="drawDialogHeight"
v-model="showDrawTool" v-model="showDrawTool"
canNotClose canNotClose
> >
<q-btn-toggle <!-- <q-btn-toggle
v-model="selectUtil" v-model="selectUtil"
color="brown" color="brown"
text-color="white" text-color="white"
@ -116,15 +122,22 @@
toggle-text-color="black" toggle-text-color="black"
:options="utilsOption" :options="utilsOption"
@update:model-value="drawSelect" @update:model-value="drawSelect"
> > -->
<template <div class="row wrap">
v-for="(ctl, idx) in utilsOption" <template v-for="(ctl, idx) in utilsOption" :key="idx">
:key="idx" <q-btn
v-slot:[ctl.value] square
> style="margin: 4px"
<q-tooltip>{{ ctl.tip }}</q-tooltip> color="brown"
@click="drawSelect(ctl.value)"
:icon="ctl.icon"
>
</q-btn>
</template> </template>
</q-btn-toggle> </div>
<!-- <q-tooltip>{{ ctl.tip }}</q-tooltip> -->
<!-- </q-btn-toggle> -->
</draggable-dialog> </draggable-dialog>
<q-resize-observer @resize="onResize" /> <q-resize-observer @resize="onResize" />
</q-layout> </q-layout>
@ -132,7 +145,7 @@
<script setup lang="ts"> <script setup lang="ts">
import DrawProperties from 'src/components/draw-app/IscsDrawProperties.vue'; import DrawProperties from 'src/components/draw-app/IscsDrawProperties.vue';
import { onMounted, reactive, ref, watch } from 'vue'; import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { useDrawStore } from 'src/stores/draw-store'; import { useDrawStore } from 'src/stores/draw-store';
@ -153,6 +166,7 @@ const router = useRouter();
const searchId = ref(0); const searchId = ref(0);
const drawStore = useDrawStore(); const drawStore = useDrawStore();
const showDrawTool = ref(true); const showDrawTool = ref(true);
const drawDialogHeight = ref(44);
watch( watch(
() => drawStore.drawMode, () => drawStore.drawMode,
@ -192,9 +206,10 @@ function toggleRightDrawer() {
// //
const selectUtil = ref(); const selectUtil = ref();
const utilsOption: ControlItem[] = reactive([]); const utilsOption: ControlItem[] = reactive([]);
const drawSelect = (item: string) => {
function drawSelect(item: string) {
drawStore.getDrawApp().interactionPlugin(item).resume(); drawStore.getDrawApp().interactionPlugin(item).resume();
}; }
class ControlItem { class ControlItem {
value: string; value: string;
slot: string; slot: string;
@ -250,6 +265,7 @@ onMounted(() => {
); );
} }
}); });
drawDialogHeight.value = 44 * Math.ceil(utilsOption.length / 2);
}); });
const canvasWidth = ref(0); const canvasWidth = ref(0);
@ -309,11 +325,31 @@ async function saveAs(name: string) {
} }
function onTopMenuClick(name: string) { function onTopMenuClick(name: string) {
console.log(name); drawStore.selectSubmenuAndStation.submenu = name;
drawStore.clickSubmenuName = name; forceReloadDate();
}
function forceReloadDate() {
const drawApp = drawStore.getDrawApp(); const drawApp = drawStore.getDrawApp();
const graphics = drawApp.queryStore.getAllGraphics(); const graphics = drawApp.queryStore.getAllGraphics();
graphics.forEach((graphic) => (graphic.visible = false)); graphics.forEach((graphic) => (graphic.visible = false));
drawApp.updateSelected();
drawApp.forceReload(); drawApp.forceReload();
} }
//
const selectStationName = ref('会展中心');
const stationOption = [
{ label: '会展中心', value: '会展中心' },
{ label: '火车站', value: '火车站' },
{ label: '丈八一路', value: '丈八一路' },
];
function selectedStation(name: string) {
drawStore.selectSubmenuAndStation.station = name;
forceReloadDate();
}
onUnmounted(() => {
drawStore.destroy();
});
</script> </script>

View File

@ -126,12 +126,17 @@ import SysMenu from 'src/components/SysMenu.vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { clearJwtToken, saveJwtToken } from 'src/configs/TokenManage'; import { clearJwtToken, saveJwtToken } from 'src/configs/TokenManage';
import { Dialog } from 'quasar'; import { Dialog } from 'quasar';
import { getLoginUserInfo } from 'src/api/UserApi';
import { useAuthStore } from 'src/stores/auth-store';
const route = useRoute(); const route = useRoute();
const authStore = useAuthStore();
onMounted(() => { onMounted(async () => {
if (route.params.token) { if (route.params.token) {
saveJwtToken(route.params.token as string); saveJwtToken(route.params.token as string);
const res = await getLoginUserInfo();
authStore.setUserId(res.loginUserInfo.id);
} }
}); });

View File

@ -15,19 +15,35 @@
@request="onRequest" @request="onRequest"
> >
<template v-slot:top-right> <template v-slot:top-right>
<q-input <div class="q-gutter-md q-mt-none row justify-center items-start">
dense <q-input dense debounce="1000" v-model="filter.name" label="名称" />
debounce="1000" <q-select
v-model="filter.name" dense
label="名称" v-model="filter.iscsStyle"
></q-input> :options="searchTscsStyleOption"
<q-btn flat round color="primary" icon="search" /> emit-value
<q-btn map-options
color="primary" options-dense
v-if="route.name == 'iscsDraft'" class="ellipsis"
label="新建" label="ISCS风格"
@click="createFormShow = true" style="width: 130px"
/> />
<q-select
v-if="route.name == 'iscsDraft'"
dense
v-model="filter.isShared"
:options="isSharedOption"
class="ellipsis"
label="共享相关"
style="width: 130px"
/>
<q-btn
color="primary"
v-if="route.name == 'iscsDraft'"
label="新建"
@click="createFormShow = true"
/>
</div>
</template> </template>
<template v-slot:header-cell-name="props"> <template v-slot:header-cell-name="props">
<q-th :props="props"> <q-th :props="props">
@ -249,6 +265,7 @@ import {
sharedDraftPageQuery, sharedDraftPageQuery,
PagingQueryParams, PagingQueryParams,
iscsStyleOption, iscsStyleOption,
searchTscsStyleOption,
} from '../api/DraftApi'; } from '../api/DraftApi';
import { ApiError } from 'src/boot/axios'; import { ApiError } from 'src/boot/axios';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
@ -261,7 +278,6 @@ import {
} from 'src/api/PublishApi'; } from 'src/api/PublishApi';
import { useAuthStore } from 'src/stores/auth-store'; import { useAuthStore } from 'src/stores/auth-store';
import { PageDto } from 'src/api/ApiCommon'; import { PageDto } from 'src/api/ApiCommon';
import { useDrawStore } from 'src/stores/draw-store';
const $q = useQuasar(); const $q = useQuasar();
const router = useRouter(); const router = useRouter();
@ -272,7 +288,6 @@ const props = withDefaults(
{ sizeHeight: 500 } { sizeHeight: 500 }
); );
const authStore = useAuthStore(); const authStore = useAuthStore();
const drawStore = useDrawStore();
const route = useRoute(); const route = useRoute();
const tableHeight = computed(() => { const tableHeight = computed(() => {
@ -300,9 +315,9 @@ const columnDefs: QTableColumn[] = [
align: 'center', align: 'center',
}, },
{ {
name: 'userId', name: 'userName',
label: '创建人', label: '创建人',
field: 'userId', field: 'userName',
align: 'center', align: 'center',
}, },
{ {
@ -339,6 +354,8 @@ const tableRef = ref();
const rows = reactive([]); const rows = reactive([]);
const filter = reactive({ const filter = reactive({
name: '', name: '',
iscsStyle: IscsStyle.UNKNOWN,
isShared: '全部',
}); });
const loading = ref(false); const loading = ref(false);
const pagination = ref({ const pagination = ref({
@ -353,8 +370,6 @@ const pagination = ref({
let allRequestData: DraftIscsDataDto[] = []; let allRequestData: DraftIscsDataDto[] = [];
async function onRequest(props: any) { async function onRequest(props: any) {
const { page, rowsPerPage } = props.pagination; const { page, rowsPerPage } = props.pagination;
const filter = props.filter;
loading.value = true; loading.value = true;
const variables: PagingQueryParams = { const variables: PagingQueryParams = {
paging: { paging: {
@ -363,9 +378,19 @@ async function onRequest(props: any) {
}, },
query: { query: {
dataType: DraftDataType.ISCS, dataType: DraftDataType.ISCS,
name: filter.name,
}, },
}; };
if (filter.name) {
Object.assign(variables.query, { name: filter.name });
}
if (filter.iscsStyle) {
Object.assign(variables.query, { options: { style: filter.iscsStyle } });
}
if (filter.isShared !== '全部') {
Object.assign(variables.query, {
isShared: filter.isShared == '共享' ? true : false,
});
}
try { try {
let response: PageDto<DraftIscsDataDto>; let response: PageDto<DraftIscsDataDto>;
if (route.name == 'iscsDraft') { if (route.name == 'iscsDraft') {
@ -402,6 +427,9 @@ function getTypeName(row: DraftItem) {
return iscsStyleName || ''; return iscsStyleName || '';
} }
//
const isSharedOption = ['全部', '共享', '不共享'];
// //
const createFormShow = ref(false); const createFormShow = ref(false);
const createForm = reactive({ const createForm = reactive({
@ -439,7 +467,6 @@ function onCreate() {
// //
function goToPath(row: DraftItem) { function goToPath(row: DraftItem) {
drawStore.clickSubmenuName = '车站控制';
let path = `/iscsPainting/${row.id}`; let path = `/iscsPainting/${row.id}`;
const iscsStyle = allRequestData.find((item) => item.draftData.id == row.id) const iscsStyle = allRequestData.find((item) => item.draftData.id == row.id)
.options.style; .options.style;
@ -621,6 +648,7 @@ const draftInfo = ref<DraftItem>({
createdAt: '', createdAt: '',
updatedAt: '', updatedAt: '',
defaultReleaseDataName: '', defaultReleaseDataName: '',
userName: '',
}); });
const publishColumnDefs: QTableColumn[] = [ const publishColumnDefs: QTableColumn[] = [

View File

@ -18,13 +18,28 @@
@request="onRequest" @request="onRequest"
> >
<template v-slot:top-right> <template v-slot:top-right>
<q-input <div class="q-gutter-md q-mt-none row justify-center items-start">
dense <q-input dense debounce="1000" v-model="filter.name" label="名称" />
debounce="1000" <q-select
v-model="filter.name" dense
label="名称" v-model="filter.iscsStyle"
></q-input> :options="searchTscsStyleOption"
<q-btn flat round color="primary" icon="search" /> emit-value
map-options
options-dense
class="ellipsis"
label="ISCS风格"
style="width: 130px"
/>
<q-select
dense
v-model="filter.isPublished"
:options="isPublishedOption"
class="ellipsis"
label="上下架"
style="width: 130px"
/>
</div>
</template> </template>
<template v-slot:header-cell-name="props"> <template v-slot:header-cell-name="props">
@ -141,7 +156,12 @@ import {
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { ApiError } from 'src/boot/axios'; import { ApiError } from 'src/boot/axios';
import { nextTick } from 'process'; import { nextTick } from 'process';
import { DraftDataType, iscsStyleOption } from 'src/api/DraftApi'; import {
DraftDataType,
IscsStyle,
iscsStyleOption,
searchTscsStyleOption,
} from 'src/api/DraftApi';
const route = useRoute(); const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
@ -186,9 +206,9 @@ const columnDefs: QTableColumn[] = [
align: 'center', align: 'center',
}, },
{ {
name: 'userId', name: 'userName',
label: '发布人', label: '发布人',
field: 'userId', field: 'userName',
align: 'center', align: 'center',
}, },
{ {
@ -210,6 +230,8 @@ const tableRef = ref();
const rows = reactive([]); const rows = reactive([]);
const filter = reactive({ const filter = reactive({
name: '', name: '',
iscsStyle: IscsStyle.UNKNOWN,
isPublished: '全部',
}); });
const loading = ref(false); const loading = ref(false);
const pagination = ref({ const pagination = ref({
@ -234,9 +256,19 @@ async function onRequest(props: any) {
}, },
query: { query: {
dataType: DraftDataType.ISCS, dataType: DraftDataType.ISCS,
name: filter.name,
}, },
}; };
if (filter.name) {
Object.assign(variables.query, { name: filter.name });
}
if (filter.iscsStyle) {
Object.assign(variables.query, { options: { style: filter.iscsStyle } });
}
if (filter.isPublished !== '全部') {
Object.assign(variables.query, {
isPublished: filter.isPublished == '上架' ? true : false,
});
}
try { try {
const response = await publishPageQuery(variables); const response = await publishPageQuery(variables);
pagination.value.rowsNumber = response.total; pagination.value.rowsNumber = response.total;
@ -268,6 +300,9 @@ function getTypeName(row: PublishItem) {
return iscsStyleName || ''; return iscsStyleName || '';
} }
//
const isPublishedOption = ['全部', '上架', '下架'];
// //
function dataReleaseFn(row: PublishItem) { function dataReleaseFn(row: PublishItem) {
if (row.isPublished) { if (row.isPublished) {
@ -402,13 +437,14 @@ const historyInfo = ref<PublishItem>({
createdAt: '', createdAt: '',
updatedAt: '', updatedAt: '',
description: '', description: '',
userName: '',
}); });
const historyColumnDefs: QTableColumn[] = [ const historyColumnDefs: QTableColumn[] = [
{ {
name: 'userId', name: 'userName',
label: '发布人', label: '发布人',
field: 'userId', field: 'userName',
required: true, required: true,
align: 'center', align: 'center',
}, },

200
src/pages/UserManage.vue Normal file
View File

@ -0,0 +1,200 @@
<template>
<div class="q-pa-md">
<q-table
ref="tableRef"
title="用户列表"
:style="{ height: tableHeight + 'px' }"
class="my-sticky-virtscroll-table"
:rows="rows"
:columns="columnDefs"
row-key="id"
v-model:pagination="pagination"
:rows-per-page-options="[10, 20, 50, 100]"
:loading="loading"
:filter="filter"
binary-state-sort
@request="onRequest"
>
<template v-slot:top-right>
<div class="q-gutter-md q-mt-none row justify-center items-start">
<q-input dense debounce="1000" v-model="filter.name" label="名称" />
<q-select
dense
v-model="filter.roles"
:options="rolesOptions"
multiple
emit-value
map-options
options-dense
label="角色"
style="min-width: 150px"
/>
<q-btn
:disable="operateDisabled"
color="primary"
label="同步"
@click="syncUsersInfoFn"
/>
</div>
</template>
<template v-slot:body-cell-roles="props">
<q-td :props="props">
<div class="q-gutter-sm row justify-center">
<q-chip
outline
size="sm"
color="primary"
v-for="(item, index) in props.row.roles"
:key="index"
>
{{ getRolesName(item) }}
</q-chip>
</div>
</q-td>
</template>
</q-table>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, computed } from 'vue';
import { useQuasar, type QTableColumn } from 'quasar';
import {
PagingQueryParams,
userPageQuery,
syncUsersInfo,
} from '../api/UserApi';
import { ApiError } from 'src/boot/axios';
const $q = useQuasar();
const props = withDefaults(
defineProps<{
sizeHeight: number;
}>(),
{ sizeHeight: 500 }
);
const tableHeight = computed(() => {
return props.sizeHeight - 32;
});
onMounted(() => {
tableRef.value.requestServerInteraction();
});
const columnDefs: QTableColumn[] = [
{ name: 'id', label: '用户ID', field: 'id', align: 'center' },
{
name: 'name',
label: '用户名',
field: 'name',
required: true,
align: 'center',
},
{
name: 'roles',
label: '角色',
field: 'roles',
required: true,
align: 'center',
},
{
name: 'mobile',
label: '手机号',
field: 'mobile',
align: 'center',
},
{
name: 'email',
label: '邮箱',
field: 'email',
align: 'center',
},
{
name: 'createdAt',
label: '创建时间',
field: (row) => new Date(row.createdAt).toLocaleString(),
align: 'center',
},
{
name: 'updatedAt',
label: '更新时间',
field: (row) => new Date(row.updatedAt).toLocaleString(),
align: 'center',
},
];
const tableRef = ref();
const rows = reactive([]);
const filter = reactive({
name: '',
roles: [],
});
const loading = ref(false);
const pagination = ref({
sortBy: 'desc',
descending: false,
page: 1,
rowsPerPage: 10,
rowsNumber: 10,
});
// eslint-disable-next-line
async function onRequest(props: any) {
const { page, rowsPerPage } = props.pagination;
const filter = props.filter;
loading.value = true;
const variables: PagingQueryParams = {
page: {
page: page,
itemsPerPage: rowsPerPage,
},
query: {},
};
if (filter.name) {
Object.assign(variables.query, { name: filter.name });
}
if (filter.roles) {
Object.assign(variables.query, { roles: filter.roles });
}
try {
const response = await userPageQuery(variables);
pagination.value.rowsNumber = response.total;
pagination.value.page = page;
pagination.value.rowsPerPage = rowsPerPage;
rows.splice(0, rows.length, ...(response.items as []));
} catch (err) {
const error = err as ApiError;
$q.notify({
type: 'negative',
message: error.title,
});
} finally {
loading.value = false;
}
}
const rolesOptions = [
{ label: '管理员', value: 'ADMIN' },
{ label: '用户', value: 'USER' },
];
function getRolesName(role: string) {
for (let i = 0; i < rolesOptions.length; i++) {
if (rolesOptions[i].value == role) {
return rolesOptions[i].label;
}
}
}
const operateDisabled = ref(false);
async function syncUsersInfoFn() {
operateDisabled.value = true;
const res = await syncUsersInfo();
operateDisabled.value = false;
if (res.syncUser) {
tableRef.value.requestServerInteraction();
}
}
</script>

View File

@ -9,112 +9,55 @@ export namespace iscsGraphicData {
export class IscsGraphicStorage extends pb_1.Message { export class IscsGraphicStorage extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
canvas?: dependency_1.common.Canvas; cctvOfStationControlStorages?: CCTVOfStationControlStorage[];
arrows?: Arrow[]; fasPlatformAlarmStorages?: FASPlatformAlarmStorage[];
iscsTexts?: IscsText[];
rects?: Rect[];
cctvButtons?: CCTVButton[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) { if ("cctvOfStationControlStorages" in data && data.cctvOfStationControlStorages != undefined) {
this.canvas = data.canvas; this.cctvOfStationControlStorages = data.cctvOfStationControlStorages;
} }
if ("arrows" in data && data.arrows != undefined) { if ("fasPlatformAlarmStorages" in data && data.fasPlatformAlarmStorages != undefined) {
this.arrows = data.arrows; this.fasPlatformAlarmStorages = data.fasPlatformAlarmStorages;
}
if ("iscsTexts" in data && data.iscsTexts != undefined) {
this.iscsTexts = data.iscsTexts;
}
if ("rects" in data && data.rects != undefined) {
this.rects = data.rects;
}
if ("cctvButtons" in data && data.cctvButtons != undefined) {
this.cctvButtons = data.cctvButtons;
} }
} }
} }
get canvas() { get cctvOfStationControlStorages() {
return pb_1.Message.getWrapperField(this, dependency_1.common.Canvas, 1) as dependency_1.common.Canvas; return pb_1.Message.getRepeatedWrapperField(this, CCTVOfStationControlStorage, 1) as CCTVOfStationControlStorage[];
} }
set canvas(value: dependency_1.common.Canvas) { set cctvOfStationControlStorages(value: CCTVOfStationControlStorage[]) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setRepeatedWrapperField(this, 1, value);
} }
get has_canvas() { get fasPlatformAlarmStorages() {
return pb_1.Message.getField(this, 1) != null; return pb_1.Message.getRepeatedWrapperField(this, FASPlatformAlarmStorage, 2) as FASPlatformAlarmStorage[];
} }
get arrows() { set fasPlatformAlarmStorages(value: FASPlatformAlarmStorage[]) {
return pb_1.Message.getRepeatedWrapperField(this, Arrow, 2) as Arrow[];
}
set arrows(value: Arrow[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value); pb_1.Message.setRepeatedWrapperField(this, 2, value);
} }
get iscsTexts() {
return pb_1.Message.getRepeatedWrapperField(this, IscsText, 3) as IscsText[];
}
set iscsTexts(value: IscsText[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
get rects() {
return pb_1.Message.getRepeatedWrapperField(this, Rect, 4) as Rect[];
}
set rects(value: Rect[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get cctvButtons() {
return pb_1.Message.getRepeatedWrapperField(this, CCTVButton, 5) as CCTVButton[];
}
set cctvButtons(value: CCTVButton[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
static fromObject(data: { static fromObject(data: {
canvas?: ReturnType<typeof dependency_1.common.Canvas.prototype.toObject>; cctvOfStationControlStorages?: ReturnType<typeof CCTVOfStationControlStorage.prototype.toObject>[];
arrows?: ReturnType<typeof Arrow.prototype.toObject>[]; fasPlatformAlarmStorages?: ReturnType<typeof FASPlatformAlarmStorage.prototype.toObject>[];
iscsTexts?: ReturnType<typeof IscsText.prototype.toObject>[];
rects?: ReturnType<typeof Rect.prototype.toObject>[];
cctvButtons?: ReturnType<typeof CCTVButton.prototype.toObject>[];
}): IscsGraphicStorage { }): IscsGraphicStorage {
const message = new IscsGraphicStorage({}); const message = new IscsGraphicStorage({});
if (data.canvas != null) { if (data.cctvOfStationControlStorages != null) {
message.canvas = dependency_1.common.Canvas.fromObject(data.canvas); message.cctvOfStationControlStorages = data.cctvOfStationControlStorages.map(item => CCTVOfStationControlStorage.fromObject(item));
} }
if (data.arrows != null) { if (data.fasPlatformAlarmStorages != null) {
message.arrows = data.arrows.map(item => Arrow.fromObject(item)); message.fasPlatformAlarmStorages = data.fasPlatformAlarmStorages.map(item => FASPlatformAlarmStorage.fromObject(item));
}
if (data.iscsTexts != null) {
message.iscsTexts = data.iscsTexts.map(item => IscsText.fromObject(item));
}
if (data.rects != null) {
message.rects = data.rects.map(item => Rect.fromObject(item));
}
if (data.cctvButtons != null) {
message.cctvButtons = data.cctvButtons.map(item => CCTVButton.fromObject(item));
} }
return message; return message;
} }
toObject() { toObject() {
const data: { const data: {
canvas?: ReturnType<typeof dependency_1.common.Canvas.prototype.toObject>; cctvOfStationControlStorages?: ReturnType<typeof CCTVOfStationControlStorage.prototype.toObject>[];
arrows?: ReturnType<typeof Arrow.prototype.toObject>[]; fasPlatformAlarmStorages?: ReturnType<typeof FASPlatformAlarmStorage.prototype.toObject>[];
iscsTexts?: ReturnType<typeof IscsText.prototype.toObject>[];
rects?: ReturnType<typeof Rect.prototype.toObject>[];
cctvButtons?: ReturnType<typeof CCTVButton.prototype.toObject>[];
} = {}; } = {};
if (this.canvas != null) { if (this.cctvOfStationControlStorages != null) {
data.canvas = this.canvas.toObject(); data.cctvOfStationControlStorages = this.cctvOfStationControlStorages.map((item: CCTVOfStationControlStorage) => item.toObject());
} }
if (this.arrows != null) { if (this.fasPlatformAlarmStorages != null) {
data.arrows = this.arrows.map((item: Arrow) => item.toObject()); data.fasPlatformAlarmStorages = this.fasPlatformAlarmStorages.map((item: FASPlatformAlarmStorage) => item.toObject());
}
if (this.iscsTexts != null) {
data.iscsTexts = this.iscsTexts.map((item: IscsText) => item.toObject());
}
if (this.rects != null) {
data.rects = this.rects.map((item: Rect) => item.toObject());
}
if (this.cctvButtons != null) {
data.cctvButtons = this.cctvButtons.map((item: CCTVButton) => item.toObject());
} }
return data; return data;
} }
@ -122,16 +65,10 @@ export namespace iscsGraphicData {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.has_canvas) if (this.cctvOfStationControlStorages.length)
writer.writeMessage(1, this.canvas, () => this.canvas.serialize(writer)); writer.writeRepeatedMessage(1, this.cctvOfStationControlStorages, (item: CCTVOfStationControlStorage) => item.serialize(writer));
if (this.arrows.length) if (this.fasPlatformAlarmStorages.length)
writer.writeRepeatedMessage(2, this.arrows, (item: Arrow) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.fasPlatformAlarmStorages, (item: FASPlatformAlarmStorage) => item.serialize(writer));
if (this.iscsTexts.length)
writer.writeRepeatedMessage(3, this.iscsTexts, (item: IscsText) => item.serialize(writer));
if (this.rects.length)
writer.writeRepeatedMessage(4, this.rects, (item: Rect) => item.serialize(writer));
if (this.cctvButtons.length)
writer.writeRepeatedMessage(5, this.cctvButtons, (item: CCTVButton) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -142,19 +79,10 @@ export namespace iscsGraphicData {
break; break;
switch (reader.getFieldNumber()) { switch (reader.getFieldNumber()) {
case 1: case 1:
reader.readMessage(message.canvas, () => message.canvas = dependency_1.common.Canvas.deserialize(reader)); reader.readMessage(message.cctvOfStationControlStorages, () => pb_1.Message.addToRepeatedWrapperField(message, 1, CCTVOfStationControlStorage.deserialize(reader), CCTVOfStationControlStorage));
break; break;
case 2: case 2:
reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 2, Arrow.deserialize(reader), Arrow)); reader.readMessage(message.fasPlatformAlarmStorages, () => pb_1.Message.addToRepeatedWrapperField(message, 2, FASPlatformAlarmStorage.deserialize(reader), FASPlatformAlarmStorage));
break;
case 3:
reader.readMessage(message.iscsTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 3, IscsText.deserialize(reader), IscsText));
break;
case 4:
reader.readMessage(message.rects, () => pb_1.Message.addToRepeatedWrapperField(message, 4, Rect.deserialize(reader), Rect));
break;
case 5:
reader.readMessage(message.cctvButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 5, CCTVButton.deserialize(reader), CCTVButton));
break; break;
default: reader.skipField(); default: reader.skipField();
} }
@ -1381,4 +1309,351 @@ export namespace iscsGraphicData {
return TemperatureDetector.deserialize(bytes); return TemperatureDetector.deserialize(bytes);
} }
} }
export class CCTVOfStationControlStorage extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
stationName?: string;
canvas?: dependency_1.common.Canvas;
arrows?: Arrow[];
iscsTexts?: IscsText[];
rects?: Rect[];
cctvButtons?: CCTVButton[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4, 5, 6], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("stationName" in data && data.stationName != undefined) {
this.stationName = data.stationName;
}
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
}
if ("arrows" in data && data.arrows != undefined) {
this.arrows = data.arrows;
}
if ("iscsTexts" in data && data.iscsTexts != undefined) {
this.iscsTexts = data.iscsTexts;
}
if ("rects" in data && data.rects != undefined) {
this.rects = data.rects;
}
if ("cctvButtons" in data && data.cctvButtons != undefined) {
this.cctvButtons = data.cctvButtons;
}
}
}
get stationName() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set stationName(value: string) {
pb_1.Message.setField(this, 1, value);
}
get canvas() {
return pb_1.Message.getWrapperField(this, dependency_1.common.Canvas, 2) as dependency_1.common.Canvas;
}
set canvas(value: dependency_1.common.Canvas) {
pb_1.Message.setWrapperField(this, 2, value);
}
get has_canvas() {
return pb_1.Message.getField(this, 2) != null;
}
get arrows() {
return pb_1.Message.getRepeatedWrapperField(this, Arrow, 3) as Arrow[];
}
set arrows(value: Arrow[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
get iscsTexts() {
return pb_1.Message.getRepeatedWrapperField(this, IscsText, 4) as IscsText[];
}
set iscsTexts(value: IscsText[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get rects() {
return pb_1.Message.getRepeatedWrapperField(this, Rect, 5) as Rect[];
}
set rects(value: Rect[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
get cctvButtons() {
return pb_1.Message.getRepeatedWrapperField(this, CCTVButton, 6) as CCTVButton[];
}
set cctvButtons(value: CCTVButton[]) {
pb_1.Message.setRepeatedWrapperField(this, 6, value);
}
static fromObject(data: {
stationName?: string;
canvas?: ReturnType<typeof dependency_1.common.Canvas.prototype.toObject>;
arrows?: ReturnType<typeof Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof IscsText.prototype.toObject>[];
rects?: ReturnType<typeof Rect.prototype.toObject>[];
cctvButtons?: ReturnType<typeof CCTVButton.prototype.toObject>[];
}): CCTVOfStationControlStorage {
const message = new CCTVOfStationControlStorage({});
if (data.stationName != null) {
message.stationName = data.stationName;
}
if (data.canvas != null) {
message.canvas = dependency_1.common.Canvas.fromObject(data.canvas);
}
if (data.arrows != null) {
message.arrows = data.arrows.map(item => Arrow.fromObject(item));
}
if (data.iscsTexts != null) {
message.iscsTexts = data.iscsTexts.map(item => IscsText.fromObject(item));
}
if (data.rects != null) {
message.rects = data.rects.map(item => Rect.fromObject(item));
}
if (data.cctvButtons != null) {
message.cctvButtons = data.cctvButtons.map(item => CCTVButton.fromObject(item));
}
return message;
}
toObject() {
const data: {
stationName?: string;
canvas?: ReturnType<typeof dependency_1.common.Canvas.prototype.toObject>;
arrows?: ReturnType<typeof Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof IscsText.prototype.toObject>[];
rects?: ReturnType<typeof Rect.prototype.toObject>[];
cctvButtons?: ReturnType<typeof CCTVButton.prototype.toObject>[];
} = {};
if (this.stationName != null) {
data.stationName = this.stationName;
}
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
}
if (this.arrows != null) {
data.arrows = this.arrows.map((item: Arrow) => item.toObject());
}
if (this.iscsTexts != null) {
data.iscsTexts = this.iscsTexts.map((item: IscsText) => item.toObject());
}
if (this.rects != null) {
data.rects = this.rects.map((item: Rect) => item.toObject());
}
if (this.cctvButtons != null) {
data.cctvButtons = this.cctvButtons.map((item: CCTVButton) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.stationName.length)
writer.writeString(1, this.stationName);
if (this.has_canvas)
writer.writeMessage(2, this.canvas, () => this.canvas.serialize(writer));
if (this.arrows.length)
writer.writeRepeatedMessage(3, this.arrows, (item: Arrow) => item.serialize(writer));
if (this.iscsTexts.length)
writer.writeRepeatedMessage(4, this.iscsTexts, (item: IscsText) => item.serialize(writer));
if (this.rects.length)
writer.writeRepeatedMessage(5, this.rects, (item: Rect) => item.serialize(writer));
if (this.cctvButtons.length)
writer.writeRepeatedMessage(6, this.cctvButtons, (item: CCTVButton) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CCTVOfStationControlStorage {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CCTVOfStationControlStorage();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.stationName = reader.readString();
break;
case 2:
reader.readMessage(message.canvas, () => message.canvas = dependency_1.common.Canvas.deserialize(reader));
break;
case 3:
reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Arrow.deserialize(reader), Arrow));
break;
case 4:
reader.readMessage(message.iscsTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 4, IscsText.deserialize(reader), IscsText));
break;
case 5:
reader.readMessage(message.rects, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Rect.deserialize(reader), Rect));
break;
case 6:
reader.readMessage(message.cctvButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 6, CCTVButton.deserialize(reader), CCTVButton));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): CCTVOfStationControlStorage {
return CCTVOfStationControlStorage.deserialize(bytes);
}
}
export class FASPlatformAlarmStorage extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
stationName?: string;
canvas?: dependency_1.common.Canvas;
arrows?: Arrow[];
iscsTexts?: IscsText[];
rects?: Rect[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4, 5], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("stationName" in data && data.stationName != undefined) {
this.stationName = data.stationName;
}
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
}
if ("arrows" in data && data.arrows != undefined) {
this.arrows = data.arrows;
}
if ("iscsTexts" in data && data.iscsTexts != undefined) {
this.iscsTexts = data.iscsTexts;
}
if ("rects" in data && data.rects != undefined) {
this.rects = data.rects;
}
}
}
get stationName() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
}
set stationName(value: string) {
pb_1.Message.setField(this, 1, value);
}
get canvas() {
return pb_1.Message.getWrapperField(this, dependency_1.common.Canvas, 2) as dependency_1.common.Canvas;
}
set canvas(value: dependency_1.common.Canvas) {
pb_1.Message.setWrapperField(this, 2, value);
}
get has_canvas() {
return pb_1.Message.getField(this, 2) != null;
}
get arrows() {
return pb_1.Message.getRepeatedWrapperField(this, Arrow, 3) as Arrow[];
}
set arrows(value: Arrow[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
get iscsTexts() {
return pb_1.Message.getRepeatedWrapperField(this, IscsText, 4) as IscsText[];
}
set iscsTexts(value: IscsText[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
get rects() {
return pb_1.Message.getRepeatedWrapperField(this, Rect, 5) as Rect[];
}
set rects(value: Rect[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
static fromObject(data: {
stationName?: string;
canvas?: ReturnType<typeof dependency_1.common.Canvas.prototype.toObject>;
arrows?: ReturnType<typeof Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof IscsText.prototype.toObject>[];
rects?: ReturnType<typeof Rect.prototype.toObject>[];
}): FASPlatformAlarmStorage {
const message = new FASPlatformAlarmStorage({});
if (data.stationName != null) {
message.stationName = data.stationName;
}
if (data.canvas != null) {
message.canvas = dependency_1.common.Canvas.fromObject(data.canvas);
}
if (data.arrows != null) {
message.arrows = data.arrows.map(item => Arrow.fromObject(item));
}
if (data.iscsTexts != null) {
message.iscsTexts = data.iscsTexts.map(item => IscsText.fromObject(item));
}
if (data.rects != null) {
message.rects = data.rects.map(item => Rect.fromObject(item));
}
return message;
}
toObject() {
const data: {
stationName?: string;
canvas?: ReturnType<typeof dependency_1.common.Canvas.prototype.toObject>;
arrows?: ReturnType<typeof Arrow.prototype.toObject>[];
iscsTexts?: ReturnType<typeof IscsText.prototype.toObject>[];
rects?: ReturnType<typeof Rect.prototype.toObject>[];
} = {};
if (this.stationName != null) {
data.stationName = this.stationName;
}
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
}
if (this.arrows != null) {
data.arrows = this.arrows.map((item: Arrow) => item.toObject());
}
if (this.iscsTexts != null) {
data.iscsTexts = this.iscsTexts.map((item: IscsText) => item.toObject());
}
if (this.rects != null) {
data.rects = this.rects.map((item: Rect) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.stationName.length)
writer.writeString(1, this.stationName);
if (this.has_canvas)
writer.writeMessage(2, this.canvas, () => this.canvas.serialize(writer));
if (this.arrows.length)
writer.writeRepeatedMessage(3, this.arrows, (item: Arrow) => item.serialize(writer));
if (this.iscsTexts.length)
writer.writeRepeatedMessage(4, this.iscsTexts, (item: IscsText) => item.serialize(writer));
if (this.rects.length)
writer.writeRepeatedMessage(5, this.rects, (item: Rect) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FASPlatformAlarmStorage {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FASPlatformAlarmStorage();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.stationName = reader.readString();
break;
case 2:
reader.readMessage(message.canvas, () => message.canvas = dependency_1.common.Canvas.deserialize(reader));
break;
case 3:
reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Arrow.deserialize(reader), Arrow));
break;
case 4:
reader.readMessage(message.iscsTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 4, IscsText.deserialize(reader), IscsText));
break;
case 5:
reader.readMessage(message.rects, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Rect.deserialize(reader), Rect));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): FASPlatformAlarmStorage {
return FASPlatformAlarmStorage.deserialize(bytes);
}
}
} }

View File

@ -17,12 +17,33 @@ const routes: RouteRecordRaw[] = [
// children: [{ path: '', component: () => import('pages/IndexPage.vue') }], // children: [{ path: '', component: () => import('pages/IndexPage.vue') }],
}, },
{
path: '/sysManage',
name: 'sysManage',
component: () => import('layouts/MainLayout.vue'),
meta: {
label: '系统管理',
icon: 'dataset',
},
children: [
{
path: 'user',
name: 'user',
meta: {
label: '用户管理',
icon: 'manage_accounts',
},
component: () => import('pages/UserManage.vue'),
},
],
},
{ {
path: '/dataManage', path: '/dataManage',
name: 'dataManage', name: 'dataManage',
component: () => import('layouts/MainLayout.vue'), component: () => import('layouts/MainLayout.vue'),
meta: { meta: {
label: '数据管理', label: 'ISCS数据管理',
icon: 'list_alt', icon: 'list_alt',
}, },
children: [ children: [
@ -31,7 +52,7 @@ const routes: RouteRecordRaw[] = [
name: 'iscsDraft', name: 'iscsDraft',
component: () => import('pages/IscsDraftManage.vue'), component: () => import('pages/IscsDraftManage.vue'),
meta: { meta: {
label: 'iscs草稿管理', label: '草稿数据',
icon: 'app_registration', icon: 'app_registration',
}, },
}, },
@ -40,7 +61,7 @@ const routes: RouteRecordRaw[] = [
name: 'iscsSharedDraft', name: 'iscsSharedDraft',
component: () => import('pages/IscsDraftManage.vue'), component: () => import('pages/IscsDraftManage.vue'),
meta: { meta: {
label: 'iscs分享草稿管理', label: '共享草稿数据',
icon: 'app_registration', icon: 'app_registration',
}, },
}, },
@ -49,7 +70,7 @@ const routes: RouteRecordRaw[] = [
name: 'iscsPublish', name: 'iscsPublish',
component: () => import('pages/IscsPublishManage.vue'), component: () => import('pages/IscsPublishManage.vue'),
meta: { meta: {
label: 'iscs发布数据管理', label: '发布数据',
icon: 'playlist_add_check', icon: 'playlist_add_check',
}, },
}, },

View File

@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
export const useAuthStore = defineStore('auth', { export const useAuthStore = defineStore('auth', {
state: () => ({ state: () => ({
userId: 8160 as number | null, userId: null as number | null,
}), }),
actions: { actions: {
setUserId(id: number | null) { setUserId(id: number | null) {

View File

@ -20,17 +20,13 @@ export const useDrawStore = defineStore('draw', {
selectedGraphics: null as JlGraphic[] | null, selectedGraphics: null as JlGraphic[] | null,
draftId: null as number | null, draftId: null as number | null,
drawPictureType: null as PictureType | null, drawPictureType: null as PictureType | null,
clickSubmenuName: '车站控制', selectSubmenuAndStation: { submenu: '站台报警', station: '会展中心' },
}), }),
getters: { getters: {
drawMode: (state) => state.drawAssistant != null, drawMode: (state) => state.drawAssistant != null,
drawGraphicType: (state) => state.drawAssistant?.type, drawGraphicType: (state) => state.drawAssistant?.type,
drawGraphicName: (state) => state.drawAssistant?.description, drawGraphicName: (state) => state.drawAssistant?.description,
drawGraphicTemplate: (state) => state.drawAssistant?.graphicTemplate, drawGraphicTemplate: (state) => state.drawAssistant?.graphicTemplate,
getApp: () => {
const app = getIscsDrawApp();
return app;
},
selectedGraphicType: (state) => { selectedGraphicType: (state) => {
if (state.selectedGraphics) { if (state.selectedGraphics) {
if (state.selectedGraphics.length === 1) { if (state.selectedGraphics.length === 1) {
@ -43,7 +39,7 @@ export const useDrawStore = defineStore('draw', {
if (state.selectedGraphics.length == 0) { if (state.selectedGraphics.length == 0) {
return '画布'; return '画布';
} else if (state.selectedGraphics.length == 1) { } else if (state.selectedGraphics.length == 1) {
const name = this.getApp?.getDrawAssistant( const name = getIscsDrawApp()?.getDrawAssistant(
state.selectedGraphics[0].type state.selectedGraphics[0].type
).description; ).description;
return name || ''; return name || '';
@ -63,7 +59,7 @@ export const useDrawStore = defineStore('draw', {
}, },
actions: { actions: {
getDrawApp(): IDrawApp { getDrawApp(): IDrawApp {
const app = this.getApp; const app = getIscsDrawApp();
if (app == null) { if (app == null) {
throw new Error('未初始化app'); throw new Error('未初始化app');
} }
@ -104,7 +100,11 @@ export const useDrawStore = defineStore('draw', {
// console.log('绘制状态清空,绘制应用销毁'); // console.log('绘制状态清空,绘制应用销毁');
this.drawAssistant = null; this.drawAssistant = null;
this.selectedGraphics = null; this.selectedGraphics = null;
destroyIscsDrawApp(); (this.selectSubmenuAndStation = {
submenu: '站台报警',
station: '会展中心',
}),
destroyIscsDrawApp();
}, },
setDraftId(id: number | null) { setDraftId(id: number | null) {
this.draftId = id; this.draftId = id;