allcommunit.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { mapState } from 'vuex';
  2. export default {
  3. data() {
  4. return {
  5. loadding: true
  6. };
  7. },
  8. computed: {
  9. //全局社区
  10. ...mapState(['globalCommunity']),
  11. resize() {
  12. // 通过scale值来判断窗口是变化
  13. return this.$store.getters['getScale'];
  14. }
  15. },
  16. watch: {
  17. globalCommunity: {
  18. handler(newVal, oldVal) {
  19. if (!!newVal.type) {
  20. this.mixins_query.communityId = null;
  21. this.mixins_query.companyIds = newVal.value.join();
  22. } else {
  23. this.mixins_query.companyIds = null;
  24. this.mixins_query.communityId = newVal.value.join();
  25. }
  26. this.getData();
  27. },
  28. deep: true
  29. },
  30. resize(va) {
  31. // console.log(va);
  32. }
  33. },
  34. methods: {},
  35. created() {
  36. const { type, value } = this.globalCommunity
  37. if (!!type) {
  38. this.mixins_query.communityId = null;
  39. this.mixins_query.companyIds = value.join();
  40. } else {
  41. this.mixins_query.companyIds = null;
  42. this.mixins_query.communityId = value.join();
  43. }
  44. }
  45. };