...
|
...
|
@@ -23,12 +23,19 @@ |
|
|
const bus = require('common/vue-bus');
|
|
|
const Overlay = require('common/overlay');
|
|
|
const filterSub = require('./filter/filter-sub.vue');
|
|
|
const qs = require('yoho-qs/parse');
|
|
|
let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, '')));
|
|
|
let hasSort = !!locationQuery.sort;
|
|
|
|
|
|
const aliasMap = {
|
|
|
groupSort: 'sort'
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
props: {
|
|
|
config: Object,
|
|
|
isVisible: Boolean,
|
|
|
action: '',
|
|
|
action: ''
|
|
|
},
|
|
|
data: function() {
|
|
|
return {
|
...
|
...
|
@@ -60,8 +67,8 @@ |
|
|
showCate: function(cateName, cateVals) {
|
|
|
if (toString.call(cateVals) === '[object Array]') {
|
|
|
if (cateName === 'groupSort') {
|
|
|
// TODO
|
|
|
} else if (cateVals.length > 1) {
|
|
|
return !hasSort;
|
|
|
} else if (cateVals.length >= 1) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -92,10 +99,16 @@ |
|
|
* @param {[type]} val [description]
|
|
|
*/
|
|
|
setParams: function(item) {
|
|
|
this.$set(`params.${this.subType}`, item);
|
|
|
let sortType = this.subType;
|
|
|
|
|
|
aliasMap[this.subType] && (sortType = aliasMap[this.subType]);
|
|
|
|
|
|
this.$set(`params.${sortType}`, item);
|
|
|
},
|
|
|
|
|
|
showLabel: function(key) {
|
|
|
aliasMap[key] && (key = aliasMap[key]);
|
|
|
|
|
|
const newSelected = this.params[key];
|
|
|
const oldSelected = this.selected[key];
|
|
|
|
...
|
...
|
@@ -106,24 +119,6 @@ |
|
|
}
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
|
unifyTxt: function(val, category) {
|
|
|
let txt = '';
|
|
|
let arr = [];
|
|
|
let foo = $.noop;
|
|
|
|
|
|
|
|
|
if ($.isArray(val)) { // [{categoryName,..},{}..]
|
|
|
foo = (index, obj) => {
|
|
|
arr.push(obj[category + 'Name']);
|
|
|
};
|
|
|
}
|
|
|
|
|
|
$.each(val, foo);
|
|
|
txt = arr.join(',');
|
|
|
return txt;
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
const self = this;
|
|
|
|
...
|
...
|
|