mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 14:34:13 +08:00
添加搜索面板推送限制条件
This commit is contained in:
parent
bf2093f63a
commit
7fb35e7c2f
@ -288,7 +288,6 @@ import specialVars from "../js/options/specialVars.js";
|
|||||||
import platformTypes from "../js/options/platformTypes.js";
|
import platformTypes from "../js/options/platformTypes.js";
|
||||||
import iconPicker from "components/popup/IconPicker.vue";
|
import iconPicker from "components/popup/IconPicker.vue";
|
||||||
import UserData from "components/popup/UserData.vue";
|
import UserData from "components/popup/UserData.vue";
|
||||||
let commandTypesOptions = Object.values(commandTypes);
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { iconPicker, UserData },
|
components: { iconPicker, UserData },
|
||||||
@ -306,9 +305,8 @@ export default {
|
|||||||
},
|
},
|
||||||
commandTypes: commandTypes,
|
commandTypes: commandTypes,
|
||||||
platformTypes: platformTypes,
|
platformTypes: platformTypes,
|
||||||
commandTypesOptions: commandTypesOptions,
|
|
||||||
currentMatchType: "关键字",
|
currentMatchType: "关键字",
|
||||||
cmdType: commandTypesOptions[0],
|
cmdType: {},
|
||||||
cmdMatch: "",
|
cmdMatch: "",
|
||||||
outputTypes: outputTypes,
|
outputTypes: outputTypes,
|
||||||
outputTypesOptions: Object.keys(outputTypes),
|
outputTypesOptions: Object.keys(outputTypes),
|
||||||
@ -323,13 +321,22 @@ export default {
|
|||||||
canCommandSave: Boolean,
|
canCommandSave: Boolean,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
commandTypesOptions() {
|
||||||
|
return this.currentCommand.features.mainPush
|
||||||
|
? Object.values(commandTypes).filter(
|
||||||
|
(x) => x.name === "regex" || x.name === "over"
|
||||||
|
)
|
||||||
|
: Object.values(commandTypes);
|
||||||
|
},
|
||||||
specialVarsOptions() {
|
specialVarsOptions() {
|
||||||
|
if (this.currentCommand.features.mainPush) return [specialVars.input];
|
||||||
let x = Object.values(specialVars).filter(
|
let x = Object.values(specialVars).filter(
|
||||||
(x) => !x.label.match(this.cmdType.disabledSpecialVars)
|
(x) => !x.label.match(this.cmdType.disabledSpecialVars)
|
||||||
);
|
);
|
||||||
return x;
|
return x;
|
||||||
},
|
},
|
||||||
outputTypesOptionsDy() {
|
outputTypesOptionsDy() {
|
||||||
|
if (this.currentCommand.features.mainPush) return ["text"];
|
||||||
switch (this.$parent.quickcommandInfo.program) {
|
switch (this.$parent.quickcommandInfo.program) {
|
||||||
case "quickcommand":
|
case "quickcommand":
|
||||||
return _.without(this.outputTypesOptions, "terminal");
|
return _.without(this.outputTypesOptions, "terminal");
|
||||||
@ -346,6 +353,11 @@ export default {
|
|||||||
this.currentCommand.output = val[0];
|
this.currentCommand.output = val[0];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
commandTypesOptions(val) {
|
||||||
|
if (!val.map((x) => x.name).includes(this.cmdType.name)) {
|
||||||
|
this.cmdType = val[0];
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
@ -401,6 +413,7 @@ export default {
|
|||||||
this.cmdMatch = `/${this.cmdMatch}/`;
|
this.cmdMatch = `/${this.cmdMatch}/`;
|
||||||
},
|
},
|
||||||
insertSpecialVar(text) {
|
insertSpecialVar(text) {
|
||||||
|
if (!text) return;
|
||||||
this.$parent.$refs.editor.repacleEditorSelection(`'${text}'`);
|
this.$parent.$refs.editor.repacleEditorSelection(`'${text}'`);
|
||||||
},
|
},
|
||||||
// 保存各类数据
|
// 保存各类数据
|
||||||
|
Loading…
x
Reference in New Issue
Block a user