南京部队项目
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.

829 lines
29 KiB

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