analysisDetails.vue 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="page_analysisDetails">
  8. <div class="cell clearfix" style="margin:0">
  9. <el-form :inline="true" :model="listQuery">
  10. <el-form-item label>
  11. <el-input v-model.trim="listQuery.search" placeholder="姓名/透析号" style="width:150px"></el-input>
  12. <el-button type="primary" @click="onSearch" icon="el-icon-search">搜索</el-button>
  13. </el-form-item>
  14. </el-form>
  15. </div>
  16. <el-container>
  17. <div style="width:150px">
  18. <div class="tableTitle">患者列表</div>
  19. <el-table :data="tableData" border style="width: 100%;" height="500">
  20. <el-table-column prop="date" label="日期" width="70"></el-table-column>
  21. <el-table-column prop="name" label="姓名" width="80"></el-table-column>
  22. </el-table>
  23. </div>
  24. <div class="containerRight" style="flex:1;overflow: hidden">
  25. <div class="cell clearfix">
  26. <label class="title" style="text-align:left">
  27. <span class="name">统计方式</span> :
  28. </label>
  29. <div class="time">
  30. <ul class>
  31. <li
  32. :class="item.state == monthType ? 'active' : ''"
  33. @click="chooseMonth(item.state)"
  34. v-for="item in month"
  35. :key="item.value"
  36. >{{ item.label }}</li>
  37. </ul>
  38. </div>
  39. <label class="title">
  40. <span class="name">日期查询</span> :
  41. </label>
  42. <el-date-picker
  43. v-model="listQuery.start_time"
  44. prefix-icon="el-icon-date"
  45. @change="changeTime"
  46. :editable="false"
  47. type="date"
  48. style="max-width:160px"
  49. placeholder="选择日期时间"
  50. align="right"
  51. format="yyyy-MM-dd"
  52. value-format="yyyy-MM-dd"
  53. ></el-date-picker>
  54. <span class>-</span>
  55. <el-date-picker
  56. v-model="listQuery.end_time"
  57. prefix-icon="el-icon-date"
  58. @change="changeEndTime"
  59. :editable="false"
  60. type="date"
  61. style="max-width:160px"
  62. placeholder="选择日期时间"
  63. align="right"
  64. format="yyyy-MM-dd"
  65. value-format="yyyy-MM-dd"
  66. ></el-date-picker>
  67. </div>
  68. <div class="tableTitle">指标趋势</div>
  69. <div>
  70. <line-chart :options="chart"></line-chart>
  71. </div>
  72. </div>
  73. </el-container>
  74. </div>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import echarts from "echarts";
  80. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  81. import LineChart from "../../qcd/components/LineChart";
  82. export default {
  83. components: {
  84. LineChart,
  85. BreadCrumb
  86. },
  87. data() {
  88. return {
  89. crumbs: [
  90. { path: false, name: "科室质控" },
  91. { path: false, name: "指标评估统计" },
  92. { path: false, name: "化验指标统计详情" }
  93. ],
  94. tableData: [
  95. {
  96. date: "2016",
  97. name: "王小虎"
  98. },
  99. {
  100. date: "2016",
  101. name: "王小虎"
  102. },
  103. {
  104. date: "2016",
  105. name: "王小虎"
  106. },
  107. {
  108. date: "2016",
  109. name: "王小虎"
  110. },
  111. {
  112. date: "2016",
  113. name: "王小虎"
  114. },
  115. {
  116. date: "2016",
  117. name: "王小虎"
  118. },
  119. {
  120. date: "2016",
  121. name: "王小虎"
  122. },
  123. {
  124. date: "2016",
  125. name: "王小虎"
  126. },
  127. {
  128. date: "2016",
  129. name: "王小虎"
  130. },
  131. {
  132. date: "2016",
  133. name: "王小虎"
  134. },
  135. {
  136. date: "2016",
  137. name: "王小虎"
  138. },
  139. {
  140. date: "2016",
  141. name: "王小虎"
  142. }
  143. ],
  144. listQuery: {
  145. start_time: "",
  146. end_time: "",
  147. page: 1,
  148. limit: 10
  149. },
  150. month: [
  151. { value: 0, label: "本月", state: 0 },
  152. { value: 1, label: "近三个月", state: 1 },
  153. { value: 2, label: "近半年", state: 2 },
  154. { value: 3, label: "近一年", state: 3 }
  155. ],
  156. monthType: 0,
  157. chart: {
  158. title: {
  159. text: "ECharts 入门示例"
  160. },
  161. tooltip: {},
  162. legend: {
  163. data: ["次数"],
  164. left: 0
  165. },
  166. xAxis: {
  167. data: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
  168. },
  169. yAxis: {
  170. axisLabel: {
  171. formatter: "{value} %"
  172. },
  173. show: false
  174. },
  175. series: [
  176. {
  177. name: "次数",
  178. type: "line",
  179. data: [
  180. "78.57",
  181. "50",
  182. "80",
  183. "93.33",
  184. "92.86",
  185. "100",
  186. "12",
  187. "77",
  188. "37"
  189. ],
  190. barWidth: 30,
  191. label: {
  192. normal: {
  193. show: true,
  194. position: "top",
  195. formatter: "{c}次"
  196. }
  197. },
  198. //配置样式
  199. itemStyle: {
  200. //通常情况下:
  201. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  202. normal: {
  203. color: function(params) {
  204. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  205. var colorList = [
  206. ["#A9E0F3", "#9FBDFC"],
  207. ["#A9E0F3", "#9FBDFC"],
  208. ["#A9E0F3", "#9FBDFC"],
  209. ["#FFD7C0", "#FF9994"],
  210. ["#FFD7C0", "#FF9994"],
  211. ["#FFD7C0", "#FF9994"],
  212. ["#D7C3FD", "#B3A8F7"],
  213. ["#D7C3FD", "#B3A8F7"],
  214. ["#D7C3FD", "#B3A8F7"]
  215. ];
  216. var index = params.dataIndex;
  217. if (params.dataIndex >= colorList.length) {
  218. index = params.dataIndex % colorList.length;
  219. }
  220. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  221. { offset: 0, color: colorList[index][0] },
  222. // { offset: 0.5, color: colorList[index][1] },
  223. { offset: 1, color: colorList[index][1] }
  224. ]);
  225. },
  226. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  227. },
  228. //鼠标悬停时:
  229. emphasis: {
  230. shadowBlur: 10,
  231. shadowOffsetX: 0,
  232. shadowColor: "rgba(0, 0, 0, 0.5)"
  233. }
  234. }
  235. }
  236. ]
  237. }
  238. };
  239. },
  240. methods: {
  241. chooseMonth(month) {
  242. this.monthType = month;
  243. }
  244. }
  245. };
  246. </script>
  247. <style lang="scss" scoped>
  248. .containerRight {
  249. padding-left: 10px;
  250. }
  251. .tableTitle {
  252. font-size: 16px;
  253. color: #000;
  254. font-weight: bold;
  255. margin-bottom: 10px;
  256. margin-top: 8px;
  257. }
  258. </style>
  259. <style lang="scss">
  260. .page_analysisDetails {
  261. .cell {
  262. text-align: center;
  263. }
  264. .el-form-item {
  265. margin-bottom: 0;
  266. }
  267. }
  268. </style>