Table.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <div class="patent-table-list-view height_100" v-DivHeight="getDivHeight">
  3. <el-table :data="tableData" border style="width: 100%" header-row-class-name="custom-table-header"
  4. :maxHeight="tableHeight" @sort-change="sortChange" @cell-click="cellClick" :cell-class-name="cellClassName">
  5. <el-table-column label="#" width="60" type="index" align="center">
  6. <template slot-scope="scope">
  7. <div v-if="refresh">
  8. <el-checkbox-group :value="patentNoList" >
  9. <el-checkbox :label="scope.row.patentNo" @change="changeSelect(scope.row)">
  10. <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
  11. </el-checkbox>
  12. </el-checkbox-group>
  13. <!-- <el-checkbox :label="scope.row.patentNo" @change="changeSelect(scope.row)"
  14. :checked="patentNoList.filter(item => { return item == scope.row.patentNo || item == scope.row.appNo }).length > 0">
  15. <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
  16. </el-checkbox> -->
  17. </div>
  18. <div v-else>
  19. <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
  20. </div>
  21. </template>
  22. </el-table-column>
  23. <el-table-column v-for="item in column.filter(item => !item.ifHidden)"
  24. :render-header="$commonJS.renderHeaderMethods" :key="item.value" :prop="item.value" :label="item.name"
  25. sortable="custom" align="center">
  26. <template slot-scope="scope">
  27. <div v-if="['patentNo'].includes(item.value)">
  28. <el-popover placement="right-start" width="500" trigger="hover">
  29. <table class="patent-popover-table">
  30. <tr>
  31. <td>
  32. <div class="patent-abstract-image text-align_center">
  33. <el-image :src="outside?scope.row.pictureGuid:$commonJS.checkViewer(scope.row.pictureGuid)"
  34. :preview-src-list="[outside?scope.row.pictureGuid:$commonJS.checkViewer(scope.row.pictureGuid)]" style="vertical-align:middle;"
  35. :style="{ width: scope.row.imgWidth ? scope.row.imgWidth : '100%', height: scope.row.imgHeight ? scope.row.imgHeight : '100%' }">
  36. <div slot="error" class="image-slot">
  37. <img src="https://www.patentstar.com.cn/img/Common/nopic.jpg" alt="" style="">
  38. </div>
  39. </el-image>
  40. </div>
  41. </td>
  42. <td>
  43. <p v-html="getView(scope.row, 'abstractStr')"></p>
  44. <el-link v-if="haveTranslatedText(scope.row, 'abstractStr')" type="primary" @click.native="handleChange(scope.row, 'abstractStr')">
  45. <span v-if="!scope.row.change2">切换译文</span>
  46. <span v-else>切换原文</span>
  47. </el-link>
  48. </td>
  49. </tr>
  50. </table>
  51. <el-link slot="reference" type="primary" @click="handleClick(scope.row, scope.$index)">
  52. <span v-html="getView(scope.row, item.value, item.type)"></span>
  53. </el-link>
  54. </el-popover>
  55. </div>
  56. <template v-else-if="item.ifPersonal">
  57. <div>
  58. <span v-html="getCustomView(scope.row,item)"></span>
  59. </div>
  60. </template>
  61. <template v-else-if="item.value === 'title'">
  62. <span v-html="getView(scope.row, 'title')"></span>
  63. <br>
  64. <el-link v-if="haveTranslatedText(scope.row, 'title')" type="primary" @click.native="handleChange(scope.row, 'title')">
  65. <span v-if="!scope.row.change">切换译文</span>
  66. <span v-else>切换原文</span>
  67. </el-link>
  68. </template>
  69. <template v-else-if="item.value === 'abstractStr'">
  70. <span v-html="getView(scope.row, 'abstractStr')"></span>
  71. <br>
  72. <el-link v-if="haveTranslatedText(scope.row, 'abstractStr')" type="primary" @click.native="handleChange(scope.row, 'abstractStr')">
  73. <span v-if="!scope.row.change2">切换译文</span>
  74. <span v-else>切换原文</span>
  75. </el-link>
  76. </template>
  77. <!-- 法律状态 -->
  78. <template v-else-if="item.value === 'legalStatus'">
  79. <span v-html="getView(scope.row, 'legalStatus')"></span>
  80. </template>
  81. <!-- 专利状态 -->
  82. <template v-else-if="item.value === 'simpleStatus'">
  83. <span v-html="getView(scope.row, 'simpleStatus')"></span>
  84. </template>
  85. <!-- 专利类型 -->
  86. <template v-else-if="item.value === 'patentType'">
  87. <span v-html="getView(scope.row, 'patentType')"></span>
  88. </template>
  89. <div v-else v-html="getView(scope.row, item.value, item.type)"></div>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. </div>
  94. </template>
  95. <script>
  96. import { projectData, handleData } from '../mixins/index'
  97. import { getTableHeight } from '@/views/components/mixins'
  98. export default {
  99. mixins: [projectData, handleData, getTableHeight],
  100. components: {
  101. },
  102. data() {
  103. return {
  104. }
  105. },
  106. activated() {
  107. },
  108. computed: {
  109. },
  110. created() {
  111. },
  112. mounted() {
  113. // console.log(this.columnList);
  114. },
  115. methods: {
  116. // 排序
  117. sortChange({ column, prop, order }) {
  118. this.$emit('on-sort', { column, prop, order })
  119. },
  120. cellClassName({ row, column, rowIndex, columnIndex }) {
  121. if (this.validationCustomField(column.label)) {
  122. return 'custom-field-cell'
  123. }
  124. },
  125. validationCustomField(label) {
  126. const field = this.column.find(item => item.name === label)
  127. if (field && field.ifPersonal) {
  128. return field
  129. }
  130. return false
  131. },
  132. cellClick(row, column, cell,event){
  133. const field = this.validationCustomField(column.label)
  134. if (field) {
  135. this.$emit('index-setting', row, field)
  136. }
  137. }
  138. },
  139. }
  140. </script>
  141. <style lang="scss">
  142. .patent-popover-table {
  143. tbody,
  144. tr,
  145. td {
  146. height: 100%;
  147. vertical-align: top;
  148. }
  149. p {
  150. padding: 0 !important;
  151. margin: 0 !important;
  152. }
  153. .patent-abstract-image {
  154. padding: 10px;
  155. border: 1px solid #bcc2cc;
  156. border-radius: 4px;
  157. width: 120px;
  158. height: 150px;
  159. line-height: 150px;
  160. img {
  161. width: 100%;
  162. height: 100%;
  163. }
  164. }
  165. }
  166. .patent-table-list-view {
  167. .view-table {
  168. width: 100%;
  169. }
  170. .el-table .cell {
  171. white-space: pre-line !important;
  172. }
  173. .custom-field-cell {
  174. cursor: pointer;
  175. }
  176. }</style>