feat(版本对比): 增加版本名称操作人时间

--user=郭雨琦 增加版本名称操作人时间
This commit is contained in:
guoyuqi 2022-01-18 19:39:52 +08:00 committed by 刘瑞斌
parent 0d77113760
commit f9a7fd8a42
7 changed files with 975 additions and 912 deletions

View File

@ -354,6 +354,7 @@
:new-scenario-definition="newScenarioDefinition" :new-scenario-definition="newScenarioDefinition"
:project-env-map="projectEnvMap" :project-env-map="projectEnvMap"
:new-project-env-map="newProjectEnvMap" :new-project-env-map="newProjectEnvMap"
:project-list="projectList"
:type ="type" :type ="type"
></scenario-diff> ></scenario-diff>
</el-dialog> </el-dialog>
@ -1749,12 +1750,16 @@ export default {
if(obj.hashTree){ if(obj.hashTree){
for (let i = 0; i < obj.hashTree.length; i++) { for (let i = 0; i < obj.hashTree.length; i++) {
obj.hashTree[i].disabled = true; obj.hashTree[i].disabled = true;
if (!obj.hashTree[i].requestResult) {
obj.hashTree[i].requestResult = [{responseResult: {}}];
}
} }
} }
for (let i = 0; i < this.scenarioDefinition.length; i++) { for (let i = 0; i < this.scenarioDefinition.length; i++) {
this.scenarioDefinition[i].disabled = true; this.scenarioDefinition[i].disabled = true;
} }
this.newScenarioDefinition = obj.hashTree; this.newScenarioDefinition = obj.hashTree;
if (response.data.environmentJson) { if (response.data.environmentJson) {
this.newProjectEnvMap = objToStrMap(JSON.parse(response.data.environmentJson)); this.newProjectEnvMap = objToStrMap(JSON.parse(response.data.environmentJson));
} else { } else {
@ -1763,6 +1768,7 @@ export default {
} }
} }
} }
res.data.userName = response.data.userName
this.newData = res.data; this.newData = res.data;
this.dialogVisible = true; this.dialogVisible = true;
} }

View File

@ -1,6 +1,15 @@
<template> <template>
<div class="compare-class"> <div>
<el-card ref="old"> <el-row>
<el-col :span="12">
<el-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.updateTime | timestampFormatDate }}</span>
</el-col>
<el-col :span="12">
<el-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.updateTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData">
<el-card ref="old" style="width: 50%">
<el-card> <el-card>
<div class="card-content"> <div class="card-content">
<div class="ms-main-div" @click="showAll" > <div class="ms-main-div" @click="showAll" >
@ -151,6 +160,7 @@
:scenario="data" :scenario="data"
:node="node" :node="node"
:env-map="projectEnvMap" :env-map="projectEnvMap"
:project-list="projectList"
:show-version="false" :show-version="false"
/> />
</span> </span>
@ -163,7 +173,7 @@
</div> </div>
</el-card> </el-card>
</el-card> </el-card>
<el-card ref="new"> <el-card ref="new" style="width: 50%">
<el-card> <el-card>
<div class="card-content"> <div class="card-content">
<div class="ms-main-div" @click="showAll" v-if="type!=='detail'"> <div class="ms-main-div" @click="showAll" v-if="type!=='detail'">
@ -314,6 +324,7 @@
:scenario="data" :scenario="data"
:node="node" :node="node"
:env-map="newProjectEnvMap" :env-map="newProjectEnvMap"
:project-list="projectList"
:show-version="false" :show-version="false"
/> />
</span> </span>
@ -345,6 +356,7 @@
></scenario-child-diff> ></scenario-child-diff>
</el-dialog> </el-dialog>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -399,7 +411,10 @@ export default{
newOnSampleError:{}, newOnSampleError:{},
projectEnvMap: {}, projectEnvMap: {},
newProjectEnvMap: {}, newProjectEnvMap: {},
type:{} type:{},
projectList:{
type: Array,
},
}, },
components:{ components:{
ScenarioChildDiff, ScenarioChildDiff,
@ -427,6 +442,7 @@ export default{
options: API_STATUS, options: API_STATUS,
levels: PRIORITY, levels: PRIORITY,
loading: false, loading: false,
isReloadData:true,
moduleObj: { moduleObj: {
id: 'id', id: 'id',
label: 'name', label: 'name',
@ -439,7 +455,6 @@ export default{
}, },
showHideTree: true, showHideTree: true,
environmentType: ENV_TYPE.JSON, environmentType: ENV_TYPE.JSON,
projectList:[],
props: { props: {
label: "label", label: "label",
children: "hashTree" children: "hashTree"
@ -455,7 +470,7 @@ export default{
rightChildNode:{}, rightChildNode:{},
leftChildVnode:{}, leftChildVnode:{},
rightChildVnode:{}, rightChildVnode:{},
dialogVisible:false dialogVisible:false,
} }
}, },
methods:{ methods:{
@ -466,6 +481,7 @@ export default{
console.log(this.$refs.old) console.log(this.$refs.old)
console.log(this.$refs.new) console.log(this.$refs.new)
diff(oldVnode,vnode); diff(oldVnode,vnode);
this.isReloadData = false
}, },
showAll() { showAll() {
// //
@ -493,11 +509,6 @@ export default{
this.newEnvResult.loading = false; this.newEnvResult.loading = false;
}) })
}, },
getWsProjects() {
this.$get("/project/listAll", res => {
this.projectList = res.data;
})
},
changeNodeStatus(nodes,source) { changeNodeStatus(nodes,source) {
for (let i in nodes) { for (let i in nodes) {
if (nodes[i]) { if (nodes[i]) {
@ -622,7 +633,7 @@ export default{
}, },
created() { created() {
this.getWsProjects();
}, },
mounted() { mounted() {
this.$nextTick(function () { this.$nextTick(function () {

View File

@ -1,4 +1,13 @@
<template> <template>
<div>
<el-row>
<el-col :span="12">
<el-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.updateTime | timestampFormatDate }}</span>
</el-col>
<el-col :span="12">
<el-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.updateTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData"> <div class="compare-class" v-loading="isReloadData">
<el-card style="width: 50%;" ref="old"> <el-card style="width: 50%;" ref="old">
<div style="background-color: white;"> <div style="background-color: white;">
@ -103,6 +112,7 @@
</div> </div>
</el-card> </el-card>
</div> </div>
</div>
</template> </template>
<script> <script>

View File

@ -1,4 +1,13 @@
<template> <template>
<div>
<el-row>
<el-col :span="12">
<el-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.updateTime | timestampFormatDate }}</span>
</el-col>
<el-col :span="12">
<el-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.updateTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData"> <div class="compare-class" v-loading="isReloadData">
<el-card style="width: 50%;" ref="old"> <el-card style="width: 50%;" ref="old">
<el-form :model="oldData" :rules="rule" ref="httpForm" label-width="80px" label-position="right" :disabled="true"> <el-form :model="oldData" :rules="rule" ref="httpForm" label-width="80px" label-position="right" :disabled="true">
@ -264,6 +273,7 @@
</api-info-container> </api-info-container>
</el-card> </el-card>
</div> </div>
</div>
</template> </template>
<script> <script>
import {API_STATUS, REQ_METHOD} from "../../../model/JsonData"; import {API_STATUS, REQ_METHOD} from "../../../model/JsonData";

View File

@ -1,4 +1,13 @@
<template> <template>
<div>
<el-row>
<el-col :span="12">
<el-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.updateTime | timestampFormatDate }}</span>
</el-col>
<el-col :span="12">
<el-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.updateTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData"> <div class="compare-class" v-loading="isReloadData">
<el-card style="width: 50%;" ref="old"> <el-card style="width: 50%;" ref="old">
<div style="background-color: white;"> <div style="background-color: white;">
@ -102,6 +111,7 @@
</div> </div>
</el-card> </el-card>
</div> </div>
</div>
</template> </template>
<script> <script>

View File

@ -1,4 +1,13 @@
<template> <template>
<div>
<el-row>
<el-col :span="12">
<el-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.updateTime | timestampFormatDate }}</span>
</el-col>
<el-col :span="12">
<el-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.updateTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData"> <div class="compare-class" v-loading="isReloadData">
<el-card style="width: 50%;" ref="old"> <el-card style="width: 50%;" ref="old">
<div style="background-color: white;"> <div style="background-color: white;">
@ -158,6 +167,7 @@
</div> </div>
</el-card> </el-card>
</div> </div>
</div>
</template> </template>
<script> <script>

View File

@ -1,9 +1,15 @@
<template> <template>
<div v-loading="isReloadData"> <div v-loading="isReloadData">
<div class="caall"> <div class="caall"></div>
<el-row>
</div> <el-col :span="12">
<el-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.updateTime | timestampFormatDate }}</span>
</el-col>
<el-col :span="12">
<el-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.updateTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" id="vdiff" ref="all" > <div class="compare-class" id="vdiff" ref="all" >
<el-card style="width: 50%;" ref="old" id="old" > <el-card style="width: 50%;" ref="old" id="old" >
<ms-form-divider :title="$t('test_track.plan_view.base_info')"/> <ms-form-divider :title="$t('test_track.plan_view.base_info')"/>