Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eventTable搜索的过滤分开写会不会更好些? #11

Open
Gxinzai opened this issue Aug 20, 2018 · 0 comments
Open

eventTable搜索的过滤分开写会不会更好些? #11

Gxinzai opened this issue Aug 20, 2018 · 0 comments

Comments

@Gxinzai
Copy link

Gxinzai commented Aug 20, 2018

notapad () {
let self = this
let typeFilter = () => self.screen_type ? todo => todo.type === self.screen_type : todo => todo
let titleFilter = () => self.screen_title
? todo => todo.content.indexOf(self.screen_title) !== -1
: todo => todo
return self.$store.getters.getEventList.filter(typeFilter()).filter(titleFilter())

  // return self.$store.getters.getEventList.filter(function (d) {
  //   if (self.screen_type !== 0 && self.screen_title === '') {
  //     if (d.type === self.screen_type) {
  //       return d
  //     }
  //   } else if (self.screen_type !== 0 && self.screen_title !== '') {
  //     if (d.type === self.screen_type && d.content.indexOf(self.screen_title) !== -1) {
  //       return d
  //     }
  //   } else if (self.screen_type === 0 && self.screen_title !== '') {
  //     if (d.content.indexOf(self.screen_title) !== -1) {
  //       return d
  //     }
  //   } else {
  //     return d
  //   }
  // })
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant