阅行客电子档案
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.

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