dataAssociateComputeData.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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="操作" key="Copy" align="center" width="110">
  50. <template slot-scope="scope">
  51. <span class="editsty" @click="copyCode(scope.row)">
  52. <i class="el-icon-document-copy" />&nbsp;复制数据</span
  53. >
  54. <span class="editsty" @click="viewTarget(scope.row)">查看数据</span>
  55. </template>
  56. </el-table-column>
  57. <div slot="empty">
  58. <tableNoData text="暂无引用的计算指标" size="mini"/>
  59. </div>
  60. </el-table>
  61. <el-pagination
  62. layout="total,prev,pager,next"
  63. background
  64. :current-page="page"
  65. @current-change="handleCurrentChange"
  66. :page-size="pageSize"
  67. :total="Total"
  68. style="float:right;margin-top:20px">
  69. </el-pagination>
  70. </div>
  71. </template>
  72. <script>
  73. import { dataBaseInterface } from '@/api/api.js';
  74. import { chartSetMixin } from '../mixins/chartPublic'
  75. export default {
  76. mixins: [chartSetMixin],
  77. props: {
  78. edbInfoId: {
  79. type: Number
  80. }
  81. },
  82. watch: {
  83. 'edbInfoId': {
  84. handler(n) {
  85. if (n) {
  86. this.page = 1
  87. this.list = []
  88. this.finished = false
  89. this.chartTotal = 0
  90. this.getEDBList()
  91. }
  92. },
  93. immediate: true
  94. }
  95. },
  96. data() {
  97. return {
  98. list: [],
  99. page: 1,
  100. pageSize: 20,
  101. Total: 0,
  102. finished: false,
  103. }
  104. },
  105. methods: {
  106. async getEDBList() {
  107. const res = await dataBaseInterface.edbRelationComputerList({
  108. PageSize: this.pageSize,
  109. CurrentIndex: this.page,
  110. EdbInfoId: this.edbInfoId
  111. })
  112. if (res.Ret !== 200) return
  113. this.list = res.Data ? this.page == 1 ? res.Data.List : [...this.list, ...res.Data.List] : []
  114. this.finished = res.Data ? res.Data.Paging.IsEnd : true
  115. this.Total=res.Data?res.Data.Paging.Totals:0
  116. },
  117. handleCurrentChange(e){
  118. this.page=e
  119. this.getEDBList()
  120. }
  121. },
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .main-box{
  126. margin-top: -30px;
  127. background-color: #fff;
  128. min-height: calc(100vh - 300px);
  129. padding: 30px;
  130. height: 100%;
  131. overflow-y: auto;
  132. }
  133. </style>