|
|
@@ -1,5 +1,5 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { useAttrs } from 'vue';
|
|
|
+import { computed, useAttrs } from 'vue';
|
|
|
import type { SelectProps } from 'naive-ui';
|
|
|
import { useDict } from '@/hooks/business/dict';
|
|
|
import type { disctSelectProps } from '.';
|
|
|
@@ -15,6 +15,15 @@ const value = defineModel<string | string[] | null>('value', { required: false }
|
|
|
|
|
|
const attrs: SelectProps = useAttrs();
|
|
|
const { options } = useDict(props.dictCode, props.immediate);
|
|
|
+const newOptions = computed(() => {
|
|
|
+ return options.value.map(item => {
|
|
|
+ return {
|
|
|
+ label: item.label,
|
|
|
+ value: item.value,
|
|
|
+ disabled: Boolean(props.disabledLables?.includes(item.label))
|
|
|
+ };
|
|
|
+ });
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -22,7 +31,7 @@ const { options } = useDict(props.dictCode, props.immediate);
|
|
|
v-model:value="value"
|
|
|
:multiple="multiple"
|
|
|
:loading="!options.length"
|
|
|
- :options="options"
|
|
|
+ :options="newOptions"
|
|
|
:clear-filter-after-select="false"
|
|
|
v-bind="attrs"
|
|
|
/>
|