fix: 修改列表页筛选bug

This commit is contained in:
luch 2024-02-06 15:35:30 +08:00 committed by sudoooooo
parent e5f70ad08c
commit b8c089f3fd
4 changed files with 8 additions and 13 deletions

View File

@ -129,7 +129,7 @@ export class SurveyMetaController {
const allowFilterField = [
'title',
'remark',
'questionType',
'surveyType',
'curStatus.status',
];
return filterList.reduce(

View File

@ -17,11 +17,9 @@ export class XiaojuSurveyPluginManager {
async triggerHook(hookName: AllowHooks, data?: any) {
for (const plugin of this.plugins) {
if (plugin[hookName]) {
await plugin[hookName](data);
break;
return await plugin[hookName](data);
}
}
return data;
}
}

View File

@ -154,7 +154,7 @@ export default {
searchVal: '',
selectOptionsDict,
selectValueMap: {
questionType: '',
surveyType: '',
'curStatus.status': '',
},
buttonOptionsDict,
@ -204,8 +204,8 @@ export default {
comparator: '',
condition: [
{
field: 'questionType',
value: this.selectValueMap.questionType,
field: 'surveyType',
value: this.selectValueMap.surveyType,
},
],
},
@ -231,12 +231,9 @@ export default {
try {
const filter = JSON.stringify(
this.filter.filter((item) => {
return (
item.condition[0].field === 'title' || item.condition[0].value
);
return item.condition[0].value;
})
);
const res = await getSurveyList({
curPage: this.currentPage,
filter,

View File

@ -68,7 +68,7 @@ export const statusMaps = {
};
// 问卷类型
export const questionTypeSelect = {
export const surveyTypeSelect = {
label: '问卷类型',
value: [
{
@ -124,7 +124,7 @@ export const curStatusSelect = {
};
export const selectOptionsDict = Object.freeze({
questionType: questionTypeSelect,
surveyType: surveyTypeSelect,
'curStatus.status': curStatusSelect,
});