fix':取消assetModel sync的选项 更换预览按钮为Save&Sync

This commit is contained in:
zhangyu
2020-10-21 14:15:58 +08:00
parent cb37350914
commit 2e6e9a7ef0
4 changed files with 23 additions and 17 deletions

View File

@@ -2188,7 +2188,7 @@ li{
display: inline-block; display: inline-block;
width: 350px; width: 350px;
} }
.right-box-form>.el-form-item.half-form-item-other:nth-child(odd){ .right-box-form>.el-form-item.half-form-item-other-two{
display: inline-block; display: inline-block;
width: 390px; width: 390px;
margin-left: 0; margin-left: 0;

View File

@@ -82,7 +82,8 @@ const cn = {
back:'区域缩放还原', back:'区域缩放还原',
stack: "查看堆叠图", stack: "查看堆叠图",
stackBack:'返回原始图' stackBack:'返回原始图'
} },
SyncSave:'保存同时更新 Assets'
}, },
webshell: { webshell: {
shellTitle: "本地 Shell", shellTitle: "本地 Shell",

View File

@@ -86,7 +86,8 @@ const en = {
back:'Area scaling restore', back:'Area scaling restore',
stack:'Show stack chart', stack:'Show stack chart',
stackBack:'Back to original chart' stackBack:'Back to original chart'
} },
SyncSave:'Save&Sync'
}, },
pageSize: '/page', pageSize: '/page',
webshell:{ webshell:{

View File

@@ -147,14 +147,6 @@
<span class="nz-input-append">px</span> <span class="nz-input-append">px</span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('dashboard.panel.chartForm.last')" v-if="editChart.type == 'table'">
<el-switch class="exporter-switch" v-model="editChart.param.last" active-color="#ee9d3f" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<el-form-item :label="$t('dashboard.panel.chartForm.sync')" v-if="showPanel.type && showPanel.type == 'model'">
<el-switch class="exporter-switch" v-model="editChart.sync" active-color="#ee9d3f" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<el-form-item v-if="isUrl" :label='$t("dashboard.panel.chartForm.url")' prop="param.url" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur' }"> <el-form-item v-if="isUrl" :label='$t("dashboard.panel.chartForm.url")' prop="param.url" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur' }">
<el-input size="small" type="textarea" maxlength="1024" show-word-limit v-model="editChart.param.url"></el-input> <el-input size="small" type="textarea" maxlength="1024" show-word-limit v-model="editChart.param.url"></el-input>
</el-form-item> </el-form-item>
@@ -169,6 +161,14 @@
<el-input size="mini" type="input" v-model="editChart.param.threshold"></el-input> <el-input size="mini" type="input" v-model="editChart.param.threshold"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('dashboard.panel.chartForm.last')" v-if="editChart.type == 'table'">
<el-switch class="exporter-switch" v-model="editChart.param.last" active-color="#ee9d3f" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<!--<el-form-item :label="$t('dashboard.panel.chartForm.sync')" v-if="showPanel.type && showPanel.type == 'model'">-->
<!--<el-switch class="exporter-switch" v-model="editChart.sync" active-color="#ee9d3f" :active-value="1" :inactive-value="0"></el-switch>-->
<!--</el-form-item>-->
<div v-if="!isUrl&&!isAlert&& editChart.type != 'text'" class="right-box-sub-title" style="margin-bottom: 20px"> <div v-if="!isUrl&&!isAlert&& editChart.type != 'text'" class="right-box-sub-title" style="margin-bottom: 20px">
<span>{{$t('alert.config.expr')}}</span> <span>{{$t('alert.config.expr')}}</span>
<span v-if="!isSingleStat" style="height: 19px;display: inline-block;line-height: 1;" class="float-right" @click="addExpression"> <span v-if="!isSingleStat" style="height: 19px;display: inline-block;line-height: 1;" class="float-right" @click="addExpression">
@@ -246,7 +246,7 @@
<el-form-item :label="$t('dashboard.panel.chartForm.valMapping.value')" prop="span" class="half-form-item-other" > <el-form-item :label="$t('dashboard.panel.chartForm.valMapping.value')" prop="span" class="half-form-item-other" >
<el-input size="mini" type="input" v-model="mapping.value" style="display: inline-block;;"></el-input> <el-input size="mini" type="input" v-model="mapping.value" style="display: inline-block;;"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('dashboard.panel.chartForm.valMapping.text')" prop="span" class="half-form-item-other"> <el-form-item :label="$t('dashboard.panel.chartForm.valMapping.text')" prop="span" class="half-form-item-other half-form-item-other-two">
<el-input size="mini" type="input" v-model="mapping.text" style="display: inline-block;width:calc(100% - 40px);"></el-input> <el-input size="mini" type="input" v-model="mapping.text" style="display: inline-block;width:calc(100% - 40px);"></el-input>
<span @click="delMapping(index)" class="nz-icon-minus-medium" style="margin-left: 7px;padding: 6px"><i class="nz-icon nz-icon-minus" style="color: #EC7F66"></i></span> <span @click="delMapping(index)" class="nz-icon-minus-medium" style="margin-left: 7px;padding: 6px"><i class="nz-icon nz-icon-minus" style="color: #EC7F66"></i></span>
</el-form-item> </el-form-item>
@@ -303,12 +303,12 @@
<button @click="esc(false)" id="chart-box-esc" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new"> <button @click="esc(false)" id="chart-box-esc" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new">
<span>{{$t('overall.cancel')}}</span> <span>{{$t('overall.cancel')}}</span>
</button> </button>
<button @click="preview" id="chart-box-preview" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new"> <button @click="SyncSave" id="chart-box-Sync" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new" v-if="showPanel.type && showPanel.type == 'model'">
<span>{{$t('overall.SyncSave')}}</span>
</button>
<button @click="preview" id="chart-box-preview" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new" v-else>
<span>{{$t('overall.preview')}}</span> <span>{{$t('overall.preview')}}</span>
</button> </button>
<!--<button @click="SyncSave" id="chart-box-Sync" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new">-->
<!--<span>{{$t('overall.SyncSave')}}</span>-->
<!--</button>-->
<button @click="confirmAdd" id="chart-box-save" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new"> <button @click="confirmAdd" id="chart-box-save" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new">
<span>{{$t('overall.save')}}</span> <span>{{$t('overall.save')}}</span>
</button> </button>
@@ -699,7 +699,7 @@
}); });
} }
} }
}) });
panelPromise.then(()=>{ panelPromise.then(()=>{
if (panelId) { if (panelId) {
@@ -837,6 +837,10 @@
} }
}) })
}, },
SyncSave(){
this.editChart.sync=1;
this.confirmAdd();
},
confirmAdd() { confirmAdd() {
this.elementTarget = []; // 初始化清空参数 this.elementTarget = []; // 初始化清空参数
if(this.editChart.type!=='url'&&this.editChart.type != 'text'){ if(this.editChart.type!=='url'&&this.editChart.type != 'text'){