chartReleationEdbTable.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <el-table
  3. :data="tableData"
  4. ref="tableRef"
  5. highlight-current-row
  6. border
  7. >
  8. <el-table-column type="expand" v-if="![10,11].includes(chartInfo.ChartType)">
  9. <template slot-scope="{row,$index}">
  10. <div class="expand-wrap">
  11. <div class="data-change">
  12. <!-- 数据转换 -->
  13. <el-checkbox v-model="updateData[$index].IsConvert">
  14. {{ $t('EtaChartAddPage.data_transformation') }}
  15. </el-checkbox>
  16. <!-- 乘以/除以/对数 -->
  17. <el-select v-model="updateData[$index].ConvertType">
  18. <el-option :label="$t('EtaChartAddPage.multiply_by')" :value="1"></el-option>
  19. <el-option :label="$t('EtaChartAddPage.divide_by')" :value="2"></el-option>
  20. <el-option :label="$t('EtaChartAddPage.logarithm')" :value="3"></el-option>
  21. </el-select>
  22. <el-input type="number" v-model="updateData[$index].ConvertValue"></el-input>
  23. </div>
  24. <div class="unit-change">
  25. <label>{{ $t('Edb.Detail.e_unit') }}</label>
  26. <el-input v-model="updateData[$index].ConvertUnit"></el-input>
  27. <label>{{ $t('Edb.Detail.e_en_unit') }}</label>
  28. <el-input v-model="updateData[$index].ConvertEnUnit"></el-input>
  29. </div>
  30. <!--柱形图:设置为图表单位-->
  31. <div class="use-change" v-if="chartInfo.ChartType===7">
  32. <el-radio v-model="useUnit" :label="$index">{{ $t('EtaChartAddPage.chart_set_radio') }}</el-radio>
  33. </div>
  34. <div class="confirm-btn">
  35. <el-button type="text" @click="changeTableData($index)">{{ $t('Dialog.confirm_save_btn') }}</el-button>
  36. </div>
  37. </div>
  38. </template>
  39. </el-table-column>
  40. <el-table-column
  41. v-for="item in tableColums"
  42. :key="item.label"
  43. :label="item.label"
  44. :width="item.widthsty"
  45. :min-width="item.minwidthsty"
  46. align="center"
  47. >
  48. <template slot-scope="scope">
  49. <div v-if="item.key === 'EdbName' && [1,4,6,7,11].includes(chartInfo.ChartType)">
  50. <!-- 柱状图用别名 -->
  51. <el-input
  52. v-model="scope.row.EdbAliasName"
  53. :placeholder="$t('OnlineExcelPage.indicator_alias_lbl')"
  54. class="target-other-name"
  55. clearable
  56. />
  57. </div>
  58. <span v-else-if="item.key==='Frequency'">{{ getFrequencyTrans(scope.row.Frequency||'null') }}</span>
  59. <span v-else-if="item.key==='Unit'">{{ getUnitTrans(scope.row.Unit) }}</span>
  60. <span v-else>{{ scope.row[item.key] }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column
  64. :label="$t('Table.column_operations')"
  65. key="Copy"
  66. align="center"
  67. width="140"
  68. >
  69. <template slot-scope="scope" v-if="scope.row.HaveOperaAuth">
  70. <span @click="delTarget(scope.row)" class="deletesty"><!-- 删除 -->{{$t('Table.delete_btn')}}&nbsp;</span>
  71. <span v-permission="permissionBtn.chartLibPermission.chartLib_copyData"
  72. class="editsty" @click="copyCode(scope.row)">
  73. <i class="el-icon-document-copy" />&nbsp;<!-- 复制数据 -->{{$t('Edb.detail_copydata_btn')}}</span
  74. ><br>
  75. <span v-permission="permissionBtn.chartLibPermission.chartLib_viewData"
  76. class="editsty"
  77. @click="viewTarget(scope.row)"
  78. ><!-- 查看数据 -->{{$t('Edb.detail_lookdata_btn')}}</span>
  79. </template>
  80. </el-table-column>
  81. <div slot="empty">
  82. <tableNoData :text="$t('Table.no_edb_msg')" size="mini"/>
  83. </div>
  84. </el-table>
  85. </template>
  86. <script>
  87. export default {
  88. props: {
  89. tableData: {
  90. type: Array,
  91. required:true
  92. },
  93. chartInfo: {
  94. type: Object,
  95. required:true
  96. },
  97. updateData: {
  98. type:Array
  99. }
  100. },
  101. computed:{
  102. tableColums(){
  103. return [
  104. {
  105. label: this.$t('Edb.Detail.e_name'),
  106. key: 'EdbName',
  107. enKey:'EdbNameEn',
  108. inputTip:'点击输入英文指标名称',
  109. minwidthsty: '150px',
  110. },
  111. {
  112. label: this.$t('Edb.Detail.e_id'),
  113. key: 'EdbCode',
  114. widthsty: '120px',
  115. },
  116. {
  117. label: this.$t('Edb.Detail.e_fre'),
  118. key: 'Frequency',
  119. enKey:'FrequencyEn',
  120. minwidthsty: '60px',
  121. },
  122. {
  123. label: this.$t('Edb.Detail.e_unit'),
  124. key: 'Unit',
  125. enKey:'UnitEn',
  126. inputTip:'英文单位',
  127. minwidthsty: '50px',
  128. },
  129. {
  130. label: this.$t('Edb.Detail.e_start_time'),
  131. key: 'StartDate',
  132. minwidthsty: '100px',
  133. },
  134. {
  135. label: this.$t('Edb.Detail.e_latest_date'),
  136. key: 'LatestDate',
  137. minwidthsty: '90px',
  138. },
  139. {
  140. label: this.$t('Edb.Detail.e_latest_value'),
  141. key: 'LatestValue',
  142. minwidthsty: '90px',
  143. },
  144. {
  145. label: this.$t('Edb.Detail.e_recent_time'),
  146. key: 'ModifyTime',
  147. minwidthsty: '100px',
  148. },
  149. {
  150. label: this.$t('Edb.Detail.source'),
  151. key: 'SourceName',
  152. },
  153. ]
  154. }
  155. },
  156. data() {
  157. return {
  158. }
  159. },
  160. mounted(){
  161. },
  162. methods:{
  163. changeTableData(index) {
  164. this.$emit('changeTableData',index)
  165. },
  166. delTarget(row) {
  167. this.$emit('delTarget',row)
  168. },
  169. copyCode(row) {
  170. this.$emit('copyCode',row)
  171. },
  172. viewTarget(row) {
  173. this.$emit('viewTarget',row)
  174. }
  175. },
  176. }
  177. </script>
  178. <style scoped lang='scss'>
  179. </style>