diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 9938c08..1b7b5b0 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -29,10 +29,15 @@ export default { path: "/upgradation", name: "上传Apk", }, + { + path: "/upgradationOta", + name: "上传Ota", + }, { path: "/activity", name: "活动列表", }, + // { // path: "/userlist", // name: "用户列表", diff --git a/src/router/index.js b/src/router/index.js index 62f8ecc..0ddeae9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -50,6 +50,15 @@ const routes = [ keepAlive: true, }, }, + { + path: "/upgradationOta", + component: () => import("../views/upgradationOta/index.vue"), + name: "upgradationOta", + meta: { + title: "上传Ota", + keepAlive: true, + }, + }, { path: "/activity", component: () => import("../views/activityList/index.vue"), diff --git a/src/views/homePage/components/tableMain.vue b/src/views/homePage/components/tableMain.vue index 9391cdc..042abc6 100644 --- a/src/views/homePage/components/tableMain.vue +++ b/src/views/homePage/components/tableMain.vue @@ -785,6 +785,44 @@ 取 消 确 定 + + + + + + + + {{ item.fileName }} + ({{ item.title }}{{ item.createTime }}) + + + + + { console.log(res); - this.upOptions = res.data; + this.upOptions = res.data.filter(item => item.type === "0"); }) .catch((err) => {}); }, + //获取Ota升级apkList + getUpgradeOtaList() { + getqueryUpgradesApi() + .then((res) => { + console.log(res); + this.upOptionsOta = res.data.filter(item => item.type === "1"); + }) + .catch((err) => {}); + }, + selectChanged(val) { console.log(val); // 找到选中项的整个object对象 @@ -1669,6 +1737,14 @@ export default { }); console.log(this.selectUpObj); }, + selectChangedOta(val) { + console.log(val); + // 找到选中项的整个object对象 + this.selectUpObjOta = this.upOptionsOta.find((item) => { + return item["path"] === val; + }); + console.log(this.selectUpObj); + }, //升级确定阿 handleupgradation() { this.$refs.upgradationRuleForm.validate((valid) => { @@ -1684,6 +1760,22 @@ export default { this.upgradationVisible = false; } }); + }, + //升级OTa确定阿 + handleupgradationOta() { + this.$refs.upgradationRuleFormOta.validate((valid) => { + if (valid) { + var params = { + act: "upd-ota", + url: this.upgradationformOta.upVal, + md5: this.selectUpObjOta.md5, + fn: this.selectUpObjOta.fileName, + termIds: this.idArray.join("-"), + }; + this.changeIssue(params); + this.upgradationVisibleOta = false; + } + }); }, //点击模板 handleModelForm() { diff --git a/src/views/report/index.vue b/src/views/report/index.vue index c4464f6..1357dd7 100644 --- a/src/views/report/index.vue +++ b/src/views/report/index.vue @@ -179,6 +179,7 @@ export default { i1_cmd_set_i1_heart_beat_time: "设置心跳周期", yw_cmd_upload_i1_zip_log: "上传日志", upgrade: "升级", + updOta: "Ota升级", yw_cmd_start_frpc: "开启frpc", yw_cmd_stop_frpc: "停止frpc", i1_cmd_stop_aging_test: "停止老化测试", @@ -197,6 +198,7 @@ export default { { id: 5, name: "设置心跳周期" }, { id: 6, name: "上传日志" }, { id: 7, name: "升级" }, + { id: 11, name: "OTA升级" }, { id: 8, name: "开启frpc" }, { id: 9, name: "停止frpc" }, { id: 10, name: "停止老化测试" }, @@ -371,6 +373,11 @@ export default { (item) => item.cmdName == "i1_cmd_stop_aging_test" ); return; + case 11: + this.leftCommand = this.runCommand.filter( + (item) => item.cmdName == "updOta" + ); + return; } }, leftInputChange() { @@ -439,6 +446,11 @@ export default { (item) => item.cmdName == "i1_cmd_stop_aging_test" ); return; + case 11: + this.leftCommand = this.runCommand.filter( + (item) => item.cmdName == "updOta" + ); + return; } }, rightInputChange() { diff --git a/src/views/upgradation/index.vue b/src/views/upgradation/index.vue index 88a1161..2732da9 100644 --- a/src/views/upgradation/index.vue +++ b/src/views/upgradation/index.vue @@ -77,6 +77,11 @@ > + + + @@ -139,6 +144,7 @@ export default { fileList: [], reportData: { title: "", + upgradeType:0, }, fileData: [], //数据列表 fileloading: false, @@ -157,6 +163,16 @@ export default { progressLoading: false, }; }, + filters: { + changeType(val) { + if (val == "0") return "0B"; + var k = 1024; + var sizes = ["B", "KB", "MB", "GB", "TB"]; + + let i = Math.floor(Math.log(val) / Math.log(k)); //得出该数字的单位应该是kB?MB + return (val / Math.pow(k, i)).toPrecision(3) + "" + sizes[i]; + }, + }, computed: {}, mounted() { this.getUpgradeList(); @@ -194,6 +210,7 @@ export default { }, //点击升级确定 beforeAvatarUpload(file) { + console.log(this.reportData.title); console.log(this.reportData.title); console.log(file); }, @@ -220,7 +237,7 @@ export default { getqueryUpgradesApi() .then((res) => { console.log(res); - this.fileData = res.data; + this.fileData = res.data.filter(item => item.type === "0"); this.fileloading = false; }) .catch((err) => {}); diff --git a/src/views/upgradationOta/index.vue b/src/views/upgradationOta/index.vue new file mode 100644 index 0000000..ce82335 --- /dev/null +++ b/src/views/upgradationOta/index.vue @@ -0,0 +1,413 @@ + + + diff --git a/vue.config.js b/vue.config.js index 3ebd2bd..103aa27 100644 --- a/vue.config.js +++ b/vue.config.js @@ -20,7 +20,7 @@ module.exports = defineConfig({ proxy: { "/api": { //表示拦截以/api开头的请求路径 - target: "http://180.166.218.222:40101/", // + target: "http://61.169.135.146:40101/", // changOrigin: true, //是否开启跨域 pathRewrite: { "^/api": "/api", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的