Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

otherall.vue 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <div>
  3. <!-- <div class="content_top">
  4. <div class="block">
  5. <span>查询时间:</span>
  6. <el-date-picker
  7. v-model="time_month"
  8. type="month"
  9. placeholder="选择月">
  10. </el-date-picker>
  11. </div>
  12. <div>
  13. <el-date-picker
  14. v-model="stat_time"
  15. type="date"
  16. placeholder="选择日期">
  17. </el-date-picker>
  18. <span>-</span>
  19. <el-date-picker
  20. v-model="end_time"
  21. type="date"
  22. placeholder="选择日期">
  23. </el-date-picker>
  24. </div>
  25. <div style="width: 200px;">
  26. <el-input v-model="input" placeholder="请输入内容"></el-input>
  27. </div>
  28. <el-button type="primary">查询</el-button>
  29. </div> -->
  30. <el-row :gutter="20">
  31. <el-col :span="5">
  32. <div class="block">
  33. <span>查询时间:</span>
  34. <el-date-picker
  35. v-model="time_month"
  36. type="month"
  37. placeholder="选择月">
  38. </el-date-picker>
  39. </div>
  40. </el-col>
  41. <el-col :span="8">
  42. <div>
  43. <el-date-picker
  44. v-model="stat_time"
  45. type="date"
  46. placeholder="选择日期">
  47. </el-date-picker>
  48. <span>-</span>
  49. <el-date-picker
  50. v-model="end_time"
  51. type="date"
  52. placeholder="选择日期">
  53. </el-date-picker>
  54. </div>
  55. </el-col>
  56. <el-col :span="3">
  57. <div style="width: 200px;">
  58. <el-input v-model="input" placeholder="请输入内容"></el-input>
  59. </div>
  60. </el-col>
  61. <el-col :span="2">
  62. <el-button type="primary">查询</el-button>
  63. </el-col>
  64. </el-row>
  65. <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
  66. <p class="chartTitle">统计图</p>
  67. </div>
  68. <div class="echart" id="mychart" :style={width:width,height:height}></div>
  69. <div style="width: 80%;margin: auto;">
  70. <el-table
  71. :data="tableData"
  72. :show-summary = true
  73. border
  74. style="width: 100%;">
  75. <el-table-column
  76. prop="date"
  77. align="center"
  78. label="白蛋白"
  79. >
  80. </el-table-column>
  81. <el-table-column
  82. prop="name"
  83. label="人数"
  84. >
  85. </el-table-column>
  86. <el-table-column
  87. prop="address"
  88. align="center"
  89. label="操作">
  90. <template slot-scope="scope">
  91. <el-button @click="handleClick(scope.row)" style="font-size:16px;"
  92. type="text" >查看详情
  93. </el-button>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. </div>
  98. </div>
  99. </template>
  100. <script>
  101. import * as echarts from "echarts";
  102. export default{
  103. props: {
  104. width: {
  105. type: String,
  106. default: "100%"
  107. },
  108. height: {
  109. type: String,
  110. default: "400px"
  111. },
  112. },
  113. data() {
  114. return {
  115. time_month:'',
  116. stat_time:'',
  117. end_time:'',
  118. input:'',
  119. myChart: {},
  120. pieData : [
  121. {
  122. value: 463,
  123. name: "不达标值患者"
  124. },
  125. {
  126. value: 395,
  127. name: "未检查患者"
  128. },
  129. {
  130. value: 157,
  131. name: "达标值患者"
  132. },
  133. // {
  134. // value: 149,
  135. // name: "广东"
  136. // },
  137. // {
  138. // value: 147,
  139. // name: "湖南"
  140. // }
  141. ],
  142. pieName: [],
  143. // myChartStyle:{float: "right", width: "100%", height: "400px"},
  144. tableData:[],
  145. }
  146. },
  147. mounted() {
  148. this.initDate(); //数据初始化
  149. this.initEcharts();
  150. },
  151. methods: {
  152. initDate() {
  153. for (let i = 0; i < this.pieData.length; i++) {
  154. this.pieName[i] = this.pieData[i].name;
  155. }
  156. },
  157. initEcharts() {
  158. // 饼图
  159. const option = {
  160. legend: {
  161. // 图例
  162. data: this.pieName,
  163. left: "10%",
  164. top: "30%",
  165. orient: "vertical"
  166. },
  167. color:['#ff7f9f','#fff67f','#1e5feb'],
  168. title: {
  169. // 设置饼图标题,位置设为顶部居中
  170. // text: "国内院士前五省份图示",
  171. top: "0%",
  172. left: "center"
  173. },
  174. series: [
  175. {
  176. type: "pie",
  177. label: {
  178. normal : {
  179. formatter: '{b}:{c}: ({d}%)',
  180. textStyle : {
  181. fontWeight : 'normal',
  182. fontSize : 15,
  183. color : "black"
  184. }
  185. }
  186. // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
  187. },
  188. radius: "65%", //饼图半径
  189. data: this.pieData,
  190. itemStyle : {
  191. emphasis: {
  192. shadowBlur: 10,
  193. shadowOffsetX: 0,
  194. shadowColor: 'rgba(0, 0, 0, 0.5)'
  195. }
  196. }
  197. }
  198. ]
  199. };
  200. // console.log(this.seriesData);
  201. const optionFree = {
  202. series: [
  203. {
  204. data: this.seriesData,
  205. type: "line",
  206. smooth: true
  207. }
  208. ]
  209. };
  210. this.myChart = echarts.init(document.getElementById("mychart"));
  211. this.myChart.setOption(option);
  212. //随着屏幕大小调节图表
  213. window.addEventListener("resize", () => {
  214. this.myChart.resize();
  215. });
  216. },
  217. getSummaries(param) {
  218. const { columns, data } = param;
  219. const sums = [];
  220. columns.forEach((column, index) => {
  221. if (index === 0) {
  222. sums[index] = '总价';
  223. return;
  224. }
  225. const values = data.map(item => Number(item[column.property]));
  226. if (!values.every(value => isNaN(value))) {
  227. sums[index] = values.reduce((prev, curr) => {
  228. const value = Number(curr);
  229. if (!isNaN(value)) {
  230. return prev + curr;
  231. } else {
  232. return prev;
  233. }
  234. }, 0);
  235. sums[index] += ' 元';
  236. } else {
  237. sums[index] = 'N/A';
  238. }
  239. });
  240. return sums;
  241. },
  242. handleClick(id){
  243. console.log(id);
  244. }
  245. }
  246. }
  247. </script>
  248. <style lang="scss" scoped>
  249. .content_top{
  250. display: flex;
  251. justify-content: space-around;
  252. color: #1e5feb;
  253. }
  254. </style>