mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
Merge branch 'master' of github.com:jumpserver/lina
This commit is contained in:
@@ -20,7 +20,7 @@ export default {
|
|||||||
const url = col.deleteUrl + cellValue
|
const url = col.deleteUrl + cellValue
|
||||||
this.$axios.delete(url).then(res => {
|
this.$axios.delete(url).then(res => {
|
||||||
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
||||||
reload()
|
window.location.reload()
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error))
|
this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error))
|
||||||
})
|
})
|
||||||
|
@@ -21,7 +21,7 @@ export default {
|
|||||||
[this.$t('perms.' + 'Basic'), ['name']],
|
[this.$t('perms.' + 'Basic'), ['name']],
|
||||||
[this.$t('perms.' + 'User'), ['users', 'user_groups']],
|
[this.$t('perms.' + 'User'), ['users', 'user_groups']],
|
||||||
[this.$t('perms.' + 'Asset'), ['assets', 'nodes', 'system_users']],
|
[this.$t('perms.' + 'Asset'), ['assets', 'nodes', 'system_users']],
|
||||||
[this.$t('common.table.Actions'), ['actions']],
|
[this.$t('common.action'), ['actions']],
|
||||||
[this.$t('common.Other'), ['is_active', 'date_expired', 'comment']]
|
[this.$t('common.Other'), ['is_active', 'date_expired', 'comment']]
|
||||||
],
|
],
|
||||||
url: '/api/v1/perms/asset-permissions/',
|
url: '/api/v1/perms/asset-permissions/',
|
||||||
@@ -99,6 +99,12 @@ export default {
|
|||||||
{ label: 'download_file', value: this.$t('perms.downloadFile') }
|
{ label: 'download_file', value: this.$t('perms.downloadFile') }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
date_expired: {
|
||||||
|
label: this.$t('common.dateExpired')
|
||||||
|
},
|
||||||
|
comment: {
|
||||||
|
label: this.$t('common.Comment')
|
||||||
|
},
|
||||||
is_active: {
|
is_active: {
|
||||||
type: 'checkbox'
|
type: 'checkbox'
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<ListTable ref="listTable" v-loading="loading" :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<AssetRelationCard type="primary" v-bind="assetReletionConfig" />
|
<AssetRelationCard type="primary" v-bind="assetReletionConfig" />
|
||||||
@@ -32,7 +32,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: `/api/v1/perms/asset-permissions/${this.object.id}/assets/all/`,
|
url: `/api/v1/perms/asset-permissions/${this.object.id}/assets/all/`,
|
||||||
columns: [
|
columns: [
|
||||||
@@ -80,14 +79,7 @@ export default {
|
|||||||
asset: v
|
asset: v
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loading = true
|
return this.$axios.post(relationUrl, data)
|
||||||
const that = this
|
|
||||||
const res = this.$axios.post(relationUrl, data)
|
|
||||||
setTimeout(function() {
|
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
|
||||||
that.loading = false
|
|
||||||
}, 500)
|
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodeReletionConfig: {
|
nodeReletionConfig: {
|
||||||
@@ -114,27 +106,31 @@ export default {
|
|||||||
node: v.value
|
node: v.value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loading = true
|
return this.$axios.post(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.post(relationUrl, data)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const itemId = item.value
|
const itemId = item.value
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/perms/asset-permissions-nodes-relations/?assetpermission=${objectId}&node=${itemId}`
|
const relationUrl = `/api/v1/perms/asset-permissions-nodes-relations/?assetpermission=${objectId}&node=${itemId}`
|
||||||
this.loading = true
|
return this.$axios.delete(relationUrl)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.delete(relationUrl)
|
onDeleteSuccess: (obj, that) => {
|
||||||
setTimeout(function() {
|
// 从hasObjects中移除这个object
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
||||||
that.loading = false
|
that.iHasObjects.splice(theRemoveIndex, 1)
|
||||||
}, 500)
|
// 从disabled values中移除这个value
|
||||||
return res
|
while (that.select2.disabledValues.indexOf(obj.value) !== -1) {
|
||||||
|
const i = that.select2.disabledValues.indexOf(obj.value)
|
||||||
|
this.$log.debug('disabled values remove index: ', i)
|
||||||
|
that.select2.disabledValues.splice(i, 1)
|
||||||
|
}
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
systemUserReletionConfig: {
|
systemUserReletionConfig: {
|
||||||
@@ -163,11 +159,29 @@ export default {
|
|||||||
})
|
})
|
||||||
return this.$axios.post(relationUrl, data)
|
return this.$axios.post(relationUrl, data)
|
||||||
},
|
},
|
||||||
|
onAddSuccess: (objects, that) => {
|
||||||
|
this.$log.debug('Select value', that.select2.value)
|
||||||
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
|
that.$refs.select2.clearSelected()
|
||||||
|
window.location.reload()
|
||||||
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const itemId = item.value
|
const itemId = item.value
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/perms/asset-permissions-system-users-relations/?assetpermission=${objectId}&systemuser=${itemId}`
|
const relationUrl = `/api/v1/perms/asset-permissions-system-users-relations/?assetpermission=${objectId}&systemuser=${itemId}`
|
||||||
return this.$axios.delete(relationUrl)
|
return this.$axios.delete(relationUrl)
|
||||||
|
},
|
||||||
|
onDeleteSuccess: (obj, that) => {
|
||||||
|
// 从hasObjects中移除这个object
|
||||||
|
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
||||||
|
that.iHasObjects.splice(theRemoveIndex, 1)
|
||||||
|
// 从disabled values中移除这个value
|
||||||
|
while (that.select2.disabledValues.indexOf(obj.value) !== -1) {
|
||||||
|
const i = that.select2.disabledValues.indexOf(obj.value)
|
||||||
|
this.$log.debug('disabled values remove index: ', i)
|
||||||
|
that.select2.disabledValues.splice(i, 1)
|
||||||
|
}
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<ListTable ref="listTable" v-loading="loading" :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard type="primary" v-bind="userReletionConfig" />
|
<RelationCard type="primary" v-bind="userReletionConfig" />
|
||||||
@@ -29,7 +29,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: `/api/v1/perms/asset-permissions/${this.object.id}/users/all/`,
|
url: `/api/v1/perms/asset-permissions/${this.object.id}/users/all/`,
|
||||||
columns: [
|
columns: [
|
||||||
@@ -90,14 +89,13 @@ export default {
|
|||||||
assetpermission: objectId
|
assetpermission: objectId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loading = true
|
return this.$axios.post(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.post(relationUrl, data)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
groupReletionConfig: {
|
groupReletionConfig: {
|
||||||
@@ -116,27 +114,30 @@ export default {
|
|||||||
usergroup: v.value
|
usergroup: v.value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loading = true
|
return this.$axios.post(relationUrl, data)
|
||||||
const that = this
|
|
||||||
const res = this.$axios.post(relationUrl, data)
|
|
||||||
setTimeout(function() {
|
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
|
||||||
that.loading = false
|
|
||||||
}, 500)
|
|
||||||
return res
|
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
// const itemId = item.value
|
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/perms/asset-permissions-user-groups-relations/?assetpermission=${objectId}`
|
const relationUrl = `/api/v1/perms/asset-permissions-user-groups-relations/?assetpermission=${objectId}`
|
||||||
this.loading = true
|
return this.$axios.delete(relationUrl)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.delete(relationUrl)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
},
|
||||||
|
onDeleteSuccess: (obj, that) => {
|
||||||
|
// 从hasObjects中移除这个object
|
||||||
|
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
||||||
|
that.iHasObjects.splice(theRemoveIndex, 1)
|
||||||
|
// 从disabled values中移除这个value
|
||||||
|
while (that.select2.disabledValues.indexOf(obj.value) !== -1) {
|
||||||
|
const i = that.select2.disabledValues.indexOf(obj.value)
|
||||||
|
this.$log.debug('disabled values remove index: ', i)
|
||||||
|
that.select2.disabledValues.splice(i, 1)
|
||||||
|
}
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<el-button :type="type" size="small" @click="addObjects">{{ $tc('Add') }}</el-button>
|
<el-button :type="type" size="small" @click="addObjects">{{ $t('common.Add') }}</el-button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -49,8 +49,7 @@ export default {
|
|||||||
type: Function,
|
type: Function,
|
||||||
default(that) {
|
default(that) {
|
||||||
this.$log.debug('AssetSelect value', that.assets)
|
this.$log.debug('AssetSelect value', that.assets)
|
||||||
// 清空资产选项
|
window.location.reload()
|
||||||
// that.$refs.assetSelect.$refs.select.clearSelected()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericDetailPage :object.sync="AssetPermission" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners" @tab-click="TabClick">
|
<GenericDetailPage :object.sync="AssetPermission" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners" @tab-click="TabClick">
|
||||||
<component :is="config.activeMenu" :object="AssetPermission" />
|
<keep-alive>
|
||||||
|
<component :is="config.activeMenu" :object="AssetPermission" />
|
||||||
|
</keep-alive>
|
||||||
</GenericDetailPage>
|
</GenericDetailPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<ListTable ref="listTable" v-loading="loading" :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard type="primary" v-bind="databaseAppReletionConfig" />
|
<RelationCard type="primary" v-bind="databaseAppReletionConfig" />
|
||||||
@@ -29,7 +29,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: `/api/v1/perms/database-app-permissions/${this.object.id}/database-apps/all/`,
|
url: `/api/v1/perms/database-app-permissions/${this.object.id}/database-apps/all/`,
|
||||||
columns: [
|
columns: [
|
||||||
@@ -82,14 +81,13 @@ export default {
|
|||||||
databaseapp: v.value
|
databaseapp: v.value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loading = true
|
return this.$axios.post(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.post(relationUrl, data)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
systemUserReletionConfig: {
|
systemUserReletionConfig: {
|
||||||
@@ -118,11 +116,29 @@ export default {
|
|||||||
})
|
})
|
||||||
return this.$axios.post(relationUrl, data)
|
return this.$axios.post(relationUrl, data)
|
||||||
},
|
},
|
||||||
|
onAddSuccess: (objects, that) => {
|
||||||
|
this.$log.debug('Select value', that.select2.value)
|
||||||
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
|
that.$refs.select2.clearSelected()
|
||||||
|
window.location.reload()
|
||||||
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const itemId = item.value
|
const itemId = item.value
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/perms/database-app-permissions-system-users-relations/?databaseapppermission=${objectId}&systemuser=${itemId}`
|
const relationUrl = `/api/v1/perms/database-app-permissions-system-users-relations/?databaseapppermission=${objectId}&systemuser=${itemId}`
|
||||||
return this.$axios.delete(relationUrl)
|
return this.$axios.delete(relationUrl)
|
||||||
|
},
|
||||||
|
onDeleteSuccess: (obj, that) => {
|
||||||
|
// 从hasObjects中移除这个object
|
||||||
|
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
||||||
|
that.iHasObjects.splice(theRemoveIndex, 1)
|
||||||
|
// 从disabled values中移除这个value
|
||||||
|
while (that.select2.disabledValues.indexOf(obj.value) !== -1) {
|
||||||
|
const i = that.select2.disabledValues.indexOf(obj.value)
|
||||||
|
this.$log.debug('disabled values remove index: ', i)
|
||||||
|
that.select2.disabledValues.splice(i, 1)
|
||||||
|
}
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<ListTable ref="listTable" v-loading="loading" :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard type="primary" v-bind="userReletionConfig" />
|
<RelationCard type="primary" v-bind="userReletionConfig" />
|
||||||
@@ -30,7 +30,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: `/api/v1/perms/database-app-permissions/${this.object.id}/users/all/`,
|
url: `/api/v1/perms/database-app-permissions/${this.object.id}/users/all/`,
|
||||||
columns: [
|
columns: [
|
||||||
@@ -91,14 +90,13 @@ export default {
|
|||||||
user: v.value
|
user: v.value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loading = true
|
return this.$axios.post(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.post(relationUrl, data)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
groupReletionConfig: {
|
groupReletionConfig: {
|
||||||
@@ -117,26 +115,30 @@ export default {
|
|||||||
usergroup: v.value
|
usergroup: v.value
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.loading = true
|
return this.$axios.post(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.post(relationUrl, data)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/perms/database-app-permissions-user-groups-relations/?databaseapppermission=${objectId}`
|
const relationUrl = `/api/v1/perms/database-app-permissions-user-groups-relations/?databaseapppermission=${objectId}`
|
||||||
this.loading = true
|
return this.$axios.delete(relationUrl)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.delete(relationUrl)
|
onDeleteSuccess: (obj, that) => {
|
||||||
setTimeout(function() {
|
// 从hasObjects中移除这个object
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
||||||
that.loading = false
|
that.iHasObjects.splice(theRemoveIndex, 1)
|
||||||
}, 500)
|
// 从disabled values中移除这个value
|
||||||
return res
|
while (that.select2.disabledValues.indexOf(obj.value) !== -1) {
|
||||||
|
const i = that.select2.disabledValues.indexOf(obj.value)
|
||||||
|
this.$log.debug('disabled values remove index: ', i)
|
||||||
|
that.select2.disabledValues.splice(i, 1)
|
||||||
|
}
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericDetailPage :object.sync="DatabaseAppPermission" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners" @tab-click="TabClick">
|
<GenericDetailPage :object.sync="DatabaseAppPermission" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners" @tab-click="TabClick">
|
||||||
<component :is="config.activeMenu" :object="DatabaseAppPermission" />
|
<keep-alive>
|
||||||
|
<component :is="config.activeMenu" :object="DatabaseAppPermission" />
|
||||||
|
</keep-alive>
|
||||||
</GenericDetailPage>
|
</GenericDetailPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<ListTable ref="listTable" v-loading="loading" :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard type="primary" v-bind="remoteAppReletionConfig" />
|
<RelationCard type="primary" v-bind="remoteAppReletionConfig" />
|
||||||
@@ -28,7 +28,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: `/api/v1/perms/remote-app-permissions/${this.object.id}/remote-apps/all/`,
|
url: `/api/v1/perms/remote-app-permissions/${this.object.id}/remote-apps/all/`,
|
||||||
columns: [
|
columns: [
|
||||||
@@ -68,14 +67,13 @@ export default {
|
|||||||
const relationUrl = `/api/v1/perms/remote-app-permissions/${objectId}/remote-apps/add/`
|
const relationUrl = `/api/v1/perms/remote-app-permissions/${objectId}/remote-apps/add/`
|
||||||
const remoteAppId = items.map(v => v.value)
|
const remoteAppId = items.map(v => v.value)
|
||||||
const data = { remote_apps: remoteAppId }
|
const data = { remote_apps: remoteAppId }
|
||||||
this.loading = true
|
return this.$axios.patch(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.patch(relationUrl, data)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
systemUserReletionConfig: {
|
systemUserReletionConfig: {
|
||||||
@@ -101,6 +99,12 @@ export default {
|
|||||||
const data = { system_users: objectRelationSystemUsers }
|
const data = { system_users: objectRelationSystemUsers }
|
||||||
return this.$axios.patch(relationUrl, data)
|
return this.$axios.patch(relationUrl, data)
|
||||||
},
|
},
|
||||||
|
onAddSuccess: (objects, that) => {
|
||||||
|
this.$log.debug('Select value', that.select2.value)
|
||||||
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
|
that.$refs.select2.clearSelected()
|
||||||
|
window.location.reload()
|
||||||
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/perms/remote-app-permissions/${objectId}/`
|
const relationUrl = `/api/v1/perms/remote-app-permissions/${objectId}/`
|
||||||
@@ -108,6 +112,18 @@ export default {
|
|||||||
const objectNewRelationSystemUsers = objectOldRelationSystemUsers.filter(v => v !== item.value)
|
const objectNewRelationSystemUsers = objectOldRelationSystemUsers.filter(v => v !== item.value)
|
||||||
const data = { system_users: objectNewRelationSystemUsers }
|
const data = { system_users: objectNewRelationSystemUsers }
|
||||||
return this.$axios.patch(relationUrl, data)
|
return this.$axios.patch(relationUrl, data)
|
||||||
|
},
|
||||||
|
onDeleteSuccess: (obj, that) => {
|
||||||
|
// 从hasObjects中移除这个object
|
||||||
|
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
||||||
|
that.iHasObjects.splice(theRemoveIndex, 1)
|
||||||
|
// 从disabled values中移除这个value
|
||||||
|
while (that.select2.disabledValues.indexOf(obj.value) !== -1) {
|
||||||
|
const i = that.select2.disabledValues.indexOf(obj.value)
|
||||||
|
this.$log.debug('disabled values remove index: ', i)
|
||||||
|
that.select2.disabledValues.splice(i, 1)
|
||||||
|
}
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :md="14" :sm="24">
|
<el-col :md="14" :sm="24">
|
||||||
<ListTable ref="listTable" v-loading="loading" :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="10" :sm="24">
|
<el-col :md="10" :sm="24">
|
||||||
<RelationCard type="primary" v-bind="userReletionConfig" />
|
<RelationCard type="primary" v-bind="userReletionConfig" />
|
||||||
@@ -28,7 +28,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: `/api/v1/perms/remote-app-permissions/${this.object.id}/users/all/`,
|
url: `/api/v1/perms/remote-app-permissions/${this.object.id}/users/all/`,
|
||||||
columns: [
|
columns: [
|
||||||
@@ -75,14 +74,13 @@ export default {
|
|||||||
const relationUrl = `/api/v1/perms/remote-app-permissions/${objectId}/users/add/`
|
const relationUrl = `/api/v1/perms/remote-app-permissions/${objectId}/users/add/`
|
||||||
const usersId = items.map(v => v.value)
|
const usersId = items.map(v => v.value)
|
||||||
const data = { users: usersId }
|
const data = { users: usersId }
|
||||||
this.loading = true
|
return this.$axios.patch(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.patch(relationUrl, data)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
groupReletionConfig: {
|
groupReletionConfig: {
|
||||||
@@ -98,14 +96,13 @@ export default {
|
|||||||
const objectRelationUserGroups = this.object.user_groups
|
const objectRelationUserGroups = this.object.user_groups
|
||||||
items.map(v => objectRelationUserGroups.push(v.value))
|
items.map(v => objectRelationUserGroups.push(v.value))
|
||||||
const data = { user_groups: objectRelationUserGroups }
|
const data = { user_groups: objectRelationUserGroups }
|
||||||
this.loading = true
|
return this.$axios.patch(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.patch(relationUrl, data)
|
onAddSuccess: (objects, that) => {
|
||||||
setTimeout(function() {
|
this.$log.debug('Select value', that.select2.value)
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.loading = false
|
that.$refs.select2.clearSelected()
|
||||||
}, 500)
|
window.location.reload()
|
||||||
return res
|
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
@@ -113,14 +110,19 @@ export default {
|
|||||||
const objectOldRelationUserGroups = this.object.user_groups
|
const objectOldRelationUserGroups = this.object.user_groups
|
||||||
const objectNewRelationUserGroups = objectOldRelationUserGroups.filter(v => v !== item.value)
|
const objectNewRelationUserGroups = objectOldRelationUserGroups.filter(v => v !== item.value)
|
||||||
const data = { user_groups: objectNewRelationUserGroups }
|
const data = { user_groups: objectNewRelationUserGroups }
|
||||||
this.loading = true
|
return this.$axios.patch(relationUrl, data)
|
||||||
const that = this
|
},
|
||||||
const res = this.$axios.patch(relationUrl, data)
|
onDeleteSuccess: (obj, that) => {
|
||||||
setTimeout(function() {
|
// 从hasObjects中移除这个object
|
||||||
that.$refs.listTable.$refs.dataTable.$refs.dataTable.$refs.table.getList()
|
const theRemoveIndex = that.iHasObjects.findIndex((v) => v.value === obj.value)
|
||||||
that.loading = false
|
that.iHasObjects.splice(theRemoveIndex, 1)
|
||||||
}, 500)
|
// 从disabled values中移除这个value
|
||||||
return res
|
while (that.select2.disabledValues.indexOf(obj.value) !== -1) {
|
||||||
|
const i = that.select2.disabledValues.indexOf(obj.value)
|
||||||
|
this.$log.debug('disabled values remove index: ', i)
|
||||||
|
that.select2.disabledValues.splice(i, 1)
|
||||||
|
}
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericDetailPage :object.sync="RemoteAppPermission" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners" @tab-click="TabClick">
|
<GenericDetailPage :object.sync="RemoteAppPermission" :active-menu.sync="config.activeMenu" v-bind="config" v-on="$listeners" @tab-click="TabClick">
|
||||||
<component :is="config.activeMenu" :object="RemoteAppPermission" />
|
<keep-alive>
|
||||||
|
<component :is="config.activeMenu" :object="RemoteAppPermission" />
|
||||||
|
</keep-alive>
|
||||||
</GenericDetailPage>
|
</GenericDetailPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user