案例效果

富文本域中可以输入文本,并且插入图片

实现思路

  1. 在功能中增加字段,并且表单字段类型配置成数据集合,用来存附件
  2. 根据第一步新加的表单字段,给字段写字段初始化事件
  3. 在功能上增加富文本域相关字段 如图中“项目背景”字段,在表单配置中将字段设置为富文本域类型
  4. 在第三步的基础上给这个“项目背景”字段增加辅助配置项linkFileField,值就是第一步增加的字段

操作步骤

1. 在功能中增加字段,并且表单字段类型配置成数据集合,用来存附件


2. 根据第一步新加的表单字段,给字段写字段初始化事件

3. 在功能上增加富文本域相关字段 如图中“项目背景”字段,在表单配置中将字段设置为富文本域类型

4. 在第三步的基础上给这个“项目背景”字段增加辅助配置项linkFileField,值就是第一步增加的字段

相关代码

  • 数据集合类型初始化事件
    function(field){
      field.columns=[{
          xtype:"rownumberer",
          width : 35,
          text :'No.',
          align : 'center'
      },{
          dataIndex: 'id',
          width: 100,
          text: '文件主键'
      },{
          dataIndex: 'code',
          width: 100,
          text: '编码'
      },{
          dataIndex:"fieldCode",
          width:100,
          text:"字段编码"
      },{
          dataIndex:"type",
          width:100,
          text:"类型"
      },{
          text: '名称',
          width:100,
          dataIndex: 'name'
      },{
          text: '宽度',
          width:100,
          dataIndex: 'width'
      },{
          text: '高度',
          width:100,
          dataIndex: 'height'
      },{
          text: '显示方式',
          width:100,
          dataIndex: 'displayFill',
          field:{
              xtype:'cbbfield',
              configInfo:'JE_IMG_FILL'
          },
          tactics:[{type:'dic',dicCode:'JE_IMG_FILL'}],
          renderer:JE.renderer
      },{
          text: '对齐方式',
          width:100,
          dataIndex: 'align',
          field:{
              xtype:'cbbfield',
              configInfo:'JE_CORE_ALIGN'
          },
          tactics:[{type:'dic',dicCode:'JE_CORE_ALIGN'}],
          renderer:JE.renderer
      }]
    }
最后编辑: 呼丽华  文档更新时间: 2024-07-05 09:35   作者:呼丽华