Commit 748a4b95 by 胡悦

添加回车事件、修改样式、添加必填等

1 parent fd62a72f
......@@ -8,7 +8,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"glsx-vue-common": "^1.1.17",
"glsx-vue-common": "^1.1.19",
"glsx-vue-components": "^1.0.15",
"node-sass": "^4.9.3",
"sass-loader": "^7.1.0",
......
......@@ -23,7 +23,7 @@ const userDetailColumn = [{
label: '管理员',
prop: 'isadmin',
formatter: (cellValue) => {
return cellValue < 1 ? '否' : '是'
return cellValue.isadmin < 1 ? '否' : '是'
}
}, {
label: '手机号码',
......
......@@ -6,7 +6,7 @@
<div><gl-button @click="pushSublings" type='primary' :disabled="value.push">添加同级菜单</gl-button></div>
<div><gl-button @click="pushChildren" type='primary' :disabled="value.push">添加子菜单</gl-button></div>
</div>
<gl-scroll :height='parseInt(this.$client_height() - this.height - 60)'>
<gl-scroll :height='parseInt(this.$client_height() - this.height - 108)'>
<tree
ref='tree'
@node-click='nodeClick'
......@@ -43,6 +43,7 @@ export default {
eventBus: Object
},
mounted() {
console.log()
this.height = this.$refs.topInfo.offsetHeight
},
methods: {
......
......@@ -158,21 +158,21 @@ export default {
})
: delMenu.req({ menuId: obj.id }).then(res => {
this.delLoading = false
this.delTip(true)
this.delTip(true, '删除成功,首页查看需重新登录')
}).catch(err => {
this.delLoading = false
console.log(err)
this.delErrTip()
})
},
delTip(val) {
delTip(val, tips) {
if (val) {
const parent = this.value.node.parent
const children = parent.data.children || parent.data
const index = children.findIndex(d => d.id === this.value.data.id)
children.splice(index, 1)
this.$notify({
title: '删除成功',
title: tips || '删除成功',
type: 'success'
})
this.value.showDetails = false
......@@ -199,8 +199,10 @@ export default {
if (this.value.sublings) {
if (treeData.parent === '#') {
obj.parentId = 0
obj.grade = 0
} else {
obj.parentId = treeData.parent
obj.grade = this.menu.grade
}
this.addData(obj)
// 添加子级
......@@ -213,7 +215,7 @@ export default {
if (!this.isDepart) {
editMenu.req(obj).then(res => {
this.subLoading = false
this.Tip(true)
this.Tip(true, '操作成功,首页查看需重新登录')
}).catch(err => {
console.log(err)
this.subLoading = false
......@@ -241,7 +243,7 @@ export default {
if (!this.isDepart) {
addMenu.req(obj).then(res => {
this.subLoading = false
this.Tip(true)
this.Tip(true, '操作成功,首页查看需重新登录')
}).catch(err => {
this.subLoading = false
console.log(err)
......@@ -256,10 +258,10 @@ export default {
this.addOrEditDepart(obj)
}
},
Tip(val) {
Tip(val, tips) {
if (val) {
this.$notify({
title: '操作成功',
title: tips || '操作成功',
type: 'success'
})
this.value.showDetails = false
......
......@@ -3,13 +3,17 @@
<gl-dialog title="角色列表" :visible.sync="detailVisible" :before-close="handleDetailCancel">
<gl-form label-width="105px">
<gl-form-item label="角色名称:">
<span>{{roleParam.roleName}}</span>
<span style="line-height:40px;">{{roleParam.roleName}}</span>
</gl-form-item>
<gl-form-item label="角色描述:">
<span style="word-wrap: break-word;">{{roleParam.description}}</span>
<div style="padding-top:10px;">
<span style="word-wrap: break-word;">{{roleParam.description}}</span>
</div>
</gl-form-item>
<gl-form-item label="菜单选项:">
<tree ref='tree' :propsData="roleMenuTree" :defaultExpandAll="defaultExpandAll" style="height:160px;overflow-y: auto;"></tree>
<div style="padding-top:10px;">
<tree ref='tree' :propsData="roleMenuTree" :defaultExpandAll="defaultExpandAll" style="height:160px;overflow-y: auto;"></tree>
</div>
</gl-form-item>
</gl-form>
</gl-dialog>
......
......@@ -75,18 +75,20 @@
</gl-col>
<gl-col :span="12">
<gl-form-item label="状态" prop="state">
<gl-select v-model="userManageForm.state" placeholder="启用">
<gl-select v-model="userManageForm.state" data-vv-as="状态" name="state" v-validate="'required'">
<gl-option label="禁用" value='0'></gl-option>
<gl-option label="启用" value='1'></gl-option>
</gl-select>
<span v-show="errorBags.has('state')" class="error">{{ errorBags.first('state') }}</span>
</gl-form-item>
</gl-col>
<gl-col :span="12">
<gl-form-item label="管理员">
<gl-select v-model="userManageForm.isadmin" placeholder="否">
<gl-form-item label="管理员" prop="isadmin">
<gl-select v-model="userManageForm.isadmin" data-vv-as="管理员" name="isadmin" v-validate="'required'">
<gl-option label="否" value='0'></gl-option>
<gl-option label="是" value='1'></gl-option>
</gl-select>
<span v-show="errorBags.has('isadmin')" class="error">{{ errorBags.first('isadmin') }}</span>
</gl-form-item>
</gl-col>
<gl-col :span="24">
......@@ -182,6 +184,12 @@ export default {
email: [
{ required: true }
],
state: [
{ required: true }
],
isadmin: [
{ required: true }
],
departName: [
{ required: true }
],
......
......@@ -2,8 +2,8 @@
<template>
<div>
<div class="default m-b20">
<gl-input class="search-w250" placeholder="请输入角色名称" v-model="roleName" clearable></gl-input>
<gl-button type="primary" @click="handleSearchRoleName">搜索</gl-button>
<gl-input class="search-w250" placeholder="请输入角色名称" @keyup.enter.native="handleSearchRoleName" v-model="roleName" clearable></gl-input>
<gl-button type="primary" @keyup.enter="handleSearchRoleName" @click="handleSearchRoleName">搜索</gl-button>
</div>
<div class="default p-t15">
<gl-button class="control-tabledata-button" size="small" @click="handleCreateOrEdit(flagCOrE = true)">创建</gl-button>
......@@ -88,6 +88,7 @@ export default {
roleData: {
border: true,
height: parseInt(this.$client_height() - 140),
align: 'center',
data: [],
column: roleDataColumn,
console: {
......@@ -125,6 +126,13 @@ export default {
}
}
},
created() {
document.onkeydown = e => {
if (e.keyCode === 13) {
this.handleSearchRoleName()
}
}
},
mounted() {
this.getList()
this.getdepartData()
......
......@@ -2,8 +2,8 @@
<template>
<div>
<div class="default m-b20">
<gl-input class="search-w250" placeholder="请输入用户名或姓名" v-model="userName" clearable></gl-input>
<gl-button type="primary" @click="finduserName">搜索</gl-button>
<gl-input class="search-w250" @keyup.enter.native="finduserName" placeholder="请输入用户名或姓名" v-model="userName" clearable></gl-input>
<gl-button type="primary" @keyup.enter="finduserName" @click="finduserName">搜索</gl-button>
</div>
<div class="default p-t15">
<div class="control-tabledata-button">
......@@ -173,6 +173,13 @@ export default {
}
}
},
created() {
document.onkeydown = e => {
if (e.keyCode === 13) {
this.finduserName()
}
}
},
mounted() {
this.findUserList()
this.getRoleOptions()
......@@ -369,6 +376,7 @@ export default {
})
},
findRolesName(params) {
if (!params) return null
var nameArray = []
const userRoles = params.split(',')
userRoles.forEach(userItem => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!