fix(版本对比): 颜色由创建时间决定

--user=郭雨琦 颜色由创建时间决定
This commit is contained in:
guoyuqi 2022-01-21 19:44:26 +08:00 committed by xiaomeinvG
parent 7b2521d52b
commit afa0b5bf7c
9 changed files with 101 additions and 177 deletions

View File

@ -46,7 +46,9 @@ export default{
},
oldVNode:{
},
newVNode:{}
newVNode:{},
oldColor:String,
newColor:String
},
components:{
MsComponentConfig,
@ -61,7 +63,7 @@ export default{
getDiff(){
let oldVnode = this.$refs.old
let vnode = this.$refs.new
diff(oldVnode,vnode)
diff(oldVnode,vnode,this.oldColor,this.newColor);
},
getVnode(){
let oldVnode = this.$refs.old

View File

@ -2,10 +2,10 @@
<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-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.createTime | 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-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.createTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData">
@ -14,16 +14,6 @@
<div class="card-content">
<div class="ms-main-div" @click="showAll" >
<!--操作按钮-->
<div class="ms-opt-btn">
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!showFollow">
<i class="el-icon-star-off" style="color: #783987; font-size: 25px; margin-right: 5px;cursor: pointer;position: relative; top: 5px; " />
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="showFollow">
<i class="el-icon-star-on" style="color: #783987; font-size: 28px; margin-right: 5px;cursor: pointer;position: relative; top: 5px; " />
</el-tooltip>
</div>
<div class="tip">{{ $t('test_track.plan_view.base_info') }}</div>
<el-form :model="oldData" label-position="right" label-width="80px" size="small" :rules="rules" :disabled="true"
ref="currentScenario" style="margin-right: 20px">
@ -178,16 +168,6 @@
<div class="card-content">
<div class="ms-main-div" @click="showAll" v-if="type!=='detail'">
<!--操作按钮-->
<div class="ms-opt-btn">
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!newShowFollow">
<i class="el-icon-star-off" style="color: #783987; font-size: 25px; margin-right: 5px;cursor: pointer;position: relative; top: 5px; " />
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="newShowFollow">
<i class="el-icon-star-on" style="color: #783987; font-size: 28px; margin-right: 5px;cursor: pointer;position: relative; top: 5px; " />
</el-tooltip>
</div>
<div class="tip">{{ $t('test_track.plan_view.base_info') }}</div>
<el-form :model="newData" label-position="right" label-width="80px" size="small" :rules="rules" :disabled="true"
ref="currentScenario" style="margin-right: 20px">
@ -355,6 +335,8 @@
:new-project-env-map="newProjectEnvMap"
:old-v-node="leftChildVnode"
:new-v-node="rightChildVnode"
:old-color="oldColor"
:new-color="newColor"
></scenario-child-diff>
</el-dialog>
</div>
@ -473,6 +455,8 @@ export default{
leftChildVnode:{},
rightChildVnode:{},
dialogVisible:false,
oldColor:"",
newColor:""
}
},
methods:{
@ -480,9 +464,14 @@ export default{
let oldVnode = this.$refs.old
let vnode = this.$refs.new
//oldVnode.style.backgroundColor = "rgb(241,200,196)";
console.log(this.$refs.old)
console.log(this.$refs.new)
diff(oldVnode,vnode);
if(this.oldData.createTime>this.newData.createTime){
this.oldColor = "rgb(121, 225, 153,0.3)";
this.newColor = "rgb(241,200,196,0.45)"
}else{
this.oldColor = "rgb(241,200,196,0.45)"
this.newColor = "rgb(121, 225, 153,0.3)";
}
diff(oldVnode,vnode,this.oldColor,this.newColor);
this.isReloadData = false
},
showAll() {

View File

@ -2,29 +2,15 @@
<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-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.createTime | 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-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.createTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData">
<el-card style="width: 50%;" ref="old">
<div style="background-color: white;">
<el-row>
<el-col>
<!--操作按钮-->
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!showFollow">
<i class="el-icon-star-off"
style="color: #783987; font-size: 25px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="showFollow">
<i class="el-icon-star-on"
style="color: #783987; font-size: 28px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
</el-col>
</el-row>
<!-- 基础信息 -->
<p class="tip">{{ $t('test_track.plan_view.base_info') }} </p>
<br/>
@ -62,20 +48,6 @@
</el-card>
<el-card style="width: 50%;" ref="new">
<div style="background-color: white;">
<el-row>
<el-col>
<!--操作按钮-->
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!newShowFollow">
<i class="el-icon-star-off"
style="color: #783987; font-size: 25px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="newShowFollow">
<i class="el-icon-star-on"
style="color: #783987; font-size: 28px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
</el-col>
</el-row>
<!-- 基础信息 -->
<p class="tip">{{ $t('test_track.plan_view.base_info') }} </p>
<br/>
@ -183,7 +155,16 @@ export default{
getDiff(){
let oldVnode = this.$refs.old
let vnode = this.$refs.new
diff(oldVnode,vnode);
let oldColor = "";
let newColor = "";
if(this.oldData.createTime>this.newData.createTime){
oldColor = "rgb(121, 225, 153,0.3)";
newColor = "rgb(241,200,196,0.45)"
}else{
oldColor = "rgb(241,200,196,0.45)"
newColor = "rgb(121, 225, 153,0.3)";
}
diff(oldVnode,vnode,oldColor,newColor);
this.isReloadData = false
},
setCount(count) {

View File

@ -2,27 +2,16 @@
<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-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.createTime | 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-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.createTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData">
<el-card style="width: 50%;" ref="old">
<el-form :model="oldData" :rules="rule" ref="httpForm" label-width="80px" label-position="right" :disabled="true">
<!-- 操作按钮 -->
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!showFollow">
<i class="el-icon-star-off"
style="color: #783987; font-size: 25px; margin-right: 5px; position: relative; top: 5px; float: right; cursor: pointer "/>
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="showFollow">
<i class="el-icon-star-on"
style="color: #783987; font-size: 28px; margin-right: 5px; position: relative; top: 5px; float: right; cursor: pointer "/>
</el-tooltip>
<br/>
<ms-form-divider :title="$t('test_track.plan_view.base_info')"/>
<!-- 基础信息 -->
@ -142,18 +131,6 @@
</el-card>
<el-card style="width: 50%;" ref="new">
<el-form :model="newData" :rules="rule" ref="httpForm" label-width="80px" label-position="right" :disabled="true">
<!-- 操作按钮 -->
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!newShowFollow">
<i class="el-icon-star-off"
style="color: #783987; font-size: 25px; margin-right: 5px; position: relative; top: 5px; float: right; cursor: pointer "/>
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="newShowFollow">
<i class="el-icon-star-on"
style="color: #783987; font-size: 28px; margin-right: 5px; position: relative; top: 5px; float: right; cursor: pointer "/>
</el-tooltip>
<br/>
<ms-form-divider :title="$t('test_track.plan_view.base_info')"/>
<!-- 基础信息 -->
@ -375,7 +352,16 @@ export default{
getDiff(){
let oldVnode = this.$refs.old
let vnode = this.$refs.new
diff(oldVnode,vnode);
let oldColor = "";
let newColor = "";
if(this.oldData.createTime>this.newData.createTime){
oldColor = "rgb(121, 225, 153,0.3)";
newColor = "rgb(241,200,196,0.45)"
}else{
oldColor = "rgb(241,200,196,0.45)"
newColor = "rgb(121, 225, 153,0.3)";
}
diff(oldVnode,vnode,oldColor,newColor);
this.isReloadData = false
},
setCount(count) {

View File

@ -2,28 +2,15 @@
<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-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.createTime | 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-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.createTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData">
<el-card style="width: 50%;" ref="old">
<div style="background-color: white;">
<el-row>
<el-col>
<!--操作按钮-->
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!showFollow">
<i class="el-icon-star-off"
style="color: #783987; font-size: 25px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="showFollow">
<i class="el-icon-star-on"
style="color: #783987; font-size: 28px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
</el-col>
</el-row>
<!-- 基础信息 -->
<p class="tip">{{ $t('test_track.plan_view.base_info') }} </p>
<br/>
@ -61,19 +48,6 @@
</el-card>
<el-card style="width: 50%;" ref="new">
<div style="background-color: white;">
<el-row>
<el-col>
<!--操作按钮-->
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!newShowFollow">
<i class="el-icon-star-off"
style="color: #783987; font-size: 25px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="newShowFollow">
<i class="el-icon-star-on"
style="color: #783987; font-size: 28px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
</el-col>
</el-row>
<!-- 基础信息 -->
<p class="tip">{{ $t('test_track.plan_view.base_info') }} </p>
<br/>
@ -182,7 +156,16 @@ export default{
getDiff(){
let oldVnode = this.$refs.old
let vnode = this.$refs.new
diff(oldVnode,vnode);
let oldColor = "";
let newColor = "";
if(this.oldData.createTime>this.newData.createTime){
oldColor = "rgb(121, 225, 153,0.3)";
newColor = "rgb(241,200,196,0.45)"
}else{
oldColor = "rgb(241,200,196,0.45)"
newColor = "rgb(121, 225, 153,0.3)";
}
diff(oldVnode,vnode,oldColor,newColor);
this.isReloadData = false
},
setCount(count) {

View File

@ -2,28 +2,15 @@
<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-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.createTime | 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-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.createTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData">
<el-card style="width: 50%;" ref="old">
<div style="background-color: white;">
<el-row>
<el-col>
<!--操作按钮-->
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!showFollow">
<i class="el-icon-star-off"
style="color: #783987; font-size: 25px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="showFollow">
<i class="el-icon-star-on"
style="color: #783987; font-size: 28px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
</el-col>
</el-row>
<!-- 基础信息 -->
<p class="tip">{{ $t('test_track.plan_view.base_info') }} </p>
<br/>
@ -89,19 +76,6 @@
</el-card>
<el-card style="width: 50%;" ref="new">
<div style="background-color: white;">
<el-row>
<el-col>
<!--操作按钮-->
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!newShowFollow">
<i class="el-icon-star-off"
style="color: #783987; font-size: 25px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="newShowFollow">
<i class="el-icon-star-on"
style="color: #783987; font-size: 28px; margin-right: 5px; position: relative; top: 5px; cursor: pointer "/>
</el-tooltip>
</el-col>
</el-row>
<!-- 基础信息 -->
<p class="tip">{{ $t('test_track.plan_view.base_info') }} </p>
<br/>
@ -254,7 +228,16 @@ export default{
getDiff(){
let oldVnode = this.$refs.old
let vnode = this.$refs.new
diff(oldVnode,vnode);
let oldColor = "";
let newColor = "";
if(this.oldData.createTime>this.newData.createTime){
oldColor = "rgb(121, 225, 153,0.3)";
newColor = "rgb(241,200,196,0.45)"
}else{
oldColor = "rgb(241,200,196,0.45)"
newColor = "rgb(121, 225, 153,0.3)";
}
diff(oldVnode,vnode,oldColor,newColor);
this.isReloadData = false
},
setCount(count) {

View File

@ -4,10 +4,10 @@
<div class="caall"></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-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.createTime | 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-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.createTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" id="vdiff" ref="all" >
@ -24,15 +24,6 @@
</el-form-item>
</el-form>
</el-col>
<el-col :span="12">
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!showFollow">
<i class="el-icon-star-off" style="color: #783987; font-size: 25px; margin-right: 15px;cursor: pointer;position: relative; top: 5px; " />
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="showFollow">
<i class="el-icon-star-on" style="color: #783987; font-size: 28px; margin-right: 15px;cursor: pointer;position: relative; top: 5px; "/>
</el-tooltip>
</el-col>
</el-row>
<ms-form-divider :title="$t('load_test.basic_config')"/>
@ -62,15 +53,6 @@
</el-form-item>
</el-form>
</el-col>
<el-col :span="12">
<el-tooltip :content="$t('commons.follow')" placement="bottom" effect="dark" v-if="!newShowFollow">
<i class="el-icon-star-off" style="color: #783987; font-size: 25px; margin-right: 15px;cursor: pointer;position: relative; top: 5px; " />
</el-tooltip>
<el-tooltip :content="$t('commons.cancel')" placement="bottom" effect="dark" v-if="newShowFollow">
<i class="el-icon-star-on" style="color: #783987; font-size: 28px; margin-right: 15px;cursor: pointer;position: relative; top: 5px; "/>
</el-tooltip>
</el-col>
</el-row>
<ms-form-divider :title="$t('load_test.basic_config')"/>
@ -140,7 +122,16 @@ export default{
getDiff(){
let oldVnode = this.$refs.old
let vnode = this.$refs.new
diff(oldVnode,vnode);
let oldColor = "";
let newColor = "";
if(this.oldData.createTime>this.newData.createTime){
oldColor = "rgb(121, 225, 153,0.3)";
newColor = "rgb(241,200,196,0.45)"
}else{
oldColor = "rgb(241,200,196,0.45)"
newColor = "rgb(121, 225, 153,0.3)";
}
diff(oldVnode,vnode,oldColor,newColor);
this.isReloadData = false;
},
clickTab(tab) {

View File

@ -29,7 +29,7 @@ const isTextInputType = makeMap('text,number,password,search,email,tel,url')
* @param oldDom 被比较的节点
* @param newDom 比较的节点
*/
export function diff (oldDom, newDom) {
export function diff (oldDom, newDom,oldColor,newColor) {
let diffNode = {
oldNodeArray:[],
nodeArray:[],
@ -62,13 +62,13 @@ export function diff (oldDom, newDom) {
diffNode.nodeArray.push(newVnode.elm)
}
changeStyle(diffNode);
changeStyle(diffNode,oldColor,newColor);
}
function changeStyle(diffNode){
console.log("查看结果");
function changeStyle(diffNode,oldColor,newColor){
/*console.log("");
console.log(diffNode.oldNodeArray);
console.log(diffNode.nodeArray);
console.log(diffNode.nodeArray);*/
for (let i = 0; i < diffNode.oldNodeArray.length; i++) {
if(diffNode.oldNodeArray[i]==='comment'||diffNode.oldNodeArray[i].nodeName==="#comment"){
continue
@ -76,12 +76,12 @@ function changeStyle(diffNode){
if(diffNode.oldNodeArray[i].className==='cell'){
let rowVnodeElm = findRowVnodeElm(diffNode.oldNodeArray[i]);
if(isDef(rowVnodeElm.style)){
rowVnodeElm.style.setProperty("background-color","rgb(241,200,196,0.45)",'important')
rowVnodeElm.style.setProperty("background-color",oldColor,'important')
}else if(isDef(rowVnodeElm.parentNode.style)&&rowVnodeElm!=='comment'){
rowVnodeElm.parentNode.style.setProperty("background-color","rgb(241,200,196,0.45)",'important')
rowVnodeElm.parentNode.style.setProperty("background-color",oldColor,'important')
}
}else{
changeStyleBySubset(diffNode.oldNodeArray[i],"rgb(241,200,196,0.45)");
changeStyleBySubset(diffNode.oldNodeArray[i],oldColor);
}
}
@ -92,12 +92,12 @@ function changeStyle(diffNode){
if(diffNode.nodeArray[i].className==='cell'){
let rowVnodeElm = findRowVnodeElm(diffNode.nodeArray[i]);
if(isDef(rowVnodeElm.style)){
rowVnodeElm.style.setProperty("background-color","rgb(121, 225, 153,0.3)",'important')
rowVnodeElm.style.setProperty("background-color",newColor,'important')
}else if(isDef(rowVnodeElm.parentNode.style)&&rowVnodeElm!=='comment'){
rowVnodeElm.parentNode.style.setProperty("background-color","rgb(121, 225, 153,0.3)",'important')
rowVnodeElm.parentNode.style.setProperty("background-color",newColor,'important')
}
}else{
changeStyleBySubset(diffNode.nodeArray[i],"rgb(121, 225, 153,0.3)");
changeStyleBySubset(diffNode.nodeArray[i],newColor);
}
}
}

View File

@ -2,10 +2,10 @@
<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-tag>当前{{oldData.versionName }}</el-tag><span style="margin-left: 10px">{{oldData.userName}}</span><span style="margin-left: 10px">{{oldData.createTime | 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-tag>{{ newData.versionName }}</el-tag><span style="margin-left: 10px">{{newData.userName}}</span><span style="margin-left: 10px">{{newData.createTime | timestampFormatDate }}</span>
</el-col>
</el-row>
<div class="compare-class" v-loading="isReloadData">
@ -329,7 +329,16 @@ export default {
getDiff() {
let oldVnode = this.$refs.old
let vnode = this.$refs.new
diff(oldVnode, vnode);
let oldColor = "";
let newColor = "";
if(this.oldData.createTime>this.newData.createTime){
oldColor = "rgb(121, 225, 153,0.3)";
newColor = "rgb(241,200,196,0.45)"
}else{
oldColor = "rgb(241,200,196,0.45)"
newColor = "rgb(121, 225, 153,0.3)";
}
diff(oldVnode,vnode,oldColor,newColor);
this.isReloadData = false
},
alert: alert,