Merge remote-tracking branch 'origin/develop' into local-test
All checks were successful
local-test分支构建发布 / Docker-Build (push) Successful in 2m2s
All checks were successful
local-test分支构建发布 / Docker-Build (push) Successful in 2m2s
This commit is contained in:
commit
328e70e188
186
src/components/common/SelectConfigUtils.vue
Normal file
186
src/components/common/SelectConfigUtils.vue
Normal file
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<q-list bordered separator class="rounded-borders">
|
||||
<q-expansion-item
|
||||
bordered
|
||||
expand-separator
|
||||
v-for="(configItem, index) in selectConfig"
|
||||
:key="configItem"
|
||||
v-model="configItem.expanded"
|
||||
:label="configItem.code"
|
||||
@click="toggleItem(index)"
|
||||
>
|
||||
<q-card>
|
||||
<q-item no-wrap class="q-gutter-y-sm column">
|
||||
<q-input
|
||||
v-if="props.ableAdd"
|
||||
outlined
|
||||
v-model="configItem.code"
|
||||
label="配置项类型"
|
||||
lazy-rules
|
||||
/>
|
||||
<div class="q-gutter-sm row">
|
||||
<q-chip
|
||||
v-for="(item, selectIndex) in configItem.refDevicesCode"
|
||||
:key="item"
|
||||
square
|
||||
color="primary"
|
||||
text-color="white"
|
||||
removable
|
||||
@remove="removeSelect(selectIndex)"
|
||||
clickable
|
||||
@click="clickSelectCenter(selectIndex)"
|
||||
>
|
||||
{{ item }}
|
||||
</q-chip>
|
||||
</div>
|
||||
<div>
|
||||
<q-btn
|
||||
v-show="configItem.refDevicesCode.length > 0"
|
||||
style="width: 100px"
|
||||
label="清空选择"
|
||||
color="red"
|
||||
class="q-mr-md"
|
||||
@click="clearAllSelect(index)"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="props.ableAdd"
|
||||
label="删除配置项"
|
||||
color="secondary"
|
||||
@click="deleteSelectConfig(index)"
|
||||
/>
|
||||
</div>
|
||||
</q-item>
|
||||
</q-card>
|
||||
</q-expansion-item>
|
||||
</q-list>
|
||||
<q-btn
|
||||
v-if="props.ableAdd"
|
||||
class="q-mt-md"
|
||||
label="增加配置项"
|
||||
color="secondary"
|
||||
@click="addSelectConfig"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { inject, ref, watch } from 'vue';
|
||||
import { IDrawApp, JlGraphic } from 'jl-graphic';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
drawStore: {
|
||||
selectedGraphics: JlGraphic[];
|
||||
getDrawApp(): IDrawApp;
|
||||
};
|
||||
ableAdd?: boolean;
|
||||
}>(),
|
||||
{ ableAdd: false }
|
||||
);
|
||||
|
||||
const selectConfig = ref<
|
||||
{
|
||||
code: string;
|
||||
refDevices: number[];
|
||||
refDevicesCode: string[];
|
||||
expanded: boolean;
|
||||
}[]
|
||||
>([
|
||||
{
|
||||
code: '配置项模版',
|
||||
refDevices: [],
|
||||
refDevicesCode: [],
|
||||
expanded: false,
|
||||
},
|
||||
]);
|
||||
|
||||
let selectGraphic: JlGraphic[] = [];
|
||||
|
||||
defineExpose({
|
||||
selectConfig,
|
||||
selectGraphic,
|
||||
});
|
||||
|
||||
interface GraphicData {
|
||||
datas: { code: string };
|
||||
}
|
||||
|
||||
const filterSelect = inject('filter') as (g: JlGraphic) => boolean;
|
||||
watch(
|
||||
() => props.drawStore.selectedGraphics,
|
||||
(val) => {
|
||||
if (val && val.length > 0 && clickIndex !== null) {
|
||||
const selectFilter = props.drawStore.selectedGraphics?.filter(
|
||||
filterSelect
|
||||
) as JlGraphic[];
|
||||
selectGraphic.push(...selectFilter);
|
||||
selectGraphic = Array.from(new Set(selectGraphic));
|
||||
props.drawStore.getDrawApp().updateSelected(...selectGraphic);
|
||||
selectConfig.value[clickIndex].refDevicesCode = selectGraphic.map((g) =>
|
||||
(g as JlGraphic & GraphicData).datas.code == ''
|
||||
? g.id + ''
|
||||
: (g as JlGraphic & GraphicData).datas.code
|
||||
);
|
||||
selectConfig.value[clickIndex].refDevices = selectGraphic.map(
|
||||
(g) => g.id
|
||||
) as number[];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
let clickIndex: null | number = null;
|
||||
function toggleItem(index: number) {
|
||||
const drawApp = props.drawStore.getDrawApp();
|
||||
selectGraphic = [];
|
||||
drawApp.updateSelected();
|
||||
if (selectConfig.value[index].expanded == true) {
|
||||
clickIndex = index;
|
||||
const select: JlGraphic[] = [];
|
||||
selectConfig.value[index].refDevices.forEach((id: number) => {
|
||||
const g = drawApp.queryStore.queryById(id);
|
||||
select.push(g);
|
||||
});
|
||||
drawApp.updateSelected(...select);
|
||||
} else {
|
||||
clickIndex = null;
|
||||
}
|
||||
}
|
||||
|
||||
function removeSelect(removeIndex: number) {
|
||||
const clickTarget = selectConfig.value[clickIndex as number];
|
||||
selectGraphic.splice(removeIndex, 1);
|
||||
clickTarget.refDevicesCode.splice(removeIndex, 1);
|
||||
clickTarget.refDevices.splice(removeIndex, 1);
|
||||
props.drawStore.getDrawApp().updateSelected(...selectGraphic);
|
||||
}
|
||||
|
||||
function clickSelectCenter(index: number) {
|
||||
const drawApp = props.drawStore.getDrawApp();
|
||||
const clickTarget = selectConfig.value[clickIndex as number];
|
||||
const clickGraphic = drawApp.queryStore.queryById(
|
||||
clickTarget.refDevices[index]
|
||||
);
|
||||
drawApp.makeGraphicCenterShow(clickGraphic);
|
||||
}
|
||||
|
||||
function clearAllSelect(index: number) {
|
||||
selectConfig.value[index].refDevices = [];
|
||||
selectConfig.value[index].refDevicesCode = [];
|
||||
selectGraphic = [];
|
||||
props.drawStore.getDrawApp().updateSelected();
|
||||
}
|
||||
|
||||
function addSelectConfig() {
|
||||
selectConfig.value.push({
|
||||
code: '配置项模版',
|
||||
refDevices: [],
|
||||
refDevicesCode: [],
|
||||
expanded: false,
|
||||
});
|
||||
}
|
||||
|
||||
function deleteSelectConfig(index: number) {
|
||||
selectConfig.value.splice(index, 1);
|
||||
selectGraphic = [];
|
||||
props.drawStore.getDrawApp().updateSelected();
|
||||
}
|
||||
</script>
|
183
src/components/draw-app/properties/AxleCountingConfig.vue
Normal file
183
src/components/draw-app/properties/AxleCountingConfig.vue
Normal file
@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<q-card class="q-gutter-sm q-pa-sm">
|
||||
<q-card-section>
|
||||
<div class="text-h6">一键生成计轴配置</div>
|
||||
</q-card-section>
|
||||
<q-form ref="myForm">
|
||||
<selectConfig-utils ref="selectConfigUtils" :drawStore="drawStore" />
|
||||
<div class="q-mt-md q-gutter-md">
|
||||
<q-btn label="确认修改" color="primary" @click="onSubmit" />
|
||||
<q-btn label="返回" color="red" @click="goBack" />
|
||||
<q-btn label="生成计轴" color="primary" @click="generateAxleCounting" />
|
||||
</div>
|
||||
<div class="q-mt-md q-gutter-md">
|
||||
<q-btn
|
||||
label="检查计轴"
|
||||
color="primary"
|
||||
@click="showErrorAxleCounting"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="showCheck"
|
||||
label="上一个"
|
||||
color="primary"
|
||||
@click="clickSelectCenter(-1)"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="showCheck"
|
||||
label="下一个"
|
||||
color="primary"
|
||||
@click="clickSelectCenter(1)"
|
||||
/>
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue';
|
||||
import { QForm, useQuasar } from 'quasar';
|
||||
import { JlGraphic } from 'jl-graphic';
|
||||
import { useDrawStore } from 'src/stores/draw-store';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { Turnout } from 'src/graphics/turnout/Turnout';
|
||||
import {
|
||||
loadGenerateAxleCountingConfig,
|
||||
setGenerateAxleCountingConfig,
|
||||
} from 'src/drawApp';
|
||||
import SelectConfigUtils from 'src/components/common/SelectConfigUtils.vue';
|
||||
import { OneClickGenerate } from 'src/graphics/trainWindow/oneClickDrawAssistant';
|
||||
import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting';
|
||||
|
||||
//供公共选择组件使用
|
||||
const filterSelect = (g: JlGraphic) => g instanceof Turnout;
|
||||
const selectConfigUtils = ref<InstanceType<typeof SelectConfigUtils> | null>(
|
||||
null
|
||||
);
|
||||
provide('filter', filterSelect);
|
||||
|
||||
const emit = defineEmits(['close']);
|
||||
|
||||
const drawStore = useDrawStore();
|
||||
const $q = useQuasar();
|
||||
|
||||
onMounted(() => {
|
||||
selectConfigUtils.value.selectConfig = [
|
||||
{
|
||||
code: 'bb连接的道岔',
|
||||
refDevices: [],
|
||||
refDevicesCode: [],
|
||||
expanded: false,
|
||||
},
|
||||
{
|
||||
code: '不生成计轴的道岔组',
|
||||
refDevices: [],
|
||||
refDevicesCode: [],
|
||||
expanded: false,
|
||||
},
|
||||
];
|
||||
const generateAxleCountingConfig = loadGenerateAxleCountingConfig();
|
||||
if (generateAxleCountingConfig !== undefined) {
|
||||
selectConfigUtils.value.selectConfig.forEach(
|
||||
(generate: {
|
||||
code: string;
|
||||
refDevices: number[];
|
||||
refDevicesCode: string[];
|
||||
}) => {
|
||||
if (generate.code == 'bb连接的道岔') {
|
||||
generate.refDevices = generateAxleCountingConfig.bbConnect;
|
||||
generateAxleCountingConfig.bbConnect.forEach((id) => {
|
||||
const g = drawStore.getDrawApp().queryStore.queryById(id);
|
||||
generate.refDevicesCode.push(g.code);
|
||||
});
|
||||
} else if (generate.code == '不生成计轴的道岔组') {
|
||||
generate.refDevices = generateAxleCountingConfig.noGenerateGroup;
|
||||
generateAxleCountingConfig.noGenerateGroup.forEach((id) => {
|
||||
const g = drawStore.getDrawApp().queryStore.queryById(id);
|
||||
generate.refDevicesCode.push(g.code);
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
const myForm = ref<QForm | null>(null);
|
||||
async function onSubmit() {
|
||||
myForm.value?.validate().then(async (res) => {
|
||||
if (res) {
|
||||
try {
|
||||
const generateAxleCountingConfig =
|
||||
new graphicData.GenerateAxleCountingConfig();
|
||||
selectConfigUtils.value.selectConfig.forEach(
|
||||
(generate: { code: string; refDevices: number[] }) => {
|
||||
if (generate.code == 'bb连接的道岔') {
|
||||
generateAxleCountingConfig.bbConnect = generate.refDevices;
|
||||
} else if (generate.code == '不生成计轴的道岔组') {
|
||||
generateAxleCountingConfig.noGenerateGroup = generate.refDevices;
|
||||
}
|
||||
}
|
||||
);
|
||||
setGenerateAxleCountingConfig(generateAxleCountingConfig);
|
||||
$q.notify({
|
||||
type: 'positive',
|
||||
message: '更新成功',
|
||||
});
|
||||
} catch (err) {
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: '更新失败',
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
emit('close');
|
||||
}
|
||||
|
||||
function generateAxleCounting() {
|
||||
drawStore.oneClickType = 'AxleCounting';
|
||||
drawStore.getDrawApp().interactionPlugin(OneClickGenerate.Type).resume();
|
||||
}
|
||||
|
||||
const selectConfig = ref<
|
||||
{
|
||||
axleCountingId: number;
|
||||
axleCountingCode: string;
|
||||
}[]
|
||||
>([]);
|
||||
function showErrorAxleCounting() {
|
||||
showCheck.value = true;
|
||||
const axleCountings = drawStore
|
||||
.getDrawApp()
|
||||
.queryStore.queryByType<AxleCounting>(AxleCounting.Type);
|
||||
const erroeAxleCountings = axleCountings
|
||||
.filter((g) => g.datas.axleCountingRef.length < 2)
|
||||
.sort((a, b) => a.position.x - b.position.x);
|
||||
erroeAxleCountings.forEach((axleCounting) => {
|
||||
selectConfig.value.push({
|
||||
axleCountingId: axleCounting.id,
|
||||
axleCountingCode: axleCounting.datas.code,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const currentIndex = ref(-1);
|
||||
const showCheck = ref(false);
|
||||
function clickSelectCenter(add: number) {
|
||||
if (
|
||||
currentIndex.value + add < 0 ||
|
||||
currentIndex.value + add >= selectConfig.value.length
|
||||
)
|
||||
return;
|
||||
currentIndex.value = currentIndex.value + add;
|
||||
const target = drawStore
|
||||
.getDrawApp()
|
||||
.queryStore.queryById(
|
||||
selectConfig.value[currentIndex.value].axleCountingId
|
||||
);
|
||||
drawStore.getDrawApp().makeGraphicCenterShow(target);
|
||||
drawStore.getDrawApp().updateSelected(target);
|
||||
}
|
||||
</script>
|
@ -289,6 +289,9 @@ export function initDrawApp(): IDrawApp {
|
||||
if (app.drawing) return;
|
||||
handleRIghtClick(e);
|
||||
});
|
||||
app.on('destroy', () => {
|
||||
generateAxleCountingConfig = new graphicData.GenerateAxleCountingConfig();
|
||||
});
|
||||
app.addKeyboardListener(
|
||||
new KeyListener({
|
||||
value: 'KeyS',
|
||||
@ -557,6 +560,7 @@ export function saveDrawDatas(app: IDrawApp) {
|
||||
// item.pcRef.nid = +item.pcRef.id;
|
||||
// }
|
||||
// });
|
||||
storage.generateAxleCountingConfig = generateAxleCountingConfig;
|
||||
const base64 = fromUint8Array(storage.serialize());
|
||||
console.log('保存数据', storage);
|
||||
// localStorage.setItem(StorageKey, base64);
|
||||
@ -579,6 +583,7 @@ export async function loadDrawDatas(): Promise<IGraphicStorage> {
|
||||
);
|
||||
console.log('加载数据', storage);
|
||||
const datas: GraphicData[] = [];
|
||||
generateAxleCountingConfig = storage.generateAxleCountingConfig;
|
||||
storage.links.forEach((link) => {
|
||||
datas.push(new LinkData(link));
|
||||
});
|
||||
@ -642,3 +647,15 @@ export async function loadDrawDatas(): Promise<IGraphicStorage> {
|
||||
datas: [],
|
||||
});
|
||||
}
|
||||
|
||||
//一键生成计轴配置
|
||||
let generateAxleCountingConfig = new graphicData.GenerateAxleCountingConfig();
|
||||
export function loadGenerateAxleCountingConfig() {
|
||||
return generateAxleCountingConfig;
|
||||
}
|
||||
|
||||
export function setGenerateAxleCountingConfig(
|
||||
newScreenDoorConfig: graphicData.GenerateAxleCountingConfig
|
||||
) {
|
||||
generateAxleCountingConfig = newScreenDoorConfig;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import { Turnout, TurnoutPort } from '../turnout/Turnout';
|
||||
import { IRelatedRefData, createRelatedRefProto } from '../CommonGraphics';
|
||||
import { Signal } from '../signal/Signal';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { loadGenerateAxleCountingConfig } from 'src/drawApp';
|
||||
|
||||
export interface IAxleCountingDrawOptions {
|
||||
newData: () => IAxleCountingData;
|
||||
@ -80,6 +81,21 @@ export class AxleCountingDraw extends GraphicDrawAssistant<
|
||||
refGraphic: Section | Turnout,
|
||||
refPort: TurnoutPort | SectionPort
|
||||
) {
|
||||
const generateAxleCountingConfig = loadGenerateAxleCountingConfig();
|
||||
if (generateAxleCountingConfig?.noGenerateGroup !== undefined) {
|
||||
const noGenerateGroup = generateAxleCountingConfig.noGenerateGroup;
|
||||
for (let i = 0; i < noGenerateGroup.length; i++) {
|
||||
if (
|
||||
noGenerateGroup[i] == graphic.id &&
|
||||
((i % 2 == 0 && refGraphic.id == noGenerateGroup[i + 1]) ||
|
||||
(i % 2 == 1 && refGraphic.id == noGenerateGroup[i - 1]))
|
||||
) {
|
||||
map.set(`${graphic.id}-${port}`, 1);
|
||||
map.set(`${refGraphic.id}-${refPort}`, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (
|
||||
graphic.type == 'Turnout' &&
|
||||
reftype == 'Turnout' &&
|
||||
|
@ -122,8 +122,11 @@
|
||||
|
||||
<q-drawer show-if-above bordered v-model="rightDrawerOpen" side="right">
|
||||
<q-resize-observer @resize="onRightResize" />
|
||||
<!-- drawer content -->
|
||||
<draw-properties></draw-properties>
|
||||
<axleCounting-config
|
||||
v-if="showGenerateAxleCountingConfig"
|
||||
@close="closeGenerateAxleCountingConfig"
|
||||
/>
|
||||
<draw-properties v-else></draw-properties>
|
||||
</q-drawer>
|
||||
|
||||
<q-page-container>
|
||||
@ -189,6 +192,7 @@ import {
|
||||
findContainDevice,
|
||||
handleCentralizedStationsData,
|
||||
} from 'src/graphics/concentrationDividingLine/ConcentrationDividingLineUtils';
|
||||
import AxleCountingConfig from 'src/components/draw-app/properties/AxleCountingConfig.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@ -358,10 +362,14 @@ function oneClickSeparator() {
|
||||
.getDrawAssistant(Separator.Type) as SeparatorDraw;
|
||||
separatorDraw.oneGenerates();
|
||||
}
|
||||
|
||||
const showGenerateAxleCountingConfig = ref(false);
|
||||
const closeGenerateAxleCountingConfig = () => {
|
||||
showGenerateAxleCountingConfig.value = false;
|
||||
};
|
||||
function oneClickAxleCounting() {
|
||||
//一键生成计轴
|
||||
drawStore.oneClickType = 'AxleCounting';
|
||||
drawStore.getDrawApp().interactionPlugin(OneClickGenerate.Type).resume();
|
||||
showGenerateAxleCountingConfig.value = true;
|
||||
}
|
||||
|
||||
function oneClickTurnoutSection() {
|
||||
|
@ -44,6 +44,13 @@
|
||||
lazy-rules
|
||||
:rules="[(val) => val >= 0 || '请选择线路ID!']"
|
||||
/>
|
||||
<q-select
|
||||
dense
|
||||
label="线路类型"
|
||||
v-model="filter.lineType"
|
||||
:options="searchOptionsLineType"
|
||||
style="width: 100px"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
v-model="filter.beginDateTime"
|
||||
@ -344,7 +351,11 @@ async function onRequest(props: any) {
|
||||
lineId: filter.value.lineId,
|
||||
});
|
||||
}
|
||||
|
||||
if (filter.value.lineType !== '全部') {
|
||||
Object.assign(params, {
|
||||
lineType: filter.value.lineType,
|
||||
});
|
||||
}
|
||||
if (filter.value.alertType !== '全部') {
|
||||
Object.assign(params, {
|
||||
alertType: (saveAlertTypeData as never)[filter.value.alertType],
|
||||
@ -436,6 +447,7 @@ function batchHandle() {
|
||||
const filter = ref({
|
||||
alertType: '全部',
|
||||
lineId: 0,
|
||||
lineType: '全部',
|
||||
beginDateTime: '',
|
||||
endDateTime: '',
|
||||
alertStatus: 999,
|
||||
@ -444,6 +456,7 @@ const filter = ref({
|
||||
const optionsLineId = ref<{ label: string; value: number }[]>([
|
||||
{ label: '全部', value: 0 },
|
||||
]);
|
||||
const searchOptionsLineType = ['全部', 'NCC', 'OCC'];
|
||||
async function queryLineInfo() {
|
||||
try {
|
||||
let response = await pageQuery({
|
||||
|
@ -27,13 +27,48 @@
|
||||
</q-td>
|
||||
</template>
|
||||
<template v-slot:top-right>
|
||||
<q-btn
|
||||
class="q-mr-md"
|
||||
color="primary"
|
||||
label="查询"
|
||||
@click="openSearchDialog"
|
||||
<q-form ref="myForm" @submit="searchDecisionInfo" style="width: 100%">
|
||||
<div class="q-gutter-md q-mt-none row justify-center items-start">
|
||||
<q-select
|
||||
dense
|
||||
v-model="filter.lineId"
|
||||
:options="searchOptionsLineId"
|
||||
emit-value
|
||||
map-options
|
||||
options-dense
|
||||
label="线路ID"
|
||||
style="width: 75px"
|
||||
no-error-icon
|
||||
lazy-rules
|
||||
:rules="[(val) => val >= 0 || '请选择线路ID!']"
|
||||
/>
|
||||
<q-btn color="primary" label="新建" @click="createFormShow = true" />
|
||||
<q-select
|
||||
dense
|
||||
label="线路类型"
|
||||
v-model="filter.lineType"
|
||||
:options="searchOptionsLineType"
|
||||
style="width: 100px"
|
||||
/>
|
||||
<q-select
|
||||
dense
|
||||
label="故障类型"
|
||||
v-model="filter.alertType"
|
||||
:options="searchOptionsAlertType"
|
||||
style="width: 130px"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
v-model="filter.areaConfigName"
|
||||
label="区域名称"
|
||||
></q-input>
|
||||
<q-btn color="primary" label="查询" type="submit" />
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="新建"
|
||||
@click="createFormShow = true"
|
||||
/>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<template v-slot:body-cell-operations="props">
|
||||
@ -134,38 +169,6 @@
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog
|
||||
v-model="searchDialog"
|
||||
persistent
|
||||
transition-show="scale"
|
||||
transition-hide="scale"
|
||||
>
|
||||
<q-card style="width: 300px">
|
||||
<q-card-section>
|
||||
<div class="text-h6">查询决策信息</div>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-select
|
||||
outlined
|
||||
label="故障类型"
|
||||
v-model="filter.alertType"
|
||||
:options="optionsAlertType"
|
||||
class="q-mb-md"
|
||||
/>
|
||||
<q-input
|
||||
outlined
|
||||
v-model="filter.areaConfigName"
|
||||
label="区域名称"
|
||||
></q-input>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn color="primary" label="确定" @click="searchDecisionInfo()" />
|
||||
<q-btn label="取消" v-close-popup />
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -287,16 +290,42 @@ const pagination = ref({
|
||||
rowsNumber: 10,
|
||||
});
|
||||
|
||||
const filter = ref({
|
||||
alertType: '全部',
|
||||
areaConfigName: '',
|
||||
lineId: 0,
|
||||
lineType: '全部',
|
||||
});
|
||||
|
||||
const onRequest: QTable['onRequest'] = async (props) => {
|
||||
const { page, rowsPerPage, sortBy, descending } = props.pagination;
|
||||
loading.value = true;
|
||||
try {
|
||||
let response = await alarmInfoPageQuery({
|
||||
const params = {
|
||||
current: page,
|
||||
size: rowsPerPage,
|
||||
};
|
||||
if (filter.value.lineId !== 0) {
|
||||
Object.assign(params, {
|
||||
lineId: filter.value.lineId,
|
||||
});
|
||||
}
|
||||
if (filter.value.lineType !== '全部') {
|
||||
Object.assign(params, {
|
||||
lineType: filter.value.lineType,
|
||||
});
|
||||
}
|
||||
if (filter.value.alertType !== '全部') {
|
||||
Object.assign(params, {
|
||||
alertType: (saveAlertTypeData as never)[filter.value.alertType],
|
||||
});
|
||||
}
|
||||
if (filter.value.areaConfigName) {
|
||||
Object.assign(params, {
|
||||
areaConfigName: filter.value.areaConfigName,
|
||||
});
|
||||
}
|
||||
let response = await alarmInfoPageQuery(params);
|
||||
const pageData = response;
|
||||
pagination.value.rowsNumber = pageData.total;
|
||||
pagination.value.page = page;
|
||||
@ -321,17 +350,7 @@ onMounted(() => {
|
||||
});
|
||||
});
|
||||
|
||||
const searchDialog = ref(false);
|
||||
const filter = ref({
|
||||
alertType: '',
|
||||
areaConfigName: '',
|
||||
});
|
||||
function openSearchDialog() {
|
||||
filter.value = { alertType: '', areaConfigName: '' };
|
||||
searchDialog.value = true;
|
||||
}
|
||||
function searchDecisionInfo() {
|
||||
searchDialog.value = false;
|
||||
tableRef.value.requestServerInteraction();
|
||||
}
|
||||
|
||||
@ -349,6 +368,9 @@ const creatForm = reactive({
|
||||
});
|
||||
|
||||
const optionsLineId = ref<{ label: string; value: number }[]>([]);
|
||||
const searchOptionsLineId = ref<{ label: string; value: number }[]>([
|
||||
{ label: '全部', value: 0 },
|
||||
]);
|
||||
async function queryLineInfo() {
|
||||
try {
|
||||
let response = await pageQuery({
|
||||
@ -357,6 +379,7 @@ async function queryLineInfo() {
|
||||
});
|
||||
response.records.forEach((info) => {
|
||||
optionsLineId.value.push({ label: info.name, value: info.lineId });
|
||||
searchOptionsLineId.value.push({ label: info.name, value: info.lineId });
|
||||
});
|
||||
} catch (err) {
|
||||
const error = err as ApiError;
|
||||
@ -367,6 +390,7 @@ async function queryLineInfo() {
|
||||
}
|
||||
}
|
||||
const optionsLineType = ['NCC', 'OCC'];
|
||||
const searchOptionsLineType = ['全部', ...optionsLineType];
|
||||
const optionsAlertType = [
|
||||
'蓝显',
|
||||
'全线蓝显',
|
||||
@ -388,6 +412,7 @@ const optionsAlertType = [
|
||||
'联锁区橙光带',
|
||||
'联锁区失表',
|
||||
];
|
||||
const searchOptionsAlertType = ['全部', ...optionsAlertType];
|
||||
let optionsLocationType = ref<string[]>([]);
|
||||
let optionsLocationList: AreaConfigItem[] = [];
|
||||
async function searchLocationType() {
|
||||
|
@ -21,7 +21,7 @@
|
||||
v-model="filter.name"
|
||||
label="名称"
|
||||
></q-input>
|
||||
<q-btn flat round color="primary" icon="search" />
|
||||
<q-btn flat round color="primary" icon="search" @click="searchQuery" />
|
||||
<q-btn color="primary" label="新建" @click="createFormShow = true" />
|
||||
</template>
|
||||
|
||||
@ -362,4 +362,7 @@ async function deleteData(row: any) {
|
||||
operateDisabled.value = false;
|
||||
});
|
||||
}
|
||||
function searchQuery() {
|
||||
tableRef.value.requestServerInteraction();
|
||||
}
|
||||
</script>
|
||||
|
@ -21,7 +21,7 @@
|
||||
v-model="filter.name"
|
||||
label="名称"
|
||||
></q-input>
|
||||
<q-btn flat round color="primary" icon="search" />
|
||||
<q-btn flat round color="primary" icon="search" @click="searchQuery" />
|
||||
<q-btn color="primary" label="新建" @click="createFormShow = true" />
|
||||
</template>
|
||||
|
||||
@ -267,4 +267,7 @@ function editData(row: any) {
|
||||
editInfo.config = row.config || '';
|
||||
createFormShow.value = true;
|
||||
}
|
||||
function searchQuery() {
|
||||
tableRef.value.requestServerInteraction();
|
||||
}
|
||||
</script>
|
||||
|
@ -11,7 +11,6 @@
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 20, 50, 100]"
|
||||
:loading="loading"
|
||||
:filter="filter"
|
||||
binary-state-sort
|
||||
@request="onRequest"
|
||||
>
|
||||
@ -104,13 +103,14 @@
|
||||
with-seconds
|
||||
>
|
||||
<div class="row items-center justify-end">
|
||||
<q-btn v-close-popup label="Close" color="primary" flat />
|
||||
<q-btn v-close-popup label="关闭" color="primary" flat />
|
||||
</div>
|
||||
</q-time>
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-btn flat round color="primary" icon="search" @click="searchQuery" />
|
||||
</template>
|
||||
<template v-slot:body-cell-subEventType="props">
|
||||
<q-td :props="props">
|
||||
@ -285,4 +285,8 @@ function getSubEventType(type: string) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function searchQuery() {
|
||||
tableRef.value.requestServerInteraction();
|
||||
}
|
||||
</script>
|
||||
|
@ -11,7 +11,6 @@
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 20, 50, 100]"
|
||||
:loading="loading"
|
||||
:filter="filter"
|
||||
binary-state-sort
|
||||
@request="onRequest"
|
||||
>
|
||||
@ -104,13 +103,14 @@
|
||||
with-seconds
|
||||
>
|
||||
<div class="row items-center justify-end">
|
||||
<q-btn v-close-popup label="Close" color="primary" flat />
|
||||
<q-btn v-close-popup label="关闭" color="primary" flat />
|
||||
</div>
|
||||
</q-time>
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-btn flat round color="primary" icon="search" @click="searchQuery" />
|
||||
</template>
|
||||
<template v-slot:body-cell-subEventType="props">
|
||||
<q-td :props="props">
|
||||
@ -269,6 +269,10 @@ async function onRequest(props: any) {
|
||||
}
|
||||
}
|
||||
|
||||
function searchQuery() {
|
||||
tableRef.value.requestServerInteraction();
|
||||
}
|
||||
|
||||
function getSubEventType(type: string) {
|
||||
switch (type) {
|
||||
case 'LOGIN':
|
||||
|
@ -21,7 +21,7 @@
|
||||
v-model="filter.name"
|
||||
label="名称"
|
||||
></q-input>
|
||||
<q-btn flat round color="primary" icon="search" />
|
||||
<q-btn flat round color="primary" icon="search" @click="searchQuery" />
|
||||
</template>
|
||||
|
||||
<template v-slot:body-cell-operations="props">
|
||||
@ -183,4 +183,7 @@ async function deleteData(row: any) {
|
||||
operateDisabled.value = false;
|
||||
});
|
||||
}
|
||||
function searchQuery() {
|
||||
tableRef.value.requestServerInteraction();
|
||||
}
|
||||
</script>
|
||||
|
@ -22,7 +22,7 @@
|
||||
v-model="filter.name"
|
||||
label="用户名"
|
||||
></q-input>
|
||||
<q-btn flat round color="primary" icon="search" />
|
||||
<q-btn flat round color="primary" icon="search" @click="searchQuery" />
|
||||
</template>
|
||||
<template v-slot:body-cell-roles="props">
|
||||
<q-td :props="props">
|
||||
@ -289,4 +289,8 @@ function onReset() {
|
||||
userInfo.Rids = [];
|
||||
myForm.value?.resetValidation();
|
||||
}
|
||||
|
||||
function searchQuery() {
|
||||
tableRef.value.requestServerInteraction();
|
||||
}
|
||||
</script>
|
||||
|
@ -28,6 +28,7 @@ export namespace graphicData {
|
||||
separators?: Separator[];
|
||||
logicSections?: LogicSection[];
|
||||
concentrationDividingLines?: ConcentrationDividingLine[];
|
||||
generateAxleCountingConfig?: GenerateAxleCountingConfig;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], this.#one_of_decls);
|
||||
@ -92,6 +93,9 @@ export namespace graphicData {
|
||||
if ("concentrationDividingLines" in data && data.concentrationDividingLines != undefined) {
|
||||
this.concentrationDividingLines = data.concentrationDividingLines;
|
||||
}
|
||||
if ("generateAxleCountingConfig" in data && data.generateAxleCountingConfig != undefined) {
|
||||
this.generateAxleCountingConfig = data.generateAxleCountingConfig;
|
||||
}
|
||||
}
|
||||
}
|
||||
get canvas() {
|
||||
@ -217,6 +221,15 @@ export namespace graphicData {
|
||||
set concentrationDividingLines(value: ConcentrationDividingLine[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 20, value);
|
||||
}
|
||||
get generateAxleCountingConfig() {
|
||||
return pb_1.Message.getWrapperField(this, GenerateAxleCountingConfig, 21) as GenerateAxleCountingConfig;
|
||||
}
|
||||
set generateAxleCountingConfig(value: GenerateAxleCountingConfig) {
|
||||
pb_1.Message.setWrapperField(this, 21, value);
|
||||
}
|
||||
get has_generateAxleCountingConfig() {
|
||||
return pb_1.Message.getField(this, 21) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
canvas?: ReturnType<typeof Canvas.prototype.toObject>;
|
||||
links?: ReturnType<typeof Link.prototype.toObject>[];
|
||||
@ -238,6 +251,7 @@ export namespace graphicData {
|
||||
separators?: ReturnType<typeof Separator.prototype.toObject>[];
|
||||
logicSections?: ReturnType<typeof LogicSection.prototype.toObject>[];
|
||||
concentrationDividingLines?: ReturnType<typeof ConcentrationDividingLine.prototype.toObject>[];
|
||||
generateAxleCountingConfig?: ReturnType<typeof GenerateAxleCountingConfig.prototype.toObject>;
|
||||
}): RtssGraphicStorage {
|
||||
const message = new RtssGraphicStorage({});
|
||||
if (data.canvas != null) {
|
||||
@ -300,6 +314,9 @@ export namespace graphicData {
|
||||
if (data.concentrationDividingLines != null) {
|
||||
message.concentrationDividingLines = data.concentrationDividingLines.map(item => ConcentrationDividingLine.fromObject(item));
|
||||
}
|
||||
if (data.generateAxleCountingConfig != null) {
|
||||
message.generateAxleCountingConfig = GenerateAxleCountingConfig.fromObject(data.generateAxleCountingConfig);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -324,6 +341,7 @@ export namespace graphicData {
|
||||
separators?: ReturnType<typeof Separator.prototype.toObject>[];
|
||||
logicSections?: ReturnType<typeof LogicSection.prototype.toObject>[];
|
||||
concentrationDividingLines?: ReturnType<typeof ConcentrationDividingLine.prototype.toObject>[];
|
||||
generateAxleCountingConfig?: ReturnType<typeof GenerateAxleCountingConfig.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.canvas != null) {
|
||||
data.canvas = this.canvas.toObject();
|
||||
@ -385,6 +403,9 @@ export namespace graphicData {
|
||||
if (this.concentrationDividingLines != null) {
|
||||
data.concentrationDividingLines = this.concentrationDividingLines.map((item: ConcentrationDividingLine) => item.toObject());
|
||||
}
|
||||
if (this.generateAxleCountingConfig != null) {
|
||||
data.generateAxleCountingConfig = this.generateAxleCountingConfig.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -431,6 +452,8 @@ export namespace graphicData {
|
||||
writer.writeRepeatedMessage(19, this.logicSections, (item: LogicSection) => item.serialize(writer));
|
||||
if (this.concentrationDividingLines.length)
|
||||
writer.writeRepeatedMessage(20, this.concentrationDividingLines, (item: ConcentrationDividingLine) => item.serialize(writer));
|
||||
if (this.has_generateAxleCountingConfig)
|
||||
writer.writeMessage(21, this.generateAxleCountingConfig, () => this.generateAxleCountingConfig.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -500,6 +523,9 @@ export namespace graphicData {
|
||||
case 20:
|
||||
reader.readMessage(message.concentrationDividingLines, () => pb_1.Message.addToRepeatedWrapperField(message, 20, ConcentrationDividingLine.deserialize(reader), ConcentrationDividingLine));
|
||||
break;
|
||||
case 21:
|
||||
reader.readMessage(message.generateAxleCountingConfig, () => message.generateAxleCountingConfig = GenerateAxleCountingConfig.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
@ -5241,4 +5267,94 @@ export namespace graphicData {
|
||||
return Separator.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class GenerateAxleCountingConfig extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
bbConnect?: number[];
|
||||
noGenerateGroup?: number[];
|
||||
}) {
|
||||
super();
|
||||
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 ("bbConnect" in data && data.bbConnect != undefined) {
|
||||
this.bbConnect = data.bbConnect;
|
||||
}
|
||||
if ("noGenerateGroup" in data && data.noGenerateGroup != undefined) {
|
||||
this.noGenerateGroup = data.noGenerateGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bbConnect() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, []) as number[];
|
||||
}
|
||||
set bbConnect(value: number[]) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get noGenerateGroup() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, []) as number[];
|
||||
}
|
||||
set noGenerateGroup(value: number[]) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
bbConnect?: number[];
|
||||
noGenerateGroup?: number[];
|
||||
}): GenerateAxleCountingConfig {
|
||||
const message = new GenerateAxleCountingConfig({});
|
||||
if (data.bbConnect != null) {
|
||||
message.bbConnect = data.bbConnect;
|
||||
}
|
||||
if (data.noGenerateGroup != null) {
|
||||
message.noGenerateGroup = data.noGenerateGroup;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
bbConnect?: number[];
|
||||
noGenerateGroup?: number[];
|
||||
} = {};
|
||||
if (this.bbConnect != null) {
|
||||
data.bbConnect = this.bbConnect;
|
||||
}
|
||||
if (this.noGenerateGroup != null) {
|
||||
data.noGenerateGroup = this.noGenerateGroup;
|
||||
}
|
||||
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.bbConnect.length)
|
||||
writer.writePackedUint32(1, this.bbConnect);
|
||||
if (this.noGenerateGroup.length)
|
||||
writer.writePackedUint32(2, this.noGenerateGroup);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenerateAxleCountingConfig {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenerateAxleCountingConfig();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.bbConnect = reader.readPackedUint32();
|
||||
break;
|
||||
case 2:
|
||||
message.noGenerateGroup = reader.readPackedUint32();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): GenerateAxleCountingConfig {
|
||||
return GenerateAxleCountingConfig.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 4f9012b0795f62bf352b078ebbc1b1fffa86849d
|
||||
Subproject commit 91cfbc3ee5574419615ae177661239cdc0d7d53e
|
Loading…
Reference in New Issue
Block a user