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

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

View File

@ -798,6 +798,21 @@
"name": "另存为", "name": "另存为",
"resourceId": "PROJECT_REPORT_ANALYSIS", "resourceId": "PROJECT_REPORT_ANALYSIS",
"license": false "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": [ "resource": [
@ -928,6 +943,10 @@
{ {
"id": "PROJECT_REPORT_ANALYSIS", "id": "PROJECT_REPORT_ANALYSIS",
"name": "报表" "name": "报表"
},
{
"id": "SYSTEM_PLUGIN",
"name": "插件管理"
} }
] ]
} }

View File

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

View File

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

View File

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