mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-20 19:20:37 +08:00
编排卡片收缩时显示摘要
This commit is contained in:
@@ -186,11 +186,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
code: this.generateCode(newValue),
|
||||
argvs: newValue,
|
||||
});
|
||||
this.updateModelValue(newValue);
|
||||
},
|
||||
},
|
||||
hasOptions() {
|
||||
@@ -281,14 +277,21 @@ export default defineComponent({
|
||||
[key]: value,
|
||||
};
|
||||
},
|
||||
getSummary(argvs) {
|
||||
return this.operations.find((op) => op.name === argvs.operation).label;
|
||||
},
|
||||
updateModelValue(argvs) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
summary: this.getSummary(argvs),
|
||||
argvs,
|
||||
code: this.generateCode(argvs),
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (!this.modelValue.argvs && !this.modelValue.code) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
code: this.generateCode(this.defaultArgvs),
|
||||
argvs: { ...this.defaultArgvs },
|
||||
});
|
||||
this.updateModelValue(this.defaultArgvs);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -263,11 +263,7 @@ export default defineComponent({
|
||||
);
|
||||
},
|
||||
set(value) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
code: this.generateCode(value),
|
||||
argvs: value,
|
||||
});
|
||||
this.updateModelValue(value);
|
||||
},
|
||||
},
|
||||
pointerStyle() {
|
||||
@@ -420,14 +416,21 @@ export default defineComponent({
|
||||
newPaths.splice(index, 1);
|
||||
this.updateArgvs("paths", newPaths);
|
||||
},
|
||||
getSummary(argvs) {
|
||||
return this.operations.find((op) => op.name === argvs.operation)?.label;
|
||||
},
|
||||
updateModelValue(argvs) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
summary: this.getSummary(argvs),
|
||||
argvs,
|
||||
code: this.generateCode(argvs),
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (!this.modelValue.argvs && !this.modelValue.code) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
code: this.generateCode(this.defaultArgvs),
|
||||
argvs: { ...this.defaultArgvs },
|
||||
});
|
||||
this.updateModelValue(this.defaultArgvs);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -204,11 +204,7 @@ export default defineComponent({
|
||||
);
|
||||
},
|
||||
set(value) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
code: this.generateCode(value),
|
||||
argvs: value,
|
||||
});
|
||||
this.updateModelValue(value);
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -279,14 +275,21 @@ export default defineComponent({
|
||||
this.argvs = { ...this.argvs, [key]: value };
|
||||
}
|
||||
},
|
||||
getSummary(argvs) {
|
||||
return argvs.command.value;
|
||||
},
|
||||
updateModelValue(argvs) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
summary: this.getSummary(argvs),
|
||||
code: this.generateCode(argvs),
|
||||
argvs,
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (!this.modelValue.argvs && !this.modelValue.code) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
code: this.generateCode(this.defaultArgvs),
|
||||
argvs: this.defaultArgvs,
|
||||
});
|
||||
this.updateModelValue(this.defaultArgvs);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user