This commit is contained in:
吴红兵
2025-12-02 10:37:49 +08:00
commit 1f645dad3e
1183 changed files with 147673 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<template>
<div style="width: 100%">
<el-input v-model="data.modelValue" @blur="changeModelValue" :disabled="props.disabled" clearable>
</el-input>
</div>
</template>
<script setup lang="ts" name="UserRolePickerIndex">
import {useMessage} from "/@/hooks/message";
import {verifyIdCard} from "/@/utils/toolsValidate";
const props = defineProps({
modelValue: {
type: String,
default: null,
},
disabled: {
type: Boolean,
default: false,
},
});
const emits = defineEmits(['update:modelValue']);
const $message = useMessage();
const data = reactive({
modelValue: null
})
const changeModelValue = () => {
if (data.modelValue) {
let boolean = verifyIdCard(data.modelValue);
if (!boolean) {
data.modelValue = null
$message.success("请输入正确的身份证号")
}
emits('update:modelValue', data.modelValue);
} else {
emits('update:modelValue', null);
}
};
onMounted(() => {
data.modelValue = props.modelValue
})
</script>