paramDetails.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <el-dialog width="400px" title="型号参数" :visible.sync="isLoad.paramShow" append-to-body>
  3. <h3 class="lag-h3">当前型号: {{data.brand || "--"}} - {{data.name || "--"}}</h3>
  4. <div style="max-height: 400px;overflow-y:auto;">
  5. <p
  6. class="saga-poent"
  7. v-for="item in labelArr"
  8. v-if="!!data.infos && data.infos[item.infoPointCode]"
  9. >{{item.infoPointName}}:{{data.infos ? data.infos[item.infoPointCode] || "--" : "--"}}</p>
  10. </div>
  11. </el-dialog>
  12. </template>
  13. <script>
  14. import { getSpaceHeader } from "@/api/scan/request"
  15. import { mapGetters, mapActions } from "vuex"
  16. export default {
  17. props: {
  18. isLoad: {
  19. type: Object,
  20. default: function () {
  21. return {
  22. paramShow: false
  23. }
  24. }
  25. },
  26. data: {
  27. type: Object,
  28. default: function () {
  29. return {
  30. }
  31. }
  32. }
  33. },
  34. computed: {
  35. ...mapGetters("layout", ["projectId", "secret", "userId"]),
  36. },
  37. data() {
  38. return {
  39. labelArr: []
  40. }
  41. },
  42. created() { },
  43. mounted() { },
  44. methods: {
  45. getData() {
  46. let param = {
  47. ProjId: this.projectId,
  48. code: this.data.eqFamily
  49. }
  50. getSpaceHeader(param).then(res => {
  51. if (res.data.Result == "success") {
  52. this.labelArr = res.data.Content.map(item => {
  53. if (item.firstTag == "台账信息") {
  54. return item
  55. } else {
  56. return undefined
  57. }
  58. }).filter(d => d)
  59. } else {
  60. this.$message.error("请求失败:" + res.data.ResultMsg)
  61. }
  62. }).catch(_ => {
  63. this.$message.error("请求失败")
  64. })
  65. }
  66. },
  67. watch: {
  68. isLoad: {
  69. deep: true,
  70. handler: function () {
  71. if (this.isLoad.paramShow) {
  72. this.getData()
  73. }
  74. }
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="less" scoped>
  80. .lag-h3 {
  81. height: 35px;
  82. line-height: 35px;
  83. font-size: 20px;
  84. font-weight: 500;
  85. margin-bottom: 8px;
  86. }
  87. .saga-poent {
  88. line-height: 28px;
  89. }
  90. </style>