feat:添加chart 同步按钮 以及 修改时间显示不正确的问题

This commit is contained in:
zhangyu
2021-05-20 14:07:58 +08:00
parent 0f5176cd48
commit f805795f1d
13 changed files with 125 additions and 11 deletions

View File

@@ -59,6 +59,9 @@
<el-dropdown-item v-has="'panel_chart_add'">
<div id="chart-temp-add" @click="addChartByTemp"><i class="nz-icon nz-icon-add"></i>{{ $t('overall.AddByTemplate') }}</div>
</el-dropdown-item>
<el-dropdown-item v-has="'panel_chart_edit'">
<div id="chart-temp-sync" @click="chartBySync"><i class="nz-icon nz-icon-sync"></i>{{ $t('overall.syncChart') }}</div>
</el-dropdown-item>
</template>
</top-tool-more-options>
</div>
@@ -296,6 +299,16 @@ export default {
this.chart.panelId = this.showPanel.id
this.rightBox.chartTemp.show = true
},
chartBySync () {
this.$post('visual/panel/chart/syncTmpl', { panelId: this.showPanel.id }).then(res => {
if (res.code === 200) {
this.getData(this.filter)
this.$message.success(this.$t('tip.syncSuccess'))
} else {
this.$message.error(res.msg)
}
})
},
addGroupItem (groupId) {
this.chart = this.newChart()
this.chart.groupId = groupId