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 :permissions="permissions" :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="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@@ -10,7 +10,7 @@
</el-table-column>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<edit v-if="checkPermission(['ADMIN','PERMISSION_ALL','PERMISSION_EDIT'])" :permissions="permissions" :data="scope.row" :sup_this="sup_this"/>
<edit v-if="checkPermission(['ADMIN','PERMISSION_ALL','PERMISSION_EDIT'])" :data="scope.row" :sup_this="sup_this"/>
<el-popover
v-if="checkPermission(['ADMIN','PERMISSION_ALL','PERMISSION_DELETE'])"
:ref="scope.row.id"
@@ -34,7 +34,6 @@ import checkPermission from '@/utils/permission' // 权限判断函数
import treeTable from '@/components/TreeTable'
import initData from '@/mixins/initData'
import { del } from '@/api/permission'
import { getPermissionTree } from '@/api/permission'
import { parseTime } from '@/utils/index'
import eHeader from './module/header'
import edit from './module/edit'
@@ -53,11 +52,10 @@ export default {
value: 'alias'
}
],
delLoading: false, sup_this: this, permissions: []
delLoading: false, sup_this: this
}
},
created() {
this.getPermissions()
this.$nextTick(() => {
this.init()
})
@@ -90,14 +88,6 @@ export default {
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
getPermissions() {
getPermissionTree().then(res => {
this.permissions = []
const permission = { id: 0, label: '顶级类目', children: [] }
permission.children = res
this.permissions.push(permission)
})
}
}
}

View File

@@ -1,7 +1,7 @@
<template>
<div>
<el-button size="mini" type="success" @click="to">编辑</el-button>
<eForm ref="form" :permissions="permissions" :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
},
permissions: {
type: Array,
required: true
}
},
methods: {
to() {
const _this = this.$refs.form
_this.getPermissions()
_this.form = { id: this.data.id, name: this.data.name, alias: this.data.alias, pid: this.data.pid }
_this.dialog = true
}

View File

@@ -19,16 +19,12 @@
</template>
<script>
import { add, edit } from '@/api/permission'
import { add, edit, getPermissionTree } from '@/api/permission'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
components: { Treeselect },
props: {
permissions: {
type: Array,
required: true
},
isAdd: {
type: Boolean,
required: true
@@ -40,7 +36,7 @@ export default {
},
data() {
return {
loading: false, dialog: false,
loading: false, dialog: false, permissions: [],
form: { name: '', alias: '', pid: 0 },
rules: {
name: [
@@ -78,7 +74,6 @@ export default {
})
this.loading = false
this.$parent.$parent.init()
this.$parent.$parent.getPermissions()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
@@ -94,7 +89,6 @@ export default {
})
this.loading = false
this.sup_this.init()
this.sup_this.getPermissions()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
@@ -104,6 +98,14 @@ export default {
this.dialog = false
this.$refs['form'].resetFields()
this.form = { name: '', alias: '', pid: 0 }
},
getPermissions() {
getPermissionTree().then(res => {
this.permissions = []
const permission = { id: 0, label: '顶级类目', children: [] }
permission.children = res
this.permissions.push(permission)
})
}
}
}

View File

@@ -11,8 +11,8 @@
size="mini"
type="primary"
icon="el-icon-plus"
@click="$refs.form.dialog = true">新增</el-button>
<eForm ref="form" :permissions="permissions" :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
},
permissions: {
type: Array,
required: true
}
},
data() {
@@ -42,6 +38,10 @@ export default {
toQuery() {
this.$parent.page = 0
this.$parent.init()
},
add() {
this.$refs.form.getPermissions()
this.$refs.form.dialog = true
}
}
}