提交 803792fe authored 作者: taojinlong's avatar taojinlong

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

......@@ -365,6 +365,7 @@
custom_filter,
drill_fields,
SNAPSHOT,
senior,
data_from)
SELECT pv_copy.chart_view_id AS id,
`name`,
......@@ -392,6 +393,7 @@
custom_filter,
drill_fields,
SNAPSHOT,
senior,
data_from
FROM (
SELECT panel_id,
......
......@@ -751,6 +751,9 @@ export default {
}
return [null, null]
},
triggerPluginEdit(e) {
this.elementMouseDown(e)
},
// 元素触摸按下
elementTouchDown(e) {
eventsFor = events.touch
......
......@@ -2,10 +2,11 @@
<div class="bg" :style="customStyle" @scroll="canvasScroll">
<div id="canvasInfoMain" ref="canvasInfoMain" :style="canvasInfoMainStyle">
<el-row v-if="showUnpublishedArea" class="custom-position">
<pre>
<svg-icon icon-class="unpublished" style="font-size: 75px" />
{{ $t('panel.panel_off') }}
</pre>
<div style="text-align: center">
<svg-icon icon-class="unpublished" style="font-size: 75px" />
<br>
<span>{{ $t('panel.panel_off') }}</span>
</div>
</el-row>
<el-row v-else-if="componentDataShow.length===0" class="custom-position">
{{ $t('panel.panelNull') }}
......
......@@ -100,6 +100,7 @@
:h="getShapeStyleIntDeDrag(item.style,'height')"
:canvas-style-data="canvasStyleData"
@input="handleInput"
@trigger-plugin-edit="pluginEditHandler"
/>
</de-drag>
<!--拖拽阴影部分-->
......@@ -1067,6 +1068,21 @@ export default {
created() {
},
methods: {
pluginEditHandler({ e, id }) {
let index = -1
for (let i = 0; i < this.componentData.length; i++) {
const item = this.componentData[i]
const itemId = item.id
if (id === itemId) {
index = i
break
}
}
if (index >= 0) {
const _this = this
_this.$refs.deDragRef && _this.$refs.deDragRef[index] && _this.$refs.deDragRef[index].triggerPluginEdit && _this.$refs.deDragRef[index].triggerPluginEdit(e)
}
},
linkageActiveCheck(item) {
return this.linkageSettingStatus && item === this.curLinkageView
},
......
......@@ -36,6 +36,7 @@
class="chart-class"
@onChartClick="chartClick"
@onJumpClick="jumpClick"
@trigger-edit-click="pluginEditHandler"
/>
<chart-component
v-else-if="charViewShowFlag"
......@@ -417,6 +418,9 @@ export default {
}
},
methods: {
pluginEditHandler(e) {
this.$emit('trigger-plugin-edit', { e, id: this.element.id })
},
batchOptChange(param) {
if (this.curBatchOptComponents.includes(this.element.propValue.viewId)) {
this.$store.state.styleChangeTimes++
......@@ -545,14 +549,7 @@ export default {
// 将视图传入echart组件
if (response.success) {
this.chart = response.data
if (this.isEdit) {
this.componentViewsData[this.chart.id] = {
'title': this.chart.title,
'render': this.chart.render,
'type': this.chart.type,
'isPlugin': this.chart.isPlugin
}
}
this.getDataOnly(response.data)
this.chart['position'] = this.inTab ? 'tab' : 'panel'
// 记录当前数据
this.panelViewDetailsInfo[id] = JSON.stringify(this.chart)
......@@ -609,7 +606,6 @@ export default {
tableChart.customStyle = JSON.stringify(tableChart.customStyle)
eventBus.$emit('openChartDetailsDialog', { chart: this.chart, tableChart: tableChart })
},
chartClick(param) {
if (this.drillClickDimensionList.length < this.chart.drillFields.length - 1) {
(this.chart.type === 'map' || this.chart.type === 'buddle-map') && this.sendToChildren(param)
......@@ -863,6 +859,21 @@ export default {
}
this.mergeScale()
}
},
getDataOnly(sourceResponseData) {
if (this.isEdit) {
if ((this.filter.filter && this.filter.filter.length) || (this.filter.linkageFilters && this.filter.linkageFilters.length)) {
viewData(this.chart.id, this.panelInfo.id, {
filter: [],
drill: [],
queryFrom: 'panel'
}).then(response => {
this.componentViewsData[this.chart.id] = response.data
})
} else {
this.componentViewsData[this.chart.id] = sourceResponseData
}
}
}
}
}
......
......@@ -411,8 +411,7 @@ const list = [
verticalAlign: 'middle',
borderStyle: 'solid',
borderColor: '#000000',
time_margin: 0,
padding: 10
time_margin: 0
},
formatInfo: {
openMode: '0',
......
......@@ -130,7 +130,7 @@ export function baseGaugeOption(chart_option, chart, scale = 1) {
}
}
}
console.log(chart_option.series[0])
// console.log(chart_option.series[0])
// console.log(chart_option);
componentStyle(chart_option, chart)
return chart_option
......
......@@ -71,7 +71,7 @@
</el-form-item>
<span v-show="showProperty('axisLabel') && axisForm.axisLabel.show">
<el-form-item :label="$t('chart.axis_label_color')" class="form-item">
<el-color-picker class="el-color-picker" :predefine="predefineColors" @change="changeXAxisStyle('axisLabel')" />
<el-color-picker v-model="axisForm.axisLabel.color" class="el-color-picker" :predefine="predefineColors" @change="changeXAxisStyle('axisLabel')" />
</el-form-item>
<el-form-item :label="$t('chart.axis_label_rotate')" class="form-item form-item-slider">
<el-slider v-model="axisForm.axisLabel.rotate" show-input :show-input-controls="false" :min="-90" :max="90" input-size="mini" @change="changeXAxisStyle('axisLabel')" />
......
......@@ -257,7 +257,7 @@ export default {
.item-span-style{
display: inline-block;
width: 100px;
width: 80px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
......
<template>
<div ref="tableContainer" :style="bg_class" style="padding: 8px;width: 100%;height: 100%;overflow: hidden;">
<div ref="tableContainer" :style="bg_class" style="width: 100%;height: 100%;overflow: hidden;">
<view-track-bar ref="viewTrack" :track-menu="trackMenu" class="track-bar" :style="trackBarStyleTime" @trackClick="trackClick" />
<p v-show="title_show" ref="title" :style="title_class">{{ chart.title }}</p>
<div
......
......@@ -1191,7 +1191,7 @@ export default {
return this.chartConfig ? this.chartConfig.propertyInner : null
},
chartType() {
return this.chart.type
return this.chart ? this.chart.type : null
},
panelInfo() {
return this.$store.state.panel.panelInfo
......@@ -1199,7 +1199,8 @@ export default {
...mapState([
'curComponent',
'panelViewEditInfo',
'allViewRender'
'allViewRender',
'componentViewsData'
])
/* pluginRenderOptions() {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
......@@ -1238,6 +1239,9 @@ export default {
}
},
created() {
this.bindPluginEvent()
this.initFromPanel()
this.chartInit()
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views'))
if (plugins) {
this.loadPluginType()
......@@ -1253,9 +1257,6 @@ export default {
}
},
mounted() {
this.bindPluginEvent()
this.initFromPanel()
this.chartInit()
},
activated() {
},
......@@ -1282,7 +1283,9 @@ export default {
this.resetDrill()
this.initFromPanel()
this.getChart(this.param.id)
this.getData(this.param.id)
if (this.componentViewsData[this.param.id]) {
this.chart = this.componentViewsData[this.param.id]
}
},
bindPluginEvent() {
bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter)
......@@ -1599,7 +1602,7 @@ export default {
const view = this.buildParam(true, 'chart', false, switchType)
if (!view) return
viewEditSave(this.panelInfo.id, view).then(() => {
this.getData(this.param.id)
// this.getData(this.param.id)
bus.$emit('view-in-cache', { type: 'propChange', viewId: this.param.id })
})
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论