运行命令界面

This commit is contained in:
fofolee 2022-04-08 19:08:31 +08:00
parent 0f7f13306b
commit 0ca153ac10
3 changed files with 38 additions and 8 deletions

View File

@ -19,7 +19,7 @@ export default defineComponent({
},
methods: {
init() {
window.utools = window.getuToolsLite()
window.utools = window.getuToolsLite();
//
const requiredVersion = "2.6.1";
let version = utools.getAppVersion();
@ -37,7 +37,12 @@ export default defineComponent({
this.$q.dark.set(utools.isDarkColors());
//
quickcommand.enterData = enter;
this.$router.push(enter.code);
this.$router.push({
path: enter.code,
query: {
timestamp: new Date().getTime(),
},
});
});
},
},

View File

@ -29,7 +29,10 @@
</div>
<div v-else>
<q-card>
{{ action.data }}
<pre
:class="runResultStatus ? '' : 'text-red'"
v-html="runResult"
></pre>
</q-card>
</div>
</div>
@ -48,6 +51,9 @@ export default {
props: {
action: Object,
},
mounted() {
window.runResult = this;
},
methods: {
//
async runCurrentCommand(currentCommand) {

View File

@ -1,22 +1,41 @@
<template>
<div>
<CommandRunResult :action="action"></CommandRunResult>
<CommandRunResult :action="action" ref="result"></CommandRunResult>
</div>
</template>
<script>
import CommandRunResult from "components/CommandRunResult.vue";
import CommandRunResult from "components/CommandRunResult";
export default {
component: { CommandRunResult },
components: { CommandRunResult },
data() {
return {
action: {
type: "fromUtools",
data: quickcommand.enterData,
data: {},
},
};
},
mounted() {},
mounted() {
window.commandPage = this;
this.runCurrentCommand();
},
computed: {
featureCode() {
return this.$route.params.type + "_" + this.$route.params.uid;
},
currentCommand() {
return this.$utools.whole.db.get("qc_" + this.featureCode).data;
},
},
beforeRouteUpdate(to, from, next) {
this.runCurrentCommand();
},
methods: {
runCurrentCommand() {
this.$refs.result.runCurrentCommand(this.currentCommand);
},
},
};
</script>