Browse Source

档案管理list高度自适应/滚动条问题

master
xuhuajiao 3 years ago
parent
commit
8cbf1f494f
  1. 5
      src/assets/styles/index.scss
  2. 25
      src/views/archivesManage/archivesList/archivesAnjuan/index.vue
  3. 11
      src/views/archivesManage/archivesList/archivesJuannei/index.vue
  4. 11
      src/views/archivesManage/archivesList/archivesProject/index.vue
  5. 10
      src/views/archivesManage/archivesList/index.vue
  6. 13
      src/views/archivesManage/archivesList/mixins/archives.js

5
src/assets/styles/index.scss

@ -210,6 +210,11 @@ ul{
border-radius: 3px; border-radius: 3px;
} }
//只需要加上这一行
::-webkit-scrollbar-corner {
background-color: #021941;
}
// 设置loading-mask // 设置loading-mask
.el-loading-mask{ .el-loading-mask{
background-color: rgba(0,0,0,0.2); background-color: rgba(0,0,0,0.2);

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

@ -65,7 +65,7 @@
</el-dialog> </el-dialog>
<!-- table表格渲染 --> <!-- table表格渲染 -->
<!-- height="calc(100vh - 350px)" -->
<!-- height="calc(100vh - 434px)" -->
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<span class="right-top-line" /> <span class="right-top-line" />
<span class="left-bottom-line" /> <span class="left-bottom-line" />
@ -76,7 +76,7 @@
:data="anjuanData" :data="anjuanData"
highlight-current-row highlight-current-row
style="width: 100%;" style="width: 100%;"
height="calc(100vh - 434px)"
:height="anjuanTableHeight"
@select-all="selectAll" @select-all="selectAll"
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
@row-click="clickRowHandler" @row-click="clickRowHandler"
@ -237,7 +237,6 @@ export default {
anjuanQuery: {}, anjuanQuery: {},
queryOption: [], queryOption: [],
anjuanInputSelect: '', anjuanInputSelect: '',
anjuanTableHeight: null,
stateOptions: [ // - stateOptions: [ // -
{ value: '0', label: '全部' }, { value: '0', label: '全部' },
{ value: '1', label: '未装' }, { value: '1', label: '未装' },
@ -285,17 +284,6 @@ export default {
this.query.queryType = this.stateOptions[0].value this.query.queryType = this.stateOptions[0].value
}, },
mounted() { mounted() {
// this.$nextTick(() => {
// console.log(this.anjuanData.length)
// if (this.anjuanData.length === 0 || this.anjuanData.length < 10) {
// console.log('tres')
// this.anjuanTableHeight = null
// } else {
// console.log('666')
// const h = '100vh'
// this.anjuanTableHeight = `calc(${h} - 434px)`
// }
// })
}, },
methods: { methods: {
// /query // /query
@ -322,7 +310,7 @@ export default {
handleSizeChange(size) { handleSizeChange(size) {
this.page.size = size this.page.size = size
this.page.page = 1 this.page.page = 1
this.getListCommon('anjuanData', 1)
this.getListCommon('anjuanData', 'anjuanTableHeight', 1)
}, },
// list // list
getTableList() { getTableList() {
@ -345,12 +333,12 @@ export default {
this.query.responsibleby = this.anjuanQuery[this.anjuanInputSelect] this.query.responsibleby = this.anjuanQuery[this.anjuanInputSelect]
break break
} }
this.getListCommon('anjuanData', 1)
this.getListCommon('anjuanData', 'anjuanTableHeight', 1)
}, },
stateSelect(val) { stateSelect(val) {
this.page.page = 1 this.page.page = 1
this.query.queryType = val this.query.queryType = val
this.getListCommon('anjuanData', 1)
this.getListCommon('anjuanData', 'anjuanTableHeight', 1)
}, },
// table - // table -
selectAll(val) { selectAll(val) {
@ -474,9 +462,8 @@ export default {
padding-left: 106px !important; padding-left: 106px !important;
} }
} }
::v-deep .el-table__fixed-right-patch{ ::v-deep .el-table__fixed-right-patch{
background-color:#13439e;
background-color:#02255f;
border-bottom: none; border-bottom: none;
} }
</style> </style>

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

@ -60,7 +60,7 @@
:data="junneiData" :data="junneiData"
highlight-current-row highlight-current-row
style="width: 100%;" style="width: 100%;"
height="calc(100vh - 434px)"
:height="juanneiTableHeight"
@select-all="selectAll" @select-all="selectAll"
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
@row-click="clickRowHandler" @row-click="clickRowHandler"
@ -180,7 +180,6 @@ export default {
return { return {
junneiData: [], junneiData: [],
juanneiQuery: {}, juanneiQuery: {},
juanneiTableHeight: null,
queryOption: [ queryOption: [
{ value: 'queryTitle', label: '题名' }, { value: 'queryTitle', label: '题名' },
{ value: 'archiveNo', label: '档号' }, { value: 'archiveNo', label: '档号' },
@ -228,7 +227,7 @@ export default {
handleSizeChange(size) { handleSizeChange(size) {
this.page.size = size this.page.size = size
this.page.page = 1 this.page.page = 1
this.getListCommon('junneiData', 2)
this.getListCommon('junneiData', 'juanneiTableHeight', 2)
}, },
// list // list
getTableList() { getTableList() {
@ -246,7 +245,7 @@ export default {
this.query.responsibleby = this.juanneiQuery[this.juanneiInputSelect] this.query.responsibleby = this.juanneiQuery[this.juanneiInputSelect]
break break
} }
this.getListCommon('junneiData', 2)
this.getListCommon('junneiData', 'juanneiTableHeight', 2)
}, },
// table - // table -
selectAll(val) { selectAll(val) {
@ -287,4 +286,8 @@ export default {
padding-left: 85px !important; padding-left: 85px !important;
} }
} }
::v-deep .el-table__fixed-right-patch{
background-color:#02255f;
border-bottom: none;
}
</style> </style>

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

@ -57,7 +57,7 @@
:data="projectData" :data="projectData"
highlight-current-row highlight-current-row
style="width: 100%;" style="width: 100%;"
height="calc(100vh - 434px)"
:height="projectTableHeight"
@select-all="selectAll" @select-all="selectAll"
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
@row-click="clickRowHandler" @row-click="clickRowHandler"
@ -144,7 +144,6 @@ export default {
{ value: 'itemNo', label: '项目代号' } { value: 'itemNo', label: '项目代号' }
], ],
projectInputSelect: '', projectInputSelect: '',
projectTableHeight: null,
isProject: true // -/ isProject: true // -/
} }
}, },
@ -176,7 +175,7 @@ export default {
handleSizeChange(size) { handleSizeChange(size) {
this.page.size = size this.page.size = size
this.page.page = 1 this.page.page = 1
this.getListCommon('projectData', 0)
this.getListCommon('projectData', 'projectTableHeight', 0)
}, },
// table - list // table - list
getTableList(page) { getTableList(page) {
@ -190,7 +189,7 @@ export default {
this.query.itemNo = this.projectQuery[this.projectInputSelect] this.query.itemNo = this.projectQuery[this.projectInputSelect]
break break
} }
this.getListCommon('projectData', 0)
this.getListCommon('projectData', 'projectTableHeight', 0)
}, },
// table - // table -
selectAll(val) { selectAll(val) {
@ -240,5 +239,9 @@ export default {
padding-left: 94px !important; padding-left: 94px !important;
} }
} }
::v-deep .el-table__fixed-right-patch{
background-color:#02255f;
border-bottom: none;
}
</style> </style>

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

@ -258,8 +258,10 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.anjuan) { if (this.$refs.anjuan) {
this.$refs.anjuan.anjuanData = [] this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
if (this.$refs.file) { if (this.$refs.file) {
this.$refs.file.junneiData = [] this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
} }
} }
}) })
@ -270,6 +272,7 @@ export default {
this.$refs.anjuan.getTableList() this.$refs.anjuan.getTableList()
if (this.$refs.file) { if (this.$refs.file) {
this.$refs.file.junneiData = [] this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
} }
} }
}) })
@ -280,6 +283,7 @@ export default {
this.$refs.anjuan.getTableList() this.$refs.anjuan.getTableList()
if (this.$refs.file) { if (this.$refs.file) {
this.$refs.file.junneiData = [] this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
} }
} }
}) })
@ -395,9 +399,11 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.anjuan) { if (this.$refs.anjuan) {
this.$refs.anjuan.anjuanData = [] this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
} }
if (this.$refs.file) { if (this.$refs.file) {
this.$refs.file.junneiData = [] this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
} }
this.$refs.project.getTableDisplayFields(0) this.$refs.project.getTableDisplayFields(0)
if (this.selectedCategory.children.length !== 0) { if (this.selectedCategory.children.length !== 0) {
@ -419,9 +425,11 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.anjuan) { if (this.$refs.anjuan) {
this.$refs.anjuan.anjuanData = [] this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
} }
if (this.$refs.file) { if (this.$refs.file) {
this.$refs.file.junneiData = [] this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
} }
this.$refs.anjuan.getTableDisplayFields(1) this.$refs.anjuan.getTableDisplayFields(1)
if (this.selectedCategory.children.length !== 0) { if (this.selectedCategory.children.length !== 0) {
@ -440,6 +448,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.file) { if (this.$refs.file) {
this.$refs.file.junneiData = [] this.$refs.file.junneiData = []
this.$refs.file.juanneiTableHeight = ''
} }
this.$refs.file.getTableDisplayFields(2) this.$refs.file.getTableDisplayFields(2)
setTimeout(() => { setTimeout(() => {
@ -453,6 +462,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.anjuan) { if (this.$refs.anjuan) {
this.$refs.anjuan.anjuanData = [] this.$refs.anjuan.anjuanData = []
this.$refs.anjuan.anjuanTableHeight = ''
} }
this.$refs.anjuan.getTableDisplayFields(1) this.$refs.anjuan.getTableDisplayFields(1)
setTimeout(() => { setTimeout(() => {

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

@ -20,6 +20,9 @@ export const archivesCrud = {
borrowTxt: [], borrowTxt: [],
tableDisplayFields: [], // table-list-title字段 tableDisplayFields: [], // table-list-title字段
getTableDisplayFieldsLoading: false, // table-loading getTableDisplayFieldsLoading: false, // table-loading
projectTableHeight: null,
anjuanTableHeight: null,
juanneiTableHeight: null,
formVisible: false, formVisible: false,
formTitle: '新建档案', formTitle: '新建档案',
formPreviewData: [], // 预览界面data formPreviewData: [], // 预览界面data
@ -103,7 +106,7 @@ export const archivesCrud = {
this.getTableList() this.getTableList()
}, },
// table - list // table - list
getListCommon(name, type) {
getListCommon(name, heightName, type) {
if (type === 0) { if (type === 0) {
this.parentsId = null this.parentsId = null
} else if (type === 1) { } else if (type === 1) {
@ -150,6 +153,14 @@ export const archivesCrud = {
this.yearGroup = data.yearGroup this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements this.page.total = data.list.totalElements
// 自适应高度
if (this[name].length === 0 || this[name].length < 10) {
this[heightName] = ''
} else {
const h = '100vh'
this[heightName] = `calc(${h} - 434px)`
}
if (name === 'anjuanData' || name === 'junneiData') { if (name === 'anjuanData' || name === 'junneiData') {
this[name].forEach((item, index) => { this[name].forEach((item, index) => {
// 入库状态 // 入库状态

Loading…
Cancel
Save