mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 14:34:13 +08:00
添加直接新建命令功能
This commit is contained in:
parent
b4aa6f9837
commit
39b8c23a73
@ -294,7 +294,7 @@ export default {
|
|||||||
editCommand() {
|
editCommand() {
|
||||||
let event = {
|
let event = {
|
||||||
type: "edit",
|
type: "edit",
|
||||||
data: this.commandInfo.features.code,
|
data: this.commandInfo,
|
||||||
};
|
};
|
||||||
this.$emit("commandChanged", event);
|
this.$emit("commandChanged", event);
|
||||||
},
|
},
|
||||||
|
@ -176,7 +176,7 @@
|
|||||||
v-model="isCommandEditorShow"
|
v-model="isCommandEditorShow"
|
||||||
persistent
|
persistent
|
||||||
:maximized="maximizedToggle"
|
:maximized="maximizedToggle"
|
||||||
transition-show="slide-up"
|
:transition-show="newCommandDirect ? '' : 'slide-up'"
|
||||||
transition-hide="slide-down"
|
transition-hide="slide-down"
|
||||||
>
|
>
|
||||||
<q-card>
|
<q-card>
|
||||||
@ -297,6 +297,9 @@ export default {
|
|||||||
tabBarWidth() {
|
tabBarWidth() {
|
||||||
return this.commandCardStyle === "mini" ? "0" : "80px";
|
return this.commandCardStyle === "mini" ? "0" : "80px";
|
||||||
},
|
},
|
||||||
|
newCommandDirect() {
|
||||||
|
return this.$route.name === "newcommand";
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initPage();
|
this.initPage();
|
||||||
@ -304,6 +307,12 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 初始化
|
// 初始化
|
||||||
initPage() {
|
initPage() {
|
||||||
|
// 如果从 newcommand 进入则直接新建命令
|
||||||
|
if (this.newCommandDirect) {
|
||||||
|
if (quickcommand.enterData.type === "text") this.addNewCommand();
|
||||||
|
else this.editCommand(JSON.parse(quickcommand.enterData.payload));
|
||||||
|
this.$router.push("/configuration");
|
||||||
|
}
|
||||||
// 已启用的 features
|
// 已启用的 features
|
||||||
let activatedFeatures = this.getActivatedFeatures();
|
let activatedFeatures = this.getActivatedFeatures();
|
||||||
// 已启用的命令的 featureCode
|
// 已启用的命令的 featureCode
|
||||||
@ -401,10 +410,10 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
// 编辑命令
|
// 编辑命令
|
||||||
editCommand(code) {
|
editCommand(command) {
|
||||||
this.commandEditorAction = {
|
this.commandEditorAction = {
|
||||||
type: "edit",
|
type: "edit",
|
||||||
data: this.allQuickCommands[code],
|
data: _.cloneDeep(command),
|
||||||
};
|
};
|
||||||
this.isCommandEditorShow = true;
|
this.isCommandEditorShow = true;
|
||||||
},
|
},
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>newCommand</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
mounted() {
|
|
||||||
console.log(JSON.parse(localStorage["enterData"]));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
@ -12,8 +12,9 @@ const routes = [{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/newcommand',
|
path: '/newcommand',
|
||||||
|
name: 'newcommand',
|
||||||
component: () =>
|
component: () =>
|
||||||
import ('pages/NewCommand.vue')
|
import ('pages/ConfigurationPage.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/:type(default|files|img|key|regex|window|professional)_:uid(\\w+)',
|
path: '/:type(default|files|img|key|regex|window|professional)_:uid(\\w+)',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user