Commit d1ea2a56 by 匡雅琴

校验重置

1 parent e812658d
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
defineProps, defineProps,
withDefaults, withDefaults,
watch, watch,
onBeforeUnmount,
} from "vue"; } from "vue";
import type { FormInstance, FormRules } from "element-plus"; import type { FormInstance, FormRules } from "element-plus";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
...@@ -46,6 +47,8 @@ watch( ...@@ -46,6 +47,8 @@ watch(
// 获取编辑数据 // 获取编辑数据
let keysLength = Object.keys(val).length; let keysLength = Object.keys(val).length;
ruleFormRef.value?.resetFields();
if (keysLength > 0) { if (keysLength > 0) {
isEdit.value = true; isEdit.value = true;
//编辑 //编辑
...@@ -161,8 +164,8 @@ const isUniqueName = async () => { ...@@ -161,8 +164,8 @@ const isUniqueName = async () => {
ruleForm.uniqueName = '' ruleForm.uniqueName = ''
return false; return false;
} }
} }
</script> </script>
<template> <template>
......
...@@ -46,6 +46,9 @@ watch( ...@@ -46,6 +46,9 @@ watch(
(val) => { (val) => {
// 获取编辑数据 // 获取编辑数据
let keysLength = Object.keys(val).length; let keysLength = Object.keys(val).length;
ruleFormRef.value?.resetFields();
if (keysLength > 0) { if (keysLength > 0) {
isEdit.value = true; isEdit.value = true;
//编辑 //编辑
......
...@@ -49,7 +49,6 @@ let currentTab = reactive<Comp>({ ...@@ -49,7 +49,6 @@ let currentTab = reactive<Comp>({
// 添加公共模板 // 添加公共模板
const addConfig = (index: number) => { const addConfig = (index: number) => {
console.log(index);
propsData = {} propsData = {}
currentTab.tabComp = '' currentTab.tabComp = ''
nextTick(() => { nextTick(() => {
...@@ -100,10 +99,9 @@ let propsData = reactive({}) ...@@ -100,10 +99,9 @@ let propsData = reactive({})
// 点击子菜单 // 点击子菜单
const clickSubItem = (index: number, item: any) => { const clickSubItem = (index: number, item: any) => {
console.log(index, item);
propsData = {...item}
currentTab.tabComp = '' currentTab.tabComp = ''
currentTab.tabComp = tabData[index].tabComp; currentTab.tabComp = tabData[index].tabComp;
propsData = {...item}
} }
// 菜单展开收起 // 菜单展开收起
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!