2024-10-29 02:33:39 +01:00
|
|
|
import { defineComponent, ref, computed, PropType, toRef } from 'vue'
|
|
|
|
|
import { IOperators } from 'model'
|
|
|
|
|
|
|
|
|
|
import { useI18n } from '@/boot/i18n'
|
|
|
|
|
import { useQuasar } from 'quasar'
|
|
|
|
|
|
|
|
|
|
import { shared_consts } from '@/common/shared_vuejs'
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'CMySlider',
|
|
|
|
|
props: {
|
|
|
|
|
modelValue: {
|
|
|
|
|
type: [String, Number],
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
label: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
min: {
|
|
|
|
|
type: Number,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
max: {
|
|
|
|
|
type: Number,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
addstr: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
|
|
|
|
color: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: false,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
2024-11-02 18:06:27 +01:00
|
|
|
disable: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: false,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
2024-10-29 02:33:39 +01:00
|
|
|
},
|
|
|
|
|
setup(props, { emit }) {
|
|
|
|
|
const $q = useQuasar()
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const sliderValue = computed({
|
|
|
|
|
get: () => {
|
|
|
|
|
let mystr = props.modelValue + ''
|
|
|
|
|
return mystr.replace(props.addstr, '')
|
|
|
|
|
},
|
|
|
|
|
set: (value) => emit('update:modelValue', value + props.addstr)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
t,
|
|
|
|
|
shared_consts,
|
|
|
|
|
sliderValue,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|