personnel.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <template>
  2. <div class="personnel">
  3. <div class="personnel-btn">
  4. <div
  5. @click="clickBtn(btn, index)"
  6. class="i-btn"
  7. v-for="(btn, index) of btns"
  8. :key="index"
  9. :class="{ active: index == btnIndex }"
  10. >
  11. {{ btn.name }}
  12. </div>
  13. </div>
  14. <div class="personnel-box">
  15. <div
  16. class="personnel-box-item"
  17. v-for="(item, index) in resData"
  18. :key="index"
  19. @click="todesc(item)"
  20. >
  21. <div class="personnel-box-item-h">
  22. <div class="personnel-box-item-header">
  23. <img :src="imgurl(item.username)" />
  24. </div>
  25. <div class="personnel-box-item-form">
  26. <div class="personnel-box-item-group">
  27. <div class="personnel-box-item-label">收缩血压:</div>
  28. <div class="personnel-box-item-value">
  29. {{ item.objects && item.objects.SSXY.doubleValue.toFixed(2) }}
  30. </div>
  31. </div>
  32. <div class="personnel-box-item-group">
  33. <div class="personnel-box-item-label">舒张血压:</div>
  34. <div class="personnel-box-item-value">
  35. {{ item.objects && item.objects.SZXY.doubleValue.toFixed(2) }}
  36. </div>
  37. </div>
  38. <div class="personnel-box-item-group">
  39. <div class="personnel-box-item-label">心跳频率:</div>
  40. <div class="personnel-box-item-value">
  41. {{ item.objects && item.objects.XTPL.doubleValue.toFixed(2) }}
  42. </div>
  43. </div>
  44. <div class="personnel-box-item-group">
  45. <div class="personnel-box-item-label">血氧浓度:</div>
  46. <div class="personnel-box-item-value">
  47. {{ item.objects && item.objects.XYND.doubleValue.toFixed(2) }}
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="personnel-box-item-f">
  53. <div class="personnel-box-item-name">
  54. {{ item.objects && item.username }}
  55. </div>
  56. <div class="personnel-box-item-icon">
  57. <i :class="['el-icon-user-solid',item.objects && frontOneHour<item.objects['LAT'].ts? 'icolor':'']" ></i>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <el-dialog
  63. title="人员信息"
  64. v-model="dialogVisible"
  65. width="1400px"
  66. top="10vh"
  67. custom-class="modal hide-header"
  68. :close-on-click-modal="false"
  69. >
  70. <div class="info-popup">
  71. <div class="query left mg-b-8">
  72. <div class="query-items">
  73. <div class="query-item">
  74. <div class="lable">开始日期:</div>
  75. <div class="search-input">
  76. <el-date-picker
  77. v-model="startdate"
  78. type="date"
  79. placeholder="选择日期"
  80. popper-class="date-select"
  81. class="placeholder-left"
  82. >
  83. </el-date-picker>
  84. </div>
  85. </div>
  86. <div class="query-item">
  87. <div class="lable">结束日期:</div>
  88. <div class="search-input">
  89. <el-date-picker
  90. v-model="enddate"
  91. type="date"
  92. placeholder="选择日期"
  93. popper-class="date-select"
  94. class="placeholder-left"
  95. >
  96. </el-date-picker>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="query-actions">
  101. <button class="btn green" @click="searchper">查询</button>
  102. </div>
  103. </div>
  104. <div class="prople-info mg-t-16 mg-b-16">
  105. <div class="prople-info-item">
  106. <div class="font-md gray-l">检修人员</div>
  107. <div class="font-md white">
  108. {{ perData.objects && perData.username }}
  109. </div>
  110. </div>
  111. <div class="prople-info-item">
  112. <div class="font-md gray-l">疲劳度</div>
  113. <div class="font-md white">
  114. {{
  115. perData.objects && perData.objects.PLD.doubleValue.toFixed(2)
  116. }}
  117. </div>
  118. </div>
  119. <div class="prople-info-item">
  120. <div class="font-md gray-l">步数</div>
  121. <div class="font-md white">
  122. {{ perData.objects && perData.objects.BS.doubleValue.toFixed(2) }}
  123. </div>
  124. </div>
  125. <div class="prople-info-item">
  126. <div class="font-md gray-l">收缩血压</div>
  127. <div class="font-md white">
  128. {{
  129. perData.objects && perData.objects.SSXY.doubleValue.toFixed(2)
  130. }}
  131. </div>
  132. </div>
  133. <div class="prople-info-item">
  134. <div class="font-md gray-l">舒张血压</div>
  135. <div class="font-md white">
  136. {{
  137. perData.objects && perData.objects.SZXY.doubleValue.toFixed(2)
  138. }}
  139. </div>
  140. </div>
  141. <div class="prople-info-item">
  142. <div class="font-md gray-l">心跳频率</div>
  143. <div class="font-md white">
  144. {{
  145. perData.objects && perData.objects.XTPL.doubleValue.toFixed(2)
  146. }}
  147. </div>
  148. </div>
  149. <div class="prople-info-item">
  150. <div class="font-md gray-l">血氧浓度</div>
  151. <div class="font-md white">
  152. {{
  153. perData.objects && perData.objects.XYND.doubleValue.toFixed(2)
  154. }}
  155. </div>
  156. </div>
  157. </div>
  158. <div class="white font-md mg-t-16 mg-b-16">检测人员健康情况</div>
  159. <normal-line-chart
  160. class="people-chart"
  161. height="45vh"
  162. :showLegend="true"
  163. :units="['半小时检测值']"
  164. :list='chartList'
  165. />
  166. </div>
  167. </el-dialog>
  168. </div>
  169. </template>
  170. <script>
  171. import NormalLineChart from "@com/chart/line/normal-line-chart.vue";
  172. import axios from "axios";
  173. export default {
  174. // 名称
  175. name: "personnel",
  176. // 使用组件
  177. components: {
  178. NormalLineChart,
  179. },
  180. // 数据
  181. data() {
  182. return {
  183. btns: [
  184. {
  185. name: "全部",
  186. val: "",
  187. },
  188. {
  189. name: "麻黄山",
  190. val: "MHS_FDC",
  191. },
  192. {
  193. name: "牛首山",
  194. val: "NSS_FDC",
  195. },
  196. {
  197. name: "青山",
  198. val: "QS_FDC",
  199. },
  200. {
  201. name: "石板泉",
  202. val: "SBQ_FDC",
  203. },
  204. {
  205. name: "香山",
  206. val: "XS_FDC",
  207. },
  208. ],
  209. btnIndex: 0,
  210. dialogVisible: false,
  211. resData: null,
  212. perData: null,
  213. frontOneHour : new Date().getTime() - 10 * 60 * 1000,
  214. startdate: new Date(
  215. new Date(new Date().setDate(new Date().getDate() - 1))
  216. ).formatDate("yyyy-MM-dd"),
  217. enddate: new Date(new Date()).formatDate("yyyy-MM-dd"),
  218. chartList:[
  219. {
  220. title: "疲劳度",
  221. yAxisIndex: 0,
  222. value: [
  223. {
  224. text: "1",
  225. value: 1,
  226. },
  227. {
  228. text: "2",
  229. value: 2,
  230. },
  231. {
  232. text: "3",
  233. value: 1,
  234. },
  235. {
  236. text: "4",
  237. value: 3,
  238. },
  239. {
  240. text: "5",
  241. value: 3,
  242. },
  243. {
  244. text: "6",
  245. value: 3,
  246. },
  247. {
  248. text: "7",
  249. value: 3,
  250. },
  251. {
  252. text: "8",
  253. value: 3,
  254. },
  255. {
  256. text: "9",
  257. value: 3,
  258. },
  259. {
  260. text: "10",
  261. value: 3,
  262. },
  263. {
  264. text: "11",
  265. value: 3,
  266. },
  267. {
  268. text: "12",
  269. value: 3,
  270. },
  271. {
  272. text: "13",
  273. value: 3,
  274. },
  275. {
  276. text: "14",
  277. value: 3,
  278. },
  279. {
  280. text: "15",
  281. value: 3,
  282. },
  283. {
  284. text: "16",
  285. value: 3,
  286. },
  287. ],
  288. },
  289. {
  290. title: "上网电量",
  291. yAxisIndex: 0,
  292. value: [
  293. {
  294. text: "1",
  295. value: 1,
  296. },
  297. {
  298. text: "2",
  299. value: 2,
  300. },
  301. {
  302. text: "3",
  303. value: 1,
  304. },
  305. {
  306. text: "4",
  307. value: 3,
  308. },
  309. ],
  310. },
  311. ],
  312. };
  313. },
  314. // 函数
  315. methods: {
  316. imgurl(v){
  317. try {
  318. const url = require(`@assets/person/${v}.jpg`)
  319. return url
  320. } catch (error) {
  321. return require('@assets/logo.png')
  322. }
  323. },
  324. clickBtn(btn, index) {
  325. this.search(btn.val);
  326. this.btnIndex = index;
  327. },
  328. clickItem(index) {
  329. this.panelIndex = index;
  330. },
  331. async todesc(item) {
  332. this.dialogVisible = true;
  333. this.perData = item;
  334. this.searchper()
  335. },
  336. async searchper() {
  337. const { data } = await axios.get( //http://192.168.10.12:8082/ //http://10.155.32.4:8010
  338. `http://192.168.1.18:8087/bracelet/getInfo?userid=${this.perData.mobile}&beginDate=${new Date(this.startdate).formatDate("yyyy-MM-dd HH:mm:ss")}&endDate=${new Date(this.enddate).formatDate("yyyy-MM-dd HH:mm:ss")}`);
  339. let arr=[]
  340. data.data.forEach(e => {
  341. let obj={
  342. title: e.name,
  343. yAxisIndex: 0,
  344. value:[]
  345. }
  346. e.bs.forEach(i => {
  347. let obj1={
  348. text: "1",
  349. value: i.val,
  350. }
  351. obj.value.push(obj1)
  352. })
  353. arr.psuh(obj)
  354. });
  355. this.chartList = arr
  356. },
  357. async search(id) {
  358. const { data } = await axios.get(
  359. `http://192.168.1.18:8087/shbraceletuser/selectRaceletUserinfo?stationid=${id}&pageNum=${1}&pageSize=${300}`
  360. );
  361. const res = data.data.records;
  362. this.resData = res;
  363. },
  364. },
  365. // 生命周期钩子
  366. beforeCreate() {
  367. // 创建前
  368. },
  369. created() {
  370. // 创建后
  371. this.search("");
  372. },
  373. beforeMount() {
  374. // 渲染前
  375. },
  376. mounted() {
  377. // 渲染后
  378. },
  379. beforeUpdate() {
  380. // 数据更新前
  381. },
  382. updated() {
  383. // 数据更新后
  384. },
  385. };
  386. </script>
  387. <style lang="less">
  388. .icolor{
  389. color: #05bb4c;
  390. }
  391. .personnel {
  392. widows: 100%;
  393. height: calc(100vh - 90px);
  394. overflow-y: auto;
  395. .personnel-btn {
  396. display: flex;
  397. .i-btn {
  398. width: 11.296vh;
  399. height: 3.056vh;
  400. line-height: 3.056vh;
  401. background: #53626833;
  402. border: 1px solid #53626833;
  403. text-align: center;
  404. cursor: pointer;
  405. font-size: 1.296vh;
  406. color: #b3bdc0;
  407. transition: all 0.3s;
  408. + .i-btn {
  409. margin-left: 0.926vh;
  410. }
  411. &:hover,
  412. &.active {
  413. border: 1px solid #05bb4c;
  414. background: #05bb4c33;
  415. color: #05bb4c;
  416. }
  417. }
  418. }
  419. .personnel-box {
  420. display: flex;
  421. flex-wrap: wrap;
  422. margin-top: 6px;
  423. .personnel-box-item {
  424. width: 198px;
  425. height: 105px;
  426. background: #53626833;
  427. border: 1px solid #53626833;
  428. margin: 10px 10px 0 0;
  429. cursor: pointer;
  430. transition: all 0.3s;
  431. padding: 6px;
  432. display: flex;
  433. flex-direction: column;
  434. .personnel-box-item-h {
  435. height: 74px;
  436. display: flex;
  437. .personnel-box-item-header {
  438. height: 100%;
  439. width: 52px;
  440. margin-right: 12px;
  441. background: #848b8a;
  442. display: flex;
  443. align-items: center;
  444. justify-content: center;
  445. img {
  446. width: 100%;
  447. // height: 100%;
  448. }
  449. }
  450. .personnel-box-item-form {
  451. flex-grow: 1;
  452. .personnel-box-item-group {
  453. font-size: 12px;
  454. display: flex;
  455. line-height: 1.5;
  456. .personnel-box-item-label {
  457. width: 60px;
  458. text-align: right;
  459. color: #b3bdc0;
  460. }
  461. .personnel-box-item-value {
  462. color: #b3bdc0;
  463. }
  464. }
  465. }
  466. }
  467. .personnel-box-item-f {
  468. flex-grow: 1;
  469. display: flex;
  470. line-height: 1;
  471. margin-top: 7px;
  472. font-size: 12px;
  473. .personnel-box-item-name {
  474. width: 52px;
  475. margin-right: 12px;
  476. text-align: center;
  477. color: #ffffff;
  478. }
  479. .personnel-box-item-icon {
  480. flex-grow: 1;
  481. color: #b3bdc0;
  482. }
  483. }
  484. &:hover {
  485. border: 1px solid #05bb4c;
  486. background: #05bb4c33;
  487. .personnel-box-item-h {
  488. .personnel-box-item-form {
  489. .personnel-box-item-group {
  490. .personnel-box-item-label {
  491. color: #ffffff;
  492. }
  493. .personnel-box-item-value {
  494. color: #05bb4c;
  495. }
  496. }
  497. }
  498. }
  499. .personnel-box-item-f {
  500. .personnel-box-item-name {
  501. color: #05bb4c;
  502. }
  503. .personnel-box-item-icon {
  504. color: #ffffff;
  505. }
  506. }
  507. }
  508. }
  509. }
  510. .prople-info {
  511. width: 100%;
  512. height: 76px;
  513. background: #53626833;
  514. display: flex;
  515. align-items: center;
  516. justify-content: center;
  517. .prople-info-item {
  518. flex: 1;
  519. text-align: center;
  520. line-height: 2;
  521. }
  522. }
  523. .people-chart {
  524. width: 100%;
  525. height: 45vh;
  526. }
  527. }
  528. </style>