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

153 lines
5.3 KiB

  1. <template>
  2. <div class="app-container">
  3. <!-- 门类列表 -->
  4. <div class="container-main">
  5. <div class="elect-cont-left">
  6. <div class="container-left">
  7. <span class="right-top-line" />
  8. <span class="left-bottom-line" />
  9. <!--门类树状结构-->
  10. <div class="tree-scroll">
  11. <el-tree ref="tree" v-loading="crud.loading" :data="treeList" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current :default-expanded-keys="[1]" :default-checked-keys="[1]" @node-click="handleNodeClick">
  12. <span slot-scope="{ node, data }" class="custom-tree-node">
  13. <span v-if="data.isType===1 " class="iconFolder">
  14. {{ data.label }}
  15. </span>
  16. <span v-if="data.isType===2 " class="iconFile">
  17. {{ data.label }}
  18. </span>
  19. </span>
  20. </el-tree>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="elect-cont-right">
  25. <!--工具栏-->
  26. <div class="head-container">
  27. <div class="head-search">
  28. <!-- 搜索 -->
  29. <el-input v-model="query.name" clearable size="small" placeholder="输入部门名称搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
  30. <rrOperation />
  31. </div>
  32. <crudOperation :permission="permission">
  33. <template v-slot:right>
  34. <el-button size="mini">批量成件</el-button>
  35. <el-button size="mini">合并成件</el-button>
  36. <el-button size="mini">移动</el-button>
  37. </template>
  38. </crudOperation>
  39. </div>
  40. <!--表格渲染-->
  41. <div class="container-right">
  42. <span class="right-top-line" />
  43. <span class="left-bottom-line" />
  44. <el-table
  45. ref="table"
  46. v-loading="crud.loading"
  47. lazy
  48. :data="crud.data"
  49. row-key="id"
  50. @select="crud.selectChange"
  51. @select-all="crud.selectAllChange"
  52. @selection-change="crud.selectionChangeHandler"
  53. >
  54. <el-table-column type="selection" align="center" width="55" />
  55. <el-table-column type="index" label="份号" align="center" width="55" />
  56. <el-table-column label="标题" prop="name" :show-overflow-tooltip="true" width="200" />
  57. <el-table-column label="发文字号" prop="number" />
  58. <el-table-column label="成文日期" prop="date" />
  59. <el-table-column label="机构或问题" prop="problem" />
  60. <el-table-column label="公文标识" prop="officialIdent" />
  61. <el-table-column label="文种" prop="recordType" />
  62. <el-table-column label="密级" prop="seClassification" />
  63. <el-table-column label="保管期限" prop="period" />
  64. </el-table>
  65. <!--分页组件-->
  66. <pagination v-if="crud.data.length!==0" />
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import crudCategory from '@/api/category/category'
  74. import CRUD, { presenter, header } from '@crud/crud'
  75. import rrOperation from '@crud/RR.operation'
  76. import crudOperation from '@crud/CRUD.operation'
  77. import dataJson from './data.json'
  78. export default {
  79. name: 'PrearchiveLibrary',
  80. components: { rrOperation, crudOperation },
  81. cruds() {
  82. return [
  83. CRUD({
  84. title: '预归档库', url: 'api/archives-type/menu',
  85. crudMethod: { ...crudCategory },
  86. optShow: {
  87. add: true,
  88. edit: true,
  89. del: true,
  90. download: true,
  91. group: false,
  92. reset: true
  93. }
  94. })
  95. ]
  96. },
  97. mixins: [presenter(), header()],
  98. data() {
  99. return {
  100. permission: {
  101. add: ['admin', 'prearchiveLibrary:add'],
  102. edit: ['admin', 'prearchiveLibrary:edit'],
  103. del: ['admin', 'prearchiveLibrary:del'],
  104. sort: ['admin', 'prearchiveLibrary:sort']
  105. },
  106. treeList: []
  107. }
  108. },
  109. computed: {
  110. },
  111. created() {
  112. this.treeList = dataJson
  113. },
  114. methods: {
  115. // 展开选中的父级
  116. expandParents(node) {
  117. node.expanded = true
  118. if (node.parent) {
  119. this.expandParents(node.parent)
  120. }
  121. },
  122. [CRUD.HOOK.beforeToAdd](crud, form, btn) {
  123. },
  124. [CRUD.HOOK.afterRefresh]() {
  125. let currentKey
  126. if (localStorage.getItem('currentMetaDataKey')) {
  127. currentKey = JSON.parse(localStorage.getItem('currentMetaDataKey'))
  128. } else {
  129. currentKey = this.treeList[0]
  130. }
  131. // 设置某个节点的当前选中状态
  132. this.$refs.tree.setCurrentKey(currentKey.id)
  133. this.$nextTick(() => {
  134. // 设置某个节点的父级展开
  135. const selectedKey = this.$refs.tree.getCurrentNode()
  136. if (this.$refs.tree.getNode(selectedKey) && this.$refs.tree.getNode(selectedKey).parent) {
  137. this.expandParents(this.$refs.tree.getNode(selectedKey).parent)
  138. }
  139. // 选中节点的门类详情
  140. this.handleNodeClick(selectedKey)
  141. })
  142. },
  143. // 选中门类后
  144. handleNodeClick(val) {
  145. }
  146. }
  147. }
  148. </script>
  149. <style lang='scss' scoped>
  150. </style>