mirror of
https://github.com/rubickCenter/rubick
synced 2025-07-28 20:19:31 +08:00
Compare commits
2 Commits
1656418c10
...
2055bf61b1
Author | SHA1 | Date | |
---|---|---|---|
|
2055bf61b1 | ||
|
6c096fcd99 |
@ -7,7 +7,7 @@
|
||||
:data-source="list.filter((item) => !!item)"
|
||||
>
|
||||
<template #renderItem="{ item, index }">
|
||||
<a-list-item v-if="item" @click="showDetail(item)">
|
||||
<a-list-item v-if="item" @click="showDetail(index)">
|
||||
<template #actions>
|
||||
<a-button
|
||||
class="download-plugin-btn"
|
||||
@ -105,7 +105,7 @@ import {
|
||||
SelectOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
|
||||
import { defineProps, ref } from 'vue';
|
||||
import { defineProps, ref, computed } from 'vue';
|
||||
import { useStore } from 'vuex';
|
||||
import { message } from 'ant-design-vue';
|
||||
import MarkdownIt from 'markdown-it';
|
||||
@ -121,7 +121,7 @@ const router = useRouter();
|
||||
const startDownload = (name) => store.dispatch('startDownload', name);
|
||||
const successDownload = (name) => store.dispatch('successDownload', name);
|
||||
|
||||
defineProps({
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: [Array],
|
||||
default: () => [],
|
||||
@ -137,13 +137,14 @@ const downloadPlugin = async (plugin) => {
|
||||
};
|
||||
|
||||
const visible = ref(false);
|
||||
const detail = ref({});
|
||||
const showIndex = ref(0);
|
||||
const markdown = new MarkdownIt();
|
||||
const content = ref('');
|
||||
|
||||
const showDetail = async (item) => {
|
||||
const showDetail = async (index) => {
|
||||
const item = props.list[index];
|
||||
visible.value = true;
|
||||
detail.value = item;
|
||||
showIndex.value = index;
|
||||
content.value = '';
|
||||
let mdContent = '暂无内容';
|
||||
try {
|
||||
@ -156,6 +157,8 @@ const showDetail = async (item) => {
|
||||
}
|
||||
};
|
||||
|
||||
const detail = computed(() => props.list[showIndex.value]);
|
||||
|
||||
const openPlugin = (item) => {
|
||||
store.commit('commonUpdate', {active: ['installed']})
|
||||
router.push({
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "4.1.5",
|
||||
"version": "4.1.6",
|
||||
"author": "muwoo <2424880409@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -190,6 +190,7 @@ class API extends DBInstance {
|
||||
value: data.text,
|
||||
})})`
|
||||
);
|
||||
this.sendSubInputChangeEvent({ data });
|
||||
}
|
||||
|
||||
public getPath({ data }) {
|
||||
|
@ -118,7 +118,7 @@ const createPluginManager = (): any => {
|
||||
if (isPin) {
|
||||
pin.forEach((p, index) => {
|
||||
if (p.name === plugin.name) {
|
||||
pin.splice(index, 1);
|
||||
plugin = pin.splice(index, 1)[0];
|
||||
}
|
||||
});
|
||||
pin.unshift(plugin);
|
||||
|
@ -41,6 +41,17 @@ const optionsManager = ({
|
||||
options[0].click();
|
||||
});
|
||||
|
||||
const getIndex = (cmd, value) => {
|
||||
let index = 0;
|
||||
if (PinyinMatch.match(cmd.label || cmd, value)) {
|
||||
index += 1;
|
||||
}
|
||||
if (cmd.label) {
|
||||
index -= 1;
|
||||
}
|
||||
return index;
|
||||
};
|
||||
|
||||
const getOptionsFromSearchValue = (value, strict = false) => {
|
||||
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
let options: any = [];
|
||||
@ -61,7 +72,7 @@ const optionsManager = ({
|
||||
desc: fe.explain,
|
||||
type: plugin.pluginType,
|
||||
match: PinyinMatch.match(cmd.label || cmd, value),
|
||||
zIndex: cmd.label ? 0 : 1, // 排序权重
|
||||
zIndex: getIndex(cmd, value), // 排序权重
|
||||
click: () => {
|
||||
pluginClickEvent({
|
||||
plugin,
|
||||
@ -117,7 +128,7 @@ const optionsManager = ({
|
||||
.map((plugin) => {
|
||||
const option = {
|
||||
...plugin,
|
||||
zIndex: 1,
|
||||
zIndex: 0,
|
||||
click: () => {
|
||||
openPlugin(plugin, option);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user