99
99
</div >
100
100
</el-form-item >
101
101
<div >
102
- <HttpHeader v-if =" temp.type === 'HttpHeader'" ref =" HttpHeader" :info =" temp.infos" @sendInfos =" sendInfos" />
103
- <HttpMethod v-if =" temp.type === 'HttpMethod'" ref =" HttpMethod" :info =" temp.infos" @sendInfos =" sendInfos" />
104
- <HttpParameter v-if =" temp.type === 'HttpParameter'" ref =" HttpParameter" :info =" temp.infos" @sendInfos =" sendInfos" />
105
- <HttpTrackHeader v-if =" temp.type === 'HttpTrackHeader'" ref =" HttpTrackHeader" :info =" temp.infos" @sendInfos =" sendInfos" />
106
- <HttpTrackParameter v-if =" temp.type === 'HttpTrackParameter'" ref =" HttpTrackParameter" :info =" temp.infos" @sendInfos =" sendInfos" />
107
- <TraceIp v-if =" temp.type === 'TraceIp'" ref =" TraceIp" :info =" temp.info" @sendInfos =" sendInfos" />
108
- <TrackAttribute v-if =" temp.type === 'TrackAttribute'" ref =" TrackAttribute" :info =" temp.infos" @sendInfos =" sendInfos" />
109
- <FlowRate v-if =" temp.type === 'FlowRate'" ref =" FlowRate" :info =" temp.infos" @sendInfos =" sendInfos" />
102
+ <HttpMethod v-if =" temp.type === 'HttpMethod'" ref =" HttpMethod" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
103
+ <HttpHeader v-if =" temp.type === 'HttpHeader'" ref =" HttpHeader" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
104
+ <HttpParameter v-if =" temp.type === 'HttpParameter'" ref =" HttpParameter" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
105
+ <HttpTrackHeader v-if =" temp.type === 'HttpTrackHeader'" ref =" HttpTrackHeader" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
106
+ <HttpTrackParameter v-if =" temp.type === 'HttpTrackParameter'" ref =" HttpTrackParameter" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
107
+ <TraceIp v-if =" temp.type === 'TraceIp'" ref =" TraceIp" :info =" temp.info" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
108
+ <TrackAttribute v-if =" temp.type === 'TrackAttribute'" ref =" TrackAttribute" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
109
+ <TrackAttributes v-if =" temp.type === 'TrackAttributes'" ref =" TrackAttributes" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
110
+ <FlowRate v-if =" temp.type === 'FlowRate'" ref =" FlowRate" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
111
+ <Attribute v-if =" temp.type === 'Attribute'" ref =" Attribute" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
112
+ <Attributes v-if =" temp.type === 'Attributes'" ref =" Attributes" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
113
+ <FixedValueRandomFlowRate v-if =" temp.type === 'FixedValueRandomFlowRate'" ref =" FixedValueRandomFlowRate" :info =" temp.infos" @sendInfos =" sendInfos" @sendDecisionName =" sendDecisionName" />
110
114
<el-form-item v-if =" temp.type === '自定义名称'" label =" infos" prop =" infos" >
111
115
<el-input v-model =" temp.infos" />
112
116
</el-form-item >
@@ -144,14 +148,18 @@ import Pagination from '@/components/Pagination' // secondary package based on e
144
148
export default {
145
149
name: ' ComplexTable' ,
146
150
components: { Pagination,
147
- HttpHeader : () => import (' ./components/HttpHeader' ),
148
151
HttpMethod : () => import (' ./components/HttpMethod' ),
152
+ HttpHeader : () => import (' ./components/HttpHeader' ),
149
153
HttpParameter : () => import (' ./components/HttpParameter' ),
150
154
HttpTrackHeader : () => import (' ./components/HttpTrackHeader' ),
151
155
HttpTrackParameter : () => import (' ./components/HttpTrackParameter' ),
152
156
TraceIp : () => import (' ./components/TraceIp' ),
153
157
TrackAttribute : () => import (' ./components/TrackAttribute' ),
154
- FlowRate : () => import (' ./components/FlowRate' )
158
+ TrackAttributes : () => import (' ./components/TrackAttributes' ),
159
+ Attribute : () => import (' ./components/Attribute' ),
160
+ Attributes : () => import (' ./components/Attributes' ),
161
+ FlowRate : () => import (' ./components/FlowRate' ),
162
+ FixedValueRandomFlowRate : () => import (' ./components/FixedValueRandomFlowRate' )
155
163
},
156
164
directives: { waves },
157
165
data () {
@@ -178,11 +186,11 @@ export default {
178
186
delFlag: ' UNDELETE'
179
187
},
180
188
options: [{
181
- value: ' HttpHeader' ,
182
- label: ' HttpHeader'
183
- }, {
184
189
value: ' HttpMethod' ,
185
190
label: ' HttpMethod'
191
+ }, {
192
+ value: ' HttpHeader' ,
193
+ label: ' HttpHeader'
186
194
}, {
187
195
value: ' HttpParameter' ,
188
196
label: ' HttpParameter'
@@ -198,15 +206,25 @@ export default {
198
206
}, {
199
207
value: ' TrackAttribute' ,
200
208
label: ' TrackAttribute'
209
+ }, {
210
+ value: ' TrackAttributes' ,
211
+ label: ' TrackAttributes'
212
+ }, {
213
+ value: ' Attribute' ,
214
+ label: ' Attribute'
215
+ }, {
216
+ value: ' Attributes' ,
217
+ label: ' Attributes'
201
218
}, {
202
219
value: ' FlowRate' ,
203
220
label: ' FlowRate'
204
- },
205
- {
221
+ }, {
222
+ value: ' FixedValueRandomFlowRate' ,
223
+ label: ' FixedValueRandomFlowRate'
224
+ }, {
206
225
value: ' 自定义名称' ,
207
226
label: ' 自定义名称'
208
- }
209
- ],
227
+ }],
210
228
sortOptions: [{ label: ' ID Ascending' , key: ' +id' }, { label: ' ID Descending' , key: ' -id' }],
211
229
statusOptions: [' published' , ' draft' , ' deleted' ],
212
230
showReviewer: false ,
@@ -217,6 +235,7 @@ export default {
217
235
timestamp: new Date (),
218
236
title: ' ' ,
219
237
type: ' ' ,
238
+ name: ' ' ,
220
239
status: ' published'
221
240
},
222
241
dialogFormVisible: false ,
@@ -249,6 +268,9 @@ export default {
249
268
sendInfos (val ) {
250
269
this .temp .infos = val
251
270
},
271
+ sendDecisionName (name ) {
272
+ this .temp .name = name
273
+ },
252
274
setPageTitle () {
253
275
const title = ' 灰度决策'
254
276
document .title = ` ${ title} - ${ this .listQuery .policyId } `
@@ -343,38 +365,12 @@ export default {
343
365
}
344
366
})
345
367
},
346
- checkName (str ) {
347
- let flag = false
348
- this .options .forEach (item => {
349
- if (item .value === str) {
350
- flag = true
351
- }
352
- })
353
- return flag
354
- },
355
- handleUpdate (row ) {
356
- this .temp = { ... row } // copy obj
357
- if (this .checkName (this .temp .name )) {
358
- this .$set (this .temp , ' type' , this .temp .name )
359
- this .$nextTick (() => {
360
- this .$refs [this .temp .name ].clear ()
361
- })
362
- } else {
363
- this .$set (this .temp , ' type' , ' 自定义名称' )
364
- }
365
- console .log (this .temp )
366
- this .temp .timestamp = new Date (this .temp .timestamp )
367
- this .dialogStatus = ' update'
368
- this .dialogFormVisible = true
369
- this .$nextTick (() => {
370
- this .$refs [' dataForm' ].clearValidate ()
371
- })
372
- },
373
368
updateData () {
374
369
this .$refs [' dataForm' ].validate ((valid ) => {
375
370
if (valid) {
376
371
if (this .temp .type !== ' 自定义名称' ) {
377
372
if (this .$refs [this .temp .type ].check ()) {
373
+ this .temp .name = this .temp .type
378
374
const tempData = Object .assign ({}, this .temp )
379
375
tempData .timestamp = + new Date (tempData .timestamp ) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
380
376
updateDecision (tempData).then (response => {
@@ -417,6 +413,33 @@ export default {
417
413
}
418
414
})
419
415
},
416
+ checkName (str ) {
417
+ let flag = false
418
+ this .options .forEach (item => {
419
+ if (item .value === str) {
420
+ flag = true
421
+ }
422
+ })
423
+ return flag
424
+ },
425
+ handleUpdate (row ) {
426
+ this .temp = { ... row } // copy obj
427
+ if (this .checkName (this .temp .name )) {
428
+ this .$set (this .temp , ' type' , this .temp .name )
429
+ this .$nextTick (() => {
430
+ this .$refs [this .temp .name ].clear ()
431
+ })
432
+ } else {
433
+ this .$set (this .temp , ' type' , ' 自定义名称' )
434
+ }
435
+ console .log (this .temp )
436
+ this .temp .timestamp = new Date (this .temp .timestamp )
437
+ this .dialogStatus = ' update'
438
+ this .dialogFormVisible = true
439
+ this .$nextTick (() => {
440
+ this .$refs [' dataForm' ].clearValidate ()
441
+ })
442
+ },
420
443
handleDelete (row ) {
421
444
this .$confirm (' Confirm to remove the record?' , ' Warning' , {
422
445
confirmButtonText: ' Confirm' ,
0 commit comments