fix(系统设置): 系统设置创建用户,下拉框option样式跟随select样式

--bug=1027734 --user=王旭 【系统设置】github#25526,系统设置-用户管理,当工作空间名称超长显示不全,样式不太好看 https://www.tapd.cn/55049933/s/1393412
This commit is contained in:
WangXu10 2023-07-14 11:43:51 +08:00 committed by fit2-zhao
parent 6afbabcb6f
commit 3953193044
1 changed files with 20 additions and 4 deletions

View File

@ -51,8 +51,9 @@
<el-select filterable v-model="group.ids" :placeholder="$t('system_user.search_get_more_tip')" multiple <el-select filterable v-model="group.ids" :placeholder="$t('system_user.search_get_more_tip')" multiple
:filter-method="(value) => filterWorkspaceOption(value, group)" :filter-method="(value) => filterWorkspaceOption(value, group)"
@visible-change="(value) => resetWorkspaceOption(value, group)" @visible-change="(value) => resetWorkspaceOption(value, group)"
class="edit-user-select" @change="updateWorkSpace(group.index,group.type)"> :popper-append-to-body="false"
<el-option style="width:690px" class="edit-user-select" @change="updateWorkSpace(group.index,group.type)" @focus="focusWorkspace" ref="workspaceContent">
<el-option :style="{width: workspaceOptionWidth}"
v-for="item in group.workspaceOptions" v-for="item in group.workspaceOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
@ -70,8 +71,9 @@
<el-select filterable v-model="group.ids" :placeholder="$t('system_user.search_get_more_tip')" multiple <el-select filterable v-model="group.ids" :placeholder="$t('system_user.search_get_more_tip')" multiple
:filter-method="(value) => filterProjectOption(value, group)" :filter-method="(value) => filterProjectOption(value, group)"
@visible-change="(value) => resetProjectOption(value, group)" @visible-change="(value) => resetProjectOption(value, group)"
class="edit-user-select" @change="setWorkSpaceIds(group.ids,group.projects)"> :popper-append-to-body="false"
<el-option style="width:690px" class="edit-user-select" @change="setWorkSpaceIds(group.ids,group.projects)" @focus="focusProject" ref="projectContent">
<el-option :style="{width: projectOptionWidth}"
v-for="item in group.projectOptions" v-for="item in group.projectOptions"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
@ -121,6 +123,8 @@ export default {
createVisible: false, createVisible: false,
updateVisible: false, updateVisible: false,
btnAddGroup: false, btnAddGroup: false,
workspaceOptionWidth: "100%",
projectOptionWidth: "100%",
form: { form: {
groups: [{ groups: [{
type: '', type: '',
@ -184,6 +188,18 @@ export default {
} }
}, },
methods: { methods: {
focusWorkspace() {
this.$nextTick(() => {
let el = this.$refs.workspaceContent;
this.workspaceOptionWidth = el[0].$el.offsetWidth + 'px'
});
},
focusProject() {
this.$nextTick(() => {
let el = this.$refs.projectContent;
this.projectOptionWidth = el[0].$el.offsetWidth + 'px'
});
},
open(type, title, row) { open(type, title, row) {
this.type = type ? type : this.type; this.type = type ? type : this.type;
this.title = title ? title : this.title; this.title = title ? title : this.title;