diff --git a/dash/package.json b/dash/package.json index 4629d2f..62e652a 100644 --- a/dash/package.json +++ b/dash/package.json @@ -34,7 +34,9 @@ "plugin:vue/essential", "eslint:recommended" ], - "rules": {}, + "rules": { + "no-console": "off" + }, "parserOptions": { "parser": "babel-eslint" } @@ -48,4 +50,4 @@ "> 1%", "last 2 versions" ] -} +} \ No newline at end of file diff --git a/dash/src/components/Cards.vue b/dash/src/components/Cards.vue index 165e810..3cd1313 100644 --- a/dash/src/components/Cards.vue +++ b/dash/src/components/Cards.vue @@ -58,6 +58,7 @@ export default { this.cardtext = text; this.switchbtn(btn); this.step = step; + console.log(step) }, switchbtn: function (mode) { if (mode == 1) { @@ -117,27 +118,18 @@ export default { } else { if (this.product > 2073600) { res = this.res; - newproduct = 0; + newproduct = res[0]*res[1]; ratio = res[0] / res[1]; if (res[0] % 4 != 0) { res[0] = res[0] - 2; - while (newproduct <= 2073600) { - res[0] = res[0] - 4; - res[1] = Math.round(res[0] / ratio); - newproduct = res[0] * res[1]; - } - if (res[1] % 4 != 0) { - res[1] = res[1] - (res[1] % 4); - } - } else { - while (newproduct <= 2073600) { - res[0] = res[0] - 4; - res[1] = Math.round(res[0] / ratio); - newproduct = res[0] * res[1]; - } - if (res[1] % 4 != 0) { - res[1] = res[1] - (res[1] % 4); - } + } + while (newproduct > 2073600) { + res[0] = res[0] - 4; + res[1] = Math.round(res[0] / ratio); + newproduct = res[0] * res[1]; + } + if (res[1] % 4 != 0) { + res[1] = res[1] - (res[1] % 4); } if (this.interlace == 1) { this.setcard("请输入宽度" + res[0] + "和高度" + res[1] + ",并按照码率B来处理,并按照手册文末问答2执行反交错操作", 3, 10000); @@ -169,54 +161,46 @@ export default { } if (this.hfps == 0 && this.interlace == 0) { res = this.res; - newproduct = 0; + newproduct = res[0]*res[1]; ratio = res[0] / res[1]; if (res[0] % 4 != 0) { res[0] = res[0] + 2; - while (newproduct > 921600) { - res[0] = res[0] + 4; - res[1] = Math.round(res[0] / ratio); - newproduct = res[0] * res[1]; - } - if (res[1] % 4 != 0) { - res[1] = res[1] + (4 - (res[1] % 4)); - } - } else { - while (newproduct > 921600) { - res[0] = res[0] + 4; - res[1] = Math.round(res[0] / ratio); - newproduct = res[0] * res[1]; - } - if (res[1] % 4 != 0) { - res[1] = res[1] + (4 - (res[1] % 4)); - } + } + console.log('-----------') + console.log(res) + console.log(ratio) + console.log(newproduct) + console.log('-----------') + while (newproduct <= 921600) { + res[0] = res[0] + 4; + res[1] = Math.round(res[0] / ratio); + newproduct = res[0] * res[1]; + console.log('-----------') + console.log(res) + console.log(ratio) + console.log(newproduct) + console.log('-----------') + } + if (res[1] % 4 != 0) { + res[1] = res[1] + (4 - (res[1] % 4)); } this.setcard("请输入宽度" + res[0] + "和高度" + res[1] + ",并按照码率B来处理", 3, 10000); return; } else { if (this.product <= 409920) { res = this.res; - newproduct = 0; + newproduct = res[0]*res[1]; ratio = res[0] / res[1]; if (res[0] % 4 != 0) { res[0] = res[0] + 2; - while (newproduct > 409920) { - res[0] = res[0] + 4; - res[1] = Math.round(res[0] / ratio); - newproduct = res[0] * res[1]; - } - if (res[1] % 4 != 0) { - res[1] = res[1] + (4 - (res[1] % 4)); - } - } else { - while (newproduct > 409920) { - res[0] = res[0] + 4; - res[1] = Math.round(res[0] / ratio); - newproduct = res[0] * res[1]; - } - if (res[1] % 4 != 0) { - res[1] = res[1] + (4 - (res[1] % 4)); - } + } + while (newproduct <= 409920) { + res[0] = res[0] + 4; + res[1] = Math.round(res[0] / ratio); + newproduct = res[0] * res[1]; + } + if (res[1] % 4 != 0) { + res[1] = res[1] + (4 - (res[1] % 4)); } if (this.interlace == 1) { this.setcard("请输入宽度" + res[0] + "和高度" + res[1] + ",并按照码率A来处理,并按照手册文末问答2执行反交错操作", 3, 10000);