View.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <el-dialog
  3. :title="$t(&quot;common.view&quot;)"
  4. :width="width"
  5. :append-to-body="true"
  6. :visible.sync="isVisible"
  7. class="tenant-view"
  8. >
  9. <el-row :gutter="10">
  10. <el-col :xs="24" :sm="3">
  11. <div class="view-item">
  12. <span>NO</span>
  13. </div>
  14. </el-col>
  15. <el-col :xs="24" :sm="3">
  16. <div class="view-item">
  17. <span>任务ID</span>
  18. </div>
  19. </el-col>
  20. <el-col :xs="24" :sm="4">
  21. <div class="view-item">
  22. <span>名称</span>
  23. </div>
  24. </el-col>
  25. <el-col :xs="24" :sm="2">
  26. <div class="view-item">
  27. <span>编号</span>
  28. </div>
  29. </el-col>
  30. <el-col :xs="24" :sm="4">
  31. <div class="view-item">
  32. <span>设备</span>
  33. </div>
  34. </el-col>
  35. <el-col :xs="24" :sm="4">
  36. <div class="view-item">
  37. <span>开始时间</span>
  38. </div>
  39. </el-col>
  40. <el-col :xs="24" :sm="4">
  41. <div class="view-item">
  42. <span>目标设备</span>
  43. </div>
  44. </el-col>
  45. </el-row>
  46. <el-row :gutter="10" v-for="taskNode in workflowList " :key="taskNode.id" >
  47. <el-col :xs="24" :sm="3">
  48. <div class="view-item">
  49. <span v-if="taskNode.exe_status == '2'" style="color: #f50" >{{ taskNode.id }}</span>
  50. <span v-else >{{ taskNode.id }}</span>
  51. </div>
  52. </el-col>
  53. <el-col :xs="24" :sm="3">
  54. <div class="view-item">
  55. <span>{{ taskNode.task_id }}</span>
  56. </div>
  57. </el-col>
  58. <el-col :xs="24" :sm="4">
  59. <div class="view-item">
  60. <span>{{ taskNode.node_name }}</span>
  61. </div>
  62. </el-col>
  63. <el-col :xs="24" :sm="2">
  64. <div class="view-item">
  65. <span>{{ taskNode.procedure_no }}</span>
  66. </div>
  67. </el-col>
  68. <el-col :xs="24" :sm="4">
  69. <div class="view-item">
  70. <span>{{ taskNode.ResourceName }}</span>
  71. </div>
  72. </el-col>
  73. <el-col :xs="24" :sm="4">
  74. <div class="view-item">
  75. <span>{{ taskNode.start_time }}</span>
  76. </div>
  77. </el-col>
  78. <el-col :xs="24" :sm="4">
  79. <div class="view-item">
  80. <span>{{ taskNode.targetResourceName }}</span>
  81. </div>
  82. </el-col>
  83. </el-row>
  84. </el-dialog>
  85. </template>
  86. <script>
  87. import toolQueryApi from "@/api/systemMgr/toolQuery"
  88. export default {
  89. name: 'TenantView',
  90. filters: {
  91. passwordErrorLockTimeFilter (time) {
  92. if (time === '0') {
  93. return '当天23点59分'
  94. }
  95. return time
  96. }
  97. },
  98. props: {
  99. dialogVisible: {
  100. type: Boolean,
  101. default: false
  102. }
  103. },
  104. data () {
  105. return {
  106. screenWidth: 0,
  107. width: this.initWidth(),
  108. workflowList:[],
  109. tenant: {}
  110. }
  111. },
  112. computed: {
  113. isVisible: {
  114. get () {
  115. return this.dialogVisible
  116. },
  117. set () {
  118. this.close()
  119. }
  120. }
  121. },
  122. mounted () {
  123. window.onresize = () => {
  124. return (() => {
  125. this.width = this.initWidth()
  126. })()
  127. }
  128. },
  129. methods: {
  130. initWidth () {
  131. this.screenWidth = document.body.clientWidth
  132. if (this.screenWidth < 550) {
  133. return '95%'
  134. } else if (this.screenWidth < 990) {
  135. return '580px'
  136. } else if (this.screenWidth < 1400) {
  137. return '600px'
  138. } else {
  139. return '1050px'
  140. }
  141. },
  142. setTenant (val) {
  143. this.tenant = { ...val }
  144. toolQueryApi.getWorkflowDetail({"completeBatchNo":this.tenant.completeBatchNo}).then(response=>{
  145. const res = response.data
  146. if(res.isSuccess){
  147. this.workflowList = res.data.data
  148. console.log(this.workflowList)
  149. }else{
  150. this.$message({
  151. message: res.msg,
  152. type: 'warning'
  153. })
  154. }
  155. }).finally(()=>{
  156. return true
  157. })
  158. },
  159. close () {
  160. this.$emit('close')
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. .tenant-view {
  167. .img-wrapper {
  168. text-align: center;
  169. margin-top: -1.5rem;
  170. margin-bottom: 10px;
  171. img {
  172. width: 4rem;
  173. border-radius: 50%;
  174. }
  175. }
  176. .view-item {
  177. margin: 7px;
  178. i {
  179. font-size: 0.97rem;
  180. }
  181. span {
  182. margin-left: 5px;
  183. }
  184. }
  185. }
  186. </style>