File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
ui/src/components/dynamics-form/items/radio Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 55 :key =" item.value"
66 class =" item"
77 shadow =" never"
8- :class =" [modelValue == item[valueField] ? 'active' : '']"
9- @click =" selected(item[valueField])"
8+ :class =" [inputDisabled ? 'is-disabled' : '', modelValue == item[valueField] ? 'active' : '']"
9+ @click =" inputDisabled ? () => {} : selected(item[valueField])"
1010 >
1111 {{ item[textField] }}
1212 </el-card >
1515<script lang="ts" setup>
1616import { computed , ref } from ' vue'
1717import type { FormField } from ' @/components/dynamics-form/type'
18+ import { useFormDisabled } from ' element-plus'
19+ const inputDisabled = useFormDisabled ()
20+
1821const props = defineProps <{
1922 formValue? : any
2023 formfieldList? : Array <FormField >
@@ -24,6 +27,7 @@ const props = defineProps<{
2427 view? : boolean
2528 // 选中的值
2629 modelValue? : any
30+ disabled? : boolean
2731}>()
2832
2933const selected = (activeValue : string | number ) => {
@@ -66,6 +70,16 @@ const option_list = computed(() => {
6670 flex-wrap : wrap ;
6771 justify-content : flex-start ;
6872 width : 100% ;
73+
74+ .is-disabled {
75+ border : 1px solid var (--el-card-border-color );
76+ background-color : var (--el-fill-color-light );
77+ color : var (--el-text-color-placeholder );
78+ cursor : not-allowed ;
79+ & :hover {
80+ cursor : not-allowed ;
81+ }
82+ }
6983 .active {
7084 border : 1px solid var (--el-color-primary );
7185 color : var (--el-color-primary );
Original file line number Diff line number Diff line change 44 v-for =" item in option_list"
55 :key =" item.value"
66 class =" item"
7- :class =" [modelValue == item[valueField] ? 'active' : '']"
7+ :class =" [inputDisabled ? 'is-disabled' : '', modelValue == item[valueField] ? 'active' : '']"
88 @click =" selected(item[valueField])"
99 >
1010 {{ item[textField] }}
1414<script lang="ts" setup>
1515import { computed } from ' vue'
1616import type { FormField } from ' @/components/dynamics-form/type'
17+ import { useFormDisabled } from ' element-plus'
18+ const inputDisabled = useFormDisabled ()
1719const props = defineProps <{
1820 formValue? : any
1921 formfieldList? : Array <FormField >
@@ -54,7 +56,15 @@ const option_list = computed(() => {
5456 padding : 3px 4px ;
5557 box-sizing : border-box ;
5658 white-space : nowrap ;
57-
59+ .is-disabled {
60+ border : 1px solid var (--el-card-border-color );
61+ background-color : var (--el-fill-color-light );
62+ color : var (--el-text-color-placeholder );
63+ cursor : not-allowed ;
64+ & :hover {
65+ cursor : not-allowed ;
66+ }
67+ }
5868 .active {
5969 border-radius : 4px ;
6070 background : var (--el-color-primary-light-9 );
You can’t perform that action at this time.
0 commit comments