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

239 lines
9.2 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
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. import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/archivesManage/library'
  2. import { crud } from '@crud/crud'
  3. export const manageLibraryCrud = {
  4. mixins: [crud()],
  5. // 组件共用属性
  6. data() {
  7. return {
  8. getTableDisplayFieldsLoading: false,
  9. tableDisplayFields: [],
  10. projectData: [],
  11. anjuanData: [],
  12. junneiData: [],
  13. fileData: [],
  14. arrySort: [],
  15. page: {
  16. page: 1,
  17. size: 10,
  18. total: 0
  19. },
  20. timer: null,
  21. query: {
  22. search: null,
  23. project_class: null,
  24. archive_ctg_no: null
  25. },
  26. classifyTree: [],
  27. classifyLoading: false,
  28. parentsId: null
  29. }
  30. },
  31. // 组件挂载时的共用方法
  32. mounted() {
  33. },
  34. // 组件共用方法
  35. methods: {
  36. // 缓存用户对于固定栏操作习惯
  37. statusBarChecked(val) {
  38. this.fixedStatusBar = val
  39. localStorage.setItem('statusBarFixedType', val)
  40. },
  41. handleSearch(categoryLevel) {
  42. console.log('selectStatus', this.selectStatus)
  43. this.parentsData.$refs.classifyTree.setCurrentKey(null)
  44. this.smartQuery = {
  45. 'retention': null,
  46. 'security_class': null,
  47. 'doc_type': null,
  48. 'medium_type': null,
  49. 'archive_year': null,
  50. 'fonds_no': null
  51. }
  52. // 2 项目 3 案卷 /文件 4 卷内 6 文件
  53. if (this.isTitleType === 2) {
  54. this.parentsId = null
  55. this.$parent.getTableDisplayFieldsLoading = true
  56. } else if (this.isTitleType === 3) {
  57. if (this.selectedCategory.arrangeType === 1) {
  58. this.parentsId = null
  59. } else {
  60. if (this.activeIndex === 1) {
  61. this.parentsId = null
  62. } else {
  63. this.parentsId = this.parentsData.parentsProjectId
  64. }
  65. }
  66. this.$parent.getTableDisplayFieldsLoading = true
  67. } else if (this.isTitleType === 4) {
  68. // 卷内
  69. this.$parent.$parent.getTableDisplayFieldsLoading = true
  70. this.parentsId = this.parentsData.parentsAnjuanId
  71. } else if (this.isTitleType === 6) {
  72. // 原文
  73. if (this.selectedCategory.arrangeType === 1) {
  74. this.parentsId = this.parentsData.parentsAnjuanId
  75. this.$parent.getTableDisplayFieldsLoading = true
  76. } else {
  77. this.$parent.$parent.getTableDisplayFieldsLoading = true
  78. if (this.parentsData.isTabFile) {
  79. this.parentsId = this.parentsData.parentsAnjuanId
  80. } else {
  81. this.parentsId = this.parentsData.parentsJuanneiId
  82. }
  83. }
  84. }
  85. setTimeout(() => {
  86. this.getViewTable(categoryLevel, this.parentsId, 'search')
  87. }, 200)
  88. },
  89. getViewTable(categoryLevel, parentsId, type) {
  90. this.getTableDisplayFieldsLoading = true
  91. this.tableDisplayFields = []
  92. FetchInitCategoryViewTable({ categoryId: this.selectedCategory.id, categoryLevel: categoryLevel }).then((res) => {
  93. if (res) {
  94. this.arrySort = []
  95. this.tableDisplayFields = res
  96. const orderSortArry = this.tableDisplayFields.filter(item => item.displayOrder).sort((a, b) => a.displayOrder - b.displayOrder)
  97. orderSortArry.forEach(item => {
  98. if (item.displayOrderBy) {
  99. this.arrySort.push(item.fieldName + ',' + item.displayOrderBy)
  100. }
  101. })
  102. this.$nextTick(() => {
  103. this.getViewTableList(categoryLevel, parentsId, type)
  104. })
  105. }
  106. })
  107. },
  108. getViewTableList(categoryLevel, parentsId, type) {
  109. const params = {
  110. 'parentId': parentsId,
  111. 'categoryId': this.selectedCategory.id,
  112. 'categoryLevel': categoryLevel,
  113. 'isdel': this.parentsData.isdel,
  114. 'checkTypes': this.selectStatus && this.selectStatus.length !== 0 ? this.selectStatus.join(',') : null,
  115. 'search': this.query.search,
  116. 'retention': this.smartQuery.retention,
  117. 'security_class': this.smartQuery.security_class,
  118. 'medium_type': this.smartQuery.medium_type,
  119. 'doc_type': this.smartQuery.doc_type,
  120. 'archive_year': this.smartQuery.archive_year,
  121. 'fonds_no': this.smartQuery.fonds_no,
  122. 'project_class': this.query.project_class,
  123. 'archive_ctg_no': this.query.archive_ctg_no,
  124. 'page': this.page.page - 1,
  125. 'size': this.page.size,
  126. 'sort': this.arrySort
  127. }
  128. FetchInitCategoryView(params).then((res) => {
  129. if (res.code !== 500) {
  130. if (categoryLevel === 1) {
  131. // 项目
  132. const projectObj = this.parentsData.$refs.projectEle
  133. this.projectData = res.list.content
  134. this.page.total = res.list.totalElements
  135. this.yearData = res.yearGroup
  136. if (this.yearData && type !== 'quickFilter') {
  137. this.$emit('myYearEvent', this.yearData)
  138. }
  139. if (type === 'search') {
  140. projectObj.projectData = res.list.content
  141. projectObj.page.total = res.list.totalElements
  142. projectObj.getTableDisplayFieldsLoading = false
  143. }
  144. } else if (categoryLevel === 2) {
  145. // 案卷
  146. const anjuanObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
  147. this.anjuanData = res.list.content
  148. this.page.total = res.list.totalElements
  149. this.yearData = res.yearGroup
  150. if (this.yearData && type !== 'quickFilter') {
  151. this.$parent.$parent.$emit('myYearEvent', this.yearData)
  152. }
  153. // 搜索/新增/编辑 非 案卷是主页的时候
  154. if (type === 'search') {
  155. anjuanObj.anjuanData = res.list.content
  156. anjuanObj.page.total = res.list.totalElements
  157. anjuanObj.getTableDisplayFieldsLoading = false
  158. }
  159. } else if (categoryLevel === 3) {
  160. if (this.isTitleType === 3) {
  161. // 案卷下的未整理 / 文件为主页时
  162. const wjObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
  163. this.anjuanData = res.list.content
  164. this.page.total = res.list.totalElements
  165. this.yearData = res.yearGroup
  166. if (this.yearData && type !== 'quickFilter') {
  167. this.$parent.$parent.$emit('myYearEvent', this.yearData)
  168. }
  169. if (type === 'search') {
  170. wjObj.anjuanData = res.list.content
  171. wjObj.page.total = res.list.totalElements
  172. wjObj.getTableDisplayFieldsLoading = false
  173. }
  174. } else {
  175. // 卷内
  176. this.junneiData = res.list.content
  177. this.page.total = res.list.totalElements
  178. if (type === 'search') {
  179. this.parentsData.$refs.juanneiEle.junneiData = res.list.content
  180. this.parentsData.$refs.juanneiEle.page.total = res.list.totalElements
  181. this.parentsData.$refs.juanneiEle.getTableDisplayFieldsLoading = false
  182. }
  183. }
  184. } else {
  185. // 原文
  186. this.fileData = res.list.content
  187. this.page.total = res.list.totalElements
  188. if (type === 'search') {
  189. this.parentsData.$refs.fileEle.fileData = res.list.content
  190. this.parentsData.$refs.fileEle.page.total = res.list.totalElements
  191. this.parentsData.$refs.fileEle.getTableDisplayFieldsLoading = false
  192. }
  193. }
  194. }
  195. this.getTableDisplayFieldsLoading = false
  196. this.crud.selections = []
  197. if (categoryLevel === 3) {
  198. // 按件
  199. if (this.isTitleType === 3) {
  200. const wjObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
  201. wjObj.selections = []
  202. wjObj.$refs.table.clearSelection() // 清空选中
  203. wjObj.$refs.table.setCurrentRow(-1) // 清除高亮
  204. } else {
  205. const juanneiObj = this.parentsData.$refs.juanneiEle
  206. juanneiObj.selections = []
  207. juanneiObj.$refs.table.clearSelection()
  208. juanneiObj.$refs.table.setCurrentRow(-1)
  209. }
  210. } else if (categoryLevel === 2) {
  211. // 按卷
  212. const anjuanObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
  213. anjuanObj.selections = []
  214. anjuanObj.$refs.table.clearSelection()
  215. anjuanObj.$refs.table.setCurrentRow(-1)
  216. } else if (categoryLevel === 1) {
  217. // 项目
  218. const projectObj = this.parentsData.$refs.projectEle
  219. projectObj.selections = []
  220. projectObj.$refs.table.clearSelection()
  221. projectObj.$refs.table.setCurrentRow(-1)
  222. } else {
  223. const fileObj = this.parentsData.$refs.fileEle
  224. fileObj.selections = []
  225. fileObj.$refs.table.clearSelection()
  226. fileObj.$refs.table.setCurrentRow(-1)
  227. }
  228. })
  229. },
  230. /* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
  231. doLayout() {
  232. this.$nextTick(() => {
  233. this.$refs.table.doLayout()
  234. })
  235. }
  236. }
  237. }