This commit is contained in:
muwoo
2021-06-02 17:17:09 +08:00
commit ce490acb6a
52 changed files with 16764 additions and 0 deletions

84
src/renderer/App.vue Normal file
View File

@@ -0,0 +1,84 @@
<template>
<a-layout id="components-layout-demo-custom-trigger">
<div class="rubick-select">
<div class="tag-container" v-if="selected">
<a-tag
:key="selected.key"
@close="closeTag"
class="select-tag"
color="green"
closable
>
{{ selected.name }}
</a-tag>
</div>
<a-input
placeholder="Hi, Rubick"
class="main-input"
@change="onSearch"
:value="searchValue"
>
<a-icon class="icon-tool" type="tool" slot="suffix" @click="() => {
showMainUI();
changePath({key: 'market'})
}"/>
}
</a-input>
<div class="options" v-show="options.length && !showMain">
<a-list item-layout="horizontal" :data-source="options">
<a-list-item @click="() => item.click($router)" class="op-item" slot="renderItem" slot-scope="item, index">
<a-list-item-meta
:description="item.desc"
>
<span slot="title" >{{ item.name }}</span>
<a-avatar
slot="avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
/>
</a-list-item-meta>
</a-list-item>
</a-list>
</div>
</div>
<router-view></router-view>
</a-layout>
</template>
<script>
import {mapActions, mapMutations, mapState} from "vuex";
import {ipcRenderer} from "electron";
import {getWindowHeight} from "./assets/common/utils";
export default {
methods: {
...mapActions('main', ['onSearch', 'showMainUI']),
...mapMutations('main', ['commonUpdate']),
changePath({key}) {
this.$router.push({path: `/home/${key}`});
this.commonUpdate({
current: [key]
})
},
closeTag(v) {
this.commonUpdate({
selected: null,
showMain: false,
});
ipcRenderer.send('changeWindowSize', {
height: getWindowHeight([]),
});
this.$router.push({
path: '/home',
});
}
},
computed: {
...mapState('main', ['showMain', 'current', 'options', 'selected', 'searchValue'])
}
};
</script>
<style lang="scss">
* {
margin: 0;
padding: 0;
}
</style>