From 9ffa941e727e9c68164aa8ae6841575a4360e4e4 Mon Sep 17 00:00:00 2001 From: fofolee Date: Thu, 13 Feb 2025 21:43:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84ConfigurationPage=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/lib/lodashMini.js | 21 --- src/components/CommandEditor.vue | 5 - src/components/ComposerEditor.vue | 17 +- src/components/config/CommandPanels.vue | 158 +++++++++++------ src/components/config/FooterBar.vue | 56 ++++-- src/components/config/TagBar.vue | 40 ++--- src/components/editor/CommandConfig.vue | 28 ++- src/components/menu/CommandManageMenu.vue | 70 ++++++-- src/components/menu/index.vue | 44 +++-- src/components/popup/PanelSetting.vue | 3 +- src/js/commandManager.js | 16 +- src/pages/ConfigurationPage.vue | 202 ++-------------------- 12 files changed, 291 insertions(+), 369 deletions(-) diff --git a/plugin/lib/lodashMini.js b/plugin/lib/lodashMini.js index 0c49d17..f9cab6a 100644 --- a/plugin/lib/lodashMini.js +++ b/plugin/lib/lodashMini.js @@ -249,27 +249,6 @@ const lodashMini = { ); }, - /** - * 移除数组中所有给定值 - * @param {Array} array - 要修改的数组 - * @param {...*} values - 要移除的值 - * @returns {Array} 返回数组本身 - * @example - * pull([1, 2, 3, 1, 2, 3], 2, 3) => [1, 1] - */ - pull: function (array, ...values) { - if (!array || !array.length || !values.length) return array; - let i = 0; - while (i < array.length) { - if (values.includes(array[i])) { - array.splice(i, 1); - } else { - i++; - } - } - return array; - }, - /** * 截断字符串 * @param {string} [string=''] - 要截断的字符串 diff --git a/src/components/CommandEditor.vue b/src/components/CommandEditor.vue index a845f18..b88367f 100644 --- a/src/components/CommandEditor.vue +++ b/src/components/CommandEditor.vue @@ -161,11 +161,6 @@ export default { this.commandInit(); this.sidebarInit(); }, - computed: { - configurationPage() { - return this.$root.$refs.view; - }, - }, methods: { // 命令初始化 commandInit() { diff --git a/src/components/ComposerEditor.vue b/src/components/ComposerEditor.vue index 70d757b..fa04d19 100644 --- a/src/components/ComposerEditor.vue +++ b/src/components/ComposerEditor.vue @@ -15,13 +15,11 @@ import CommandComposer from "components/composer/CommandComposer.vue"; import CommandRunResult from "components/CommandRunResult"; import { findCommandByValue } from "js/composer/composerConfig"; import programs from "js/options/programs.js"; -import { provide, ref } from "vue"; +import { ref } from "vue"; export default { components: { CommandComposer, CommandRunResult }, setup(props) { - provide("allQuickCommandTags", props.allQuickCommandTags); - const retoreToFullCommand = (command) => { const { flows } = command; if (!flows) return command; @@ -100,9 +98,13 @@ export default { ...defaultCommand, ...retoreToFullCommand(savedCommand), }); + + const isRunComposePage = ref(props.action.type === "composer"); + return { quickcommandInfo, getLitedComposerCommand, + isRunComposePage, }; }, emits: ["editorEvent"], @@ -111,15 +113,6 @@ export default { type: Object, required: true, }, - allQuickCommandTags: { - type: Array, - default: () => [], - }, - }, - data() { - return { - isRunComposePage: this.action.type === "composer", - }; }, methods: { handleComposerAction(actionType, command) { diff --git a/src/components/config/CommandPanels.vue b/src/components/config/CommandPanels.vue index 8750b73..cc7e4c1 100644 --- a/src/components/config/CommandPanels.vue +++ b/src/components/config/CommandPanels.vue @@ -25,21 +25,24 @@ }" > -