rt-sim-training-client/src/views/jointTraining/menuDraft/chooseRole.vue

95 lines
2.2 KiB
Vue
Raw Normal View History

2019-07-26 13:32:43 +08:00
<template>
2019-08-29 17:16:33 +08:00
<el-dialog
v-dialogDrag
:title="title"
:visible.sync="show"
width="400px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<el-input v-model="filterText" placeholder="输入名称进行过滤" clearable />
<ul v-if="filterList.length" class="listBox">
<li v-for="item in filterList" :key="item" class="listLi">
<el-radio v-model="selected" :label="item"><span>{{ item.name }}</span></el-radio>
</li>
</ul>
2019-11-14 13:59:33 +08:00
<span v-else class="tipLable"> {{ $t('global.temporarilyNoData') }} </span>
2019-08-29 17:16:33 +08:00
<span slot="footer" class="dialog-footer">
2019-11-14 13:59:33 +08:00
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" :loading="loading" @click="commit">{{ $t('global.confirm') }}</el-button>
2019-08-29 17:16:33 +08:00
</span>
</el-dialog>
2019-07-26 13:32:43 +08:00
</template>
<script>
2019-08-29 17:16:33 +08:00
export default {
2019-11-14 13:59:33 +08:00
name: 'CmdNotice',
data() {
return {
dialogShow: false,
title: '',
props: {
label: 'name'
},
sourceList: [],
filterText: '',
selected: '',
loading: false
};
},
computed: {
show() {
return this.dialogShow;
},
filterList() {
return this.sourceList.filter(p => p.name.indexOf(this.filterText) !== -1);
}
},
methods: {
doShow(obj) {
this.dialogShow = true;
this.title = obj.title;
this.sourceList = obj.list;
this.selected = '';
},
doClose() {
this.dialogShow = false;
},
commit() {
this.$emit('setDriver', this.selected);
this.doClose();
}
}
2019-08-29 17:16:33 +08:00
};
2019-07-26 13:32:43 +08:00
</script>
<style scoped lang="scss">
/deep/ {
.el-dialog__body {
padding: 0px 20px;
}
}
.listBox {
margin: 0px;
max-height: 270px;
overflow-y: auto;
padding-inline-start: 0px;
width: 100%;
.listLi {
list-style: none;
height: 30px;
line-height: 30px;
}
}
.tipLable {
line-height: 33px;
}
2019-08-29 17:16:33 +08:00
</style>