Skip to content

Commit 2c058e7

Browse files
author
rainyan
committed
Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev
2 parents 70414b7 + 3023037 commit 2c058e7

File tree

8 files changed

+241
-29
lines changed

8 files changed

+241
-29
lines changed

web/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"vue-router": "^3.1.3",
2828
"vuescroll": "^4.14.4",
2929
"vuex": "^3.1.1",
30-
"vuex-persist": "^2.1.0"
30+
"vuex-persist": "^2.1.0",
31+
"timeline-vuejs": "1.1.1"
3132
},
3233
"devDependencies": {
3334
"@vue/cli-plugin-babel": "^3.11.0",

web/src/api/github.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import axios from "axios";
2+
import { Loading } from "element-ui";
3+
4+
let loadingInstance;
5+
let service = axios.create();
6+
7+
service.interceptors.request.use((config) => {
8+
loadingInstance = Loading.service({ fullscreen: true });
9+
return config;
10+
});
11+
12+
service.interceptors.response.use((resp) => {
13+
loadingInstance.close();
14+
return resp;
15+
}, (error) => {
16+
loadingInstance.close();
17+
return error;
18+
});
19+
20+
export function Commits(page) {
21+
return service({
22+
url: "https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=" +
23+
page,
24+
method: "get",
25+
});
26+
}
27+
28+
export function Members() {
29+
return service({
30+
url: "https://api.github.com/orgs/FLIPPED-AURORA/members",
31+
method: "get",
32+
});
33+
}

web/src/assets/flipped-aurora.png

70.9 KB
Loading

web/src/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import vueParticleLine from 'vue-particle-line'
1414
import 'vue-particle-line/dist/vue-particle-line.css'
1515
Vue.use(vueParticleLine)
1616

17+
// time line css
18+
import '../node_modules/timeline-vuejs/dist/timeline-vuejs.css'
19+
1720
// 富文本插件
1821
import VueQuillEditor from 'vue-quill-editor'
1922
import 'quill/dist/quill.core.css'

web/src/view/layout/aside/historyComponent/history.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
const obj = {}
3939
obj.name = route.name
4040
obj.meta = route.meta
41-
this.historys.push(obj)
41+
this.historys.push(obj)
4242
}
4343
this.activeValue = this.$route.name
4444
},

web/src/view/layout/aside/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<el-scrollbar style="height:calc(100vh)">
44
<el-menu
5-
:class="['el-menu-vertical',!isCollapse&&'noCollapse']"
5+
class="el-menu-vertical"
66
:collapse="isCollapse"
77
:collapse-transition="true"
88
:default-active="active"

web/src/view/layout/index.vue

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
</el-aside>
88
<!-- 分块滑动功能 -->
99
<el-main class="main-cont main-right">
10+
<transition mode="out-in" name="el-fade-in-linear">
11+
<div class="topfix" :style="{width: `calc(100% - ${isCollapse?'54px':'220px'})`}">
1012
<el-header class="header-cont">
1113
<div @click="totalCollapse" class="menu-total">
1214
<i class="el-icon-s-unfold" v-if="isCollapse"></i>
@@ -37,7 +39,26 @@
3739
<el-dropdown-item @click.native="LoginOut" icon="el-icon-table-lamp">登 出</el-dropdown-item>
3840
</el-dropdown-menu>
3941
</el-dropdown>
40-
<el-dialog
42+
43+
</div>
44+
</el-header>
45+
<!-- 当前面包屑用路由自动生成可根据需求修改 -->
46+
<!--
47+
:to="{ path: item.path }" 暂时注释不用-->
48+
<HistoryComponent />
49+
</div>
50+
</transition>
51+
<transition mode="out-in" name="el-fade-in-linear">
52+
<keep-alive>
53+
<router-view v-if="$route.meta.keepAlive" class="admin-box"></router-view>
54+
</keep-alive>
55+
</transition>
56+
<transition mode="out-in" name="el-fade-in-linear">
57+
<router-view v-if="!$route.meta.keepAlive" class="admin-box"></router-view>
58+
</transition>
59+
</el-main>
60+
</el-container>
61+
<el-dialog
4162
title="修改密码"
4263
:visible.sync="showPassword"
4364
@close="clearPassword"
@@ -59,23 +80,6 @@
5980
<el-button type="primary" @click="savePassword">确 定</el-button>
6081
</div>
6182
</el-dialog>
62-
</div>
63-
64-
</el-header>
65-
<!-- 当前面包屑用路由自动生成可根据需求修改 -->
66-
<!--
67-
:to="{ path: item.path }" 暂时注释不用-->
68-
<HistoryComponent />
69-
<transition mode="out-in" name="el-fade-in-linear">
70-
<keep-alive>
71-
<router-view v-if="$route.meta.keepAlive" class="admin-box"></router-view>
72-
</keep-alive>
73-
</transition>
74-
<transition mode="out-in" name="el-fade-in-linear">
75-
<router-view v-if="!$route.meta.keepAlive" class="admin-box"></router-view>
76-
</transition>
77-
</el-main>
78-
</el-container>
7983
</el-container>
8084
</template>
8185

@@ -221,8 +225,15 @@ $mainHight: 100vh;
221225
.dropdown-group {
222226
min-width: 100px;
223227
}
228+
.topfix{
229+
position:fixed;
230+
top:0;
231+
box-sizing: border-box;
232+
z-index: 999;
233+
}
224234
.admin-box{
225235
background-color: rgb(255,255,255);
236+
margin-top: 100px;
226237
}
227238
.el-scrollbar__wrap {
228239
padding-bottom: 17px;
@@ -260,7 +271,6 @@ $mainHight: 100vh;
260271
}
261272
.router-history{
262273
background: #fff;
263-
margin-top: 1px;
264274
padding: 0 6px;
265275
}
266276
&.el-main {

web/src/view/test/index.vue

Lines changed: 172 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,181 @@
11
<template>
2-
<div>
3-
动态路由测试
4-
</div>
2+
<div>
3+
<el-row :gutter="10">
4+
<el-col :span="12">
5+
<el-card>
6+
<div slot="header">gin-vue-admin</div>
7+
<div>
8+
<el-row>
9+
<el-col :span="8" :offset="8">
10+
<a href="https://github.com/flipped-aurora/gin-vue-admin">
11+
<img
12+
class="org-img dom-center"
13+
src="@/assets/logo.png"
14+
alt="gin-vue-admin"
15+
/>
16+
</a>
17+
</el-col>
18+
</el-row>
19+
<el-row :gutter="10">
20+
<el-col :span="8">
21+
<a href="https://github.com/flipped-aurora/gin-vue-admin">
22+
<img
23+
class="dom-center"
24+
src="https://img.shields.io/github/watchers/flipped-aurora/gin-vue-admin.svg?label=Watch"
25+
alt=""
26+
/>
27+
</a>
28+
</el-col>
29+
<el-col :span="8">
30+
<a href="https://github.com/flipped-aurora/gin-vue-admin">
31+
<img
32+
class="dom-center"
33+
src="https://img.shields.io/github/stars/flipped-aurora/gin-vue-admin.svg?style=social"
34+
alt=""/></a
35+
></el-col>
36+
<el-col :span="8">
37+
<a href="https://github.com/flipped-aurora/gin-vue-admin">
38+
<img
39+
class="dom-center"
40+
src="https://img.shields.io/github/forks/flipped-aurora/gin-vue-admin.svg?label=Fork"
41+
alt=""/></a
42+
></el-col>
43+
</el-row>
44+
</div>
45+
</el-card>
46+
<el-card style="margin-top: 20px">
47+
<div slot="header">flipped-aurora团队</div>
48+
<div>
49+
<el-row>
50+
<el-col :span="8" :offset="8">
51+
<a href="https://github.com/flipped-aurora">
52+
<img
53+
class="org-img dom-center"
54+
src="@/assets/flipped-aurora.png"
55+
alt="flipped-aurora"
56+
/>
57+
</a>
58+
</el-col>
59+
</el-row>
60+
<el-row style="margin-left: 40px" :gutter="20">
61+
<template v-for="(item, index) in members">
62+
<el-col :span="8" :key="index">
63+
<a :href="item.html_url">
64+
<img class="avatar-img" :src="item.avatar_url" />
65+
<a class="author-name" style="">{{ item.login }}</a>
66+
</a>
67+
</el-col>
68+
</template>
69+
</el-row>
70+
</div>
71+
</el-card>
72+
</el-col>
73+
<el-col :span="12">
74+
<el-card>
75+
<div slot="header">
76+
提交记录
77+
</div>
78+
<div>
79+
<Timeline
80+
:timeline-items="dataTimeline"
81+
:message-when-no-items="messageWhenNoItems"
82+
:uniqueTimeline="true"
83+
:unique-year="true"
84+
:show-day-and-month="true"
85+
order="desc"
86+
dateLocale="zh-CN"
87+
/>
88+
</div>
89+
<el-button class="load-more" @click="loadMore" type="text"
90+
>Load more</el-button
91+
>
92+
</el-card>
93+
</el-col>
94+
</el-row>
95+
</div>
596
</template>
697

798
<script>
99+
import { Commits, Members } from "@/api/github";
100+
import Timeline from "timeline-vuejs";
8101
export default {
9-
name:"Test"
10-
11-
}
102+
name: "Test",
103+
components: {
104+
Timeline,
105+
},
106+
data() {
107+
return {
108+
messageWhenNoItems: "There arent commits",
109+
members: [],
110+
dataTimeline: [],
111+
page: 0,
112+
};
113+
},
114+
created() {
115+
this.loadCommits();
116+
this.loadMembers();
117+
},
118+
methods: {
119+
loadMore() {
120+
this.page++;
121+
this.loadCommits();
122+
},
123+
loadCommits() {
124+
Commits(this.page).then(({ data }) => {
125+
data.forEach((element) => {
126+
if (element.commit.message) {
127+
this.dataTimeline.push({
128+
from: new Date(element.commit.author.date),
129+
title: element.commit.author.name,
130+
showDayAndMonth: true,
131+
description: `<a style="color: #26191b" href="${element.html_url}">${element.commit.message}</a>`,
132+
});
133+
}
134+
});
135+
});
136+
},
137+
loadMembers() {
138+
Members().then(({ data }) => {
139+
this.members = data;
140+
this.members.sort();
141+
});
142+
},
143+
},
144+
};
12145
</script>
13146

14147
<style scoped>
148+
.load-more {
149+
margin-left: 120px;
150+
}
15151
16-
</style>
152+
.avatar-img {
153+
float: left;
154+
height: 40px;
155+
width: 40px;
156+
border-radius: 50%;
157+
-webkit-border-radius: 50%;
158+
-moz-border-radius: 50%;
159+
margin-top: 15px;
160+
}
161+
162+
.org-img {
163+
height: 150px;
164+
width: 150px;
165+
}
166+
167+
.author-name {
168+
float: left;
169+
line-height: 65px !important;
170+
margin-left: 10px;
171+
color: darkblue;
172+
line-height: 100px;
173+
font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
174+
"Lucida Sans Unicode", Geneva, Verdana, sans-serif;
175+
}
176+
177+
.dom-center {
178+
margin-left: 50%;
179+
transform: translateX(-50%);
180+
}
181+
</style>

0 commit comments

Comments
 (0)