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

425 lines
12 KiB

  1. <template>
  2. <div class="result-main">
  3. <div class="result-left">
  4. <el-collapse v-model="activeNames" @change="handleChange">
  5. <el-collapse-item title="全宗" name="1">
  6. <el-input
  7. v-model="filterFondsText"
  8. class="quick-search"
  9. placeholder="快速检索"
  10. suffix-icon="el-icon-search"
  11. />
  12. <el-tree
  13. ref="tree"
  14. :data="fondsOptions"
  15. show-checkbox
  16. default-expand-all
  17. node-key="id"
  18. :props="{children: 'children', label: 'fondsName'}"
  19. :filter-node-method="filterFondsNode"
  20. @check-change="getFondsCheckedKeys"
  21. />
  22. </el-collapse-item>
  23. <el-collapse-item title="档案门类" name="2">
  24. <el-input
  25. v-model="filterCategoryText"
  26. class="quick-search"
  27. placeholder="快速检索"
  28. suffix-icon="el-icon-search"
  29. />
  30. <el-tree
  31. ref="treeCategory"
  32. :data="categoryOptions"
  33. show-checkbox
  34. default-expand-all
  35. node-key="id"
  36. :props="{children: 'children', label: 'cnName'}"
  37. :filter-node-method="filterCategoryNode"
  38. @check-change="getCategoryCheckedKeys"
  39. />
  40. </el-collapse-item>
  41. <el-collapse-item title="档案分类" name="3">
  42. <el-input
  43. v-model="filterClassifyText"
  44. class="quick-search"
  45. placeholder="快速检索"
  46. suffix-icon="el-icon-search"
  47. />
  48. <el-tree
  49. ref="treeClassify"
  50. :data="classifyOptions"
  51. show-checkbox
  52. default-expand-all
  53. node-key="id"
  54. :props="{children: 'children', label: 'name'}"
  55. :filter-node-method="filterClassifyNode"
  56. @check-change="getClassifyCheckedKeys"
  57. />
  58. </el-collapse-item>
  59. <el-collapse-item title="档案层级" name="4">
  60. <el-input
  61. v-model="filterLevelText"
  62. class="quick-search"
  63. placeholder="快速检索"
  64. suffix-icon="el-icon-search"
  65. />
  66. <el-tree
  67. ref="treeLevel"
  68. :data="levelOptions"
  69. show-checkbox
  70. default-expand-all
  71. node-key="id"
  72. :props="{children: 'children', label: 'label'}"
  73. :filter-node-method="filterLevelNode"
  74. @check-change="getLevelCheckedKeys"
  75. />
  76. </el-collapse-item>
  77. </el-collapse>
  78. </div>
  79. <div class="result-right">
  80. <div class="right-header">
  81. <div class="head-search">
  82. <el-select
  83. v-model="status"
  84. multiple
  85. collapse-tags
  86. placeholder="状态(支持多选)"
  87. >
  88. <el-option
  89. v-for="item in statusOptions"
  90. :key="item.value"
  91. :label="item.label"
  92. :value="item.value"
  93. />
  94. </el-select>
  95. <div class="search-input">
  96. <el-input v-model="keyword" placeholder="请输入检索关键字" class="input-with-select">
  97. <el-button slot="append" icon="el-icon-search">搜索</el-button>
  98. </el-input>
  99. </div>
  100. <span class="change-search">高级搜索</span>
  101. </div>
  102. <div class="search-tip">
  103. 检索 <span>合同</span> 成功获得<i>30</i>条结果
  104. </div>
  105. </div>
  106. <div class="result-list">
  107. <div class="result-item">1</div>
  108. </div>
  109. </div>
  110. </div>
  111. </template>
  112. <script >
  113. import { FetchFondsAll } from '@/api/system/fonds'
  114. import { FetchCategoryMenu } from '@/api/system/category/category'
  115. export default {
  116. name: 'ResultList',
  117. data() {
  118. return {
  119. activeNames: ['1'],
  120. filterFondsText: '',
  121. fondsOptions: [],
  122. filterCategoryText: '',
  123. categoryOptions: [],
  124. filterLevelText: '',
  125. levelOptions: [
  126. {
  127. label: '原文',
  128. value: '4'
  129. },
  130. {
  131. label: '文件',
  132. value: '3'
  133. },
  134. {
  135. label: '案卷',
  136. value: '2'
  137. },
  138. {
  139. label: '项目',
  140. value: '1'
  141. }
  142. ],
  143. filterClassifyText: '',
  144. classifyOptions: [],
  145. statusOptions: [],
  146. status: null,
  147. keyword: ''
  148. }
  149. },
  150. watch: {
  151. filterFondsText(val) {
  152. this.$refs.tree.filter(val)
  153. },
  154. filterCategoryText(val) {
  155. this.$refs.treeCategory.filter(val)
  156. },
  157. filterLevelText(val) {
  158. this.$refs.treeLevel.filter(val)
  159. },
  160. filterClassifyText(val) {
  161. this.$refs.treeClassify.filter(val)
  162. }
  163. },
  164. mounted() {
  165. // 延迟模拟请求数据
  166. setTimeout(() => {
  167. this.getFondsDatas()
  168. this.getCategoryDataTree()
  169. }, 300)
  170. },
  171. methods: {
  172. getFondsDatas() {
  173. FetchFondsAll().then(res => {
  174. this.fondsOptions = res
  175. })
  176. },
  177. filterData(data) {
  178. const result = []
  179. for (const node of data) {
  180. if (node.isType === 2) {
  181. const filteredChildren = node.children.filter(child => child.isType !== 3)
  182. node.children = filteredChildren
  183. result.push(node)
  184. } else if (node.children && node.children.length > 0) {
  185. const filteredChildren = this.filterData(node.children)
  186. result.push(...filteredChildren)
  187. }
  188. }
  189. return result
  190. },
  191. filterArchivesClasses(data, result = []) {
  192. if (data && data.length > 0) {
  193. for (let i = 0; i < data.length; i++) {
  194. const archivesClasses = data[i].archivesClasses
  195. if (archivesClasses && archivesClasses.length > 0) {
  196. result.push(...archivesClasses)
  197. }
  198. this.filterArchivesClasses(data[i].children, result)
  199. }
  200. }
  201. return result
  202. },
  203. getCategoryDataTree() {
  204. FetchCategoryMenu().then(res => {
  205. this.categoryOptions = this.filterData(res)
  206. this.classifyOptions = this.filterArchivesClasses(res)
  207. })
  208. },
  209. handleChange(val) {
  210. console.log(val)
  211. },
  212. filterFondsNode(value, data) {
  213. if (!value) return true
  214. return data.fondsName.indexOf(value) !== -1
  215. },
  216. filterCategoryNode(value, data) {
  217. if (!value) return true
  218. return data.cnName.indexOf(value) !== -1
  219. },
  220. filterLevelNode(value, data) {
  221. if (!value) return true
  222. return data.label.indexOf(value) !== -1
  223. },
  224. filterClassifyNode(value, data) {
  225. if (!value) return true
  226. return data.name.indexOf(value) !== -1
  227. },
  228. getFondsCheckedKeys() {
  229. const checkedKeys = this.$refs.tree.getCheckedNodes()
  230. console.log('fondsKeys', checkedKeys)
  231. },
  232. getCategoryCheckedKeys() {
  233. const checkedKeys = this.$refs.treeCategory.getCheckedNodes()
  234. console.log('categoryKeys', checkedKeys)
  235. },
  236. getClassifyCheckedKeys() {
  237. const checkedKeys = this.$refs.treeClassify.getCheckedNodes()
  238. console.log('classifysKeys', checkedKeys)
  239. },
  240. getLevelCheckedKeys() {
  241. const checkedKeys = this.$refs.treeLevel.getCheckedNodes()
  242. console.log('levelsKeys', checkedKeys)
  243. }
  244. }
  245. }
  246. </script>
  247. <style lang='scss' scoped>
  248. .result-main{
  249. display: flex;
  250. justify-content: space-between;
  251. height: calc(100vh - 140px);
  252. .result-left{
  253. position: relative;
  254. width: 265px;
  255. height: calc(100%);
  256. padding: 20px;
  257. background-color: #fff;
  258. box-shadow: 4px 0px 4px 0px rgba(0,0,0,0.04);
  259. z-index: 9999;
  260. ::v-deep .el-collapse{
  261. border: none;
  262. height: calc(100%);
  263. overflow: hidden;
  264. overflow-y: scroll;
  265. .el-collapse-item__header{
  266. padding-left: 13px;
  267. height: 32px;
  268. background-color: #F3F6FA;
  269. border-radius: 3px 3px 3px 3px;
  270. opacity: 1;
  271. border: 1px solid #CBD1DC;
  272. .el-collapse-item__arrow{
  273. // margin: 0;
  274. // text-align: right;
  275. }
  276. .el-icon-arrow-right:before{
  277. font-family: "iconfont" !important;
  278. font-style: normal;
  279. -webkit-font-smoothing: antialiased;
  280. -moz-osx-font-smoothing: grayscale;
  281. content: "\e629";
  282. font-size: 6px;
  283. color: #545B65;
  284. }
  285. .el-collapse-item__arrow.is-active{
  286. transform: rotate(180deg);
  287. }
  288. }
  289. .el-collapse-item{
  290. margin-bottom: 16px;
  291. .el-collapse-item__wrap{
  292. padding: 12px;
  293. margin-top: -1px;
  294. border: 1px solid #CBD1DC;
  295. // border-top: none;
  296. border-radius: 0 0 3px 3px;
  297. }
  298. .el-collapse-item__content{
  299. padding-bottom: 0;
  300. .quick-search{
  301. margin-bottom: 16px;
  302. }
  303. .el-tree{
  304. max-height: calc(100vh/4 - 25px);
  305. overflow: hidden;
  306. overflow-y: scroll;
  307. .el-tree-node__content {
  308. height: 30px;
  309. }
  310. .el-tree-node__expand-icon{
  311. font-size: 12px;
  312. display: none;
  313. }
  314. .el-tree-node__label{
  315. font-size: 14px;
  316. }
  317. }
  318. }
  319. }
  320. }
  321. }
  322. .result-right{
  323. flex: 1;
  324. // background-color: #fff;
  325. .right-header{
  326. padding: 20px 20px 14px 20px;
  327. background-color: #fff;
  328. .head-search{
  329. margin-bottom: 10px;
  330. .search-input{
  331. margin-left: 10px;
  332. .input-with-select{
  333. ::v-deep .el-input__inner{
  334. width: 320px;
  335. }
  336. }
  337. ::v-deep .el-input-group__append{
  338. width: auto;
  339. padding: 0 20px 0 0 !important;
  340. border-color: #0348F3;
  341. .el-button{
  342. background-color: #0348F3 !important;
  343. color: #fff;
  344. }
  345. }
  346. }
  347. }
  348. .change-search{
  349. margin-left: 12px;
  350. font-size: 14px;
  351. color: #0348F3;
  352. line-height: 32px;
  353. }
  354. .search-tip{
  355. font-size: 14px;
  356. color: #545B65;
  357. span{
  358. color: #ED4A41;
  359. }
  360. i{
  361. font-style: normal;
  362. padding: 0 4px;
  363. }
  364. }
  365. }
  366. .result-list{
  367. padding: 20px;
  368. .result-item{
  369. padding: 16px 16px 10px 16px;
  370. margin-bottom: 16px;
  371. background-color: #fff;
  372. border-radius: 3px;
  373. }
  374. }
  375. }
  376. }
  377. ::v-deep .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
  378. background-color: transparent !important;
  379. }
  380. ::v-deep .el-tree .el-tree-node.is-current>.el-tree-node__content .el-tree-node__label{
  381. background-color: transparent !important;
  382. color: #0C0E1E !important;
  383. }
  384. ::v-deep .el-tree .is-current>.el-tree-node__content{
  385. background-color: transparent !important;
  386. color: #0C0E1E !important;
  387. }
  388. ::v-deep .el-collapse::-webkit-scrollbar,
  389. ::v-deep .el-collapse-item__content::-webkit-scrollbar,
  390. ::v-deep .el-tree::-webkit-scrollbar {
  391. width: 5px !important;
  392. height: 5px !important;
  393. background-color: #fff !important;
  394. }
  395. ::v-deep .el-collapse::-webkit-scrollbar-thumb{
  396. border-radius: 3px;
  397. background-color: #fff !important;
  398. }
  399. ::v-deep .el-collapse-item__content::-webkit-scrollbar-thumb,
  400. ::v-deep .el-tree::-webkit-scrollbar-thumb {
  401. border-radius: 3px;
  402. background-color: #4578F6 !important;
  403. // background-color: #fff !important;
  404. }
  405. ::v-deep .el-collapse::-webkit-scrollbar-thumb:hover,
  406. ::v-deep .el-collapse-item__content::-webkit-scrollbar-thumb:hover,
  407. ::v-deep .el-tree::-webkit-scrollbar-thumb:hover {
  408. // background-color: #4578F6 !important;
  409. background-color: #fff !important;
  410. }
  411. ::v-deep .el-collapse::-webkit-scrollbar-corner,
  412. ::v-deep .el-collapse-item__content::-webkit-scrollbar-corner,
  413. ::v-deep .el-tree::-webkit-scrollbar-corner {
  414. background-color: #DDE8FB !important;
  415. }
  416. </style>