Tester.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  1. <template>
  2. <div>
  3. <div class="row">
  4. <div class="col-md-12">
  5. <el-form :inline="true">
  6. <el-form-item label="设备国标编号">
  7. <el-input v-model="serial" placeholder="设备国标编号"></el-input>
  8. </el-form-item>
  9. <el-form-item label="国标通道编号">
  10. <el-input v-model="code" placeholder="国标通道编号"></el-input>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="primary" @click.prevent="onStart" v-if="!testing">运行</el-button>
  14. <el-button type="danger" @click.prevent="onStop" v-if="testing">停止</el-button>
  15. <el-button type="button" @click.prevent="onRefresh">刷新树</el-button>
  16. <el-button type="button" @click.prevent="onReport">测试报告</el-button>
  17. </el-form-item>
  18. </el-form>
  19. </div>
  20. <div class="col-md-12" v-if="teserNames != ''">
  21. <div class="test-link">测试序列:{{teserNames}}</div>
  22. </div>
  23. <div class="col-md-5">
  24. <el-tree style="width: 100%;height:700px;overflow-y: auto;" ref="tree" showCheckbox :data="data" node-key="id" :props="defaultProps"></el-tree>
  25. </div>
  26. <div class="col-md-7">
  27. <div class="row">
  28. <el-table :data="testerData" height="300" style="width: 100%;" @row-click="onRowClick">
  29. <el-table-column prop="Step" width="50" label="步骤"></el-table-column>
  30. <el-table-column prop="TesterName" label="测试对象" width="180">
  31. </el-table-column>
  32. <el-table-column prop="Result" label="结果" width="150">
  33. <template slot-scope="props">
  34. <span class="text-success" title="单击查看详细信令报文" style="cursor:pointer;" v-if="props.row.Result =='接收成功'||props.row.Result =='响应成功'">{{props.row.Result}}</span>
  35. <span style="color:red" v-else-if="props.row.Result=='失败'">{{props.row.Result}}</span>
  36. <span v-else>{{props.row.Result}}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column prop="Detail" label="详细信息">
  40. </el-table-column>
  41. <el-table-column prop="Time" label="时间">
  42. </el-table-column>
  43. </el-table>
  44. </div>
  45. <div class="row">
  46. <div class="col-md-12 card">
  47. <el-tabs v-model="activeName">
  48. <el-tab-pane name="in" :label="TesterName+' 信令(设备端>>>>服务端)'">
  49. <el-input placeholder="点击步骤查看详情" rows="14" type="textarea" v-model="TesterIn"></el-input>
  50. </el-tab-pane>
  51. <el-tab-pane name="out" :label="TesterName+' 信令(服务端>>>>设备端)'">
  52. <el-input placeholder="点击步骤查看详情" rows="14" class="card-content" type="textarea" v-model="TesterOut"></el-input>
  53. </el-tab-pane>
  54. </el-tabs>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import _ from 'lodash'
  63. export default {
  64. data() {
  65. return {
  66. activeName: "in",
  67. first: true,
  68. index: 0,
  69. teserNames: "",
  70. testing: false,
  71. serial: "",
  72. code: "",
  73. TesterName: "",
  74. TesterIn: "",
  75. TesterOut: "",
  76. checkIDS: [],
  77. testerData: [],
  78. data: [{
  79. id: 101,
  80. label: '注册',
  81. children: [{
  82. id: 1011,
  83. label: '注册应答',
  84. children: [{
  85. id: 10111,
  86. label: '等待无鉴权注册',
  87. disabled: false
  88. }, {
  89. id: 10112,
  90. label: '等待有鉴权注册',
  91. disabled: false
  92. }]
  93. }]
  94. }, {
  95. id: 102,
  96. label: '心跳',
  97. children: [{
  98. id: 1021,
  99. label: '心跳',
  100. children: [{
  101. id: 10211,
  102. label: '等待心跳',
  103. disabled: false
  104. }]
  105. }]
  106. }, {
  107. id: 103,
  108. label: '设备信息查询',
  109. children: [{
  110. id: 1031,
  111. label: '设备信息查询',
  112. children: [{
  113. id: 10311,
  114. label: '发送设备查询信息',
  115. disabled: false
  116. }, {
  117. id: 10312,
  118. label: '等待设备查询信息',
  119. disabled: false
  120. }]
  121. }]
  122. }, {
  123. id: 104,
  124. label: '设备目录查询',
  125. children: [{
  126. id: 1041,
  127. label: '设备目录查询',
  128. children: [{
  129. id: 10411,
  130. label: '发送设备目录查询命令',
  131. disabled: false
  132. }, {
  133. id: 10412,
  134. label: '等待设备目录信息',
  135. disabled: false
  136. }]
  137. }]
  138. }, {
  139. id: 105,
  140. label: '设备状态查询',
  141. children: [{
  142. id: 1051,
  143. label: '设备状态查询',
  144. children: [{
  145. id: 10511,
  146. label: '发送状态查询',
  147. disabled: false
  148. }, {
  149. id: 10512,
  150. label: '等待状态消息',
  151. disabled: false
  152. }]
  153. }]
  154. }, {
  155. id: 106,
  156. label: '配置查询',
  157. children: [{
  158. id: 1061,
  159. label: '国标配置查询',
  160. children: [{
  161. id: 10611,
  162. label: '国标编码配置查询',
  163. disabled: false
  164. }, {
  165. id: 10612,
  166. label: '等待国标配置',
  167. disabled: false
  168. }]
  169. }, {
  170. id: 1062,
  171. label: '视频参数范围查询',
  172. children: [{
  173. id: 10621,
  174. label: '视频参数范围查询',
  175. disabled: false
  176. }, {
  177. id: 10622,
  178. label: '等待回复视频参数范围',
  179. disabled: false
  180. }]
  181. }]
  182. }, {
  183. id: 107,
  184. label: '手动录像',
  185. children: [{
  186. id: 1071,
  187. label: '开启手动录像',
  188. children: [{
  189. id: 10711,
  190. label: '开始手动录像',
  191. disabled: false
  192. }, {
  193. id: 10712,
  194. label: '等待开启成功',
  195. disabled: false
  196. }]
  197. },
  198. {
  199. id: 1072,
  200. label: '停止手动录像',
  201. children: [{
  202. id: 10721,
  203. label: '停止手动录像',
  204. disabled: false
  205. }, {
  206. id: 10722,
  207. label: '等待停止成功',
  208. disabled: false
  209. }]
  210. }
  211. ]
  212. }, {
  213. id: 108,
  214. label: '实时视频',
  215. children: [{
  216. id: 1081,
  217. label: '实时视频建立_UDP',
  218. children: [{
  219. id: 10811,
  220. label: '打开视频端口',
  221. disabled: false
  222. }, {
  223. id: 10812,
  224. label: '发送实时视频请求',
  225. disabled: false
  226. }, {
  227. id: 10813,
  228. label: '等待设备回复200OK',
  229. disabled: false
  230. }, {
  231. id: 10814,
  232. label: '发送ACK',
  233. disabled: false
  234. }, {
  235. id: 10815,
  236. label: '播放码流',
  237. disabled: false
  238. }, {
  239. id: 10816,
  240. label: '停止视频请求',
  241. disabled: false
  242. }, {
  243. id: 10817,
  244. label: '关闭视频端口',
  245. disabled: false
  246. }, {
  247. id: 10818,
  248. label: '普通等待',
  249. disabled: false
  250. }]
  251. }, {
  252. id: 1082,
  253. label: '实时视频建立_TCP',
  254. children: [{
  255. id: 10821,
  256. label: '打开视频端口',
  257. disabled: false
  258. }, {
  259. id: 10822,
  260. label: '发送实时视频请求',
  261. disabled: false
  262. }, {
  263. id: 10823,
  264. label: '等待设备回复200OK',
  265. disabled: false
  266. }, {
  267. id: 10824,
  268. label: '发送ACK',
  269. disabled: false
  270. }, {
  271. id: 10825,
  272. label: '播放码流',
  273. disabled: false
  274. }, {
  275. id: 10826,
  276. label: '停止视频请求',
  277. disabled: false
  278. }, {
  279. id: 10827,
  280. label: '关闭视频端口',
  281. disabled: false
  282. }, {
  283. id: 10828,
  284. label: '普通等待',
  285. disabled: false
  286. }]
  287. }]
  288. }, {
  289. id: 109,
  290. label: '强制I帧',
  291. children: [{
  292. id: 1091,
  293. label: '强制I帧',
  294. children: [{
  295. id: 10911,
  296. label: '打开视频端口',
  297. disabled: false
  298. }, {
  299. id: 10912,
  300. label: '发送实时视频请求',
  301. disabled: false
  302. }, {
  303. id: 10913,
  304. label: '等待设备回复200OK',
  305. disabled: false
  306. }, {
  307. id: 10914,
  308. label: '发送ACK',
  309. disabled: false
  310. }, {
  311. id: 10915,
  312. label: '播放码流',
  313. disabled: false
  314. }, {
  315. id: 10916,
  316. label: '强制I帧检测',
  317. disabled: false
  318. }, {
  319. id: 10917,
  320. label: '播放码流',
  321. disabled: false
  322. }, {
  323. id: 10918,
  324. label: '停止视频请求',
  325. disabled: false
  326. }, {
  327. id: 10919,
  328. label: '关闭视频端口',
  329. disabled: false
  330. }, {
  331. id: 109110,
  332. label: '普通等待',
  333. disabled: false
  334. }]
  335. }]
  336. }, {
  337. id: 110,
  338. label: '云台控制',
  339. children: [{
  340. id: 1101,
  341. label: '云台控制',
  342. children: [{
  343. id: 11011,
  344. label: '打开视频端口',
  345. disabled: false
  346. }, {
  347. id: 11012,
  348. label: '发送实时视频请求',
  349. disabled: false
  350. }, {
  351. id: 11013,
  352. label: '等待设备回复200OK',
  353. disabled: false
  354. }, {
  355. id: 11014,
  356. label: '发送ACK',
  357. disabled: false
  358. }, {
  359. id: 11015,
  360. label: '播放码流',
  361. disabled: false
  362. }, {
  363. id: 11016,
  364. label: '向左转',
  365. disabled: false
  366. }, {
  367. id: 11017,
  368. label: '停止向左转',
  369. disabled: false
  370. }, {
  371. id: 11018,
  372. label: '等待1',
  373. disabled: false
  374. }, {
  375. id: 11019,
  376. label: '向右转',
  377. disabled: false
  378. }, {
  379. id: 110110,
  380. label: '停止向右转',
  381. disabled: false
  382. }, {
  383. id: 110111,
  384. label: '等待2',
  385. disabled: false
  386. }, {
  387. id: 110112,
  388. label: '向上转',
  389. disabled: false
  390. }, {
  391. id: 110113,
  392. label: '停止向上转',
  393. disabled: false
  394. }, {
  395. id: 110114,
  396. label: '等待3',
  397. disabled: false
  398. }, {
  399. id: 110115,
  400. label: '向下转',
  401. disabled: false
  402. }, {
  403. id: 110116,
  404. label: '停止向下转',
  405. disabled: false
  406. }, {
  407. id: 110117,
  408. label: '等待4',
  409. disabled: false
  410. }, {
  411. id: 110118,
  412. label: '焦距放大',
  413. disabled: false
  414. }, {
  415. id: 110119,
  416. label: '停止放大',
  417. disabled: false
  418. }, {
  419. id: 110120,
  420. label: '等待5',
  421. disabled: false
  422. }, {
  423. id: 110121,
  424. label: '焦距缩小',
  425. disabled: false
  426. }, {
  427. id: 110122,
  428. label: '停止缩小',
  429. disabled: false
  430. }, {
  431. id: 110123,
  432. label: '停止视频请求',
  433. disabled: false
  434. }, {
  435. id: 110124,
  436. label: '关闭视频端口',
  437. disabled: false
  438. }]
  439. }]
  440. }, {
  441. id: 111,
  442. label: '录像查询全部',
  443. children: [{
  444. id: 1111,
  445. label: '录像查询_ALL',
  446. children: [{
  447. id: 11111,
  448. label: '查询录像(ALL)',
  449. disabled: false
  450. }, {
  451. id: 11112,
  452. label: '等待录像(ALL)',
  453. disabled: false
  454. }]
  455. }]
  456. }, {
  457. id: 112,
  458. label: '录像回放',
  459. children: [{
  460. id: 1121,
  461. label: '录像回放_UDP',
  462. children: [{
  463. id: 11211,
  464. label: '获取录像播放时间',
  465. disabled: false
  466. }, {
  467. id: 11212,
  468. label: '等待录像(ALL)',
  469. disabled: false
  470. }, {
  471. id: 11213,
  472. label: '打开媒体端口',
  473. disabled: false
  474. }, {
  475. id: 11214,
  476. label: '发送录像播放请求',
  477. disabled: false
  478. }, {
  479. id: 11215,
  480. label: '等待设备回复200OK',
  481. disabled: false
  482. }, {
  483. id: 11216,
  484. label: '发送ACK',
  485. disabled: false
  486. }, {
  487. id: 11217,
  488. label: '录像回放',
  489. disabled: false
  490. }, {
  491. id: 11218,
  492. label: '等待录像结束消息',
  493. disabled: false
  494. }, {
  495. id: 11219,
  496. label: '发送录像停止请求',
  497. disabled: false
  498. }, {
  499. id: 112110,
  500. label: '关闭媒体端口',
  501. disabled: false
  502. }]
  503. }, {
  504. id: 1122,
  505. label: '录像回放_TCP',
  506. children: [{
  507. id: 11221,
  508. label: '获取录像播放时间',
  509. disabled: false
  510. }, {
  511. id: 11222,
  512. label: '等待录像(ALL)',
  513. disabled: false
  514. }, {
  515. id: 11223,
  516. label: '打开媒体端口',
  517. disabled: false
  518. }, {
  519. id: 11224,
  520. label: '发送录像播放请求',
  521. disabled: false
  522. }, {
  523. id: 11225,
  524. label: '等待设备回复200OK',
  525. disabled: false
  526. }, {
  527. id: 11226,
  528. label: '发送ACK',
  529. disabled: false
  530. }, {
  531. id: 11227,
  532. label: '录像回放',
  533. disabled: false
  534. }, {
  535. id: 11228,
  536. label: '等待录像结束消息',
  537. disabled: false
  538. }, {
  539. id: 11229,
  540. label: '发送录像停止请求',
  541. disabled: false
  542. }, {
  543. id: 112210,
  544. label: '关闭媒体端口',
  545. disabled: false
  546. }]
  547. }, {
  548. id: 1123,
  549. label: '录像慢放',
  550. children: [{
  551. id: 11231,
  552. label: '获取录像播放时间',
  553. disabled: false
  554. }, {
  555. id: 11232,
  556. label: '等待录像(ALL)',
  557. disabled: false
  558. }, {
  559. id: 11233,
  560. label: '打开媒体端口',
  561. disabled: false
  562. }, {
  563. id: 11234,
  564. label: '发送录像播放请求',
  565. disabled: false
  566. }, {
  567. id: 11235,
  568. label: '等待设备回复200OK',
  569. disabled: false
  570. }, {
  571. id: 11236,
  572. label: '发送ACK',
  573. disabled: false
  574. }, {
  575. id: 11237,
  576. label: '录像回放',
  577. disabled: false
  578. }, {
  579. id: 11238,
  580. label: '1/4速度播放',
  581. disabled: false
  582. }, {
  583. id: 11239,
  584. label: '恢复正常播放',
  585. disabled: false
  586. }, {
  587. id: 112310,
  588. label: '发送录像停止请求',
  589. disabled: false
  590. }, {
  591. id: 112311,
  592. label: '关闭媒体端口',
  593. disabled: false
  594. }]
  595. }, {
  596. id: 1124,
  597. label: '录像快放',
  598. children: [{
  599. id: 11241,
  600. label: '获取录像播放时间',
  601. disabled: false
  602. }, {
  603. id: 11242,
  604. label: '等待录像(ALL)',
  605. disabled: false
  606. }, {
  607. id: 11243,
  608. label: '打开媒体端口',
  609. disabled: false
  610. }, {
  611. id: 11244,
  612. label: '发送录像播放请求',
  613. disabled: false
  614. }, {
  615. id: 11245,
  616. label: '等待设备回复200OK',
  617. disabled: false
  618. }, {
  619. id: 11246,
  620. label: '发送ACK',
  621. disabled: false
  622. }, {
  623. id: 11247,
  624. label: '录像回放',
  625. disabled: false
  626. }, {
  627. id: 11248,
  628. label: '4倍速度播放',
  629. disabled: false
  630. }, {
  631. id: 11249,
  632. label: '恢复正常播放',
  633. disabled: false
  634. }, {
  635. id: 112410,
  636. label: '发送录像停止请求',
  637. disabled: false
  638. }, {
  639. id: 112411,
  640. label: '关闭媒体端口',
  641. disabled: false
  642. }]
  643. }, {
  644. id: 1125,
  645. label: '录像暂停',
  646. children: [{
  647. id: 11251,
  648. label: '获取录像播放时间',
  649. disabled: false
  650. }, {
  651. id: 11252,
  652. label: '等待录像(ALL)',
  653. disabled: false
  654. }, {
  655. id: 11253,
  656. label: '打开媒体端口',
  657. disabled: false
  658. }, {
  659. id: 11254,
  660. label: '发送录像播放请求',
  661. disabled: false
  662. }, {
  663. id: 11255,
  664. label: '等待设备回复200OK',
  665. disabled: false
  666. }, {
  667. id: 11256,
  668. label: '发送ACK',
  669. disabled: false
  670. }, {
  671. id: 11257,
  672. label: '录像回放',
  673. disabled: false
  674. }, {
  675. id: 11258,
  676. label: '录像暂停',
  677. disabled: false
  678. }, {
  679. id: 11259,
  680. label: '恢复正常播放',
  681. disabled: false
  682. }, {
  683. id: 112510,
  684. label: '发送录像停止请求',
  685. disabled: false
  686. }, {
  687. id: 112511,
  688. label: '关闭媒体端口',
  689. disabled: false
  690. }]
  691. }, {
  692. id: 1126,
  693. label: '录像拖放',
  694. children: [{
  695. id: 11261,
  696. label: '获取录像播放时间',
  697. disabled: false
  698. }, {
  699. id: 11262,
  700. label: '等待录像(ALL)',
  701. disabled: false
  702. }, {
  703. id: 11263,
  704. label: '打开媒体端口',
  705. disabled: false
  706. }, {
  707. id: 11264,
  708. label: '发送录像播放请求',
  709. disabled: false
  710. }, {
  711. id: 11265,
  712. label: '等待设备回复200OK',
  713. disabled: false
  714. }, {
  715. id: 11266,
  716. label: '发送ACK',
  717. disabled: false
  718. }, {
  719. id: 11267,
  720. label: '录像回放',
  721. disabled: false
  722. }, {
  723. id: 11268,
  724. label: '录像拖动',
  725. disabled: false
  726. }, {
  727. id: 11269,
  728. label: '发送录像停止请求',
  729. disabled: false
  730. }, {
  731. id: 112610,
  732. label: '关闭媒体端口',
  733. disabled: false
  734. }]
  735. }]
  736. }, {
  737. id: 113,
  738. label: '录像下载',
  739. children: [{
  740. id: 1131,
  741. label: '录像下载_UDP',
  742. children: [{
  743. id: 11311,
  744. label: '获取录像播放时间',
  745. disabled: false
  746. }, {
  747. id: 11312,
  748. label: '等待录像(ALL)',
  749. disabled: false
  750. }, {
  751. id: 11313,
  752. label: '切换到下载模式',
  753. disabled: false
  754. }, {
  755. id: 11314,
  756. label: '打开媒体端口',
  757. disabled: false
  758. }, {
  759. id: 11315,
  760. label: '发送录像下载请求',
  761. disabled: false
  762. }, {
  763. id: 11316,
  764. label: '等待设备回复200OK',
  765. disabled: false
  766. }, {
  767. id: 11317,
  768. label: '发送ACk',
  769. disabled: false
  770. }, {
  771. id: 11318,
  772. label: '等待录像下载',
  773. disabled: false
  774. }, {
  775. id: 11319,
  776. label: '等待录像下载结束',
  777. disabled: false
  778. }, {
  779. id: 113110,
  780. label: '停止下载',
  781. disabled: false
  782. }, {
  783. id: 113111,
  784. label: '关闭媒体端口',
  785. disabled: false
  786. }, {
  787. id: 113112,
  788. label: '切换到播放模式',
  789. disabled: false
  790. }]
  791. }, {
  792. id: 1132,
  793. label: '录像下载_TCP',
  794. children: [{
  795. id: 11321,
  796. label: '获取录像播放时间',
  797. disabled: false
  798. }, {
  799. id: 11322,
  800. label: '等待录像(ALL)',
  801. disabled: false
  802. }, {
  803. id: 11323,
  804. label: '切换到下载模式',
  805. disabled: false
  806. }, {
  807. id: 11324,
  808. label: '打开媒体端口',
  809. disabled: false
  810. }, {
  811. id: 11325,
  812. label: '发送录像下载请求',
  813. disabled: false
  814. }, {
  815. id: 11326,
  816. label: '等待设备回复200OK',
  817. disabled: false
  818. }, {
  819. id: 11327,
  820. label: '发送ACk',
  821. disabled: false
  822. }, {
  823. id: 11328,
  824. label: '等待录像下载',
  825. disabled: false
  826. }, {
  827. id: 11329,
  828. label: '等待录像下载结束',
  829. disabled: false
  830. }, {
  831. id: 113210,
  832. label: '停止下载',
  833. disabled: false
  834. }, {
  835. id: 113211,
  836. label: '关闭媒体端口',
  837. disabled: false
  838. }, {
  839. id: 113212,
  840. label: '切换到播放模式',
  841. disabled: false
  842. }]
  843. }]
  844. }, {
  845. id: 114,
  846. label: '对讲与广播',
  847. children: [{
  848. id: 1141,
  849. label: '语音对讲',
  850. children: [{
  851. id: 11411,
  852. label: '打开音频接收端口',
  853. disabled: false
  854. }, {
  855. id: 11412,
  856. label: '发送语音对讲请求',
  857. disabled: false
  858. }, {
  859. id: 11413,
  860. label: '等待设备回复200OK',
  861. disabled: false
  862. }, {
  863. id: 11414,
  864. label: '发送ACk',
  865. disabled: false
  866. }, {
  867. id: 11415,
  868. label: '语音对讲',
  869. disabled: false
  870. }, {
  871. id: 11416,
  872. label: '停止语音对讲',
  873. disabled: false
  874. }, {
  875. id: 11417,
  876. label: '关闭音频接收端口',
  877. disabled: false
  878. }, {
  879. id: 11418,
  880. label: '确认语音对讲功能',
  881. disabled: false
  882. }, {
  883. id: 11419,
  884. label: '普通等待',
  885. disabled: false
  886. }]
  887. }, {
  888. id: 1142,
  889. label: '语音广播',
  890. children: [{
  891. id: 11421,
  892. label: '打开音频发送端口',
  893. disabled: false
  894. }, {
  895. id: 11422,
  896. label: '发送语音广播通知',
  897. disabled: false
  898. }, {
  899. id: 11423,
  900. label: '等待语音广播回复',
  901. disabled: false
  902. }, {
  903. id: 11424,
  904. label: '等待语音广播请求',
  905. disabled: false
  906. }, {
  907. id: 11425,
  908. label: '等待ACK',
  909. disabled: false
  910. }, {
  911. id: 11426,
  912. label: '语音广播',
  913. disabled: false
  914. }, {
  915. id: 11427,
  916. label: '关闭语音广播',
  917. disabled: false
  918. }, {
  919. id: 11428,
  920. label: '关闭音频发送端口',
  921. disabled: false
  922. }, {
  923. id: 11429,
  924. label: '确认语音广播功能',
  925. disabled: false
  926. }, {
  927. id: 114210,
  928. label: '普通等待',
  929. disabled: false
  930. }]
  931. }]
  932. }, {
  933. id: 115,
  934. label: '订阅与通知',
  935. children: [{
  936. id: 1151,
  937. label: '报警订阅',
  938. children: [{
  939. id: 11511,
  940. label: '布防通道',
  941. disabled: false
  942. }, {
  943. id: 11512,
  944. label: '等待布放成功',
  945. disabled: false
  946. }, {
  947. id: 11513,
  948. label: '报警订阅',
  949. disabled: false
  950. }, {
  951. id: 11514,
  952. label: '等待报警信息',
  953. disabled: false
  954. }, {
  955. id: 11515,
  956. label: '刷新订阅',
  957. disabled: false
  958. }, {
  959. id: 11516,
  960. label: '等待报警信息',
  961. disabled: false
  962. }, {
  963. id: 11517,
  964. label: '取消订阅',
  965. disabled: false
  966. }, {
  967. id: 11518,
  968. label: '普通等待',
  969. disabled: false
  970. }]
  971. }, {
  972. id: 1152,
  973. label: '目录订阅',
  974. children: [{
  975. id: 11521,
  976. label: '目录订阅',
  977. disabled: false
  978. }, {
  979. id: 11522,
  980. label: '等待初始状态上报',
  981. disabled: false
  982. }, {
  983. id: 11523,
  984. label: '等待目录改变通知',
  985. disabled: false
  986. }, {
  987. id: 11524,
  988. label: '刷新订阅',
  989. disabled: false
  990. }, {
  991. id: 11525,
  992. label: '等待初始状态上报',
  993. disabled: false
  994. }, {
  995. id: 11526,
  996. label: '等待目录改变通知',
  997. disabled: false
  998. }, {
  999. id: 11527,
  1000. label: '取消订阅',
  1001. disabled: false
  1002. }, {
  1003. id: 11528,
  1004. label: '普通等待',
  1005. disabled: false
  1006. }]
  1007. }]
  1008. }, {
  1009. id: 116,
  1010. label: '远程协助',
  1011. children: [{
  1012. id: 1161,
  1013. label: '远程启动',
  1014. isLeaf: true,
  1015. children: [{
  1016. id: 11611,
  1017. label: '发送重启命令'
  1018. }, {
  1019. id: 11612,
  1020. label: '等待注销1'
  1021. }, {
  1022. id: 11613,
  1023. label: '等待注销2'
  1024. }, {
  1025. id: 11614,
  1026. label: '等待注册并响应失败'
  1027. }, {
  1028. id: 11615,
  1029. label: '注册普通等待'
  1030. }, {
  1031. id: 11616,
  1032. label: '等待注册1'
  1033. }, {
  1034. id: 11617,
  1035. label: '等待注册2'
  1036. }]
  1037. }]
  1038. }],
  1039. defaultProps: {
  1040. children: 'children',
  1041. label: 'label'
  1042. }
  1043. };
  1044. },
  1045. mounted() {
  1046. this.updateSteps();
  1047. this.timer1 = setInterval(() => {
  1048. this.updateSteps();
  1049. }, 1000);
  1050. },
  1051. beforeDestroy() {
  1052. if (this.timer1) {
  1053. clearInterval(this.timer1);
  1054. this.timer1 = 0;
  1055. }
  1056. },
  1057. methods: {
  1058. updateSteps() {
  1059. $.get("/api/v1/tester/logs", {}).then(ret => {
  1060. this.testerData = ret;
  1061. });
  1062. if (this.index % 3 == 0) {
  1063. var tnames = ""
  1064. $.get("/api/v1/tester/names", {}).then(ret => {
  1065. var names = ret.names;
  1066. for (var i = 0; i < names.length; i++) {
  1067. if (tnames == "") {
  1068. tnames = (i + 1) + "-" + names[i]
  1069. } else {
  1070. tnames += "->" + (i + 1) + "-" + names[i]
  1071. }
  1072. }
  1073. if (this.first) {
  1074. this.first = false
  1075. this.serial = ret.serial;
  1076. this.code = ret.code;
  1077. this.$refs.tree.setCheckedKeys(ret.ids);
  1078. }
  1079. this.teserNames = tnames
  1080. });
  1081. $.get("/api/v1/tester/status", {}).then(ret => {
  1082. this.testing = ret.Testing
  1083. });
  1084. }
  1085. this.index++
  1086. },
  1087. onStart() {
  1088. var ids = this.$refs.tree.getCheckedKeys()
  1089. var hids = this.$refs.tree.getHalfCheckedKeys()
  1090. for (var i = 0; i < hids.length; i++) {
  1091. ids.push(hids[i])
  1092. }
  1093. if (ids.length == 0) {
  1094. this.$message({
  1095. type: 'error',
  1096. message: "没有选中任何测试"
  1097. })
  1098. return;
  1099. }
  1100. if (this.code == "" || this.serial == "") {
  1101. this.$message({
  1102. type: 'error',
  1103. message: "设备国标编号或国标通道编号 不能为空"
  1104. })
  1105. return;
  1106. }
  1107. this.checkIDS = ""
  1108. for (var i = 0; i < ids.length; i++) {
  1109. if ((ids[i] + "").length == 4) {
  1110. if (this.checkIDS == "") {
  1111. this.checkIDS = ids[i]
  1112. } else {
  1113. this.checkIDS += "," + ids[i]
  1114. }
  1115. }
  1116. }
  1117. $.get("/api/v1/tester/status", {}).then(ret => {
  1118. if (!ret.Testing) {
  1119. this.testerData = []
  1120. this.testing = true
  1121. $.get("/api/v1/tester/start", {
  1122. serial: this.serial,
  1123. code: this.code,
  1124. ids: this.checkIDS,
  1125. })
  1126. } else {
  1127. this.testing = true
  1128. this.$message({
  1129. type: 'error',
  1130. message: "测试中请先停止"
  1131. })
  1132. }
  1133. });
  1134. },
  1135. onStop() {
  1136. $.get("/api/v1/tester/stop", {}).then(ret => {
  1137. this.testing = false;
  1138. this.$message({
  1139. type: 'success',
  1140. message: "停止成功"
  1141. })
  1142. });
  1143. },
  1144. onRefresh() {
  1145. this.$refs.tree.setCheckedKeys([]);
  1146. this.checkIDS = "";
  1147. this.$message({
  1148. type: 'success',
  1149. message: "刷新成功"
  1150. })
  1151. },
  1152. onRowClick(row, column, event) {
  1153. this.TesterName = row.TesterName;
  1154. this.TesterIn = row.TesterIn;
  1155. this.TesterOut = row.TesterOut;
  1156. if (row.Result == '响应成功') {
  1157. this.activeName = "out"
  1158. } else {
  1159. this.activeName = "in"
  1160. }
  1161. },
  1162. onReport() {
  1163. window.open('/#/testreport');
  1164. }
  1165. },
  1166. };
  1167. </script>
  1168. <style lang="less" scoped>
  1169. .card {
  1170. padding-top: 12px;
  1171. background-color: white;
  1172. height: 400px;
  1173. border-right-color: lightgrey;
  1174. border-right-width: 1px;
  1175. border-right-style: solid;
  1176. }
  1177. .test-link {
  1178. width: 100%;
  1179. line-height: 24px;
  1180. padding-left: 5px;
  1181. padding-bottom: 5px;
  1182. }
  1183. </style>