Electro.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="electro">
  3. <div class="reply" :style="{color: color}">全场用电情况</div>
  4. <x-form :formItems="formItems" :day="day" @setDay="setDay" @onClickType="onClickType"></x-form>
  5. <div class="echarts">
  6. <div class="echarts-l">
  7. <chart-electro></chart-electro>
  8. </div>
  9. <div class="echarts-r">
  10. <chart-dl></chart-dl>
  11. </div>
  12. </div>
  13. <br>
  14. <div class="reply" :style="{color: color}">用电量详情</div>
  15. <x-form :formItems="selectItems" :day="day1" @setDay="setDay1" @onClickType="onClickType1"></x-form>
  16. <div class="echarts">
  17. <div class="echarts-l">
  18. <chart-electro :id="'1'"></chart-electro>
  19. </div>
  20. <div class="echarts-r">
  21. <chart-dl :id="'1'"></chart-dl>
  22. </div>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import { mapState } from 'vuex';
  28. import XForm from "@/components/XForm";
  29. import ChartElectro from "@/views/Env/chart/ChartElectro";
  30. import ChartDl from "@/views/dashboard/chart/ChartDl";
  31. export default {
  32. name: "Electro",
  33. components: {
  34. XForm,
  35. ChartElectro,
  36. ChartDl
  37. },
  38. data() {
  39. return {
  40. formItems: [
  41. {
  42. id: 1,
  43. type: 'text',
  44. text: '今日',
  45. value: 1,
  46. col: 1
  47. },
  48. {
  49. id: 2,
  50. type: 'text',
  51. text: '本周',
  52. value: 2,
  53. col: 1
  54. },
  55. {
  56. id: 3,
  57. type: 'text',
  58. text: '本月',
  59. value: 3,
  60. col: 1
  61. },
  62. {
  63. id: 4,
  64. type: 'datepicker',
  65. placeholder: [],
  66. field: 'value1',
  67. col: 6
  68. },
  69. {
  70. id: 5,
  71. type: 'button',
  72. text: '查询',
  73. col: 2,
  74. click: 'search'
  75. }
  76. ],
  77. day: 2,
  78. selectItems: [
  79. {
  80. id: 1,
  81. type: 'select',
  82. label: '栋舍:',
  83. placeholder: '请选择栋舍',
  84. field: 'areaId',
  85. options: [],
  86. col: 4
  87. },
  88. {
  89. id: 2,
  90. type: 'select',
  91. label: '单元:',
  92. placeholder: '请选择单元',
  93. field: 'unitId',
  94. options: [],
  95. col: 4
  96. },
  97. {
  98. id: 3,
  99. type: 'text',
  100. text: '今日',
  101. value: 1,
  102. col: 1
  103. },
  104. {
  105. id: 4,
  106. type: 'text',
  107. text: '本周',
  108. value: 2,
  109. col: 1
  110. },
  111. {
  112. id: 5,
  113. type: 'text',
  114. text: '本月',
  115. value: 3,
  116. col: 1
  117. },
  118. {
  119. id: 6,
  120. type: 'datepicker',
  121. placeholder: [],
  122. field: 'value1',
  123. col: 6
  124. },
  125. {
  126. id: 7,
  127. type: 'button',
  128. text: '查询',
  129. col: 2,
  130. click: 'search'
  131. }
  132. ],
  133. day1: 2,
  134. dataValue: [12, 13, 10, 13, 9, 23, 21, 21, 24, 23, 14, 21, 21]
  135. };
  136. },
  137. computed: {
  138. ...mapState(['color'])
  139. },
  140. methods: {
  141. setDay(data) {
  142. this.day = data;
  143. },
  144. onClickType() {
  145. },
  146. setDay1(data) {
  147. this.day1 = data;
  148. },
  149. onClickType1() {},
  150. }
  151. }
  152. </script>
  153. <style scoped>
  154. .electro {
  155. width: 100%;
  156. height: 100%;
  157. box-sizing: border-box;
  158. padding: 20px 20px 0 20px;
  159. }
  160. .reply {
  161. width: 100%;
  162. border: 1px solid #ddd;
  163. border-bottom: 0;
  164. height: 50px;
  165. background-color: #F3F3F3;
  166. line-height: 50px;
  167. font-size: 18px;
  168. box-sizing: border-box;
  169. padding-left: 20px;
  170. }
  171. .echarts {
  172. width: 100%;
  173. height: 401px;
  174. box-sizing: border-box;
  175. border: 1px solid #ddd;
  176. border-top: 0;
  177. display: flex;
  178. }
  179. .echarts-l {
  180. width: 30%;
  181. height: 100%;
  182. }
  183. .echarts-r {
  184. width: 70%;
  185. height: 100%;
  186. }
  187. </style>