6262            <a-col  :span =" 8"   v-for =" (item,key) in advancedValue"   :key =" key"  >
6363              <a-form-item >
6464                <span >{{ local[key] }}</span >
65-                 <a-input-number  v-model =" advancedValue[key]"   v-if =" advancedAttr[key].type === 'integer'"   style =" width  :100%  "   :placeholder =" key"  />
66-                 <a-input-number  v-model =" advancedValue[key]"   v-else-if =" advancedAttr[key].type === 'number'"   style =" width  :100%  "   :placeholder =" key"  />
65+                 <a-input-number  v-model =" advancedValue[key]"   v-if =" advancedAttr[key].type === 'integer' || advancedAttr[key].type === 'number'"   style =" width  :100%  "   :placeholder =" key"  />
6766                <span  v-else-if =" advancedAttr[key].type === 'boolean'"   style =" display  :inline-block ;width  :100%  "  >
6867                  <a-switch  v-model =" advancedValue[key]"  />
6968                </span >
69+                 <a-textarea  @blur =" changeEnumValue"   :value =" advancedValue['enum'] && advancedValue['enum'].length && advancedValue['enum'].join('\n')"   :rows =" 2"   v-else-if =" key === 'enum'"   ></a-textarea >
7070                <a-select  v-else-if =" advancedAttr[key].type === 'array'"   v-model =" advancedValue[key]"   style =" width  :100%  "   :getPopupContainer =" 
7171                triggerNode => { 
7272                  return triggerNode.parentNode || document.body; 
7878                    {{t}}
7979                  </a-select-option >
8080                </a-select >
81-                 
8281                <a-input  v-model =" advancedValue[key]"   v-else  style =" width  :100%  "   :placeholder =" key"  />
8382              </a-form-item >
8483            </a-col >
@@ -128,7 +127,7 @@ export default {
128127    AButton:  Button, 
129128    //  eslint-disable-next-line vue/no-unused-components 
130129    AIcon:  Icon, 
131-     AInput:  Input,AInputNumber: InputNumber, 
130+     AInput:  Input,AInputNumber: InputNumber,ATextarea :   Input . TextArea ,  
132131    ACheckbox:  Checkbox, 
133132    ASelect:  Select, 
134133    ASelectOption: Select .Option , 
@@ -254,10 +253,19 @@ export default {
254253      } 
255254    }, 
256255    onChangeType () { 
256+       this .parseCustomProps () 
257+       //  删除自定义属性 
258+       this .customProps .forEach (item  =>  { 
259+         this .$delete (this .pickValue , item .key ) 
260+       }); 
261+       this .customProps  =  []; 
262+ 
257263      this .$delete (this .pickValue ,' properties'  ) 
258264      this .$delete (this .pickValue ,' items'  ) 
259265      this .$delete (this .pickValue ,' required'  ) 
260266      this .$delete (this .pickValue ,' format'  ) 
267+       this .$delete (this .pickValue ,' enum'  ) 
268+ 
261269      if (this .isArray ){ 
262270        this .$set (this .pickValue ,' items'  ,{type: ' string'  }) 
263271      } 
@@ -268,6 +276,16 @@ export default {
268276    onRootCheck (e ){ 
269277     this ._deepCheck ( e .target .checked ,this .pickValue ) 
270278    }, 
279+     changeEnumValue  (e ) { 
280+       const  pickType  =  this .pickValue .type  
281+       const  value  =  e .target .value  
282+       var  arr =  value .split (' \n '  ) 
283+       if  (arr .length  ===  0  ||  (arr .length  ==  1  &&  ! arr[0 ])) { 
284+         this .$delete (this .advancedValue , ' enum'  ) 
285+       } else  { 
286+         this .advancedValue .enum  =  arr .map (item  =>  pickType ===  ' string'   ?  item :  + item) 
287+       } 
288+     }, 
271289    _deepCheck (checked ,node ){ 
272290      if (node .type  ===  ' object'   &&  node .properties ){ 
273291        checked ?  this .$set (node,' required'  ,Object .keys (node .properties )) :  this .$delete (node,' required'  ) 
@@ -323,7 +341,8 @@ export default {
323341    }, 
324342    onSetting (){ 
325343      this .modalVisible  =  true  
326-       this .advancedValue  =  this .advanced .value  
344+       console .info (' t7'  , this .advanced .value , this .pickValue ) 
345+       this .advancedValue  =  { ... this .advanced .value  } 
327346      for (const  k  in  this .advancedValue ) { 
328347        if (this .pickValue [k]) this .advancedValue [k] =  this .pickValue [k] 
329348      } 
0 commit comments