File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,10 +213,8 @@ export default {
213213 const filterOptions = this .items .find ((item ) => item .type === " filter" )? .options || [];
214214 filterOptions .forEach ((item ) => {
215215 if (item .type === " radio" ) {
216- const firstOption = item .options [0 ];
217- if (firstOption) {
218- this .formData [item .key ] = firstOption .key ;
219- }
216+ const resetOption = item .options .find ((option ) => option .key === " " || option .value === " 全部" );
217+ this .formData [item .key ] = resetOption ? resetOption .key : " " ;
220218 } else if (item .type === " checkbox" ) {
221219 const allOption = item .options .find ((opt ) => opt .value === " all" );
222220 if (allOption) {
Original file line number Diff line number Diff line change @@ -400,7 +400,13 @@ export default {
400400 });
401401 },
402402 searchEvent (data ) {
403- if (! data .nCatag1Index ) {
403+ const newData = this .doPrams (data);
404+ const hasSearchValue = Object .values (newData || {}).some ((value ) => {
405+ if (Array .isArray (value)) return value .length ;
406+ return ! [undefined , null , " " ].includes (value);
407+ });
408+
409+ if (! hasSearchValue) {
404410 this .active = " " ;
405411 this .search = {};
406412 this .list = [];
@@ -409,7 +415,6 @@ export default {
409415 return ;
410416 }
411417 this .active = data .nCatag1Index ;
412- const newData = this .doPrams (data);
413418 this .search = newData;
414419 },
415420 loadFurniture () {
You can’t perform that action at this time.
0 commit comments