|
@@ -138,18 +138,11 @@ const getFields = (arr: ComponentSchema[]) => {
|
|
|
const openAllStyle = computed({
|
|
const openAllStyle = computed({
|
|
|
get() {
|
|
get() {
|
|
|
const formData = props.formData || {}
|
|
const formData = props.formData || {}
|
|
|
- const valueLength = Object.keys(formData).length
|
|
|
|
|
const fields = getFields(props.formItemsSchema || []).flat(Infinity)
|
|
const fields = getFields(props.formItemsSchema || []).flat(Infinity)
|
|
|
-
|
|
|
|
|
- let hasNotValue = false
|
|
|
|
|
- fields.forEach((field) => {
|
|
|
|
|
- if (!has(formData, field) && field !== 'part') {
|
|
|
|
|
- hasNotValue = true
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const styleFields = fields.filter((field) => field !== 'part')
|
|
|
|
|
|
|
|
// 所有样式都开启
|
|
// 所有样式都开启
|
|
|
- return !!valueLength && !hasNotValue
|
|
|
|
|
|
|
+ return styleFields.some((field) => has(formData, field))
|
|
|
},
|
|
},
|
|
|
set(val: boolean) {
|
|
set(val: boolean) {
|
|
|
emit('change', val ? 'select' : 'cancel')
|
|
emit('change', val ? 'select' : 'cancel')
|