ykt-wxapp/components/form-template/form-cell/form-surgical-history.vue

36 lines
746 B
Vue

<template>
<form-multi-select-and-other
v-bind="attrs"
:range="normalizedRange"
:form="form"
:disableChange="disableChange"
:otherList="['有']"
@change="change"
/>
</template>
<script setup>
import { computed, useAttrs } from 'vue';
import formMultiSelectAndOther from './form-multiSelectAndOther.vue';
const attrs = useAttrs();
const emits = defineEmits(['change']);
defineProps({
form: { type: Object, default: () => ({}) },
disableChange: { type: Boolean, default: false },
});
const normalizedRange = computed(() => {
const r = attrs?.range;
if (Array.isArray(r) && r.length) return r;
return ['无', '有'];
});
function change(data) {
emits('change', data);
}
</script>
<style scoped></style>