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

time.vue 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  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. <el-tabs v-model="activeName" @tab-click="handleClick">
  8. <el-tab-pane label="按时间分组" name="first"></el-tab-pane>
  9. <el-tab-pane label="按项目分组" name="second"></el-tab-pane>
  10. </el-tabs>
  11. <div class="cell clearfix">
  12. <!-- <el-select v-model="lapseto" placeholder="请选择" style="width:120px;margin-right:10px" @change="changeLapseto">
  13. <el-option
  14. v-for="item in options"
  15. :key="item.value"
  16. :label="item.label"
  17. :value="item.value"
  18. ></el-option>
  19. </el-select> -->
  20. <el-select v-model="type" placeholder="请选择" @change="chooseType" style="margin-right:10px">
  21. <el-option
  22. v-for="item in options1"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. ></el-option>
  27. </el-select>
  28. <div v-if="type == '自定义'">
  29. <label class="title">
  30. <span class="name">日期查询</span> :
  31. </label>
  32. <el-date-picker
  33. v-model="listQuery.start_time"
  34. prefix-icon="el-icon-date"
  35. @change="changeTime"
  36. :editable="false"
  37. style="width: 196px;"
  38. type="date"
  39. placeholder="选择日期时间"
  40. align="right"
  41. format="yyyy-MM-dd"
  42. value-format="yyyy-MM-dd"
  43. ></el-date-picker>
  44. <span class>-</span>
  45. <el-date-picker
  46. v-model="listQuery.end_time"
  47. prefix-icon="el-icon-date"
  48. @change="changeEndTime"
  49. :editable="false"
  50. style="width: 196px;"
  51. type="date"
  52. placeholder="选择日期时间"
  53. align="right"
  54. format="yyyy-MM-dd"
  55. value-format="yyyy-MM-dd"
  56. ></el-date-picker>
  57. </div>
  58. </div>
  59. <div class="cell clearfix">
  60. <div class="time newLi" v-if="type == '按季度统计对比'">
  61. <ul class>
  62. <li
  63. :class="item.state == quarterType ? 'active' : ''"
  64. @click="chooseQuarter(item.state)"
  65. v-for="item in quarter"
  66. :key="item.value"
  67. >{{ item.label }}
  68. </li>
  69. </ul>
  70. </div>
  71. <div class="time newLi" v-if="type == '按月份统计对比'">
  72. <ul class>
  73. <li
  74. :class="item.state == monthType ? 'active' : ''"
  75. @click="chooseMonth(item.state)"
  76. v-for="item in month"
  77. :key="item.value"
  78. >{{ item.label }}
  79. </li>
  80. </ul>
  81. </div>
  82. </div>
  83. <div class="cell clearfix">
  84. <label class="title"> <span class="name">转归状态</span> : </label>
  85. <div class="time">
  86. <ul class>
  87. <li
  88. :class="item.lapseto == lapseto ? 'active' : ''"
  89. @click="changeLapseto(item.lapseto)"
  90. v-for="item in lapsetoState"
  91. :key="item.value"
  92. >
  93. {{ item.label }}
  94. </li>
  95. </ul>
  96. </div>
  97. </div>
  98. <div class="cell clearfix">
  99. <label class="title"> <span class="name">患者来源</span> : </label>
  100. <div class="time">
  101. <ul class>
  102. <li
  103. :class="item.source == originType ? 'active' : ''"
  104. @click="selectOrigin(item.source)"
  105. v-for="item in originState"
  106. :key="item.value"
  107. >
  108. {{ item.label }}
  109. </li>
  110. </ul>
  111. </div>
  112. </div>
  113. <div class="cell clearfix">
  114. <p class="chartTitle">统计图</p>
  115. </div>
  116. <div class="cell clearfix">
  117. <p class="point"></p>
  118. <p class="pointTitle">达标率</p>
  119. </div>
  120. <div v-loading="isLoading">
  121. <line-chart :options="chart"></line-chart>
  122. </div>
  123. <div class="cell clearfix">
  124. <p class="point"></p>
  125. <p class="pointTitle">指标正常范围值</p>
  126. </div>
  127. <div class="cell clearfix newDisplay">
  128. <span v-for="(item,index) in normData" :key="index" class="index">
  129. <span v-if="item.is_status == 1">{{ item.item_name }}</span>
  130. <span v-if="item.is_status == 0 && item.inspection_major == 0 && item.inspection_minor == -1">收缩压</span>
  131. <span v-if="item.is_status == 0 && item.inspection_major == 0 && item.inspection_minor == -2">舒张压</span>
  132. <span v-if="item.range_type == 1 && item.is_status == 1">({{ item.min_range }}-{{ item.large_range }})</span>
  133. <span v-if="item.range_type == 2 && item.is_status == 1">({{ item.range_value }})</span>
  134. <span v-if="item.range_type == 0 && item.is_status == 0">({{ item.min_range }}-{{ item.large_range }})</span>
  135. </span>
  136. </div>
  137. </div>
  138. </div>
  139. </template>
  140. <script>
  141. const moment = require('moment')
  142. import echarts from 'echarts'
  143. import LineChart from '../../qcd/components/LineChart'
  144. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  145. import { getFirstQuarter, getNormData } from '@/api/common/common'
  146. export default {
  147. components: {
  148. LineChart,
  149. BreadCrumb
  150. },
  151. data() {
  152. return {
  153. pickerOptions: {
  154. disabledDate(time) {
  155. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
  156. return time.getTime() > Date.now() || time.getTime() < threeMonths
  157. }
  158. },
  159. isLoading: false,
  160. sortOne: 0,
  161. sortTwo: 0,
  162. modetype: 0,
  163. startime: '',
  164. endtime: '',
  165. activeName: 'first',
  166. modesData: {
  167. xAxis: [],
  168. series: []
  169. }, lapsetoType: 0,
  170. lapsetoState: [
  171. { value: 0, label: '全部', source: 0, lapseto: 0 },
  172. { value: 1, label: '转出', source: 0, lapseto: 2 },
  173. { value: 2, label: '留治', source: 0, lapseto: 1 }
  174. ],originType:0,
  175. originState: [
  176. { value: 0, label: '全部', source: 0},
  177. { value: 2, label: '住院', source: 2},
  178. { value: 1, label: '门诊', source: 1}
  179. ],
  180. crumbs: [
  181. { path: false, name: '质控管理' },
  182. { path: false, name: '科室质控达标统计' },
  183. { path: false, name: '按时间分组' }
  184. ],
  185. normData: [],
  186. newArrData: [],
  187. listQuery: {
  188. start_time: '',
  189. end_time: '',
  190. page: 1,
  191. limit: 10
  192. },
  193. lapseto: 0,
  194. options: [
  195. {
  196. value: 0,
  197. label: '全部'
  198. },
  199. {
  200. value: 1,
  201. label: '留治'
  202. },
  203. {
  204. value: 2,
  205. label: '转出'
  206. }
  207. ],
  208. value: '请选项',
  209. options1: [
  210. {
  211. value: '按季度统计对比',
  212. label: '按季度统计对比'
  213. },
  214. {
  215. value: '按月份统计对比',
  216. label: '按月份统计对比'
  217. },
  218. {
  219. value: '自定义',
  220. label: '自定义'
  221. }
  222. ],
  223. type: '按季度统计对比',
  224. quarter: [
  225. { value: 0, label: '第一季度', state: 0 },
  226. { value: 1, label: '第二季度', state: 1 },
  227. { value: 2, label: '第三季度', state: 2 },
  228. { value: 3, label: '第四季度', state: 3 }
  229. ],
  230. quarterType: 0,
  231. month: [
  232. { value: 0, label: '一月', state: 0 },
  233. { value: 1, label: '二月', state: 1 },
  234. { value: 2, label: '三月', state: 2 },
  235. { value: 3, label: '四月', state: 3 },
  236. { value: 4, label: '五月', state: 4 },
  237. { value: 5, label: '六月', state: 5 },
  238. { value: 6, label: '七月', state: 6 },
  239. { value: 7, label: '八月', state: 7 },
  240. { value: 8, label: '九月', state: 8 },
  241. { value: 9, label: '十月', state: 9 },
  242. { value: 10, label: '十一月', state: 10 },
  243. { value: 11, label: '十二月', state: 11 }
  244. ],
  245. monthType: 0,
  246. chart: {
  247. // title: {
  248. // text: "ECharts 入门示例"
  249. // },
  250. tooltip: {},
  251. // legend: {
  252. // data: ["达标率"],
  253. // left: 0
  254. // },
  255. xAxis: {
  256. data: []
  257. },
  258. yAxis: {
  259. axisLabel: {
  260. formatter: '{value}%'
  261. },
  262. show: false
  263. },
  264. series: [
  265. {
  266. name: '达标率',
  267. type: 'bar',
  268. data: [],
  269. barWidth: 30,
  270. label: {
  271. normal: {
  272. show: true,
  273. position: 'top',
  274. formatter: '{c}%'
  275. }
  276. },
  277. //配置样式
  278. itemStyle: {
  279. //通常情况下:
  280. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  281. normal: {
  282. color: function(params) {
  283. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  284. var colorList = [
  285. ['#A9E0F3', '#9FBDFC'],
  286. ['#A9E0F3', '#9FBDFC'],
  287. ['#A9E0F3', '#9FBDFC'],
  288. ['#FFD7C0', '#FF9994'],
  289. ['#FFD7C0', '#FF9994'],
  290. ['#FFD7C0', '#FF9994'],
  291. ['#D7C3FD', '#B3A8F7'],
  292. ['#D7C3FD', '#B3A8F7'],
  293. ['#D7C3FD', '#B3A8F7']
  294. ]
  295. var index = params.dataIndex
  296. if (params.dataIndex >= colorList.length) {
  297. index = params.dataIndex % colorList.length
  298. }
  299. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  300. { offset: 0, color: colorList[index][0] },
  301. // { offset: 0.5, color: colorList[index][1] },
  302. { offset: 1, color: colorList[index][1] }
  303. ])
  304. },
  305. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  306. },
  307. //鼠标悬停时:
  308. emphasis: {
  309. shadowBlur: 10,
  310. shadowOffsetX: 0,
  311. shadowColor: 'rgba(0, 0, 0, 0.2)'
  312. }
  313. }
  314. }
  315. ],
  316. dataZoom: [
  317. {
  318. // Y轴固定,让内容滚动
  319. type: 'slider',
  320. show: false,
  321. xAxisIndex: [0],
  322. start: 1,
  323. end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
  324. zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
  325. },
  326. {
  327. type: 'inside',
  328. xAxisIndex: [0],
  329. start: 1,
  330. end: 20,
  331. zoomLock: true // 锁定区域禁止缩放
  332. }
  333. ]
  334. },
  335. syslarge: 0,
  336. sysmin: 0,
  337. dialarge: 0,
  338. diamin: 0
  339. }
  340. },
  341. methods: {
  342. handleClick() {
  343. if (this.activeName == 'second') {
  344. this.$router.push({ path: '/qcd/officesControlAnalysis/project' })
  345. }
  346. },
  347. changeTime(val) {
  348. var time = this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time)
  349. if (time > 0) {
  350. this.$message.error('结束时间不能小于开始时间')
  351. this.listQuery.start_time = ''
  352. } else {
  353. this.getlist()
  354. }
  355. },
  356. changeLapseto(val) {
  357. if (val == 0) {
  358. this.lapseto = 0
  359. this.getlist()
  360. }
  361. if (val == 1) {
  362. this.lapseto = 1
  363. this.getlist()
  364. }
  365. if (val == 2) {
  366. this.lapseto = 2
  367. this.getlist()
  368. }
  369. },
  370. changeEndTime(val) {
  371. var time =
  372. this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time)
  373. if (time < 0) {
  374. this.$message.error('结束时间不能小于开始时间')
  375. this.listQuery.end_time = ''
  376. } else {
  377. this.getlist()
  378. }
  379. },
  380. getTimestamp(time) {
  381. // 把时间日期转成时间戳
  382. return new Date(time).getTime() / 1000
  383. },
  384. selectLapseTo(state) {
  385. this.lapsetoType = state
  386. this.getlist()
  387. // this.listQuery.state = state
  388. },selectOrigin(state) {
  389. this.originType = state
  390. // this.listQuery.state = state
  391. this.getlist()
  392. },
  393. chooseType(val) {
  394. this.modesData.series = []
  395. this.modesData.xAxis = []
  396. this.type = val
  397. if (val == '按月份统计对比') {
  398. this.modetype = 1
  399. this.monthType = 0
  400. this.getlist()
  401. }
  402. if (val == '按季度统计对比') {
  403. this.modetype = 0
  404. this.getlist()
  405. }
  406. if (val == '自定义') {
  407. this.modetype = 2
  408. }
  409. },
  410. chooseQuarter(quarter) {
  411. this.quarterType = quarter
  412. //第一季度
  413. if (quarter === 0) {
  414. this.modetype = 0
  415. this.getlist()
  416. return false
  417. }
  418. //第二季度
  419. if (quarter === 1) {
  420. this.modetype = 0
  421. this.getlist()
  422. return false
  423. }
  424. //第三季度
  425. if (quarter === 2) {
  426. this.modetype = 0
  427. this.getlist()
  428. return false
  429. }
  430. //第四季度
  431. if (quarter === 3) {
  432. this.modetype = 0
  433. this.getlist()
  434. return false
  435. }
  436. },
  437. chooseMonth(month) {
  438. //1月
  439. if (month == 0) {
  440. this.modetype = 1
  441. this.monthType = month
  442. this.getlist()
  443. return false
  444. }
  445. //2月
  446. if (month == 1) {
  447. this.modetype = 1
  448. this.monthType = month
  449. this.getlist()
  450. return false
  451. }
  452. //
  453. //3月
  454. if (month == 2) {
  455. this.modetype = 1
  456. this.monthType = month
  457. this.getlist()
  458. return false
  459. }
  460. //4月
  461. if (month == 3) {
  462. this.modetype = 1
  463. this.monthType = month
  464. this.getlist()
  465. return false
  466. }
  467. //5月
  468. if (month == 4) {
  469. this.modetype = 1
  470. this.monthType = month
  471. this.getlist()
  472. return false
  473. }
  474. //6月
  475. if (month == 5) {
  476. this.modetype = 1
  477. this.monthType = month
  478. this.getlist()
  479. return false
  480. }
  481. //7月
  482. if (month == 6) {
  483. this.monthType = month
  484. this.modetype = 1
  485. this.getlist()
  486. return false
  487. }
  488. //8月
  489. if (month == 7) {
  490. this.monthType = month
  491. this.modetype = 1
  492. this.getlist()
  493. return false
  494. }
  495. //9月
  496. if (month == 8) {
  497. this.monthType = month
  498. this.modetype = 1
  499. this.getlist()
  500. return false
  501. }
  502. //10月
  503. if (month == 9) {
  504. this.monthType = month
  505. this.modetype = 1
  506. this.getlist()
  507. return false
  508. }
  509. //11月
  510. if (month == 10) {
  511. this.monthType = month
  512. this.modetype = 1
  513. this.getlist()
  514. return false
  515. }
  516. //12月
  517. if (month == 11) {
  518. this.monthType = month
  519. this.modetype = 1
  520. this.getlist()
  521. return false
  522. }
  523. },
  524. getNormData() {
  525. getNormData().then(response => {
  526. if (response.data.state === 1) {
  527. var newArr = []
  528. var normdata = response.data.data.normdata
  529. newArr = normdata
  530. // console.log("指标正常范围",normdata)
  531. var bloodpressure = response.data.data.bloodPressure
  532. console.log('bloodPressure', bloodpressure)
  533. for (let i = 0; i < bloodpressure.length; i++) {
  534. if (bloodpressure[i].inspection_major == 0 && bloodpressure[i].inspection_minor == -1 && bloodpressure[i].is_status == 0) {
  535. bloodpressure[i].item_name = '收缩压'
  536. this.sortOne = bloodpressure[i].sort
  537. this.syslarge = parseInt(bloodpressure[i].large_range)
  538. this.sysmin = parseInt(bloodpressure[i].min_range)
  539. }
  540. if (bloodpressure[i].inspection_major == 0 && bloodpressure[i].inspection_minor == -2 && bloodpressure[i].is_status == 0) {
  541. bloodpressure[i].item_name = '舒张压'
  542. this.sortTwo = bloodpressure[i].sort
  543. this.dialarge = parseInt(bloodpressure[i].large_range)
  544. this.diamin = parseInt(bloodpressure[i].min_range)
  545. }
  546. }
  547. // console.log("血压数据",bloodpressure)
  548. bloodpressure.map(item => {
  549. newArr.push(item)
  550. })
  551. var newarr = newArr.sort((a, b) => {
  552. return a.sort - b.sort
  553. })
  554. // console.log("normdata",newarr)
  555. this.normData = newarr
  556. this.getlist()
  557. }
  558. })
  559. },
  560. //第一季度
  561. getlist() {
  562. this.modesData.series = []
  563. this.modesData.xAxis = []
  564. //本月的开始时间
  565. //第一季度
  566. if (this.modetype == 0 && this.quarterType == 0) {
  567. this.startime = moment().startOf('year').format('YYYY-MM-DD')
  568. this.endtime = moment().month(2).endOf('month').format('YYYY-MM-DD')
  569. }
  570. //第二季度
  571. if (this.modetype == 0 && this.quarterType == 1) {
  572. this.startime = moment().month(3).startOf('month').format('YYYY-MM-DD')
  573. this.endtime = moment().month(5).endOf('month').format('YYYY-MM-DD')
  574. }
  575. //第三季度
  576. if (this.modetype == 0 && this.quarterType == 2) {
  577. this.startime = moment().month(6).startOf('month').format('YYYY-MM-DD')
  578. this.endtime = moment().month(8).endOf('month').format('YYYY-MM-DD')
  579. }
  580. //第四季度
  581. if (this.modetype == 0 && this.quarterType == 3) {
  582. this.startime = moment().month(9).startOf('month').format('YYYY-MM-DD')
  583. this.endtime = moment().month(11).endOf('month').format('YYYY-MM-DD')
  584. }
  585. //1月
  586. if (this.modetype == 1 && this.monthType == 0) {
  587. this.startime = moment().month(0).startOf('month').format('YYYY-MM-DD')
  588. this.endtime = moment().month(0).endOf('month').format('YYYY-MM-DD')
  589. }
  590. //2 月
  591. if (this.modetype == 1 && this.monthType == 1) {
  592. this.startime = moment().month(1).startOf('month').format('YYYY-MM-DD')
  593. this.endtime = moment().month(1).endOf('month').format('YYYY-MM-DD')
  594. }
  595. //3 月
  596. if (this.modetype == 1 && this.monthType == 2) {
  597. this.startime = moment().month(2).startOf('month').format('YYYY-MM-DD')
  598. this.endtime = moment().month(2).endOf('month').format('YYYY-MM-DD')
  599. }
  600. //4月
  601. if (this.modetype == 1 && this.monthType == 3) {
  602. this.startime = moment().month(3).startOf('month').format('YYYY-MM-DD')
  603. this.endtime = moment().month(3).endOf('month').format('YYYY-MM-DD')
  604. }
  605. //5月
  606. if (this.modetype == 1 && this.monthType == 4) {
  607. this.startime = moment().month(4).startOf('month').format('YYYY-MM-DD')
  608. this.endtime = moment().month(4).endOf('month').format('YYYY-MM-DD')
  609. }
  610. //6月
  611. if (this.modetype == 1 && this.monthType == 5) {
  612. this.startime = moment().month(5).startOf('month').format('YYYY-MM-DD')
  613. this.endtime = moment().month(5).endOf('month').format('YYYY-MM-DD')
  614. }
  615. //7月
  616. if (this.modetype == 1 && this.monthType == 6) {
  617. this.startime = moment().month(6).startOf('month').format('YYYY-MM-DD')
  618. this.endtime = moment().month(6).endOf('month').format('YYYY-MM-DD')
  619. }
  620. //8月
  621. if (this.modetype == 1 && this.monthType == 7) {
  622. this.startime = moment().month(7).startOf('month').format('YYYY-MM-DD')
  623. this.endtime = moment().month(7).endOf('month').format('YYYY-MM-DD')
  624. }
  625. //9月
  626. if (this.modetype == 1 && this.monthType == 8) {
  627. this.startime = moment().month(8).startOf('month').format('YYYY-MM-DD')
  628. this.endtime = moment().month(8).endOf('month').format('YYYY-MM-DD')
  629. }
  630. //10月
  631. if (this.modetype == 1 && this.monthType == 9) {
  632. this.startime = moment().month(9).startOf('month').format('YYYY-MM-DD')
  633. this.endtime = moment().month(9).endOf('month').format('YYYY-MM-DD')
  634. }
  635. //11月
  636. if (this.modetype == 1 && this.monthType == 10) {
  637. this.startime = moment().month(10).startOf('month').format('YYYY-MM-DD')
  638. this.endtime = moment().month(10).endOf('month').format('YYYY-MM-DD')
  639. }
  640. //12月
  641. if (this.modetype == 1 && this.monthType == 11) {
  642. this.startime = moment().month(11).startOf('month').format('YYYY-MM-DD')
  643. this.endtime = moment().month(11).endOf('month').format('YYYY-MM-DD')
  644. }
  645. if (this.modetype == 2) {
  646. this.startime = this.listQuery.start_time
  647. this.endtime = this.listQuery.end_time
  648. }
  649. const params = {
  650. lapseto: this.lapseto,
  651. startime: this.startime,
  652. endtime: this.endtime,
  653. origin:this.originType,
  654. }
  655. this.isLoading = true
  656. getFirstQuarter(params).then(response => {
  657. if (response.data.state === 1) {
  658. this.isLoading = false
  659. var count = response.data.data.count
  660. var countwo = response.data.data.countwo
  661. var systolicTotal = response.data.data.systolicTotal
  662. console.log('systolictotal', systolicTotal)
  663. var sysstandTotal = 0
  664. var systolic = response.data.data.systolic
  665. console.log('systolic', systolic)
  666. var sysarr = []
  667. for (let i = 0; i < systolic.length; i++) {
  668. if (systolic[i].systolic_blood_pressure >= this.sysmin && systolic[i].systolic_blood_pressure <= this.syslarge) {
  669. sysarr.push(systolic[i])
  670. }
  671. }
  672. sysstandTotal = sysarr.length
  673. console.log('sysarr', sysarr)
  674. var diastotal = response.data.data.diastotal
  675. var diasstandtotal = 0
  676. var diastolic = response.data.data.diastolic
  677. // console.log("diastolic",diastolic)
  678. var diaArr = []
  679. for (let i = 0; i < diastolic.length; i++) {
  680. if (diastolic[i].diastolic_blood_pressure >= this.diamin && diastolic[i].diastolic_blood_pressure <= this.dialarge) {
  681. diaArr.push(diastolic[i])
  682. }
  683. }
  684. // console.log("diaArr",diaArr)
  685. diasstandtotal = diaArr.length
  686. var normData = response.data.data.normData
  687. var newArr = [
  688. { item_id: 0, Total: 0, Count: 0, sort: 0 },
  689. { item_id: 0, Total: 0, Count: 0, sort: 0 }
  690. ]
  691. for (let i = 0; i < newArr.length; i++) {
  692. if (sysstandTotal == 0) {
  693. newArr[0].Total = 1
  694. newArr[0].Count = sysstandTotal
  695. newArr[0].sort = this.sortOne
  696. } else {
  697. newArr[0].Total = systolicTotal
  698. newArr[0].Count = sysstandTotal
  699. newArr[0].sort = this.sortOne
  700. }
  701. if (diasstandtotal == 0) {
  702. newArr[1].Total = 1
  703. newArr[1].Count = diasstandtotal
  704. newArr[1].sort = this.sortTwo
  705. } else {
  706. newArr[1].Total = diastotal
  707. newArr[1].Count = diasstandtotal
  708. newArr[1].sort = this.sortTwo
  709. }
  710. }
  711. countwo.map(item => {
  712. count.push(item)
  713. })
  714. //获取已经配置的数据
  715. var arr = []
  716. for (let i = 0; i < count.length; i++) {
  717. for (let j = 0; j < normData.length; j++) {
  718. if (count[i].item_id == normData[j].inspection_minor) {
  719. arr.push(count[i])
  720. }
  721. }
  722. }
  723. var arrtwo = this.arrayDate(count, normData)
  724. for (let i = 0; i < arrtwo.length; i++) {
  725. this.$set(arrtwo[i], 'Count', 0)
  726. }
  727. for (let i = 0; i < arrtwo.length; i++) {
  728. this.$set(arrtwo[i], 'Total', 1)
  729. }
  730. arrtwo.map(item => {
  731. arr.push(item)
  732. })
  733. newArr.map(item => {
  734. arr.push(item)
  735. })
  736. arr.sort(this.compare('sort'))
  737. for (const key in this.normData) {
  738. this.modesData.xAxis.push(this.normData[key].item_name)
  739. if (key in arr) {
  740. this.modesData.series.push(((parseInt(arr[key].Count) / parseInt(arr[key].Total)) * 100).toFixed(1))
  741. } else {
  742. this.modesData.series.push(0)
  743. }
  744. }
  745. this.chart.series[0].data = this.modesData.series
  746. this.chart.xAxis.data = this.modesData.xAxis
  747. this.getArrLength(this.chart.xAxis.data)
  748. } else {
  749. this.isLoading = false
  750. }
  751. })
  752. },
  753. compare(property) {
  754. return function(a, b) {
  755. var value1 = a[property]
  756. var value2 = b[property]
  757. return value1 - value2
  758. }
  759. },
  760. arrayDate(array1, array2) {
  761. var array1 = array1
  762. var array2 = array2
  763. var result = []
  764. for (var i = 0; i < array2.length; i++) {
  765. var obj = array2[i]
  766. var num = obj.inspection_minor //staff_id 就是要对比的key
  767. var isExist = false
  768. for (var j = 0; j < array1.length; j++) {
  769. var aj = array1[j]
  770. var n = aj.item_id
  771. if (n == num) {
  772. isExist = true
  773. break
  774. }
  775. }
  776. if (!isExist) {
  777. result.push(obj)
  778. }
  779. }
  780. return result
  781. },
  782. getArrLength(result) {
  783. if (result.length > 10) {
  784. var dataZoom_end = (10 / result.length) * 100
  785. this.chart.dataZoom[0].end = dataZoom_end
  786. } else {
  787. var dataZoom_end = 100
  788. this.chart.dataZoom[0].end = dataZoom_end
  789. }
  790. }
  791. },
  792. created() {
  793. //获取指标正常范围值
  794. this.getNormData()
  795. // this.getFirstQuarter(this.lapseto,firstQuarterStart,firstQuarterEnd)
  796. }
  797. }
  798. </script>
  799. <style lang="scss" scoped>
  800. .newLi {
  801. li {
  802. background: #f5f5f6;
  803. }
  804. }
  805. .chartTitle {
  806. font-size: 16px;
  807. font-weight: bold;
  808. color: #000000;
  809. }
  810. .point {
  811. width: 13px;
  812. height: 13px;
  813. background: linear-gradient(
  814. 0deg,
  815. rgba(169, 224, 243, 1),
  816. rgba(159, 189, 252, 1)
  817. );
  818. border-radius: 7px;
  819. margin-right: 8px;
  820. }
  821. .pointTitle {
  822. font-size: 13px;
  823. }
  824. .index {
  825. color: #a09ba3;
  826. font-size: 13px;
  827. margin-right: 36px;
  828. margin-bottom: 20px;
  829. }
  830. .newDisplay {
  831. flex-wrap: wrap;
  832. padding-left: 20px;
  833. }
  834. </style>