编排卡片收缩时显示摘要

This commit is contained in:
fofolee
2025-01-05 14:40:00 +08:00
parent 923fc9e4de
commit 54bb43dcc8
21 changed files with 325 additions and 213 deletions

View File

@@ -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);
}
},
});

View File

@@ -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);
}
},
});

View File

@@ -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);
}
},
});