exhibitionBaseInformation.vue 4.7 KB

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