Browse Source

Merge branch 'dev/v1.1.15_tsz' of jianyu/page_entbase into feature/v1.1.15

汤世哲 1 year ago
parent
commit
4c2d053f9a
1 changed files with 14 additions and 8 deletions
  1. 14 8
      entbase-pc/src/views/ent/components/personal.vue

+ 14 - 8
entbase-pc/src/views/ent/components/personal.vue

@@ -56,13 +56,13 @@
       >
         <el-table-column
           type="selection"
-          :style="{ 'min-width': '3%' }"
+          :style="{ 'width': getColumnWidth(3) }"
           width="3%"
           :selectable="checkSelectable"
           v-if="hasAuth"
         >
         </el-table-column>
-        <el-table-column prop="name" :style="{ 'min-width': '10%' }" label="姓名" width="10%">
+        <el-table-column prop="name" :style="{ 'width': getColumnWidth(10) }" label="姓名" width="10%">
           <template slot="header">
             <div
               style="cursor: pointer"
@@ -72,18 +72,18 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="邮箱" :style="{ 'min-width': '17%' }"  width="17%">
+        <el-table-column label="邮箱" :style="{ 'width': getColumnWidth(17) }"  width="17%">
           <template slot-scope="scope">
             {{ scope.row.mail || "--" }}
           </template>
         </el-table-column>
-        <el-table-column prop="phone" label="手机" :style="{ 'min-width': '14%' }"  width="14%"> </el-table-column>
-        <el-table-column prop="account" :style="{ 'min-width': '21.4%' }"  label="账号名" width="21.4%">
+        <el-table-column prop="phone" label="手机" :style="{ 'width': getColumnWidth(14) }"  width="14%"> </el-table-column>
+        <el-table-column prop="account" :style="{ 'width': getColumnWidth(21.4) }"  label="账号名" width="21.4%">
            <template slot-scope="scope">
             <div :title="scope.row.user_name">{{ getAccountName(scope.row.user_name) }}</div>
           </template>
         </el-table-column>
-        <el-table-column width="17.8%" :style="{ 'min-width': '17.8%' }"  prop="dname" label="部门">
+        <el-table-column width="17.8%" :style="{ 'width': getColumnWidth(17.8) }"  prop="dname" label="部门">
           <template slot="header">
             <div
               style="cursor: pointer"
@@ -93,7 +93,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column :style="{ 'min-width': '21.4%' }" label="角色" width="21.4%">
+        <el-table-column :style="{ 'width': getColumnWidth(21.4) }" label="角色" width="21.4%">
           <template slot-scope="scope">
             <span v-if="scope.row.role == '企业管理员'" class="company_user">
               <span v-if="$store.state.companyMsg.nicheDis_show !== 1">{{ scope.row.role }}</span>
@@ -111,7 +111,7 @@
         </el-table-column>
         <el-table-column
           header-align="center"
-          :style="{ 'min-width': '11%' }"
+          :style="{ 'width': getColumnWidth(11) }"
           width="11%"
           v-if="hasAuth"
           label="操作"
@@ -445,6 +445,12 @@ export default {
     }
   },
   methods: {
+    getColumnWidth(data) {
+      const screenWidth = window.innerWidth;
+      const desiredPercentage = data;
+      const widthInPixels = (screenWidth * desiredPercentage) / 100;
+      return `${widthInPixels}px`;
+    },
     setAllocition (data) {
       let str = ''
       switch (data) {