|
|
@ -81,7 +81,9 @@ |
|
|
v-model="inputValue" |
|
|
v-model="inputValue" |
|
|
type="datetimerange" |
|
|
type="datetimerange" |
|
|
range-separator="至" |
|
|
range-separator="至" |
|
|
|
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" |
|
|
:picker-options="pickerOptions" |
|
|
:picker-options="pickerOptions" |
|
|
|
|
|
@change="(val) => onDateChange(val, 'yyyy/MM/DD HH:mm:ss')" |
|
|
start-placeholder="开始日期" |
|
|
start-placeholder="开始日期" |
|
|
end-placeholder="结束日期"> |
|
|
end-placeholder="结束日期"> |
|
|
</el-date-picker> |
|
|
</el-date-picker> |
|
|
@ -300,6 +302,7 @@ export default { |
|
|
const defaultCheckedValue = getDefaultValueByOptions(this.item.options || []); |
|
|
const defaultCheckedValue = getDefaultValueByOptions(this.item.options || []); |
|
|
initialValue = { checkedValues: defaultCheckedValue, otherValues: {} }; |
|
|
initialValue = { checkedValues: defaultCheckedValue, otherValues: {} }; |
|
|
} |
|
|
} |
|
|
|
|
|
const {type} = this; |
|
|
return { |
|
|
return { |
|
|
inputValue: initialValue, |
|
|
inputValue: initialValue, |
|
|
oldValue: typeof initialValue === 'object' ? JSON.parse(JSON.stringify(initialValue)) : initialValue, // 记录上一次的值 |
|
|
oldValue: typeof initialValue === 'object' ? JSON.parse(JSON.stringify(initialValue)) : initialValue, // 记录上一次的值 |
|
|
@ -335,7 +338,7 @@ export default { |
|
|
disabledDate(time) { |
|
|
disabledDate(time) { |
|
|
return time.getTime() > Date.now(); |
|
|
return time.getTime() > Date.now(); |
|
|
}, |
|
|
}, |
|
|
shortcuts: [{ |
|
|
|
|
|
|
|
|
shortcuts: type === 'dateTimeRange' ? undefined:[{ |
|
|
text: '今天', |
|
|
text: '今天', |
|
|
onClick(picker) { |
|
|
onClick(picker) { |
|
|
picker.$emit('pick', new Date()); |
|
|
picker.$emit('pick', new Date()); |
|
|
@ -657,7 +660,11 @@ export default { |
|
|
this.onCommonHandleSaveRecord(this.inputValue); |
|
|
this.onCommonHandleSaveRecord(this.inputValue); |
|
|
}, |
|
|
}, |
|
|
onDateChange(val, format) { |
|
|
onDateChange(val, format) { |
|
|
this.inputValue = moment(val).format(format); |
|
|
|
|
|
|
|
|
if (this.type === 'dateTimeRange') { |
|
|
|
|
|
this.inputValue = [moment(val[0]).format(format), moment(val[1]).format(format)]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.inputValue = moment(val).format(format); |
|
|
|
|
|
} |
|
|
this.onCommonHandleSaveRecord(this.inputValue); |
|
|
this.onCommonHandleSaveRecord(this.inputValue); |
|
|
}, |
|
|
}, |
|
|
getUserName(record) { |
|
|
getUserName(record) { |
|
|
|