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