Skip to content

Commit 3eed609

Browse files
author
奇淼(piexlmax
authored
Merge pull request #525 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2 parents e716a31 + f6865ba commit 3eed609

File tree

12 files changed

+67
-9938
lines changed

12 files changed

+67
-9938
lines changed

server/resource/template/server/model.go.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
type {{.StructName}} struct {
1010
global.GVA_MODEL {{- range .Fields}}
1111
{{- if eq .FieldType "bool" }}
12-
{{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
12+
{{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- end }}"`
1313
{{- else }}
14-
{{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"`
14+
{{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if ne .FieldType "string" -}}{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}{{- end -}}"`
1515
{{- end }} {{- end }}
1616
}
1717

web/.env.development

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ENV = 'development'
22

3-
VUE_APP_CLI_PORT = '8080'
4-
VUE_APP_SERVER_PORT = '8888'
5-
VUE_APP_BASE_API = '/api'
6-
VUE_APP_BASE_PATH = 'http://127.0.0.1'
3+
VUE_APP_CLI_PORT = 8080
4+
VUE_APP_SERVER_PORT = 8888
5+
VUE_APP_BASE_API = /api
6+
VUE_APP_BASE_PATH = http://127.0.0.1

web/.env.production

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ENV = 'production'
22

3-
VUE_APP_CLI_PORT = '8080'
4-
VUE_APP_SERVER_PORT = '8888'
5-
VUE_APP_BASE_API = '/api'
3+
VUE_APP_CLI_PORT = 8080
4+
VUE_APP_SERVER_PORT = 8888
5+
VUE_APP_BASE_API = /api
66
#下方修改为你的线上ip
7-
VUE_APP_BASE_PATH = 'http://8.141.61.63'
7+
VUE_APP_BASE_PATH = http://8.141.61.63

web/src/core/config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* 网站配置文件
3+
* */
4+
5+
6+
7+
const config ={
8+
9+
appName : 'Gin-Vue-Admin',
10+
11+
appLogo : 'https://www.gin-vue-admin.com/img/logo.png'
12+
13+
}
14+
15+
export default config

web/src/core/gin-vue-admin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import APlayer from '@moefe/vue-aplayer'
1010
import '../../node_modules/timeline-vuejs/dist/timeline-vuejs.css'
1111
// 路由守卫
1212
import Bus from '@/utils/bus'
13+
//加载网站配置文件夹
14+
import config from './config'
15+
Vue.prototype.$GIN_VUE_ADMIN = config
16+
console.log(config)
1317
Vue.use(Bus)
1418
Vue.use(APlayer, {
1519
defaultCover: 'https://github.com/u3u.png',

web/src/utils/page.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
const title = 'GIN-VUE-ADMIN'
2-
1+
import config from '@/core/config'
32
export default function getPageTitle(pageTitle) {
43
if (pageTitle) {
5-
return `${pageTitle} - ${title}`
4+
return `${pageTitle} - ${config.appName}`
65
}
7-
return `${title}`
6+
return `${config.appName}`
87
}

web/src/view/init/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export default {
7474
console.log(this.hello)
7575
},
7676
async onSubmit() {
77-
this.out = true
7877
const loading = this.$loading({
7978
lock: true,
8079
text: '正在初始化数据库,请稍候',
@@ -84,6 +83,7 @@ export default {
8483
try {
8584
const res = await initDB(this.form)
8685
if (res.code === 0) {
86+
this.out = true
8787
this.$message({
8888
type: 'success',
8989
message: res.msg

web/src/view/layout/bottomInfo/bottomInfo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div>
44
<span>Powered by</span>
55
<span>
6-
<a href="https://github.com/flipped-aurora/gin-vue-admin">gin-vue-admin</a>
6+
<a href="https://github.com/flipped-aurora/gin-vue-admin">{{$GIN_VUE_ADMIN.appName}}</a>
77
</span>
88
<el-divider direction="vertical" />
99
<span>Copyright</span>

web/src/view/layout/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<el-row :class="[isShadowBg?'shadowBg':'']" @click.native="changeShadow()" />
55
<el-aside class="main-cont main-left">
66
<div class="tilte">
7-
<img alt class="logoimg" src="~@/assets/nav_logo.png">
8-
<h2 v-if="isSider" class="tit-text">Gin-Vue-Admin</h2>
7+
<img alt class="logoimg" :src="$GIN_VUE_ADMIN.appLogo">
8+
<h2 v-if="isSider" class="tit-text">{{ $GIN_VUE_ADMIN.appName }}</h2>
99
</div>
1010
<Aside class="aside" />
1111
</el-aside>
@@ -38,7 +38,7 @@
3838
<Search />
3939
<Screenfull class="screenfull" :style="{cursor:'pointer'}" />
4040
<el-dropdown>
41-
<span class="header-avatar">
41+
<span class="header-avatar" style="cursor: pointer">
4242
<CustomPic />
4343
<span style="margin-left: 5px">{{ userInfo.nickName }}</span>
4444
<i class="el-icon-arrow-down" />

web/src/view/layout/search/search.vue

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
:style="{display:'inline-block',float:'right',width:'31px',textAlign:'left',fontSize:'16px',paddingTop:'2px'}"
2424
class="user-box"
2525
>
26-
<i :style="{cursor:'pointer'}" class="el-icon-refresh" @click="$bus.$emit('reload')" />
26+
<i :style="{cursor:'pointer'}" class="el-icon-refresh reload" :class="[reload ? 'reloading' : '']" @click="handleReload" />
2727
</div>
2828
<div :style="{display:'inline-block',float:'right'}" class="user-box">
2929
<i :style="{cursor:'pointer'}" class="el-icon-search search-icon" @click="showSearch()" />
@@ -39,7 +39,8 @@ export default {
3939
data() {
4040
return {
4141
value: '',
42-
show: false
42+
show: false,
43+
reload: false
4344
}
4445
},
4546
computed: {
@@ -58,7 +59,33 @@ export default {
5859
this.$nextTick(() => {
5960
this.$refs['search-input'].focus()
6061
})
62+
},
63+
handleReload() {
64+
this.reload = true
65+
this.$bus.$emit('reload')
66+
setTimeout(() => {
67+
this.reload = false
68+
}, 500)
6169
}
6270
}
6371
}
6472
</script>
73+
<style scoped lang="scss">
74+
.reload{
75+
font-size: 17px;
76+
&:hover{
77+
transform: scale(1.02)
78+
}
79+
}
80+
81+
.reloading{
82+
animation:turn 0.5s linear infinite;
83+
}
84+
@keyframes turn {
85+
0%{-webkit-transform:rotate(0deg);}
86+
25%{-webkit-transform:rotate(90deg);}
87+
50%{-webkit-transform:rotate(180deg);}
88+
75%{-webkit-transform:rotate(270deg);}
89+
100%{-webkit-transform:rotate(360deg);}
90+
}
91+
</style>

0 commit comments

Comments
 (0)