测试用例修改
This commit is contained in:
@@ -63,7 +63,7 @@ const loadData = () => {
|
|||||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
getTerminalTreeForFive(form).then(res => {
|
getTerminalTreeForFive(form).then(res => {
|
||||||
console.log('---',res)
|
//console.log('---',res)
|
||||||
if (obj.code == 'Power_Network') {
|
if (obj.code == 'Power_Network') {
|
||||||
res.data = [
|
res.data = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ const tableStore = new TableStore({
|
|||||||
showPage: false,
|
showPage: false,
|
||||||
url: '/device-boot/LineIntegrityData/getLineIntegrityData',
|
url: '/device-boot/LineIntegrityData/getLineIntegrityData',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|
||||||
column: [
|
column: [
|
||||||
{
|
{
|
||||||
title: formData.value.statisticalType.name,
|
title: formData.value.statisticalType.name,
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ const info = () => {
|
|||||||
clickRow(List.value[0], 0)
|
clickRow(List.value[0], 0)
|
||||||
setTime()
|
setTime()
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
const setTime = () => {
|
const setTime = () => {
|
||||||
timer.value = setInterval(() => {
|
timer.value = setInterval(() => {
|
||||||
@@ -83,7 +84,6 @@ const setTime = () => {
|
|||||||
} else {
|
} else {
|
||||||
rowColor.value += 1
|
rowColor.value += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
clickRow(List.value[rowColor.value], rowColor.value)
|
clickRow(List.value[rowColor.value], rowColor.value)
|
||||||
}, 1000 * 5)
|
}, 1000 * 5)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ const height = mainHeight(330, 3)
|
|||||||
const chartRef = ref<HTMLDivElement>()
|
const chartRef = ref<HTMLDivElement>()
|
||||||
const info = (item: any) => {
|
const info = (item: any) => {
|
||||||
let chart = echarts.init(chartRef.value as HTMLDivElement)
|
let chart = echarts.init(chartRef.value as HTMLDivElement)
|
||||||
|
|
||||||
let everyDepartment = {
|
let everyDepartment = {
|
||||||
stages: [
|
stages: [
|
||||||
{ name: '在线率', max: 100 },
|
{ name: '在线率', max: 100 },
|
||||||
|
|||||||
@@ -124,10 +124,16 @@ const tableStore = new TableStore({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
ElMessageBox.confirm('是否确认删除该部门', '提示', {
|
||||||
|
confirmButtonText: '确认删除',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
deleteDept([row.id]).then(response => {
|
deleteDept([row.id]).then(response => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success('删除成功')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<el-input v-model="form.code" placeholder="请输入部门编号"></el-input>
|
<el-input v-model="form.code" placeholder="请输入部门编号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="top" label="部门名称:" prop="name">
|
<el-form-item class="top" label="部门名称:" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入部门名称"></el-input>
|
<el-input v-model="form.name" placeholder="请输入部门名称" maxlength="32" show-word-limit clearable @input="handleInput"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="top" label="部门类型:" prop="type">
|
<el-form-item class="top" label="部门类型:" prop="type">
|
||||||
<el-select v-model="form.type" placeholder="选择部门类型" style="width: 100%">
|
<el-select v-model="form.type" placeholder="选择部门类型" style="width: 100%">
|
||||||
@@ -144,5 +144,14 @@ const submit = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const handleInput = ( value: string) => {
|
||||||
|
// 过滤空格
|
||||||
|
const filteredValue = value.replace(/\s/g, '')
|
||||||
|
if (filteredValue !== value) {
|
||||||
|
form.name = filteredValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title">
|
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules">
|
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||||
<el-form-item label="角色名称">
|
<el-form-item label="角色名称" required>
|
||||||
<el-input v-model="form.name" placeholder="请输入菜单名称" />
|
<el-input v-model="form.name" placeholder="请输入菜单名称" maxlength="32" show-word-limit @input="handleInput"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色编码">
|
<el-form-item label="角色编码">
|
||||||
<el-input v-model="form.code" placeholder="请输入菜单名称" />
|
<el-input v-model="form.code" placeholder="请输入菜单名称" />
|
||||||
@@ -32,6 +32,7 @@ import { useAdminInfo } from '@/stores/adminInfo'
|
|||||||
|
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
const tableStore = inject('tableStore') as TableStore
|
const tableStore = inject('tableStore') as TableStore
|
||||||
|
const formRef = ref()
|
||||||
// do not use same name with ref
|
// do not use same name with ref
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
code: '',
|
code: '',
|
||||||
@@ -60,6 +61,9 @@ const open = (text: string, data?: anyObj) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
|
// 先进行表单验证
|
||||||
|
try {
|
||||||
|
await formRef.value.validate()
|
||||||
if (form.id) {
|
if (form.id) {
|
||||||
await update(form)
|
await update(form)
|
||||||
} else {
|
} else {
|
||||||
@@ -69,6 +73,14 @@ const submit = async () => {
|
|||||||
ElMessage.success('保存成功')
|
ElMessage.success('保存成功')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
} catch (error) {
|
||||||
|
// 验证失败,Element Plus 会自动显示错误信息
|
||||||
|
console.log('表单验证失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleInput = (val: string) => {
|
||||||
|
form.name = val.replace(/\s+/g, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<el-dialog draggable :title="title" v-model="formVisible" width="30%" :before-close="closeDialog">
|
<el-dialog draggable :title="title" v-model="formVisible" width="30%" :before-close="closeDialog">
|
||||||
<el-form :model="formdata" label-width="100px" :rules="rules" ref="ruleForm">
|
<el-form :model="formdata" label-width="100px" :rules="rules" ref="ruleForm">
|
||||||
<el-form-item label="模板名称" prop="name">
|
<el-form-item label="模板名称" prop="name">
|
||||||
<el-input placeholder="模板名称" v-model="formdata.name" style="width: 100%"></el-input>
|
<el-input placeholder="模板名称" v-model="formdata.name" style="width: 100%" maxlength="32" show-word-limit @input="handleInput"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="部门" prop="deptId">
|
<el-form-item label="部门" prop="deptId">
|
||||||
<Area
|
<Area
|
||||||
@@ -110,6 +110,15 @@ const open = (text: string, row?: any) => {
|
|||||||
|
|
||||||
formVisible.value = true
|
formVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleInput = (value: string) => {
|
||||||
|
// 过滤空格
|
||||||
|
const filteredValue = value.replace(/\s/g, '')
|
||||||
|
if (filteredValue !== value) {
|
||||||
|
formdata.value.name = filteredValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
Reference in New Issue
Block a user