Merge branch 'main' of github.com:dataease/dataease into main

This commit is contained in:
taojinlong 2021-06-07 15:00:07 +08:00
commit d43f6b0d4a
3 changed files with 18 additions and 4 deletions

View File

@ -401,7 +401,7 @@ SELECT
sys_auth.auth_source sys_auth.auth_source
having sum( sys_auth_detail.privilege_value )> 0) temp; having sum( sys_auth_detail.privilege_value )> 0) temp;
select GROUP_CONCAT(id) into oTempAllIds from v_auth_model where v_auth_model.model_type=modelType and FIND_IN_SET(v_auth_model.id,GET_V_AUTH_MODEL_WITH_PARENT ( oTempLeafIds ,modelType)); select GROUP_CONCAT(id) into oTempAllIds from (select GET_V_AUTH_MODEL_WITH_PARENT ( oTempLeafIds ,modelType) cids) t, v_auth_model where v_auth_model.model_type=modelType and FIND_IN_SET(v_auth_model.id,cids);
RETURN oTempAllIds; RETURN oTempAllIds;
END END

View File

@ -7,3 +7,11 @@ export function checkPermission(pers) {
}) })
return hasPermission return hasPermission
} }
export function hasDataPermission(pTarget, pSource) {
debugger
if (pSource && pTarget) {
return pSource.indexOf(pTarget) > -1
}
return false
}

View File

@ -92,7 +92,7 @@
import LayoutContent from '@/components/business/LayoutContent' import LayoutContent from '@/components/business/LayoutContent'
import ComplexTable from '@/components/business/complex-table' import ComplexTable from '@/components/business/complex-table'
import { checkPermission } from '@/utils/permission' import { checkPermission, hasDataPermission } from '@/utils/permission'
import { formatCondition } from '@/utils/index' import { formatCondition } from '@/utils/index'
import { dsGrid, addDs, editDs, delDs, validateDs } from '@/api/system/datasource' import { dsGrid, addDs, editDs, delDs, validateDs } from '@/api/system/datasource'
@ -124,10 +124,16 @@ export default {
buttons: [ buttons: [
{ {
label: this.$t('commons.edit'), icon: 'el-icon-edit', type: 'primary', click: this.edit, label: this.$t('commons.edit'), icon: 'el-icon-edit', type: 'primary', click: this.edit,
show: checkPermission(['datasource:edit']) show: true,
disabled: (row) => {
return !hasDataPermission('manage', row.privileges)
}
}, { }, {
label: this.$t('commons.delete'), icon: 'el-icon-delete', type: 'danger', click: this._handleDelete, label: this.$t('commons.delete'), icon: 'el-icon-delete', type: 'danger', click: this._handleDelete,
show: checkPermission(['datasource:del']) show: true,
disabled: (row) => {
return !hasDataPermission('manage', row.privileges)
}
} }
], ],
searchConfig: { searchConfig: {