@@ -200,45 +200,28 @@ export default {
200
200
201
201
if (this .$store .state .storedSubscriptionName !== ' ' ) {
202
202
this .getData (this .$store .state .subscription_id )
203
- // let self = this
204
- // let subId = lodash.findIndex(self.$store.state.subscription_list, function (o) { return o.label === 'All' })
205
- // console.log('self.$store.state.subscription_list.....', self.$store.state.subscription_list, subId)
206
- // if (subId !== -1) {
207
- // console.log('called....')
208
- // self.$store.state.subscription_list.splice(subId, 1)
209
- // }
210
-
211
- // let subscriptionObj1
212
- // subscriptionObj1 = lodash.filter(self.$store.state.subscription_list, function (o) {
213
- // if (o.label === self.$store.state.storedSubscriptionName) {
214
- // return o
215
- // }
216
- // })
217
- // console.log('subscriptionObj1 &&&&&&', subscriptionObj1)
218
- // if (subscriptionObj1.length !== 0) {
219
- // self.$store.state.subscription_id = subscriptionObj1[0].value
220
- // }
221
- // this.getData(this.$store.state.subscription_id)
222
- // } else {
223
- // let self = this
224
- // let subId = lodash.findIndex(self.$store.state.subscription_list, function (o) { return o.label === 'All' })
225
- // if (subId !== -1) {
226
- // self.$store.state.subscription_list.splice(subId, 1)
227
- // }
228
- // this.$store.state.subscription_id = this.$store.state.subscription_list[0].value
229
- // this.$store.state.subscription_name = this.$store.state.subscription_list[0].label
230
- // this.$store.state.storedSubscriptionName = this.$store.state.subscription_name
231
- // this.getData(this.$store.state.subscription_id)
232
203
}
204
+ console .log (' this.$store.state.storedUsername uploader .....' , this .$store .state .storedUsername , this .$store .state .user_detail_list )
205
+ // let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === this.$store.state.storedUsername })
206
+ // console.log('&&&&&', filteredUser)
207
+ // let subsArr = []
208
+
209
+ // for (let userSubs in filteredUser) {
210
+ // for (let subs in this.$store.state.fullSubscriptionList) {
211
+ // if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
212
+ // subsArr.push(this.$store.state.fullSubscriptionList[subs])
213
+ // }
214
+ // }
215
+ // }
216
+ // this.$store.state.subscription_list = []
217
+ // this.$store.state.subscription_list = subsArr
218
+ // this.$store.state.storedSubscriptionName = subsArr[0].label
233
219
},
234
220
watch: {
235
221
' $store.state.subscription_id ' : function (id ) {
236
222
console .log (' $store' )
237
223
if (id === ' All' ) {
238
224
this .loading = false
239
- // this.$Notice.error({
240
- // title: 'Please select a proper subscription id...'
241
- // })
242
225
} else {
243
226
if (this .showDiv === true ) {
244
227
this .showDiv = false
@@ -257,50 +240,45 @@ export default {
257
240
let subId = lodash .findIndex (this .$store .state .subscription_list , function (o ) { return o .label === ' All' })
258
241
if (subId !== - 1 ) {
259
242
this .$store .state .subscription_list .splice (subId, 1 )
260
- // this.$store.state.fullSubscriptionList = lodash.cloneDeep(this.$store.state.subscription_list)
243
+ let self = this
244
+ let filteredUser = lodash .filter (this .$store .state .user_detail_list , function (o ) { return o .name === self .$store .state .storedUsername })
245
+ console .log (' &&&&&' , filteredUser)
246
+ let subsArr = []
247
+
248
+ if (filteredUser .length !== 0 ) {
249
+ for (let userSubs in filteredUser) {
250
+ for (let subs in self .$store .state .fullSubscriptionList ) {
251
+ if (filteredUser[userSubs].value === self .$store .state .fullSubscriptionList [subs].value ) {
252
+ subsArr .push (self .$store .state .fullSubscriptionList [subs])
253
+ }
254
+ }
255
+ }
256
+ self .$store .state .subscription_list = []
257
+ self .$store .state .subscription_list = subsArr
258
+ self .$store .state .storedSubscriptionName = subsArr[0 ].label
259
+ console .log (' subsArr....' , subsArr)
260
+ self .$store .state .subscription_id = subsArr[0 ].value
261
+ }
261
262
}
262
263
}
263
264
}
264
265
}
265
266
},
266
267
' $store.state.storedUsername ' : function (selectedUser ) {
267
- console .log (' called 8888888....' )
268
- if (selectedUser !== ' All' ) {
269
- let filteredUser = lodash .filter (this .$store .state .user_detail_list , function (o ) { return o .name === selectedUser })
270
- let subsArr = []
268
+ console .log (' called.....' )
269
+ let filteredUser = lodash .filter (this .$store .state .user_detail_list , function (o ) { return o .name === selectedUser })
270
+ let subsArr = []
271
271
272
- for (let userSubs in filteredUser) {
273
- for (let subs in this .$store .state .fullSubscriptionList ) {
274
- if (filteredUser[userSubs].value === this .$store .state .fullSubscriptionList [subs].value ) {
275
- subsArr .push (this .$store .state .fullSubscriptionList [subs])
276
- }
272
+ for (let userSubs in filteredUser) {
273
+ for (let subs in this .$store .state .fullSubscriptionList ) {
274
+ if (filteredUser[userSubs].value === this .$store .state .fullSubscriptionList [subs].value ) {
275
+ subsArr .push (this .$store .state .fullSubscriptionList [subs])
277
276
}
278
277
}
279
- this .$store .state .subscription_list = []
280
- this .$store .state .subscription_list = subsArr
281
- this .$store .state .storedSubscriptionName = subsArr[0 ].label
282
- } else {
283
- console .log (' else called' )
284
- this .$store .state .subscription_list = []
285
- this .$store .state .subscription_list = this .$store .state .fullSubscriptionList
286
- this .$store .state .storedSubscriptionName = this .$store .state .fullSubscriptionList [0 ].label
287
278
}
279
+ this .$store .state .subscription_list = subsArr
280
+ this .$store .state .storedSubscriptionName = subsArr[0 ].label
288
281
}
289
- // '$store.state.storedUsername': function (selectedUser) {
290
- // console.log('called.....')
291
- // let filteredUser = lodash.filter(this.$store.state.user_detail_list, function (o) { return o.name === selectedUser })
292
- // let subsArr = []
293
-
294
- // for (let userSubs in filteredUser) {
295
- // for (let subs in this.$store.state.fullSubscriptionList) {
296
- // if (filteredUser[userSubs].value === this.$store.state.fullSubscriptionList[subs].value) {
297
- // subsArr.push(this.$store.state.fullSubscriptionList[subs])
298
- // }
299
- // }
300
- // }
301
- // this.$store.state.subscription_list = subsArr
302
- // this.$store.state.storedSubscriptionName = subsArr[0].label
303
- // }
304
282
}
305
283
}
306
284
</script >
0 commit comments