Browse Source

字段调整

pull/200/head
lingxiao 2 years ago
parent
commit
db47ab8875
2 changed files with 8 additions and 8 deletions
  1. +2
    -2
      src/utils/tableHeight.js
  2. +6
    -6
      src/views/system/role/index.vue

+ 2
- 2
src/utils/tableHeight.js View File

@ -3,9 +3,9 @@ export function calculationTableHeight(ref, plusHeight) {
return ref.offsetHeight - plusHeight || 0; return ref.offsetHeight - plusHeight || 0;
}; };
// 保存列宽 // 保存列宽
export function saveRowWidth({rawColumnKey}, width) {
export function saveRowWidth({property}, width) {
let allRowWidth = localStorage.allRowWidth ? JSON.parse(localStorage.allRowWidth) : {}; let allRowWidth = localStorage.allRowWidth ? JSON.parse(localStorage.allRowWidth) : {};
allRowWidth[rawColumnKey] = width;
allRowWidth[property] = width;
localStorage.allRowWidth = JSON.stringify(allRowWidth); localStorage.allRowWidth = JSON.stringify(allRowWidth);
} }
// 获取列表 // 获取列表


+ 6
- 6
src/views/system/role/index.vue View File

@ -15,11 +15,11 @@
</el-form> </el-form>
</SearchTemplate> </SearchTemplate>
<ContentContainer> <ContentContainer>
<el-table v-if="tableHeight" :height="tableHeight" :data="tableData" v-loading="loading" size="mini" style="width: 100%" border>
<el-table-column label="角色编号" prop="Role-RoleId" />
<el-table-column label="角色名称" prop="Role-RoleName" :show-overflow-tooltip="true" />
<el-table-column label="权限字符" prop="Role-RoleKey" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center">
<el-table v-if="tableHeight" :height="tableHeight" @header-dragend="(newWidth, oldWidth, column)=>saveRowWidth(column, newWidth)" :data="tableData" v-loading="loading" size="mini" style="width: 100%" border>
<el-table-column label="角色编号" prop="Role-RoleId" :width="getRowWidth('Role-RoleId')" />
<el-table-column label="角色名称" prop="Role-RoleName" :width="getRowWidth('Role-RoleName')" :show-overflow-tooltip="true" />
<el-table-column label="权限字符" prop="Role-RoleKey" :width="getRowWidth('Role-RoleKey')" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" :width="getRowWidth('Role-Status')">
<template #default="scope"> <template #default="scope">
<el-switch <el-switch
v-model="scope.row['Role-Status']" v-model="scope.row['Role-Status']"
@ -30,7 +30,7 @@
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="Role-CreateTime" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" prop="Role-CreateTime" :width="getRowWidth('Role-CreateTime')" :show-overflow-tooltip="true" />
<el-table-column align="center" label="操作" width="170"> <el-table-column align="center" label="操作" width="170">
<template #default="scope"> <template #default="scope">
<el-button class="edit-button-style" @click="handleUpdate(scope.row)" icon="el-icon-edit" size="small">修改</el-button> <el-button class="edit-button-style" @click="handleUpdate(scope.row)" icon="el-icon-edit" size="small">修改</el-button>


Loading…
Cancel
Save