Browse Source

收集库api调试

master
xuhuajiao 1 year ago
parent
commit
13bd9f17b0
  1. 38
      src/api/collect/collect.js
  2. 18
      src/assets/styles/archives-manage.scss
  3. 15
      src/views/archivesManage/managementLibrary/anjuan/tableList.vue
  4. 20
      src/views/archivesManage/managementLibrary/index.vue
  5. 2
      src/views/archivesManage/managementLibrary/juannei/index.vue
  6. 121
      src/views/archivesManage/managementLibrary/module/collectHeader.vue
  7. 2
      src/views/archivesManage/managementLibrary/project/index.vue
  8. 6
      src/views/collectReorganizi/collectionLibrary/anjuan/content.vue
  9. 2
      src/views/collectReorganizi/collectionLibrary/anjuan/index.vue
  10. 37
      src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue
  11. 11
      src/views/collectReorganizi/collectionLibrary/file/index.vue
  12. 57
      src/views/collectReorganizi/collectionLibrary/index.vue
  13. 8
      src/views/collectReorganizi/collectionLibrary/juannei/index.vue
  14. 5
      src/views/collectReorganizi/collectionLibrary/mixins/index.js
  15. 187
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  16. 2
      src/views/collectReorganizi/collectionLibrary/module/fourTest/index.vue
  17. 19
      src/views/collectReorganizi/collectionLibrary/project/index.vue
  18. 64
      src/views/components/category/PreviewForm.vue

38
src/api/collect/collect.js

@ -18,4 +18,40 @@ export function FetchInitCategoryView(params) {
})
}
export default { FetchInitCategoryViewTable, FetchInitCategoryView }
// 添加项目/卷内/文件
export function collectAdd(data) {
return request({
url: 'api/collect/addArchives',
method: 'post',
data
})
}
// 添加项目/卷内/文件
export function collectEdit(data) {
return request({
url: 'api/collect/editArchives',
method: 'post',
data
})
}
// 删除
export function collectDel(data) {
return request({
url: 'api/collect/delArchives',
method: 'post',
data
})
}
// 根据门类父id获取卷内列表
export function FetchDetailsById(params) {
return request({
url: 'api/collect/getDetailsById',
method: 'get',
params
})
}
export default { collectAdd, collectEdit, collectDel, FetchInitCategoryViewTable, FetchInitCategoryView, FetchDetailsById }

18
src/assets/styles/archives-manage.scss

@ -938,13 +938,27 @@
}
}
.collect-filter{
display: flex;
// width: 360px;
height: 32px;
justify-content: flex-end;
.vue-treeselect{
font-size: 12px;
margin-right: 10px !important;
.vue-treeselect__control{
height: 33px !important;
}
}
}
.mangement-fixed-top{
padding: 0 20px 10px 20px;
// padding: 0 20px 10px 20px;
text-align: right;
flex: 1;
color: #545B65;
}
.drag-tip {
display: block;
padding-left: 20px;

15
src/views/archivesManage/managementLibrary/anjuan/tableList.vue

@ -132,13 +132,19 @@ export default {
data() {
return {
categoryId: 'F0F59CC713C83AE4BAB99B',
arcId: '256E752BC0280618840600'
arcId: '256E752BC0280618840600',
title: ''
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
this.selections = []
this.$refs.table.clearSelection()
if (newValue.arrangeType === 1) {
this.title = '文件'
} else {
this.title = '案卷'
}
},
tableDisplayFields(val) {
this.doLayout()
@ -205,11 +211,16 @@ export default {
// table - row
clickRowHandler(row) {
console.log('clickRowHandler', row)
if (this.selectedCategory.arrangeType === 1) {
this.title = '文件'
} else {
this.title = '案卷'
}
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.openJuannei(row.archive_no)
this.openJuannei('所属' + this.title + ':' + row.archive_no)
}, 300)
this.selections = this.crud.selections
},

20
src/views/archivesManage/managementLibrary/index.vue

@ -32,10 +32,11 @@
node-key="id"
:expand-on-click-node="false"
highlight-current
@node-click="handleNodeFilter"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="data.childDictionarys !== null " class="iconClassify">
{{ data.dictionaryName }}
<span v-if="data.childDictionarys || data.fondsName" class="iconClassify">
{{ data.dictionaryName || data.fondsName }}
</span>
<span v-else class="iconClassify-child">
{{ data.dictionaryName }}
@ -195,7 +196,7 @@ export default {
this.selectedCategory = val
if (this.selectedCategory.isType !== 1) {
this.getInitArchivesClass(val.id)
this.getDictionaryTreeByCategoryId(val.id)
} else {
this.classifyTree = []
}
@ -222,18 +223,27 @@ export default {
}
})
},
getInitArchivesClass(categoryId) {
getDictionaryTreeByCategoryId(categoryId) {
this.classifyLoading = true
const params = {
'categoryId': categoryId
}
FetchDictionaryTreeByCategoryId(params).then((res) => {
this.classifyTree = res
let fonds
if (res.fonds.length <= 1) {
fonds = []
} else {
fonds = res.fonds
}
this.classifyTree = res.dictionarys.concat(fonds)
this.classifyLoading = false
}).catch(err => {
console.log(err)
})
},
handleNodeFilter(val) {
console.log('val', val)
},
handleOpenAnjuan(data) {
this.$refs.anjuanEle.anjuanDrawer = true
// this.$refs.anjuanEle.$refs.ajContent.activeIndex = 0

2
src/views/archivesManage/managementLibrary/juannei/index.vue

@ -195,7 +195,7 @@ export default {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.openFile(row.archive_no)
this.openFile('所属卷内:' + row.archive_no)
}, 300)
this.selections = this.crud.selections
},

121
src/views/archivesManage/managementLibrary/module/collectHeader.vue

@ -1,14 +1,37 @@
<template>
<div>
<div :class="[ isTitleType === 6 || isTitleType === 2 ? 'collect-header manage-fixed-style' : 'collect-header']">
<h4 :class="classType">{{ collectTitle }} <span v-if="isTitleType !== 2 && !(isTitleType === 3 && (selectedCategory.arrangeType === 1 || selectedCategory.arrangeType === 2) )"> > {{ test }}</span></h4>
<!-- <div :class="[ isTitleType === 6 || isTitleType === 2 ? 'collect-header manage-fixed-style' : 'collect-header']"> -->
<div class="collect-header">
<h4 :class="classType">{{ collectTitle }} </h4>
<div class="collect-filter">
<treeselect
v-if="selectedCategory.arrangeType === 3 && isTitleType !== 4 && isTitleType !== 6 && activeIndex !== 1"
v-model="query.projectClass"
:options="projectOptions"
style="width: 160px;"
flat
:multiple="false"
:normalizer="normalizerProject"
placeholder="请选择"
/>
<treeselect
v-if="isTitleType !== 6"
v-model="query.classify"
:options="classifyOptions"
style="width: 160px;"
flat
:multiple="false"
:normalizer="normalizer"
placeholder="请选择档案分类"
/>
</div>
<div class="head-search">
<el-select
v-if="isTitleType === 3 && selectedCategory.arrangeType !== 3"
v-model="selectStatus"
multiple
collapse-tags
style="margin-right: 10px;"
style="margin-right: 10px; width: 160px;"
placeholder="请选择"
>
<el-option
@ -157,16 +180,22 @@
</div>
</el-dialog>
</div>
<!-- v-if="selectedCategory.isType !== 1 && !isRecycle" :class="['archives-top', {'archives-fixed-top': selectedCategory.isType === 2 || selectedCategory.isType === 4 }]" -->
<div style="display: flex; justify-content: space-between; height: 30px; line-height: 30px; padding: 0 10px; ">
<span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)" style="font-size: 12px;">{{ test }}</span>
<div v-if="isTitleType !== 2 && !isRecycle && isTitleType !== 6" class="mangement-fixed-top">
<el-checkbox v-model="fixedStatusBar" @change="statusBarChecked">隐藏状态栏</el-checkbox>
</div>
</div>
</div>
</template>
<script>
import { manageLibraryCrud } from '../mixins/index'
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
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'
import Print from './print/index'
import BindingTagDlg from '@/views/components/BindingTagDlg'
@ -174,7 +203,7 @@ import BindingTagDlg from '@/views/components/BindingTagDlg'
import { mapGetters } from 'vuex'
export default {
name: 'CollectHeader',
components: { PreviewForm, BindingTagDlg, Print },
components: { Treeselect, PreviewForm, BindingTagDlg, Print },
mixins: [manageLibraryCrud],
props: {
selectedCategory: {
@ -255,6 +284,12 @@ export default {
formVisible: false,
formTitle: '项目',
formPreviewData: [], // data
query: {
projectClass: null,
classify: null
},
projectOptions: [],
classifyOptions: [],
deleteVisible: false,
moveVisible: false,
exportVisible: false,
@ -304,16 +339,18 @@ export default {
},
placeholderType() {
if (this.isTitleType === 2) {
return '输入项目名称或项目编号搜索'
return '输入项目名称或编号搜索'
} else if (this.isTitleType === 3 || this.isTitleType === 4) {
return '输入题名或档号搜索'
}
return '输入项目名称或项目编号搜索'
return '输入项目名称或编号搜索'
}
},
created() {
},
mounted() {
this.getInitArchivesClass()
this.getDictsList()
if (localStorage.getItem('statusBarFixedType') !== 'undefined') {
this.fixedStatusBar = JSON.parse(localStorage.getItem('statusBarFixedType')) === true
this.$emit('status-bar-checked-changed', this.fixedStatusBar)
@ -327,6 +364,76 @@ export default {
this.$emit('status-bar-checked-changed', this.fixedStatusBar)
localStorage.setItem('statusBarFixedType', val)
},
getInitArchivesClass() {
this.classifyOptions = []
const params = {
'categoryId': this.selectedCategory.id
}
FetchArchivesClassTree(params).then((res) => {
this.classifyOptions = JSON.parse(JSON.stringify(res))
}).catch(err => {
console.log(err)
})
},
normalizer(node) {
if (node.childArchivesClass === null) {
delete node.childArchivesClass
}
return {
id: node.code,
label: node.name,
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) {
this.projectOptions = filteredItems
// console.log(this.projectOptions)
} else {
this.projectOptions = this.filterData(filteredItems, filteredItems[0].id)
}
}).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.dictionaryCode,
label: node.dictionaryName,
children: node.childDictionarys,
isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1
}
},
handleSelect(key, keyPath) {
console.log(key, keyPath)
},

2
src/views/archivesManage/managementLibrary/project/index.vue

@ -140,7 +140,7 @@ export default {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.openAnjuan(row.item_no)
this.openAnjuan('所属项目:' + row.archive_no)
}, 300)
this.selections = this.crud.selections
},

6
src/views/collectReorganizi/collectionLibrary/anjuan/content.vue

@ -41,9 +41,9 @@ export default {
created() {
},
mounted() {
console.log((!this.isRecycle && this.selectedCategory.arrangeType !== 1))
console.log('isRecycle', this.isRecycle)
console.log('test', this.test)
// console.log((!this.isRecycle && this.selectedCategory.arrangeType !== 1))
// console.log('isRecycle', this.isRecycle)
// console.log('test', this.test)
},
methods: {
changeActiveTab(data) {

2
src/views/collectReorganizi/collectionLibrary/anjuan/index.vue

@ -47,7 +47,7 @@ export default {
created() {
},
mounted() {
console.log('nei', this.selectedCategory.arrangeType)
// console.log('nei', this.selectedCategory.arrangeType)
},
methods: {
closeDrawer() {

37
src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue

@ -59,8 +59,8 @@ import { collectionLibraryCrud } from '../mixins/index'
import ArchivesInfo from '../module/archivesInfo/index'
import CollectHeader from '../module/collectHeader.vue'
import tableData from '@/views/archivesManage/managementLibrary/anjuan/table.json'
import jsonData from '@/views/archivesManage/managementLibrary/anjuan/data.json'
// import tableData from '@/views/archivesManage/managementLibrary/anjuan/table.json'
// import jsonData from '@/views/archivesManage/managementLibrary/anjuan/data.json'
export default {
name: 'Sorted',
components: { ArchivesInfo, CollectHeader },
@ -97,13 +97,19 @@ export default {
return {
categoryId: 'F0F59CC713C83AE4BAB99B',
arcId: '256E752BC0280618840600',
title: '案卷'
title: '',
selections: []
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
this.selections = []
this.$refs.table.clearSelection()
if (newValue.arrangeType !== 1) {
this.title = '案卷'
} else {
this.title = '文件'
}
},
tableDisplayFields(val) {
this.doLayout()
@ -119,11 +125,10 @@ export default {
}
},
created() {
this.tableDisplayFields = tableData.data
this.anjuanData = jsonData.data.list.content
// this.tableDisplayFields = tableData.data
// this.anjuanData = jsonData.data.list.content
},
mounted() {
},
methods: {
getCommonData(type) {
@ -160,22 +165,18 @@ export default {
if (this.timer) {
clearTimeout(this.timer)
}
console.log('tableDoubleClick', row)
// console.log('tableDoubleClick', row)
this.arcId = row.id
if (this.selectedCategory.arrangeType !== 1) {
this.title = '案卷'
this.$refs.archivesInfo.isHasFile = false
if (this.activeIndex === 1) {
this.title = '文件'
this.$refs.archivesInfo.detailTitle = '文件详情'
this.$refs.archivesInfo.isHasFile = true
} else {
this.title = '案卷'
this.$refs.archivesInfo.detailTitle = '案卷详情'
}
} else {
this.title = '文件'
this.$refs.archivesInfo.isHasFile = true
this.$refs.archivesInfo.detailTitle = '文件详情'
}
@ -185,18 +186,26 @@ export default {
},
// table - row
clickRowHandler(row) {
console.log('clickRowHandler', row)
if (this.selectedCategory.arrangeType === 1) {
if (this.activeIndex === 0) {
this.title = '文件'
}
} else {
if (this.activeIndex === 0) {
this.title = '案卷'
}
}
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.openJuannei('所属' + this.title + row.archive_no)
this.openJuannei('所属' + this.title + ':' + row.archive_no)
}, 300)
this.selections = this.crud.selections
},
//
handleCurrentChange(selection, row) {
console.log('触发单选', row)
// console.log('', row)
this.selections = selection
},
handleSizeChange(size) {

11
src/views/collectReorganizi/collectionLibrary/file/index.vue

@ -97,7 +97,8 @@ export default {
isTitleType: 6,
fileDrawer: false,
test: '',
isAjNo: 0
isAjNo: 0,
selections: []
}
},
watch: {
@ -131,18 +132,18 @@ export default {
},
// table -
tableDoubleClick(row) {
console.log('tableDoubleClick', row)
// console.log('tableDoubleClick', row)
// this.arcId = row.id
console.log(this.selectedCategory.isType)
// console.log(this.selectedCategory.isType)
},
// table - row
clickRowHandler(row) {
console.log('clickRowHandler', row)
// console.log('clickRowHandler', row)
this.selections = this.crud.selections
},
//
handleCurrentChange(selection, row) {
console.log('触发单选', row)
// console.log('', row)
this.selections = selection
},
handleSizeChange(size) {

57
src/views/collectReorganizi/collectionLibrary/index.vue

@ -23,41 +23,26 @@
</el-tree>
</div>
<h3 class="arc-title arc-title-bottom">快速筛选</h3>
<div class="arc-tree arc-tree-02">
<el-tree
ref="classifyTree"
v-loading="classifyLoading"
class="arc-tree arc-tree-02"
:data="classifyTree"
:props="defaultClassifyProps"
node-key="id"
:expand-on-click-node="false"
highlight-current
@node-click="handleNodeFilter"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="data.childDictionarys !== null " class="iconClassify">
{{ data.dictionaryName }}
<span v-if="data.childDictionarys || data.fondsName" class="iconClassify">
{{ data.dictionaryName || data.fondsName }}
</span>
<span v-else class="iconClassify-child">
{{ data.dictionaryName }}
</span>
</span>
</el-tree>
<el-tree
ref="fondsTree"
v-loading="classifyLoading"
:data="fondsTree"
:props="defaultFondsProps"
node-key="id"
:expand-on-click-node="false"
highlight-current
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span class="iconClassify">
{{ data.fondsName }}
</span>
</span>
</el-tree>
</div>
</div>
</div>
</div>
@ -118,8 +103,8 @@ export default {
label: 'cnName'
},
defaultClassifyProps: {
children: 'childDictionarys',
label: 'dictionaryName'
children: 'childDictionarys' || null,
label: 'dictionaryName' || 'fondsName'
},
defaultFondsProps: {
children: 'children',
@ -128,7 +113,6 @@ export default {
sharedData: '',
selectedCategory: {},
classifyTree: [],
fondsTree: [],
classifyLoading: false
}
},
@ -213,23 +197,23 @@ export default {
handleNodeClick(val) {
//
localStorage.setItem('currentArchivesKey', JSON.stringify(val))
this.selectedCategory = val
if (this.selectedCategory.isType !== 1) {
this.FetchDictionaryTreeByCategoryId(val.id)
this.getDictionaryTreeByCategoryId(val.id)
} else {
this.classifyTree = []
this.fondsTree = []
}
this.$nextTick(() => {
if (this.selectedCategory.arrangeType === 3) {
// this.$refs.projectEle.getCommonData(1)
//
this.$refs.projectEle.getCommonData(1)
} else if (this.selectedCategory.arrangeType === 2) {
// this.$refs.anjuanEle.$refs.ajContent.$refs.tableList.getCommonData(2)
//
this.$refs.anjuanEle.$refs.ajContent.$refs.tableList.getCommonData(2)
} else if (this.selectedCategory.arrangeType === 1) {
// this.$refs.anjuanEle.$refs.ajContent.$refs.tableList.getCommonData(3)
//
this.$refs.anjuanEle.$refs.ajContent.$refs.tableList.getCommonData(3)
}
if (this.$refs.anjuanEle) {
this.$refs.anjuanEle.anjuanDrawer = false
@ -245,19 +229,27 @@ export default {
}
})
},
FetchDictionaryTreeByCategoryId(categoryId) {
getDictionaryTreeByCategoryId(categoryId) {
this.classifyLoading = true
const params = {
'categoryId': categoryId
}
FetchDictionaryTreeByCategoryId(params).then((res) => {
this.classifyTree = res.dictionarys
this.fondsTree = res.fonds
let fonds
if (res.fonds.length <= 1) {
fonds = []
} else {
fonds = res.fonds
}
this.classifyTree = res.dictionarys.concat(fonds)
this.classifyLoading = false
}).catch(err => {
console.log(err)
})
},
handleNodeFilter(val) {
console.log('val', val)
},
handleOpenAnjuan(data) {
this.$refs.anjuanEle.anjuanDrawer = true
this.activeIndex = 0
@ -357,7 +349,6 @@ export default {
}
.arc-tree-02{
margin: 20px 0;
height: calc(100vh - 720px);
overflow: hidden;
overflow-y: scroll;

8
src/views/collectReorganizi/collectionLibrary/juannei/index.vue

@ -95,14 +95,15 @@ export default {
juanneiDrawer: false,
categoryId: 'CD135F6A77018CE04D4FDB',
arcId: '256E752BC0280618840600',
test: ''
test: '',
selections: []
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
},
tableDisplayFields(val) {
this.doLayout()
// this.doLayout()
}
},
created() {
@ -110,7 +111,6 @@ export default {
this.junneiData = jsonData.data.list.content
},
mounted() {
console.log('nei2', this.selectedCategory.arrangeType)
},
methods: {
getCommonData(type) {
@ -161,7 +161,7 @@ export default {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.openFile('所属卷内' + row.archive_no)
this.openFile('所属卷内' + row.archive_no)
}, 300)
this.selections = this.crud.selections
},

5
src/views/collectReorganizi/collectionLibrary/mixins/index.js

@ -11,7 +11,6 @@ export const collectionLibraryCrud = {
anjuanData: [],
junneiData: [],
fileData: [],
selections: [],
arrySort: [],
page: {
page: 1,
@ -74,10 +73,14 @@ export const collectionLibraryCrud = {
console.log('333')
if (this.isTitleType === 6) {
this.fileData = res.list.content
} else {
if (this.selectedCategory.arrangeType === 1) {
this.anjuanData = res.list.content
} else {
this.junneiData = res.list.content
}
}
}
this.page.total = res.list.totalElements
}
this.getTableDisplayFieldsLoading = false

187
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -115,9 +115,20 @@
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form -->
<!-- @emitTableList="getTableList" -->
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="true" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" />
<!-- form @emitTableList="getTableList" -->
<PreviewForm
v-if="formPreviewData.length"
ref="previewForm"
:is-has-code="true"
:is-disabled="false"
:form-preview-data.sync="formPreviewData"
:selected-category="selectedCategory"
:parents-id="parentsId"
:arc-id="arcId"
:is-des-form-type="isDesFormType"
:collect-level="collectLevel"
@close-dialog="closeDialog"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
</div>
@ -236,7 +247,7 @@
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="downloadVisible = false">取消</el-button>
<el-button type="primary" @click.native="handleExportConfirm">确定</el-button>
<el-button v-loading="delAllLoading" type="primary" @click.native="handleExportConfirm">确定</el-button>
</div>
</div>
</el-dialog>
@ -291,13 +302,15 @@
</div>
</el-dialog>
</div>
<div style="height: 30px; line-height: 30px; padding: 0 20px;"> <span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)">{{ test }}</span></div>
<div style="height: 30px; line-height: 30px; padding: 0 20px; font-size: 12px;"> <span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)">{{ test }}</span></div>
</div>
</template>
<script>
import CRUD from '@crud/crud'
import { collectionLibraryCrud } from '../mixins/index'
import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category'
import { FetchDetailsById, collectDel } from '@/api/collect/collect'
import { FetchArchivesClassTree } from '@/api/system/archivesClass'
import { FetchDictionaryTree } from '@/api/system/dict'
import Treeselect from '@riophae/vue-treeselect'
@ -333,18 +346,10 @@ export default {
type: Number,
default: 2
},
arcId: {
type: String,
default: function() {
return ''
}
selections: {
type: Array,
default: () => []
},
// selections: {
// type: Array,
// default: function() {
// return []
// }
// },
activeIndex: {
type: Number,
default: 0
@ -372,6 +377,7 @@ export default {
},
projectOptions: [],
classifyOptions: [],
delAllLoading: false,
deleteVisible: false,
moveVisible: false,
updateVisible: false,
@ -383,7 +389,9 @@ export default {
recoverVisible: false,
completelyDeleteVisible: false,
parentsId: null, // id
isDesFormType: 'arcives' //
isDesFormType: 'arcives', //
collectLevel: null,
arcId: null
}
},
computed: {
@ -437,6 +445,31 @@ export default {
this.getInitArchivesClass()
this.getDictsList()
}
},
isTitleType: function(newValue, oldValue) {
switch (newValue) {
case 2:
//
this.collectLevel = 1
break
case 3:
if (this.selectedCategory.arrangeType === 1 || this.activeIndex === 1) {
//
this.collectLevel = 3
} else {
//
this.collectLevel = 2
}
break
case 4:
//
this.collectLevel = 3
break
case 6:
//
this.collectLevel = 4
break
}
}
},
created() {
@ -444,8 +477,10 @@ export default {
mounted() {
this.getInitArchivesClass()
this.getDictsList()
this.getLevel()
},
methods: {
// -
getInitArchivesClass() {
this.classifyOptions = []
const params = {
@ -467,16 +502,16 @@ export default {
children: node.childArchivesClass
}
},
// -
getDictsList() {
this.projectOptions = []
FetchDictionaryTree().then((res) => {
console.log(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) {
this.projectOptions = filteredItems
console.log(this.projectOptions)
// console.log(this.projectOptions)
} else {
this.projectOptions = this.filterData(filteredItems, filteredItems[0].id)
}
@ -507,7 +542,7 @@ export default {
return dictionaryList
},
normalizerProject(node) {
if (node.childDictionarys && !node.childDictionarys.length) {
if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) {
delete node.childDictionarys
}
return {
@ -525,10 +560,9 @@ export default {
if (type === 'add') {
this.formVisible = true
this.formTitle = '新增' + this.collectTitle
// this.arcId = null
this.arcId = null
} else if (type === 'edit') {
console.log(this.selections)
// this.arcId = this.selections[0].id
this.arcId = this.selections[0].id
if (this.selections.length === 0) {
this.$message('您还未勾选需要操作的条目,请先确认!')
return false
@ -544,40 +578,71 @@ export default {
//
this.getFormInfo(type)
},
handleFromEdit() {
},
getLevel() {
switch (this.isTitleType) {
case 2:
//
this.collectLevel = 1
break
case 3:
if (this.selectedCategory.arrangeType === 1 || this.activeIndex === 1) {
//
this.collectLevel = 3
} else {
//
this.collectLevel = 2
}
break
case 4:
//
this.collectLevel = 3
break
case 6:
//
this.collectLevel = 4
break
}
},
getFormInfo(type) {
FetchInitCategoryInputFieldByPid({ categoryId: this.selectedCategory.id }).then(data => {
this.formPreviewData = data
this.$nextTick(() => {
if (type === 'edit') {
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'id': this.arcId
}
FetchDetailsById(params).then(data => {
const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
this.$nextTick(() => {
this.formPreviewData = showFiledAll
this.isDesFormType = 'arcives'
this.$nextTick(() => {
this.$refs.previewForm.archivesType = 'edit'
this.$refs.previewForm.addOrUpdateForm = data.echo
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
})
})
})
} else {
// if (this.recycleMain.selectedCategory.isType !== 5) {
//
// this.formPreviewData.forEach(item => {
// if (isAnOrJuan === 1) {
// if (this.recycleMain.selectedCategory.isType !== 3) {
// if (this.recycleMain.projectSelection[item.fieldName]) {
// this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.projectSelection))
// }
// }
// } else if (isAnOrJuan === 2) {
// if (this.recycleMain.anjuanSelection[item.fieldName]) {
// this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.anjuanSelection))
// }
// }
// })
// }
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel
}
FetchInitCategoryInputFieldByPid(params).then(data => {
this.formPreviewData = data
this.$nextTick(() => {
this.isDesFormType = 'arcives'
this.$refs.previewForm.archivesType = 'add'
this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
})
})
}
},
// form - submit
handlerArchivesSubmit() {
this.formVisible = false
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id)
this.selections = []
},
// -
handleClose(done) {
@ -602,7 +667,25 @@ export default {
},
// -
handleDelConfirm() {
this.delAllLoading = true
const archivesIds = []
this.selections.forEach(val => {
archivesIds.push(val.id)
})
const params = {
'categoryId': this.selectedCategory.id,
'categoryLevel': this.collectLevel,
'archivesIds': archivesIds
}
collectDel(params).then(() => {
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.deleteVisible = false
this.crud.refresh()
this.delAllLoading = false
}).catch(err => {
this.delAllLoading = false
console.log(err)
})
},
// -
handleMoveConfirm() {
@ -823,24 +906,14 @@ export default {
},
handleCompletelyDelete() {
this.completelyDeleteVisible = false
},
closeDialog() {
this.formVisible = false
}
}
}
</script>
<style lang='scss' scoped>
.collect-filter{
display: flex;
// width: 360px;
height: 32px;
justify-content: flex-end;
::v-deep .vue-treeselect{
font-size: 12px;
margin-right: 10px !important;
.vue-treeselect__control{
height: 33px !important;
}
}
}
</style>

2
src/views/collectReorganizi/collectionLibrary/module/fourTest/index.vue

@ -52,7 +52,7 @@ export default {
},
mounted() {
console.log(this.tableData)
// console.log(this.tableData)
},
methods: {
handleComfireTest() {

19
src/views/collectReorganizi/collectionLibrary/project/index.vue

@ -60,8 +60,8 @@ import { header, form } from '@crud/crud'
import CollectHeader from '../module/collectHeader.vue'
import ArchivesInfo from '../module/archivesInfo/index'
import tableData from '@/views/archivesManage/managementLibrary/anjuan/table.json'
import jsonData from '@/views/archivesManage/managementLibrary/anjuan/data.json'
// import tableData from '@/views/archivesManage/managementLibrary/anjuan/table.json'
// import jsonData from '@/views/archivesManage/managementLibrary/anjuan/data.json'
export default {
name: 'Project',
components: { CollectHeader, ArchivesInfo },
@ -91,19 +91,20 @@ export default {
isTitleType: 2,
categoryId: 'B073E8430B85B4821E7360',
arcId: '2946C34412182B73FBC287',
activeIndex: '1'
activeIndex: '1',
selections: []
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
},
tableDisplayFields(val) {
this.doLayout()
// this.doLayout()
}
},
created() {
this.tableDisplayFields = tableData.data
this.projectData = jsonData.data.list.content
// this.tableDisplayFields = tableData.data
// this.projectData = jsonData.data.list.content
},
mounted() {
},
@ -138,7 +139,7 @@ export default {
if (this.timer) {
clearTimeout(this.timer)
}
console.log('tableDoubleClick', row)
// console.log('tableDoubleClick', row)
this.arcId = row.id
this.$refs.archivesInfo.detailTitle = '项目详情'
this.$refs.archivesInfo.archivesInfoVisible = true
@ -147,12 +148,12 @@ export default {
},
// table - row
clickRowHandler(row) {
console.log('clickRowHandler', row)
// console.log('clickRowHandler', row)
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.openAnjuan('所属项目' + row.archive_no)
this.openAnjuan('所属项目' + row.archive_no)
}, 300)
this.selections = this.crud.selections
},

64
src/views/components/category/PreviewForm.vue

@ -113,7 +113,8 @@
<script>
import { crud } from '@crud/crud'
import { edit, FetchDoeditIsRepeat } from '@/api/archivesManage/archivesList'
import { FetchDoeditIsRepeat } from '@/api/archivesManage/archivesList'
import { collectAdd, collectEdit } from '@/api/collect/collect'
import { prearchEdit, FetchMergeToFile, FetchReDoeditIsRepeat } from '@/api/prearchiveLibrary/prearchiveLibrary'
import { getNoFormatField } from '@/api/system/category/fileNoFormat'
import draggable from 'vuedraggable'
@ -171,6 +172,10 @@ export default {
isDesFormType: {
type: String,
default: ''
},
collectLevel: {
type: Number,
default: 1
}
},
data() {
@ -195,7 +200,6 @@ export default {
result: null,
autoMatic: null,
// isType: 'category',
file: null, // change
fileNames: '', // - name
formatType: '', // - type
@ -206,7 +210,8 @@ export default {
nowDate: '', //
fileJsonString: null,
mergeFileArcIds: null,
mergeFileCategory: null
mergeFileCategory: null,
archivesType: null
}
},
computed: {
@ -253,11 +258,11 @@ export default {
}
},
normalizerClassify(node) {
if (node.childArchivesClass && !node.childArchivesClass.length) {
if ((node.childArchivesClass && !node.childArchivesClass.length) || node.childArchivesClass === null) {
delete node.childArchivesClass
}
return {
id: node.name,
id: node.code,
label: node.name,
children: node.childArchivesClass
}
@ -267,7 +272,7 @@ export default {
delete node.childMenus
}
return {
id: node.fondsName,
id: node.fondsNo,
label: node.fondsName,
children: node.childMenus
}
@ -295,13 +300,13 @@ export default {
})
return data
},
getFondsNode(list, fondsName) {
getFondsNode(list, fondsNo) {
let data;
(list || []).map(item => {
if (item.fondsName === fondsName) {
if (item.fondsNo === fondsNo) {
data = [item]
} else {
const child = this.getFondsNode(item.childMenus, fondsName)
const child = this.getFondsNode(item.childMenus, fondsNo)
if (child) {
data = child
}
@ -309,13 +314,13 @@ export default {
})
return data
},
getClassfiyNode(list, name) {
getClassfiyNode(list, code) {
let data;
(list || []).map(item => {
if (item.name === name) {
if (item.code === code) {
data = [item]
} else {
const child = this.getClassfiyNode(item.childArchivesClass, name)
const child = this.getClassfiyNode(item.childArchivesClass, code)
if (child) {
data = child
}
@ -325,6 +330,7 @@ export default {
},
//
handleAuto() {
console.log('isTableType', this.isTableType)
let string = ''
const getAutoFiledVal = []
this.autoMatic.forEach(async val => {
@ -349,6 +355,7 @@ export default {
await FetchFondsAll().then(res => {
const option = this.getFondsNode(res, this.addOrUpdateForm[val.fieldName])
if (option) {
console.log('option', option)
const obj = {}
obj.name = val.fieldName
obj.val = option[0].fondsNo + val.connector
@ -402,7 +409,7 @@ export default {
},
//
FetchNoFormatField(categoryId) {
getNoFormatField({ categoryId: categoryId }).then(res => {
getNoFormatField({ categoryId: categoryId, categoryLevel: this.collectLevel }).then(res => {
this.autoMatic = res
this.handleAuto()
})
@ -601,9 +608,9 @@ export default {
console.log(val)
if (val.length > 0) {
if (this.isTableType === 1) {
this.addOrUpdateForm[this.currentFieldName] = val[0].fondsName
this.addOrUpdateForm[this.currentFieldName] = val[0].fondsNo
} else if (this.isTableType === 2 && this.isDesFormType !== 'prearchiveLibrary') {
this.addOrUpdateForm[this.currentFieldName] = val[0].name
this.addOrUpdateForm[this.currentFieldName] = val[0].code
} else {
this.addOrUpdateForm[this.currentFieldName] = val[0].dictionaryName
}
@ -717,7 +724,7 @@ export default {
this.formPreviewData.map(item => {
if (item.isInputClass === 'date') {
if (this.addOrUpdateForm[item.fieldName] !== '') {
this.$set(this.addOrUpdateForm, item.fieldName, parseTime(this.addOrUpdateForm[item.fieldName]).split('00:00:00')[0])
this.$set(this.addOrUpdateForm, item.fieldName, parseTime(this.addOrUpdateForm[item.fieldName]).split(' ')[0])
}
}
})
@ -760,6 +767,7 @@ export default {
}
})
} else if (this.isDesFormType === 'mergeFile') {
//
const params = {
'archivesId': null,
'archivesIds': this.mergeFileArcIds,
@ -776,22 +784,32 @@ export default {
}
})
} else {
//
const params = {
'id': this.arcId,
'archivesId': this.arcId,
'categoryId': categoryId,
'parentsId': this.setParentsId,
'categoryLevel': this.collectLevel,
'jsonString': JSON.stringify(this.addOrUpdateForm)
}
console.log(this.addOrUpdateForm)
edit(params).then(res => {
if (res) {
console.log(params)
if (this.archivesType === 'add') {
collectAdd(params).then(res => {
if (res.code === 200) {
this.$message.success(res)
this.$emit('emitTableList')
this.$emit('close-dialog')
this.crud.refresh()
localStorage.setItem('isForm', true)
localStorage.removeItem('isDelt')
}
})
} else {
collectEdit(params).then(res => {
if (res.code === 200) {
this.$message.success(res)
this.$emit('close-dialog')
this.crud.refresh()
}
})
}
}
} else {
console.log('error submit!!')

Loading…
Cancel
Save