index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="widget-groupPageModules" v-if="showGroupPage">
  3. <!--左侧模块-->
  4. <ContractInfo :show="showGroupPage" v-on="{ fontSize, getRequestResult, setNullAndUndefinedEmpty }" />
  5. <!--中部模块-->
  6. <IndexStatistic :show="showGroupPage" v-on="{ fontSize, getRequestResult, setNullAndUndefinedEmpty }" />
  7. <!--右侧模块-->
  8. <ProjectInfo :show="showGroupPage" v-on="{ fontSize, getRequestResult, setNullAndUndefinedEmpty }" />
  9. <!--底部模块-->
  10. <ProjectStatistic :show="showGroupPage" v-on="{ fontSize, getRequestResult, setNullAndUndefinedEmpty }" />
  11. </div>
  12. </template>
  13. <script>
  14. import { getBlockPage, getResultList } from '@/api/bigScreenAPI/bigScreenRequest'
  15. //信息模块
  16. import ContractInfo from '@/views/groupPage/groupPageModules/ContractInfo.vue'
  17. import ProjectStatistic from '@/views/groupPage/groupPageModules/ProjectStatistic.vue'
  18. import ProjectInfo from '@/views/groupPage/groupPageModules/ProjectInfo.vue'
  19. import IndexStatistic from '@/views/groupPage/groupPageModules/IndexStatistic.vue'
  20. export default {
  21. name: 'groupPageModules', //集团分公司页面模块
  22. components: {
  23. ContractInfo,
  24. ProjectStatistic,
  25. ProjectInfo,
  26. IndexStatistic
  27. },
  28. props: {
  29. show: {}
  30. },
  31. computed: {
  32. showGroupPage() {
  33. return this.show
  34. },
  35. fontSize() {
  36. return this.$listeners.fontSize
  37. }
  38. },
  39. mounted() {
  40. getBlockPage({ size: 999 }).then((res) => {
  41. // console.log('code列表', res)
  42. })
  43. },
  44. methods: {
  45. async getRequestResult(params) {
  46. let returnData = await new Promise((resolve, reject) => {
  47. getResultList(params)
  48. .then((res) => {
  49. if (res.code == 1) resolve(res.result)
  50. })
  51. .catch((err) => {})
  52. })
  53. return returnData
  54. },
  55. //数据检查公共方法(针对数字)
  56. setNullAndUndefinedEmpty(input) {
  57. if (
  58. input === 'Null' ||
  59. input === 'null' ||
  60. input === 'NULL' ||
  61. input === null ||
  62. input === undefined ||
  63. input === ''
  64. ) {
  65. return 0
  66. } else {
  67. return input
  68. }
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang='scss' scoped>
  74. </style>