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