Skip to content

Commit 44f054e

Browse files
committed
移除 VueRouteButton 组件
添加 ToolButton 组件 修改 logo
1 parent a6a6d24 commit 44f054e

File tree

14 files changed

+260
-164
lines changed

14 files changed

+260
-164
lines changed

config/admin.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
'loginDesc' => '开箱即用的 Laravel 后台扩展',
99

1010

11-
'loginLogo' => 'https://file.iviewui.com/admin-pro-dist/img/logo.7b8cc895.png',
12-
'logoDark' => 'https://file.iviewui.com/admin-pro-dist/img/logo-dark.ab519d9f.png',
1311
'logo' => 'https://file.iviewui.com/admin-pro-dist/img/logo.7b8cc895.png',
1412

1513
'copyright' => 'Copyright © 2020 小土狗',
@@ -24,7 +22,6 @@
2422
]
2523
],
2624

27-
'logo-mini' => 'https://file.iviewui.com/admin-pro-dist/img/logo-small.4a34a883.png',
2825

2926
'bootstrap' => app_path('Admin/bootstrap.php'),
3027

docs/components.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,17 @@ $grid->actions(function (Grid\Actions $actions) {
149149

150150
### 工具栏组件
151151

152-
#### VueRouteButton
152+
#### ToolButton
153153

154-
用于跳转到其他页面的操作
154+
可用于vue路由导航,异步请求,连接跳转 操作
155155

156156
```php
157-
VueRouteButton::make("/adv/loc", "广告位管理")->type("text")
157+
Grid\Tools\ToolButton::make("同步粉丝")
158+
->handler("request") // 类型 request|route|link
159+
->uri("") //路径
158160
```
159161

160-
162+
其他属性可参考 `el-button`
161163

162164
## 表单组件
163165

public/app.js

Lines changed: 106 additions & 81 deletions
Large diffs are not rendered by default.

public/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"/app.js": "/app.js?id=16f9cb98a45761e057b8",
2+
"/app.js": "/app.js?id=7bccd6d48bd0882ab721",
33
"/manifest.js": "/manifest.js?id=d9708e48a6c10ccee4bb",
44
"/vendor.js": "/vendor.js?id=f4679ac178c0e413cb28"
55
}

resources/js/components.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ Vue.component('VueRouteAction', VueRouteAction);
9696

9797
//Tools
9898
import GridCreateButton from './components/widgets/Tools/Create'
99-
import VueRouteButton from './components/widgets/Tools/VueRouteButton'
99+
import ToolButton from './components/widgets/Tools/ToolButton'
100100
Vue.component('GridCreateButton', GridCreateButton);
101-
Vue.component('VueRouteButton', VueRouteButton);
101+
Vue.component('ToolButton', ToolButton);
102102

103103

104104
//Widget

resources/js/components/Login.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
<div class="page-account-top">
88
<div class="page-account-top-logo">
99
<img :src="page_data.logo" alt="logo" />
10+
<h1>{{page_data.name}}</h1>
1011
</div>
1112

1213
<div class="page-account-top-desc">{{ page_data.desc }}</div>
1314
</div>
1415
<div class="login-form">
15-
<el-form ref="formValidate" :model="form" :rules="ruleValidate">
16+
<el-form ref="formValidate" :model="form" :rules="ruleValidate" size="medium">
1617
<el-form-item prop="username">
1718
<el-input
1819
autofocus
@@ -131,7 +132,14 @@ export default {
131132
padding: 32px 0;
132133
text-align: center;
133134
}
134-
135+
.page-account-top-logo{
136+
display: flex;
137+
align-items: center;
138+
justify-content: center;
139+
h1{
140+
font-weight: 100;
141+
}
142+
}
135143
.page-account-top-logo img {
136144
height: 75px;
137145
}

resources/js/components/Root.vue

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@
88
:width="isCollapsed ? '64px' : '200px'"
99
>
1010
<div class="content-side-logo">
11-
<template v-if="!isCollapsed">
12-
<img :src="page_data.logo" v-if="!isDark" />
13-
<img :src="page_data.logoDark" v-else />
14-
</template>
15-
16-
<img :src="page_data.logoMini" v-else />
11+
<img :src="page_data.logo" />
12+
<h1 v-if="!isCollapsed">{{ page_data.name }}</h1>
1713
</div>
1814
<el-scrollbar wrap-class="scrollbar-wrapper">
1915
<el-menu
@@ -313,6 +309,17 @@ $header-bar-height: 55px;
313309
object-fit: cover;
314310
vertical-align: middle;
315311
}
312+
h1 {
313+
display: inline-block;
314+
margin: 0 0 0 5px;
315+
color: #666;
316+
font-weight: 600;
317+
font-size: 20px;
318+
vertical-align: middle;
319+
animation: fade-in;
320+
animation-duration: 0.3s;
321+
}
322+
316323
}
317324
.el-scrollbar {
318325
flex: 1;
@@ -338,6 +345,11 @@ $header-bar-height: 55px;
338345
.side-dark {
339346
background: #1d1e23;
340347
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
348+
.content-side-logo {
349+
h1 {
350+
color: #ffffff;
351+
}
352+
}
341353
}
342354
.layout-header-bar {
343355
width: 100%;

resources/js/components/grid/Table.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
v-for="(component, index) in attrs.toolbars.right"
3030
:key="component.componentName + index"
3131
:is="component.componentName"
32-
:attr="component"
32+
:attrs="component"
3333
/>
3434
<el-divider
3535
direction="vertical"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<template>
2+
<el-button
3+
:type="attrs.type"
4+
:size="attrs.size"
5+
:plain="attrs.plain"
6+
:round="attrs.round"
7+
:circle="attrs.circle"
8+
:disabled="attrs.disabled"
9+
:icon="attrs.icon"
10+
:autofocus="attrs.autofocus"
11+
:loading="loading"
12+
class="mr-10"
13+
@click="onClick"
14+
>{{ attrs.content }}</el-button
15+
>
16+
</template>
17+
<script>
18+
export default {
19+
props: {
20+
attrs: Object
21+
},
22+
data() {
23+
return {
24+
loading: false
25+
};
26+
},
27+
methods: {
28+
onClick() {
29+
switch (this.attrs.handler) {
30+
case "route":
31+
this.$route.push(this.attrs.uri);
32+
break;
33+
case "link":
34+
window.location.href = this.attrs.uri;
35+
break;
36+
case "request":
37+
this.onRequest(this.attrs.uri);
38+
break;
39+
default:
40+
this.$Message.warning("响应类型未定义");
41+
break;
42+
}
43+
},
44+
onRequest(uri) {
45+
this.loading = true;
46+
this.$http
47+
.get(uri)
48+
.then(res => {
49+
if (res.code == 200) {
50+
51+
}
52+
})
53+
.finally(() => {
54+
this.loading = false;
55+
});
56+
}
57+
}
58+
};
59+
</script>

resources/js/components/widgets/Tools/VueRouteButton.vue

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)