fix: 问题修复
This commit is contained in:
parent
946d29ad97
commit
4d7de97445
@ -9,12 +9,12 @@
|
|||||||
</common-cell>
|
</common-cell>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import { computed, onMounted } from 'vue';
|
||||||
import { set } from '@/utils/cache';
|
import { set } from '@/utils/cache';
|
||||||
|
|
||||||
import commonCell from '../common-cell.vue';
|
import commonCell from '../common-cell.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['change']);
|
const emits = defineEmits(['change', 'addRule']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
form: {
|
form: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -52,6 +52,18 @@ function select() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (props.required && props.title) {
|
||||||
|
emits('addRule', {
|
||||||
|
title: props.title,
|
||||||
|
fn: () => {
|
||||||
|
if (value.value.length > 0) return true;
|
||||||
|
return `请选择${props.name || ''}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
@import '../cell-style.css';
|
@import '../cell-style.css';
|
||||||
|
|||||||
@ -12,10 +12,10 @@
|
|||||||
@change="change" />
|
@change="change" />
|
||||||
<form-textarea v-else-if="attrs.type === 'textarea'" v-bind="attrs" :form="form" :disableChange="disableChange"
|
<form-textarea v-else-if="attrs.type === 'textarea'" v-bind="attrs" :form="form" :disableChange="disableChange"
|
||||||
@change="change" />
|
@change="change" />
|
||||||
<form-mult-disease v-else-if="attrs.type === 'selfMultipleDiseases'" v-bind="attrs" :form="form"
|
<form-mult-disease v-else-if="attrs.type === 'selfMultipleDiseases'" v-bind="attrs" :form="form" @change="change"
|
||||||
@change="change"></form-mult-disease>
|
@addRule="addRule"></form-mult-disease>
|
||||||
<form-mult-disease v-else-if="attrs.type === 'diagnosis'" v-bind="attrs" :form="form"
|
<form-mult-disease v-else-if="attrs.type === 'diagnosis'" v-bind="attrs" :form="form" @change="change"
|
||||||
@change="change"></form-mult-disease>
|
@addRule="addRule"></form-mult-disease>
|
||||||
<form-upload v-else-if="attrs.type === 'files'" v-bind="attrs" :form="form" @change="change" />
|
<form-upload v-else-if="attrs.type === 'files'" v-bind="attrs" :form="form" @change="change" />
|
||||||
<form-mult-other v-else-if="attrs.type === 'multiSelectAndOther'" v-bind="attrs" :form="form" @change="change" />
|
<form-mult-other v-else-if="attrs.type === 'multiSelectAndOther'" v-bind="attrs" :form="form" @change="change" />
|
||||||
<!--
|
<!--
|
||||||
@ -52,11 +52,14 @@ defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
const emits = defineEmits(['change']);
|
const emits = defineEmits(['change', 'addRule']);
|
||||||
|
|
||||||
function change(data) {
|
function change(data) {
|
||||||
emits('change', data)
|
emits('change', data)
|
||||||
}
|
}
|
||||||
|
function addRule(data) {
|
||||||
|
emits('addRule', data)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- <script>
|
<!-- <script>
|
||||||
|
|||||||
@ -42,7 +42,6 @@ const disabledMap = computed(() => props.disableTitles.reduce((m, i) => {
|
|||||||
return m
|
return m
|
||||||
}, {}))
|
}, {}))
|
||||||
|
|
||||||
provide('addRule', addRule);
|
|
||||||
|
|
||||||
const customRule = ref({});
|
const customRule = ref({});
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,8 @@ const urlsConfig = {
|
|||||||
getArticle: 'getArticle',
|
getArticle: 'getArticle',
|
||||||
addArticleSendRecord: 'addArticleSendRecord',
|
addArticleSendRecord: 'addArticleSendRecord',
|
||||||
addArticleReadRecord: 'addArticleReadRecord',
|
addArticleReadRecord: 'addArticleReadRecord',
|
||||||
getMiniAppReceivedArticleList: 'getMiniAppReceivedArticleList'
|
getMiniAppReceivedArticleList: 'getMiniAppReceivedArticleList',
|
||||||
|
getPageDisease:'getPageDisease'
|
||||||
},
|
},
|
||||||
member: {
|
member: {
|
||||||
addCustomer: 'add',
|
addCustomer: 'add',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user