uid 从新分配 更新时间
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
"build:dev": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode dev",
|
||||
"build:test": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode test",
|
||||
"build:stage": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode stage",
|
||||
"build:prod": "node --max_old_space_size=1024 ./node_modules/vite/bin/vite.js build --mode prod",
|
||||
"build:prod": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode prod",
|
||||
"serve:dev": "vite preview --mode dev",
|
||||
"serve:prod": "vite preview --mode prod",
|
||||
"preview": "pnpm build:local && vite preview",
|
||||
|
||||
@@ -16,6 +16,8 @@ export interface EmployeeHostsVO {
|
||||
hostsKind: string // 直播类型 娱乐,游戏
|
||||
operationStatus: number // 操作状态
|
||||
createTime: string // 创建时间
|
||||
updateTime: string // 创建时间
|
||||
|
||||
remake: string // 备注
|
||||
uid: string // 用户id
|
||||
}
|
||||
@@ -47,7 +49,11 @@ export const EmployeeHostsApi = {
|
||||
updateEmployeeHosts: async (data: EmployeeHostsVO) => {
|
||||
return await request.put({ url: `/server/employee-hosts/update`, data })
|
||||
},
|
||||
|
||||
// 批量修改员工分配主播
|
||||
updateBatchEmployeeHosts: async (data: EmployeeHostsVO[]) => {
|
||||
return await request.put({ url: `/server/employee-hosts/batch_update`, data })
|
||||
},
|
||||
|
||||
// 删除员工分配主播
|
||||
deleteEmployeeHosts: async (id: number) => {
|
||||
return await request.delete({ url: `/server/employee-hosts/delete?id=` + id })
|
||||
|
||||
@@ -43,7 +43,10 @@ export const NewHostsApi = {
|
||||
updateNewHosts: async (data: NewHostsVO) => {
|
||||
return await request.put({ url: `/server/new-hosts/update`, data })
|
||||
},
|
||||
|
||||
// 批量修改主播数据管理
|
||||
updateBatchNewHosts: async (data: NewHostsVO[]) => {
|
||||
return await request.put({ url: `/server/new-hosts/batch-update`, data })
|
||||
},
|
||||
// 删除主播数据管理
|
||||
deleteNewHosts: async (id: number) => {
|
||||
return await request.delete({ url: `/server/new-hosts/delete?id=` + id })
|
||||
|
||||
@@ -18,6 +18,7 @@ export interface UserVO {
|
||||
crawl: number
|
||||
bigBrother: number
|
||||
tenantId: number
|
||||
aiChat: number
|
||||
}
|
||||
|
||||
// 查询用户管理列表
|
||||
|
||||
@@ -514,6 +514,7 @@ export default {
|
||||
isAssigned: 'Assignment Status',
|
||||
placeIsAssigned: 'Please select assignment status',
|
||||
createTime: 'Created Time',
|
||||
updateTime: 'update Time',
|
||||
userId: 'User ID',
|
||||
placeAllocationUser: 'Please select assigned employee',
|
||||
invitationType: 'Invitation Type',
|
||||
@@ -524,6 +525,7 @@ export default {
|
||||
reset: 'Reset',
|
||||
newAdd: 'Add',
|
||||
export: 'Export',
|
||||
exportAi: 'copy StreamerId',
|
||||
allocation: 'Assign',
|
||||
hideSearch: 'Hide Search',
|
||||
showSearch: 'Show Search',
|
||||
|
||||
@@ -513,6 +513,7 @@ export default {
|
||||
isAssigned: '分配情况',
|
||||
placeIsAssigned: '请选择是否已经分配给员工',
|
||||
createTime: '创建时间',
|
||||
updateTime: '更新时间',
|
||||
userId: '用户 Id',
|
||||
placeAllocationUser: '请选择分配的员工',
|
||||
invitationType: '邀请类型',
|
||||
@@ -523,6 +524,7 @@ export default {
|
||||
reset: '重置',
|
||||
newAdd: '新增',
|
||||
export: '导出',
|
||||
exportAi: '批量复制主播Id',
|
||||
allocation: '分配',
|
||||
hideSearch: '隐藏搜索',
|
||||
showSearch: '显示搜索',
|
||||
|
||||
@@ -58,13 +58,13 @@
|
||||
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="date"
|
||||
class="!w-240px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('employee.userId')" prop="userId">
|
||||
<!-- <el-form-item :label="$t('employee.userId')" prop="userId">
|
||||
<el-select v-model="queryParams.userId" :placeholder="$t('employee.placeAllocationUser')" clearable
|
||||
class="!w-240px">
|
||||
<el-option v-for="(user, index) in allocationUserList" :key="index" :label="user.label"
|
||||
:value="user.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('employee.invitationType')" prop="invitationType">
|
||||
<el-select v-model="queryParams.invitationType" :placeholder="$t('employee.placeInvitationType')" clearable
|
||||
class="!w-240px">
|
||||
@@ -86,6 +86,11 @@
|
||||
<el-button @click="resetQuery">
|
||||
<Icon icon="ep:refresh" class="mr-5px" /> {{ $t('employee.reset') }}
|
||||
</el-button>
|
||||
<el-button @click="exportAi">
|
||||
<Icon icon="ep:copy-document" class="mr-5px" /> {{ $t('employee.exportAi') }}
|
||||
</el-button>
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
@@ -100,7 +105,10 @@
|
||||
<!-- 列表区域 -->
|
||||
<ContentWrap>
|
||||
<!-- ✅ PC 端使用 table -->
|
||||
<el-table v-if="!isMobile" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table v-if="!isMobile" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
|
||||
<el-table-column :label="$t('employee.hostsId')" align="center" prop="hostsId">
|
||||
<template #default="scope">
|
||||
<div style="color: green; text-decoration: underline;" @click="openHtml(scope.row, scope.row.hostsId)">
|
||||
@@ -131,6 +139,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.createTime')" align="center" prop="createTime" :formatter="dateFormatter"
|
||||
width="180px" />
|
||||
<el-table-column :label="$t('employee.updateTime')" align="center" prop="updateTime" :formatter="dateFormatter"
|
||||
width="180px" />
|
||||
<el-table-column :label="$t('employee.action')" align="center" min-width="120px">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="openForm('update', scope.row.id)">{{ $t('employee.edit') }}</el-button>
|
||||
@@ -156,9 +166,10 @@
|
||||
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="item.operationStatus" />
|
||||
</div>
|
||||
<div class="card-row"><b>{{ $t('employee.createTime') }}:</b>{{ item.createTime }}</div>
|
||||
<div class="card-row"><b>{{ $t('employee.updateTime') }}:</b>{{ item.updateTime }}</div>
|
||||
<div class="card-row action-row">
|
||||
<el-button link type="primary" @click="openForm('update', item.id, index)">{{ $t('employee.edit')
|
||||
}}</el-button>
|
||||
}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -174,12 +185,14 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { EmployeeHostsApi, EmployeeHostsVO } from '@/api/server/employeehosts'
|
||||
import EmployeeHostsForm from './EmployeeHostsForm.vue'
|
||||
import { getAllocation } from '@/api/system/user'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { func } from 'vue-types'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
@@ -223,6 +236,8 @@ let allocationUserList = ref([
|
||||
value: '1'
|
||||
}
|
||||
]) //选中的分配用户
|
||||
let selectHostList = ref([]) //选中的主播列表
|
||||
let allocationUser = ref() //选中的分配用户
|
||||
/** 查询列表pc直接赋值 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
@@ -354,6 +369,37 @@ function formSuccess(data, index) {
|
||||
|
||||
}
|
||||
|
||||
//分配按钮操作
|
||||
const handleSelectionChange = (val) => {
|
||||
selectHostList.value = val
|
||||
console.log(selectHostList.value)
|
||||
}
|
||||
|
||||
function exportAi() {
|
||||
if (selectHostList.value.length != 0) {
|
||||
const data = []
|
||||
selectHostList.value.forEach((item) => {
|
||||
data.push(item.hostsId)
|
||||
})
|
||||
navigator.clipboard.writeText(data.join('\n'))
|
||||
.then(() => {
|
||||
ElMessage.success('复制成功' + selectHostList.value.length + '条数据')
|
||||
})
|
||||
.catch(err => {
|
||||
ElMessage.error('复制失败')
|
||||
|
||||
})
|
||||
} else {
|
||||
ElMessage.error('请选择主播')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function AllocationFun() {
|
||||
console.log(allocationUser.value)
|
||||
console.log(selectHostList.value)
|
||||
}
|
||||
|
||||
const isMobile = ref(window.innerWidth <= 768)
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -86,6 +86,10 @@
|
||||
<el-button @click="resetQuery">
|
||||
<Icon icon="ep:refresh" class="mr-5px" /> {{ $t('employee.reset') }}
|
||||
</el-button>
|
||||
<el-button @click="dialogAllocation = true">
|
||||
<Icon icon="ep:refresh" class="mr-5px" /> {{ t('newHosts.allocation') }}
|
||||
</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
@@ -100,7 +104,10 @@
|
||||
<!-- 列表区域 -->
|
||||
<ContentWrap>
|
||||
<!-- ✅ PC 端使用 table -->
|
||||
<el-table v-if="!isMobile" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table v-if="!isMobile" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
|
||||
<el-table-column :label="$t('employee.hostsId')" align="center" prop="hostsId">
|
||||
<template #default="scope">
|
||||
<div style="color: green; text-decoration: underline;" @click="openHtml(scope.row, scope.row.hostsId)">
|
||||
@@ -131,6 +138,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.createTime')" align="center" prop="createTime" :formatter="dateFormatter"
|
||||
width="180px" />
|
||||
<el-table-column :label="$t('employee.updateTime')" align="center" prop="updateTime" :formatter="dateFormatter"
|
||||
width="180px" />
|
||||
<el-table-column :label="$t('employee.action')" align="center" min-width="120px">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="openForm('update', scope.row.id)">{{ $t('employee.edit') }}</el-button>
|
||||
@@ -157,9 +166,10 @@
|
||||
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="item.operationStatus" />
|
||||
</div>
|
||||
<div class="card-row"><b>{{ $t('employee.createTime') }}:</b>{{ formatTimestamp(item.createTime) }}</div>
|
||||
<div class="card-row"><b>{{ $t('employee.updateTime') }}:</b>{{ formatTimestamp(item.updateTime) }}</div>
|
||||
<div class="card-row action-row">
|
||||
<el-button link type="primary" @click="openForm('update', item.id, index)">{{ $t('employee.edit')
|
||||
}}</el-button>
|
||||
}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -168,7 +178,23 @@
|
||||
<Pagination v-if="!isMobile" :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</ContentWrap>
|
||||
<el-dialog v-model="dialogAllocation" :title="t('newHosts.allocationUser')">
|
||||
<!-- <div style="padding: 0px 0px 30px 0px ;">
|
||||
<el-alert title="分配成功数量可能会小于选择数量,同id主播无法被重复分配" type="warning" />
|
||||
</div> -->
|
||||
|
||||
<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>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogAllocation = false">{{ t('newHosts.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="AllocationFun">
|
||||
{{ t('newHosts.confirm') }}
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 表单弹窗 -->
|
||||
<EmployeeHostsForm ref="formRef" @success="formSuccess" />
|
||||
</template>
|
||||
@@ -218,12 +244,15 @@ const queryParams = reactive({
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
let isShowSearch = ref(true) // 是否显示搜索
|
||||
let dialogAllocation = ref(false) //分配弹窗
|
||||
let allocationUserList = ref([
|
||||
{
|
||||
label: '分配用户1',
|
||||
value: '1'
|
||||
}
|
||||
]) //选中的分配用户
|
||||
let selectHostList = ref([]) //选中的主播列表
|
||||
let allocationUser = ref() //选中的分配用户
|
||||
/** 查询列表pc直接赋值 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
@@ -368,6 +397,36 @@ function formatTimestamp(milliseconds) {
|
||||
}
|
||||
|
||||
|
||||
//分配按钮操作
|
||||
const handleSelectionChange = (val) => {
|
||||
selectHostList.value = val
|
||||
console.log(selectHostList.value)
|
||||
}
|
||||
|
||||
|
||||
|
||||
function AllocationFun() {
|
||||
console.log(allocationUser.value)
|
||||
console.log(selectHostList.value)
|
||||
if (allocationUser.value == undefined || selectHostList.value.length <= 0) {
|
||||
message.error('请选择分配用户和主播')
|
||||
return
|
||||
}
|
||||
let data = []
|
||||
selectHostList.value.forEach(element => {
|
||||
data.push({
|
||||
id: element.id,
|
||||
userId: allocationUser.value
|
||||
})
|
||||
})
|
||||
|
||||
EmployeeHostsApi.updateBatchEmployeeHosts(data).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
dialogAllocation.value = false
|
||||
}
|
||||
|
||||
const isMobile = ref(window.innerWidth <= 768)
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -255,11 +255,7 @@ const queryParams = reactive({
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
let dialogAllocation = ref(false)//分配弹窗
|
||||
let selectHostList = ref([{
|
||||
userId: '',
|
||||
isAssigned: 0,
|
||||
|
||||
}]) //选中的主播列表
|
||||
let selectHostList = ref([]) //选中的主播列表
|
||||
let allocationUser = ref('') //选中的分配用户
|
||||
let allocationUserList = ref([
|
||||
{
|
||||
@@ -369,12 +365,10 @@ const handleSelectionChange = (val) => {
|
||||
|
||||
//分配确认
|
||||
function AllocationFun() {
|
||||
if (selectHostList.value.length == 0) {
|
||||
message.error('请选择要分配的主播')
|
||||
return
|
||||
}
|
||||
if (allocationUser.value == '') {
|
||||
message.error('请选择分配用户')
|
||||
console.log('分配用户', allocationUser.value)
|
||||
console.log('分配主播', selectHostList.value)
|
||||
if (allocationUser.value == undefined || selectHostList.value.length <= 0) {
|
||||
message.error('请选择分配用户和主播')
|
||||
return
|
||||
}
|
||||
selectHostList.value.forEach((item) => {
|
||||
|
||||
@@ -52,7 +52,12 @@
|
||||
<el-radio-group v-model="userData.bigBrother">
|
||||
<el-radio :value="1">开启</el-radio>
|
||||
<el-radio :value="0">关闭</el-radio>
|
||||
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="userData.id" label="ai自动化" prop="status">
|
||||
<el-radio-group v-model="userData.aiChat">
|
||||
<el-radio :value="1">开启</el-radio>
|
||||
<el-radio :value="0">关闭</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -97,7 +102,7 @@ const userData = ref({} as userApi.UserVO)
|
||||
|
||||
let userList = ref([{
|
||||
id: 0,
|
||||
username: '',
|
||||
aiChat: 0,
|
||||
bigBrother: 0,
|
||||
crawl: 0
|
||||
}])
|
||||
|
||||
Reference in New Issue
Block a user