|
@@ -24,7 +24,7 @@ const checksName = { |
|
@@ -24,7 +24,7 @@ const checksName = { |
24
|
* @returns {string}
|
24
|
* @returns {string}
|
25
|
*/
|
25
|
*/
|
26
|
const handleFilterUrl = (originParam, newParam, delParam) => {
|
26
|
const handleFilterUrl = (originParam, newParam, delParam) => {
|
27
|
- let dest = '';
|
27
|
+ let dest = '?';
|
28
|
let tempOriginParam = {};
|
28
|
let tempOriginParam = {};
|
29
|
|
29
|
|
30
|
delParam = delParam || {};
|
30
|
delParam = delParam || {};
|
|
@@ -38,9 +38,7 @@ const handleFilterUrl = (originParam, newParam, delParam) => { |
|
@@ -38,9 +38,7 @@ const handleFilterUrl = (originParam, newParam, delParam) => { |
38
|
}
|
38
|
}
|
39
|
});
|
39
|
});
|
40
|
|
40
|
|
41
|
- dest = dest ? _.trim(`?${dest}`, '&') : '';
|
|
|
42
|
-
|
|
|
43
|
- return dest;
|
41
|
+ return _.trim(dest, '&');
|
44
|
};
|
42
|
};
|
45
|
|
43
|
|
46
|
/**
|
44
|
/**
|
|
@@ -637,26 +635,37 @@ exports.handleFilterData = (origin, params) => { |
|
@@ -637,26 +635,37 @@ exports.handleFilterData = (origin, params) => { |
637
|
* @returns {{}}
|
635
|
* @returns {{}}
|
638
|
*/
|
636
|
*/
|
639
|
exports.handleSeniorFilterData = (data, params) => {
|
637
|
exports.handleSeniorFilterData = (data, params) => {
|
640
|
- let resData = {
|
|
|
641
|
- checkedConditions: {
|
|
|
642
|
- conditions: []
|
|
|
643
|
- }
|
|
|
644
|
- };
|
638
|
+ let resData = {};
|
645
|
|
639
|
|
646
|
if (data) {
|
640
|
if (data) {
|
647
|
let chose = [];
|
641
|
let chose = [];
|
|
|
642
|
+ let conditions = [];
|
648
|
|
643
|
|
649
|
if (!_.isEmpty(data.style)) {
|
644
|
if (!_.isEmpty(data.style)) {
|
650
|
- let sub = [];
|
645
|
+ let sub = [],
|
|
|
646
|
+ conName = [];
|
|
|
647
|
+ let styles = _.split(_.get(params, 'style', ''), ',');
|
651
|
|
648
|
|
652
|
_.forEach(data.style, value => {
|
649
|
_.forEach(data.style, value => {
|
|
|
650
|
+ let ched = styles.indexOf(`${value.style_id}`) >= 0;
|
|
|
651
|
+
|
|
|
652
|
+ if (ched && conName.length < 2) {
|
|
|
653
|
+ conName.push(value.style_name);
|
|
|
654
|
+ }
|
653
|
sub.push({
|
655
|
sub.push({
|
654
|
id: value.style_id,
|
656
|
id: value.style_id,
|
655
|
- checked: parseInt(params.style, 10) === parseInt(value.style_id, 10),
|
657
|
+ checked: ched,
|
656
|
href: handleFilterUrl(params, {style: value.style_id}),
|
658
|
href: handleFilterUrl(params, {style: value.style_id}),
|
657
|
name: value.style_name
|
659
|
name: value.style_name
|
658
|
});
|
660
|
});
|
659
|
});
|
661
|
});
|
|
|
662
|
+
|
|
|
663
|
+ if (conName.length) {
|
|
|
664
|
+ conditions.push({
|
|
|
665
|
+ name: _.join(conName, '、'),
|
|
|
666
|
+ href: handleFilterUrl(params, {}, {style: true})
|
|
|
667
|
+ });
|
|
|
668
|
+ }
|
660
|
chose.push({
|
669
|
chose.push({
|
661
|
name: '风格',
|
670
|
name: '风格',
|
662
|
showMulti: true,
|
671
|
showMulti: true,
|
|
@@ -668,32 +677,46 @@ exports.handleSeniorFilterData = (data, params) => { |
|
@@ -668,32 +677,46 @@ exports.handleSeniorFilterData = (data, params) => { |
668
|
if (!_.isEmpty(data.standard)) {
|
677
|
if (!_.isEmpty(data.standard)) {
|
669
|
_.forEach(data.standard, value => {
|
678
|
_.forEach(data.standard, value => {
|
670
|
let sub = [];
|
679
|
let sub = [];
|
|
|
680
|
+ let parKey = `parameter_${value.standard_id}`;
|
671
|
|
681
|
|
672
|
_.forEach(value.sub, subValue => {
|
682
|
_.forEach(value.sub, subValue => {
|
|
|
683
|
+ let standard = {};
|
|
|
684
|
+ let ched = parseInt(params[parKey], 10) === parseInt(subValue.standard_id, 10);
|
|
|
685
|
+
|
|
|
686
|
+ standard[parKey] = subValue.standard_id;
|
|
|
687
|
+
|
|
|
688
|
+ if (ched) {
|
|
|
689
|
+ conditions.push({
|
|
|
690
|
+ name: subValue.standard_name,
|
|
|
691
|
+ href: handleFilterUrl(params, {}, standard),
|
|
|
692
|
+ });
|
|
|
693
|
+ }
|
|
|
694
|
+
|
673
|
sub.push({
|
695
|
sub.push({
|
674
|
id: value.standard_id,
|
696
|
id: value.standard_id,
|
675
|
- checked: parseInt(params.standard_val, 10) === parseInt(subValue.standard_id, 10),
|
|
|
676
|
- href: handleFilterUrl(params, {
|
|
|
677
|
- standard_id: value.standard_id,
|
|
|
678
|
- standard_val: subValue.standard_id
|
|
|
679
|
- }),
|
697
|
+ checked: ched,
|
|
|
698
|
+ href: handleFilterUrl(params, standard),
|
680
|
name: subValue.standard_name
|
699
|
name: subValue.standard_name
|
681
|
- });
|
|
|
682
|
- })
|
700
|
+ });
|
|
|
701
|
+ });
|
683
|
chose.push({
|
702
|
chose.push({
|
684
|
name: value.standard_name,
|
703
|
name: value.standard_name,
|
685
|
sub: sub
|
704
|
sub: sub
|
686
|
});
|
705
|
});
|
687
|
- })
|
706
|
+ });
|
688
|
}
|
707
|
}
|
689
|
|
708
|
|
690
|
if (!_.isEmpty(chose)) {
|
709
|
if (!_.isEmpty(chose)) {
|
691
|
resData.seniorChose = chose;
|
710
|
resData.seniorChose = chose;
|
692
|
}
|
711
|
}
|
|
|
712
|
+
|
|
|
713
|
+ if (!_.isEmpty(conditions)) {
|
|
|
714
|
+ _.set(resData, 'checkedConditions.conditions', conditions);
|
|
|
715
|
+ }
|
693
|
}
|
716
|
}
|
694
|
|
717
|
|
695
|
return resData;
|
718
|
return resData;
|
696
|
-}
|
719
|
+};
|
697
|
|
720
|
|
698
|
/**
|
721
|
/**
|
699
|
* 根据页面设置面包屑导航
|
722
|
* 根据页面设置面包屑导航
|