Commit dc5dc3d8 by 胡悦

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

2 parents 97591823 a6a95389
......@@ -39,10 +39,7 @@ const getRoleList = {
const saveRoleList = {
p: [__sSaveRoleList],
// req: params => GlAxios.get(__sSaveRoleList, params)
req: params => GlAxios.post(__sSaveRoleList, params, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }})
// req: params => GlAxios.post(__sSaveRoleList, params, { headers: { 'Content-Type': 'application/json; charset=utf-8' }})
// req: params => GlAxios.post(__sSaveRoleList, params)
req: params => GlAxios.post(__sSaveRoleList, params, { headers: { 'Content-Type': 'application/json; charset=utf-8' }, requestType: 'jsonString' })
}
const selectMenuTreeRoleId = {
......@@ -57,7 +54,7 @@ const selectUserRoleByRoleId = {
const updateRole = {
p: [__sUpdateRole],
req: params => GlAxios.post(__sUpdateRole, params)
req: params => GlAxios.post(__sUpdateRole, params, { headers: { 'Content-Type': 'application/json; charset=utf-8' }, requestType: 'jsonString' })
}
export {
......
......@@ -15,7 +15,7 @@
</template>
<script type='text/ecmascript-6'>
// const timeTip = '系统自动生成(格式yyyy-MM-dd HH:mm:ss)'
const timeTip = '系统自动生成(格式yyyy-MM-dd HH:mm:ss)'
export default {
name: 'leftManager',
data() {
......@@ -68,10 +68,10 @@ export default {
for (const key in this.value.form) {
this.value.form[key] = null
}
// if (this.value.form.createTime !== undefined) {
// this.value.form.createTime = timeTip
// this.value.form.updateTime = timeTip
// }
if (this.value.form.createTime !== undefined) {
this.value.form.createTime = timeTip
this.value.form.updateTime = timeTip
}
}
}
}
......
......@@ -102,6 +102,8 @@ export default {
obj[key] = this.value.form[key]
}
if (!this.isDepart) delete obj.name
delete obj.createTime
delete obj.updateTime
return obj
},
// 接口调用-start
......@@ -128,7 +130,7 @@ export default {
console.log(err)
this.delErrTip()
})
: delMenu.req(obj).then(res => {
: delMenu.req({ menuId: obj.id }).then(res => {
this.delTip(true)
}).catch(err => {
console.log(err)
......
......@@ -48,6 +48,7 @@ export default {
},
watch: {
keyFresh(val) {
// console.log(val)
// console.log(`keyFresh----------------------${this.keyFresh}`)
// console.log(this.defaultCheckedKeys)
val && (this.checkStrictly = val) && this.loadingTree()
......@@ -62,12 +63,12 @@ export default {
},
check(data, treeData) {
this.$emit('input', { data, treeData })
this.checkStrictly = false
},
loadingTree() {
// console.log(this.checkStrictly)
!this.propsData && this.getData()
this.propsData && (this.data = fn(this.propsData, '#'))
this.checkStrictly = false
// console.log(this.checkStrictly)
// console.log(this.propsData)
// console.log(this.data)
......
......@@ -89,4 +89,7 @@ a:hover {
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.mentBox{
overflow-y: scroll;
}
\ No newline at end of file
<!-- departmentManagement -->
<template>
<gl-row :gutter="50">
<gl-row :gutter="50" :style="{ height: height }" class="mentBox">
<gl-col :span='8'>
<left-manager :title='"部门列表"' isDepart v-model="department" :nodeClick='nodeClick'></left-manager>
</gl-col>
......@@ -17,6 +17,7 @@ export default {
name: 'department',
data() {
return {
height: 0,
department: {
sublings: false,
children: false,
......@@ -45,6 +46,9 @@ export default {
LeftManager,
RightForm
},
mounted() {
this.height = window.innerHeight + 'px'
},
methods: {
nodeClick(data, node, that, props) {
this.department.showDetails = true
......
<template>
<gl-row :gutter="100">
<gl-row :gutter="100" :style="{ height: height }" class="mentBox">
<gl-col :span='8'>
<left-manager :title='"菜单列表"' v-model="menuMG" :node-click='nodeClick'></left-manager>
</gl-col>
......@@ -8,7 +8,6 @@
</gl-col>
</gl-row>
</template>
<script>
import { LeftManager, RightForm } from '@/components/index'
import { findMenuById } from '@/api/api'
......@@ -16,6 +15,7 @@ export default {
name: 'menuMG',
data() {
return {
height: 0,
menuMG: {
sublings: false,
children: false,
......@@ -29,9 +29,9 @@ export default {
data: [],
form: {
id: 0,
urlName: 'ttt',
urlName: '',
hostName: '',
openStyle: '新系统',
openStyle: '',
menuType: '',
name: '',
path: '',
......@@ -39,8 +39,8 @@ export default {
baseUrl: '',
iorder: null,
isHidden: 0,
// createTime: null,
// updateTime: null,
createTime: null,
updateTime: null,
grade: 0,
iconUrl: '',
lastOperatorId: 0,
......@@ -102,6 +102,9 @@ export default {
LeftManager,
RightForm
},
mounted() {
this.height = window.innerHeight + 'px'
},
methods: {
nodeClick(data, node, that, props) {
this.menuMG.showDetails = true
......@@ -115,18 +118,12 @@ export default {
this.menuMG.del = true
this.menuMG.push = false
findMenuById.req({ id: data.id }).then(res => {
// for (const key in res) {
// console.log(res[key], typeof res[key], key)
// }
// console.log(this.menuMG.allNode, this.menuMG.node)
console.log(res)
for (const key in this.menuMG.form) {
if (key === 'isHidden') {
this.menuMG.form[key] = res[key] === 0
} else if (key === 'createTime' || key === 'updateTime') {
console.log(res[key])
this.menuMG.form[key] = res[key]
// this.menuMG.form[key] = new Date(res[key]).format('yyyy-MM-dd HH:mm:ss')
this.menuMG.form[key] = new Date(res[key]).format('yyyy-MM-dd HH:mm:ss')
} else if (key === 'name') {
this.menuMG.form[key] = node.level === 1 ? '顶级菜单' : node.parent.data[props.label]
} else {
......
......@@ -175,15 +175,15 @@ export default {
// const cc = { roleName: 'ggg' }
// ----------------------
// delete params.roleName
delete params.description
delete params.departId
delete params.departName
delete params.departPath
delete params.rights
delete params.state
const paramsJS = JSON.stringify(params)
console.log(paramsJS)
saveRoleList.req(paramsJS).then((data) => {
// delete params.description
// delete params.departId
// delete params.departName
// delete params.departPath
// delete params.rights
// delete params.state
// const paramsJS = JSON.stringify(params)
// console.log(paramsJS)
saveRoleList.req(params).then((data) => {
console.log(data)
this.createOrEditSuccess()
}).catch(err => {
......@@ -193,7 +193,9 @@ export default {
// 编辑角色
updateRoleInfo(params) {
console.log(params)
this.createOrEditSuccess()
delete params.createTime
delete params.updateTime
// this.createOrEditSuccess()
updateRole.req(params).then((data) => {
console.log(data)
this.createOrEditSuccess()
......@@ -256,7 +258,7 @@ export default {
},
// 关闭新增用户组件
handleCreateClose(data) {
this.roleParam = this.$deep_clone(roleCreateStructure)
// this.roleParam = this.$deep_clone(roleCreateStructure)
if (!data) {
this.createDialogVisible()
this.message(this.flagCOrE ? '取消创建角色' : '取消编辑角色', 'info')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!