测试用例修改

This commit is contained in:
sjl
2025-07-25 14:15:26 +08:00
parent f670802868
commit c47d524f9d
24 changed files with 118 additions and 49 deletions

View File

@@ -64,9 +64,11 @@ const open = (row: any) => {
}
// 上传
const choose = (e: any) => {
ElMessage.info('上传中,请稍等...')
const loadingMessage = ElMessage.info({ message: '上传中,请稍等...', duration: 0 }); // duration: 0 表示不自动关闭
uploadFile(e.raw, '/supervision/').then((row: any) => {
addStandardCase({ caseUrl: row.data.name }).then(res => {
loadingMessage.close(); // 关闭 "上传中" 提示
ElMessage.success('上传成功!')
queryStandardCase().then(res => {
open(res.data)

View File

@@ -4,7 +4,7 @@
<el-scrollbar>
<el-form :inline="false" :model="form" class="form-two" label-width="auto" :rules="rules" ref="formRef">
<el-form-item label="事件名称" prop="name">
<el-input v-model="form.name" placeholder="请输入事件名称" maxlength="32" type="textarea" show-word-limit :autosize="{ minRows: 2, maxRows: 4 }"/>
<el-input v-model="form.name" placeholder="请输入事件名称" maxlength="32" type="textarea" show-word-limit :autosize="{ minRows: 2, maxRows: 4 }" @input="handleInput('name', $event)"/>
</el-form-item>
<!-- <el-form-item label="发生事件" prop="type">
<el-input
@@ -16,20 +16,20 @@
</el-form-item> -->
<el-form-item label="发生地点" prop="location">
<el-input v-model="form.location" placeholder="请输入发生地点" :autosize="{ minRows: 2, maxRows: 4 }"
type="textarea" maxlength="32" show-word-limit/>
type="textarea" maxlength="32" show-word-limit @input="handleInput('location', $event)"/>
</el-form-item>
<el-form-item label="事件经过" prop="process">
<el-input v-model="form.process" placeholder="请输入事件经过" :autosize="{ minRows: 2, maxRows: 4 }"
type="textarea" maxlength="32" show-word-limit/>
type="textarea" maxlength="32" show-word-limit @input="handleInput('process', $event)"/>
</el-form-item>
<el-form-item label="处理措施" prop="measures">
<el-input v-model="form.measures" placeholder="请输入处理措施" :autosize="{ minRows: 2, maxRows: 4 }"
type="textarea" maxlength="32" show-word-limit/>
type="textarea" maxlength="32" show-word-limit @input="handleInput('measures', $event)"/>
</el-form-item>
<el-form-item label="治理效果" prop="effect">
<el-input v-model="form.effect" placeholder="请输入治理效果" :autosize="{ minRows: 2, maxRows: 4 }"
type="textarea" maxlength="32" show-word-limit/>
type="textarea" maxlength="32" show-word-limit @input="handleInput('effect', $event)"/>
</el-form-item>
<el-form-item label="附件">
<el-upload v-model:file-list="fileList" action="" :auto-upload="false" multiple>
@@ -38,9 +38,13 @@
</el-form-item>
</el-form>
<div style="display: flex">
<!-- <div style="display: flex">
<div style="width: 80px">事件简介</div>
<editor v-model="form.summary" />
</div> -->
<div style="display: flex; align-items: start;">
<div style="width: 80px; flex-shrink: 0;">事件简介</div>
<editor v-model="form.summary" />
</div>
</el-scrollbar>
<template #footer>
@@ -171,6 +175,15 @@ const handleClose = () => {
dialogVisible.value = false
}
const handleInput = (field: string, value: string) => {
// 过滤空格
const filteredValue = value.replace(/\s/g, '')
if (filteredValue !== value) {
form[field] = filteredValue
}
}
defineExpose({ open })
</script>
<style lang="scss" scoped>