device-history.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. <template>
  2. <div>
  3. <div class="my-title">历史记录</div>
  4. <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
  5. <el-form-item label="上报时间">
  6. <el-date-picker
  7. v-model="dataForm.date"
  8. value-format="yyyy-MM-dd HH:mm:ss"
  9. type="datetimerange"
  10. range-separator="至"
  11. start-placeholder="开始时间"
  12. end-placeholder="结束时间">
  13. </el-date-picker>
  14. </el-form-item>
  15. <el-form-item>
  16. <el-button @click="search()">查询</el-button>
  17. </el-form-item>
  18. </el-form>
  19. <el-table
  20. :data="dataList"
  21. border
  22. v-loading="dataListLoading"
  23. style="width: 100%;">
  24. <el-table-column
  25. label="序号"
  26. type="index"
  27. width="50"
  28. align="center">
  29. </el-table-column>
  30. <el-table-column
  31. prop="deviceName"
  32. header-align="center"
  33. align="center"
  34. min-width="120"
  35. label="设备编号">
  36. </el-table-column>
  37. <el-table-column
  38. prop="deviceTimeStr"
  39. header-align="center"
  40. align="center"
  41. min-width="160"
  42. :show-overflow-tooltip="true"
  43. label="上报时间">
  44. </el-table-column>
  45. <el-table-column
  46. prop="serverTimeStr"
  47. header-align="center"
  48. align="center"
  49. min-width="160"
  50. :show-overflow-tooltip="true"
  51. label="系统接收时间">
  52. </el-table-column>
  53. <el-table-column
  54. prop="version"
  55. header-align="center"
  56. align="center"
  57. min-width="100"
  58. label="协议版本">
  59. </el-table-column>
  60. <el-table-column
  61. prop="ack"
  62. header-align="center"
  63. align="center"
  64. min-width="100"
  65. label="是否需要响应">
  66. <template slot-scope="scope">
  67. <span>{{ scope.row.ack === '0'?'否':'是' }}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column
  71. prop="longitude"
  72. header-align="center"
  73. align="center"
  74. min-width="100"
  75. label="纬度">
  76. </el-table-column>
  77. <el-table-column
  78. prop="latitude"
  79. header-align="center"
  80. align="center"
  81. min-width="100"
  82. :show-overflow-tooltip="true"
  83. label="经度">
  84. </el-table-column>
  85. <el-table-column
  86. header-align="center"
  87. align="center"
  88. min-width="150"
  89. label="NC软件版本">
  90. <template slot-scope="scope">
  91. <span v-for="item in scope.row.points" v-if="item.name==='NCVersion'">{{ item.value }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column
  95. header-align="center"
  96. align="center"
  97. label="NC名称">
  98. <template slot-scope="scope">
  99. <span v-for="item in scope.row.points" v-if="item.name==='NCInfo'">{{ item.value }}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column
  103. header-align="center"
  104. align="center"
  105. label="第一轴下一指令">
  106. <template slot-scope="scope">
  107. <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos1'">{{ item.value }}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column
  111. header-align="center"
  112. align="center"
  113. label="第二轴下一指令">
  114. <template slot-scope="scope">
  115. <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos2'">{{ item.value }}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column
  119. header-align="center"
  120. align="center"
  121. label="第三轴下一指令">
  122. <template slot-scope="scope">
  123. <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos3'">{{ item.value }}</span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column
  127. header-align="center"
  128. align="center"
  129. label="第四轴下一指令">
  130. <template slot-scope="scope">
  131. <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos4'">{{ item.value }}</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column
  135. header-align="center"
  136. align="center"
  137. label="第五轴下一指令">
  138. <template slot-scope="scope">
  139. <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos5'">{{ item.value }}</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column
  143. header-align="center"
  144. align="center"
  145. label="第六轴下一指令">
  146. <template slot-scope="scope">
  147. <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos6'">{{ item.value }}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column
  151. header-align="center"
  152. align="center"
  153. min-width="90"
  154. label="自动运行时间">
  155. <template slot-scope="scope">
  156. <span v-for="item in scope.row.points" v-if="item.name==='RunTime'">{{ item.value }}</span>
  157. </template>
  158. </el-table-column>
  159. <el-table-column
  160. header-align="center"
  161. align="center"
  162. min-width="90"
  163. label="自动启动时间">
  164. <template slot-scope="scope">
  165. <span v-for="item in scope.row.points" v-if="item.name==='StartTime'">{{ item.value }}</span>
  166. </template>
  167. </el-table-column>
  168. <el-table-column
  169. header-align="center"
  170. align="center"
  171. min-width="90"
  172. label="循环时间">
  173. <template slot-scope="scope">
  174. <span v-for="item in scope.row.points" v-if="item.name==='CycleTime'">{{ item.value }}</span>
  175. </template>
  176. </el-table-column>
  177. <el-table-column
  178. header-align="center"
  179. align="center"
  180. min-width="90"
  181. label="上电时间">
  182. <template slot-scope="scope">
  183. <span v-for="item in scope.row.points" v-if="item.name==='KeepAliveTime'">{{ item.value }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column
  187. header-align="center"
  188. align="center"
  189. min-width="90"
  190. label="系统日期">
  191. <template slot-scope="scope">
  192. <span v-for="item in scope.row.points" v-if="item.name==='SystemDate'">{{ item.value }}</span>
  193. </template>
  194. </el-table-column>
  195. <el-table-column
  196. header-align="center"
  197. align="center"
  198. min-width="90"
  199. label="系统时间">
  200. <template slot-scope="scope">
  201. <span v-for="item in scope.row.points" v-if="item.name==='SystemTime'">{{ item.value }}</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column
  205. header-align="center"
  206. align="center"
  207. min-width="100"
  208. :show-overflow-tooltip="true"
  209. label="主程序名">
  210. <template slot-scope="scope">
  211. <span v-for="item in scope.row.points" v-if="item.name==='MainProName'">{{ item.value }}</span>
  212. </template>
  213. </el-table-column>
  214. <el-table-column
  215. header-align="center"
  216. align="center"
  217. min-width="90"
  218. label="当前运行程序号">
  219. <template slot-scope="scope">
  220. <span v-for="item in scope.row.points" v-if="item.name==='CuRunProNum'">{{ item.value }}</span>
  221. </template>
  222. </el-table-column>
  223. <el-table-column
  224. header-align="center"
  225. align="center"
  226. min-width="120"
  227. :show-overflow-tooltip="true"
  228. label="当前运行程序内容">
  229. <template slot-scope="scope">
  230. <span v-for="item in scope.row.points" v-if="item.name==='CuRunProContent'">{{ item.value }}</span>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. header-align="center"
  235. align="center"
  236. min-width="120"
  237. :show-overflow-tooltip="true"
  238. label="设备报警">
  239. <template slot-scope="scope">
  240. <span v-for="item in scope.row.points" v-if="item.name==='AlarmMsg'">{{ item.value }}</span>
  241. </template>
  242. </el-table-column>
  243. <el-table-column
  244. header-align="center"
  245. align="center"
  246. min-width="100"
  247. :show-overflow-tooltip="true"
  248. label="进给设定转速FA">
  249. <template slot-scope="scope">
  250. <span v-for="item in scope.row.points" v-if="item.name==='FeedSetSpeed'">{{ item.value }}</span>
  251. </template>
  252. </el-table-column>
  253. <el-table-column
  254. header-align="center"
  255. align="center"
  256. min-width="100"
  257. :show-overflow-tooltip="true"
  258. label="进给实际速度FE">
  259. <template slot-scope="scope">
  260. <span v-for="item in scope.row.points" v-if="item.name==='FeedActualSpeed'">{{ item.value }}</span>
  261. </template>
  262. </el-table-column>
  263. <el-table-column
  264. header-align="center"
  265. align="center"
  266. min-width="90"
  267. label="主轴设定转速">
  268. <template slot-scope="scope">
  269. <span v-for="item in scope.row.points" v-if="item.name==='SpindleSetSpeed'">{{ item.value }}</span>
  270. </template>
  271. </el-table-column>
  272. <el-table-column
  273. header-align="center"
  274. align="center"
  275. min-width="90"
  276. label="主轴实际转速">
  277. <template slot-scope="scope">
  278. <span v-for="item in scope.row.points" v-if="item.name==='SpindleActualSpeed'">{{ item.value }}</span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column
  282. header-align="center"
  283. align="center"
  284. min-width="90"
  285. label="主轴倍率">
  286. <template slot-scope="scope">
  287. <span v-for="item in scope.row.points" v-if="item.name==='SpindleRate'">{{ item.value }}</span>
  288. </template>
  289. </el-table-column>
  290. <el-table-column
  291. header-align="center"
  292. align="center"
  293. min-width="90"
  294. label="进给倍率">
  295. <template slot-scope="scope">
  296. <span v-for="item in scope.row.points" v-if="item.name==='FeedRate'">{{ item.value }}</span>
  297. </template>
  298. </el-table-column>
  299. <el-table-column
  300. header-align="center"
  301. align="center"
  302. min-width="90"
  303. label="快速移动倍率">
  304. <template slot-scope="scope">
  305. <span v-for="item in scope.row.points" v-if="item.name==='MoveRate'">{{ item.value }}</span>
  306. </template>
  307. </el-table-column>
  308. <el-table-column
  309. header-align="center"
  310. align="center"
  311. min-width="90"
  312. label="主轴负载">
  313. <template slot-scope="scope">
  314. <span v-for="item in scope.row.points" v-if="item.name==='SpindleLoad'">{{ item.value }}</span>
  315. </template>
  316. </el-table-column>
  317. <el-table-column
  318. header-align="center"
  319. align="center"
  320. min-width="90"
  321. label="第一轴伺服轴负载">
  322. <template slot-scope="scope">
  323. <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad1'">{{ item.value }}</span>
  324. </template>
  325. </el-table-column>
  326. <el-table-column
  327. header-align="center"
  328. align="center"
  329. min-width="90"
  330. label="第二轴伺服轴负载">
  331. <template slot-scope="scope">
  332. <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad2'">{{ item.value }}</span>
  333. </template>
  334. </el-table-column>
  335. <el-table-column
  336. header-align="center"
  337. align="center"
  338. min-width="90"
  339. label="第三轴伺服轴负载">
  340. <template slot-scope="scope">
  341. <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad3'">{{ item.value }}</span>
  342. </template>
  343. </el-table-column>
  344. <el-table-column
  345. header-align="center"
  346. align="center"
  347. min-width="90"
  348. label="第四轴伺服轴负载">
  349. <template slot-scope="scope">
  350. <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad4'">{{ item.value }}</span>
  351. </template>
  352. </el-table-column>
  353. <el-table-column
  354. header-align="center"
  355. align="center"
  356. min-width="90"
  357. label="第五轴伺服轴负载">
  358. <template slot-scope="scope">
  359. <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad5'">{{ item.value }}</span>
  360. </template>
  361. </el-table-column>
  362. <el-table-column
  363. header-align="center"
  364. align="center"
  365. min-width="100"
  366. label="第六轴伺服轴负载">
  367. <template slot-scope="scope">
  368. <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad6'">{{ item.value }}</span>
  369. </template>
  370. </el-table-column>
  371. <el-table-column
  372. header-align="center"
  373. align="center"
  374. min-width="100"
  375. label="设备运行模式">
  376. <template slot-scope="scope">
  377. <span v-for="item in scope.row.points" v-if="item.name==='RunMode'">{{ item.value }}</span>
  378. </template>
  379. </el-table-column>
  380. <el-table-column
  381. header-align="center"
  382. align="center"
  383. min-width="100"
  384. label="设备运行状态">
  385. <template slot-scope="scope">
  386. <span v-for="item in scope.row.points" v-if="item.name==='RunStatus'">{{ item.value }}</span>
  387. </template>
  388. </el-table-column>
  389. <el-table-column
  390. header-align="center"
  391. align="center"
  392. min-width="100"
  393. label="当前刀具号">
  394. <template slot-scope="scope">
  395. <span v-for="item in scope.row.points" v-if="item.name==='CulToolNum'">{{ item.value }}</span>
  396. </template>
  397. </el-table-column>
  398. <el-table-column
  399. header-align="center"
  400. align="center"
  401. min-width="100"
  402. label="设备急停状态">
  403. <template slot-scope="scope">
  404. <span v-for="item in scope.row.points" v-if="item.name==='EmergencyStop'">{{ item.value }}</span>
  405. </template>
  406. </el-table-column>
  407. <el-table-column
  408. header-align="center"
  409. align="center"
  410. min-width="100"
  411. label="G代码状态">
  412. <template slot-scope="scope">
  413. <span v-for="item in scope.row.points" v-if="item.name==='GCodeStatus'">{{ item.value }}</span>
  414. </template>
  415. </el-table-column>
  416. <el-table-column
  417. header-align="center"
  418. align="center"
  419. min-width="100"
  420. label="累计生产件数">
  421. <template slot-scope="scope">
  422. <span v-for="item in scope.row.points" v-if="item.name==='ProductCounts'">{{ item.value }}</span>
  423. </template>
  424. </el-table-column>
  425. <el-table-column
  426. header-align="center"
  427. align="center"
  428. min-width="100"
  429. label="第一轴机械坐标">
  430. <template slot-scope="scope">
  431. <span v-for="item in scope.row.points" v-if="item.name==='MacPos1'">{{ item.value }}</span>
  432. </template>
  433. </el-table-column>
  434. <el-table-column
  435. header-align="center"
  436. align="center"
  437. min-width="100"
  438. label="第二轴机械坐标">
  439. <template slot-scope="scope">
  440. <span v-for="item in scope.row.points" v-if="item.name==='MacPos2'">{{ item.value }}</span>
  441. </template>
  442. </el-table-column>
  443. <el-table-column
  444. header-align="center"
  445. align="center"
  446. min-width="100"
  447. label="第三轴机械坐标">
  448. <template slot-scope="scope">
  449. <span v-for="item in scope.row.points" v-if="item.name==='MacPos3'">{{ item.value }}</span>
  450. </template>
  451. </el-table-column>
  452. <el-table-column
  453. header-align="center"
  454. align="center"
  455. min-width="100"
  456. label="第四轴机械坐标">
  457. <template slot-scope="scope">
  458. <span v-for="item in scope.row.points" v-if="item.name==='MacPos4'">{{ item.value }}</span>
  459. </template>
  460. </el-table-column>
  461. <el-table-column
  462. header-align="center"
  463. align="center"
  464. min-width="100"
  465. label="第五轴机械坐标">
  466. <template slot-scope="scope">
  467. <span v-for="item in scope.row.points" v-if="item.name==='MacPos5'">{{ item.value }}</span>
  468. </template>
  469. </el-table-column>
  470. <el-table-column
  471. header-align="center"
  472. align="center"
  473. min-width="100"
  474. label="第六轴机械坐标">
  475. <template slot-scope="scope">
  476. <span v-for="item in scope.row.points" v-if="item.name==='MacPos6'">{{ item.value }}</span>
  477. </template>
  478. </el-table-column>
  479. <el-table-column
  480. header-align="center"
  481. align="center"
  482. min-width="100"
  483. label="第一轴工件坐标">
  484. <template slot-scope="scope">
  485. <span v-for="item in scope.row.points" v-if="item.name==='WorkPos1'">{{ item.value }}</span>
  486. </template>
  487. </el-table-column>
  488. <el-table-column
  489. header-align="center"
  490. align="center"
  491. min-width="100"
  492. label="第二轴工件坐标">
  493. <template slot-scope="scope">
  494. <span v-for="item in scope.row.points" v-if="item.name==='WorkPos2'">{{ item.value }}</span>
  495. </template>
  496. </el-table-column>
  497. <el-table-column
  498. header-align="center"
  499. align="center"
  500. min-width="100"
  501. label="第三轴工件坐标">
  502. <template slot-scope="scope">
  503. <span v-for="item in scope.row.points" v-if="item.name==='WorkPos3'">{{ item.value }}</span>
  504. </template>
  505. </el-table-column>
  506. <el-table-column
  507. header-align="center"
  508. align="center"
  509. min-width="100"
  510. label="第四轴工件坐标">
  511. <template slot-scope="scope">
  512. <span v-for="item in scope.row.points" v-if="item.name==='WorkPos4'">{{ item.value }}</span>
  513. </template>
  514. </el-table-column>
  515. <el-table-column
  516. header-align="center"
  517. align="center"
  518. min-width="100"
  519. label="第五轴工件坐标">
  520. <template slot-scope="scope">
  521. <span v-for="item in scope.row.points" v-if="item.name==='WorkPos5'">{{ item.value }}</span>
  522. </template>
  523. </el-table-column>
  524. <el-table-column
  525. header-align="center"
  526. align="center"
  527. min-width="100"
  528. label="第六轴工件坐标">
  529. <template slot-scope="scope">
  530. <span v-for="item in scope.row.points" v-if="item.name==='WorkPos6'">{{ item.value }}</span>
  531. </template>
  532. </el-table-column>
  533. <el-table-column
  534. header-align="center"
  535. align="center"
  536. min-width="100"
  537. label="第一轴当前(相对)坐标">
  538. <template slot-scope="scope">
  539. <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos1'">{{ item.value }}</span>
  540. </template>
  541. </el-table-column>
  542. <el-table-column
  543. header-align="center"
  544. align="center"
  545. min-width="100"
  546. label="第二轴当前(相对)坐标">
  547. <template slot-scope="scope">
  548. <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos2'">{{ item.value }}</span>
  549. </template>
  550. </el-table-column>
  551. <el-table-column
  552. header-align="center"
  553. align="center"
  554. min-width="100"
  555. label="第三轴当前(相对)坐标">
  556. <template slot-scope="scope">
  557. <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos3'">{{ item.value }}</span>
  558. </template>
  559. </el-table-column>
  560. <el-table-column
  561. header-align="center"
  562. align="center"
  563. min-width="100"
  564. label="第四轴当前(相对)坐标">
  565. <template slot-scope="scope">
  566. <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos4'">{{ item.value }}</span>
  567. </template>
  568. </el-table-column>
  569. <el-table-column
  570. header-align="center"
  571. align="center"
  572. min-width="100"
  573. label="第五轴当前(相对)坐标">
  574. <template slot-scope="scope">
  575. <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos5'">{{ item.value }}</span>
  576. </template>
  577. </el-table-column>
  578. <el-table-column
  579. header-align="center"
  580. align="center"
  581. min-width="100"
  582. label="第六轴当前(相对)坐标">
  583. <template slot-scope="scope">
  584. <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos6'">{{ item.value }}</span>
  585. </template>
  586. </el-table-column>
  587. <el-table-column
  588. header-align="center"
  589. align="center"
  590. min-width="100"
  591. label="第一轴剩余坐标">
  592. <template slot-scope="scope">
  593. <span v-for="item in scope.row.points" v-if="item.name==='DistancePos1'">{{ item.value }}</span>
  594. </template>
  595. </el-table-column>
  596. <el-table-column
  597. header-align="center"
  598. align="center"
  599. min-width="100"
  600. label="第二轴剩余坐标">
  601. <template slot-scope="scope">
  602. <span v-for="item in scope.row.points" v-if="item.name==='DistancePos2'">{{ item.value }}</span>
  603. </template>
  604. </el-table-column>
  605. <el-table-column
  606. header-align="center"
  607. align="center"
  608. min-width="100"
  609. label="第三轴剩余坐标">
  610. <template slot-scope="scope">
  611. <span v-for="item in scope.row.points" v-if="item.name==='DistancePos3'">{{ item.value }}</span>
  612. </template>
  613. </el-table-column>
  614. <el-table-column
  615. header-align="center"
  616. align="center"
  617. min-width="100"
  618. label="第四轴剩余坐标">
  619. <template slot-scope="scope">
  620. <span v-for="item in scope.row.points" v-if="item.name==='DistancePos4'">{{ item.value }}</span>
  621. </template>
  622. </el-table-column>
  623. <el-table-column
  624. header-align="center"
  625. align="center"
  626. min-width="100"
  627. label="第五轴剩余坐标">
  628. <template slot-scope="scope">
  629. <span v-for="item in scope.row.points" v-if="item.name==='DistancePos5'">{{ item.value }}</span>
  630. </template>
  631. </el-table-column>
  632. <el-table-column
  633. header-align="center"
  634. align="center"
  635. min-width="100"
  636. label="第六轴剩余坐标">
  637. <template slot-scope="scope">
  638. <span v-for="item in scope.row.points" v-if="item.name==='DistancePos6'">{{ item.value }}</span>
  639. </template>
  640. </el-table-column>
  641. </el-table>
  642. <el-pagination
  643. @size-change="sizeChangeHandle"
  644. @current-change="currentChangeHandle"
  645. :current-page="pageIndex"
  646. :page-sizes="[10, 20, 50, 100]"
  647. :page-size="pageSize"
  648. :total="totalPage"
  649. layout="total, sizes, prev, pager, next, jumper">
  650. </el-pagination>
  651. <span slot="footer" class="dialog-footer">
  652. <el-button @click="onChose">返回</el-button>
  653. </span>
  654. </div>
  655. </template>
  656. <script>
  657. export default {
  658. name: 'device-history',
  659. components: {
  660. },
  661. data () {
  662. return {
  663. code: 0,
  664. dataForm: {},
  665. dataList: [],
  666. pageIndex: 1,
  667. pageSize: 10,
  668. totalPage: 0,
  669. dataListLoading: false,
  670. dataListSelections: []
  671. }
  672. },
  673. methods: {
  674. async init (code) {
  675. this.code = code
  676. this.search()
  677. },
  678. onChose () {
  679. this.$emit('onChose')
  680. },
  681. // 查询
  682. search () {
  683. this.pageIndex = 1
  684. this.getDataList()
  685. },
  686. // 获取数据列表
  687. getDataList () {
  688. this.dataListLoading = true
  689. this.addOrUpdateVisible = false
  690. this.$http({
  691. url: this.$http.adornUrl('/iot-platform/data-gateway/history'),
  692. method: 'get',
  693. params: this.$http.adornParams({
  694. 'current': this.pageIndex,
  695. 'size': this.pageSize,
  696. 'code': this.code,
  697. 'timeStart': this.dataForm.date ? this.dataForm.date[0] : null,
  698. 'timeEnd': this.dataForm.date ? this.dataForm.date[1] : null
  699. })
  700. }).then(({data}) => {
  701. if (data && data.code === '200') {
  702. this.dataList = data.data.records
  703. this.totalPage = Number(data.data.total)
  704. } else {
  705. this.dataList = []
  706. this.totalPage = 0
  707. }
  708. this.dataListLoading = false
  709. })
  710. },
  711. // 每页数
  712. sizeChangeHandle (val) {
  713. this.pageSize = val
  714. this.pageIndex = 1
  715. this.getDataList()
  716. },
  717. // 当前页
  718. currentChangeHandle (val) {
  719. this.pageIndex = val
  720. this.getDataList()
  721. },
  722. // 多选
  723. selectionChangeHandle (val) {
  724. this.dataListSelections = val
  725. },
  726. // 详情
  727. detailHandle (row) {
  728. // todo
  729. }
  730. }
  731. }
  732. </script>
  733. <style scoped>
  734. </style>