index.vue
4.43 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!-- 错误码测试页 -->
<template>
<div>
<d2-container>
<div class="header" slot="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" label-width="100px" :search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<!-- <el-button size="small"
@click="handleReset">
重置
</el-button> -->
</div>
</div>
<div class="d2-container-content">
<!-- <p>原有错误码:{{resultMsg.code}}</p> -->
<!-- <d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:hasPage="false"
:before-search-fn="beforeSearchFn">
</d2-table>
<br /><br /><br />
<d2-table ref="recordTable2"
:get-list-api="getListApi2"
:search-form="searchFormSearch"
:table-params="tableParams2"
:hasPage="false"
:before-search-fn="beforeSearchFn">
</d2-table> -->
</div>
</d2-container>
</div>
</template>
<script>
import { deepClone } from '@/common/util'
import { getCode, getNewCode } from '@/api/codeTest.js'
export default {
name: 'CodeTest',
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
searchForm: {
code: ''
},
searchFormSearch: {},
showFormData: [{
label: '错误码',
name: 'code',
type: 'input',
maxlength: '20',
isClear: true
}],
resultMsg: {}
// getListApi: getCode,
// getListApi2: getNewCode,
// tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
// listName: 'list',
// tableOption: false,
// tableColumns: [{
// label: '原有错误码',
// prop: 'merchantName'
// }, {
// label: '原有错误信息',
// prop: 'merchantName'
// }]
// },
// tableParams2: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
// listName: 'list',
// tableOption: false,
// tableColumns: [{
// label: '现有错误码',
// prop: 'merchantName'
// }, {
// label: '现有错误信息',
// prop: 'merchantName'
// }]
// },
}
},
computed: {
},
mounted() {
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleSearch() {
// this.$refs.recordTable.refreshTable()
// this.$refs.recordTable2.refreshTable()
this.getCode()
this.getNewCode()
},
// handleReset() {
// this.searchForm = {
// code: ''
// }
// this.$refs.recordTable.refreshTable()
// this.$refs.recordTable2.refreshTable()
// },
// 原返回
getCode(row) {
getCode({ code: this.searchForm.code }).then(res => {
console.log('res', res)
}).catch(() => { })
},
// 现返回
getNewCode(row) {
getNewCode({ code: this.searchForm.code }).then(res => {
console.log('res', res)
}).catch(() => { })
}
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin: 65px 0;
.reject-input .el-textarea__inner {
height: 79px;
width: 432px;
}
.el-textarea .el-input__count {
right: 90px;
bottom: -10px;
font-size: 12px;
color: #999999;
}
.tips {
color: #999999;
}
}
.footer {
display: flex;
justify-content: flex-end;
}
</style>