riku
2025-03-07 2592dc279ec82bf3649a4dbe644c6416263a10ef
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<template>
  <el-row class="wrap">
    <el-col span="2">
      <el-row>
        <CardButton
          name="网格样式"
          direction="left"
          @click="() => (show = !show)"
        ></CardButton>
      </el-row>
    </el-col>
    <el-col span="2">
      <BaseCard v-show="show" direction="right" borderless="r">
        <template #content>
          <div class="content-wrap">
            <div v-for="(g, i) in gridStore.gridClzList" :key="i">
              <div>
                <el-text>g.name</el-text>
              </div>
              <el-row>
                <el-text>网格</el-text>
                <el-switch
                  v-model="gridVisible"
                  width="60"
                  inline-prompt
                  active-text="显示"
                  inactive-text="隐藏"
                />
              </el-row>
            </div>
          </div>
        </template>
      </BaseCard>
    </el-col>
  </el-row>
</template>
<script setup>
/**
 * 网格样式控制工具
 */
import { ref } from 'vue';
import { useGridStore } from '@/stores/grid-info';
 
const gridStore = useGridStore();
 
const show = ref(true);
 
const gridVisible = ref(false);
const rankVisible = ref(false);
const dataVisible = ref(false);
const isStandardColor = ref(true);
const isOpacity = ref(false);
const opacityValue = ref(0.7);
 
const emits = defineEmits([
  'showRank',
  'showData',
  'changeColor',
  'changeOpacity'
]);
 
function handleRankClick() {
  rankVisible.value = !rankVisible.value;
  emits('showRank', rankVisible.value);
}
 
function handleDataClick() {
  dataVisible.value = !dataVisible.value;
  emits('showData', dataVisible.value);
}
 
function handleColorClick() {
  isStandardColor.value = !isStandardColor.value;
  emits('changeColor', isStandardColor.value);
}
 
function handleOpacityClick() {
  // isOpacity.value = !isOpacity.value;
  // emits('changeOpacity', isOpacity.value);
}
 
function handleOpacityChange(value) {
  emits('changeOpacity', value);
}
</script>
<style scoped>
.content-wrap {
  min-width: 300px;
  min-height: 600px;
}
</style>