@@ -123,6 +123,8 @@ | |||||
if(value=='/wel/index'){return} | if(value=='/wel/index'){return} | ||||
if (action === 'remove') { | if (action === 'remove') { | ||||
let { tag, key } = this.findTag(value) | let { tag, key } = this.findTag(value) | ||||
// console.log(tag,'关闭的标签'); | |||||
// return | |||||
this.$store.commit('DEL_TAG', tag) | this.$store.commit('DEL_TAG', tag) | ||||
if (tag.value === this.tag.value) { | if (tag.value === this.tag.value) { | ||||
tag = this.tagList[key === 0 ? key : key - 1] // 如果关闭本标签让前推一个 | tag = this.tagList[key === 0 ? key : key - 1] // 如果关闭本标签让前推一个 | ||||
@@ -47,6 +47,7 @@ const navs = { | |||||
state.tagList = state.tagList.filter(item => { | state.tagList = state.tagList.filter(item => { | ||||
return !diff(item, action) | return !diff(item, action) | ||||
}) | }) | ||||
// console.log(state,action,'内容'); | |||||
setFistTag(state.tagList) | setFistTag(state.tagList) | ||||
setStore({ name: 'tagList', content: state.tagList, type: 'session' }) | setStore({ name: 'tagList', content: state.tagList, type: 'session' }) | ||||
}, | }, | ||||
@@ -62,10 +62,13 @@ export const diff = (obj1, obj2) => { | |||||
var o1 = obj1 instanceof Object | var o1 = obj1 instanceof Object | ||||
var o2 = obj2 instanceof Object | var o2 = obj2 instanceof Object | ||||
if (!o1 || !o2) { /* 判断不是对象 */ | if (!o1 || !o2) { /* 判断不是对象 */ | ||||
// console.log(1); | |||||
return obj1 === obj2 | return obj1 === obj2 | ||||
} | } | ||||
if (Object.keys(obj1).length !== Object.keys(obj2).length) { | if (Object.keys(obj1).length !== Object.keys(obj2).length) { | ||||
// console.log(2); | |||||
console.log(Object.keys(obj1).length,Object.keys(obj2).length); | |||||
return false | return false | ||||
// Object.keys() 返回一个由对象的自身可枚举属性(key值)组成的数组,例如:数组返回下表:let arr = ["a", "b", "c"];console.log(Object.keys(arr))->0,1,2; | // Object.keys() 返回一个由对象的自身可枚举属性(key值)组成的数组,例如:数组返回下表:let arr = ["a", "b", "c"];console.log(Object.keys(arr))->0,1,2; | ||||
} | } | ||||
@@ -74,11 +77,15 @@ export const diff = (obj1, obj2) => { | |||||
var t1 = obj1[attr] instanceof Object | var t1 = obj1[attr] instanceof Object | ||||
var t2 = obj2[attr] instanceof Object | var t2 = obj2[attr] instanceof Object | ||||
if (t1 && t2) { | if (t1 && t2) { | ||||
// console.log(3); | |||||
return diff(obj1[attr], obj2[attr]) | return diff(obj1[attr], obj2[attr]) | ||||
} else if (obj1[attr] !== obj2[attr]) { | } else if (obj1[attr] !== obj2[attr]) { | ||||
// console.log(obj1[attr],obj2[attr]); | |||||
// console.log(4); | |||||
return false | return false | ||||
} | } | ||||
} | } | ||||
// console.log(5); | |||||
return true | return true | ||||
} | } | ||||
/** | /** | ||||
@@ -723,6 +723,16 @@ export default { | |||||
}, | }, | ||||
methods: { | methods: { | ||||
gojianyi(){ | gojianyi(){ | ||||
// console.log(this.$route); | |||||
let tag={ | |||||
group:[], | |||||
label: "接待详情", | |||||
params:{}, | |||||
query:this.$route.query, | |||||
value:this.$route.fullPath, | |||||
} | |||||
// console.log(tag); | |||||
this.$store.commit('DEL_TAG', tag) | |||||
this.$router.go(-1);//返回上一层 | this.$router.go(-1);//返回上一层 | ||||
}, | }, | ||||
//上一首 | //上一首 | ||||