Commit 099ab666be4e527fed85829ac9b60b57e00cc075
1 parent
c63ac5d2
feat: visual board can not select visual component
Showing
4 changed files
with
28 additions
and
6 deletions
| 1 | 1 | <script lang="ts" setup> |
| 2 | - import { RadioRecord } from '../../detail/config/util'; | |
| 2 | + import { computed } from '@vue/reactivity'; | |
| 3 | + import { DEFAULT_RADIO_RECORD, fontSize, RadioRecord } from '../../detail/config/util'; | |
| 3 | 4 | |
| 4 | 5 | const props = defineProps<{ |
| 5 | 6 | value?: boolean; |
| ... | ... | @@ -14,10 +15,20 @@ |
| 14 | 15 | emit('update:value', _value); |
| 15 | 16 | emit('change', _value); |
| 16 | 17 | }; |
| 18 | + | |
| 19 | + const getRadio = computed(() => { | |
| 20 | + return props.radio! || DEFAULT_RADIO_RECORD; | |
| 21 | + }); | |
| 17 | 22 | </script> |
| 18 | 23 | |
| 19 | 24 | <template> |
| 20 | - <div class="toggle-switch"> | |
| 25 | + <div | |
| 26 | + class="toggle-switch" | |
| 27 | + :style="{ | |
| 28 | + width: fontSize({ radioRecord: getRadio, basic: 75, max: 75, min: 60 }), | |
| 29 | + height: fontSize({ radioRecord: getRadio, basic: 97.5, max: 97.5, min: 80 }), | |
| 30 | + }" | |
| 31 | + > | |
| 21 | 32 | <label class="switch"> |
| 22 | 33 | <input :value="props.value" type="checkbox" :checked="props.value" @change="handleChange" /> |
| 23 | 34 | <div class="button"> |
| ... | ... | @@ -33,9 +44,10 @@ |
| 33 | 44 | |
| 34 | 45 | <style scoped> |
| 35 | 46 | .toggle-switch { |
| 36 | - flex: 1 1 auto; | |
| 47 | + /* flex: 1 1 auto; */ | |
| 37 | 48 | max-width: 75px; |
| 38 | - height: 97.5px; | |
| 49 | + | |
| 50 | + /* height: 97.5px; */ | |
| 39 | 51 | display: flex; |
| 40 | 52 | } |
| 41 | 53 | ... | ... |
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | <section class="widget"> |
| 19 | 19 | <slot name="header"></slot> |
| 20 | 20 | |
| 21 | - <div class="widget-content" :style="{ height: slot.header ? 'calc(100% - 22px)' : '100%' }"> | |
| 21 | + <div class="widget-content"> | |
| 22 | 22 | <div |
| 23 | 23 | v-for="item in props.dataSource" |
| 24 | 24 | :key="item.id" | ... | ... |
| ... | ... | @@ -28,6 +28,7 @@ import ToggleSwitch from './ControlComponent/ToggleSwitch.vue'; |
| 28 | 28 | import SlidingSwitch from './ControlComponent/SlidingSwitch.vue'; |
| 29 | 29 | import SwitchWithIcon from './ControlComponent/SwitchWithIcon.vue'; |
| 30 | 30 | import MapComponent from './MapComponent/MapComponent.vue'; |
| 31 | +import { transfromMapComponentConfig } from './MapComponent/map.config'; | |
| 31 | 32 | |
| 32 | 33 | export enum FrontComponentCategory { |
| 33 | 34 | TEXT = 'text', |
| ... | ... | @@ -170,7 +171,7 @@ frontComponentMap.set(FrontComponent.MAP_COMPONENT_TRACK, { |
| 170 | 171 | Component: MapComponent, |
| 171 | 172 | ComponentKey: FrontComponent.MAP_COMPONENT_TRACK, |
| 172 | 173 | ComponentCategory: FrontComponentCategory.MAP, |
| 173 | - transformConfig: () => {}, | |
| 174 | + transformConfig: transfromMapComponentConfig, | |
| 174 | 175 | }); |
| 175 | 176 | |
| 176 | 177 | frontComponentDefaultConfigMap.set(FrontComponent.TEXT_COMPONENT_1, TextComponentDefaultConfig); | ... | ... |