mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-28 11:52:46 +08:00
添加清空流程功能
This commit is contained in:
parent
fec8eb3f09
commit
9f7d8dde05
@ -146,6 +146,11 @@ export default defineComponent({
|
||||
},
|
||||
];
|
||||
|
||||
const clearFlows = () => {
|
||||
updateFlows(defaultFlow);
|
||||
activeTab.value = "main";
|
||||
};
|
||||
|
||||
if (!props.modelValue.flows || props.modelValue.flows.length === 0) {
|
||||
updateFlows(defaultFlow);
|
||||
}
|
||||
@ -258,6 +263,7 @@ export default defineComponent({
|
||||
activeTab,
|
||||
getOutputVariables,
|
||||
updateFlows,
|
||||
clearFlows,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
@ -373,6 +379,9 @@ export default defineComponent({
|
||||
this.addFlow(payload);
|
||||
}
|
||||
break;
|
||||
case "clear":
|
||||
this.clearFlows();
|
||||
break;
|
||||
default:
|
||||
this.$emit("action", type, payload);
|
||||
}
|
||||
|
@ -54,6 +54,15 @@
|
||||
>
|
||||
<q-tooltip>保存</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
icon="delete_sweep"
|
||||
@click="handleClear"
|
||||
v-if="!disabledButtons.includes('clear')"
|
||||
>
|
||||
<q-tooltip>清空所有流程</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
@ -138,6 +147,14 @@ export default defineComponent({
|
||||
const code = generateFlowsCode(this.flows);
|
||||
this.$emit("action", "apply", code);
|
||||
},
|
||||
handleClear() {
|
||||
quickcommand
|
||||
.showConfirmBox("确定要清空所有流程吗?", "FBI WARNING")
|
||||
.then((isConfirm) => {
|
||||
if (!isConfirm) return;
|
||||
this.$emit("action", "clear");
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user