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