Browse Source

档案管理选中状态保持问题

master
xuhuajiao 2 years ago
parent
commit
945a46653f
  1. 8
      src/assets/styles/yxk-admin.scss
  2. 10
      src/views/archivesManage/archivesList/archivesAnjuan/index.vue
  3. 8
      src/views/archivesManage/archivesList/archivesJuannei/index.vue
  4. 10
      src/views/archivesManage/archivesList/archivesProject/index.vue
  5. 156
      src/views/archivesManage/archivesList/index.vue
  6. 23
      src/views/archivesManage/archivesList/mixins/archives.js
  7. 10
      src/views/archivesManage/archivesList/module/deltArchives/index.vue
  8. 7
      src/views/category/descriptionPreview/index.vue
  9. 15
      src/views/components/category/PreviewForm.vue

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

@ -1216,10 +1216,10 @@ input[type='number'] {
}
// table 选中状态
// .el-table__body .rowStyle>td {
// color: #fff !important;
// background-color: #13439E !important;
// }
.el-table__body .rowStyle>td {
color: #fff !important;
background-color: #13439E !important;
}
// 数据为空
.empty-main{

10
src/views/archivesManage/archivesList/archivesAnjuan/index.vue

@ -56,7 +56,7 @@
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form -->
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="false" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" @emitTableList="getTableList" />
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="false" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" @emitTableList="getTableList" />
<div slot="footer" class="dialog-footer">
<!-- :loading="crud.status.cu === 2" -->
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
@ -77,13 +77,15 @@
highlight-current-row
style="width: 100%;"
:height="anjuanTableHeight"
:row-class-name="tableRowClassName"
:row-key="rowKey"
@select-all="selectAll"
@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="selection" :reserve-selection="true" 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>
@ -158,7 +160,7 @@
<!-- 还原 -->
<RestoreArchives ref="restore" :selections="selections" :category-id="categoryId" />
<!-- 删除档案 -->
<DeltArchives ref="deltArchives" :selections="selections" :category-id="categoryId" :total-sum-all="totalSumAll" />
<DeltArchives ref="deltArchives" :selections="selections" :category-id="categoryId" :total-sum-all="totalSumAll" :is-delt-type="2" />
<!-- 借阅 -->
<el-dialog title="借阅" :visible.sync="lengingVisible" :close-on-click-modal="false" :before-close="handleClose">
@ -310,6 +312,7 @@ export default {
handleSizeChange(size) {
this.page.size = size
this.page.page = 1
this.getListCommon('anjuanData', 'anjuanTableHeight', 1)
},
// list
@ -345,6 +348,7 @@ export default {
this.selections = val
this.isAnjuan = val.length !== 1
this.$emit('getJnInAjBtnState', this.isAnjuan)
this.$emit('getSelections', val, this.selections)
},
// table -
tableDoubleClick(row) {

8
src/views/archivesManage/archivesList/archivesJuannei/index.vue

@ -41,7 +41,7 @@
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form -->
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="false" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" @emitTableList="getTableList" />
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-has-code="false" :is-disabled="false" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" @emitTableList="getTableList" />
<div slot="footer" class="dialog-footer">
<!-- :loading="crud.status.cu === 2" -->
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
@ -61,13 +61,15 @@
highlight-current-row
style="width: 100%;"
:height="juanneiTableHeight"
:row-class-name="tableRowClassName"
:row-key="rowKey"
@select-all="selectAll"
@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="selection" width="55" :reserve-selection="true" 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>
@ -116,7 +118,7 @@
<!-- 还原 -->
<RestoreArchives ref="restore" :selections="selections" :category-id="categoryId" />
<!-- 删除档案 -->
<DeltArchives ref="deltArchives" :selections="selections" :category-id="categoryId" :total-sum-all="totalSumAll" />
<DeltArchives ref="deltArchives" :selections="selections" :category-id="categoryId" :total-sum-all="totalSumAll" :is-delt-type="3" />
<!-- 上传附件 -->
<el-dialog class="upload-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible.sync="uploadFileVisible" title="上传附件">

10
src/views/archivesManage/archivesList/archivesProject/index.vue

@ -37,7 +37,7 @@
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form -->
<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" @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" @emitTableList="getTableList" />
<div slot="footer" class="dialog-footer">
<!-- :loading="crud.status.cu === 2" -->
<el-button type="primary" @click="handlerArchivesSubmit">保存</el-button>
@ -58,13 +58,15 @@
highlight-current-row
style="width: 100%;"
:height="projectTableHeight"
:row-key="rowKey"
:row-class-name="tableRowClassName"
@select-all="selectAll"
@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="selection" :reserve-selection="true" 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>
@ -100,7 +102,7 @@
<!-- 还原 -->
<RestoreArchives ref="restore" :selections="selections" :category-id="categoryId" />
<!-- 删除档案 -->
<DeltArchives ref="deltArchives" :selections="selections" :category-id="categoryId" :total-sum-all="totalSumAll" />
<DeltArchives ref="deltArchives" :selections="selections" :category-id="categoryId" :total-sum-all="totalSumAll" :is-delt-type="1" />
</div>
</template>
@ -196,6 +198,8 @@ export default {
this.selections = val
this.isProject = val.length !== 1
this.$emit('getAjInProjectBtnState', this.isProject)
console.log('pr', this.selections)
this.$emit('getProjectSelections', val, this.selections)
},
// table -
tableDoubleClick(row) {

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

@ -72,6 +72,7 @@ import archivesAnjuan from './archivesAnjuan/index'
import archivesJuannei from './archivesJuannei/index'
import crudCategory from '@/api/category/category'
import CRUD, { presenter } from '@crud/crud'
import { archivesCrud } from './mixins/archives'
export default {
name: 'ArchivesList',
@ -89,7 +90,7 @@ export default {
recycleMain: this
}
},
mixins: [presenter()],
mixins: [presenter(), archivesCrud],
props: {
isdel: {
type: Boolean,
@ -126,7 +127,8 @@ export default {
'securityClass': null,
'organizationMatter': null
},
treeCurrentNode: null
treeCurrentNode: null,
nodeClick: false
}
},
watch: {
@ -196,8 +198,33 @@ export default {
if (this.$refs.archivesTree.getNode(selectedKey) && this.$refs.archivesTree.getNode(selectedKey).parent) {
this.expandParents(this.$refs.archivesTree.getNode(selectedKey).parent)
}
//
if (localStorage.getItem('isDelt') === '1') {
if (this.$refs.project) {
this.$refs.project.$refs.table.clearSelection()
}
this.clearAnjuan()
this.clearFile()
} else if (localStorage.getItem('isDelt') === '2') {
if (this.$refs.project) {
this.$refs.project.selections = this.$refs.project.$refs.table.selection
}
if (this.$refs.anjuan) {
this.$refs.anjuan.$refs.table.clearSelection()
}
this.clearFile()
} else if (localStorage.getItem('isDelt') === '3') {
if (this.$refs.anjuan) {
this.$refs.anjuan.selections = this.$refs.anjuan.$refs.table.selection
}
if (this.$refs.file) {
this.$refs.file.$refs.table.clearSelection()
}
}
//
this.handleNodeClick(selectedKey)
localStorage.removeItem('noClick')
})
}
this.getIntellClassify()
@ -211,9 +238,14 @@ export default {
}
})
},
//
//
handleNodeClick(val) {
if (val) {
if (localStorage.getItem('isForm')) {
localStorage.removeItem('noClick')
} else {
localStorage.setItem('noClick', true)
}
//
if (this.$refs.smartTree) {
this.treeCurrentNode = null
@ -233,6 +265,7 @@ export default {
this.crud.selectionChangeHandler([val])
this.selectedCategory = val
this.handleTableList()
//
localStorage.setItem('currentArchivesKey', JSON.stringify(val))
}
@ -257,11 +290,11 @@ export default {
this.projectSelection = {}
this.$nextTick(() => {
if (this.$refs.anjuan) {
this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
this.$refs.anjuan.$refs.table.clearSelection()
this.clearAnjuan()
if (this.$refs.file) {
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
this.$refs.file.$refs.table.clearSelection()
this.clearFile()
}
}
})
@ -269,10 +302,11 @@ export default {
this.projectSelection = selectData[0]
this.$nextTick(() => {
if (this.$refs.anjuan) {
this.$refs.anjuan.$refs.table.clearSelection()
this.$refs.anjuan.getTableList()
if (this.$refs.file) {
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
this.$refs.file.$refs.table.clearSelection()
this.clearFile()
}
}
})
@ -280,10 +314,11 @@ export default {
this.projectSelection = data
this.$nextTick(() => {
if (this.$refs.anjuan) {
this.$refs.anjuan.$refs.table.clearSelection()
this.$refs.anjuan.getTableList()
if (this.$refs.file) {
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
this.$refs.file.$refs.table.clearSelection()
this.clearFile()
}
}
})
@ -302,7 +337,8 @@ export default {
this.anjuanSelection = {}
this.$nextTick(() => {
if (this.$refs.file) {
this.$refs.file.junneiData = []
this.$refs.file.$refs.table.clearSelection()
this.clearFile()
}
})
} else if (selectData && selectData.length === 1) {
@ -348,6 +384,15 @@ export default {
handleIntellNodeClick(data, node, ele) {
if (data) {
if (node.childNodes.length === 0) {
if (this.$refs.project) {
this.$refs.project.$refs.table.clearSelection()
}
if (this.$refs.anjuan) {
this.$refs.anjuan.$refs.table.clearSelection()
}
if (this.$refs.file) {
this.$refs.file.$refs.table.clearSelection()
}
const selectedKey = this.$refs.smartTree.getCurrentNode()
const selectedParentVal = this.$refs.smartTree.getNode(selectedKey).parent.data.dicCode
this.treeCurrentNode = ele.$el
@ -396,17 +441,23 @@ export default {
// list
handleTableList() {
// /''btn
localStorage.removeItem('isForm')
localStorage.removeItem('isDelt')
this.isProject = true
this.isAnjuan = true
if (this.selectedCategory.isType === 2) {
this.$nextTick(() => {
if (this.$refs.anjuan) {
this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
if (localStorage.getItem('noClick')) {
this.$refs.anjuan.$refs.table.clearSelection()
}
this.clearAnjuan()
}
if (this.$refs.file) {
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
if (localStorage.getItem('noClick')) {
this.$refs.file.$refs.table.clearSelection()
}
this.clearFile()
}
this.$refs.project.getTableDisplayFields(0)
if (this.selectedCategory.children.length !== 0) {
@ -419,6 +470,25 @@ export default {
}
setTimeout(() => {
this.$refs.project.getTableList()
if (this.$refs.project.$refs.table.selection.length !== 0) {
this.$refs.project.selections = this.$refs.project.$refs.table.selection
this.$refs.anjuan.getTableList()
this.isProject = false
} else {
this.$refs.anjuan.$refs.table.clearSelection()
}
if (this.$refs.anjuan.$refs.table.selection.length !== 0) {
this.$refs.anjuan.selections = this.$refs.anjuan.$refs.table.selection
this.$refs.file.getTableList()
this.isAnjuan = false
} else {
this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
}
}, 200)
if (!this.treeCurrentNode) {
this.getYear('project')
@ -427,12 +497,17 @@ export default {
} else if (this.selectedCategory.isType === 3) {
this.$nextTick(() => {
if (this.$refs.anjuan) {
if (localStorage.getItem('noClick')) {
this.$refs.anjuan.$refs.table.clearSelection()
}
this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
}
if (this.$refs.file) {
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
if (localStorage.getItem('noClick')) {
this.$refs.file.$refs.table.clearSelection()
}
this.clearFile()
}
this.$refs.anjuan.getTableDisplayFields(1)
if (this.selectedCategory.children.length !== 0) {
@ -442,6 +517,17 @@ export default {
}
setTimeout(() => {
this.$refs.anjuan.getTableList()
if (this.$refs.anjuan.$refs.table.selection.length !== 0) {
this.$refs.anjuan.selections = this.$refs.anjuan.$refs.table.selection
this.$refs.file.getTableList()
if (this.$refs.file.$refs.table.selection.length !== 0) {
this.$refs.file.selections = this.$refs.file.$refs.table.selection
}
this.isAnjuan = false
} else {
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
}
}, 200)
if (!this.treeCurrentNode) {
this.getYear('anjuan')
@ -450,8 +536,8 @@ export default {
} else if (this.selectedCategory.isType === 4) {
this.$nextTick(() => {
if (this.$refs.file) {
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
this.$refs.file.$refs.table.clearSelection()
this.clearFile()
}
this.$refs.file.getTableDisplayFields(2)
setTimeout(() => {
@ -463,20 +549,44 @@ export default {
})
} else if (this.selectedCategory.isType === 5) {
this.$nextTick(() => {
if (this.$refs.anjuan) {
this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
if (localStorage.getItem('noClick')) {
this.$refs.anjuan.$refs.table.clearSelection()
}
this.clearAnjuan()
this.$refs.anjuan.getTableDisplayFields(1)
setTimeout(() => {
this.$refs.anjuan.getTableList()
this.$refs.anjuan.selections = this.$refs.anjuan.$refs.table.selection
}, 200)
if (!this.treeCurrentNode) {
this.getYear('anjuan')
}
})
}
},
clearAnjuan() {
if (this.$refs.anjuan) {
this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
this.$refs.anjuan.page = {
page: 1,
size: 10,
total: 0
}
}
},
clearFile() {
if (this.$refs.file) {
this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
this.$refs.file.page = {
page: 1,
size: 10,
total: 0
}
}
}
}
}
</script>

23
src/views/archivesManage/archivesList/mixins/archives.js

@ -33,7 +33,8 @@ export const archivesCrud = {
parentsId: null, // 父id
arcId: null, // 档案ID
yearGroup: [], // 智能分类 - 年度
uploadFileVisible: false // 上传附件
uploadFileVisible: false, // 上传附件
isDesFormType: null
}
},
// 组件共用方法
@ -42,6 +43,20 @@ export const archivesCrud = {
querySelect(name, val) {
this[name] = val
},
rowKey(row) {
return row.id
},
// table选中加上选中状态
tableRowClassName({ row, rowIndex }) {
// console.log('添加类名', row, rowIndex)
let color = ''
this.selections.forEach(item => {
if (item.id === row.id) {
color = 'rowStyle'
}
})
return color
},
// 案卷 / 卷内 / 文件 导出
doExport(type) {
this.crud.downloadLoading = true
@ -103,7 +118,11 @@ export const archivesCrud = {
},
handleCurrentPage(val) {
this.page.page = val
// console.log(this.$refs.table.selection)
this.getTableList()
this.$nextTick(() => {
this.selections = this.$refs.table.selection
})
},
// table - list
getListCommon(name, heightName, type) {
@ -234,7 +253,7 @@ export const archivesCrud = {
if (type === 'edit') {
this.$refs.previewForm.addOrUpdateForm = data.echo
}
this.$refs.previewForm.isType = 'arcives'
this.isDesFormType = 'arcives'
this.$refs.previewForm.FetchNoFormatField(this.categoryId)
})
})

10
src/views/archivesManage/archivesList/module/deltArchives/index.vue

@ -51,6 +51,12 @@ export default {
default: function() {
return 0
}
},
isDeltType: {
type: Number,
default: function() {
return 0
}
}
},
inject: ['recycleMain'],
@ -65,6 +71,8 @@ export default {
categoryId: function(newValue, oldValue) {
},
totalSumAll: function(newValue, oldValue) {
},
isDeltType: function(newValue, oldValue) {
}
},
created() {
@ -90,12 +98,14 @@ export default {
this.crud.delAllLoading = false
this.$message.success('删除成功!')
this.crud.refresh()
localStorage.setItem('isDelt', this.isDeltType)
})
} else {
FetchCompletelyDelete(params).then(res => {
this.crud.delAllLoading = false
this.$message.success('删除成功!')
this.crud.refresh()
localStorage.setItem('isDelt', this.isDeltType)
})
}
},

7
src/views/category/descriptionPreview/index.vue

@ -34,7 +34,7 @@
<div class="des-title">
<p>界面预览效果</p>
</div>
<PreviewForm ref="previewForm1" :is-has-code="true" :is-disabled="false" :form-preview-data.sync="isInputFields" :selected-category="selectedCategory" />
<PreviewForm ref="previewForm1" :is-has-code="true" :is-disabled="false" :form-preview-data.sync="isInputFields" :selected-category="selectedCategory" :is-des-form-type="isDesFormType" />
</div>
<!-- 修改字段 -->
@ -56,7 +56,7 @@
<div class="setting-dialog">
<i class="drag-tip">提示请通过拖动鼠标来调整当前顺序</i>
<!-- <PreviewForm :is-disabled="true" :all-fields-data="allFieldsData" .sync/> -->
<PreviewForm ref="previewForm" :is-has-code="true" :is-disabled="false" :is-draggable="true" :form-preview-data="JSON.parse(JSON.stringify(isInputFields))" :selected-category="selectedCategory" />
<PreviewForm ref="previewForm" :is-has-code="true" :is-disabled="false" :is-draggable="true" :form-preview-data="JSON.parse(JSON.stringify(isInputFields))" :is-des-form-type="isDesFormType" :selected-category="selectedCategory" />
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click.native="handleSort">保存</el-button>
</div>
@ -92,7 +92,8 @@ export default {
thisFields: { dictionaryConfigId: { dicName: null, id: null }}, //
editField: {},
isInputFields: [],
loading: false
loading: false,
isDesFormType: 'category'
}
},
watch: {

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

@ -71,6 +71,7 @@
</template>
<script>
import { crud } from '@crud/crud'
import { edit, FetchDoeditIsRepeat } from '@/api/archivesManage/archivesList'
import { getNoFormatField } from '@/api/category/fileNoFormat'
import draggable from 'vuedraggable'
@ -82,6 +83,7 @@ import { parseTime } from '@/utils/index.js'
export default {
name: 'PreviewForm',
components: { draggable, Treeselect },
mixins: [crud()],
props: {
isDisabled: {
type: Boolean,
@ -112,6 +114,10 @@ export default {
isDraggable: {
type: Boolean,
default: false
},
isDesFormType: {
type: String,
default: ''
}
},
data() {
@ -126,7 +132,7 @@ export default {
setParentsId: null,
result: null,
autoMatic: null,
isType: 'category',
// isType: 'category',
normalizer(node) {
if (node.childMenus == null || node.childMenus === 'null') {
delete node.childMenus
@ -146,9 +152,12 @@ export default {
},
parentsId: function(newValue, oldValue) {
},
isDesFormType: function(newValue, oldValue) {
},
formPreviewData: function() {
this.editFormRow()
if (this.isType !== 'arcives') {
//
if (this.isDesFormType === 'category') {
this.FetchNoFormatField(this.selectedCategory.id)
}
}
@ -426,6 +435,8 @@ export default {
this.$message.success(res)
this.$emit('emitTableList')
this.crud.refresh()
localStorage.setItem('isForm', true)
localStorage.removeItem('isDelt')
}
})
} else {

Loading…
Cancel
Save