Commit c657ad49 by cwq0219

Merge branch 'master' of https://github.com/glsx-web/authority

2 parents b4e126f3 dc5dc3d8
......@@ -4,6 +4,7 @@
<el-col :span="12">
<gl-form-item label="用户名" prop="username">
<gl-input v-model="userManageForm.username" clearable></gl-input>
<!-- <input v-color="red" /> -->
<!-- <div v-show="!isEdit" class="err">{{msg}}</div> -->
</gl-form-item>
</el-col>
......@@ -27,7 +28,7 @@
</gl-col>
<gl-col :span="12">
<gl-form-item label="注册IP" prop="joinip">
<gl-masked v-model="userManageForm.joinip" :mask="tel" placeholder='请输入手机号码' clearable></gl-masked>
<gl-masked v-model="userManageForm.joinip" :mask="tel" placeholder='请输入注册IP' clearable></gl-masked>
<!-- <gl-input v-model="userManageForm.joinip" clearable></gl-input> -->
</gl-form-item>
</gl-col>
......@@ -59,6 +60,7 @@
<tree ref='tree' :isDepart="isDepart" :defaultExpandAll="defaultExpandAll" @node-click='clickDepart' style="height:160px"></tree>
</gl-option>
</gl-select>
<gl-input-tree :data='data' :props='props' :treeStyle='{ maxHeight: "160px" }' v-model="userManageForm.departName" />
<!-- <gl-select v-model="userManageForm.departId" placeholder="请选择">
<gl-option
v-for="item in userManageForm.options"
......@@ -104,23 +106,19 @@ export default {
!val && this.$refs['userManageForm'].resetFields()
},
'userManageForm.id'(val) {
console.log(val)
val && (this.placeholder = '不填为不修改')
!val && (this.placeholder = '')
}
},
mounted() {
// this.list = this.userManageForm.roleList.map(item => item.roleName)
},
data() {
return {
key: Date.now(),
isDepart: true,
// userData: {},
data: '',
placeholder: '',
defaultExpandAll: true,
val: '',
tel: [/\d{1,3}/, '.', /\d{1,3}/, '.', /\d{1,3}/,'.', /\d{1,3}/],
tel: [/\d{1,3}/, '.', /\d{1,3}/, '.', /\d{1,3}/, '.', /\d{1,3}/],
rules: {
username: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
......@@ -166,11 +164,11 @@ export default {
})
},
clickDepart(data, treeData, vue, props) {
console.log(treeData)
if (data.parent !== '#' || !data.children) {
this.userManageForm.departId = data.id
this.userManageForm.departName = data.text
this.getDepartName(treeData)
// this.userManageForm.departName = this.departName.join(' - ')
this.departName = []
}
},
......@@ -182,14 +180,6 @@ export default {
return true
}
},
// isPoneAvailable(pone) {
// this.tel = '/^[1][3,4,5,7,8][0-9]{9}$/'
// if (!this.tel.test(pone)) {
// return false
// } else {
// return true
// }
// },
submitForm(formName) {
this.$refs[formName].validate(valid => {
this.userData = this.$deep_clone(this.userManageForm)
......@@ -208,6 +198,7 @@ export default {
this.$emit('userFormData')
},
handleCheckedChange(value) {
console.log(value)
if (!value) return
this.val = value.join(',')
}
......
......@@ -13,9 +13,12 @@
right: 25px;
top: -56px;
}
.m-rl8{
margin: 0 8px;
}
// .m-rl8{
// margin: 0 8px;
// }
.w-75{
width: 75px;
}
.el-pagination {
margin-top: 25px;
}
\ No newline at end of file
......@@ -5,7 +5,6 @@
<gl-input class="search-w250" placeholder="请输入角色名称" v-model="roleName" clearable></gl-input>
<gl-button type="primary" @click="handleSearchRoleName">搜索</gl-button>
</div>
<hr>
<div class="default p-t15">
<gl-button class="control-tabledata-button" size="small" @click="handleCreateOrEdit(flagCOrE = true)">创建</gl-button>
<role-create :createVisible="createVisible" :createRuleForm="roleParam" :defaultCheckedKeys="roleMenu" :flagCOrE="flagCOrE" @createClose="handleCreateClose"></role-create>
......@@ -61,7 +60,7 @@ export default {
// 分页所需参数-end
roleData: {
border: true,
height: 400,
height: parseInt(this.$client_height() - 140),
data: [],
column: roleDataColumn,
console: {
......@@ -123,7 +122,7 @@ export default {
// 删除角色,根据返回的code值来判断是否删除成功(已有拦截器)
this.deleteRole(rows[index].id)
}).catch(() => {
this.message('取消删除', 'info')
// this.message('取消删除', 'info')
})
},
// 获取页面参数
......
......@@ -5,7 +5,6 @@
<gl-input class="search-w250" placeholder="请输入用户名或姓名" v-model="userName" clearable></gl-input>
<gl-button type="primary" @click="finduserName">搜索</gl-button>
</div>
<hr>
<div class="default p-t15">
<div class="control-tabledata-button">
<gl-button size="small" @click="createUser()">新增用户</gl-button>
......@@ -59,7 +58,7 @@ export default {
select: this.handleSelectionChange,
border: true,
align: 'center',
height: 500,
height: parseInt(this.$client_height() - 140),
data: [],
column: [{
label: '用户序号',
......@@ -156,6 +155,7 @@ export default {
}
},
mounted() {
console.log(parseInt(this.$client_height()))
this.findUserList()
this.getRoleOptions()
findDepartTree.req().then(res => {
......@@ -248,7 +248,7 @@ export default {
this.updateUser_Post(params)
} else {
this.dialogFormVisible = !this.dialogFormVisible
this.message('取消操作', 'info')
// this.message('取消操作', 'info')
}
// !params && this.message('取消操作', 'info')
// params && this.updateUser_Post(params)
......@@ -275,12 +275,11 @@ export default {
}
})
Promise.all([findAll, getRoleList]).then((result) => {
console.log(row.roles)
if (row.roles && typeof (row.roles) === 'string') {
row.roles = (row.roles + '').split(',').map(role => +role)
} else {
(typeof (row.roles) === 'object') && row.roles
!(typeof (row.roles) === 'object') && []
row.roles = []
}
this.userManageForm = this.$deep_clone(row)
})
......@@ -306,18 +305,10 @@ export default {
this.batcheDel(ids.join(','))
this.message('删除成功', 'success')
}).catch(() => {
this.message('取消删除', 'info')
console.log('error')
// this.message('取消删除', 'info')
})
}
// else {
// this.message('', '操作失败')
// }
},
// 提示
createOrEditSuccess() {
this.dialogFormVisible = !this.dialogFormVisible
this.message(!this.isEdit ? '创建角色成功' : '已经成功修改数据', 'success')
this.findUserList()
},
// 搜索
finduserName() {
......@@ -342,7 +333,7 @@ export default {
this.operatUser({ id: rows[index].id, state: 2 })
this.message('成功删除该用户', 'success')
}).catch(() => {
this.message('取消删除', 'info')
// this.message('取消删除', 'info')
})
},
findRolesName(params) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!