uid 从新分配 更新时间

This commit is contained in:
2025-07-04 14:05:15 +08:00
parent 8384660b31
commit e415d50c7c
10 changed files with 140 additions and 22 deletions

View File

@@ -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(() => {