From 832100f39db5303e949d4414616e49384ed308e5 Mon Sep 17 00:00:00 2001
From: pixel <303176530@qq.com>
Date: Fri, 17 Apr 2020 14:15:41 +0800
Subject: [PATCH 1/9] =?UTF-8?q?=E8=8F=9C=E5=8D=95=20=E8=A7=92=E8=89=B2?=
=?UTF-8?q?=E9=80=89=E6=8B=A9=E6=9B=B4=E6=94=B9=E4=B8=BA=E6=A0=91=E5=BD=A2?=
=?UTF-8?q?=E9=80=89=E6=8B=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../view/superAdmin/authority/authority.vue | 88 +++++++++----------
web/src/view/superAdmin/menu/menu.vue | 88 ++++++++-----------
web/src/view/superAdmin/user/user.vue | 71 ++++++++-------
3 files changed, 118 insertions(+), 129 deletions(-)
diff --git a/web/src/view/superAdmin/authority/authority.vue b/web/src/view/superAdmin/authority/authority.vue
index 56cfde31..09053280 100644
--- a/web/src/view/superAdmin/authority/authority.vue
+++ b/web/src/view/superAdmin/authority/authority.vue
@@ -27,20 +27,14 @@
-
-
-
+
+
@@ -218,60 +212,58 @@ export default {
}
})
},
- getAuthorityList(AuthorityData){
- AuthorityData.map(item=>{
- this.AuthorityOption.push({
- authorityId:item.authorityId,
- authorityName:item.authorityName
- })
- if(item.children){
- this.getAuthorityList(item.children)
+ setOptions(){
+ this.AuthorityOption = [{
+ authorityId:"0",
+ authorityName:"根角色"
+ }]
+ this.setAuthorityOptions(this.tableData,this.AuthorityOption,false)
+ },
+ setAuthorityOptions(AuthorityData,optionsData,disabled){
+ AuthorityData&&AuthorityData.map(item=>{
+ if(item.children.length){
+ const option = {
+ authorityId:item.authorityId,
+ authorityName:item.authorityName,
+ disabled:disabled||item.authorityId == this.form.authorityId,
+ children:[]
+ }
+ this.setAuthorityOptions(item.children,option.children,disabled||item.authorityId == this.form.authorityId)
+ optionsData.push(option)
+ }else{
+ const option = {
+ authorityId:item.authorityId,
+ authorityName:item.authorityName,
+ disabled:disabled||item.authorityId == this.form.authorityId,
+ }
+ optionsData.push(option)
}
})
},
- findAuthoritySelf(authority,authData,outData){
- authData.some(item=>{
- if(item.authorityId == authority.authorityId){
- outData.push(item)
- return true
- }
- this.findAuthoritySelf(authority,item.children,outData)
- })
- },
- findAllChild(authority,array){
- authority&&authority.map(item=>{
- array.push(item.authorityId)
- this.findAllChild(item.children,array)
- })
- },
- canSelect(authority){
- const array = []
- const arrayIds = []
- this.findAuthoritySelf({authorityId:this.form.authorityId},this.tableData,array)
- this.findAllChild(array,arrayIds)
- return arrayIds.indexOf(authority.authorityId)>-1
- },
// 增加角色
addAuthority(parentId) {
- this. dialogTitle = "新增角色"
+ this.dialogTitle = "新增角色"
this.dialogType = "add"
this.form.parentId = parentId
+ this.setOptions()
this.dialogFormVisible = true
+
},
- // 增加角色
+ // 编辑角色
editAuthority(row) {
- this. dialogTitle = "编辑角色"
+ this.setOptions()
+ this.dialogTitle = "编辑角色"
this.dialogType = "edit"
for(let key in this.form){
this.form[key] = row[key]
}
+ this.setOptions()
this.dialogFormVisible = true
}
},
async created() {
this.pageSize = 999
await this.getTableData()
- this.getAuthorityList(this.tableData)
}
}
diff --git a/web/src/view/superAdmin/menu/menu.vue b/web/src/view/superAdmin/menu/menu.vue
index 7c742f0e..76fd5881 100644
--- a/web/src/view/superAdmin/menu/menu.vue
+++ b/web/src/view/superAdmin/menu/menu.vue
@@ -47,21 +47,14 @@
-
-
-
-
+
+
@@ -143,6 +136,34 @@ export default {
}
},
methods: {
+ setOptions(){
+ this.menuOption = [{
+ ID:"0",
+ title:"根目录"
+ }]
+ this.setMenuOptions(this.tableData,this.menuOption,false)
+ },
+ setMenuOptions(menuData,optionsData,disabled){
+ menuData&&menuData.map(item=>{
+ if(item.children.length){
+ const option = {
+ title:item.meta.title,
+ ID:String(item.ID),
+ disabled:disabled||item.ID == this.form.ID,
+ children:[]
+ }
+ this.setMenuOptions(item.children,option.children,disabled||item.ID == this.form.ID)
+ optionsData.push(option)
+ }else{
+ const option = {
+ title:item.meta.title,
+ ID:String(item.ID),
+ disabled:disabled||item.ID == this.form.ID,
+ }
+ optionsData.push(option)
+ }
+ })
+ },
handleClose(done) {
this.initForm()
done()
@@ -239,6 +260,7 @@ export default {
this.dialogTitle = "新增菜单"
this.form.parentId = String(id)
this.isEdit = false
+ this.setOptions()
this.dialogFormVisible = true
},
// 修改菜单方法
@@ -246,41 +268,9 @@ export default {
this.dialogTitle = "编辑菜单"
const res = await getBaseMenuById({ id })
this.form = res.data.menu
- this.dialogFormVisible = true
this.isEdit = true
- },
- getMenuList(MenuData){
- MenuData.map(item=>{
- this.menuOption.push({
- ID:String(item.ID),
- title:item.meta.title
- })
- if(item.children){
- this.getMenuList(item.children)
- }
- })
- },
- findAuthoritySelf(mune,muneData,outData){
- muneData&&muneData.some(item=>{
- if(item.ID == mune.ID){
- outData.push(item)
- return true
- }
- this.findAuthoritySelf(mune,item.children,outData)
- })
- },
- findAllChild(menu,array){
- menu&&menu.map(item=>{
- array.push(String(item.ID))
- this.findAllChild(item.children,array)
- })
- },
- canSelect(authority){
- const array = []
- const arrayIds = []
- this.findAuthoritySelf({ID:this.form.ID},this.tableData,array)
- this.findAllChild(array,arrayIds)
- return arrayIds.indexOf(authority.ID)>-1
+ this.setOptions()
+ this.dialogFormVisible = true
},
},
async created() {
diff --git a/web/src/view/superAdmin/user/user.vue b/web/src/view/superAdmin/user/user.vue
index 7d5be00a..b1ede5ba 100644
--- a/web/src/view/superAdmin/user/user.vue
+++ b/web/src/view/superAdmin/user/user.vue
@@ -16,18 +16,14 @@
-
-
-
+ v-model="scope.row.authority.authorityId"
+ :options="authOptions"
+ :show-all-levels="false"
+ :props="{ checkStrictly: true,label:'authorityName',value:'authorityId',disabled:'disabled',emitPath:false}"
+ filterable>
+
@@ -82,14 +78,14 @@
-
-
-
+
+
-
+
-
@@ -114,7 +114,7 @@ export default {
}
]
},
-
+
}
},
components: {
@@ -216,6 +216,9 @@ $mainHight: 100vh;
.dropdown-group {
min-width: 100px;
}
+.admin-box{
+ background-color: rgb(243,243,243);
+}
.el-scrollbar__wrap {
padding-bottom: 17px;
}
@@ -318,4 +321,4 @@ $mainHight: 100vh;
}
}
}
-
\ No newline at end of file
+
From a766be61d836a63784027dd3db9cc39af20866c7 Mon Sep 17 00:00:00 2001
From: QM303176530 <303176530@qq.com>
Date: Fri, 17 Apr 2020 21:45:29 +0800
Subject: [PATCH 3/9] =?UTF-8?q?=E8=BF=98=E5=8E=9Fdbname?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
server/config.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/config.yaml b/server/config.yaml
index c0bfed12..02631245 100644
--- a/server/config.yaml
+++ b/server/config.yaml
@@ -13,7 +13,7 @@ mysql:
username: root
password: 'Aa@6447985'
path: '127.0.0.1:3306'
- db-name: 'yx'
+ db-name: 'qmplus'
config: 'charset=utf8&parseTime=True&loc=Local'
max-idle-conns: 10
max-open-conns: 10
From 992b8446cf6606f8d9d8d4f1489cded95e8e0513 Mon Sep 17 00:00:00 2001
From: QM303176530 <303176530@qq.com>
Date: Fri, 17 Apr 2020 23:31:08 +0800
Subject: [PATCH 4/9] =?UTF-8?q?=E6=9A=82=E6=97=B6=E9=9A=90=E8=97=8F?=
=?UTF-8?q?=E9=9F=B3=E4=B9=90=E6=92=AD=E6=94=BE=E5=99=A8=20=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E5=85=A8=E5=B1=80css?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/view/dashboard/index.vue | 9 +++++----
web/src/view/example/breakpoint/breakpoint.vue | 4 ++--
web/src/view/layout/index.vue | 2 +-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/web/src/view/dashboard/index.vue b/web/src/view/dashboard/index.vue
index 7c4213a2..3288211a 100644
--- a/web/src/view/dashboard/index.vue
+++ b/web/src/view/dashboard/index.vue
@@ -22,7 +22,7 @@
-
+
@@ -45,7 +45,7 @@ require('echarts/theme/macarons') // echarts theme
import RaddarChart from "./component/RaddarChart"
import stackMap from "./component/stackMap"
import Sunburst from "./component/Sunburst"
-import musicPlayer from "./component/musicPlayer"
+// import musicPlayer from "./component/musicPlayer"
export default {
name: 'Dashboard',
data() {
@@ -57,7 +57,7 @@ export default {
RaddarChart, //雷达图
stackMap, //堆叠图
Sunburst, //旭日图
- musicPlayer //音乐播放器
+ // musicPlayer //音乐播放器
},
mounted() {
let myChart = echarts.init(document.getElementById('main'),'macarons');
@@ -165,6 +165,7 @@ export default {