From 066f57e5c550507198aa14730cc4b0e47660ccf7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 3 Jan 2022 09:38:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20bpmnProcessDesigner=20?= =?UTF-8?q?=E7=9A=84=20id=20=E8=B5=8B=E5=80=BC=EF=BC=8C=E5=BF=85=E9=A1=BB?= =?UTF-8?q?=E6=BB=A1=E8=B6=B3=20NCName=20=E8=A7=84=E5=88=99=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=BB=98=E5=88=B6=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package/penal/base/ElementBaseInfo.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/yudao-admin-ui/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue b/yudao-admin-ui/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue index e59738127..761b483b5 100644 --- a/yudao-admin-ui/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue +++ b/yudao-admin-ui/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue @@ -19,7 +19,7 @@ - + @@ -72,6 +72,16 @@ export default { this.elementBaseInfo = JSON.parse(JSON.stringify(this.bpmnElement.businessObject)); }, handleKeyUpdate(value) { + // 校验 value 的值,只有 XML NCName 通过的情况下,才进行赋值。否则,会导致流程图报错,无法绘制的问题 + if (!value) { + return; + } + if (!value.match(/[a-zA-Z_][\-_.0-9_a-zA-Z$]*/)) { + console.log('key 不满足 XML NCName 规则,所以不进行赋值'); + return; + } + console.log('key 满足 XML NCName 规则,所以进行赋值'); + // 在 BPMN 的 XML 中,流程标识 key,其实对应的是 id 节点 this.elementBaseInfo['id'] = value; this.updateBaseInfo('id'); @@ -80,6 +90,11 @@ export default { this.elementBaseInfo['name'] = value; this.updateBaseInfo('name'); }, + handleDescriptionUpdate(value) { + // TODO 芋艿:documentation 暂时无法修改,后续在看看 + // this.elementBaseInfo['documentation'] = value; + // this.updateBaseInfo('documentation'); + }, updateBaseInfo(key) { // 触发 elementBaseInfo 对应的字段 const attrObj = Object.create(null);