Merge branch 'v1.14' of github.com:dataease/dataease into v1.14
This commit is contained in:
commit
4b527bb9b4
@ -1,5 +1,6 @@
|
||||
package io.dataease.provider.query.ck;
|
||||
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableField;
|
||||
import io.dataease.plugins.common.base.domain.DatasetTableFieldExample;
|
||||
@ -30,6 +31,7 @@ import javax.annotation.Resource;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
@ -42,6 +44,8 @@ import static io.dataease.plugins.common.constants.datasource.SQLConstants.TABLE
|
||||
*/
|
||||
@Service("ckQueryProvider")
|
||||
public class CKQueryProvider extends QueryProvider {
|
||||
|
||||
private static final String toDateTime64 = "toDateTime64(%s, 3, '')";
|
||||
@Resource
|
||||
private DatasetTableFieldMapper datasetTableFieldMapper;
|
||||
|
||||
@ -1060,6 +1064,25 @@ public class CKQueryProvider extends QueryProvider {
|
||||
if (CollectionUtils.isEmpty(requestList)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AtomicReference<ChartExtFilterRequest> atomicReference = new AtomicReference<>();
|
||||
requestList.forEach(request -> {
|
||||
DatasetTableField datasetTableField = request.getDatasetTableField();
|
||||
List<String> requestValue = request.getValue();
|
||||
if (ObjectUtils.isNotEmpty(datasetTableField) && datasetTableField.getDeType() == DeTypeConstants.DE_TIME && StringUtils.equalsIgnoreCase(request.getOperator(), "between")) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
request.setOperator("ge");
|
||||
request.setValue(new ArrayList<String>(){{add(String.format(toDateTime64, "'" + simpleDateFormat.format(new Date(Long.parseLong(requestValue.get(0)))) + "'"));}});
|
||||
ChartExtFilterRequest requestCopy = BeanUtils.copyBean(new ChartExtFilterRequest(), request);
|
||||
requestCopy.setOperator("le");
|
||||
requestCopy.setValue(new ArrayList<String>(){{add(String.format(toDateTime64, "'" + simpleDateFormat.format(new Date(Long.parseLong(requestValue.get(1)))) + "'"));}});
|
||||
atomicReference.set(requestCopy);
|
||||
}
|
||||
});
|
||||
|
||||
if (ObjectUtils.isNotEmpty(atomicReference.get())) {
|
||||
requestList.add(atomicReference.get());
|
||||
}
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
for (ChartExtFilterRequest request : requestList) {
|
||||
List<String> value = request.getValue();
|
||||
@ -1138,7 +1161,7 @@ public class CKQueryProvider extends QueryProvider {
|
||||
whereValue = String.format(CKConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
}
|
||||
} else {
|
||||
whereValue = String.format(CKConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
whereValue = isCompleteField(value.get(0)) ? value.get(0) : String.format(CKConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
}
|
||||
|
||||
if (!request.getIsTree() && fieldList.get(0).getDeType() == DeTypeConstants.DE_TIME && StringUtils.equalsIgnoreCase(request.getOperator(), "null")) {
|
||||
@ -1163,6 +1186,10 @@ public class CKQueryProvider extends QueryProvider {
|
||||
return CollectionUtils.isNotEmpty(list) ? "(" + String.join(" AND ", strList) + ")" : null;
|
||||
}
|
||||
|
||||
private boolean isCompleteField(String field) {
|
||||
return StringUtils.isNotBlank(field) && StringUtils.startsWith(field, "toDateTime64('") && StringUtils.endsWith(field, "')");
|
||||
}
|
||||
|
||||
private String sqlFix(String sql) {
|
||||
if (sql.lastIndexOf(";") == (sql.length() - 1)) {
|
||||
sql = sql.substring(0, sql.length() - 1);
|
||||
|
||||
@ -229,6 +229,9 @@ export default {
|
||||
off(document, 'mouseup', this._popoverHideFun)
|
||||
},
|
||||
methods: {
|
||||
resetSelectAll() {
|
||||
this.selectAll = false
|
||||
},
|
||||
selectAllChane(val) {
|
||||
if (val) {
|
||||
this.ids = this._checkSum()
|
||||
|
||||
@ -114,6 +114,9 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
resetSelectAll() {
|
||||
this.selectAll = false
|
||||
},
|
||||
setSelect(id) {
|
||||
if (Array.isArray(this.selectValue)) {
|
||||
return this.selectValue.map(ele => ele.id).includes(id) && 'selected'
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
<de-main-container v-show="showChartCanvas" class="">
|
||||
<div id="chartCanvas" class="canvas-class" :style="customStyle">
|
||||
<div class="canvas-class" :style="commonStyle">
|
||||
<!-- <svg-icon v-show="svgInnerEnable" :style="{'color':this.element.commonBackground.innerImageColor}" class="svg-background" :icon-class="mainSlotSvgInner" />-->
|
||||
<plugin-com
|
||||
v-if="chart.isPlugin"
|
||||
:component-name="chart.type + '-view'"
|
||||
:obj="{chart: mapChart || chart}"
|
||||
:chart="mapChart || chart"
|
||||
:theme-style="element.commonBackground"
|
||||
class="chart-class"
|
||||
/>
|
||||
<chart-component v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" :theme-style="element.commonBackground" class="chart-class" :chart="mapChart || chart" />
|
||||
@ -42,7 +42,7 @@ import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
|
||||
import { exportDetails, innerExportDetails } from '@/api/panel/panel'
|
||||
import html2canvas from 'html2canvasde'
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import {deepCopy, exportImg, imgUrlTrans} from '@/components/canvas/utils/utils'
|
||||
import { deepCopy, exportImg, imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
import { getLinkToken, getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'UserViewDialog',
|
||||
@ -101,7 +101,7 @@ export default {
|
||||
},
|
||||
|
||||
svgInnerEnable() {
|
||||
return !this.screenShot&&this.element.commonBackground.enable && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string'
|
||||
return !this.screenShot && this.element.commonBackground.enable && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string'
|
||||
},
|
||||
mainSlotSvgInner() {
|
||||
if (this.svgInnerEnable) {
|
||||
@ -124,7 +124,7 @@ export default {
|
||||
}
|
||||
if (this.element.commonBackground.enable) {
|
||||
if (this.screenShot && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string') {
|
||||
let innerImage = this.element.commonBackground.innerImage.replace('svg', 'png')
|
||||
const innerImage = this.element.commonBackground.innerImage.replace('svg', 'png')
|
||||
style['background'] = `url(${imgUrlTrans(innerImage)}) no-repeat ${colorRGBA}`
|
||||
} else if (this.element.commonBackground.backgroundType === 'outerImage' && typeof this.element.commonBackground.outerImage === 'string') {
|
||||
style['background'] = `url(${imgUrlTrans(this.element.commonBackground.outerImage)}) no-repeat ${colorRGBA}`
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
:component-name="chart.type + '-view'"
|
||||
:obj="{chart: mapChart || chart}"
|
||||
:chart="mapChart || chart"
|
||||
:theme-style="element.commonBackground"
|
||||
class="chart-class"
|
||||
/>
|
||||
<chart-component v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" :theme-style="element.commonBackground" class="chart-class" :chart="mapChart || chart" />
|
||||
@ -34,8 +35,8 @@ import DeContainer from '@/components/dataease/DeContainer'
|
||||
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
|
||||
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
|
||||
import PluginCom from '@/views/system/plugin/PluginCom'
|
||||
import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
|
||||
import {hexColorToRGBA} from "@/views/chart/chart/util";
|
||||
import { deepCopy, imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
export default {
|
||||
name: 'UserViewMobileDialog',
|
||||
components: { ChartComponentS2, LabelNormalText, DeContainer, DeMainContainer, ChartComponentG2, ChartComponent, TableNormal, LabelNormal, PluginCom },
|
||||
@ -83,7 +84,7 @@ export default {
|
||||
},
|
||||
|
||||
svgInnerEnable() {
|
||||
return !this.screenShot&&this.element.commonBackground.enable && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string'
|
||||
return !this.screenShot && this.element.commonBackground.enable && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string'
|
||||
},
|
||||
mainSlotSvgInner() {
|
||||
if (this.svgInnerEnable) {
|
||||
@ -106,7 +107,7 @@ export default {
|
||||
}
|
||||
if (this.element.commonBackground.enable) {
|
||||
if (this.screenShot && this.element.commonBackground.backgroundType === 'innerImage' && typeof this.element.commonBackground.innerImage === 'string') {
|
||||
let innerImage = this.element.commonBackground.innerImage.replace('svg', 'png')
|
||||
const innerImage = this.element.commonBackground.innerImage.replace('svg', 'png')
|
||||
style['background'] = `url(${imgUrlTrans(innerImage)}) no-repeat ${colorRGBA}`
|
||||
} else if (this.element.commonBackground.backgroundType === 'outerImage' && typeof this.element.commonBackground.outerImage === 'string') {
|
||||
style['background'] = `url(${imgUrlTrans(this.element.commonBackground.outerImage)}) no-repeat ${colorRGBA}`
|
||||
|
||||
@ -431,7 +431,7 @@ const list = [
|
||||
openMode: '0',
|
||||
showWeek: false,
|
||||
showDate: true,
|
||||
dateFormat: 'yyyy年-MM月-dd日',
|
||||
dateFormat: 'yyyy-MM-dd',
|
||||
timeFormat: 'hh:mm:ss'
|
||||
},
|
||||
x: 1,
|
||||
|
||||
@ -213,7 +213,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
clearHandler() {
|
||||
this.value = null
|
||||
this.value = this.element.options.attrs.multiple ? [] : null
|
||||
this.$refs.deSelect && this.$refs.deSelect.resetSelectAll && this.$refs.deSelect.resetSelectAll()
|
||||
},
|
||||
filterMethod(key) {
|
||||
this.keyWord = key
|
||||
|
||||
@ -213,7 +213,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
clearHandler() {
|
||||
this.value = null
|
||||
this.value = this.element.options.attrs.multiple ? [] : null
|
||||
},
|
||||
resetDefaultValue(id) {
|
||||
if (this.inDraw && this.manualModify && this.element.id === id) {
|
||||
|
||||
@ -223,7 +223,8 @@ export default {
|
||||
|
||||
methods: {
|
||||
clearHandler() {
|
||||
this.value = null
|
||||
this.value = this.element.options.attrs.multiple ? [] : null
|
||||
this.$refs.deSelectTree && this.$refs.deSelectTree.resetSelectAll && this.$refs.deSelectTree.resetSelectAll()
|
||||
},
|
||||
resetDefaultValue(id) {
|
||||
if (this.inDraw && this.manualModify && this.element.id === id) {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="myAttrs.customRange" :label="$t('desearchbutton.relative')">
|
||||
<el-select v-model="myAttrs.filterIds" style="width: 280px;" multiple clearable>
|
||||
<el-select v-model="myAttrs.filterIds" style="width: 100%;" multiple clearable>
|
||||
<el-option v-for="(filter, index) in filters" :key="filter.id + index" :label="filter.showName" :value="filter.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user