【前端】智能库房综合管理系统前端项目
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.

802 lines
28 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
  1. <!-- eslint-disable no-return-assign -->
  2. <template>
  3. <div class="app-container">
  4. <!-- 门类列表 -->
  5. <el-row class="container-main">
  6. <el-col class="curd-in-out" :xs="10" :sm="8" :md="5" :lg="6" :xl="5">
  7. <div :class="['container-left', !isRecycle ? 'left-tree-item' : '' ]">
  8. <span class="right-top-line" />
  9. <span class="left-bottom-line" />
  10. <div class="tree-title">档案门类</div>
  11. <!--档案门类树状结构-->
  12. <div class="tree-scroll">
  13. <el-tree ref="archivesTree" v-loading="crud.loading" :data="crud.data" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current @node-click="handleNodeClick" />
  14. </div>
  15. </div>
  16. <div v-if="!isRecycle" class="container-left left-tree-item">
  17. <span class="right-top-line" />
  18. <span class="left-bottom-line" />
  19. <div class="tree-title">智能分类</div>
  20. <!--智能分类树状结构-->
  21. <!-- @node-click="handleIntellNodeClick" -->
  22. <!-- @check="nodeCheck" -->
  23. <div class="tree-scroll">
  24. <el-tree
  25. ref="smartTree"
  26. v-loading="intellClassifyLoading"
  27. :data="intellClassifyTree"
  28. :props="intellDefaultProps"
  29. node-key="dicName"
  30. :check-strictly="true"
  31. :default-expand-all="true"
  32. :default-checked-keys="defaultCheckedKeys"
  33. :expand-on-click-node="false"
  34. @node-click="handleIntellNodeClick"
  35. >
  36. <template #default="{ node }">
  37. <span>
  38. <el-tooltip v-if="node.data.dicPid === null" class="item" effect="dark" content="点击当前根目录取消所选项" placement="top-start">
  39. <span>{{ node.label }}</span>
  40. </el-tooltip>
  41. <span v-else>{{ node.label }}</span>
  42. <span
  43. v-if="node.checked && node.data.dicPid !== null"
  44. class="el-icon-check"
  45. />
  46. </span>
  47. </template>
  48. </el-tree>
  49. </div>
  50. </div>
  51. </el-col>
  52. <!-- 档案管理列表 -->
  53. <el-col class="archives-right-list" :xs="14" :sm="18" :md="19" :lg="18" :xl="19">
  54. <div v-if="selectedCategory.isType !== 1 && !isRecycle" :class="['archives-top', {'archives-fixed-top': selectedCategory.isType === 2 }]">
  55. <el-button v-if="selectedCategory.isType !== 4" type="primary" class="one-click-delete el-icon-delete" @click="oneClickDeleteHandle">一键删除</el-button>
  56. <el-checkbox v-model="fixedStatusBar" @change="statusBarChecked">隐藏状态栏</el-checkbox>
  57. </div>
  58. <!-- 项目 -->
  59. <archivesProject
  60. v-if="selectedCategory.isType === 2"
  61. ref="project"
  62. :selected-category="selectedCategory"
  63. :smart-query="smartQuery"
  64. @getAjInProjectBtnState="getAjInProjectBtnState"
  65. @getProjectSelections="getProjectSelections"
  66. />
  67. <!-- 案卷 -->
  68. <archivesAnjuan
  69. v-if="( selectedCategory.isType === 2 && selectedCategory.children.length !== 0 ) || selectedCategory.isType === 3 || selectedCategory.isType === 5"
  70. ref="anjuan"
  71. :selected-category="selectedCategory"
  72. :is-project="isProject"
  73. :is-has-project="isHasProject"
  74. :project-selection="projectSelection"
  75. :fixed-status-bar="fixedStatusBar"
  76. :archive-year="archiveYear"
  77. :smart-query="smartQuery"
  78. @getJnInAjBtnState="getJnInAjBtnState"
  79. @getSelections="getSelections"
  80. />
  81. <!-- 卷内 -->
  82. <archivesJuannei
  83. v-if="( selectedCategory.isType === 2 && selectedCategory.children.length !== 0 && selectedCategory.children[0].children.length !==0 ) || ( selectedCategory.isType === 3 && selectedCategory.children.length !==0 ) || selectedCategory.isType === 4"
  84. ref="file"
  85. :is-anjuan="isAnjuan"
  86. :anjuan-selection="anjuanSelection"
  87. :selected-category="selectedCategory"
  88. :fixed-status-bar="fixedStatusBar"
  89. :smart-query="smartQuery"
  90. />
  91. </el-col>
  92. </el-row>
  93. <oneClickDeltModule v-if="isOneClick" ref="oneClickRef" :selected-category="selectedCategory" :intell-classify-tree="intellClassifyTree" />
  94. </div>
  95. </template>
  96. <script>
  97. import { getDicts } from '@/api/archivesConfig/dict'
  98. import archivesProject from './archivesProject/index'
  99. import archivesAnjuan from './archivesAnjuan/index'
  100. import archivesJuannei from './archivesJuannei/index'
  101. import oneClickDeltModule from './oneClickDelete/index'
  102. import crudCategory from '@/api/category/category'
  103. import CRUD, { presenter } from '@crud/crud'
  104. import { archivesCrud } from './mixins/archives'
  105. export default {
  106. name: 'ArchivesList',
  107. components: { archivesProject, archivesAnjuan, archivesJuannei, oneClickDeltModule },
  108. cruds() {
  109. return [
  110. CRUD({
  111. title: '档案', url: 'api/archives-type/menu',
  112. crudMethod: { ...crudCategory }
  113. })
  114. ]
  115. },
  116. provide() {
  117. return {
  118. recycleMain: this
  119. }
  120. },
  121. mixins: [presenter(), archivesCrud],
  122. props: {
  123. isdel: {
  124. type: Boolean,
  125. default: false
  126. },
  127. isRecycle: {
  128. type: Boolean,
  129. default: false
  130. }
  131. },
  132. data() {
  133. return {
  134. intellClassifyTree: [],
  135. defaultProps: {
  136. children: 'children',
  137. label: 'cnName'
  138. },
  139. intellDefaultProps: {
  140. children: 'childMenus',
  141. label: 'dicName'
  142. },
  143. selectedCategory: {},
  144. isAnjuan: true,
  145. isProject: true,
  146. anjuanSelection: {},
  147. projectSelection: {},
  148. intellClassifyLoading: false,
  149. nodeCheckDataArr: [],
  150. fixedStatusBar: false,
  151. archiveYear: null,
  152. smartQuery: {
  153. 'archiveYear': null,
  154. 'department': null,
  155. 'retention': null,
  156. 'securityClass': null,
  157. 'organizationMatter': null,
  158. 'fondsNo': null,
  159. 'recordType': null,
  160. 'mediumType': null
  161. },
  162. treeCurrentNode: null,
  163. nodeClick: false,
  164. isHasProject: null, // 案卷上是否有项目门类
  165. isOneClick: false,
  166. defaultCheckedKeys: []
  167. }
  168. },
  169. watch: {
  170. isdel: function(newValue, oldValue) {
  171. },
  172. isRecycle: function(newValue, oldValue) {
  173. }
  174. },
  175. mounted() {
  176. this.fixedStatusBar = JSON.parse(localStorage.getItem('statusBarFixedType')) === true
  177. },
  178. methods: {
  179. // 缓存用户对于固定栏操作习惯
  180. statusBarChecked(val) {
  181. localStorage.setItem('statusBarFixedType', val)
  182. },
  183. // 逆归实现 获取指定元素
  184. findNode(tree, func) {
  185. for (const node of tree) {
  186. if (func(node)) return node
  187. if (node.children) {
  188. const res = this.findNode(node.children, func)
  189. if (res) return res
  190. }
  191. }
  192. return null
  193. },
  194. // 展开选中的父级
  195. expandParents(node) {
  196. node.expanded = true
  197. if (node.parent) {
  198. this.expandParents(node.parent)
  199. }
  200. },
  201. [CRUD.HOOK.afterRefresh]() {
  202. let currentKey
  203. if (localStorage.getItem('currentArchivesKey')) {
  204. currentKey = JSON.parse(localStorage.getItem('currentArchivesKey'))
  205. // 删除门类节点后
  206. if (this.$refs.archivesTree.getCurrentKey(currentKey.id) == null) {
  207. localStorage.removeItem('currentArchivesKey')
  208. }
  209. // 缓存的门类节点判断
  210. if (currentKey.isType === 1) {
  211. if (currentKey.children.length !== 0) {
  212. currentKey = this.findNode(currentKey.children, (node) => {
  213. return node.isType !== 1
  214. })
  215. }
  216. }
  217. } else {
  218. // 默认
  219. if (this.crud.data[0].isType === 1) {
  220. currentKey = this.findNode(this.crud.data[0].children, (node) => {
  221. return node.isType !== 1
  222. })
  223. } else {
  224. currentKey = this.crud.data[0]
  225. }
  226. }
  227. if (currentKey.id) {
  228. // 设置某个节点的当前选中状态
  229. this.$refs.archivesTree.setCurrentKey(currentKey.id)
  230. this.$nextTick(() => {
  231. // 设置某个节点的父级展开
  232. const selectedKey = this.$refs.archivesTree.getCurrentNode()
  233. if (this.$refs.archivesTree.getNode(selectedKey) && this.$refs.archivesTree.getNode(selectedKey).parent) {
  234. this.expandParents(this.$refs.archivesTree.getNode(selectedKey).parent)
  235. }
  236. // 删除刷新
  237. if (localStorage.getItem('isDelt') === '1') {
  238. if (this.$refs.project) {
  239. this.$refs.project.$refs.table.clearSelection()
  240. }
  241. this.clearAnjuan()
  242. this.clearFile()
  243. } else if (localStorage.getItem('isDelt') === '2') {
  244. if (this.$refs.project) {
  245. this.$refs.project.selections = this.$refs.project.$refs.table.selection
  246. }
  247. if (this.$refs.anjuan) {
  248. this.$refs.anjuan.$refs.table.clearSelection()
  249. }
  250. this.clearFile()
  251. } else if (localStorage.getItem('isDelt') === '3') {
  252. if (this.$refs.anjuan) {
  253. this.$refs.anjuan.selections = this.$refs.anjuan.$refs.table.selection
  254. }
  255. if (this.$refs.file) {
  256. this.$refs.file.$refs.table.clearSelection()
  257. }
  258. }
  259. // 选中节点的门类详情
  260. this.handleNodeClick(selectedKey)
  261. this.isOneClick = true
  262. localStorage.removeItem('noClick')
  263. })
  264. }
  265. this.getIntellClassify()
  266. },
  267. getIntellClassify() {
  268. getDicts().then(data => {
  269. if (data) {
  270. this.intellClassifyTree = data.filter(item => {
  271. item.checked = false
  272. return item.dicCode === 'Search_MJ' || item.dicCode === 'Search_BGQX' || item.dicCode === 'WZ' || item.dicCode === 'ZT' || item.dicCode === 'QZH'
  273. })
  274. this.intellClassifyTree.forEach(item => {
  275. item.disabled = item.dicPid === null
  276. })
  277. }
  278. })
  279. },
  280. // 选中门类后,设置字典详情数据
  281. handleNodeClick(val) {
  282. if (val) {
  283. if (localStorage.getItem('isForm')) {
  284. localStorage.removeItem('noClick')
  285. } else {
  286. localStorage.setItem('noClick', true)
  287. }
  288. // 初始化智能分类的操作
  289. if (this.$refs.smartTree) {
  290. this.treeCurrentNode = null
  291. // const smartTreeList = this.intellClassifyTree
  292. this.smartQuery = {
  293. 'archiveYear': null,
  294. 'department': null,
  295. 'retention': null,
  296. 'securityClass': null,
  297. 'organizationMatter': null,
  298. 'fondsNo': null,
  299. 'recordType': null,
  300. 'mediumType': null
  301. }
  302. this.nodeCheckDataArr = []
  303. this.$refs.smartTree.setCheckedKeys([])
  304. // smartTreeList.forEach((item, index) => {
  305. // this.$refs.smartTree.store.nodesMap[smartTreeList[index].dicName].expanded = false
  306. // })
  307. }
  308. this.crud.selectionChangeHandler([val])
  309. this.selectedCategory = val
  310. // 判断当前选中的案卷上是否有项目门类,有-新增hide, 无-新增show
  311. if (this.$refs.archivesTree.getNode(this.selectedCategory.id).parent.data.isType === 2) {
  312. this.isHasProject = true
  313. } else {
  314. this.isHasProject = false
  315. }
  316. this.handleTableList()
  317. // 缓存当前的选中的
  318. localStorage.setItem('currentArchivesKey', JSON.stringify(val))
  319. }
  320. },
  321. // 判断案卷内的卷内-新增btn-状态 中转站
  322. getJnInAjBtnState(data) {
  323. this.isAnjuan = data
  324. },
  325. getAjInProjectBtnState(data) {
  326. this.isProject = data
  327. },
  328. // 项目内操作
  329. getProjectSelections(data, selectData) {
  330. this.smartQuery = {
  331. 'archiveYear': null,
  332. 'department': null,
  333. 'retention': null,
  334. 'securityClass': null,
  335. 'organizationMatter': null,
  336. 'fondsNo': null,
  337. 'recordType': null,
  338. 'mediumType': null
  339. }
  340. if ((selectData && selectData.length > 1) || (selectData && selectData.length === 0)) {
  341. this.isProject = true
  342. this.isAnjuan = true
  343. this.projectSelection = {}
  344. this.$nextTick(() => {
  345. if (this.$refs.anjuan) {
  346. this.$refs.anjuan.selections = []
  347. this.$refs.anjuan.$refs.table.clearSelection()
  348. this.clearAnjuan()
  349. if (this.$refs.file) {
  350. this.$refs.file.selections = []
  351. this.$refs.file.$refs.table.clearSelection()
  352. this.clearFile()
  353. }
  354. }
  355. })
  356. } else if (selectData && selectData.length === 1) {
  357. this.projectSelection = selectData[0]
  358. this.$nextTick(() => {
  359. if (this.$refs.anjuan) {
  360. this.$refs.anjuan.$refs.table.clearSelection()
  361. this.$refs.anjuan.getTableList()
  362. if (this.$refs.file) {
  363. this.$refs.file.$refs.table.clearSelection()
  364. this.clearFile()
  365. }
  366. }
  367. })
  368. } else {
  369. this.projectSelection = data
  370. this.$nextTick(() => {
  371. if (this.$refs.anjuan) {
  372. this.$refs.anjuan.$refs.table.clearSelection()
  373. this.clearAnjuan()
  374. this.$refs.anjuan.getTableList()
  375. if (this.$refs.file) {
  376. this.$refs.file.$refs.table.clearSelection()
  377. this.clearFile()
  378. }
  379. }
  380. })
  381. }
  382. },
  383. // 案卷内操作
  384. getSelections(data, selectData) {
  385. this.smartQuery = {
  386. 'archiveYear': null,
  387. 'department': null,
  388. 'retention': null,
  389. 'securityClass': null,
  390. 'organizationMatter': null,
  391. 'fondsNo': null,
  392. 'recordType': null,
  393. 'mediumType': null
  394. }
  395. if ((selectData && selectData.length > 1) || (selectData && selectData.length === 0)) {
  396. this.isAnjuan = true
  397. this.anjuanSelection = {}
  398. this.$nextTick(() => {
  399. if (this.$refs.file) {
  400. this.$refs.file.selections = []
  401. this.$refs.file.$refs.table.clearSelection()
  402. this.clearFile()
  403. }
  404. })
  405. } else if (selectData && selectData.length === 1) {
  406. this.anjuanSelection = selectData[0]
  407. this.$nextTick(() => {
  408. if (this.$refs.file) {
  409. this.$refs.file.$refs.table.clearSelection()
  410. this.$refs.file.getTableList()
  411. }
  412. })
  413. } else {
  414. this.anjuanSelection = data
  415. this.$nextTick(() => {
  416. if (this.$refs.file) {
  417. this.$refs.file.$refs.table.clearSelection()
  418. this.$refs.file.getTableList()
  419. }
  420. })
  421. }
  422. // 已装盒得案卷,不可新增案卷
  423. if (this.anjuanSelection.case_no) {
  424. this.isAnjuan = true
  425. }
  426. },
  427. // 智能分类获取年度
  428. getYear(obj) {
  429. if (this.$refs.smartTree) {
  430. this.intellClassifyLoading = true
  431. setTimeout(() => {
  432. if (this.intellClassifyTree[0].dicName === '年度') {
  433. this.intellClassifyTree = this.intellClassifyTree.slice(1)
  434. }
  435. if (this.$refs[obj].yearGroup.length !== 0) {
  436. const newYearArr = this.$refs[obj].yearGroup.map((item, index) => {
  437. const json = {}
  438. json.id = index + 1
  439. json.dicName = item
  440. json.childMenus = []
  441. json.dicPid = 0
  442. return json
  443. })
  444. this.intellClassifyTree.unshift({ id: 0, dicName: '年度', dicPid: null, dicCode: 'Search_year', disabled: true, childMenus: newYearArr })
  445. console.log(this.intellClassifyTree)
  446. }
  447. this.intellClassifyLoading = false
  448. }, 1000)
  449. }
  450. },
  451. unique(arr) {
  452. return Array.from(new Set(arr))
  453. },
  454. // 递归函数,取消选中指定节点下的所有子节点
  455. uncheckChildren(node) {
  456. if (node.childNodes && node.childNodes.length > 0) {
  457. for (const child of node.childNodes) {
  458. const index = this.nodeCheckDataArr.findIndex(item => item.data.dicName === child.data.dicName)
  459. if (index !== -1) {
  460. this.nodeCheckDataArr.splice(index, 1)
  461. }
  462. this.uncheckChildren(child)
  463. }
  464. switch (node.data.dicCode) {
  465. case 'Search_year':
  466. this.smartQuery.archiveYear = null
  467. break
  468. case 'Search_BM':
  469. this.smartQuery.department = null
  470. break
  471. case 'Search_BGQX':
  472. this.smartQuery.retention = null
  473. break
  474. case 'Search_MJ':
  475. this.smartQuery.securityClass = null
  476. break
  477. case 'WZ':
  478. this.smartQuery.recordType = null
  479. break
  480. case 'ZT':
  481. this.smartQuery.mediumType = null
  482. break
  483. case 'QZH':
  484. this.smartQuery.fondsNo = null
  485. break
  486. default:
  487. this.smartQuery.organizationMatter = null
  488. }
  489. this.handleTableList()
  490. }
  491. },
  492. // 智能分类
  493. handleIntellNodeClick(data, node, ele) {
  494. console.log(node)
  495. if (!this.nodeCheckDataArr.includes(node)) {
  496. this.nodeCheckDataArr.push(node)
  497. }
  498. const oldItemIndex = this.nodeCheckDataArr.findIndex(item => item.data.dicName === node.data.dicName)
  499. if (oldItemIndex !== -1) {
  500. this.uncheckChildren(node)
  501. // this.nodeCheckDataArr.splice(oldItemIndex, 1)
  502. } else {
  503. this.nodeCheckDataArr.push(node)
  504. }
  505. const parentDicName = node.parent.data.dicName
  506. this.nodeCheckDataArr = this.nodeCheckDataArr.filter(item => item.parent.data.dicName !== parentDicName)
  507. this.nodeCheckDataArr.push(node)
  508. const ids = Array.from(new Set(this.nodeCheckDataArr.map(item => item.data.dicName)))
  509. this.$refs.smartTree.setCheckedKeys(ids)
  510. if (data) {
  511. if (node.childNodes.length === 0) {
  512. if (this.$refs.project) {
  513. this.$refs.project.$refs.table.clearSelection()
  514. this.clearProject()
  515. }
  516. if (this.$refs.anjuan) {
  517. this.$refs.anjuan.$refs.table.clearSelection()
  518. this.clearAnjuan()
  519. }
  520. if (this.$refs.file) {
  521. this.$refs.file.$refs.table.clearSelection()
  522. this.clearFile()
  523. }
  524. const selectedKey = this.$refs.smartTree.getCurrentNode()
  525. const selectedParentVal = this.$refs.smartTree.getNode(selectedKey).parent.data.dicCode
  526. this.treeCurrentNode = ele.$el
  527. // this.smartQuery = {
  528. // 'archiveYear': null,
  529. // 'department': null,
  530. // 'retention': null,
  531. // 'securityClass': null,
  532. // 'organizationMatter': null,
  533. // 'fondsNo': null,
  534. // 'recordType': null,
  535. // 'mediumType': null
  536. // }
  537. // if (ele.$el.classList.contains('is-current')) {
  538. // this.treeCurrentNode.classList.remove('is-current')
  539. // } else {
  540. // this.treeCurrentNode.classList.add('is-current')
  541. switch (selectedParentVal) {
  542. case 'Search_year':
  543. if (selectedKey.dicCode !== 'Search_year') {
  544. this.smartQuery.archiveYear = selectedKey.dicName
  545. }
  546. break
  547. case 'Search_BM':
  548. if (selectedKey.dicCode !== 'Search_BM') {
  549. this.smartQuery.department = selectedKey.dicName
  550. }
  551. break
  552. case 'Search_BGQX':
  553. if (selectedKey.dicCode !== 'Search_BGQX') {
  554. this.smartQuery.retention = selectedKey.dicName
  555. }
  556. break
  557. case 'Search_MJ':
  558. if (selectedKey.dicCode !== 'Search_MJ') {
  559. this.smartQuery.securityClass = selectedKey.dicName
  560. }
  561. break
  562. case 'WZ':
  563. if (selectedKey.dicCode !== 'WZ') {
  564. this.smartQuery.recordType = selectedKey.dicName
  565. }
  566. break
  567. case 'ZT':
  568. if (selectedKey.dicCode !== 'ZT') {
  569. this.smartQuery.mediumType = selectedKey.dicName
  570. }
  571. break
  572. case 'QZH':
  573. if (selectedKey.dicCode !== 'QZH') {
  574. this.smartQuery.fondsNo = selectedKey.dicName
  575. }
  576. break
  577. default:
  578. if (selectedKey.dicCode !== 'Search_JGWT') {
  579. this.smartQuery.organizationMatter = selectedKey.dicName
  580. }
  581. }
  582. this.handleTableList()
  583. // }
  584. }
  585. }
  586. },
  587. // 获取档案list
  588. handleTableList() {
  589. // 门类菜单切换时案卷/卷内'新增'btn不可操作
  590. localStorage.removeItem('isForm')
  591. localStorage.removeItem('isDelt')
  592. this.isProject = true
  593. this.isAnjuan = true
  594. if (this.selectedCategory.isType === 2) {
  595. this.$nextTick(() => {
  596. if (this.$refs.anjuan) {
  597. if (localStorage.getItem('noClick')) {
  598. this.$refs.anjuan.$refs.table.clearSelection()
  599. this.clearAnjuan()
  600. }
  601. }
  602. if (this.$refs.file) {
  603. if (localStorage.getItem('noClick')) {
  604. this.$refs.file.$refs.table.clearSelection()
  605. this.clearFile()
  606. }
  607. }
  608. this.$refs.project.getTableDisplayFields(0)
  609. if (this.selectedCategory.children.length !== 0) {
  610. if (this.$refs.anjuan) {
  611. this.$refs.anjuan.getTableDisplayFields(1)
  612. }
  613. if (this.$refs.file) {
  614. this.$refs.file.getTableDisplayFields(2)
  615. }
  616. }
  617. setTimeout(() => {
  618. this.$refs.project.getTableList()
  619. if (this.$refs.project.$refs.table.selection.length !== 0) {
  620. this.$refs.project.selections = this.$refs.project.$refs.table.selection
  621. this.$refs.anjuan.getTableList()
  622. this.isProject = false
  623. } else {
  624. this.$refs.anjuan.$refs.table.clearSelection()
  625. }
  626. if (this.$refs.anjuan.$refs.table.selection.length !== 0) {
  627. this.$refs.anjuan.selections = this.$refs.anjuan.$refs.table.selection
  628. this.$refs.file.getTableList()
  629. if (this.$refs.file.$refs.table.selection.length !== 0) {
  630. this.$refs.file.selections = this.$refs.file.$refs.table.selection
  631. }
  632. this.isAnjuan = false
  633. } else {
  634. this.clearAnjuan()
  635. this.clearFile()
  636. // this.$refs.anjuan.anjuanData = []
  637. // this.$refs.anjuan.anjuanTableHeight = ''
  638. // this.$refs.file.junneiData = []
  639. // this.$refs.file.juanneiTableHeight = ''
  640. }
  641. }, 500)
  642. if (!this.treeCurrentNode) {
  643. this.getYear('project')
  644. }
  645. })
  646. } else if (this.selectedCategory.isType === 3) {
  647. this.$nextTick(() => {
  648. if (this.$refs.anjuan) {
  649. if (localStorage.getItem('noClick')) {
  650. this.$refs.anjuan.$refs.table.clearSelection()
  651. this.clearAnjuan()
  652. }
  653. }
  654. if (this.$refs.file) {
  655. if (localStorage.getItem('noClick')) {
  656. this.$refs.file.$refs.table.clearSelection()
  657. this.clearFile()
  658. }
  659. }
  660. this.$refs.anjuan.getTableDisplayFields(1)
  661. if (this.selectedCategory.children.length !== 0) {
  662. if (this.$refs.file) {
  663. this.$refs.file.getTableDisplayFields(2)
  664. }
  665. }
  666. setTimeout(() => {
  667. this.$refs.anjuan.getTableList()
  668. if (this.$refs.anjuan.$refs.table.selection.length !== 0) {
  669. this.$refs.anjuan.selections = this.$refs.anjuan.$refs.table.selection
  670. this.$refs.file.getTableList()
  671. if (this.$refs.file.$refs.table.selection.length !== 0) {
  672. this.$refs.file.selections = this.$refs.file.$refs.table.selection
  673. }
  674. this.isAnjuan = false
  675. } else {
  676. // this.$refs.file.junneiData = []
  677. // this.$refs.file.juanneiTableHeight = ''
  678. this.clearFile()
  679. }
  680. }, 500)
  681. if (!this.treeCurrentNode) {
  682. this.getYear('anjuan')
  683. }
  684. })
  685. } else if (this.selectedCategory.isType === 4) {
  686. this.$nextTick(() => {
  687. if (this.$refs.file) {
  688. this.$refs.file.$refs.table.clearSelection()
  689. this.clearFile()
  690. }
  691. this.$refs.file.getTableDisplayFields(2)
  692. setTimeout(() => {
  693. this.$refs.file.getTableList()
  694. }, 500)
  695. if (!this.treeCurrentNode) {
  696. this.getYear('file')
  697. }
  698. })
  699. } else if (this.selectedCategory.isType === 5) {
  700. this.$nextTick(() => {
  701. if (localStorage.getItem('noClick')) {
  702. this.$refs.anjuan.$refs.table.clearSelection()
  703. }
  704. this.clearAnjuan()
  705. this.$refs.anjuan.getTableDisplayFields(1)
  706. setTimeout(() => {
  707. this.$refs.anjuan.getTableList()
  708. this.$refs.anjuan.selections = this.$refs.anjuan.$refs.table.selection
  709. }, 500)
  710. if (!this.treeCurrentNode) {
  711. this.getYear('anjuan')
  712. }
  713. })
  714. }
  715. },
  716. clearProject() {
  717. if (this.$refs.project) {
  718. this.$refs.project.projectData = []
  719. this.$refs.project.projectTableHeight = ''
  720. this.$refs.project.page = {
  721. page: 1,
  722. size: 10,
  723. total: 0
  724. }
  725. }
  726. },
  727. clearAnjuan() {
  728. if (this.$refs.anjuan) {
  729. this.$refs.anjuan.anjuanData = []
  730. this.$refs.anjuan.anjuanTableHeight = ''
  731. this.$refs.anjuan.page = {
  732. page: 1,
  733. size: 10,
  734. total: 0
  735. }
  736. }
  737. },
  738. clearFile() {
  739. if (this.$refs.file) {
  740. this.$refs.file.junneiData = []
  741. this.$refs.file.juanneiTableHeight = ''
  742. this.$refs.file.page = {
  743. page: 1,
  744. size: 10,
  745. total: 0
  746. }
  747. }
  748. },
  749. // 一键删除
  750. oneClickDeleteHandle() {
  751. this.$refs.oneClickRef.oneClickVisible = true
  752. }
  753. }
  754. }
  755. </script>
  756. <style lang="scss" scoped>
  757. @import "~@/assets/styles/archives-manage.scss";
  758. .tree-scroll{
  759. height: calc(100vh - 630px);
  760. overflow-y: scroll;
  761. overflow-x: hidden;
  762. }
  763. ::v-deep .el-table th.el-table__cell > .cell {
  764. white-space: pre;
  765. }
  766. .iconfont::before{
  767. margin-right: 6px;
  768. }
  769. .one-click-delete{
  770. padding: 4px 10px;
  771. margin-right: 20px;
  772. &.active{
  773. border-color: #f65163;
  774. background-color: #f65163;
  775. }
  776. ::v-deep span{
  777. display: inline-block;
  778. margin-left: 5px;
  779. }
  780. }
  781. // ::v-deep .el-tree {
  782. // // 不可全选样式
  783. // .el-tree-node {
  784. // .el-checkbox .el-checkbox__inner {
  785. // display: none !important;
  786. // }
  787. // }
  788. // }
  789. </style>