check.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. <!-- 检测设备
  2. 注意事项:
  3. 这个页面涉及到的planid或者runnerid或者executeid都是 this.deviceDetail.curPlanId
  4. -->
  5. <template>
  6. <div class="check-container">
  7. <div class="check-container-inner">
  8. <div class="check-title">
  9. <div class="title-main">
  10. 设备编号:{{ deviceGet.serialNumber||deviceGet.name }}
  11. <!-- <el-button icon="el-icon-plus" class="dark-button" size="mini" @click="test()">测试按钮</el-button> -->
  12. </div>
  13. <div class="title-lable">
  14. <div class="state" :style="'color:'+deviceStatus.stateStyle+';border:1px solid '+deviceStatus.stateStyle+';background: '+deviceStatus.stateStyle+'33;'">{{ deviceStatus.stateName }}</div>
  15. </div>
  16. </div>
  17. <div class="check-sub-title">
  18. <!-- 选择方案 -->
  19. <div class="sub-left">
  20. <el-select
  21. v-model="deviceDetail.devicePlanValue"
  22. filterable
  23. placeholder="请选择方案"
  24. size="small"
  25. :disabled="isDisable"
  26. @change="changePlan"
  27. >
  28. <el-option
  29. v-for="item in deviceDetail.devicePlanOptions"
  30. :key="item.id"
  31. :label="item.name"
  32. :value="item.id"
  33. />
  34. </el-select>
  35. </div>
  36. <!-- 选择刷新 -->
  37. <div class="sub-right">
  38. <el-select
  39. v-model="deviceDetail.deviceRefreshValue"
  40. filterable
  41. placeholder="请选择刷新"
  42. size="small"
  43. @change="changeTime"
  44. >
  45. <el-option
  46. v-for="item in deviceDetail.deviceRefreshOptions"
  47. :key="item.value"
  48. :label="item.label"
  49. :value="item.value"
  50. />
  51. </el-select>
  52. </div>
  53. </div>
  54. <div class="contorl-panel">
  55. <div class="top">
  56. <!-- 检测参数 和右侧按钮一起 移入 CheckParames.vue 原来的先保留,测试通过删除 -->
  57. <el-row>
  58. <CheckParamesMaster104
  59. v-if="isMaster104 == true"
  60. ref="checkparames"
  61. :cur-plan-detail="deviceDetail.planDetail"
  62. :device-status="deviceStatus"
  63. :play-data-id="deviceDetail.curPlanId"
  64. @updateDisable="getDisable"
  65. @updateDeviceStatus="getDeviceStatus"
  66. />
  67. <CheckParames
  68. v-else
  69. ref="checkparames"
  70. :cur-plan-detail="deviceDetail.planDetail"
  71. :device-status="deviceStatus"
  72. :play-data-id="deviceDetail.curPlanId"
  73. @updateDisable="getDisable"
  74. @updateDeviceStatus="getDeviceStatus"
  75. />
  76. </el-row>
  77. </div>
  78. <!-- 如果检测协议是低功耗,则显示低功耗组件,只显示MQTT结果 -->
  79. <!-- <low-power v-if="deviceDetail.planDetail.productType == 'LOW_POWER'" ref="lowChild" :device-detail="deviceDetail" /> -->
  80. <PowerCentent
  81. v-if="deviceDetail.planDetail.productType == 'MICRO_POWER' || deviceDetail.planDetail.productType == 'LOW_POWER'"
  82. ref="lowPComp"
  83. :example-update="exampleUpdate"
  84. :device-detail="deviceDetail"
  85. :component-parames="{
  86. 'deviceName':deviceGet.name,
  87. 'curPlanId':deviceDetail.curPlanId,
  88. 'curSuiteId':deviceDetail.suiteId,
  89. 'status':exampleStatus,
  90. 'isDisable':isDisable
  91. }"
  92. />
  93. <!-- 默认样式 -->
  94. <el-row v-else>
  95. <el-col :span="6" class="main-left">
  96. <!-- 步骤组件 模块 -->
  97. <CheckSteps
  98. v-if="deviceDetail.planDetail.id"
  99. ref="stepComp"
  100. :key="checkStepsUpdate"
  101. :check-steps-parames="{
  102. curPlanId: deviceDetail.curPlanId,
  103. curPlanDetailId: deviceDetail.planDetail.id,
  104. checkPlans: deviceDetail.deviceCheckPlans
  105. }"
  106. />
  107. </el-col>
  108. <el-col :span="18" class="main-right">
  109. <div class="main-right-container">
  110. <!-- 用例模块 -->
  111. <Example
  112. :key="exampleUpdate"
  113. :component-parames="{
  114. 'deviceName':deviceGet.name,
  115. 'curPlanId':deviceDetail.curPlanId,
  116. 'curSuiteId':deviceDetail.suiteId,
  117. 'status':exampleStatus,
  118. 'isDisable':isDisable
  119. }"
  120. />
  121. <!-- 采样模块 -->
  122. <SampleMaster104
  123. v-if="isMaster104==true"
  124. :key="sampleUpdate104"
  125. :component-parames="{
  126. 'deviceName':deviceGet.name,
  127. 'curPlanId':deviceDetail.curPlanId,
  128. 'productId':deviceDetail.planDetail.productId,
  129. 'status':sampleStatus,
  130. 'isDisable':isDisable
  131. }"
  132. />
  133. <Sample
  134. v-if="isMaster104==false"
  135. :key="sampleUpdate"
  136. :component-parames="{
  137. 'deviceName':deviceGet.name,
  138. 'curPlanId':deviceDetail.curPlanId,
  139. 'productId':deviceDetail.planDetail.productId,
  140. 'status':sampleStatus,
  141. 'isDisable':isDisable
  142. }"
  143. />
  144. <ModelReportMaster104
  145. v-if="isMaster104"
  146. :report-parames="{
  147. 'deviceName':'',
  148. 'curPlanId':deviceDetail.curPlanId
  149. }"
  150. @toggleModel="closeModel"
  151. />
  152. </div>
  153. </el-col>
  154. </el-row>
  155. <!-- <div class="left"></div>
  156. <div class="right"></div> -->
  157. </div>
  158. </div>
  159. </div>
  160. </template>
  161. <script>
  162. import { mapGetters } from 'vuex'
  163. import { editRow, httpGet, httpPostJson, getOptionIndex } from '@/api/common-action'
  164. import { singleAction } from '@/api/device'
  165. // 当前检测参数
  166. import CheckParamesMaster104 from './components/CheckParames_master104'
  167. import CheckParames from './components/CheckParames'
  168. // 步骤组件
  169. import CheckSteps from './components/CheckSteps.vue'
  170. // 用例表格
  171. import Example from './tables/Example'
  172. // 采样表格
  173. import Sample from './tables/Sample'
  174. // 采样表格(仅主站104检测才显示)
  175. import SampleMaster104 from './tables/Sample_master104'
  176. // 报文列表(仅主站104检测才显示)
  177. import ModelReportMaster104 from './components/ModelReport_master104'
  178. // 导入总线
  179. import { EventBus } from '@/main.js'
  180. // 微功率界面
  181. import PowerCentent from './protocols/PowerCentent'
  182. export default {
  183. components: {
  184. CheckParames,
  185. CheckParamesMaster104,
  186. Example,
  187. Sample,
  188. CheckSteps,
  189. PowerCentent,
  190. ModelReportMaster104,
  191. SampleMaster104
  192. },
  193. filters: {
  194. formartStatus: function(params) {
  195. if (params == null) {
  196. return 'null'
  197. }
  198. }
  199. },
  200. data() {
  201. return {
  202. isMaster104: false, // 是否主站104
  203. // 默认数据
  204. deviceDetail: {
  205. deviceId: 0,
  206. suiteId: 0, // 方案ID 用于获取方案详细信息
  207. curPlanId: 0, // 当前执行方案ID,用于获取当前正在执行的方案各种状态和执行情况
  208. planDetail: {}, // 方案详情
  209. devicePlanValue: '',
  210. devicePlanOptions: [],
  211. // 实时状态 刷新时间间隔 默认15秒 0不刷新 -1 自动刷新
  212. deviceRefreshValue: 0,
  213. deviceRefreshOptions: [
  214. {
  215. label: '不刷新',
  216. value: 0
  217. },
  218. {
  219. label: '每3秒',
  220. value: 3
  221. },
  222. {
  223. label: '每10秒',
  224. value: 10
  225. },
  226. {
  227. label: '每1分钟',
  228. value: 60
  229. },
  230. {
  231. label: '每5分钟',
  232. value: 300
  233. }
  234. ],
  235. deviceCheckPlans: [],
  236. // 当前方案执行步骤id,例: '2400000013',
  237. currenPlanStepsId: '0',
  238. showModelReport: false,
  239. showModelAddStep: false
  240. },
  241. // 步骤栏更新值,用于更新步骤栏状态
  242. deviceCheckPlanUpdate: '0',
  243. // 从后端获取后的设备信息
  244. deviceGet: {},
  245. // 是否禁用
  246. isDisable: true,
  247. deviceStatus: {},
  248. singleActionRunId: '0',
  249. // 准备编辑的当前步骤数据
  250. editCheckStepData: {},
  251. // 开始检测要传的数据
  252. playData: {},
  253. // 计时器
  254. timer: null,
  255. // 用例高频刷新状态 存放变量
  256. exampleStatus: {
  257. successful: 0,
  258. failed: 0
  259. },
  260. // 采集高频刷新状态 存放变量
  261. sampleStatus: {},
  262. // 用例刷新值,用于控制用例刷新
  263. exampleUpdate: 'example-0',
  264. // 采样刷新值,用于控制用例刷新
  265. sampleUpdate: 'sample-0',
  266. sampleUpdate104: 'sample104-0',
  267. // 步骤刷新值,用于控制用例刷新
  268. checkStepsUpdate: 'checkSteps-0',
  269. // 点击样式
  270. clickClass: {
  271. schedule: 'default',
  272. cancel: 'default',
  273. refresh: 'default'
  274. },
  275. // 使用点击对象的方式改变样式,避免当有多个不确定数量的元素时无法控制 的问题
  276. clickObj: {}
  277. }
  278. },
  279. computed: {
  280. ...mapGetters(['roles'])
  281. },
  282. watch: {
  283. $route: {
  284. handler() {
  285. // 路由改变时先清空定时器,避免切换页面时生成多个定时器
  286. this.clearTimer()
  287. this.watchRouter()
  288. }
  289. },
  290. deviceDetail: {
  291. handler() {
  292. if (this.deviceDetail.deviceRefreshValue > 0) {
  293. // 死循环一直更新状态数据
  294. // this.getStatusLoop()
  295. }
  296. },
  297. deep: true
  298. }
  299. },
  300. created() {
  301. this.deviceDetail.curPlanId = this.$route.query.curPlanId
  302. this.deviceDetail.suiteId = this.$route.query.suiteId
  303. this.deviceDetail.deviceId = this.$route.query.deviceId
  304. },
  305. mounted() {
  306. const tmpdeviceRefreshValue = window.localStorage.getItem('deviceRefreshValue')
  307. if (tmpdeviceRefreshValue !== null && !isNaN(tmpdeviceRefreshValue)) {
  308. this.deviceDetail.deviceRefreshValue = tmpdeviceRefreshValue * 1
  309. this.getStatusLoop()
  310. }
  311. this.$nextTick(() => {
  312. // 网页加载完成后执行
  313. this.initFunctions()
  314. // 全局公用函数测试
  315. // console.log('this.common=', this.common)
  316. // const test = this.common.ct3()
  317. // console.log('test=', test)
  318. })
  319. },
  320. beforeDestroy() {
  321. // 页面切换前先把定时器清空,否则会造成多个定时器,客户无法控制
  322. // console.log('beforeDestroy started')
  323. this.clearTimer()
  324. },
  325. methods: {
  326. // 监听路由
  327. watchRouter() {
  328. // console.log('watchRouter stated query=', this.$route.query)
  329. this.deviceDetail.curPlanId = this.$route.query.curPlanId
  330. this.deviceDetail.suiteId = this.$route.query.suiteId
  331. this.deviceDetail.deviceId = this.$route.query.deviceId
  332. this.initFunctions()
  333. },
  334. // 初始化
  335. async initFunctions() {
  336. // 获取设备详细信息
  337. const getUrl = `/test/project/${this.deviceDetail.deviceId}`
  338. httpGet(getUrl).then(response => {
  339. // console.log('initFunctions deviceGet=', response)
  340. this.deviceGet = response
  341. })
  342. // 刷新测试状态
  343. this.controlRefresh()
  344. // 获取选择方案选项
  345. httpGet(`/test/project/${this.deviceDetail.deviceId}/plan/list`).then(
  346. (response) => {
  347. // console.log('获取选择方案选项 getOptions rs=', response)
  348. this.deviceDetail.devicePlanOptions = response
  349. this.deviceDetail.devicePlanValue = this.deviceDetail.curPlanId
  350. }
  351. )
  352. // 获取检测参数
  353. // /test/plan/:plan
  354. httpGet(`/test/plan/${this.deviceDetail.curPlanId}`).then((response) => {
  355. // console.log('获取当前方案详细信息 res=', response)
  356. this.deviceDetail.planDetail = response
  357. if (response.productType === 'IEC104') {
  358. this.isMaster104 = true
  359. } else {
  360. this.isMaster104 = false
  361. }
  362. })
  363. // 获取当前方案相关步骤
  364. this.getSteps()
  365. },
  366. // 更改定时器时 清除之前的定时器
  367. changeTime(val) {
  368. this.clearTimer()
  369. this.deviceDetail.deviceRefreshValue = val
  370. if (this.deviceDetail.deviceRefreshValue === 0) {
  371. window.localStorage.removeItem('deviceRefreshValue')
  372. } else {
  373. window.localStorage.setItem('deviceRefreshValue', this.deviceDetail.deviceRefreshValue)
  374. this.getStatusLoop()
  375. }
  376. },
  377. // 自动循环刷新
  378. async getStatusLoop() {
  379. if (this.deviceDetail.deviceRefreshValue === 0 || this.deviceDetail.deviceRefreshValue === null) {
  380. this.clearTimer()
  381. return
  382. }
  383. // 每隔x秒运行一次
  384. this.timer = setTimeout(() => {
  385. if (this.deviceDetail.deviceRefreshValue === 0 || !this.deviceDetail.deviceRefreshValue) {
  386. this.clearTimer()
  387. return
  388. }
  389. // 刷新测试状态
  390. this.controlRefresh()
  391. // #TODO: 999 和 3200000217 都 返回的是空
  392. // 接口 步骤状态(高频刷新) /test/execute/:runner/progress
  393. // :runner 例 3200000217
  394. // 刷新步骤
  395. EventBus.$emit('refreshManualStep', false)
  396. // 刷新用例、采样表格状态
  397. EventBus.$emit('refreshManualFn', false)
  398. EventBus.$emit('refreshManualSample', false)
  399. EventBus.$emit('refreshManualReportMsg', false)
  400. this.getStatusLoop()
  401. }, this.deviceDetail.deviceRefreshValue * 1000)
  402. },
  403. // 获取禁用状态
  404. getDisable(bVal) {
  405. this.isDisable = bVal
  406. },
  407. // 获取设备状态
  408. getDeviceStatus(statusObj) {
  409. this.deviceStatus = statusObj
  410. // 更新子组件步骤列表的设备状态
  411. if (this.$refs.stepComp != null) this.$refs.stepComp.UpdateDeviceStatus(statusObj)
  412. if (this.$refs.lowPComp != null) this.$refs.lowPComp.UpStatusFa(statusObj)
  413. },
  414. // 添加/编辑步骤后刷新步骤模块
  415. getSteps() {
  416. // console.log('刷新步骤模块 getSteps')
  417. // 获取设备 - 检测步骤 数据
  418. // 检测步骤列表 接口 get /test/plan/:plan/steps
  419. // 暂时没有分页,直接取999条
  420. const getUrl = `/test/plan/${this.deviceDetail.curPlanId}/steps?page=0&size=999`
  421. httpGet(getUrl).then((response) => {
  422. // console.log('刷新步骤模块 response=', response)
  423. this.deviceDetail.deviceCheckPlans = response.content
  424. // 刷新一次步骤状态
  425. this.stepActionClick('refresh')
  426. })
  427. // 销毁 添加/编辑 步骤窗口,避免数据残留
  428. this.editCheckStepData = {}
  429. this.deviceDetail.showModelAddStep = false
  430. },
  431. // 改变方案
  432. changePlan(curPlanId) {
  433. this.exampleUpdate = 'example-' + new Date().getTime()
  434. this.sampleUpdate = 'sample-' + new Date().getTime()
  435. this.sampleUpdate104 = 'sample104-' + new Date().getTime()
  436. this.checkStepsUpdate = 'checkSteps-' + new Date().getTime()
  437. // console.log('changePlan curPlanId=', curPlanId)
  438. // this.$set(this.deviceDetail, 'curPlanId', curPlanId)
  439. // 获取当前选中方案的suiteID
  440. const index = getOptionIndex(this.deviceDetail.devicePlanOptions, curPlanId)
  441. // console.log('changePlan index=', index)
  442. // console.log('changePlan this.devicePlanOptions=', this.deviceDetail.devicePlanOptions)
  443. this.$router.push({
  444. path: `/device/check?curPlanId=${curPlanId}&suiteId=${this.deviceDetail.devicePlanOptions[index].suiteId}&deviceId=${this.deviceDetail.deviceId}`
  445. })
  446. },
  447. // 提交
  448. submitPlan() {
  449. // console.log(`this.requestData=`, this.requestData)
  450. // 已经是最后一步
  451. const submitTableData = this.getSubmitTableRowData(this.requestData)
  452. // /test/project/:project/suites?id=999&id=998
  453. const editPath = `/test/project`
  454. // const editData = submitTableData
  455. editRow(editPath, submitTableData)
  456. // 已经是最后一步了
  457. },
  458. // 获取提交的行数据-公用
  459. // #TODO: 测试如果翻页,选取状态能否正常保存
  460. getSubmitTableRowData(rowData) {
  461. // console.log(' rowData=', rowData)
  462. let submitRowData = []
  463. // 组织出待提交数据
  464. submitRowData = {
  465. deviceId: rowData.deviceCurrentCheckValue,
  466. planId: rowData.deviceCurrentPlanValue
  467. }
  468. return submitRowData
  469. },
  470. // 控制按钮
  471. controlClick(actStr) {
  472. // console.log('controlAction 执行开始 actStr=', actStr)
  473. const postUrl = `/test/execute/${this.deviceDetail.curPlanId}/${actStr}`
  474. httpPostJson(postUrl).then((response) => {
  475. // console.log('controlAction 执行完成 rs=', response)
  476. })
  477. },
  478. // 刷新 这里是获取 检测状态 根据获取结果动态显示:
  479. // 检测状态: .title-tag
  480. controlRefresh() {
  481. // 接口 测试状态 /test/execute/:runner/state
  482. // :runner 3200000208
  483. const getUrl = `/test/execute/${this.deviceDetail.curPlanId}/state`
  484. httpGet(getUrl).then((response) => {
  485. // console.log('controlRefresh() 执行完成 response=', response)
  486. this.deviceStatus = response
  487. // 更新子组件步骤列表的设备状态
  488. if (this.$refs.stepComp != null) this.$refs.stepComp.UpdateDeviceStatus(response)
  489. if (this.$refs.lowPComp != null) this.$refs.lowPComp.UpStatusFa(response)
  490. // 设置禁用状态
  491. if (this.deviceStatus.state === 'RUNNING') {
  492. this.isDisable = true
  493. } else {
  494. this.isDisable = false
  495. }
  496. })
  497. },
  498. // 步骤控制 按钮
  499. stepActionClick(actStr) {
  500. // 设置图片点击效果
  501. this.clickEffect(actStr)
  502. if (actStr === 'refresh') {
  503. // 刷新状态
  504. const getUrl = `/test/execute/${this.deviceDetail.curPlanId}/progress`
  505. httpGet(getUrl).then((response) => {
  506. this.deviceDetail.deviceCheckPlans.forEach(item => {
  507. response.forEach(ritem => {
  508. if (item.id === ritem.id) {
  509. item.status = ritem.stateName
  510. }
  511. })
  512. })
  513. this.deviceCheckPlanUpdate = 'steps' + new Date().getTime()
  514. })
  515. } else {
  516. // 运行/停止
  517. const postUrl = `/test/execute/${this.deviceDetail.curPlanId}/step/${actStr}`
  518. httpPostJson(postUrl).then(response => {
  519. // 执行成功后刷新状态
  520. this.stepActionClick('refresh')
  521. })
  522. }
  523. },
  524. // 点击效果
  525. clickEffect(actStr) {
  526. // 设置点击特效 - 开始
  527. this.clickClass[`${actStr}`] = 'clicked'
  528. setTimeout(() => {
  529. // 延迟200毫秒更新样式
  530. this.clickClass[`${actStr}`] = 'default'
  531. }, 200)
  532. },
  533. // 对象 点击效果
  534. clickObjEffect(event) {
  535. // e.target.className = 'clicked'
  536. this.clickObj = event.currentTarget.parentElement
  537. this.clickObj.classList.add('clicked')
  538. setTimeout(() => {
  539. // 延迟200毫秒更新样式
  540. this.clickObj.classList.remove('clicked')
  541. }, 200)
  542. },
  543. // 添加步骤
  544. ModelAddStep() {
  545. // console.log('addCheckStep 添加步骤 开始')
  546. this.deviceDetail.showModelAddStep = true
  547. },
  548. // 关闭 model
  549. closeModel(modelName, modelShow) {
  550. // console.log('closeModel modelName=', modelName)
  551. // console.log('closeModel modelShow=', modelShow)
  552. switch (modelName) {
  553. case 'ModelAddStep':
  554. this.deviceDetail.showModelAddStep = modelShow
  555. break
  556. case 'ModelReport':
  557. this.deviceDetail.showModelReport = modelShow
  558. break
  559. default:
  560. // console.log('未获取到 modelName')
  561. break
  562. }
  563. },
  564. // 单条步骤 编辑
  565. singleEditClick(currentCheckStep, index) {
  566. this.editCheckStepData = currentCheckStep
  567. this.deviceDetail.showModelAddStep = true
  568. },
  569. // 单条步骤 操作按钮
  570. singleActionClick(currentCheckStep, actStr, e) {
  571. // 点击特效
  572. this.clickObjEffect(e)
  573. // e.currentTarget.parentElement.classList.add('clicked')
  574. // this.deviceDetail.deviceCheckPlans[index].singleActionStatus = actStr
  575. if (actStr === 'run') {
  576. this.singleActionRunId = currentCheckStep.id
  577. } else {
  578. this.singleActionRunId = '0'
  579. }
  580. // console.log('singleActionClick 单条步骤开始 currentCheckStep=', currentCheckStep)
  581. // console.log('singleActionClick 单条步骤开始 this.deviceDetail.deviceCheckPlans=', this.deviceDetail.deviceCheckPlans)
  582. singleAction(
  583. this.deviceDetail.curPlanId,
  584. currentCheckStep.id,
  585. actStr
  586. ).then((response) => {
  587. // 为高亮显示当前步骤,更新当前执行步骤id
  588. this.deviceDetail.currenPlanStepsId = currentCheckStep.id
  589. // this.stepActionClick('refresh')
  590. this.stepActionClick('refresh')
  591. })
  592. },
  593. // 清空定时器
  594. clearTimer() {
  595. // console.log('clearTimer started')
  596. this.deviceDetail.deviceRefreshValue = 0
  597. clearTimeout(this.timer)
  598. this.timer = null
  599. }
  600. }
  601. }
  602. </script>
  603. <style lang="scss">
  604. .example {
  605. .el-table {
  606. font-size: 12px;
  607. }
  608. }
  609. </style>
  610. <style lang="scss" scoped>
  611. .check-container {
  612. padding:10px 30px;
  613. background-color: #fff;
  614. position: relative;
  615. font-size: 16px;
  616. color: rgb(112, 112, 112);
  617. min-height: calc(100vh - 84px);
  618. .check-container-inner {
  619. border: 1px solid #ccc;
  620. padding: 5px 20px;
  621. .check-title {
  622. display: flex;
  623. font-size: 18px;
  624. color: #111;
  625. font-weight: bolder;
  626. justify-content: center;
  627. align-items: flex-end;
  628. .title-lable {
  629. font-size: 16px;
  630. font-weight: normal;
  631. margin-left: 10px;
  632. .state {
  633. font-size:12px;
  634. border-radius: 10%;
  635. padding: 1px;
  636. text-align: center;
  637. }
  638. }
  639. }
  640. .check-sub-title {
  641. display: flex;
  642. justify-content: center;
  643. padding: 10px 0;
  644. .sub-left {
  645. padding-right: 10px;
  646. }
  647. }
  648. .contorl-panel {
  649. .top {
  650. border: 1px #ccc solid;
  651. padding: 10px;
  652. .left {
  653. // display: flex;
  654. }
  655. .right {
  656. display: flex;
  657. align-items: center;
  658. height: 80px;
  659. // border: 1px solid #f00;
  660. justify-content: right;
  661. .play,
  662. .stop {
  663. padding-right: 10px;
  664. }
  665. .play,
  666. .stop,
  667. .refresh {
  668. cursor: pointer;
  669. .el-image {
  670. height: 50px;
  671. }
  672. }
  673. .refresh .el-image {
  674. height: 44px;
  675. }
  676. }
  677. }
  678. .main-left {
  679. padding: 20px 20px 0 0;
  680. font-size: 14px;
  681. .left-container {
  682. border: 1px solid #ccc;
  683. padding: 0 20px;
  684. .check-steps {
  685. display: flex;
  686. justify-content: space-between;
  687. padding: 20px 0;
  688. .check-steps-title {
  689. font-weight: bold;
  690. }
  691. }
  692. .check-buttons {
  693. display: flex;
  694. .play-all,.stop-all,.refresh-all {
  695. display: flex;
  696. align-items: center;
  697. padding-right: 16px;
  698. cursor: pointer;
  699. .icon {
  700. padding-left: 5px;
  701. .el-image {
  702. height: 36px;
  703. }
  704. }
  705. .lable {
  706. white-space: nowrap;
  707. }
  708. }
  709. }
  710. }
  711. .check-item {
  712. border: 1px solid #ccc;
  713. margin-top: 10px;
  714. padding: 10px;
  715. background-color: #fbffff;
  716. border-radius: 5px;
  717. .check-item-title{
  718. padding-top: 10px;
  719. }
  720. .check-item-title,
  721. .check-item-control-title {
  722. span {
  723. font-weight: bold;
  724. color: #111;
  725. }
  726. }
  727. .check-item-control {
  728. display: flex;
  729. justify-content: space-between;
  730. align-items: center;
  731. .check-item-control-buttons {
  732. display: flex;
  733. align-items: center;
  734. justify-content: right;
  735. .check-item-edit,
  736. .check-item-play,
  737. .check-item-stop {
  738. cursor: pointer;
  739. }
  740. .el-image {
  741. height: 30px;
  742. margin-left: 10px;
  743. }
  744. }
  745. }
  746. .check-item-status {
  747. display: flex;
  748. }
  749. }
  750. .check-item.active {
  751. border: 1px solid #00706b;
  752. background-color: #f2fdfd;
  753. }
  754. }
  755. .main-right {
  756. font-size: 14px;
  757. padding: 20px 0 0 0;
  758. .main-right-container {
  759. padding: 0 20px;
  760. border: 1px solid #ccc;
  761. }
  762. }
  763. }
  764. }
  765. // 按钮图片物资公用样式
  766. .clicked {
  767. border-radius: 40%;
  768. filter: Alpha(opacity=50);
  769. border:4px solid transparent;
  770. }
  771. .default {
  772. filter: Alpha(opacity=100);
  773. }
  774. // 底部按钮
  775. .bottom-button {
  776. display: flex;
  777. justify-content: center;
  778. padding-bottom: 20px;
  779. .cancel-device {
  780. padding-right: 20px;
  781. }
  782. }
  783. // 按钮公用样式
  784. .dark-button {
  785. background-color: #00706b;
  786. border: 1px #00706b solid;
  787. color: #fff;
  788. }
  789. .light-button {
  790. color: #00706b;
  791. border: 1px #00706b solid;
  792. }
  793. }
  794. </style>