1.7版本发布,详情查看版本说明

This commit is contained in:
zhengjie
2019-04-11 11:15:30 +08:00
parent 0642c46288
commit 94585f26f0
86 changed files with 2287 additions and 537 deletions

View File

@@ -1,8 +1,8 @@
<template>
<div class="app-container">
<eHeader :menus="menus" :query="query"/>
<eHeader :query="query"/>
<!--表格渲染-->
<tree-table v-loading="loading" :data="data" :expand-all="true" :columns="columns" border size="small">
<tree-table v-loading="loading" :data="data" :expand-all="true" :columns="columns" size="small">
<el-table-column prop="icon" label="图标" align="center" width="80px">
<template slot-scope="scope">
<svg-icon :icon-class="scope.row.icon" />
@@ -28,7 +28,7 @@
</el-table-column>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<edit v-if="checkPermission(['ADMIN','MENU_ALL','MENU_EDIT'])" :menus="menus" :data="scope.row" :sup_this="sup_this"/>
<edit v-if="checkPermission(['ADMIN','MENU_ALL','MENU_EDIT'])" :data="scope.row" :sup_this="sup_this"/>
<el-popover
v-if="checkPermission(['ADMIN','MENU_ALL','MENU_DELETE'])"
:ref="scope.row.id"
@@ -51,7 +51,7 @@
import checkPermission from '@/utils/permission' // 权限判断函数
import treeTable from '@/components/TreeTable'
import initData from '@/mixins/initData'
import { del, getMenusTree } from '@/api/menu'
import { del } from '@/api/menu'
import { parseTime } from '@/utils/index'
import eHeader from './module/header'
import edit from './module/edit'
@@ -66,11 +66,10 @@ export default {
value: 'name'
}
],
delLoading: false, sup_this: this, menus: []
delLoading: false, sup_this: this
}
},
created() {
this.getMenus()
this.$nextTick(() => {
this.init()
})
@@ -103,14 +102,6 @@ export default {
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
getMenus() {
getMenusTree().then(res => {
this.menus = []
const menu = { id: 0, label: '顶级类目', children: [] }
menu.children = res
this.menus.push(menu)
})
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<div>
<el-button size="mini" type="success" @click="to">编辑</el-button>
<eForm ref="form" :menus="menus" :sup_this="sup_this" :is-add="false"/>
<eForm ref="form" :sup_this="sup_this" :is-add="false"/>
</div>
</template>
<script>
@@ -16,15 +16,12 @@ export default {
sup_this: {
type: Object,
required: true
},
menus: {
type: Array,
required: true
}
},
methods: {
to() {
const _this = this.$refs.form
_this.getMenus()
_this.form = { id: this.data.id, component: this.data.component, name: this.data.name, sort: this.data.sort, pid: this.data.pid, path: this.data.path, iframe: this.data.iframe.toString(), roles: [], icon: this.data.icon }
_this.dialog = true
}

View File

@@ -42,17 +42,13 @@
</template>
<script>
import { add, edit } from '@/api/menu'
import { add, edit, getMenusTree } from '@/api/menu'
import Treeselect from '@riophae/vue-treeselect'
import IconSelect from '@/components/IconSelect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
components: { Treeselect, IconSelect },
props: {
menus: {
type: Array,
required: true
},
isAdd: {
type: Boolean,
required: true
@@ -64,7 +60,7 @@ export default {
},
data() {
return {
loading: false, dialog: false,
loading: false, dialog: false, menus: [],
form: { name: '', sort: 999, path: '', component: '', iframe: 'false', roles: [], pid: 0, icon: '' },
rules: {
name: [
@@ -105,7 +101,6 @@ export default {
})
this.loading = false
this.$parent.$parent.init()
this.$parent.$parent.getMenus()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
@@ -121,7 +116,6 @@ export default {
})
this.loading = false
this.sup_this.init()
this.sup_this.getMenus()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
@@ -134,6 +128,14 @@ export default {
},
selected(name) {
this.form.icon = name
},
getMenus() {
getMenusTree().then(res => {
this.menus = []
const menu = { id: 0, label: '顶级类目', children: [] }
menu.children = res
this.menus.push(menu)
})
}
}
}

View File

@@ -11,8 +11,8 @@
size="mini"
type="primary"
icon="el-icon-plus"
@click="$refs.form.dialog = true">新增</el-button>
<eForm ref="form" :menus="menus" :is-add="true"/>
@click="add">新增</el-button>
<eForm ref="form" :is-add="true"/>
</div>
</div>
</template>
@@ -26,10 +26,6 @@ export default {
query: {
type: Object,
required: true
},
menus: {
type: Array,
required: true
}
},
data() {
@@ -42,6 +38,10 @@ export default {
toQuery() {
this.$parent.page = 0
this.$parent.init()
},
add() {
this.$refs.form.getMenus()
this.$refs.form.dialog = true
}
}
}