Merge branch 'dev' of github.com:jumpserver/lina into dev

This commit is contained in:
Bai
2020-06-15 17:08:11 +08:00
4 changed files with 7 additions and 30 deletions

View File

@@ -209,6 +209,7 @@ export default {
if (!parentNode) {
return
}
this.zTree.expandNode(parentNode, true, false, true, false)
// http://localhost/api/v1/assets/nodes/85aa4ee2-0bd9-41db-9079-aa3646448d0c/children/
const url = `${this.treeSetting.nodeUrl}${parentNode.meta.node.id}/children/`
this.$axios.post(url, {}).then(data => {

View File

@@ -130,11 +130,7 @@ export default {
items.map(v => {
newData.push(v.value)
})
return this.$axios.patch(relationUrl, { nodes: newData }).then(res => {
this.$message.success(this.$t('common.updateSuccessMsg'))
}).catch(err => {
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
})
return this.$axios.patch(relationUrl, { nodes: newData })
},
performDelete: (item) => {
const itemId = item.value
@@ -146,11 +142,7 @@ export default {
}
})
const relationUrl = `/api/v1/assets/assets/${this.object.id}/`
return this.$axios.patch(relationUrl, { nodes: newData }).then(res => {
this.$message.success(this.$t('common.updateSuccessMsg'))
}).catch(err => {
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
})
return this.$axios.patch(relationUrl, { nodes: newData })
}
},
labelConfig: {

View File

@@ -55,11 +55,7 @@ export default {
items.map(v => {
newData.push(v.value)
})
return this.$axios.patch(relationUrl, { system_users: newData }).then(res => {
this.$message.success(this.$t('common.updateSuccessMsg'))
}).catch(err => {
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
})
return this.$axios.patch(relationUrl, { system_users: newData })
},
performDelete: (item) => {
const itemId = item.value
@@ -71,11 +67,7 @@ export default {
}
})
const relationUrl = `/api/v1/assets/cmd-filters/${this.object.id}/`
return this.$axios.patch(relationUrl, { system_users: newData }).then(res => {
this.$message.success(this.$t('common.deleteSuccessMsg'))
}).catch(err => {
this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + err))
})
return this.$axios.patch(relationUrl, { system_users: newData })
}
}
}

View File

@@ -127,21 +127,13 @@ export default {
node: v.value
}
})
return this.$axios.post(relationUrl, data).then(res => {
this.$message.success(this.$t('common.updateSuccessMsg'))
}).catch(err => {
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
})
return this.$axios.post(relationUrl, data)
},
performDelete: (item) => {
const itemId = item.value
const objectId = this.object.id
const relationUrl = `/api/v1/assets/system-users-nodes-relations/?systemuser=${objectId}&node=${itemId}`
return this.$axios.delete(relationUrl).then(res => {
this.$message.success(this.$t('common.updateSuccessMsg'))
}).catch(err => {
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
})
return this.$axios.delete(relationUrl)
}
}
}