From ef82e14d37b27bea9c849df4b0c270c2183f76ca Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 16 May 2022 17:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=91=BD=E4=BB=A4=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/CommandPage.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pages/CommandPage.vue b/src/pages/CommandPage.vue index 5cd3e90..d54c735 100644 --- a/src/pages/CommandPage.vue +++ b/src/pages/CommandPage.vue @@ -19,16 +19,15 @@ export default { }; }, mounted() { - this.runCurrentCommand(); - }, - computed: { - currentCommand() { - return this.$root.utools.whole.db.get("qc_" + this.featureCode).data; - }, + let command = + this.featureCode.slice(0, 8) === "default_" + ? require(`../json/${this.featureCode}.json`) + : this.$root.utools.whole.db.get("qc_" + this.featureCode).data; + this.runCurrentCommand(command); }, methods: { - runCurrentCommand() { - this.$refs.result.runCurrentCommand(_.cloneDeep(this.currentCommand)); + runCurrentCommand(command) { + this.$refs.result.runCurrentCommand(_.cloneDeep(command)); }, }, };