Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangjiahao 2022-08-02 11:54:43 +08:00
commit 74a6ec51a2
2 changed files with 36 additions and 4 deletions

View File

@ -104,7 +104,7 @@ public class ViewExportExcel {
Object val = row.get(key);
if (ObjectUtils.isEmpty(val))
return StringUtils.EMPTY;
return val.toString();
return filterInvalidDecimal(val.toString());
}).collect(Collectors.toList())).collect(Collectors.toList());
result.setHeads(heads);
result.setDatas(details);
@ -112,4 +112,12 @@ public class ViewExportExcel {
result.setSheetName(title);
return result;
}
private String filterInvalidDecimal(String sourceNumberStr) {
if (StringUtils.isNotBlank(sourceNumberStr) && StringUtils.contains(sourceNumberStr, ".")) {
sourceNumberStr = sourceNumberStr.replaceAll("0+?$", "");
sourceNumberStr = sourceNumberStr.replaceAll("[.]$", "");
}
return sourceNumberStr;
}
}

View File

@ -1,9 +1,9 @@
<template>
<el-date-picker
v-if="element.options!== null && element.options.attrs!==null"
v-if="element.options!== null && element.options.attrs!==null && show"
ref="dateRef"
v-model="values"
popper-class="coustom-date-picker"
:popper-class="'coustom-date-picker' + ' ' + extPoperClass"
:type="componentType"
:range-separator="$t(element.options.attrs.rangeSeparator)"
:start-placeholder="$t(element.options.attrs.startPlaceholder)"
@ -56,10 +56,17 @@ export default {
return {
operator: 'between',
values: null,
onFocus: false
onFocus: false,
show: true
}
},
computed: {
extPoperClass() {
if(this.labelFormat && this.labelFormat.includes('HH') && !this.labelFormat.includes('HH:mm')) {
return 'de-no-minite'
}
return ''
},
defaultoptions() {
if (!this.element || !this.element.options || !this.element.options.attrs.default) return ''
return JSON.stringify(this.element.options.attrs.default)
@ -118,6 +125,14 @@ export default {
const widget = ApplicationContext.getService(this.element.serviceName)
this.values = widget.dynamicDateFormNow(this.element)
this.dateChange(this.values)
},
'labelFormat': function(val, old) {
if(val !== old) {
this.show = false
this.$nextTick(() => {
this.show = true
})
}
}
},
created() {
@ -285,4 +300,13 @@ export default {
color: #409EFF;
}
}
.de-no-minite {
.el-time-spinner__wrapper {
width: 100% !important;
}
.el-scrollbar:nth-of-type(2) {
display: none;
}
}
</style>