提交 46c45315 authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' of github.com:dataease/dataease into dev

...@@ -7,12 +7,15 @@ import io.dataease.service.dataset.DataSetFieldService; ...@@ -7,12 +7,15 @@ import io.dataease.service.dataset.DataSetFieldService;
import io.dataease.service.dataset.DataSetTableFieldsService; import io.dataease.service.dataset.DataSetTableFieldsService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -74,18 +77,27 @@ public class DataSetTableFieldController { ...@@ -74,18 +77,27 @@ public class DataSetTableFieldController {
@ApiOperation("值枚举") @ApiOperation("值枚举")
@PostMapping("fieldValues/{fieldId}") @PostMapping("fieldValues/{fieldId}")
public List<Object> fieldValues(@PathVariable String fieldId) throws Exception{ public List<Object> fieldValues(@PathVariable String fieldId) throws Exception {
return dataSetFieldService.fieldValues(fieldId); return dataSetFieldService.fieldValues(fieldId);
} }
@ApiOperation("多字段值枚举") @ApiOperation("多字段值枚举")
@PostMapping("multFieldValues") @PostMapping("multFieldValues")
public List<Object> multFieldValues(@RequestBody List<String> fieldIds) throws Exception{ public List<Object> multFieldValues(@RequestBody List<String> fieldIds) throws Exception {
List<Object> results = new ArrayList<>(); List<Object> results = new ArrayList<>();
for (String fieldId : fieldIds) { for (String fieldId : fieldIds) {
results.addAll(dataSetFieldService.fieldValues(fieldId)); results.addAll(dataSetFieldService.fieldValues(fieldId));
} }
results.stream().distinct().collect(Collectors.toList()); ArrayList<Object> list = results.stream().collect(
return results; Collectors.collectingAndThen(
Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(t -> {
if (ObjectUtils.isEmpty(t)) return "";
return t.toString();
}))
), ArrayList::new
)
);
return list;
} }
} }
...@@ -805,11 +805,13 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -805,11 +805,13 @@ public class DorisQueryProvider extends QueryProvider {
} else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) { } else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) {
whereValue = "'%" + value + "%'"; whereValue = "'%" + value + "%'";
} else { } else {
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { // Doris field type test
/*if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value); whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value);
} else { } else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value); whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value);
} }*/
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value);
} }
list.add(SQLObj.builder() list.add(SQLObj.builder()
.whereField(whereName) .whereField(whereName)
...@@ -881,11 +883,13 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -881,11 +883,13 @@ public class DorisQueryProvider extends QueryProvider {
whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1)); whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1));
} }
} else { } else {
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { // doris field type test
/*if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value.get(0)); whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value.get(0));
} else { } else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0)); whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0));
} }*/
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0));
} }
list.add(SQLObj.builder() list.add(SQLObj.builder()
.whereField(whereName) .whereField(whereName)
......
...@@ -498,7 +498,7 @@ public class ChartViewService { ...@@ -498,7 +498,7 @@ public class ChartViewService {
String cValue = item[dataIndex]; String cValue = item[dataIndex];
// 获取计算后的时间,并且与所有维度拼接 // 获取计算后的时间,并且与所有维度拼接
String lastTime = calcLastTime(cTime, compareCalc.getType(), timeField.getDateStyle()); String lastTime = calcLastTime(cTime, compareCalc.getType(), timeField.getDateStyle(), timeField.getDatePattern());
String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size()); String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size());
dimension[timeIndex] = lastTime; dimension[timeIndex] = lastTime;
...@@ -599,51 +599,81 @@ public class ChartViewService { ...@@ -599,51 +599,81 @@ public class ChartViewService {
return false; return false;
} }
private String calcLastTime(String cTime, String type, String dateStyle) throws Exception { private String calcLastTime(String cTime, String type, String dateStyle, String datePattern) {
String lastTime = null; try {
Calendar calendar = Calendar.getInstance(); String lastTime = null;
if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_MOM)) { Calendar calendar = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy"); if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_MOM)) {
Date date = simpleDateFormat.parse(cTime); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
calendar.setTime(date); Date date = simpleDateFormat.parse(cTime);
calendar.add(Calendar.YEAR, -1); calendar.setTime(date);
lastTime = simpleDateFormat.format(calendar.getTime()); calendar.add(Calendar.YEAR, -1);
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_MOM)) { lastTime = simpleDateFormat.format(calendar.getTime());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_MOM)) {
Date date = simpleDateFormat.parse(cTime); SimpleDateFormat simpleDateFormat = null;
calendar.setTime(date); if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) {
calendar.add(Calendar.MONTH, -1); simpleDateFormat = new SimpleDateFormat("yyyy/MM");
lastTime = simpleDateFormat.format(calendar.getTime()); } else {
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_YOY)) { simpleDateFormat = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat simpleDateFormat = null; }
if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) { Date date = simpleDateFormat.parse(cTime);
simpleDateFormat = new SimpleDateFormat("yyyy-MM"); calendar.setTime(date);
} else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) { calendar.add(Calendar.MONTH, -1);
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); lastTime = simpleDateFormat.format(calendar.getTime());
} } else if (StringUtils.equalsIgnoreCase(type, ChartConstants.YEAR_YOY)) {
Date date = simpleDateFormat.parse(cTime); SimpleDateFormat simpleDateFormat = null;
calendar.setTime(date); if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) {
calendar.add(Calendar.YEAR, -1); if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) {
lastTime = simpleDateFormat.format(calendar.getTime()); simpleDateFormat = new SimpleDateFormat("yyyy/MM");
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.DAY_MOM)) { } else {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); simpleDateFormat = new SimpleDateFormat("yyyy-MM");
Date date = simpleDateFormat.parse(cTime); }
calendar.setTime(date); } else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) {
calendar.add(Calendar.DAY_OF_MONTH, -1); if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) {
lastTime = simpleDateFormat.format(calendar.getTime()); simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd");
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_YOY)) { } else {
SimpleDateFormat simpleDateFormat = null; simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) { }
simpleDateFormat = new SimpleDateFormat("yyyy-MM"); }
} else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) { Date date = simpleDateFormat.parse(cTime);
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); calendar.setTime(date);
calendar.add(Calendar.YEAR, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.DAY_MOM)) {
SimpleDateFormat simpleDateFormat = null;
if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) {
simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd");
} else {
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
}
Date date = simpleDateFormat.parse(cTime);
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
} else if (StringUtils.equalsIgnoreCase(type, ChartConstants.MONTH_YOY)) {
SimpleDateFormat simpleDateFormat = null;
if (StringUtils.equalsIgnoreCase(dateStyle, "y_M")) {
if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) {
simpleDateFormat = new SimpleDateFormat("yyyy/MM");
} else {
simpleDateFormat = new SimpleDateFormat("yyyy-MM");
}
} else if (StringUtils.equalsIgnoreCase(dateStyle, "y_M_d")) {
if (StringUtils.equalsIgnoreCase(datePattern, "date_split")) {
simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd");
} else {
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
}
}
Date date = simpleDateFormat.parse(cTime);
calendar.setTime(date);
calendar.add(Calendar.MONTH, -1);
lastTime = simpleDateFormat.format(calendar.getTime());
} }
Date date = simpleDateFormat.parse(cTime); return lastTime;
calendar.setTime(date); } catch (Exception e) {
calendar.add(Calendar.MONTH, -1); return cTime;
lastTime = simpleDateFormat.format(calendar.getTime());
} }
return lastTime;
} }
private boolean checkDrillExist(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> extStack, ChartViewFieldDTO dto, ChartViewWithBLOBs view) { private boolean checkDrillExist(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> extStack, ChartViewFieldDTO dto, ChartViewWithBLOBs view) {
......
...@@ -75,6 +75,7 @@ export default { ...@@ -75,6 +75,7 @@ export default {
padding-left: 1px; padding-left: 1px;
padding-right: 1px; padding-right: 1px;
cursor:pointer!important; cursor:pointer!important;
text-align: center;
background-color: #0a7be0; background-color: #0a7be0;
} }
.bar-main i{ .bar-main i{
......
...@@ -229,7 +229,6 @@ export default { ...@@ -229,7 +229,6 @@ export default {
}, },
methods: { methods: {
_isMobile() { _isMobile() {
console.log('navigator.userAgent:' + navigator.userAgent)
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
this.terminal = flag ? 'mobile' : 'pc' this.terminal = flag ? 'mobile' : 'pc'
// this.terminal = 'mobile' // this.terminal = 'mobile'
...@@ -311,7 +310,7 @@ export default { ...@@ -311,7 +310,7 @@ export default {
} }
}, },
handleMouseDown() { handleMouseDown() {
this.$store.commit('setClickComponentStatus', fals) this.$store.commit('setClickComponentStatus', false)
}, },
initMobileCanvas() { initMobileCanvas() {
this.$store.commit('openMobileLayout') this.$store.commit('openMobileLayout')
......
...@@ -9,6 +9,7 @@ import { uuid } from 'vue-uuid' ...@@ -9,6 +9,7 @@ import { uuid } from 'vue-uuid'
import { findOne } from '@/api/panel/panel' import { findOne } from '@/api/panel/panel'
import { getPanelAllLinkageInfo } from '@/api/panel/linkage' import { getPanelAllLinkageInfo } from '@/api/panel/linkage'
import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJump' import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJump'
import { panelInit } from '@/components/canvas/utils/utils'
export default { export default {
components: { Preview }, components: { Preview },
...@@ -43,8 +44,10 @@ export default { ...@@ -43,8 +44,10 @@ export default {
} }
// 加载视图数据 // 加载视图数据
findOne(this.panelId).then(response => { findOne(this.panelId).then(response => {
const componentDatas = JSON.parse(response.data.panelData)
panelInit(componentDatas)
this.dataLoading = false this.dataLoading = false
this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) this.$store.commit('setComponentData', this.resetID(componentDatas))
this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle)) this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle))
const data = { const data = {
id: response.data.id, id: response.data.id,
......
...@@ -75,7 +75,6 @@ import { deepCopy, mobile2MainCanvas } from '@/components/canvas/utils/utils' ...@@ -75,7 +75,6 @@ import { deepCopy, mobile2MainCanvas } from '@/components/canvas/utils/utils'
import { panelSave } from '@/api/panel/panel' import { panelSave } from '@/api/panel/panel'
import { saveLinkage, getPanelAllLinkageInfo } from '@/api/panel/linkage' import { saveLinkage, getPanelAllLinkageInfo } from '@/api/panel/linkage'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import { import {
DEFAULT_COMMON_CANVAS_STYLE_STRING DEFAULT_COMMON_CANVAS_STYLE_STRING
} from '@/views/panel/panel' } from '@/views/panel/panel'
...@@ -266,6 +265,12 @@ export default { ...@@ -266,6 +265,12 @@ export default {
panelStyle: JSON.stringify(this.canvasStyleData), panelStyle: JSON.stringify(this.canvasStyleData),
panelData: JSON.stringify(this.componentData) panelData: JSON.stringify(this.componentData)
} }
const components = deepCopy(this.componentData)
components.forEach(view => {
if (view.filters && view.filters.length > 0) { view.filters = [] }
})
// 无需保存条件
requestInfo.panelData = JSON.stringify(components)
panelSave(requestInfo).then(response => { panelSave(requestInfo).then(response => {
this.$store.commit('refreshSaveStatus') this.$store.commit('refreshSaveStatus')
this.$message({ this.$message({
...@@ -376,6 +381,7 @@ export default { ...@@ -376,6 +381,7 @@ export default {
mobileDataObj[item.id] = item mobileDataObj[item.id] = item
}) })
const sourceComponentData = JSON.parse(this.componentDataCache) const sourceComponentData = JSON.parse(this.componentDataCache)
this.$store.commit('setComponentDataCache', null)
sourceComponentData.forEach(item => { sourceComponentData.forEach(item => {
if (mobileDataObj[item.id]) { if (mobileDataObj[item.id]) {
mobile2MainCanvas(item, mobileDataObj[item.id]) mobile2MainCanvas(item, mobileDataObj[item.id])
......
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
} }
}, },
editBarViewShowFlag() { editBarViewShowFlag() {
return this.active && this.inTab return this.active && this.inTab && !this.mobileLayoutStatus
}, },
charViewShowFlag() { charViewShowFlag() {
return this.httpRequest.status && this.chart.type && !this.chart.type.includes('table') && !this.chart.type.includes('text') && this.renderComponent() === 'echarts' return this.httpRequest.status && this.chart.type && !this.chart.type.includes('table') && !this.chart.type.includes('text') && this.renderComponent() === 'echarts'
......
<template> <template>
<div v-if="editMode == 'edit'" class="v-text" @keydown="handleKeydown" @keyup="handleKeyup"> <div v-if="editStatus" class="v-text" @keydown="handleKeydown" @keyup="handleKeyup">
<!-- tabindex >= 0 使得双击时聚集该元素 --> <!-- tabindex >= 0 使得双击时聚集该元素 -->
<div <div
v-if="canEdit" v-if="canEdit"
...@@ -15,7 +15,16 @@ ...@@ -15,7 +15,16 @@
@input="handleInput" @input="handleInput"
v-html="element.propValue" v-html="element.propValue"
/> />
<div v-if="!canEdit" :style="{ verticalAlign: element.style.verticalAlign }" @dblclick="setEdit" v-html="element.propValue" /> <div
v-if="!canEdit"
:style="{ verticalAlign: element.style.verticalAlign }"
@dblclick="setEdit"
@paste="clearStyle"
@mousedown="handleMousedown"
@blur="handleBlur"
@input="handleInput"
v-html="element.propValue"
/>
</div> </div>
<div v-else class="v-text"> <div v-else class="v-text">
<div :style="{ verticalAlign: element.style.verticalAlign }" v-html="textInfo" /> <div :style="{ verticalAlign: element.style.verticalAlign }" v-html="textInfo" />
...@@ -24,6 +33,7 @@ ...@@ -24,6 +33,7 @@
<script> <script>
import { keycodes } from '@/components/canvas/utils/shortcutKey.js' import { keycodes } from '@/components/canvas/utils/shortcutKey.js'
import { mapState } from 'vuex'
export default { export default {
props: { props: {
...@@ -56,13 +66,19 @@ export default { ...@@ -56,13 +66,19 @@ export default {
} }
}, },
computed: { computed: {
editStatus() {
return this.editMode === 'edit' && !this.mobileLayoutStatus
},
textInfo() { textInfo() {
if (this.element && this.element.hyperlinks && this.element.hyperlinks.enable) { if (this.element && this.element.hyperlinks && this.element.hyperlinks.enable) {
return "<a title='" + this.element.hyperlinks.content + "' target='" + this.element.hyperlinks.openMode + "' href='" + this.element.hyperlinks.content + "'>" + this.element.propValue + '</a>' return "<a title='" + this.element.hyperlinks.content + "' target='" + this.element.hyperlinks.openMode + "' href='" + this.element.hyperlinks.content + "'>" + this.element.propValue + '</a>'
} else { } else {
return this.element.propValue return this.element.propValue
} }
} },
...mapState([
'mobileLayoutStatus'
])
}, },
watch: { watch: {
...@@ -75,6 +91,7 @@ export default { ...@@ -75,6 +91,7 @@ export default {
}, },
methods: { methods: {
handleInput(e) { handleInput(e) {
this.$store.state.styleChangeTimes++
this.$emit('input', this.element, e.target.innerHTML) this.$emit('input', this.element, e.target.innerHTML)
this.$store.commit('recordStyleChange') this.$store.commit('recordStyleChange')
}, },
......
<template>
<div v-loading="dataLoading" class="bg">
<Preview v-if="!dataLoading" />
</div>
</template>
<script>
import Preview from './Preview'
import { uuid } from 'vue-uuid'
import { findOne } from '@/api/panel/panel'
import { getPanelAllLinkageInfo } from '@/api/panel/linkage'
import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJump'
export default {
components: { Preview },
props: {
panelId: {
type: String,
require: true
}
},
data() {
return {
dataLoading: false
}
},
mounted() {
this.restore()
},
methods: {
restore() {
this.dataLoading = true
// 加载视图数据
findOne(this.panelId).then(response => {
this.dataLoading = false
this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData)))
this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle))
const data = {
id: response.data.id,
name: response.data.name
}
// 刷新联动信息
getPanelAllLinkageInfo(this.panelId).then(rsp => {
this.$store.commit('setNowPanelTrackInfo', rsp.data)
})
// 刷新跳转信息
queryPanelJumpInfo(this.panelId).then(rsp => {
this.$store.commit('setNowPanelJumpInfo', rsp.data)
})
// 如果含有跳转参数 进行触发
const tempParam = localStorage.getItem('jumpInfoParam')
if (tempParam) {
localStorage.removeItem('jumpInfoParam')
const jumpParam = JSON.parse(tempParam)
const jumpRequestParam = {
sourcePanelId: jumpParam.sourcePanelId,
sourceViewId: jumpParam.sourceViewId,
sourceFieldId: jumpParam.sourceFieldId,
targetPanelId: this.panelId
}
this.dataLoading = true
// 刷新跳转目标仪表板联动信息
queryTargetPanelJumpInfo(jumpRequestParam).then(rsp => {
this.dataLoading = false
this.$store.commit('setNowTargetPanelJumpInfo', rsp.data)
this.$store.commit('addViewTrackFilter', jumpParam)
})
}
this.$store.dispatch('panel/setPanelInfo', data)
})
},
resetID(data) {
if (data) {
data.forEach(item => {
item.type !== 'custom' && (item.id = uuid.v1())
})
}
return data
}
}
}
</script>
<style lang="scss" scoped>
.bg {
width: 100%;
height: 100vh!important;
min-width: 800px;
min-height: 600px;
background-color: #f7f8fa;
}
</style>
...@@ -60,7 +60,20 @@ export function mobile2MainCanvas(mainSource, mobileSource) { ...@@ -60,7 +60,20 @@ export function mobile2MainCanvas(mainSource, mobileSource) {
export function panelInit(componentDatas) { export function panelInit(componentDatas) {
componentDatas.forEach(item => { componentDatas.forEach(item => {
item.filters = (item.filters || []) if (item.component && item.component === 'de-date') {
if (item.options.attrs && !item.options.attrs.default) {
item.options.attrs.default = {
isDynamic: false,
dkey: 0,
dynamicPrefix: 1,
dynamicInfill: 'day',
dynamicSuffix: 'before'
}
}
}
if (item.filters && item.filters.length > 0) {
item.filters = []
}
item.linkageFilters = (item.linkageFilters || []) item.linkageFilters = (item.linkageFilters || [])
item.auxiliaryMatrix = (item.auxiliaryMatrix || false) item.auxiliaryMatrix = (item.auxiliaryMatrix || false)
item.x = (item.x || 1) item.x = (item.x || 1)
......
...@@ -10,10 +10,18 @@ ...@@ -10,10 +10,18 @@
</div> </div>
</div> </div>
</div> </div>
<div ref="deContentContainer" class="condition-content" :class="element.options.attrs.title ? '' : 'condition-content-default'"> <div
ref="deContentContainer"
class="condition-content"
:class="element.options.attrs.title ? '' : 'condition-content-default'"
>
<div class="condition-content-container"> <div class="condition-content-container">
<div class="first-element"> <div class="first-element">
<div :class="element.component === 'de-select-grid' ? 'first-element-grid-contaner': ''" class="first-element-contaner"> <div
:class="element.component === 'de-select-grid' ? 'first-element-grid-contaner': ''"
class="first-element-contaner"
>
<component <component
:is="element.component" :is="element.component"
v-if="element.type==='custom'" v-if="element.type==='custom'"
...@@ -27,6 +35,7 @@ ...@@ -27,6 +35,7 @@
/> />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -71,6 +80,7 @@ export default { ...@@ -71,6 +80,7 @@ export default {
sizeInfo() { sizeInfo() {
let size let size
if (this.h > this.inputMaxSize) { if (this.h > this.inputMaxSize) {
return size
} else if (this.h > this.inputLargeSize) { } else if (this.h > this.inputLargeSize) {
size = 'medium' size = 'medium'
} else if (this.h > this.inputSmallSize) { } else if (this.h > this.inputSmallSize) {
...@@ -99,42 +109,61 @@ export default { ...@@ -99,42 +109,61 @@ export default {
const titleWidth = this.$refs.deTitle.offsetWidth const titleWidth = this.$refs.deTitle.offsetWidth
const deContentContainer = this.$refs.deContentContainer const deContentContainer = this.$refs.deContentContainer
this.$nextTick(() => { this.$nextTick(() => {
let min = 75 let min = this.element.style.fontSize * 2 + 50
if (this.element.component === 'de-number-range') { if (this.element.component === 'de-number-range') {
min = 105 min = this.element.style.fontSize * 2 + 80
} }
if (height < min) { if (height < min) {
// console.log(titleWidth)
this.mainClass = 'condition-main-line' this.mainClass = 'condition-main-line'
deContentContainer && (deContentContainer.style.inset = '0 0 0 ' + (titleWidth + 15) + 'px')
if (deContentContainer) {
deContentContainer.style.top = '0px'
deContentContainer.style.marginLeft = (titleWidth + 15) + 'px'
}
} else { } else {
this.mainClass = '' this.mainClass = ''
deContentContainer && (deContentContainer.style.inset = '33px 0px 0px') if (deContentContainer) {
deContentContainer.style.top = '2em'
deContentContainer.style.marginLeft = '0px'
}
} }
}) })
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.my-container { .my-container {
position: absolute; position: absolute;
overflow: auto; overflow: auto;
inset: 0px; top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
} }
.ccondition-main { .ccondition-main {
position: absolute; position: absolute;
overflow: auto; overflow: auto;
inset: 0px; top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
} }
.condition-title { .condition-title {
inset: 0; top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
position: absolute; position: absolute;
height: 35px; height: 2em;
cursor: -webkit-grab; cursor: -webkit-grab;
} }
.first-title { .first-title {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
...@@ -145,10 +174,13 @@ export default { ...@@ -145,10 +174,13 @@ export default {
} }
.condition-title-absolute { .condition-title-absolute {
inset: 0px 0px; right: 0px;
bottom: 0px;
position: absolute; position: absolute;
top: 15px; top: 0px;
left: 4px; left: 4px;
display: flex;
align-items: flex-end;
} }
.span-container { .span-container {
...@@ -159,10 +191,14 @@ export default { ...@@ -159,10 +191,14 @@ export default {
.condition-content { .condition-content {
overflow: auto hidden; overflow: auto hidden;
inset: 33px 0px 0px; top: 2em;
left: 0px;
right: 0px;
bottom: 0px;
position: absolute; position: absolute;
letter-spacing: 0px!important; letter-spacing: 0px !important;
} }
.condition-content-container { .condition-content-container {
position: relative; position: relative;
display: table; display: table;
...@@ -170,6 +206,7 @@ export default { ...@@ -170,6 +206,7 @@ export default {
height: 100%; height: 100%;
white-space: nowrap; white-space: nowrap;
} }
.first-element { .first-element {
position: relative; position: relative;
display: table-cell; display: table-cell;
...@@ -178,25 +215,34 @@ export default { ...@@ -178,25 +215,34 @@ export default {
padding: 0px; padding: 0px;
height: 100%; height: 100%;
} }
.first-element-contaner { .first-element-contaner {
width: calc(100% - 10px); width: calc(100% - 10px);
background: initial; background: initial;
position:absolute; position: absolute;
bottom: 5px; bottom: 5px;
margin: 0 4px; margin: 0 4px;
div {
width: 100%; div {
} width: 100%;
}
display: flex;
align-items: flex-end;
} }
.first-element-grid-contaner { .first-element-grid-contaner {
background: #fff; background: #fff;
border: 1px solid #d7dae2; border: 1px solid #d7dae2;
top: 5px; top: 5px;
} }
.condition-main-line { .condition-main-line {
height: 40px !important; height: 40px !important;
} }
.condition-content-default { .condition-content-default {
inset: 0px 0px 0px !important; inset: 0px 0px 0px !important;
} }
</style> </style>
...@@ -19,9 +19,13 @@ ...@@ -19,9 +19,13 @@
</template> </template>
<script> <script>
import { ApplicationContext } from '@/utils/ApplicationContext' import {
import { timeSection } from '@/utils' ApplicationContext
import bus from "@/utils/bus"; } from '@/utils/ApplicationContext'
import {
timeSection
} from '@/utils'
import bus from '@/utils/bus'
export default { export default {
props: { props: {
...@@ -92,7 +96,8 @@ export default { ...@@ -92,7 +96,8 @@ export default {
} }
}, },
created() { created() {
if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) { if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default && this.element.options
.attrs.default.isDynamic) {
if (this.element.options.attrs.default) { if (this.element.options.attrs.default) {
const widget = ApplicationContext.getService(this.element.serviceName) const widget = ApplicationContext.getService(this.element.serviceName)
this.values = widget.dynamicDateFormNow(this.element) this.values = widget.dynamicDateFormNow(this.element)
...@@ -172,15 +177,16 @@ export default { ...@@ -172,15 +177,16 @@ export default {
fillValueDerfault() { fillValueDerfault() {
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
if (this.element.options.attrs.type === 'daterange') { if (this.element.options.attrs.type === 'daterange') {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') { return [] }
return defaultV.split(',').map(item => parseFloat(item)) return defaultV.split(',').map(item => parseFloat(item))
} else { } else {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') { return null }
return parseFloat(defaultV.split(',')[0]) return parseFloat(defaultV.split(',')[0])
} }
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -2,12 +2,19 @@ ...@@ -2,12 +2,19 @@
<div v-if="element.options!== null && element.options.attrs!==null && show" class="de-select-grid-class"> <div v-if="element.options!== null && element.options.attrs!==null && show" class="de-select-grid-class">
<div class="de-select-grid-search"> <div class="de-select-grid-search">
<el-input v-model="keyWord" :placeholder="$t('deinputsearch.placeholder')" :size="size" prefix-icon="el-icon-search" clearable /> <el-input
v-model="keyWord"
:placeholder="$t('deinputsearch.placeholder')"
:size="size"
prefix-icon="el-icon-search"
clearable
/>
</div> </div>
<div class="list"> <div class="list">
<div v-if="element.options.attrs.multiple" class="checkbox-group-container"> <div v-if="element.options.attrs.multiple" class="checkbox-group-container">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">{{ $t('commons.all') }}</el-checkbox> <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">
{{ $t('commons.all') }}</el-checkbox>
<el-checkbox-group v-model="value" @change="handleCheckedChange"> <el-checkbox-group v-model="value" @change="handleCheckedChange">
<el-checkbox v-for="item in datas" :key="item.id" :label="item.id">{{ item.id }}</el-checkbox> <el-checkbox v-for="item in datas" :key="item.id" :label="item.id">{{ item.id }}</el-checkbox>
...@@ -27,7 +34,9 @@ ...@@ -27,7 +34,9 @@
</template> </template>
<script> <script>
import { multFieldValues } from '@/api/dataset/dataset' import {
multFieldValues
} from '@/api/dataset/dataset'
export default { export default {
props: { props: {
...@@ -100,10 +109,10 @@ export default { ...@@ -100,10 +109,10 @@ export default {
if (typeof value === 'undefined' || value === old) return if (typeof value === 'undefined' || value === old) return
this.datas = [] this.datas = []
this.element.options.attrs.fieldId && this.element.options.attrs.fieldId &&
this.element.options.attrs.fieldId.length > 0 && this.element.options.attrs.fieldId.length > 0 &&
multFieldValues(this.element.options.attrs.fieldId.split(',')).then(res => { multFieldValues(this.element.options.attrs.fieldId.split(',')).then(res => {
this.datas = this.optionDatas(res.data) this.datas = this.optionDatas(res.data)
}) || (this.element.options.value = '') }) || (this.element.options.value = '')
}, },
'element.options.attrs.multiple': function(value, old) { 'element.options.attrs.multiple': function(value, old) {
if (typeof old === 'undefined' || value === old) return if (typeof old === 'undefined' || value === old) return
...@@ -167,10 +176,10 @@ export default { ...@@ -167,10 +176,10 @@ export default {
fillValueDerfault() { fillValueDerfault() {
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
if (this.element.options.attrs.multiple) { if (this.element.options.attrs.multiple) {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') { return [] }
return defaultV.split(',') return defaultV.split(',')
} else { } else {
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') { return null }
return defaultV.split(',')[0] return defaultV.split(',')[0]
} }
}, },
...@@ -204,41 +213,49 @@ export default { ...@@ -204,41 +213,49 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.de-select-grid-search {
>>>input {
border-radius: 0px;
.de-select-grid-search { }
>>>input {
border-radius: 0px; .el-input {
} display: block !important;
} }
.de-select-grid-class {
.list {
overflow-y: auto;
width: 100%;
position: absolute;
top: 30px;
bottom: 0;
} }
}
.radio-group-container > .el-radio-group > label { .de-select-grid-class {
display: block !important; height: 100%;
margin: 10px !important;
}
.checkbox-group-container{ .list {
label.el-checkbox { overflow-y: auto;
display: block !important; width: 100%;
margin: 10px !important; position: relative;
bottom: 0;
height: calc(100% - 40px);
}
} }
.el-checkbox-group > label { .radio-group-container>.el-radio-group>label {
display: block !important; display: block !important;
margin: 10px !important; margin: 10px !important;
} }
} .checkbox-group-container {
label.el-checkbox {
display: block !important;
margin: 10px !important;
}
.el-checkbox-group>label {
display: block !important;
margin: 10px !important;
}
}
</style> </style>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<span slot="label"> <span slot="label">
<span>{{ item.title }}</span> <span>{{ item.title }}</span>
<el-dropdown v-if="isEdit" slot="label" class="de-tab-drop" trigger="click" @command="handleCommand"> <el-dropdown v-if="dropdownShow" slot="label" class="de-tab-drop" trigger="click" @command="handleCommand">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<!-- <span>{{ item.title }}</span> --> <!-- <span>{{ item.title }}</span> -->
...@@ -135,8 +135,12 @@ export default { ...@@ -135,8 +135,12 @@ export default {
} }
}, },
computed: { computed: {
dropdownShow() {
return this.isEdit && !this.mobileLayoutStatus
},
...mapState([ ...mapState([
'curComponent' 'curComponent',
'mobileLayoutStatus'
]) ])
}, },
watch: { watch: {
......
...@@ -91,7 +91,7 @@ class TimeDateServiceImpl extends WidgetService { ...@@ -91,7 +91,7 @@ class TimeDateServiceImpl extends WidgetService {
} }
if (element.options.attrs.default.dkey === 3) { if (element.options.attrs.default.dkey === 3) {
const dynamicPrefix = element.options.attrs.default.dynamicPrefix const dynamicPrefix = parseInt(element.options.attrs.default.dynamicPrefix)
const dynamicInfill = element.options.attrs.default.dynamicInfill const dynamicInfill = element.options.attrs.default.dynamicInfill
const dynamicSuffix = element.options.attrs.default.dynamicSuffix const dynamicSuffix = element.options.attrs.default.dynamicSuffix
...@@ -130,7 +130,8 @@ class TimeDateServiceImpl extends WidgetService { ...@@ -130,7 +130,8 @@ class TimeDateServiceImpl extends WidgetService {
const nowMonth = now.getMonth() const nowMonth = now.getMonth()
const nowYear = now.getFullYear() const nowYear = now.getFullYear()
const nowDate = now.getDate() const nowDate = now.getDate()
return new Date(nowYear - 1, nowMonth, nowDate).getTime()
return new Date(dynamicSuffix === 'before' ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), nowMonth, nowDate).getTime()
} }
} }
} }
......
...@@ -348,6 +348,7 @@ const data = { ...@@ -348,6 +348,7 @@ const data = {
}, },
// 启用移动端布局 // 启用移动端布局
openMobileLayout(state) { openMobileLayout(state) {
state.componentDataCache = null
state.componentDataCache = JSON.stringify(state.componentData) state.componentDataCache = JSON.stringify(state.componentData)
state.pcComponentData = state.componentData state.pcComponentData = state.componentData
const mainComponentData = [] const mainComponentData = []
......
...@@ -18,7 +18,7 @@ export function baseMapOption(chart_option, chart) { ...@@ -18,7 +18,7 @@ export function baseMapOption(chart_option, chart) {
const a = params.seriesName const a = params.seriesName
const b = params.name const b = params.name
const c = params.value ? params.value : '' const c = params.value ? params.value : ''
return text.replaceAll('{a}', a).replaceAll('{b}', b).replaceAll('{c}', c) return text.replace(new RegExp('{a}', 'g'), a).replace(new RegExp('{b}', 'g'), b).replace(new RegExp('{c}', 'g'), c)
} }
chart_option.tooltip = tooltip chart_option.tooltip = tooltip
} }
...@@ -36,7 +36,7 @@ export function baseMapOption(chart_option, chart) { ...@@ -36,7 +36,7 @@ export function baseMapOption(chart_option, chart) {
const a = params.seriesName const a = params.seriesName
const b = params.name const b = params.name
const c = params.value ? params.value : '' const c = params.value ? params.value : ''
return text.replaceAll('{a}', a).replaceAll('{b}', b).replaceAll('{c}', c) return text.replace(new RegExp('{a}', 'g'), a).replace(new RegExp('{b}', 'g'), b).replace(new RegExp('{c}', 'g'), c)
} }
chart_option.series[0].labelLine = customAttr.label.labelLine chart_option.series[0].labelLine = customAttr.label.labelLine
} }
......
<template> <template>
<div style="display: flex;"> <div style="display: flex;position:relative">
<view-track-bar ref="viewTrack" :track-menu="trackMenu" class="track-bar" :style="trackBarStyleTime" @trackClick="trackClick" /> <view-track-bar
ref="viewTrack"
:track-menu="trackMenu"
class="track-bar"
:style="trackBarStyleTime"
@trackClick="trackClick"
/>
<div :id="chartId" style="width: 100%;height: 100%;overflow: hidden;" :style="{ borderRadius: borderRadius}" /> <div :id="chartId" style="width: 100%;height: 100%;overflow: hidden;" :style="{ borderRadius: borderRadius}" />
<div v-if="chart.type === 'map'" class="map-zoom-box">
<div style="margin-bottom: 0.5em;">
<el-button size="mini" icon="el-icon-plus" circle @click="roamMap(true)" />
</div>
<div style="margin-bottom: 0.5em;">
<el-button size="mini" icon="el-icon-refresh" circle @click="resetZoom()" />
</div>
<div>
<el-button size="mini" icon="el-icon-minus" circle @click="roamMap(false)" />
</div>
</div>
</div> </div>
</template> </template>
...@@ -19,24 +39,55 @@ import { ...@@ -19,24 +39,55 @@ import {
BASE_TREEMAP, BASE_TREEMAP,
BASE_MIX BASE_MIX
} from '../chart/chart' } from '../chart/chart'
import { baseBarOption, stackBarOption, horizontalBarOption, horizontalStackBarOption } from '../chart/bar/bar' import {
import { baseLineOption, stackLineOption } from '../chart/line/line' baseBarOption,
import { basePieOption, rosePieOption } from '../chart/pie/pie' stackBarOption,
import { baseMapOption } from '../chart/map/map' horizontalBarOption,
import { baseFunnelOption } from '../chart/funnel/funnel' horizontalStackBarOption
import { baseRadarOption } from '../chart/radar/radar' } from '../chart/bar/bar'
import { baseGaugeOption } from '../chart/gauge/gauge' import {
import { baseScatterOption } from '../chart/scatter/scatter' baseLineOption,
import { baseTreemapOption } from '../chart/treemap/treemap' stackLineOption
import { baseMixOption } from '@/views/chart/chart/mix/mix' } from '../chart/line/line'
// import eventBus from '@/components/canvas/utils/eventBus' import {
import { uuid } from 'vue-uuid' basePieOption,
import { geoJson } from '@/api/map/map' rosePieOption
} from '../chart/pie/pie'
import {
baseMapOption
} from '../chart/map/map'
import {
baseFunnelOption
} from '../chart/funnel/funnel'
import {
baseRadarOption
} from '../chart/radar/radar'
import {
baseGaugeOption
} from '../chart/gauge/gauge'
import {
baseScatterOption
} from '../chart/scatter/scatter'
import {
baseTreemapOption
} from '../chart/treemap/treemap'
import {
baseMixOption
} from '@/views/chart/chart/mix/mix'
// import eventBus from '@/components/canvas/utils/eventBus'
import {
uuid
} from 'vue-uuid'
import {
geoJson
} from '@/api/map/map'
import ViewTrackBar from '@/components/canvas/components/Editor/ViewTrackBar' import ViewTrackBar from '@/components/canvas/components/Editor/ViewTrackBar'
export default { export default {
name: 'ChartComponent', name: 'ChartComponent',
components: { ViewTrackBar }, components: {
ViewTrackBar
},
props: { props: {
chart: { chart: {
type: Object, type: Object,
...@@ -110,7 +161,9 @@ export default { ...@@ -110,7 +161,9 @@ export default {
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
// 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表板有重复id情况 // 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表板有重复id情况
const that = this const that = this
new Promise((resolve) => { resolve() }).then(() => { new Promise((resolve) => {
resolve()
}).then(() => {
// 此dom为echarts图标展示dom // 此dom为echarts图标展示dom
this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId)) this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
if (!this.myChart) { if (!this.myChart) {
...@@ -171,7 +224,10 @@ export default { ...@@ -171,7 +224,10 @@ export default {
if (chart.type === 'map') { if (chart.type === 'map') {
const customAttr = JSON.parse(chart.customAttr) const customAttr = JSON.parse(chart.customAttr)
if (!customAttr.areaCode) return if (!customAttr.areaCode) {
this.myChart.clear()
return
}
const cCode = this.dynamicAreaCode || customAttr.areaCode const cCode = this.dynamicAreaCode || customAttr.areaCode
if (this.$store.getters.geoMap[cCode]) { if (this.$store.getters.geoMap[cCode]) {
const json = this.$store.getters.geoMap[cCode] const json = this.$store.getters.geoMap[cCode]
...@@ -193,25 +249,25 @@ export default { ...@@ -193,25 +249,25 @@ export default {
}, },
registerDynamicMap(areaCode) { registerDynamicMap(areaCode) {
this.dynamicAreaCode = areaCode this.dynamicAreaCode = areaCode
// if (this.$store.getters.geoMap[areaCode]) { // if (this.$store.getters.geoMap[areaCode]) {
// const json = this.$store.getters.geoMap[areaCode] // const json = this.$store.getters.geoMap[areaCode]
// this.myChart.dispose() // this.myChart.dispose()
// this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId)) // this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
// this.$echarts.registerMap('MAP', json) // this.$echarts.registerMap('MAP', json)
// return // return
// } // }
// geoJson(areaCode).then(res => { // geoJson(areaCode).then(res => {
// this.$store.dispatch('map/setGeo', { // this.$store.dispatch('map/setGeo', {
// key: areaCode, // key: areaCode,
// value: res // value: res
// }).then(() => { // }).then(() => {
// this.myChart.dispose() // this.myChart.dispose()
// this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId)) // this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
// this.$echarts.registerMap('MAP', res) // this.$echarts.registerMap('MAP', res)
// }) // })
// }).catch(() => { // }).catch(() => {
// this.downOrUp = true // this.downOrUp = true
// }) // })
}, },
initMapChart(geoJson, chart) { initMapChart(geoJson, chart) {
...@@ -284,11 +340,39 @@ export default { ...@@ -284,11 +340,39 @@ export default {
default: default:
break break
} }
},
roamMap(flag) {
let targetZoom = 1
const zoom = this.myChart.getOption().series[0].zoom
if (flag) {
targetZoom = zoom * 1.2
} else {
targetZoom = zoom / 1.2
}
const options = JSON.parse(JSON.stringify(this.myChart.getOption()))
options.series[0].zoom = targetZoom
this.myChart.setOption(options)
},
resetZoom() {
const options = JSON.parse(JSON.stringify(this.myChart.getOption()))
options.series[0].zoom = 1
this.myChart.setOption(options)
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.map-zoom-box {
position: absolute;
z-index: 999;
left: 2%;
bottom: 30px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
text-align: center;
padding: 2px;
border-radius: 5px
}
</style> </style>
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<div style="display: inline-block;"> <div style="display: inline-block;">
<el-button icon="el-icon-plus" circle size="mini" style="margin-bottom: 10px;" @click="addFilter" /> <el-button icon="el-icon-plus" circle size="mini" style="margin-bottom: 10px;" @click="addFilter" />
<el-radio-group <el-radio-group
v-show="item.filter && item.filter.length > 1"
v-model="logic" v-model="logic"
size="mini" size="mini"
style="margin-left: 10px;" style="margin-left: 10px;"
......
...@@ -339,7 +339,8 @@ export default { ...@@ -339,7 +339,8 @@ export default {
white-space: pre; white-space: pre;
text-overflow: ellipsis; text-overflow: ellipsis;
position: absolute; position: absolute;
inset: 0px 0px 0px 40px; /* inset: 0px 0px 0px 40px; */
margin-left: 40px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
overflow-x: hidden; overflow-x: hidden;
......
...@@ -81,6 +81,7 @@ export default { ...@@ -81,6 +81,7 @@ export default {
.component-wait-main { .component-wait-main {
width: 100%; width: 100%;
height: calc(100% - 30px); height: calc(100% - 30px);
text-align: left;
overflow-y: auto; overflow-y: auto;
} }
.component-custom { .component-custom {
......
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
componentItemStyle() { componentItemStyle() {
return { return {
padding: '5px', padding: '5px',
display: 'inline-block', float: 'left',
width: '33%' width: '33%'
} }
}, },
......
...@@ -37,35 +37,31 @@ ...@@ -37,35 +37,31 @@
</div> </div>
<!-- 视图图表 end --> <!-- 视图图表 end -->
<!-- 过滤组件 start --> <!-- 过滤组件 start -->
<div tabindex="-1" style="position: relative; margin: 16px auto">
<div style="height: 60px; position: relative"> <div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; ">
<div class="button-div-class" style=" text-align: center;line-height: 1;position: absolute;inset: 0px 0px 45px; "> <el-button circle :class="show&&showIndex===1? 'button-show':'button-closed'" class="el-icon-s-tools" size="mini" @click="showPanel(1)" />
<el-button circle :class="show&&showIndex===1? 'button-show':'button-closed'" class="el-icon-s-tools" size="mini" @click="showPanel(1)" /> </div>
</div> <div class="button-text" style=" position: relative; margin: 18px auto 16px;">
<div class="button-text" style=" position: absolute;left: 0px;right: 0px;bottom: 10px; height: 16px;"> <div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"> {{ $t('panel.module') }}
{{ $t('panel.module') }}
</div>
</div>
</div> </div>
</div> </div>
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;"> <div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" /> <div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
</div> </div>
<!-- 过滤组件 end --> <!-- 过滤组件 end -->
<!-- 其他组件 start --> <!-- 其他组件 start -->
<div tabindex="-1" style="position: relative; margin: 16px auto">
<div style="height: 60px; position: relative"> <div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; ">
<div class="button-div-class" style=" text-align: center;line-height: 1;position: absolute;inset: 0px 0px 45px; "> <el-button circle :class="show&&showIndex===3? 'button-show':'button-closed'" class="el-icon-brush" size="mini" @click="showPanel(3)" />
<el-button circle :class="show&&showIndex===3? 'button-show':'button-closed'" class="el-icon-brush" size="mini" @click="showPanel(3)" /> </div>
</div> <div class="button-text" style=" position: relative; margin: 18px auto 16px;">
<div class="button-text" style=" position: absolute;left: 0px;right: 0px;bottom: 10px; height: 16px;"> <div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"> {{ $t('panel.other_module') }}
{{ $t('panel.other_module') }}
</div>
</div>
</div> </div>
</div> </div>
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;"> <div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" /> <div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
</div> </div>
......
...@@ -98,6 +98,10 @@ export default { ...@@ -98,6 +98,10 @@ export default {
}, },
dynamicPrefixChange(value) { dynamicPrefixChange(value) {
if (value < 1) {
value = 1
this.element.options.attrs.default.dynamicPrefix = 1
}
this.setDval() this.setDval()
}, },
dynamicInfillChange(value) { dynamicInfillChange(value) {
......
...@@ -272,7 +272,8 @@ export default { ...@@ -272,7 +272,8 @@ export default {
white-space: pre; white-space: pre;
text-overflow: ellipsis; text-overflow: ellipsis;
position: absolute; position: absolute;
inset: 0px 0px 0px 40px; /* inset: 0px 0px 0px 40px; */
margin-left: 40px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
overflow-x: hidden; overflow-x: hidden;
......
...@@ -645,6 +645,8 @@ export default { ...@@ -645,6 +645,8 @@ export default {
this.lastActiveNodeData = data this.lastActiveNodeData = data
this.activeTree = data.panelType this.activeTree = data.panelType
if (data.nodeType === 'panel') { if (data.nodeType === 'panel') {
// 清理pc布局缓存
this.$store.commit('setComponentDataCache', null)
// 加载视图数据 // 加载视图数据
findOne(data.id).then(response => { findOne(data.id).then(response => {
const componentDatas = JSON.parse(response.data.panelData) const componentDatas = JSON.parse(response.data.panelData)
......
...@@ -130,13 +130,11 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine' ...@@ -130,13 +130,11 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import { queryAll } from '@/api/panel/pdfTemplate' import { queryAll } from '@/api/panel/pdfTemplate'
import ShareHead from '@/views/panel/GrantAuth/ShareHead' import ShareHead from '@/views/panel/GrantAuth/ShareHead'
import JsPDF from 'jspdf'
export default { export default {
name: 'PanelViewShow', name: 'PanelViewShow',
components: { Preview, SaveToTemplate, PDFPreExport, ShareHead }, components: { Preview, SaveToTemplate, PDFPreExport, ShareHead },
props: { props: {
// eslint-disable-next-line vue/require-default-prop
activeTab: { activeTab: {
type: String, type: String,
required: false required: false
...@@ -208,7 +206,6 @@ export default { ...@@ -208,7 +206,6 @@ export default {
bus.$on('set-panel-show-type', type => { bus.$on('set-panel-show-type', type => {
this.showType = type || 0 this.showType = type || 0
}) })
this.initPdfTemplate() this.initPdfTemplate()
}, },
methods: { methods: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论