Commit 347ce23f by cwq0219
2 parents 1a209124 9f0b4bde
......@@ -14,7 +14,7 @@
class="w-300"
v-model="accountRuleForm.accounttypeName"
:size="btn_size"
maxlength="10"
maxlength="15"
show-word-limit
></el-input>
</el-form-item>
......@@ -259,14 +259,14 @@ export default {
if (res.code == '0') {
// this.changeList = arr
this.treeData.push(_.cloneDeep(res.data[0]))
if (this.responseList.length != 0) {
// 新增默认全选
const len = this.treeData.length - 1
console.log(len, this.$refs[`tree${len}`], this.treeData[len].children)
this.$nextTick(() => {
this.$refs[`tree${len}`][0].setCheckedNodes(this.treeData[len].children)
})
}
// if (this.responseList.length != 0) {
// 新增默认全选
const len = this.treeData.length - 1
console.log(len, this.$refs[`tree${len}`], this.treeData[len].children)
this.$nextTick(() => {
this.$refs[`tree${len}`][0].setCheckedNodes(this.treeData[len].children)
})
// }
}
})
} else {
......@@ -349,12 +349,13 @@ export default {
params.id = this.accountParams.id
api = 'update'
}
console.log(params)
accountApi[api](params).then(res => {
const { code, data } = res
if (code == '0' && data) {
this.notice.okTips()
// this.$root.close()
window.history.go(-1)
// window.history.go(-1)
} else {
this.notice.errorTips()
}
......@@ -376,23 +377,35 @@ export default {
const halfCheckedNodes = this.$refs[`tree${index}`][0].getHalfCheckedNodes()
const nodes = checkedNodes.concat(halfCheckedNodes)
console.log(nodes)
const menuIdList = checkedNodes.filter(item => item.logo !== 'neglect').map(i => i.id) // 全选菜单idlist
const partSelectList = halfCheckedNodes.filter(item => item.logo !== 'neglect').map(i => i.id) // 半选菜单idlist
const menuIdList = checkedNodes.filter(item => item.logo === 'menu').map(i => i.id) // 全选菜单idlist
const partSelectList = halfCheckedNodes.filter(item => item.logo === 'menu').map(i => i.id) // 半选菜单idlist
const functionIdList = nodes.filter(item => item.logo === 'function')
const functionValueIdLists = nodes.filter(item => item.logo === 'functionValue')
var list = []
/** { menuId, id, functionValue} */
functionValueIdLists.forEach((j, index) => {
if (list.map(item => item.id).includes(j.parentId)) {
const obj = list.find(k => k.id === j.parentId)
obj.functionValue += ';' + j.id + ':' + j.label
} else {
if (functionValueIdLists.length !== 0) {
functionValueIdLists.forEach((j, index) => {
if (list.map(item => item.id).includes(j.parentId)) {
const obj = list.find(k => k.id === j.parentId)
obj.functionValue += ';' + j.id + ':' + j.label
} else {
list.push({
id: j.parentId,
menuId: j.superParentId,
functionValue: j.id + ':' + j.label
})
}
})
}
console.log(functionIdList)
if (functionIdList.length !== 0) {
functionIdList.forEach(m => {
list.push({
id: j.parentId,
menuId: j.superParentId,
functionValue: j.id + ':' + j.label
id: m.parentId,
menuId: m.superParentId
})
}
})
})
}
const obj = {
productId: item.dictValue,
menuIdList: menuIdList,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!