74 lines
1.6 KiB
Vue
74 lines
1.6 KiB
Vue
<script>
|
|
module.exports = {
|
|
name: "index",
|
|
components: {
|
|
"drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue")
|
|
},
|
|
props: {
|
|
value: {
|
|
type: [String, Number],
|
|
default: null
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
groupOptions: [],
|
|
internalGroupId: null
|
|
}
|
|
},
|
|
watch: {
|
|
internalGroupId(newValue) {
|
|
this.$emit('update:value', newValue);
|
|
},
|
|
value:{
|
|
handler:function (val){
|
|
this.internalGroupId = val
|
|
},
|
|
immediate:true
|
|
}
|
|
},
|
|
methods: {
|
|
async listGroups() {
|
|
const {data} = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
|
|
this.groupOptions = data
|
|
},
|
|
onGroupChange(id) {
|
|
this.listGroups()
|
|
}
|
|
},
|
|
created() {
|
|
this.listGroups()
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<div style="display: flex;">
|
|
<el-select placeholder="参加人员范围"
|
|
v-model="internalGroupId"
|
|
clearable
|
|
style="width: 100%"
|
|
filterable>
|
|
<el-option v-for="item in groupOptions"
|
|
:label="item.groupName"
|
|
:value="item.groupId"
|
|
:key="item.groupId"
|
|
></el-option>
|
|
</el-select>
|
|
<el-button @click="$refs.drawerUserScope.userScopeDialog = true" type="primary" icon="el-icon-setting" class="ml10">设置
|
|
</el-button>
|
|
</div>
|
|
|
|
<drawer-user-scope
|
|
@group_change="onGroupChange"
|
|
ref="drawerUserScope"
|
|
:group_id.sync="internalGroupId"
|
|
></drawer-user-scope>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|