fix(接口定义): 插件管理增加权限控制

This commit is contained in:
fit2-zhao 2021-11-15 13:09:34 +08:00 committed by fit2-zhao
parent 7fff5e1f8a
commit d0b3ae9430
4 changed files with 30 additions and 5 deletions

View File

@ -818,6 +818,21 @@
"name": "另存为",
"resourceId": "PROJECT_REPORT_ANALYSIS",
"license": false
},
{
"id": "SYSTEM_PLUGIN:UPLOAD",
"name": "点击上传",
"resourceId": "SYSTEM_PLUGIN"
},
{
"id": "SYSTEM_PLUGIN:DEL",
"name": "删除",
"resourceId": "SYSTEM_PLUGIN"
},
{
"id": "SYSTEM_PLUGIN:VIEW",
"name": "查看脚本",
"resourceId": "SYSTEM_PLUGIN"
}
],
"resource": [
@ -952,6 +967,10 @@
{
"id": "PROJECT_REPORT_ANALYSIS",
"name": "报表"
},
{
"id": "SYSTEM_PLUGIN",
"name": "插件管理"
}
]
}

View File

@ -10,7 +10,7 @@
<span class="operate-button">
<ms-table-button v-permission="createPermission" v-if="showCreate" icon="el-icon-circle-plus-outline"
:content="createTip" @click="create"/>
<ms-table-button icon="el-icon-download" v-if="showImport"
<ms-table-button icon="el-icon-download" v-if="showImport" v-permission="uploadPermission"
:content="importTip" @click="importData"/>
<ms-table-button v-if="showRun" icon="el-icon-video-play"
type="primary"
@ -78,6 +78,12 @@
return []
}
},
uploadPermission: {
type: Array,
default() {
return []
}
},
runTip: {
type: String,

View File

@ -13,7 +13,7 @@
:title="$t('plugin.title')"
@search="initPlugins"
@import="importJar"
:show-import="true"/>
:show-import="true" :upload-permission="['SYSTEM_PLUGIN:UPLOAD']"/>
</template>
<el-table
@ -44,13 +44,13 @@
:tip="$t('commons.delete')"
icon="el-icon-delete"
type="danger"
@exec="handleDelete(scope.row.id)"/>
@exec="handleDelete(scope.row.id)" v-permission="['SYSTEM_PLUGIN:DEL']"/>
</div>
<div v-else>
<ms-table-operator-button
:tip="$t('plugin.script_view')"
icon="el-icon-view"
@exec="handleView(scope.row)"/>
@exec="handleView(scope.row)" v-permission="['SYSTEM_PLUGIN:VIEW']"/>
</div>
</template>
</el-table-column>

View File

@ -4,7 +4,7 @@
<el-card class="table-card">
<template v-slot:header>
<ms-table-header :create-permission="['SYSTEM_USER:READ+CREATE']" :condition.sync="condition" @search="search"
@import="importUserDialogOpen" :show-import="true" :import-tip="$t('commons.import_user')"
@import="importUserDialogOpen" :show-import="true" :upload-permission="['SYSTEM_USER:READ+CREATE']" :import-tip="$t('commons.import_user')"
:tip="$t('commons.search_by_name_or_id')" @create="create"
:create-tip="$t('user.create')" :title="$t('commons.user')"/>
</template>