yongshuifenxi.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <div>
  3. <el-row>
  4. <el-col :span="24" class="first-row">
  5. <div class="tag">用水分析</div>
  6. </el-col>
  7. </el-row>
  8. <el-row>
  9. <el-col :span="24" class="second-row">
  10. <el-form :inline="true" class="demo-form-inline">
  11. <el-form-item label="楼栋号:" class="shuibiaoId">
  12. <el-select v-model="drom_value" placeholder="请选择" class="my-select" @change="drom_change">
  13. <el-option v-for="item in drom_options" :key="item.value" :label="item.label"
  14. :value="item.value">
  15. </el-option>
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="宿舍号:" class="shuibiaoId left-margin">
  19. <el-input placeholder="请输入宿舍号" v-model="room_value" clearable :disabled="room_select_disabled">
  20. </el-input>
  21. </el-form-item>
  22. </el-form>
  23. <div class="water-total">用水总量:15898吨</div>
  24. <div class="show-detail" @click="show_detail">查看详情</div>
  25. </el-col>
  26. </el-row>
  27. <hr style="background-color: #CCCCCC;height: 1px;border: 0;">
  28. <el-row>
  29. <el-col :span="24" class="third-row">
  30. <div style="margin-top: 20px">
  31. <div class="pages">
  32. <div class="tip">用水统计图</div>
  33. <div class="right-tip">
  34. <div class="dmy-btn" :class="{my_active:show_active == '日'}" @click="change_riqi('日')">日</div>
  35. <div class="dmy-btn" :class="{my_active:show_active == '月'}" @click="change_riqi('月')">月</div>
  36. <div class="dmy-btn" :class="{my_active:show_active == '年'}" @click="change_riqi('年')">年</div>
  37. </div>
  38. </div>
  39. <!-- <div class="hygrometer" ref="hygrometer"></div> -->
  40. <!--为echarts准备一个具备大小的容器dom-->
  41. <div id="main" style="width: 100%; height: 500px"></div>
  42. </div>
  43. </el-col>
  44. </el-row>
  45. <el-row>
  46. <el-col :span="24" class="forth-row">
  47. <!-- 编辑对话框 -->
  48. <el-dialog title="用水详情" :visible.sync="editdialogFormVisible" width="640px" top="0vh" class="my-dialog">
  49. <hr
  50. style="width: 100%; position: absolute; top: 60px; left: 0px;background-color: #CCCCCC;height: 1px;border: 0;">
  51. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  52. <el-form-item label="姓名:" class="shuibiaoId">
  53. <el-input v-model="formInline.user" placeholder="请输入姓名"></el-input>
  54. </el-form-item>
  55. <el-form-item>
  56. <el-button type="primary" @click="onSearch">查找</el-button>
  57. </el-form-item>
  58. </el-form>
  59. <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
  60. highlight-current-row>
  61. <el-table-column align="center" label="学号">
  62. <template slot-scope="scope">{{ scope.row.id }}</template>
  63. </el-table-column>
  64. <el-table-column align="center" prop="stuName" label="姓名" show-overflow-tooltip>
  65. </el-table-column>
  66. <el-table-column align="center" prop="yongShuiLiang" label="用水量" show-overflow-tooltip>
  67. </el-table-column>
  68. </el-table>
  69. <div slot="footer" class="dialog-footer">
  70. <div class="dialog-pages">
  71. <el-pagination layout="prev, pager, next" :total="9000"></el-pagination>
  72. </div>
  73. </div>
  74. </el-dialog>
  75. </el-col>
  76. </el-row>
  77. </div>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. show_active: '日',
  84. charts: "",
  85. opinionData: ["3", "2", "4", "4", "5"],
  86. room_select_disabled: true,
  87. day_balance: 88888,
  88. month_balance: 888888,
  89. year_balance: 8888888,
  90. drom_value: '0',
  91. room_value: '1201',
  92. date_value: '0',
  93. drom_options: [{
  94. value: '0',
  95. label: '全部'
  96. }, {
  97. value: '1',
  98. label: '1栋'
  99. }, {
  100. value: '2',
  101. label: '2栋'
  102. }, {
  103. value: '3',
  104. label: '3栋'
  105. }, {
  106. value: '4',
  107. label: '4栋'
  108. }],
  109. date_options: [{
  110. value: '0',
  111. label: '当天日期'
  112. }, {
  113. value: '2021-08-10',
  114. label: '2021-08-10'
  115. }, {
  116. value: '2021-09-20',
  117. label: '2021-09-20'
  118. }, {
  119. value: '2021-10-19',
  120. label: '2021-10-19'
  121. }],
  122. editdialogFormVisible: false,
  123. delDialogVisible: false,
  124. formLabelWidth: '120px',
  125. formInline: {
  126. user: '',
  127. options: [{
  128. value: '选项1',
  129. label: '全部'
  130. }, {
  131. value: '选项2',
  132. label: '黄金糕'
  133. }],
  134. value: '选项1'
  135. },
  136. tableData: [{
  137. id: '20140309010103',
  138. stuName: '吴亦凡',
  139. yongShuiLiang: '188'
  140. }, {
  141. id: '20140309010103',
  142. stuName: '吴亦凡',
  143. yongShuiLiang: '188'
  144. }, {
  145. id: '20140309010103',
  146. stuName: '吴亦凡',
  147. yongShuiLiang: '188'
  148. }, {
  149. id: '20140309010103',
  150. stuName: '吴亦凡',
  151. yongShuiLiang: '188'
  152. }, {
  153. id: '20140309010103',
  154. stuName: '吴亦凡',
  155. yongShuiLiang: '188'
  156. }, {
  157. id: '20140309010103',
  158. stuName: '吴亦凡',
  159. yongShuiLiang: '188'
  160. }, {
  161. id: '20140309010103',
  162. stuName: '吴亦凡',
  163. yongShuiLiang: '188'
  164. }, {
  165. id: '20140309010103',
  166. stuName: '吴亦凡',
  167. yongShuiLiang: '188'
  168. }],
  169. multipleSelection: [],
  170. }
  171. },
  172. mounted() {
  173. var base = +new Date(1988, 9, 3);
  174. var oneDay = 24 * 3600 * 1000;
  175. var data = [
  176. [base, Math.random() * 300]
  177. ];
  178. for (var i = 1; i < 200; i++) {
  179. var now = new Date(base += oneDay);
  180. data.push([
  181. [now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/'),
  182. Math.round((Math.random() - 0.5) * 20 + data[i - 1][1])
  183. ]);
  184. }
  185. var option = {
  186. tooltip: {
  187. trigger: 'axis',
  188. position: function(pt) {
  189. return [pt[0], '10%'];
  190. }
  191. },
  192. title: {
  193. left: 'center',
  194. text: '大数据量面积图',
  195. },
  196. toolbox: {
  197. feature: {
  198. dataZoom: {
  199. yAxisIndex: 'none'
  200. },
  201. restore: {},
  202. saveAsImage: {}
  203. }
  204. },
  205. xAxis: {
  206. type: 'time',
  207. boundaryGap: false
  208. },
  209. yAxis: {
  210. type: 'value',
  211. boundaryGap: [0, '100%']
  212. },
  213. dataZoom: [{
  214. type: 'inside',
  215. start: 0,
  216. end: 20
  217. }, {
  218. start: 0,
  219. end: 20
  220. }],
  221. series: [{
  222. name: '模拟数据',
  223. type: 'line',
  224. smooth: true,
  225. symbol: 'none',
  226. areaStyle: {},
  227. data: data
  228. }]
  229. };
  230. this.$nextTick(function() {
  231. this.charts = this.$echarts.init(document.getElementById('main'));
  232. this.charts.setOption(option);
  233. });
  234. },
  235. methods: {
  236. change_riqi(riqi) {
  237. this.show_active = riqi
  238. // 获取查询年、月、日的数据的参数
  239. var params = {}
  240. if (riqi == '日') {
  241. } else if (riqi == '月') {
  242. } else if (riqi == '年') {
  243. }
  244. // 查询年、月、日的数据
  245. },
  246. drom_change() {
  247. if (this.drom_value != 0) {
  248. this.room_select_disabled = false
  249. } else {
  250. this.room_select_disabled = true
  251. }
  252. },
  253. onSearch() {
  254. console.log('onSearch!');
  255. },
  256. show_detail(e) {
  257. this.editdialogFormVisible = true
  258. console.log(e);
  259. }
  260. }
  261. }
  262. </script>
  263. <style scoped>
  264. @import url("yongshuifenxi.css");
  265. </style>