公共服务平台-bug修复

This commit is contained in:
lSun 2025-09-19 09:50:04 +08:00
parent 65661a2647
commit c04f383a33
2 changed files with 26 additions and 16 deletions

View File

@ -150,16 +150,29 @@ export default {
// //
filterMaterials() { filterMaterials() {
console.log(this.selectedTypes) this.updateFilteredList()
if (this.selectedTypes.length === 0) {
this.showProMaterialsDuctList = this.proMaterialsListAll;
} else {
this.showProMaterialsDuctList = this.proMaterialsListAll.filter(item => {
return this.selectedTypes.includes(item.fileType.toString());
});
}
}, },
//
updateFilteredList() {
let filtered = this.proMaterialsListAll;
//
if (this.activeTypeValue !== 'all') {
filtered = filtered.filter(item => item.typeId === Number(this.activeTypeValue));
}
//
if (this.selectedTypes.length > 0) {
filtered = filtered.filter(item =>
this.selectedTypes.includes(item.fileType.toString())
);
}
this.showProMaterialsDuctList = filtered;
},
// //
getItemWidth() { getItemWidth() {
this.itemWidth = (this.$refs.servicesGrid?.clientWidth - 120) / 4 this.itemWidth = (this.$refs.servicesGrid?.clientWidth - 120) / 4
@ -283,14 +296,8 @@ export default {
// //
watch: { watch: {
activeTypeValue(newVal) { activeTypeValue() {
if (newVal === 'all') { this.updateFilteredList();
this.showProMaterialsDuctList = this.proMaterialsListAll
} else {
this.showProMaterialsDuctList = this.proMaterialsListAll.filter(
(item) => item.typeId === Number(newVal),
)
}
}, },
}, },
} }

View File

@ -577,6 +577,7 @@ export default {
// postIds roleIds // postIds roleIds
const originalPostIds = this.form.postIds; const originalPostIds = this.form.postIds;
const originalRoleIds = this.form.roleIds; const originalRoleIds = this.form.roleIds;
const originalPermissions = [...this.form.permissions]; //
this.form.postIds = Array.isArray(this.form.postIds) ? this.form.postIds : [this.form.postIds]; this.form.postIds = Array.isArray(this.form.postIds) ? this.form.postIds : [this.form.postIds];
this.form.roleIds = Array.isArray(this.form.roleIds) ? this.form.roleIds : [this.form.roleIds]; this.form.roleIds = Array.isArray(this.form.roleIds) ? this.form.roleIds : [this.form.roleIds];
@ -602,6 +603,7 @@ export default {
// //
this.form.postIds = originalPostIds; this.form.postIds = originalPostIds;
this.form.roleIds = originalRoleIds; this.form.roleIds = originalRoleIds;
this.form.permissions = originalPermissions; //
}) })
} else { } else {
addUser(this.form).then(response => { addUser(this.form).then(response => {
@ -612,6 +614,7 @@ export default {
// //
this.form.postIds = originalPostIds; this.form.postIds = originalPostIds;
this.form.roleIds = originalRoleIds; this.form.roleIds = originalRoleIds;
this.form.permissions = originalPermissions; //
}) })
} }
} }