update standard

This commit is contained in:
Qiuxia Fan 2022-03-23 17:01:44 +08:00
parent e9b9f51061
commit e3779d2a06
5 changed files with 30 additions and 25 deletions

View File

@ -318,11 +318,11 @@ function aggregation(val: number, standard: any): number | string {
data = val - Number(standard.plus);
return data;
}
if (!isNaN(standard.multiply)) {
if (!isNaN(standard.multiply) && standard.divide !== 0) {
data = val * Number(standard.multiply);
return data;
}
if (!isNaN(standard.divide)) {
if (!isNaN(standard.divide) && standard.divide !== 0) {
data = val / Number(standard.divide);
return data;
}

View File

@ -214,9 +214,9 @@ function exportTemplates() {
});
const name = `dashboards.json`;
saveFile(templates, name);
setTimeout(() => {
multipleTableRef.value!.clearSelection();
}, 2000);
// setTimeout(() => {
// multipleTableRef.value!.clearSelection();
// }, 2000);
}
function handleEdit(row: DashboardItem) {
dashboardStore.setMode(true);

View File

@ -55,61 +55,67 @@ limitations under the License. -->
</div>
<div class="item">
<span class="label">{{ t("plus") }}</span>
<el-input
<el-input-number
class="input"
v-model="selectedGrid.standard.plus"
:min="0"
size="small"
placeholder="none"
placeholder="Please input"
@change="changeStandardOpt"
/>
</div>
<div class="item">
<span class="label">{{ t("minus") }}</span>
<el-input
<el-input-number
class="input"
v-model="selectedGrid.standard.minus"
:min="0"
size="small"
placeholder="none"
placeholder="Please input"
@change="changeStandardOpt"
/>
</div>
<div class="item">
<span class="label">{{ t("multiply") }}</span>
<el-input
<el-input-number
class="input"
v-model="selectedGrid.standard.multiply"
:min="1"
size="small"
placeholder="none"
placeholder="Please input"
@change="changeStandardOpt"
/>
</div>
<div class="item">
<span class="label">{{ t("divide") }}</span>
<el-input
<el-input-number
class="input"
v-model="selectedGrid.standard.divide"
size="small"
placeholder="none"
placeholder="Please input"
:min="1"
@change="changeStandardOpt"
/>
</div>
<div class="item">
<span class="label">{{ t("convertToMilliseconds") }}</span>
<el-input
<el-input-number
class="input"
:min="0"
v-model="selectedGrid.standard.milliseconds"
size="small"
placeholder="none"
placeholder="Please input"
@change="changeStandardOpt"
/>
</div>
<div class="item">
<span class="label">{{ t("convertToSeconds") }}</span>
<el-input
<el-input-number
class="input"
:min="0"
v-model="selectedGrid.standard.seconds"
size="small"
placeholder="none"
placeholder="Please input"
@change="changeStandardOpt"
/>
</div>

View File

@ -44,15 +44,16 @@ limitations under the License. -->
</el-table-column>
<el-table-column label="Service Instances">
<template #default="scope">
<div class="attributes">
<div class="attributes" v-if="scope.row.attributes.length">
<div
v-for="(attr, index) in scope.row.attributes"
:key="attr.name + index"
:style="{ fontSize: `${config.fontSize}px` }"
>
{{ attr.name }}: {{ attr.value }}
{{ attr.name }}: {{ attr.value || null }}
</div>
</div>
<div v-else>No Data</div>
</template>
</el-table-column>
<el-table-column

View File

@ -330,6 +330,10 @@ function changeMode() {
}
function clickIcons(t: { id: string; content: string; name: string }) {
if (t.id === "apply") {
applyDashboard();
return;
}
if (
dashboardStore.selectedGrid &&
dashboardStore.selectedGrid.type === "Tab"
@ -361,9 +365,6 @@ function setTabControls(id: string) {
case "addTopology":
dashboardStore.addTabControls("Topology");
break;
case "apply":
applyDashboard();
break;
default:
ElMessage.info("Don't support this control");
break;
@ -390,9 +391,6 @@ function setControls(id: string) {
case "addTopology":
dashboardStore.addControl("Topology");
break;
case "apply":
applyDashboard();
break;
default:
dashboardStore.addControl("Widget");
}