Compare commits
10 Commits
05cad57358
...
01e9c26821
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01e9c26821 | ||
| 560581f1a4 | |||
| 17d2251a70 | |||
| dcd677bbab | |||
| 60f6fc4873 | |||
| 5e34aaf402 | |||
| c5fb3ea0b2 | |||
| 666e27246f | |||
| 91ee2dd7cb | |||
| 7df29e741c |
BIN
YOLO工具箱.zip
Normal file
@@ -24,4 +24,10 @@ window.ResizeObserver = class ResizeObserver extends _ResizeObserver {
|
|||||||
super(callback)
|
super(callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- <style lang="less">
|
||||||
|
/*每个页面公共css */
|
||||||
|
|
||||||
|
@import "@/static/css/app.less";
|
||||||
|
</style> -->
|
||||||
@@ -1,17 +1,42 @@
|
|||||||
import { getAxios, postAxios, downFile } from '@/utils/axios.js'
|
import { getAxios, postAxios, downFile } from '@/utils/axios.js'
|
||||||
|
|
||||||
|
//租户获取登录id
|
||||||
|
export function rentgetloginID(data) {
|
||||||
|
return getAxios({ url: `/api/tenant/get-id-by-name?name=${data.name}`})
|
||||||
|
}
|
||||||
|
//登录
|
||||||
|
export function login(data) {
|
||||||
|
return postAxios({ url: '/api/user/bigbrother-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/big-brother/page', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function apiGetCart() {
|
export function apiGetCart() {
|
||||||
return getAxios({ url: '/cgi-bin/cart/latest' })
|
return getAxios({ url: '/cgi-bin/cart/latest' })
|
||||||
}
|
}
|
||||||
export function login(data) {
|
// export function login(data) {
|
||||||
return postAxios({ url: 'api/account/login', data })
|
// return postAxios({ url: 'api/account/login', data })
|
||||||
}
|
// }
|
||||||
export function cheekalive(data) {
|
export function cheekalive(data) {
|
||||||
return postAxios({ url: 'api/account/cheekalive', data })
|
return postAxios({ url: 'api/account/cheekalive', data })
|
||||||
}
|
}
|
||||||
export function tkhostdata(data) {
|
|
||||||
return postAxios({ url: 'api/tkinfo/tkhostdata', data })
|
|
||||||
}
|
|
||||||
export function dicts(data) {
|
export function dicts(data) {
|
||||||
return postAxios({ url: 'api/param/dicts', data })
|
return postAxios({ url: 'api/param/dicts', data })
|
||||||
}
|
}
|
||||||
@@ -25,10 +50,7 @@ export function exporthosts(data) {
|
|||||||
export function downList(url, data) {
|
export function downList(url, data) {
|
||||||
return downFile(url, data)
|
return downFile(url, data)
|
||||||
}
|
}
|
||||||
//查询tk账号查询次数
|
|
||||||
export function tkaccountuseinfo(data) {
|
|
||||||
return postAxios({ url: 'api/tkinfo/tkaccountuseinfo', data })
|
|
||||||
}
|
|
||||||
//查询员工
|
//查询员工
|
||||||
export function getStaffList(data) {
|
export function getStaffList(data) {
|
||||||
return postAxios({ url: 'api/account/list', data })
|
return postAxios({ url: 'api/account/list', data })
|
||||||
@@ -41,7 +63,9 @@ export function managerhosts(data) {
|
|||||||
export function upholdinfo(data) {
|
export function upholdinfo(data) {
|
||||||
return postAxios({ url: 'api/tkinfo/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 |
@@ -38,6 +38,8 @@ export default {
|
|||||||
|
|
||||||
this.inputTime = this.time
|
this.inputTime = this.time
|
||||||
this.getTkhostdetail();
|
this.getTkhostdetail();
|
||||||
|
console.log(this.time)
|
||||||
|
|
||||||
console.log(this.getPrevious7Days(this.inputTime))
|
console.log(this.getPrevious7Days(this.inputTime))
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -93,16 +95,6 @@ export default {
|
|||||||
res[0][this.getPrevious7Days(this.inputTime)[6]] == null ? 0 : Number(res[0][this.getPrevious7Days(this.inputTime)[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.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.initChart();
|
||||||
this.num++
|
this.num++
|
||||||
console.log("返回数据", this.seriesData)
|
console.log("返回数据", this.seriesData)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<div class="logo">
|
<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">
|
<img src="@/assets/logotext.png">
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li @click="updateActiveIndex(1)" v-show="userInfo.userType == 3">
|
<li @click="updateActiveIndex(1)">
|
||||||
<div>
|
<div>
|
||||||
<img v-show="activeIndex == 1" src="@/assets/navAction.png" autoplay loop muted class="background-img">
|
<img v-show="activeIndex == 1" src="@/assets/navAction.png" autoplay loop muted class="background-img">
|
||||||
<div style="display: flex;">
|
<div style="display: flex;">
|
||||||
@@ -45,11 +45,13 @@ import { ref, reactive, onMounted } from 'vue';
|
|||||||
import { getUser } from '@/utils/storage'
|
import { getUser } from '@/utils/storage'
|
||||||
import { defineEmits } from 'vue';
|
import { defineEmits } from 'vue';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const userInfo = ref(getUser())
|
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) => {
|
const updateActiveIndex = (index) => {
|
||||||
@@ -58,23 +60,23 @@ const updateActiveIndex = (index) => {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="less">
|
||||||
.sidebar {
|
.sidebar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
height: 900px;
|
height: 900px;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
background-color: #338F6A;
|
background-color: @bg-color;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
border-bottom: 1px solid #fff;
|
border-bottom: 1px solid #fff;
|
||||||
padding-bottom: 29px;
|
padding-top: 20px;
|
||||||
|
|
||||||
img:nth-of-type(1) {
|
img:nth-of-type(1) {
|
||||||
height: 40px;
|
height: 66px;
|
||||||
}
|
}
|
||||||
|
|
||||||
img:nth-of-type(2) {
|
img:nth-of-type(2) {
|
||||||
|
|||||||
@@ -5,11 +5,15 @@ import store from './store'
|
|||||||
import { createPinia } from 'pinia';
|
import { createPinia } from 'pinia';
|
||||||
import ElementPlus from 'element-plus'
|
import ElementPlus from 'element-plus'
|
||||||
import 'element-plus/dist/index.css'
|
import 'element-plus/dist/index.css'
|
||||||
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'; // 引入中文语言包
|
||||||
|
|
||||||
// createApp(App).use(store).use(router).mount('#app')
|
// createApp(App).use(store).use(router).mount('#app')
|
||||||
|
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
app.use(ElementPlus, {
|
||||||
|
locale: zhCn, // 配置中文
|
||||||
|
});
|
||||||
app.use(ElementPlus) // 注册 ElementPlus
|
app.use(ElementPlus) // 注册 ElementPlus
|
||||||
app.use(createPinia()); // 注册 Pinia
|
app.use(createPinia()); // 注册 Pinia
|
||||||
app.use(store); // 注册 store
|
app.use(store); // 注册 store
|
||||||
|
|||||||
@@ -19,11 +19,12 @@ const routes = [
|
|||||||
name: 'hostsList',
|
name: 'hostsList',
|
||||||
component: () => import(/* webpackChunkName: "hostsList" */ '../views/hosts/hostsList.vue')
|
component: () => import(/* webpackChunkName: "hostsList" */ '../views/hosts/hostsList.vue')
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: 'workBenches',
|
// path: 'workBenches',
|
||||||
name: 'workBenches',
|
// name: 'workBenches',
|
||||||
component: () => import(/* webpackChunkName: "hostsList" */ '../views/hosts/workbenches.vue')
|
// component: () => import(/* webpackChunkName: "hostsList" */ '../views/hosts/workbenches.vue')
|
||||||
},]
|
// },
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
|||||||
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,27 +4,38 @@
|
|||||||
*/
|
*/
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { getToken, getUser } from '@/utils/storage'
|
import { getToken, getUser } from '@/utils/storage'
|
||||||
import { useRouter } from 'vue-router';
|
import router from '@/router'
|
||||||
import { ElMessage } from 'element-plus';
|
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import { usePythonBridge, } from '@/utils/pythonBridge'
|
||||||
|
|
||||||
|
const { stopScript } = usePythonBridge();
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
// 请求地址前缀
|
// 请求地址前缀
|
||||||
let baseURL = ''
|
let baseURL = ''
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// 生产环境
|
// 生产环境
|
||||||
baseURL = "http://120.26.251.180:8085/"
|
// baseURL = "https://api.tkpage.yolozs.com"
|
||||||
// baseURL = "http://192.168.0.115:8085/"
|
baseURL = "http://47.79.98.113:8101"
|
||||||
|
// baseURL = "http://192.168.0.103:8085/"
|
||||||
} else {
|
} else {
|
||||||
|
// 测试环境
|
||||||
|
// baseURL = "http://120.26.251.180:8085/"
|
||||||
// 开发环境
|
// 开发环境
|
||||||
baseURL = "http://120.26.251.180:8085/"
|
// baseURL = "https://api.tkpage.yolozs.com"
|
||||||
|
baseURL = "http://47.79.98.113:8101"
|
||||||
|
// baseURL = "http://api.tkpage.vvtiktok.cn"
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求拦截器
|
// 请求拦截器
|
||||||
axios.interceptors.request.use((config) => {
|
axios.interceptors.request.use((config) => {
|
||||||
// if (getToken()) {
|
console.log("config", config)
|
||||||
// config.headers['token'] = getToken();
|
const url = sliceUrl(config.url)
|
||||||
// }
|
console.log("url", url)
|
||||||
|
if (!(config.url == 'bigbrother-doLogin' || config.url == 'get-id-by-name')) {
|
||||||
|
config.headers['vvtoken'] = getToken();
|
||||||
|
}
|
||||||
|
|
||||||
// 请求超时时间 - 毫秒
|
// 请求超时时间 - 毫秒
|
||||||
config.timeout = 60000
|
config.timeout = 60000
|
||||||
@@ -38,7 +49,19 @@ axios.interceptors.request.use((config) => {
|
|||||||
|
|
||||||
// 响应拦截器
|
// 响应拦截器
|
||||||
axios.interceptors.response.use((response) => {
|
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 if (response.data.code == 40400) {
|
||||||
|
router.push('/')
|
||||||
|
ElMessage.error(response.data.code + '' + response.data.message);
|
||||||
|
}else{
|
||||||
|
ElMessage.error(response.data.code + '' + response.data.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
// 可添加请求失败后的处理逻辑
|
// 可添加请求失败后的处理逻辑
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
@@ -54,10 +77,9 @@ export function getAxios({ url, params }) {
|
|||||||
params
|
params
|
||||||
// 请求成功,将返回的数据传递给resolve函数
|
// 请求成功,将返回的数据传递给resolve函数
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
resolve(res.data)
|
resolve(res)
|
||||||
// 请求失败,将错误信息传递给reject函数
|
// 请求失败,将错误信息传递给reject函数
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
|
||||||
reject(err)
|
reject(err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -65,13 +87,6 @@ export function getAxios({ url, params }) {
|
|||||||
|
|
||||||
// axios的post请求
|
// axios的post请求
|
||||||
export function postAxios({ url, data }) {
|
export function postAxios({ url, data }) {
|
||||||
if (url != 'api/account/login') {
|
|
||||||
|
|
||||||
throttledCheekalive();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios.post(
|
axios.post(
|
||||||
url,
|
url,
|
||||||
@@ -82,20 +97,9 @@ export function postAxios({ url, data }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
).then(res => {
|
).then(res => {
|
||||||
resolve(res.data)
|
resolve(res)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
if (err.message == "Network Error") {
|
reject(err)
|
||||||
// alert("网络错误,请检查网络连接")
|
|
||||||
ElMessage.error('网络连接错误');
|
|
||||||
reject('网络连接错误')
|
|
||||||
|
|
||||||
} else {
|
|
||||||
ElMessage.error(err.message);
|
|
||||||
reject(err.message)
|
|
||||||
|
|
||||||
}
|
|
||||||
// console.log(err)
|
|
||||||
// reject(err)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -146,6 +150,7 @@ function cheekalive() {
|
|||||||
if (res.data) {
|
if (res.data) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
stopScript();
|
||||||
alert("账号在其他地方登录!")
|
alert("账号在其他地方登录!")
|
||||||
window.location.href = '/';
|
window.location.href = '/';
|
||||||
}
|
}
|
||||||
@@ -167,6 +172,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
|
export default axios
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
// pythonBridge.js
|
// pythonBridge.js
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
const bridge = ref(null);
|
import { ElMessage } from 'element-plus';
|
||||||
|
const pyBridge = ref(null);
|
||||||
// 初始化 QWebChannel
|
// 初始化 QWebChannel
|
||||||
const initBridge = () => {
|
const initBridge = () => {
|
||||||
if (/localhost/.test(window.location.href)) return
|
if (/localhost/.test(window.location.href)) return
|
||||||
new QWebChannel(qt.webChannelTransport, (channel) => {
|
new QWebChannel(qt.webChannelTransport, (channel) => {
|
||||||
bridge.value = channel.objects.bridge;
|
pyBridge.value = channel.objects.bridge;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
export function usePythonBridge() {
|
export function usePythonBridge() {
|
||||||
@@ -13,105 +14,147 @@ export function usePythonBridge() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 调用 Python 方法
|
// // 调用 Python 方法
|
||||||
const fetchDataConfig = (data) => {
|
// const fetchDataConfig = (data) => {
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// if (bridge.value) {
|
||||||
|
// bridge.value.fetchDataConfig(data, function (result) {
|
||||||
|
// resolve(result);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
|
// // 查询获取主播的数据
|
||||||
|
// const fetchDataCount = () => {
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// if (bridge.value) {
|
||||||
|
// bridge.value.fetchDataCount(function (result) {
|
||||||
|
// resolve(result);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
// 查询获取大哥的数据
|
||||||
|
const controlTask = (data) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (bridge.value) {
|
if (pyBridge.value) {
|
||||||
bridge.value.fetchDataConfig(data, function (result) {
|
pyBridge.value.control_task(data,function (result) {
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
console.log("pyBridge is null未连接上")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 查询获取主播的数据
|
//总数有效数
|
||||||
const fetchDataCount = () => {
|
const getBrotherInfo = () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (bridge.value) {
|
if (pyBridge.value) {
|
||||||
bridge.value.fetchDataCount(function (result) {
|
pyBridge.value.getBrotherInfo(function (result) {
|
||||||
resolve(result);
|
resolve(JSON.parse(result));
|
||||||
|
// ElMessage.success(result);
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
console.log("pyBridge is null未连接上")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开tk后台
|
// 打开tk后台
|
||||||
const loginTikTok = () => {
|
const loginTikTok = () => {
|
||||||
if (bridge.value) {
|
if (pyBridge.value) {
|
||||||
bridge.value.loginTikTok(function (result) {
|
pyBridge.value.loginTikTok(function (result) {
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}else{
|
||||||
|
console.log("pyBridge is null未连接上")
|
||||||
};
|
|
||||||
|
|
||||||
// 登录tk后台
|
|
||||||
const loginBackStage = (data) => {
|
|
||||||
if (bridge.value) {
|
|
||||||
if (data.index == 0) {
|
|
||||||
bridge.value.loginBackStage(JSON.stringify(data));
|
|
||||||
} else if (data.index == 1) {
|
|
||||||
bridge.value.loginBackStageCopy(JSON.stringify(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// // 登录tk后台
|
||||||
|
// const loginBackStage = (data) => {
|
||||||
|
// if (bridge.value) {
|
||||||
|
// if (data.index == 0) {
|
||||||
|
// bridge.value.loginBackStage(JSON.stringify(data));
|
||||||
|
// } else if (data.index == 1) {
|
||||||
|
// bridge.value.loginBackStageCopy(JSON.stringify(data));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
//跳转到主播页面
|
//跳转到主播页面
|
||||||
const givePyAnchorId = (id) => {
|
const givePyAnchorId = (id) => {
|
||||||
|
console.log("id",id);
|
||||||
if (bridge.value) {
|
if (pyBridge.value) {
|
||||||
bridge.value.givePyAnchorId(id, function (result) {
|
ElMessage.success(id);
|
||||||
|
pyBridge.value.givePyAnchorId(id, function (result) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//查询登录状态
|
// //查询登录状态
|
||||||
const backStageloginStatus = () => {
|
// const backStageloginStatus = () => {
|
||||||
return new Promise((resolve, reject) => {
|
// return new Promise((resolve, reject) => {
|
||||||
if (bridge.value) {
|
// if (bridge.value) {
|
||||||
bridge.value.backStageloginStatus(function (result) {
|
// bridge.value.backStageloginStatus(function (result) {
|
||||||
resolve(result);
|
// resolve(result);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
};
|
// };
|
||||||
//查询登录状态
|
// //查询登录状态
|
||||||
const backStageloginStatusCopy = () => {
|
// const backStageloginStatusCopy = () => {
|
||||||
return new Promise((resolve, reject) => {
|
// return new Promise((resolve, reject) => {
|
||||||
if (bridge.value) {
|
// if (bridge.value) {
|
||||||
bridge.value.backStageloginStatusCopy(function (result) {
|
// bridge.value.backStageloginStatusCopy(function (result) {
|
||||||
resolve(result);
|
// resolve(result);
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
};
|
// };
|
||||||
|
|
||||||
//导出表格
|
//导出表格
|
||||||
const exportToExcel = (data) => {
|
const exportToExcel = (data) => {
|
||||||
if (bridge.value) {
|
if (pyBridge .value) {
|
||||||
bridge.value.exportToExcel(JSON.stringify(data));
|
pyBridge .value.exportToExcel(JSON.stringify(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
const stopScript = () => {
|
||||||
|
if (pyBridge .value) {
|
||||||
|
pyBridge .value.stopScript();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//获取版本号
|
||||||
|
const getVersion = () => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (pyBridge.value) {
|
||||||
|
pyBridge.value.currentVersion(function (result) {
|
||||||
|
resolve(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
// 在组件挂载时初始化桥接
|
// 在组件挂载时初始化桥接
|
||||||
onMounted(initBridge);
|
onMounted(initBridge);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
fetchDataConfig,
|
|
||||||
fetchDataCount,
|
|
||||||
loginBackStage,
|
|
||||||
loginTikTok,
|
loginTikTok,
|
||||||
givePyAnchorId,
|
exportToExcel,
|
||||||
backStageloginStatus,
|
stopScript,
|
||||||
backStageloginStatusCopy,
|
controlTask,
|
||||||
exportToExcel
|
getBrotherInfo,
|
||||||
|
getVersion,
|
||||||
|
givePyAnchorId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -42,4 +42,13 @@ export function setTkUser(userdata) {
|
|||||||
// 用于获取tk账户密码
|
// 用于获取tk账户密码
|
||||||
export function getTkUser() {
|
export function getTkUser() {
|
||||||
return JSON.parse(localStorage.getItem('tkuser'));
|
return JSON.parse(localStorage.getItem('tkuser'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用于列表筛选条件
|
||||||
|
export function setSerch(data) {
|
||||||
|
localStorage.setItem('Serch', JSON.stringify(data));
|
||||||
|
}
|
||||||
|
// 用于获取列表筛选条件
|
||||||
|
export function getSerch() {
|
||||||
|
return JSON.parse(localStorage.getItem('Serch'));
|
||||||
}
|
}
|
||||||
@@ -24,10 +24,9 @@
|
|||||||
<div class="center-line" style="margin-top: 40px;">
|
<div class="center-line" style="margin-top: 40px;">
|
||||||
<!-- logo -->
|
<!-- logo -->
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<div class="center-justify" style="height: 80px; width: 300px;">
|
<!-- <div class="center-justify" style="height: 80px; width: 300px;">
|
||||||
<img style="margin-right: 20px;" src="@/assets/logo.png">
|
<img style="height: 100%;" src="@/assets/logotext.png">
|
||||||
<img src="@/assets/logotext.png">
|
</div> -->
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- From -->
|
<!-- From -->
|
||||||
@@ -38,7 +37,12 @@
|
|||||||
|
|
||||||
<div class="from-input">
|
<div class="from-input">
|
||||||
<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">
|
||||||
|
<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">
|
<div class="from-input-item1">
|
||||||
<img src="@/assets/username.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
|
||||||
@@ -53,12 +57,16 @@
|
|||||||
<div class="from-input-item">
|
<div class="from-input-item">
|
||||||
<el-button class="loginButton" color="#8f7ee7" type="primary"
|
<el-button class="loginButton" color="#8f7ee7" type="primary"
|
||||||
@click="onSubmit">登录</el-button>
|
@click="onSubmit">登录</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="version center-justify ">版本号:{{ version }}</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -66,18 +74,57 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { login } from '@/api/account';
|
import { login, rentgetloginID } from '@/api/account';
|
||||||
import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/utils/storage';
|
import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/utils/storage';
|
||||||
import { ElLoading } from 'element-plus';
|
import { ElLoading } from 'element-plus';
|
||||||
|
import { usePythonBridge } from '@/utils/pythonBridge'
|
||||||
|
|
||||||
|
|
||||||
|
const { getVersion } = usePythonBridge();
|
||||||
|
let version = ref('0.0.0');
|
||||||
|
|
||||||
|
// 测试 localStorage
|
||||||
|
const testLocalStorage = () => {
|
||||||
|
try {
|
||||||
|
// 尝试设置一个测试项
|
||||||
|
localStorage.setItem('testKey', 'testValue');
|
||||||
|
// 尝试获取这个测试项
|
||||||
|
const testValue = localStorage.getItem('testKey');
|
||||||
|
if (testValue === 'testValue') {
|
||||||
|
} else {
|
||||||
|
console.error('localStorage is not working');
|
||||||
|
ElMessage.error('localStorage 被禁用');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('localStorage is not available:', error);
|
||||||
|
ElMessage.error('localStorage 不可用');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
getVersion().then((res) => {
|
||||||
|
version.value = res;
|
||||||
|
})
|
||||||
|
// 测试localStorage;
|
||||||
|
testLocalStorage();
|
||||||
|
}, 500);
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
|
tenantName: getUserPass() == null ? '' : getUserPass().tenantName,
|
||||||
userId: getUserPass() == null ? '' : getUserPass().userId,
|
userId: getUserPass() == null ? '' : getUserPass().userId,
|
||||||
password: getUserPass() == null ? '' : getUserPass().password,
|
password: getUserPass() == null ? '' : getUserPass().password,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
const loading = ElLoading.service({
|
const loading = ElLoading.service({
|
||||||
lock: true,
|
lock: true,
|
||||||
@@ -85,27 +132,28 @@ const onSubmit = () => {
|
|||||||
background: 'rgba(0, 0, 0, 0.7)',
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
});
|
});
|
||||||
setUserPass(formData.value);
|
setUserPass(formData.value);
|
||||||
login({
|
rentgetloginID({
|
||||||
userId: formData.value.userId,
|
name: formData.value.tenantName,
|
||||||
password: formData.value.password,
|
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
loading.close();
|
console.log(res);
|
||||||
console.log(res)
|
|
||||||
if (res) {
|
|
||||||
if (res.activeYn == 'Y') {
|
|
||||||
setToken(res.currcode);
|
|
||||||
setUser(res);
|
|
||||||
router.push('/nav');
|
|
||||||
} else {
|
|
||||||
alert('账号未启用');
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
login({
|
||||||
alert('账号或密码错误');
|
username: formData.value.userId,
|
||||||
}
|
tenantId: res,
|
||||||
|
password: formData.value.password,
|
||||||
|
}).then((res) => {
|
||||||
|
loading.close();
|
||||||
|
console.log(res)
|
||||||
|
setToken(res.tokenValue);
|
||||||
|
setUser(res);
|
||||||
|
router.push('/nav');
|
||||||
|
}).catch((err) => {
|
||||||
|
loading.close();
|
||||||
|
});
|
||||||
|
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
loading.close();
|
loading.close();
|
||||||
|
console.log(err)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -141,6 +189,18 @@ const onSubmit = () => {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
/* 防止内容溢出 */
|
/* 防止内容溢出 */
|
||||||
|
|
||||||
|
.version {
|
||||||
|
color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
font-size: 20px;
|
||||||
|
bottom: 20px;
|
||||||
|
left: calc(50% - 50px);
|
||||||
|
// box-sizing: border-box;
|
||||||
|
// width: 1600px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.background-video {
|
.background-video {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -171,12 +231,13 @@ const onSubmit = () => {
|
|||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
|
height: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.from {
|
.from {
|
||||||
width: 420px;
|
width: 420px;
|
||||||
height: 320px;
|
// height: 320px;
|
||||||
color: #107A4E;
|
color: @bg-color;
|
||||||
background-color: #ffffff44;
|
background-color: #ffffff44;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
@@ -187,7 +248,7 @@ const onSubmit = () => {
|
|||||||
font-family: Source Han Sans SC;
|
font-family: Source Han Sans SC;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
color: #107A4E;
|
color: @bg-color;
|
||||||
line-height: 37px;
|
line-height: 37px;
|
||||||
|
|
||||||
|
|
||||||
@@ -207,7 +268,7 @@ const onSubmit = () => {
|
|||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
|
|
||||||
.from-input-item-title {
|
.from-input-item-title {
|
||||||
color: #107A4E;
|
color: @bg-color;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
@@ -225,7 +286,7 @@ const onSubmit = () => {
|
|||||||
font-family: Source Han Sans SC;
|
font-family: Source Han Sans SC;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
color: #107A4E;
|
color: @bg-color;
|
||||||
line-height: 37px;
|
line-height: 37px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -234,7 +295,7 @@ const onSubmit = () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: 359px;
|
width: 359px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background: rgba(147, 174, 158, 0.37);
|
background: @bg-color-light-light;
|
||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
border: 1px solid #FFFFFF;
|
border: 1px solid #FFFFFF;
|
||||||
padding: 12px 25px 13px 25px;
|
padding: 12px 25px 13px 25px;
|
||||||
@@ -277,7 +338,7 @@ const onSubmit = () => {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="less">
|
||||||
::v-deep(.el-input__wrapper) {
|
::v-deep(.el-input__wrapper) {
|
||||||
background-color: rgba(255, 0, 0, 0);
|
background-color: rgba(255, 0, 0, 0);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
@@ -285,11 +346,11 @@ const onSubmit = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
::v-deep(.el-input__inner) {
|
::v-deep(.el-input__inner) {
|
||||||
color: #107A4E;
|
color: #fff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep(.el-input__inner::placeholder) {
|
::v-deep(.el-input__inner::placeholder) {
|
||||||
color: #107A4E;
|
color: @bg-color;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -3,13 +3,15 @@
|
|||||||
<div class="center-align" style="width: 100%; margin: 0 20px;">
|
<div class="center-align" style="width: 100%; margin: 0 20px;">
|
||||||
<div class="box-card-num1 center-line">
|
<div class="box-card-num1 center-line">
|
||||||
<div>总数量: <span>{{ hostData.totalCount }}</span></div>
|
<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.checkedDataCount }}</span></div>
|
||||||
<div>可邀请: <span>{{ hostData.canInvitationCount }}</span></div>
|
<div>可邀请: <span>{{ hostData.canInvitationCount }}</span></div>
|
||||||
|
<div>运行时间: <span>{{ formattedTime }}</span></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="center-line" style="padding-top: 15vh;">
|
<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="openTK">开启tk</el-button>
|
||||||
|
<!-- <el-button class="open-login" type="primary" @click="startTimer">计时开始</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -20,21 +22,21 @@
|
|||||||
<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 == 0)" v-model="tkData[index].account"
|
<el-input :disabled="!(tkData[index].code == 0 && !isLogin[index])"
|
||||||
placeholder="请输入登录账号" clearable />
|
v-model="tkData[index].account" placeholder="请输入登录账号" clearable />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<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 == 0)" v-model="tkData[index].password"
|
<el-input :disabled="!(tkData[index].code == 0 && !isLogin[index])"
|
||||||
type="password" placeholder="请输入登录密码" show-password />
|
v-model="tkData[index].password" 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 == 0)" type="primary"
|
:disabled="!(tkData[index].code == 0 && !isLogin[index])" type="primary"
|
||||||
@click="loginTK(index)">登录tk</el-button>
|
@click="loginTK(index)">登录后台</el-button>
|
||||||
<div v-if="tkData[index].code == 0" class="loginState"></div>
|
<div v-if="tkData[index].code == 0" class="loginState"></div>
|
||||||
<div v-if="tkData[index].code == 1" class="loginState" style="background-color: green;"></div>
|
<div v-if="tkData[index].code == 1" class="loginState" style="background-color: green;"></div>
|
||||||
|
|
||||||
@@ -86,14 +88,14 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<label>后台查询频率</label>
|
<label>后台查询频率</label>
|
||||||
<el-input type='number' v-model="pyData.frequency.hour" :min="0"
|
<!-- <el-input type='number' v-model="pyData.frequency.hour" @input="handleInputHour" -->
|
||||||
:max="pyData.frequency.day - 1" placeholder="次/小时" style="width: 100%"
|
<el-input type='number' v-model="pyData.frequency.hour" placeholder="次/小时"
|
||||||
:disabled="!pyData.isStart">
|
style="width: 100%" :disabled="!pyData.isStart">
|
||||||
<template #append>次/小时</template>
|
<template #append>次/小时</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-input type='number' v-model="pyData.frequency.day" :min="pyData.frequency.hour + 1"
|
<!-- <el-input type='number' v-model="pyData.frequency.day" @input="handleInputDay" -->
|
||||||
:max="100" placeholder="次/24小时" style="width: 100%; margin-top: 10px"
|
<el-input type='number' v-model="pyData.frequency.day" placeholder="次/24小时"
|
||||||
:disabled="!pyData.isStart">
|
style="width: 100%; margin-top: 10px" :disabled="!pyData.isStart">
|
||||||
<template #append>次/24小时</template>
|
<template #append>次/24小时</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
@@ -113,7 +115,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted, computed } from 'vue';
|
||||||
import { usePythonBridge, } from '@/utils/pythonBridge'
|
import { usePythonBridge, } from '@/utils/pythonBridge'
|
||||||
import { setNumData, getNumData, getUser, setTkUser, getTkUser } from '@/utils/storage'
|
import { setNumData, getNumData, getUser, setTkUser, getTkUser } from '@/utils/storage'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
@@ -132,15 +134,27 @@ let hostData = ref({
|
|||||||
validAnchorsCount: 0,
|
validAnchorsCount: 0,
|
||||||
canInvitationCount: 0,
|
canInvitationCount: 0,
|
||||||
checkedDataCount: 0,
|
checkedDataCount: 0,
|
||||||
|
|
||||||
});
|
});
|
||||||
//是否开启tk
|
//是否开启tk
|
||||||
let isTk = ref(true);
|
// let isTk = ref(true);
|
||||||
|
|
||||||
|
//账号是否登陆中
|
||||||
|
let isLogin = ref([false, false]);
|
||||||
//设置状态轮询定时器
|
//设置状态轮询定时器
|
||||||
let statusTimer = ref(null);
|
let statusTimer = ref(null);
|
||||||
let statusTimerCopy = ref(null);
|
let statusTimerCopy = ref(null);
|
||||||
|
|
||||||
|
//设置次数最大值
|
||||||
|
let maxCount = ref([
|
||||||
|
{
|
||||||
|
hourMax: 50,
|
||||||
|
dayMax: 300,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
hourMax: 100,
|
||||||
|
dayMax: 600,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
//tk账号信息
|
//tk账号信息
|
||||||
let tkData = ref([
|
let tkData = ref([
|
||||||
@@ -157,9 +171,7 @@ let tkData = ref([
|
|||||||
index: 2,
|
index: 2,
|
||||||
code: 0,
|
code: 0,
|
||||||
num: 0
|
num: 0
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//python需要的数据
|
//python需要的数据
|
||||||
@@ -176,7 +188,8 @@ let pyData = ref({
|
|||||||
});
|
});
|
||||||
|
|
||||||
//按钮提交状态
|
//按钮提交状态
|
||||||
let submitting = ref(false);
|
let submitting = ref(true);
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
//从缓存获取数据
|
//从缓存获取数据
|
||||||
@@ -193,7 +206,6 @@ onMounted(() => {
|
|||||||
tkaccountuse(tkData.value[1].account, 1)
|
tkaccountuse(tkData.value[1].account, 1)
|
||||||
|
|
||||||
getIpInfo()
|
getIpInfo()
|
||||||
//查询次数查询
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -210,6 +222,22 @@ const getIpInfo = async () => {
|
|||||||
countryData.value = getCountryName(data.country);
|
countryData.value = getCountryName(data.country);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('请求出错:', error);
|
console.error('请求出错:', error);
|
||||||
|
ElMessageBox.prompt('请输入将要获取国家的中文名', '获取国家失败', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
showClose: false,
|
||||||
|
closeOnClickModal: false,
|
||||||
|
showCancelButton: false,
|
||||||
|
})
|
||||||
|
.then(({ value }) => {
|
||||||
|
countryData.value = value
|
||||||
|
})
|
||||||
|
// .catch(() => {
|
||||||
|
// ElMessage({
|
||||||
|
// type: 'info',
|
||||||
|
// message: 'Input canceled',
|
||||||
|
// })
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -217,12 +245,26 @@ const getIpInfo = async () => {
|
|||||||
const submit = () => {
|
const submit = () => {
|
||||||
pyData.value.country = countryData.value;
|
pyData.value.country = countryData.value;
|
||||||
console.log('提交的区间值:', pyData.value);
|
console.log('提交的区间值:', pyData.value);
|
||||||
if (tkData.value[0].account == '' || tkData.value[1].account == '') {
|
// if (tkData.value[0].account == '' && tkData.value[1].account == '') {
|
||||||
ElMessage.error('请输入账号密码');
|
// ElMessage.error('请输入账号密码');
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// if (tkData.value[0].password == '' && tkData.value[1].password == '') {
|
||||||
|
// ElMessage.error('请输入账号密码');
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
if (((Number(pyData.value.gold.min) > Number(pyData.value.gold.max)) || (Number(pyData.value.fans.min) > Number(pyData.value.fans.max)))) {
|
||||||
|
ElMessage.error('请输入正确的区间值');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tkData.value[0].password == '' || tkData.value[1].password == '') {
|
if ((Number(pyData.value.gold.max) <= 0 || Number(pyData.value.fans.max <= 0)) || pyData.value.gold.max == '' || pyData.value.fans.max == '') {
|
||||||
ElMessage.error('请输入账号密码');
|
ElMessage.error('请输入正确的区间值');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Number(pyData.value.frequency.hour) <= 0 || Number(pyData.value.frequency.day) <= 0 || pyData.value.frequency.hour == '' || pyData.value.frequency.day == '') {
|
||||||
|
ElMessage.error('请输入正确的频率区间值');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
@@ -250,14 +292,16 @@ const submit = () => {
|
|||||||
tenantId: getUser().tenantId,
|
tenantId: getUser().tenantId,
|
||||||
userId: getUser().userId,
|
userId: getUser().userId,
|
||||||
})).then((res) => {
|
})).then((res) => {
|
||||||
|
//开始计时器
|
||||||
|
startTimer();
|
||||||
|
//开启查询次数
|
||||||
getHostTimer.value = setInterval(() => {
|
getHostTimer.value = setInterval(() => {
|
||||||
fetchDataCount().then((res) => {
|
fetchDataCount().then((res) => {
|
||||||
hostData.value = JSON.parse(res);
|
hostData.value = JSON.parse(res);
|
||||||
tkaccountuse(tkData.value[0].account, 0)
|
tkaccountuse(tkData.value[0].account, 0)
|
||||||
tkaccountuse(tkData.value[1].account, 1)
|
tkaccountuse(tkData.value[1].account, 1)
|
||||||
})
|
})
|
||||||
}, 1000);
|
}, 5000);
|
||||||
|
|
||||||
|
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
@@ -287,6 +331,7 @@ const unsubmit = () => {
|
|||||||
tenantId: getUser().tenantId,
|
tenantId: getUser().tenantId,
|
||||||
userId: getUser().userId,
|
userId: getUser().userId,
|
||||||
})).then((res) => {
|
})).then((res) => {
|
||||||
|
pauseTimer();
|
||||||
pyData.value.isStart = true;
|
pyData.value.isStart = true;
|
||||||
clearInterval(getHostTimer.value);
|
clearInterval(getHostTimer.value);
|
||||||
getHostTimer.value = null;
|
getHostTimer.value = null;
|
||||||
@@ -312,10 +357,12 @@ const loginTK = (index) => {
|
|||||||
index: index
|
index: index
|
||||||
})
|
})
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
|
isLogin.value[1] = true;
|
||||||
statusTimer = setInterval(() => {
|
statusTimer = setInterval(() => {
|
||||||
getloginStatus();
|
getloginStatus();
|
||||||
}, 2000)
|
}, 2000)
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
|
isLogin.value[0] = true;
|
||||||
statusTimerCopy = setInterval(() => {
|
statusTimerCopy = setInterval(() => {
|
||||||
getloginStatusCopy();
|
getloginStatusCopy();
|
||||||
}, 2000)
|
}, 2000)
|
||||||
@@ -325,8 +372,8 @@ const loginTK = (index) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openTK = () => {
|
const openTK = () => {
|
||||||
isTk.value = true;
|
// isTk.value = true;
|
||||||
console.log(isTk.value)
|
// console.log(isTk.value)
|
||||||
loginTikTok();
|
loginTikTok();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -339,6 +386,8 @@ function getloginStatus() {
|
|||||||
if (data.code == 1) {
|
if (data.code == 1) {
|
||||||
clearInterval(statusTimer);
|
clearInterval(statusTimer);
|
||||||
statusTimer = null;
|
statusTimer = null;
|
||||||
|
submitting.value = false
|
||||||
|
isLogin.value[1] = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -350,6 +399,8 @@ function getloginStatusCopy() {
|
|||||||
if (data.code == 1) {
|
if (data.code == 1) {
|
||||||
clearInterval(statusTimer);
|
clearInterval(statusTimer);
|
||||||
statusTimer = null;
|
statusTimer = null;
|
||||||
|
submitting.value = false
|
||||||
|
isLogin.value[0] = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -357,13 +408,114 @@ function getloginStatusCopy() {
|
|||||||
|
|
||||||
function tkaccountuse(id, index) {
|
function tkaccountuse(id, index) {
|
||||||
let num = 0;
|
let num = 0;
|
||||||
tkaccountuseinfo({ userId: id }).then((res) => {
|
tkaccountuseinfo(id).then((res) => {
|
||||||
num = res
|
if (res) {
|
||||||
tkData.value[index].num = num
|
num = res
|
||||||
console.log('账号使用次数', tkData.value[index].num)
|
tkData.value[index].num = num
|
||||||
|
console.log('账号使用次数', tkData.value[index].num)
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log('账号使用次数', err)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 = Math.floor((Date.now() - startTimedata.value) / 1000);
|
||||||
|
}, 1000);
|
||||||
|
};
|
||||||
|
|
||||||
|
//结束运行 暂停
|
||||||
|
const pauseTimer = () => {
|
||||||
|
isRunning.value = false;
|
||||||
|
clearInterval(timerCrawl);
|
||||||
|
};
|
||||||
|
//清空时间
|
||||||
|
const resetTimer = () => {
|
||||||
|
isRunning.value = false;
|
||||||
|
clearInterval(timerCrawl);
|
||||||
|
totalSeconds.value = 0;
|
||||||
|
};
|
||||||
|
// 格式化时间为 HH:MM:SS
|
||||||
|
const formattedTime = computed(() => {
|
||||||
|
const hours = Math.floor(totalSeconds.value / 3600);
|
||||||
|
const minutes = Math.floor((totalSeconds.value % 3600) / 60);
|
||||||
|
const seconds = totalSeconds.value % 60;
|
||||||
|
|
||||||
|
return [
|
||||||
|
hours.toString().padStart(2, '0'),
|
||||||
|
minutes.toString().padStart(2, '0'),
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
@@ -398,7 +550,7 @@ function tkaccountuse(id, index) {
|
|||||||
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;
|
||||||
padding-top: 60px;
|
// padding-top: 60px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
div {
|
div {
|
||||||
@@ -498,7 +650,7 @@ label {
|
|||||||
.open-login {
|
.open-login {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 47px;
|
height: 47px;
|
||||||
background: #E7CA92;
|
background: @btn-bg-color;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
@@ -506,7 +658,7 @@ label {
|
|||||||
.reset-button {
|
.reset-button {
|
||||||
width: 132px;
|
width: 132px;
|
||||||
height: 47px;
|
height: 47px;
|
||||||
background: #E7CA92;
|
background: @btn-bg-color;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
||||||
font-family: Source Han Sans SC;
|
font-family: Source Han Sans SC;
|
||||||
@@ -520,7 +672,7 @@ label {
|
|||||||
.submit-button {
|
.submit-button {
|
||||||
width: 160px;
|
width: 160px;
|
||||||
height: 47px;
|
height: 47px;
|
||||||
background: #338F6A;
|
background: @bg-color;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -551,9 +703,9 @@ label {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="less">
|
||||||
::v-deep(.el-input-group__prepend) {
|
::v-deep(.el-input-group__prepend) {
|
||||||
background: #84CEB2;
|
background: @bg-color-light;
|
||||||
border-radius: 10px 0px 0px 10px;
|
border-radius: 10px 0px 0px 10px;
|
||||||
border: 1px solid #B7CEC5;
|
border: 1px solid #B7CEC5;
|
||||||
font-family: Source Han Sans SC;
|
font-family: Source Han Sans SC;
|
||||||
@@ -564,7 +716,7 @@ label {
|
|||||||
}
|
}
|
||||||
|
|
||||||
::v-deep(.el-input-group__append) {
|
::v-deep(.el-input-group__append) {
|
||||||
background: #84CEB2;
|
background: @bg-color-light;
|
||||||
border-radius: 0px 10px 10px 0px;
|
border-radius: 0px 10px 10px 0px;
|
||||||
border: 1px solid #B7CEC5;
|
border: 1px solid #B7CEC5;
|
||||||
font-family: Source Han Sans SC;
|
font-family: Source Han Sans SC;
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<Sidebar class="noneText" @activeIndex="activeIndexFn" />
|
<!-- <Sidebar class="noneText" @activeIndex="activeIndexFn" /> -->
|
||||||
<div class="content ">
|
<div class="content ">
|
||||||
<div v-show="activeIndex == 1">
|
<!-- <div v-show="activeIndexA == 1">
|
||||||
<workbenches v-if="openWerk" />
|
<workbenches />
|
||||||
</div>
|
</div> -->
|
||||||
<div v-show="activeIndex == 2">
|
<div>
|
||||||
<hostsList v-if="openList" />
|
<hostsList />
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div style="position: absolute; bottom: 0; right: 0;">{{ version }}</div> -->
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -15,32 +16,30 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import Sidebar from '../components/Sidebar.vue';
|
// import Sidebar from '../components/Sidebar.vue';
|
||||||
import { RouterLink, RouterView } from 'vue-router'
|
import { RouterLink, RouterView } from 'vue-router'
|
||||||
import hostsList from '@/views/hosts/hostsList.vue'
|
import hostsList from '@/views/hosts/hostsList.vue'
|
||||||
import workbenches from '@/views/hosts/workbenches.vue'
|
// import workbenches from '@/views/hosts/workbenches.vue'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { getUser } from '@/utils/storage'
|
import { getUser } from '@/utils/storage'
|
||||||
|
// import { usePythonBridge } from '@/utils/pythonBridge'
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function activeIndexFn(data) {
|
|
||||||
activeIndex.value = data
|
|
||||||
openWerk.value = true
|
|
||||||
openList.value = true
|
// let activeIndexA = ref(1)
|
||||||
console.log(data)
|
|
||||||
}
|
// function activeIndexFn(data) {
|
||||||
|
// activeIndexA.value = data
|
||||||
|
// console.log(data)
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="less">
|
||||||
body,
|
body,
|
||||||
html {
|
html {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -52,7 +51,8 @@ html {
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: 1600px;
|
width: 1600px;
|
||||||
height: 900px;
|
height: 900px;
|
||||||
background-color: #338F6A;
|
background-color: @bg-color;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -67,14 +67,16 @@ html {
|
|||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
background-color: #338F6A;
|
background-color: @bg-color;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
/* box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); */
|
/* box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); */
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
margin-left: 280px;
|
// margin-left: 280px;
|
||||||
width: 1304px;
|
margin-left: 25px;
|
||||||
|
margin-right: 25px;
|
||||||
|
width: 1540px;
|
||||||
height: 868px;
|
height: 868px;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 36px;
|
border-radius: 36px;
|
||||||
|
|||||||
BIN
tk-page.rar
@@ -18,6 +18,9 @@ module.exports = defineConfig({
|
|||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
less: {
|
||||||
|
additionalData: `@import "@/static/css/app.less";` // 注入全局变量文件
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||