This commit is contained in:
muwoo
2023-08-01 14:58:42 +08:00
parent 7a96bf395a
commit eef24dbb76
13 changed files with 66 additions and 48 deletions

View File

@@ -115,6 +115,7 @@ import { computed, ref, toRaw } from 'vue';
import path from 'path';
import MarkdownIt from 'markdown-it';
import { PlusCircleOutlined, MinusCircleOutlined } from '@ant-design/icons-vue';
import { message } from 'ant-design-vue';
const { ipcRenderer } = window.require('electron');
@@ -133,6 +134,7 @@ const localPlugins = computed(() =>
);
const updateLocalPlugin = () => store.dispatch('updateLocalPlugin');
const startUnDownload = (name) => store.dispatch('startUnDownload', name);
const errorUnDownload = (name) => store.dispatch('errorUnDownload', name);
const currentSelect = ref([0]);
@@ -146,7 +148,7 @@ const superPanelPlugins = ref(
_id: 'super-panel-plugins',
}
);
console.log(toRaw(superPanelPlugins.value.data));
const addCmdToSuperPanel = ({ cmd, code }) => {
const plugin = {
...toRaw(pluginDetail.value),
@@ -216,8 +218,13 @@ const readme = computed(() => {
const deletePlugin = async (plugin) => {
startUnDownload(plugin.name);
const timer = setTimeout(() => {
errorUnDownload(plugin.name);
message.error('卸载超时,请重试!');
}, 20000);
await window.market.deletePlugin(plugin);
updateLocalPlugin();
clearTimeout(timer);
};
</script>