yolo
BIN
YOLO工具箱.zip
Normal file
@@ -25,3 +25,9 @@ window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- <style lang="less">
|
||||
/*每个页面公共css */
|
||||
|
||||
@import "@/static/css/app.less";
|
||||
</style> -->
|
||||
@@ -1,17 +1,43 @@
|
||||
import { getAxios, postAxios, downFile } from '@/utils/axios.js'
|
||||
|
||||
|
||||
|
||||
export function getIdByName(name) {
|
||||
return getAxios({ url: `/api/tenant/get-id-by-name?name=${name}` })
|
||||
}
|
||||
|
||||
export function login(data) {
|
||||
return postAxios({ url: '/api/user/doLogin', data })
|
||||
}
|
||||
//获取国家
|
||||
export function getCountryinfo(data) {
|
||||
return postAxios({ url: '/api/common/country_info', data })
|
||||
}
|
||||
|
||||
//查询tk账号查询次数
|
||||
export function tkaccountuseinfo(accountName) {
|
||||
return getAxios({ url: `/api/common/accountCount?accountName=${accountName}` })
|
||||
}
|
||||
|
||||
export function tkhostdata(data) {
|
||||
return postAxios({ url: '/api/save_data/hosts_info', data })
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export function apiGetCart() {
|
||||
return getAxios({ url: '/cgi-bin/cart/latest' })
|
||||
}
|
||||
export function login(data) {
|
||||
return postAxios({ url: 'api/account/login', data })
|
||||
}
|
||||
// export function login(data) {
|
||||
// return postAxios({ url: 'api/account/login', data })
|
||||
// }
|
||||
export function cheekalive(data) {
|
||||
return postAxios({ url: 'api/account/cheekalive', data })
|
||||
}
|
||||
export function tkhostdata(data) {
|
||||
return postAxios({ url: 'api/tkinfo/tkhostdata', data })
|
||||
}
|
||||
|
||||
export function dicts(data) {
|
||||
return postAxios({ url: 'api/param/dicts', data })
|
||||
}
|
||||
@@ -25,10 +51,7 @@ export function exporthosts(data) {
|
||||
export function downList(url, data) {
|
||||
return downFile(url, data)
|
||||
}
|
||||
//查询tk账号查询次数
|
||||
export function tkaccountuseinfo(data) {
|
||||
return postAxios({ url: 'api/tkinfo/tkaccountuseinfo', data })
|
||||
}
|
||||
|
||||
//查询员工
|
||||
export function getStaffList(data) {
|
||||
return postAxios({ url: 'api/account/list', data })
|
||||
@@ -41,11 +64,9 @@ export function managerhosts(data) {
|
||||
export function upholdinfo(data) {
|
||||
return postAxios({ url: 'api/tkinfo/upholdinfo', data })
|
||||
}
|
||||
//获取
|
||||
export function getCountryinfo(data) {
|
||||
return postAxios({ url: 'api/tkinfo/countryinfo', data })
|
||||
}
|
||||
|
||||
//查看名字
|
||||
export function accountName(str) {
|
||||
return postAxios({ url: 'api/account/accountName?accounts=' + str })
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 88 KiB |
BIN
src/assets/logo1.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 1.3 MiB |
BIN
src/assets/logoBg1.png
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 106 KiB |
BIN
src/assets/logotext1.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
src/assets/logotext12.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
@@ -95,16 +95,6 @@ export default {
|
||||
res[0][this.getPrevious7Days(this.inputTime)[6]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[6]][this.dataType]),
|
||||
]
|
||||
|
||||
// this.seriesData = {
|
||||
// [this.getPrevious7Days(this.inputTime)[0]]: res[0][this.getPrevious7Days(this.inputTime)[0]] == null ? 0 : res[0][this.getPrevious7Days(this.inputTime)[0]][this.dataType],
|
||||
// [this.getPrevious7Days(this.inputTime)[1]]: res[0][this.getPrevious7Days(this.inputTime)[1]] == null ? 0 : res[0][this.getPrevious7Days(this.inputTime)[1]][this.dataType],
|
||||
// [this.getPrevious7Days(this.inputTime)[2]]: res[0][this.getPrevious7Days(this.inputTime)[2]] == null ? 0 : res[0][this.getPrevious7Days(this.inputTime)[2]][this.dataType],
|
||||
// [this.getPrevious7Days(this.inputTime)[3]]: res[0][this.getPrevious7Days(this.inputTime)[3]] == null ? 0 : res[0][this.getPrevious7Days(this.inputTime)[3]][this.dataType],
|
||||
// [this.getPrevious7Days(this.inputTime)[4]]: res[0][this.getPrevious7Days(this.inputTime)[4]] == null ? 0 : res[0][this.getPrevious7Days(this.inputTime)[4]][this.dataType],
|
||||
// [this.getPrevious7Days(this.inputTime)[5]]: res[0][this.getPrevious7Days(this.inputTime)[5]] == null ? 0 : res[0][this.getPrevious7Days(this.inputTime)[5]][this.dataType],
|
||||
// [this.getPrevious7Days(this.inputTime)[6]]: res[0][this.getPrevious7Days(this.inputTime)[6]] == null ? 0 : res[0][this.getPrevious7Days(this.inputTime)[6]][this.dataType],
|
||||
// }
|
||||
|
||||
this.initChart();
|
||||
this.num++
|
||||
console.log("返回数据", this.seriesData)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="sidebar">
|
||||
<div class="logo">
|
||||
<img style="margin-right: 10px;" src="@/assets/logo.png">
|
||||
<!-- <img style="margin-right: 10px;" src="@/assets/logo.png"> -->
|
||||
<img src="@/assets/logotext.png">
|
||||
</div>
|
||||
<ul>
|
||||
<li @click="updateActiveIndex(1)" v-show="userInfo.userType == 3">
|
||||
<li @click="updateActiveIndex(1)">
|
||||
<div>
|
||||
<img v-show="activeIndex == 1" src="@/assets/navAction.png" autoplay loop muted class="background-img">
|
||||
<div style="display: flex;">
|
||||
@@ -49,9 +49,9 @@ import { defineEmits } from 'vue';
|
||||
|
||||
const userInfo = ref(getUser())
|
||||
|
||||
let activeIndex = ref(userInfo.value.userType == 3 ? 1 : 2);
|
||||
let activeIndex = ref(1);
|
||||
|
||||
const emit = defineEmits(['update:activeIndex']);
|
||||
const emit = defineEmits(['activeIndex']);
|
||||
|
||||
|
||||
const updateActiveIndex = (index) => {
|
||||
@@ -60,23 +60,23 @@ const updateActiveIndex = (index) => {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 900px;
|
||||
width: 280px;
|
||||
background-color: #338F6A;
|
||||
background-color: @bg-color;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.logo {
|
||||
border-bottom: 1px solid #fff;
|
||||
padding-bottom: 29px;
|
||||
padding-top: 20px;
|
||||
|
||||
img:nth-of-type(1) {
|
||||
height: 40px;
|
||||
height: 66px;
|
||||
}
|
||||
|
||||
img:nth-of-type(2) {
|
||||
|
||||
@@ -5,11 +5,15 @@ import store from './store'
|
||||
import { createPinia } from 'pinia';
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'; // 引入中文语言包
|
||||
|
||||
// createApp(App).use(store).use(router).mount('#app')
|
||||
|
||||
|
||||
const app = createApp(App);
|
||||
app.use(ElementPlus, {
|
||||
locale: zhCn, // 配置中文
|
||||
});
|
||||
app.use(ElementPlus) // 注册 ElementPlus
|
||||
app.use(createPinia()); // 注册 Pinia
|
||||
app.use(store); // 注册 store
|
||||
|
||||
4
src/static/css/app.less
Normal file
@@ -0,0 +1,4 @@
|
||||
@bg-color: #022b4e; // 主色
|
||||
@bg-color-light: #022b4eaf; // 浅主色
|
||||
@bg-color-light-light: #022b4e1c; // 浅浅主色
|
||||
@btn-bg-color: #045dac; // 黄色按钮主色
|
||||
@@ -4,33 +4,37 @@
|
||||
*/
|
||||
import axios from 'axios'
|
||||
import { getToken, getUser } from '@/utils/storage'
|
||||
import { useRouter } from 'vue-router';
|
||||
import router from '@/router'
|
||||
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { usePythonBridge, } from '@/utils/pythonBridge'
|
||||
|
||||
const { stopScript } = usePythonBridge();
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
// 请求地址前缀
|
||||
let baseURL = ''
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// 生产环境
|
||||
baseURL = "http://api.tkpage.vvtiktok.cn"
|
||||
// baseURL = "http://120.26.251.180:8085/"
|
||||
// baseURL = "https://api.tkpage.yolozs.com"
|
||||
baseURL = "http://192.168.1.174:8101"
|
||||
// baseURL = "http://192.168.0.103:8085/"
|
||||
} else {
|
||||
// 测试环境
|
||||
// baseURL = "http://120.26.251.180:8085/"
|
||||
// 开发环境
|
||||
baseURL = "http://api.tkpage.vvtiktok.cn"
|
||||
baseURL = "https://api.tkpage.yolozs.com"
|
||||
// baseURL = "http://api.tkpage.vvtiktok.cn"
|
||||
}
|
||||
|
||||
// 请求拦截器
|
||||
axios.interceptors.request.use((config) => {
|
||||
// if (getToken()) {
|
||||
// config.headers['token'] = getToken();
|
||||
// }
|
||||
console.log("config", config)
|
||||
const url = sliceUrl(config.url)
|
||||
console.log("url", url)
|
||||
if (!(config.url == 'doLogin' || config.url == 'get-id-by-name')) {
|
||||
config.headers['vvtoken'] = getToken();
|
||||
}
|
||||
|
||||
// 请求超时时间 - 毫秒
|
||||
config.timeout = 60000
|
||||
@@ -44,7 +48,15 @@ axios.interceptors.request.use((config) => {
|
||||
|
||||
// 响应拦截器
|
||||
axios.interceptors.response.use((response) => {
|
||||
return response
|
||||
console.log("response", response.data)
|
||||
if (response.data.code == 0) {
|
||||
console.log("response", response.data.data)
|
||||
return response.data.data
|
||||
} else {
|
||||
router.push('/')
|
||||
ElMessage.error(response.data.code + '' + response.data.message);
|
||||
}
|
||||
|
||||
}, (error) => {
|
||||
// 可添加请求失败后的处理逻辑
|
||||
return Promise.reject(error)
|
||||
@@ -60,10 +72,9 @@ export function getAxios({ url, params }) {
|
||||
params
|
||||
// 请求成功,将返回的数据传递给resolve函数
|
||||
}).then(res => {
|
||||
resolve(res.data)
|
||||
resolve(res)
|
||||
// 请求失败,将错误信息传递给reject函数
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
@@ -71,13 +82,6 @@ export function getAxios({ url, params }) {
|
||||
|
||||
// axios的post请求
|
||||
export function postAxios({ url, data }) {
|
||||
if (url != 'api/account/login') {
|
||||
|
||||
throttledCheekalive();
|
||||
|
||||
}
|
||||
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.post(
|
||||
url,
|
||||
@@ -88,21 +92,9 @@ export function postAxios({ url, data }) {
|
||||
}
|
||||
}
|
||||
).then(res => {
|
||||
resolve(res.data)
|
||||
resolve(res)
|
||||
}).catch(err => {
|
||||
if (err.message == "Network Error") {
|
||||
// alert("网络错误,请检查网络连接")
|
||||
// ElMessage.error('网络连接错误');
|
||||
reject('网络连接错误')
|
||||
|
||||
} else {
|
||||
console.log(err)
|
||||
ElMessage.error('报错啦' + err.response.status);
|
||||
// reject(err)
|
||||
|
||||
|
||||
}
|
||||
// console.log(err)
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -175,6 +167,18 @@ function throttle(func, limit) {
|
||||
}
|
||||
}
|
||||
|
||||
const throttledCheekalive = throttle(cheekalive, 5000);
|
||||
function sliceUrl(url) {
|
||||
const lastSlash = url.lastIndexOf('/');
|
||||
const questionMark = url.indexOf('?');
|
||||
if (questionMark == -1) {
|
||||
const result = url.slice(lastSlash + 1, url.length);
|
||||
return result;
|
||||
} else {
|
||||
const result = url.slice(lastSlash + 1, questionMark);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
export default axios
|
||||
@@ -25,8 +25,8 @@
|
||||
<!-- logo -->
|
||||
<div class="logo">
|
||||
<div class="center-justify" style="height: 80px; width: 300px;">
|
||||
<img style="margin-right: 20px;" src="@/assets/logo.png">
|
||||
<img src="@/assets/logotext.png">
|
||||
<!-- <img style="margin-right: 20px;height: 100%;" src="@/assets/logo.png"> -->
|
||||
<img style="height: 100%;" src="@/assets/logotext.png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,11 @@
|
||||
|
||||
<div class="from-input">
|
||||
<el-form label-position="left" label-width="100px" :model="formData">
|
||||
|
||||
<div class="from-input-item1">
|
||||
<img src="@/assets/username.png" alt="">
|
||||
<el-input style="height: 25px;" v-model="formData.tenantName" placeholder="租户名称"
|
||||
clearable @keyup.enter="onSubmit" />
|
||||
</div>
|
||||
<div class="from-input-item1">
|
||||
<img src="@/assets/username.png" alt="">
|
||||
<el-input style="height: 25px;" v-model="formData.userId" placeholder="账号" clearable
|
||||
@@ -70,7 +74,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { login } from '@/api/account';
|
||||
import { login, getIdByName } from '@/api/account';
|
||||
import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/utils/storage';
|
||||
import { ElLoading } from 'element-plus';
|
||||
import { usePythonBridge } from '@/utils/pythonBridge'
|
||||
@@ -91,6 +95,7 @@ onMounted(() => {
|
||||
const router = useRouter();
|
||||
|
||||
const formData = ref({
|
||||
tenantName: getUserPass() == null ? '' : getUserPass().tenantName,
|
||||
userId: getUserPass() == null ? '' : getUserPass().userId,
|
||||
password: getUserPass() == null ? '' : getUserPass().password,
|
||||
});
|
||||
@@ -104,29 +109,24 @@ const onSubmit = () => {
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
});
|
||||
setUserPass(formData.value);
|
||||
getIdByName(formData.value.tenantName).then((tenantId) => {
|
||||
console.log(tenantId)
|
||||
login({
|
||||
userId: formData.value.userId,
|
||||
tenantId: Number(tenantId),
|
||||
username: formData.value.userId,
|
||||
password: formData.value.password,
|
||||
source: 'app'
|
||||
}).then((res) => {
|
||||
loading.close();
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
if (res.data.activeYn == 'Y') {
|
||||
setToken(res.data.currcode);
|
||||
setUser(res.data);
|
||||
setToken(res.tokenValue);
|
||||
setUser(res);
|
||||
router.push('/nav');
|
||||
} else {
|
||||
alert('账号未启用');
|
||||
}
|
||||
|
||||
} else {
|
||||
alert(res.mes);
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
loading.close();
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -207,8 +207,8 @@ const onSubmit = () => {
|
||||
|
||||
.from {
|
||||
width: 420px;
|
||||
height: 320px;
|
||||
color: #107A4E;
|
||||
// height: 320px;
|
||||
color: @bg-color;
|
||||
background-color: #ffffff44;
|
||||
border-radius: 20px;
|
||||
border: 1px solid #fff;
|
||||
@@ -219,7 +219,7 @@ const onSubmit = () => {
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 500;
|
||||
font-size: 24px;
|
||||
color: #107A4E;
|
||||
color: @bg-color;
|
||||
line-height: 37px;
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ const onSubmit = () => {
|
||||
padding: 8px 0;
|
||||
|
||||
.from-input-item-title {
|
||||
color: #107A4E;
|
||||
color: @bg-color;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
width: 80px;
|
||||
@@ -257,7 +257,7 @@ const onSubmit = () => {
|
||||
font-family: Source Han Sans SC;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #107A4E;
|
||||
color: @bg-color;
|
||||
line-height: 37px;
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,7 @@ const onSubmit = () => {
|
||||
display: flex;
|
||||
width: 359px;
|
||||
height: 50px;
|
||||
background: rgba(147, 174, 158, 0.37);
|
||||
background: @bg-color-light-light;
|
||||
border-radius: 24px;
|
||||
border: 1px solid #FFFFFF;
|
||||
padding: 12px 25px 13px 25px;
|
||||
@@ -309,7 +309,7 @@ const onSubmit = () => {
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
::v-deep(.el-input__wrapper) {
|
||||
background-color: rgba(255, 0, 0, 0);
|
||||
box-shadow: none;
|
||||
@@ -317,11 +317,11 @@ const onSubmit = () => {
|
||||
}
|
||||
|
||||
::v-deep(.el-input__inner) {
|
||||
color: #107A4E;
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
|
||||
::v-deep(.el-input__inner::placeholder) {
|
||||
color: #107A4E;
|
||||
color: @bg-color;
|
||||
}
|
||||
</style>
|
||||
@@ -7,24 +7,16 @@
|
||||
</el-select>
|
||||
|
||||
<div></div>
|
||||
<el-date-picker v-model="searchForm.time" type="date" value-format="YYYYMMDD" placeholder="选择查询时间" size="large"
|
||||
style="margin-left: 50px;width: 160px;" />
|
||||
<el-date-picker v-model="searchForm.createTime" type="date" value-format="YYYY-MM-DD" placeholder="选择查询时间"
|
||||
size="large" style="margin-left: 50px;width: 160px;" />
|
||||
|
||||
<el-input v-model="searchForm.hostId" placeholder="请输入主播id" size="large"
|
||||
<el-input v-model="searchForm.hostsId" placeholder="请输入主播id" size="large"
|
||||
style="width: 160px; margin-left: 50px;" clearable />
|
||||
|
||||
<el-select v-if="userInfo.userType == 3" v-model="searchForm.belongYn" filterable placeholder="分配情况"
|
||||
style="width: 120px; margin-left: 50px;">
|
||||
<el-option
|
||||
v-for="item in [{ label: '全部', value: '' }, { label: '未分配', value: '0' }, { label: '已分配', value: '1' }]"
|
||||
:key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
|
||||
<el-button class="serch-button" style="margin-left: 50px;" type="primary" @click="serch">查询</el-button>
|
||||
<el-button class="put-button" :disabled="tableData.length == 0" type="primary"
|
||||
@click="exportList">导出Excel数据</el-button>
|
||||
<el-button v-if="userInfo.userType == 3" class="put-button" type="primary"
|
||||
@click="dialogFormVisible = true">分配给指定员工</el-button>
|
||||
<!-- <el-button class="put-button" type="primary" @click="dialogFormVisible = true">分配给指定员工</el-button> -->
|
||||
<el-button @click="filterdialogVisible = true" style="width: 50px;" class="put-button" type="primary"><img
|
||||
style="height: 30px;" src="@/assets/filter.png"></el-button>
|
||||
</div>
|
||||
@@ -33,121 +25,29 @@
|
||||
<el-table ref="multipleTableRef" :data="tableData" stripe v-loading="loading" height="500"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="35" />
|
||||
|
||||
<el-table-column fixed prop="hostId" label="主播id" width="160">
|
||||
<template #default="scope">
|
||||
<div class="hostIdText" :style="{ color: scope.row.useable == 'Y' ? 'green' : '#0f0092' }"
|
||||
@click="openHTML(scope.row.hostId)"> {{
|
||||
<div class="hostIdText" @click="openHTML(scope.row.hostId)"> {{
|
||||
scope.row.hostId }}</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="hostName" label="主播名字" min-width="160">
|
||||
<template #default="scope">
|
||||
{{ scope.row.hostName }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column v-if="userInfo.userType == 3" prop="belongBy" label="分配情况" width="120">
|
||||
<template #default="scope">
|
||||
<el-popover v-if="scope.row.belongBy" placement="bottom" :width="200" trigger="hover"
|
||||
@show="openAccountName(scope.row.belongBy)">
|
||||
<template #reference>
|
||||
<!-- <div @click="openAccountName(scope.row.belongBy)"> -->
|
||||
<div style="color: green;">
|
||||
{{ scope.row.belongBy == null || scope.row.belongBy == '' ? "未分配" : "已分配" }}
|
||||
</div>
|
||||
</template>
|
||||
<div v-for="str in staffId" :key="str">
|
||||
{{ str }}
|
||||
</div>
|
||||
<!-- <el-table :data="gridData">
|
||||
<el-table-column width="150" property="date" label="date" />
|
||||
<el-table-column width="100" property="name" label="name" />
|
||||
</el-table> -->
|
||||
</el-popover>
|
||||
<div v-show="!scope.row.belongBy">未分配</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="hostlevel" label="等级" width="120">
|
||||
|
||||
<el-table-column prop="hostlevel" label="等级" width="80">
|
||||
<template #default="scope">
|
||||
{{ scope.row.hostlevel }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-for="label in labelList" :key="label.paramCode" :prop="label.paramCode"
|
||||
:label="label.paramCodeMeaning" width="120">
|
||||
<template v-if="label.paramCode != 'createDt'" #default="scope">
|
||||
<el-popover v-if="!(label.paramCode == 'hostcoins' || label.paramCode == 'ysthostcoins')"
|
||||
placement="bottom" :width="600" trigger="hover">
|
||||
<div style="height: 300px;">
|
||||
<!-- createDt往前推7天 -->
|
||||
<!-- <component :is="EChartsComponent" v-if="isPopoverVisible[`${scope.row.hostId}-${label.paramCode}`]"
|
||||
:title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode"
|
||||
:time="scope.row.createDt.split('T')[0].replace(/-/g, '').substring(0, 8)"></component> -->
|
||||
<component :is="EChartsComponent" v-if="isPopoverVisible[`${scope.row.hostId}-${label.paramCode}`]"
|
||||
:title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode"
|
||||
:time="scope.row.updateDt"></component>
|
||||
</div>
|
||||
<template #reference>
|
||||
<span @mouseover="openPopover(scope.row.hostId, label.paramCode)"
|
||||
@mouseout="closePopover(scope.row.hostId, label.paramCode)">
|
||||
{{ scope.row[label.paramCode] }}
|
||||
</span>
|
||||
</template>
|
||||
</el-popover>
|
||||
|
||||
<el-popover v-else placement="bottom" :width="500" trigger="hover">
|
||||
<div style="height: 300px;">
|
||||
<!-- <component :is="EChartsComponent" v-if="isPopoverVisible[`${scope.row.hostId}-${label.paramCode}`]"
|
||||
:title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode"
|
||||
:time="scope.row.createDt.split('T')[0].replace(/-/g, '').substring(0, 8)">
|
||||
</component> -->
|
||||
<component :is="EChartsComponent" v-if="isPopoverVisible[`${scope.row.hostId}-${label.paramCode}`]"
|
||||
:title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode"
|
||||
:time="scope.row.updateDt">
|
||||
</component>
|
||||
</div>
|
||||
<template #reference>
|
||||
<!-- 鼠标移入时开启 -->
|
||||
|
||||
<span @mouseover="openPopover(scope.row.hostId, label.paramCode)"
|
||||
@mouseout="closePopover(scope.row.hostId, label.paramCode)">
|
||||
{{ scope.row[label.paramCode] }}
|
||||
</span>
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-if="userInfo.userType == 4" fixed="right" label="操作" width="120">
|
||||
<template #default="scope">
|
||||
|
||||
<el-popover placement="top-start" :width="200" trigger="hover" :content="scope.row.comment">
|
||||
<template #reference>
|
||||
<el-button @click="openComment(scope.row)" link type="primary" size="small">维护情况</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
|
||||
|
||||
<select @change="handleSelectChange($event, scope.row)" v-model="scope.row.useable" class="m-2"
|
||||
placeholder="Select" size="small" style="width: 70px">
|
||||
<option label="未转化" value="N" />
|
||||
<option label="已转化" value="Y" />
|
||||
</select>
|
||||
|
||||
<el-dialog :modal="false" v-model="commentVisible" title="维护情况" align-center>
|
||||
<el-input maxlength="80" v-model="commentInfo" placeholder="请输入维护情况" clearable show-word-limit />
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="commentVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="uphostcomment()">
|
||||
提交
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- <el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center">
|
||||
@@ -156,7 +56,9 @@
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<!-- 分页 -->
|
||||
<div class="center-justify" style="margin-top: 30px;">
|
||||
<el-pagination v-model:current-page="page" v-model:page-size="pageSize" background
|
||||
layout="sizes, prev, pager, next" :total="total" :page-sizes="[10, 20, 50, 100]"
|
||||
@@ -165,63 +67,26 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<el-dialog v-model="dialogFormVisible" title="分配主播" align-center>
|
||||
<el-select v-model="staffValue" filterable placeholder="Select" style="width: 240px">
|
||||
<el-option v-for="item in staffOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="allocation">
|
||||
分配
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- <el-dialog v-model="hostNameVisible" title="分配情况" align-center>
|
||||
{{ staffId }}
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="hostNameVisible = false">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog> -->
|
||||
|
||||
<el-dialog v-model="filterdialogVisible" width="800px" :before-close="handleClose">
|
||||
<el-row :gutter="20" v-for="item in filterOptions" :key="item.type">
|
||||
<el-row v-for="(field, index) in fields" :key="index" :gutter="20" style="margin-bottom: 10px">
|
||||
<el-col :span="4">
|
||||
<!-- <label>选择筛选条件</label> -->
|
||||
<div style="height: 100%;padding-top: 10px;" class="center-justify">
|
||||
{{ item.label }}
|
||||
<div style="height: 100%; padding-top: 10px" class="center-justify">
|
||||
{{ field.label }}
|
||||
</div>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<div v-if="!(item.type == 'InvitationType')"><label>最小值</label></div>
|
||||
<div v-else><label>普票/金票</label></div>
|
||||
|
||||
<el-input v-show="!(item.type == 'InvitationType')" oninput="if(value.length>10)value=value.slice(0,10)"
|
||||
type="number" v-model.number="item.dataStart" placeholder="请输入最小值" />
|
||||
<el-select v-show="(item.type == 'InvitationType')" v-model="item.dataStart" filterable placeholder="请选择"
|
||||
style="width: 240px">
|
||||
<el-option
|
||||
v-for="item in [{ label: '全部', value: '' }, { label: '普票', value: '1' }, { label: '金票', value: '2' }]"
|
||||
:key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
|
||||
<div><label>最小值</label></div>
|
||||
<el-input type="number" :oninput="'if(value.length>9)value=value.slice(0,9)'"
|
||||
v-model.number="searchForm[field.minModel]" placeholder="请输入最小值" />
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<div v-show="!(item.type == 'InvitationType')"><label>最大值</label></div>
|
||||
|
||||
<el-input v-show="!(item.type == 'InvitationType')" oninput="if(value.length>10)value=value.slice(0,10)"
|
||||
type="number" v-model.number="item.dataEnd" placeholder="请输入最大值" />
|
||||
<div><label>最大值</label></div>
|
||||
<el-input type="number" :oninput="'if(value.length>9)value=value.slice(0,9)'"
|
||||
v-model.number="searchForm[field.maxModel]" placeholder="请输入最大值" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<!-- <label>选择筛选条件</label> -->
|
||||
@@ -235,7 +100,7 @@
|
||||
|
||||
|
||||
<el-select v-model="sortData.sortType" filterable placeholder="请选择" style="width: 240px">
|
||||
<el-option v-for="item in filterOptions" :key="item.value" :label="item.label" :value="item.type" />
|
||||
<el-option v-for="item in sortNameOptions" :key="item.type" :label="item.label" :value="item.type" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
@@ -250,7 +115,9 @@
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
|
||||
<el-button type="primary" @click="reset">
|
||||
重置
|
||||
</el-button>
|
||||
<!-- <el-button @click="filterdialogVisible = false">取消</el-button> -->
|
||||
<el-button type="primary" @click="handelClick">
|
||||
确认
|
||||
@@ -284,25 +151,42 @@ const userInfo = ref(getUser())
|
||||
//主播列表DOM
|
||||
const multipleTableRef = ref(null)
|
||||
|
||||
let labelList = ref([])
|
||||
let labelList = ref([
|
||||
{ paramCode: 'country', paramCodeMeaning: '国家' },
|
||||
{ paramCode: 'createTime', paramCodeMeaning: '创建时间' },
|
||||
{ paramCode: 'hostsCoins', paramCodeMeaning: '主播金币' },
|
||||
{ paramCode: 'yesterdayCoins', paramCodeMeaning: '昨日金币' },
|
||||
{ paramCode: 'fans', paramCodeMeaning: '粉丝数' },
|
||||
{ paramCode: 'fllowernum', paramCodeMeaning: '关注数' },
|
||||
{ paramCode: 'onlineFans', paramCodeMeaning: '在线粉丝' },
|
||||
{ paramCode: 'hostsKind', paramCodeMeaning: '主播类型' },
|
||||
]);
|
||||
const tableData = ref([])
|
||||
//主播列表传参
|
||||
const searchForm = ref({
|
||||
hostId: '',
|
||||
belongYn: '',
|
||||
country: '',
|
||||
// time: new Date().toISOString().split('T')[0].replace(/-/g, ''),
|
||||
time: '',
|
||||
dataType: '',
|
||||
dataStart: '',
|
||||
dataEnd: '',
|
||||
})
|
||||
const searchForm = ref({})
|
||||
const fields = [
|
||||
{ label: '粉丝数', minModel: 'fansMin', maxModel: 'fansMax' },
|
||||
{ label: '在线人数', minModel: 'onlineFansMin', maxModel: 'onlineFansMax' },
|
||||
{ label: '金币数', minModel: 'hostsCoinsMin', maxModel: 'hostsCoinsMax' },
|
||||
{ label: '关注数', minModel: 'fllowernumMin', maxModel: 'fllowernumMax' },
|
||||
]
|
||||
//排序
|
||||
let sortData = ref({ sortForm: 'desc', sortType: 'hostcoins' })
|
||||
let sortData = ref({ sortForm: 'desc', sortType: "createTime" })
|
||||
|
||||
//排序类型
|
||||
let sortNameOptions = ref([
|
||||
{ label: '创建时间', type: 'createTime' },
|
||||
{ label: '主播金币', type: 'hostsCoins' },
|
||||
{ label: '粉丝数', type: 'fans' },
|
||||
{ label: '昨日金币', type: 'yesterdayCoins' },
|
||||
{ label: '在线粉丝', type: 'onlineFans' },
|
||||
{ label: '关注数', type: 'fllowernum' },
|
||||
|
||||
])
|
||||
//员工选择列表
|
||||
let staffOptions = ref([])
|
||||
//筛选条件选择列表
|
||||
let filterOptions = ref([])
|
||||
|
||||
//选择的员工
|
||||
let staffValue = ref('')
|
||||
//选择的主播列表
|
||||
@@ -336,19 +220,17 @@ let version = ref('0.0.0');
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
getdictionary()//获取字典
|
||||
|
||||
getStaff(); //获取下级员工
|
||||
|
||||
getCountry(); //获取国家
|
||||
|
||||
getSerchStorage();//获取搜索条件
|
||||
// getSerchStorage();//获取搜索条件
|
||||
|
||||
getlist();//获取主播列表
|
||||
})
|
||||
|
||||
function serch() {
|
||||
|
||||
page.value = 1
|
||||
getlist();
|
||||
}
|
||||
|
||||
@@ -356,28 +238,7 @@ function exportList() {
|
||||
if (searchForm.value.dataType == 'InvitationType') {
|
||||
searchForm.value.dataEnd = searchForm.value.dataStart
|
||||
}
|
||||
exportToExcel({
|
||||
hostId: searchForm.value.hostId == '' ? null : searchForm.value.hostId,
|
||||
belongYn: searchForm.value.belongYn == '' ? null : searchForm.value.belongYn,
|
||||
searchTime: searchForm.value.time == '' ? null : searchForm.value.time,
|
||||
region: searchForm.value.country == '' ? null : searchForm.value.country,
|
||||
sortType: sortData.value.sortType,
|
||||
sortForm: sortData.value.sortForm,
|
||||
conditions: filterOptions.value.map(option => {
|
||||
return {
|
||||
...option,
|
||||
dataEnd: option.dataEnd == '' ? null : option.dataEnd,
|
||||
dataStart: option.dataStart == '' ? null : option.dataStart
|
||||
};
|
||||
}),
|
||||
// dataType: searchForm.value.dataType == '' ? null : searchForm.value.dataType,
|
||||
// dataStart: searchForm.value.dataStart == '' ? null : searchForm.value.dataStart,
|
||||
// dataEnd: searchForm.value.dataEnd == '' ? null : searchForm.value.dataEnd,
|
||||
pageSize: pageSize.value,
|
||||
page: page.value,
|
||||
userId: userInfo.value.userId,
|
||||
userType: userInfo.value.userType
|
||||
})
|
||||
exportToExcel({})
|
||||
|
||||
|
||||
// //浏览器导出方法
|
||||
@@ -388,7 +249,6 @@ function exportList() {
|
||||
// pageSize: pageSize.value,
|
||||
// page: page.value,
|
||||
// userId: userInfo.value.userId,
|
||||
// userType: userInfo.value.userType
|
||||
// }
|
||||
// );
|
||||
|
||||
@@ -418,68 +278,56 @@ function handleSelectionChange(data) {
|
||||
}
|
||||
//获取主播列表
|
||||
const getlist = () => {
|
||||
if (searchForm.value.dataType == 'InvitationType') {
|
||||
searchForm.value.dataEnd = searchForm.value.dataStart
|
||||
}
|
||||
|
||||
|
||||
|
||||
loading.value = true
|
||||
console.log(searchForm.value)
|
||||
tkhostdata({
|
||||
hostId: searchForm.value.hostId == '' ? null : searchForm.value.hostId,
|
||||
belongYn: searchForm.value.belongYn == '' ? null : searchForm.value.belongYn,
|
||||
searchTime: searchForm.value.time == '' ? null : searchForm.value.time,
|
||||
region: searchForm.value.country == '' ? null : searchForm.value.country,
|
||||
sortType: sortData.value.sortType,
|
||||
sortForm: sortData.value.sortForm,
|
||||
conditions: filterOptions.value.map(option => {
|
||||
return {
|
||||
...option,
|
||||
dataEnd: option.dataEnd == '' ? null : option.dataEnd,
|
||||
dataStart: option.dataStart == '' ? null : option.dataStart
|
||||
};
|
||||
}),
|
||||
// dataType: searchForm.value.dataType == '' ? null : searchForm.value.dataType,
|
||||
// dataStart: searchForm.value.dataStart == '' ? null : searchForm.value.dataStart,
|
||||
// dataEnd: searchForm.value.dataEnd == '' ? null : searchForm.value.dataEnd,
|
||||
pageSize: pageSize.value,
|
||||
page: page.value,
|
||||
userId: userInfo.value.userId,
|
||||
userType: userInfo.value.userType
|
||||
tenantId: Number(userInfo.value.tenantId),
|
||||
sort: sortData.value.sortForm,//正序倒序
|
||||
sortName: sortData.value.sortType,//排序类型
|
||||
"current": page.value,
|
||||
"pageSize": pageSize.value,
|
||||
...searchForm.value,//筛选条件
|
||||
}).then(res => {
|
||||
loading.value = false
|
||||
total.value = res.total
|
||||
tableData.value = []
|
||||
res.records.forEach(item => {
|
||||
if (item.infoMap.InvitationType == '1') {
|
||||
item.infoMap.InvitationType = '普票'
|
||||
} else if (item.infoMap.InvitationType == '2') {
|
||||
item.infoMap.InvitationType = '金票'
|
||||
|
||||
if (res) {
|
||||
console.log('主播列表', res)
|
||||
total.value = Number(res.total)
|
||||
tableData.value = res.records.map(item => ({
|
||||
hostId: item.hostsId, // 注意:原字段是 hostId,你的数据是 hostsId,需手动映射
|
||||
hostlevel: item.hostsLevel, // 原字段 hostlevel 对应你的数据 hostsLevel
|
||||
country: item.country,
|
||||
createTime: item.createTime,
|
||||
fans: item.fans,
|
||||
fllowernum: item.fllowernum,
|
||||
hostsCoins: item.hostsCoins,
|
||||
hostsKind: item.hostsKind,
|
||||
onlineFans: item.onlineFans,
|
||||
yesterdayCoins: item.yesterdayCoins,
|
||||
// 保留原有字段(如 belongBy、useable 等)
|
||||
belongBy: item.belongBy,
|
||||
useable: item.useable
|
||||
}));
|
||||
}
|
||||
console.log(item.infoMap)
|
||||
item = { ...item, ...item.infoMap }
|
||||
tableData.value.push(item)
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
function handelClick() {
|
||||
|
||||
filterOptions.value.forEach(item => {
|
||||
if (item.type == 'InvitationType') {
|
||||
item.dataEnd = item.dataStart
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
setSerch(filterOptions.value)
|
||||
console.log(filterOptions.value)
|
||||
filterdialogVisible.value = false
|
||||
}
|
||||
|
||||
function reset() {
|
||||
searchForm.value.fansMin = null
|
||||
searchForm.value.fansMax = null
|
||||
searchForm.value.onlineFansMin = null
|
||||
searchForm.value.onlineFansMax = null
|
||||
searchForm.value.hostsCoinsMin = null
|
||||
searchForm.value.hostsCoinsMax = null
|
||||
searchForm.value.fllowernumMin = null
|
||||
searchForm.value.fllowernumMax = null
|
||||
}
|
||||
function handleClose(done) {
|
||||
console.log('关闭')
|
||||
// searchForm.value = {
|
||||
@@ -490,135 +338,106 @@ function handleClose(done) {
|
||||
done()
|
||||
}
|
||||
|
||||
function getSerchStorage() {
|
||||
if (getSerch()) {
|
||||
// filterOptions.value = getSerch()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function openComment(data) {
|
||||
console.log(data)
|
||||
commentInfo.value = data.comment
|
||||
commentHost.value = data.hostId
|
||||
commentVisible.value = true
|
||||
}
|
||||
|
||||
//修改主播维护状态
|
||||
function handleSelectChange(event, data) {
|
||||
// function handleSelectChange(event, data) {
|
||||
|
||||
upholdinfo({
|
||||
"hostId": data.hostId,
|
||||
"userId": userInfo.value.userId,
|
||||
"tenantId": userInfo.value.tenantId,
|
||||
// "comment": "我已经尽力维护,但是失败了",
|
||||
"useable": event.target.value
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
// upholdinfo({
|
||||
// "hostId": data.hostId,
|
||||
// "userId": userInfo.value.userId,
|
||||
// "tenantId": userInfo.value.tenantId,
|
||||
// // "comment": "我已经尽力维护,但是失败了",
|
||||
// "useable": event.target.value
|
||||
// }).then(res => {
|
||||
// console.log(res)
|
||||
// })
|
||||
// }
|
||||
|
||||
//更改主播维护备注
|
||||
|
||||
function uphostcomment() {
|
||||
upholdinfo({
|
||||
"hostId": commentHost.value,
|
||||
"userId": userInfo.value.userId,
|
||||
"tenantId": userInfo.value.tenantId,
|
||||
"comment": commentInfo.value,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
serch()
|
||||
commentVisible.value = false
|
||||
})
|
||||
}
|
||||
//获取字典
|
||||
const getdictionary = () => {
|
||||
dicts({
|
||||
paramType: "hostsdata",
|
||||
// page: 1,
|
||||
offset: 1,
|
||||
pageSize: 100
|
||||
}).then(res => {
|
||||
// labelList.value = res.records
|
||||
labelList.value = res
|
||||
console.log(labelList.value)
|
||||
// function uphostcomment() {
|
||||
// upholdinfo({
|
||||
// "hostId": commentHost.value,
|
||||
// "userId": userInfo.value.userId,
|
||||
// "tenantId": userInfo.value.tenantId,
|
||||
// "comment": commentInfo.value,
|
||||
// }).then(res => {
|
||||
// console.log(res)
|
||||
// serch()
|
||||
// commentVisible.value = false
|
||||
// })
|
||||
// }
|
||||
|
||||
labelList.value.forEach(item => {
|
||||
if (item.paramCodeMeaning != '获取时间') {
|
||||
filterOptions.value.push({
|
||||
type: item.paramCode,
|
||||
label: item.paramCodeMeaning,
|
||||
dataStart: '',
|
||||
dataEnd: ''
|
||||
})
|
||||
function filterTag(value, row) {
|
||||
console.log(row.useable, value)
|
||||
return row.useable === value;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
//获取国家
|
||||
function getCountry() {
|
||||
getCountryinfo({}).then(res => {
|
||||
console.log(res)
|
||||
res.forEach(item => {
|
||||
if (item.countryGroupName) {
|
||||
options.value.push({ value: item.countryGroupName, label: item.countryGroupName })
|
||||
|
||||
}
|
||||
})
|
||||
console.log(options.value)
|
||||
}).catch(err => {
|
||||
console.log('getCountry', err)
|
||||
})
|
||||
}
|
||||
|
||||
//获取下级员工
|
||||
const getStaff = () => {
|
||||
getStaffList({
|
||||
userId: userInfo.value.userId,
|
||||
userType: userInfo.value.userType,
|
||||
activeYn: userInfo.value.activeYn,
|
||||
tenantId: userInfo.value.tenantId,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
res.forEach(item => {
|
||||
staffOptions.value.push({
|
||||
value: item.userId,
|
||||
label: item.userName
|
||||
})
|
||||
})
|
||||
})
|
||||
// const getStaff = () => {
|
||||
// getStaffList({
|
||||
// userId: userInfo.value.userId,
|
||||
// activeYn: userInfo.value.activeYn,
|
||||
// tenantId: userInfo.value.tenantId,
|
||||
// }).then(res => {
|
||||
// console.log(res)
|
||||
// res.forEach(item => {
|
||||
// staffOptions.value.push({
|
||||
// value: item.userId,
|
||||
// label: item.userName
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
|
||||
}
|
||||
//分配主播给员工
|
||||
function allocation() {
|
||||
managerhosts({
|
||||
"manaId": userInfo.value.userId,
|
||||
"userId": staffValue.value,
|
||||
"tenantId": userInfo.value.tenantId,
|
||||
"hostIds": selectHostList.value
|
||||
}).then(res => {
|
||||
if (res) {
|
||||
dialogFormVisible.value = false
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
// //分配主播给员工
|
||||
// function allocation() {
|
||||
// managerhosts({
|
||||
// "manaId": userInfo.value.userId,
|
||||
// "userId": staffValue.value,
|
||||
// "tenantId": userInfo.value.tenantId,
|
||||
// "hostIds": selectHostList.value
|
||||
// }).then(res => {
|
||||
// if (res) {
|
||||
// dialogFormVisible.value = false
|
||||
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
//获取主播信息
|
||||
const getTkhostdetail = (id) => {
|
||||
tkhostdetail({
|
||||
hostId: id,
|
||||
// page: 1,
|
||||
searchTimeStart: '20250401',
|
||||
searchTimeEnd: '20250403'
|
||||
}).then(res => {
|
||||
// const getTkhostdetail = (id) => {
|
||||
// tkhostdetail({
|
||||
// hostId: id,
|
||||
// // page: 1,
|
||||
// searchTimeStart: '20250401',
|
||||
// searchTimeEnd: '20250403'
|
||||
// }).then(res => {
|
||||
|
||||
console.log(labelList.value)
|
||||
// console.log(labelList.value)
|
||||
|
||||
})
|
||||
// })
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
function openPopover(hostId, paramCode) {
|
||||
@@ -637,30 +456,30 @@ function closePopover(hostId, paramCode) {
|
||||
function openHTML(id) {
|
||||
givePyAnchorId(id)
|
||||
|
||||
upholdinfo({
|
||||
"hostId": id,
|
||||
"userId": userInfo.value.userId,
|
||||
"tenantId": userInfo.value.tenantId,
|
||||
// "comment": "我已经尽力维护,但是失败了",
|
||||
"useable": "Y"
|
||||
}).then(res => {
|
||||
// upholdinfo({
|
||||
// "hostId": id,
|
||||
// "userId": userInfo.value.userId,
|
||||
// "tenantId": userInfo.value.tenantId,
|
||||
// // "comment": "我已经尽力维护,但是失败了",
|
||||
// "useable": "Y"
|
||||
// }).then(res => {
|
||||
|
||||
getlist();
|
||||
})
|
||||
// getlist();
|
||||
// })
|
||||
|
||||
}
|
||||
|
||||
function openAccountName(idStr) {
|
||||
if (idStr) {
|
||||
hostNameVisible.value = true
|
||||
accountName(idStr).then(res => {
|
||||
staffId.value = JSON.stringify(res).replace(/[{}"]/g, '') // 移除所有 {} 和 "
|
||||
.split(',') // 按逗号分割成数组
|
||||
// function openAccountName(idStr) {
|
||||
// if (idStr) {
|
||||
// hostNameVisible.value = true
|
||||
// accountName(idStr).then(res => {
|
||||
// staffId.value = JSON.stringify(res).replace(/[{}"]/g, '') // 移除所有 {} 和 "
|
||||
// .split(',') // 按逗号分割成数组
|
||||
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
// console.log(res)
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@@ -688,7 +507,7 @@ function openAccountName(idStr) {
|
||||
.serch-button {
|
||||
width: 80px;
|
||||
height: 47px;
|
||||
background: #E7CA92;
|
||||
background: @btn-bg-color;
|
||||
border-radius: 10px;
|
||||
border: none;
|
||||
}
|
||||
@@ -696,7 +515,7 @@ function openAccountName(idStr) {
|
||||
.put-button {
|
||||
width: 132px;
|
||||
height: 47px;
|
||||
background: #E7CA92;
|
||||
background: @btn-bg-color;
|
||||
border-radius: 10px;
|
||||
border: none;
|
||||
|
||||
@@ -708,6 +527,8 @@ function openAccountName(idStr) {
|
||||
--el-dialog-font-line-height: 50px;
|
||||
--el-dialog-width: 600px;
|
||||
--el-dialog-border-radius: 8px;
|
||||
|
||||
// border: 10px solid @bg-color-light;
|
||||
}
|
||||
|
||||
.center-line {
|
||||
@@ -736,20 +557,20 @@ function openAccountName(idStr) {
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
::v-deep(.el-input__wrapper) {
|
||||
background-color: #F2FAF9;
|
||||
border: 1px solid #B7CEC5;
|
||||
border: 1px solid @bg-color;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
::v-deep(.el-select__wrapper) {
|
||||
background-color: #F2FAF9;
|
||||
border: 1px solid #B7CEC5;
|
||||
border: 1px solid @bg-color;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
::v-deep(.el-pagination.is-background .el-pager li.is-active) {
|
||||
background-color: #338F6A;
|
||||
background-color: @bg-color;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="center-align" style="width: 100%; margin: 0 20px;">
|
||||
<div class="box-card-num1 center-line">
|
||||
<div>总数量: <span>{{ hostData.totalCount }}</span></div>
|
||||
<div>有效主播: <span>{{ hostData.validAnchorsCount }}</span></div>
|
||||
<div>新建主播: <span>{{ hostData.validAnchorsCount }}</span></div>
|
||||
<div> 已查询: <span>{{ hostData.checkedDataCount }}</span></div>
|
||||
<div>可邀请: <span>{{ hostData.canInvitationCount }}</span></div>
|
||||
<div>运行时间: <span>{{ formattedTime }}</span></div>
|
||||
@@ -11,6 +11,7 @@
|
||||
</div>
|
||||
<div class="center-line" style="padding-top: 15vh;">
|
||||
<el-button class="open-login" type="primary" @click="openTK">开启tk</el-button>
|
||||
<!-- <el-button class="open-login" type="primary" @click="startTimer">计时开始</el-button> -->
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -87,14 +88,14 @@
|
||||
<el-col :span="8">
|
||||
<div class="input-group">
|
||||
<label>后台查询频率</label>
|
||||
<el-input type='number' v-model="pyData.frequency.hour" :min="0"
|
||||
:max="pyData.frequency.day - 1" placeholder="次/小时" style="width: 100%"
|
||||
:disabled="!pyData.isStart">
|
||||
<!-- <el-input type='number' v-model="pyData.frequency.hour" @input="handleInputHour" -->
|
||||
<el-input type='number' v-model="pyData.frequency.hour" placeholder="次/小时"
|
||||
style="width: 100%" :disabled="!pyData.isStart">
|
||||
<template #append>次/小时</template>
|
||||
</el-input>
|
||||
<el-input type='number' v-model="pyData.frequency.day" :min="pyData.frequency.hour + 1"
|
||||
:max="100" placeholder="次/24小时" style="width: 100%; margin-top: 10px"
|
||||
:disabled="!pyData.isStart">
|
||||
<!-- <el-input type='number' v-model="pyData.frequency.day" @input="handleInputDay" -->
|
||||
<el-input type='number' v-model="pyData.frequency.day" placeholder="次/24小时"
|
||||
style="width: 100%; margin-top: 10px" :disabled="!pyData.isStart">
|
||||
<template #append>次/24小时</template>
|
||||
</el-input>
|
||||
</div>
|
||||
@@ -136,12 +137,24 @@ let hostData = ref({
|
||||
});
|
||||
//是否开启tk
|
||||
// let isTk = ref(true);
|
||||
|
||||
//账号是否登陆中
|
||||
let isLogin = ref([false, false]);
|
||||
//设置状态轮询定时器
|
||||
let statusTimer = ref(null);
|
||||
let statusTimerCopy = ref(null);
|
||||
|
||||
//设置次数最大值
|
||||
let maxCount = ref([
|
||||
{
|
||||
hourMax: 50,
|
||||
dayMax: 300,
|
||||
},
|
||||
{
|
||||
hourMax: 100,
|
||||
dayMax: 600,
|
||||
},
|
||||
]);
|
||||
|
||||
//tk账号信息
|
||||
let tkData = ref([
|
||||
@@ -158,9 +171,7 @@ let tkData = ref([
|
||||
index: 2,
|
||||
code: 0,
|
||||
num: 0
|
||||
|
||||
},
|
||||
|
||||
]);
|
||||
|
||||
//python需要的数据
|
||||
@@ -252,7 +263,7 @@ const submit = () => {
|
||||
ElMessage.error('请输入正确的区间值');
|
||||
return;
|
||||
}
|
||||
if (Number(pyData.value.frequency.hour) <= 0 || Number(pyData.value.frequency.day <= 0) || pyData.value.frequency.hour == '' || pyData.value.frequency.day == '') {
|
||||
if (Number(pyData.value.frequency.hour) <= 0 || Number(pyData.value.frequency.day) <= 0 || pyData.value.frequency.hour == '' || pyData.value.frequency.day == '') {
|
||||
ElMessage.error('请输入正确的频率区间值');
|
||||
return;
|
||||
}
|
||||
@@ -290,7 +301,7 @@ const submit = () => {
|
||||
tkaccountuse(tkData.value[0].account, 0)
|
||||
tkaccountuse(tkData.value[1].account, 1)
|
||||
})
|
||||
}, 1000);
|
||||
}, 5000);
|
||||
|
||||
|
||||
}).finally(() => {
|
||||
@@ -397,10 +408,14 @@ function getloginStatusCopy() {
|
||||
|
||||
function tkaccountuse(id, index) {
|
||||
let num = 0;
|
||||
tkaccountuseinfo({ userId: id }).then((res) => {
|
||||
tkaccountuseinfo(id).then((res) => {
|
||||
if (res) {
|
||||
num = res
|
||||
tkData.value[index].num = num
|
||||
console.log('账号使用次数', tkData.value[index].num)
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log('账号使用次数', err)
|
||||
})
|
||||
|
||||
}
|
||||
@@ -409,13 +424,16 @@ const isRunning = ref(false);
|
||||
const totalSeconds = ref(0);
|
||||
//定时器
|
||||
let timerCrawl = null;
|
||||
|
||||
const startTimedata = ref(null);
|
||||
//清空时间 并开始运行
|
||||
const startTimer = () => {
|
||||
resetTimer();
|
||||
if (isRunning.value) return;
|
||||
isRunning.value = true;
|
||||
startTimedata.value = Date.now();
|
||||
timerCrawl = setInterval(() => {
|
||||
totalSeconds.value++;
|
||||
totalSeconds.value = Math.floor((Date.now() - startTimedata.value) / 1000);
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
@@ -442,6 +460,62 @@ const formattedTime = computed(() => {
|
||||
seconds.toString().padStart(2, '0')
|
||||
].join(':');
|
||||
});
|
||||
|
||||
|
||||
function handleInputHour(value) {
|
||||
console.log(value)
|
||||
// 替换非数字字符为空字符串
|
||||
let num = value.replace(/[^\d]/g, '');
|
||||
// 如果值小于等于0,则设置为0
|
||||
if (Number(num) <= 0) {
|
||||
num = 0;
|
||||
}
|
||||
|
||||
if ((tkData.value[0].code == 1) && (tkData.value[1].code == 1)) {
|
||||
if (Number(num) > maxCount.value[1].hourMax) {
|
||||
num = maxCount.value[1].hourMax;
|
||||
}
|
||||
} else if ((tkData.value[0].code == 1) || (tkData.value[1].code == 1)) {
|
||||
// 如果值大于最大值,则设置为最大值
|
||||
if (Number(num) > maxCount.value[0].hourMax) {
|
||||
num = maxCount.value[0].hourMax;
|
||||
}
|
||||
|
||||
} else {
|
||||
ElMessage.error('请先登录tk后台');
|
||||
num = 0;
|
||||
}
|
||||
// 更新模型
|
||||
pyData.value.frequency.hour = num;
|
||||
}
|
||||
|
||||
function handleInputDay(value) {
|
||||
console.log(value)
|
||||
// 替换非数字字符为空字符串
|
||||
let num = value.replace(/[^\d]/g, '');
|
||||
// 如果值小于等于0,则设置为0
|
||||
if (Number(num) <= 0) {
|
||||
num = 0;
|
||||
}
|
||||
|
||||
if ((tkData.value[0].code == 1) && (tkData.value[1].code == 1)) {
|
||||
if (Number(num) > maxCount.value[1].dayMax) {
|
||||
num = maxCount.value[1].dayMax;
|
||||
}
|
||||
} else if ((tkData.value[0].code == 1) || (tkData.value[1].code == 1)) {
|
||||
// 如果值大于最大值,则设置为最大值
|
||||
if (Number(num) > maxCount.value[0].dayMax) {
|
||||
num = maxCount.value[0].dayMax;
|
||||
}
|
||||
} else {
|
||||
ElMessage.error('请先登录tk后台');
|
||||
num = 0;
|
||||
}
|
||||
|
||||
|
||||
// 更新模型
|
||||
pyData.value.frequency.day = num;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@@ -576,7 +650,7 @@ label {
|
||||
.open-login {
|
||||
width: 100px;
|
||||
height: 47px;
|
||||
background: #E7CA92;
|
||||
background: @btn-bg-color;
|
||||
border-radius: 10px;
|
||||
border: none;
|
||||
}
|
||||
@@ -584,7 +658,7 @@ label {
|
||||
.reset-button {
|
||||
width: 132px;
|
||||
height: 47px;
|
||||
background: #E7CA92;
|
||||
background: @btn-bg-color;
|
||||
border-radius: 10px;
|
||||
|
||||
font-family: Source Han Sans SC;
|
||||
@@ -598,7 +672,7 @@ label {
|
||||
.submit-button {
|
||||
width: 160px;
|
||||
height: 47px;
|
||||
background: #338F6A;
|
||||
background: @bg-color;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
@@ -629,9 +703,9 @@ label {
|
||||
</style>
|
||||
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="less">
|
||||
::v-deep(.el-input-group__prepend) {
|
||||
background: #84CEB2;
|
||||
background: @bg-color-light;
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
border: 1px solid #B7CEC5;
|
||||
font-family: Source Han Sans SC;
|
||||
@@ -642,7 +716,7 @@ label {
|
||||
}
|
||||
|
||||
::v-deep(.el-input-group__append) {
|
||||
background: #84CEB2;
|
||||
background: @bg-color-light;
|
||||
border-radius: 0px 10px 10px 0px;
|
||||
border: 1px solid #B7CEC5;
|
||||
font-family: Source Han Sans SC;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<div class="app-container">
|
||||
<Sidebar class="noneText" @activeIndex="activeIndexFn" />
|
||||
<div class="content ">
|
||||
<div v-show="activeIndex == 1">
|
||||
<workbenches v-if="openWerk" />
|
||||
<div v-show="activeIndexA == 1">
|
||||
<workbenches />
|
||||
</div>
|
||||
<div v-show="activeIndex == 2">
|
||||
<hostsList v-if="openList" />
|
||||
<div v-show="activeIndexA == 2">
|
||||
<hostsList />
|
||||
</div>
|
||||
<div style="position: absolute; bottom: 0; right: 0;">{{ version }}</div>
|
||||
|
||||
@@ -29,25 +29,17 @@ import { getUser } from '@/utils/storage'
|
||||
|
||||
|
||||
|
||||
let userType = ref(getUser().userType)
|
||||
let activeIndex = ref(userType.value == 3 ? 1 : 2)
|
||||
let openWerk = ref(userType.value == 3 ? true : false)
|
||||
let openList = ref(userType.value == 3 ? false : true)
|
||||
console.log("用户等级", getUser().userType)
|
||||
|
||||
|
||||
let activeIndexA = ref(1)
|
||||
|
||||
function activeIndexFn(data) {
|
||||
activeIndex.value = data
|
||||
openWerk.value = true
|
||||
openList.value = true
|
||||
activeIndexA.value = data
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style lang="less">
|
||||
body,
|
||||
html {
|
||||
margin: 0;
|
||||
@@ -59,7 +51,7 @@ html {
|
||||
display: flex;
|
||||
width: 1600px;
|
||||
height: 900px;
|
||||
background-color: #338F6A;
|
||||
background-color: @bg-color;
|
||||
position: relative;
|
||||
|
||||
|
||||
@@ -75,7 +67,7 @@ html {
|
||||
|
||||
.sidebar {
|
||||
width: 200px;
|
||||
background-color: #338F6A;
|
||||
background-color: @bg-color;
|
||||
padding: 20px;
|
||||
/* box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); */
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ module.exports = defineConfig({
|
||||
})
|
||||
]
|
||||
}
|
||||
},
|
||||
less: {
|
||||
additionalData: `@import "@/static/css/app.less";` // 注入全局变量文件
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||