mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-08 03:24:12 +08:00
commit
c2a23f0c6c
@ -4,6 +4,7 @@ export default {
|
|||||||
market: {
|
market: {
|
||||||
title: 'Market',
|
title: 'Market',
|
||||||
search: 'Search Plugins',
|
search: 'Search Plugins',
|
||||||
|
searchResult: 'Search Results',
|
||||||
explore: 'Explore',
|
explore: 'Explore',
|
||||||
efficiency: 'Efficiency',
|
efficiency: 'Efficiency',
|
||||||
searchTool: 'Search Tools',
|
searchTool: 'Search Tools',
|
||||||
|
@ -4,6 +4,7 @@ export default {
|
|||||||
market: {
|
market: {
|
||||||
title: '插件市场',
|
title: '插件市场',
|
||||||
search: '搜索插件',
|
search: '搜索插件',
|
||||||
|
searchResult: '搜索结果',
|
||||||
explore: '探索',
|
explore: '探索',
|
||||||
efficiency: '效率',
|
efficiency: '效率',
|
||||||
searchTool: '搜索工具',
|
searchTool: '搜索工具',
|
||||||
|
@ -16,6 +16,7 @@ export default createStore({
|
|||||||
state: {
|
state: {
|
||||||
totalPlugins: [],
|
totalPlugins: [],
|
||||||
localPlugins: [],
|
localPlugins: [],
|
||||||
|
searchValue: '',
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
commonUpdate(state: any, payload) {
|
commonUpdate(state: any, payload) {
|
||||||
@ -23,6 +24,9 @@ export default createStore({
|
|||||||
state[key] = payload[key];
|
state[key] = payload[key];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
setSearchValue(state: any, payload) {
|
||||||
|
state.searchValue = payload;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async init({ commit }) {
|
async init({ commit }) {
|
||||||
|
45
feature/src/views/market/components/result.vue
Normal file
45
feature/src/views/market/components/result.vue
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<div class="result">
|
||||||
|
<PluginList
|
||||||
|
v-if="result && !!result.length"
|
||||||
|
@downloadSuccess="downloadSuccess"
|
||||||
|
:title="$t('feature.market.searchResult')"
|
||||||
|
:list="result"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import PluginList from './plugin-list.vue';
|
||||||
|
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
const store = useStore();
|
||||||
|
|
||||||
|
const totalPlugins = computed(() => store.state.totalPlugins);
|
||||||
|
const searchValue = computed(() => store.state.searchValue);
|
||||||
|
|
||||||
|
const result = computed(() => {
|
||||||
|
if (searchValue.value.trim().length > 0) {
|
||||||
|
const pattern = new RegExp(searchValue.value);
|
||||||
|
return totalPlugins.value.filter((plugin) => {
|
||||||
|
if (plugin.pluginName.match(pattern)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return totalPlugins.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.result {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
overflow-x: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
@ -73,6 +73,7 @@ import Worker from './components/worker.vue';
|
|||||||
import Tools from './components/tools.vue';
|
import Tools from './components/tools.vue';
|
||||||
import Dev from './components/devlopment.vue';
|
import Dev from './components/devlopment.vue';
|
||||||
import Image from './components/image.vue';
|
import Image from './components/image.vue';
|
||||||
|
import Result from './components/result.vue';
|
||||||
|
|
||||||
const Components = {
|
const Components = {
|
||||||
finder: Finder,
|
finder: Finder,
|
||||||
@ -81,6 +82,7 @@ const Components = {
|
|||||||
image: Image,
|
image: Image,
|
||||||
tools: Tools,
|
tools: Tools,
|
||||||
dev: Dev,
|
dev: Dev,
|
||||||
|
result: Result,
|
||||||
};
|
};
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
@ -93,6 +95,11 @@ const store = useStore();
|
|||||||
const totalPlugins = computed(() => store.state.totalPlugins);
|
const totalPlugins = computed(() => store.state.totalPlugins);
|
||||||
|
|
||||||
const { searchValue, current } = toRefs(state);
|
const { searchValue, current } = toRefs(state);
|
||||||
|
|
||||||
|
const onSearch = (searchValue: string) => {
|
||||||
|
state.current = ['result'];
|
||||||
|
store.commit('setSearchValue', searchValue);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@ -104,9 +111,11 @@ const { searchValue, current } = toRefs(state);
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: var(--color-menu-bg);
|
background: var(--color-menu-bg);
|
||||||
height: calc(~"100vh - 46px");
|
height: calc(~'100vh - 46px');
|
||||||
.search {
|
.search {
|
||||||
:deep(.ant-btn), :deep(.ant-input), :deep(.ant-input-group-addon) {
|
:deep(.ant-btn),
|
||||||
|
:deep(.ant-input),
|
||||||
|
:deep(.ant-input-group-addon) {
|
||||||
color: var(--ant-primary-color) !important;
|
color: var(--ant-primary-color) !important;
|
||||||
background: var(--color-input-hover);
|
background: var(--color-input-hover);
|
||||||
border-color: var(--color-border-light);
|
border-color: var(--color-border-light);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user