粉丝更新
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
|
||||||
|
|||||||
45
package-lock.json
generated
45
package-lock.json
generated
@@ -59,6 +59,7 @@
|
|||||||
"vue-i18n": "9.10.2",
|
"vue-i18n": "9.10.2",
|
||||||
"vue-router": "4.4.5",
|
"vue-router": "4.4.5",
|
||||||
"vue-types": "^5.1.1",
|
"vue-types": "^5.1.1",
|
||||||
|
"vue3-clipboard": "^1.0.0",
|
||||||
"vue3-signature": "^0.2.4",
|
"vue3-signature": "^0.2.4",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"web-storage-cache": "^1.1.1",
|
"web-storage-cache": "^1.1.1",
|
||||||
@@ -8055,6 +8056,16 @@
|
|||||||
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
|
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/clipboard": {
|
||||||
|
"version": "2.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz",
|
||||||
|
"integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
|
||||||
|
"dependencies": {
|
||||||
|
"good-listener": "^1.2.2",
|
||||||
|
"select": "^1.1.2",
|
||||||
|
"tiny-emitter": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/cliui": {
|
"node_modules/cliui": {
|
||||||
"version": "8.0.1",
|
"version": "8.0.1",
|
||||||
"resolved": "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz",
|
"resolved": "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz",
|
||||||
@@ -9112,6 +9123,11 @@
|
|||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/delegate": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
|
||||||
|
},
|
||||||
"node_modules/destr": {
|
"node_modules/destr": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.5",
|
||||||
"resolved": "https://registry.npmmirror.com/destr/-/destr-2.0.5.tgz",
|
"resolved": "https://registry.npmmirror.com/destr/-/destr-2.0.5.tgz",
|
||||||
@@ -11065,6 +11081,14 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/good-listener": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
|
||||||
|
"dependencies": {
|
||||||
|
"delegate": "^3.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/gopd": {
|
"node_modules/gopd": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz",
|
"resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz",
|
||||||
@@ -14856,6 +14880,11 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/select": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA=="
|
||||||
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "7.7.2",
|
"version": "7.7.2",
|
||||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-7.7.2.tgz",
|
"resolved": "https://registry.npmmirror.com/semver/-/semver-7.7.2.tgz",
|
||||||
@@ -15873,6 +15902,11 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/tiny-emitter": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
|
||||||
|
},
|
||||||
"node_modules/tiny-svg": {
|
"node_modules/tiny-svg": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmmirror.com/tiny-svg/-/tiny-svg-3.1.3.tgz",
|
"resolved": "https://registry.npmmirror.com/tiny-svg/-/tiny-svg-3.1.3.tgz",
|
||||||
@@ -17080,6 +17114,17 @@
|
|||||||
"integrity": "sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==",
|
"integrity": "sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/vue3-clipboard": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/vue3-clipboard/-/vue3-clipboard-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-GUqKh1oO79xDpq0z+cCv/NDVTpcJGNDzeNgT3PmTdTp/WJh3gcTrDqIYKycKhzMFOtIFJ7hO/+usgyWtT+fNhA==",
|
||||||
|
"dependencies": {
|
||||||
|
"clipboard": "^2.0.6"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"vue": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vue3-signature": {
|
"node_modules/vue3-signature": {
|
||||||
"version": "0.2.4",
|
"version": "0.2.4",
|
||||||
"resolved": "https://registry.npmmirror.com/vue3-signature/-/vue3-signature-0.2.4.tgz",
|
"resolved": "https://registry.npmmirror.com/vue3-signature/-/vue3-signature-0.2.4.tgz",
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
"vue-i18n": "9.10.2",
|
"vue-i18n": "9.10.2",
|
||||||
"vue-router": "4.4.5",
|
"vue-router": "4.4.5",
|
||||||
"vue-types": "^5.1.1",
|
"vue-types": "^5.1.1",
|
||||||
|
"vue3-clipboard": "^1.0.0",
|
||||||
"vue3-signature": "^0.2.4",
|
"vue3-signature": "^0.2.4",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"web-storage-cache": "^1.1.1",
|
"web-storage-cache": "^1.1.1",
|
||||||
|
|||||||
57
src/api/server/bigbrother/index.ts
Normal file
57
src/api/server/bigbrother/index.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 大哥数据 VO
|
||||||
|
export interface BigBrotherVO {
|
||||||
|
id: number // 主键id
|
||||||
|
displayId: string // 大哥的display_id
|
||||||
|
userIdStr: string // 大哥的用户id
|
||||||
|
nickname: string // 大哥的用户昵称
|
||||||
|
level: number // 大哥的等级
|
||||||
|
hostcoins: number // 大哥打赏的金币
|
||||||
|
followerCount: number // 大哥的粉丝数
|
||||||
|
followingCount: number // 大哥的关注数
|
||||||
|
region: string // 大哥所在的地区
|
||||||
|
historicHighCoins: number // 大哥打赏的历史最高金币
|
||||||
|
totalGiftCoins: number // 大哥历史打赏金币总和
|
||||||
|
hostDisplayId: string // 大哥所在的直播间的主播display_id
|
||||||
|
ownerId: string // 该数据所属的账号id
|
||||||
|
}
|
||||||
|
|
||||||
|
// 大哥数据 API
|
||||||
|
export const BigBrotherApi = {
|
||||||
|
// 查询大哥数据分页
|
||||||
|
getBigBrotherPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/server/big-brother/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询大哥数据详情
|
||||||
|
getBigBrother: async (id: number) => {
|
||||||
|
return await request.get({ url: `/server/big-brother/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增大哥数据
|
||||||
|
createBigBrother: async (data: BigBrotherVO) => {
|
||||||
|
return await request.post({ url: `/server/big-brother/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改大哥数据
|
||||||
|
updateBigBrother: async (data: BigBrotherVO) => {
|
||||||
|
return await request.put({ url: `/server/big-brother/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 分配大哥
|
||||||
|
Allocation: async (data: BigBrotherVO[]) => {
|
||||||
|
return await request.post({ url: `/server/employee-big-brother/allocation`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除大哥数据
|
||||||
|
deleteBigBrother: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/server/big-brother/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出大哥数据 Excel
|
||||||
|
exportBigBrother: async (params) => {
|
||||||
|
return await request.download({ url: `/server/big-brother/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
60
src/api/server/employeebigbrother/index.ts
Normal file
60
src/api/server/employeebigbrother/index.ts
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 大哥数据员工业务 VO
|
||||||
|
export interface EmployeeBigBrotherVO {
|
||||||
|
id: number // 主键id
|
||||||
|
displayId: string // 大哥的display_id
|
||||||
|
userIdStr: string // 大哥的用户id
|
||||||
|
nickname: string // 大哥的用户昵称
|
||||||
|
level: number // 大哥的等级
|
||||||
|
hostcoins: number // 大哥打赏的金币
|
||||||
|
followerCount: number // 大哥的粉丝数
|
||||||
|
followingCount: number // 大哥的关注数
|
||||||
|
region: string // 大哥所在的地区
|
||||||
|
historicHighCoins: number // 大哥打赏的历史最高金币
|
||||||
|
totalGiftCoins: number // 大哥历史打赏金币总和
|
||||||
|
hostDisplayId: string // 大哥所在的直播间的主播display_id
|
||||||
|
userId: string // 该数据所属的账号id
|
||||||
|
operationStatus: number // 是否洽谈
|
||||||
|
}
|
||||||
|
|
||||||
|
// 大哥数据员工业务 API
|
||||||
|
export const EmployeeBigBrotherApi = {
|
||||||
|
// 查询大哥数据员工业务分页
|
||||||
|
getMeangeEmployeeBigBrotherPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/server/employee-big-brother/page`, params })
|
||||||
|
},
|
||||||
|
// 查询管理大哥数据员工业务分页
|
||||||
|
getEmployeeBigBrotherPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/server/employee-big-brother/self_page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 批量修改大哥数据
|
||||||
|
batchUpdateBigBrother: async (data: EmployeeBigBrotherVO[]) => {
|
||||||
|
return await request.put({ url: `/server/employee-big-brother/batch_update`, data })
|
||||||
|
},
|
||||||
|
// 查询大哥数据员工业务详情
|
||||||
|
getEmployeeBigBrother: async (id: number) => {
|
||||||
|
return await request.get({ url: `/server/employee-big-brother/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增大哥数据员工业务
|
||||||
|
createEmployeeBigBrother: async (data: EmployeeBigBrotherVO) => {
|
||||||
|
return await request.post({ url: `/server/employee-big-brother/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改大哥数据员工业务
|
||||||
|
updateEmployeeBigBrother: async (data: EmployeeBigBrotherVO) => {
|
||||||
|
return await request.put({ url: `/server/employee-big-brother/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除大哥数据员工业务
|
||||||
|
deleteEmployeeBigBrother: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/server/employee-big-brother/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出大哥数据员工业务 Excel
|
||||||
|
exportEmployeeBigBrother: async (params) => {
|
||||||
|
return await request.download({ url: `/server/employee-big-brother/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,7 @@ export const EmployeeHostsApi = {
|
|||||||
getEmployeeHostsPage: async (params: any) => {
|
getEmployeeHostsPage: async (params: any) => {
|
||||||
return await request.get({ url: `/server/employee-hosts/self_page`, params })
|
return await request.get({ url: `/server/employee-hosts/self_page`, params })
|
||||||
},
|
},
|
||||||
|
// 查询管理员工分配主播分页
|
||||||
getMeangeEmployeeHostsPage: async (params: any) => {
|
getMeangeEmployeeHostsPage: async (params: any) => {
|
||||||
return await request.get({ url: `server/employee-hosts/page`, params })
|
return await request.get({ url: `server/employee-hosts/page`, params })
|
||||||
},
|
},
|
||||||
@@ -46,7 +47,7 @@ export const EmployeeHostsApi = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 修改员工分配主播
|
// 修改员工分配主播
|
||||||
updateEmployeeHosts: async (data: EmployeeHostsVO) => {
|
updateEmployeeHosts: async (data) => {
|
||||||
return await request.put({ url: `/server/employee-hosts/update`, data })
|
return await request.put({ url: `/server/employee-hosts/update`, data })
|
||||||
},
|
},
|
||||||
// 批量修改员工分配主播
|
// 批量修改员工分配主播
|
||||||
|
|||||||
@@ -250,5 +250,7 @@ export enum DICT_TYPE {
|
|||||||
INT_TRUE_FLASE = 'int_true_false',// 桥梁类型HOST_LEVEL
|
INT_TRUE_FLASE = 'int_true_false',// 桥梁类型HOST_LEVEL
|
||||||
HOST_LEVEL = 'host_level', // 桥梁类型country_group
|
HOST_LEVEL = 'host_level', // 桥梁类型country_group
|
||||||
COUNTRY_GROUP = 'country_group', // 桥梁类型
|
COUNTRY_GROUP = 'country_group', // 桥梁类型
|
||||||
OPERATION_STATE = 'operational_state' // 桥梁类型operational_state
|
OPERATION_STATE = 'operational_state', // 桥梁类型operational_state
|
||||||
|
BIGBIOTHER_NEGOTIATION = 'bigBiother_negotiation' // 是否洽谈
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
147
src/views/server/bigbrother/BigBrotherForm.vue
Normal file
147
src/views/server/bigbrother/BigBrotherForm.vue
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="大哥的display_id" prop="displayId">
|
||||||
|
<el-input v-model="formData.displayId" placeholder="请输入大哥的display_id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的用户id" prop="userIdStr">
|
||||||
|
<el-input v-model="formData.userIdStr" placeholder="请输入大哥的用户id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的用户昵称" prop="nickname">
|
||||||
|
<el-input v-model="formData.nickname" placeholder="请输入大哥的用户昵称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的等级" prop="level">
|
||||||
|
<el-input v-model="formData.level" placeholder="请输入大哥的等级" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的金币" prop="hostcoins">
|
||||||
|
<el-input v-model="formData.hostcoins" placeholder="请输入大哥打赏的金币" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的粉丝数" prop="followerCount">
|
||||||
|
<el-input v-model="formData.followerCount" placeholder="请输入大哥的粉丝数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的关注数" prop="followingCount">
|
||||||
|
<el-input v-model="formData.followingCount" placeholder="请输入大哥的关注数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的地区" prop="region">
|
||||||
|
<el-input v-model="formData.region" placeholder="请输入大哥所在的地区" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的历史最高金币" prop="historicHighCoins">
|
||||||
|
<el-input v-model="formData.historicHighCoins" placeholder="请输入大哥打赏的历史最高金币" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥历史打赏金币总和" prop="totalGiftCoins">
|
||||||
|
<el-input v-model="formData.totalGiftCoins" placeholder="请输入大哥历史打赏金币总和" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的直播间的主播display_id" prop="hostDisplayId">
|
||||||
|
<el-input v-model="formData.hostDisplayId" placeholder="请输入大哥所在的直播间的主播display_id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="该数据所属的账号id" prop="ownerId">
|
||||||
|
<el-input v-model="formData.ownerId" placeholder="请输入该数据所属的账号id" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { BigBrotherApi, BigBrotherVO } from '@/api/server/bigbrother'
|
||||||
|
|
||||||
|
/** 大哥数据 表单 */
|
||||||
|
defineOptions({ name: 'BigBrotherForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
level: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoins: undefined,
|
||||||
|
totalGiftCoins: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
ownerId: undefined
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
displayId: [{ required: true, message: '大哥的display_id不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await BigBrotherApi.getBigBrother(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as BigBrotherVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await BigBrotherApi.createBigBrother(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await BigBrotherApi.updateBigBrother(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
level: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoins: undefined,
|
||||||
|
totalGiftCoins: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
ownerId: undefined
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
339
src/views/server/bigbrother/index.vue
Normal file
339
src/views/server/bigbrother/index.vue
Normal file
@@ -0,0 +1,339 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true">
|
||||||
|
<el-form-item label="大哥的用户id" prop="displayId">
|
||||||
|
<el-input v-model="queryParams.displayId" placeholder="请输入大哥的用户id" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="大哥的uid" prop="userIdStr">
|
||||||
|
<el-input v-model="queryParams.userIdStr" placeholder="请输入大哥的uid" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的昵称" prop="nickname">
|
||||||
|
<el-input v-model="queryParams.nickname" placeholder="请输入大哥的昵称" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="大哥的等级" prop="level">
|
||||||
|
<!-- <el-input v-model="queryParams.level" placeholder="请输入大哥的等级" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" /> -->
|
||||||
|
|
||||||
|
<el-input v-model="queryParams.levelMin" :placeholder="t('newHosts.min')" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.levelMax" :placeholder="t('newHosts.max')" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-form-item label="大哥打赏的金币" prop="hostcoins">
|
||||||
|
<el-input v-model="queryParams.hostcoins" placeholder="请输入大哥打赏的金币" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的粉丝数" prop="followerCount">
|
||||||
|
<el-input v-model="queryParams.followerCount" placeholder="请输入大哥的粉丝数" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的关注数" prop="followingCount">
|
||||||
|
<el-input v-model="queryParams.followingCount" placeholder="请输入大哥的关注数" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="大哥所在的地区" prop="region">
|
||||||
|
<el-input v-model="queryParams.region" placeholder="请输入大哥所在的地区" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的国家" prop="countryName">
|
||||||
|
<el-input v-model="queryParams.countryName" placeholder="请输入大哥的国家" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的历史最高金币" prop="historicHighCoins">
|
||||||
|
<!-- <el-input v-model="queryParams.historicHighCoins" placeholder="请输入大哥打赏的历史最高金币" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-240px" /> -->
|
||||||
|
|
||||||
|
<el-input v-model="queryParams.historicHighCoinsMin" :placeholder="t('newHosts.min')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.historicHighCoinsMax" :placeholder="t('newHosts.max')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥历史打赏金币总和" prop="totalGiftCoinsMin">
|
||||||
|
|
||||||
|
<el-input v-model="queryParams.totalGiftCoinsMin" :placeholder="t('newHosts.min')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.totalGiftCoinsMax" :placeholder="t('newHosts.max')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的直播间的主播id" prop="hostDisplayId">
|
||||||
|
<el-input v-model="queryParams.hostDisplayId" placeholder="请输入大哥所在的直播间的主播id" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="该数据所属的账号id" prop="ownerId">
|
||||||
|
<el-input v-model="queryParams.ownerId" placeholder="请输入该数据所属的账号id" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
|
||||||
|
start-placeholder="开始日期" end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-220px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery">
|
||||||
|
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetQuery">
|
||||||
|
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button type="primary" plain @click="openForm('create')" v-hasPermi="['server:big-brother:create']">
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button> -->
|
||||||
|
<el-button type="success" plain @click="handleExport" :loading="exportLoading"
|
||||||
|
v-hasPermi="['server:big-brother:export']">
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="dialogAllocation = true">
|
||||||
|
<Icon icon="ep:refresh" class="mr-5px" /> {{ t('newHosts.allocation') }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
|
||||||
|
<el-table-column label="大哥的用户id" align="center" prop="displayId" />
|
||||||
|
<el-table-column label="大哥的uid" align="center" prop="userIdStr" />
|
||||||
|
<el-table-column label="大哥的用户昵称" align="center" prop="nickname" />
|
||||||
|
<el-table-column label="大哥的等级" align="center" prop="level" />
|
||||||
|
<el-table-column label="大哥打赏的金币" align="center" prop="hostcoins" />
|
||||||
|
<el-table-column label="大哥的粉丝数" align="center" prop="followerCount" />
|
||||||
|
<el-table-column label="大哥的关注数" align="center" prop="followingCount" />
|
||||||
|
<el-table-column label="大哥所在的地区" align="center" prop="region" />
|
||||||
|
<el-table-column label="大哥打赏的历史最高金币" align="center" prop="historicHighCoins" />
|
||||||
|
<el-table-column label="大哥历史打赏金币总和" align="center" prop="totalGiftCoins" />
|
||||||
|
<el-table-column label="大哥所在的直播间的主播id" align="center" prop="hostDisplayId" />
|
||||||
|
<el-table-column label="该数据所属的账号id" align="center" prop="ownerId" />
|
||||||
|
<el-table-column :label="t('newHosts.isAssigned')" align="center" prop="isAssigned">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.INT_TRUE_FLASE" :value="scope.row.isAssigned" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180px" />
|
||||||
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['server:big-brother:update']">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['server:big-brother:delete']">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</ContentWrap>
|
||||||
|
<!-- 分配弹窗 -->
|
||||||
|
<el-dialog v-model="dialogAllocation" :title="t('newHosts.allocationUser')">
|
||||||
|
<!-- <div style="padding: 0px 0px 30px 0px ;">
|
||||||
|
<el-alert title="分配成功数量可能会小于选择数量,同id主播无法被重复分配" type="warning" />
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<el-select v-model="allocationUser" :placeholder="t('newHosts.placeAllocationUser')" clearable>
|
||||||
|
<el-option v-for="(user, index) in allocationUserList" :key="index" :label="user.label" :value="user.value" />
|
||||||
|
</el-select>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogAllocation = false">{{ t('newHosts.cancel') }}</el-button>
|
||||||
|
<el-button type="primary" @click="AllocationFun">
|
||||||
|
{{ t('newHosts.confirm') }}
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<BigBrotherForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { BigBrotherApi, BigBrotherVO } from '@/api/server/bigbrother'
|
||||||
|
import { getAllocation, getSimpleUserList } from '@/api/system/user'
|
||||||
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
|
import BigBrotherForm from './BigBrotherForm.vue'
|
||||||
|
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
/** 大哥数据 列表 */
|
||||||
|
defineOptions({ name: 'BigBrother' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<BigBrotherVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
levelMin: undefined,
|
||||||
|
levelMax: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoins: undefined,
|
||||||
|
historicHighCoinsMin: undefined,
|
||||||
|
historicHighCoinsMax: undefined,
|
||||||
|
totalGiftCoinsMin: undefined,
|
||||||
|
totalGiftCoinsMax: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
ownerId: undefined,
|
||||||
|
createTime: [],
|
||||||
|
createTimeStart: '',
|
||||||
|
createTimeEnd: '',
|
||||||
|
countryName: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
let dialogAllocation = ref(false)//分配弹窗
|
||||||
|
let selectHostList = ref([]) //选中的主播列表
|
||||||
|
let allocationUser = ref('') //选中的分配用户
|
||||||
|
let allocationUserList = ref([
|
||||||
|
{
|
||||||
|
label: '分配用户1',
|
||||||
|
value: 1
|
||||||
|
}
|
||||||
|
]) //选中的分配用户
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
queryParams.createTimeStart = queryParams.createTime?.[0]
|
||||||
|
queryParams.createTimeEnd = queryParams.createTime?.[1]
|
||||||
|
const data = await BigBrotherApi.getBigBrotherPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
queryParams.levelMin = undefined
|
||||||
|
queryParams.levelMax = undefined
|
||||||
|
queryParams.totalGiftCoinsMin = undefined
|
||||||
|
queryParams.totalGiftCoinsMax = undefined
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await BigBrotherApi.deleteBigBrother(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await BigBrotherApi.exportBigBrother(queryParams)
|
||||||
|
download.excel(data, '大哥数据.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 查询员工 */
|
||||||
|
const getAllocationList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
allocationUserList.value = []
|
||||||
|
try {
|
||||||
|
const data = await getSimpleUserList()
|
||||||
|
console.log('data', data)
|
||||||
|
data.forEach((item) => {
|
||||||
|
if (wsCache.get('user').user.id == item.id) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
allocationUserList.value.push({
|
||||||
|
label: item.nickname,
|
||||||
|
value: item.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
console.log(allocationUserList.value)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//分配按钮操作
|
||||||
|
const handleSelectionChange = (val) => {
|
||||||
|
|
||||||
|
selectHostList.value = val
|
||||||
|
console.log(selectHostList.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
//分配确认
|
||||||
|
function AllocationFun() {
|
||||||
|
console.log('分配用户', allocationUser.value)
|
||||||
|
console.log('分配主播', selectHostList.value)
|
||||||
|
if (allocationUser.value == undefined || selectHostList.value.length <= 0) {
|
||||||
|
message.error('请选择分配用户和主播')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
selectHostList.value.forEach((item) => {
|
||||||
|
item.userId = allocationUser.value;
|
||||||
|
item.isAssigned = 1;
|
||||||
|
})
|
||||||
|
console.log('数组', selectHostList.value)
|
||||||
|
BigBrotherApi.Allocation(selectHostList.value).then((res) => {
|
||||||
|
message.success(`分配${selectHostList.value.length}个,成功${res}个`)
|
||||||
|
dialogAllocation.value = false
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
getAllocationList();
|
||||||
|
})
|
||||||
|
</script>
|
||||||
154
src/views/server/employeebigbrother/EmployeeBigBrotherForm.vue
Normal file
154
src/views/server/employeebigbrother/EmployeeBigBrotherForm.vue
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="大哥的display_id" prop="displayId">
|
||||||
|
<el-input v-model="formData.displayId" placeholder="请输入大哥的display_id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的用户id" prop="userIdStr">
|
||||||
|
<el-input v-model="formData.userIdStr" placeholder="请输入大哥的用户id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的用户昵称" prop="nickname">
|
||||||
|
<el-input v-model="formData.nickname" placeholder="请输入大哥的用户昵称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的等级" prop="level">
|
||||||
|
<el-input v-model="formData.level" placeholder="请输入大哥的等级" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的金币" prop="hostcoins">
|
||||||
|
<el-input v-model="formData.hostcoins" placeholder="请输入大哥打赏的金币" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的粉丝数" prop="followerCount">
|
||||||
|
<el-input v-model="formData.followerCount" placeholder="请输入大哥的粉丝数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的关注数" prop="followingCount">
|
||||||
|
<el-input v-model="formData.followingCount" placeholder="请输入大哥的关注数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的地区" prop="region">
|
||||||
|
<el-input v-model="formData.region" placeholder="请输入大哥所在的地区" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的历史最高金币" prop="historicHighCoins">
|
||||||
|
<el-input v-model="formData.historicHighCoins" placeholder="请输入大哥打赏的历史最高金币" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥历史打赏金币总和" prop="totalGiftCoins">
|
||||||
|
<el-input v-model="formData.totalGiftCoins" placeholder="请输入大哥历史打赏金币总和" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的直播间的主播display_id" prop="hostDisplayId">
|
||||||
|
<el-input v-model="formData.hostDisplayId" placeholder="请输入大哥所在的直播间的主播display_id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="该数据所属的账号id" prop="userId">
|
||||||
|
<el-input v-model="formData.userId" placeholder="请输入该数据所属的账号id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否洽谈" prop="operationStatus">
|
||||||
|
<el-radio-group v-model="formData.operationStatus">
|
||||||
|
<el-radio value="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { EmployeeBigBrotherApi, EmployeeBigBrotherVO } from '@/api/server/employeebigbrother'
|
||||||
|
|
||||||
|
/** 大哥数据员工业务 表单 */
|
||||||
|
defineOptions({ name: 'EmployeeBigBrotherForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
level: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoins: undefined,
|
||||||
|
totalGiftCoins: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
operationStatus: undefined
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
displayId: [{ required: true, message: '大哥的display_id不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await EmployeeBigBrotherApi.getEmployeeBigBrother(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as EmployeeBigBrotherVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await EmployeeBigBrotherApi.createEmployeeBigBrother(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await EmployeeBigBrotherApi.updateEmployeeBigBrother(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
level: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoins: undefined,
|
||||||
|
totalGiftCoins: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
operationStatus: undefined
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
317
src/views/server/employeebigbrother/index.vue
Normal file
317
src/views/server/employeebigbrother/index.vue
Normal file
@@ -0,0 +1,317 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true">
|
||||||
|
<el-form-item label="大哥的用户id" prop="displayId">
|
||||||
|
<el-input v-model="queryParams.displayId" placeholder="请输入大哥的用户id" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="大哥的uid" prop="userIdStr">
|
||||||
|
<el-input v-model="queryParams.userIdStr" placeholder="请输入大哥的uid" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的用户昵称" prop="nickname">
|
||||||
|
<el-input v-model="queryParams.nickname" placeholder="请输入大哥的用户昵称" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="大哥的等级" prop="level">
|
||||||
|
<el-input v-model="queryParams.levelMin" :placeholder="t('newHosts.min')" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.levelMax" :placeholder="t('newHosts.max')" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="大哥打赏的金币" prop="hostcoins">
|
||||||
|
<el-input v-model="queryParams.hostcoins" placeholder="请输入大哥打赏的金币" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的粉丝数" prop="followerCount">
|
||||||
|
<el-input v-model="queryParams.followerCount" placeholder="请输入大哥的粉丝数" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的关注数" prop="followingCount">
|
||||||
|
<el-input v-model="queryParams.followingCount" placeholder="请输入大哥的关注数" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="大哥所在的地区" prop="region">
|
||||||
|
<el-input v-model="queryParams.region" placeholder="请输入大哥所在的地区" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的历史最高金币" prop="historicHighCoins">
|
||||||
|
<el-input v-model="queryParams.historicHighCoinsMin" :placeholder="t('newHosts.min')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.historicHighCoinsMax" :placeholder="t('newHosts.max')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥历史打赏金币总和" prop="totalGiftCoins">
|
||||||
|
<el-input v-model="queryParams.totalGiftCoinsMin" :placeholder="t('newHosts.min')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.totalGiftCoinsMax" :placeholder="t('newHosts.max')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的直播间的主播id" prop="hostDisplayId">
|
||||||
|
<el-input v-model="queryParams.hostDisplayId" placeholder="请输入大哥所在的直播间的主播id" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="该数据所属的账号id" prop="userId">
|
||||||
|
<el-input v-model="queryParams.userId" placeholder="请输入该数据所属的账号id" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
|
||||||
|
start-placeholder="开始日期" end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-220px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否洽谈" prop="operationStatus">
|
||||||
|
<el-select v-model="queryParams.operationStatus" placeholder="请选择是否洽谈" clearable class="!w-240px">
|
||||||
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.BIGBIOTHER_NEGOTIATION)" :key="dict.value"
|
||||||
|
:label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="t('newHosts.allocationUser')" prop="allocationUser">
|
||||||
|
<el-select v-model="queryParams.userId" :placeholder="t('newHosts.placeAllocationUser')" clearable
|
||||||
|
class="!w-240px">
|
||||||
|
<el-option v-for="(user, index) in allocationUserList" :key="index" :label="user.label" :value="user.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery">
|
||||||
|
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetQuery">
|
||||||
|
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button type="primary" plain @click="openForm('create')" v-hasPermi="['server:employee-big-brother:create']">
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button> -->
|
||||||
|
<el-button type="success" plain @click="handleExport" :loading="exportLoading"
|
||||||
|
v-hasPermi="['server:employee-big-brother:export']">
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column label="大哥的用户id" align="center" prop="displayId">
|
||||||
|
<template #default="scope">
|
||||||
|
<div style="color: green; text-decoration: underline;" @click="openHtml(scope.row, scope.row.displayId)">
|
||||||
|
{{ scope.row.displayId }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="大哥的uid" align="center" prop="userIdStr" />
|
||||||
|
<el-table-column label="大哥的用户昵称" align="center" prop="nickname" />
|
||||||
|
<el-table-column label="大哥的等级" align="center" prop="level" />
|
||||||
|
<el-table-column label="大哥打赏的金币" align="center" prop="hostcoins" />
|
||||||
|
<el-table-column label="大哥的粉丝数" align="center" prop="followerCount" />
|
||||||
|
<el-table-column label="大哥的关注数" align="center" prop="followingCount" />
|
||||||
|
<el-table-column label="大哥所在的地区" align="center" prop="region" />
|
||||||
|
<el-table-column label="大哥打赏的历史最高金币" align="center" prop="historicHighCoins" />
|
||||||
|
<el-table-column label="大哥历史打赏金币总和" align="center" prop="totalGiftCoins" />
|
||||||
|
<el-table-column label="大哥所在的直播间的主播id" align="center" prop="hostDisplayId" />
|
||||||
|
<!-- <el-table-column label="该数据所属的账号id" align="center" prop="userId" /> -->
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180px" />
|
||||||
|
<el-table-column label="是否洽谈" align="center" prop="operationStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BIGBIOTHER_NEGOTIATION" :value="scope.row.operationStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['server:employee-big-brother:update']">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button link type="danger" @click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['server:employee-big-brother:delete']">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<EmployeeBigBrotherForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { EmployeeBigBrotherApi, EmployeeBigBrotherVO } from '@/api/server/employeebigbrother'
|
||||||
|
import EmployeeBigBrotherForm from './EmployeeBigBrotherForm.vue'
|
||||||
|
import { getAllocation, getSimpleUserList } from '@/api/system/user'
|
||||||
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
|
/** 大哥数据员工业务 列表 */
|
||||||
|
defineOptions({ name: 'EmployeeBigBrother' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<EmployeeBigBrotherVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
levelMin: undefined,
|
||||||
|
levelMax: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoinsMin: undefined,
|
||||||
|
historicHighCoinsMax: undefined,
|
||||||
|
totalGiftCoinsMin: undefined,
|
||||||
|
totalGiftCoinsMax: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
createTime: [],
|
||||||
|
createTimeStart: '',
|
||||||
|
createTimeEnd: '',
|
||||||
|
operationStatus: undefined
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
let selectBigList = ref([])
|
||||||
|
let allocationUser = ref('') //选中的分配用户
|
||||||
|
let allocationUserList = ref([
|
||||||
|
{
|
||||||
|
label: '分配用户1',
|
||||||
|
value: 1
|
||||||
|
}
|
||||||
|
]) //选中的分配用户
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
queryParams.createTimeStart = queryParams.createTime?.[0]
|
||||||
|
queryParams.createTimeEnd = queryParams.createTime?.[1]
|
||||||
|
const data = await EmployeeBigBrotherApi.getEmployeeBigBrotherPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryParams.levelMin = undefined
|
||||||
|
queryParams.levelMax = undefined
|
||||||
|
queryParams.totalGiftCoinsMin = undefined
|
||||||
|
queryParams.totalGiftCoinsMax = undefined
|
||||||
|
queryParams.historicHighCoinsMin = undefined
|
||||||
|
queryParams.historicHighCoinsMax = undefined
|
||||||
|
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await EmployeeBigBrotherApi.deleteEmployeeBigBrother(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await EmployeeBigBrotherApi.exportEmployeeBigBrother(queryParams)
|
||||||
|
download.excel(data, '大哥数据员工业务.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//分配按钮操作
|
||||||
|
const handleSelectionChange = (val) => {
|
||||||
|
|
||||||
|
selectBigList.value = val
|
||||||
|
console.log(selectBigList.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询员工 */
|
||||||
|
const getAllocationList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
allocationUserList.value = []
|
||||||
|
try {
|
||||||
|
const data = await getSimpleUserList()
|
||||||
|
console.log('data', data)
|
||||||
|
data.forEach((item) => {
|
||||||
|
if (wsCache.get('user').user.id == item.id) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
allocationUserList.value.push({
|
||||||
|
label: item.nickname,
|
||||||
|
value: item.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
console.log(allocationUserList.value)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openHtml(item, id) {
|
||||||
|
let data = item
|
||||||
|
data.operationStatus = 1
|
||||||
|
EmployeeBigBrotherApi.updateEmployeeBigBrother(data).then(res => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
window.open(`https://www.tiktok.com/@${id}`)
|
||||||
|
|
||||||
|
}
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
getAllocationList();
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
<!-- 列表区域 -->
|
<!-- 列表区域 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- ✅ PC 端使用 table -->
|
<!-- ✅ PC 端使用 table -->
|
||||||
<el-table v-if="!isMobile" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"
|
<el-table v-if="!isMobile" v-loading="loading" :data="list" :stripe="true"
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
|
|
||||||
@@ -318,35 +318,35 @@ const handleExport = async () => {
|
|||||||
exportLoading.value = false
|
exportLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 查询员工 */
|
// /** 查询员工 */
|
||||||
const getAllocationList = async () => {
|
// const getAllocationList = async () => {
|
||||||
loading.value = true
|
// loading.value = true
|
||||||
allocationUserList.value = []
|
// allocationUserList.value = []
|
||||||
try {
|
// try {
|
||||||
const data = await getAllocation(wsCache.get('user').user.deptId)
|
// const data = await getAllocation(wsCache.get('user').user.deptId)
|
||||||
console.log('data', data)
|
// console.log('data', data)
|
||||||
data.forEach((item) => {
|
// data.forEach((item) => {
|
||||||
if (wsCache.get('user').user.id == item.id) {
|
// if (wsCache.get('user').user.id == item.id) {
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
allocationUserList.value.push({
|
// allocationUserList.value.push({
|
||||||
label: item.nickname,
|
// label: item.nickname,
|
||||||
value: item.id
|
// value: item.id
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
})
|
// })
|
||||||
console.log(allocationUserList.value)
|
// console.log(allocationUserList.value)
|
||||||
} finally {
|
// } finally {
|
||||||
loading.value = false
|
// loading.value = false
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
function openHtml(item, id) {
|
function openHtml(item, id) {
|
||||||
let data = item
|
let data = item
|
||||||
data.operationStatus = 1
|
data.operationStatus = 1
|
||||||
EmployeeHostsApi.updateEmployeeHosts(data).then(res => {
|
EmployeeHostsApi.updateEmployeeHosts({ id: data.id, operationStatus: 1 }).then(res => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
window.open(`https://www.tiktok.com/@${id}`)
|
window.open(`https://www.tiktok.com/@${id}`)
|
||||||
@@ -376,25 +376,51 @@ const handleSelectionChange = (val) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function exportAi() {
|
function exportAi() {
|
||||||
if (selectHostList.value.length != 0) {
|
if (selectHostList.value.length === 0) {
|
||||||
const data = []
|
|
||||||
selectHostList.value.forEach((item) => {
|
|
||||||
data.push(item.hostsId)
|
|
||||||
})
|
|
||||||
navigator.clipboard.writeText(data.join('\n'))
|
|
||||||
.then(() => {
|
|
||||||
ElMessage.success('复制成功' + selectHostList.value.length + '条数据')
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
ElMessage.error('复制失败')
|
|
||||||
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
ElMessage.error('请选择主播')
|
ElMessage.error('请选择主播')
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const data = selectHostList.value.map(item => item.hostsId).join('\n')
|
||||||
|
|
||||||
|
const copyToClipboard = async (text) => {
|
||||||
|
// 优先使用 Clipboard API
|
||||||
|
if (navigator.clipboard && window.isSecureContext) {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(text)
|
||||||
|
ElMessage.success('✅ 复制成功 ' + selectHostList.value.length + ' 条数据')
|
||||||
|
} catch (err) {
|
||||||
|
ElMessage.error('❌ 复制失败')
|
||||||
|
console.error(err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// fallback 兼容方案
|
||||||
|
const textarea = document.createElement('textarea')
|
||||||
|
textarea.value = text
|
||||||
|
textarea.style.position = 'fixed' // 避免跳动
|
||||||
|
textarea.style.opacity = '0'
|
||||||
|
document.body.appendChild(textarea)
|
||||||
|
textarea.select()
|
||||||
|
try {
|
||||||
|
const result = document.execCommand('copy')
|
||||||
|
if (result) {
|
||||||
|
ElMessage.success('✅(兼容模式)复制成功 ' + selectHostList.value.length + ' 条数据')
|
||||||
|
} else {
|
||||||
|
ElMessage.error('❌(兼容模式)复制失败')
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
ElMessage.error('❌(兼容模式)复制异常')
|
||||||
|
console.error(err)
|
||||||
|
} finally {
|
||||||
|
document.body.removeChild(textarea)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
copyToClipboard(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function AllocationFun() {
|
function AllocationFun() {
|
||||||
console.log(allocationUser.value)
|
console.log(allocationUser.value)
|
||||||
console.log(selectHostList.value)
|
console.log(selectHostList.value)
|
||||||
@@ -404,7 +430,7 @@ const isMobile = ref(window.innerWidth <= 768)
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
getAllocationList()
|
// getAllocationList()
|
||||||
//实时监听实际还是电脑
|
//实时监听实际还是电脑
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
if ((window.innerWidth <= 768) != isMobile.value) {
|
if ((window.innerWidth <= 768) != isMobile.value) {
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
|
||||||
|
<el-form-item label="大哥的display_id" prop="displayId">
|
||||||
|
<el-input v-model="formData.displayId" placeholder="请输入大哥的display_id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的用户id" prop="userIdStr">
|
||||||
|
<el-input v-model="formData.userIdStr" placeholder="请输入大哥的用户id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的用户昵称" prop="nickname">
|
||||||
|
<el-input v-model="formData.nickname" placeholder="请输入大哥的用户昵称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的等级" prop="level">
|
||||||
|
<el-input v-model="formData.level" placeholder="请输入大哥的等级" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的金币" prop="hostcoins">
|
||||||
|
<el-input v-model="formData.hostcoins" placeholder="请输入大哥打赏的金币" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的粉丝数" prop="followerCount">
|
||||||
|
<el-input v-model="formData.followerCount" placeholder="请输入大哥的粉丝数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的关注数" prop="followingCount">
|
||||||
|
<el-input v-model="formData.followingCount" placeholder="请输入大哥的关注数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的地区" prop="region">
|
||||||
|
<el-input v-model="formData.region" placeholder="请输入大哥所在的地区" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的历史最高金币" prop="historicHighCoins">
|
||||||
|
<el-input v-model="formData.historicHighCoins" placeholder="请输入大哥打赏的历史最高金币" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥历史打赏金币总和" prop="totalGiftCoins">
|
||||||
|
<el-input v-model="formData.totalGiftCoins" placeholder="请输入大哥历史打赏金币总和" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的直播间的主播display_id" prop="hostDisplayId">
|
||||||
|
<el-input v-model="formData.hostDisplayId" placeholder="请输入大哥所在的直播间的主播display_id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="该数据所属的账号id" prop="userId">
|
||||||
|
<el-input v-model="formData.userId" placeholder="请输入该数据所属的账号id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否洽谈" prop="operationStatus">
|
||||||
|
<el-radio-group v-model="formData.operationStatus">
|
||||||
|
<el-radio value="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { EmployeeBigBrotherApi, EmployeeBigBrotherVO } from '@/api/server/employeebigbrother'
|
||||||
|
|
||||||
|
/** 大哥数据员工业务 表单 */
|
||||||
|
defineOptions({ name: 'EmployeeBigBrotherForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
level: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoins: undefined,
|
||||||
|
totalGiftCoins: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
operationStatus: undefined
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
displayId: [{ required: true, message: '大哥的display_id不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await EmployeeBigBrotherApi.getEmployeeBigBrother(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as EmployeeBigBrotherVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await EmployeeBigBrotherApi.createEmployeeBigBrother(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await EmployeeBigBrotherApi.updateEmployeeBigBrother(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
level: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoins: undefined,
|
||||||
|
totalGiftCoins: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
operationStatus: undefined
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
361
src/views/server/manageemployeebigbrother/index.vue
Normal file
361
src/views/server/manageemployeebigbrother/index.vue
Normal file
@@ -0,0 +1,361 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true">
|
||||||
|
<el-form-item label="大哥的用户id" prop="displayId">
|
||||||
|
<el-input v-model="queryParams.displayId" placeholder="请输入大哥的用户id" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="大哥的uid" prop="userIdStr">
|
||||||
|
<el-input v-model="queryParams.userIdStr" placeholder="请输入大哥的uid" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的用户昵称" prop="nickname">
|
||||||
|
<el-input v-model="queryParams.nickname" placeholder="请输入大哥的用户昵称" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="大哥的等级" prop="level">
|
||||||
|
<el-input v-model="queryParams.levelMin" :placeholder="t('newHosts.min')" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.levelMax" :placeholder="t('newHosts.max')" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="大哥打赏的金币" prop="hostcoins">
|
||||||
|
<el-input v-model="queryParams.hostcoins" placeholder="请输入大哥打赏的金币" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的粉丝数" prop="followerCount">
|
||||||
|
<el-input v-model="queryParams.followerCount" placeholder="请输入大哥的粉丝数" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥的关注数" prop="followingCount">
|
||||||
|
<el-input v-model="queryParams.followingCount" placeholder="请输入大哥的关注数" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="大哥所在的地区" prop="region">
|
||||||
|
<el-input v-model="queryParams.region" placeholder="请输入大哥所在的地区" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥打赏的历史最高金币" prop="historicHighCoins">
|
||||||
|
<el-input v-model="queryParams.historicHighCoinsMin" :placeholder="t('newHosts.min')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.historicHighCoinsMax" :placeholder="t('newHosts.max')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥历史打赏金币总和" prop="totalGiftCoins">
|
||||||
|
<el-input v-model="queryParams.totalGiftCoinsMin" :placeholder="t('newHosts.min')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
<span>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
<el-input v-model="queryParams.totalGiftCoinsMax" :placeholder="t('newHosts.max')" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-115px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="大哥所在的直播间的主播id" prop="hostDisplayId">
|
||||||
|
<el-input v-model="queryParams.hostDisplayId" placeholder="请输入大哥所在的直播间的主播id" clearable
|
||||||
|
@keyup.enter="handleQuery" class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="该数据所属的账号id" prop="userId">
|
||||||
|
<el-input v-model="queryParams.userId" placeholder="请输入该数据所属的账号id" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
|
||||||
|
start-placeholder="开始日期" end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-220px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否洽谈" prop="operationStatus">
|
||||||
|
<el-select v-model="queryParams.operationStatus" placeholder="请选择是否洽谈" clearable class="!w-240px">
|
||||||
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.BIGBIOTHER_NEGOTIATION)" :key="dict.value"
|
||||||
|
:label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="t('newHosts.allocationUser')" prop="allocationUser">
|
||||||
|
<el-select v-model="queryParams.userId" :placeholder="t('newHosts.placeAllocationUser')" clearable
|
||||||
|
class="!w-240px">
|
||||||
|
<el-option v-for="(user, index) in allocationUserList" :key="index" :label="user.label" :value="user.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery">
|
||||||
|
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetQuery">
|
||||||
|
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button type="primary" plain @click="openForm('create')" v-hasPermi="['server:employee-big-brother:create']">
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button> -->
|
||||||
|
<el-button type="success" plain @click="handleExport" :loading="exportLoading"
|
||||||
|
v-hasPermi="['server:employee-big-brother:export']">
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="dialogAllocation = true">
|
||||||
|
<Icon icon="ep:refresh" class="mr-5px" /> {{ t('newHosts.allocation') }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column label="大哥的用户id" align="center" prop="displayId">
|
||||||
|
<template #default="scope">
|
||||||
|
<div style="color: green; text-decoration: underline;" @click="openHtml(scope.row, scope.row.displayId)">
|
||||||
|
{{ scope.row.displayId }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="大哥的uid" align="center" prop="userIdStr" />
|
||||||
|
<el-table-column label="大哥的用户昵称" align="center" prop="nickname" />
|
||||||
|
<el-table-column label="大哥的等级" align="center" prop="level" />
|
||||||
|
<el-table-column label="大哥打赏的金币" align="center" prop="hostcoins" />
|
||||||
|
<el-table-column label="大哥的粉丝数" align="center" prop="followerCount" />
|
||||||
|
<el-table-column label="大哥的关注数" align="center" prop="followingCount" />
|
||||||
|
<el-table-column label="大哥所在的地区" align="center" prop="region" />
|
||||||
|
<el-table-column label="大哥打赏的历史最高金币" align="center" prop="historicHighCoins" />
|
||||||
|
<el-table-column label="大哥历史打赏金币总和" align="center" prop="totalGiftCoins" />
|
||||||
|
<el-table-column label="大哥所在的直播间的主播id" align="center" prop="hostDisplayId" />
|
||||||
|
<!-- <el-table-column label="该数据所属的账号id" align="center" prop="userId" /> -->
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180px" />
|
||||||
|
<el-table-column label="是否洽谈" align="center" prop="operationStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BIGBIOTHER_NEGOTIATION" :value="scope.row.operationStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['server:employee-big-brother:update']">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button link type="danger" @click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['server:employee-big-brother:delete']">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</ContentWrap>
|
||||||
|
<el-dialog v-model="dialogAllocation" :title="t('newHosts.allocationUser')">
|
||||||
|
<!-- <div style="padding: 0px 0px 30px 0px ;">
|
||||||
|
<el-alert title="分配成功数量可能会小于选择数量,同id主播无法被重复分配" type="warning" />
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<el-select v-model="allocationUser" :placeholder="t('newHosts.placeAllocationUser')" clearable>
|
||||||
|
<el-option v-for="(user, index) in allocationUserList" :key="index" :label="user.label" :value="user.value" />
|
||||||
|
</el-select>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogAllocation = false">{{ t('newHosts.cancel') }}</el-button>
|
||||||
|
<el-button type="primary" @click="AllocationFun">
|
||||||
|
{{ t('newHosts.confirm') }}
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<EmployeeBigBrotherForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { EmployeeBigBrotherApi, EmployeeBigBrotherVO } from '@/api/server/employeebigbrother'
|
||||||
|
import EmployeeBigBrotherForm from './EmployeeBigBrotherForm.vue'
|
||||||
|
import { getAllocation, getSimpleUserList } from '@/api/system/user'
|
||||||
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
|
/** 大哥数据员工业务 列表 */
|
||||||
|
defineOptions({ name: 'EmployeeBigBrother' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<EmployeeBigBrotherVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
displayId: undefined,
|
||||||
|
userIdStr: undefined,
|
||||||
|
nickname: undefined,
|
||||||
|
levelMin: undefined,
|
||||||
|
levelMax: undefined,
|
||||||
|
hostcoins: undefined,
|
||||||
|
followerCount: undefined,
|
||||||
|
followingCount: undefined,
|
||||||
|
region: undefined,
|
||||||
|
historicHighCoinsMin: undefined,
|
||||||
|
historicHighCoinsMax: undefined,
|
||||||
|
totalGiftCoinsMin: undefined,
|
||||||
|
totalGiftCoinsMax: undefined,
|
||||||
|
hostDisplayId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
createTime: [],
|
||||||
|
createTimeStart: '',
|
||||||
|
createTimeEnd: '',
|
||||||
|
operationStatus: undefined
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
let selectBigList = ref([])
|
||||||
|
let allocationUser = ref('') //选中的分配用户
|
||||||
|
let allocationUserList = ref([
|
||||||
|
{
|
||||||
|
label: '分配用户1',
|
||||||
|
value: 1
|
||||||
|
}
|
||||||
|
]) //选中的分配用户
|
||||||
|
let dialogAllocation = ref(false) //分配弹窗
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
queryParams.createTimeStart = queryParams.createTime?.[0]
|
||||||
|
queryParams.createTimeEnd = queryParams.createTime?.[1]
|
||||||
|
const data = await EmployeeBigBrotherApi.getMeangeEmployeeBigBrotherPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryParams.levelMin = undefined
|
||||||
|
queryParams.levelMax = undefined
|
||||||
|
queryParams.totalGiftCoinsMin = undefined
|
||||||
|
queryParams.totalGiftCoinsMax = undefined
|
||||||
|
queryParams.historicHighCoinsMin = undefined
|
||||||
|
queryParams.historicHighCoinsMax = undefined
|
||||||
|
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await EmployeeBigBrotherApi.deleteEmployeeBigBrother(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await EmployeeBigBrotherApi.exportEmployeeBigBrother(queryParams)
|
||||||
|
download.excel(data, '大哥数据员工业务.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//分配按钮操作
|
||||||
|
const handleSelectionChange = (val) => {
|
||||||
|
|
||||||
|
selectBigList.value = val
|
||||||
|
console.log(selectBigList.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询员工 */
|
||||||
|
const getAllocationList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
allocationUserList.value = []
|
||||||
|
try {
|
||||||
|
const data = await getSimpleUserList()
|
||||||
|
console.log('data', data)
|
||||||
|
data.forEach((item) => {
|
||||||
|
if (wsCache.get('user').user.id == item.id) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
allocationUserList.value.push({
|
||||||
|
label: item.nickname,
|
||||||
|
value: item.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
console.log(allocationUserList.value)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function AllocationFun() {
|
||||||
|
console.log(allocationUser.value)
|
||||||
|
console.log(selectBigList.value)
|
||||||
|
if (allocationUser.value == undefined || selectBigList.value.length <= 0) {
|
||||||
|
message.error('请选择分配用户和主播')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let data = []
|
||||||
|
selectBigList.value.forEach(element => {
|
||||||
|
data.push({
|
||||||
|
id: element.id,
|
||||||
|
userId: allocationUser.value
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
EmployeeBigBrotherApi.batchUpdateBigBrother(data).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
handleQuery()
|
||||||
|
message.success('分配成功')
|
||||||
|
})
|
||||||
|
|
||||||
|
dialogAllocation.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function openHtml(item, id) {
|
||||||
|
let data = item
|
||||||
|
data.operationStatus = 1
|
||||||
|
EmployeeBigBrotherApi.updateEmployeeBigBrother(data).then(res => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
window.open(`https://www.tiktok.com/@${id}`)
|
||||||
|
|
||||||
|
}
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
getAllocationList();
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
<!-- 列表区域 -->
|
<!-- 列表区域 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- ✅ PC 端使用 table -->
|
<!-- ✅ PC 端使用 table -->
|
||||||
<el-table v-if="!isMobile" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"
|
<el-table v-if="!isMobile" v-loading="loading" :data="list" :stripe="true"
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
<el-table-column :label="$t('employee.remark')" align="center" prop="remake" />
|
<el-table-column :label="$t('employee.remark')" align="center" prop="remake" />
|
||||||
<el-table-column :label="$t('employee.operationStatus')" align="center" prop="operationStatus">
|
<el-table-column :label="$t('employee.operationStatus')" align="center" prop="operationStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="scope.row.operationStatus" />
|
<dict-tag :type="DICT_TYPE.x" :value="scope.row.operationStatus" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('employee.createTime')" align="center" prop="createTime" :formatter="dateFormatter"
|
<el-table-column :label="$t('employee.createTime')" align="center" prop="createTime" :formatter="dateFormatter"
|
||||||
@@ -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(data).then(res => {
|
EmployeeHostsApi.updateEmployeeHosts({ id: data.id, operationStatus: 1 }).then(res => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
window.open(`https://www.tiktok.com/@${id}`)
|
window.open(`https://www.tiktok.com/@${id}`)
|
||||||
@@ -422,6 +422,8 @@ function AllocationFun() {
|
|||||||
|
|
||||||
EmployeeHostsApi.updateBatchEmployeeHosts(data).then(res => {
|
EmployeeHostsApi.updateBatchEmployeeHosts(data).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
handleQuery()
|
||||||
|
message.success('分配成功')
|
||||||
})
|
})
|
||||||
|
|
||||||
dialogAllocation.value = false
|
dialogAllocation.value = false
|
||||||
|
|||||||
@@ -143,8 +143,7 @@
|
|||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"
|
<el-table v-loading="loading" :data="list" :stripe="true" @selection-change="handleSelectionChange">
|
||||||
@selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column :label="t('newHosts.hostsId')" align="center" prop="hostsId" />
|
<el-table-column :label="t('newHosts.hostsId')" align="center" prop="hostsId" />
|
||||||
<el-table-column :label="t('newHosts.hostsLevel')" sortable align="center" prop="hostsLevel" />
|
<el-table-column :label="t('newHosts.hostsLevel')" sortable align="center" prop="hostsLevel" />
|
||||||
|
|||||||
Reference in New Issue
Block a user