NEZ-2662 asset,endpoint dashboard导出选项不支持 all data

This commit is contained in:
zyh
2023-03-08 17:29:25 +08:00
parent 95918356eb
commit 531683ac1c

View File

@@ -105,7 +105,7 @@
<div class="export-box"> <div class="export-box">
<span class="export-title">{{$t('export.records')}}</span> <span class="export-title">{{$t('export.records')}}</span>
<el-radio-group v-model="importBox.record" size="small"> <el-radio-group v-model="importBox.record" size="small">
<el-radio-button :label="item.value" v-for="(item,index) in recordArr" :key="index" :disabled="item.value==='records'&&!deleteObjs.length"> <el-radio-button :label="item.value" v-for="(item,index) in recordArr" :key="index" :disabled="(item.value==='records'&&!deleteObjs.length) || (item.value==='all'&&assetOrEndpoint)">
{{item.name}} {{item.name}}
<span v-if="item.value==='records'&&deleteObjs.length">({{deleteObjs.length}})</span> <span v-if="item.value==='records'&&deleteObjs.length">({{deleteObjs.length}})</span>
</el-radio-button> </el-radio-button>
@@ -281,6 +281,10 @@ export default {
isDashboard () { isDashboard () {
return this.importUrl === '/visual/panel/import' return this.importUrl === '/visual/panel/import'
}, },
// assetendpoint dashboard导出选项不支持 all data
assetOrEndpoint () {
return this.paramsType === 'asset' || this.paramsType === 'endpoint'
},
// 是否同步更新关联的dashboard // 是否同步更新关联的dashboard
showSyncDashboard () { showSyncDashboard () {
// asset endpoint model // asset endpoint model
@@ -645,7 +649,7 @@ export default {
if (this.paramsType) { if (this.paramsType) {
params.type = this.paramsType params.type = this.paramsType
} }
if (params.from == 'asset') { if (this.assetOrEndpoint) {
delete params.type delete params.type
delete params.from delete params.from
} }
@@ -699,6 +703,10 @@ export default {
showImportBox (type) { showImportBox (type) {
this.importBox.show = true this.importBox.show = true
this.importBox.type = type this.importBox.type = type
if (this.assetOrEndpoint) {
this.importBox.record = 'current'
}
// isDashboard 只支持JSON // isDashboard 只支持JSON
if (this.isDashboard) { if (this.isDashboard) {
this.importBox.format = 3 this.importBox.format = 3