批量删除 员工主播更新逻辑

This commit is contained in:
2025-07-09 16:53:06 +08:00
parent 65e24c51d9
commit c3ba308ca7
10 changed files with 49 additions and 15 deletions

View File

@@ -303,7 +303,7 @@ const getAllocationList = async () => {
function openHtml(item, id) {
let data = item
data.operationStatus = 1
EmployeeBigBrotherApi.updateEmployeeBigBrother(data).then(res => {
EmployeeBigBrotherApi.updateEmployeeBigBrother({ id: data.id, userId: data.userId, displayId: data.displayId, operationStatus: 1 }).then(res => {
getList()
})
window.open(`https://www.tiktok.com/@${id}`)

View File

@@ -169,7 +169,7 @@
<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>
@@ -346,7 +346,7 @@ const handleExport = async () => {
function openHtml(item, id) {
let data = item
data.operationStatus = 1
EmployeeHostsApi.updateEmployeeHosts({ id: data.id, operationStatus: 1 }).then(res => {
EmployeeHostsApi.updateEmployeeHosts({ id: data.id, userId: data.userId, hostsId: data.hostsId, operationStatus: 1 }).then(res => {
getList()
})
window.open(`https://www.tiktok.com/@${id}`)

View File

@@ -347,7 +347,7 @@ function AllocationFun() {
function openHtml(item, id) {
let data = item
data.operationStatus = 1
EmployeeBigBrotherApi.updateEmployeeBigBrother(data).then(res => {
EmployeeBigBrotherApi.updateEmployeeBigBrother({ id: data.id, userId: data.userId, displayId: data.displayId, operationStatus: 1 }).then(res => {
getList()
})
window.open(`https://www.tiktok.com/@${id}`)

View File

@@ -169,7 +169,7 @@
<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>
@@ -361,7 +361,7 @@ const getAllocationList = async () => {
function openHtml(item, id) {
let data = item
data.operationStatus = 1
EmployeeHostsApi.updateEmployeeHosts({ id: data.id, operationStatus: 1 }).then(res => {
EmployeeHostsApi.updateEmployeeHosts({ id: data.id, userId: data.userId, hostsId: data.hostsId, operationStatus: 1 }).then(res => {
getList()
})
window.open(`https://www.tiktok.com/@${id}`)

View File

@@ -136,7 +136,10 @@
<el-button @click="dialogAllocation = true">
<Icon icon="ep:refresh" class="mr-5px" /> {{ t('newHosts.allocation') }}
</el-button>
<el-button type="danger" plain :disabled="checkedIds.length === 0" @click="handleDeleteBatch"
v-hasPermi="['system:post:delete']">
<Icon icon="ep:delete" class="mr-5px" /> 批量删除
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
@@ -248,7 +251,7 @@ const queryParams = reactive({
country: undefined,
hostsKind: undefined,
isAssigned: undefined,
createTime: [],
createTime: new Date().toISOString().split('T')[0] + ' 00:00:00',
userId: undefined,
})
const queryFormRef = ref() // 搜索的表单
@@ -341,6 +344,23 @@ const handleDelete = async (id: number) => {
} catch { }
}
/** 批量删除按钮操作 */
const checkedIds = ref<number[]>([])
const handleDeleteBatch = async () => {
try {
// 删除的二次确认
await message.delConfirm()
// 发起批量删除
await NewHostsApi.deleteNewHostsList(checkedIds.value)
message.success(t('common.delSuccess'))
// 刷新列表
await getList()
} catch { }
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
@@ -357,9 +377,10 @@ const handleExport = async () => {
}
//分配按钮操作
const handleSelectionChange = (val) => {
checkedIds.value = val.map((row) => row.id)
selectHostList.value = val
console.log(selectHostList.value)
console.log(checkedIds.value)
}
//分配确认