DeviceCheck.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <!-- 步骤3 开始检测 -->
  2. <template>
  3. <el-row v-show="currentStep==2">
  4. <el-col :span="3" style="border: 1px solid transparent">
  5. <!-- 占位 -->
  6. </el-col>
  7. <el-col :span="18" :class="className">
  8. <div class="device-current-check item">
  9. <div class="lable-title">当前检测设备:</div>
  10. <div class="lable-title">
  11. {{ requestData.deviceDefaultName }}
  12. <!-- <el-select v-model="requestData.deviceCurrentCheckValue" filterable placeholder="请选择检测设备">
  13. <el-option
  14. v-for="item in requestData.deviceCurrentCheckOptions"
  15. :key="item.value"
  16. :label="item.label"
  17. :value="item.value"
  18. />
  19. </el-select> -->
  20. </div>
  21. </div>
  22. <div class="device-current-plan item">
  23. <div class="lable-title">当前检测方案:</div>
  24. <div class="lable">
  25. <el-select v-model="requestData.deviceCurrentPlanValue" filterable placeholder="请选择检测设备">
  26. <el-option
  27. v-for="item in requestData.deviceCurrentPlanOptions"
  28. :key="item.value"
  29. :label="item.label"
  30. :value="item.value"
  31. />
  32. </el-select>
  33. </div>
  34. </div>
  35. <!-- 底部按钮 -->
  36. <div class="bottom-button item">
  37. <div class="save-plan">
  38. <el-button class="dark-button" @click="submitPlan()">开始检测</el-button>
  39. </div>
  40. </div>
  41. </el-col>
  42. <el-col :span="3" />
  43. </el-row>
  44. </template>
  45. <script>
  46. // import { editRow } from '@/api/common-action'
  47. export default {
  48. props: {
  49. className: {
  50. type: String,
  51. default: 'example-bar-default'
  52. },
  53. currentStep: {
  54. type: Number,
  55. default: 1
  56. },
  57. currentDeviceId: {
  58. type: Number,
  59. default: 0
  60. }
  61. },
  62. data() {
  63. return {
  64. // 默认数据
  65. requestData: {
  66. deviceDefaultName: '当前设备编号,加载中...',
  67. deviceCurrentCheckValue: 'd1',
  68. deviceCurrentCheckOptions: [],
  69. deviceCurrentPlanValue: 'p1',
  70. deviceCurrentPlanOptions: []
  71. }
  72. }
  73. },
  74. mounted() {
  75. this.$nextTick(() => {
  76. // 网页加载完成后执行
  77. if (this.currentDeviceId > 0) {
  78. //
  79. }
  80. })
  81. },
  82. methods: {
  83. // 提交
  84. submitPlan() {
  85. // console.log(`this.requestData=`, this.requestData)
  86. // // 已经是最后一步
  87. // const submitTableData = this.getSubmitTableRowData(this.requestData)
  88. // // /test/project/:project/suites?id=999&id=998
  89. // const editPath = `/test/project`
  90. // // const editData = submitTableData
  91. // editRow(editPath, submitTableData)
  92. this.$router.push({ path: `/device/check`, query: { deviceCheckId: this.currentDeviceId }})
  93. // 已经是最后一步了
  94. },
  95. // 获取提交的行数据-公用
  96. // #TODO: 测试如果翻页,选取状态能否正常保存
  97. getSubmitTableRowData(rowData) {
  98. // console.log('getSubmitTableRowData rowData=', rowData)
  99. let submitRowData = []
  100. // 组织出待提交数据
  101. submitRowData = {
  102. deviceId: rowData.deviceCurrentCheckValue,
  103. planId: rowData.deviceCurrentPlanValue
  104. }
  105. return submitRowData
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .device-check {
  112. $itemHeight: 40px;
  113. border: 1px #ccc solid;
  114. font-size: 16px;
  115. background-color: #f1f1f1;
  116. .item {
  117. display: flex;
  118. justify-content: center;
  119. padding-top:30px;
  120. .lable-title {
  121. padding-right: 5px;
  122. height: $itemHeight;
  123. line-height: $itemHeight;
  124. }
  125. }
  126. // 底部按钮
  127. .bottom-button {
  128. display: flex;
  129. justify-content: center;
  130. padding-bottom: 20px;
  131. .cancel-device {
  132. padding-right: 20px;
  133. }
  134. }
  135. // 按钮公用样式
  136. .dark-button {
  137. background-color: #00706B;
  138. border: 1px #00706B solid;
  139. color: #fff;
  140. }
  141. .light-button {
  142. color: #00706B;
  143. border: 1px #00706B solid;
  144. }
  145. }
  146. </style>