批量转化
This commit is contained in:
@@ -4,8 +4,8 @@ NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://192.168.2.22:48080'
|
||||
# VITE_BASE_URL='https://backstageapi.yolozs.com'
|
||||
# VITE_BASE_URL='http://192.168.2.22:48080'
|
||||
VITE_BASE_URL='https://backstageapi.yolozs.com'
|
||||
# VITE_BASE_URL='https://testapi.tknb.net'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { EmployeeHostsApi, EmployeeHostsVO } from '@/api/server/employeehosts'
|
||||
@@ -645,7 +645,39 @@ function exportAi() {
|
||||
}
|
||||
}
|
||||
|
||||
// 弹出确认对话框,询问是否同时更改 operationStatus 状态
|
||||
ElMessageBox.confirm('是否同时将选中主播的状态更改为已建联?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 用户确认,批量更新状态
|
||||
let updateData = []
|
||||
selectHostList.value.forEach(element => {
|
||||
updateData.push({
|
||||
id: element.id,
|
||||
userId: element.userId,
|
||||
hostsId: element.hostsId,
|
||||
operationStatus: 1
|
||||
})
|
||||
})
|
||||
|
||||
EmployeeHostsApi.updateBatchEmployeeHosts(updateData).then(res => {
|
||||
ElMessage.success('✅ 状态更新成功')
|
||||
// 复制到剪贴板
|
||||
copyToClipboard(data)
|
||||
// 刷新列表
|
||||
getList()
|
||||
}).catch(err => {
|
||||
ElMessage.error('❌ 状态更新失败')
|
||||
console.error(err)
|
||||
// 即使更新失败也复制到剪贴板
|
||||
copyToClipboard(data)
|
||||
})
|
||||
}).catch(() => {
|
||||
// 用户取消,只复制到剪贴板
|
||||
copyToClipboard(data)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -301,6 +301,7 @@ import { getAllocation, getSimpleUserList, getCountry } from '@/api/system/user'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import MobilePagination from '@/components/MobilePagination.vue'
|
||||
import { useDictStore } from '@/store/modules/dict' // 如果你项目里有字典 store
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
const dictStore = useDictStore?.() // 有就用;没有的话把 dictStore 相关行删掉
|
||||
|
||||
// 统一用字符串比较,自动识别并翻译 i18n key
|
||||
@@ -650,7 +651,39 @@ function exportAi() {
|
||||
}
|
||||
}
|
||||
|
||||
// 弹出确认对话框,询问是否同时更改 operationStatus 状态
|
||||
ElMessageBox.confirm('是否同时将选中主播的状态更改为已建联?', '操作确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 用户确认,批量更新状态
|
||||
let updateData = []
|
||||
selectHostList.value.forEach(element => {
|
||||
updateData.push({
|
||||
id: element.id,
|
||||
userId: element.userId,
|
||||
hostsId: element.hostsId,
|
||||
operationStatus: 1
|
||||
})
|
||||
})
|
||||
|
||||
EmployeeHostsApi.updateBatchEmployeeHosts(updateData).then(res => {
|
||||
ElMessage.success('✅ 状态更新成功')
|
||||
// 复制到剪贴板
|
||||
copyToClipboard(data)
|
||||
// 刷新列表
|
||||
getList()
|
||||
}).catch(err => {
|
||||
ElMessage.error('❌ 状态更新失败')
|
||||
console.error(err)
|
||||
// 即使更新失败也复制到剪贴板
|
||||
copyToClipboard(data)
|
||||
})
|
||||
}).catch(() => {
|
||||
// 用户取消,只复制到剪贴板
|
||||
copyToClipboard(data)
|
||||
})
|
||||
}
|
||||
// /** 初始化 **/
|
||||
// onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user