workflow-editor 0.0.22-up → 0.0.24-up
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/workflow-editor.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.svg-icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}h3[data-v-f49fd5e2]{color:#999;margin:0;padding:0;font-weight:700;font-size:18px}.el-button[data-v-f49fd5e2]{margin:6px 0;min-width:110px;padding:9px 15px}.el-button i[data-v-f49fd5e2]{padding-right:4px}.joint-container{stroke-width:0;fill:#fff;fill-opacity:0}.joint{fill:#00f;stroke-width:1px}.joint-activated{fill:red;stroke-width:1px;fill-opacity:1}.start,.end{stroke-width:0;fill:#fff}.resizer{stroke:#00f;stroke-width:1;fill:#fff}.decision,.human-decision{stroke-width:0;fill:#fff}.control-point[data-v-0ff53a0a]{fill:#fff;cursor:move}.control-line[data-v-0ff53a0a]{stroke-dasharray:2 2}.control-point[data-v-788fb0ae]{fill:#fff;cursor:move}.control-line[data-v-788fb0ae]{stroke-dasharray:2 2}.transition[data-v-275ae600]{stroke-width:2;stroke:#666;fill:none;cursor:pointer}.selected[data-v-275ae600]{stroke:red}.transition-dragger[data-v-275ae600]{stroke:red;stroke-width:1;fill:#fff;cursor:move}.no-events[data-v-275ae600]{pointer-events:none}.virtual-transition{stroke-width:2;stroke:#000;stroke-dasharray:2 2;fill:none}.selection-region{stroke:#00f;stroke-width:1;fill:#fff;fill-opacity:0;opacity:1;cursor:move}.dashed{stroke-dasharray:10 2;pointer-events:none}.group[data-v-98300543]{font-size:14px;width:100%}.item[data-v-98300543]{float:left;list-style-type:none;width:33.33%;margin-bottom:18px}.item-content[data-v-98300543]{height:calc(100vh - 300px);padding-left:20px;overflow:auto}.el-tag+.el-tag[data-v-784515ae]{margin-left:10px}.button-new-tag[data-v-784515ae]{margin-left:10px;height:32px;line-height:30px;padding-top:0;padding-bottom:0}.input-new-tag[data-v-784515ae]{width:150px;margin-left:10px;vertical-align:bottom}select[data-v-784515ae]{width:150px;margin-left:10px;height:32px;line-height:32px}#custTabOne[data-v-35cd2a7f] .el-tabs__content{height:500px}.percent[data-v-69eb4f2a]{margin-left:10px;color:red;font-size:1.2em}#appContainer[data-v-4827f065] .el-checkbox{display:block}#appContainer[data-v-4827f065] .el-transfer-panel{width:400px}#appContainer[data-v-4827f065] .ellipsis{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;width:55%}.searchResult{color:red}.inline-input-custom{width:90%}.el-checkbox[data-v-c019538f]{margin-left:20px}span[data-v-c22bfcb5]{margin:0 10px}.properties-editor[data-v-76873ec4] .el-dialog__body,.properties-editor[data-v-feca75ec] .el-dialog__body{padding-top:0}.percent[data-v-c1c7385b]{margin-left:10px;color:red;font-size:1.2em}.el-checkbox[data-v-5fb29fef]{margin-left:20px}.properties-editor[data-v-af76d417] .el-dialog__body{padding-top:0}.percent[data-v-6aef99ff]{margin-left:10px;color:red;font-size:1.2em}.properties-editor[data-v-adb7c2ff] .el-dialog__body,.properties-editor[data-v-bd66d235] .el-dialog__body{padding-top:0}.tooltip[data-v-ac799913]{position:absolute;background:#fff;min-width:150px;border-radius:4px;border:1px solid #ebeef5;padding:12px;z-index:2000;color:#606266;line-height:1.4;text-align:justify;font-size:14px;box-shadow:0 2px 12px #0000001a;word-break:break-all}li[data-v-ee0cf618]{color:#333}.context-menu[data-v-ee0cf618]{position:fixed;background:#fff;z-index:999;padding:5px;margin:0}.context-menu li[data-v-ee0cf618]{min-width:75px;height:28px;line-height:28px;text-align:left;color:#1a1a1a}.context-menu li[data-v-ee0cf618]:hover{background:#42b983;color:#fff}.context-menu[data-v-ee0cf618]{border:1px solid #eee;box-shadow:0 .5em 1em #0000001a;border-radius:5px}li[data-v-ee0cf618]{list-style-type:none}.button-area[data-v-
|
|
1
|
+
.svg-icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}h3[data-v-f49fd5e2]{color:#999;margin:0;padding:0;font-weight:700;font-size:18px}.el-button[data-v-f49fd5e2]{margin:6px 0;min-width:110px;padding:9px 15px}.el-button i[data-v-f49fd5e2]{padding-right:4px}.joint-container{stroke-width:0;fill:#fff;fill-opacity:0}.joint{fill:#00f;stroke-width:1px}.joint-activated{fill:red;stroke-width:1px;fill-opacity:1}.start,.end{stroke-width:0;fill:#fff}.resizer{stroke:#00f;stroke-width:1;fill:#fff}.decision,.human-decision{stroke-width:0;fill:#fff}.control-point[data-v-0ff53a0a]{fill:#fff;cursor:move}.control-line[data-v-0ff53a0a]{stroke-dasharray:2 2}.control-point[data-v-788fb0ae]{fill:#fff;cursor:move}.control-line[data-v-788fb0ae]{stroke-dasharray:2 2}.transition[data-v-275ae600]{stroke-width:2;stroke:#666;fill:none;cursor:pointer}.selected[data-v-275ae600]{stroke:red}.transition-dragger[data-v-275ae600]{stroke:red;stroke-width:1;fill:#fff;cursor:move}.no-events[data-v-275ae600]{pointer-events:none}.virtual-transition{stroke-width:2;stroke:#000;stroke-dasharray:2 2;fill:none}.selection-region{stroke:#00f;stroke-width:1;fill:#fff;fill-opacity:0;opacity:1;cursor:move}.dashed{stroke-dasharray:10 2;pointer-events:none}.group[data-v-98300543]{font-size:14px;width:100%}.item[data-v-98300543]{float:left;list-style-type:none;width:33.33%;margin-bottom:18px}.item-content[data-v-98300543]{height:calc(100vh - 300px);padding-left:20px;overflow:auto}.el-tag+.el-tag[data-v-784515ae]{margin-left:10px}.button-new-tag[data-v-784515ae]{margin-left:10px;height:32px;line-height:30px;padding-top:0;padding-bottom:0}.input-new-tag[data-v-784515ae]{width:150px;margin-left:10px;vertical-align:bottom}select[data-v-784515ae]{width:150px;margin-left:10px;height:32px;line-height:32px}#custTabOne[data-v-35cd2a7f] .el-tabs__content{height:500px}.percent[data-v-69eb4f2a]{margin-left:10px;color:red;font-size:1.2em}#appContainer[data-v-4827f065] .el-checkbox{display:block}#appContainer[data-v-4827f065] .el-transfer-panel{width:400px}#appContainer[data-v-4827f065] .ellipsis{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;width:55%}.searchResult{color:red}.inline-input-custom{width:90%}.el-checkbox[data-v-c019538f]{margin-left:20px}span[data-v-c22bfcb5]{margin:0 10px}.properties-editor[data-v-76873ec4] .el-dialog__body,.properties-editor[data-v-feca75ec] .el-dialog__body{padding-top:0}.percent[data-v-c1c7385b]{margin-left:10px;color:red;font-size:1.2em}.el-checkbox[data-v-5fb29fef]{margin-left:20px}.properties-editor[data-v-af76d417] .el-dialog__body{padding-top:0}.percent[data-v-6aef99ff]{margin-left:10px;color:red;font-size:1.2em}.properties-editor[data-v-adb7c2ff] .el-dialog__body,.properties-editor[data-v-bd66d235] .el-dialog__body{padding-top:0}.tooltip[data-v-ac799913]{position:absolute;background:#fff;min-width:150px;border-radius:4px;border:1px solid #ebeef5;padding:12px;z-index:2000;color:#606266;line-height:1.4;text-align:justify;font-size:14px;box-shadow:0 2px 12px #0000001a;word-break:break-all}li[data-v-ee0cf618]{color:#333}.context-menu[data-v-ee0cf618]{position:fixed;background:#fff;z-index:999;padding:5px;margin:0}.context-menu li[data-v-ee0cf618]{min-width:75px;height:28px;line-height:28px;text-align:left;color:#1a1a1a}.context-menu li[data-v-ee0cf618]:hover{background:#42b983;color:#fff}.context-menu[data-v-ee0cf618]{border:1px solid #eee;box-shadow:0 .5em 1em #0000001a;border-radius:5px}li[data-v-ee0cf618]{list-style-type:none}.button-area[data-v-71752234]{padding:5px 0 5px 5px;height:50px}.el-row[data-v-71752234]{border:1px solid #f1f1f1;border-radius:5px}.el-col[data-v-71752234]{padding-left:5px}.main[data-v-71752234]{position:relative;display:flex;height:calc(100% - 50px);width:100%}.canvas-container[data-v-71752234]{position:relative;height:calc(100% - 50px);width:100%}.toolbox[data-v-71752234]{width:150px;overflow-y:auto;height:100%;background:#f7f7f7;padding:10px;text-align:center;flex:none}section[data-v-71752234]{overflow:hidden;flex:1 1 auto;height:100%;padding:0}.tabs[data-v-71752234],.tab-pane[data-v-71752234]{height:100%;width:100%}.tabs[data-v-71752234] .el-tabs__content{height:calc(100% - 41px);padding:10px;width:100%}.canvas[data-v-71752234],.xml[data-v-71752234]{overflow:auto;height:100%;width:100%;padding:0;min-height:500px}pre[data-v-71752234]{margin:0;font-size:16px}.component-icon[data-v-71752234]{position:absolute;pointer-events:none}.canvas[data-v-71752234] .draggable{cursor:move}.primaryButton[data-v-71752234]{color:#fff;border-color:#005eba;background-color:#005eba}#_subprocess-content[data-v-2b195c05]{width:100%;height:calc(100vh - 200px)}#svg{background:white;background-image:linear-gradient(rgba(242,242,242,.7) 1px,transparent 0),linear-gradient(90deg,rgba(242,242,242,.7) 1px,transparent 0),linear-gradient(#e5e5e5 1px,transparent 0),linear-gradient(90deg,#e5e5e5 1px,transparent 0);background-size:15px 15px,15px 15px,75px 75px,75px 75px}g{font-size:16px}g text{dominant-baseline:middle}.selected{fill:#fff;stroke:red;stroke-width:2}.task-tache{fill:#fff;stroke:#666;stroke-width:2}.passed-tache .task-tache{fill:green;stroke:green;stroke-width:2}.current-tache .task-tache{fill:red;stroke:red;stroke-width:2}.passed-tache text{fill:#fff}.current-tache text{fill:#fff}.main[data-v-6658e14b]{position:relative;display:flex;height:100%;width:100%}.canvas-container[data-v-6658e14b]{position:relative;height:100%;width:100%}section[data-v-6658e14b]{overflow:hidden;width:100%;height:100%;padding:0}.canvas[data-v-6658e14b]{overflow:auto;height:100%;padding:0;min-height:500px}.canvas[data-v-6658e14b] .draggable{cursor:default}
|
package/lib/workflow-editor.js
CHANGED
|
@@ -22503,7 +22503,7 @@ function _sfc_render$4(e, t, o, i, n, r) {
|
|
|
22503
22503
|
_: 1
|
|
22504
22504
|
}, 8, ["title"]);
|
|
22505
22505
|
}
|
|
22506
|
-
const AdminSaveDialog = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]),
|
|
22506
|
+
const AdminSaveDialog = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]), workflowEditor_vue_vue_type_style_index_0_scoped_71752234_lang = "", _sfc_main$3 = {
|
|
22507
22507
|
name: "WorkflowEditor",
|
|
22508
22508
|
components: {
|
|
22509
22509
|
WorkflowCanvas,
|
|
@@ -22589,7 +22589,7 @@ const AdminSaveDialog = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sf
|
|
|
22589
22589
|
n && n === "ENABLE" && (this.isShowEnable = !1), o.formCode ? window.$store.commit("wfEditor/setIsHandleCreate", "true") : window.$store.commit("wfEditor/setIsHandleCreate", "false");
|
|
22590
22590
|
}
|
|
22591
22591
|
const i = t.xml;
|
|
22592
|
-
this.initProcessByXml(i);
|
|
22592
|
+
this.initProcessByXml(i, o);
|
|
22593
22593
|
});
|
|
22594
22594
|
} else
|
|
22595
22595
|
this.isShowEnable = !1, window.$store.commit("wfEditor/setIsCreateDefinition", "true"), this.process = processTemplate.newProcess(), initializeProcessData(this.process);
|
|
@@ -22613,9 +22613,13 @@ const AdminSaveDialog = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sf
|
|
|
22613
22613
|
y: e.clientY - t.y
|
|
22614
22614
|
};
|
|
22615
22615
|
},
|
|
22616
|
-
initProcessByXml(e) {
|
|
22617
|
-
|
|
22618
|
-
|
|
22616
|
+
initProcessByXml(e, t) {
|
|
22617
|
+
if (!e)
|
|
22618
|
+
this.process = processTemplate.newProcess(), this.process.attr.name = t.name, this.process.attr.code = t.code, this.process.properties.basicProperties.systemCode = t.systemCode, initializeProcessData(this.process);
|
|
22619
|
+
else {
|
|
22620
|
+
const o = { nativeType: !0, attributesKey: "attr", compact: !0, ignoreComment: !0, spaces: 4 }, i = convert.xml2js(e, o);
|
|
22621
|
+
removeTextProperty(i.process), this.process = i.process, this.process && this.process.properties && this.process.properties.basicProperties ? this.setSystemCode(this.process.properties.basicProperties.systemCode) : this.setSystemCode(this.systemCode), this.process && this.process.attr && this.setProcessCode(this.process.attr.code), this.fetchFormFields(), initializeProcessData(this.process), this.count = this.getMaxCount() + 1;
|
|
22622
|
+
}
|
|
22619
22623
|
},
|
|
22620
22624
|
fetchFormFields() {
|
|
22621
22625
|
const e = this.process.properties.basicProperties, t = e.formCode, o = e.formVersion;
|
|
@@ -22994,7 +22998,7 @@ function _sfc_render$3(e, t, o, i, n, r) {
|
|
|
22994
22998
|
}, null, 8, ["onUpdate", "onAdd"])) : createCommentVNode("", !0)
|
|
22995
22999
|
], 544);
|
|
22996
23000
|
}
|
|
22997
|
-
const WorkflowEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-
|
|
23001
|
+
const WorkflowEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-71752234"]]), getters = {
|
|
22998
23002
|
taches: (e) => e.taches,
|
|
22999
23003
|
transitions: (e) => e.transitions,
|
|
23000
23004
|
startJoint: (e) => e.startJoint,
|
|
@@ -40,8 +40,8 @@ Actual: `+_.attribValue);else{var L=_.tag,G=_.tags[_.tags.length-1]||_;L.ns===G.
|
|
|
40
40
|
* @namespace
|
|
41
41
|
* @public
|
|
42
42
|
*/var o=function(i){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,l={},s={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function f(p){return p instanceof a?new a(p.type,f(p.content),p.alias):Array.isArray(p)?p.map(f):p.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(f){return Object.prototype.toString.call(f).slice(8,-1)},objId:function(f){return f.__id||Object.defineProperty(f,"__id",{value:++r}),f.__id},clone:function f(p,y){y=y||{};var N,O;switch(s.util.type(p)){case"Object":if(O=s.util.objId(p),y[O])return y[O];N={},y[O]=N;for(var V in p)p.hasOwnProperty(V)&&(N[V]=f(p[V],y));return N;case"Array":return O=s.util.objId(p),y[O]?y[O]:(N=[],y[O]=N,p.forEach(function(x,k){N[k]=f(x,y)}),N);default:return p}},getLanguage:function(f){for(;f;){var p=n.exec(f.className);if(p)return p[1].toLowerCase();f=f.parentElement}return"none"},setLanguage:function(f,p){f.className=f.className.replace(RegExp(n,"gi"),""),f.classList.add("language-"+p)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(N){var f=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(N.stack)||[])[1];if(f){var p=document.getElementsByTagName("script");for(var y in p)if(p[y].src==f)return p[y]}return null}},isActive:function(f,p,y){for(var N="no-"+p;f;){var O=f.classList;if(O.contains(p))return!0;if(O.contains(N))return!1;f=f.parentElement}return!!y}},languages:{plain:l,plaintext:l,text:l,txt:l,extend:function(f,p){var y=s.util.clone(s.languages[f]);for(var N in p)y[N]=p[N];return y},insertBefore:function(f,p,y,N){N=N||s.languages;var O=N[f],V={};for(var x in O)if(O.hasOwnProperty(x)){if(x==p)for(var k in y)y.hasOwnProperty(k)&&(V[k]=y[k]);y.hasOwnProperty(x)||(V[x]=O[x])}var R=N[f];return N[f]=V,s.languages.DFS(s.languages,function(H,$){$===R&&H!=f&&(this[H]=V)}),V},DFS:function f(p,y,N,O){O=O||{};var V=s.util.objId;for(var x in p)if(p.hasOwnProperty(x)){y.call(p,x,p[x],N||x);var k=p[x],R=s.util.type(k);R==="Object"&&!O[V(k)]?(O[V(k)]=!0,f(k,y,null,O)):R==="Array"&&!O[V(k)]&&(O[V(k)]=!0,f(k,y,x,O))}}},plugins:{},highlightAll:function(f,p){s.highlightAllUnder(document,f,p)},highlightAllUnder:function(f,p,y){var N={callback:y,container:f,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};s.hooks.run("before-highlightall",N),N.elements=Array.prototype.slice.apply(N.container.querySelectorAll(N.selector)),s.hooks.run("before-all-elements-highlight",N);for(var O=0,V;V=N.elements[O++];)s.highlightElement(V,p===!0,N.callback)},highlightElement:function(f,p,y){var N=s.util.getLanguage(f),O=s.languages[N];s.util.setLanguage(f,N);var V=f.parentElement;V&&V.nodeName.toLowerCase()==="pre"&&s.util.setLanguage(V,N);var x=f.textContent,k={element:f,language:N,grammar:O,code:x};function R($){k.highlightedCode=$,s.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,s.hooks.run("after-highlight",k),s.hooks.run("complete",k),y&&y.call(k.element)}if(s.hooks.run("before-sanity-check",k),V=k.element.parentElement,V&&V.nodeName.toLowerCase()==="pre"&&!V.hasAttribute("tabindex")&&V.setAttribute("tabindex","0"),!k.code){s.hooks.run("complete",k),y&&y.call(k.element);return}if(s.hooks.run("before-highlight",k),!k.grammar){R(s.util.encode(k.code));return}if(p&&i.Worker){var H=new Worker(s.filename);H.onmessage=function($){R($.data)},H.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else R(s.highlight(k.code,k.grammar,k.language))},highlight:function(f,p,y){var N={code:f,grammar:p,language:y};if(s.hooks.run("before-tokenize",N),!N.grammar)throw new Error('The language "'+N.language+'" has no grammar.');return N.tokens=s.tokenize(N.code,N.grammar),s.hooks.run("after-tokenize",N),a.stringify(s.util.encode(N.tokens),N.language)},tokenize:function(f,p){var y=p.rest;if(y){for(var N in y)p[N]=y[N];delete p.rest}var O=new u;return m(O,O.head,f),d(f,O,p,O.head,0),w(O)},hooks:{all:{},add:function(f,p){var y=s.hooks.all;y[f]=y[f]||[],y[f].push(p)},run:function(f,p){var y=s.hooks.all[f];if(!(!y||!y.length))for(var N=0,O;O=y[N++];)O(p)}},Token:a};i.Prism=s;function a(f,p,y,N){this.type=f,this.content=p,this.alias=y,this.length=(N||"").length|0}a.stringify=function f(p,y){if(typeof p=="string")return p;if(Array.isArray(p)){var N="";return p.forEach(function(R){N+=f(R,y)}),N}var O={type:p.type,content:f(p.content,y),tag:"span",classes:["token",p.type],attributes:{},language:y},V=p.alias;V&&(Array.isArray(V)?Array.prototype.push.apply(O.classes,V):O.classes.push(V)),s.hooks.run("wrap",O);var x="";for(var k in O.attributes)x+=" "+k+'="'+(O.attributes[k]||"").replace(/"/g,""")+'"';return"<"+O.tag+' class="'+O.classes.join(" ")+'"'+x+">"+O.content+"</"+O.tag+">"};function c(f,p,y,N){f.lastIndex=p;var O=f.exec(y);if(O&&N&&O[1]){var V=O[1].length;O.index+=V,O[0]=O[0].slice(V)}return O}function d(f,p,y,N,O,V){for(var x in y)if(!(!y.hasOwnProperty(x)||!y[x])){var k=y[x];k=Array.isArray(k)?k:[k];for(var R=0;R<k.length;++R){if(V&&V.cause==x+","+R)return;var H=k[R],$=H.inside,j=!!H.lookbehind,te=!!H.greedy,ne=H.alias;if(te&&!H.pattern.global){var ee=H.pattern.toString().match(/[imsuy]*$/)[0];H.pattern=RegExp(H.pattern.source,ee+"g")}for(var U=H.pattern||H,K=N.next,J=O;K!==p.tail&&!(V&&J>=V.reach);J+=K.value.length,K=K.next){var q=K.value;if(p.length>f.length)return;if(!(q instanceof a)){var Q=1,z;if(te){if(z=c(U,J,f,j),!z||z.index>=f.length)break;var le=z.index,se=z.index+z[0].length,Z=J;for(Z+=K.value.length;le>=Z;)K=K.next,Z+=K.value.length;if(Z-=K.value.length,J=Z,K.value instanceof a)continue;for(var oe=K;oe!==p.tail&&(Z<se||typeof oe.value=="string");oe=oe.next)Q++,Z+=oe.value.length;Q--,q=f.slice(J,Z),z.index-=J}else if(z=c(U,0,q,j),!z)continue;var le=z.index,_=z[0],v=q.slice(0,le),F=q.slice(le+_.length),S=J+q.length;V&&S>V.reach&&(V.reach=S);var L=K.prev;v&&(L=m(p,L,v),J+=v.length),b(p,L,Q);var G=new a(x,$?s.tokenize(_,$):_,ne,_);if(K=m(p,L,G),F&&m(p,K,F),Q>1){var T={cause:x+","+R,reach:S};d(f,p,y,K.prev,J,T),V&&T.reach>V.reach&&(V.reach=T.reach)}}}}}}function u(){var f={value:null,prev:null,next:null},p={value:null,prev:f,next:null};f.next=p,this.head=f,this.tail=p,this.length=0}function m(f,p,y){var N=p.next,O={value:y,prev:p,next:N};return p.next=O,N.prev=O,f.length++,O}function b(f,p,y){for(var N=p.next,O=0;O<y&&N!==f.tail;O++)N=N.next;p.next=N,N.prev=p,f.length-=O}function w(f){for(var p=[],y=f.head.next;y!==f.tail;)p.push(y.value),y=y.next;return p}if(!i.document)return i.addEventListener&&(s.disableWorkerMessageHandler||i.addEventListener("message",function(f){var p=JSON.parse(f.data),y=p.language,N=p.code,O=p.immediateClose;i.postMessage(s.highlight(N,s.languages[y],y)),O&&i.close()},!1)),s;var g=s.util.currentScript();g&&(s.filename=g.src,g.hasAttribute("data-manual")&&(s.manual=!0));function E(){s.manual||s.highlightAll()}if(!s.manual){var h=document.readyState;h==="loading"||h==="interactive"&&g&&g.defer?document.addEventListener("DOMContentLoaded",E):window.requestAnimationFrame?window.requestAnimationFrame(E):window.setTimeout(E,16)}return s}(t);e.exports&&(e.exports=o),typeof commonjsGlobal<"u"&&(commonjsGlobal.Prism=o),o.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},o.languages.markup.tag.inside["attr-value"].inside.entity=o.languages.markup.entity,o.languages.markup.doctype.inside["internal-subset"].inside=o.languages.markup,o.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(o.languages.markup.tag,"addInlined",{value:function(n,r){var l={};l["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:o.languages[r]},l.cdata=/^<!\[CDATA\[|\]\]>$/i;var s={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:l}};s["language-"+r]={pattern:/[\s\S]+/,inside:o.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:s},o.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(o.languages.markup.tag,"addAttribute",{value:function(i,n){o.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:o.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),o.languages.html=o.languages.markup,o.languages.mathml=o.languages.markup,o.languages.svg=o.languages.markup,o.languages.xml=o.languages.extend("markup",{}),o.languages.ssml=o.languages.xml,o.languages.atom=o.languages.xml,o.languages.rss=o.languages.xml,function(i){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var r=i.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))}(o),o.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},o.languages.javascript=o.languages.extend("clike",{"class-name":[o.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),o.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,o.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:o.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:o.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:o.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:o.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:o.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),o.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:o.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),o.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),o.languages.markup&&(o.languages.markup.tag.addInlined("script","javascript"),o.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),o.languages.js=o.languages.javascript,function(){if(typeof o>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",n=function(g,E){return"✖ Error "+g+" while fetching file: "+E},r="✖ Error: File does not exist or is empty",l={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},s="data-src-status",a="loading",c="loaded",d="failed",u="pre[data-src]:not(["+s+'="'+c+'"]):not(['+s+'="'+a+'"])';function m(g,E,h){var f=new XMLHttpRequest;f.open("GET",g,!0),f.onreadystatechange=function(){f.readyState==4&&(f.status<400&&f.responseText?E(f.responseText):f.status>=400?h(n(f.status,f.statusText)):h(r))},f.send(null)}function b(g){var E=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(E){var h=Number(E[1]),f=E[2],p=E[3];return f?p?[h,Number(p)]:[h,void 0]:[h,h]}}o.hooks.add("before-highlightall",function(g){g.selector+=", "+u}),o.hooks.add("before-sanity-check",function(g){var E=g.element;if(E.matches(u)){g.code="",E.setAttribute(s,a);var h=E.appendChild(document.createElement("CODE"));h.textContent=i;var f=E.getAttribute("data-src"),p=g.language;if(p==="none"){var y=(/\.(\w+)$/.exec(f)||[,"none"])[1];p=l[y]||y}o.util.setLanguage(h,p),o.util.setLanguage(E,p);var N=o.plugins.autoloader;N&&N.loadLanguages(p),m(f,function(O){E.setAttribute(s,c);var V=b(E.getAttribute("data-range"));if(V){var x=O.split(/\r\n?|\n/g),k=V[0],R=V[1]==null?x.length:V[1];k<0&&(k+=x.length),k=Math.max(0,Math.min(k-1,x.length)),R<0&&(R+=x.length),R=Math.max(0,Math.min(R,x.length)),O=x.slice(k,R).join(`
|
|
43
|
-
`),E.hasAttribute("data-start")||E.setAttribute("data-start",String(k+1))}h.textContent=O,o.highlightElement(h)},function(O){E.setAttribute(s,d),h.textContent=O})}}),o.plugins.fileHighlight={highlight:function(E){for(var h=(E||document).querySelectorAll(u),f=0,p;p=h[f++];)o.highlightElement(p)}};var w=!1;o.fileHighlight=function(){w||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),w=!0),o.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(prism);var prismExports=prism.exports;const Prism=getDefaultExportFromCjs(prismExports),_sfc_main$4={name:"AdminSaveDialog",data(){return{dialogVisible:!0}},methods:{updateWfVersion(){this.$emit("update")},addWfVersion(){this.$emit("add")}}};function _sfc_render$4(e,t,o,i,n,r){const l=vue.resolveComponent("el-button"),s=vue.resolveComponent("el-dialog");return vue.openBlock(),vue.createBlock(s,{"model-value":"",title:e.$t("workflowEditorPublicModel.tipTitle"),center:!0,top:"10vh","append-to-body":"",onOpen:t[1]||(t[1]=a=>e.$emit("open")),onOpend:t[2]||(t[2]=a=>e.$emit("opend")),onClose:t[3]||(t[3]=a=>e.$emit("close")),onClosed:t[4]||(t[4]=a=>e.$emit("closed"))},{footer:vue.withCtx(()=>[vue.createVNode(l,{onClick:r.updateWfVersion},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorMessage.updateVersion")),1)]),_:1},8,["onClick"]),vue.createVNode(l,{type:"primary",onClick:r.addWfVersion},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorMessage.addVersion")),1)]),_:1},8,["onClick"]),vue.createVNode(l,{onClick:t[0]||(t[0]=a=>e.$emit("close"))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.cancel")),1)]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip")),1),vue.createElementVNode("ul",null,[vue.createElementVNode("li",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip1")),1),vue.createElementVNode("li",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip2")),1),vue.createElementVNode("li",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip3")),1),vue.createElementVNode("li",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip4")),1)]),vue.createElementVNode("div",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip5")),1)]),_:1},8,["title"])}const AdminSaveDialog=_export_sfc(_sfc_main$4,[["render",_sfc_render$4]]),
|
|
44
|
-
`+o,o},saveXml(){const e=this.getProcessXml();if(this.code||this.id||this.definitionId)this.saveWf(e,this.baseAPI+"/wf-editor/workflow-definitions/updates").then(()=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.$alert(this.$t("workflowEditorMessage.updateSuccessful"))});else{const t={xml:e,publishVersion:this.systemPublishVersion};this.$http.post(this.baseAPI+"/wf-editor/workflow-definitions",t).then(o=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.definitionId=o.id,this.$alert(this.$t("workflowEditorMessage.savedSuccessfully"))})}},saveWf(e,t,o){return new Promise((i,n)=>{const r=this.packageSaveXmlParam(e);this.$http.post(t,r).then(l=>{this.definitionId=l.id,i()})})},packageSaveXmlParam(e){const t={xml:e,publishVersion:this.systemPublishVersion};return this.definitionId?t.id=this.definitionId:this.id?t.id=this.id:this.code&&(t.code=this.code,t.version=this.version),t},adminSave(){const e=this.getProcessXml();if(this.code||this.id||this.definitionId){const t=this.baseAPI+"/wf-editor/workflow-definitions/states",o={};this.definitionId?o.id=this.definitionId:this.id?o.id=this.id:this.code&&(o.code=this.code,o.version=this.version),this.$http.post(t,o).then(i=>{i==="DRAFT"?this.saveWf(e,this.baseAPI+"/wf-editor/workflow-definitions/updates").then(()=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.$alert(this.$t("workflowEditorMessage.updateSuccessful"))}):this.isAdminSave=!0})}else{const t={xml:e,publishVersion:this.systemPublishVersion};this.$http.post(this.baseAPI+"/wf-editor/workflow-definitions",t).then(o=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.definitionId=o.id,this.$alert(this.$t("workflowEditorMessage.savedSuccessfully"))})}},updateWfVersion(){const e=this.getProcessXml();this.saveWf(e,this.baseAPI+"/wf-editor/workflow-definitions/update-version").then(()=>{window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.isAdminSave=!1,this.$alert(this.$t("workflowEditorMessage.updateVersionSuccessful"))})},addWfVersion(){const e=this.getProcessXml();this.saveWf(e,this.baseAPI+"/wf-editor/workflow-definitions/updates").then(()=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.isAdminSave=!1,this.$alert(this.$t("workflowEditorMessage.addVersionSuccessful"))})},exportProcessFromClient(){const e=new Blob([this.getProcessXml()],{type:"text/xml;charset=utf-8"});FileSaver.saveAs(e,this.process.attr.name+".xml")},exportProcess(){const e=this.getProcessXml();this.$http({method:"post",url:this.baseAPI+"/wf-editor/save-as-xmls",data:{xmlContent:e}}).then(t=>{this.download(t),console.log(this.$t("workflowEditorMessage.exportSucceeded"))})},download(e){if(!e)return;const t=window.URL.createObjectURL(new Blob([e])),o=document.createElement("a");o.style.display="none",o.href=t,o.setAttribute("download","myXml.xml"),document.body.appendChild(o),o.click()},uploadSuccess(e,t,o){const i=e;this.clearCanvas(),this.initProcessByXml(i),this.$refs.upload.clearFiles()},getCurrentPosition(e){if(this.componentToDraw){const t=this.$refs.wfEditor.getBoundingClientRect();this.currentPosition={x:e.clientX-t.x-22,y:e.clientY-t.y-22}}},startDrag(e){this.getCurrentPosition(e)},drag(e){this.getCurrentPosition(e)},endDrag(){this.componentToDraw&&this.setComponentToDraw("")},addTache(e){if(this.componentToDraw){const t=getMousePosition(e),o=processTemplate["new"+this.componentToDraw]();o.attr.id=this.componentToDraw.charAt(0).toLowerCase()+this.componentToDraw.substring(1)+"_"+this.count;const i={id:o.attr.id,name:o.attr.name,x:t.x-this.componentInfo.width/2,y:t.y-this.componentInfo.height/2,width:this.componentInfo.width,height:this.componentInfo.height,type:this.componentToDraw,isSelected:!1};i.ref=o,this.taches.push(i),this.count++}},clearStatus(){this.componentToDraw&&this.setComponentToDraw("")},getMaxCount(){let e=0;return this.taches.map(t=>{let o=t.id.substring(t.id.lastIndexOf("_")+1);o=+o,e<o&&(e=o)}),e},selectProcessFile(){this.$refs.processFile.click()},openXmlFromClient(){if(this.$refs.processFile.value==="")return;const e=this.$refs.processFile.files[0],t=new FileReader;t.readAsText(e);const o=this;t.onload=function(){o.clearCanvas(),o.initProcessByXml(t.result),o.$refs.processFile.value=""}},enableWf(){this.definitionId&&this.$http.put(this.baseAPI+"/wf-editor/workflow-editors/"+this.definitionId+"/states").then(()=>{this.isShowEnable=!1,this.$alert(this.$t("workflowEditorMessage.enabledSuccessfully"))})}}},_hoisted_1$3={key:0,class:"xml line-numbers"};function _sfc_render$3(e,t,o,i,n,r){const l=vue.resolveComponent("el-button"),s=vue.resolveComponent("el-row"),a=vue.resolveComponent("toolbox"),c=vue.resolveComponent("workflow-canvas"),d=vue.resolveComponent("el-tab-pane"),u=vue.resolveComponent("el-tabs"),m=vue.resolveComponent("icon-svg"),b=vue.resolveComponent("context-menu"),w=vue.resolveComponent("admin-save-dialog"),g=vue.resolveDirective("permission");return vue.openBlock(),vue.createElementBlock("div",{ref:"wfEditor",style:{position:"relative",height:"100%"},onMousedown:t[8]||(t[8]=E=>e.setContextMenuVisible(!1)),onMousewheel:t[9]||(t[9]=E=>e.setContextMenuVisible(!1))},[vue.createVNode(s,{class:"button-area"},{default:vue.withCtx(()=>[o.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(l,{key:0,class:"primaryButton",type:"primary",onClick:r.saveXml},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.save")),1)]),_:1},8,["onClick"])),o.readonly?vue.createCommentVNode("",!0):vue.withDirectives((vue.openBlock(),vue.createBlock(l,{key:1,class:"primaryButton",type:"primary",onClick:r.adminSave},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.adminSave")),1)]),_:1},8,["onClick"])),[[g,"wf.workflowDefinition.adminSave"]]),e.isShowEnable?(vue.openBlock(),vue.createBlock(l,{key:2,class:"primaryButton",type:"primary",onClick:r.enableWf},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.enable")),1)]),_:1},8,["onClick"])):vue.createCommentVNode("",!0),vue.createVNode(l,{class:"primaryButton",type:"primary",onClick:r.exportProcessFromClient},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.export")),1)]),_:1},8,["onClick"]),o.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(l,{key:3,type:"primary",class:"primaryButton",onClick:r.selectProcessFile},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.open"))+" ",1),vue.createElementVNode("input",{ref:"processFile",type:"file",name:"processFile",accept:".xml",style:{display:"none"},onChange:t[0]||(t[0]=(...E)=>r.openXmlFromClient&&r.openXmlFromClient(...E))},null,544)]),_:1},8,["onClick"])),vue.createVNode(l,{type:"primary",class:"primaryButton",onClick:t[1]||(t[1]=E=>e.$emit("back"))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.return")),1)]),_:1})]),_:1}),vue.createElementVNode("div",{class:"main",onMousedown:t[3]||(t[3]=(...E)=>r.startDrag&&r.startDrag(...E)),onMousemove:t[4]||(t[4]=(...E)=>r.drag&&r.drag(...E)),onMouseup:t[5]||(t[5]=(...E)=>r.endDrag&&r.endDrag(...E)),onMouseleave:t[6]||(t[6]=(...E)=>r.clearStatus&&r.clearStatus(...E))},[o.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(a,{key:0,class:"toolbox",onselectstart:"return false",oncontextmenu:"return false"})),vue.createElementVNode("section",null,[vue.createVNode(u,{modelValue:e.activeTab,"onUpdate:modelValue":t[2]||(t[2]=E=>e.activeTab=E),type:"border-card",class:"tabs"},{default:vue.withCtx(()=>[vue.createVNode(d,{label:e.$t("workflowEditorPublicModel.flowChart"),name:"canvas",class:"tab-pane"},{default:vue.withCtx(()=>[vue.createVNode(c,{onselectstart:"return false",process:e.process,class:"canvas",onMouseup:r.addTache,onContextmenu:vue.withModifiers(r.showContextMenu,["prevent"])},null,8,["process","onMouseup","onContextmenu"])]),_:1},8,["label"]),vue.createVNode(d,{label:"XML",name:"xml",class:"tab-pane"},{default:vue.withCtx(()=>[e.activeTab==="xml"?(vue.openBlock(),vue.createElementBlock("pre",_hoisted_1$3,[vue.createElementVNode("code",{ref:"xml",class:"language-xml"},vue.toDisplayString(e.xml),513)])):vue.createCommentVNode("",!0)]),_:1})]),_:1},8,["modelValue"])])],32),e.componentToDraw?(vue.openBlock(),vue.createBlock(m,{key:0,style:vue.normalizeStyle({height:r.componentInfo.height,width:r.componentInfo.width,color:r.componentInfo.color,left:e.currentPosition.x+"px",top:e.currentPosition.y+"px"}),icon:r.componentInfo.icon,class:"component-icon"},null,8,["style","icon"])):vue.createCommentVNode("",!0),e.contextMenuVisible?(vue.openBlock(),vue.createBlock(b,{key:1,style:vue.normalizeStyle({position:"absolute",left:e.contextMenuPosition.x+"px",top:e.contextMenuPosition.y+"px"})},null,8,["style"])):vue.createCommentVNode("",!0),e.isAdminSave?(vue.openBlock(),vue.createBlock(w,{key:2,onClose:t[7]||(t[7]=E=>e.isAdminSave=!1),onUpdate:r.updateWfVersion,onAdd:r.addWfVersion},null,8,["onUpdate","onAdd"])):vue.createCommentVNode("",!0)],544)}const WorkflowEditor$1=_export_sfc(_sfc_main$3,[["render",_sfc_render$3],["__scopeId","data-v-066bb934"]]),getters={taches:e=>e.taches,transitions:e=>e.transitions,startJoint:e=>e.startJoint,endJoint:e=>e.endJoint,isMovingTache:e=>e.isMovingTache,mouseDownPosition:e=>e.mouseDownPosition,isDrawingRegion:e=>e.isDrawingRegion,isMovingRegion:e=>e.isMovingRegion,selectedTaches:e=>e.selectedTaches,selectedTransition:e=>e.selectedTransition,resizerToMove:e=>e.resizerToMove,draggerToMove:e=>e.draggerToMove,propertiesEditorFor:e=>e.propertiesEditorFor,componentToDraw:e=>e.componentToDraw,controlPointToMove:e=>e.controlPointToMove,formFields:e=>e.formFields,formCode:e=>e.formCode,formFieldsWithSub:e=>e.formFieldsWithSub,contextMenuVisible:e=>e.contextMenuVisible,systemCode:e=>e.systemCode,processCode:e=>e.processCode,processI18n:e=>e.processI18n,subtableConditionMap:e=>e.subtableConditionMap,propSettingKeyList:e=>e.propSettingKeyList,systemVersion:e=>e.systemVersion,tableCode:e=>e.tableCode,isHandleCreate:e=>e.isHandleCreate,isCreateDefinition:e=>e.isCreateDefinition},wfEditor={namespaced:!0,state:{taches:[],transitions:[],startJoint:null,endJoint:null,isMovingTache:!1,mouseDownPosition:null,isDrawingRegion:!1,isMovingRegion:!1,selectedTaches:[],selectedTransition:null,resizerToMove:null,draggerToMove:null,propertiesEditorFor:"",componentToDraw:"",controlPointToMove:null,formFields:[],formFieldsWithSub:[],contextMenuVisible:!1,formCode:null,systemCode:null,processCode:null,processI18n:null,subtableConditionMap:null,propSettingKeyList:null,tableCode:null,isCreateDefinition:"",isHandleCreate:""},getters,mutations:{setTaches(e,t){e.taches=t},setTransitions(e,t){e.transitions=t},clearCanvas(e){e.taches=[],e.transitions=[]},resetState(e){e.isMovingTache=!1,e.startJoint=null,e.endJoint=null,e.isDrawingRegion=!1,e.isMovingRegion=!1,e.resizerToMove=null,e.draggerToMove=null,e.controlPointToMove=null},stopDrawingLine(e){e.startJoint=null,e.endJoint=null},setStartJoint(e,t){e.startJoint=t},setEndJoint(e,t){e.endJoint=t},setMovingTache(e,t){e.isMovingTache=t},setMouseDownPosition(e,t){e.mouseDownPosition=t},setDrawingRegion(e,t){e.isDrawingRegion=t},setMovingRegion(e,t){e.isMovingRegion=t},setSelectedTaches(e,t){e.selectedTaches=t},setSelectedTransition(e,t){e.selectedTransition=t},setResizerToMove(e,t){e.resizerToMove=t},setDraggerToMove(e,t){e.draggerToMove=t},setPropertiesEditorFor(e,t){console.log("setPropertiesEditorFor======",t,"state===",e),e.propertiesEditorFor=t},setComponentToDraw(e,t){e.componentToDraw=t},setControlPointToMove(e,t){e.controlPointToMove=t},setFormFields(e,t){e.formFields=t},setFormCode(e,t){e.formCode=t},setFormFieldsWithSub(e,t){e.formFieldsWithSub=t},setContextMenuVisible(e,t){e.contextMenuVisible=t},setSystemCode(e,t){e.systemCode=t},setProcessCode(e,t){e.processCode=t},setProcessI18n(e,t){e.processI18n=t},setSubtableConditionMap(e,t){e.subtableConditionMap=t},setPropSettingKeyList(e,t){e.propSettingKeyList=t},setSystemVersion(e,t){e.systemVersion=t},setTableCode(e,t){e.tableCode=t},setTableCode(e,t){e.tableCode=t},setIsCreateDefinition(e,t){e.isCreateDefinition=t},setIsHandleCreate(e,t){e.isHandleCreate=t}}};function i18nOperation(e,t,o,i){let n=e.transactionResult;const r=e.historyType;if(!e.current&&r)if(e.transactionParams){const l=JSON.parse(e.transactionParams);let s=r.toLowerCase();const a=isCommonButtonOperation(r);if(a?s="commonButtonOperation":s==="process_end"&&(s="processEnd"),a||r==="HISTORY_COMPLETE_TRANSFER"){const c=l[2];l.key_2=getI18n$1().t("workflowButton."+c)}if(s==="process_start"&&t&&t!==null)l.key_1=t,n=getI18n$1().t("workflowHistoryList."+s,l);else{const c={};for(const d in l){let u=d+"";(d+"").indexOf("key_")<0&&(u="key_"+u),c[u]=l[d]}if(o&&i)for(const d in l){let u=d+"";(d+"").indexOf("key_")<0&&(u="key_"+u),c[u]=l[d];const m=l[d];if(m.indexOf("${taskNodeId:")>=0){const b=m.substring(m.indexOf(":")+1,m.indexOf("##")),w=m.substring(m.indexOf("##")+2,m.lastIndexOf("}")),g=o[b];g&&g[i]&&g[i]!==""?c[u]=g[i]:c[u]=w}}n=getI18n$1().t("workflowHistoryList."+s,c)}}else n=getI18n$1().t("workflowHistoryList."+r.toLowerCase());return n}function isCommonButtonOperation(e){return e==="HISTORY_SUBMIT"||e==="HISTORY_AGREE"||e==="HISTORY_DISAGREE"||e==="HISTORY_AGREEMENT"||e==="HISTORY_OPPOSE"||e==="HISTORY_KIKEN"||e==="HISTORY_SIGNOFF"||e==="HISTORY_SEND"||e==="HISTORY_DISTRIBUTE"||e==="HISTORY_READED"}const tacheSubprocessHistoryDialog_vue_vue_type_style_index_0_scoped_2b195c05_lang="",_sfc_main$2={name:"TacheSubprocessHistoryDialog",props:{workflowId:{type:Number,default:null}},data(){return{dialogVisible:!0}}},_hoisted_1$2=["src"];function _sfc_render$2(e,t,o,i,n,r){const l=vue.resolveComponent("el-dialog");return vue.openBlock(),vue.createBlock(l,{"model-value":"",title:e.$t("workflowEditorPublicModel.subprocessTitle"),"close-on-click-modal":!1,"append-to-body":"",width:"90%",top:"5vh",onOpen:t[0]||(t[0]=s=>e.$emit("open")),onOpend:t[1]||(t[1]=s=>e.$emit("opend")),onClose:t[2]||(t[2]=s=>e.$emit("close")),onClosed:t[3]||(t[3]=s=>e.$emit("closed"))},{default:vue.withCtx(()=>[vue.createElementVNode("iframe",{id:"_subprocess-content",src:"#/show-sub-wf-history?workflowId="+o.workflowId,name:"_subprocess-content",title:"Subprocess Content",frameborder:"0"},null,8,_hoisted_1$2)]),_:1},8,["title"])}const TacheSubprocessHistoryDialog=_export_sfc(_sfc_main$2,[["render",_sfc_render$2],["__scopeId","data-v-2b195c05"]]),wfHistoryCanvas_vue_vue_type_style_index_0_lang="",_sfc_main$1={name:"WfHistoryCanvas",components:{Start,End,HumanTask,Decision,Subprocess,CustomTask,Fork,Join,HumanDecision,CopyTask,Transition,TacheHistoryTooltip,TacheSubprocessHistoryDialog,AutoTask},props:{process:{type:Object,default:null},histories:{type:Array,default:null},currentTasks:{type:Array,default:null},allProcessI18n:{type:Object,default:null}},data:function(){return{showHistory:!1,tooltipPosition:null,tacheHistoryInfo:null,showSubprocessDialog:!1,subWorkflowId:null}},computed:{...mapGetters("wfEditor",["taches","transitions","processI18n"])},mounted:function(){},methods:{getTacheClass(e){if(this.getCurrentTache(e))return"current-tache";{const t=this.getPassedTache(e);return t&&t.current?"current-tache":t?"passed-tache":""}},getPassedTache(e){let t=null;for(const o of this.histories)if(o.historyType==="PROCESS_START"&&e.ref.attr.id&&e.ref.attr.id==="start"||o.historyType==="PROCESS_END"&&e.ref.attr.id&&e.ref.attr.id==="end"||e.ref.attr.name&&o.taskName&&o.taskName===e.ref.attr.name){t=o;break}return t},getPassedTacheHistories(e){const t=[];for(const o of this.histories)(o.historyType==="PROCESS_START"&&e.ref.attr.id&&e.ref.attr.id==="start"||o.historyType==="PROCESS_END"&&e.ref.attr.id&&e.ref.attr.id==="end"||e.ref.attr.name&&o.taskName&&o.taskName===e.ref.attr.name)&&t.push(this.i18nOperation(o));return t},i18nOperation(e){let t,o;const i=getLanguageWithLocale(),n=e.bundleCode;return n&&n!==""&&this.processI18n&&(t=this.processI18n[n]),t&&t.processName&&(o=t.processName[i]),i18nOperation(e,o,t,i)},getCurrentTache(e){let t=null;for(const o of this.currentTasks)if(o.taskName===e.ref.attr.name){t=o;break}return t},getTacheHistory(e){let t=null,o;const i=this.getPassedTacheHistories(e);i&&i.length>0&&(o=i.join("</br>"));const n=this.getCurrentTache(e);return n?(t=this.$t("workflowEditorMessage.currentHandlingPersonnel")+": "+n.transactionResult,o&&(t+="</br>"+o)):t=o,t},forbidSelection(){return!1},mousedown(e){console.log("mousedown")},mousemove(e){},mouseup(e){},mouseleave(e){},endDrag(e){},showTacheHistoryTooltip(e,t){this.tacheHistoryInfo=this.getTacheHistory(e),this.showHistory=!0},hideTacheHistoryTooltip(){this.showHistory=!1},updateTacheHistoryTooltipPosition(e){const t=getMousePosition(e);this.tooltipPosition={left:t.x+5+"px",top:t.y+5+"px"}},showSubprocessHistory(e){const t=this.getPassedTache(e);t&&t.hasChildren!==void 0&&t.hasChildren===!0&&(t.children&&t.children.length>0&&(this.subWorkflowId=t.children[0].workflowId),this.showSubprocessDialog=!0)},closeSubprocessHistory(){this.showSubprocessDialog=!1}}},_hoisted_1$1={ref:"svgContainer",style:{position:"relative"}},_hoisted_2$1=vue.createElementVNode("defs",null,[vue.createElementVNode("marker",{id:"arrow",markerWidth:"10",markerHeight:"10",refX:"6",refY:"2",orient:"auto",markerUnits:"strokeWidth"},[vue.createElementVNode("path",{d:"M0,0 L0,4 L6,2 z",fill:"#666"})])],-1);function _sfc_render$1(e,t,o,i,n,r){const l=vue.resolveComponent("tache-history-tooltip"),s=vue.resolveComponent("tache-subprocess-history-dialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[(vue.openBlock(),vue.createElementBlock("svg",{id:"svg",width:"2000",height:"2000",onMousedown:t[0]||(t[0]=(...a)=>r.mousedown&&r.mousedown(...a)),onMousemove:t[1]||(t[1]=(...a)=>r.mousemove&&r.mousemove(...a)),onMouseup:t[2]||(t[2]=(...a)=>r.mouseup&&r.mouseup(...a)),onMouseleave:t[3]||(t[3]=(...a)=>r.mouseleave&&r.mouseleave(...a))},[_hoisted_2$1,(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(e.taches,a=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(a.type),{key:a.id,model:a,class:vue.normalizeClass([r.getTacheClass(a)]),"display-mode":a.displayMode,onMouseenter:c=>r.showTacheHistoryTooltip(a,c),onMouseleave:c=>r.hideTacheHistoryTooltip(a),onMousemove:r.updateTacheHistoryTooltipPosition,onClick:c=>r.showSubprocessHistory(a)},null,40,["model","class","display-mode","onMouseenter","onMouseleave","onMousemove","onClick"]))),128)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(e.transitions,a=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent("transition"),{key:a.id,model:a},null,8,["model"]))),128))],32)),e.showHistory&&e.tacheHistoryInfo?(vue.openBlock(),vue.createBlock(l,{key:0,style:vue.normalizeStyle(e.tooltipPosition),content:e.tacheHistoryInfo},null,8,["style","content"])):vue.createCommentVNode("",!0),e.showSubprocessDialog?(vue.openBlock(),vue.createBlock(s,{key:1,"workflow-id":e.subWorkflowId,onClose:r.closeSubprocessHistory},null,8,["workflow-id","onClose"])):vue.createCommentVNode("",!0)],512)}const WfHistoryCanvas=_export_sfc(_sfc_main$1,[["render",_sfc_render$1]]),apis={refresh(){this.showHistory()}},workflowHistory_vue_vue_type_style_index_0_scoped_6658e14b_lang="",_sfc_main={name:"WorkflowHistory",components:{WfHistoryCanvas},props:{id:{type:Number,default:null}},data:function(){return{process:null,histories:[],currentTasks:[],allProcessI18n:null}},computed:{...mapGetters("wfEditor",["componentToDraw","taches","transitions","contextMenuVisible"]),...mapGetters(["sidebar"])},watch:{},created:function(){this.showHistory()},mounted:function(){},methods:{...apis,...mapMutations("wfEditor",["setComponentToDraw","clearCanvas","setContextMenuVisible","setProcessI18n"]),showHistory(){this.clearCanvas(),this.id?this.$http.get(this.baseAPI+"/wf-editor/i18n-settings/get-bundle-info?workflowId="+this.id).then(e=>{this.allProcessI18n=e;const t=this.baseAPI+"/wf-editor/instance-histories/"+this.id;this.$http.get(t).then(o=>{this.initProcessByXml(o.xml);let i;o.histories&&o.histories.length>0&&(i=o.histories[0].bundleCode),!i&&o.currentTasks&&o.currentTasks.length>0&&(i=o.currentTasks[0].bundleCode),i&&this.setProcessI18n(e[i]),this.histories=o.histories,this.currentTasks=o.currentTasks})}):(this.process=processTemplate.newProcess(),initializeProcessData(this.process))},showContextMenu(e){},initProcessByXml(e){const t={nativeType:!0,attributesKey:"attr",compact:!0,ignoreComment:!0,spaces:4},o=convert.xml2js(e,t);removeTextProperty(o.process),this.process=o.process,initializeProcessData(this.process)}}},_hoisted_1={ref:"wfEditor",style:{position:"relative",height:"100%"}},_hoisted_2={class:"main"};function _sfc_render(e,t,o,i,n,r){const l=vue.resolveComponent("wf-history-canvas");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",_hoisted_2,[vue.createElementVNode("section",null,[vue.createVNode(l,{onselectstart:"return false",process:e.process,histories:e.histories,"current-tasks":e.currentTasks,"all-process-i18n":e.allProcessI18n,"show-history":!0,class:"canvas",onContextmenu:vue.withModifiers(r.showContextMenu,["prevent"])},null,8,["process","histories","current-tasks","all-process-i18n","onContextmenu"])])])],512)}const WorkflowHistory$1=_export_sfc(_sfc_main,[["render",_sfc_render],["__scopeId","data-v-6658e14b"]]);WorkflowEditor$1.install=function(e){e.component(WorkflowEditor$1.name,WorkflowEditor$1),e.component(WorkflowHistory$1.name,WorkflowHistory$1)};const workflow={WorkflowEditor:WorkflowEditor$1,WorkflowHistory:WorkflowHistory$1,wfEditorStore:wfEditor};function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(e)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},_setPrototypeOf(e,t)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(e,t,o){return _isNativeReflectConstruct()?_construct=Reflect.construct.bind():_construct=function(n,r,l){var s=[null];s.push.apply(s,r);var a=Function.bind.apply(n,s),c=new a;return l&&_setPrototypeOf(c,l.prototype),c},_construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _wrapNativeSuper(e){var t=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(i){if(i===null||!_isNativeFunction(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(i))return t.get(i);t.set(i,n)}function n(){return _construct(i,arguments,_getPrototypeOf(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(n,i)},_wrapNativeSuper(e)}var formatRegExp=/%[sdj%]/g,warning=function e(){};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(warning=function(t,o){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&o.every(function(i){return typeof i=="string"})&&console.warn(t,o)});function convertFieldsError(e){if(!e||!e.length)return null;var t={};return e.forEach(function(o){var i=o.field;t[i]=t[i]||[],t[i].push(o)}),t}function format(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),i=1;i<t;i++)o[i-1]=arguments[i];var n=0,r=o.length;if(typeof e=="function")return e.apply(null,o);if(typeof e=="string"){var l=e.replace(formatRegExp,function(s){if(s==="%%")return"%";if(n>=r)return s;switch(s){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch{return"[Circular]"}break;default:return s}});return l}return e}function isNativeStringType(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function isEmptyValue(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||isNativeStringType(t)&&typeof e=="string"&&!e)}function asyncParallelArray(e,t,o){var i=[],n=0,r=e.length;function l(s){i.push.apply(i,s||[]),n++,n===r&&o(i)}e.forEach(function(s){t(s,l)})}function asyncSerialArray(e,t,o){var i=0,n=e.length;function r(l){if(l&&l.length){o(l);return}var s=i;i=i+1,s<n?t(e[s],r):o([])}r([])}function flattenObjArr(e){var t=[];return Object.keys(e).forEach(function(o){t.push.apply(t,e[o]||[])}),t}var AsyncValidationError=function(e){_inheritsLoose(t,e);function t(o,i){var n;return n=e.call(this,"Async Validation Error")||this,n.errors=o,n.fields=i,n}return t}(_wrapNativeSuper(Error));function asyncMap(e,t,o,i,n){if(t.first){var r=new Promise(function(m,b){var w=function(h){return i(h),h.length?b(new AsyncValidationError(h,convertFieldsError(h))):m(n)},g=flattenObjArr(e);asyncSerialArray(g,o,w)});return r.catch(function(m){return m}),r}var l=t.firstFields===!0?Object.keys(e):t.firstFields||[],s=Object.keys(e),a=s.length,c=0,d=[],u=new Promise(function(m,b){var w=function(E){if(d.push.apply(d,E),c++,c===a)return i(d),d.length?b(new AsyncValidationError(d,convertFieldsError(d))):m(n)};s.length||(i(d),m(n)),s.forEach(function(g){var E=e[g];l.indexOf(g)!==-1?asyncSerialArray(E,o,w):asyncParallelArray(E,o,w)})});return u.catch(function(m){return m}),u}function isErrorObj(e){return!!(e&&e.message!==void 0)}function getValue(e,t){for(var o=e,i=0;i<t.length;i++){if(o==null)return o;o=o[t[i]]}return o}function complementError(e,t){return function(o){var i;return e.fullFields?i=getValue(t,e.fullFields):i=t[o.field||e.fullField],isErrorObj(o)?(o.field=o.field||e.fullField,o.fieldValue=i,o):{message:typeof o=="function"?o():o,fieldValue:i,field:o.field||e.fullField}}}function deepMerge(e,t){if(t){for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];typeof i=="object"&&typeof e[o]=="object"?e[o]=_extends({},e[o],i):e[o]=i}}return e}var required$1=function e(t,o,i,n,r,l){t.required&&(!i.hasOwnProperty(t.field)||isEmptyValue(o,l||t.type))&&n.push(format(r.messages.required,t.fullField))},whitespace=function e(t,o,i,n,r){(/^\s+$/.test(o)||o==="")&&n.push(format(r.messages.whitespace,t.fullField))},urlReg,getUrlRegex=function(){if(urlReg)return urlReg;var e="[a-fA-F\\d:]",t=function(y){return y&&y.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},o="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",n=(`
|
|
43
|
+
`),E.hasAttribute("data-start")||E.setAttribute("data-start",String(k+1))}h.textContent=O,o.highlightElement(h)},function(O){E.setAttribute(s,d),h.textContent=O})}}),o.plugins.fileHighlight={highlight:function(E){for(var h=(E||document).querySelectorAll(u),f=0,p;p=h[f++];)o.highlightElement(p)}};var w=!1;o.fileHighlight=function(){w||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),w=!0),o.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(prism);var prismExports=prism.exports;const Prism=getDefaultExportFromCjs(prismExports),_sfc_main$4={name:"AdminSaveDialog",data(){return{dialogVisible:!0}},methods:{updateWfVersion(){this.$emit("update")},addWfVersion(){this.$emit("add")}}};function _sfc_render$4(e,t,o,i,n,r){const l=vue.resolveComponent("el-button"),s=vue.resolveComponent("el-dialog");return vue.openBlock(),vue.createBlock(s,{"model-value":"",title:e.$t("workflowEditorPublicModel.tipTitle"),center:!0,top:"10vh","append-to-body":"",onOpen:t[1]||(t[1]=a=>e.$emit("open")),onOpend:t[2]||(t[2]=a=>e.$emit("opend")),onClose:t[3]||(t[3]=a=>e.$emit("close")),onClosed:t[4]||(t[4]=a=>e.$emit("closed"))},{footer:vue.withCtx(()=>[vue.createVNode(l,{onClick:r.updateWfVersion},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorMessage.updateVersion")),1)]),_:1},8,["onClick"]),vue.createVNode(l,{type:"primary",onClick:r.addWfVersion},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorMessage.addVersion")),1)]),_:1},8,["onClick"]),vue.createVNode(l,{onClick:t[0]||(t[0]=a=>e.$emit("close"))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.cancel")),1)]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip")),1),vue.createElementVNode("ul",null,[vue.createElementVNode("li",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip1")),1),vue.createElementVNode("li",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip2")),1),vue.createElementVNode("li",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip3")),1),vue.createElementVNode("li",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip4")),1)]),vue.createElementVNode("div",null,vue.toDisplayString(e.$t("workflowEditorMessage.adminSaveTip5")),1)]),_:1},8,["title"])}const AdminSaveDialog=_export_sfc(_sfc_main$4,[["render",_sfc_render$4]]),workflowEditor_vue_vue_type_style_index_0_scoped_71752234_lang="",_sfc_main$3={name:"WorkflowEditor",components:{WorkflowCanvas,Toolbox,IconSvg,ContextMenu,AdminSaveDialog},props:{code:{type:String,default:null},version:{type:Number,default:null},id:{type:Number,default:null},readonly:{type:Boolean,default:!1},systemCode:{type:String,default:null},systemPublishVersion:{type:Number,default:null}},data:function(){return{activeTab:"canvas",count:1,currentPosition:{x:0,y:0},process:null,definitionId:null,xml:"",contextMenuPosition:null,isAdminSave:!1,isShowEnable:!1}},computed:{...mapGetters("wfEditor",["componentToDraw","taches","transitions","contextMenuVisible","systemVersion","tableCode"]),...mapGetters(["sidebar"]),componentInfo(){return getComponentInfo(this.componentToDraw)}},watch:{activeTab(e){e==="xml"&&(this.xml=this.getProcessXml(),this.$nextTick(function(){Prism.highlightElement(this.$refs.xml)}))}},created:function(){if(authApi.setSessionCache("wf_editor_systemVersion",this.systemPublishVersion),this.systemCode&&this.setSystemCode(this.systemCode),this.clearCanvas(),this.id&&(this.definitionId=this.id),console.log("canvas-created=",this.code,this.id),this.code||this.id){window.$store.commit("wfEditor/setIsCreateDefinition","false");let e=this.baseAPI+"/wf-editor/open-xmls/with-definitions";e=this.packageUrlParam(e),this.$http.get(e).then(t=>{const o=t.definition;if(o){this.definitionId=o.id,window.$store.commit("wfEditor/setTableCode",o.tableCode);const n=o.enable;n&&n==="ENABLE"&&(this.isShowEnable=!1),o.formCode?window.$store.commit("wfEditor/setIsHandleCreate","true"):window.$store.commit("wfEditor/setIsHandleCreate","false")}const i=t.xml;this.initProcessByXml(i,o)})}else this.isShowEnable=!1,window.$store.commit("wfEditor/setIsCreateDefinition","true"),this.process=processTemplate.newProcess(),initializeProcessData(this.process)},mounted:function(){},methods:{...mapMutations("wfEditor",["setComponentToDraw","clearCanvas","setContextMenuVisible","setSystemCode","setSystemVersion","setProcessCode"]),showContextMenu(e){console.log(e),this.setContextMenuVisible(!0);const t=this.$refs.wfEditor.getBoundingClientRect();this.contextMenuPosition={x:e.clientX-t.x,y:e.clientY-t.y}},initProcessByXml(e,t){if(!e)this.process=processTemplate.newProcess(),this.process.attr.name=t.name,this.process.attr.code=t.code,this.process.properties.basicProperties.systemCode=t.systemCode,initializeProcessData(this.process);else{const o={nativeType:!0,attributesKey:"attr",compact:!0,ignoreComment:!0,spaces:4},i=convert.xml2js(e,o);removeTextProperty(i.process),this.process=i.process,this.process&&this.process.properties&&this.process.properties.basicProperties?this.setSystemCode(this.process.properties.basicProperties.systemCode):this.setSystemCode(this.systemCode),this.process&&this.process.attr&&this.setProcessCode(this.process.attr.code),this.fetchFormFields(),initializeProcessData(this.process),this.count=this.getMaxCount()+1}},fetchFormFields(){const e=this.process.properties.basicProperties,t=e.formCode,o=e.formVersion;console.log("fetchFormFields---this.tableCode=",this.tableCode),t&&t!==""&&o?processService.fetchFormFields(e.formCode,e.formVersion,null,this.systemPublishVersion):this.tableCode&&processService.fetchFormFields(null,null,this.tableCode,this.systemPublishVersion)},packageUrlParam(e){return this.id?e=e+"?id="+this.id:this.code&&(e=e+"?code="+this.code+"&version="+this.version),e},getProcessXml(){const e={start:[],humanTask:[],decision:[],transition:[],fork:[],join:[],subprocess:[],humanDecision:[],copyTask:[],autoTask:[],end:[]};e.attr=this.process.attr,e.properties=this.process.properties,this.taches.map(i=>{const n=i.type;e[n.charAt(0).toLowerCase()+n.substring(1)].push(i.ref),i.ref.g={x:i.x,y:i.y,width:i.width,height:i.height}}),this.transitions.map(i=>{if(e.transition.push(i.ref),i.ref.g={fromJoint:i.startJoint.position,toJoint:i.endJoint.position,coordinate:"",lineType:i.lineInfo.type},i.lineInfo.type==="CurveLine"&&i.lineInfo.controlPoint)i.ref.g.coordinate=i.lineInfo.controlPoint.x+","+i.lineInfo.controlPoint.y;else if(i.lineInfo.type==="BrokenLine"&&i.lineInfo.controlPoint){let n="";i.lineInfo.controlPoint.forEach(r=>{n+=r.x+","+r.y+";"}),i.ref.g.coordinate=n}});const t={attributesKey:"attr",compact:!0,ignoreComment:!0,spaces:4};let o=convert.json2xml({process:e},t);return o=`<?xml version="1.0" encoding="utf-8"?>
|
|
44
|
+
`+o,o},saveXml(){const e=this.getProcessXml();if(this.code||this.id||this.definitionId)this.saveWf(e,this.baseAPI+"/wf-editor/workflow-definitions/updates").then(()=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.$alert(this.$t("workflowEditorMessage.updateSuccessful"))});else{const t={xml:e,publishVersion:this.systemPublishVersion};this.$http.post(this.baseAPI+"/wf-editor/workflow-definitions",t).then(o=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.definitionId=o.id,this.$alert(this.$t("workflowEditorMessage.savedSuccessfully"))})}},saveWf(e,t,o){return new Promise((i,n)=>{const r=this.packageSaveXmlParam(e);this.$http.post(t,r).then(l=>{this.definitionId=l.id,i()})})},packageSaveXmlParam(e){const t={xml:e,publishVersion:this.systemPublishVersion};return this.definitionId?t.id=this.definitionId:this.id?t.id=this.id:this.code&&(t.code=this.code,t.version=this.version),t},adminSave(){const e=this.getProcessXml();if(this.code||this.id||this.definitionId){const t=this.baseAPI+"/wf-editor/workflow-definitions/states",o={};this.definitionId?o.id=this.definitionId:this.id?o.id=this.id:this.code&&(o.code=this.code,o.version=this.version),this.$http.post(t,o).then(i=>{i==="DRAFT"?this.saveWf(e,this.baseAPI+"/wf-editor/workflow-definitions/updates").then(()=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.$alert(this.$t("workflowEditorMessage.updateSuccessful"))}):this.isAdminSave=!0})}else{const t={xml:e,publishVersion:this.systemPublishVersion};this.$http.post(this.baseAPI+"/wf-editor/workflow-definitions",t).then(o=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.definitionId=o.id,this.$alert(this.$t("workflowEditorMessage.savedSuccessfully"))})}},updateWfVersion(){const e=this.getProcessXml();this.saveWf(e,this.baseAPI+"/wf-editor/workflow-definitions/update-version").then(()=>{window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.isAdminSave=!1,this.$alert(this.$t("workflowEditorMessage.updateVersionSuccessful"))})},addWfVersion(){const e=this.getProcessXml();this.saveWf(e,this.baseAPI+"/wf-editor/workflow-definitions/updates").then(()=>{this.isShowEnable=!0,window.$store.commit("wfEditor/setIsCreateDefinition","false"),this.isAdminSave=!1,this.$alert(this.$t("workflowEditorMessage.addVersionSuccessful"))})},exportProcessFromClient(){const e=new Blob([this.getProcessXml()],{type:"text/xml;charset=utf-8"});FileSaver.saveAs(e,this.process.attr.name+".xml")},exportProcess(){const e=this.getProcessXml();this.$http({method:"post",url:this.baseAPI+"/wf-editor/save-as-xmls",data:{xmlContent:e}}).then(t=>{this.download(t),console.log(this.$t("workflowEditorMessage.exportSucceeded"))})},download(e){if(!e)return;const t=window.URL.createObjectURL(new Blob([e])),o=document.createElement("a");o.style.display="none",o.href=t,o.setAttribute("download","myXml.xml"),document.body.appendChild(o),o.click()},uploadSuccess(e,t,o){const i=e;this.clearCanvas(),this.initProcessByXml(i),this.$refs.upload.clearFiles()},getCurrentPosition(e){if(this.componentToDraw){const t=this.$refs.wfEditor.getBoundingClientRect();this.currentPosition={x:e.clientX-t.x-22,y:e.clientY-t.y-22}}},startDrag(e){this.getCurrentPosition(e)},drag(e){this.getCurrentPosition(e)},endDrag(){this.componentToDraw&&this.setComponentToDraw("")},addTache(e){if(this.componentToDraw){const t=getMousePosition(e),o=processTemplate["new"+this.componentToDraw]();o.attr.id=this.componentToDraw.charAt(0).toLowerCase()+this.componentToDraw.substring(1)+"_"+this.count;const i={id:o.attr.id,name:o.attr.name,x:t.x-this.componentInfo.width/2,y:t.y-this.componentInfo.height/2,width:this.componentInfo.width,height:this.componentInfo.height,type:this.componentToDraw,isSelected:!1};i.ref=o,this.taches.push(i),this.count++}},clearStatus(){this.componentToDraw&&this.setComponentToDraw("")},getMaxCount(){let e=0;return this.taches.map(t=>{let o=t.id.substring(t.id.lastIndexOf("_")+1);o=+o,e<o&&(e=o)}),e},selectProcessFile(){this.$refs.processFile.click()},openXmlFromClient(){if(this.$refs.processFile.value==="")return;const e=this.$refs.processFile.files[0],t=new FileReader;t.readAsText(e);const o=this;t.onload=function(){o.clearCanvas(),o.initProcessByXml(t.result),o.$refs.processFile.value=""}},enableWf(){this.definitionId&&this.$http.put(this.baseAPI+"/wf-editor/workflow-editors/"+this.definitionId+"/states").then(()=>{this.isShowEnable=!1,this.$alert(this.$t("workflowEditorMessage.enabledSuccessfully"))})}}},_hoisted_1$3={key:0,class:"xml line-numbers"};function _sfc_render$3(e,t,o,i,n,r){const l=vue.resolveComponent("el-button"),s=vue.resolveComponent("el-row"),a=vue.resolveComponent("toolbox"),c=vue.resolveComponent("workflow-canvas"),d=vue.resolveComponent("el-tab-pane"),u=vue.resolveComponent("el-tabs"),m=vue.resolveComponent("icon-svg"),b=vue.resolveComponent("context-menu"),w=vue.resolveComponent("admin-save-dialog"),g=vue.resolveDirective("permission");return vue.openBlock(),vue.createElementBlock("div",{ref:"wfEditor",style:{position:"relative",height:"100%"},onMousedown:t[8]||(t[8]=E=>e.setContextMenuVisible(!1)),onMousewheel:t[9]||(t[9]=E=>e.setContextMenuVisible(!1))},[vue.createVNode(s,{class:"button-area"},{default:vue.withCtx(()=>[o.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(l,{key:0,class:"primaryButton",type:"primary",onClick:r.saveXml},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.save")),1)]),_:1},8,["onClick"])),o.readonly?vue.createCommentVNode("",!0):vue.withDirectives((vue.openBlock(),vue.createBlock(l,{key:1,class:"primaryButton",type:"primary",onClick:r.adminSave},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.adminSave")),1)]),_:1},8,["onClick"])),[[g,"wf.workflowDefinition.adminSave"]]),e.isShowEnable?(vue.openBlock(),vue.createBlock(l,{key:2,class:"primaryButton",type:"primary",onClick:r.enableWf},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.enable")),1)]),_:1},8,["onClick"])):vue.createCommentVNode("",!0),vue.createVNode(l,{class:"primaryButton",type:"primary",onClick:r.exportProcessFromClient},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.export")),1)]),_:1},8,["onClick"]),o.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(l,{key:3,type:"primary",class:"primaryButton",onClick:r.selectProcessFile},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.open"))+" ",1),vue.createElementVNode("input",{ref:"processFile",type:"file",name:"processFile",accept:".xml",style:{display:"none"},onChange:t[0]||(t[0]=(...E)=>r.openXmlFromClient&&r.openXmlFromClient(...E))},null,544)]),_:1},8,["onClick"])),vue.createVNode(l,{type:"primary",class:"primaryButton",onClick:t[1]||(t[1]=E=>e.$emit("back"))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.$t("workflowEditorPublicModel.return")),1)]),_:1})]),_:1}),vue.createElementVNode("div",{class:"main",onMousedown:t[3]||(t[3]=(...E)=>r.startDrag&&r.startDrag(...E)),onMousemove:t[4]||(t[4]=(...E)=>r.drag&&r.drag(...E)),onMouseup:t[5]||(t[5]=(...E)=>r.endDrag&&r.endDrag(...E)),onMouseleave:t[6]||(t[6]=(...E)=>r.clearStatus&&r.clearStatus(...E))},[o.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(a,{key:0,class:"toolbox",onselectstart:"return false",oncontextmenu:"return false"})),vue.createElementVNode("section",null,[vue.createVNode(u,{modelValue:e.activeTab,"onUpdate:modelValue":t[2]||(t[2]=E=>e.activeTab=E),type:"border-card",class:"tabs"},{default:vue.withCtx(()=>[vue.createVNode(d,{label:e.$t("workflowEditorPublicModel.flowChart"),name:"canvas",class:"tab-pane"},{default:vue.withCtx(()=>[vue.createVNode(c,{onselectstart:"return false",process:e.process,class:"canvas",onMouseup:r.addTache,onContextmenu:vue.withModifiers(r.showContextMenu,["prevent"])},null,8,["process","onMouseup","onContextmenu"])]),_:1},8,["label"]),vue.createVNode(d,{label:"XML",name:"xml",class:"tab-pane"},{default:vue.withCtx(()=>[e.activeTab==="xml"?(vue.openBlock(),vue.createElementBlock("pre",_hoisted_1$3,[vue.createElementVNode("code",{ref:"xml",class:"language-xml"},vue.toDisplayString(e.xml),513)])):vue.createCommentVNode("",!0)]),_:1})]),_:1},8,["modelValue"])])],32),e.componentToDraw?(vue.openBlock(),vue.createBlock(m,{key:0,style:vue.normalizeStyle({height:r.componentInfo.height,width:r.componentInfo.width,color:r.componentInfo.color,left:e.currentPosition.x+"px",top:e.currentPosition.y+"px"}),icon:r.componentInfo.icon,class:"component-icon"},null,8,["style","icon"])):vue.createCommentVNode("",!0),e.contextMenuVisible?(vue.openBlock(),vue.createBlock(b,{key:1,style:vue.normalizeStyle({position:"absolute",left:e.contextMenuPosition.x+"px",top:e.contextMenuPosition.y+"px"})},null,8,["style"])):vue.createCommentVNode("",!0),e.isAdminSave?(vue.openBlock(),vue.createBlock(w,{key:2,onClose:t[7]||(t[7]=E=>e.isAdminSave=!1),onUpdate:r.updateWfVersion,onAdd:r.addWfVersion},null,8,["onUpdate","onAdd"])):vue.createCommentVNode("",!0)],544)}const WorkflowEditor$1=_export_sfc(_sfc_main$3,[["render",_sfc_render$3],["__scopeId","data-v-71752234"]]),getters={taches:e=>e.taches,transitions:e=>e.transitions,startJoint:e=>e.startJoint,endJoint:e=>e.endJoint,isMovingTache:e=>e.isMovingTache,mouseDownPosition:e=>e.mouseDownPosition,isDrawingRegion:e=>e.isDrawingRegion,isMovingRegion:e=>e.isMovingRegion,selectedTaches:e=>e.selectedTaches,selectedTransition:e=>e.selectedTransition,resizerToMove:e=>e.resizerToMove,draggerToMove:e=>e.draggerToMove,propertiesEditorFor:e=>e.propertiesEditorFor,componentToDraw:e=>e.componentToDraw,controlPointToMove:e=>e.controlPointToMove,formFields:e=>e.formFields,formCode:e=>e.formCode,formFieldsWithSub:e=>e.formFieldsWithSub,contextMenuVisible:e=>e.contextMenuVisible,systemCode:e=>e.systemCode,processCode:e=>e.processCode,processI18n:e=>e.processI18n,subtableConditionMap:e=>e.subtableConditionMap,propSettingKeyList:e=>e.propSettingKeyList,systemVersion:e=>e.systemVersion,tableCode:e=>e.tableCode,isHandleCreate:e=>e.isHandleCreate,isCreateDefinition:e=>e.isCreateDefinition},wfEditor={namespaced:!0,state:{taches:[],transitions:[],startJoint:null,endJoint:null,isMovingTache:!1,mouseDownPosition:null,isDrawingRegion:!1,isMovingRegion:!1,selectedTaches:[],selectedTransition:null,resizerToMove:null,draggerToMove:null,propertiesEditorFor:"",componentToDraw:"",controlPointToMove:null,formFields:[],formFieldsWithSub:[],contextMenuVisible:!1,formCode:null,systemCode:null,processCode:null,processI18n:null,subtableConditionMap:null,propSettingKeyList:null,tableCode:null,isCreateDefinition:"",isHandleCreate:""},getters,mutations:{setTaches(e,t){e.taches=t},setTransitions(e,t){e.transitions=t},clearCanvas(e){e.taches=[],e.transitions=[]},resetState(e){e.isMovingTache=!1,e.startJoint=null,e.endJoint=null,e.isDrawingRegion=!1,e.isMovingRegion=!1,e.resizerToMove=null,e.draggerToMove=null,e.controlPointToMove=null},stopDrawingLine(e){e.startJoint=null,e.endJoint=null},setStartJoint(e,t){e.startJoint=t},setEndJoint(e,t){e.endJoint=t},setMovingTache(e,t){e.isMovingTache=t},setMouseDownPosition(e,t){e.mouseDownPosition=t},setDrawingRegion(e,t){e.isDrawingRegion=t},setMovingRegion(e,t){e.isMovingRegion=t},setSelectedTaches(e,t){e.selectedTaches=t},setSelectedTransition(e,t){e.selectedTransition=t},setResizerToMove(e,t){e.resizerToMove=t},setDraggerToMove(e,t){e.draggerToMove=t},setPropertiesEditorFor(e,t){console.log("setPropertiesEditorFor======",t,"state===",e),e.propertiesEditorFor=t},setComponentToDraw(e,t){e.componentToDraw=t},setControlPointToMove(e,t){e.controlPointToMove=t},setFormFields(e,t){e.formFields=t},setFormCode(e,t){e.formCode=t},setFormFieldsWithSub(e,t){e.formFieldsWithSub=t},setContextMenuVisible(e,t){e.contextMenuVisible=t},setSystemCode(e,t){e.systemCode=t},setProcessCode(e,t){e.processCode=t},setProcessI18n(e,t){e.processI18n=t},setSubtableConditionMap(e,t){e.subtableConditionMap=t},setPropSettingKeyList(e,t){e.propSettingKeyList=t},setSystemVersion(e,t){e.systemVersion=t},setTableCode(e,t){e.tableCode=t},setTableCode(e,t){e.tableCode=t},setIsCreateDefinition(e,t){e.isCreateDefinition=t},setIsHandleCreate(e,t){e.isHandleCreate=t}}};function i18nOperation(e,t,o,i){let n=e.transactionResult;const r=e.historyType;if(!e.current&&r)if(e.transactionParams){const l=JSON.parse(e.transactionParams);let s=r.toLowerCase();const a=isCommonButtonOperation(r);if(a?s="commonButtonOperation":s==="process_end"&&(s="processEnd"),a||r==="HISTORY_COMPLETE_TRANSFER"){const c=l[2];l.key_2=getI18n$1().t("workflowButton."+c)}if(s==="process_start"&&t&&t!==null)l.key_1=t,n=getI18n$1().t("workflowHistoryList."+s,l);else{const c={};for(const d in l){let u=d+"";(d+"").indexOf("key_")<0&&(u="key_"+u),c[u]=l[d]}if(o&&i)for(const d in l){let u=d+"";(d+"").indexOf("key_")<0&&(u="key_"+u),c[u]=l[d];const m=l[d];if(m.indexOf("${taskNodeId:")>=0){const b=m.substring(m.indexOf(":")+1,m.indexOf("##")),w=m.substring(m.indexOf("##")+2,m.lastIndexOf("}")),g=o[b];g&&g[i]&&g[i]!==""?c[u]=g[i]:c[u]=w}}n=getI18n$1().t("workflowHistoryList."+s,c)}}else n=getI18n$1().t("workflowHistoryList."+r.toLowerCase());return n}function isCommonButtonOperation(e){return e==="HISTORY_SUBMIT"||e==="HISTORY_AGREE"||e==="HISTORY_DISAGREE"||e==="HISTORY_AGREEMENT"||e==="HISTORY_OPPOSE"||e==="HISTORY_KIKEN"||e==="HISTORY_SIGNOFF"||e==="HISTORY_SEND"||e==="HISTORY_DISTRIBUTE"||e==="HISTORY_READED"}const tacheSubprocessHistoryDialog_vue_vue_type_style_index_0_scoped_2b195c05_lang="",_sfc_main$2={name:"TacheSubprocessHistoryDialog",props:{workflowId:{type:Number,default:null}},data(){return{dialogVisible:!0}}},_hoisted_1$2=["src"];function _sfc_render$2(e,t,o,i,n,r){const l=vue.resolveComponent("el-dialog");return vue.openBlock(),vue.createBlock(l,{"model-value":"",title:e.$t("workflowEditorPublicModel.subprocessTitle"),"close-on-click-modal":!1,"append-to-body":"",width:"90%",top:"5vh",onOpen:t[0]||(t[0]=s=>e.$emit("open")),onOpend:t[1]||(t[1]=s=>e.$emit("opend")),onClose:t[2]||(t[2]=s=>e.$emit("close")),onClosed:t[3]||(t[3]=s=>e.$emit("closed"))},{default:vue.withCtx(()=>[vue.createElementVNode("iframe",{id:"_subprocess-content",src:"#/show-sub-wf-history?workflowId="+o.workflowId,name:"_subprocess-content",title:"Subprocess Content",frameborder:"0"},null,8,_hoisted_1$2)]),_:1},8,["title"])}const TacheSubprocessHistoryDialog=_export_sfc(_sfc_main$2,[["render",_sfc_render$2],["__scopeId","data-v-2b195c05"]]),wfHistoryCanvas_vue_vue_type_style_index_0_lang="",_sfc_main$1={name:"WfHistoryCanvas",components:{Start,End,HumanTask,Decision,Subprocess,CustomTask,Fork,Join,HumanDecision,CopyTask,Transition,TacheHistoryTooltip,TacheSubprocessHistoryDialog,AutoTask},props:{process:{type:Object,default:null},histories:{type:Array,default:null},currentTasks:{type:Array,default:null},allProcessI18n:{type:Object,default:null}},data:function(){return{showHistory:!1,tooltipPosition:null,tacheHistoryInfo:null,showSubprocessDialog:!1,subWorkflowId:null}},computed:{...mapGetters("wfEditor",["taches","transitions","processI18n"])},mounted:function(){},methods:{getTacheClass(e){if(this.getCurrentTache(e))return"current-tache";{const t=this.getPassedTache(e);return t&&t.current?"current-tache":t?"passed-tache":""}},getPassedTache(e){let t=null;for(const o of this.histories)if(o.historyType==="PROCESS_START"&&e.ref.attr.id&&e.ref.attr.id==="start"||o.historyType==="PROCESS_END"&&e.ref.attr.id&&e.ref.attr.id==="end"||e.ref.attr.name&&o.taskName&&o.taskName===e.ref.attr.name){t=o;break}return t},getPassedTacheHistories(e){const t=[];for(const o of this.histories)(o.historyType==="PROCESS_START"&&e.ref.attr.id&&e.ref.attr.id==="start"||o.historyType==="PROCESS_END"&&e.ref.attr.id&&e.ref.attr.id==="end"||e.ref.attr.name&&o.taskName&&o.taskName===e.ref.attr.name)&&t.push(this.i18nOperation(o));return t},i18nOperation(e){let t,o;const i=getLanguageWithLocale(),n=e.bundleCode;return n&&n!==""&&this.processI18n&&(t=this.processI18n[n]),t&&t.processName&&(o=t.processName[i]),i18nOperation(e,o,t,i)},getCurrentTache(e){let t=null;for(const o of this.currentTasks)if(o.taskName===e.ref.attr.name){t=o;break}return t},getTacheHistory(e){let t=null,o;const i=this.getPassedTacheHistories(e);i&&i.length>0&&(o=i.join("</br>"));const n=this.getCurrentTache(e);return n?(t=this.$t("workflowEditorMessage.currentHandlingPersonnel")+": "+n.transactionResult,o&&(t+="</br>"+o)):t=o,t},forbidSelection(){return!1},mousedown(e){console.log("mousedown")},mousemove(e){},mouseup(e){},mouseleave(e){},endDrag(e){},showTacheHistoryTooltip(e,t){this.tacheHistoryInfo=this.getTacheHistory(e),this.showHistory=!0},hideTacheHistoryTooltip(){this.showHistory=!1},updateTacheHistoryTooltipPosition(e){const t=getMousePosition(e);this.tooltipPosition={left:t.x+5+"px",top:t.y+5+"px"}},showSubprocessHistory(e){const t=this.getPassedTache(e);t&&t.hasChildren!==void 0&&t.hasChildren===!0&&(t.children&&t.children.length>0&&(this.subWorkflowId=t.children[0].workflowId),this.showSubprocessDialog=!0)},closeSubprocessHistory(){this.showSubprocessDialog=!1}}},_hoisted_1$1={ref:"svgContainer",style:{position:"relative"}},_hoisted_2$1=vue.createElementVNode("defs",null,[vue.createElementVNode("marker",{id:"arrow",markerWidth:"10",markerHeight:"10",refX:"6",refY:"2",orient:"auto",markerUnits:"strokeWidth"},[vue.createElementVNode("path",{d:"M0,0 L0,4 L6,2 z",fill:"#666"})])],-1);function _sfc_render$1(e,t,o,i,n,r){const l=vue.resolveComponent("tache-history-tooltip"),s=vue.resolveComponent("tache-subprocess-history-dialog");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[(vue.openBlock(),vue.createElementBlock("svg",{id:"svg",width:"2000",height:"2000",onMousedown:t[0]||(t[0]=(...a)=>r.mousedown&&r.mousedown(...a)),onMousemove:t[1]||(t[1]=(...a)=>r.mousemove&&r.mousemove(...a)),onMouseup:t[2]||(t[2]=(...a)=>r.mouseup&&r.mouseup(...a)),onMouseleave:t[3]||(t[3]=(...a)=>r.mouseleave&&r.mouseleave(...a))},[_hoisted_2$1,(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(e.taches,a=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(a.type),{key:a.id,model:a,class:vue.normalizeClass([r.getTacheClass(a)]),"display-mode":a.displayMode,onMouseenter:c=>r.showTacheHistoryTooltip(a,c),onMouseleave:c=>r.hideTacheHistoryTooltip(a),onMousemove:r.updateTacheHistoryTooltipPosition,onClick:c=>r.showSubprocessHistory(a)},null,40,["model","class","display-mode","onMouseenter","onMouseleave","onMousemove","onClick"]))),128)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(e.transitions,a=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent("transition"),{key:a.id,model:a},null,8,["model"]))),128))],32)),e.showHistory&&e.tacheHistoryInfo?(vue.openBlock(),vue.createBlock(l,{key:0,style:vue.normalizeStyle(e.tooltipPosition),content:e.tacheHistoryInfo},null,8,["style","content"])):vue.createCommentVNode("",!0),e.showSubprocessDialog?(vue.openBlock(),vue.createBlock(s,{key:1,"workflow-id":e.subWorkflowId,onClose:r.closeSubprocessHistory},null,8,["workflow-id","onClose"])):vue.createCommentVNode("",!0)],512)}const WfHistoryCanvas=_export_sfc(_sfc_main$1,[["render",_sfc_render$1]]),apis={refresh(){this.showHistory()}},workflowHistory_vue_vue_type_style_index_0_scoped_6658e14b_lang="",_sfc_main={name:"WorkflowHistory",components:{WfHistoryCanvas},props:{id:{type:Number,default:null}},data:function(){return{process:null,histories:[],currentTasks:[],allProcessI18n:null}},computed:{...mapGetters("wfEditor",["componentToDraw","taches","transitions","contextMenuVisible"]),...mapGetters(["sidebar"])},watch:{},created:function(){this.showHistory()},mounted:function(){},methods:{...apis,...mapMutations("wfEditor",["setComponentToDraw","clearCanvas","setContextMenuVisible","setProcessI18n"]),showHistory(){this.clearCanvas(),this.id?this.$http.get(this.baseAPI+"/wf-editor/i18n-settings/get-bundle-info?workflowId="+this.id).then(e=>{this.allProcessI18n=e;const t=this.baseAPI+"/wf-editor/instance-histories/"+this.id;this.$http.get(t).then(o=>{this.initProcessByXml(o.xml);let i;o.histories&&o.histories.length>0&&(i=o.histories[0].bundleCode),!i&&o.currentTasks&&o.currentTasks.length>0&&(i=o.currentTasks[0].bundleCode),i&&this.setProcessI18n(e[i]),this.histories=o.histories,this.currentTasks=o.currentTasks})}):(this.process=processTemplate.newProcess(),initializeProcessData(this.process))},showContextMenu(e){},initProcessByXml(e){const t={nativeType:!0,attributesKey:"attr",compact:!0,ignoreComment:!0,spaces:4},o=convert.xml2js(e,t);removeTextProperty(o.process),this.process=o.process,initializeProcessData(this.process)}}},_hoisted_1={ref:"wfEditor",style:{position:"relative",height:"100%"}},_hoisted_2={class:"main"};function _sfc_render(e,t,o,i,n,r){const l=vue.resolveComponent("wf-history-canvas");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",_hoisted_2,[vue.createElementVNode("section",null,[vue.createVNode(l,{onselectstart:"return false",process:e.process,histories:e.histories,"current-tasks":e.currentTasks,"all-process-i18n":e.allProcessI18n,"show-history":!0,class:"canvas",onContextmenu:vue.withModifiers(r.showContextMenu,["prevent"])},null,8,["process","histories","current-tasks","all-process-i18n","onContextmenu"])])])],512)}const WorkflowHistory$1=_export_sfc(_sfc_main,[["render",_sfc_render],["__scopeId","data-v-6658e14b"]]);WorkflowEditor$1.install=function(e){e.component(WorkflowEditor$1.name,WorkflowEditor$1),e.component(WorkflowHistory$1.name,WorkflowHistory$1)};const workflow={WorkflowEditor:WorkflowEditor$1,WorkflowHistory:WorkflowHistory$1,wfEditorStore:wfEditor};function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},_getPrototypeOf(e)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},_setPrototypeOf(e,t)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(e,t,o){return _isNativeReflectConstruct()?_construct=Reflect.construct.bind():_construct=function(n,r,l){var s=[null];s.push.apply(s,r);var a=Function.bind.apply(n,s),c=new a;return l&&_setPrototypeOf(c,l.prototype),c},_construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _wrapNativeSuper(e){var t=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(i){if(i===null||!_isNativeFunction(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(i))return t.get(i);t.set(i,n)}function n(){return _construct(i,arguments,_getPrototypeOf(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(n,i)},_wrapNativeSuper(e)}var formatRegExp=/%[sdj%]/g,warning=function e(){};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(warning=function(t,o){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&o.every(function(i){return typeof i=="string"})&&console.warn(t,o)});function convertFieldsError(e){if(!e||!e.length)return null;var t={};return e.forEach(function(o){var i=o.field;t[i]=t[i]||[],t[i].push(o)}),t}function format(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),i=1;i<t;i++)o[i-1]=arguments[i];var n=0,r=o.length;if(typeof e=="function")return e.apply(null,o);if(typeof e=="string"){var l=e.replace(formatRegExp,function(s){if(s==="%%")return"%";if(n>=r)return s;switch(s){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch{return"[Circular]"}break;default:return s}});return l}return e}function isNativeStringType(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function isEmptyValue(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||isNativeStringType(t)&&typeof e=="string"&&!e)}function asyncParallelArray(e,t,o){var i=[],n=0,r=e.length;function l(s){i.push.apply(i,s||[]),n++,n===r&&o(i)}e.forEach(function(s){t(s,l)})}function asyncSerialArray(e,t,o){var i=0,n=e.length;function r(l){if(l&&l.length){o(l);return}var s=i;i=i+1,s<n?t(e[s],r):o([])}r([])}function flattenObjArr(e){var t=[];return Object.keys(e).forEach(function(o){t.push.apply(t,e[o]||[])}),t}var AsyncValidationError=function(e){_inheritsLoose(t,e);function t(o,i){var n;return n=e.call(this,"Async Validation Error")||this,n.errors=o,n.fields=i,n}return t}(_wrapNativeSuper(Error));function asyncMap(e,t,o,i,n){if(t.first){var r=new Promise(function(m,b){var w=function(h){return i(h),h.length?b(new AsyncValidationError(h,convertFieldsError(h))):m(n)},g=flattenObjArr(e);asyncSerialArray(g,o,w)});return r.catch(function(m){return m}),r}var l=t.firstFields===!0?Object.keys(e):t.firstFields||[],s=Object.keys(e),a=s.length,c=0,d=[],u=new Promise(function(m,b){var w=function(E){if(d.push.apply(d,E),c++,c===a)return i(d),d.length?b(new AsyncValidationError(d,convertFieldsError(d))):m(n)};s.length||(i(d),m(n)),s.forEach(function(g){var E=e[g];l.indexOf(g)!==-1?asyncSerialArray(E,o,w):asyncParallelArray(E,o,w)})});return u.catch(function(m){return m}),u}function isErrorObj(e){return!!(e&&e.message!==void 0)}function getValue(e,t){for(var o=e,i=0;i<t.length;i++){if(o==null)return o;o=o[t[i]]}return o}function complementError(e,t){return function(o){var i;return e.fullFields?i=getValue(t,e.fullFields):i=t[o.field||e.fullField],isErrorObj(o)?(o.field=o.field||e.fullField,o.fieldValue=i,o):{message:typeof o=="function"?o():o,fieldValue:i,field:o.field||e.fullField}}}function deepMerge(e,t){if(t){for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];typeof i=="object"&&typeof e[o]=="object"?e[o]=_extends({},e[o],i):e[o]=i}}return e}var required$1=function e(t,o,i,n,r,l){t.required&&(!i.hasOwnProperty(t.field)||isEmptyValue(o,l||t.type))&&n.push(format(r.messages.required,t.fullField))},whitespace=function e(t,o,i,n,r){(/^\s+$/.test(o)||o==="")&&n.push(format(r.messages.whitespace,t.fullField))},urlReg,getUrlRegex=function(){if(urlReg)return urlReg;var e="[a-fA-F\\d:]",t=function(y){return y&&y.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},o="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",n=(`
|
|
45
45
|
(?:
|
|
46
46
|
(?:`+i+":){7}(?:"+i+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
47
47
|
(?:`+i+":){6}(?:"+o+"|:"+i+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
package/package.json
CHANGED
|
@@ -213,7 +213,7 @@ export default {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
const xml = data.xml
|
|
216
|
-
this.initProcessByXml(xml)
|
|
216
|
+
this.initProcessByXml(xml, definition)
|
|
217
217
|
})
|
|
218
218
|
} else {
|
|
219
219
|
this.isShowEnable = false
|
|
@@ -244,24 +244,33 @@ export default {
|
|
|
244
244
|
y: event.clientY - offset.y
|
|
245
245
|
}
|
|
246
246
|
},
|
|
247
|
-
initProcessByXml(xml) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
this.
|
|
247
|
+
initProcessByXml(xml, definition) {
|
|
248
|
+
if(!xml){
|
|
249
|
+
// xml内容为空,则初始化xml
|
|
250
|
+
this.process = processTemplate.newProcess()
|
|
251
|
+
this.process.attr.name = definition.name
|
|
252
|
+
this.process.attr.code = definition.code
|
|
253
|
+
this.process.properties.basicProperties.systemCode = definition.systemCode
|
|
254
|
+
initializeProcessData(this.process)
|
|
254
255
|
} else {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
this.
|
|
256
|
+
const options = { nativeType: true, attributesKey: 'attr', compact: true, ignoreComment: true, spaces: 4 }
|
|
257
|
+
const processObj = convert.xml2js(xml, options)
|
|
258
|
+
removeTextProperty(processObj.process)
|
|
259
|
+
this.process = processObj.process
|
|
260
|
+
if (this.process && this.process.properties && this.process.properties.basicProperties) {
|
|
261
|
+
this.setSystemCode(this.process.properties.basicProperties.systemCode)
|
|
262
|
+
} else {
|
|
263
|
+
// 新增时,将传过来的系统编码缓存起来
|
|
264
|
+
this.setSystemCode(this.systemCode)
|
|
265
|
+
}
|
|
266
|
+
if (this.process && this.process.attr) {
|
|
267
|
+
this.setProcessCode(this.process.attr.code)
|
|
268
|
+
}
|
|
269
|
+
// 得到表单字段放到vuex
|
|
270
|
+
this.fetchFormFields()
|
|
271
|
+
initializeProcessData(this.process)
|
|
272
|
+
this.count = this.getMaxCount() + 1
|
|
260
273
|
}
|
|
261
|
-
// 得到表单字段放到vuex
|
|
262
|
-
this.fetchFormFields()
|
|
263
|
-
initializeProcessData(this.process)
|
|
264
|
-
this.count = this.getMaxCount() + 1
|
|
265
274
|
},
|
|
266
275
|
fetchFormFields() {
|
|
267
276
|
const processProperties = this.process.properties.basicProperties
|