Browse Source

用户和角色增删改查修改

dev
hosinokamui 6 years ago
parent
commit
955f3e0c7b
  1. 9
      epmet-oper-web/package-lock.json
  2. 2
      epmet-oper-web/public/index.html
  3. 60
      epmet-oper-web/src/views/modules/sys/role-add-or-update.vue
  4. 4
      epmet-oper-web/src/views/modules/sys/role.vue
  5. 12
      epmet-oper-web/src/views/modules/sys/user-add-or-update.vue

9
epmet-oper-web/package-lock.json

@ -5365,6 +5365,15 @@
"integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=",
"dev": true
},
"dai-js": {
"version": "0.0.12",
"resolved": "https://registry.npm.taobao.org/dai-js/download/dai-js-0.0.12.tgz",
"integrity": "sha1-Yk4eqh6Q5p2bFrYcl3cUDIZoF70=",
"dev": true,
"requires": {
"babel-runtime": "^6.11.6"
}
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",

2
epmet-oper-web/public/index.html

@ -29,7 +29,7 @@
<!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>window.SITE_CONFIG['apiURL'] = 'http://10.10.10.77:8080/api';</script>
<script>window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/api';</script>
<% } %>
<!-- 集成测试环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>

60
epmet-oper-web/src/views/modules/sys/role-add-or-update.vue

@ -20,18 +20,18 @@
</el-tree>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item size="mini" :label="$t('role.deptList')">
<el-tree
:data="deptList"
:props="{ label: 'name', children: 'children' }"
node-key="id"
ref="deptListTree"
accordion
show-checkbox>
</el-tree>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item size="mini" :label="$t('role.deptList')">-->
<!-- <el-tree-->
<!-- :data="deptList"-->
<!-- :props="{ label: 'name', children: 'children' }"-->
<!-- node-key="id"-->
<!-- ref="deptListTree"-->
<!-- accordion-->
<!-- show-checkbox>-->
<!-- </el-tree>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
</el-form>
<template slot="footer">
@ -48,12 +48,12 @@ export default {
return {
visible: false,
menuList: [],
deptList: [],
// deptList: [],
dataForm: {
id: '',
name: '',
menuIdList: [],
deptIdList: [],
// deptIdList: [],
remark: ''
}
}
@ -73,10 +73,10 @@ export default {
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs.menuListTree.setCheckedKeys([])
this.$refs.deptListTree.setCheckedKeys([])
// this.$refs.deptListTree.setCheckedKeys([])
Promise.all([
this.getMenuList(),
this.getDeptList()
this.getMenuList()
// this.getDeptList()
]).then(() => {
if (this.dataForm.id) {
this.getInfo()
@ -86,7 +86,7 @@ export default {
},
//
getMenuList () {
return this.$http.get('/sys/menu/select').then(({ data: res }) => {
return this.$http.get('/oper/access/menu/select').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -94,17 +94,17 @@ export default {
}).catch(() => {})
},
//
getDeptList () {
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.deptList = res.data
}).catch(() => {})
},
// getDeptList () {
// return this.$http.get('/sys/dept/list').then(({ data: res }) => {
// if (res.code !== 0) {
// return this.$message.error(res.msg)
// }
// this.deptList = res.data
// }).catch(() => {})
// },
//
getInfo () {
this.$http.get(`/sys/role/${this.dataForm.id}`).then(({ data: res }) => {
this.$http.get(`/oper/access/operrole/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
@ -113,7 +113,7 @@ export default {
...res.data
}
this.dataForm.menuIdList.forEach(item => this.$refs.menuListTree.setChecked(item, true))
this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList)
// this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList)
}).catch(() => {})
},
//
@ -126,8 +126,8 @@ export default {
...this.$refs.menuListTree.getCheckedKeys(),
...this.$refs.menuListTree.getHalfCheckedKeys()
]
this.dataForm.deptIdList = this.$refs.deptListTree.getCheckedKeys()
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/role', this.dataForm).then(({ data: res }) => {
// this.dataForm.deptIdList = this.$refs.deptListTree.getCheckedKeys()
this.$http[!this.dataForm.id ? 'post' : 'put']('/oper/access/operrole', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}

4
epmet-oper-web/src/views/modules/sys/role.vue

@ -56,9 +56,9 @@ export default {
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/sys/role/page',
getDataListURL: '/oper/access/operrole/page',
getDataListIsPage: true,
deleteURL: '/sys/role',
deleteURL: '/oper/access/operrole',
deleteIsBatch: true
},
dataForm: {

12
epmet-oper-web/src/views/modules/sys/user-add-or-update.vue

@ -26,7 +26,7 @@
<el-form-item prop="email" :label="$t('user.email')">
<el-input v-model="dataForm.email" :placeholder="$t('user.email')"></el-input>
</el-form-item>
<el-form-item prop="mobile" :label="$t('user.mobile')">
<el-form-item prop="phone" :label="$t('user.mobile')">
<el-input v-model="dataForm.phone" :placeholder="$t('user.mobile')"></el-input>
</el-form-item>
<el-form-item prop="roleIdList" :label="$t('user.roleIdList')" class="role-list">
@ -100,26 +100,20 @@ export default {
callback()
}
return {
username: [
realName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
deptName: [
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
],
password: [
{ validator: validatePassword, trigger: 'blur' }
],
confirmPassword: [
{ validator: validateConfirmPassword, trigger: 'blur' }
],
realName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
email: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateEmail, trigger: 'blur' }
],
mobile: [
phone: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateMobile, trigger: 'blur' }
]

Loading…
Cancel
Save