dataAssociateComputeData.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <div class="main-box">
  3. <el-table
  4. :data="list"
  5. ref="tableRef"
  6. highlight-current-row
  7. border
  8. >
  9. <el-table-column
  10. v-for="item in tableColums"
  11. :key="item.label"
  12. :label="item.label"
  13. :width="item.widthsty"
  14. :min-width="item.minwidthsty"
  15. align="center"
  16. >
  17. <template slot-scope="scope">
  18. <!-- 中文 -->
  19. <span v-show="currentLang == 'ch'">{{ scope.row[item.key] }}</span>
  20. <!-- 英文 没有内容 只有指标名称、单位可以编辑 -->
  21. <!-- 中文没有内容 对应英文显示为空 -->
  22. <span
  23. v-show="currentLang == 'en' && !scope.row[item.enKey || item.key]"
  24. style="color: #999; cursor: pointer"
  25. @click="openEnNameDia()"
  26. >{{ scope.row[item.key] ? item.inputTip : "" }}</span
  27. >
  28. <!-- 英文有内容 只有指标名称、单位可以编辑 -->
  29. <span
  30. v-show="
  31. currentLang == 'en' &&
  32. scope.row[item.enKey || item.key] &&
  33. ['EdbNameEn', 'UnitEn'].includes(item.enKey)
  34. "
  35. style="cursor: pointer"
  36. @click="openEnNameDia()"
  37. >{{ scope.row[item.enKey || item.key] }}</span
  38. >
  39. <span
  40. v-show="
  41. currentLang == 'en' &&
  42. scope.row[item.enKey || item.key] &&
  43. !['EdbNameEn', 'UnitEn'].includes(item.enKey)
  44. "
  45. >{{ scope.row[item.enKey || item.key] }}</span
  46. >
  47. </template>
  48. </el-table-column>
  49. <el-table-column :label="$t('Edb.Detail.e_opera')" key="Copy" align="center" width="110">
  50. <template slot-scope="scope">
  51. <span v-permission="permissionBtn.edbDataPermission.edbData_copyData"
  52. class="editsty" @click="copyCode(scope.row)">
  53. <i class="el-icon-document-copy" />&nbsp;{{$t('Edb.detail_copydata_btn')}}</span
  54. >
  55. <span class="editsty" @click="viewTarget(scope.row)">{{$t('Edb.detail_lookdata_btn')}}</span>
  56. </template>
  57. </el-table-column>
  58. <div slot="empty">
  59. <tableNoData :text="$t('EtaBasePage.no_quote_edb')" size="mini"/>
  60. </div>
  61. </el-table>
  62. <el-pagination
  63. layout="total,prev,pager,next"
  64. background
  65. :current-page="page"
  66. @current-change="handleCurrentChange"
  67. :page-size="pageSize"
  68. :total="Total"
  69. style="float:right;margin-top:20px">
  70. </el-pagination>
  71. </div>
  72. </template>
  73. <script>
  74. import { dataBaseInterface } from '@/api/api.js';
  75. import { chartSetMixin } from '../mixins/chartPublic'
  76. export default {
  77. mixins: [chartSetMixin],
  78. props: {
  79. edbInfoId: {
  80. type: Number
  81. }
  82. },
  83. watch: {
  84. 'edbInfoId': {
  85. handler(n) {
  86. if (n) {
  87. this.page = 1
  88. this.list = []
  89. this.finished = false
  90. this.chartTotal = 0
  91. this.getEDBList()
  92. }
  93. },
  94. immediate: true
  95. }
  96. },
  97. data() {
  98. return {
  99. list: [],
  100. page: 1,
  101. pageSize: 20,
  102. Total: 0,
  103. finished: false,
  104. }
  105. },
  106. methods: {
  107. async getEDBList() {
  108. const res = await dataBaseInterface.edbRelationComputerList({
  109. PageSize: this.pageSize,
  110. CurrentIndex: this.page,
  111. EdbInfoId: this.edbInfoId
  112. })
  113. if (res.Ret !== 200) return
  114. this.list = res.Data ? this.page == 1 ? res.Data.List : [...this.list, ...res.Data.List] : []
  115. this.finished = res.Data ? res.Data.Paging.IsEnd : true
  116. this.Total=res.Data?res.Data.Paging.Totals:0
  117. },
  118. handleCurrentChange(e){
  119. this.page=e
  120. this.getEDBList()
  121. }
  122. },
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .main-box{
  127. margin-top: -30px;
  128. background-color: #fff;
  129. min-height: calc(100vh - 300px);
  130. padding: 30px;
  131. height: 100%;
  132. overflow-y: auto;
  133. }
  134. </style>