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

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

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