提交 fd3189d8 authored 作者: pengxiaohui's avatar pengxiaohui

样式优化

上级 738bab87
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<div class="btn-bar"> <div class="btn-bar">
<el-button v-if="hasCreate" type="primary" size="mini" @click="dialogVisible = true">新建角色</el-button> <el-button v-if="hasCreate" type="primary" size="mini" @click="dialogVisible = true">新建角色</el-button>
</div> </div>
<el-table :data="tableData" size="mini" style="width: 100%"> <el-table :data="tableData" size="small" height="calc(100% - 38px)" style="width: 100%">
<el-table-column label="角色名称" min-width="120" prop="name" /> <el-table-column label="角色名称" min-width="120" prop="name" />
<el-table-column label="角色描述" min-width="150" prop="description" /> <el-table-column label="角色描述" min-width="150" prop="description" />
<el-table-column label="操作" min-width="130"> <el-table-column label="操作" min-width="130">
<template slot-scope="scope" v-if="scope.row.name !== 'superAdmin'"> <template slot-scope="scope" v-if="scope.row.name !== 'superAdmin'">
<el-button v-if="hasUpdate" type="text" @click="handleEdit(scope.row)">编辑角色</el-button> <el-button v-if="hasUpdate" type="text" size="small" @click="handleEdit(scope.row)">编辑角色</el-button>
<el-button v-if="hasPermit" type="text" @click="handlePermission(scope.row)">权限配置</el-button> <el-button v-if="hasPermit" type="text" size="small" @click="handlePermission(scope.row)">权限配置</el-button>
<el-button v-if="hasDelete" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button v-if="hasDelete" type="text" size="small" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
</template> </template>
<!-- 图片 --> <!-- 图片 -->
<template v-slot:table_img="{ row }"> <template v-slot:table_img="{ row }">
<img :src="row.head_img" height="40" style="max-width:60px;"/> <img v-if="row.head_img" :src="row.head_img" height="60" width="60"/>
</template> </template>
<!-- Id --> <!-- Id -->
<template v-slot:table_id="scope"> <template v-slot:table_id="scope">
<span class="details-handle" @click="handleDetails(scope.row)">{{ scope.row.student_number }}</span> <span class="details-handle" style="color:#409EFF" @click="handleDetails(scope.row)">{{ scope.row.student_number }}</span>
</template> </template>
<!-- 状态 --> <!-- 状态 -->
<template v-slot:status="{ row }"> <template v-slot:status="{ row }">
...@@ -150,6 +150,9 @@ export default { ...@@ -150,6 +150,9 @@ export default {
hasSaveCourse() { hasSaveCourse() {
return this.permissions.includes('v1/student/save-course') return this.permissions.includes('v1/student/save-course')
}, },
onlyView() {
return !this.hasImport && !this.hasExport && !this.hasDelete && !this.hasViewInfo && !this.hasViewDegree && !this.hasViewCourse
},
tableOptions() { tableOptions() {
return { return {
remote: { remote: {
...@@ -178,7 +181,20 @@ export default { ...@@ -178,7 +181,20 @@ export default {
} }
}, },
{ prop: 'age', label: '年龄', minWidth: '60px' }, { prop: 'age', label: '年龄', minWidth: '60px' },
{ prop: 'id_number', label: '身份证号', minWidth: '150px' }, {
prop: 'id_number',
label: '身份证号',
minWidth: '150px',
computed: ({ row }) => {
let id = row.id_number
console.log(this.onlyView)
if (this.onlyView) {
id = id.substr(0, 6) + '********' + id.substr(14)
console.log(id)
}
return id
}
},
{ prop: 'mobile', label: '电话号码', minWidth: '130px' }, { prop: 'mobile', label: '电话号码', minWidth: '130px' },
{ prop: 'email', label: '邮箱地址', minWidth: '150px' }, { prop: 'email', label: '邮箱地址', minWidth: '150px' },
{ {
...@@ -198,6 +214,9 @@ export default { ...@@ -198,6 +214,9 @@ export default {
} }
} }
}, },
created() {
console.log(this.onlyView)
},
methods: { methods: {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val.map(item => item.id) this.multipleSelection = val.map(item => item.id)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<el-button v-if="hasCreate" type="primary" size="mini" @click="drawerVisible = true">新增授权</el-button> <el-button v-if="hasCreate" type="primary" size="mini" @click="drawerVisible = true">新增授权</el-button>
</div> </div>
<el-table :data="tableData" size="mini" style="width: 100%"> <el-table :data="tableData" size="mini" style="width: 100%" height="calc(100% - 42px)">
<el-table-column label="用户ID" min-width="120" prop="userId" /> <el-table-column label="用户ID" min-width="120" prop="userId" />
<el-table-column label="用户姓名" min-width="150" prop="userName" /> <el-table-column label="用户姓名" min-width="150" prop="userName" />
<el-table-column label="用户昵称" min-width="150" prop="nickname" /> <el-table-column label="用户昵称" min-width="150" prop="nickname" />
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<el-table-column label="操作" min-width="130"> <el-table-column label="操作" min-width="130">
<template slot-scope="scope" v-if="scope.row.name !== 'superAdmin'"> <template slot-scope="scope" v-if="scope.row.name !== 'superAdmin'">
<!-- <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button> --> <!-- <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button> -->
<el-button v-if="hasDelete" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button v-if="hasDelete" type="text" size="small" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论