feat:Data link编辑页面开发
This commit is contained in:
@@ -653,6 +653,65 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chart-dataLink-tooltip{
|
||||||
|
position: fixed;
|
||||||
|
min-width: 150px;
|
||||||
|
max-width: 600px;
|
||||||
|
display: block;
|
||||||
|
white-space: nowrap;
|
||||||
|
will-change: transform;
|
||||||
|
transition: opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;
|
||||||
|
border-radius: 4px;
|
||||||
|
font: 14 px/ 21px "Microsoft YaHei";
|
||||||
|
padding-top: 10px;
|
||||||
|
z-index: 9999999999;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: $--tooltip-background-color !important;
|
||||||
|
border: 2px solid $--tooltip-border-color !important;
|
||||||
|
border-color: $--tooltip-border-color !important;
|
||||||
|
color: $--color-text-regular !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
.chart-dataLink-title{
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding: 0 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
max-width: 500px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
font-size: 14px;
|
||||||
|
color: $--color-text-primary !important;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.chart-dataLink-content{
|
||||||
|
padding: 0 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.chart-dataLink-list{
|
||||||
|
margin-top: 10px;
|
||||||
|
border-top: 1px solid $--border-color-light;
|
||||||
|
.chart-dataLink-item{
|
||||||
|
padding: 0 10px;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover{
|
||||||
|
background: $--background-color-base;
|
||||||
|
color: $--color-primary !important;
|
||||||
|
}
|
||||||
|
.nz-icon{
|
||||||
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.graph-icon-info-box{
|
.graph-icon-info-box{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.style('font-size', function (d) {
|
.style('font-size', function (d) {
|
||||||
let fontSize
|
let fontSize
|
||||||
fontSize = d.r / 4 > 10 ? d.r / 4 : 0
|
fontSize = d.r / 3 > 10 ? d.r / 3 : 0
|
||||||
fontSize = fontSize > 30 ? 30 : fontSize
|
fontSize = fontSize > 30 ? 30 : fontSize
|
||||||
return fontSize
|
return fontSize
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
<div style="display: inline-block">{{tooltip.value}}</div>
|
<div style="display: inline-block">{{tooltip.value}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="chart-canvas-tooltip-content">
|
||||||
|
<div>percent</div>
|
||||||
|
<div>{{tooltip.percent}}%</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -87,6 +91,7 @@ export default {
|
|||||||
y: 0,
|
y: 0,
|
||||||
title: 0,
|
title: 0,
|
||||||
value: 0,
|
value: 0,
|
||||||
|
percent: 0,
|
||||||
mapping: {},
|
mapping: {},
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
@@ -181,6 +186,12 @@ export default {
|
|||||||
.value(d => d.value)
|
.value(d => d.value)
|
||||||
const arcs = pie(doughnutData)
|
const arcs = pie(doughnutData)
|
||||||
|
|
||||||
|
// 计算百分比
|
||||||
|
arcs.forEach(function (d) {
|
||||||
|
const percentage = (d.data.value / d3.sum(doughnutData, function (d) { return d.value })) * 100
|
||||||
|
d.percent = percentage.toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
function doughnutOver (e, d) {
|
function doughnutOver (e, d) {
|
||||||
chart.select('.path-' + d.index)
|
chart.select('.path-' + d.index)
|
||||||
.transition()
|
.transition()
|
||||||
@@ -297,6 +308,7 @@ export default {
|
|||||||
doughnutEnter (e, node) { // 移入气泡
|
doughnutEnter (e, node) { // 移入气泡
|
||||||
this.tooltip.title = node.data.alias
|
this.tooltip.title = node.data.alias
|
||||||
this.tooltip.value = node.data.showValue
|
this.tooltip.value = node.data.showValue
|
||||||
|
this.tooltip.percent = node.percent
|
||||||
this.tooltip.mapping = node.data.mapping
|
this.tooltip.mapping = node.data.mapping
|
||||||
this.tooltip.show = true
|
this.tooltip.show = true
|
||||||
this.setPosition(e)
|
this.setPosition(e)
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
<div style="display: inline-block">{{tooltip.value}}</div>
|
<div style="display: inline-block">{{tooltip.value}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="chart-canvas-tooltip-content">
|
||||||
|
<div>percent</div>
|
||||||
|
<div>{{tooltip.percent}}%</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -87,6 +91,7 @@ export default {
|
|||||||
y: 0,
|
y: 0,
|
||||||
title: 0,
|
title: 0,
|
||||||
value: 0,
|
value: 0,
|
||||||
|
percent: 0,
|
||||||
mapping: {},
|
mapping: {},
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
@@ -193,6 +198,12 @@ export default {
|
|||||||
|
|
||||||
const arcs = pie(roseData)
|
const arcs = pie(roseData)
|
||||||
|
|
||||||
|
// 计算百分比
|
||||||
|
arcs.forEach(function (d) {
|
||||||
|
const percentage = (d.data.value / d3.sum(roseData, function (d) { return d.value })) * 100
|
||||||
|
d.percent = percentage.toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
function roseOver (e, d) {
|
function roseOver (e, d) {
|
||||||
chart.select('.path-' + d.index)
|
chart.select('.path-' + d.index)
|
||||||
.transition()
|
.transition()
|
||||||
@@ -312,6 +323,7 @@ export default {
|
|||||||
roseEnter (e, node) { // 移入气泡
|
roseEnter (e, node) { // 移入气泡
|
||||||
this.tooltip.title = node.data.alias
|
this.tooltip.title = node.data.alias
|
||||||
this.tooltip.value = node.data.showValue
|
this.tooltip.value = node.data.showValue
|
||||||
|
this.tooltip.percent = node.percent
|
||||||
this.tooltip.mapping = node.data.mapping
|
this.tooltip.mapping = node.data.mapping
|
||||||
this.tooltip.show = true
|
this.tooltip.show = true
|
||||||
this.setPosition(e)
|
this.setPosition(e)
|
||||||
|
|||||||
@@ -537,6 +537,9 @@ export default {
|
|||||||
this.isStack = this.chartInfo.param.stack
|
this.isStack = this.chartInfo.param.stack
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
this.chartInfo.loaded && this.initChart(this.chartOption)
|
this.chartInfo.loaded && this.initChart(this.chartOption)
|
||||||
|
},
|
||||||
|
beforeDestroy () {
|
||||||
|
getChart(this.chartId) && getChart(this.chartId).getZr().off('mousemove')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -715,6 +715,7 @@ export default {
|
|||||||
bus.$off('creat-chart-success', this.createChartSuccess)
|
bus.$off('creat-chart-success', this.createChartSuccess)
|
||||||
bus.$off('groupChildMove', this.moveChart)
|
bus.$off('groupChildMove', this.moveChart)
|
||||||
window.removeEventListener('resize', this.resize)
|
window.removeEventListener('resize', this.resize)
|
||||||
|
document.onmousemove = null
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isShrink: {
|
isShrink: {
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (chartInfo.param.enable && chartInfo.param.enable.thresholds && !lodash.isEmpty(chartInfo.param.thresholds) && chartInfo.param.thresholds.length) { // 阈值
|
if (chartInfo.param.enable && chartInfo.param.enable.thresholds && !lodash.isEmpty(chartInfo.param.thresholds) && chartInfo.param.thresholds.length) { // 阈值
|
||||||
s.markLine = {
|
s.markLine = {
|
||||||
|
silent: true,
|
||||||
symbol: 'circle',
|
symbol: 'circle',
|
||||||
symbolSize: 5
|
symbolSize: 5
|
||||||
}
|
}
|
||||||
@@ -481,9 +482,6 @@ export default {
|
|||||||
this.chartId = `${this.chartInfo.id}${this.isFullscreen ? '-fullscreen' : ''}`
|
this.chartId = `${this.chartInfo.id}${this.isFullscreen ? '-fullscreen' : ''}`
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
try {
|
|
||||||
getChart(this.chartId) && getChart(this.chartId).getZr().off('mousemove')
|
|
||||||
} catch (error) {}
|
|
||||||
getChart(this.chartId) && setChart(this.chartId, null)
|
getChart(this.chartId) && setChart(this.chartId, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,7 +240,8 @@ export default {
|
|||||||
label: '',
|
label: '',
|
||||||
min: undefined,
|
min: undefined,
|
||||||
max: undefined
|
max: undefined
|
||||||
}
|
},
|
||||||
|
dataLink: []
|
||||||
},
|
},
|
||||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }],
|
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }],
|
||||||
panel: '',
|
panel: '',
|
||||||
@@ -274,12 +275,7 @@ export default {
|
|||||||
type: this.from,
|
type: this.from,
|
||||||
id: null
|
id: null
|
||||||
},
|
},
|
||||||
blankChartTemp: {
|
|
||||||
varType: 1,
|
|
||||||
pid: '',
|
|
||||||
dashboardId: null,
|
|
||||||
varIds: []
|
|
||||||
},
|
|
||||||
// removeModal: false, // 删除弹出
|
// removeModal: false, // 删除弹出
|
||||||
// deleteObj: {}, // 删除对象
|
// deleteObj: {}, // 删除对象
|
||||||
// ---图表相关参数--end
|
// ---图表相关参数--end
|
||||||
@@ -368,17 +364,7 @@ export default {
|
|||||||
this.$refs.addChartModal.isStable = 'stable'
|
this.$refs.addChartModal.isStable = 'stable'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addChartByTemp () {
|
|
||||||
this.chart = JSON.parse(JSON.stringify(this.blankChartTemp))
|
|
||||||
this.chart.dashboardId = this.showPanel.id
|
|
||||||
if (this.from === fromRoute.endpoint) {
|
|
||||||
this.chart.varType = 2
|
|
||||||
}
|
|
||||||
if (this.from === fromRoute.asset || this.from === fromRoute.endpoint) {
|
|
||||||
this.chart.varIds.push(this.obj.id)
|
|
||||||
}
|
|
||||||
this.rightBox.chartTemp.show = true
|
|
||||||
},
|
|
||||||
newChart () {
|
newChart () {
|
||||||
return JSON.parse(JSON.stringify(this.blankChart))
|
return JSON.parse(JSON.stringify(this.blankChart))
|
||||||
},
|
},
|
||||||
@@ -435,6 +421,23 @@ export default {
|
|||||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||||
this.chart.groupId = ''
|
this.chart.groupId = ''
|
||||||
}
|
}
|
||||||
|
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||||
|
this.chart.param.rightYAxis = {
|
||||||
|
elementNames: [],
|
||||||
|
style: 'line',
|
||||||
|
unit: 2,
|
||||||
|
label: '',
|
||||||
|
min: undefined,
|
||||||
|
max: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.chart.type === 'stat') {
|
||||||
|
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||||
|
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||||
|
}
|
||||||
|
if (!this.chart.param.dataLink) {
|
||||||
|
this.chart.param.dataLink = []
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.rightBox.loading = true
|
this.rightBox.loading = true
|
||||||
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
||||||
@@ -449,7 +452,10 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.chart.param = {}
|
this.chart.param = {}
|
||||||
}
|
}
|
||||||
if (!this.chart.param.rightYAxis) {
|
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||||
|
this.chart.groupId = ''
|
||||||
|
}
|
||||||
|
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||||
this.chart.param.rightYAxis = {
|
this.chart.param.rightYAxis = {
|
||||||
elementNames: [],
|
elementNames: [],
|
||||||
style: 'line',
|
style: 'line',
|
||||||
@@ -459,13 +465,13 @@ export default {
|
|||||||
max: undefined
|
max: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
|
||||||
this.chart.groupId = ''
|
|
||||||
}
|
|
||||||
if (this.chart.type === 'stat') {
|
if (this.chart.type === 'stat') {
|
||||||
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||||
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||||
}
|
}
|
||||||
|
if (!this.chart.param.dataLink) {
|
||||||
|
this.chart.param.dataLink = []
|
||||||
|
}
|
||||||
if (this.chart.type == 'table') {
|
if (this.chart.type == 'table') {
|
||||||
const arr = this.chart.param.indexs ? this.chart.param.indexs.split(',') : []
|
const arr = this.chart.param.indexs ? this.chart.param.indexs.split(',') : []
|
||||||
this.chart.param.tags = arr.map((item) => {
|
this.chart.param.tags = arr.map((item) => {
|
||||||
|
|||||||
@@ -1092,6 +1092,91 @@
|
|||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--Data link-->
|
||||||
|
<div class="form__sub-title" >
|
||||||
|
<span>{{$t('dashboard.dashboard.chartForm.dataLink')}}</span>
|
||||||
|
</div>
|
||||||
|
<draggable
|
||||||
|
v-model="chartConfig.param.dataLink"
|
||||||
|
@start="start"
|
||||||
|
@end="onEnd"
|
||||||
|
:scroll-sensitivity="150"
|
||||||
|
:options="{
|
||||||
|
dragClass:'drag-dataLink-class',
|
||||||
|
fallbackClass:'fallback-class',
|
||||||
|
forceFallback:true,
|
||||||
|
ghostClass:'chart-ghost',
|
||||||
|
chosenClass:'choose-class',
|
||||||
|
scroll:true,
|
||||||
|
filter: '.drag-disabled',
|
||||||
|
animation: 150,
|
||||||
|
handle: '.drag-sort'
|
||||||
|
}">
|
||||||
|
<div v-for="(item,index) in chartConfig.param.dataLink" :key="index" :class="item.error? 'is-item-box-error' : ''">
|
||||||
|
<div class="chart-title chart-title-config">
|
||||||
|
<span class="chart-title-content">
|
||||||
|
<i class="nz-icon nz-icon-arrow-down" :class="item.show?'':'is-active'" @click="showDataLink(index)"></i>
|
||||||
|
<span v-show="!item.show" class="title-content-left">
|
||||||
|
<span>
|
||||||
|
{{item.title}}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span @click="addDataLink()" :title="$t('tip.add')">
|
||||||
|
<i class="nz-icon nz-icon-create-square" style="font-weight: normal; font-size: 17px; cursor: pointer;"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px" :title="$t('overall.duplicate')">
|
||||||
|
<i @click="copyDataLink(index)" class="nz-icon nz-icon-override"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px" class="nz-icon-minus-medium" :title="$t('overall.delete')">
|
||||||
|
<i @click="removeDataLink(index)" class="nz-icon nz-icon-minus"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px;fontSize:17px;cursor: grab;" class="drag-sort" :title="$t('dashboard.dashboard.chartForm.sort')">
|
||||||
|
<i class="nz-icon nz-icon-sort" style="cursor: grab;"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<transition-group appear tag="div" name="el-zoom-in-top">
|
||||||
|
<el-row class="thresholds-item" v-show="item.show" :key="1">
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t("dashboard.dashboard.chartForm.title")}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- Title -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.title'" class="thresholds-from-item">
|
||||||
|
<el-input size="small" v-model="item.title" @change="change"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t('dashboard.dashboard.chartForm.openIn')}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- Open in -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.openIn'" class="thresholds-from-item">
|
||||||
|
<el-select
|
||||||
|
v-model="item.openIn"
|
||||||
|
size="small"
|
||||||
|
@change="change"
|
||||||
|
>
|
||||||
|
<el-option value="newTab" :label="$t('dashboard.dashboard.chartForm.newTab')"></el-option>
|
||||||
|
<el-option value="currentTab" :label="$t('dashboard.dashboard.chartForm.currentTab')"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="thresholds-item" v-show="item.show" :key="2">
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t('dashboard.dashboard.chartForm.dataLinkUrl')}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- url -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.url'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
|
||||||
|
<el-input v-model="item.url" size="small" @change="change('dataLink',index)"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</transition-group>
|
||||||
|
</div>
|
||||||
|
</draggable>
|
||||||
|
<div @click="addDataLink" class="thresholds-add">
|
||||||
|
{{$t('overall.addDataLink')}}
|
||||||
|
</div>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -1224,7 +1309,8 @@ export default {
|
|||||||
label: '',
|
label: '',
|
||||||
min: undefined,
|
min: undefined,
|
||||||
max: undefined
|
max: undefined
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.chartConfig.param.thresholds.push({ value: undefined, color: randomcolor() })
|
this.chartConfig.param.thresholds.push({ value: undefined, color: randomcolor() })
|
||||||
@@ -1266,7 +1352,8 @@ export default {
|
|||||||
result: 'show'
|
result: 'show'
|
||||||
},
|
},
|
||||||
sparklineMode: 'line',
|
sparklineMode: 'line',
|
||||||
comparison: 'none'
|
comparison: 'none',
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'bar':
|
case 'bar':
|
||||||
@@ -1298,7 +1385,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'table':
|
case 'table':
|
||||||
@@ -1325,7 +1413,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'log':
|
case 'log':
|
||||||
@@ -1347,7 +1436,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,8 +233,14 @@ export default {
|
|||||||
delete item.uid
|
delete item.uid
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (params.param.dataLink) {
|
||||||
|
params.param.dataLink.forEach(item => {
|
||||||
|
delete item.error
|
||||||
|
})
|
||||||
|
}
|
||||||
if (params.type === 'group') {
|
if (params.type === 'group') {
|
||||||
params.height = 1
|
params.height = 1
|
||||||
|
delete params.param.dataLink
|
||||||
}
|
}
|
||||||
if (!params.groupId) {
|
if (!params.groupId) {
|
||||||
params.groupId = 0
|
params.groupId = 0
|
||||||
@@ -389,7 +395,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.editChart.param.dataLink
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -415,7 +422,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.editChart.param.dataLink
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -456,7 +464,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.editChart.param.dataLink
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete this.editChart.elements
|
delete this.editChart.elements
|
||||||
@@ -481,7 +490,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.editChart.param.dataLink
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete this.editChart.elements
|
delete this.editChart.elements
|
||||||
|
|||||||
@@ -289,6 +289,93 @@
|
|||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--Data link-->
|
||||||
|
<template v-if="chartConfig.type!=='group'">
|
||||||
|
<div class="form__sub-title" >
|
||||||
|
<span>{{$t('dashboard.dashboard.chartForm.dataLink')}}</span>
|
||||||
|
</div>
|
||||||
|
<draggable
|
||||||
|
v-model="chartConfig.param.dataLink"
|
||||||
|
@start="start"
|
||||||
|
@end="onEnd"
|
||||||
|
:scroll-sensitivity="150"
|
||||||
|
:options="{
|
||||||
|
dragClass:'drag-dataLink-class',
|
||||||
|
fallbackClass:'fallback-class',
|
||||||
|
forceFallback:true,
|
||||||
|
ghostClass:'chart-ghost',
|
||||||
|
chosenClass:'choose-class',
|
||||||
|
scroll:true,
|
||||||
|
filter: '.drag-disabled',
|
||||||
|
animation: 150,
|
||||||
|
handle: '.drag-sort'
|
||||||
|
}">
|
||||||
|
<div v-for="(item,index) in chartConfig.param.dataLink" :key="index" :class="item.error? 'is-item-box-error' : ''">
|
||||||
|
<div class="chart-title chart-title-config">
|
||||||
|
<span class="chart-title-content">
|
||||||
|
<i class="nz-icon nz-icon-arrow-down" :class="item.show?'':'is-active'" @click="showDataLink(index)"></i>
|
||||||
|
<span v-show="!item.show" class="title-content-left">
|
||||||
|
<span>
|
||||||
|
{{item.title}}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span @click="addDataLink()" :title="$t('tip.add')">
|
||||||
|
<i class="nz-icon nz-icon-create-square" style="font-weight: normal; font-size: 17px; cursor: pointer;"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px" :title="$t('overall.duplicate')">
|
||||||
|
<i @click="copyDataLink(index)" class="nz-icon nz-icon-override"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px" class="nz-icon-minus-medium" :title="$t('overall.delete')">
|
||||||
|
<i @click="removeDataLink(index)" class="nz-icon nz-icon-minus"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px;fontSize:17px;cursor: grab;" class="drag-sort" :title="$t('dashboard.dashboard.chartForm.sort')">
|
||||||
|
<i class="nz-icon nz-icon-sort" style="cursor: grab;"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<transition-group appear tag="div" name="el-zoom-in-top">
|
||||||
|
<el-row class="thresholds-item" v-show="item.show" :key="1">
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t("dashboard.dashboard.chartForm.title")}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- Title -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.title'" class="thresholds-from-item">
|
||||||
|
<el-input size="small" v-model="item.title" @change="change"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t('dashboard.dashboard.chartForm.openIn')}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- Open in -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.openIn'" class="thresholds-from-item">
|
||||||
|
<el-select
|
||||||
|
v-model="item.openIn"
|
||||||
|
size="small"
|
||||||
|
@change="change"
|
||||||
|
>
|
||||||
|
<el-option value="newTab" :label="$t('dashboard.dashboard.chartForm.newTab')"></el-option>
|
||||||
|
<el-option value="currentTab" :label="$t('dashboard.dashboard.chartForm.currentTab')"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="thresholds-item" v-show="item.show" :key="2">
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t('dashboard.dashboard.chartForm.dataLinkUrl')}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- url -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.url'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
|
||||||
|
<el-input v-model="item.url" size="small" @change="change('dataLink',index)"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</transition-group>
|
||||||
|
</div>
|
||||||
|
</draggable>
|
||||||
|
<div @click="addDataLink" class="thresholds-add">
|
||||||
|
{{$t('overall.addDataLink')}}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -298,12 +385,14 @@ import publicConfig from '@/components/common/rightBox/chart/publicConfig'
|
|||||||
import chartTypeShow from '@/components/common/rightBox/chart/chartTypeShow'
|
import chartTypeShow from '@/components/common/rightBox/chart/chartTypeShow'
|
||||||
import diagram from '@/components/common/ChartDiagram/diagram'
|
import diagram from '@/components/common/ChartDiagram/diagram'
|
||||||
import richTextEditor from '@/components/chart/richTextEditor'
|
import richTextEditor from '@/components/chart/richTextEditor'
|
||||||
|
import draggable from 'vuedraggable'
|
||||||
export default {
|
export default {
|
||||||
name: 'otherChartConfig',
|
name: 'otherChartConfig',
|
||||||
mixins: [publicConfig, chartTypeShow],
|
mixins: [publicConfig, chartTypeShow],
|
||||||
components: {
|
components: {
|
||||||
diagram,
|
diagram,
|
||||||
richTextEditor
|
richTextEditor,
|
||||||
|
draggable
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 'chartConfig.param.text': {
|
// 'chartConfig.param.text': {
|
||||||
@@ -373,7 +462,8 @@ export default {
|
|||||||
},
|
},
|
||||||
repeat: {
|
repeat: {
|
||||||
variable: ''
|
variable: ''
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'text':
|
case 'text':
|
||||||
@@ -389,7 +479,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'diagram':
|
case 'diagram':
|
||||||
@@ -405,7 +496,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'url':
|
case 'url':
|
||||||
@@ -421,7 +513,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'clock':
|
case 'clock':
|
||||||
@@ -437,7 +530,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -455,6 +549,13 @@ export default {
|
|||||||
this.chartConfig.param.text = html
|
this.chartConfig.param.text = html
|
||||||
this.$refs.chartForm.validateField('param.text')
|
this.$refs.chartForm.validateField('param.text')
|
||||||
this.change()
|
this.change()
|
||||||
|
},
|
||||||
|
start () {
|
||||||
|
document.body.classList.add('isDrag')
|
||||||
|
},
|
||||||
|
onEnd () {
|
||||||
|
this.change()
|
||||||
|
document.body.classList.remove('isDrag')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
|||||||
@@ -685,6 +685,11 @@ export default {
|
|||||||
this.$emit('change', this.chartConfig)
|
this.$emit('change', this.chartConfig)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
tagsChange (newTags) {
|
||||||
|
this.chartConfig.param.tags = newTags
|
||||||
|
this.chartConfig.param.indexs = newTags.map(item => item.text).join(',')
|
||||||
|
this.change()
|
||||||
|
},
|
||||||
addColumns () {
|
addColumns () {
|
||||||
this.chartConfig.param.columns.push({
|
this.chartConfig.param.columns.push({
|
||||||
title: '',
|
title: '',
|
||||||
@@ -706,9 +711,25 @@ export default {
|
|||||||
this.chartConfig.param.columns[index].show = !this.chartConfig.param.columns[index].show
|
this.chartConfig.param.columns[index].show = !this.chartConfig.param.columns[index].show
|
||||||
this.change()
|
this.change()
|
||||||
},
|
},
|
||||||
tagsChange (newTags) {
|
addDataLink () {
|
||||||
this.chartConfig.param.tags = newTags
|
this.chartConfig.param.dataLink.push({
|
||||||
this.chartConfig.param.indexs = newTags.map(item => item.text).join(',')
|
show: true,
|
||||||
|
title: '',
|
||||||
|
url: '',
|
||||||
|
openIn: 'newTab'
|
||||||
|
})
|
||||||
|
this.change()
|
||||||
|
},
|
||||||
|
copyDataLink (index) {
|
||||||
|
this.chartConfig.param.dataLink.push({ ...this.chartConfig.param.dataLink[index] })
|
||||||
|
this.change()
|
||||||
|
},
|
||||||
|
removeDataLink (index) {
|
||||||
|
this.chartConfig.param.dataLink.splice(index, 1)
|
||||||
|
this.change()
|
||||||
|
},
|
||||||
|
showDataLink (index) {
|
||||||
|
this.chartConfig.param.dataLink[index].show = !this.chartConfig.param.dataLink[index].show
|
||||||
this.change()
|
this.change()
|
||||||
},
|
},
|
||||||
enableChange (type) {
|
enableChange (type) {
|
||||||
|
|||||||
@@ -440,7 +440,7 @@
|
|||||||
<draggable
|
<draggable
|
||||||
v-model="chartConfig.param.columns"
|
v-model="chartConfig.param.columns"
|
||||||
@start="start"
|
@start="start"
|
||||||
@end="end"
|
@end="onEnd"
|
||||||
:scroll-sensitivity="150"
|
:scroll-sensitivity="150"
|
||||||
:options="{
|
:options="{
|
||||||
dragClass:'drag-columns-class',
|
dragClass:'drag-columns-class',
|
||||||
@@ -542,7 +542,7 @@
|
|||||||
<draggable
|
<draggable
|
||||||
v-model="chartConfig.param.valueMapping"
|
v-model="chartConfig.param.valueMapping"
|
||||||
@start="start"
|
@start="start"
|
||||||
@end="end"
|
@end="onEnd"
|
||||||
:scroll-sensitivity="150"
|
:scroll-sensitivity="150"
|
||||||
:options="{
|
:options="{
|
||||||
dragClass:'drag-valueMapping-class',
|
dragClass:'drag-valueMapping-class',
|
||||||
@@ -839,6 +839,91 @@
|
|||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--Data link-->
|
||||||
|
<div class="form__sub-title" >
|
||||||
|
<span>{{$t('dashboard.dashboard.chartForm.dataLink')}}</span>
|
||||||
|
</div>
|
||||||
|
<draggable
|
||||||
|
v-model="chartConfig.param.dataLink"
|
||||||
|
@start="start"
|
||||||
|
@end="onEnd"
|
||||||
|
:scroll-sensitivity="150"
|
||||||
|
:options="{
|
||||||
|
dragClass:'drag-dataLink-class',
|
||||||
|
fallbackClass:'fallback-class',
|
||||||
|
forceFallback:true,
|
||||||
|
ghostClass:'chart-ghost',
|
||||||
|
chosenClass:'choose-class',
|
||||||
|
scroll:true,
|
||||||
|
filter: '.drag-disabled',
|
||||||
|
animation: 150,
|
||||||
|
handle: '.drag-sort'
|
||||||
|
}">
|
||||||
|
<div v-for="(item,index) in chartConfig.param.dataLink" :key="index" :class="item.error? 'is-item-box-error' : ''">
|
||||||
|
<div class="chart-title chart-title-config">
|
||||||
|
<span class="chart-title-content">
|
||||||
|
<i class="nz-icon nz-icon-arrow-down" :class="item.show?'':'is-active'" @click="showDataLink(index)"></i>
|
||||||
|
<span v-show="!item.show" class="title-content-left">
|
||||||
|
<span>
|
||||||
|
{{item.title}}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span @click="addDataLink()" :title="$t('tip.add')">
|
||||||
|
<i class="nz-icon nz-icon-create-square" style="font-weight: normal; font-size: 17px; cursor: pointer;"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px" :title="$t('overall.duplicate')">
|
||||||
|
<i @click="copyDataLink(index)" class="nz-icon nz-icon-override"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px" class="nz-icon-minus-medium" :title="$t('overall.delete')">
|
||||||
|
<i @click="removeDataLink(index)" class="nz-icon nz-icon-minus"></i>
|
||||||
|
</span>
|
||||||
|
<span style="margin-right: 5px;fontSize:17px;cursor: grab;" class="drag-sort" :title="$t('dashboard.dashboard.chartForm.sort')">
|
||||||
|
<i class="nz-icon nz-icon-sort" style="cursor: grab;"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<transition-group appear tag="div" name="el-zoom-in-top">
|
||||||
|
<el-row class="thresholds-item" v-show="item.show" :key="1">
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t("dashboard.dashboard.chartForm.title")}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- Title -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.title'" class="thresholds-from-item">
|
||||||
|
<el-input size="small" v-model="item.title" @change="change"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t('dashboard.dashboard.chartForm.openIn')}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- Open in -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.openIn'" class="thresholds-from-item">
|
||||||
|
<el-select
|
||||||
|
v-model="item.openIn"
|
||||||
|
size="small"
|
||||||
|
@change="change"
|
||||||
|
>
|
||||||
|
<el-option value="newTab" :label="$t('dashboard.dashboard.chartForm.newTab')"></el-option>
|
||||||
|
<el-option value="currentTab" :label="$t('dashboard.dashboard.chartForm.currentTab')"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="thresholds-item" v-show="item.show" :key="2">
|
||||||
|
<div>
|
||||||
|
<div class='mapping-display'>{{$t('dashboard.dashboard.chartForm.dataLinkUrl')}}</div>
|
||||||
|
</div>
|
||||||
|
<!-- url -->
|
||||||
|
<el-form-item :prop="'param.dataLink.' + index + '.url'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
|
||||||
|
<el-input v-model="item.url" size="small" @change="change('dataLink',index)"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</transition-group>
|
||||||
|
</div>
|
||||||
|
</draggable>
|
||||||
|
<div @click="addDataLink" class="thresholds-add">
|
||||||
|
{{$t('overall.addDataLink')}}
|
||||||
|
</div>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -1005,7 +1090,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'bar':
|
case 'bar':
|
||||||
@@ -1038,7 +1124,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'table':
|
case 'table':
|
||||||
@@ -1065,7 +1152,8 @@ export default {
|
|||||||
operator: 'equal',
|
operator: 'equal',
|
||||||
varValue: '',
|
varValue: '',
|
||||||
result: 'show'
|
result: 'show'
|
||||||
}
|
},
|
||||||
|
dataLink: this.chartConfig.param.dataLink
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -1127,7 +1215,7 @@ export default {
|
|||||||
start () {
|
start () {
|
||||||
document.body.classList.add('isDrag')
|
document.body.classList.add('isDrag')
|
||||||
},
|
},
|
||||||
end () {
|
onEnd () {
|
||||||
this.change()
|
this.change()
|
||||||
document.body.classList.remove('isDrag')
|
document.body.classList.remove('isDrag')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,7 +261,8 @@ export default {
|
|||||||
label: '',
|
label: '',
|
||||||
min: undefined,
|
min: undefined,
|
||||||
max: undefined
|
max: undefined
|
||||||
}
|
},
|
||||||
|
dataLink: []
|
||||||
},
|
},
|
||||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }],
|
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1, orderNum: 0 }],
|
||||||
panel: '',
|
panel: '',
|
||||||
@@ -275,12 +276,6 @@ export default {
|
|||||||
pageSize: -1, // 此处获取所有数据
|
pageSize: -1, // 此处获取所有数据
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
blankChartTemp: {
|
|
||||||
varType: 1,
|
|
||||||
pid: '',
|
|
||||||
dashboardId: '',
|
|
||||||
varIds: []
|
|
||||||
},
|
|
||||||
panelData: [],
|
panelData: [],
|
||||||
panelDataDragTmp: [],
|
panelDataDragTmp: [],
|
||||||
searchMsg: { // 给搜索框子组件传递的信息
|
searchMsg: { // 给搜索框子组件传递的信息
|
||||||
@@ -566,11 +561,6 @@ export default {
|
|||||||
this.$refs.addChartModal.isStable = 'stable'
|
this.$refs.addChartModal.isStable = 'stable'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addChartByTemp () {
|
|
||||||
this.chart = JSON.parse(JSON.stringify(this.blankChartTemp))
|
|
||||||
this.chart.dashboardId = this.showPanel.id
|
|
||||||
this.rightBox.chartTemp.show = true
|
|
||||||
},
|
|
||||||
addGroupItem (groupId) {
|
addGroupItem (groupId) {
|
||||||
this.chart = this.newChart()
|
this.chart = this.newChart()
|
||||||
this.chart.groupId = groupId
|
this.chart.groupId = groupId
|
||||||
@@ -604,6 +594,23 @@ export default {
|
|||||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||||
this.chart.groupId = ''
|
this.chart.groupId = ''
|
||||||
}
|
}
|
||||||
|
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||||
|
this.chart.param.rightYAxis = {
|
||||||
|
elementNames: [],
|
||||||
|
style: 'line',
|
||||||
|
unit: 2,
|
||||||
|
label: '',
|
||||||
|
min: undefined,
|
||||||
|
max: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.chart.type === 'stat') {
|
||||||
|
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||||
|
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||||
|
}
|
||||||
|
if (!this.chart.param.dataLink) {
|
||||||
|
this.chart.param.dataLink = []
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.rightBox.loading = true
|
this.rightBox.loading = true
|
||||||
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
||||||
@@ -618,7 +625,10 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.chart.param = {}
|
this.chart.param = {}
|
||||||
}
|
}
|
||||||
if (!this.chart.param.rightYAxis) {
|
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||||
|
this.chart.groupId = ''
|
||||||
|
}
|
||||||
|
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||||
this.chart.param.rightYAxis = {
|
this.chart.param.rightYAxis = {
|
||||||
elementNames: [],
|
elementNames: [],
|
||||||
style: 'line',
|
style: 'line',
|
||||||
@@ -628,13 +638,13 @@ export default {
|
|||||||
max: undefined
|
max: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
|
||||||
this.chart.groupId = ''
|
|
||||||
}
|
|
||||||
if (this.chart.type === 'stat') {
|
if (this.chart.type === 'stat') {
|
||||||
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||||
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||||
}
|
}
|
||||||
|
if (!this.chart.param.dataLink) {
|
||||||
|
this.chart.param.dataLink = []
|
||||||
|
}
|
||||||
if (this.chart.type == 'table') {
|
if (this.chart.type == 'table') {
|
||||||
const arr = this.chart.param.indexs ? this.chart.param.indexs.split(',') : []
|
const arr = this.chart.param.indexs ? this.chart.param.indexs.split(',') : []
|
||||||
this.chart.param.tags = arr.map((item) => {
|
this.chart.param.tags = arr.map((item) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user