@@ -201,10 +201,16 @@
< ! - - < div style = "padding: 0px 0px 30px 0px ;" >
< el-alert title = "分配成功数量可能会小于选择数量, 同id主播无法被重复分配" type = "warning" / >
< / div > -- >
< el-select v-model = "allocationUser" :placeholder="t('newHosts.placeAllocationUs er')" clearable >
< el-option v-for = "(user, index) in allocationUserList" :key="index" :label="user.label" :value="user.value" / >
< / el-select >
< div style = "display: flex;" >
< el-select v-if = "wsCache.get('roleRout ers ').find(item => item.id === 1).children.find(item => item.id === 103) "
v-model = "allocationDept" :placeholder="t('newHosts.placeAllocationDept')" clearable
@change ="getAllocationUserList" >
< el -option v-for = "(dept, index) in allocationdeptList" :key="index" :label="dept.name" :value="dept.id" / >
< / el-select >
< el-select v-model = "allocationUser" :placeholder="t('newHosts.placeAllocationUser')" clearable >
< el-option v-for = "(user, index) in allocationUserList" :key="index" :label="user.label" :value="user.value" / >
< / el-select >
< / div >
< template # footer >
< span class = "dialog-footer" >
< el-button @click ="dialogAllocation = false" > {{ t ( ' newHosts.cancel ' ) }} < / el -button >
@@ -224,12 +230,14 @@ import { getIntDictOptions, DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { NewHostsApi , NewHostsVO } from '@/api/server/newhosts'
import { getAllocation , getSimpleUserList } from '@/api/system/user'
import { getAllocation , getSimpleUserList , getSimpleUserListPage } from '@/api/system/user'
import NewHostsForm from './NewHostsForm.vue'
import { useCache } from '@/hooks/web/useCache'
import * as DeptApi from '@/api/system/dept'
import { func } from 'vue-types'
const { wsCache } = useCache ( )
// console.log("===================================", wsCache.get('roleRouters').find(item => item.id === 1).children)
/** 主播数据管理 列表 */
defineOptions ( { name : 'NewHosts' } )
@@ -265,12 +273,19 @@ const exportLoading = ref(false) // 导出的加载中
let dialogAllocation = ref ( false ) //分配弹窗
let selectHostList = ref ( [ ] ) //选中的主播列表
let allocationUser = ref ( '' ) //选中的分配用户
let allocationDept = ref ( '' ) //选中的分配部门
let allocationUserList = ref ( [
{
label : '分配用户1' ,
value : 1
}
] ) //选中的分配用户
let allocationdeptList = ref ( [
{
name : '分配用户1' ,
id : 1
}
] ) //选中的分配部门
/** 查询列表 */
const getList = async ( ) => {
@@ -308,6 +323,28 @@ const getAllocationList = async () => {
loading . value = false
}
}
const getAllocationUserList = async ( ) => {
const data = await getSimpleUserListPage ( { pageSize : 1000 , pageNo : 1 , deptId : allocationDept . value } )
allocationUserList . value = [ ]
console . log ( "----------------------------------------------------" , data . list )
data . list . forEach ( ( item ) => {
allocationUserList . value . push ( {
label : item . nickname ,
value : item . id
} )
} )
}
/** 查询部门 */
const getAlldeptList = async ( ) => {
loading . value = true
try {
const data = await DeptApi . getDeptPage ( queryParams )
allocationdeptList . value = data
// console.log('=========================================', allocationdeptList)
} finally {
loading . value = false
}
}
/** 搜索按钮操作 */
const handleQuery = ( ) => {
queryParams . pageNo = 1
@@ -435,5 +472,9 @@ function handleCopy(text) {
onMounted ( ( ) => {
getList ( )
getAllocationList ( ) ;
if ( wsCache . get ( 'roleRouters' ) . find ( item => item . id === 1 ) . children . find ( item => item . id === 103 ) ) {
getAlldeptList ( ) ;
}
} )
< / script >