Commit dc5dc3d8 by 胡悦

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

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