1- import { defineComponent , PropType } from "vue" ;
1+ import { computed , defineComponent , PropType } from "vue" ;
22import { Popover , Radio } from "@munet/ui" ;
33import { ShiftMethod } from "@/client/apiGen" ;
44import { TempOptions } from "./types" ;
@@ -11,29 +11,34 @@ export default defineComponent({
1111 setup ( props ) {
1212 const { t} = useI18n ( ) ;
1313
14+ const value = computed ( {
15+ get : ( ) => props . tempOptions . shift ,
16+ set : ( v : ShiftMethod ) => { if ( ! props . tempOptions . shiftLocked ) props . tempOptions . shift = v }
17+ } )
18+
1419 return ( ) => < div >
1520 < div class = "ml-1 text-sm" > { t ( 'chart.import.option.shiftMode' ) } </ div >
1621 < div class = "flex flex-col gap-2 w-full" >
1722 < div class = "flex gap-2 h-34px items-center" >
1823 < Popover trigger = "hover" >
1924 { {
20- trigger : ( ) => < Radio value = { ShiftMethod . Bar } checked = { props . tempOptions . shift === ShiftMethod . Bar } onUpdate : checked = { ( ) => { if ( ! props . tempOptions . shiftLocked ) props . tempOptions . shift = ShiftMethod . Bar } } > { t ( 'chart.import.option.shiftByBar' ) } </ Radio > ,
25+ trigger : ( ) => < Radio k = { ShiftMethod . Bar } v-model : value = { value . value } > { t ( 'chart.import.option.shiftByBar' ) } </ Radio > ,
2126 default : ( ) => < div >
2227 { props . tempOptions . shiftLocked ? t ( 'chart.import.option.shiftModeLocked' ) : t ( 'chart.import.option.shiftByBarDesc' ) }
2328 </ div >
2429 } }
2530 </ Popover >
2631 < Popover trigger = "hover" >
2732 { {
28- trigger : ( ) => < Radio value = { ShiftMethod . Legacy } checked = { props . tempOptions . shift === ShiftMethod . Legacy } onUpdate : checked = { ( ) => { if ( ! props . tempOptions . shiftLocked ) props . tempOptions . shift = ShiftMethod . Legacy } } > { t ( 'chart.import.option.shiftLegacy' ) } </ Radio > ,
33+ trigger : ( ) => < Radio k = { ShiftMethod . Legacy } v-model : value = { value . value } > { t ( 'chart.import.option.shiftLegacy' ) } </ Radio > ,
2934 default : ( ) => < div >
3035 { props . tempOptions . shiftLocked ? t ( 'chart.import.option.shiftModeLocked' ) : t ( 'chart.import.option.shiftLegacyDesc' ) }
3136 </ div >
3237 } }
3338 </ Popover >
3439 < Popover trigger = "hover" >
3540 { {
36- trigger : ( ) => < Radio value = { ShiftMethod . NoShift } checked = { props . tempOptions . shift === ShiftMethod . NoShift } onUpdate : checked = { ( ) => { if ( ! props . tempOptions . shiftLocked ) props . tempOptions . shift = ShiftMethod . NoShift } } > { t ( 'chart.import.option.shiftNoMove' ) } </ Radio > ,
41+ trigger : ( ) => < Radio k = { ShiftMethod . NoShift } v-model : value = { value . value } > { t ( 'chart.import.option.shiftNoMove' ) } </ Radio > ,
3742 default : ( ) => < div >
3843 { props . tempOptions . shiftLocked ? t ( 'chart.import.option.shiftModeLocked' ) : t ( 'chart.import.option.shiftNoMoveDesc' ) }
3944 </ div >
0 commit comments