fix: 修复操作列按钮权限

This commit is contained in:
Captain.B 2021-05-27 12:23:09 +08:00 committed by BugKing
parent c738139e49
commit 46e7a47d2e
36 changed files with 318 additions and 215 deletions

View File

@ -58,11 +58,13 @@
</el-table-column>
<el-table-column width="150" :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator-button :tip="$t('api_report.detail')" icon="el-icon-s-data"
@exec="handleView(scope.row)" type="primary"/>
<ms-table-operator-button :tip="$t('api_report.delete')"
v-permission="['PROJECT_API_REPORT:READ+DELETE']"
icon="el-icon-delete" @exec="handleDelete(scope.row)" type="danger"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -102,6 +102,7 @@
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<div>
<ms-table-operator-button class="run-button"
:tip="$t('api_test.automation.execute')"
icon="el-icon-video-play"
@ -110,11 +111,14 @@
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-edit" @exec="handleTestCase(scope.row)"
v-permission="['PROJECT_API_DEFINITION:READ+EDIT_CASE']"
/>
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" @exec="handleDelete(scope.row)"
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete"
@exec="handleDelete(scope.row)"
v-permission="['PROJECT_API_DEFINITION:READ+DELETE_CASE']"
type="danger"/>
<ms-api-case-table-extend-btns @showCaseRef="showCaseRef" @showEnvironment="showEnvironment"
<ms-api-case-table-extend-btns @showCaseRef="showCaseRef"
@showEnvironment="showEnvironment"
@createPerformance="createPerformance" :row="scope.row"/>
</div>
</template>
</el-table-column>

View File

@ -38,11 +38,14 @@
</el-table-column>
<el-table-column fixed="right" min-width="100" align="center" :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator-button :tip="$t('commons.copy')" icon="el-icon-copy-document"
@exec="copyExpect(scope.row)"
/>
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-delete" @exec="removeExpect(scope.row)"
<ms-table-operator-button :tip="$t('commons.edit')" icon="el-icon-delete"
@exec="removeExpect(scope.row)"
/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -15,9 +15,12 @@
<el-table-column :label="$t('commons.operating')" min-width="100">
<template v-slot:default="scope">
<div>
<ms-table-operator-button :tip="$t('commons.copy')" icon="el-icon-document-copy" type="success"
@exec="handleCopy(scope.$index, scope.row)"/>
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" type="danger" @exec="handleDelete(scope.$index)"/>
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" type="danger"
@exec="handleDelete(scope.$index)"/>
</div>
</template>
</el-table-column>

View File

@ -43,10 +43,12 @@
</el-table-column>
<el-table-column width="150" :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator-button :tip="$t('api_report.detail')" icon="el-icon-s-data"
@exec="handleView(scope.row)" type="primary"/>
<ms-table-operator-button :tip="$t('api_report.delete')"
icon="el-icon-delete" @exec="handleDelete(scope.row)" type="danger"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -45,7 +45,9 @@
</el-table-column>
<el-table-column width="150" :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operators :buttons="buttons" :row="scope.row"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -69,10 +69,12 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')" width="100px">
<template v-slot:default="{row}">
<div>
<ms-table-operator-button :tip="$t('api_test.automation.copy')"
icon="el-icon-document-copy" @exec="copy(row)"/>
<ms-table-operator-button :tip="$t('api_test.automation.remove')"
icon="el-icon-delete" @exec="remove(row)" type="danger"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -23,10 +23,12 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')" width="100px">
<template v-slot:default="{row}">
<div>
<ms-table-operator-button :tip="$t('commons.update')" icon="el-icon-edit"
type="primary" @exec="edit(row)"/>
<ms-table-operator-button :tip="$t('api_test.automation.remove')"
icon="el-icon-delete" @exec="remove(row)" type="danger"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -19,7 +19,10 @@
<el-table-column :label="$t('commons.operating')" min-width="100">
<template v-slot:default="scope">
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" type="danger" @exec="handleDelete(scope.row.id)"/>
<div>
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" type="danger"
@exec="handleDelete(scope.row.id)"/>
</div>
</template>
</el-table-column>

View File

@ -15,9 +15,12 @@
<el-table-column :label="$t('commons.operating')" min-width="100">
<template v-slot:default="scope">
<div>
<ms-table-operator-button :tip="$t('commons.copy')" icon="el-icon-document-copy" type="success"
@exec="handleCopy(scope.$index, scope.row)"/>
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" type="danger" @exec="handleDelete(scope.$index)"/>
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete" type="danger"
@exec="handleDelete(scope.$index)"/>
</div>
</template>
</el-table-column>

View File

@ -41,7 +41,9 @@
<header-label-operate @exec="openCustomHeader"/>
</template>
<template v-slot:default="scope">
<div>
<ms-table-operators :buttons="operators" :row="scope.row" :index="scope.$index"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -78,7 +78,9 @@
width="150"
:label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operators :buttons="buttons" :row="scope.row"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -34,9 +34,12 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['ORGANIZATION_USER:READ+EDIT']"
:delete-permission="['ORGANIZATION_USER:READ+DELETE']"
:tip2="$t('commons.remove')" @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
:tip2="$t('commons.remove')" @editClick="edit(scope.row)"
@deleteClick="del(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -19,9 +19,11 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['ORGANIZATION_WORKSPACE:READ+EDIT']"
:delete-permission="['ORGANIZATION_WORKSPACE:READ+DELETE']"
@editClick="edit(scope.row)" @deleteClick="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>
@ -77,7 +79,10 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>
<div>
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)"
@deleteClick="delMember(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -51,8 +51,10 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator-button :tip="$t('commons.delete')" icon="el-icon-delete"
type="danger" @exec="deleteApiKey(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -22,10 +22,12 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator-button :tip="$t('member.edit_information')" icon="el-icon-edit"
type="primary" @exec="edit(scope.row)"/>
<ms-table-operator-button :tip="$t('member.edit_password')" icon="el-icon-s-tools" v-if="isLocalUser"
type="success" @exec="editPassword(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -35,14 +35,17 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['PROJECT_ENVIRONMENT:READ+EDIT']"
:delete-permission="['PROJECT_ENVIRONMENT:READ+DELETE']"
@editClick="editEnv(scope.row)" @deleteClick="deleteEnv(scope.row)">
<template v-slot:middle>
<ms-table-operator-button v-permission="['PROJECT_ENVIRONMENT:READ+COPY']" :tip="$t('commons.copy')" @exec="copyEnv(scope.row)"
<ms-table-operator-button v-permission="['PROJECT_ENVIRONMENT:READ+COPY']" :tip="$t('commons.copy')"
@exec="copyEnv(scope.row)"
icon="el-icon-document-copy" type="info"/>
</template>
</ms-table-operator>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -20,9 +20,12 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['PROJECT_USER:READ+EDIT']"
:delete-permission="['PROJECT_USER:READ+DELETE']"
:tip2="$t('commons.remove')" @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
:tip2="$t('commons.remove')" @editClick="edit(scope.row)"
@deleteClick="del(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -53,6 +53,7 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')" width="180">
<template v-slot:default="scope">
<div>
<ms-table-operator
:edit-permission="['PROJECT_MANAGER:READ+EDIT']"
:delete-permission="['PROJECT_MANAGER:READ+DELETE']"
@ -71,6 +72,7 @@
type="success" @exec="openFiles(scope.row)"/>
</template>
</ms-table-operator>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -21,9 +21,11 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['SYSTEM_ORGANIZATION:READ+EDIT']"
:delete-permission="['SYSTEM_ORGANIZATION:READ+DELETE']"
@editClick="edit(scope.row)" @deleteClick="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>
@ -49,8 +51,10 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)"
@deleteClick="delMember(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -21,8 +21,11 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<ms-table-operator :edit-permission="['SYSTEM_WORKSPACE:READ+EDIT']" :delete-permission="['SYSTEM_WORKSPACE:READ+DELETE']"
<div>
<ms-table-operator :edit-permission="['SYSTEM_WORKSPACE:READ+EDIT']"
:delete-permission="['SYSTEM_WORKSPACE:READ+DELETE']"
@editClick="edit(scope.row)" @deleteClick="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>
@ -107,8 +110,10 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)"
@deleteClick="delMember(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -39,9 +39,11 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['SYSTEM_TEST_POOL:READ+EDIT']"
:delete-permission="['SYSTEM_TEST_POOL:READ+DELETE']"
@editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -53,13 +53,18 @@
<el-table-column prop="source" :label="$t('user.source')"/>
<el-table-column :label="$t('commons.operating')" min-width="120px">
<template v-slot:default="scope">
<ms-table-operator :edit-permission="['SYSTEM_USER:READ+EDIT']" :delete-permission="['SYSTEM_USER:READ+DELETE']"
<div>
<ms-table-operator :edit-permission="['SYSTEM_USER:READ+EDIT']"
:delete-permission="['SYSTEM_USER:READ+DELETE']"
@editClick="edit(scope.row)" @deleteClick="del(scope.row)">
<template v-slot:behind>
<ms-table-operator-button :tip="$t('member.edit_password')" icon="el-icon-s-tools"
v-permission="['SYSTEM_USER:READ+EDIT_PASSWORD']" type="success" @exec="editPassword(scope.row)" v-if="scope.row.isLocalUser"/>
v-permission="['SYSTEM_USER:READ+EDIT_PASSWORD']" type="success"
@exec="editPassword(scope.row)" v-if="scope.row.isLocalUser"/>
</template>
</ms-table-operator>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -29,14 +29,18 @@
<el-table-column prop="description" label="描述"/>
<el-table-column :label="$t('commons.operating')" min-width="120">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['SYSTEM_GROUP:READ+EDIT', 'ORGANIZATION_GROUP:READ+EDIT']"
:delete-permission="['SYSTEM_GROUP:READ+DELETE', 'ORGANIZATION_GROUP:READ+DELETE']"
@editClick="edit(scope.row)" @deleteClick="del(scope.row)">
<template v-slot:middle>
<!-- <ms-table-operator-button tip="复制" icon="el-icon-document-copy" @exec="copy(scope.row)"/>-->
<ms-table-operator-button v-permission="['SYSTEM_GROUP:READ+SETTING_PERMISSION', 'ORGANIZATION_GROUP:READ+SETTING_PERMISSION']" tip="设置权限" icon="el-icon-s-tools" @exec="setPermission(scope.row)"/>
<ms-table-operator-button
v-permission="['SYSTEM_GROUP:READ+SETTING_PERMISSION', 'ORGANIZATION_GROUP:READ+SETTING_PERMISSION']"
tip="设置权限" icon="el-icon-s-tools" @exec="setPermission(scope.row)"/>
</template>
</ms-table-operator>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -60,6 +60,7 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')" width="180">
<template v-slot:default="scope">
<div>
<ms-table-operator
:edit-permission="['WORKSPACE_PROJECT_MANAGER:READ+EDIT']"
:delete-permission="['WORKSPACE_PROJECT_MANAGER:READ+DELETE']"
@ -78,6 +79,7 @@
type="success" @exec="openFiles(scope.row)"/>
</template>
</ms-table-operator>
</div>
</template>
</el-table-column>
</el-table>
@ -149,7 +151,10 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)" @deleteClick="delMember(scope.row)"/>
<div>
<ms-table-operator :tip2="$t('commons.remove')" @editClick="editMember(scope.row)"
@deleteClick="delMember(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -35,9 +35,12 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['WORKSPACE_USER:READ+EDIT']"
:delete-permission="['WORKSPACE_USER:READ+DELETE']"
:tip2="$t('commons.remove')" @editClick="edit(scope.row)" @deleteClick="del(scope.row)"/>
:tip2="$t('commons.remove')" @editClick="edit(scope.row)"
@deleteClick="del(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -35,14 +35,17 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['WORKSPACE_PROJECT_ENVIRONMENT:READ+EDIT']"
:delete-permission="['WORKSPACE_PROJECT_ENVIRONMENT:READ+DELETE']"
@editClick="editEnv(scope.row)" @deleteClick="deleteEnv(scope.row)">
<template v-slot:middle>
<ms-table-operator-button v-permission="['WORKSPACE_PROJECT_ENVIRONMENT:READ+COPY']" :tip="$t('commons.copy')" @exec="copyEnv(scope.row)"
<ms-table-operator-button v-permission="['WORKSPACE_PROJECT_ENVIRONMENT:READ+COPY']"
:tip="$t('commons.copy')" @exec="copyEnv(scope.row)"
icon="el-icon-document-copy" type="info"/>
</template>
</ms-table-operator>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -184,6 +184,7 @@
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['PROJECT_TRACK_PLAN:READ+EDIT']"
:delete-permission="['PROJECT_TRACK_PLAN:READ+DELETE']"
@editClick="handleEdit(scope.row)"
@ -205,11 +206,13 @@
v-if="!scope.row.scheduleOpen" type="text"
:tip="$t('commons.trigger_mode.schedule')" icon="el-icon-time"
@exec="scheduleTask(scope.row)"/>
<ms-table-operator-button style="margin-left: 10px;color:#6C317C; border-color: #6C317C; border-width: thin;"
<ms-table-operator-button
style="margin-left: 10px;color:#6C317C; border-color: #6C317C; border-width: thin;"
v-permission="['PROJECT_TRACK_PLAN:READ+SCHEDULE']"
v-if="scope.row.scheduleOpen" type="text"
:tip="$t('commons.trigger_mode.schedule')" icon="el-icon-time"
@exec="scheduleTask(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -120,6 +120,8 @@
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<div>
<ms-table-operator-button class="run-button" v-permission="['PROJECT_API_DEFINITION:READ+RUN']"
:tip="$t('api_test.run')"
icon="el-icon-video-play"
@ -127,6 +129,7 @@
<ms-table-operator-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']"
:tip="$t('test_track.plan_view.cancel_relevance')"
icon="el-icon-unlock" type="danger" @exec="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>

View File

@ -86,6 +86,7 @@
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="{row}">
<div>
<ms-table-operator-button class="run-button"
v-permission="['PROJECT_API_SCENARIO:READ+RUN']"
:tip="$t('api_test.run')"
@ -94,6 +95,7 @@
<ms-table-operator-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']"
:tip="$t('test_track.plan_view.cancel_relevance')"
icon="el-icon-unlock" type="danger" @exec="remove(row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -220,12 +220,14 @@
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<div>
<ms-table-operator-button v-permission="['PROJECT_TRACK_CASE:READ+EDIT']" :tip="$t('commons.edit')"
icon="el-icon-edit"
@exec="handleEdit(scope.row)"/>
<ms-table-operator-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']"
:tip="$t('test_track.plan_view.cancel_relevance')"
icon="el-icon-unlock" type="danger" @exec="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -117,6 +117,8 @@
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<div>
<ms-table-operator-button class="run-button"
v-permission="['PROJECT_PERFORMANCE_TEST:READ+RUN']"
:tip="$t('api_test.run')"
@ -125,6 +127,7 @@
<ms-table-operator-button v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']"
:tip="$t('test_track.plan_view.cancel_relevance')"
icon="el-icon-unlock" type="danger" @exec="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -54,10 +54,13 @@
</el-table-column>
<el-table-column min-width="150" :label="$t('commons.operating')">
<template v-slot:default="scope">
<div>
<ms-table-operator-button :tip="$t('test_track.plan_view.view_report')" icon="el-icon-document"
@exec="openReport(scope.row.id)"/>
<ms-table-operator-button v-permission="['PROJECT_TRACK_PLAN:READ+REPORT_DELETE']" type="danger" :tip="$t('commons.delete')" icon="el-icon-delete"
<ms-table-operator-button v-permission="['PROJECT_TRACK_PLAN:READ+REPORT_DELETE']" type="danger"
:tip="$t('commons.delete')" icon="el-icon-delete"
@exec="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

View File

@ -95,11 +95,15 @@
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<div>
<ms-table-operator :edit-permission="['PROJECT_TRACK_REVIEW:READ+EDIT']"
:delete-permission="['PROJECT_TRACK_REVIEW:READ+DELETE']"
@editClick="handleEdit(scope.row)"
@deleteClick="handleDelete(scope.row)">
</ms-table-operator>
</div>
</template>
</el-table-column>
<header-custom ref="headerCustom" :initTableData="initTableData" :optionalFields=headerItems

View File

@ -156,12 +156,14 @@
<header-label-operate @exec="customHeader"/>
</template>
<template v-slot:default="scope">
<div>
<ms-table-operator-button v-permission="['PROJECT_TRACK_CASE:READ+EDIT']" :tip="$t('commons.edit')"
icon="el-icon-edit"
@exec="handleEdit(scope.row)"/>
<ms-table-operator-button v-permission="['PROJECT_TRACK_REVIEW:READ+RELEVANCE_OR_CANCEL']"
:tip="$t('test_track.plan_view.cancel_relevance')"
icon="el-icon-unlock" type="danger" @exec="handleDelete(scope.row)"/>
</div>
</template>
</el-table-column>
</el-table>

@ -1 +1 @@
Subproject commit 0af67efb336b3f5f6718c7b2684de4d4985c0aee
Subproject commit c85bda6f2fa74e0e696e9f9170742834a7519319