Skip to content

Commit ee35797

Browse files
committed
fix: eslint
1 parent b983476 commit ee35797

File tree

3 files changed

+78
-29
lines changed

3 files changed

+78
-29
lines changed

README.md

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,80 @@
44

55
[预览地址](https://pro.loacg.com/) **附带一些后台基础用到的列表展示例子**
66

7-
![](https://static-2.loacg.com/open/static/github/20180916-134306.png)
8-
![](https://static-2.loacg.com/open/static/github/20180916-134251.png)
9-
![](https://static-2.loacg.com/open/static/github/20180916-155011.png)
10-
![](https://static-2.loacg.com/open/static/github/20180916-154921.png)
11-
![](https://static-2.loacg.com/open/static/github/20180916-155317.png)
12-
![](https://static-2.loacg.com/open/static/github/20180916-154937.png)
13-
![](https://static-2.loacg.com/open/static/github/20180916-154950.png)
7+
![工作台](https://static-2.loacg.com/open/static/github/20180916-134306.png)
8+
9+
![个人设置](https://static-2.loacg.com/open/static/github/20180916-134251.png)
10+
11+
![内联编辑列表](https://static-2.loacg.com/open/static/github/20180916-155011.png)
12+
13+
![角色列表](https://static-2.loacg.com/open/static/github/20180916-154921.png)
14+
15+
![角色编辑](https://static-2.loacg.com/open/static/github/20180916-155317.png)
16+
17+
![权限列表](https://static-2.loacg.com/open/static/github/20180916-154937.png)
18+
19+
![权限编辑](https://static-2.loacg.com/open/static/github/20180916-154950.png)
1420

1521
## 环境和依赖
1622
- node
1723
- yarn
1824
- webpack
1925
- eslint
20-
- @vue/cli 3.0.3
21-
- [vue-cropper (头像裁剪组件)](https://github.com/xyxiao001/vue-cropper)
22-
- [@antv/g2] (https://antv.alipay.com/zh-cn/index.html)
23-
- [viser-vue (封装de antv/g2)](https://viserjs.github.io/docs.html#/viser/guide/installation)
26+
- @vue/cli 3.0.1
27+
- [vue-cropper](https://github.com/xyxiao001/vue-cropper) - 头像裁剪组件
28+
- [@antv/g2](https://antv.alipay.com/zh-cn/index.html) - Alipay AntV 数据可视化图表
29+
- [Viser-vue](https://viserjs.github.io/docs.html#/viser/guide/installation) - antv/g2 封装实现
30+
31+
32+
## 项目下载和运行
2433

34+
- 拉取项目代码
35+
```bash
36+
git clone https://github.com/sendya/ant-design-pro-vue.git
37+
cd ant-design-pro-vue
38+
```
2539

26-
## Project setup
40+
- 安装依赖
2741
```
2842
yarn install
2943
```
3044

31-
### Compiles and hot-reloads for development
45+
- 开发模式运行
3246
```
3347
yarn run serve
3448
```
3549

36-
### Compiles and minifies for production
50+
- 编译项目
3751
```
3852
yarn run build
3953
```
4054

41-
### Lints and fixes files
55+
- Lints and fixes files
4256
```
4357
yarn run lint
58+
```
59+
60+
61+
62+
## 其他说明
63+
64+
- 项目使用的 [vue-cli3](https://cli.vuejs.org/guide/), 请更新您的 cli
65+
66+
- 修改 Ant Design 配色
67+
在文件 vue.config.js 中,其他 less 变量覆盖参考 ant design 官方说明
68+
```ecmascript 6
69+
css: {
70+
loaderOptions: {
71+
less: {
72+
modifyVars: {
73+
/* less 变量覆盖,用于自定义 ant design 主题 */
74+
75+
'primary-color': '#F5222D',
76+
'link-color': '#F5222D',
77+
'border-radius-base': '4px',
78+
},
79+
javascriptEnabled: true,
80+
}
81+
}
82+
}
4483
```

src/components/layout/LayoutHeader.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,23 @@
7676
...mapActions(["Logout"]),
7777
...mapGetters(["nickname", "avatar"]),
7878
handleLogout() {
79-
this.Logout({}).then(() => {
80-
window.location.reload()
81-
}).catch(err => {
82-
this.$message.error(err.message)
83-
})
79+
const that = this
80+
81+
this.$confirm({
82+
title: '提示',
83+
content: '真的要注销登录吗 ?',
84+
onOk() {
85+
return that.Logout({}).then(() => {
86+
window.location.reload()
87+
}).catch(err => {
88+
that.$message.error({
89+
title: '错误',
90+
description: err.message
91+
})
92+
})
93+
},
94+
onCancel() {},
95+
});
8496
},
8597
toggle() {
8698
this.$emit('toggle')

src/views/list/RoleList.vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,13 @@
140140
label='拥有权限'
141141
hasFeedback
142142
>
143-
<a-row :gutter="16">
144-
<template v-for="(permission, index) in mdl.permissions">
145-
<a-col :span="4">
146-
{{ permission.permissionName }}:
147-
</a-col>
148-
<a-col :span="20">
149-
<a-checkbox-group :options="permission.actionsOptions"/>
150-
</a-col>
151-
</template>
143+
<a-row :gutter="16" v-for="(permission, index) in mdl.permissions" :key="index">
144+
<a-col :span="4">
145+
{{ permission.permissionName }}:
146+
</a-col>
147+
<a-col :span="20">
148+
<a-checkbox-group :options="permission.actionsOptions"/>
149+
</a-col>
152150
</a-row>
153151

154152
</a-form-item>

0 commit comments

Comments
 (0)