exhibitionBaseInformation.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="exhibition-baseInformation">
  3. <section v-for="(val,key,i) in exhibitionBaseInformation.information">
  4. <h4 class="base">{{key || '信息'}}</h4>
  5. <div class="infoPoint-item" v-for="(value,keys,index) in val.paths">
  6. <span> {{value.InfoPointName}}:</span>
  7. <el-popover
  8. v-if="value.Path == 'EquipQRCode' || value.Path == 'RoomQRCode' || value.Path == 'ShaftQRCode'"
  9. placement="top"
  10. width="360"
  11. trigger="hover">
  12. <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
  13. <div style="overflow:hidden;">
  14. <div style="float:left;width: 60%">
  15. <img
  16. v-if="value.Value"
  17. style="width:200px;height:200px;"
  18. :src="'/image-service/common/file_get/'+ value.Value +'?systemId=dataPlatform'"
  19. alt="二维码"
  20. >
  21. <span v-else>数据暂无</span>
  22. </div>
  23. <div style="float:right;width: 40%;margin-top: 30px">
  24. <span>{{value.Value}}</span>
  25. </div>
  26. </div>
  27. <div style="text-align: center; margin: 0">
  28. <el-button type="text" size="mini" @click="handleCopy(value.Value)">复制</el-button>
  29. </div>
  30. <el-button slot="reference" type="text">{{value.Value ? '有' :'-'}}</el-button>
  31. </el-popover>
  32. <el-popover
  33. v-else-if="Array.isArray(value.Value) && value.InputMode== 'F2'"
  34. placement="top"
  35. width="250"
  36. trigger="hover">
  37. <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
  38. <div v-for="(pic,index) in value.Value">
  39. <div>图纸名称:{{pic.Name}}
  40. <el-button style="" type="text" size="mini" @click="downloadFile(pic.Key)">下载</el-button>
  41. </div>
  42. </div>
  43. <el-button slot="reference" type="text">{{value.Value? '有':'-'}}</el-button>
  44. </el-popover>
  45. <el-popover
  46. v-else-if="Array.isArray(value.Value) && value.InputMode=='N2'"
  47. placement="top"
  48. width="600"
  49. trigger="hover">
  50. <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
  51. <p style="height: 300px;overflow: auto">{{value.Value}}</p>
  52. <div style="text-align: center; margin: 0">
  53. <el-button type="text" size="mini" @click="handleCopy(value.Value)">复制</el-button>
  54. </div>
  55. <el-button slot="reference" type="text">{{value.Value ? '有' :'-'}}</el-button>
  56. </el-popover>
  57. <el-popover
  58. v-else-if="value.Value && value.Value.length && `${value.InfoPointName}:${value.Value}`.length>23"
  59. placement="top"
  60. width="160"
  61. trigger="hover">
  62. <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
  63. <p>{{value.Value}}</p>
  64. <div style="text-align: center; margin: 0">
  65. <el-button type="text" size="mini" @click="handleCopy(value.Value)">复制</el-button>
  66. </div>
  67. <el-button slot="reference" type="text">{{handleName(value.InfoPointName, value.Value)}}</el-button>
  68. </el-popover>
  69. <span v-else>{{value.Value}}</span>
  70. </div>
  71. </section>
  72. </div>
  73. </template>
  74. <script>
  75. export default {
  76. name: "exhibition-baseInformation",
  77. props: ['exhibitionBaseInformation'],
  78. data() {
  79. return {}
  80. },
  81. methods: {
  82. downloadFile(key) {
  83. window.open("/image-service/common/file_get/" + key + "?systemId=dataPlatform")
  84. },
  85. handleCopy(data) {
  86. let oInput = document.createElement('input')
  87. oInput.value = data
  88. document.body.appendChild(oInput)
  89. oInput.select()
  90. document.execCommand('Copy')
  91. this.$message.success('复制成功')
  92. oInput.remove()
  93. },
  94. handleName(infoPoint, val) {
  95. let text = `${infoPoint}:${val}`
  96. return text.length > 23 ? val.substring(0, 23-`${infoPoint}:`.length) + '...' : val
  97. }
  98. }
  99. }
  100. </script>
  101. <style scoped lang="less">
  102. .exhibition-baseInformation {
  103. section {
  104. /*border: 1px solid #eeeeee;*/
  105. /*margin: 10px;*/
  106. .base {
  107. margin: 10px;
  108. font-weight: 600;
  109. text-indent: 10px;
  110. border-bottom: 1px dashed #eee;
  111. }
  112. /deep/ .el-button--text {
  113. color: #555 !important;
  114. font-size: 14px;
  115. }
  116. }
  117. .ml-10 {
  118. margin-left: 10px;
  119. text-indent: 10px;
  120. }
  121. .infoPoint-item {
  122. width: 350px;
  123. display: inline-block;
  124. margin-left: 20px;
  125. }
  126. }
  127. </style>