ETAChart.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div class="eta-chart-wrap">
  3. <div class="top-box">
  4. <div class="left-card">
  5. <span :class="['item',activeType==='ETA图库'?'active':'']" @click="activeTypeChange('ETA图库')">{{$t('ReportManage.ReportList.chart_inventory_radio')}}</span>
  6. <span :class="['item',activeType==='MyETA'?'active':'']" @click="activeTypeChange('MyETA')">{{$t('MyEtaPage.tab_my')}}</span>
  7. </div>
  8. <div class="right">
  9. <el-input
  10. class="search-box"
  11. :placeholder="$t('ReportManage.ReportList.chart_name')"
  12. v-model="keyword"
  13. size="medium"
  14. prefix-icon="el-icon-search"
  15. v-if="activeType==='ETA图库'"
  16. @input="handleETAChartSearch"
  17. />
  18. </div>
  19. </div>
  20. <div class="main-box">
  21. <ImportETAChart ref="ETAChartWrap" v-if="activeType==='ETA图库'"/>
  22. <ImportMyETAChart @handleImportMyChart="handleImportMyChart" v-if="activeType==='MyETA'"/>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import ImportETAChart from './ImportETAChart.vue';
  28. import ImportMyETAChart from './ImportMyETAChart.vue';
  29. export default {
  30. name:"ETAChartWrap",
  31. components:{ImportETAChart,ImportMyETAChart},
  32. data() {
  33. return {
  34. keyword:'',
  35. activeType:'ETA图库',
  36. }
  37. },
  38. methods: {
  39. activeTypeChange(e){
  40. if(this.activeType===e) return
  41. this.activeType=e
  42. },
  43. handleETAChartSearch(){
  44. this.$refs.ETAChartWrap.handleSearch(this.keyword)
  45. },
  46. handleImportMyChart(list){
  47. this.$emit('handleImportMyChart',list)
  48. }
  49. },
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. div{
  54. box-sizing: border-box;
  55. }
  56. .eta-chart-wrap{
  57. width: 100%;
  58. min-width: 600px;
  59. overflow-x: auto;
  60. .top-box{
  61. display: flex;
  62. justify-content: space-between;
  63. align-items: center;
  64. .left-card{
  65. border-radius: 4px;
  66. border: 1px solid var(--unnamed, #DCDFE6);
  67. background: var(--gary-gy-3-disabled, #EBEFF6);
  68. display: flex;
  69. align-items: center;
  70. padding: 6px;
  71. .item{
  72. cursor: pointer;
  73. display: block;
  74. width: 110px;
  75. height: 30px;
  76. line-height: 30px;
  77. text-align: center;
  78. border-radius: 4px;
  79. font-size: 18px;
  80. color: #666;
  81. &.active{
  82. background: #FFF;
  83. color: #002D78;
  84. }
  85. }
  86. }
  87. .right{
  88. .search-box{
  89. width: 330px;
  90. }
  91. }
  92. }
  93. .main-box{
  94. margin-top: 30px;
  95. height: calc(100vh - 180px);
  96. border-radius: 4px;
  97. border: 1px solid var(--gary-gy-5-line, #C8CDD9);
  98. background: #FFF;
  99. padding: 0 20px 20px 20px;
  100. }
  101. }
  102. </style>