index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div class="chainAnalysis">
  3. <div class="chainContent1">
  4. <div style="display: flex">
  5. <el-select v-model="store.state.siteId" placeholder="选择站点">
  6. <el-option
  7. v-for="item in store.state.siteList"
  8. :key="item.id"
  9. :label="item.siteName"
  10. :value="item.id"
  11. ></el-option>
  12. </el-select>
  13. </div>
  14. <div class="chainSwitch">
  15. <el-tree
  16. :data="data"
  17. show-checkbox
  18. node-key="id"
  19. :default-expanded-keys="[2, 3]"
  20. :props="defaultProps"
  21. />
  22. </div>
  23. </div>
  24. <div class="chainContent2">
  25. <div class="chainDivOne">
  26. <div class="chainDivTwo">
  27. <div class="block">
  28. <span class="demonstration">选择时间范围:</span>
  29. <el-date-picker
  30. v-model="value1"
  31. type="datetimerange"
  32. range-separator="➥"
  33. start-placeholder="开始时间"
  34. end-placeholder="结束时间"
  35. ></el-date-picker>
  36. </div>
  37. </div>
  38. <el-radio-group
  39. v-model="listTabPosition"
  40. @change="listTabsChange(listTabPosition)"
  41. style="display: flex"
  42. >
  43. <el-radio-button label="allValue">所有值</el-radio-button>
  44. <el-radio-button label="dailyValue">每日值</el-radio-button>
  45. <el-radio-button label="monthValue">每月值</el-radio-button>
  46. <div style="margin-left: 10px">
  47. <el-button
  48. icon="el-icon-search"
  49. type="primary"
  50. style="padding: 7px 12px"
  51. >
  52. 查询
  53. </el-button>
  54. </div>
  55. </el-radio-group>
  56. </div>
  57. <div class="chainEcharts">
  58. <echarts v-for="op in options" :key="op"></echarts>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import { useStore } from 'vuex'
  65. import { defineComponent, ref, reactive, toRefs } from 'vue'
  66. import echarts from './ehcarts/index.vue'
  67. export default defineComponent({
  68. name: 'chainAnalysis',
  69. components: { echarts },
  70. props: {},
  71. setup() {
  72. const store = useStore()
  73. const listTabsChange = (value) => {
  74. console.log(value)
  75. }
  76. const state = reactive({
  77. value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
  78. })
  79. return {
  80. store,
  81. ...toRefs(state),
  82. listTabPosition: ref('allValue'),
  83. data: [
  84. {
  85. id: 1,
  86. label: '设备1',
  87. children: [
  88. {
  89. id: 4,
  90. label: '母线停电次数',
  91. },
  92. {
  93. id: 4,
  94. label: '功率因数',
  95. },
  96. {
  97. id: 4,
  98. label: 'A相功率因数',
  99. },
  100. ],
  101. },
  102. ],
  103. value: ref(''),
  104. options: ref([
  105. {
  106. value: 'Option1',
  107. label: 'Option1',
  108. },
  109. {
  110. value: 'Option2',
  111. label: 'Option2',
  112. },
  113. {
  114. value: 'Option3',
  115. label: 'Option3',
  116. },
  117. {
  118. value: 'Option4',
  119. label: 'Option4',
  120. },
  121. {
  122. value: 'Option5',
  123. label: 'Option5',
  124. },
  125. ]),
  126. defaultProps: {
  127. children: 'children',
  128. label: 'label',
  129. },
  130. listTabsChange,
  131. }
  132. },
  133. })
  134. </script>
  135. <style lang="scss" scoped>
  136. .chainAnalysis {
  137. display: flex;
  138. height: calc(100vh - 130px);
  139. // padding: 30px;
  140. // margin-top: 50px;
  141. .chainContent1 {
  142. background-color: #fff;
  143. width: 15%;
  144. height: 100%;
  145. margin-right: 25px;
  146. padding: 20px;
  147. min-width: 200px;
  148. .chainSwitch {
  149. margin-top: 20px;
  150. width: 100%;
  151. height: 20px;
  152. cursor: pointer;
  153. .chainSwitchOne {
  154. display: flex;
  155. border: 0.5px solid silver;
  156. padding: 8px;
  157. font-size: 13px;
  158. div:nth-child(1) {
  159. width: 100%;
  160. }
  161. }
  162. .chainSwitchOne:hover {
  163. background-color: #409eff;
  164. }
  165. .chainSwitchOne:focus {
  166. background-color: #409eff;
  167. }
  168. }
  169. }
  170. .chainContent2 {
  171. background-color: #fff;
  172. width: 85%;
  173. min-width: 845px;
  174. height: 100%;
  175. .chainEcharts {
  176. height: calc(100vh - 192px);
  177. overflow-y: auto;
  178. }
  179. .chainDivOne {
  180. display: flex;
  181. margin: 15px 0px 15px 15px;
  182. .chainDivTwo {
  183. font-weight: 600;
  184. color: #9d9d9d;
  185. margin-right: 20px;
  186. }
  187. }
  188. }
  189. }
  190. .chainEcharts::-webkit-scrollbar {
  191. display: none;
  192. }
  193. </style>