Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2022-11-22 11:01:21 +08:00
commit 21f0f7a91c
26 changed files with 530 additions and 109 deletions

View File

@ -158,12 +158,17 @@ public class ChartDataBuild {
} catch (Exception e) {
axisChartDataDTO.setValue(new BigDecimal(0));
}
if ("line".equals(view.getType()) && CollectionUtils.isEmpty(xAxisExt)) {
axisChartDataDTO.setCategory(yAxis.get(j).getName());
} else {
axisChartDataDTO.setCategory(b.toString());
}
axisChartDataDTO.setCategory(b.toString());
dataList.add(axisChartDataDTO);
if ("line".equals(view.getType())) {
if (CollectionUtils.isEmpty(xAxisExt)){
axisChartDataDTO.setCategory(yAxis.get(j).getName());
} else {
// 多指标只取第一个
break;
}
}
}
}
map.put("data", dataList);

View File

@ -294,7 +294,7 @@ export default {
created() {
eventBus.$on('editPanelInitReady', this.editPanelInit)
eventBus.$on('preview', this.preview)
eventBus.$on('save', this.save)
eventBus.$on('checkAndSave', this.checkAndSave)
eventBus.$on('clearCanvas', this.clearCanvas)
this.scale = this.canvasStyleData.scale
this.mobileLayoutInitStatus = this.mobileLayoutStatus
@ -303,13 +303,18 @@ export default {
},
beforeDestroy() {
eventBus.$off('preview', this.preview)
eventBus.$off('save', this.save)
eventBus.$off('checkAndSave', this.checkAndSave)
eventBus.$off('clearCanvas', this.clearCanvas)
eventBus.$off('editPanelInitReady', this.editPanelInit)
clearInterval(this.timer)
this.timer = null
},
methods: {
checkAndSave() {
if (!this.saveButtonDisabled) {
this.save(false)
}
},
editPanelInit() {
this.showGridSwitch = this.canvasStyleData.aidedDesign.showGrid
},

View File

@ -8,6 +8,7 @@
v-if="isPublicLink"
ref="widget-div"
class="function-div"
:class="functionClass"
>
<el-button-group size="mini">
<el-button
@ -22,7 +23,10 @@
v-if="existLinkage"
size="mini"
@click="clearAllLinkage"
><i class="icon iconfont icon-quxiaoliandong" />{{ $t('panel.remove_all_linkage') }}</el-button>
><i
style="width: 12px;height: 12px"
class="icon iconfont icon-quxiaoliandong"
/>{{ $t('panel.remove_all_linkage') }}</el-button>
<el-button
size="mini"
@click="exportPDF"
@ -52,7 +56,25 @@ import { mapState } from 'vuex'
import bus from '@/utils/bus'
export default {
props: {
canvasStyleData: {
type: Object,
default: null
}
},
data() {
return {
}
},
computed: {
functionClass() {
let result = 'function-light'
if (this.canvasStyleData?.panel?.themeColor === 'dark') {
result = 'function-dark'
}
return result
},
existLinkage() {
let linkageFiltersCount = 0
this.componentData.forEach(item => {
@ -142,13 +164,43 @@ export default {
width: max-content;
text-align: end;
z-index: 999;
::v-deep button:hover {
background-color: rgba(31, 35, 41, 0.1);
color: #1F2329;
font-weight: bold;
border-color: rgba(31, 35, 41, 0.1)
border-radius: 4px;
::v-deep button {
border-radius: 0px;
}
}
.function-light {
background: #FFFFFF;
border: 1px solid #DEE0E3;
box-shadow: 0px 4px 8px rgb(31 35 41 / 10%);
::v-deep button {
background-color: #FFFFFF;
box-shadow: 0px 4px 8px rgba(31, 35, 41, 0.1);
border: 1px solid #DEE0E3;
&:hover {
background-color: rgba(31, 35, 41, 0.1);
color: #1F2329;
font-weight: bold;
border-color: rgba(31, 35, 41, 0.1)
}
}
}
.function-dark {
background: #1A1A1A;
border: 1px solid #434343;
box-shadow: 0px 4px 8px rgba(26, 26, 26, 0.1);
::v-deep button {
background-color: #1A1A1A;
border: 1px solid #434343;
box-shadow: 0px 4px 8px rgba(26, 26, 26, 0.1);
color: #FFFFFF;
&:hover {
background-color: rgba(235, 235, 235, 0.1);
color: #EBEBEB;
font-weight: bold;
border-color: rgba(235, 235, 235, 0.1);
}
}
}
&:hover {
border-top: 60px solid rgba(245, 74, 69, 0);;

View File

@ -193,6 +193,7 @@ import LinkJumpSet from '@/views/panel/linkJumpSet'
import Background from '@/views/background/index'
import MapLayerController from '@/views/chart/components/map/MapLayerController'
import { uploadFileResult } from '@/api/staticResource/staticResource'
import eventBus from '@/components/canvas/utils/eventBus'
export default {
components: { Background, LinkJumpSet, FieldsList, SettingMenu, LinkageField, MapLayerController },
@ -364,9 +365,16 @@ export default {
this.initCurFields()
if (this.element.type === 'view') {
bus.$on('initCurFields-' + this.element.id, this.initCurFields)
eventBus.$on('viewEnlarge', this.viewEnlarge)
}
},
beforeDestroy() {
eventBus.$off('preview', this.showViewDetails)
},
methods: {
viewEnlarge() {
this.showViewDetails('enlarge')
},
backgroundSetClose() {
this.boardSetVisible = false
},

View File

@ -11,6 +11,7 @@
>
<canvas-opt-bar
ref="canvas-opt-bar"
:canvas-style-data="canvasStyleData"
@link-export-pdf="downloadAsPDF"
/>
<div
@ -501,10 +502,15 @@ export default {
}
}
this.timer = setInterval(() => {
this.clearAllLinkage()
this.searchCount++
}, refreshTime)
}
},
clearAllLinkage() {
this.$store.commit('clearPanelLinkageInfo')
bus.$emit('clear_panel_linkage', { viewId: 'all' })
},
changeStyleWithScale,
getStyle,
restore() {
@ -610,11 +616,16 @@ export default {
const domId = this.canvasInfoTemp
setTimeout(() => {
this.exporting = true
this.backScreenShot = true
const scrollHeight = document.getElementById('preview-temp-canvas-main').scrollHeight
document.getElementById('preview-canvas-main').style.height = (scrollHeight + 'px')
setTimeout(() => {
html2canvas(document.getElementById(domId)).then(canvas => {
const snapshot = canvas.toDataURL('image/jpeg', 1) //
this.dataLoading = false
this.exporting = false
this.backScreenShot = false
if (snapshot !== '') {
this.snapshotInfo = snapshot
this.pdfExportShow = true

View File

@ -90,6 +90,13 @@
<i class="icon iconfont icon-font icon-chaolianjie1" />
{{ $t('panel.hyperlinks') }}
</el-dropdown-item>
<el-dropdown-item
v-if="curComponent.type !== 'user-view' && !curComponent.auxiliaryMatrix"
@click.native="positionAdjust"
>
<i class="el-icon-map-location" />
{{ $t('panel.position_adjust') }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
@ -213,6 +220,9 @@ export default {
this.showCustomSort = false
})
},
positionAdjust() {
bus.$emit('change_panel_right_draw', true)
},
edit() {
if (this.curComponent.type === 'custom') {
bus.$emit('component-dialog-edit', 'update')

View File

@ -585,6 +585,9 @@ export default {
updateParams['customAttr'] = this.sourceCustomAttrStr
} else if (param.custom === 'customStyle') {
const sourceCustomStyle = JSON.parse(this.sourceCustomStyleStr)
if (param.property === 'margin') {
sourceCustomStyle[param.property] = param.value
}
sourceCustomStyle[param.property][param.value.modifyName] = param.value[param.value.modifyName]
this.sourceCustomStyleStr = JSON.stringify(sourceCustomStyle)
this.chart.customStyle = this.sourceCustomStyleStr

View File

@ -1,4 +1,5 @@
import store from '@/store'
import eventBus from '@/components/canvas/utils/eventBus'
const ctrlKey = 17
const commandKey = 91 // mac command
@ -15,8 +16,13 @@ const bKey = 66 // 拆分
const lKey = 76 // 锁定
const dKey = 68 // 删除
const deleteKey = 46 // 删除
const sKey = 83 // 保存
const enlargeKey = 190 // command + .
export const keycodes = [66, 67, 68, 69, 71, 76, 80, 83, 85, 86, 88, 89, 90]
// 与组件状态无关的操作
@ -35,10 +41,13 @@ const unlockMap = {
[bKey]: decompose,
[dKey]: deleteComponent,
[deleteKey]: deleteComponent,
[lKey]: lock
[lKey]: lock,
[sKey]: save,
[enlargeKey]: viewEnlarge
}
let isCtrlOrCommandDown = false
// Monitor key operations globally and execute corresponding commands
export function listenGlobalKeyDown() {
window.onkeydown = (e) => {
@ -47,7 +56,7 @@ export function listenGlobalKeyDown() {
if (keyCode === ctrlKey || keyCode === commandKey) {
isCtrlOrCommandDown = true
} else if (isCtrlOrCommandDown) {
if (keyCode === zKey || keyCode === yKey) {
if (keyCode === zKey || keyCode === yKey || keyCode === vKey || keyCode === cKey || keyCode === sKey || keyCode === enlargeKey) {
e.preventDefault()
unlockMap[keyCode]()
}
@ -107,3 +116,11 @@ function deleteComponent() {
function lock() {
store.commit('lock')
}
function save() {
eventBus.$emit('checkAndSave')
}
function viewEnlarge() {
eventBus.$emit('viewEnlarge')
}

View File

@ -1,4 +1 @@
<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.09092 7.00066L7.51207 12.4218C7.64225 12.552 7.64225 12.763 7.51207 12.8932L7.04067 13.3646C6.91049 13.4948 6.69944 13.4948 6.56926 13.3646L0.676707 7.47206C0.416358 7.21171 0.416358 6.7896 0.676707 6.52925L6.56926 0.636694C6.69944 0.506519 6.91049 0.506519 7.04067 0.636694L7.51207 1.1081C7.64225 1.23827 7.64225 1.44933 7.51207 1.5795L2.09092 7.00066Z" fill="#1F2329" />
</svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="16px" height="16.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M393.390114 512.023536l347.948667-336.348468c20.50808-19.85828 20.50808-51.997258 0-71.792093-20.507056-19.826558-53.778834-19.826558-74.28589 0L281.990954 476.135164c-20.476357 19.826558-20.476357 51.981908 0 71.746044l385.061936 372.236839c10.285251 9.91379 23.728424 14.869662 37.173644 14.869662 13.446243 0 26.889417-4.956895 37.112246-14.901385 20.50808-19.826558 20.50808-51.919487 0-71.746044L393.390114 512.023536" /></svg>

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 697 B

View File

@ -1,4 +1 @@
<svg width="12" height="14" viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 11.3327V12.9994C12 13.3675 11.7015 13.666 11.3333 13.666H0.666667C0.298477 13.666 0 13.3675 0 12.9994V11.3327C0 11.1486 0.149238 10.9994 0.333333 10.9994H1C1.18409 10.9994 1.33333 11.1486 1.33333 11.3327V12.3327H10.6667V11.3327C10.6667 11.1486 10.8159 10.9994 11 10.9994H11.6667C11.8508 10.9994 12 11.1486 12 11.3327ZM6.66667 8.35649L8.67365 6.34952C8.80382 6.21934 9.01488 6.21934 9.14505 6.34952L9.61646 6.82092C9.74663 6.95109 9.74663 7.16215 9.61646 7.29232L6.31663 10.5922C6.25154 10.6572 6.16623 10.6898 6.08092 10.6898C5.99562 10.6898 5.91031 10.6572 5.84522 10.5922L2.54539 7.29232C2.41521 7.16215 2.41521 6.95109 2.54539 6.82092L3.01679 6.34952C3.14697 6.21934 3.35802 6.21934 3.4882 6.34952L5.33334 8.19465V0.999349C5.33334 0.815254 5.48257 0.666016 5.66667 0.666016H6.33334C6.51743 0.666016 6.66667 0.815254 6.66667 0.999349V8.35649Z" fill="#1F2329" />
</svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="16px" height="16.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M828.975746 894.125047 190.189132 894.125047c-70.550823 0-127.753639-57.18542-127.753639-127.752616L62.435493 606.674243c0-17.634636 14.308891-31.933293 31.93227-31.933293l63.889099 0c17.634636 0 31.93227 14.298658 31.93227 31.933293l0 95.821369c0 35.282574 28.596292 63.877843 63.87682 63.877843L765.098927 766.373455c35.281551 0 63.87682-28.595268 63.87682-63.877843l0-95.821369c0-17.634636 14.298658-31.933293 31.943526-31.933293l63.877843 0c17.634636 0 31.933293 14.298658 31.933293 31.933293l0 159.699212C956.729385 836.939627 899.538849 894.125047 828.975746 894.125047L828.975746 894.125047zM249.938957 267.509636c12.921287-12.919241 33.884738-12.919241 46.807049 0l148.97087 148.971893L445.716876 94.89323c0-17.634636 14.300704-31.94762 31.933293-31.94762l63.875796 0c17.637706 0 31.945573 14.312984 31.945573 31.94762l0 321.588299 148.97087-148.971893c12.921287-12.919241 33.875528-12.919241 46.796816 0l46.814212 46.818305c12.921287 12.922311 12.921287 33.874505 0 46.807049L552.261471 624.930025c-1.140986 1.137916-21.664416 13.68365-42.315758 13.69286-20.87647 0.010233-41.878806-12.541641-43.020816-13.69286L203.121676 361.13499c-12.922311-12.933567-12.922311-33.884738 0-46.807049L249.938957 267.509636 249.938957 267.509636z" fill="" /></svg>

Before

Width:  |  Height:  |  Size: 984 B

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1447,7 +1447,11 @@ export default {
total_sort_none: 'None',
total_sort_asc: 'ASC',
total_sort_desc: 'DESC',
total_sort_field: 'Sort Field'
total_sort_field: 'Sort Field',
empty_data_strategy: 'Empty Data Strategy',
break_line: 'Disconnection',
set_zero: 'Set Zero',
ignore_data: 'Ignore Data'
},
dataset: {
spend_time: 'Spend',
@ -1872,6 +1876,11 @@ export default {
back_parent: 'Back to previous'
},
panel: {
position_adjust: 'Position',
space_top: 'Top',
space_left: 'Left',
space_width: 'Widht',
space_height: 'Height',
to_top: 'To Top',
down: 'Down',
mobile_style_setting: 'Style setting',

View File

@ -1447,7 +1447,11 @@ export default {
total_sort_none: '無',
total_sort_asc: '升序',
total_sort_desc: '降序',
total_sort_field: '排序字段'
total_sort_field: '排序字段',
empty_data_strategy: '空值處理',
break_line: '線條斷開',
set_zero: '置為0線條不斷開',
ignore_data: '跳過空值,不展示'
},
dataset: {
spend_time: '耗時',
@ -1872,6 +1876,11 @@ export default {
back_parent: '返回上一級'
},
panel: {
position_adjust: '位置',
space_top: '上',
space_left: '左',
space_width: '寬',
space_height: '高',
to_top: '置頂',
down: '下載',
mobile_style_setting: '樣式設置',

View File

@ -1446,7 +1446,11 @@ export default {
total_sort_none: '无',
total_sort_asc: '升序',
total_sort_desc: '降序',
total_sort_field: '排序字段'
total_sort_field: '排序字段',
empty_data_strategy: '空值处理',
break_line: '线条断开',
set_zero: '置为0,线条不断开',
ignore_data: '跳过空值,不展示'
},
dataset: {
spend_time: '耗时',
@ -1872,6 +1876,11 @@ export default {
back_parent: '返回上一级'
},
panel: {
position_adjust: '位置',
space_top: '上',
space_left: '左',
space_width: '宽',
space_height: '高',
to_top: '置顶',
down: '下载',
mobile_style_setting: '样式设置',

View File

@ -22,12 +22,10 @@ import layer from '@/components/canvas/store/layer'
import snapshot from '@/components/canvas/store/snapshot'
import lock from '@/components/canvas/store/lock'
import task from './modules/task'
import { valueValid, formatCondition } from '@/utils/conditionUtil'
import { formatCondition, valueValid } from '@/utils/conditionUtil'
import { Condition } from '@/components/widget/bean/Condition'
import {
DEFAULT_COMMON_CANVAS_STYLE_STRING
} from '@/views/panel/panel'
import { DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel'
import bus from '@/utils/bus'
import { BASE_MOBILE_STYLE } from '@/components/canvas/customComponent/component-list'
import { TYPE_CONFIGS } from '@/views/chart/chart/util'
@ -236,10 +234,10 @@ const data = {
setShapeStyle({ curComponent, canvasStyleData, curCanvasScaleMap }, { top, left, width, height, rotate }) {
const curCanvasScaleSelf = curCanvasScaleMap[curComponent.canvasId]
if (curComponent) {
if (top || top === 0) curComponent.style.top = (top / curCanvasScaleSelf.scalePointHeight) + 0.0000001
if (left || left === 0) curComponent.style.left = (left / curCanvasScaleSelf.scalePointWidth) + 0.0000001
if (width || width === 0) curComponent.style.width = (width / curCanvasScaleSelf.scalePointWidth + 0.0000001)
if (height || height === 0) curComponent.style.height = (height / curCanvasScaleSelf.scalePointHeight) + 0.0000001
if (top || top === 0) curComponent.style.top = Math.round((top / curCanvasScaleSelf.scalePointHeight))
if (left || left === 0) curComponent.style.left = Math.round((left / curCanvasScaleSelf.scalePointWidth))
if (width || width === 0) curComponent.style.width = Math.round((width / curCanvasScaleSelf.scalePointWidth))
if (height || height === 0) curComponent.style.height = Math.round((height / curCanvasScaleSelf.scalePointHeight))
if (rotate || rotate === 0) curComponent.style.rotate = rotate
}
},

View File

@ -439,7 +439,8 @@ export const DEFAULT_FUNCTION_CFG = {
sliderRange: [0, 10],
sliderBg: '#FFFFFF',
sliderFillBg: '#BCD6F1',
sliderTextClolor: '#999999'
sliderTextClolor: '#999999',
emptyDataStrategy: 'breakLine'
}
export const DEFAULT_THRESHOLD = {
gaugeThreshold: '',

View File

@ -10,7 +10,8 @@ import {
getSlider,
getAnalyse
} from '@/views/chart/chart/common/common_antv'
import { antVCustomColor } from '@/views/chart/chart/util'
import { antVCustomColor, handleEmptyDataStrategy } from '@/views/chart/chart/util'
import _ from 'lodash'
export function baseLineOptionAntV(plot, container, chart, action) {
// theme
@ -23,7 +24,7 @@ export function baseLineOptionAntV(plot, container, chart, action) {
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
const data = chart.data.data
const data = _.cloneDeep(chart.data.data)
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)
@ -87,7 +88,8 @@ export function baseLineOptionAntV(plot, container, chart, action) {
}
// custom color
options.color = antVCustomColor(chart)
const emptyDataStrategy = chart.senior ? JSON.parse(chart.senior)?.functionCfg.emptyDataStrategy : 'breakLine'
handleEmptyDataStrategy(emptyDataStrategy, chart, data, options)
// 开始渲染
if (plot) {
plot.destroy()

View File

@ -37,7 +37,7 @@ const fillGradientColor = (data, colors) => {
})
return data
}
export function baseMapOption(chart_option, chart, themeStyle, curAreaCode) {
export function baseMapOption(chart_option, chart, themeStyle, curAreaCode, seriesId) {
// 处理shape attr
let customAttr = {}
let isGradient = false
@ -45,7 +45,7 @@ export function baseMapOption(chart_option, chart, themeStyle, curAreaCode) {
if (chart.customAttr) {
customAttr = JSON.parse(chart.customAttr)
if (chart.yaxis && chart.yaxis.length > 1) {
let currentSeriesId = customAttr.currentSeriesId
let currentSeriesId = seriesId
const yAxis = JSON.parse(chart.yaxis)
if (!currentSeriesId || !yAxis.some(item => item.id === currentSeriesId)) {
currentSeriesId = yAxis[0].id

View File

@ -3323,3 +3323,120 @@ export function getRemark(chart) {
}
export const quotaViews = ['label', 'richTextView', 'text', 'gauge', 'liquid']
export function handleEmptyDataStrategy(strategy, chart, data, options) {
if (!data?.length) {
return
}
if (strategy === 'ignoreData') {
handleIgnoreData(chart, data)
return
}
const yaxis = JSON.parse(chart.yaxis)
const extAxis = JSON.parse(chart.xaxisExt)
const multiDimension = yaxis?.length >= 2 || extAxis?.length > 0
switch (strategy) {
case 'breakLine': {
if (multiDimension) {
// 多维度线条断开
handleBreakLineMultiDimension(chart, data, options)
} else {
// 单维度线条断开
options.connectNulls = false
}
break
}
case 'setZero': {
if (multiDimension > 0) {
// 多维度置0
handleSetZeroMultiDimension(chart, data, options)
} else {
// 单维度置0
handleSetZeroSingleDimension(chart, data, options)
}
break
}
default:
break
}
}
function handleBreakLineMultiDimension(chart, data, options) {
options.connectNulls = false
const dimensionInfoMap = new Map()
const subDimensionSet = new Set()
for (let i = 0; i < data.length; i++) {
const item = data[i]
const dimensionInfo = dimensionInfoMap.get(item.field)
if (dimensionInfo) {
dimensionInfo.set.add(item.category)
} else {
dimensionInfoMap.set(item.field, { set: new Set([item.category]), index: i })
}
subDimensionSet.add(item.category)
}
// Map 是按照插入顺序排序的,所以插入索引往后推
let insertCount = 0
dimensionInfoMap.forEach((dimensionInfo, field) => {
if (dimensionInfo.set.size < subDimensionSet.size) {
const toBeFillDimension = [...subDimensionSet].filter(item => !dimensionInfo.set.has(item))
toBeFillDimension.forEach(dimension => {
data.splice(dimensionInfo.index + insertCount, 0, {
field,
value: null,
category: dimension
})
})
insertCount += toBeFillDimension.size
}
})
}
function handleSetZeroMultiDimension(chart, data) {
const dimensionInfoMap = new Map()
const subDimensionSet = new Set()
for (let i = 0; i < data.length; i++) {
const item = data[i]
if (item.value === null) {
item.value = 0
}
const dimensionInfo = dimensionInfoMap.get(item.field)
if (dimensionInfo) {
dimensionInfo.set.add(item.category)
} else {
dimensionInfoMap.set(item.field, { set: new Set([item.category]), index: i })
}
subDimensionSet.add(item.category)
}
let insertCount = 0
dimensionInfoMap.forEach((dimensionInfo, field) => {
if (dimensionInfo.set.size < subDimensionSet.size) {
const toBeFillDimension = [...subDimensionSet].filter(item => !dimensionInfo.set.has(item))
toBeFillDimension.forEach(dimension => {
data.splice(dimensionInfo.index + insertCount, 0, {
field,
value: 0,
category: dimension
})
})
insertCount += toBeFillDimension.size
}
})
}
function handleSetZeroSingleDimension(chart, data) {
data.forEach(item => {
if (item.value === null) {
item.value = 0
}
})
}
function handleIgnoreData(chart, data) {
for (let i = data.length - 1; i >= 0; i--) {
const item = data[i]
if (item.value === null) {
data.splice(i, 1)
}
}
}

View File

@ -119,7 +119,8 @@ export default {
linkageActiveParam: null,
buttonTextColor: null,
loading: true,
showSuspension: true
showSuspension: true,
currentSeriesId: null
}
},
@ -132,6 +133,11 @@ export default {
])
},
watch: {
currentSeriesId(value, old) {
if (value !== old) {
this.preDraw()
}
},
chart: {
handler(newVal, oldVla) {
this.preDraw()
@ -171,9 +177,7 @@ export default {
if (id !== this.chart.id) {
return
}
const customAttr = JSON.parse(this.chart.customAttr)
customAttr.currentSeriesId = seriesId
this.chart.customAttr = JSON.stringify(customAttr)
this.currentSeriesId = seriesId
},
reDrawView() {
this.myChart.dispatchAction({
@ -366,7 +370,7 @@ export default {
this.buttonTextColor = null
}
}
const chart_option = baseMapOption(base_json, chart, this.buttonTextColor, curAreaCode)
const chart_option = baseMapOption(base_json, chart, this.buttonTextColor, curAreaCode, this.currentSeriesId)
this.myEcharts(chart_option)
const opt = this.myChart.getOption()
if (opt && opt.series) {

View File

@ -79,10 +79,19 @@ export default {
this.chart.customAttr = JSON.stringify(this.customAttr)
},
callParent(methodName, param) {
this.$emit(methodName, param)
this.$emit(this.toLowerLine(methodName), param)
},
init() {
},
toLowerLine(str) {
var temp = str.replace(/[A-Z]/g, function(match) {
return '-' + match.toLowerCase()
})
if (temp.slice(0, 1) === '-') {
temp = temp.slice(1)
}
return temp
}
}
}

View File

@ -67,6 +67,20 @@
@change="changeFunctionCfg"
/>
</el-form-item>
<el-form-item
v-show="chart.render === 'antv' && chart.type === 'line'"
:label="$t('chart.empty_data_strategy')"
class="form-item"
>
<el-radio-group
v-model="functionForm.emptyDataStrategy"
@change="changeFunctionCfg"
>
<el-radio :label="'breakLine'">{{ $t('chart.break_line') }}</el-radio>
<el-radio :label="'setZero'">{{ $t('chart.set_zero') }}</el-radio>
<el-radio :label="'ignoreData'">{{ $t('chart.ignore_data') }}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</el-col>
</div>
@ -110,7 +124,7 @@ export default {
senior = JSON.parse(chart.senior)
}
if (senior.functionCfg) {
this.functionForm = senior.functionCfg
this.functionForm = { ...DEFAULT_FUNCTION_CFG, ...senior.functionCfg }
} else {
this.functionForm = JSON.parse(JSON.stringify(DEFAULT_FUNCTION_CFG))
}
@ -123,7 +137,7 @@ export default {
}
</script>
<style scoped>
<style scoped lang="scss">
.shape-item{
padding: 6px;
border: none;
@ -158,4 +172,12 @@ span{
cursor: pointer;
z-index: 1003;
}
.form-item ::v-deep .el-radio-group{
display: flex;
flex-direction: row;
flex-wrap: wrap;
label {
line-height: 28px;
}
}
</style>

View File

@ -74,7 +74,9 @@
round
@click="changeDs"
>
<span style="font-weight: bold">{{ $t('panel.template_view_tips') }}<i class="el-icon-refresh el-icon--right" /></span>
<span style="font-weight: bold">{{ $t('panel.template_view_tips') }}<i
class="el-icon-refresh el-icon--right"
/></span>
</el-button>
</span>
</div>
@ -1107,6 +1109,16 @@
</div>
</el-row>
</el-tab-pane>
<el-tab-pane
v-if="!curComponent.auxiliaryMatrix"
name="position"
:label="$t('panel.position_adjust')"
class="padding-tab"
style="width: 350px;"
>
<position-adjust />
</el-tab-pane>
</el-tabs>
<el-col
@ -1235,12 +1247,14 @@
<el-button
size="mini"
@click="closeRename()"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveRename"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
@ -1262,12 +1276,14 @@
<el-button
size="mini"
@click="closeQuotaFilter"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveQuotaFilter"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
<el-dialog
@ -1287,12 +1303,14 @@
<el-button
size="mini"
@click="closeDimensionFilter"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveDimensionFilter"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
<el-dialog
@ -1315,12 +1333,14 @@
<el-button
size="mini"
@click="closeResultFilter"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveResultFilter"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
@ -1346,7 +1366,8 @@
<el-button
size="mini"
@click="closeChangeChart"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@ -1382,7 +1403,8 @@
size="mini"
style="float: right;"
@click="closeEditDsField"
>{{ $t('chart.close') }}</el-button>
>{{ $t('chart.close') }}
</el-button>
</div>
</el-dialog>
@ -1411,7 +1433,8 @@
size="mini"
style="float: right;"
@click="closeEditChartField"
>{{ $t('chart.close') }}</el-button>
>{{ $t('chart.close') }}
</el-button>
</div>
</el-dialog>
@ -1436,12 +1459,14 @@
<el-button
size="mini"
@click="closeQuotaEditCompare"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveQuotaEditCompare"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
@ -1466,12 +1491,14 @@
<el-button
size="mini"
@click="closeValueFormatter"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveValueFormatter"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
@ -1498,12 +1525,14 @@
<el-button
size="mini"
@click="closeCustomSort"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveCustomSort"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
@ -1530,12 +1559,14 @@
<el-button
size="mini"
@click="closeStackCustomSort"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveStackCustomSort"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
@ -1562,10 +1593,11 @@
<script>
import {
ajaxGetDataOnly,
post,
getChartDetails,
viewEditSave,
resetViewCacheCallBack
pluginTypes,
post,
resetViewCacheCallBack,
viewEditSave
} from '@/api/chart/chart'
import DimensionItem from '../components/dragItem/DimensionItem'
import QuotaItem from '../components/dragItem/QuotaItem'
@ -1616,7 +1648,6 @@ import MapMapping from '@/views/chart/components/senior/MapMapping'
import AssistLine from '@/views/chart/components/senior/AssistLine'
import Threshold from '@/views/chart/components/senior/Threshold'
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
import { pluginTypes } from '@/api/chart/chart'
import ValueFormatterEdit from '@/views/chart/components/valueFormatter/ValueFormatterEdit'
import ChartStyle from '@/views/chart/view/ChartStyle'
import CustomSortEdit from '@/views/chart/components/compare/CustomSortEdit'
@ -1624,10 +1655,14 @@ import ScrollCfg from '@/views/chart/components/senior/ScrollCfg'
import ChartFieldEdit from '@/views/chart/view/ChartFieldEdit'
import CalcChartFieldEdit from '@/views/chart/view/CalcChartFieldEdit'
import { equalsAny } from '@/utils/StringUtils'
import MarginSelector from '@/views/chart/components/componentStyle/MarginSelector'
import PositionAdjust from '@/views/chart/view/PositionAdjust'
export default {
name: 'ChartEdit',
components: {
PositionAdjust,
MarginSelector,
ScrollCfg,
CalcChartFieldEdit,
ChartFieldEdit,
@ -1817,15 +1852,13 @@ export default {
'allViewRender'
])
/* pluginRenderOptions() {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
const pluginOptions = plugins.filter(plugin => !this.renderOptions.some(option => option.value === plugin.render)).map(plugin => {
return { name: plugin.render, value: plugin.render }
})
return [...this.renderOptions, ...pluginOptions]
} */
},
watch: {
'curComponent.auxiliaryMatrix': function(val) {
if (val && this.tabActive === 'position') {
this.tabActive = 'data'
}
},
'editStatus': function(val) {
if (val && this.param.id !== this.preChartId) {
this.preChartId = this.param.id
@ -2086,7 +2119,7 @@ export default {
ele.filter = []
}
})
if (view.type === 'table-pivot' || view.type === 'bar-group') {
if (view.type === 'table-pivot' || view.type === 'bar-group' || (view.render === 'antv' && view.type === 'line')) {
view.xaxisExt.forEach(function(ele) {
if (!ele.dateStyle || ele.dateStyle === '') {
ele.dateStyle = 'y_M_d'
@ -2237,7 +2270,8 @@ export default {
if (!view) return
viewEditSave(this.panelInfo.id, view).then(() => {
// this.getData(this.param.id)
bus.$emit('view-in-cache', { type: 'propChange',
bus.$emit('view-in-cache', {
type: 'propChange',
viewId: this.param.id,
view: view
})
@ -2270,7 +2304,12 @@ export default {
viewEditSave(this.panelInfo.id, viewSave)
if (modifyName === 'color') {
bus.$emit('view-in-cache', { type: 'styleChange', viewId: this.view.id, viewInfo: view, refreshProp: 'customAttr' })
bus.$emit('view-in-cache', {
type: 'styleChange',
viewId: this.view.id,
viewInfo: view,
refreshProp: 'customAttr'
})
} else {
bus.$emit('view-in-cache', { type: 'styleChange', viewId: this.view.id, viewInfo: view })
}
@ -2993,7 +3032,10 @@ export default {
const current = this.$refs.dynamicChart
this.setDetailMapCode(null)
if (this.view.isPlugin) {
current && current.callPluginInner && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: null })
current && current.callPluginInner && current.callPluginInner({
methodName: 'registerDynamicMap',
methodParam: null
})
} else {
current && current.registerDynamicMap && current.registerDynamicMap(null)
}
@ -3299,7 +3341,7 @@ export default {
}
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.padding-lr {
padding: 0 6px;
}
@ -3333,13 +3375,13 @@ export default {
.view-panel-Mask {
display: flex;
height: calc(100vh - 80px);
background-color: rgba(92,94,97, 0.7);
position:absolute;
top:0px;
background-color: rgba(92, 94, 97, 0.7);
position: absolute;
top: 0px;
left: 0px;
width: 350px;
z-index: 2;
cursor:not-allowed;
cursor: not-allowed;
display: flex;
align-items: center;
justify-content: center;
@ -3676,8 +3718,8 @@ span {
width: 100px !important;
}
::v-deep .el-slider__runway.show-input{
width: 80px!important;
::v-deep .el-slider__runway.show-input {
width: 80px !important;
}
.no-senior {
@ -3690,15 +3732,16 @@ span {
height: 100%;
}
.form-item-slider::v-deep.el-form-item__label{
.form-item-slider::v-deep.el-form-item__label {
font-size: 12px;
line-height: 38px;
}
.form-item::v-deep.el-form-item__label{
.form-item::v-deep.el-form-item__label {
font-size: 12px;
}
.field-name{
.field-name {
display: inline-block;
width: 90px;
word-break: break-all;
@ -3709,7 +3752,7 @@ span {
top: 2px;
}
.field-setting{
.field-setting {
position: absolute;
right: 8px;
}
@ -3722,19 +3765,19 @@ span {
visibility: visible;
}
.field-split{
.field-split {
height: calc(100% - 40px);
}
.field-split ::v-deep .fu-split-pane__left{
padding-right: 0!important;
.field-split ::v-deep .fu-split-pane__left {
padding-right: 0 !important;
}
.field-split ::v-deep .fu-split-pane__right{
padding-left: 0!important;
.field-split ::v-deep .fu-split-pane__right {
padding-left: 0 !important;
}
.view-panel-row ::v-deep .el-collapse-item__header{
.view-panel-row ::v-deep .el-collapse-item__header {
height: 34px !important;
line-height: 34px !important;
padding: 0 0 0 6px !important;
@ -3742,14 +3785,14 @@ span {
font-weight: 400 !important;
}
.data-area-label{
.data-area-label {
text-align: left;
position: relative;
width: 100%;
display: inline-block;
}
.data-area-clear{
.data-area-clear {
position: absolute;
top: 4px;
right: 6px;

View File

@ -0,0 +1,92 @@
<template>
<div style="width: 100%;padding: 10px;">
<el-col>
<el-form
label-width="40px"
size="mini"
>
<el-form-item
:label="$t('panel.space_top')"
class="form-item"
prop="marginTop"
>
<el-input
v-model="styleInfo.top"
type="number"
:min="0"
class="hide-icon-number"
>
<template slot="append">px</template>
</el-input>
</el-form-item>
<el-form-item
:label="$t('panel.space_left')"
:min="0"
class="form-item"
prop="marginTop"
>
<el-input
v-model="styleInfo.left"
type="number"
:min="0"
class="hide-icon-number"
>
<template slot="append">px</template>
</el-input>
</el-form-item>
<el-form-item
:label="$t('panel.space_width')"
:min="0"
class="form-item"
prop="marginTop"
>
<el-input
v-model="styleInfo.width"
type="number"
class="hide-icon-number"
>
<template slot="append">px</template>
</el-input>
</el-form-item>
<el-form-item
:label="$t('panel.space_height')"
:min="0"
class="form-item"
prop="marginTop"
>
<el-input
v-model="styleInfo.height"
type="number"
class="hide-icon-number"
>
<template slot="append">px</template>
</el-input>
</el-form-item>
</el-form>
</el-col>
</div>
</template>
<script>
export default {
name: 'PositionAdjust',
props: {},
data() {
return {}
},
computed: {
styleInfo() {
return this.$store.state.curComponent.style
}
},
watch: {},
mounted() {
},
methods: {}
}
</script>
<style scoped>
</style>

View File

@ -259,10 +259,10 @@ export default {
return this.$store.state.user.loginMsg
},
qrTypes() {
return this.loginTypes && this.loginTypes.filter(item => item > 3 && item < 8) || []
return this.loginTypes && this.loginTypes.filter(item => item > 3 && item < 7) || []
},
radioTypes() {
return this.loginTypes && this.loginTypes.filter(item => item < 4 || item > 7) || []
return this.loginTypes && this.loginTypes.filter(item => item < 4 || item > 6) || []
}
},
watch: {

View File

@ -283,11 +283,10 @@
@click="changeRightDrawOpen(false)"
/>
</el-tooltip>
<span style="font-weight: bold;font-size: 14px;margin-left: 40px;line-height:40px">{{ $t('panel.position_adjust') }}</span>
</el-row>
<el-row>
<div class="view-selected-message-class">
<span style="font-size: 14px;margin-left: 10px;font-weight: bold;line-height: 20px">{{ $t('panel.select_view') }}</span>
</div>
<position-adjust v-if="curComponent&&!curComponent.auxiliaryMatrix" />
</el-row>
</div>
</div>
@ -526,10 +525,12 @@ import DeCanvas from '@/components/canvas/DeCanvas'
import TextAttr from '@/components/canvas/components/TextAttr'
import { userLoginInfo } from '@/api/systemInfo/userLogin'
import { activeWatermark } from '@/components/canvas/tools/watermark'
import PositionAdjust from '@/views/chart/view/PositionAdjust'
export default {
name: 'PanelEdit',
components: {
PositionAdjust,
TextAttr,
DeCanvas,
Multiplexing,

View File

@ -117,7 +117,7 @@ export default {
initContent() {
this.templateContentChange = this.templateContent
for (const [key, value] of Object.entries(this.varsInfo)) {
this.templateContentChange = pdfTemplateReplaceAll(this.templateContentChange, key, value)
this.templateContentChange = pdfTemplateReplaceAll(this.templateContentChange, key, value || '')
}
},