完善功能
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { getAxios, postAxios } from '@/utils/axios.js'
|
import { getAxios, postAxios, downFile } from '@/utils/axios.js'
|
||||||
|
|
||||||
export function apiGetCart() {
|
export function apiGetCart() {
|
||||||
return getAxios({ url: '/cgi-bin/cart/latest' })
|
return getAxios({ url: '/cgi-bin/cart/latest' })
|
||||||
@@ -18,3 +18,14 @@ export function dicts(data) {
|
|||||||
export function tkhostdetail(data) {
|
export function tkhostdetail(data) {
|
||||||
return postAxios({ url: 'tkinfo/tkhostdetail', data })
|
return postAxios({ url: 'tkinfo/tkhostdetail', data })
|
||||||
}
|
}
|
||||||
|
//导出表格
|
||||||
|
export function exporthosts(data) {
|
||||||
|
return postAxios({ url: 'export/hostsinfo', data })
|
||||||
|
}
|
||||||
|
export function downList(url, data) {
|
||||||
|
return downFile(url, data)
|
||||||
|
}
|
||||||
|
//查询tk账号查询次数
|
||||||
|
export function tkaccountuseinfo(data) {
|
||||||
|
return postAxios({ url: 'tkinfo/tkaccountuseinfo', data })
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,19 +20,25 @@ export default {
|
|||||||
dataType: {
|
dataType: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
time: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
seriesData: [],
|
seriesData: [],
|
||||||
num: 0
|
num: 0,
|
||||||
|
inputTime: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
|
this.inputTime = this.time
|
||||||
this.getTkhostdetail();
|
this.getTkhostdetail();
|
||||||
|
console.log(this.getPrevious7Days(this.inputTime))
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -51,7 +57,7 @@ export default {
|
|||||||
data: [this.title]
|
data: [this.title]
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
data: [this.getCurrentDate()[0].slice(4), this.getCurrentDate()[1].slice(4), this.getCurrentDate()[2].slice(4), this.getCurrentDate()[3].slice(4), this.getCurrentDate()[4].slice(4), this.getCurrentDate()[5].slice(4), this.getCurrentDate()[6].slice(4)]
|
data: [this.getPrevious7Days(this.inputTime)[0].slice(4), this.getPrevious7Days(this.inputTime)[1].slice(4), this.getPrevious7Days(this.inputTime)[2].slice(4), this.getPrevious7Days(this.inputTime)[3].slice(4), this.getPrevious7Days(this.inputTime)[4].slice(4), this.getPrevious7Days(this.inputTime)[5].slice(4), this.getPrevious7Days(this.inputTime)[6].slice(4)]
|
||||||
},
|
},
|
||||||
yAxis: {},
|
yAxis: {},
|
||||||
series: [
|
series: [
|
||||||
@@ -65,34 +71,36 @@ export default {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
myChart.setOption(option);
|
myChart.setOption(option);
|
||||||
|
console.log(this.dataTime)
|
||||||
|
|
||||||
},
|
},
|
||||||
getTkhostdetail() {
|
getTkhostdetail() {
|
||||||
tkhostdetail({
|
tkhostdetail({
|
||||||
hostId: this.id,
|
hostId: this.id,
|
||||||
dataType: this.dataType,
|
dataType: this.dataType,
|
||||||
searchTimeStart: this.getCurrentDate()[0],
|
searchTimeStart: this.getPrevious7Days(this.inputTime)[0],
|
||||||
searchTimeEnd: this.getCurrentDate()[6]
|
searchTimeEnd: this.getPrevious7Days(this.inputTime)[6]
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
// console.log("返回数据", res[0][this.getCurrentDate()[2]])
|
// console.log("返回数据", res[0][this.getPrevious7Days(this.inputTime)[2]])
|
||||||
//echarts 数据初始化
|
//echarts 数据初始化
|
||||||
this.seriesData = [
|
this.seriesData = [
|
||||||
res[0][this.getCurrentDate()[0]] == null ? 0 : Number(res[0][this.getCurrentDate()[0]][this.dataType]),
|
res[0][this.getPrevious7Days(this.inputTime)[0]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[0]][this.dataType]),
|
||||||
res[0][this.getCurrentDate()[1]] == null ? 0 : Number(res[0][this.getCurrentDate()[1]][this.dataType]),
|
res[0][this.getPrevious7Days(this.inputTime)[1]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[1]][this.dataType]),
|
||||||
res[0][this.getCurrentDate()[2]] == null ? 0 : Number(res[0][this.getCurrentDate()[2]][this.dataType]),
|
res[0][this.getPrevious7Days(this.inputTime)[2]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[2]][this.dataType]),
|
||||||
res[0][this.getCurrentDate()[3]] == null ? 0 : Number(res[0][this.getCurrentDate()[3]][this.dataType]),
|
res[0][this.getPrevious7Days(this.inputTime)[3]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[3]][this.dataType]),
|
||||||
res[0][this.getCurrentDate()[4]] == null ? 0 : Number(res[0][this.getCurrentDate()[4]][this.dataType]),
|
res[0][this.getPrevious7Days(this.inputTime)[4]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[4]][this.dataType]),
|
||||||
res[0][this.getCurrentDate()[5]] == null ? 0 : Number(res[0][this.getCurrentDate()[5]][this.dataType]),
|
res[0][this.getPrevious7Days(this.inputTime)[5]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[5]][this.dataType]),
|
||||||
res[0][this.getCurrentDate()[6]] == null ? 0 : Number(res[0][this.getCurrentDate()[6]][this.dataType]),
|
res[0][this.getPrevious7Days(this.inputTime)[6]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[6]][this.dataType]),
|
||||||
]
|
]
|
||||||
|
|
||||||
// this.seriesData = {
|
// this.seriesData = {
|
||||||
// [this.getCurrentDate()[0]]: res[0][this.getCurrentDate()[0]] == null ? 0 : res[0][this.getCurrentDate()[0]][this.dataType],
|
// [this.getPrevious7Days(this.inputTime)[0]]: res[0][this.getPrevious7Days(this.inputTime)[0]] == null ? 0 : res[0][this.getPrevious7Days(this.inputTime)[0]][this.dataType],
|
||||||
// [this.getCurrentDate()[1]]: res[0][this.getCurrentDate()[1]] == null ? 0 : res[0][this.getCurrentDate()[1]][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.getCurrentDate()[2]]: res[0][this.getCurrentDate()[2]] == null ? 0 : res[0][this.getCurrentDate()[2]][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.getCurrentDate()[3]]: res[0][this.getCurrentDate()[3]] == null ? 0 : res[0][this.getCurrentDate()[3]][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.getCurrentDate()[4]]: res[0][this.getCurrentDate()[4]] == null ? 0 : res[0][this.getCurrentDate()[4]][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.getCurrentDate()[5]]: res[0][this.getCurrentDate()[5]] == null ? 0 : res[0][this.getCurrentDate()[5]][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.getCurrentDate()[6]]: res[0][this.getCurrentDate()[6]] == null ? 0 : res[0][this.getCurrentDate()[6]][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.initChart();
|
||||||
@@ -103,24 +111,58 @@ export default {
|
|||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCurrentDate() {
|
// getCurrentDate() {
|
||||||
const dates = [];
|
// const dates = [];
|
||||||
const today = new Date();
|
// const today = new Date();
|
||||||
|
|
||||||
for (let i = 6; i >= 0; i--) {
|
// for (let i = 6; i >= 0; i--) {
|
||||||
const date = new Date(today);
|
// const date = new Date(today);
|
||||||
date.setDate(today.getDate() - i);
|
// date.setDate(today.getDate() - i);
|
||||||
|
|
||||||
const year = date.getFullYear();
|
// const year = date.getFullYear();
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
// const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
// const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
|
||||||
dates.push(`${year}${month}${day}`);
|
// dates.push(`${year}${month}${day}`);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return dates;
|
||||||
|
// },
|
||||||
|
getPrevious7Days(dateStr) {
|
||||||
|
// 验证输入格式是否正确
|
||||||
|
if (!/^\d{8}$/.test(dateStr)) {
|
||||||
|
console.error('输入的格式不是YYYYMMDD.');
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return dates;
|
// 解析输入的日期字符串
|
||||||
|
const year = parseInt(dateStr.substring(0, 4));
|
||||||
|
const month = parseInt(dateStr.substring(4, 6)) - 1; // 月份从 0 开始
|
||||||
|
const day = parseInt(dateStr.substring(6, 8));
|
||||||
|
|
||||||
|
// 创建日期对象
|
||||||
|
const date = new Date(year, month, day);
|
||||||
|
|
||||||
|
// 存储结果的数组
|
||||||
|
const result = [];
|
||||||
|
|
||||||
|
// 计算前 7 天的日期
|
||||||
|
for (let i = 0; i <= 6; i++) {
|
||||||
|
const currentDate = new Date(date);
|
||||||
|
currentDate.setDate(date.getDate() - i); // 减去 i 天
|
||||||
|
|
||||||
|
// 格式化为 YYYYMMDD
|
||||||
|
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1).toString().padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}`;
|
||||||
|
result.push(formattedDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按时间顺序排序(从最早到最晚)
|
||||||
|
result.sort((a, b) => a.localeCompare(b));
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -11,11 +11,10 @@ const router = useRouter();
|
|||||||
|
|
||||||
// 请求地址前缀
|
// 请求地址前缀
|
||||||
let baseURL = ''
|
let baseURL = ''
|
||||||
console.log(process.env.NODE_ENV)
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// 生产环境
|
// 生产环境
|
||||||
baseURL = "http://120.26.251.180:8085/api/"
|
baseURL = "http://120.26.251.180:8085/api/"
|
||||||
// baseURL = "http://192.168.0.100:8085/api/"
|
// baseURL = "http://192.168.0.108:8085/api/"
|
||||||
} else {
|
} else {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
baseURL = ""
|
baseURL = ""
|
||||||
@@ -85,7 +84,6 @@ export function postAxios({ url, data }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
).then(res => {
|
).then(res => {
|
||||||
console.log(res)
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
if (err.message == "Network Error") {
|
if (err.message == "Network Error") {
|
||||||
// alert("网络错误,请检查网络连接")
|
// alert("网络错误,请检查网络连接")
|
||||||
@@ -128,5 +126,38 @@ export function postAxios({ url, data }) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export const downFile = async (urlstr, data) => {
|
||||||
|
|
||||||
|
// 发送请求,获取文件流
|
||||||
|
const response = await axios.post(urlstr, data, { responseType: 'blob' });
|
||||||
|
|
||||||
|
// 获取文件名(如果后端设置了 Content-Disposition)
|
||||||
|
const contentDisposition = response.headers['content-disposition'];
|
||||||
|
let fileName = 'default-file-name'; // 默认文件名
|
||||||
|
console.log(contentDisposition)
|
||||||
|
console.log(response)
|
||||||
|
if (contentDisposition) {
|
||||||
|
// 从响应头中提取文件名
|
||||||
|
const fileNameMatch = contentDisposition.match(/filename="(.+)"/);
|
||||||
|
if (fileNameMatch && fileNameMatch.length > 1) {
|
||||||
|
fileName = fileNameMatch[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个临时的下载链接
|
||||||
|
const blob = new Blob([response.data], { type: response.headers['content-type'] });
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = fileName; // 设置下载的文件名
|
||||||
|
a.click();
|
||||||
|
|
||||||
|
// 释放 URL 对象
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default axios
|
export default axios
|
||||||
@@ -47,18 +47,14 @@ export function usePythonBridge() {
|
|||||||
|
|
||||||
// 登录tk后台
|
// 登录tk后台
|
||||||
const loginBackStage = (data) => {
|
const loginBackStage = (data) => {
|
||||||
return new Promise((resolve, reject) => {
|
if (bridge.value) {
|
||||||
if (bridge.value) {
|
if (data.index == 0) {
|
||||||
bridge.value.loginBackStage(data, function (result) {
|
bridge.value.loginBackStage(JSON.stringify(data));
|
||||||
if (result) {
|
} else if (data.index == 1) {
|
||||||
resolve(result);
|
bridge.value.loginBackStageCopy(JSON.stringify(data));
|
||||||
} else {
|
|
||||||
reject(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//跳转到主播页面
|
//跳转到主播页面
|
||||||
@@ -70,6 +66,31 @@ export function usePythonBridge() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//查询登录状态
|
||||||
|
const backStageloginStatus = () => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (bridge.value) {
|
||||||
|
bridge.value.backStageloginStatus(function (result) {
|
||||||
|
resolve(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
//查询登录状态
|
||||||
|
const backStageloginStatusCopy = () => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (bridge.value) {
|
||||||
|
bridge.value.backStageloginStatusCopy(function (result) {
|
||||||
|
resolve(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// 在组件挂载时初始化桥接
|
// 在组件挂载时初始化桥接
|
||||||
onMounted(initBridge);
|
onMounted(initBridge);
|
||||||
|
|
||||||
@@ -78,6 +99,8 @@ export function usePythonBridge() {
|
|||||||
fetchDataCount,
|
fetchDataCount,
|
||||||
loginBackStage,
|
loginBackStage,
|
||||||
loginTikTok,
|
loginTikTok,
|
||||||
givePyAnchorId
|
givePyAnchorId,
|
||||||
|
backStageloginStatus,
|
||||||
|
backStageloginStatusCopy
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -26,9 +26,20 @@ export function getNumData() {
|
|||||||
return JSON.parse(localStorage.getItem('num'));
|
return JSON.parse(localStorage.getItem('num'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导出一个函数,用于设置用户密码
|
||||||
export function setUserPass(userdata) {
|
export function setUserPass(userdata) {
|
||||||
localStorage.setItem('userPass', JSON.stringify(userdata));
|
localStorage.setItem('userPass', JSON.stringify(userdata));
|
||||||
}
|
}
|
||||||
|
// 导出一个函数,用于获取用户密码
|
||||||
export function getUserPass() {
|
export function getUserPass() {
|
||||||
return JSON.parse(localStorage.getItem('userPass'));
|
return JSON.parse(localStorage.getItem('userPass'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用于设置tk账户密码
|
||||||
|
export function setTkUser(userdata) {
|
||||||
|
localStorage.setItem('tkuser', JSON.stringify(userdata));
|
||||||
|
}
|
||||||
|
// 用于获取tk账户密码
|
||||||
|
export function getTkUser() {
|
||||||
|
return JSON.parse(localStorage.getItem('tkuser'));
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<el-form label-position="left" label-width="100px" :model="formData">
|
<el-form label-position="left" label-width="100px" :model="formData">
|
||||||
|
|
||||||
<div class="from-input-item1">
|
<div class="from-input-item1">
|
||||||
<img src="@/assets/password.png" alt="">
|
<img src="@/assets/username.png" alt="">
|
||||||
<el-input style="height: 25px;" v-model="formData.userId" placeholder="账号" clearable
|
<el-input style="height: 25px;" v-model="formData.userId" placeholder="账号" clearable
|
||||||
@keyup.enter="onSubmit" />
|
@keyup.enter="onSubmit" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,11 +10,13 @@
|
|||||||
style="margin-left: 50px;" />
|
style="margin-left: 50px;" />
|
||||||
|
|
||||||
<el-button class="serch-button" style="margin-left: 50px;" type="primary" @click="serch">查询</el-button>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hostTable center-justify">
|
<div class="hostTable center-justify">
|
||||||
<el-table size="small" :data="tableData" stripe v-loading="loading">
|
<el-table :data="tableData" stripe v-loading="loading" height="500">
|
||||||
<el-table-column prop="hostId" label="主播id" width="200">
|
<el-table-column fixed prop="hostId" label="主播id" width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="hostIdText" @click="openHTML(scope.row.hostId)"> {{ scope.row.hostId }}</div>
|
<div class="hostIdText" @click="openHTML(scope.row.hostId)"> {{ scope.row.hostId }}</div>
|
||||||
|
|
||||||
@@ -25,7 +27,11 @@
|
|||||||
{{ scope.row.hostName }}
|
{{ scope.row.hostName }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="hostlevel" label="等级" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.hostlevel }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column v-for="label in labelList" :key="label.paramCode" :prop="label.paramCode"
|
<el-table-column v-for="label in labelList" :key="label.paramCode" :prop="label.paramCode"
|
||||||
:label="label.paramCodeMeaning" width="120">
|
:label="label.paramCodeMeaning" width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@@ -33,7 +39,8 @@
|
|||||||
placement="bottom" :width="600" trigger="hover">
|
placement="bottom" :width="600" trigger="hover">
|
||||||
<div style="height: 300px;">
|
<div style="height: 300px;">
|
||||||
<component :is="EChartsComponent" v-if="isPopoverVisible[`${scope.row.hostId}-${label.paramCode}`]"
|
<component :is="EChartsComponent" v-if="isPopoverVisible[`${scope.row.hostId}-${label.paramCode}`]"
|
||||||
:title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode"></component>
|
:title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode"
|
||||||
|
:time="searchForm.time"></component>
|
||||||
</div>
|
</div>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<span @mouseover="openPopover(scope.row.hostId, label.paramCode)"
|
<span @mouseover="openPopover(scope.row.hostId, label.paramCode)"
|
||||||
@@ -46,7 +53,9 @@
|
|||||||
<el-popover v-else placement="bottom" :width="500" trigger="hover">
|
<el-popover v-else placement="bottom" :width="500" trigger="hover">
|
||||||
<div style="height: 300px;">
|
<div style="height: 300px;">
|
||||||
<component :is="EChartsComponent" v-if="isPopoverVisible[`${scope.row.hostId}-${label.paramCode}`]"
|
<component :is="EChartsComponent" v-if="isPopoverVisible[`${scope.row.hostId}-${label.paramCode}`]"
|
||||||
:title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode"></component>
|
:title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode"
|
||||||
|
:time="searchForm.time">
|
||||||
|
</component>
|
||||||
</div>
|
</div>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<!-- 鼠标移入时开启 -->
|
<!-- 鼠标移入时开启 -->
|
||||||
@@ -69,8 +78,9 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="center-justify" style="margin-top: 30px;">
|
<div class="center-justify" style="margin-top: 30px;">
|
||||||
<el-pagination :default-current-page="4" v-model:current-page="page" background layout="prev, pager, next"
|
<el-pagination v-model:current-page="page" v-model:page-size="pageSize" background
|
||||||
:total="total" @change="serch" />
|
layout="sizes, prev, pager, next" :total="total" :page-sizes="[10, 20, 50, 100]"
|
||||||
|
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,8 +88,9 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
// import { getToken, setToken, removeToken } from '@/utils/storage'
|
// import { getToken, setToken, removeToken } from '@/utils/storage'
|
||||||
import { tkhostdata, dicts, tkhostdetail } from '@/api/account';
|
import { tkhostdata, dicts, tkhostdetail, exporthosts, downList } from '@/api/account';
|
||||||
import { usePythonBridge, } from '@/utils/pythonBridge'
|
import { usePythonBridge, } from '@/utils/pythonBridge'
|
||||||
|
import { getUser } from '@/utils/storage'
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import EChartsComponent from '@/components/EChartsComponent.vue';
|
import EChartsComponent from '@/components/EChartsComponent.vue';
|
||||||
|
|
||||||
@@ -127,13 +138,50 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function serch() {
|
function serch() {
|
||||||
console.log("pageSize.value", pageSize.value)
|
|
||||||
console.log("page.value", page.value)
|
|
||||||
console.log("searchForm.value.country", searchForm.value.country)
|
|
||||||
console.log("time.value", searchForm.value.time)
|
|
||||||
getlist();
|
getlist();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exportList() {
|
||||||
|
downList('export/hostsinfo',
|
||||||
|
{
|
||||||
|
searchTime: searchForm.value.time,
|
||||||
|
region: searchForm.value.country,
|
||||||
|
pageSize: pageSize.value,
|
||||||
|
page: page.value,
|
||||||
|
userId: getUser().userId,
|
||||||
|
userType: getUser().userType
|
||||||
|
}
|
||||||
|
);
|
||||||
|
// exporthosts({
|
||||||
|
// searchTime: searchForm.value.time,
|
||||||
|
// region: searchForm.value.country,
|
||||||
|
// pageSize: pageSize.value,
|
||||||
|
// page: page.value,
|
||||||
|
// userId: getUser().userId,
|
||||||
|
// userType: getUser().userType
|
||||||
|
// }).then(res => {
|
||||||
|
// const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||||
|
// const url = window.URL.createObjectURL(blob);
|
||||||
|
// const a = document.createElement('a');
|
||||||
|
// a.href = url;
|
||||||
|
// a.download = 'table-data.xlsx'; // 下载的文件名
|
||||||
|
// document.body.appendChild(a);
|
||||||
|
// a.click();
|
||||||
|
// a.remove();
|
||||||
|
// window.URL.revokeObjectURL(url);
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
function handleSizeChange(val) {
|
||||||
|
console.log(`${val} items per page`)
|
||||||
|
getlist();
|
||||||
|
|
||||||
|
}
|
||||||
|
function handleCurrentChange(val) {
|
||||||
|
console.log(`current page: ${val}`)
|
||||||
|
getlist();
|
||||||
|
|
||||||
|
}
|
||||||
//获取主播列表
|
//获取主播列表
|
||||||
const getlist = () => {
|
const getlist = () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -141,17 +189,17 @@ const getlist = () => {
|
|||||||
searchTime: searchForm.value.time,
|
searchTime: searchForm.value.time,
|
||||||
region: searchForm.value.country,
|
region: searchForm.value.country,
|
||||||
pageSize: pageSize.value,
|
pageSize: pageSize.value,
|
||||||
page: page.value
|
page: page.value,
|
||||||
|
userId: getUser().userId,
|
||||||
|
userType: getUser().userType
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
total.value = res.total
|
total.value = res.total
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
res.records.forEach(item => {
|
res.records.forEach(item => {
|
||||||
item = { ...item, ...item.infoMap }
|
item = { ...item, ...item.infoMap }
|
||||||
console.log(item)
|
|
||||||
tableData.value.push(item)
|
tableData.value.push(item)
|
||||||
})
|
})
|
||||||
console.log(tableData.value)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -208,7 +256,7 @@ function openHTML(id) {
|
|||||||
<style lang="less">
|
<style lang="less">
|
||||||
.main {
|
.main {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 100vh;
|
// height: 100vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 40px;
|
padding: 40px;
|
||||||
|
|
||||||
@@ -228,6 +276,16 @@ function openHTML(id) {
|
|||||||
height: 47px;
|
height: 47px;
|
||||||
background: #E7CA92;
|
background: #E7CA92;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.put-button {
|
||||||
|
width: 132px;
|
||||||
|
height: 47px;
|
||||||
|
background: #E7CA92;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: none;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-card class="box-card-num center-justify" v-for="(item, index) in 2" :key="index">
|
<el-card class="box-card-num" v-for="(item, index) in 2" :key="index">
|
||||||
<div class="center-justify">
|
<div class="center-justify">
|
||||||
<div class="from-input-item">
|
<div class="from-input-item">
|
||||||
<div class="from-input-item-title center-justify">
|
<div class="from-input-item-title center-justify">
|
||||||
公会账号:
|
公会账号:
|
||||||
</div>
|
</div>
|
||||||
<el-input :disabled="!(isTk || tkData[index].code == 1)" v-model="tkData[index].account"
|
<el-input :disabled="!(isTk && tkData[index].code == 0)" v-model="tkData[index].account"
|
||||||
style="height: 50px;" placeholder="请输入登录账号" clearable />
|
style="height: 50px;" placeholder="请输入登录账号" clearable />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -28,18 +28,18 @@
|
|||||||
<div class="from-input-item-title center-justify">
|
<div class="from-input-item-title center-justify">
|
||||||
公会密码:
|
公会密码:
|
||||||
</div>
|
</div>
|
||||||
<el-input :disabled="!(isTk || tkData[index].code == 1)" v-model="tkData[index].password"
|
<el-input :disabled="!(isTk && tkData[index].code == 0)" v-model="tkData[index].password"
|
||||||
style="height: 50px;" type="password" placeholder="请输入登录密码" show-password />
|
style="height: 50px;" type="password" placeholder="请输入登录密码" show-password />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-button class="open-login" style="margin-left: 60px;"
|
<el-button class="open-login" style="margin-left: 60px;"
|
||||||
:disabled="!(isTk || tkData[index].code == 1)" type="primary"
|
:disabled="!(isTk && tkData[index].code == 0)" type="primary"
|
||||||
@click="loginTK(index)">登录tk</el-button>
|
@click="loginTK(index)">登录tk</el-button>
|
||||||
<div v-if="tkData[index].code == 0" class="loginState" style="background-color: red;"></div>
|
<div v-if="tkData[index].code == 0" class="loginState"></div>
|
||||||
<div v-else class="loginState" style="background-color: green;"></div>
|
<div v-if="tkData[index].code == 1" class="loginState" style="background-color: green;"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="todayCount">今日已查询次数:{{ tkData[index].num }}</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span class="center-justify"><img src="@/assets/worklogo.png">工作台 </span>
|
<span class="center-justify"><img src="@/assets/worklogo.png">工作台 </span>
|
||||||
<div>当前网络:{{ countryData }}
|
<div style="margin-right: 120px;">当前网络:{{ countryData }}
|
||||||
<!-- <el-button class="reset-button" @click="reset">重置数据</el-button> -->
|
<!-- <el-button class="reset-button" @click="reset">重置数据</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -116,11 +116,12 @@
|
|||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
// import { useIPCountry } from '@/utils/useIPCountry';
|
// import { useIPCountry } from '@/utils/useIPCountry';
|
||||||
import { usePythonBridge, } from '@/utils/pythonBridge'
|
import { usePythonBridge, } from '@/utils/pythonBridge'
|
||||||
import { setNumData, getNumData, getUser } from '@/utils/storage'
|
import { setNumData, getNumData, getUser, setTkUser, getTkUser } from '@/utils/storage'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { getCountryName } from '@/utils/countryUtil'
|
import { getCountryName } from '@/utils/countryUtil'
|
||||||
|
import { tkaccountuseinfo } from '@/api/account'
|
||||||
//导入python交互方法
|
//导入python交互方法
|
||||||
const { fetchDataConfig, fetchDataCount, loginBackStage, loginTikTok } = usePythonBridge();
|
const { fetchDataConfig, fetchDataCount, loginBackStage, loginTikTok, backStageloginStatus, backStageloginStatusCopy } = usePythonBridge();
|
||||||
|
|
||||||
//ip国家
|
//ip国家
|
||||||
let countryData = ref('');
|
let countryData = ref('');
|
||||||
@@ -137,6 +138,10 @@ let hostData = ref({
|
|||||||
//是否开启tk
|
//是否开启tk
|
||||||
let isTk = ref(false);
|
let isTk = ref(false);
|
||||||
|
|
||||||
|
//设置状态轮询定时器
|
||||||
|
let statusTimer = ref(null);
|
||||||
|
let statusTimerCopy = ref(null);
|
||||||
|
|
||||||
|
|
||||||
//tk账号信息
|
//tk账号信息
|
||||||
let tkData = ref([
|
let tkData = ref([
|
||||||
@@ -145,12 +150,15 @@ let tkData = ref([
|
|||||||
password: '',
|
password: '',
|
||||||
index: 1,
|
index: 1,
|
||||||
code: 0,
|
code: 0,
|
||||||
|
num: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
account: '',
|
account: '',
|
||||||
password: '',
|
password: '',
|
||||||
index: 2,
|
index: 2,
|
||||||
code: 0,
|
code: 0,
|
||||||
|
num: 0
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
]);
|
]);
|
||||||
@@ -176,7 +184,18 @@ onMounted(() => {
|
|||||||
if (getNumData()) {
|
if (getNumData()) {
|
||||||
pyData.value = getNumData();
|
pyData.value = getNumData();
|
||||||
}
|
}
|
||||||
|
if (getTkUser()) {
|
||||||
|
tkData.value = getTkUser();
|
||||||
|
tkData.value[0].code = 0;
|
||||||
|
tkData.value[1].code = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
tkData.value[0].num = tkaccountuse(tkData.value[0].account)
|
||||||
|
tkData.value[1].num = tkaccountuse(tkData.value[1].account)
|
||||||
|
|
||||||
getIpInfo()
|
getIpInfo()
|
||||||
|
//查询次数查询
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -277,18 +296,23 @@ const reset = () => {
|
|||||||
|
|
||||||
|
|
||||||
const loginTK = (index) => {
|
const loginTK = (index) => {
|
||||||
loginBackStage(JSON.stringify({
|
setTkUser(tkData.value)
|
||||||
|
loginBackStage({
|
||||||
account: tkData.value[index].account,
|
account: tkData.value[index].account,
|
||||||
password: tkData.value[index].password,
|
password: tkData.value[index].password,
|
||||||
index: index
|
index: index
|
||||||
})).then((res) => {
|
|
||||||
// let data = JSON.parse(res);
|
|
||||||
// if (data.code == 1) {
|
|
||||||
// tkData.value[data.index].code = 1;
|
|
||||||
// }
|
|
||||||
}).catch((err) => {
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
if (index == 0) {
|
||||||
|
statusTimer = setInterval(() => {
|
||||||
|
getloginStatus();
|
||||||
|
}, 2000)
|
||||||
|
} else if (index == 1) {
|
||||||
|
statusTimerCopy = setInterval(() => {
|
||||||
|
getloginStatusCopy();
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const openTK = () => {
|
const openTK = () => {
|
||||||
@@ -297,9 +321,38 @@ const openTK = () => {
|
|||||||
loginTikTok();
|
loginTikTok();
|
||||||
|
|
||||||
}
|
}
|
||||||
function jszhuru() {
|
|
||||||
isTk.value = true;
|
function getloginStatus() {
|
||||||
tkData[index].code = 1;
|
backStageloginStatus().then((res) => {
|
||||||
|
const data = JSON.parse(res);
|
||||||
|
tkData.value[data.index].code = data.code
|
||||||
|
|
||||||
|
if (data.code == 1) {
|
||||||
|
clearInterval(statusTimer);
|
||||||
|
statusTimer = null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function getloginStatusCopy() {
|
||||||
|
backStageloginStatusCopy().then((res) => {
|
||||||
|
const data = JSON.parse(res);
|
||||||
|
tkData.value[data.index].code = data.code
|
||||||
|
|
||||||
|
if (data.code == 1) {
|
||||||
|
clearInterval(statusTimer);
|
||||||
|
statusTimer = null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function tkaccountuse(id) {
|
||||||
|
let num = 0;
|
||||||
|
tkaccountuseinfo({ userId: id }).then((res) => {
|
||||||
|
num = res
|
||||||
|
console.log(num)
|
||||||
|
})
|
||||||
|
return num
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -346,15 +399,20 @@ function jszhuru() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.box-card-num {
|
.box-card-num {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
width: 897px;
|
width: 897px;
|
||||||
height: 145px;
|
height: 145px;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
box-shadow: 0px 0px 21px 0px rgba(183, 183, 183, 0.33);
|
box-shadow: 0px 0px 21px 0px rgba(183, 183, 183, 0.33);
|
||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
|
|
||||||
|
padding-top: 18px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.todayCount {
|
||||||
|
padding: 15px 21px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.from-input-item {
|
.from-input-item {
|
||||||
@@ -382,7 +440,7 @@ function jszhuru() {
|
|||||||
width: 15px;
|
width: 15px;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: red;
|
background-color: #b90000;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,6 +482,7 @@ label {
|
|||||||
height: 47px;
|
height: 47px;
|
||||||
background: #E7CA92;
|
background: #E7CA92;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.reset-button {
|
.reset-button {
|
||||||
|
|||||||
Reference in New Issue
Block a user