mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-07-02 05:52:46 +08:00
运行命令界面
This commit is contained in:
parent
0f7f13306b
commit
0ca153ac10
@ -19,7 +19,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
window.utools = window.getuToolsLite()
|
window.utools = window.getuToolsLite();
|
||||||
// 版本检测
|
// 版本检测
|
||||||
const requiredVersion = "2.6.1";
|
const requiredVersion = "2.6.1";
|
||||||
let version = utools.getAppVersion();
|
let version = utools.getAppVersion();
|
||||||
@ -37,7 +37,12 @@ export default defineComponent({
|
|||||||
this.$q.dark.set(utools.isDarkColors());
|
this.$q.dark.set(utools.isDarkColors());
|
||||||
// 路由跳转
|
// 路由跳转
|
||||||
quickcommand.enterData = enter;
|
quickcommand.enterData = enter;
|
||||||
this.$router.push(enter.code);
|
this.$router.push({
|
||||||
|
path: enter.code,
|
||||||
|
query: {
|
||||||
|
timestamp: new Date().getTime(),
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -29,7 +29,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<q-card>
|
<q-card>
|
||||||
{{ action.data }}
|
<pre
|
||||||
|
:class="runResultStatus ? '' : 'text-red'"
|
||||||
|
v-html="runResult"
|
||||||
|
></pre>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -48,6 +51,9 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
action: Object,
|
action: Object,
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
window.runResult = this;
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 运行命令
|
// 运行命令
|
||||||
async runCurrentCommand(currentCommand) {
|
async runCurrentCommand(currentCommand) {
|
||||||
|
@ -1,22 +1,41 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<CommandRunResult :action="action"></CommandRunResult>
|
<CommandRunResult :action="action" ref="result"></CommandRunResult>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CommandRunResult from "components/CommandRunResult.vue";
|
import CommandRunResult from "components/CommandRunResult";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
component: { CommandRunResult },
|
components: { CommandRunResult },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
action: {
|
action: {
|
||||||
type: "fromUtools",
|
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>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user