diff --git a/.env.local b/.env.local index 610d0f1..6475fac 100644 --- a/.env.local +++ b/.env.local @@ -4,9 +4,9 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://192.168.1.144:48080' +# VITE_BASE_URL='http://192.168.1.144:48080' # VITE_BASE_URL='http://47.79.98.113:48080' -# VITE_BASE_URL='https://backstageapi.yolozs.com' +VITE_BASE_URL='https://backstageapi.yolozs.com' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server diff --git a/src/api/server/employeehosts/index.ts b/src/api/server/employeehosts/index.ts index c587dfc..99b3a13 100644 --- a/src/api/server/employeehosts/index.ts +++ b/src/api/server/employeehosts/index.ts @@ -65,6 +65,10 @@ export const EmployeeHostsApi = { deleteEmployeeHosts: async (id: number) => { return await request.delete({ url: `/server/employee-hosts/delete?id=` + id }) }, + // 删除员工分配主播 + deleteEmployeeHostsList: async (ids: number[]) => { + return await request.delete({ url: `/server/employee-hosts/delete-list`, params: { ids: ids.join(',') } }) + }, // 导出员工分配主播 Excel exportEmployeeHosts: async (params) => { diff --git a/src/views/server/employeehosts/index.vue b/src/views/server/employeehosts/index.vue index 9bea0be..2c0a508 100644 --- a/src/views/server/employeehosts/index.vue +++ b/src/views/server/employeehosts/index.vue @@ -125,6 +125,9 @@ + + 批量删除 + @@ -134,6 +137,10 @@
{{ isShowSearch ? $t('employee.showSearch') : $t('employee.hideSearch') }} +
+ + 简化列表 +
@@ -195,32 +202,67 @@
-
-
- {{ $t('employee.hostsId') }}:{{ item.hostsId }} - 复制id -
+
+ + + - -
{{ $t('employee.hostsLevel') }}:{{ item.hostsLevel }}
-
{{ $t('employee.hostsCoins') }}:{{ item.hostsCoins }}
-
{{ $t('employee.fans') }}:{{ item.fans }}
-
{{ $t('employee.fllowernum') }}:{{ item.fllowernum }}
-
{{ $t('employee.hostsCountry') }}:{{ item.country }}
-
{{ $t('employee.hostsKind') }}:{{ item.hostsKind }}
-
{{ $t('employee.remark') }}:{{ item.remake }}
-
{{ $t('employee.flag') }}: -
-
{{ $t('employee.operationStatus') }}: - -
-
{{ $t('employee.createTime') }}:{{ formatTimestamp(item.createTime) }}
-
{{ $t('employee.updateTime') }}:{{ formatTimestamp(item.updateTime) }}
-
- {{ $t('employee.edit') - }} + + + + + + + + + + + +
+
+
+
+ {{ $t('employee.hostsId') }}:{{ item.hostsId }} + 复制id +
+ + +
{{ $t('employee.hostsLevel') }}:{{ item.hostsLevel }}
+
{{ $t('employee.hostsCoins') }}:{{ item.hostsCoins }}
+
{{ $t('employee.fans') }}:{{ item.fans }}
+
{{ $t('employee.fllowernum') }}:{{ item.fllowernum }}
+
{{ $t('employee.hostsCountry') }}:{{ item.country }}
+
{{ $t('employee.hostsKind') }}:{{ item.hostsKind }}
+
{{ $t('employee.remark') }}:{{ item.remake }}
+
{{ $t('employee.flag') }}: +
+
{{ $t('employee.operationStatus') }}: + +
+
{{ $t('employee.createTime') }}:{{ formatTimestamp(item.createTime) }}
+
{{ $t('employee.updateTime') }}:{{ formatTimestamp(item.updateTime) }}
+
+ {{ $t('employee.edit') + }} + {{ $t('employee.delete') + }} +
@@ -250,6 +292,8 @@ import MobilePagination from '@/components/MobilePagination.vue' const { wsCache } = useCache() +let simpleModel = ref(false) + /** 员工分配主播 列表 */ defineOptions({ name: 'EmployeeHosts' }) @@ -363,6 +407,18 @@ const handleDelete = async (id: number) => { await getList() } catch { } } +/** 删除按钮操作 */ +const handleDeleteList = async () => { + try { + // 删除的二次确认 + await message.delConfirm() + // 发起删除 + await EmployeeHostsApi.deleteEmployeeHostsList(checkedIds.value) + message.success(t('common.delSuccess')) + // 刷新列表 + await getList() + } catch { } +} /** 导出按钮操作 */ const handleExport = async () => { @@ -445,10 +501,12 @@ function formatTimestamp(milliseconds) { return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; } - +/** 批量删除按钮操作 */ +const checkedIds = ref([]) //分配按钮操作 const handleSelectionChange = (val) => { selectHostList.value = val + checkedIds.value = val.map((row) => row.id) console.log(selectHostList.value) }