paramDetails.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. export default {
  16. props: {
  17. isLoad: {
  18. type: Object,
  19. default: function () {
  20. return {
  21. paramShow: false
  22. }
  23. }
  24. },
  25. data: {
  26. type: Object,
  27. default: function () {
  28. return {
  29. }
  30. }
  31. }
  32. },
  33. data() {
  34. return {
  35. labelArr: []
  36. }
  37. },
  38. created() { },
  39. mounted() { },
  40. methods: {
  41. getData() {
  42. let param = {
  43. ProjId: this.$route.query.projId,
  44. code: this.data.eqFamily
  45. }
  46. getSpaceHeader(param).then(res => {
  47. if (res.data.Result == "success") {
  48. this.labelArr = res.data.Content.map(item => {
  49. if (item.firstTag == "台账信息") {
  50. return item
  51. } else {
  52. return undefined
  53. }
  54. }).filter(d => d)
  55. } else {
  56. this.$message.error("请求失败:" + res.data.ResultMsg)
  57. }
  58. }).catch(_ => {
  59. this.$message.error("请求失败")
  60. })
  61. }
  62. },
  63. watch: {
  64. isLoad: {
  65. deep: true,
  66. handler: function () {
  67. if (this.isLoad.paramShow) {
  68. this.getData()
  69. }
  70. }
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="less" scoped>
  76. .lag-h3 {
  77. height: 35px;
  78. line-height: 35px;
  79. font-size: 20px;
  80. font-weight: 500;
  81. margin-bottom: 8px;
  82. }
  83. .saga-poent {
  84. line-height: 28px;
  85. }
  86. </style>