exhibitionBaseInformation.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. <a
  46. style="cursor: pointer;color: #409eff"
  47. :href="`/image-service/common/file_get/${pic.Key}?systemId=dataPlatform`"
  48. :download="pic.Name"
  49. >下载</a>
  50. </div>
  51. </div>
  52. <el-button slot="reference" type="text">{{value.Value? '有':'-'}}</el-button>
  53. </el-popover>
  54. <el-popover
  55. v-else-if="Array.isArray(value.Value) && value.InputMode=='N2'"
  56. placement="right"
  57. width="600"
  58. trigger="hover">
  59. <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
  60. <p style="height: 300px;overflow: auto">{{value.Value}}</p>
  61. <div style="text-align: center; margin: 0">
  62. <el-button type="text" size="mini" @click="handleCopy(value.Value)">复制</el-button>
  63. </div>
  64. <el-button slot="reference" type="text">{{value.Value ? '有' :'-'}}</el-button>
  65. </el-popover>
  66. <el-popover
  67. v-else-if="value.Value && value.Value.length && `${value.InfoPointName}:${value.Value}`.length>21 "
  68. placement="right"
  69. width="160"
  70. trigger="hover">
  71. <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
  72. <p>{{value.Value}}</p>
  73. <div style="text-align: center; margin: 0">
  74. <el-button type="text" size="mini" @click="handleCopy(value.Value)">复制</el-button>
  75. </div>
  76. <el-button slot="reference" type="text">{{handleName(value.InfoPointName, value.Value)}}</el-button>
  77. </el-popover>
  78. <span v-else>{{value.Value}}</span>
  79. </div>
  80. </section>
  81. </div>
  82. </template>
  83. <script>
  84. export default {
  85. name: "exhibition-baseInformation",
  86. props: ['exhibitionBaseInformation'],
  87. data() {
  88. return {}
  89. },
  90. methods: {
  91. downloadFile(key) {
  92. window.open("/image-service/common/file_get/" + key + "?systemId=dataPlatform")
  93. },
  94. handleCopy(data) {
  95. let oInput = document.createElement('input')
  96. oInput.value = data
  97. document.body.appendChild(oInput)
  98. oInput.select()
  99. document.execCommand('Copy')
  100. this.$message.success('复制成功')
  101. oInput.remove()
  102. },
  103. handleName(infoPoint, val) {
  104. let text = `${infoPoint}:${val}`;
  105. return text.length > 21 ? val.substring(0, 21-`${infoPoint}:`.length) + '...' : val;
  106. }
  107. }
  108. }
  109. </script>
  110. <style scoped lang="less">
  111. .exhibition-baseInformation {
  112. section {
  113. /*border: 1px solid #eeeeee;*/
  114. /*margin: 10px;*/
  115. .base {
  116. margin: 10px;
  117. font-weight: 600;
  118. /*text-indent: 10px;*/
  119. border-bottom: 1px dashed #eee;
  120. }
  121. /deep/ .el-button--text {
  122. color: #555 !important;
  123. font-size: 14px;
  124. }
  125. }
  126. .ml-10 {
  127. margin-left: 10px;
  128. text-indent: 10px;
  129. }
  130. .infoPoint-item {
  131. width: 315px;
  132. display: inline-block;
  133. margin-left: 20px;
  134. vertical-align: text-top;
  135. }
  136. }
  137. </style>