hemoglobinalone.vue 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <div>
  3. <div class="content_top">
  4. <el-autocomplete
  5. class="inline-input"
  6. v-model="inputValue"
  7. :fetch-suggestions="querySearch"
  8. :trigger-on-focus="false"
  9. placeholder="请输入患者名字或透析号"
  10. @select="handleSubmit"
  11. ></el-autocomplete>
  12. <div>
  13. <span>查询时间:</span>
  14. <el-date-picker
  15. v-model="stat_time"
  16. type="date"
  17. placeholder="选择日期">
  18. </el-date-picker>
  19. <span>-</span>
  20. <el-date-picker
  21. v-model="end_time"
  22. type="date"
  23. placeholder="选择日期">
  24. </el-date-picker>
  25. <el-select v-model="value" placeholder="请选择">
  26. <el-option
  27. v-for="item in options"
  28. :key="item.value"
  29. :label="item.label"
  30. :value="item.value">
  31. </el-option>
  32. </el-select>
  33. <el-select v-model="value" placeholder="请选择">
  34. <el-option
  35. v-for="item in options"
  36. :key="item.value"
  37. :label="item.label"
  38. :value="item.value">
  39. </el-option>
  40. </el-select>
  41. <el-button type="primary">查询</el-button>
  42. </div>
  43. <div>
  44. <el-button type="primary">打印</el-button>
  45. <el-button type="primary">导出</el-button>
  46. </div>
  47. </div>
  48. <div style="margin: 20px 0px;">
  49. <h2 >患者列表</h2>
  50. </div>
  51. <div >
  52. <el-row :gutter="20">
  53. <el-col :span="4">
  54. <div class="grid-content bg-purple">
  55. <!-- <span style="font-size: 18px;font-weight: bold;display: block;">患者列表</span> -->
  56. <!-- <h2>患者列表</h2> -->
  57. <el-table
  58. :data="tableData"
  59. border
  60. style="width: 100%">
  61. <el-table-column
  62. align="center"
  63. prop="date"
  64. label="透析号"
  65. >
  66. </el-table-column>
  67. <el-table-column
  68. align="center"
  69. prop="name"
  70. label="姓名"
  71. >
  72. </el-table-column>
  73. </el-table>
  74. </div>
  75. </el-col>
  76. <el-col :span="19">
  77. <div class="grid-content bg-purple">
  78. <div class="echart" id="germychart" style="width:100%;height:400px"></div>
  79. <el-table
  80. :data="tableData"
  81. style="width: 100%"
  82. border
  83. align="center"
  84. max-height="250">
  85. <el-table-column
  86. fixed
  87. prop="date"
  88. label="姓名"
  89. >
  90. </el-table-column>
  91. <el-table-column
  92. prop="name"
  93. label="检查日期"
  94. >
  95. </el-table-column>
  96. <el-table-column
  97. prop="province"
  98. label="血红蛋白(g/L)"
  99. >
  100. </el-table-column>
  101. </el-table>
  102. </div>
  103. </el-col>
  104. </el-row>
  105. </div>
  106. </div>
  107. </template>
  108. <script>
  109. import * as echarts from 'echarts'
  110. export default{
  111. // props: {
  112. // width: {
  113. // type: String,
  114. // default: "100%"
  115. // },
  116. // height: {
  117. // type: String,
  118. // default: "400px"
  119. // },
  120. // },
  121. data() {
  122. return {
  123. inputValue:'',
  124. stat_time:'',
  125. end_time:'',
  126. value:'',
  127. myChart: {},
  128. xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], //横坐标
  129. opinionData: [23, 24, 18, 25, 27, 28, 25], //人数数据
  130. // myChartStyle: { float: "left", width: "100%", height: "400px" },//图表样式
  131. tableData:[],
  132. }
  133. },
  134. created(){
  135. },
  136. mounted() {
  137. // this.$nextTick(function() {
  138. this.initEcharts();
  139. // })
  140. // this.myChart = echarts.init(document.getElementById("germychart"));
  141. // this.myChart.setOption(option);
  142. //随着屏幕大小调节图表
  143. window.addEventListener("resize", () => {
  144. this.myChart.resize();
  145. });
  146. },
  147. methods:{
  148. handleSubmit(){
  149. console.log('asdfa');
  150. },
  151. initEcharts() {
  152. const option = {
  153. xAxis: {
  154. type: 'category',
  155. boundaryGap:true,
  156. axisTick:{
  157. alignWithLabel:true //保证刻度线和标签对齐
  158. },
  159. data: this.xData,
  160. splitNumber:this.xData.length, //纵坐标数
  161. interval:this.xData //强制设置坐标轴分割间隔
  162. },
  163. yAxis: {
  164. type: 'value',
  165. boundaryGap: true,
  166. splitNumber:4, //纵坐标数
  167. interval:10 //强制设置坐标轴分割间隔
  168. },
  169. legend: {
  170. show: true,
  171. align:'left',//文字在前图标在后
  172. left:'15%',
  173. top:'5%',
  174. data: [{name:'血红蛋白g/L'}]
  175. },
  176. series: [
  177. {
  178. data: this.opinionData,
  179. name:'血红蛋白g/L',
  180. type: "line",// 类型设置为折线图
  181. symbol: 'circle',
  182. itemStyle: {
  183. normal: {
  184. color: '#409eff', //改变折线点的颜色#a80000
  185. lineStyle: {
  186. color: '#409eff' //改变折线颜色
  187. }
  188. }
  189. },
  190. },
  191. ],
  192. };
  193. this.myChart = echarts.init(document.getElementById("germychart"));
  194. this.myChart.setOption(option);
  195. //随着屏幕大小调节图表
  196. window.addEventListener("resize", () => {
  197. this.myChart.resize();
  198. });
  199. },
  200. },
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. .content_top{
  205. display: flex;
  206. justify-content: space-around;
  207. margin-bottom: 20px;
  208. }
  209. </style>