refactor(stores): rename

This commit is contained in:
yangsy
2025-11-19 11:59:31 +08:00
parent df3888d8b5
commit 2f06054e66
3 changed files with 6 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ const route = useRoute();
const show = defineModel<boolean>('show');
const layoutStore = useLayoutStore();
const { stationLayoutGridCols } = storeToRefs(layoutStore);
const { stationGridColumns } = storeToRefs(layoutStore);
const queryControlStore = useQueryControlStore();
const { stationVerifyMode } = storeToRefs(queryControlStore);
@@ -76,7 +76,7 @@ useEventListener('keydown', (event) => {
<template v-if="route.path === '/station'">
<NDivider>布局</NDivider>
<NFormItem label="车站列数" label-placement="left">
<NInputNumber v-model:value="stationLayoutGridCols" :min="1" :max="10" />
<NInputNumber v-model:value="stationGridColumns" :min="1" :max="10" />
</NFormItem>
</template>
<template v-if="debugEnabled">

View File

@@ -24,7 +24,7 @@ const { lineAlarmCounts } = storeToRefs(lineAlarmsStore);
const { error: lineDevicesQueryError } = useLineDevicesQuery();
const { error: lineAlarmsQueryError } = useLineAlarmsQuery();
const layoutStore = useLayoutStore();
const { stationLayoutGridCols } = storeToRefs(layoutStore);
const { stationGridColumns } = storeToRefs(layoutStore);
watch([lineDevicesQueryError, lineAlarmsQueryError], ([newLineDevicesQueryError, newLineAlarmsQueryError]) => {
if (newLineDevicesQueryError) {
@@ -54,7 +54,7 @@ const openDeviceParamsConfigModal = (station: Station) => {
</script>
<template>
<NGrid :cols="stationLayoutGridCols" :x-gap="6" :y-gap="6" style="padding: 8px">
<NGrid :cols="stationGridColumns" :x-gap="6" :y-gap="6" style="padding: 8px">
<NGi v-for="station in stationList" :key="station.code">
<StationCard
:station="station"

View File

@@ -4,10 +4,10 @@ import { ref } from 'vue';
export const useLayoutStore = defineStore(
'ndm-layout-store',
() => {
const stationLayoutGridCols = ref(8);
const stationGridColumns = ref(6);
return {
stationLayoutGridCols,
stationGridColumns,
};
},
{