Skip to content

Commit afab1fd

Browse files
committed
Merge branch 'main' of github.com:flipped-aurora/gin-vue-admin
2 parents 1a56963 + dce0415 commit afab1fd

File tree

9 files changed

+124
-94
lines changed

9 files changed

+124
-94
lines changed

.github/workflows/build_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
node-version: [14.16.0]
23+
node-version: [16.8.0]
2424
steps:
2525
- name: Check out branch
2626
uses: actions/checkout@v2

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,10 @@
4242

4343
3.您完全可以通过我们的教程和文档完成一切操作,因此我们不再提供免费的技术服务,如需服务请进行[付费支持](https://www.gin-vue-admin.com/coffee/payment.html)
4444

45-
4.如果您将此项目用于商业用途,请遵守Apache2.0协议并保留作者技术支持声明。您需保留如下版权声明信息,其余信息功能不做任何限制。如需剔除请联系微信:shouzi_1994
45+
4.如果您将此项目用于商业用途,请遵守Apache2.0协议并保留作者技术支持声明。您需保留如下版权声明信息,其余信息功能不做任何限制。如需剔除请[购买授权](https://www.gin-vue-admin.com/empower/index.html)
4646

4747
<img src="https://qmplusimg.henrongyi.top/%E6%8E%88%E6%9D%83.png" width="1000">
4848

49-
5.如果您需要服务器的话 2核2G腾讯云服务器45元/年 在这里购买:https://cloud.tencent.com/act/new?fromSource=gwzcw.4325959.4325959.4325959&utm_medium=cps&utm_id=gwzcw.4325959.4325959.4325959&cps_key=962a7fdaa930cda1c06e36a7608e95cc
50-
51-
阿里云服务器 1c2g1m 38一年 在这里购买:https://www.aliyun.com/minisite/goods?userCode=xqe01uob
52-
5349
## 1. 基本介绍
5450

5551
### 1.1 项目介绍
@@ -86,11 +82,9 @@ Gin-vue-admin 的成长离不开大家的支持,如果你愿意为 gin-vue-adm
8682
## 2. 使用说明
8783

8884
```
89-
- node版本 > v12.18.3
85+
- node版本 > v16.8.3
9086
- golang版本 >= v1.16
9187
- IDE推荐:Goland
92-
- 初始化项目: 不同版本数据库初始化不通 参见 https://www.gin-vue-admin.com/docs/first_master
93-
- 替换掉项目中的七牛云公钥,私钥,仓名和默认url地址,以免发生测试文件数据错乱
9488
```
9589

9690
### 2.1 server项目
@@ -121,7 +115,7 @@ go build -o server main.go (windows编译命令为go build -o server.exe main.go
121115
cd web
122116

123117
# 安装依赖
124-
cnpm install || npm install
118+
npm install
125119

126120
# 启动web项目
127121
npm run serve
@@ -352,7 +346,7 @@ swag init
352346
353347
(5)gin-vue-admin 版本更新介绍视频
354348

355-
> bilibili:https://space.bilibili.com/322210472/channel/detail?cid=126418&ctype=0
349+
> bilibili:https://www.bilibili.com/video/BV1kv4y1g7nT
356350
357351
## 7. 联系方式
358352

@@ -384,12 +378,6 @@ swag init
384378

385379
如果你觉得这个项目对你有帮助,你可以请作者喝饮料 :tropical_drink: [点我](https://www.gin-vue-admin.com/coffee/index.html)
386380

387-
## 10. 友情链接
388-
389-
[H5-Dooring | H5页面制作神器](https://github.com/MrXujiang/h5-Dooring)
390-
391-
[go-zero 微服务框架|缩短从需求到上线的距离](https://github.com/zeromicro/go-zero)
392-
393-
## 11. 商用注意事项
381+
## 10. 商用注意事项
394382

395383
如果您将此项目用于商业用途,请遵守Apache2.0协议并保留作者技术支持声明。

web/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@
2323
"qs": "^6.8.0",
2424
"quill": "^1.3.7",
2525
"screenfull": "^5.0.2",
26-
"script-ext-html-webpack-plugin": "^2.1.4",
2726
"spark-md5": "^3.0.1",
2827
"vue": "^3.2.25",
2928
"vue-router": "^4.0.0-0"
3029
},
3130
"devDependencies": {
32-
"@vitejs/plugin-legacy": "^1.4.4",
33-
"@vitejs/plugin-vue": "^2.3.3",
31+
"@vitejs/plugin-legacy": "^2.0.0",
32+
"@vitejs/plugin-vue": "^3.0.1",
3433
"@vue/cli-plugin-babel": "~4.5.0",
3534
"@vue/cli-plugin-eslint": "~4.5.0",
3635
"@vue/cli-plugin-router": "~4.5.0",
@@ -43,9 +42,9 @@
4342
"dotenv": "^10.0.0",
4443
"eslint": "^6.7.2",
4544
"eslint-plugin-vue": "^7.0.0",
46-
"sass": "^1.26.5",
47-
"sass-loader": "^8.0.2",
48-
"vite": "^2.8.0",
45+
"sass": "^1.54.0",
46+
"terser": "^5.4.0",
47+
"vite": "^3.0.1",
4948
"vite-plugin-banner": "^0.1.3",
5049
"vite-plugin-importer": "^0.2.5"
5150
}

web/src/style/base.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.clearfix {
2-
*zoom: 1;
3-
}
4-
51
.clearfix:after {
62
content: '';
73
display: block;

web/src/style/button.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.sticky-button {
2+
position: sticky;
3+
top: 2px;
4+
z-index: 2;
5+
background-color: #fff;
6+
}
7+
.fitler{
8+
width: 60%;
9+
}

web/src/view/superAdmin/authority/authority.vue

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
</template>
8484
</el-dialog>
8585

86-
<el-drawer v-if="drawer" v-model="drawer" :with-header="false" size="40%" title="角色配置">
87-
<el-tabs :before-leave="autoEnter" class="role-box" type="border-card">
86+
<el-drawer v-if="drawer" v-model="drawer" custom-class="auth-drawer" :with-header="false" size="40%" title="角色配置">
87+
<el-tabs :before-leave="autoEnter" type="border-card">
8888
<el-tab-pane label="角色菜单">
8989
<Menus ref="menus" :row="activeRow" @changeRow="changeRow" />
9090
</el-tab-pane>
@@ -396,10 +396,15 @@ export default {
396396
}
397397
}
398398
}
399-
.role-box {
400-
.el-tabs__content {
401-
height: calc(100vh - 72px);
402-
overflow: auto;
399+
.tree-content{
400+
overflow: auto;
401+
height: calc(100vh - 100px);
402+
margin-top: 10px;
403+
}
404+
405+
.auth-drawer{
406+
.el-drawer__body{
407+
overflow: hidden;
403408
}
404409
}
405410
</style>

web/src/view/superAdmin/authority/components/apis.vue

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<template>
22
<div>
3-
<div class="clearfix">
3+
<div class="clearfix sticky-button">
4+
<el-input v-model="filterText" class="fitler" placeholder="筛选" />
45
<el-button class="fl-right" size="small" type="primary" @click="authApiEnter">确 定</el-button>
56
</div>
6-
<el-tree
7-
ref="apiTree"
8-
:data="apiTreeData"
9-
:default-checked-keys="apiTreeIds"
10-
:props="apiDefaultProps"
11-
default-expand-all
12-
highlight-current
13-
node-key="onlyId"
14-
show-checkbox
15-
@check="nodeChange"
16-
/>
7+
<div class="tree-content">
8+
<el-tree
9+
ref="apiTree"
10+
:data="apiTreeData"
11+
:default-checked-keys="apiTreeIds"
12+
:props="apiDefaultProps"
13+
default-expand-all
14+
highlight-current
15+
node-key="onlyId"
16+
show-checkbox
17+
:filter-node-method="filterNode"
18+
@check="nodeChange"
19+
/>
20+
</div>
1721
</div>
1822
</template>
1923
<script>
@@ -25,7 +29,7 @@ export default {
2529
<script setup>
2630
import { getAllApis } from '@/api/api'
2731
import { UpdateCasbin, getPolicyPathByAuthorityId } from '@/api/casbin'
28-
import { ref } from 'vue'
32+
import { ref, watch } from 'vue'
2933
import { ElMessage } from 'element-plus'
3034
const props = defineProps({
3135
row: {
@@ -40,7 +44,7 @@ const apiDefaultProps = ref({
4044
children: 'children',
4145
label: 'description'
4246
})
43-
47+
const filterText = ref('')
4448
const apiTreeData = ref([])
4549
const apiTreeIds = ref([])
4650
const activeUserId = ref('')
@@ -120,4 +124,16 @@ defineExpose({
120124
enterAndNext
121125
})
122126
127+
const filterNode = (value, data) => {
128+
if (!value) return true
129+
return data.description.indexOf(value) !== -1
130+
}
131+
watch(filterText, (val) => {
132+
apiTree.value.filter(val)
133+
})
134+
123135
</script>
136+
137+
<style lang="scss" scoped>
138+
@import "@/style/button.scss";
139+
</style>

web/src/view/superAdmin/authority/components/datas.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<template>
22
<div>
3-
<div class="clearfix" style="margin: 18px">
3+
<div class="clearfix sticky-button" style="margin: 18px">
44
<el-button class="fl-right" size="small" type="primary" @click="authDataEnter">确 定</el-button>
55
<el-button class="fl-left" size="small" type="primary" @click="all">全选</el-button>
66
<el-button class="fl-left" size="small" type="primary" @click="self">本角色</el-button>
77
<el-button class="fl-left" size="small" type="primary" @click="selfAndChildren">本角色及子角色</el-button>
88
</div>
9-
<el-checkbox-group v-model="dataAuthorityId" @change="selectAuthority">
10-
<el-checkbox v-for="(item,key) in authoritys" :key="key" :label="item">{{ item.authorityName }}</el-checkbox>
11-
</el-checkbox-group>
9+
<div class="tree-content">
10+
<el-checkbox-group v-model="dataAuthorityId" @change="selectAuthority">
11+
<el-checkbox v-for="(item,key) in authoritys" :key="key" :label="item">{{ item.authorityName }}</el-checkbox>
12+
</el-checkbox-group>
13+
</div>
1214
<warning-bar title="此功能仅用于创建角色和角色的many2many关系表,具体使用还须自己结合表实现业务,详情参考示例代码(客户示例)" />
1315
</div>
1416
</template>

web/src/view/superAdmin/authority/components/menus.vue

Lines changed: 57 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,51 @@
11
<template>
22
<div>
3-
<div class="clearfix">
3+
<div class="clearfix sticky-button">
4+
<el-input v-model="filterText" class="fitler" placeholder="筛选" />
45
<el-button class="fl-right" size="small" type="primary" @click="relation">确 定</el-button>
56
</div>
6-
<el-tree
7-
ref="menuTree"
8-
:data="menuTreeData"
9-
:default-checked-keys="menuTreeIds"
10-
:props="menuDefaultProps"
11-
default-expand-all
12-
highlight-current
13-
node-key="ID"
14-
show-checkbox
15-
@check="nodeChange"
16-
>
17-
<template #default="{ node , data }">
18-
<span class="custom-tree-node">
19-
<span>{{ node.label }}</span>
20-
<span>
21-
<el-button
22-
type="primary"
23-
link
24-
size="small"
25-
:style="{color:row.defaultRouter === data.name?'#E6A23C':'#85ce61'}"
26-
:disabled="!node.checked"
27-
@click="() => setDefault(data)"
28-
>
29-
{{ row.defaultRouter === data.name?"首页":"设为首页" }}
30-
</el-button>
31-
</span>
32-
<span v-if="data.menuBtn.length">
33-
<el-button
34-
type="primary"
35-
link
36-
size="small"
37-
@click="() => OpenBtn(data)"
38-
>
39-
分配按钮
40-
</el-button>
7+
<div class="tree-content">
8+
<el-tree
9+
ref="menuTree"
10+
:data="menuTreeData"
11+
:default-checked-keys="menuTreeIds"
12+
:props="menuDefaultProps"
13+
default-expand-all
14+
highlight-current
15+
node-key="ID"
16+
show-checkbox
17+
:filter-node-method="filterNode"
18+
@check="nodeChange"
19+
>
20+
<template #default="{ node , data }">
21+
<span class="custom-tree-node">
22+
<span>{{ node.label }}</span>
23+
<span>
24+
<el-button
25+
type="primary"
26+
link
27+
size="small"
28+
:style="{color:row.defaultRouter === data.name?'#E6A23C':'#85ce61'}"
29+
:disabled="!node.checked"
30+
@click="() => setDefault(data)"
31+
>
32+
{{ row.defaultRouter === data.name?"首页":"设为首页" }}
33+
</el-button>
34+
</span>
35+
<span v-if="data.menuBtn.length">
36+
<el-button
37+
type="primary"
38+
link
39+
size="small"
40+
@click="() => OpenBtn(data)"
41+
>
42+
分配按钮
43+
</el-button>
44+
</span>
4145
</span>
42-
</span>
43-
</template>
44-
</el-tree>
45-
46+
</template>
47+
</el-tree>
48+
</div>
4649
<el-dialog v-model="btnVisible" title="分配按钮" destroy-on-close>
4750
<el-table
4851
ref="btnTableRef"
@@ -70,8 +73,9 @@ import {
7073
updateAuthority
7174
} from '@/api/authority'
7275
import { getAuthorityBtnApi, setAuthorityBtnApi } from '@/api/authorityBtn'
73-
import { nextTick, ref } from 'vue'
76+
import { nextTick, ref, watch } from 'vue'
7477
import { ElMessage } from 'element-plus'
78+
7579
const props = defineProps({
7680
row: {
7781
default: function() {
@@ -82,7 +86,7 @@ const props = defineProps({
8286
})
8387
8488
const emit = defineEmits(['changeRow'])
85-
89+
const filterText = ref('')
8690
const menuTreeData = ref([])
8791
const menuTreeIds = ref([])
8892
const needConfirm = ref(false)
@@ -192,6 +196,16 @@ const enterDialog = async() => {
192196
}
193197
}
194198
199+
const filterNode = (value, data) => {
200+
if (!value) return true
201+
// console.log(data.mate.title)
202+
return data.meta.title.indexOf(value) !== -1
203+
}
204+
205+
watch(filterText, (val) => {
206+
menuTree.value.filter(val)
207+
})
208+
195209
</script>
196210

197211
<script>
@@ -202,6 +216,7 @@ export default {
202216
</script>
203217

204218
<style lang="scss" scope>
219+
@import "@/style/button.scss";
205220
.custom-tree-node{
206221
span+span{
207222
margin-left: 12px;

0 commit comments

Comments
 (0)