修改组件中hooks和store的调用方式

This commit is contained in:
wzy-warehouse
2026-05-07 12:53:25 +08:00
parent 2ab1b7da7c
commit 68715dea2b
32 changed files with 350 additions and 261 deletions
@@ -6,15 +6,15 @@
type="primary"
@click="changeStatus"
circle
:title="`${useStatusStore().uiComponents.disasterChainPointShow.show ? '关闭' : '打开'}灾害链影响点列表`"
:title="`${useStatus.uiComponents.disasterChainPointShow.show ? '关闭' : '打开'}灾害链影响点列表`"
>{{
useStatusStore().uiComponents.disasterChainPointShow.show ? '-' : '+'
useStatus.uiComponents.disasterChainPointShow.show ? '-' : '+'
}}</el-button
>
</div>
<div
class="disaster-list-box"
v-show="useStatusStore().uiComponents.disasterChainPointShow.show"
v-show="useStatus.uiComponents.disasterChainPointShow.show"
>
<header class="table-title">
<span>灾害链影响点列表</span>
@@ -84,6 +84,8 @@
import type { PaginationType } from '@/types/common/PaginationType';
import { ref, watch, computed, type Ref } from 'vue';
const useStatus = useStatusStore();
// 接收父组件的参数
const props = defineProps<{
selectOptions: { label: string; value: PointType }[];
@@ -124,8 +126,8 @@
// 切换面板显示状态
const changeStatus = () => {
useStatusStore().uiComponents.disasterChainPointShow.show =
!useStatusStore().uiComponents.disasterChainPointShow.show;
useStatus.uiComponents.disasterChainPointShow.show =
!useStatus.uiComponents.disasterChainPointShow.show;
};
// 上一页