diff --git a/public/bg.mp4 b/public/bg.mp4 new file mode 100644 index 0000000..96c4f6e Binary files /dev/null and b/public/bg.mp4 differ diff --git a/public/index.html b/public/index.html index 0b595c3..90764e7 100644 --- a/public/index.html +++ b/public/index.html @@ -24,6 +24,8 @@ body { margin: 0; padding: 0; + width: 1600px; + height: 900px; } diff --git a/src/assets/index.png b/src/assets/index.png new file mode 100644 index 0000000..9911934 Binary files /dev/null and b/src/assets/index.png differ diff --git a/src/assets/list.png b/src/assets/list.png new file mode 100644 index 0000000..35cdece Binary files /dev/null and b/src/assets/list.png differ diff --git a/src/assets/listAction.png b/src/assets/listAction.png new file mode 100644 index 0000000..7af1eac Binary files /dev/null and b/src/assets/listAction.png differ diff --git a/src/assets/logo.png b/src/assets/logo.png index f3d2503..5f72e2b 100644 Binary files a/src/assets/logo.png and b/src/assets/logo.png differ diff --git a/src/assets/logotext.png b/src/assets/logotext.png new file mode 100644 index 0000000..eafd6cd Binary files /dev/null and b/src/assets/logotext.png differ diff --git a/src/assets/navAction.png b/src/assets/navAction.png new file mode 100644 index 0000000..368ad6b Binary files /dev/null and b/src/assets/navAction.png differ diff --git a/src/assets/password.png b/src/assets/password.png new file mode 100644 index 0000000..25ba67d Binary files /dev/null and b/src/assets/password.png differ diff --git a/src/assets/username.png b/src/assets/username.png new file mode 100644 index 0000000..cdab952 Binary files /dev/null and b/src/assets/username.png differ diff --git a/src/assets/video/bg.mp4 b/src/assets/video/bg.mp4 new file mode 100644 index 0000000..96c4f6e Binary files /dev/null and b/src/assets/video/bg.mp4 differ diff --git a/src/assets/work.png b/src/assets/work.png new file mode 100644 index 0000000..2136c3e Binary files /dev/null and b/src/assets/work.png differ diff --git a/src/assets/workAction.png b/src/assets/workAction.png new file mode 100644 index 0000000..a510944 Binary files /dev/null and b/src/assets/workAction.png differ diff --git a/src/assets/worklogo.png b/src/assets/worklogo.png new file mode 100644 index 0000000..4536c9a Binary files /dev/null and b/src/assets/worklogo.png differ diff --git a/src/components/EChartsComponent.vue b/src/components/EChartsComponent.vue index a4cb9df..44e5211 100644 --- a/src/components/EChartsComponent.vue +++ b/src/components/EChartsComponent.vue @@ -23,12 +23,24 @@ export default { } }, + data() { + return { + seriesData: [], + num: 0 + } + }, mounted() { - this.initChart(); + + this.getTkhostdetail(); + }, methods: { initChart() { + if (!this.$refs.chart) { + console.error('DOM element not found'); + return; + } const myChart = echarts.init(this.$refs.chart); const option = { title: { @@ -36,17 +48,17 @@ export default { }, tooltip: {}, legend: { - data: ['销量'] + data: [this.title] }, xAxis: { - data: ['2025-03-29', '2025-03-30', '2025-03-31', '2025-04-01', '2025-04-02', '2025-04-03'] + 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)] }, yAxis: {}, series: [ { - name: '金币数', + name: this.title, type: 'line', - data: [23266, 12144, 44467, 86686, 35637, 34534], + data: [this.seriesData[0], this.seriesData[1], this.seriesData[2], this.seriesData[3], this.seriesData[4], this.seriesData[5], this.seriesData[6]], smooth: true } @@ -61,7 +73,33 @@ export default { searchTimeStart: this.getCurrentDate()[0], searchTimeEnd: this.getCurrentDate()[6] }).then(res => { - res[0] + // console.log("返回数据", res[0][this.getCurrentDate()[2]]) + //echarts 数据初始化 + this.seriesData = [ + res[0][this.getCurrentDate()[0]] == null ? 0 : Number(res[0][this.getCurrentDate()[0]][this.dataType]), + res[0][this.getCurrentDate()[1]] == null ? 0 : Number(res[0][this.getCurrentDate()[1]][this.dataType]), + res[0][this.getCurrentDate()[2]] == null ? 0 : Number(res[0][this.getCurrentDate()[2]][this.dataType]), + res[0][this.getCurrentDate()[3]] == null ? 0 : Number(res[0][this.getCurrentDate()[3]][this.dataType]), + res[0][this.getCurrentDate()[4]] == null ? 0 : Number(res[0][this.getCurrentDate()[4]][this.dataType]), + res[0][this.getCurrentDate()[5]] == null ? 0 : Number(res[0][this.getCurrentDate()[5]][this.dataType]), + res[0][this.getCurrentDate()[6]] == null ? 0 : Number(res[0][this.getCurrentDate()[6]][this.dataType]), + ] + + // this.seriesData = { + // [this.getCurrentDate()[0]]: res[0][this.getCurrentDate()[0]] == null ? 0 : res[0][this.getCurrentDate()[0]][this.dataType], + // [this.getCurrentDate()[1]]: res[0][this.getCurrentDate()[1]] == null ? 0 : res[0][this.getCurrentDate()[1]][this.dataType], + // [this.getCurrentDate()[2]]: res[0][this.getCurrentDate()[2]] == null ? 0 : res[0][this.getCurrentDate()[2]][this.dataType], + // [this.getCurrentDate()[3]]: res[0][this.getCurrentDate()[3]] == null ? 0 : res[0][this.getCurrentDate()[3]][this.dataType], + // [this.getCurrentDate()[4]]: res[0][this.getCurrentDate()[4]] == null ? 0 : res[0][this.getCurrentDate()[4]][this.dataType], + // [this.getCurrentDate()[5]]: res[0][this.getCurrentDate()[5]] == null ? 0 : res[0][this.getCurrentDate()[5]][this.dataType], + // [this.getCurrentDate()[6]]: res[0][this.getCurrentDate()[6]] == null ? 0 : res[0][this.getCurrentDate()[6]][this.dataType], + // } + + this.initChart(); + this.num++ + console.log("返回数据", this.seriesData) + console.log("返回数据", this.num) + }) }, diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 3d5eb63..59bfd2f 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -1,48 +1,120 @@ + + \ No newline at end of file diff --git a/src/utils/axios.js b/src/utils/axios.js index 925c772..7df0b93 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -14,7 +14,8 @@ let baseURL = '' console.log(process.env.NODE_ENV) if (process.env.NODE_ENV === 'development') { // 生产环境 - baseURL = "http://192.168.0.119:8080/api/" + baseURL = "http://120.26.251.180:8085/api/" + // baseURL = "http://192.168.0.100:8085/api/" } else { // 开发环境 baseURL = "" @@ -115,8 +116,12 @@ export function postAxios({ url, data }) { if (err.message == "Network Error") { // alert("网络错误,请检查网络连接") ElMessage.error('网络连接错误'); + reject('网络连接错误') + } else { ElMessage.error(err.message); + reject(err.message) + } // console.log(err) // reject(err) diff --git a/src/utils/countryUtil.js b/src/utils/countryUtil.js new file mode 100644 index 0000000..0ce1e7f --- /dev/null +++ b/src/utils/countryUtil.js @@ -0,0 +1,261 @@ +// country-utils.js +export const CountryCode = { + AD: "安道尔", + AE: "阿拉伯联合酋长国", + AF: "阿富汗", + AG: "安提瓜和巴布达", + AI: "安圭拉", + AL: "阿尔巴尼亚", + AM: "亚美尼亚", + AO: "安哥拉", + AQ: "南极洲", + AR: "阿根廷", + AS: "美属萨摩亚", + AT: "奥地利", + AU: "澳大利亚", + AU1: "澳大利亚", + AW: "阿鲁巴", + AX: "奥兰群岛", + AZ: "阿塞拜疆", + BA: "波斯尼亚和黑塞哥维那", + BB: "巴巴多斯", + BD: "孟加拉国", + BE: "比利时", + BF: "布基纳法索", + BG: "保加利亚", + BH: "巴林", + BI: "布隆迪", + BJ: "贝宁", + BL: "圣巴泰勒米", + BM: "百慕大群岛", + BN: "文莱达鲁萨兰国", + BO: "玻利维亚", + BQ: "博奈尔、圣尤斯特歇斯和萨巴", + BR: "巴西", + BS: "巴哈马", + BT: "不丹", + BV: "布韦岛", + BW: "博茨瓦纳", + BY: "白俄罗斯", + BZ: "伯利兹", + CA: "加拿大", + CA1: "加拿大", + CC: "科科斯(基林)群岛", + CD: "刚果民主共和国", + CF: "中非共和国", + CG: "刚果共和国", + CH: "瑞士", + CI: "科特迪瓦", + CK: "库克群岛", + CL: "智利", + CM: "喀麦隆", + CN: "中国", + CO: "哥伦比亚", + CR: "哥斯达黎加", + CU: "古巴", + CV: "佛得角", + CW: "库拉索", + CX: "圣诞岛", + CY: "塞浦路斯", + CZ: "捷克共和国", + DE: "德国", + DG: "迪戈加西亚岛", + DJ: "吉布提", + DK: "丹麦", + DM: "多米尼克", + DO: "多米尼加共和国", + DZ: "阿尔及利亚", + EC: "厄瓜多尔", + EE: "爱沙尼亚", + EG: "埃及", + EH: "西撒哈拉", + ER: "厄立特里亚", + ES: "西班牙", + ET: "埃塞俄比亚", + FI: "芬兰", + FJ: "斐济", + FK: "福克兰群岛", + FM: "密克罗尼西亚", + FO: "法罗群岛", + FR: "法国", + GA: "加蓬", + GB: "英国", + GD: "格林纳达", + GE: "格鲁吉亚", + GF: "法属圭亚那", + GG: "根西岛", + GH: "加纳", + GI: "直布罗陀", + GL: "格陵兰", + GM: "冈比亚", + GN: "几内亚", + GP: "瓜德罗普", + GQ: "赤道几内亚", + GR: "希腊", + GS: "南乔治亚和南桑德威奇群岛", + GT: "危地马拉", + GU: "关岛", + GW: "几内亚比绍", + GY: "圭亚那", + HK: "中国香港特别行政区", + HM: "赫德岛和麦克唐纳群岛", + HN: "洪都拉斯", + HR: "克罗地亚", + HT: "海地", + HU: "匈牙利", + ID: "印度尼西亚", + IE: "爱尔兰", + IL: "以色列", + IM: "马恩岛", + IN: "印度", + IO: "英属印度洋领地", + IQ: "伊拉克", + IR: "伊朗", + IS: "冰岛", + IT: "意大利", + JE: "泽西岛", + JM: "牙买加", + JO: "约旦", + JP: "日本", + JP1: "日本", + KE: "肯尼亚", + KG: "吉尔吉斯斯坦", + KH: "柬埔寨", + KI: "基里巴斯", + KM: "科摩罗", + KN: "圣基茨和尼维斯", + KP: "朝鲜", + KR: "韩国", + KR1: "韩国", + KR1_UXWAUDIT: "韩国", + KW: "科威特", + KY: "开曼群岛", + KZ: "哈萨克斯坦", + LA: "老挝", + LB: "黎巴嫩", + LC: "圣卢西亚", + LI: "列支敦士登", + LK: "斯里兰卡", + LR: "利比里亚", + LS: "莱索托", + LT: "立陶宛", + LU: "卢森堡", + LV: "拉脱维亚", + LY: "利比亚", + MA: "摩洛哥", + MC: "摩纳哥", + MD: "摩尔多瓦", + ME: "黑山", + MF: "圣马丁", + MG: "马达加斯加", + MH: "马绍尔群岛", + MK: "北马其顿", + ML: "马里", + MM: "缅甸", + MN: "蒙古", + MO: "中国澳门特别行政区", + MP: "北马里亚纳群岛", + MQ: "马提尼克", + MR: "毛里塔尼亚", + MS: "蒙特塞拉特", + MT: "马耳他", + MU: "毛里求斯", + MV: "马尔代夫", + MW: "马拉维", + MX: "墨西哥", + MY: "马来西亚", + MZ: "莫桑比克", + NA: "纳米比亚", + NC: "新喀里多尼亚", + NE: "尼日尔", + NF: "诺福克岛", + NG: "尼日利亚", + NI: "尼加拉瓜", + NL: "荷兰", + NO: "挪威", + NP: "尼泊尔", + NR: "瑙鲁", + NU: "纽埃", + NZ: "新西兰", + OM: "阿曼", + PA: "巴拿马", + PE: "秘鲁", + PF: "法属玻利尼西亚", + PG: "巴布亚新几内亚", + PH: "菲律宾", + PK: "巴基斯坦", + PL: "波兰", + PM: "圣皮埃尔和密克隆群岛", + PN: "皮特凯恩群岛", + PR: "波多黎各", + PS: "巴勒斯坦", + PT: "葡萄牙", + PW: "帕劳", + PY: "巴拉圭", + QA: "卡塔尔", + RE: "留尼汪", + RO: "罗马尼亚", + RS: "塞尔维亚", + RU: "俄罗斯", + RW: "卢旺达", + SA: "沙特阿拉伯", + SB: "索罗门群岛", + SC: "塞舌尔", + SD: "苏丹", + SE: "瑞典", + SG: "新加坡", + SI: "斯洛文尼亚", + SJ: "斯瓦尔巴和扬马延", + SK: "斯洛伐克", + SL: "塞拉利昂", + SM: "圣马利诺", + SN: "塞内加尔", + SO: "索马里", + SR: "苏里南", + SS: "南苏丹", + ST: "圣多美和普林西比", + SV: "萨尔瓦多", + SX: "荷属圣马丁", + SY: "叙利亚", + SZ: "斯威士兰", + TC: "特克斯和凯科斯群岛", + TD: "乍得", + TF: "法属南部领地", + TG: "多哥", + TH: "泰国", + TJ: "塔吉克斯坦", + TK: "托克劳群岛", + TL: "东帝汶", + TM: "土库曼斯坦", + TN: "突尼斯", + TO: "汤加", + TR: "土耳其", + TT: "特立尼达和多巴哥", + TV: "图瓦卢", + TW: "台湾", + TZ: "坦桑尼亚", + UA: "乌克兰", + UG: "乌干达", + UM: "美国本土外小岛屿", + US: "美国", + UY: "乌拉圭", + UZ: "乌兹别克斯坦", + VA: "梵蒂冈", + VC: "圣文森特", + VE: "委内瑞拉", + VG: "英属维尔京群岛", + VI: "美属维尔京群岛", + VN: "越南", + VN1: "越南", + VU: "瓦努阿图", + WS: "萨摩亚", + YE: "也门", + YT: "马约特岛", + ZA: "南非", + ZM: "赞比亚", + ZW: "津巴布韦" +}; + +export function getCountryName(code) { + return CountryCode[code] || null; +} \ No newline at end of file diff --git a/src/utils/pythonBridge.js b/src/utils/pythonBridge.js index 3e8aef5..a6ae624 100644 --- a/src/utils/pythonBridge.js +++ b/src/utils/pythonBridge.js @@ -14,31 +14,70 @@ export function usePythonBridge() { // 调用 Python 方法 const fetchDataConfig = (data) => { return new Promise((resolve, reject) => { - if (!bridge.value) { - reject(new Error('返回出错,请检查是否已连接到 Python')); - return; + if (bridge.value) { + bridge.value.fetchDataConfig(data, function (result) { + resolve(result); + }); } - bridge.value.fetchDataConfig(data, function (result) { - resolve(result); - }); + }); }; - // 从 Python 获取数据 - const getPythonData = (data) => { + // 查询获取主播的数据 + const fetchDataCount = () => { + return new Promise((resolve, reject) => { + if (bridge.value) { + bridge.value.fetchDataCount(function (result) { + resolve(result); + }); + } + }); + }; + + // 打开tk后台 + const loginTikTok = () => { if (bridge.value) { - bridge.value.stringToJs(data, function (result) { - alert(result); + bridge.value.loginTikTok(function (result) { + + }); + } + + }; + + // 登录tk后台 + const loginBackStage = (data) => { + return new Promise((resolve, reject) => { + if (bridge.value) { + bridge.value.loginBackStage(data, function (result) { + if (result) { + resolve(result); + } else { + reject(result); + } + + }); + } + }); + }; + + //跳转到主播页面 + const givePyAnchorId = (id) => { + + if (bridge.value) { + bridge.value.givePyAnchorId(id, function (result) { + }); } }; - // 在组件挂载时初始化桥接 onMounted(initBridge); return { fetchDataConfig, - getPythonData + fetchDataCount, + loginBackStage, + loginTikTok, + givePyAnchorId }; } \ No newline at end of file diff --git a/src/utils/storage.js b/src/utils/storage.js index 972cb5a..8e3f1af 100644 --- a/src/utils/storage.js +++ b/src/utils/storage.js @@ -24,4 +24,11 @@ export function setNumData(numData) { } export function getNumData() { return JSON.parse(localStorage.getItem('num')); +} + +export function setUserPass(userdata) { + localStorage.setItem('userPass', JSON.stringify(userdata)); +} +export function getUserPass() { + return JSON.parse(localStorage.getItem('userPass')); } \ No newline at end of file diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index f1c9b48..31c78df 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1,15 +1,13 @@ @@ -82,65 +72,72 @@ import { ref, reactive, onMounted } from 'vue'; import { useRouter } from 'vue-router'; import { login } from '@/api/account'; -import { getToken, setToken, setUser } from '@/utils/storage' +import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/utils/storage'; +import { ElLoading } from 'element-plus'; const router = useRouter(); -// import { usePythonBridge } from '@/utils/pythonBridge'; - -// let inputValue = ref('999'); -// const output = ref(''); -// const { callPython, getPythonData } = usePythonBridge(); - - - const formData = ref({ - userId: '', - password: '', -}) - + userId: getUserPass() == null ? '' : getUserPass().userId, + password: getUserPass() == null ? '' : getUserPass().password, +}); const onSubmit = () => { - console.log('submit!') + const loading = ElLoading.service({ + lock: true, + text: 'Loading', + background: 'rgba(0, 0, 0, 0.7)', + }); + console.log('submit!'); + setUserPass(formData.value); login({ userId: formData.value.userId, password: formData.value.password, - }).then(res => { - console.log(res) - setToken(res.currcode) - setUser(res) + }).then((res) => { + loading.close(); + setToken(res.currcode); + setUser(res); router.push('/nav'); - - }) - - -} - + }).catch((err) => { + loading.close(); + }); +}; + + \ No newline at end of file diff --git a/src/views/hosts/hostsList.vue b/src/views/hosts/hostsList.vue index 7119deb..a347b09 100644 --- a/src/views/hosts/hostsList.vue +++ b/src/views/hosts/hostsList.vue @@ -9,13 +9,22 @@ - 查询 + 查询
- - - + + + + + + + @@ -27,8 +36,8 @@ :title="label.paramCodeMeaning" :id="scope.row.hostId" :dataType="label.paramCode">
@@ -41,7 +50,8 @@ @@ -49,13 +59,13 @@ - +
@@ -67,11 +77,15 @@ + + \ No newline at end of file diff --git a/src/views/hosts/workbenches.vue b/src/views/hosts/workbenches.vue index c791b33..7392277 100644 --- a/src/views/hosts/workbenches.vue +++ b/src/views/hosts/workbenches.vue @@ -1,98 +1,270 @@ - + + + \ No newline at end of file diff --git a/src/views/nav.vue b/src/views/nav.vue index ce34458..b3d3902 100644 --- a/src/views/nav.vue +++ b/src/views/nav.vue @@ -1,7 +1,7 @@