From 552b7d0b617d436928a8aa7e0559e6b53f3daedf Mon Sep 17 00:00:00 2001
From: 63f1bb74d2451104dc7d8b9f <63f1bb74d2451104dc7d8b9f@devide>
Date: Fri, 30 Jun 2023 04:08:35 +0000
Subject: [PATCH] Auto Commit
---
src/components/SearchGrade.vue | 42 +++++++++++++++++++++-------------
1 file changed, 26 insertions(+), 16 deletions(-)
diff --git a/src/components/SearchGrade.vue b/src/components/SearchGrade.vue
index ba5954a..776d0fc 100644
--- a/src/components/SearchGrade.vue
+++ b/src/components/SearchGrade.vue
@@ -43,16 +43,16 @@ const state = reactive({
return range[0] + '-' + range[1] + ' 共' + total + '篇博客';
},
onShowSizeChange: changePageSize, // 改变每页数量时更新显示
- onChange:changePage,//点击页码事件
+ onChange: changePage,//点击页码事件
}
})
-function changePage(page,pageSize){
- state.pagination.current= page
- state.pagination.pageSize= pageSize
+function changePage(page, pageSize) {
+ state.pagination.current = page
+ state.pagination.pageSize = pageSize
}
-function changePageSize(current,pageSize){
- state.pagination.current= current
- state.pagination.pageSize= pageSize
+function changePageSize(current, pageSize) {
+ state.pagination.current = current
+ state.pagination.pageSize = pageSize
}
const getCsdnData = (uId) => {
@@ -75,9 +75,7 @@ const getCsdnData = (uId) => {
initFirstData()
})
}
-onMounted(() => {
- // onSearch()
-})
+
const onSearch = () => {
if (!state.searchValue) {
return window.alert('请输入用户id')
@@ -129,7 +127,6 @@ function initFirstData() {
},
tooltip: {
formatter: function (params) {
- console.log('params', params)
const findItem = state.dataSource.find(item => {
return item.postTime == params.name
})
@@ -154,7 +151,7 @@ function initFirstData() {
position: 'center',//在上方显示
textStyle: {//数值样式
fontSize: '2px',
- color: 'white'
+ color: 'blue'
}
},
markPoint: {
@@ -182,12 +179,25 @@ function initFirstData() {
window.open(findItem.src, '_blank')
}
});
+
+ onMounted(() => {
+ const storageUid=window.localStorage.getItem('csdnUid')
+ if(storageUid){
+ state.searchValue=storageUid
+ onSearch()
+ }
+ })
onUnmounted(() => {
window.onresize = null
+ if (!state.searchValue) {
+ window.localStorage.removeItem('csdnUid')
+ }
+ else {
+ if (!state.searchValue) {
+ window.localStorage.setItem('csdnUid', state.searchValue)
+ }
+ }
})
- function jumpUrl(url){
- window.open(url, '_blank')
- }
}
@@ -200,7 +210,7 @@ function initFirstData() {