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

188 lines
5.6 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
  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 :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" :category-id="categoryId" :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. import tableData from '@/views/archivesManage/managementLibrary/anjuan/table.json'
  70. import jsonData from '@/views/archivesManage/managementLibrary/anjuan/data.json'
  71. export default {
  72. name: 'Juannei',
  73. components: { CollectHeader, ArchivesInfo },
  74. mixins: [
  75. header(),
  76. form({}),
  77. collectionLibraryCrud
  78. ],
  79. props: {
  80. selectedCategory: {
  81. type: Object,
  82. default: function() {
  83. return {}
  84. }
  85. },
  86. isRecycle: {
  87. type: Boolean,
  88. default: false
  89. }
  90. },
  91. data() {
  92. return {
  93. isTitleType: 4,
  94. juanneiDrawer: false,
  95. categoryId: 'CD135F6A77018CE04D4FDB',
  96. arcId: '256E752BC0280618840600',
  97. test: ''
  98. }
  99. },
  100. watch: {
  101. selectedCategory: function(newValue, oldValue) {
  102. },
  103. tableDisplayFields(val) {
  104. this.doLayout()
  105. }
  106. },
  107. created() {
  108. this.tableDisplayFields = tableData.data
  109. this.junneiData = jsonData.data.list.content
  110. },
  111. mounted() {
  112. console.log('nei2', this.selectedCategory.arrangeType)
  113. },
  114. methods: {
  115. getCommonData(type) {
  116. this.getViewTable(type)
  117. },
  118. openFile(data) {
  119. // this.$emit('openFile', '这是来自卷内的通知')
  120. this.$emit('openFile', data)
  121. },
  122. closeDrawer() {
  123. this.juanneiDrawer = false
  124. },
  125. rowKey(row) {
  126. return row.id
  127. },
  128. // table选中加上选中状态
  129. tableRowClassName({ row, rowIndex }) {
  130. // console.log('添加类名', row, rowIndex)
  131. let color = ''
  132. this.selections.forEach(item => {
  133. if (item.id === row.id) {
  134. color = 'rowStyle'
  135. }
  136. })
  137. return color
  138. },
  139. // table - 全选
  140. selectAll(val) {
  141. this.selections = val
  142. },
  143. // table - 双击查看详情
  144. tableDoubleClick(row) {
  145. if (this.timer) {
  146. clearTimeout(this.timer)
  147. }
  148. console.log('tableDoubleClick', row)
  149. this.arcId = row.id
  150. this.$refs.archivesInfo.isHasFile = true
  151. this.$refs.archivesInfo.detailTitle = '卷内详情'
  152. this.$refs.archivesInfo.archivesInfoVisible = true
  153. this.$refs.archivesInfo.archivesTabIndex = 0
  154. // this.$refs.archivesInfo.getDetial(row.id)
  155. },
  156. // table - 当前选中得row
  157. clickRowHandler(row) {
  158. console.log('clickRowHandler', row)
  159. if (this.timer) {
  160. clearTimeout(this.timer)
  161. }
  162. this.timer = setTimeout(() => {
  163. this.openFile('所属卷内' + row.archive_no)
  164. }, 300)
  165. this.selections = this.crud.selections
  166. },
  167. // 触发单选
  168. handleCurrentChange(selection, row) {
  169. console.log('触发单选', row)
  170. this.selections = selection
  171. },
  172. handleSizeChange(size) {
  173. this.page.size = size
  174. this.page.page = 1
  175. this.getViewTable(3)
  176. },
  177. handleCurrentPage(val) {
  178. this.page.page = val
  179. this.getViewTable(3)
  180. }
  181. }
  182. }
  183. </script>
  184. <style lang='scss' scoped>
  185. @import "~@/assets/styles/collect-reorganizi.scss";
  186. </style>