Skip to content

Commit 4d3c12d

Browse files
committed
show match history (90%)
1 parent b6567ce commit 4d3c12d

File tree

18 files changed

+401
-292
lines changed

18 files changed

+401
-292
lines changed

src/background.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
queryMatchIpc,
1818
creatMatchAfterStartGame
1919
} from "../frankElectron";
20+
2021
const Store = require("electron-store");Store.initRenderer()
2122
const path = require('path')
2223

src/render/components/assist/assistWindow.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {onMounted, ref} from "vue";
2525
import {ipcRenderer} from "electron";
2626
import {createHttp1Request} from "@/utils/league-connect";
2727
import {appConfig} from "@/utils/main/config";
28-
import {useStore} from "@/render/store";
28+
import {assistStore} from "@/render/store";
2929
import {storeToRefs} from "pinia/dist/pinia";
3030
import {querySummonerIdAndSummonerName,queryEnemySummonerIdAndSummonerName} from "@/utils/render/blacklistUtils";
3131
@@ -50,7 +50,7 @@ onMounted(() => {
5050
const tabsInstRef = ref(['champRank', 'rune','blacklist'])
5151
let transValue = ref('champRank')
5252
const message = useMessage()
53-
const store = useStore()
53+
const store = assistStore()
5454
const {summonerInfo,showSummonerInfoModal,currentBlackList,endGameAfterInfo} = storeToRefs(store)
5555
const isSwitchBlacklist = appConfig.get('isSwitchBlacklist')
5656

src/render/components/assist/blacklist.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ import {onMounted, reactive, ref,watch} from "vue"
130130
import PickSummoner from "./pickSummoner.vue"
131131
import {appConfig} from "@/utils/main/config";
132132
import AddBlacklist from "./addBlacklist.vue"
133-
import {useStore} from "@/render/store";
133+
import {assistStore} from "@/render/store";
134134
import {storeToRefs} from "pinia/dist/pinia";
135135
136136
const active = ref(false)
@@ -139,7 +139,7 @@ const blacklist = ref([])
139139
const detialsJson = reactive({name:'',date:'',content:'',tag:'',summonerId:''})
140140
const message = useMessage()
141141
let localBlacklist
142-
const store = useStore()
142+
const store = assistStore()
143143
const {currentBlackList} = storeToRefs(store)
144144
145145
watch(currentBlackList.value,() => {

src/render/components/assist/pickSummoner.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ import {CircleX} from '@vicons/tabler'
7979
import AddBlacklist from './addBlacklist.vue'
8080
import {ref} from "vue";
8181
import {ipcRenderer} from "electron";
82-
import {useStore} from "@/render/store";
82+
import {assistStore} from "@/render/store";
8383
import {storeToRefs} from "pinia/dist/pinia";
8484
8585
8686
const active = ref(false)
8787
const summonersList = ref([])
8888
const enemySummonersList = ref([])
89-
const store = useStore()
89+
const store = assistStore()
9090
const {endGameAfterInfo, showSummonerInfoModal} = storeToRefs(store)
9191
const blacklistName = ref('')
9292
const blacklistId = ref('')

src/render/components/home/dashboard.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</n-popover>
2222
<n-popover :show-arrow="false" trigger="hover" :delay="1000">
2323
<template #trigger>
24-
<n-button text circle color="black" @click="toSettingPage">
24+
<n-button text circle color="black" @click="changePage">
2525
<n-icon size="24">
2626
<settings/>
2727
</n-icon>
@@ -38,7 +38,7 @@
3838
</n-icon>
3939
</n-button>
4040
</template>
41-
是否退出Frank
41+
是否退出Frank?
4242
</n-popconfirm>
4343
</n-space>
4444
</header>
@@ -47,17 +47,15 @@
4747
<script setup>
4848
import {NIcon, NSpace, NButton, NPopover,NPopconfirm} from 'naive-ui'
4949
import {ChevronsDownRight, Settings, CircleX} from '@vicons/tabler'
50-
import {useStore} from "@/render/store";
5150
import {ipcRenderer} from 'electron'
5251
import {ref} from "vue";
5352
import {appConfig} from "@/utils/main/config";
5453
55-
56-
const store = useStore()
54+
const emits = defineEmits(['changePage'])
5755
let isConnectSuccess = ref(appConfig.get('credentials.port'))
5856
59-
const toSettingPage = () => {
60-
store.pageIncrease()
57+
const changePage = () => {
58+
emits('changePage')
6159
}
6260
6361
const handldDrge = (pos) => {

src/render/components/home/fbottom.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
</n-space>
5858
</n-space>
5959
</n-card>
60-
6160
</div>
6261
</template>
6362

src/render/components/home/index.vue

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
<template>
2-
<dashboard></dashboard>
2+
<dashboard @changePage="() => { pageCount = pageCount === 1 ? 2 : 1}"/>
33
<div>
4-
<app-main v-if="pageCount==1" class="slide-in-left "></app-main>
5-
<fbottom v-if="pageCount==1" class="slide-in-left "></fbottom>
6-
<setting v-else-if="pageCount==2" class="slide-in-right "></setting>
4+
<app-main v-if="pageCount===1" class="slide-in-left "/>
5+
<fbottom v-if="pageCount===1" class="slide-in-left "/>
6+
<setting v-else-if="pageCount===2" class="slide-in-right" @changePage="() => { pageCount = 1}"/>
77
</div>
88
</template>
99

1010
<script setup>
1111
import Dashboard from './dashboard.vue'
1212
import Setting from './setting.vue'
1313
import AppMain from './appMain.vue'
14-
import {useStore} from '../../store'
15-
import {storeToRefs} from 'pinia'
16-
import Fbottom from "@/render/components/home/fbottom";
17-
document.title = 'Frank'
18-
19-
// 使用pinia 管理切换页面的参数
20-
const store = useStore()
21-
let {pageCount, echartsData} = storeToRefs(store)
14+
import Fbottom from "@/render/components/home/fbottom"
15+
import {ref} from "vue";
2216
17+
document.title = 'Frank'
18+
const pageCount = ref(1)
2319
</script>
2420

2521
<style scoped>

src/render/components/home/setting.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<n-space>
6666
<n-tag :bordered="false" >赞助发电</n-tag>
6767
<n-button size="small" type="success" style="width: 214px;"
68-
secondary @click="showModal = true">赞助作者持续开发
68+
secondary @click="() => {showModal = true}">赞助作者持续开发
6969
</n-button>
7070
</n-space>
7171

@@ -151,12 +151,11 @@ import {
151151
import {optionsChampion} from '@/utils/render/lolDataList'
152152
import {ref} from "vue";
153153
import {appConfig} from "@/utils/main/config"
154-
import {useStore} from "@/render/store";
155154
import {ipcRenderer} from "electron";
156155
156+
const emits = defineEmits(['changePage'])
157157
let isExist = ref(false)
158158
let directory = ref('')
159-
const store = useStore()
160159
let isAutoPick = ref(appConfig.get('autoPickChampion.isAuto'))
161160
let pickChampion = ref(appConfig.get('autoPickChampion.championId'))
162161
const optionsChampionPick = optionsChampion
@@ -168,6 +167,11 @@ let isAccept = ref(appConfig.get('autoAccept'))
168167
const message = useMessage()
169168
const showModal = ref(false)
170169
170+
171+
const toHomePage = () => {
172+
emits('changePage')
173+
}
174+
171175
// 判断是否已经获取路径
172176
if (appConfig.get('gameDirectory') != '') {
173177
isExist.value = true
@@ -225,10 +229,6 @@ const handleUpdateAccept = () => {
225229
appConfig.set('autoAccept', isAccept.value)
226230
}
227231
228-
// 回到首页
229-
const toHomePage = () => {
230-
store.pageIncrease()
231-
}
232232
233233
// 恢复默认设置
234234
const toReset = async () => {

src/render/components/matchHistory/barKDA.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@
192192

193193
<div class="suspension">
194194
<n-space>
195+
<n-button
196+
text
197+
@click="() => {pageCount=1}" color="black">
198+
<n-icon size="25">
199+
<PictureInPictureTop/>
200+
</n-icon>
201+
</n-button>
202+
195203
<n-button
196204
text
197205
@click="handleMin" color="black">
@@ -235,14 +243,14 @@ import {
235243
} from 'naive-ui'
236244
import {onMounted, ref} from "vue"
237245
import {appConfig} from "@/utils/main/config"
238-
import {ChevronsDownLeft, CircleX, Ballon} from '@vicons/tabler'
246+
import {ChevronsDownLeft, CircleX, Ballon,PictureInPictureTop} from '@vicons/tabler'
239247
import {ipcRenderer} from "electron"
240-
import {useStore} from "@/render/store";
248+
import {matchStore} from "@/render/store";
241249
import {storeToRefs} from "pinia/dist/pinia";
242250
import {sendMessageToChat} from "@/utils/main/lcu";
243251
244-
const store = useStore()
245-
const {echartsData, enemyEchartsData, currentTeam, currentEchartData,summonerInfo} = storeToRefs(store)
252+
const store = matchStore()
253+
const {echartsData, enemyEchartsData, currentTeam, currentEchartData,summonerInfo,pageCount} = storeToRefs(store)
246254
let refresh = ref(1)
247255
let topHorse = ref(appConfig.get("topHorse"))
248256
let midHorse = ref(appConfig.get("midHorse"))
@@ -254,7 +262,7 @@ let midHorseType = ref(horseType.value.mid)
254262
let botHorseType = ref(horseType.value.bot)
255263
let trashHorseType = ref(horseType.value.trash)
256264
const sendPopover = ref(false)
257-
const emits = defineEmits(['summonerId'])
265+
const emits = defineEmits(['summonerId','changePage'])
258266
259267
const summonerName = ref([])
260268
@@ -277,7 +285,6 @@ const closeWindow = () => {
277285
const handleMin = () => {
278286
ipcRenderer.send('match-history-window-min')
279287
}
280-
281288
const sendToChat = () => {
282289
if (summonerName.value.length ===0){sendPopover.value = !sendPopover.value; return}
283290
let sendMessage = 'Powered By Frank \n'
@@ -347,8 +354,8 @@ function onClick() {
347354
348355
.suspension {
349356
position: absolute;
350-
top: 30px;
351-
right: 25px;
357+
top: 7px;
358+
right: 3px;
352359
}
353360
354361
.n-popconfirm__action {

src/render/components/matchHistory/gameDetails.vue

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<n-card class="mainCard boxShadow">
3+
<n-card class="mainCard boxShadow" content-style="padding-top:30px">
44
<n-space vertical>
55
<n-grid :cols="7">
66
<n-gi>
@@ -56,7 +56,7 @@
5656
</n-gi>
5757
</n-grid>
5858
</n-space>
59-
<n-space vertical style="margin-top: 25px" :size="[2,21]" >
59+
<n-space vertical style="margin-top: 25px" :size="[2,25]" >
6060
<!-- 队伍一-->
6161
<n-space justify="space-around" v-for="(singleData,index) in summonersDataList">
6262
<n-space vertical :size="[2,0]">
@@ -246,7 +246,7 @@ import {
246246
} from 'naive-ui'
247247
import {ThumbUp,World,ThumbDown,ChevronsDownLeft, ArrowBackUp, Ballon} from '@vicons/tabler'
248248
import {onMounted,ref} from "vue";
249-
import {useStore} from "@/render/store";
249+
import {matchStore} from "@/render/store";
250250
import {storeToRefs} from "pinia/dist/pinia";
251251
import {appConfig} from "@/utils/main/config";
252252
import {queryGameDetailsData} from "@/utils/main/queryDetailedGame";
@@ -258,10 +258,15 @@ export default {
258258
NCard, NAvatar, NSpace, NTag, NIcon, NButton, NColorPicker,NEllipsis,
259259
NPopover,NList, NListItem,NScrollbar,NGrid,NGi,NBadge,ThumbUp,World,ThumbDown,ChevronsDownLeft, ArrowBackUp, Ballon
260260
},
261-
setup(props,{emit}){
261+
props: {
262+
lastPage: {
263+
type: Number
264+
}
265+
},
266+
setup(props){
262267
let gameDetalisList = []
263-
const store = useStore()
264-
const {currentQueryGameId,currentSummonerName} = storeToRefs(store)
268+
const store = matchStore()
269+
const {currentQueryGameId,currentSummonerName,pageCount} = storeToRefs(store)
265270
let titleList = ref([])
266271
let summonersDataList = ref([])
267272
let otherData = ref(null)
@@ -365,10 +370,14 @@ export default {
365370
})
366371
}
367372
const backPageSencond = () => {
368-
emit('changePageSencond')
373+
if (props.lastPage===1){
374+
pageCount.value = 1
375+
}else {
376+
pageCount.value = 2
377+
}
369378
}
370379
const handleMin = () => {
371-
ipcRenderer.send('mainwin-min')
380+
ipcRenderer.send('match-history-window-min')
372381
}
373382
374383
// 图片不存在显示默认图片
@@ -413,8 +422,8 @@ export default {
413422
}
414423
.suspension {
415424
position: absolute;
416-
bottom: 5px;
417-
right: 60px;
425+
top: 7px;
426+
right: 3px;
418427
}
419428
.scale-in-hor-left {
420429
-webkit-animation: scale-in-hor-left 1.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;

0 commit comments

Comments
 (0)