<template>
|
<el-dialog class="select-member" :visible.sync="visible" width="53.33%" :close-on-click-modal="false"
|
:show-close="false">
|
<template #title>
|
<div>选择参与人员</div>
|
</template>
|
<div class="select-member-content">
|
<el-row :gutter="16">
|
<el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
|
<div class="select-member-content-left">
|
<div class="select-member-content-left-search">
|
<div class="select-member-content-left-search-input">
|
<img src="@/assets/public/search-outline@2x.png" />
|
<el-input v-model="search" placeholder="请输入" />
|
<div class="select-member-content-left-search-input-close">
|
<img @click.stop="searchRole" v-if="search"
|
src="@/assets/public/close-circle-fill@2x.png" />
|
</div>
|
</div>
|
<el-button type="primary">搜索</el-button>
|
</div>
|
<div class="select-member-content-left-list">
|
<div class="select-member-content-left-list-title">角色列表</div>
|
<div class="select-member-content-left-list-itemBox">
|
<div v-for="item in 10" :key="item.id"
|
class="select-member-content-left-list-itemBox-item">
|
实验员
|
</div>
|
</div>
|
</div>
|
</div>
|
</el-col>
|
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
|
<div class="select-member-content-right">
|
<div class="select-member-content-right-header">
|
<div class="select-member-content-right-header-text">人员列表</div>
|
<div class="select-member-content-right-header-search">
|
<el-input clearable v-model="searchName" placeholder="请输入姓名" />
|
<el-button type="primary">搜索</el-button>
|
</div>
|
</div>
|
<Table :data="tableData" :total="0" @selection-change="handleSelectionChange"
|
:row-class-name="tableRowClassName">
|
<el-table-column type="selection" width="55" />
|
<el-table-column label="角色" prop="role" />
|
<el-table-column label="姓名" prop="name" />
|
<el-table-column label="创建时间" prop="createTime" />
|
</Table>
|
</div>
|
</el-col>
|
</el-row>
|
</div>
|
<div class="select-member-footer">
|
<el-button @click="close" type="default">关闭</el-button>
|
<el-button type="primary">确认选择</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
data() {
|
return {
|
visible: false,
|
search: '',
|
searchName: '',
|
tableData: [
|
{
|
name: '张三',
|
role: '实验员',
|
createTime: '2025-1-2 15:13:58'
|
},
|
{
|
name: '李四',
|
role: '实验员',
|
createTime: '2025-1-2 15:13:58'
|
},
|
],
|
selectData: []
|
}
|
},
|
computed: {
|
...mapState(['isFold'])
|
},
|
methods: {
|
handleSelectionChange(val) {
|
this.selectData = val
|
},
|
searchRole() {
|
this.search = ''
|
},
|
open() {
|
this.visible = true
|
},
|
close() {
|
this.visible = false
|
},
|
tableRowClassName({ row, rowIndex }) {
|
if (this.selectData.findIndex(item => item.name === row.name) != -1) {
|
return 'select-row';
|
}
|
return '';
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="less">
|
.select-member-content {
|
.select-member-content-left {
|
box-shadow: 0px 4px 12px 4px rgba(0, 0, 0, 0.08);
|
border-radius: 10px;
|
margin-bottom: 31px;
|
|
&-search {
|
padding: 6px 7px 6px 10px;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
border-bottom: 1px solid rgba(238, 238, 238, 1);
|
|
&-input {
|
display: flex;
|
align-items: center;
|
background: rgba(0, 0, 0, 0.04);
|
border-radius: 4px;
|
margin-right: 10px;
|
flex: 1;
|
|
::v-deep .el-input__inner {
|
background-color: transparent;
|
border: none;
|
height: 36px;
|
line-height: 36px;
|
padding: 0;
|
width: 100%;
|
}
|
|
img {
|
flex-shrink: 0;
|
width: 19px;
|
height: 20px;
|
margin: 0 5px;
|
}
|
|
&-close {
|
width: 19px;
|
height: 20px;
|
margin: 0 9px;
|
flex-shrink: 0;
|
|
img {
|
cursor: pointer;
|
}
|
}
|
}
|
}
|
|
&-list {
|
padding: 15px 13px;
|
|
&-title {
|
font-weight: 500;
|
font-size: 16px;
|
line-height: 16px;
|
color: #222222;
|
font-family: 'SourceHanSansCN-Medium';
|
margin-bottom: 8px;
|
}
|
|
&-itemBox {
|
height: 451px;
|
background: #F4F6F8;
|
border-radius: 10px;
|
padding: 12px 10px;
|
overflow-y: auto;
|
|
&-item {
|
cursor: pointer;
|
font-weight: 400;
|
font-size: 14px;
|
line-height: 22px;
|
color: rgba(0, 0, 0, 0.88);
|
font-family: 'PingFangSCRegular';
|
background: #FFFFFF;
|
border-radius: 4px;
|
padding: 9px 15px;
|
margin-bottom: 10px;
|
|
&:last-child {
|
margin-bottom: 0;
|
}
|
}
|
}
|
}
|
}
|
|
.select-member-content-right {
|
margin-bottom: 31px;
|
|
&-header {
|
display: flex;
|
align-items: center;
|
margin-top: 5px;
|
justify-content: space-between;
|
margin-bottom: 21px;
|
|
&-text {
|
flex-shrink: 0;
|
font-weight: 500;
|
font-size: 16px;
|
line-height: 16px;
|
color: #222222;
|
font-family: 'SourceHanSansCN-Medium';
|
margin-right: 20px;
|
}
|
|
&-search {
|
display: flex;
|
align-items: center;
|
|
::v-deep .el-input {
|
margin-right: 12px;
|
}
|
}
|
}
|
}
|
}
|
</style>
|