fix: 测试跟踪部分权限问题
This commit is contained in:
parent
4bf0bd7f7a
commit
6caf0e7347
|
@ -52,7 +52,7 @@
|
|||
"vue-float-action-button": "^0.6.6",
|
||||
"vue-i18n": "^8.15.3",
|
||||
"vue-jsonpath-picker": "^1.1.5",
|
||||
"vue-minder-editor-plus": "^1.0.25",
|
||||
"vue-minder-editor-plus": "^1.0.26",
|
||||
"vue-papa-parse": "^2.0.0",
|
||||
"vue-pdf": "^4.2.0",
|
||||
"vue-router": "^3.1.3",
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
:tree-nodes="data"
|
||||
:allLabel="$t('commons.all_module_title')"
|
||||
:type="isReadOnly ? 'view' : 'edit'"
|
||||
:delete-permission="['PROJECT_API_SCENARIO:READ+DELETE']"
|
||||
:add-permission="['PROJECT_API_SCENARIO:READ+CREATE']"
|
||||
:update-permission="['PROJECT_API_SCENARIO:READ+EDIT']"
|
||||
@add="add"
|
||||
@edit="edit"
|
||||
@drag="drag"
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
@drag="drag"
|
||||
@remove="remove"
|
||||
@refresh="list"
|
||||
:delete-permission="['PROJECT_API_DEFINITION:READ+DELETE_API']"
|
||||
:add-permission="['PROJECT_API_DEFINITION:READ+CREATE_API']"
|
||||
:update-permission="['PROJECT_API_DEFINITION:READ+EDIT_API']"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
ref="nodeTree">
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
:default-mold="defaultMode"
|
||||
@afterMount="$emit('afterMount')"
|
||||
@moldChange="handleMoldChange"
|
||||
:disabled="disabled"
|
||||
@save="save"
|
||||
/>
|
||||
</div>
|
||||
|
@ -63,7 +64,8 @@ export default {
|
|||
},
|
||||
tagDisableCheck: Function,
|
||||
tagEditCheck: Function,
|
||||
priorityDisableCheck: Function
|
||||
priorityDisableCheck: Function,
|
||||
disabled: Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -7,11 +7,6 @@
|
|||
<script>
|
||||
export default {
|
||||
name: "MsTableButton",
|
||||
data() {
|
||||
return {
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
props: {
|
||||
content: String,
|
||||
icon: {
|
||||
|
@ -33,7 +28,8 @@
|
|||
isTesterPermission: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
disabled: Boolean
|
||||
},
|
||||
methods: {
|
||||
exec() {
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
</el-tab-pane>
|
||||
<el-tab-pane name="add">
|
||||
<template v-slot:label>
|
||||
<el-dropdown @command="handleCommand">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini"/>
|
||||
<el-dropdown @command="handleCommand" v-permission="['PROJECT_TRACK_CASE:READ+CREATE']">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" />
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="ADD" v-permission="['PROJECT_TRACK_CASE:READ+CREATE']">
|
||||
{{ $t('test_track.case.create') }}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="dropdown-menu-class">
|
||||
<div class="show-more-btn-title">{{$t('test_track.case.batch_handle', [size])}}</div>
|
||||
<el-dropdown-item v-for="(btn,index) in buttons" v-permission="btn.permission ? btn.permission: []" :key="index" @click.native.stop="click(btn)">
|
||||
<el-dropdown-item v-for="(btn,index) in buttons" :disabled="isDisable(btn)" :key="index" @click.native.stop="click(btn)">
|
||||
{{btn.name}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
|
@ -15,6 +15,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {hasPermissions} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "ShowMoreBtn",
|
||||
props: {
|
||||
|
@ -36,6 +38,12 @@
|
|||
if (btn.handleClick instanceof Function) {
|
||||
btn.handleClick();
|
||||
}
|
||||
},
|
||||
isDisable(item) {
|
||||
if (item.permission && item.permission.length > 0) {
|
||||
return !hasPermissions(item.permission);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
:content="$t('commons.save')"
|
||||
size="small" @click="saveCase"
|
||||
icon=""
|
||||
:disabled="readOnly"
|
||||
title="ctrl + s"/>
|
||||
<el-dropdown v-else split-button type="primary" class="ms-api-buttion" @click="handleCommand"
|
||||
@command="handleCommand" size="small" style="float: right;margin-right: 20px">
|
||||
|
@ -123,7 +124,7 @@
|
|||
import {
|
||||
getCurrentUser,
|
||||
getNodePath,
|
||||
handleCtrlSEvent,
|
||||
handleCtrlSEvent, hasPermission,
|
||||
listenGoBack,
|
||||
removeGoBackListener
|
||||
} from "@/common/js/utils";
|
||||
|
@ -208,7 +209,6 @@
|
|||
stepModel: 'STEP',
|
||||
customNum: ''
|
||||
},
|
||||
readOnly: false,
|
||||
maintainerOptions: [],
|
||||
testOptions: [],
|
||||
workspaceId: '',
|
||||
|
@ -277,6 +277,9 @@
|
|||
},
|
||||
systemNameMap() {
|
||||
return SYSTEM_FIELD_NAME_MAP;
|
||||
},
|
||||
readOnly() {
|
||||
return !hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
@ -275,7 +275,8 @@ export default {
|
|||
handleClick: this.handleBatchEdit,
|
||||
permissions: ['PROJECT_TRACK_CASE:READ+EDIT']
|
||||
}, {
|
||||
name: this.$t('test_track.case.batch_move_case'), handleClick: this.handleBatchMove
|
||||
name: this.$t('test_track.case.batch_move_case'),
|
||||
handleClick: this.handleBatchMove
|
||||
}, {
|
||||
name: this.$t('test_track.case.batch_delete_case'),
|
||||
handleClick: this.handleDeleteBatch,
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
v-if="data.id !== 'root' && data.name !=='默认模块'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
v-permission="updatePermission"
|
||||
:open-delay="200"
|
||||
:content="$t('test_track.module.rename')"
|
||||
placement="top">
|
||||
|
@ -45,6 +46,7 @@
|
|||
</el-tooltip>
|
||||
<el-tooltip
|
||||
v-if="data.name ==='默认模块' && data.level !==1"
|
||||
v-permission="updatePermission"
|
||||
class="item"
|
||||
effect="dark"
|
||||
:open-delay="200"
|
||||
|
@ -56,6 +58,7 @@
|
|||
class="item"
|
||||
effect="dark"
|
||||
:open-delay="200"
|
||||
v-permission="addPermission"
|
||||
:content="$t('test_track.module.add_submodule')"
|
||||
placement="top">
|
||||
<i @click.stop="append(node, data)" class="el-icon-circle-plus-outline"></i>
|
||||
|
@ -65,6 +68,7 @@
|
|||
v-if="data.name ==='默认模块' && data.level !==1"
|
||||
class="item" effect="dark"
|
||||
:open-delay="200"
|
||||
v-permission="deletePermission"
|
||||
:content="$t('commons.delete')"
|
||||
placement="top">
|
||||
<i @click.stop="remove(node, data)" class="el-icon-delete"></i>
|
||||
|
@ -75,6 +79,7 @@
|
|||
class="item" effect="dark"
|
||||
:open-delay="200"
|
||||
:content="$t('commons.delete')"
|
||||
v-permission="deletePermission"
|
||||
placement="top">
|
||||
<i @click.stop="remove(node, data)" class="el-icon-delete"></i>
|
||||
</el-tooltip>
|
||||
|
@ -99,7 +104,7 @@ export default {
|
|||
children: "children",
|
||||
label: "label"
|
||||
},
|
||||
extendTreeNodes: []
|
||||
extendTreeNodes: [],
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -122,6 +127,9 @@ export default {
|
|||
return 50;
|
||||
}
|
||||
},
|
||||
updatePermission: Array,
|
||||
addPermission: Array,
|
||||
deletePermission: Array
|
||||
},
|
||||
watch: {
|
||||
treeNodes() {
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
:tree-nodes="treeNodes"
|
||||
:type="'edit'"
|
||||
:name-limit="100"
|
||||
:delete-permission="['PROJECT_TRACK_CASE:READ+DELETE']"
|
||||
:add-permission="['PROJECT_TRACK_CASE:READ+CREATE']"
|
||||
:update-permission="['PROJECT_TRACK_CASE:READ+EDIT']"
|
||||
@add="add"
|
||||
@edit="edit"
|
||||
@drag="drag"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
:distinct-tags="tags"
|
||||
:tag-edit-check="tagEditCheck()"
|
||||
:priority-disable-check="priorityDisableCheck()"
|
||||
:disabled="disabled"
|
||||
@save="save"
|
||||
ref="minder"
|
||||
/>
|
||||
|
@ -21,7 +22,7 @@ import {
|
|||
getTestCaseDataMap,
|
||||
parseCase, priorityDisableCheck, tagEditCheck, updateNode
|
||||
} from "@/business/components/track/common/minder/minderUtils";
|
||||
import {getNodePath} from "@/common/js/utils";
|
||||
import {getNodePath, hasPermission} from "@/common/js/utils";
|
||||
export default {
|
||||
name: "TestCaseMinder",
|
||||
components: {MsModuleMinder},
|
||||
|
@ -52,6 +53,9 @@ name: "TestCaseMinder",
|
|||
},
|
||||
moduleOptions() {
|
||||
return this.$store.state.testCaseModuleOptions;
|
||||
},
|
||||
disabled() {
|
||||
return !hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
},
|
||||
methods: {
|
||||
setStatus(status) {
|
||||
if (this.isReadOnly) {
|
||||
return;
|
||||
}
|
||||
this.$emit('statusChange', status);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -249,6 +249,7 @@ import HeaderCustom from "@/business/components/common/head/HeaderCustom";
|
|||
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
|
||||
import MsTag from "@/business/components/common/components/MsTag";
|
||||
import MsTestPlanScheduleMaintain from "@/business/components/track/plan/components/ScheduleMaintain";
|
||||
import {hasPermission} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "TestPlanList",
|
||||
|
@ -366,6 +367,9 @@ export default {
|
|||
this.$emit('testPlanEdit', testPlan);
|
||||
},
|
||||
statusChange(data) {
|
||||
if (!hasPermission('PROJECT_TRACK_PLAN:READ+EDIT')) {
|
||||
return;
|
||||
}
|
||||
let oldStatus = data.item.status;
|
||||
let newStatus = data.status;
|
||||
let param = {};
|
||||
|
|
|
@ -122,7 +122,7 @@ import ApiTestDetail from "../test/ApiTestDetail";
|
|||
import ApiTestResult from "../test/ApiTestResult";
|
||||
import PerformanceTestDetail from "../test/PerformanceTestDetail";
|
||||
import PerformanceTestResult from "../test/PerformanceTestResult";
|
||||
import {getUUID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import {getUUID, hasPermission, listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
||||
import CaseComment from "@/business/components/track/case/components/CaseComment";
|
||||
import MsPreviousNextButton from "../../../../../common/components/MsPreviousNextButton";
|
||||
|
@ -185,7 +185,8 @@ export default {
|
|||
testCaseTemplate: {},
|
||||
formLabelWidth: "100px",
|
||||
isCustomFiledActive: false,
|
||||
otherInfoActive: true
|
||||
otherInfoActive: true,
|
||||
isReadOnly: false
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -194,10 +195,6 @@ export default {
|
|||
},
|
||||
searchParam: {
|
||||
type: Object
|
||||
},
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -383,6 +380,8 @@ export default {
|
|||
this.activeTab = 'detail';
|
||||
this.hasTapdId = false;
|
||||
this.hasZentaoId = false;
|
||||
this.isReadOnly = !hasPermission('PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL');
|
||||
|
||||
listenGoBack(this.handleClose);
|
||||
let initFuc = this.initData;
|
||||
getTemplate('field/template/case/get/relate/', this)
|
||||
|
|
Loading…
Reference in New Issue