9999 </div >
100100 </el-form-item >
101101 <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" />
110114 <el-form-item v-if =" temp.type === '自定义名称'" label =" infos" prop =" infos" >
111115 <el-input v-model =" temp.infos" />
112116 </el-form-item >
@@ -144,14 +148,18 @@ import Pagination from '@/components/Pagination' // secondary package based on e
144148export default {
145149 name: ' ComplexTable' ,
146150 components: { Pagination,
147- HttpHeader : () => import (' ./components/HttpHeader' ),
148151 HttpMethod : () => import (' ./components/HttpMethod' ),
152+ HttpHeader : () => import (' ./components/HttpHeader' ),
149153 HttpParameter : () => import (' ./components/HttpParameter' ),
150154 HttpTrackHeader : () => import (' ./components/HttpTrackHeader' ),
151155 HttpTrackParameter : () => import (' ./components/HttpTrackParameter' ),
152156 TraceIp : () => import (' ./components/TraceIp' ),
153157 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' )
155163 },
156164 directives: { waves },
157165 data () {
@@ -178,11 +186,11 @@ export default {
178186 delFlag: ' UNDELETE'
179187 },
180188 options: [{
181- value: ' HttpHeader' ,
182- label: ' HttpHeader'
183- }, {
184189 value: ' HttpMethod' ,
185190 label: ' HttpMethod'
191+ }, {
192+ value: ' HttpHeader' ,
193+ label: ' HttpHeader'
186194 }, {
187195 value: ' HttpParameter' ,
188196 label: ' HttpParameter'
@@ -198,15 +206,25 @@ export default {
198206 }, {
199207 value: ' TrackAttribute' ,
200208 label: ' TrackAttribute'
209+ }, {
210+ value: ' TrackAttributes' ,
211+ label: ' TrackAttributes'
212+ }, {
213+ value: ' Attribute' ,
214+ label: ' Attribute'
215+ }, {
216+ value: ' Attributes' ,
217+ label: ' Attributes'
201218 }, {
202219 value: ' FlowRate' ,
203220 label: ' FlowRate'
204- },
205- {
221+ }, {
222+ value: ' FixedValueRandomFlowRate' ,
223+ label: ' FixedValueRandomFlowRate'
224+ }, {
206225 value: ' 自定义名称' ,
207226 label: ' 自定义名称'
208- }
209- ],
227+ }],
210228 sortOptions: [{ label: ' ID Ascending' , key: ' +id' }, { label: ' ID Descending' , key: ' -id' }],
211229 statusOptions: [' published' , ' draft' , ' deleted' ],
212230 showReviewer: false ,
@@ -217,6 +235,7 @@ export default {
217235 timestamp: new Date (),
218236 title: ' ' ,
219237 type: ' ' ,
238+ name: ' ' ,
220239 status: ' published'
221240 },
222241 dialogFormVisible: false ,
@@ -249,6 +268,9 @@ export default {
249268 sendInfos (val ) {
250269 this .temp .infos = val
251270 },
271+ sendDecisionName (name ) {
272+ this .temp .name = name
273+ },
252274 setPageTitle () {
253275 const title = ' 灰度决策'
254276 document .title = ` ${ title} - ${ this .listQuery .policyId } `
@@ -343,38 +365,12 @@ export default {
343365 }
344366 })
345367 },
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- },
373368 updateData () {
374369 this .$refs [' dataForm' ].validate ((valid ) => {
375370 if (valid) {
376371 if (this .temp .type !== ' 自定义名称' ) {
377372 if (this .$refs [this .temp .type ].check ()) {
373+ this .temp .name = this .temp .type
378374 const tempData = Object .assign ({}, this .temp )
379375 tempData .timestamp = + new Date (tempData .timestamp ) // change Thu Nov 30 2017 16:41:05 GMT+0800 (CST) to 1512031311464
380376 updateDecision (tempData).then (response => {
@@ -417,6 +413,33 @@ export default {
417413 }
418414 })
419415 },
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+ },
420443 handleDelete (row ) {
421444 this .$confirm (' Confirm to remove the record?' , ' Warning' , {
422445 confirmButtonText: ' Confirm' ,
0 commit comments