...
|
...
|
@@ -24,7 +24,7 @@ const checksName = { |
|
|
* @returns {string}
|
|
|
*/
|
|
|
const handleFilterUrl = (originParam, newParam, delParam) => {
|
|
|
let dest = '';
|
|
|
let dest = '?';
|
|
|
let tempOriginParam = {};
|
|
|
|
|
|
delParam = delParam || {};
|
...
|
...
|
@@ -38,9 +38,7 @@ const handleFilterUrl = (originParam, newParam, delParam) => { |
|
|
}
|
|
|
});
|
|
|
|
|
|
dest = dest ? _.trim(`?${dest}`, '&') : '';
|
|
|
|
|
|
return dest;
|
|
|
return _.trim(dest, '&');
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -637,26 +635,37 @@ exports.handleFilterData = (origin, params) => { |
|
|
* @returns {{}}
|
|
|
*/
|
|
|
exports.handleSeniorFilterData = (data, params) => {
|
|
|
let resData = {
|
|
|
checkedConditions: {
|
|
|
conditions: []
|
|
|
}
|
|
|
};
|
|
|
let resData = {};
|
|
|
|
|
|
if (data) {
|
|
|
let chose = [];
|
|
|
let conditions = [];
|
|
|
|
|
|
if (!_.isEmpty(data.style)) {
|
|
|
let sub = [];
|
|
|
let sub = [],
|
|
|
conName = [];
|
|
|
let styles = _.split(_.get(params, 'style', ''), ',');
|
|
|
|
|
|
_.forEach(data.style, value => {
|
|
|
let ched = styles.indexOf(`${value.style_id}`) >= 0;
|
|
|
|
|
|
if (ched && conName.length < 2) {
|
|
|
conName.push(value.style_name);
|
|
|
}
|
|
|
sub.push({
|
|
|
id: value.style_id,
|
|
|
checked: parseInt(params.style, 10) === parseInt(value.style_id, 10),
|
|
|
checked: ched,
|
|
|
href: handleFilterUrl(params, {style: value.style_id}),
|
|
|
name: value.style_name
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if (conName.length) {
|
|
|
conditions.push({
|
|
|
name: _.join(conName, '、'),
|
|
|
href: handleFilterUrl(params, {}, {style: true})
|
|
|
});
|
|
|
}
|
|
|
chose.push({
|
|
|
name: '风格',
|
|
|
showMulti: true,
|
...
|
...
|
@@ -668,32 +677,46 @@ exports.handleSeniorFilterData = (data, params) => { |
|
|
if (!_.isEmpty(data.standard)) {
|
|
|
_.forEach(data.standard, value => {
|
|
|
let sub = [];
|
|
|
let parKey = `parameter_${value.standard_id}`;
|
|
|
|
|
|
_.forEach(value.sub, subValue => {
|
|
|
let standard = {};
|
|
|
let ched = parseInt(params[parKey], 10) === parseInt(subValue.standard_id, 10);
|
|
|
|
|
|
standard[parKey] = subValue.standard_id;
|
|
|
|
|
|
if (ched) {
|
|
|
conditions.push({
|
|
|
name: subValue.standard_name,
|
|
|
href: handleFilterUrl(params, {}, standard),
|
|
|
});
|
|
|
}
|
|
|
|
|
|
sub.push({
|
|
|
id: value.standard_id,
|
|
|
checked: parseInt(params.standard_val, 10) === parseInt(subValue.standard_id, 10),
|
|
|
href: handleFilterUrl(params, {
|
|
|
standard_id: value.standard_id,
|
|
|
standard_val: subValue.standard_id
|
|
|
}),
|
|
|
checked: ched,
|
|
|
href: handleFilterUrl(params, standard),
|
|
|
name: subValue.standard_name
|
|
|
});
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
chose.push({
|
|
|
name: value.standard_name,
|
|
|
sub: sub
|
|
|
});
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (!_.isEmpty(chose)) {
|
|
|
resData.seniorChose = chose;
|
|
|
}
|
|
|
|
|
|
if (!_.isEmpty(conditions)) {
|
|
|
_.set(resData, 'checkedConditions.conditions', conditions);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return resData;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 根据页面设置面包屑导航
|
...
|
...
|
|