代码优化,用户列表加“角色”显示

This commit is contained in:
吕金泽
2022-02-04 17:21:59 +08:00
parent bae0dcfd96
commit 7c0519888a
8 changed files with 112 additions and 18 deletions
@@ -70,9 +70,9 @@ export default {
reset() {
for(var key in this.where){
if(this.where[key] instanceof Object){
this.where[key].value = ''
this.where[key].value = null
}else{
this.where[key] = ''
this.where[key] = null
}
}
this.$nextTick(() => this.$emit('search'))
@@ -1,6 +1,6 @@
<template>
<div>
<el-select v-if="mbType === 'select'" v-model="selectValue" v-bind="el" :style="{ width }" placeholder="请选择" filterable clearable>
<el-select v-if="mbType === 'select'" v-model="selectValue" v-bind="el" :style="{ width }" :placeholder="placeholder || '请选择'" filterable clearable>
<el-option
v-for="item in selectList"
:key="item.value"
@@ -68,6 +68,10 @@ export default {
el: {
type: Object,
default: () => {}
},
placeholder: {
type: String,
default: ''
}
},
data() {
@@ -89,7 +93,7 @@ export default {
this.loadData()
},
selectValue(value) {
if (this.el && this.el.multiple && !(this.value instanceof Array)) {
if (this.el && this.el.multiple && value.length > 0) {
value = value.join(',')
}
this.$emit('update:value', value)
@@ -15,7 +15,7 @@
<el-table-column v-if="selection" align="center" type="selection" width="50" />
<el-table-column v-if="showNo" label="序号" prop="num" align="center" width="100">
<el-table-column v-if="showNo" label="序号" prop="num" align="center" width="65">
<template slot-scope="row">
<span>{{ row.$index+1 }}</span>
</template>