---修改输入数字组件bug
1、调整日期范围组件为不可修改
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<a-range-picker :size="size" v-model:value="modelValue" :placeholder="placeholder" :allowClear="allowClear" :disabled="disabled"
|
||||
@input.stop="() => {}" @keydown.stop="() => {}" :inputReadOnly="true" @keyup.stop="() => {}" @change.stop="handleChange" />
|
||||
:inputReadOnly="true" @change="handleChange" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, watchEffect, inject, watch } from 'vue';
|
||||
@ -31,7 +31,6 @@ import dayjs, { Dayjs } from 'dayjs';
|
||||
watch(
|
||||
() => props.value,
|
||||
(val: any) => {
|
||||
debugger;
|
||||
modelValue.value = props.valueType == 'Array' ? val || [] : val ? val.split(',') : '';
|
||||
},
|
||||
{
|
||||
@ -44,7 +43,6 @@ import dayjs, { Dayjs } from 'dayjs';
|
||||
// emit('update:value', []);
|
||||
// return;
|
||||
// }
|
||||
debugger;
|
||||
if (props.mainKey) {
|
||||
if (!formModel[props.mainKey]) return;
|
||||
const emitData =
|
||||
@ -60,7 +58,6 @@ import dayjs, { Dayjs } from 'dayjs';
|
||||
}
|
||||
});
|
||||
const handleChange = (time,e) => {
|
||||
debugger;
|
||||
console.log(time,e);
|
||||
emit('update:value', props.valueType == 'Array' || !time ? time : time.join(','));
|
||||
emit('change', props.valueType == 'Array' || !time ? time : time.join(','));
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import { NoValueType } from "@grapecity/activereports/core";
|
||||
|
||||
declare type ValueType = string | number | undefined;
|
||||
|
||||
|
||||
@ -45,7 +43,7 @@ export class InputNumberModel {
|
||||
}
|
||||
|
||||
viewToModel(vv: ValueType):ValueType {
|
||||
if(vv===undefined || vv=="" || vv=="-") return;
|
||||
if(vv===undefined || vv==="" || vv==="-") return;
|
||||
if(!this.focus){
|
||||
this.viewValue = Number.format(Number.parse(vv),this.numberFormat);
|
||||
}
|
||||
|
||||
@ -83,6 +83,9 @@ export default {
|
||||
() => props.value,
|
||||
(val) => {
|
||||
model.value.setModelValue(val);
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
const handleChange = (e) => {
|
||||
|
||||
Reference in New Issue
Block a user