feat: 移动端表单必填项标记红色 * 号 + 提交校验

- 客户单位/日期/纪要内容/计划拜访时间 标记 *
- 缺失必填项时 ElMessage.warning 提示
- CSS: .required-star { color: var(--vermilion); }

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-12 20:28:54 +08:00
parent 6d1ccbb246
commit ff0a38a369
6 changed files with 18 additions and 10 deletions
+4 -2
View File
@@ -60,6 +60,7 @@ onMounted(async () => {
})
async function handleSubmit() {
if (!form.value.note_date) { ElMessage.warning('请选择日期'); return }
if (!form.value.content.trim()) { ElMessage.warning('请输入纪要内容'); return }
submitLoading.value = true
try {
@@ -108,7 +109,7 @@ async function handleDelete() {
<el-form label-position="top" class="editorial-form">
<el-form-item>
<template #label>
<span class="form-label">日期</span>
<span class="form-label">日期 <span class="required-star">*</span></span>
</template>
<el-date-picker v-model="form.note_date" type="date" style="width:100%" />
</el-form-item>
@@ -158,7 +159,7 @@ async function handleDelete() {
<el-form-item>
<template #label>
<span class="form-label">工作内容 <span class="form-label-required">*</span></span>
<span class="form-label">工作内容 <span class="required-star">*</span></span>
</template>
<el-input v-model="form.content" type="textarea" :rows="5" placeholder="今天做了什么..." />
</el-form-item>
@@ -288,4 +289,5 @@ async function handleDelete() {
animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.required-star { color: var(--vermilion); font-weight: 700; }
</style>