diff --git a/magic-boot-ui/src/components/Psyduck/pd-table-column.vue b/magic-boot-ui/src/components/Psyduck/pd-table-column.vue
index 7c6b139..2b17896 100644
--- a/magic-boot-ui/src/components/Psyduck/pd-table-column.vue
+++ b/magic-boot-ui/src/components/Psyduck/pd-table-column.vue
@@ -29,6 +29,7 @@
+
{{ scope.row[col.field] }}
diff --git a/magic-boot-ui/src/icons/svg/dict.svg b/magic-boot-ui/src/icons/svg/dict.svg
new file mode 100644
index 0000000..a5bd659
--- /dev/null
+++ b/magic-boot-ui/src/icons/svg/dict.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/magic-boot-ui/src/icons/svg/examples.svg b/magic-boot-ui/src/icons/svg/examples.svg
new file mode 100644
index 0000000..c30cc01
--- /dev/null
+++ b/magic-boot-ui/src/icons/svg/examples.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/magic-boot-ui/src/icons/svg/home.svg b/magic-boot-ui/src/icons/svg/home.svg
new file mode 100644
index 0000000..57cbfc4
--- /dev/null
+++ b/magic-boot-ui/src/icons/svg/home.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/magic-boot-ui/src/icons/svg/menu.svg b/magic-boot-ui/src/icons/svg/menu.svg
new file mode 100644
index 0000000..b687061
--- /dev/null
+++ b/magic-boot-ui/src/icons/svg/menu.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/magic-boot-ui/src/icons/svg/role.svg b/magic-boot-ui/src/icons/svg/role.svg
new file mode 100644
index 0000000..34cffeb
--- /dev/null
+++ b/magic-boot-ui/src/icons/svg/role.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/magic-boot-ui/src/scripts/common.js b/magic-boot-ui/src/scripts/common.js
index c912ebc..e65d4df 100644
--- a/magic-boot-ui/src/scripts/common.js
+++ b/magic-boot-ui/src/scripts/common.js
@@ -121,12 +121,8 @@ common.objAssign = (obj1, obj2) => {
}
}
-common.copyNewObject = (obj) => {
- var newObj = {}
- for (var key in obj) {
- newObj[key] = obj[key]
- }
- return newObj
+common.copyNew = (obj) => {
+ return JSON.parse(JSON.stringify(obj))
}
common.getParam = (data) => {
diff --git a/magic-boot-ui/src/views/system/menu/menu-list.vue b/magic-boot-ui/src/views/system/menu/menu-list.vue
index db7d4b8..e63396c 100644
--- a/magic-boot-ui/src/views/system/menu/menu-list.vue
+++ b/magic-boot-ui/src/views/system/menu/menu-list.vue
@@ -1,17 +1,18 @@
-
-
-
- 添加菜单
-
+
+
+
+
+
+
+ 添加菜单
+
+
+
-
+
@@ -63,6 +64,8 @@ export default {
components: { MenuIcons },
data() {
return {
+ menuData: [],
+ searchValue: '',
tableOptions: {
el: {
'default-expand-all': true,
@@ -70,13 +73,13 @@ export default {
'row-key': 'id'
},
showNo: false,
- url: 'menu/tree',
page: false,
cols: [
{
field: 'name',
title: '菜单名称',
- align: 'left'
+ align: 'left',
+ type: 'html'
},
{
field: 'url',
@@ -89,6 +92,15 @@ export default {
width: 150,
align: 'left'
},
+ {
+ field: 'icon',
+ title: '图标',
+ width: 45,
+ align: 'left',
+ templet: (row) => {
+ return this.generateIconCode(row.icon)
+ }
+ },
{
field: 'sort',
title: '排序',
@@ -156,7 +168,34 @@ export default {
}
}
},
+ mounted() {
+ this.reloadTable()
+ },
methods: {
+ searchMenu() {
+ this.$set(this.tableOptions, 'data', this.recursionSearch(this.$common.copyNew(this.menuData), this.searchValue))
+ },
+ recursionSearch(data, text){
+ var searchData = []
+ for(var i in data){
+ var treeNode = data[i]
+ var children = treeNode.children
+ if(children && children.length > 0){
+ var childrenSearch = this.recursionSearch(children, text)
+ treeNode.children = childrenSearch && childrenSearch.length > 0 ? childrenSearch : treeNode.children
+ if(treeNode.name.indexOf(text) != -1 || childrenSearch.length > 0){
+ treeNode.name = treeNode.name.replace(text, `${text}`)
+ searchData.push(treeNode)
+ }
+ }else{
+ if(treeNode.name.indexOf(text) != -1){
+ treeNode.name = treeNode.name.replace(text, `${text}`)
+ searchData.push(treeNode)
+ }
+ }
+ }
+ return searchData
+ },
generateIconCode(symbol) {
return ``
},
@@ -217,7 +256,10 @@ export default {
})
},
reloadTable() {
- this.$refs.table.reloadList()
+ this.$get('menu/tree').then(res => {
+ this.menuData = res.data.list
+ this.$set(this.tableOptions, 'data', this.menuData)
+ })
},
handleUpdate(row) {
for (var t in this.temp) {