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 = [ const allowFilterField = [
'title', 'title',
'remark', 'remark',
'questionType', 'surveyType',
'curStatus.status', 'curStatus.status',
]; ];
return filterList.reduce( return filterList.reduce(

View File

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

View File

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

View File

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