bug:动态rules报错

This commit is contained in:
2025-11-12 16:00:01 +08:00
parent 120ef802b7
commit 32bb142882
2 changed files with 7 additions and 13 deletions

View File

@@ -61,10 +61,7 @@
</el-breadcrumb>
</div>
<div class="search" @click="searchFun">
<span>搜索</span>
<el-icon :size="12">
<Search />
</el-icon>
<el-input v-model="searchData" :suffix-icon="Search" placeholder="搜索" size="small" clearable />
</div>
</div>
<div class="table">
@@ -98,6 +95,7 @@ const treeRef = ref<any>();
const navList = ref<any>([]);
const visible = ref(true);
const isToggleShow = ref(true);
const searchData = ref<any>('');
watch(() => props.templateId, () => {
reloadFun();
@@ -297,7 +295,7 @@ defineExpose({
border-bottom: solid 1px var(--el-border-color-light);
.menu {
flex: 1;
height: 30px;
height: 24px;
background-color: var(--el-bg-color-page);
margin-right: 20px;
border-radius: 4px;
@@ -306,18 +304,11 @@ defineExpose({
padding: 0 10px;
}
.search {
width: 200px;
height: 30px;
background-color: var(--el-bg-color);
height: 24px;
background-color: var(--el-bg-color-page);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
font-size: 14px;
color: var(--el-text-color-placeholder);
cursor: pointer;
}
}
}

View File

@@ -112,6 +112,9 @@ const getHeadDataFun = () => {
}
});
for (const key in props.ruleData) {
if (!rulesObj[key]) {
rulesObj[key] = [];
}
props.ruleData[key].forEach((rule: any) => {
const validator = rule.validator;
rulesObj[key].push({