|
|
@@ -187,23 +187,39 @@ export default {
|
|
|
this.showInfo.scenes.forEach((item) => {
|
|
|
this.showInfo.catalogs.forEach((sub) => {
|
|
|
if (item.category == sub.id) {
|
|
|
- tmp.push(sub);
|
|
|
+ if (tmp.indexOf(sub) < 0) {
|
|
|
+ tmp.push(sub);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
tmp = this.$unique(tmp)
|
|
|
+
|
|
|
this.showInfo.catalogs = tmp;
|
|
|
let rootmp = [];
|
|
|
tmp.forEach((item) => {
|
|
|
this.showInfo.catalogRoot.forEach((sub) => {
|
|
|
+
|
|
|
sub.children = this.$unique(sub.children)
|
|
|
+
|
|
|
if (sub.children.indexOf(item.id) > -1) {
|
|
|
rootmp.push(sub);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
rootmp = this.$unique(rootmp)
|
|
|
|
|
|
+ let sortArr = this.showInfo.catalogRoot.map(item=>item.name)
|
|
|
+ rootmp.sort((a,b)=>{
|
|
|
+ return sortArr.indexOf(a.name) - sortArr.indexOf(b.name)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ console.log(rootmp,666666);
|
|
|
+
|
|
|
+
|
|
|
this.showInfo.catalogRoot = rootmp.map((item) => {
|
|
|
let temp = [];
|
|
|
item.children = this.$unique(item.children)
|
|
|
@@ -219,6 +235,7 @@ export default {
|
|
|
children: temp,
|
|
|
};
|
|
|
});
|
|
|
+
|
|
|
this.showInfo.catalogs = tmp
|
|
|
|
|
|
let cid = 'c_'+this.$randomWord(true,8,8)
|