fix: entity

This commit is contained in:
Fine 2024-01-12 13:40:28 +08:00
parent 48956acc9e
commit 37a3eebfcc
2 changed files with 5 additions and 3 deletions

View File

@ -158,8 +158,9 @@ limitations under the License. -->
</template> </template>
<Metrics <Metrics
:type="'hierarchyServicesConfig'" :type="'hierarchyServicesConfig'"
:expressions="currentRow.expressions" :expressions="currentRow.expressions || []"
:layer="currentRow.layer" :layer="currentRow.layer"
:entity="currentRow.entity"
@update="updateSettings" @update="updateSettings"
/> />
</el-popover> </el-popover>

View File

@ -72,6 +72,7 @@ limitations under the License. -->
isExpression: { type: Boolean, default: true }, isExpression: { type: Boolean, default: true },
layer: { type: String, default: "" }, layer: { type: String, default: "" },
expressions: { type: Array<string>, default: () => [] }, expressions: { type: Array<string>, default: () => [] },
entity: { type: String, default: EntityType[0].value },
}); });
const { t } = useI18n(); const { t } = useI18n();
const emit = defineEmits(["update"]); const emit = defineEmits(["update"]);
@ -120,7 +121,7 @@ limitations under the License. -->
const { dashboard } = getDashboard( const { dashboard } = getDashboard(
{ {
layer: props.layer || "", layer: props.layer || "",
entity: EntityType[0].value, entity: props.entity,
}, },
ConfigFieldTypes.ISDEFAULT, ConfigFieldTypes.ISDEFAULT,
); );
@ -165,7 +166,7 @@ limitations under the License. -->
}; };
} }
watch( watch(
() => props.type, () => [props.type, ...props.expressions],
() => { () => {
currentMetric.value = metricList.value[0].value; currentMetric.value = metricList.value[0].value;
const config = getMetricConfig.value || []; const config = getMetricConfig.value || [];