测试用例修改

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

@@ -8,11 +8,11 @@
@clear="TreeList = {}" />
</el-form-item>
<el-form-item label="名称" prop="name" v-if="title == '修改算法' ? TreeList.level != 4 : TreeList.level != 3">
<el-input v-model="form.name" placeholder="名称" clearable />
<el-input v-model="form.name" placeholder="名称" clearable maxlength="32" show-word-limit @input="handleInput('name', $event)"/>
</el-form-item>
<!-- <div v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3"> -->
<el-form-item label="算法名称" prop="name" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
<el-input v-model="form.name" placeholder="请输入算法名称" clearable />
<el-input v-model="form.name" placeholder="请输入算法名称" clearable maxlength="32" show-word-limit @input="handleInput('name', $event)"/>
</el-form-item>
<el-form-item label="计算周期" prop="period" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
<el-select v-model="form.period" placeholder="请选择计算周期" clearable>
@@ -20,7 +20,7 @@
</el-select>
</el-form-item>
<el-form-item label="数据来源" prop="source" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
<el-input v-model="form.source" placeholder="请输入数据来源" clearable />
<el-input v-model="form.source" placeholder="请输入数据来源" clearable maxlength="32" show-word-limit @input="handleInput('source', $event)"/>
</el-form-item>
<!-- <el-form-item label="定义" prop="definition" style="width: 100%;" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
@@ -29,7 +29,7 @@
<!-- </div> -->
</el-form>
<div style="display: flex" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
<div style="width: 120px;margin-right: 12px;text-align: end;">定义</div>
<div style="width: 140px;margin-right: -20px;text-align: center;flex-shrink: 0;">定义</div>
<editor v-model="form.definition" />
</div>
@@ -177,5 +177,14 @@ const getTheTree = () => {
})
}
const handleInput = (field: string, value: string) => {
// 过滤空格
const filteredValue = value.replace(/\s/g, '')
if (filteredValue !== value) {
form[field] = filteredValue
}
}
defineExpose({ open })
</script>

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>

View File

@@ -13,7 +13,7 @@
checkStrictly :props="cascaderProps" @change="change" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="名称" maxlength="32" show-word-limit/>
<el-input v-model="form.name" placeholder="名称" maxlength="32" show-word-limit @input="handleInput"/>
</el-form-item>
<el-form-item label="标准" v-if="title == '新增' && form.pid?.length > 0">
@@ -217,6 +217,14 @@ const handleClose = () => {
emit('onSubmit')
dialogVisible.value = false
}
const handleInput = (value: string) => {
// 过滤空格
const filteredValue = value.replace(/\s/g, '')
if (filteredValue !== value) {
form.name = filteredValue
}
}
defineExpose({ open })
</script>
<style lang="scss" scoped>

View File

@@ -3,7 +3,7 @@
<el-scrollbar>
<el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef">
<el-form-item label="模版名称" prop="name">
<el-input v-model="form.name" placeholder="请输入模版名称" maxlength="32" show-word-limit/>
<el-input v-model="form.name" placeholder="请输入模版名称" maxlength="32" show-word-limit @input="handleInput"/>
</el-form-item>
<el-form-item label="模版">
@@ -149,6 +149,18 @@ const handleClose = () => {
emit('onSubmit')
dialogVisible.value = false
}
const handleInput = (value: string) => {
// 过滤空格
const filteredValue = value.replace(/\s/g, '')
if (filteredValue !== value) {
form.name = filteredValue
}
}
// ... 其余代码保持不变 ...
defineExpose({ open })
</script>
<style lang="scss" scoped>