VersionCompare.vue
3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<template>
<a-modal
title="Ebom版本比较"
:width="modalWidth"
:visible="visible"
:bodyStyle="bodyStyle"
style="top: 0px;"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<!-- 查询区域 -->
<div class="table-page-search-wrapper" style="margin-top: 10px;margin-left: 20px">
<a-form layout="inline" >
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="选择版本">
<a-select
show-search
placeholder="请选择版本"
option-filter-prop="children"
style="width: 200px" v-model="ver1"
>
<a-select-option v-for="item in versionList" :key="item" :value="item">{{ item }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="选择版本">
<a-select
show-search
placeholder="请选择版本"
option-filter-prop="children"
style="width: 200px" v-model="ver2"
>
<a-select-option v-for="item in versionList" :key="item" :value="item">{{ item }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-button type="primary" icon="search" @click="compare" >比较</a-button>
<a-button type="primary" icon="download" style="margin-left: 30px" @click="compare" >导出差异单</a-button>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<split-pane :min-percent='20' :default-percent='50' split="vertical">
<template slot="paneL">
<compare-a ref="verA" :ver1="ver1"></compare-a>
</template>
<template slot="paneR">
<compare-b ref="verB" :ver2="ver2"></compare-b>
</template>
</split-pane>
</a-modal>
</template>
<script>
import splitPane from 'vue-splitpane'
import CompareA from "./modules/CompareA";
import CompareB from "./modules/CompareB";
import {getVersionList} from "../../api/api";
export default {
name: "VersionCompare",
components:{
splitPane,
CompareA,
CompareB
},
data () {
return {
workno:'',
ver1:'',
ver2:'',
visible: false,
versionList:[],
bodyStyle:{
padding: "0",
height:(window.innerHeight-150)+"px"
},
modalWidth:800,
}
},
created () {
this.modalWidth = window.innerWidth-0;
},
methods: {
compare(){
this.$refs.verA.search1();
this.$refs.verB.search2();
},
show (workno) {
this.workno=workno
this.visible = true;
let params = {
'workno': this.workno
}
getVersionList(params).then((res) => {
if (res.success) {
this.versionList = res.result
}
})
},
handleOk(){
},
handleCancel () {
this.visible = false;
},
}
}
</script>
<style scoped>
</style>