新增简化列表+员工端删除
This commit is contained in:
@@ -4,9 +4,9 @@ NODE_ENV=development
|
|||||||
VITE_DEV=true
|
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='http://47.79.98.113:48080'
|
||||||
# VITE_BASE_URL='https://backstageapi.yolozs.com'
|
VITE_BASE_URL='https://backstageapi.yolozs.com'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ export const EmployeeHostsApi = {
|
|||||||
deleteEmployeeHosts: async (id: number) => {
|
deleteEmployeeHosts: async (id: number) => {
|
||||||
return await request.delete({ url: `/server/employee-hosts/delete?id=` + id })
|
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
|
// 导出员工分配主播 Excel
|
||||||
exportEmployeeHosts: async (params) => {
|
exportEmployeeHosts: async (params) => {
|
||||||
|
|||||||
@@ -125,6 +125,9 @@
|
|||||||
<!-- <el-button type="success" plain @click="handleExport" v-hasPermi="['server:new-hosts:export']">
|
<!-- <el-button type="success" plain @click="handleExport" v-hasPermi="['server:new-hosts:export']">
|
||||||
<Icon icon="ep:download" class="mr-5px" /> {{ t('newHosts.export') }}
|
<Icon icon="ep:download" class="mr-5px" /> {{ t('newHosts.export') }}
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
|
<el-button type="danger" @click="handleDeleteList">
|
||||||
|
<Icon icon="ep:delete" class="mr-5px" /> 批量删除
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
@@ -134,6 +137,10 @@
|
|||||||
<div class="center-justify" style="margin-top: -15px;">
|
<div class="center-justify" style="margin-top: -15px;">
|
||||||
<el-button type="primary" @click="isShowSearch = !isShowSearch">{{ isShowSearch ? $t('employee.showSearch') :
|
<el-button type="primary" @click="isShowSearch = !isShowSearch">{{ isShowSearch ? $t('employee.showSearch') :
|
||||||
$t('employee.hideSearch') }}</el-button>
|
$t('employee.hideSearch') }}</el-button>
|
||||||
|
<div v-if="isMobile">
|
||||||
|
<el-switch v-model="simpleModel" />
|
||||||
|
简化列表
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 列表区域 -->
|
<!-- 列表区域 -->
|
||||||
@@ -194,6 +201,38 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- ✅ 移动端使用卡片列表 -->
|
<!-- ✅ 移动端使用卡片列表 -->
|
||||||
|
<div v-else>
|
||||||
|
<div v-if="simpleModel">
|
||||||
|
<!-- ✅ PC 端使用 table -->
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="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)">
|
||||||
|
{{ scope.row.hostsId }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('employee.operationStatus')" align="center" prop="operationStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="scope.row.operationStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('employee.remark')" align="center" prop="remake" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <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>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div v-for="(item, index) in list" :key="index" class="mobile-card">
|
<div v-for="(item, index) in list" :key="index" class="mobile-card">
|
||||||
<div class="card-row" style="color:green;">
|
<div class="card-row" style="color:green;">
|
||||||
@@ -221,6 +260,9 @@
|
|||||||
<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>
|
||||||
|
<el-button link type="danger" @click="handleDelete(item.id)">{{ $t('employee.delete')
|
||||||
|
}}</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -250,6 +292,8 @@ import MobilePagination from '@/components/MobilePagination.vue'
|
|||||||
|
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
|
let simpleModel = ref(false)
|
||||||
|
|
||||||
/** 员工分配主播 列表 */
|
/** 员工分配主播 列表 */
|
||||||
defineOptions({ name: 'EmployeeHosts' })
|
defineOptions({ name: 'EmployeeHosts' })
|
||||||
|
|
||||||
@@ -363,6 +407,18 @@ const handleDelete = async (id: number) => {
|
|||||||
await getList()
|
await getList()
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDeleteList = async () => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await EmployeeHostsApi.deleteEmployeeHostsList(checkedIds.value)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
@@ -445,10 +501,12 @@ function formatTimestamp(milliseconds) {
|
|||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除按钮操作 */
|
||||||
|
const checkedIds = ref<number[]>([])
|
||||||
//分配按钮操作
|
//分配按钮操作
|
||||||
const handleSelectionChange = (val) => {
|
const handleSelectionChange = (val) => {
|
||||||
selectHostList.value = val
|
selectHostList.value = val
|
||||||
|
checkedIds.value = val.map((row) => row.id)
|
||||||
console.log(selectHostList.value)
|
console.log(selectHostList.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user