支持本地启动,修改mac 下获取 APP icon 的方式

This commit is contained in:
muwoo
2023-09-15 16:17:52 +08:00
parent 61b4e37fe0
commit c21c08c370
24 changed files with 493 additions and 124 deletions

View File

@@ -1,14 +1,24 @@
<template>
<div
v-show="
!!options.length &&
(searchValue || !!clipboardFile.length) &&
!currentPlugin.name
"
v-show="!currentPlugin.name"
class="options"
ref="scrollDom"
>
<a-list item-layout="horizontal" :dataSource="sort(options)">
<div class="history-plugins" v-if="!options.length || !(searchValue || !!clipboardFile.length)">
<a-row>
<a-col
@click="() => item.click()"
:class="currentSelect === index ? 'active history-item' : 'history-item'"
:span="3"
v-for="(item, index) in pluginHistory"
:key="index"
>
<a-avatar style="border-radius: 0" :src="item.icon" />
<div class="name ellpise">{{item.pluginName || item._name || item.name}}</div>
</a-col>
</a-row>
</div>
<a-list v-else item-layout="horizontal" :dataSource="sort(options)">
<template #renderItem="{ item, index }">
<a-list-item
@click="() => item.click()"
@@ -52,6 +62,7 @@ const props = defineProps({
default: 0,
},
currentPlugin: {},
pluginHistory: (() => [])(),
clipboardFile: (() => [])(),
});
@@ -91,15 +102,45 @@ const sort = (options) => {
</script>
<style lang="less">
.ellpise {
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-line-clamp:1;
-webkit-box-orient:vertical;
}
.options {
position: absolute;
top: 62px;
top: 60px;
left: 0;
width: 100%;
z-index: 99;
max-height: calc(~'100vh - 64px');
max-height: calc(~'100vh - 60px');
overflow: auto;
background: var(--color-body-bg);
.history-plugins {
width: 100%;
border-top: 1px dashed #ddd;
box-sizing: border-box;
.history-item {
box-sizing: border-box;
height: 79px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
border-right: 1px dashed #ddd;
&.active {
background: var(--color-list-hover);
}
}
.name {
margin-top: 4px;
width: 100%;
text-align: center;
}
}
.op-item {
padding: 0 10px;
height: 60px;

View File

@@ -19,6 +19,7 @@
class="main-input"
@input="e => changeValue(e)"
@keydown.down="e => keydownEvent(e, 'down')"
@keydown.tab="e => keydownEvent(e, 'down')"
@keydown.up="e => keydownEvent(e, 'up')"
@keydown="e => checkNeedInit(e)"
:value="searchValue"
@@ -71,6 +72,7 @@ const props: any = defineProps({
type: String,
default: '',
},
pluginHistory: (() => [])(),
currentPlugin: {},
pluginLoading: Boolean,
clipboardFile: (() => [])(),
@@ -107,7 +109,7 @@ const keydownEvent = (e, key: string) => {
modifiers,
},
});
const runPluginDisable = e.target.value === '' || props.currentPlugin.name;
const runPluginDisable = ((e.target.value === '' && !props.pluginHistory.length) || props.currentPlugin.name) ;
switch (key) {
case 'up':
emit('changeCurrent', -1);