wangrong
2026-08-30 4c949c0dc9bcae785c281c9d8125295f09810b15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<template>
  <div class="bar-main">
    <el-checkbox v-model="checked" @change="checkChange" />
  </div>
</template>
 
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { useViewSelectorStoreWithOut } from '@/store/modules/data-visualization/viewSelector'
const viewSelectorStore = useViewSelectorStoreWithOut()
 
const checked = ref(false)
 
const props = defineProps({
  resourceId: {
    type: String,
    required: false
  }
})
onMounted(() => {
  checked.value = viewSelectorStore.getViewIdList.includes(props.resourceId)
})
 
const checkChange = val => {
  if (val) {
    viewSelectorStore.add(props.resourceId)
  } else {
    viewSelectorStore.remove(props.resourceId)
  }
}
</script>
 
<style lang="less" scoped>
.bar-main {
  position: absolute;
  float: right;
  right: 10px;
  z-index: 10;
  border-radius: 2px;
  cursor: pointer !important;
  font-size: 16px !important;
}
</style>