Skip to content

Commit

Permalink
fix: 修复移动端单据详情字段必填校验的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luofann committed Oct 25, 2023
1 parent 12252b9 commit e592408
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 1 addition & 3 deletions frontend/weixin/src/components/renderField/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ export default defineComponent({
})
const results = validateFns.map(fn => fn())
const required = results.every(item => item)
const allNotSupportTypes = [...notSupportEditTypes, ...notSupportTypes]
const hasNotSupportField = fields.value.some(field => allNotSupportTypes.indexOf(field.type) !== -1)
return required && !hasNotSupportField
return required
}

/** 字段隐藏逻辑处理 */
Expand Down
11 changes: 7 additions & 4 deletions frontend/weixin/src/components/renderField/notSupport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->

<template>
<div v-if="!isViewMode" class="not-support required">
<div v-if="!isViewMode" :class="['not-support', { required: isRequire }]">
<span class="van-ellipsis">{{ item.name }}
<van-icon name="info-o" color="#ffb213" @click="handelNotSupportPrompt" />
</span>
Expand All @@ -36,7 +36,7 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { defineComponent, computed, toRefs } from 'vue'
import { Toast } from 'vant'

export default defineComponent({
Expand All @@ -51,14 +51,17 @@ export default defineComponent({
default: false
}
},
setup() {
setup(props) {
const { item } = toRefs(props)
const isRequire = computed(() => item.value.validate_type === 'REQUIRE')

const handelNotSupportPrompt = () => {
Toast({
message: '暂不支持操作,请至PC端处理',
className: 'not-support-toast'
})
}
return { handelNotSupportPrompt }
return { isRequire, handelNotSupportPrompt }
}
})

Expand Down

0 comments on commit e592408

Please sign in to comment.