update 文档库改使用JTable
This commit is contained in:
@@ -227,7 +227,8 @@ export default {
|
||||
const endArr = [] // 冻结右侧的列(只能是action,暂时不能自定义固定右侧)
|
||||
columns.forEach(col => {
|
||||
const key = getKey(col)
|
||||
const fixed = this.settingColumnsObj.freeze.includes(key)
|
||||
// 如果不需要配置冻结列,就按表头本身传的参数决定固定列
|
||||
const fixed = this.needSettingColumnHideOrFreeze ? this.settingColumnsObj.freeze.includes(key) : col.fixed
|
||||
col.hide = this.settingColumnsObj.hide.includes(key)
|
||||
col.fixed = key === actionKey ? 'right' : fixed
|
||||
// 如果是字符串就转换成数字(因为实现拖拽,单位只能是px)
|
||||
@@ -271,8 +272,8 @@ export default {
|
||||
},
|
||||
// 初始化表格拖拽
|
||||
initDrag (columns) {
|
||||
// 没有边框就不能拖拽
|
||||
if (!this.bordered || !this.canDrag) {
|
||||
// 根据配置项决定是否可以拖拽,本身是根据是否有边框配置的,但是有边框且有固定操作列的情况下,拖动会有一个空白列
|
||||
if (!this.canDrag) {
|
||||
return
|
||||
}
|
||||
// 如果没有任何列开启拖拽就不需要拖拽
|
||||
@@ -469,6 +470,8 @@ export default {
|
||||
.j-table {
|
||||
.resize-table-th {
|
||||
position: relative;
|
||||
// 让拖动的地方有个线
|
||||
border-right: 1px #e8e8e8 solid;
|
||||
|
||||
.table-draggable-handle {
|
||||
transform: none !important;
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
v-if="columns && columns.length > 0"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:bordered="true"
|
||||
:can-drag="true"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
|
||||
Reference in New Issue
Block a user