Commit 1d3fd10c by 梁建民

js

parent 98522799
...@@ -26,41 +26,53 @@ const mutations = { ...@@ -26,41 +26,53 @@ const mutations = {
state.ziYingIndex = payload.data; state.ziYingIndex = payload.data;
}, },
aggs(state, payload) { aggs(state, payload) {
if (payload.reset) {
for (let k in payload.data.aggs) {
for (let i = 0; i < payload.data.aggs[k].list.length; i++) {
payload.data.aggs[k].list[i].check = false;
payload.data.aggs[k].list[i].flag=false;
}
}
var arr = [];
var obj = Object.keys(payload.data.aggs);
if (payload.id) { }else{
arr = payload.id.split(","); var arr = [];
}
for (let k in payload.data.aggs) { if (payload.id) {
arr = payload.id.split(",");
}
for (let i = 0; i < payload.data.aggs[k].list.length; i++) { for (let k in payload.data.aggs) {
payload.data.aggs[k].list[i].check = false;
for (let i = 0; i < payload.data.aggs[k].list.length; i++) {
payload.data.aggs[k].list[i].check = false;
for (let j = 0; j < arr.length; j++) {
for (let j = 0; j < arr.length; j++) { if (payload.data.aggs[k].list[i].id == arr[j]) {
payload.data.aggs[k].list[i].check = !payload.data.aggs[k].list[i].check;
payload.data.aggs[k].list[i].flag = !payload.data.aggs[k].list[i].flag;
if (payload.data.aggs[k].list[i].id == arr[j]) {
payload.data.aggs[k].list[i].check = !payload.data.aggs[k].list[i].check;
payload.data.aggs[k].list[i].flag = !payload.data.aggs[k].list[i].flag;
if (payload.reset) {
payload.data.aggs[k].list[i].check = false;
payload.data.aggs[k].list[i].flag = false;
} }
} }
} }
} }
} }
state.aggs = payload.data; state.aggs = payload.data;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment