Commit c78f7aed by liyuhang19990520

宽度适配

parent 40b56958
......@@ -109,7 +109,7 @@
<el-table-column
prop="roleNames"
label="组角色"
:width="newWidth == 3 ? 175 * newWidth : 155 * newWidth"
:width="newWidth"
show-overflow-tooltip
>
<template slot-scope="scope">
......@@ -165,7 +165,7 @@
<Confirmation content="编辑用户">
<img
style="
width: 1.125rem;
width: 1.125rem !important;
height: 1.125rem;
margin-right: 1.125rem;
cursor: pointer;
......@@ -520,6 +520,7 @@ export default {
this.width1 = (this.width1 * w2) / w1;
this.width2 = (this.width2 * w2) / w1;
this.width3 = (this.width3 * w2) / w1;
this.width5 = (this.width5 * w2) / w1;
this.btnwidth = (this.btnwidth * w2) / w1;
},
data() {
......@@ -556,6 +557,7 @@ export default {
}
};
return {
width5: "",
width3: 90,
width2: 400,
width1: 200,
......@@ -666,13 +668,23 @@ export default {
return str == "" ? false : true;
},
newWidth() {
let w1 = 1920;
let w2 = window.innerWidth;
let map = this.tableData.map((i) => i.roleNames.split(","));
let num = 0;
let width;
map.forEach((i) => {
if (i.length > num) num = i.length;
});
if (num > 3) num = 3;
return num;
console.log(num, 22222222222);
if (num == 3) {
width = 3 * 175;
} else {
width = 155 * num;
}
width = (width * w2) / w1;
return width;
},
},
methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment