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

171 lines
5.5 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
  1. <template>
  2. <!-- 移动 -->
  3. <el-dialog class="move-form" append-to-body :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="moveVisible" title="移动">
  4. <span class="dialog-right-top" />
  5. <span class="dialog-left-bottom" />
  6. <div class="setting-dialog">
  7. <div class="move-main">
  8. <div class="move-left">
  9. <el-tree
  10. ref="treeMove"
  11. v-loading="crud.loading"
  12. :data="crud.data"
  13. node-key="id"
  14. :props="defaultProps"
  15. :expand-on-click-node="false"
  16. @node-click="handleMoveNodeClick"
  17. />
  18. </div>
  19. <div class="move-right">
  20. <div style="padding: 10px;">
  21. <el-select v-model="query.status" placeholder="选择状态" style="width: 100px;" :disabled="selectedCategoryMove && selectedCategoryMove.arrangeType === 1">
  22. <el-option
  23. v-for="item in options"
  24. :key="item.value"
  25. :label="item.label"
  26. :value="item.value"
  27. />
  28. </el-select>
  29. <el-input v-model="query.keyWord" placeholder="输入题名或档号搜索" style="width: 200px;" />
  30. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search">搜索</el-button>
  31. </div>
  32. <div class="raido-main">
  33. <!-- @select="handleSelect"
  34. @selection-change="selectionChangeHandler"
  35. @row-click="clickRowHandler" -->
  36. <el-table
  37. ref="table"
  38. v-loading="crud.loading"
  39. lazy
  40. :show-header="false"
  41. :data="tableData"
  42. :row-key="getRowKey"
  43. :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
  44. highlight-current-row
  45. >
  46. <el-table-column type="selection" align="center" width="55" />
  47. <el-table-column prop="status" label="状态" />
  48. <el-table-column :show-overflow-tooltip="true" prop="scopeName" label="名称" />
  49. </el-table>
  50. </div>
  51. <el-pagination
  52. :current-page="currentPage"
  53. :page-sizes="[10, 20, 30, 50]"
  54. :page-size="10"
  55. layout="total, sizes, prev, pager, next, jumper"
  56. :total="30"
  57. @size-change="handleSizeChange"
  58. @current-change="handleCurrentChange"
  59. />
  60. </div>
  61. </div>
  62. <div slot="footer" class="dialog-footer">
  63. <el-button type="text" @click="formVisible = false">取消</el-button>
  64. <el-button type="primary" @click="formVisible = false">确定</el-button>
  65. </div>
  66. </div>
  67. </el-dialog>
  68. </template>
  69. <script>
  70. import { preLibraryCrud } from '../mixins/index'
  71. import CRUD, { presenter, header, crud } from '@crud/crud'
  72. import Vue from 'vue'
  73. export default {
  74. name: 'MoveFile',
  75. components: { },
  76. cruds() {
  77. return [
  78. CRUD({
  79. title: '移动', url: 'api/category/menu',
  80. crudMethod: {}, sort: []
  81. })
  82. ]
  83. },
  84. mixins: [presenter(), header(), crud(), preLibraryCrud],
  85. data() {
  86. return {
  87. selectedCategoryMove: {},
  88. options: [
  89. {
  90. value: 1,
  91. label: '已整理'
  92. },
  93. {
  94. value: 2,
  95. label: '未整理'
  96. }
  97. ],
  98. query: {
  99. status: '',
  100. keyWord: ''
  101. },
  102. moveVisible: false,
  103. tableData: [],
  104. defaultProps: { children: 'children', label: 'cnName' },
  105. currentPage: 1
  106. }
  107. },
  108. created() {
  109. },
  110. methods: {
  111. getRowKey(row) {
  112. return row.id
  113. },
  114. [CRUD.HOOK.afterRefresh]() {
  115. this.crud.data = this.filterData(this.crud.data)
  116. this.$nextTick(() => {
  117. if (this.$refs.treeMove) {
  118. let currentKey
  119. if (this.crud.data[0].isType === 1) {
  120. currentKey = this.findNode(this.crud.data[0].children, (node) => {
  121. return node.isType !== 1
  122. })
  123. } else {
  124. currentKey = this.crud.data[0]
  125. }
  126. // 设置某个节点的当前选中状态
  127. this.$refs.treeMove.setCurrentKey(currentKey.id)
  128. this.$nextTick(() => {
  129. // 设置某个节点的父级展开
  130. const selectedKey = this.$refs.treeMove.getCurrentNode()
  131. if (this.$refs.treeMove.getNode(selectedKey) && this.$refs.treeMove.getNode(selectedKey).parent) {
  132. this.expandParents(this.$refs.treeMove.getNode(selectedKey).parent)
  133. }
  134. // 选中节点的门类详情
  135. this.handleMoveNodeClick(selectedKey)
  136. })
  137. }
  138. })
  139. },
  140. // 选中门类后,设置门类详情数据
  141. handleMoveNodeClick(val) {
  142. if (val) {
  143. this.selectedCategoryMove = val
  144. if (val.pid !== '0') {
  145. Vue.set(this.selectedCategoryMove, 'parentName', this.$refs.treeMove.getNode(val.pid).data.cnName)
  146. }
  147. }
  148. },
  149. handleClose(done) {
  150. this.moveVisible = false
  151. done()
  152. },
  153. handleSizeChange(val) {
  154. console.log(`每页 ${val}`)
  155. },
  156. handleCurrentChange(val) {
  157. console.log(`当前页: ${val}`)
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. @import "~@/assets/styles/prearchive-library.scss";
  164. .el-pagination{
  165. padding-right: 5px;
  166. margin: 25px 0 !important;
  167. }
  168. </style>