NEZ-2634 feat:集成详情页面dashboard更新

This commit is contained in:
zyh
2023-03-06 17:37:09 +08:00
parent a2c698ce6a
commit 0689209aa5
7 changed files with 93 additions and 69 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div v-clickoutside="{obj: editDashboard, func: esc}" class="right-box right-box-dashboard-temp">
<div class="right-box__header">
<div class="header__title">{{$t("dashboard.panel.createPanelTitle")}}</div>
<div class="header__title">{{from==='integration'?$t("overall.tempImport"):$t("dashboard.panel.createPanelTitle")}}</div>
<div class="header__operation">
<span v-cancel="{obj: editDashboard, func: esc}"><i class="nz-icon nz-icon-close" :title="$t('overall.close')"></i></span>
</div>
@@ -16,6 +16,7 @@
<!-- dashboardTemplate -->
<el-form-item :label="$t('upload.template')" prop="tmplId">
<v-selectpage
:disabled="from==='integration'"
:data="templateList"
:tb-columns="ChartSearchShowFields"
:multiple="false"
@@ -75,6 +76,7 @@ import bus from '@/libs/bus'
import editRigthBox from '../mixin/editRigthBox'
export default {
props: {
from: String
},
mixins: [editRigthBox],
data () {
@@ -224,11 +226,16 @@ export default {
}, 50),
// 获取dashboard模板列表
getDashboardTempData () {
this.$get('visual/panel', { type: 'template', pageSize: -1 }).then(response => {
if (response.code === 200) {
this.templateList = response.data.list
}
})
if (this.from === 'integration') {
this.editDashboard.tmplId = String(this.$parent.tempId)
this.templateList = this.$loadsh.cloneDeep(this.$parent.panelData)
} else {
this.$get('visual/panel', { type: 'template', pageSize: -1 }).then(response => {
if (response.code === 200) {
this.templateList = response.data.list
}
})
}
},
// 根据选中模板vartype请求数据
getTableData () {
@@ -265,13 +272,13 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
// 模板varType ≠ 0时link有效且必填
if (this.templateType == 0) {
if (!this.templateType) {
delete params.link
}
this.$post(this.url, params).then(response => {
this.prevent_opt.save = false
if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.$message({ duration: 1000, type: 'success', message: this.from === 'integration' ? this.$t('overall.result.successfully') : this.$t('tip.saveSuccess') })
this.esc(true)
} else {
this.$message.error(response.msg)