版本号更新

This commit is contained in:
2025-05-06 15:38:23 +08:00
parent 5e34aaf402
commit 60f6fc4873
10 changed files with 139 additions and 19 deletions

BIN
dist.rar

Binary file not shown.

View File

@@ -38,6 +38,8 @@ export default {
this.inputTime = this.time
this.getTkhostdetail();
console.log(this.time)
console.log(this.getPrevious7Days(this.inputTime))
},

View File

@@ -45,6 +45,8 @@ import { ref, reactive, onMounted } from 'vue';
import { getUser } from '@/utils/storage'
import { defineEmits } from 'vue';
const userInfo = ref(getUser())
let activeIndex = ref(userInfo.value.userType == 3 ? 1 : 2);

View File

@@ -6,6 +6,9 @@ import axios from 'axios'
import { getToken, getUser } from '@/utils/storage'
import { useRouter } from 'vue-router';
import { ElMessage } from 'element-plus';
import { usePythonBridge, } from '@/utils/pythonBridge'
const { stopScript } = usePythonBridge();
const router = useRouter();
@@ -13,8 +16,9 @@ const router = useRouter();
let baseURL = ''
if (process.env.NODE_ENV === 'development') {
// 生产环境
baseURL = "http://api.tkpage.vvtiktok.cn"
// baseURL = "http://192.168.0.116:8085/"
// baseURL = "http://api.tkpage.vvtiktok.cn"
baseURL = "http://120.26.251.180:8085/"
// baseURL = "http://192.168.0.113:8085/"
} else {
// 开发环境
baseURL = "http://api.tkpage.vvtiktok.cn"
@@ -90,7 +94,10 @@ export function postAxios({ url, data }) {
reject('网络连接错误')
} else {
ElMessage.error(err.message);
if (err.response.data.message) {
ElMessage.error(err.response.data.message);
}
reject(err.message)
}
@@ -146,6 +153,7 @@ function cheekalive() {
if (res.data) {
} else {
stopScript();
alert("账号在其他地方登录!")
window.location.href = '/';
}

View File

@@ -99,8 +99,23 @@ export function usePythonBridge() {
}
};
const stopScript = () => {
if (bridge.value) {
bridge.value.stopScript();
}
};
//获取版本号
const getVersion = () => {
return new Promise((resolve, reject) => {
if (bridge.value) {
bridge.value.currentVersion(function (result) {
resolve(result);
});
}
});
};
// 在组件挂载时初始化桥接
onMounted(initBridge);
@@ -112,6 +127,8 @@ export function usePythonBridge() {
givePyAnchorId,
backStageloginStatus,
backStageloginStatusCopy,
exportToExcel
exportToExcel,
stopScript,
getVersion
};
}

View File

@@ -42,4 +42,13 @@ export function setTkUser(userdata) {
// 用于获取tk账户密码
export function getTkUser() {
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'));
}

View File

@@ -53,12 +53,16 @@
<div class="from-input-item">
<el-button class="loginButton" color="#8f7ee7" type="primary"
@click="onSubmit">登录</el-button>
</div>
</el-form>
</div>
</div>
</div>
<div class="version center-justify ">版本号{{ version }}</div>
</div>
</div>
</div>
</template>
@@ -69,6 +73,20 @@ import { useRouter } from 'vue-router';
import { login } from '@/api/account';
import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/utils/storage';
import { ElLoading } from 'element-plus';
import { usePythonBridge } from '@/utils/pythonBridge'
const { getVersion } = usePythonBridge();
let version = ref('0.0.0');
onMounted(() => {
setTimeout(() => {
getVersion().then((res) => {
version.value = res;
})
}, 500);
})
const router = useRouter();
@@ -78,6 +96,7 @@ const formData = ref({
});
const onSubmit = () => {
const loading = ElLoading.service({
lock: true,
@@ -88,6 +107,7 @@ const onSubmit = () => {
login({
userId: formData.value.userId,
password: formData.value.password,
source: 'app'
}).then((res) => {
loading.close();
console.log(res)
@@ -101,7 +121,7 @@ const onSubmit = () => {
}
} else {
alert('账号或密码错误');
// alert('账号或密码错误');
}
}).catch((err) => {
@@ -141,6 +161,18 @@ const onSubmit = () => {
overflow: hidden;
/* 防止内容溢出 */
.version {
color: #fff;
position: absolute;
font-size: 20px;
bottom: 20px;
left: calc(50% - 50px);
// box-sizing: border-box;
// width: 1600px;
}
.background-video {
position: absolute;
top: 0;

View File

@@ -46,7 +46,7 @@
<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="searchForm.time"></component>
:time="scope.row.createDt.split('T')[0].replace(/-/g, '').substring(0, 8)"></component>
</div>
<template #reference>
<span @mouseover="openPopover(scope.row.hostId, label.paramCode)"
@@ -60,7 +60,7 @@
<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="searchForm.time">
:time="scope.row.createDt.split('T')[0].replace(/-/g, '').substring(0, 8)">
</component>
</div>
<template #reference>
@@ -138,7 +138,7 @@
</el-dialog>
<el-dialog v-model="filterdialogVisible" width="800px">
<el-dialog v-model="filterdialogVisible" width="800px" :before-close="handleClose">
<el-row :gutter="20">
<el-col :span="8">
<label>选择筛选条件</label>
@@ -169,7 +169,7 @@
<template #footer>
<span class="dialog-footer">
<!-- <el-button @click="filterdialogVisible = false">取消</el-button> -->
<el-button type="primary" @click="filterdialogVisible = false">
<el-button type="primary" @click="handelClick">
确认
</el-button>
</span>
@@ -185,7 +185,7 @@
// import { getToken, setToken, removeToken } from '@/utils/storage'
import { tkhostdata, dicts, tkhostdetail, downList, getStaffList, managerhosts, upholdinfo, getCountryinfo } from '@/api/account';
import { usePythonBridge, } from '@/utils/pythonBridge'
import { getUser } from '@/utils/storage'
import { getUser, setSerch, getSerch } from '@/utils/storage'
import { ref, reactive, onMounted } from 'vue';
import EChartsComponent from '@/components/EChartsComponent.vue';
import { ElMessage, ElMessageBox } from 'element-plus'
@@ -205,7 +205,8 @@ const tableData = ref([])
//选择国家
const searchForm = ref({
country: '',
time: new Date().toISOString().split('T')[0].replace(/-/g, ''),
// time: new Date().toISOString().split('T')[0].replace(/-/g, ''),
time: '',
dataType: '',
dataStart: '',
dataEnd: '',
@@ -240,14 +241,17 @@ const isPopoverVisible = reactive({})
let options = ref([])
onMounted(() => {
//获取字典
getdictionary()
//获取下级员工
getStaff();
//获取国家
getCountry();
let version = ref('0.0.0');
onMounted(() => {
getdictionary()//获取字典
getStaff(); //获取下级员工
getCountry(); //获取国家
getSerchStorage();//获取搜索条件
getlist();//获取主播列表
})
@@ -347,7 +351,29 @@ const getlist = () => {
})
}
function handelClick() {
setSerch({ dataType: searchForm.value.dataType, dataStart: searchForm.value.dataStart, dataEnd: searchForm.value.dataEnd })
filterdialogVisible.value = false
}
function handleClose(done) {
console.log('关闭')
searchForm.value = {
dataType: '',
dataStart: '',
dataEnd: '',
}
done()
}
function getSerchStorage() {
if (getSerch()) {
searchForm.value.dataType = getSerch().dataType
searchForm.value.dataStart = getSerch().dataStart
searchForm.value.dataEnd = getSerch().dataEnd
}
}
function openComment(data) {
console.log(data)
commentInfo.value = data.comment

View File

@@ -55,7 +55,7 @@
<!-- <el-button class="reset-button" @click="reset">重置数据</el-button> -->
</div>
</div>
</template>n
</template>
<el-row :gutter="20">
<el-col :span="8">
<div class="input-group">
@@ -211,6 +211,22 @@ const getIpInfo = async () => {
countryData.value = getCountryName(data.country);
} catch (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',
// })
// })
}
};

View File

@@ -8,6 +8,7 @@
<div v-show="activeIndex == 2">
<hostsList v-if="openList" />
</div>
<div style="position: absolute; bottom: 0; right: 0;">{{ version }}</div>
</div>
@@ -21,6 +22,12 @@ import hostsList from '@/views/hosts/hostsList.vue'
import workbenches from '@/views/hosts/workbenches.vue'
import { ref } from 'vue'
import { getUser } from '@/utils/storage'
// import { usePythonBridge } from '@/utils/pythonBridge'
let userType = ref(getUser().userType)
let activeIndex = ref(userType.value == 3 ? 1 : 2)
@@ -53,6 +60,7 @@ html {
width: 1600px;
height: 900px;
background-color: #338F6A;
position: relative;
}