Merge branch 'v1.18' of github.com:dataease/dataease into v1.18

This commit is contained in:
taojinlong 2023-04-14 16:05:56 +08:00
commit 4c459d69d9
20 changed files with 82 additions and 36 deletions

View File

@ -8,6 +8,8 @@ import io.dataease.commons.model.excel.ExcelSheetModel;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -29,6 +31,9 @@ public class ExcelUtils {
List<List<String>> details = sheet.getData();
details.add(0, sheet.getHeads());
String sheetName = sheet.getSheetName();
Pattern pattern = Pattern.compile("[\\s\\\\/:\\*\\?\\\"<>\\|]");
Matcher matcher = pattern.matcher(sheetName);
sheetName = matcher.replaceAll("-");
Sheet curSheet = wb.createSheet(sheetName);
if (StringUtils.isBlank(fileName)) {
String cName = sheetName + suffix;

View File

@ -63,7 +63,7 @@ public class ViewExportExcel {
String panelStyle = panelDto.getPanelStyle();
Map map = gson.fromJson(panelStyle, Map.class);
Map panelMap = (LinkedTreeMap) map.get("panel");
double resultCount = Double.parseDouble(panelMap.get("resultCount").toString());
double resultCount = ObjectUtils.isEmpty(panelMap.get("resultCount")) ? 1000 : Double.parseDouble(panelMap.get("resultCount").toString());
String resultMode = null;
if (ObjectUtils.isNotEmpty(panelMap.get("resultMode"))) {
resultMode = panelMap.get("resultMode").toString();

View File

@ -141,7 +141,7 @@
style="position: absolute;right: 70px;top:15px"
>
<el-button
v-if="showChartInfoType==='enlarge' && hasDataPermission('export',panelInfo.privileges)&& showChartInfo && showChartInfo.type !== 'symbol-map'"
v-if="showChartInfoType==='enlarge' && hasDataPermission('export',panelInfo.privileges)&& showChartInfo && !equalsAny(showChartInfo.type, 'symbol-map', 'flow-map')"
class="el-icon-picture-outline"
size="mini"
:disabled="imageDownloading"
@ -218,6 +218,7 @@ import Vue from 'vue'
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog'
import UserViewMobileDialog from '@/components/canvas/customComponent/UserViewMobileDialog'
import { equalsAny } from '@/utils/StringUtils'
export default {
name: 'UserView',
@ -321,6 +322,7 @@ export default {
curFields: [],
isFirstLoad: true, //
refId: null,
getDataLoading: false,
chart: BASE_CHART_STRING,
requestStatus: 'success',
message: null,
@ -490,6 +492,7 @@ export default {
handler: function(val1, val2) {
if (isChange(val1, val2) && !this.isFirstLoad) {
this.getData(this.element.propValue.viewId)
this.getDataLoading = true
}
},
deep: true
@ -577,6 +580,7 @@ export default {
}
},
methods: {
equalsAny,
tabSwitch(tabCanvasId) {
if (this.charViewS2ShowFlag && tabCanvasId === this.canvasId && this.$refs[this.element.propValue.id]) {
this.$refs[this.element.propValue.id].chartResize()
@ -745,6 +749,7 @@ export default {
},
getData(id, cache = true, dataBroadcast = false) {
if (id) {
if (this.getDataLoading) return
this.requestStatus = 'waiting'
this.message = null
@ -843,6 +848,8 @@ export default {
}
this.isFirstLoad = false
return true
}).finally(() => {
this.getDataLoading = false
})
}
},

View File

@ -423,7 +423,7 @@ export default {
try {
const targetRef = _this.$refs['canvasTabRef-' + _this.activeTabName]
if (targetRef) {
targetRef[0].restore()
targetRef[0]?.restore()
}
_this.$refs[this.activeTabName][0].resizeChart()
} catch (e) {
@ -528,7 +528,7 @@ export default {
_this.activeTabName = _this.element.options.tabList[nowIndex].name
const targetRef = _this.$refs['canvasTabRef-' + _this.activeTabName]
if (targetRef) {
targetRef[0].restore()
targetRef[0]?.restore()
}
});
}, switchTime)

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 714 KiB

After

Width:  |  Height:  |  Size: 673 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.5 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 712 KiB

After

Width:  |  Height:  |  Size: 672 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -364,7 +364,7 @@ export function getTooltip(chart) {
res = valueFormatter(param.value, formatterItem)
}
}
} else if (includesAny(chart.type, 'bar', 'line', 'scatter', 'radar', 'area') && !chart.type.includes('group')) {
} else if (includesAny(chart.type, 'bar', 'scatter', 'radar', 'area') && !chart.type.includes('group')) {
obj = { name: param.category, value: param.value }
for (let i = 0; i < yAxis.length; i++) {
const f = yAxis[i]
@ -377,6 +377,20 @@ export function getTooltip(chart) {
break
}
}
} else if (chart.type === 'line') {
obj = { name: param.category, value: param.value }
const xAxisExt = JSON.parse(chart.xaxisExt)
for (let i = 0; i < yAxis.length; i++) {
const f = yAxis[i]
if (f.name === param.category || (yAxis.length && xAxisExt.length)) {
if (f.formatterCfg) {
res = valueFormatter(param.value, f.formatterCfg)
} else {
res = valueFormatter(param.value, formatterItem)
}
break
}
}
} else if (chart.type.includes('group')) {
if (chart.type === 'bar-group') {
obj = { name: param.category, value: param.value }

View File

@ -3220,7 +3220,7 @@ export const TYPE_CONFIGS = [
category: 'chart.chart_type_space',
value: 'map',
title: 'chart.chart_map',
icon: 'map',
icon: 'map_mini',
properties: [
'color-selector',
'label-selector',
@ -3367,19 +3367,21 @@ export function getColors(chart, colors, reset) {
}
} else if (equalsAny(chart.type, 'bar-group', 'line')) {
// 拿到data中的category并去重然后构建seriesColor
const data = chart.data.data
const s = []
data.forEach((cur) => {
if (s.indexOf(cur.category) < 0) {
s.push(cur.category)
}
})
for (let i = 0; i < s.length; i++) {
seriesColors.push({
name: s[i],
color: colors[i % colors.length],
isCustom: false
if (chart.data) {
const data = chart.data.data
const s = []
data.forEach((cur) => {
if (s.indexOf(cur.category) < 0) {
s.push(cur.category)
}
})
for (let i = 0; i < s.length; i++) {
seriesColors.push({
name: s[i],
color: colors[i % colors.length],
isCustom: false
})
}
}
} else {
if (chart.data) {

View File

@ -243,7 +243,7 @@ export default {
fieldOptions() {
const xaxis = this.view.xaxis
const yaxis = this.view.yaxis
const locationIds = this.view.viewFields.filter(item => item.busiType === 'locationXaxis' || item.busiType === 'locationYaxis').map(item => item.id)
const locationIds = this.view.viewFields ? this.view.viewFields.filter(item => item.busiType === 'locationXaxis' || item.busiType === 'locationYaxis').map(item => item.id) : []
const xIds = xaxis ? xaxis.map(item => item.id) : []
const yIds = yaxis ? yaxis.map(item => item.id) : []
const disableIds = [...xIds, ...yIds, ...locationIds]

View File

@ -19,7 +19,6 @@
v-for="(item, idx) in container"
:key="idx"
style="position: relative;display: block;"
:style="{'top': item.isPlugin ? '5px' : '0'}"
>
<el-radio
v-if="item.placeholder"

View File

@ -1,6 +1,6 @@
<template>
<div class="de-dataset-form">
<div class="top">
<div class="top" v-loading="loading">
<span class="name">
<i
class="el-icon-arrow-left"
@ -43,7 +43,6 @@
<deBtn
:disabled="['db', 'excel', 'api'].includes(datasetType) && !tableNum"
type="primary"
:loading="loading"
@click="datasetSave"
>{{
$t('commons.save')
@ -58,6 +57,7 @@
:origin-name="originName"
:name-list="nameList"
@setTableNum="(val) => (tableNum = val)"
@datasourceLoading="(val) => loading = val"
/>
</div>
</div>
@ -80,9 +80,9 @@ export default {
return {
originName: '',
tableNum: 0,
loading: false,
showInput: false,
editType: '',
loading: false,
selectDatasets: [],
tData: [],
datasetType: '',
@ -185,7 +185,6 @@ export default {
return
}
}
this.loading = true
this.$refs.addDataset.save()
},
handleClick() {
@ -219,6 +218,7 @@ export default {
)
},
initTable(id) {
this.loading = true
post('/dataset/table/getWithPermission/' + id, null)
.then((response) => {
const { sceneId: id, id: tableId, name } = response.data || {}
@ -234,7 +234,10 @@ export default {
this.table.editType = +this.editType
}
})
.catch(() => {})
.catch(() => { })
.finally(() => {
this.loading = false
})
},
switchComponent(c) {
switch (c) {

View File

@ -420,6 +420,7 @@ export default {
this.openMessageSuccess('deDataset.cannot_be_duplicate', 'error')
return
}
if (this.loading) return
this.loading = true
const sceneId = this.param.id
const dataSourceId = this.dataSource

View File

@ -439,6 +439,7 @@ export default {
this.openMessageSuccess('deDataset.cannot_be_duplicate', 'error')
return
}
if (this.loading) return
this.loading = true
const sceneId = this.param.id
const dataSourceId = this.dataSource

View File

@ -591,6 +591,7 @@ export default {
}
this.handlerConfirm(options)
} else {
if (this.loading) return
this.loading = true
post('/dataset/table/update', table)
.then((response) => {

View File

@ -905,6 +905,7 @@ export default {
initTableInfo() {
const tableId = this.param.tableId || this.$route.query.id
if (tableId) {
this.$emit('datasourceLoading', true)
getTable(tableId).then((response) => {
const table = response.data
this.dataSource = table.dataSourceId
@ -919,6 +920,8 @@ export default {
).sql
}
this.variables = JSON.parse(table.sqlVariableDetails)
}).finally(() => {
this.$emit('datasourceLoading', false)
})
}
},
@ -1008,6 +1011,7 @@ export default {
return
}
this.parseVariable()
if (this.loading) return
this.loading = true
const table = {
id: this.param.tableId,

View File

@ -261,6 +261,7 @@ export default {
this.openMessageSuccess('dataset.char_can_not_more_50', 'error')
return
}
if (this.loading) return
this.loading = true
const table = {
id: this.param.tableId,

View File

@ -722,6 +722,7 @@
:visible.sync="editCalcField"
class="de-dialog-form de-center-dialog"
width="980px"
:before-close="closeCalcField"
:title="
currEditField.id
? $t('dataset.edit_calc_field')
@ -730,6 +731,7 @@
append-to-body
>
<calc-field-edit
ref="calcFieldEdit"
:param="param"
:table-fields="tableFields"
:field="currEditField"
@ -893,6 +895,7 @@ export default {
closeCalcField() {
this.editCalcField = false
this.$refs.calcFieldEdit.resetField()
this.initField()
},

View File

@ -420,8 +420,11 @@ export default {
return
}
const regep = new RegExp(/^1[3-9]\d{9}$/)
if (!regep.test(value)) {
let phoneNumber = value
if (value.length > 3 && value.startsWith('+86')) {
phoneNumber = value.substr(3)
}
if (!regep.test(phoneNumber)) {
const msg = this.$t('user.phone_format')
callback(new Error(msg))
} else {