|
@@ -1,17 +1,7 @@
|
|
<template>
|
|
<template>
|
|
- <el-dialog
|
|
|
|
- :model-value="visible"
|
|
|
|
- @update:model-value="(val) => emit('update:visible', val)"
|
|
|
|
- :title="title"
|
|
|
|
- width="500"
|
|
|
|
- >
|
|
|
|
- <el-input
|
|
|
|
- v-model.trim="ivalue"
|
|
|
|
- :maxlength="100"
|
|
|
|
- show-word-limit
|
|
|
|
- type="textarea"
|
|
|
|
- :placeholder="placeholder"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-dialog :model-value="visible" @update:model-value="(val) => emit('update:visible', val)" :title="title"
|
|
|
|
+ width="500">
|
|
|
|
+ <el-input v-model.trim="ivalue" :maxlength="100" show-word-limit type="textarea" :placeholder="placeholder" />
|
|
<template #footer>
|
|
<template #footer>
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
<el-button @click="emit('update:visible', false)">取消</el-button>
|
|
<el-button @click="emit('update:visible', false)">取消</el-button>
|
|
@@ -32,6 +22,7 @@ const props = withDefaults(
|
|
title: string;
|
|
title: string;
|
|
name?: string;
|
|
name?: string;
|
|
placeholder: string;
|
|
placeholder: string;
|
|
|
|
+ isAllowEmpty?: boolean;
|
|
updateValue: (value: string) => void;
|
|
updateValue: (value: string) => void;
|
|
}>(),
|
|
}>(),
|
|
{
|
|
{
|
|
@@ -48,7 +39,7 @@ watchEffect(() => {
|
|
});
|
|
});
|
|
|
|
|
|
const submit = async () => {
|
|
const submit = async () => {
|
|
- if (ivalue.value.length === 0) {
|
|
|
|
|
|
+ if (ivalue.value.length === 0 && !props.isAllowEmpty) {
|
|
return ElMessage.error(`${props.name || "点位"}名称不能为空!`);
|
|
return ElMessage.error(`${props.name || "点位"}名称不能为空!`);
|
|
}
|
|
}
|
|
await props.updateValue(ivalue.value);
|
|
await props.updateValue(ivalue.value);
|