edbDetailPopover.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <el-popover
  3. placement="right"
  4. title=""
  5. width="350"
  6. offset="100"
  7. trigger="hover"
  8. >
  9. <ul class="edb-info-cont">
  10. <li v-for="key in keysArr" :key="key">
  11. <label class="li-label">{{keysLabel[key]}}</label>
  12. {{info[key]}}
  13. </li>
  14. </ul>
  15. <div slot="reference">
  16. <slot name="reference"/>
  17. </div>
  18. </el-popover>
  19. </template>
  20. <script>
  21. export default {
  22. name: "mDialog",
  23. props: {
  24. info: {
  25. type: Object,
  26. default: {}
  27. }
  28. },
  29. computed: {
  30. keysLabel(){
  31. return {
  32. 'EdbName': /* '指标名称' */ this.$t('Edb.Detail.e_name'),
  33. 'EdbNameEn': /* '指标名称' */ this.$t('Edb.Detail.e_name'),
  34. 'EdbCode': /* '指标ID' */this.$t('Edb.Detail.e_id'),
  35. 'Frequency': /* '更新频度' */this.$t('Edb.Detail.e_fre'),
  36. 'Unit': /* '单位' */this.$t('Edb.Detail.e_unit'),
  37. 'UnitEn': /* '单位' */this.$t('Edb.Detail.e_unit'),
  38. 'StartDate': /* '起始时间' */this.$t('Edb.Detail.e_start_time'),
  39. 'LatestDate': /* '最新日期' */this.$t('Edb.Detail.e_latest_date'),
  40. 'LatestValue': /* '最新值' */this.$t('Edb.Detail.e_latest_value'),
  41. 'ModifyTime': /* '最近更新' */this.$t('Edb.Detail.e_recent_time'),
  42. 'SourceName': /* '数据来源' */this.$t('Edb.Detail.source'),
  43. }
  44. },
  45. keysArr(){
  46. const keys = [
  47. 'EdbName',
  48. 'EdbCode',
  49. 'Frequency',
  50. 'Unit',
  51. 'StartDate',
  52. 'LatestDate',
  53. 'LatestValue',
  54. 'ModifyTime',
  55. 'SourceName'
  56. ]
  57. const enKeyMap = {
  58. 'EdbName': 'EdbNameEn',
  59. 'Unit': 'UnitEn'
  60. }
  61. return this.currentLang==='en'
  62. ? keys.map(_=>enKeyMap[_]?enKeyMap[_]:_)
  63. : keys
  64. },
  65. currentLang() {
  66. return this.$store.state.lang
  67. }
  68. },
  69. data() {
  70. return {
  71. };
  72. }
  73. };
  74. </script>
  75. <style scoped lang="scss">
  76. .edb-info-cont {
  77. background: #fff;
  78. padding: 20px 20px 10px;
  79. li {
  80. margin-bottom: 20px;
  81. display: flex;
  82. font-size: 14px;
  83. .li-label {
  84. min-width: 100px;
  85. margin-right: 20px;
  86. }
  87. }
  88. }
  89. </style>