fix: 接口定义、场景、测试计划功能用例的表格,列拖动设置最小拖动植

接口定义、场景、测试计划功能用例的表格,列拖动设置最小拖动植,防止因表头换行导致的表格错位问题
This commit is contained in:
song.tianyang 2021-02-02 14:41:29 +08:00
parent 67a2752439
commit 311e163a4c
5 changed files with 35 additions and 27 deletions

View File

@ -10,6 +10,7 @@
@sort-change="sort"
@filter-change="filter"
@select-all="select" @select="select"
@header-dragend="headerDragend"
v-loading="loading">
<el-table-column type="selection" width="50"/>
@ -40,7 +41,6 @@
sortable="custom"
:label="$t('api_test.automation.scenario_name')"
show-overflow-tooltip
min-width="120px"/>
<el-table-column prop="level"
sortable="custom"
@ -609,13 +609,13 @@
_filter(filters, this.condition);
this.search();
},
labelHead(h,{column,index}){
// alert(column.minWidth+":"+column.realWidth+":"+column.width);
if(column.minWidth>column.realWidth){
column.realWidth = column.minWidth;
column.width = column.minWidth;
headerDragend(newWidth,oldWidth,column,event){
let finalWidth = newWidth;
if(column.minWidth>finalWidth){
finalWidth = column.minWidth;
}
return column.label;
column.width = finalWidth;
column.realWidth = finalWidth;
},
openScenario(item) {
this.$emit('openScenario', item)

View File

@ -15,6 +15,7 @@
@select-all="handleSelectAll"
@filter-change="filter"
@sort-change="sort"
@header-dragend="headerDragend"
@select="handleSelect" :height="screenHeight">
<el-table-column type="selection" width="50"/>
@ -507,12 +508,13 @@ export default {
this.clickRow = row;
this.$refs.setEnvironment.open(row);
},
labelHead(h,{column,index}){
if(column.minWidth>column.realWidth){
column.realWidth = column.minWidth;
column.width = column.minWidth;
headerDragend(newWidth,oldWidth,column,event){
let finalWidth = newWidth;
if(column.minWidth>finalWidth){
finalWidth = column.minWidth;
}
return column.label;
column.width = finalWidth;
column.realWidth = finalWidth;
},
createPerformance(row, environment) {
/**

View File

@ -17,6 +17,7 @@
@filter-change="filter"
:data="tableData" row-key="id" class="test-content adjust-table ms-select-all-fixed"
@select-all="handleSelectAll"
@header-dragend="headerDragend"
@select="handleSelect" :height="screenHeight">
<el-table-column width="50" type="selection"/>
@ -693,12 +694,13 @@ export default {
_filter(filters, this.condition);
this.initTable();
},
labelHead(h,{column,index}){
if(column.minWidth>column.realWidth){
column.realWidth = column.minWidth;
column.width = column.minWidth;
headerDragend(newWidth,oldWidth,column,event){
let finalWidth = newWidth;
if(column.minWidth>finalWidth){
finalWidth = column.minWidth;
}
return column.label;
column.width = finalWidth;
column.realWidth = finalWidth;
},
open() {
this.$refs.searchBar.open();

View File

@ -29,6 +29,7 @@
@filter-change="filter"
@select-all="handleSelectAll"
@select="handleSelect"
@header-dragend="headerDragend"
@cell-mouse-enter="showPopover"
row-key="id"
class="test-content adjust-table ms-select-all-fixed"
@ -562,12 +563,13 @@ export default {
this.selectDataCounts = this.selectRows.size;
}
},
labelHead(h,{column,index}){
if(column.minWidth>column.realWidth){
column.realWidth = column.minWidth;
column.width = column.minWidth;
headerDragend(newWidth,oldWidth,column,event){
let finalWidth = newWidth;
if(column.minWidth>finalWidth){
finalWidth = column.minWidth;
}
return column.label;
column.width = finalWidth;
column.realWidth = finalWidth;
},
moveSave(param) {
param.condition = this.condition;

View File

@ -35,6 +35,7 @@
@select="handleSelectionChange"
row-key="id"
@row-click="showDetail"
@header-dragend="headerDragend"
:data="tableData">
<el-table-column
@ -595,12 +596,13 @@ export default {
_sort(column, this.condition);
this.initTableData();
},
labelHead(h,{column,index}){
if(column.minWidth>column.realWidth){
column.realWidth = column.minWidth;
column.width = column.minWidth;
headerDragend(newWidth,oldWidth,column,event){
let finalWidth = newWidth;
if(column.minWidth>finalWidth){
finalWidth = column.minWidth;
}
return column.label;
column.width = finalWidth;
column.realWidth = finalWidth;
},
batchEdit(form) {
let param = {};