完善第一次运行编排时的提示

This commit is contained in:
fofolee 2025-03-25 17:00:34 +08:00
parent 97ce5fa965
commit 2259a61fa1

View File

@ -6,6 +6,37 @@
:disabled-control-buttons="disabledControlButtons" :disabled-control-buttons="disabledControlButtons"
class="fixed-full" class="fixed-full"
/> />
<q-dialog v-model="showHelpDialog">
<q-card style="width: 450px">
<div class="q-pa-md">
<div class="text-h6 q-mb-md">👏🏻 欢迎使用可视化编排</div>
<div class="q-mb-sm">由于编排功能众多推荐先查看教程再使用</div>
<div class="q-mb-sm">
<q-btn dense color="primary" flat @click="showHelp('#TMtYg')">
完整教程
</q-btn>
</div>
<div class="q-mb-sm">
<q-btn dense color="primary" flat @click="showHelp('#JqM2f')">
快速入门浏览器控制典型案例
</q-btn>
</div>
<div class="row items-center">
<div>你随时可以点击右上角的</div>
<q-icon name="help" class="q-ml-xs" size="13px" />
<div>帮助按钮再次查看教程</div>
</div>
</div>
<div class="flex justify-end q-pa-sm">
<q-btn
flat
dense
label="我知道了"
@click="showHelpDialog = false"
/>
</div>
</q-card>
</q-dialog>
<!-- 运行结果 --> <!-- 运行结果 -->
<CommandRunResult ref="result"></CommandRunResult> <CommandRunResult ref="result"></CommandRunResult>
</template> </template>
@ -15,22 +46,15 @@ import CommandComposer from "components/composer/CommandComposer.vue";
import CommandRunResult from "components/CommandRunResult"; import CommandRunResult from "components/CommandRunResult";
import { useCommandManager } from "js/commandManager.js"; import { useCommandManager } from "js/commandManager.js";
import { dbManager } from "js/utools"; import { dbManager } from "js/utools";
import { ref } from "vue";
export default { export default {
components: { CommandComposer, CommandRunResult }, components: { CommandComposer, CommandRunResult },
setup() { setup() {
const hasRunComposer = dbManager.getStorage("st_hasRunComposer"); const hasRunComposer = dbManager.getStorage("st_hasRunComposer");
const showHelpDialog = ref(false);
if (!hasRunComposer) { if (!hasRunComposer) {
quickcommand.showConfirmBox( showHelpDialog.value = true;
`<div>👏🏻 欢迎使用可视化编排,由于编排功能众多,推荐先查看教程再使用</div>
<div>查看教程<a href="javascript:void(0)" onclick="utools.ubrowser.goto('https://www.yuque.com/fofolee/qcdocs3/bg31vl#TMtYg').run({width: 1280, height: 720})">戳我</a></div>
<div>或者看一个<a href="javascript:void(0)" onclick="utools.ubrowser.goto('https://www.yuque.com/fofolee/qcdocs3/bg31vl#JqM2f').run({width: 1280, height: 720})">浏览器控制典型案例</a>快速入门</div>
<div>你随时可以点击右上角的<span style="font-weight: bolder;">帮助</span>按钮图标为问号再次查看教程</div>`,
"帮助",
true,
600
);
dbManager.setStorage("st_hasRunComposer", true); dbManager.setStorage("st_hasRunComposer", true);
} }
@ -47,6 +71,7 @@ export default {
return { return {
commandManager, commandManager,
showHelpDialog,
}; };
}, },
emits: ["editorEvent"], emits: ["editorEvent"],
@ -76,6 +101,9 @@ export default {
runCurrentCommand(command) { runCurrentCommand(command) {
this.$refs.result.runCurrentCommand(command); this.$refs.result.runCurrentCommand(command);
}, },
showHelp(id) {
window.showUb.help(id);
},
}, },
}; };
</script> </script>