批量删除 员工主播更新逻辑
This commit is contained in:
@@ -4,8 +4,8 @@ NODE_ENV=development
|
|||||||
VITE_DEV=true
|
VITE_DEV=true
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
# VITE_BASE_URL='http://192.168.1.174:48080'
|
VITE_BASE_URL='http://192.168.1.174:48080'
|
||||||
VITE_BASE_URL='http://47.79.98.113:48080'
|
# VITE_BASE_URL='http://47.79.98.113:48080'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export const EmployeeBigBrotherApi = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 修改大哥数据员工业务
|
// 修改大哥数据员工业务
|
||||||
updateEmployeeBigBrother: async (data: EmployeeBigBrotherVO) => {
|
updateEmployeeBigBrother: async (data) => {
|
||||||
return await request.put({ url: `/server/employee-big-brother/update`, data })
|
return await request.put({ url: `/server/employee-big-brother/update`, data })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,10 @@ export const NewHostsApi = {
|
|||||||
deleteNewHosts: async (id: number) => {
|
deleteNewHosts: async (id: number) => {
|
||||||
return await request.delete({ url: `/server/new-hosts/delete?id=` + id })
|
return await request.delete({ url: `/server/new-hosts/delete?id=` + id })
|
||||||
},
|
},
|
||||||
|
// 批量删除主播
|
||||||
|
deleteNewHostsList : async (ids: number[]) => {
|
||||||
|
return await request.delete({ url: '/server/new-hosts/delete-list', params: { ids: ids.join(',') } })
|
||||||
|
},
|
||||||
|
|
||||||
// 导出主播数据管理 Excel
|
// 导出主播数据管理 Excel
|
||||||
exportNewHosts: async (params) => {
|
exportNewHosts: async (params) => {
|
||||||
|
|||||||
@@ -161,6 +161,10 @@ export default {
|
|||||||
streamerDataManage: 'StreamerDataManage',
|
streamerDataManage: 'StreamerDataManage',
|
||||||
streamerList: 'StreamerList',
|
streamerList: 'StreamerList',
|
||||||
staffStreamerManage: 'StaffStreamerManage',
|
staffStreamerManage: 'StaffStreamerManage',
|
||||||
|
BigBrotherManage: 'BigBrotherManage',
|
||||||
|
BigBrotherDataManage: 'BigBrotherDataManage',
|
||||||
|
BigBrotherList: 'BigBrotherList',
|
||||||
|
staffBigBrotherManage: 'StaffBigBrotherManage',
|
||||||
},
|
},
|
||||||
analysis: {
|
analysis: {
|
||||||
newUser: 'New user',
|
newUser: 'New user',
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { BigBrotherApi } from "@/api/server/bigbrother";
|
||||||
import Search from "@/components/Search/src/Search.vue";
|
import Search from "@/components/Search/src/Search.vue";
|
||||||
import { max } from "lodash-es";
|
import { max } from "lodash-es";
|
||||||
|
|
||||||
@@ -163,9 +164,13 @@ export default {
|
|||||||
analysis: '分析页',
|
analysis: '分析页',
|
||||||
workplace: '工作台',
|
workplace: '工作台',
|
||||||
streamerManage: '主播管理',
|
streamerManage: '主播管理',
|
||||||
streamerDataManage: '主播数据管理',
|
streamerDataManage: '主播数据管理(管理)',
|
||||||
streamerList: '主播列表',
|
streamerList: '主播列表(员工)',
|
||||||
staffStreamerManage: '员工主播管理',
|
staffStreamerManage: '员工主播管理(管理)',
|
||||||
|
BigBrotherManage: '大哥管理',
|
||||||
|
BigBrotherDataManage: '大哥数据管理(管理)',
|
||||||
|
BigBrotherList: '大哥列表(员工)',
|
||||||
|
staffBigBrotherManage: '员工大哥管理(管理)',
|
||||||
|
|
||||||
},
|
},
|
||||||
analysis: {
|
analysis: {
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ const getAllocationList = async () => {
|
|||||||
function openHtml(item, id) {
|
function openHtml(item, id) {
|
||||||
let data = item
|
let data = item
|
||||||
data.operationStatus = 1
|
data.operationStatus = 1
|
||||||
EmployeeBigBrotherApi.updateEmployeeBigBrother(data).then(res => {
|
EmployeeBigBrotherApi.updateEmployeeBigBrother({ id: data.id, userId: data.userId, displayId: data.displayId, operationStatus: 1 }).then(res => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
window.open(`https://www.tiktok.com/@${id}`)
|
window.open(`https://www.tiktok.com/@${id}`)
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
<div class="card-row"><b>{{ $t('employee.updateTime') }}:</b>{{ item.updateTime }}</div>
|
<div class="card-row"><b>{{ $t('employee.updateTime') }}:</b>{{ item.updateTime }}</div>
|
||||||
<div class="card-row action-row">
|
<div class="card-row action-row">
|
||||||
<el-button link type="primary" @click="openForm('update', item.id, index)">{{ $t('employee.edit')
|
<el-button link type="primary" @click="openForm('update', item.id, index)">{{ $t('employee.edit')
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -346,7 +346,7 @@ const handleExport = async () => {
|
|||||||
function openHtml(item, id) {
|
function openHtml(item, id) {
|
||||||
let data = item
|
let data = item
|
||||||
data.operationStatus = 1
|
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()
|
getList()
|
||||||
})
|
})
|
||||||
window.open(`https://www.tiktok.com/@${id}`)
|
window.open(`https://www.tiktok.com/@${id}`)
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ function AllocationFun() {
|
|||||||
function openHtml(item, id) {
|
function openHtml(item, id) {
|
||||||
let data = item
|
let data = item
|
||||||
data.operationStatus = 1
|
data.operationStatus = 1
|
||||||
EmployeeBigBrotherApi.updateEmployeeBigBrother(data).then(res => {
|
EmployeeBigBrotherApi.updateEmployeeBigBrother({ id: data.id, userId: data.userId, displayId: data.displayId, operationStatus: 1 }).then(res => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
window.open(`https://www.tiktok.com/@${id}`)
|
window.open(`https://www.tiktok.com/@${id}`)
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
<div class="card-row"><b>{{ $t('employee.updateTime') }}:</b>{{ formatTimestamp(item.updateTime) }}</div>
|
<div class="card-row"><b>{{ $t('employee.updateTime') }}:</b>{{ formatTimestamp(item.updateTime) }}</div>
|
||||||
<div class="card-row action-row">
|
<div class="card-row action-row">
|
||||||
<el-button link type="primary" @click="openForm('update', item.id, index)">{{ $t('employee.edit')
|
<el-button link type="primary" @click="openForm('update', item.id, index)">{{ $t('employee.edit')
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -361,7 +361,7 @@ const getAllocationList = async () => {
|
|||||||
function openHtml(item, id) {
|
function openHtml(item, id) {
|
||||||
let data = item
|
let data = item
|
||||||
data.operationStatus = 1
|
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()
|
getList()
|
||||||
})
|
})
|
||||||
window.open(`https://www.tiktok.com/@${id}`)
|
window.open(`https://www.tiktok.com/@${id}`)
|
||||||
|
|||||||
@@ -136,7 +136,10 @@
|
|||||||
<el-button @click="dialogAllocation = true">
|
<el-button @click="dialogAllocation = true">
|
||||||
<Icon icon="ep:refresh" class="mr-5px" /> {{ t('newHosts.allocation') }}
|
<Icon icon="ep:refresh" class="mr-5px" /> {{ t('newHosts.allocation') }}
|
||||||
</el-button>
|
</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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
@@ -248,7 +251,7 @@ const queryParams = reactive({
|
|||||||
country: undefined,
|
country: undefined,
|
||||||
hostsKind: undefined,
|
hostsKind: undefined,
|
||||||
isAssigned: undefined,
|
isAssigned: undefined,
|
||||||
createTime: [],
|
createTime: new Date().toISOString().split('T')[0] + ' 00:00:00',
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
@@ -341,6 +344,23 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch { }
|
} 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 () => {
|
const handleExport = async () => {
|
||||||
try {
|
try {
|
||||||
@@ -357,9 +377,10 @@ const handleExport = async () => {
|
|||||||
}
|
}
|
||||||
//分配按钮操作
|
//分配按钮操作
|
||||||
const handleSelectionChange = (val) => {
|
const handleSelectionChange = (val) => {
|
||||||
|
checkedIds.value = val.map((row) => row.id)
|
||||||
selectHostList.value = val
|
selectHostList.value = val
|
||||||
console.log(selectHostList.value)
|
console.log(selectHostList.value)
|
||||||
|
console.log(checkedIds.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//分配确认
|
//分配确认
|
||||||
|
|||||||
Reference in New Issue
Block a user