refactor(stores): rename
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user