| | |
| | | /** |
| | | * @description 获取权限分配树 |
| | | */ |
| | | getTree = (parents, options) => { |
| | | getTree = (parents, options, addSelf) => { |
| | | parents.forEach(parent => { |
| | | parent.children = [] |
| | | |
| | |
| | | title: option.MenuName, |
| | | key: option.MenuID, |
| | | addSelf: option.OnlySelf === 'true', |
| | | tabs: option.Tabs |
| | | // tabs: option.Tabs |
| | | }) |
| | | } |
| | | }) |
| | |
| | | if (parent.children.length === 0) { |
| | | parent.children = null |
| | | // 针对标签,生成新的id,并保存关联关系(标签不唯一) |
| | | if (parent.tabs) { |
| | | let _uuid = Utils.getuuid() |
| | | linkMap.set(_uuid, parent.key) |
| | | // if (parent.tabs) { |
| | | // let _uuid = Utils.getuuid() |
| | | // linkMap.set(_uuid, parent.key) |
| | | |
| | | parent.originKey = parent.key |
| | | parent.key = _uuid |
| | | } |
| | | // parent.originKey = parent.key |
| | | // parent.key = _uuid |
| | | // } |
| | | } else { |
| | | // 三级菜单创建子项 |
| | | if (parent.addSelf) { |
| | |
| | | parent.children.unshift({ |
| | | title: parent.title + '(仅页面)', |
| | | key: _uuid, |
| | | isSubView: true |
| | | // isSubView: true |
| | | }) |
| | | } else if (addSelf) { |
| | | let _uuid = Utils.getuuid() |
| | | linkMap.set(_uuid, parent.key) |
| | | parent.subKey = _uuid |
| | | |
| | | parent.children.unshift({ |
| | | title: parent.title + '(表格)', |
| | | key: _uuid, |
| | | }) |
| | | } |
| | | |
| | | // 针对标签,生成新的id,并保存关联关系(标签不唯一) |
| | | if (parent.tabs) { |
| | | let _uuid = Utils.getuuid() |
| | | linkMap.set(_uuid, parent.key) |
| | | // if (parent.tabs) { |
| | | // let _uuid = Utils.getuuid() |
| | | // linkMap.set(_uuid, parent.key) |
| | | |
| | | parent.originKey = parent.key |
| | | parent.key = _uuid |
| | | } |
| | | // parent.originKey = parent.key |
| | | // parent.key = _uuid |
| | | // } |
| | | |
| | | parent.children = this.getTree(parent.children, options) |
| | | parent.children = this.getTree(parent.children, options, parent.addSelf) |
| | | } |
| | | }) |
| | | return parents |
| | |
| | | } |
| | | } |
| | | return true |
| | | } else if (parent.isSubView) { |
| | | return true |
| | | // } else if (parent.isSubView) { |
| | | // return true |
| | | } |
| | | return false |
| | | }) |
| | |
| | | |
| | | confirm({ |
| | | content: '部分字段名称与显示列不一致,是否更新?', |
| | | okText: '更新', |
| | | cancelText: '不更新', |
| | | onOk() { |
| | | _columns = _columns.map(item => { |
| | | let key = item.Column.toLowerCase() |
| | |
| | | |
| | | confirm({ |
| | | content: '部分字段名称与显示列不一致,是否更新?', |
| | | okText: '更新', |
| | | cancelText: '不更新', |
| | | onOk() { |
| | | columns = columns.map(item => { |
| | | let key = item.Column.toLowerCase() |
| | |
| | | let _card = { |
| | | uuid: newCon.uuid, |
| | | type: 'table', |
| | | name: newCon.name, |
| | | name: newCon.name || '', |
| | | format: 'array', |
| | | pageable: true, |
| | | switchable: true, |
| | |
| | | action: [], |
| | | subtype: 'normaltable', |
| | | setting: { useMSearch: 'false', sync: 'false', onload: 'true' }, |
| | | wrap: {name: newCon.name}, |
| | | wrap: {name: newCon.name || ''}, |
| | | style: {}, |
| | | headerStyle: {}, |
| | | columns: [], |