|
|
@ -11,14 +11,15 @@ |
|
|
|
flat |
|
|
|
:multiple="false" |
|
|
|
:normalizer="normalizerProject" |
|
|
|
placeholder="请选择" |
|
|
|
:default-expand-level="Infinity" |
|
|
|
:placeholder="projectPlaceholder" |
|
|
|
@input="handleSearch(collectLevel)" |
|
|
|
@select="handleSearch(collectLevel)" |
|
|
|
> |
|
|
|
<p |
|
|
|
slot="option-label" |
|
|
|
slot-scope="{node}" |
|
|
|
style="display:flex; justify-content: space-between ;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 90%;" |
|
|
|
style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 100%; padding-left: 10px;" |
|
|
|
:title="node.label" |
|
|
|
> |
|
|
|
<template> {{ node.label }} </template> |
|
|
@ -39,7 +40,7 @@ |
|
|
|
<p |
|
|
|
slot="option-label" |
|
|
|
slot-scope="{node}" |
|
|
|
style="display:flex; justify-content: space-between ;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 90%;" |
|
|
|
style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 100%; padding-left: 10px;" |
|
|
|
:title="node.label" |
|
|
|
> |
|
|
|
<template> {{ node.label }} </template> |
|
|
@ -215,10 +216,8 @@ |
|
|
|
import CRUD, { crud } from '@crud/crud' |
|
|
|
import { collectionLibraryCrud } from '../mixins/index' |
|
|
|
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category' |
|
|
|
// FetchBecomeDocumentConfirm |
|
|
|
import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives } from '@/api/collect/collect' |
|
|
|
import { FetchArchivesClassTree } from '@/api/system/archivesClass' |
|
|
|
import { FetchDictionaryTree } from '@/api/system/dict' |
|
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
|
import PreviewForm from '@/views/components/category/PreviewForm' |
|
|
@ -366,13 +365,20 @@ export default { |
|
|
|
return '输入题名或档号' |
|
|
|
} |
|
|
|
return '输入项目名称或编号' |
|
|
|
}, |
|
|
|
projectPlaceholder() { |
|
|
|
if (this.isTitleType === 2) { |
|
|
|
return '请选择项目分类' |
|
|
|
} else if (this.isTitleType === 3) { |
|
|
|
return '请选择项目阶段' |
|
|
|
} |
|
|
|
return '请选择项目分类' |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
selectedCategory: function(newValue, oldValue) { |
|
|
|
if (newValue && newValue.id) { |
|
|
|
this.getInitArchivesClass() |
|
|
|
this.getDictsList() |
|
|
|
} |
|
|
|
}, |
|
|
|
isTitleType: function(newValue, oldValue) { |
|
|
@ -391,7 +397,6 @@ export default { |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.getInitArchivesClass() |
|
|
|
this.getDictsList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
resetQuery() { |
|
|
@ -429,83 +434,6 @@ export default { |
|
|
|
children: node.childArchivesClass |
|
|
|
} |
|
|
|
}, |
|
|
|
// 项目级别 - 阶段分类 |
|
|
|
getDictsList() { |
|
|
|
this.projectOptions = [] |
|
|
|
FetchDictionaryTree().then((res) => { |
|
|
|
const filterCodes = ['project_class'] |
|
|
|
let filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode)) |
|
|
|
filteredItems = this.addLevelToDictionaryList(filteredItems, 1) |
|
|
|
if (this.selectedCategory.arrangeType === 3 && this.isTitleType === 3) { |
|
|
|
console.log('项目下的案卷') |
|
|
|
let fiterData = [] |
|
|
|
fiterData = filteredItems.flatMap(item => { |
|
|
|
const level2Childs = item.childDictionarys.filter(child => { |
|
|
|
return child.dictionaryParents === item.id && child.level === 2 |
|
|
|
}) |
|
|
|
return level2Childs |
|
|
|
}) |
|
|
|
if (this.parentsData.parentsProjectRow) { |
|
|
|
if (this.parentsData.parentsProjectRow.project_class !== null || this.parentsData.parentsProjectRow.project_class !== '') { |
|
|
|
console.log('project_class', this.parentsData.parentsProjectRow.project_class) |
|
|
|
const findDic = fiterData.find(item => item.dictionaryName === this.parentsData.parentsProjectRow.project_class) |
|
|
|
console.log('findDic', findDic) |
|
|
|
this.projectOptions.push(findDic) |
|
|
|
console.log('444', this.projectOptions) |
|
|
|
} else { |
|
|
|
this.projectOptions = fiterData |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
// this.projectOptions = this.filterData(filteredItems, filteredItems[0].id) |
|
|
|
this.projectOptions = filteredItems.flatMap(item => { |
|
|
|
const level2Childs = item.childDictionarys.filter(child => { |
|
|
|
return child.dictionaryParents === item.id && child.level === 2 |
|
|
|
}) |
|
|
|
// 将满足条件的子项目的childDictionarys设置为空数组,因为项目页不需要 |
|
|
|
level2Childs.forEach(child => { |
|
|
|
child.childDictionarys = [] |
|
|
|
}) |
|
|
|
return level2Childs |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 显示第一级和第二级 |
|
|
|
filterData(data, targetId) { |
|
|
|
return data.filter(item => { |
|
|
|
if (item.id === targetId || item.dictionaryParents === targetId) { |
|
|
|
if (item.childDictionarys && item.childDictionarys.length > 0) { |
|
|
|
item.childDictionarys = this.filterData(item.childDictionarys, targetId) |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
return false |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 给筛选出来的数据加level 方便后面是否可点击 |
|
|
|
addLevelToDictionaryList(dictionaryList, level) { |
|
|
|
dictionaryList.forEach(dictionary => { |
|
|
|
dictionary.level = level |
|
|
|
if (dictionary.childDictionarys) { |
|
|
|
dictionary.childDictionarys = this.addLevelToDictionaryList(dictionary.childDictionarys, level + 1) |
|
|
|
} |
|
|
|
}) |
|
|
|
return dictionaryList |
|
|
|
}, |
|
|
|
normalizerProject(node) { |
|
|
|
if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) { |
|
|
|
delete node.childDictionarys |
|
|
|
} |
|
|
|
return { |
|
|
|
id: node.dictionaryName, |
|
|
|
label: `${node.dictionaryName} - ${node.dictionaryCode}`, |
|
|
|
children: node.childDictionarys, |
|
|
|
isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1 |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSelect(key, keyPath) { |
|
|
|
console.log(key, keyPath) |
|
|
|
}, |
|
|
@ -522,7 +450,6 @@ export default { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.arcId = null |
|
|
|
if (isPaper) { |
|
|
|
this.quickPaper = true |
|
|
@ -1222,6 +1149,33 @@ export default { |
|
|
|
|
|
|
|
<style lang='scss' scoped> |
|
|
|
::v-deep .vue-treeselect__list-item{ |
|
|
|
width: 200px; |
|
|
|
width: 220px; |
|
|
|
} |
|
|
|
::v-deep .vue-treeselect__menu { |
|
|
|
padding: 20px 0; |
|
|
|
} |
|
|
|
::v-deep .vue-treeselect__option--highlight{ |
|
|
|
background: #f5f9fc !important; |
|
|
|
color: #0348f3 !important; |
|
|
|
} |
|
|
|
::v-deep .vue-treeselect__option-arrow-container .vue-treeselect__option-arrow{ |
|
|
|
color: #1c1c1c !important; |
|
|
|
} |
|
|
|
::v-deep .vue-treeselect__placeholder{ |
|
|
|
font-size: 14px; |
|
|
|
} |
|
|
|
::v-deep .vue-treeselect__label-container{ |
|
|
|
font-size: 14px; |
|
|
|
height: 34px; |
|
|
|
line-height: 34px; |
|
|
|
color: #1c1c1c; |
|
|
|
} |
|
|
|
::v-deep .vue-treeselect__option.vue-treeselect__option--disabled{ |
|
|
|
.vue-treeselect__label-container{ |
|
|
|
color: #545b65 !important; |
|
|
|
} |
|
|
|
} |
|
|
|
::v-deep.vue-treeselect--has-value .vue-treeselect__single-value{ |
|
|
|
font-size: 14px; |
|
|
|
} |
|
|
|
</style> |