Merge pull request 'master' (#54) from master into test

Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/54
This commit is contained in:
2024-09-15 12:13:00 +00:00

View File

@@ -1,9 +1,9 @@
<template>
<div class="tag-style">
<el-tag v-if="tagConfig.isType" :type="tagConfig.listClass" :effect="tagConfig.theme || 'plain'">
<el-tag v-if="tagConfig?.isType" :type="tagConfig?.listClass" :effect="tagConfig?.theme || 'plain'">
{{ filterDict(cacheStore.getDict(dictType), value) }}
</el-tag>
<el-tag v-else :color="tagConfig.listClass" :effect="tagConfig.theme || 'plain'"
<el-tag v-else :color="tagConfig?.listClass" :effect="tagConfig?.theme || 'plain'"
:class="{'null-tag':filterDict(cacheStore.getDict(dictType), value)===undefined}">
{{ filterDict(cacheStore.getDict(dictType), value) }}
</el-tag>
@@ -45,7 +45,7 @@ const filterDict = (data, value) => {
tagConfig.value = data.find(item => item.value == value)
}
}
return tagConfig.value.label
return tagConfig.value?.label || '未知'
}
</script>