fix(测试跟踪): 新建用例时版本及所属模块未指定初值
--bug=1023265,1023264 --user=宋昌昌 【测试跟踪】功能用例-创建用例/功能用例列表-复制用例/编辑用例-更多操作-复制-版本默认为空 https://www.tapd.cn/55049933/s/1337907
This commit is contained in:
parent
8716a1d0ea
commit
fb9791e4d6
|
@ -28,7 +28,7 @@
|
||||||
<svg-icon v-if="data.id !== 'root' && !hideNodeOperator" icon-class="icon_drag_outlined"/>
|
<svg-icon v-if="data.id !== 'root' && !hideNodeOperator" icon-class="icon_drag_outlined"/>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span v-if="data.isEdit" @click.stop @click.stop style="width: 92%">
|
<span v-if="data.isEdit" @click.stop style="width: 92%">
|
||||||
<el-input @blur.stop="save(node, data)" @keyup.enter.native.stop="$event.target.blur()" v-model="data.name"
|
<el-input @blur.stop="save(node, data)" @keyup.enter.native.stop="$event.target.blur()" v-model="data.name"
|
||||||
class="name-input" size="mini" ref="nameInput" :draggable="true"/>
|
class="name-input" size="mini" ref="nameInput" :draggable="true"/>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -345,7 +345,8 @@ export default {
|
||||||
hasPermission,
|
hasPermission,
|
||||||
handleCreateCase(){
|
handleCreateCase(){
|
||||||
openCaseCreate({
|
openCaseCreate({
|
||||||
projectId: this.projectId
|
projectId: this.projectId,
|
||||||
|
createNodeId: this.selectNode.data && this.selectNode.data.id !== 'root' ? this.selectNode.data.id : ""
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
handleImportCommand(e) {
|
handleImportCommand(e) {
|
||||||
|
|
|
@ -307,6 +307,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {getProjectVersions} from "metersphere-frontend/src/api/version";
|
||||||
import { TokenKey } from "metersphere-frontend/src/utils/constants";
|
import { TokenKey } from "metersphere-frontend/src/utils/constants";
|
||||||
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
|
import MsDialogFooter from "metersphere-frontend/src/components/MsDialogFooter";
|
||||||
import {
|
import {
|
||||||
|
@ -691,8 +692,21 @@ export default {
|
||||||
this.$router.push('/track/case/all');
|
this.$router.push('/track/case/all');
|
||||||
});
|
});
|
||||||
this.$EventBus.$on("handleSaveCaseWithEvent", this.handleSaveCaseWithEvent);
|
this.$EventBus.$on("handleSaveCaseWithEvent", this.handleSaveCaseWithEvent);
|
||||||
|
this.setInitialVal();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
setInitialVal() {
|
||||||
|
if (this.isAdd) {
|
||||||
|
getProjectVersions(getCurrentProjectID()).then(
|
||||||
|
(r) => {
|
||||||
|
let latestVersion = r.data.filter(version => version.latest);
|
||||||
|
if (latestVersion && latestVersion.length === 1 && this.editable) {
|
||||||
|
this.initLatestVersionId = latestVersion[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
checkoutLatest(){
|
checkoutLatest(){
|
||||||
//切换最新版本
|
//切换最新版本
|
||||||
this.checkoutByVersionId(this.latestVersionId);
|
this.checkoutByVersionId(this.latestVersionId);
|
||||||
|
@ -937,6 +951,7 @@ export default {
|
||||||
this.form.method = "manual";
|
this.form.method = "manual";
|
||||||
this.form.maintainer = user.id;
|
this.form.maintainer = user.id;
|
||||||
this.form.tags = [];
|
this.form.tags = [];
|
||||||
|
this.form.versionId = this.initLatestVersionId;
|
||||||
this.getSelectOptions();
|
this.getSelectOptions();
|
||||||
this.customFieldForm = parseCustomField(
|
this.customFieldForm = parseCustomField(
|
||||||
this.form,
|
this.form,
|
||||||
|
@ -986,7 +1001,7 @@ export default {
|
||||||
//复制的时候只复制当前版本
|
//复制的时候只复制当前版本
|
||||||
testCase.id = getUUID();
|
testCase.id = getUUID();
|
||||||
testCase.refId = null;
|
testCase.refId = null;
|
||||||
testCase.versionId = null;
|
testCase.versionId = this.initLatestVersionId;
|
||||||
|
|
||||||
this.testCaseTemplate.customFields.forEach((item) => {
|
this.testCaseTemplate.customFields.forEach((item) => {
|
||||||
item.isEdit = false;
|
item.isEdit = false;
|
||||||
|
|
|
@ -328,9 +328,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {getProjectVersions} from "metersphere-frontend/src/api/version";
|
||||||
getProjectVersions,
|
|
||||||
} from "metersphere-frontend/src/api/version";
|
|
||||||
import { hasLicense } from "metersphere-frontend/src/utils/permission";
|
import { hasLicense } from "metersphere-frontend/src/utils/permission";
|
||||||
import MsFormDivider from "metersphere-frontend/src/components/MsFormDivider";
|
import MsFormDivider from "metersphere-frontend/src/components/MsFormDivider";
|
||||||
import MsSelectTree from "metersphere-frontend/src/components/select-tree/SelectTree";
|
import MsSelectTree from "metersphere-frontend/src/components/select-tree/SelectTree";
|
||||||
|
@ -466,13 +464,17 @@ export default {
|
||||||
defaultModuleKey() {
|
defaultModuleKey() {
|
||||||
if (this.editable) {
|
if (this.editable) {
|
||||||
let defaultNodeKey = '';
|
let defaultNodeKey = '';
|
||||||
this.treeNodes.forEach(node => {
|
if (this.$route.query.createNodeId) {
|
||||||
if (node.label === '未规划用例') {
|
defaultNodeKey = this.$route.query.createNodeId;
|
||||||
defaultNodeKey = node.id;
|
} else {
|
||||||
this.form.module = defaultNodeKey;
|
this.treeNodes.forEach(node => {
|
||||||
this.form.nodePath = node.path;
|
if (node.label === '未规划用例') {
|
||||||
}
|
defaultNodeKey = node.id;
|
||||||
})
|
this.form.module = defaultNodeKey;
|
||||||
|
this.form.nodePath = node.path;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
return defaultNodeKey;
|
return defaultNodeKey;
|
||||||
} else {
|
} else {
|
||||||
return this.form.module
|
return this.form.module
|
||||||
|
@ -482,6 +484,11 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getDemandOptions();
|
this.getDemandOptions();
|
||||||
this.getVersionOptions();
|
this.getVersionOptions();
|
||||||
|
if (this.$route.query.createNodeId) {
|
||||||
|
this.form.module = this.$route.query.createNodeId;
|
||||||
|
let node = this.findTreeNode(this.treeNodes);
|
||||||
|
this.form.nodePath = node.path;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleDemandOptionPlatform(data){
|
handleDemandOptionPlatform(data){
|
||||||
|
|
Loading…
Reference in New Issue