Browse Source

档案管理

master
xuhuajiao 3 years ago
parent
commit
3f335bbc97
  1. 81
      src/api/archivesManage/archivesList.js
  2. 53
      src/assets/styles/archives-manage.scss
  3. 49
      src/assets/styles/yxk-admin.scss
  4. 15
      src/utils/index.js
  5. 164
      src/views/archivesManage/archivesList/archivesDetail.vue
  6. 183
      src/views/archivesManage/archivesList/index.vue
  7. 517
      src/views/archivesManage/archivesList/module/archivesAnjuan/index.vue
  8. 147
      src/views/archivesManage/archivesList/module/archivesInfo/index.vue
  9. 453
      src/views/archivesManage/archivesList/module/archivesJuannei/index.vue
  10. 369
      src/views/archivesManage/archivesList/module/archivesProject/index.vue
  11. 230
      src/views/archivesManage/archivesList/module/table/index.vue
  12. 99
      src/views/components/category/PreviewForm.vue

81
src/api/archivesManage/archivesList.js

@ -2,14 +2,14 @@ import request from '@/utils/request'
import qs from 'qs'
// import { form } from '../../components/Crud/crud'
export function getTableDisplayFields(params) {
export function FetchTableDisplayFields(params) {
return request({
url: 'api/archives/initArchivesViewTable' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export function getFormDisplayFields(params) {
export function FetchFormDisplayFields(params) {
return request({
url: 'api/archives/doedit' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
@ -28,6 +28,7 @@ export function edit(parameter) {
})
}
// 档案删除
export function del(parameter) {
return request({
url: 'api/archives/delete',
@ -36,6 +37,23 @@ export function del(parameter) {
})
}
// 档案回收站删除
export function FetchCompletelyDelete(parameter) {
return request({
url: 'api/archives/completelyDelete',
method: 'post',
data: parameter
})
}
// 档案列表
export function FetchInitArchivesView(params) {
return request({
url: 'api/archives/initArchivesView' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 档案判断值是否重复
export function FetchDoeditIsRepeat(parameter) {
return request({
@ -45,12 +63,65 @@ export function FetchDoeditIsRepeat(parameter) {
})
}
export function initArchivesView(params) {
// 档案详情
export function FetchArchivesDetails(params) {
return request({
url: 'api/archives/initArchivesView' + '?' + qs.stringify(params, { indices: false }),
url: 'api/archives/archivesDetails' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 档案元数据
export function FetchArchivesMetadata(params) {
return request({
url: 'api/archives/archivesMetadata' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 初始化档案附件列表
export function FetchInitArchiveFilesView(params) {
return request({
url: 'api/archives/initArchiveFilesView' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { add, edit, del, getTableDisplayFields, getFormDisplayFields, FetchDoeditIsRepeat }
// 编辑附件
export function FetchEditFile(parameter) {
return request({
url: 'api/archives/editFile',
method: 'post',
data: parameter
})
}
// 删除附件
export function FetchDeleteFile(parameter) {
return request({
url: 'api/archives/deleteFile',
method: 'post',
data: parameter
})
}
// 档案还原
export function FetchReduction(parameter) {
return request({
url: 'api/archives/reduction',
method: 'post',
data: parameter
})
}
// 根据门类导出数据
// export function FetchExportArchives(params) {
// return request({
// url: 'api/archives/exportArchives?' + qs.stringify(params, { indices: false }),
// method: 'get',
// responseType: 'blob'
// })
// }
export default { add, edit, del, FetchInitArchivesView, FetchTableDisplayFields, FetchFormDisplayFields, FetchDoeditIsRepeat }

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

@ -6,9 +6,26 @@ $arcRed:#F65163;
$arcGreen: #1AAE93;
$arcCyan: #0FBED9;
.head-archives{
padding: 0 0 20px 0;
.archives-crud{
float: left;
}
.head-search{
float: left;
margin-left: 10px;
margin-bottom: 0 !important;
.filter-item{
margin-right: 5px !important;
}
}
.archives-handler-btn{
float: right;
}
}
::v-deep.input-prepend{
position: relative;
z-index: 1001;
z-index: 99;
.el-input__inner {
padding-left: 80px;
}
@ -58,18 +75,26 @@ $arcCyan: #0FBED9;
background-color: #02255F;
}
}
.head-archives-top{
.archives-warp{
margin-bottom: 20px;
}
.archives-top{
display: flex;
justify-content: space-between;
.head-search{
flex: 1;
}
justify-content: right;
margin-bottom: 10px;
::v-deep .el-checkbox .el-checkbox__label{
color: #fff;
}
}
.archives-right-list{
position: relative;
}
.archives-fixed-top{
position: absolute;
right: 0;
top: 6px;
margin-bottom: 0;
}
.crud-opts{
justify-content: space-between;
}
@ -175,7 +200,7 @@ $arcCyan: #0FBED9;
::v-deep .is-scrolling-left,
::v-deep .is-scrolling-middle,
::v-deep .is-scrolling-right{
min-height: calc(100vh - 434px) !important;
max-height: calc(100vh - 434px) !important;
}
}
::v-deep .archives-table.el-table .el-table__fixed-right{
@ -289,15 +314,17 @@ $arcCyan: #0FBED9;
span{
display: block;
width: 160px;
margin-right: 5px;
text-align: right;
color: #3A99FD;
}
p{
flex: 1;
// flex: 1;
}
}
}
::v-deep.hljs{
padding: 0 30px;
color: #fff;
background-color: transparent;
}
@ -506,4 +533,10 @@ $arcCyan: #0FBED9;
background-color: #031435;
}
}
}
.item-content{
max-height: calc(100vh - 410px);
overflow: hidden;
overflow-y: scroll;
}

49
src/assets/styles/yxk-admin.scss

@ -424,7 +424,7 @@
.el-checkbox__inner{
background: transparent;
border-color: #339CFF;
border-color: $inputBorder;
}
.el-icon-arrow-right:before{
@ -436,26 +436,43 @@
padding: 2px 10px;
margin: 10px 0 !important;
.el-pagination__total{
color: #fff;
color: $inputBorder;
}
button{
height: 24px;
line-height: 24px;
background-color: transparent;
&:disabled{
background-color: transparent;
}
}
.el-pager li{
min-width: 24px;
height: 24px;
line-height: 24px;
color: $inputBorder;
background-color: transparent;
}
.el-pager li.active{
color: #fff;
background-color: transparent;
background-color: #2072D2;
}
.el-select .el-input .el-input__inner{
background-color: transparent;
color: #fff;
color: $inputBorder;
border-color: $inputBorder;
}
.el-icon-arrow-right:before{
color: $inputBorder;
}
.btn-prev,
.btn-next{
color: $inputBorder;
background-color: transparent;
}
.el-select .el-input .el-select__caret{
color: $inputBorder;
}
}
// 弹框
@ -931,3 +948,27 @@ input[type='number'] {
color: #fff;
}
}
.el-message-box .el-button,
.el-popover .el-button{
color: #fff;
border-color: #339cff;
background-color: transparent;
}
.el-message-box .el-button:hover,
.el-popover .el-button:focus{
color: #fff;
background-color: #02255F;
border-color: #339CFF;
}
.el-message-box .el-button--primary,
.el-message-box .el-button--primary:focus,
.el-message-box .el-button--primary:hover {
background: #46a6ff;
border-color: #46a6ff;
color: #fff;
}
.el-table__header-wrapper{
background-color: #02255f;
border-top: 1px solid #113d72;
}

15
src/utils/index.js

@ -377,6 +377,7 @@ export function regMobile(mobile) {
// 下载文件
export function downloadFile(obj, name, suffix) {
const url = window.URL.createObjectURL(new Blob([obj]))
console.log(url)
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
@ -386,3 +387,17 @@ export function downloadFile(obj, name, suffix) {
link.click()
document.body.removeChild(link)
}
// new - 导出 - TEST
export function exportFile(StingParams, fileName) {
const baseURL = process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : 'http://192.168.99.84:7070/'
const url = baseURL + StingParams
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('target', '_blank')
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}

164
src/views/archivesManage/archivesList/archivesDetail.vue

@ -1,39 +1,41 @@
<template>
<div>
<!--工具栏-->
<div class="head-container">
<div class="head-archives-top">
<div class="head-search">
<!-- 搜索 -->
<el-select v-if="selectedCategory.isType === 3 || selectedCategory.isType === 5" v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="crud.toQuery">
<i slot="prefix" class="iconfont icon-zhuangtai-fanbai" />
<el-option v-for="item in stateOptions" :key="item.key" :label="item.label" :value="item.key" />
</el-select>
<el-input v-model="query[inputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item" @keyup.enter.native="crud.toQuery">
<el-select slot="prepend" v-model="inputSelect" style="width: 80px" @change="querySelect">
<el-option
v-for="item in queryOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-input>
<rrOperation />
</div>
<el-checkbox v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" v-model="fixedStatusBar">隐藏固定状态栏</el-checkbox>
</div>
<div class="head-container head-archives">
<crudOperation :permission="permission">
<template v-slot:left>
<!-- 新增 -->
<el-button v-if="selectedCategory.isType !== 4" v-permission="permission.add" :disabled="selectedCategory.isType === 3 && isJuannei" size="mini" icon="el-icon-plus" @click="crud.toAdd">新增</el-button>
</template>
<template v-slot:right>
<!-- 删除btn 多选 -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">删除</el-button>
<!-- 导出btn -->
<el-button v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" v-permission="permission.download" :loading="crud.downloadLoading" :disabled="!crud.data.length" size="mini" icon="el-icon-download" @click="crud.doExport">导出</el-button>
<!-- 导出btn :disabled="!crud.data.length" -->
<el-button v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" v-permission="permission.download" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="doExport">导出</el-button>
<!-- 上传附件btn 针对卷内/文件 单选 -->
<el-button v-if="selectedCategory.isType === 4 || selectedCategory.isType === 5" :disabled="crud.selections.length !== 1" size="mini" icon="el-icon-download" @click="uploadFile">上传附件</el-button>
<div class="head-search">
<!-- 搜索 -->
<el-select v-if="selectedCategory.isType === 3 || selectedCategory.isType === 5" v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px" @change="crud.toQuery">
<i slot="prefix" class="iconfont icon-zhuangtai-fanbai" />
<el-option v-for="item in stateOptions" :key="item.key" :label="item.label" :value="item.key" />
</el-select>
<el-input v-model="query[inputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item" @keyup.enter.native="crud.toQuery">
<el-select slot="prepend" v-model="inputSelect" style="width: 80px" @change="querySelect">
<el-option
v-for="item in queryOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-input>
<rrOperation />
</div>
</template>
<template v-slot:rightButtonGroup>
<div v-if="selectedCategory.isType === 3 || selectedCategory.isType === 5" class="archives-handler-btn">
<div v-if="selectedCategory.isType === 5 || !isJuannei" class="archives-handler-btn">
<!-- 装盒btn 多选 -->
<el-button class="packing-btn iconfont icon-weibiaoti-2" type="primary" :disabled="crud.selections.length === 0" @click="handlePacking(crud.selections)">装盒</el-button>
<!-- 分卷装盒btn 针对案卷-单选 -->
@ -93,42 +95,46 @@
</el-dialog>
<!-- table表格渲染 -->
<el-table ref="table" v-loading="crud.loading || getTableDisplayFieldsLoading" class="archives-table" :data="crud.data" highlight-current-row style="width: 100%; " height="calc(100vh - 370px)" @selection-change="crud.selectionChangeHandler" @row-click="clickRowHandler" @cell-dblclick="tableDoubleClick">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
<el-table-column v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<!-- state-active 已装/已入/已借/已绑 -->
<template slot-scope="scope">
<!-- 未装 / 已装 -->
<span class="row-state row-packing state-active">{{ scope.row.case_no ? '已装': '未装' }}</span>
</template>
</el-table-column>
<el-table-column v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" label="入库" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 未入 / 已入 -->
<span class="row-state row-warehousing">未入</span>
</template>
</el-table-column>
<el-table-column v-if="selectedCategory.isType === 3 || selectedCategory.isType === 5" label="借阅" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 待借 / 不可借- 表示 / 已借 -->
<span class="row-state row-lending"></span>
</template>
</el-table-column>
<el-table-column v-if="selectedCategory.isType === 3 || selectedCategory.isType === 5" label="标签" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="scope">
<!-- 未绑 / 已绑 -->
<span class="row-state row-binding">{{ scope.row.tid ? '已绑': '未绑' }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
<el-card class="box-card" shadow="never">
<span class="right-top-line" />
<span class="left-bottom-line" />
<el-table ref="table" v-loading="crud.loading || getTableDisplayFieldsLoading" class="archives-table" :data="crud.data" highlight-current-row style="width: 100%; " height="calc(100vh - 350px)" @selection-change="crud.selectionChangeHandler" @row-click="clickRowHandler" @cell-dblclick="tableDoubleClick">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
<el-table-column v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<!-- state-active 已装/已入/已借/已绑 -->
<template slot-scope="scope">
<!-- 未装 / 已装 -->
<span class="row-state row-packing state-active">{{ scope.row.case_no ? '已装': '未装' }}</span>
</template>
</el-table-column>
<el-table-column v-if="selectedCategory.isType !== 1 && selectedCategory.isType !== 2" label="入库" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 未入 / 已入 -->
<span class="row-state row-warehousing">未入</span>
</template>
</el-table-column>
<el-table-column v-if="selectedCategory.isType === 3 || selectedCategory.isType === 5" label="借阅" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 待借 / 不可借- 表示 / 已借 -->
<span class="row-state row-lending"></span>
</template>
</el-table-column>
<el-table-column v-if="selectedCategory.isType === 3 || selectedCategory.isType === 5" label="标签" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="scope">
<!-- 未绑 / 已绑 -->
<span class="row-state row-binding">{{ scope.row.tid ? '已绑': '未绑' }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</el-card>
<!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" />
@ -155,8 +161,10 @@
</template>
<script>
import qs from 'qs'
import { add, edit, del, getTableDisplayFields, getFormDisplayFields } from '@/api/archivesManage/archivesList'
import CRUD, { presenter, header, form } from '@crud/crud'
import { exportFile } from '@/utils/index'
import { initData } from '@/api/data'
import crudOperation from '@crud/CRUD.operation'
import rrOperation from '@crud/RR.operation'
@ -169,6 +177,7 @@ import PartPacking from './module/partPacking/index'
import Binding from './module/binding/index'
export default {
name: 'ArchivesDetail',
components: { crudOperation, rrOperation, pagination, PreviewForm, UploadFile, ArchivesInfo, Packing, Binding, PartPacking },
mixins: [
presenter(),
@ -181,6 +190,10 @@ export default {
default: function() {
return {}
}
},
isJuannei: {
type: Boolean,
default: false
}
},
cruds() {
@ -191,7 +204,7 @@ export default {
query: { isdel: false },
crudMethod: { add, edit, del },
optShow: {
add: true,
add: false,
edit: true,
del: false,
reset: false,
@ -239,8 +252,8 @@ export default {
uploadFileVisible: false, //
archivesInfoVisible: false, //
lengingVisible: false, //
isBinding: false //
isBinding: false, //
parent_id: null
}
},
watch: {
@ -250,6 +263,9 @@ export default {
this.crud.query.categoryId = newValue.id
this.crud.refresh()
}
},
isJuannei: function(newValue, oldValue) {
},
tableDisplayFields(val) {
this.doLayout()
@ -262,11 +278,31 @@ export default {
mounted() {
},
methods: {
doExport(fileName = '未知文件') {
this.crud.downloadLoading = true
if (this.selectedCategory.pid !== '0') {
this.parent_id = this.selectedCategory.pid
} else {
this.parent_id = null
}
const params = {
'categoryId': this.selectedCategory.id,
'parentsId': this.parent_id
}
exportFile('api/archives/exportArchives?' + qs.stringify(params))
// this.crud.downloadLoading = false
},
// -select
querySelect(val) {
this.inputSelect = val
},
[CRUD.HOOK.beforeRefresh]() {
// id
if (this.selectedCategory.pid !== '0') {
this.crud.query.parentsId = this.selectedCategory.pid
} else {
this.crud.query.parentsId = null
}
this.getTableDisplayFieldsLoading = true
//
getTableDisplayFields({ categoryId: this.selectedCategory.id }).then(data => {

183
src/views/archivesManage/archivesList/index.vue

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<!-- 门类列表 -->
<el-row class="container-main" :gutter="20">
<el-row class="container-main">
<el-col class="curd-in-out" :xs="10" :sm="8" :md="5" :lg="6" :xl="5">
<div class="container-left left-tree-item">
<span class="right-top-line" />
@ -13,34 +13,67 @@
<div class="container-left left-tree-item">
<span class="right-top-line" />
<span class="left-bottom-line" />
<div class="tree-title">智能</div>
<div class="tree-title">智能</div>
<!--门类树状结构-->
<el-tree ref="tree" v-loading="crud.loading" :data="crud.data" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current @node-click="handleNodeClick" />
<el-tree ref="tree" v-loading="intellClassifyLoading" :data="intellClassifyTree" :props="intellDefaultProps" node-key="id" :expand-on-click-node="false" highlight-current @node-click="handleIntellNodeClick" />
</div>
</el-col>
<!-- 档案管理列表 -->
<el-col class="container-right" :xs="14" :sm="18" :md="19" :lg="18" :xl="19">
<span class="right-top-line" />
<span class="left-bottom-line" />
<archivesDetail ref="archivesDetail" :selected-category="selectedCategory" />
<el-col class="archives-right-list" :xs="14" :sm="18" :md="19" :lg="18" :xl="19">
<div v-if="selectedCategory.isType !== 1" :class="['archives-top', {'archives-fixed-top': selectedCategory.isType===2 || selectedCategory.isType===4 }]">
<el-checkbox v-model="fixedStatusBar">隐藏固定状态栏</el-checkbox>
</div>
<!-- <archivesDetail :selected-category="selectedCategory" /> -->
<!-- 项目 -->
<archivesProject
v-if="selectedCategory.isType === 2"
ref="project"
:selected-category="selectedCategory"
@getAjInProjectBtnState="getAjInProjectBtnState"
@getProjectSelections="getProjectSelections"
/>
<!-- 案卷 -->
<archivesAnjuan
v-if="selectedCategory.isType === 2 || selectedCategory.isType === 3|| selectedCategory.isType === 5"
ref="anjuan"
:selected-category="selectedCategory"
:is-project="isProject"
:project-selection="projectSelection"
:fixed-status-bar="fixedStatusBar"
@getJnInAjBtnState="getJnInAjBtnState"
@getSelections="getSelections"
/>
<!-- 卷内 -->
<archivesJuannei
v-if="selectedCategory.isType === 2 || selectedCategory.isType === 3 || selectedCategory.isType === 4"
ref="file"
:is-anjuan="isAnjuan"
:anjuan-selection="anjuanSelection"
:selected-category="selectedCategory"
:fixed-status-bar="fixedStatusBar"
/>
</el-col>
</el-row>
</div>
</template>
<script>
import archivesDetail from './archivesDetail'
// import archivesDetail from './archivesDetail'
import { getDicts } from '@/api/archivesConfig/dict'
import archivesProject from './module/archivesProject/index'
import archivesAnjuan from './module/archivesAnjuan/index'
import archivesJuannei from './module/archivesJuannei/index'
import crudCategory from '@/api/category/category'
import CRUD, { presenter } from '@crud/crud'
export default {
name: 'ArchivesList',
components: { archivesDetail },
components: { archivesProject, archivesAnjuan, archivesJuannei },
cruds() {
return [
CRUD({
title: '门类', url: 'api/archives-type/menu',
title: '档案', url: 'api/archives-type/menu',
crudMethod: { ...crudCategory }
})
]
@ -48,21 +81,25 @@ export default {
mixins: [presenter()],
data() {
return {
intellClassifyTree: [],
defaultProps: {
children: 'children',
label: 'cnName'
},
selectedCategory: {}
intellDefaultProps: {
children: 'childMenus',
label: 'dicName'
},
selectedCategory: {},
isAnjuan: true,
isProject: true,
anjuanSelection: {},
projectSelection: {},
intellClassifyLoading: false,
fixedStatusBar: false
}
},
methods: {
//
// [CRUD.HOOK.beforeRefresh]() {
// if (this.$refs.dictDetail) {
// this.$refs.dictDetail.query.id = ''
// }
// return true
// },
//
findNode(tree, func) {
for (const node of tree) {
@ -85,7 +122,20 @@ export default {
let currentKey
if (localStorage.getItem('currentArchivesKey')) {
currentKey = JSON.parse(localStorage.getItem('currentArchivesKey'))
//
if (this.$refs.archivesTree.getCurrentKey(currentKey.id) == null) {
localStorage.removeItem('currentArchivesKey')
}
//
if (currentKey.isType === 1) {
if (currentKey.children.length !== 0) {
currentKey = this.findNode(currentKey.children, (node) => {
return node.isType !== 1
})
}
}
} else {
//
if (this.crud.data[0].isType === 1) {
currentKey = this.findNode(this.crud.data[0].children, (node) => {
return node.isType !== 1
@ -98,7 +148,7 @@ export default {
//
this.$refs.archivesTree.setCurrentKey(currentKey.id)
this.$nextTick(() => {
//
//
const selectedKey = this.$refs.archivesTree.getCurrentNode()
if (this.$refs.archivesTree.getNode(selectedKey) && this.$refs.archivesTree.getNode(selectedKey).parent) {
this.expandParents(this.$refs.archivesTree.getNode(selectedKey).parent)
@ -107,24 +157,109 @@ export default {
this.handleNodeClick(selectedKey)
})
}
this.getIntellClassify()
},
getIntellClassify() {
getDicts().then(data => {
if (data) {
this.intellClassifyTree = data
}
})
},
//
handleNodeClick(val) {
if (val) {
this.crud.selectionChangeHandler([val])
this.selectedCategory = val
// this.$refs.dictDetail.query.id = val.id
// this.$refs.dictDetail.dicPid = val.id
// this.$refs.dictDetail.crud.toQuery()
// this.activeAddBtn = true
if (val.isType === 2) {
this.$nextTick(() => {
this.$refs.anjuan.anjuanData = []
this.$refs.file.junneiData = []
if (val.children.length !== 0) {
this.$refs.anjuan.getTableDisplayFields()
this.$refs.file.getTableDisplayFields()
}
this.$refs.project.getTableList()
this.getYear('project')
})
} else if (val.isType === 3) {
this.$nextTick(() => {
this.$refs.anjuan.anjuanData = []
this.$refs.file.junneiData = []
this.$refs.anjuan.getTableDisplayFields()
if (val.children.length !== 0) {
this.$refs.file.getTableDisplayFields()
}
this.$refs.anjuan.getTableList()
this.getYear('anjuan')
})
} else if (val.isType === 4) {
this.$nextTick(() => {
this.$refs.file.junneiData = []
this.$refs.file.getTableDisplayFields()
this.$refs.file.getTableList()
this.getYear('file')
})
} else if (val.isType === 5) {
this.$nextTick(() => {
this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.getTableDisplayFields()
this.$refs.anjuan.getTableList()
this.getYear('anjuan')
})
}
//
localStorage.setItem('currentArchivesKey', JSON.stringify(val))
}
},
getYear(obj) {
this.intellClassifyLoading = true
setTimeout(() => {
if (this.intellClassifyTree[0].dicName === '年度') {
this.intellClassifyTree = this.intellClassifyTree.slice(1)
}
if (this.$refs[obj].yearGroup.length !== 0) {
const newYearArr = this.$refs[obj].yearGroup.map(item => {
const json = {}
json.dicName = item
json.childMenus = []
return json
})
this.intellClassifyTree.unshift({ 'dicName': '年度', 'childMenus': newYearArr })
}
this.intellClassifyLoading = false
}, 500)
},
// -btn-
getJnInAjBtnState(data) {
this.isAnjuan = data
},
getAjInProjectBtnState(data) {
this.isProject = data
console.log('isProject', data)
},
getProjectSelections(data) {
this.projectSelection = data
this.$nextTick(() => {
this.$refs.anjuan.getTableList()
})
},
getSelections(data) {
this.anjuanSelection = data
this.$nextTick(() => {
this.$refs.file.getTableList()
})
},
//
handleIntellNodeClick(val) {
if (val) {
console.log(val)
}
}
}
}
</script>
m
<style lang="scss" scoped>
@import "~@/assets/styles/archives-manage.scss";
</style>

517
src/views/archivesManage/archivesList/module/archivesAnjuan/index.vue

@ -0,0 +1,517 @@
<template>
<div class="archives-warp">
<!--工具栏-->
<div class="head-container head-archives clearfix">
<div class="archives-crud">
<!-- 新增 -->
<el-button size="mini" :disabled="isProject && selectedCategory.isType === 2" icon="el-icon-plus" @click="handleForm('add')">新增</el-button>
<!-- 修改 -->
<el-button size="mini" icon="el-icon-edit" :disabled="selections.length !== 1" @click="handleForm('edit')">修改</el-button>
<!-- 删除btn 多选 -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">删除</el-button>
<!-- 导出btn :disabled="!crud.data.length" -->
<el-button v-permission="permission.download" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="doExport">导出</el-button>
<!-- 上传附件btn 针对卷内/文件 单选 -->
<el-button v-if="selectedCategory.isType===5" :disabled="selections.length !== 1" size="mini" icon="el-icon-download" @click="uploadFile">上传附件</el-button>
</div>
<div class="head-search">
<!-- 搜索 -->
<!-- @change="crud.toQuery" -->
<el-select v-model="query.enabled" clearable size="small" placeholder="状态" class="filter-item" style="width: 100px">
<i slot="prefix" class="iconfont icon-zhuangtai-fanbai" />
<el-option v-for="item in stateOptions" :key="item.key" :label="item.label" :value="item.key" />
</el-select>
<!-- @keyup.enter.native="crud.toQuery" -->
<el-input v-model="query[inputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item">
<el-select slot="prepend" v-model="inputSelect" style="width: 80px" @change="querySelect">
<el-option
v-for="item in queryOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-input>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="crud.toQuery">搜索</el-button>
</div>
<div class="archives-handler-btn">
<!-- 装盒btn 多选 -->
<el-button class="packing-btn iconfont icon-weibiaoti-2" type="primary" :disabled="selections.length === 0" @click="handlePacking(selections)">装盒</el-button>
<!-- 分卷装盒btn 针对案卷-单选 -->
<el-button v-if="selectedCategory.isType === 3" class="part-btn iconfont icon-weibiaoti-2" type="primary" :disabled="selections.length !== 1" @click="handlePartPacking(selections)">分卷装盒</el-button>
<!-- <el-button class="warehousing-btn iconfont icon-weibiaoti-2" type="primary">入库</el-button> -->
<!-- 借阅btn 多选 -->
<el-button class="lending-btn iconfont icon-weibiaoti-2" :disabled="selections.length === 0" type="primary" @click="lengingVisible=true">借阅</el-button>
<!-- 绑定标签btn 单选 -->
<el-button class="binding-btn iconfont icon-weibiaoti-2" type="primary" :disabled="selections.length !== 1" @click="handleBinding(selections)">绑定标签</el-button>
</div>
</div>
<!--新增 / 编辑 表单组件-->
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="formVisible" :title="formTitle">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form -->
<PreviewForm v-if="formPreviewData.length && archivesTabIndex == 0" ref="previewForm" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" @emitTableList="getTableList" />
<div slot="footer" class="dialog-footer">
<!-- :loading="crud.status.cu === 2" -->
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
</div>
</div>
</el-dialog>
<!-- 删除档案 -->
<el-dialog title="删除档案" :visible.sync="deleteVisible" :close-on-click-modal="false" :before-close="handleClose">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<div class="dialog-delt">
<p><span>确定删除当前档案吗</span></p>
<p v-if="selectedCategory.isType !== 5">数据来源案卷 {{ selections.length }} 条数据 卷内 {{ totalSumAll }} 条数据</p>
<p v-else>数据来源文件 {{ selections.length }} 条数据 附件 {{ totalSumAll }} 条数据</p>
<p class="delt-tip"><span>提示如果删除当前档案此档案内所附带的文件会一并删除</span></p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button>
</div>
</div>
</el-dialog>
<!-- table表格渲染 -->
<!-- height="calc(100vh - 350px)" -->
<el-card class="box-card" shadow="never">
<span class="right-top-line" />
<span class="left-bottom-line" />
<el-table
ref="table"
v-loading="crud.loading || getTableDisplayFieldsLoading"
class="archives-table"
:data="anjuanData"
highlight-current-row
style="width: 100%; "
@selection-change="crud.selectionChangeHandler"
@row-click="clickRowHandler"
@cell-dblclick="tableDoubleClick"
@select="handleCurrentChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column :label=" selectedCategory.isType === 5 ? '文件':'卷内'" prop="children_num" width="55" align="center" />
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
<template slot="header">
<el-tooltip
class="item"
effect="dark"
:content="field.fieldCnName"
placement="top-start"
>
<span>{{ field.fieldCnName }}</span>
</el-tooltip>
</template>
<template slot-scope="scope">
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
<el-table-column label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<!-- state-active 已装/已入/已借/已绑 -->
<template slot-scope="scope">
<!-- 未装 / 已装 -->
<span class="row-state row-packing state-active">{{ scope.row.case_no ? '已装': '未装' }}</span>
</template>
</el-table-column>
<el-table-column label="入库" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 未入 / 已入 -->
<span class="row-state row-warehousing">未入</span>
</template>
</el-table-column>
<el-table-column label="借阅" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 待借 / 不可借- 表示 / 已借 -->
<span class="row-state row-lending"></span>
</template>
</el-table-column>
<el-table-column label="标签" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="scope">
<!-- 未绑 / 已绑 -->
<span class="row-state row-binding">{{ scope.row.tid ? '已绑': '未绑' }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:current-page="page.page+1"
:total="page.total"
:page-size="page.size"
:pager-count="5"
layout="total, prev, pager, next, sizes"
@size-change="crud.sizeChangeHandler($event)"
@current-change="getTableList"
/>
</el-card>
<!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" :archives-details-data="archivesDetailsData" :archives-details-metadata.sync="archivesDetailsMetadata" />
<!-- 装盒 -->
<Packing ref="packing" />
<!-- 装盒 -->
<PartPacking ref="partPacking" />
<!-- 绑定标签 -->
<Binding ref="bind" :is-binding="isBinding" />
<!-- 借阅 -->
<el-dialog title="借阅" :visible.sync="lengingVisible" :close-on-click-modal="false" :before-close="handleClose">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<div class="dialog-delt">
<p><span>确定将当前档案加入借阅列表</span></p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="lengingVisible=false">确定</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import qs from 'qs'
import { del, FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields, FetchArchivesDetails, FetchArchivesMetadata } from '@/api/archivesManage/archivesList'
import { header, form } from '@crud/crud'
import { exportFile } from '@/utils/index'
// import { initData } from '@/api/data'
// import crudOperation from '@crud/CRUD.operation'
// import rrOperation from '@crud/RR.operation'
// import pagination from '@crud/Pagination'
import PreviewForm from '@/views/components/category/PreviewForm'
import ArchivesInfo from '../archivesInfo/index'
import Packing from '../packing/index'
import PartPacking from '../partPacking/index'
import Binding from '../binding/index'
export default {
name: 'ArchivesAnjuan',
components: { PreviewForm, ArchivesInfo, Packing, Binding, PartPacking },
mixins: [
header(),
form({})
],
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
},
isProject: {
type: Boolean,
default: true
},
projectSelection: {
type: Object,
default: function() {
return {}
}
},
fixedStatusBar: {
type: Boolean,
default: false
}
},
data() {
return {
page: {
page: 0,
size: 10,
total: 0
},
anjuanData: [],
formVisible: false,
formTitle: '新建档案',
isAddOrEditBtn: null,
tableDisplayFields: [], // table-list-title
getTableDisplayFieldsLoading: false, // table-loading
formPreviewData: [], // data
stateOptions: [ // -
{ key: '1', label: '全部' },
{ key: '2', label: '未装' },
{ key: '3', label: '未入' },
{ key: '4', label: '在库' },
{ key: '5', label: '待借' },
{ key: '6', label: '已借' }
],
queryOption: [
{ value: 'maintitle', label: '题名' },
{ value: 'archive_no', label: '档号' },
{ value: 'archive_year', label: '年度' }
],
inputSelect: '',
permission: {
add: ['admin', 'archivesList:add'],
edit: ['admin', 'archivesList:edit'],
del: ['admin', 'archivesList:del'],
download: ['admin', 'archivesList:download']
},
deleteVisible: false, // dialog
deleteData: {}, // data
selections: [], // table
archivesTabIndex: 0, //
arcId: null, // ID
arrySort: [], // sort-query
uploadFileVisible: false, //
archivesInfoVisible: false, //
lengingVisible: false, //
isBinding: false, //
parentsId: null,
isAnjuan: true,
totalSumAll: 0, //
yearGroup: [],
archivesDetailsData: [],
archivesDetailsMetadata: ''
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
},
tableDisplayFields(val) {
this.doLayout()
},
isProject: function(newValue, oldValue) {
},
fixedStatusBar: function(newValue, oldValue) {
},
projectSelection: function(newValue, oldValue) {
}
},
created() {
// select -
this.inputSelect = this.queryOption[0].value
},
mounted() {
},
methods: {
doExport(fileName = '未知文件') {
this.crud.downloadLoading = true
if (this.selectedCategory.pid !== '0') {
this.parentsId = this.categoryId
} else {
this.parentsId = null
}
const params = {
'categoryId': this.selectedCategory.id,
'parentsId': this.parentsId
}
exportFile('api/archives/exportArchives?' + qs.stringify(params))
this.crud.downloadLoading = false
},
// -select
querySelect(val) {
this.inputSelect = val
},
//
getTableDisplayFields() {
this.getTableDisplayFieldsLoading = true
this.selections = []
if (this.selectedCategory.isType === 2) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].id
}
} else {
this.categoryId = this.selectedCategory.id
}
FetchTableDisplayFields({ categoryId: this.categoryId }).then(data => {
if (data) {
this.tableDisplayFields = data
this.getTableDisplayFieldsLoading = false
this.tableDisplayFields.map(item => {
if (item.queue) {
this.arrySort.push(item.fieldName + ', ' + (item.displayOrder === 1 ? 'asc' : 'desc'))
}
})
}
})
},
// list
getTableList(page) {
this.page.page = isNaN(page - 1) ? 0 : page - 1
this.formVisible = false
this.getTableDisplayFieldsLoading = true
if (this.selectedCategory.isType === 3 || this.selectedCategory.isType === 5) {
this.parentsId = null
} else {
this.parentsId = this.projectSelection.id
}
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId,
'isdel': false,
'page': this.page.page,
'size': this.page.size,
'sort': this.arrySort
}
FetchInitArchivesView(params).then(data => {
this.getTableDisplayFieldsLoading = false
if (data) {
this.anjuanData = data.list.content
this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements
}
})
},
// -form/-api
handleForm(type) {
if (type === 'add') {
this.formTitle = '新增档案'
this.arcId = null
this.parentsId = this.projectSelection.id
} else if (type === 'edit') {
this.arcId = this.selections[0].id
this.formTitle = '编辑档案'
}
this.formVisible = true
this.form.dictionaryConfigId = {}
this.formPreviewData = []
//
const params = {
categoryId: this.categoryId,
archivesId: this.arcId
}
this.getFormInfo(params, type)
},
getFormInfo(params, type) {
FetchFormDisplayFields(params).then(data => {
// this.formPreviewData = data.showFiled.filter((fields) => { return fields.isInput })
this.formPreviewData = data.showFiled
this.$nextTick(() => {
if (type === 'edit') {
this.$refs.previewForm.addOrUpdateForm = data.echo
}
})
})
},
// form - submit
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.categoryId)
this.selections = []
},
// table -
tableDoubleClick(row) {
this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0
const params = {
categoryId: this.categoryId,
archivesId: row.id
}
FetchArchivesDetails(params).then(data => {
this.archivesDetailsData = data
})
FetchArchivesMetadata(params).then(data => {
this.archivesDetailsMetadata = data
})
},
// table - row
clickRowHandler(row) {
// this.$refs.table.toggleRowSelection(row)
this.$emit('getSelections', row)
},
//
handleCurrentChange(selection, row) {
this.selections = selection
// -btn-
this.isAnjuan = selection.length !== 1
this.$emit('getJnInAjBtnState', this.isAnjuan)
},
//
toDelete(data) {
this.deleteData = data
this.deleteVisible = true
this.totalSumAll = 0
this.deleteData.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num })
if (isNaN(this.totalSumAll)) {
return 0
}
},
getTotalSumAll() {
this.dataInfo.map((item) => { if (!isNaN(item.totalSum)) this.totalSumAll += item.totalSum })
if (isNaN(this.totalSumAll)) {
return 0
}
return this.totalSumAll
},
//
handleDeltConfirm() {
this.deleteVisible = false
this.crud.delAllLoading = true
// this.crud.doDelete(this.deleteData)
const ids = []
this.deleteData.forEach(val => {
ids.push(val.id)
})
const params = {
'ids': ids,
'categoryId': this.categoryId
}
// fetch
del(params).then(res => {
this.crud.delAllLoading = false
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
this.selections = []
this.getTableList()
})
},
// -
handleClose(done) {
this.formVisible = false
this.deleteData = {}
done()
},
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
},
//
uploadFile() {
this.uploadFileVisible = true
},
uploadFileSave() {
this.uploadFileVisible = false
},
//
handleBinding(data) {
this.$refs.bind.bindingVisible = true
if (data.tid == null) {
this.isBinding = false
this.$refs.bind.bindingTitle = '绑定标签'
} else {
this.isBinding = true
this.$refs.bind.bindingTitle = '重新绑定'
}
},
//
handlePacking(data) {
this.$refs.packing.packingVisible = true
},
//
handlePartPacking(data) {
this.$refs.partPacking.partPackingVisible = true
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/archives-manage.scss";
::v-deep .el-table th.el-table__cell > .cell {
white-space: pre;
// white-space: pre-wrap; //
}
</style>

147
src/views/archivesManage/archivesList/module/archivesInfo/index.vue

@ -11,44 +11,34 @@
<li :class="{'active': archivesTabIndex == 2}" @click="changeActiveTab(2)">元数据</li>
</ul>
<!-- 基本信息 -->
<div v-if="archivesTabIndex==0" class="base-info">
<div v-if="archivesTabIndex==0" class="base-info item-content">
<el-row>
<el-col :span="12" class="base-info-item">
<span>全宗号</span>
<p>父区域-子区域-设备1-1区1列1节1层左边</p>
</el-col>
<el-col :span="12" class="base-info-item">
<span>TID</span>
<p>E2806894200040159AF8AD06</p>
</el-col>
<el-col :span="12" class="base-info-item">
<span>全宗号</span>
<p>父区域-子区域-设备1-1区1列1节1层左边</p>
</el-col>
<el-col :span="12" class="base-info-item">
<span>TID</span>
<p>E2806894200040159AF8AD06</p>
<el-col v-for="(item,index) in archivesDetailsData" :key="index" :span="item.isLine? 24 : 12" class="base-info-item">
<span>{{ item.fieldCnName }}</span>
<p :style="{ width: item.editLength+'px'}">{{ item.context }}</p>
</el-col>
</el-row>
</div>
<!-- 附件 -->
<UploadFile v-if="archivesTabIndex==1" :is-upload-detail="false" />
<UploadFile v-if="archivesTabIndex==1" class="item-content" :is-upload-detail="false" />
<!-- 元数据 -->
<div v-if="archivesTabIndex==2">
<div v-if="archivesTabIndex==2" class="item-content">
<pre v-highlightjs="xml_show">
<code class="highlight_s" />
<code class="highlight_s">
{{ xml_show }}
</code>
</pre>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button>
<el-button type="primary" @click.native="archivesInfoVisible = false">确定</el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import vkbeautify from 'vkbeautify'
// import vkbeautify from 'vkbeautify'
import { form } from '@crud/crud'
import UploadFile from '../uploadFile/index'
export default {
@ -57,41 +47,134 @@ export default {
mixins: [
form({})
],
props: {
archivesDetailsData: {
type: Array,
default: function() {
return []
}
},
archivesDetailsMetadata: {
type: String,
default: function() {
return ''
}
}
},
data() {
return {
archivesInfoVisible: false,
archivesTabIndex: 0,
textareaoutput: null,
xml_show: null
}
},
watch: {
archivesDetailsData: function(newValue, oldValue) {
},
archivesDetailsMetadata: function(newValue, oldValue) {
}
},
created() {
},
mounted() {
this.setXml()
},
methods: {
setXml() {
const xmlstr = `<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>`
this.xml_show = vkbeautify.xml(xmlstr)
const xmlstr = this.archivesDetailsMetadata
// console.log('xmlstr:', xmlstr)
// console.log('xmljson:', this.$x2js.xml2js(xmlstr))
// console.log('jsonxml:', this.$x2js.js2xml(this.$x2js.xml2js(xmlstr)))
this.textareaoutput = xmlstr
// this.xml_show = vkbeautify.xml(xmlstr)
this.xml_show = this.showXml(xmlstr)
},
changeActiveTab(index) {
this.archivesTabIndex = index
if (this.archivesTabIndex === 2) {
this.setXml()
}
},
// -
handleClose(done) {
this.archivesInfoVisible = false
done()
},
getPrefix(prefixIndex) {
var span = ' '
var output = []
for (var i = 0; i < prefixIndex; ++i) {
output.push(span)
}
return output.join('')
},
// ---xml--
showXml(str) {
var that = this
var text = str
//
text =
'\n' +
text
.replace(/(<\w+)(\s.*?>)/g, function($0, name, props) {
return name + ' ' + props.replace(/\s+(\w+=)/g, ' $1')
})
.replace(/>\s*?</g, '>\n<')
//
text = text
.replace(/\n/g, '\r')
.replace(/<!--(.+?)-->/g, function($0, text) {
var ret = '<!--' + escape(text) + '-->'
return ret
})
.replace(/\r/g, '\n')
//
var rgx = /\n(<(([^\?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(?:(\/)>)|(?:<(\/)\2>)))?)/gm
var nodeStack = []
var output = text.replace(rgx, function(
$0,
all,
name,
isBegin,
isCloseFull1,
isCloseFull2,
isFull1,
isFull2
) {
var isClosed =
isCloseFull1 === '/' ||
isCloseFull2 === '/' ||
isFull1 === '/' ||
isFull2 === '/'
var prefix = ''
if (isBegin === '!') {
prefix = that.getPrefix(nodeStack.length)
} else {
if (isBegin !== '/') {
prefix = that.getPrefix(nodeStack.length)
if (!isClosed) {
nodeStack.push(name)
}
} else {
nodeStack.pop()
prefix = that.getPrefix(nodeStack.length)
}
}
var ret = '\n' + prefix + all
return ret
})
var outputText = output.substring(1)
//
outputText = outputText
.replace(/\n/g, '\r')
.replace(/(\s*)<!--(.+?)-->/g, function($0, prefix, text) {
if (prefix.charAt(0) === '\r') prefix = prefix.substring(1)
text = unescape(text).replace(/\r/g, '\n')
var ret =
'\n' + prefix + '<!--' + text.replace(/^\s*/gm, prefix) + '-->'
return ret
})
outputText = outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n')
return outputText
}
}
}

453
src/views/archivesManage/archivesList/module/archivesJuannei/index.vue

@ -0,0 +1,453 @@
<template>
<div class="archives-warp">
<!--工具栏-->
<div class="head-container head-archives clearfix">
<div class="archives-crud">
<!-- 新增 -->
<el-button v-if="selectedCategory.isType !== 4" size="mini" :disabled="isAnjuan" icon="el-icon-plus" @click="handleForm('add')">新增</el-button>
<!-- 修改 -->
<el-button size="mini" icon="el-icon-edit" :disabled="selections.length !== 1" @click="handleForm('edit')">修改</el-button>
<!-- 删除btn 多选 -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">删除</el-button>
<!-- 导出btn :disabled="!crud.data.length" -->
<el-button v-permission="permission.download" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="doExport">导出</el-button>
<!-- 上传附件btn 针对卷内/文件 单选 -->
<el-button :disabled="selections.length !== 1" size="mini" icon="el-icon-download" @click="uploadFile">上传附件</el-button>
</div>
<div class="head-search">
<!-- @keyup.enter.native="crud.toQuery" -->
<el-input v-model="query[inputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item">
<el-select slot="prepend" v-model="inputSelect" style="width: 80px" @change="querySelect">
<el-option
v-for="item in queryOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-input>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="crud.toQuery">搜索</el-button>
</div>
</div>
<!--新增 / 编辑 表单组件-->
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="formVisible" :title="formTitle">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form -->
<PreviewForm v-if="formPreviewData.length && archivesTabIndex == 0" ref="previewForm" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" @emitTableList="getTableList" />
<div slot="footer" class="dialog-footer">
<!-- :loading="crud.status.cu === 2" -->
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
</div>
</div>
</el-dialog>
<!-- 删除档案 -->
<el-dialog title="删除档案" :visible.sync="deleteVisible" :close-on-click-modal="false" :before-close="handleClose">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<div class="dialog-delt">
<p><span>确定删除当前档案吗</span></p>
<p>数据来源卷内 {{ selections.length }} 条数据 附件 {{ totalSumAll }} 条数据 </p>
<p class="delt-tip"><span>提示如果删除当前档案此档案内所附带的文件会一并删除</span></p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button>
</div>
</div>
</el-dialog>
<!-- table表格渲染 -->
<!-- height="calc(100vh - 350px)" -->
<el-card class="box-card" shadow="never">
<span class="right-top-line" />
<span class="left-bottom-line" />
<el-table
ref="table"
v-loading="crud.loading || getTableDisplayFieldsLoading"
class="archives-table"
:data="junneiData"
highlight-current-row
style="width: 100%; "
@selection-change="crud.selectionChangeHandler"
@row-click="clickRowHandler"
@cell-dblclick="tableDoubleClick"
@select="handleCurrentChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="文件" prop="children_num" width="55" align="center" />
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
<template slot="header">
<el-tooltip
class="item"
effect="dark"
:content="field.fieldCnName"
placement="top-start"
>
<span>{{ field.fieldCnName }}</span>
</el-tooltip>
</template>
<template slot-scope="scope">
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
<el-table-column label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<!-- state-active 已装/已入/已借/已绑 -->
<template slot-scope="scope">
<!-- 未装 / 已装 -->
<span class="row-state row-packing state-active">{{ scope.row.case_no ? '已装': '未装' }}</span>
</template>
</el-table-column>
<el-table-column label="入库" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 未入 / 已入 -->
<span class="row-state row-warehousing">未入</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:current-page="page.page+1"
:total="page.total"
:page-size="page.size"
:pager-count="5"
layout="total, prev, pager, next, sizes"
@size-change="crud.sizeChangeHandler($event)"
@current-change="getTableList"
/>
</el-card>
<!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" :archives-details-data="archivesDetailsData" :archives-details-metadata.sync="archivesDetailsMetadata" />
<!-- 上传附件 -->
<el-dialog class="upload-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible.sync="uploadFileVisible" title="上传附件">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<UploadFile ref="uploadFile" />
<div slot="footer" class="dialog-footer">
<el-button :loading="crud.status.cu === 2" type="primary" @click="uploadFileSave">保存</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import qs from 'qs'
import { del, FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields, FetchArchivesDetails, FetchArchivesMetadata } from '@/api/archivesManage/archivesList'
import { header, form } from '@crud/crud'
import { exportFile } from '@/utils/index'
// import { initData } from '@/api/data'
// import crudOperation from '@crud/CRUD.operation'
// import rrOperation from '@crud/RR.operation'
// import pagination from '@crud/Pagination'
import PreviewForm from '@/views/components/category/PreviewForm'
import ArchivesInfo from '../archivesInfo/index'
import UploadFile from '../uploadFile/index'
export default {
name: 'ArchivesJuannei',
components: { PreviewForm, ArchivesInfo, UploadFile },
mixins: [
header(),
form({})
],
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
},
isAnjuan: {
type: Boolean,
default: true
},
fixedStatusBar: {
type: Boolean,
default: true
},
anjuanSelection: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
page: {
page: 0,
size: 10,
total: 0
},
junneiData: [],
formVisible: false,
formTitle: '新建档案',
isAddOrEditBtn: null,
tableDisplayFields: [], // table-list-title
getTableDisplayFieldsLoading: false, // table-loading
formPreviewData: [], // data
stateOptions: [ // -
{ key: '1', label: '全部' },
{ key: '2', label: '未装' },
{ key: '3', label: '未入' },
{ key: '4', label: '在库' },
{ key: '5', label: '待借' },
{ key: '6', label: '已借' }
],
queryOption: [
{ value: 'maintitle', label: '题名' },
{ value: 'archive_no', label: '档号' },
{ value: 'archive_year', label: '年度' }
],
inputSelect: '',
permission: {
add: ['admin', 'archivesList:add'],
edit: ['admin', 'archivesList:edit'],
del: ['admin', 'archivesList:del'],
download: ['admin', 'archivesList:download']
},
deleteVisible: false, // dialog
deleteData: {}, // data
selections: [], // table
archivesTabIndex: 0, //
arcId: null, // ID
arrySort: [], // sort-query
uploadFileVisible: false, //
archivesInfoVisible: false, //
lengingVisible: false, //
isBinding: false, //
parentsId: null,
categoryId: null,
totalSumAll: 0,
yearGroup: [],
archivesDetailsData: [],
archivesDetailsMetadata: ''
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
this.setCategory = newValue
},
tableDisplayFields(val) {
this.doLayout()
},
isAnjuan: function(newValue, oldValue) {
},
fixedStatusBar: function(newValue, oldValue) {
},
anjuanSelection: function(newValue, oldValue) {
}
},
created() {
// select -
this.inputSelect = this.queryOption[0].value
this.selections = []
},
mounted() {
// this.getTableDisplayFields()
},
methods: {
doExport(fileName = '未知文件') {
this.crud.downloadLoading = true
if (this.selectedCategory.pid !== '0') {
this.parentsId = this.selectedCategory.pid
} else {
this.parentsId = null
}
const params = {
'categoryId': this.selectedCategory.id,
'parentsId': this.parentsId
}
exportFile('api/archives/exportArchives?' + qs.stringify(params))
this.crud.downloadLoading = false
},
// -select
querySelect(val) {
this.inputSelect = val
},
//
getTableDisplayFields() {
this.selections = []
if (this.selectedCategory.isType === 2) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].children[0].id
}
} else if (this.selectedCategory.isType === 3) {
if (this.selectedCategory.children.length !== 0) {
this.categoryId = this.selectedCategory.children[0].id
}
} else {
this.categoryId = this.selectedCategory.id
}
FetchTableDisplayFields({ categoryId: this.categoryId }).then(data => {
if (data) {
this.tableDisplayFields = data
this.getTableDisplayFieldsLoading = false
this.tableDisplayFields.map(item => {
if (item.queue) {
this.arrySort.push(item.fieldName + ', ' + (item.displayOrder === 1 ? 'asc' : 'desc'))
}
})
}
})
},
// list
getTableList(page) {
this.page.page = isNaN(page - 1) ? 0 : page - 1
this.formVisible = false
this.getTableDisplayFieldsLoading = true
if (this.selectedCategory.isType !== 4) {
this.parentsId = this.anjuanSelection.id
} else {
this.parentsId = null
}
const params = {
'categoryId': this.categoryId,
'parentsId': this.parentsId,
'isdel': false,
'page': this.page.page,
'size': this.page.size,
'sort': this.arrySort
}
FetchInitArchivesView(params).then(data => {
this.getTableDisplayFieldsLoading = false
if (data) {
this.junneiData = data.list.content
this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements
}
})
},
// -form/-api
handleForm(type) {
if (type === 'add') {
this.formTitle = '新增档案'
this.arcId = null
this.parentsId = this.anjuanSelection.id
} else if (type === 'edit') {
this.arcId = this.selections[0].id
this.formTitle = '编辑档案'
}
this.formVisible = true
this.form.dictionaryConfigId = {}
this.formPreviewData = []
//
const params = {
categoryId: this.categoryId,
archivesId: this.arcId
}
this.getFormInfo(params, type)
},
getFormInfo(params, type) {
FetchFormDisplayFields(params).then(data => {
// this.formPreviewData = data.showFiled.filter((fields) => { return fields.isInput })
this.formPreviewData = data.showFiled
this.$nextTick(() => {
if (type === 'edit') {
this.$refs.previewForm.addOrUpdateForm = data.echo
}
})
})
},
// form - submit
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.categoryId)
this.selections = []
},
// table -
tableDoubleClick(row) {
this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0
const params = {
categoryId: this.categoryId,
archivesId: row.id
}
FetchArchivesDetails(params).then(data => {
this.archivesDetailsData = data
})
FetchArchivesMetadata(params).then(data => {
this.archivesDetailsMetadata = data
})
},
// table - row
clickRowHandler(row) {
},
//
handleCurrentChange(selection, row) {
this.selections = selection
},
//
toDelete(data) {
this.deleteData = data
this.deleteVisible = true
this.totalSumAll = 0
this.deleteData.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num })
if (isNaN(this.totalSumAll)) {
return 0
}
},
//
handleDeltConfirm() {
this.deleteVisible = false
this.crud.delAllLoading = true
// this.crud.doDelete(this.deleteData)
const ids = []
this.deleteData.forEach(val => {
ids.push(val.id)
})
const params = {
'ids': ids,
'categoryId': this.categoryId
}
// fetch
del(params).then(res => {
this.crud.delAllLoading = false
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
this.selections = []
this.getTableList()
})
},
// -
handleClose(done) {
this.formVisible = false
this.deleteData = {}
done()
},
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
},
//
uploadFile() {
this.uploadFileVisible = true
},
uploadFileSave() {
this.uploadFileVisible = false
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/archives-manage.scss";
::v-deep .el-table th.el-table__cell > .cell {
white-space: pre;
// white-space: pre-wrap; //
}
</style>

369
src/views/archivesManage/archivesList/module/archivesProject/index.vue

@ -0,0 +1,369 @@
<template>
<div class="archives-warp">
<!--工具栏-->
<div class="head-container head-archives clearfix">
<div class="archives-crud">
<!-- 新增 -->
<el-button size="mini" icon="el-icon-plus" @click="handleForm('add')">新增</el-button>
<!-- 修改 -->
<el-button size="mini" icon="el-icon-edit" :disabled="selections .length !== 1" @click="handleForm('edit')">修改</el-button>
<!-- 删除btn 多选 -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="selections .length === 0" @click="toDelete(selections )">删除</el-button>
</div>
<div class="head-search">
<!-- @keyup.enter.native="crud.toQuery" -->
<el-input v-model="query[inputSelect]" clearable size="small" placeholder="请输入关键词" style="width: 200px;" class="input-prepend filter-item">
<el-select slot="prepend" v-model="inputSelect" style="width: 80px" @change="querySelect">
<el-option
v-for="item in queryOption"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-input>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="crud.toQuery">搜索</el-button>
</div>
</div>
<!--新增 / 编辑 表单组件-->
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="formVisible" :title="formTitle">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form -->
<PreviewForm v-if="formPreviewData.length && archivesTabIndex == 0" ref="previewForm" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" @emitTableList="getTableList" />
<div slot="footer" class="dialog-footer">
<!-- :loading="crud.status.cu === 2" -->
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
</div>
</div>
</el-dialog>
<!-- 删除档案 -->
<el-dialog title="删除档案" :visible.sync="deleteVisible" :close-on-click-modal="false" :before-close="handleClose">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<div class="dialog-delt">
<p><span>确定删除当前项目吗</span></p>
<p>数据来源项目 {{ selections.length }} 条数据 案卷 {{ totalSumAll }} 条数据</p>
<p class="delt-tip"><span>提示如果删除当前档案此档案内所附带的文件会一并删除</span></p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button>
</div>
</div>
</el-dialog>
<!-- table表格渲染 -->
<!-- height="calc(100vh - 350px)" -->
<el-card class="box-card" shadow="never">
<span class="right-top-line" />
<span class="left-bottom-line" />
<el-table
ref="table"
v-loading="crud.loading || getTableDisplayFieldsLoading"
class="archives-table"
:data="projectData"
highlight-current-row
style="width: 100%; "
@selection-change="crud.selectionChangeHandler"
@row-click="clickRowHandler"
@cell-dblclick="tableDoubleClick"
@select="handleCurrentChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="案卷" prop="children_num" width="55" align="center" />
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
<template slot="header">
<el-tooltip
class="item"
effect="dark"
:content="field.fieldCnName"
placement="top-start"
>
<span>{{ field.fieldCnName }}</span>
</el-tooltip>
</template>
<template slot-scope="scope">
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:current-page="page.page+1"
:total="page.total"
:page-size="page.size"
:pager-count="5"
layout="total, prev, pager, next, sizes"
@size-change="crud.sizeChangeHandler($event)"
@current-change="getTableList"
/>
</el-card>
<!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" :archives-details-data="archivesDetailsData" :archives-details-metadata.sync="archivesDetailsMetadata" />
</div>
</template>
<script>
import { del, FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields, FetchArchivesDetails, FetchArchivesMetadata } from '@/api/archivesManage/archivesList'
import { header, form } from '@crud/crud'
// import { initData } from '@/api/data'
// import crudOperation from '@crud/CRUD.operation'
// import rrOperation from '@crud/RR.operation'
// import pagination from '@crud/Pagination'
import PreviewForm from '@/views/components/category/PreviewForm'
import ArchivesInfo from '../archivesInfo/index'
export default {
name: 'ArchivesProject',
components: { PreviewForm, ArchivesInfo },
mixins: [
header(),
form({})
],
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
page: {
page: 0,
size: 10,
total: 0
},
projectData: [],
formVisible: false,
formTitle: '新建项目',
isAddOrEditBtn: null,
tableDisplayFields: [], // table-list-title
getTableDisplayFieldsLoading: false, // table-loading
formPreviewData: [], // data
stateOptions: [ // -
{ key: '1', label: '全部' },
{ key: '2', label: '未装' },
{ key: '3', label: '未入' },
{ key: '4', label: '在库' },
{ key: '5', label: '待借' },
{ key: '6', label: '已借' }
],
queryOption: [
{ value: 'maintitle', label: '题名' },
{ value: 'archive_no', label: '档号' },
{ value: 'archive_year', label: '年度' }
],
inputSelect: '',
permission: {
add: ['admin', 'archivesList:add'],
edit: ['admin', 'archivesList:edit'],
del: ['admin', 'archivesList:del'],
download: ['admin', 'archivesList:download']
},
fixedStatusBar: false, // table-fixed
deleteVisible: false, // dialog
deleteData: {}, // data
selections: [], // table
archivesTabIndex: 0, //
arcId: null, // ID
arrySort: [], // sort-query
uploadFileVisible: false, //
archivesInfoVisible: false, //
lengingVisible: false, //
isBinding: false, //
parentsId: null,
isProject: true,
anjuanSelection: {},
totalSumAll: 0,
yearGroup: [],
archivesDetailsData: [],
archivesDetailsMetadata: ''
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
},
tableDisplayFields(val) {
this.doLayout()
}
},
created() {
// select -
this.inputSelect = this.queryOption[0].value
this.selections = []
},
mounted() {
this.getTableDisplayFields()
},
methods: {
// -select
querySelect(val) {
this.inputSelect = val
},
//
getTableDisplayFields() {
this.selections = []
FetchTableDisplayFields({ categoryId: this.selectedCategory.id }).then(data => {
if (data) {
this.tableDisplayFields = data
this.getTableDisplayFieldsLoading = false
this.tableDisplayFields.map(item => {
if (item.queue) {
this.arrySort.push(item.fieldName + ', ' + (item.displayOrder === 1 ? 'asc' : 'desc'))
}
})
}
})
},
// list
getTableList(page) {
this.page.page = isNaN(page - 1) ? 0 : page - 1
this.formVisible = false
this.getTableDisplayFieldsLoading = true
this.parentsId = null
const params = {
'categoryId': this.selectedCategory.id,
'parentsId': this.parentsId,
'isdel': false,
'page': this.page.page,
'size': this.page.size,
'sort': this.arrySort
}
FetchInitArchivesView(params).then(data => {
this.getTableDisplayFieldsLoading = false
if (data) {
this.projectData = data.list.content
this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements
}
})
},
// -form/-api
handleForm(type) {
if (type === 'add') {
this.arcId = null
this.formTitle = '新建项目'
} else if (type === 'edit') {
this.arcId = this.selections[0].id
this.formTitle = '编辑项目'
}
this.formVisible = true
this.form.dictionaryConfigId = {}
this.formPreviewData = []
//
const params = {
categoryId: this.selectedCategory.id,
archivesId: this.arcId
}
this.getFormInfo(params, type)
},
getFormInfo(params, type) {
FetchFormDisplayFields(params).then(data => {
// this.formPreviewData = data.showFiled.filter((fields) => { return fields.isInput })
this.formPreviewData = data.showFiled
this.$nextTick(() => {
if (type === 'edit') {
this.$refs.previewForm.addOrUpdateForm = data.echo
}
})
})
},
// form - submit
handlerArchivesSubmit() {
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id)
this.selections = []
},
// table -
tableDoubleClick(row) {
this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0
const params = {
categoryId: this.categoryId,
archivesId: row.id
}
FetchArchivesDetails(params).then(data => {
this.archivesDetailsData = data
})
FetchArchivesMetadata(params).then(data => {
this.archivesDetailsMetadata = data
})
},
// table - row
clickRowHandler(row) {
this.$emit('getProjectSelections', row)
},
//
handleCurrentChange(selection, row) {
// this.$refs.table.toggleRowSelection(row)
this.selections = selection
// -btn-
this.isProject = selection.length !== 1
this.$emit('getAjInProjectBtnState', this.isProject)
},
//
toDelete(data) {
this.deleteData = data
this.deleteVisible = true
this.totalSumAll = 0
this.deleteData.map((item) => { if (!isNaN(item.children_num)) this.totalSumAll += item.children_num })
if (isNaN(this.totalSumAll)) {
return 0
}
},
//
handleDeltConfirm() {
this.deleteVisible = false
this.crud.delAllLoading = true
// this.crud.doDelete(this.deleteData)
const ids = []
this.deleteData.forEach(val => {
ids.push(val.id)
})
const params = {
'ids': ids,
'categoryId': this.selectedCategory.id
}
// fetch
del(params).then(res => {
this.crud.delAllLoading = false
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
this.selections = []
this.getTableList()
})
},
// -
handleClose(done) {
this.formVisible = false
this.deleteData = {}
done()
},
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/archives-manage.scss";
::v-deep .el-table th.el-table__cell > .cell {
white-space: pre;
// white-space: pre-wrap; //
}
</style>

230
src/views/archivesManage/archivesList/module/table/index.vue

@ -0,0 +1,230 @@
<template>
<div>
<!-- table表格渲染 -->
<el-card class="box-card" shadow="never">
<span class="right-top-line" />
<span class="left-bottom-line" />
<el-table
ref="table"
v-loading="crud.loading || getTableDisplayFieldsLoading"
class="archives-table"
:data="anjuanData"
highlight-current-row
style="width: 100%; "
height="calc(100vh - 350px)"
@selection-change="crud.selectionChangeHandler"
@row-click="clickRowHandler"
@cell-dblclick="tableDoubleClick"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row[field.fieldName] }}
</template>
</el-table-column>
<el-table-column label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<!-- state-active 已装/已入/已借/已绑 -->
<template slot-scope="scope">
<!-- 未装 / 已装 -->
<span class="row-state row-packing state-active">{{ scope.row.case_no ? '已装': '未装' }}</span>
</template>
</el-table-column>
<el-table-column label="入库" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 未入 / 已入 -->
<span class="row-state row-warehousing">未入</span>
</template>
</el-table-column>
<el-table-column label="借阅" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="">
<!-- 待借 / 不可借- 表示 / 已借 -->
<span class="row-state row-lending"></span>
</template>
</el-table-column>
<el-table-column label="标签" width="100" align="center" :fixed="fixedStatusBar?false:'right'">
<template slot-scope="scope">
<!-- 未绑 / 已绑 -->
<span class="row-state row-binding">{{ scope.row.tid ? '已绑': '未绑' }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</el-card>
<!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" />
</div>
</template>
<script>
import { FetchInitArchivesView, FetchTableDisplayFields } from '@/api/archivesManage/archivesList'
import { header, form } from '@crud/crud'
// import { initData } from '@/api/data'
// import crudOperation from '@crud/CRUD.operation'
// import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import ArchivesInfo from '../archivesInfo/index'
export default {
name: 'TableAnjuan',
components: { pagination, ArchivesInfo },
mixins: [
header(),
form({})
],
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
anjuanData: [],
formVisible: false,
formTitle: '新建档案',
isAddOrEditBtn: null,
tableDisplayFields: [], // table-list-title
getTableDisplayFieldsLoading: false, // table-loading
formPreviewData: [], // data
stateOptions: [ // -
{ key: '1', label: '全部' },
{ key: '2', label: '未装' },
{ key: '3', label: '未入' },
{ key: '4', label: '在库' },
{ key: '5', label: '待借' },
{ key: '6', label: '已借' }
],
queryOption: [
{ value: 'maintitle', label: '题名' },
{ value: 'archive_no', label: '档号' },
{ value: 'archive_year', label: '年度' }
],
inputSelect: '',
permission: {
add: ['admin', 'archivesList:add'],
edit: ['admin', 'archivesList:edit'],
del: ['admin', 'archivesList:del'],
download: ['admin', 'archivesList:download']
},
fixedStatusBar: false, // table-fixed
deleteVisible: false, // dialog
deleteData: {}, // data
selections: [], // table
archivesTabIndex: 0, //
arcId: null, // ID
arrySort: [], // sort-query
uploadFileVisible: false, //
archivesInfoVisible: false, //
lengingVisible: false, //
isBinding: false, //
parentsId: null
}
},
watch: {
selectedCategory: function(newValue, oldValue) {
//
if (newValue.isType === 3 || newValue.isType === 4 || newValue.isType === 5) {
// this.crud.query.categoryId = newValue.id
}
},
tableDisplayFields(val) {
this.doLayout()
}
},
mounted() {
this.getTableDisplayFields()
},
methods: {
//
getTableDisplayFields() {
FetchTableDisplayFields({ categoryId: this.selectedCategory.id }).then(data => {
this.tableDisplayFields = data
this.getTableDisplayFieldsLoading = false
this.tableDisplayFields.map(item => {
if (item.queue) {
this.arrySort.push(item.fieldName + ', ' + (item.displayOrder === 1 ? 'asc' : 'desc'))
}
})
this.getTableList()
})
},
// list
getTableList() {
if (this.selectedCategory.pid !== '0') {
this.parentsId = this.selectedCategory.pid
} else {
this.parentsId = null
}
const params = {
'categoryId': this.selectedCategory.id,
'parentsId': this.parentsId,
'isdel': false,
'page': 0,
'size': 10,
'sort': this.arrySort
}
FetchInitArchivesView(params).then(data => {
if (data) {
this.anjuanData = data.content
}
})
},
// table -
tableDoubleClick(row) {
this.$refs.archivesInfo.archivesInfoVisible = true
const params = {
categoryId: this.selectedCategory.id,
archivesId: row.id
}
this.getFormInfo(params)
},
// table - row
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row)
this.selections = this.crud.selections
console.log(this.crud.selections.id)
},
//
toDelete(data) {
this.deleteData = data
this.deleteVisible = true
},
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "~@/assets/styles/archives-manage.scss";
.preview-dialog {
::v-deep .el-dialog {
.el-dialog__body{
padding: 0;
}
.preview-content {
width: auto !important;
margin-right: 6px;
overflow: hidden;
overflow-y: auto;
.el-textarea__inner {
border: 1px solid #339cff;
background-color: transparent;
}
}
.dialog-footer{
margin: 0 auto;
padding: 15px 0 20px 0;
}
}
}
</style>

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

@ -70,7 +70,7 @@
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<el-table ref="table" :data="tableData" highlight-current-row row-key="id" :tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler">
<el-table ref="popoverTable" :data="popoverTableData" highlight-current-row row-key="id" :tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="dicName" label="字典名称" />
<el-table-column prop="dicCode" label="字典代码" />
@ -83,7 +83,7 @@
<script>
// import formPreviewData from './data.json'
import CRUD, { form } from '@crud/crud'
import { form } from '@crud/crud'
import { edit, FetchDoeditIsRepeat } from '@/api/archivesManage/archivesList'
import draggable from 'vuedraggable'
import Treeselect from '@riophae/vue-treeselect'
@ -114,17 +114,23 @@ export default {
arcId: {
type: String,
default: ''
},
parentsId: {
type: String,
default: ''
}
},
data() {
return {
addOrUpdateForm: {},
rules: {},
tableData: [], // popover - tableData
popoverTableData: [], // popover - popoverTableData
popoverVisible: false, // popover - visible
currentFieldName: null, // popover fieldName
treeCurrentFiled: null,
categoryId: null,
setParentsId: null,
result: null,
normalizer(node) {
if (node.childMenus == null || node.childMenus === 'null') {
delete node.childMenus
@ -141,29 +147,42 @@ export default {
selectedCategory: function(newValue, oldValue) {
},
arcId: function(newValue, oldValue) {
},
parentsId: function(newValue, oldValue) {
}
},
mounted() {
this.getAllSubset()
// this.getAllSubset()
this.editFormRow()
},
methods: {
//
getAllSubset() {
this.formPreviewData.map(item => {
this.$set(item, 'options', [])
if (item.dictionaryConfigId) {
FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => {
if (item.isInputClass === 'select') {
this.$set(item, 'options', res)
} else if (item.isInputClass === 'popover') {
if (item.fieldName === this.currentFieldName) {
this.tableData = res
}
}
})
}
})
getAllSubset(item) {
if (item.dictionaryConfigId) {
FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => {
if (item.isInputClass === 'select') {
this.$set(item, 'options', res)
} else if (item.isInputClass === 'popover') {
// if (item.fieldName === this.currentFieldName) {
this.popoverTableData = res
// }
}
})
}
// this.formPreviewData.map(item => {
// this.$set(item, 'options', [])
// if (item.dictionaryConfigId) {
// FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => {
// if (item.isInputClass === 'select') {
// this.$set(item, 'options', res)
// } else if (item.isInputClass === 'popover') {
// if (item.fieldName === this.currentFieldName) {
// this.popoverTableData = res
// }
// }
// })
// }
// })
},
// api
handlerIsRepeat(params, item) {
@ -189,6 +208,8 @@ export default {
// tree - open
openTree(item) {
this.treeCurrentFiled = item
this.$set(item, 'options', [])
this.getAllSubset(this.treeCurrentFiled)
},
// tree - select
selectTree(val) {
@ -206,28 +227,32 @@ export default {
},
// popover - table
clickRowHandler(row) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row)
this.$refs.popoverTable.clearSelection()
this.$refs.popoverTable.toggleRowSelection(row)
},
// popover - table
handleSelectionChange(val) {
if (val.length > 0) {
this.addOrUpdateForm[this.currentFieldName] = val[0].dicName
}
this.$refs.table.clearSelection()
this.$refs.popoverTable.clearSelection()
this.popoverVisible = false
},
// popover -
handleCurrentFieldName(item) {
this.popoverVisible = true
this.currentFieldName = item.fieldName
this.tableData = []
this.getAllSubset(item)
},
//
editFormRow() {
this.rules = {}
this.formPreviewData.map(item => {
// this.$set(this.addOrUpdateForm, item.fieldName, '')
if (item.isDefaultValue !== '') {
this.$set(this.addOrUpdateForm, item.fieldName, item.isDefaultValue)
} else {
this.$set(this.addOrUpdateForm, item.fieldName, '')
}
if (item.isInputClass === 'select') {
this.$set(this.addOrUpdateForm, item.fieldName, null) // unkonwn
}
@ -245,13 +270,8 @@ export default {
evt.preventDefault()
console.log('拖动前的索引 :' + evt.oldIndex)
console.log('拖动后的索引 :' + evt.newIndex)
// console.log(this.formPreviewData)// ()
// console.log(' :' +
// this.formPreviewData[evt.oldIndex])
// console.log(' :' +
// this.formPreviewData[evt.newIndex])
},
submitForm(formName, arcId) {
submitForm(formName, categoryId) {
//
this.formPreviewData.map(item => {
if (item.isInputClass === 'date') {
@ -260,11 +280,15 @@ export default {
}
}
})
const parent_id = this.selectedCategory.pid
if (parseInt(parent_id) === 0) {
this.addOrUpdateForm.parent_id = null
if (this.selectedCategory.isType !== 4 || this.selectedCategory.isType !== 3) {
this.setParentsId = this.parentsId
} else {
this.addOrUpdateForm.parent_id = parent_id
const parent_id = this.selectedCategory.pid
if (parseInt(parent_id) === 0) {
this.setParentsId = null
} else {
this.setParentsId = parent_id
}
}
delete this.addOrUpdateForm.id
console.log(this.addOrUpdateForm)
@ -272,9 +296,11 @@ export default {
if (valid) {
const params = {
'id': this.arcId,
'categoryId': this.selectedCategory.id,
'categoryId': categoryId,
'parentsId': this.setParentsId,
'jsonString': JSON.stringify(this.addOrUpdateForm)
}
console.log(params)
edit(params).then(res => {
if (res) {
this.$notify({
@ -282,8 +308,7 @@ export default {
type: 'success',
duration: 2500
})
this.crud.status.add = CRUD.STATUS.NORMAL
this.crud.status.edit = CRUD.STATUS.NORMAL
this.$emit('emitTableList')
this.crud.refresh()
}
})

Loading…
Cancel
Save