Angular+NgAlain,sf的使用

  1. 自定义sf搜索。经常遇到
    一个问题,在使用sf搜索时,有时候需要固定传某一个值,或者想要自定义搜索的值,如下可以解决一些,(下方例子是搜索时固定传值id=1)

    html: 
    
        
    
    ts:
    
          conditionChange(e){
            console.log(e);
            this.st.reset(Object.assign(e, {id:  1}));
          }
    
  2. 在formgroup里直接在input标签使用 [disabled]=“true” 似乎不能禁用input,最后使用这种方法解决

    ts:

       isDisabled = true
       validateForm: FormGroup;
       constructor(  private fb: FormBuilder) {}
        this.validateForm= this.fb.group({
          userName: [{value:null,disabled:this.isDisabled}, [Validators.required]],
        });
    

    html:

效果图:
在这里插入图片描述

3: 图片

 imgUrl: {
        type: 'string',
        title: '图片',
        description: '建议上传尺寸750*300px,图片须小于5M,否则将上传失败',
        ui: {
          widget: 'upload',
          action: `${environment.adminApi.upload}`,
          resReName: 'entity.url',
          accept: 'image/*',
          listType: 'picture-card',
          change: (args: UploadChangeParam) => {
            console.log(args);
            if (args.type === 'success' && args.fileList.length > 1) {
              args.fileList.splice(0, 1);
            }
            if (args.type === 'error') {
              args.fileList.splice(args.fileList.length - 1, 1);
            }
          }
        },
        // description: '建议上传尺寸224*149px,支持png,jpg,大小不超过5M'
      },

你可能感兴趣的:(Angular+NgAlain)