|
@@ -9,6 +9,8 @@
|
|
<div class="row justify-xs-center justify-sm-start items-center">
|
|
<div class="row justify-xs-center justify-sm-start items-center">
|
|
|
|
|
|
<div class="col-auto" >
|
|
<div class="col-auto" >
|
|
|
|
+ <div class="row items-center justify-center">
|
|
|
|
+ <div class="text-right"> space </div>
|
|
<q-select
|
|
<q-select
|
|
v-model="localUnits"
|
|
v-model="localUnits"
|
|
:options="unitsOptions"
|
|
:options="unitsOptions"
|
|
@@ -20,20 +22,26 @@
|
|
behavior="menu"
|
|
behavior="menu"
|
|
>
|
|
>
|
|
</q-select>
|
|
</q-select>
|
|
|
|
+ <div/>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-auto" >
|
|
<div class="col-auto" >
|
|
- <div class="row q-py-xs q-px-md items-center justify-center">
|
|
|
|
- <div class="q-pr-xs"> Source units </div>
|
|
|
|
|
|
+ <div class="row items-center justify-center">
|
|
|
|
+ <div class="text-right"> and source </div>
|
|
|
|
|
|
<q-select
|
|
<q-select
|
|
v-model="localSourceUnits"
|
|
v-model="localSourceUnits"
|
|
:options="sourceUnitsOptions"
|
|
:options="sourceUnitsOptions"
|
|
|
|
+ style="width:7em"
|
|
|
|
+ class="q-pa-xs"
|
|
|
|
+ :class="{'q-field--disabled': isSourceSameUnits}"
|
|
outlined
|
|
outlined
|
|
dense
|
|
dense
|
|
options-dense
|
|
options-dense
|
|
option-value="label"
|
|
option-value="label"
|
|
option-label="label"
|
|
option-label="label"
|
|
|
|
+ behavior="menu"
|
|
>
|
|
>
|
|
<template #option="scope">
|
|
<template #option="scope">
|
|
<q-item :label="scope.opt.title" dense>
|
|
<q-item :label="scope.opt.title" dense>
|
|
@@ -50,7 +58,7 @@
|
|
</q-select>
|
|
</q-select>
|
|
|
|
|
|
|
|
|
|
- <div class="row q-py-xs items-center">
|
|
|
|
|
|
+ <div class="row q-py-xs q-px-xs items-center">
|
|
<q-checkbox v-model="isSourceSameUnits" size="sm"/>
|
|
<q-checkbox v-model="isSourceSameUnits" size="sm"/>
|
|
<div>same</div>
|
|
<div>same</div>
|
|
</div>
|
|
</div>
|
|
@@ -70,6 +78,7 @@
|
|
import {
|
|
import {
|
|
defineComponent,
|
|
defineComponent,
|
|
computed,
|
|
computed,
|
|
|
|
+ watch
|
|
} from 'vue'
|
|
} from 'vue'
|
|
import { useStore } from 'src/store'
|
|
import { useStore } from 'src/store'
|
|
import { flexRowTitleStyle } from 'components/utils'
|
|
import { flexRowTitleStyle } from 'components/utils'
|
|
@@ -80,10 +89,10 @@ export default defineComponent({
|
|
components: {},
|
|
components: {},
|
|
|
|
|
|
setup() {
|
|
setup() {
|
|
- const unitsOptions = [ 'nm', 'mkm', 'mm', 'cm', 'm', 'km' ]
|
|
|
|
|
|
+ const unitsOptions = [ 'nm', 'mkm', 'mm', 'cm', 'm']
|
|
const sourceUnitsOptions = [
|
|
const sourceUnitsOptions = [
|
|
{ title: 'Frequency',
|
|
{ title: 'Frequency',
|
|
- children: [{label: 'Hz'},{label: 'kHz'},{label: 'MHz'},{label: 'GHz'},{label: 'THz'}]},
|
|
|
|
|
|
+ children: [{label: 'MHz'},{label: 'GHz'},{label: 'THz'}]},
|
|
{ title: 'Energy',
|
|
{ title: 'Energy',
|
|
children: [{label: 'meV'}, {label: 'eV'}]},
|
|
children: [{label: 'meV'}, {label: 'eV'}]},
|
|
{ title: 'Period duration',
|
|
{ title: 'Period duration',
|
|
@@ -96,6 +105,7 @@ export default defineComponent({
|
|
set: val => $store.commit('guiRuntime/setIsSourceSameUnits', val)
|
|
set: val => $store.commit('guiRuntime/setIsSourceSameUnits', val)
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+
|
|
const localUnits = computed({
|
|
const localUnits = computed({
|
|
get: () => $store.state.guiRuntime.units,
|
|
get: () => $store.state.guiRuntime.units,
|
|
set: val => $store.commit('guiRuntime/setUnits', val)
|
|
set: val => $store.commit('guiRuntime/setUnits', val)
|
|
@@ -106,6 +116,16 @@ export default defineComponent({
|
|
set: val => $store.commit('guiRuntime/setSourceUnits', val.label)
|
|
set: val => $store.commit('guiRuntime/setSourceUnits', val.label)
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ watch(isSourceSameUnits, ()=>{
|
|
|
|
+ if (isSourceSameUnits.value) $store.commit('guiRuntime/setSourceUnits',localUnits.value)
|
|
|
|
+ else $store.commit('guiRuntime/setSourceUnits','THz')
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ watch(localUnits, ()=>{
|
|
|
|
+ if (isSourceSameUnits.value) $store.commit('guiRuntime/setSourceUnits',localUnits.value)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
return { isSourceSameUnits, flexRowTitleStyle,
|
|
return { isSourceSameUnits, flexRowTitleStyle,
|
|
unitsOptions, localUnits,
|
|
unitsOptions, localUnits,
|
|
localSourceUnits, sourceUnitsOptions }
|
|
localSourceUnits, sourceUnitsOptions }
|