diff --git a/src/components/DictTag/index.vue b/src/components/DictTag/index.vue index e28dd097..5d4628bb 100644 --- a/src/components/DictTag/index.vue +++ b/src/components/DictTag/index.vue @@ -15,14 +15,24 @@ const props = defineProps({ type: [Number, String], default: '', }, + /**数据默认值,当前值不存在时 */ + valueOption: { + type: [Number, String], + }, }); /**遍历找到对应值数据项 */ const item = computed(() => { if (Array.isArray(props.options) && props.options.length > 0) { - const option = (props.options as any[]).find( + let option = (props.options as any[]).find( item => `${item[props.valueField]}` === `${props.value}` ); + // 数据默认值 + if (props.valueOption != undefined && !option) { + option = (props.options as any[]).find( + item => `${item[props.valueField]}` === `${props.valueOption }` + ); + } return option; } return undefined; diff --git a/src/views/dashboard/overview/components/UserActivity/index.vue b/src/views/dashboard/overview/components/UserActivity/index.vue index 8d2cbd83..f86e2f45 100644 --- a/src/views/dashboard/overview/components/UserActivity/index.vue +++ b/src/views/dashboard/overview/components/UserActivity/index.vue @@ -85,9 +85,9 @@ onMounted(() => {
{{ t('views.dashboard.overview.userActivity.caller') }}: - {{ - item.data.callerParty - }} + + {{ item.data.callerParty }} +
{{ t('views.dashboard.overview.userActivity.called') }}: @@ -104,7 +104,7 @@ onMounted(() => {
{{ t('views.dashboard.overview.userActivity.result') }}:  - + {{ t('views.dashboard.overview.userActivity.resultOK') }}