style: 优化文件列表样式

This commit is contained in:
jmal 2024-09-24 14:30:08 +08:00
parent 685c79ec15
commit c95e7e7bbf
5 changed files with 24 additions and 9 deletions

View File

@ -152,7 +152,6 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.item, this.gridWidth)
}, },
computed: { computed: {
findIconClass() { findIconClass() {

View File

@ -305,6 +305,7 @@
<!--list布局--> <!--list布局-->
<div <div
v-show="fileList.length > 0" v-show="fileList.length > 0"
ref="fileListTableContainer"
id="v-draw-rectangle" id="v-draw-rectangle"
:style="{ width: '100%', height: clientHeight + 'px' }" :style="{ width: '100%', height: clientHeight + 'px' }"
> >
@ -323,6 +324,7 @@
:pagination-show="false" :pagination-show="false"
style="width: 100%;margin: 20px 0 0 0;" style="width: 100%;margin: 20px 0 0 0;"
stripe stripe
:fit="true"
:cell-style="rowStyle" :cell-style="rowStyle"
:height-change="false" :height-change="false"
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
@ -358,7 +360,8 @@
v-if="index === 2" v-if="index === 2"
:key="index" :key="index"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
max-width="200" min-width="200"
:width="tableHeadNameWidth"
:index="index" :index="index"
:prop="item.name" :prop="item.name"
:label="item.label" :label="item.label"
@ -467,8 +470,8 @@
overflow: 'auto', overflow: 'auto',
'box-shadow': 'box-shadow':
fileListScrollTop > 0 fileListScrollTop > 0
? '#a5a7a8 0px 0px 3px' ? '-1px -1px 4px #00152914'
: '#ffffff 0px 0px 0px', : '-1px -1px 4px #ffffff',
}" }"
> >
<van-grid-item <van-grid-item
@ -998,6 +1001,7 @@ export default {
isIndeterminate: false, isIndeterminate: false,
isSelectAll: false, isSelectAll: false,
clientHeight: 500, clientHeight: 500,
tableHeadNameWidth: 500,
// 表头数据 // 表头数据
tableHead: [ tableHead: [
{ {
@ -1544,6 +1548,7 @@ export default {
this.pinSelect(row, event) this.pinSelect(row, event)
}, },
containerResize() { containerResize() {
// gird视图
const container = document.querySelector('.dashboard-container') const container = document.querySelector('.dashboard-container')
let clientWidth = container.clientWidth let clientWidth = container.clientWidth
this.clientHeight = document.documentElement.clientHeight - this.lessClientHeight this.clientHeight = document.documentElement.clientHeight - this.lessClientHeight
@ -1570,6 +1575,12 @@ export default {
} }
this.getFileListEnter() this.getFileListEnter()
} }
this.$nextTick(() => {
// list 视图
const fileListTableWidth = this.$refs.fileListTableContainer.offsetWidth
this.tableHeadNameWidth = fileListTableWidth - (80 + 200 + 250) - 50
})
// 使列表可拖拽 // 使列表可拖拽
this.rowDrop() this.rowDrop()
this.darwRectangle() this.darwRectangle()
@ -3135,7 +3146,7 @@ export default {
if (columnIndex === 0) { if (columnIndex === 0) {
return { return {
backgroundColor: '#e0f3fc !important', backgroundColor: '#e0f3fc !important',
borderRadius: '3px 0 0 3px', borderRadius: '5px 0 0 5px',
borderLeft: '1px solid #409eff', borderLeft: '1px solid #409eff',
borderTop: '1px solid #409eff', borderTop: '1px solid #409eff',
borderBottom: '1px solid #409eff', borderBottom: '1px solid #409eff',
@ -3144,7 +3155,7 @@ export default {
if (columnIndex === 3) { if (columnIndex === 3) {
return { return {
backgroundColor: '#e0f3fc !important', backgroundColor: '#e0f3fc !important',
borderRadius: '0 3px 3px 0', borderRadius: '0 5px 5px 0',
borderRight: '1px solid #409eff', borderRight: '1px solid #409eff',
borderTop: '1px solid #409eff', borderTop: '1px solid #409eff',
borderBottom: '1px solid #409eff', borderBottom: '1px solid #409eff',
@ -4575,6 +4586,7 @@ export default {
} }
>>> .el-table { >>> .el-table {
padding-left: 20px;
th.gutter { th.gutter {
display: table-cell !important; display: table-cell !important;
} }
@ -4594,4 +4606,5 @@ export default {
.mt-5 { .mt-5 {
margin-top: 5px; margin-top: 5px;
} }
</style> </style>

View File

@ -86,9 +86,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.newFileMenu ul { .newFileMenu ul {
list-style: none; list-style: none;
padding-inline-start: 0px; padding-inline-start: 0;
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
padding: 0 5px;
} }
.newFileMenu li { .newFileMenu li {
cursor: pointer; cursor: pointer;

View File

@ -43,6 +43,7 @@
padding-inline-start: 0; padding-inline-start: 0;
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
padding: 0 5px;
} }
.newFileMenu li { .newFileMenu li {
cursor: pointer; cursor: pointer;
@ -286,7 +287,7 @@
} }
>>> .van-grid { >>> .van-grid {
padding-left: 10px; padding-left: 20px;
} }
>>> .van-grid-item__content .svg-icon{ >>> .van-grid-item__content .svg-icon{

View File

@ -1538,9 +1538,10 @@ input {
.newFileMenu ul { .newFileMenu ul {
list-style: none; list-style: none;
padding-inline-start: 0px; padding-inline-start: 0;
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
padding: 0 5px;
} }
.newFileMenu { .newFileMenu {