diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index 176bc528d..043061b6b 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -37,20 +37,20 @@ - + - + - + - + - + diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue index fd88e6d6d..a0ee2c7dd 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue @@ -23,6 +23,7 @@ -1) { url = '/asset/asset/template' param.type = 'asset' - } else if (this.paramsType === 'dashboard') { + } else if (this.importUrl.indexOf('panel') > -1) { url = 'visual/panel/template' - } else if (this.paramsType === 'endpoint') { + param.type = this.paramsType + } else if (this.importUrl.indexOf('endpoint') > -1) { url = '/monitor/endpoint/template' param.type = 'endpoint' } else if (this.importUrl.indexOf('tmpl') > -1) { @@ -244,12 +248,12 @@ export default { }, exportCur () { const params = JSON.parse(JSON.stringify(this.params)) - if (this.params2){ - Object.keys(this.params2).forEach(key=>{ - if ( params[key] ) { - if ( params[key].prototype.toString.call(val) === '[object Object]' ){ - Object.assign(params[key],this.params2[key]) - } else if (params[key].prototype.toString.call(val) === '[object Array]'){ + if (this.params2) { + Object.keys(this.params2).forEach(key => { + if (params[key]) { + if (params[key].prototype.toString.call(val) === '[object Object]') { + Object.assign(params[key], this.params2[key]) + } else if (params[key].prototype.toString.call(val) === '[object Array]') { params[key].concat(this.params2[key]) } } else { @@ -270,12 +274,12 @@ export default { }, exportAll () { const params = JSON.parse(JSON.stringify(this.params)) - if (this.params2){ - Object.keys(this.params2).forEach(key=>{ - if ( params[key] ) { - if ( params[key].prototype.toString.call(val) === '[object Object]' ){ - Object.assign(params[key],this.params2[key]) - } else if (params[key].prototype.toString.call(val) === '[object Array]'){ + if (this.params2) { + Object.keys(this.params2).forEach(key => { + if (params[key]) { + if (params[key].prototype.toString.call(val) === '[object Object]') { + Object.assign(params[key], this.params2[key]) + } else if (params[key].prototype.toString.call(val) === '[object Array]') { params[key].concat(this.params2[key]) } } else { @@ -367,16 +371,16 @@ export default { }, formatNum (num) { return num > 9 ? num : '0' + num - }, - getParamsType () { - const path = this.$route.path - switch (path) { - case '/panel': this.paramsType = 'dashboard'; break - case '/asset': this.paramsType = 'asset'; break - case '/monitor/endpoint': this.paramsType = 'endpoint'; break - default: this.paramsType = ''; break - } } + // getParamsType () { + // const path = this.$route.path + // switch (path) { + // case '/panel': this.paramsType = 'dashboard'; break + // case '/asset': this.paramsType = 'asset'; break + // case '/monitor/endpoint': this.paramsType = 'endpoint'; break + // default: this.paramsType = ''; break + // } + // } }, watch: { panelLock: { diff --git a/nezha-fronted/src/components/common/project/L5/CanvasProps.vue b/nezha-fronted/src/components/common/project/L5/CanvasProps.vue index 735a6234d..1a853ed1b 100644 --- a/nezha-fronted/src/components/common/project/L5/CanvasProps.vue +++ b/nezha-fronted/src/components/common/project/L5/CanvasProps.vue @@ -697,7 +697,7 @@
+ v-model="selection.pen.font.textBaseline" value-key="chartType" @change="onChange"> {{item.name}} diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue index 937e4277f..d54c5eb88 100644 --- a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue @@ -566,8 +566,13 @@ export default { this.$refs.form.validate((valid) => { if (valid) { - if (this.editAsset.id) { - this.$put(this.url, this.editAsset).then(res => { + const params = JSON.parse(JSON.stringify(this.editAsset)) + if (params.type.vm !== 1) { + params.parent = {} + params.pid = '' + } + if (params.id) { + this.$put(this.url, params).then(res => { this.prevent_opt.save = false if (res.code === 200) { this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) @@ -577,7 +582,7 @@ export default { } }) } else { - this.$post(this.url, this.editAsset).then(res => { + this.$post(this.url, params).then(res => { this.prevent_opt.save = false if (res.code === 200) { this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index a27ae279a..7a6ce2ec5 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -44,6 +44,7 @@ import: 'panel_chart_add', export: 'panel_view' }" + :paramsType="'dashboard'" class="top-tool-export" export-file-name="chart" export-url="/visual/panel/export"