Commit a41172a9 by 胡悦

优化

1 parent 7ec7a65e
......@@ -30,7 +30,7 @@
>新增</el-button>
</div>
<el-table
ref="table"
ref="menuTable"
:data="menuTableData"
style="width: 100%"
row-key="id"
......@@ -259,7 +259,6 @@ export default {
methods: {
search() {
let params = Object.assign({}, this.searchForm, this.page)
console.log(params)
this.getList(params)
},
// 重置搜索条件
......@@ -277,7 +276,6 @@ export default {
},
// 确定,新增、编辑
handleConfirm() {
console.log(this.menuForm)
this.$refs.menuForm.$children[0].validate((valid) => {
if (valid) {
let params = JSON.parse(JSON.stringify(this.menuForm))
......@@ -296,7 +294,7 @@ export default {
this.handleClose()
if (params.parentId) {
getMenuChildren({ parentId: params.parentId }).then(res => {
this.$set(this.$refs.table.store.states.lazyTreeNodeMap, params.parentId, res.data)
this.$set(this.$refs.menuTable.store.states.lazyTreeNodeMap, params.parentId, res.data)
})
} else {
this.search()
......@@ -319,7 +317,6 @@ export default {
},
// 按钮事件
btnClick(pType, scope) {
console.log(pType, scope)
switch (pType) {
case 'create':
this.isOpen = true
......@@ -347,7 +344,6 @@ export default {
},
// 编辑触发事件
editEvent(row) {
console.log(row)
if (row.parentId == 0) {
this.menuData[0].children = this.$Constants.MENU_TYPE
this.menuData[1].hidden = true
......@@ -380,10 +376,9 @@ export default {
})
if (row.parentId == 0) {
this.getList()
} else {
getMenuChildren({ parentId: row.parentId }).then(res => {
const nodes = res.data
this.$set(this.$refs.table.store.states.lazyTreeNodeMap, row.parentId, nodes)
this.$set(this.$refs.menuTable.store.states.lazyTreeNodeMap, 13, nodes)
})
}
} else {
......@@ -396,7 +391,6 @@ export default {
this.$Common.confirmDialog(tipData)
},
load(tree, treeNode, resolve) {
console.log(tree, treeNode, resolve)
getMenuChildren({ parentId: tree.menuNo }).then(res => {
resolve(res.data)
})
......@@ -413,13 +407,11 @@ export default {
this.filterVisible = !this.filterVisible
},
filterConfirm() {
console.log(this.$refs.tree.getCurrentNode())
this.menuForm.parentId = this.$refs.tree.getCurrentNode().id
this.menuForm.parentName = this.$refs.tree.getCurrentNode().label
this.closeFilter()
},
filterNode(value, data) {
console.log(value, data)
if (!value) return true
return data.label.indexOf(value) !== -1
},
......@@ -452,7 +444,6 @@ export default {
this.search()
},
radioChange(event, prop) {
console.log(event, prop)
if (event != 1) {
this.menuData.map(item => {
if (item.prop == 'parentName') {
......
......@@ -224,7 +224,6 @@ export default {
},
// 确定,新增组织、编辑组织
handleConfirm() {
console.log(this.orginizaForm)
this.$refs.orginizaForm.$children[0].validate((valid) => {
if (valid) {
let params = {
......@@ -266,15 +265,9 @@ export default {
this.$refs.orginizaForm.$children[0].resetFields()
}
this.orginizaVisible = !this.orginizaVisible
// if (!this.orginizaVisible) {
// this.orginizaForm = {}
// this.orginizaForm = _.cloneDeep(this.form)
// console.log(this.orginizaForm)
// }
},
// 按钮事件
btnClick(pType, scope) {
console.log(pType, scope, this.orginizaForm)
switch (pType) {
case 'root':
this.isRoot = true
......@@ -283,14 +276,15 @@ export default {
this.handleClose()
break
case 'create':
console.log('??????')
this.isRoot = false
this.orginizaData[0].hidden = false
// this.$set(this.orginizaForm, 'superiorName', scope.departmentName)
this.orginizaForm['superiorName'] = _.cloneDeep(scope.departmentName)
this.orginizaForm['superiorId'] = _.cloneDeep(scope.id)
this.orginizaDialogTitle = '新增组织' + this.orginizaForm.superiorName
console.log(this.orginizaForm)
const obj = {
superiorId: scope.id,
superiorName: scope.departmentName,
enableStatus: true
}
this.orginizaForm = obj
this.orginizaDialogTitle = '新增组织'
this.handleClose()
break
case 'edit':
......@@ -304,8 +298,6 @@ export default {
},
// 编辑触发事件
editEvent(row) {
console.log(row)
// this.orginizaForm = JSON.parse(JSON.stringify(this.form))
organizaInfo({ id: row.id }).then(res => {
this.orginizaForm = _.cloneDeep(res.data)
this.orginizaForm.enableStatus = row.enableStatus == 1 ? true : false
......@@ -315,7 +307,6 @@ export default {
} else {
this.isRoot = false
}
console.log(this.orginizaForm)
this.handleClose()
})
},
......@@ -353,7 +344,6 @@ export default {
},
// 树形table懒加载
load(tree, treeNode, resolve) {
console.log(tree, treeNode, resolve)
getChildren({ rootId: tree.id }).then(res => {
let nodes = res.data
resolve(nodes)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!