阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

207 lines
6.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <el-drawer
  3. :with-header="false"
  4. :visible.sync="juanneiDrawer"
  5. :modal="false"
  6. :wrapper-closable="false"
  7. :show-close="false"
  8. direction="rtl"
  9. :size="selectedCategory.arrangeType === 2 ? '90%' :'80%'"
  10. >
  11. <CollectHeader ref="collectHeaderRef" :is-title-type="isTitleType" :selected-category="selectedCategory" :selections="selections" :test="test" :is-recycle="isRecycle" />
  12. <div class="collect-table">
  13. <el-table
  14. ref="table"
  15. v-loading="crud.loading || getTableDisplayFieldsLoading"
  16. class="archives-table"
  17. :data="junneiData"
  18. highlight-current-row
  19. style="width: 100%;"
  20. height="calc(100vh - 418px)"
  21. :row-class-name="tableRowClassName"
  22. :row-key="rowKey"
  23. @select-all="selectAll"
  24. @selection-change="crud.selectionChangeHandler"
  25. @row-click="clickRowHandler"
  26. @cell-dblclick="tableDoubleClick"
  27. @select="handleCurrentChange"
  28. >
  29. <el-table-column type="selection" width="55" :reserve-selection="true" align="center" />
  30. <el-table-column type="index" label="序号" width="55" align="center" />
  31. <el-table-column label="原文" prop="child" width="55" align="center">
  32. <template slot-scope="scope">
  33. {{ scope.row.child === '' ? 0 : scope.row.child }}
  34. </template>
  35. </el-table-column>
  36. <el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
  37. <template slot="header">
  38. <el-tooltip
  39. class="item"
  40. effect="dark"
  41. :content="field.fieldCnName"
  42. placement="top-start"
  43. >
  44. <span>{{ field.fieldCnName }}</span>
  45. </el-tooltip>
  46. </template>
  47. <template slot-scope="scope">
  48. {{ scope.row[field.fieldName] }}
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. <!--分页组件-->
  53. <el-pagination
  54. v-if="junneiData.length !== 0"
  55. :current-page="page.page"
  56. :total="page.total"
  57. :page-size="page.size"
  58. :pager-count="5"
  59. layout="total, prev, pager, next, sizes"
  60. @size-change="handleSizeChange"
  61. @current-change="handleCurrentPage"
  62. />
  63. </div>
  64. <!-- 档案详情 -->
  65. <ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" :is-title-type="isTitleType" />
  66. <span class="closed-btn" @click="closeDrawer" />
  67. </el-drawer>
  68. </template>
  69. <script>
  70. import { collectionLibraryCrud } from '../mixins/index'
  71. import { header, form } from '@crud/crud'
  72. import CollectHeader from '../module/collectHeader.vue'
  73. import ArchivesInfo from '../module/archivesInfo/index'
  74. export default {
  75. name: 'Juannei',
  76. components: { CollectHeader, ArchivesInfo },
  77. mixins: [
  78. header(),
  79. form({}),
  80. collectionLibraryCrud
  81. ],
  82. props: {
  83. selectedCategory: {
  84. type: Object,
  85. default: function() {
  86. return {}
  87. }
  88. },
  89. isRecycle: {
  90. type: Boolean,
  91. default: false
  92. },
  93. smartQuery: {
  94. type: Object,
  95. default: function() {
  96. return {}
  97. }
  98. }
  99. },
  100. inject: ['parentsData'],
  101. data() {
  102. return {
  103. isTitleType: 4,
  104. juanneiDrawer: false,
  105. categoryId: '',
  106. arcId: '',
  107. test: '',
  108. selections: [],
  109. parentId: null
  110. }
  111. },
  112. watch: {
  113. selectedCategory: function(newValue, oldValue) {
  114. },
  115. tableDisplayFields(val) {
  116. // this.doLayout()
  117. }
  118. },
  119. created() {
  120. },
  121. mounted() {
  122. },
  123. methods: {
  124. getCommonData(categoryLevel, parentId, type) {
  125. this.getViewTable(categoryLevel, parentId, type)
  126. },
  127. openFile(data, parentId) {
  128. // this.$emit('openFile', '这是来自卷内的通知')
  129. this.$emit('openFile', data, parentId)
  130. },
  131. closeDrawer() {
  132. this.juanneiDrawer = false
  133. this.$parent.parentsAnjuanId = null
  134. },
  135. rowKey(row) {
  136. return row.id
  137. },
  138. // table选中加上选中状态
  139. tableRowClassName({ row, rowIndex }) {
  140. // console.log('添加类名', row, rowIndex)
  141. let color = ''
  142. this.selections.forEach(item => {
  143. if (item.id === row.id) {
  144. color = 'rowStyle'
  145. }
  146. })
  147. return color
  148. },
  149. // table - 全选
  150. selectAll(val) {
  151. this.selections = val
  152. },
  153. // table - 双击查看详情
  154. tableDoubleClick(row) {
  155. if (this.timer) {
  156. clearTimeout(this.timer)
  157. }
  158. this.arcId = row.id
  159. this.$nextTick(() => {
  160. this.$refs.archivesInfo.isHasFile = true
  161. this.$refs.archivesInfo.isFourTest = true
  162. this.$refs.archivesInfo.detailTitle = '卷内详情'
  163. this.$refs.archivesInfo.archivesInfoVisible = true
  164. this.$refs.archivesInfo.archivesTabIndex = 0
  165. this.$refs.archivesInfo.getDetial(3, row.id)
  166. })
  167. },
  168. // table - 当前选中得row
  169. clickRowHandler(row) {
  170. this.parentsData.smartQuery = {
  171. 'retention': null,
  172. 'security_class': null,
  173. 'doc_type': null,
  174. 'medium_type': null,
  175. 'archive_year': null,
  176. 'fonds_no': null
  177. }
  178. if (this.timer) {
  179. clearTimeout(this.timer)
  180. }
  181. this.timer = setTimeout(() => {
  182. this.parentId = row.id
  183. this.openFile('所属卷内:' + row.archive_no, this.parentId)
  184. }, 300)
  185. this.selections = this.crud.selections
  186. },
  187. // 触发单选
  188. handleCurrentChange(selection, row) {
  189. this.selections = selection
  190. },
  191. handleSizeChange(size) {
  192. this.page.size = size
  193. this.page.page = 1
  194. this.getViewTable(3, this.parentsData.parentsAnjuanId)
  195. },
  196. handleCurrentPage(val) {
  197. this.page.page = val
  198. this.getViewTable(3, this.parentsData.parentsAnjuanId)
  199. }
  200. }
  201. }
  202. </script>
  203. <style lang='scss' scoped>
  204. @import "~@/assets/styles/collect-reorganizi.scss";
  205. </style>