没有activiti:FormProperty属性
hcjhope opened this issue · comments
hcjhope commented
我尝试自己添加
interface FromPropertyElement {
$type: string;
id: string;
type: string;
$attrs: FromPropertyAttrsElement;
}
interface FromPropertyAttrsElement {
name: string;
}
/**
- 表单属性组配置
*/
export const FormProperties: GroupProperties = {
name: '表单属性',
icon: 'el-icon-document-add',
properties: {
'extensionElements.formProperty': {
component: SubList,
columns: [
{
prop: 'id',
label: '编码',
align: 'center',
},
{
prop: 'type',
label: '类型',
align: 'center',
},
{
prop: 'name',
label: '名称',
align: 'center',
},
],
rules: {
id: [{ required: true, message: '属性名不能为空' }],
type: [{ required: true, message: '属性值不能为空' }],
name: [{ required: true, message: '属性值不能为空' }],
},
getValue: (businessObject: ModdleElement): Array => {
return businessObject?.extensionElements?.values
?.filter((item: FromPropertyElement) => item.$type === 'activiti:FormProperty')
.map((elem: FromPropertyElement) => {
return { id: elem.id, type: elem.type, name: elem?.$attrs?.name };
})
},
setValue(businessObject: ModdleElement, key: string, value: []): void {
const bpmnContext = BpmnStore;
const moddle = bpmnContext.getModeler().get('moddle');
const properties = moddle.create(activiti:FormProperty
, {
values: value.map((attr: { id: string; value: unknown }) => {
return moddle.create(activiti:FormProperty
, { name: attr.name, value: attr.value });
}),
});
bpmnContext.updateExtensionElements('activiti:Properties', properties);
},
},
},
};
getValue 是可以的。
setValue 不知道这么搞
请问有QQ群没。
Yiuman Kam commented
表单属性标签是放在扩展标签下的bpmn:ExtensionElements
,你可以参考现有的扩展属性的属性面板去实现哦
Yiuman Kam commented
实现后如果也可以提个PR哦 @hcjhope ~~ 😁
hcjhope commented
实现不了setValue 。 请大佬实现一下 。 有没有qq群。
Yiuman Kam commented
没有QQ群,如果等我实现估计得等个几天了,最新有点小忙 @hcjhope
Yiuman Kam commented
@hcjhope 表单属性组件已实现,放在了StartEvent处,请自行扩展
Yiuman Kam commented
开始事件及任务均已添加表单属性配置,放在表单信息GroupProperties中