Authored by 杨延青

Merge branch 'feature/styleId' into 'release/6.8.3'

解决style id为多个时选中异常问题



See merge request !397
... ... @@ -349,9 +349,9 @@ class FilterTools {
condition.totalName;
}
} else if (k === 'style') {
const styleids = _.split(params.style, ',');
const styleids = (params.style || '') + ',';
const styleFinds = _.filter(filter.style,
style => _.some(styleids, id => _.parseInt(id) === style.style_id));
style => styleids.includes(`${style.style_id},`));
if (styleFinds.length) {
condition.name = styleFinds.length >= 2 ?
... ... @@ -540,13 +540,13 @@ class FilterTools {
const filter = _.get(origin, 'filter', {});
let styles = [];
const href = handleFilterUrl(baseUrl, params, {style: '${style}'});
const styleids = _.split(params.style, ',');
const styleids = (params.style || '') + ',';
_.each(filter.style, style => {
styles.push({
name: style.style_name,
href: href.replace('${style}', style.style_id),
checked: _.some(styleids, id => _.parseInt(id) === style.style_id),
checked: styleids.includes(`${style.style_id},`),
id: style.style_id
});
});
... ...
... ... @@ -877,10 +877,10 @@ exports.handleSeniorFilterData = (data, params) => {
if (!_.isEmpty(data.style)) {
let sub = [],
conName = [];
let styles = _.split(_.get(params, 'style', ''), ',');
let styles = _.get(params, 'style', '') + ',';
_.forEach(data.style, value => {
let ched = styles.indexOf(`${value.style_id}`) >= 0;
let ched = styles.includes(`${value.style_id},`);
if (ched && conName.length < 2) {
conName.push(value.style_name);
... ...