@zhijiancloud/bpm 0.0.19 → 0.0.21

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],t):"object"==typeof exports?exports.bpm2=t(require("lodash")):e.bpm2=t(e.lodash)}(self,(function(e){return function(){var t={9392:function(e,t,n){"use strict";var r=n(8081),o=n.n(r),i=n(3645),s=n.n(i)()(o());s.push([e.id,".select-from-form-editor {\n .fake-trigger {\n min-height: 40px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n border: 1px solid #d9dce3;\n border-radius: 4px;\n padding: 0 15px;\n cursor: pointer;\n }\n}\n.bpm-select-from-form-box{\n list-style: none;\n padding: 10px 0;\n max-height: calc(70vh - 220px);\n box-sizing: border-box;\n overflow: auto;\n\n .form-item{\n list-style: none;\n margin-bottom: 10px;\n }\n .subitem {\n margin-left: 24px;\n font-size: 12px;\n color: #949494;\n }\n}\n",""]),t.Z=s},432:function(e,t,n){"use strict";var r=n(8081),o=n.n(r),i=n(3645),s=n.n(i),l=n(9392),a=s()(o());a.i(l.Z),a.push([e.id,"\n",""]),t.Z=a},3645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var l=0;l<this.length;l++){var a=this[l][0];null!=a&&(s[a]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&s[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},8081:function(e){"use strict";e.exports=function(e){return e[1]}},3379:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},s=[],l=0;l<e.length;l++){var a=e[l],c=r.base?a[0]+r.base:a[0],u=i[c]||0,d="".concat(c," ").concat(u);i[c]=u+1;var f=n(d),p={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==f)t[f].references++,t[f].updater(p);else{var m=o(p,r);r.byIndex=l,t.splice(l,0,{identifier:d,updater:m,references:1})}s.push(d)}return s}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<i.length;s++){var l=n(i[s]);t[l].references--}for(var a=r(e,o),c=0;c<i.length;c++){var u=n(i[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}i=a}}},569:function(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},9216:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3565:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7795:function(e){"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},4589:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},5460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{attrs:{title:e.label}},[e._v(e._s(e.label))])};r._withStripped=!0;var o=n(467),i=n.n(o),s={props:["value","fieldConf","row","formName","orgInfo"],data(){return{label:""}},watch:{value(){this.loadRemoteLabel()}},mounted(){this.loadRemoteLabel()},methods:{async loadRemoteLabel(){let e=this.value;if(i().isNil(e)||!e)return this.label=zj.z("未选择","c.not_selected");try{if(i().isObject(e))try{e=JSON.parse(e)}catch(e){console.log("error",e)}let t=i().isArray(e)?e:[e],n=i().get(this.fieldConf,"id");i().isEmpty(t)?this.label=zj.z("未选择","c.not_selected"):(t=i().isArray(t)?t:[t],this.label=await this.$bpm.fetchLabelByValues(t,n,this.formName,this.row))}finally{console.log("finally")}}}},l=(0,n(1900).Z)(s,r,[],!1,null,null,null);l.options.__file="components/lib/mixins/RemoteSelectReader.vue";var a=l.exports},1900:function(e,t,n){"use strict";function r(e,t,n,r,o,i,s,l){var a,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(a=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=a):o&&(a=l?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),a)if(c.functional){c._injectStyles=a;var u=c.render;c.render=function(e,t){return a.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,a):[a]}return{exports:e,options:c}}n.d(t,{Z:function(){return r}})},6981:function(e){e.exports=function(){return this.ELEMENT}()},3371:function(e){e.exports=function(){return this.Vue}()},467:function(t){"use strict";t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={id:e,exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var o={};return function(){"use strict";r.r(o),r.d(o,{default:function(){return j}});var e=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-from-form",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,formName:e.formName,orgInfo:e.orgInfo,uiType:e.uiType,isMultiple:e.isMultiple},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};e._withStripped=!0;var t=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-from-form-editor"},[n("div",{on:{click:e.toOpen}},[n("div",{staticClass:"fake-trigger"},[e._v(e._s(e.label))])]),e._v(" "),n("el-dialog",{attrs:{"append-to-body":!0,visible:e.opened,"before-close":e.onHide,title:e.fieldConf.name,width:"40%"},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"只展示前100条数据,通过搜索获取更多"},on:{change:e.debounceSearch},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),e._v(" "),n("div",{staticClass:"bpm-select-from-form-box"},[e.isMultiple?n("el-checkbox-group",{attrs:{max:e.maxCount},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},e._l(e.formList,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.titleStyle},[n("el-checkbox",{key:t.id,attrs:{label:t.id}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.id,staticClass:"subitem",style:e.geFieldStyle(t.key)},[e._v("\n "+e._s(t.value)+"\n ")])}))],2)})),0):n("el-radio-group",{model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},e._l(e.formList,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.titleStyle},[n("el-radio",{key:t.id,attrs:{label:t.id,value:t.id}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.id,staticClass:"subitem",style:e.geFieldStyle(t.key)},[e._v("\n "+e._s(t.key+": "+t.value)+"\n ")])}))],2)})),0)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("确 定")])],1)],1)],1)};t._withStripped=!0;var n=r(3371),i=r.n(n),s=r(467),l=r.n(s),a=r(6981);i().use(a.Dialog);var c={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],inject:["getSelectFields","selectOptions"],data(){return{curVal:"",label:"未选择",keyword:"",opened:!1,debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[]}},watch:{value(e){(l().isString(e)||l().isArray(e))&&(this.curVal=e),this.loadRemoteLabel()}},computed:{placeholder(){return this.fieldConf.desc||this.fieldConf.name},maxCount(){return l().get(this.fieldConf,"check.max_count")},titleStyle(){let e=this.fieldConf,t=l().get(e,"range_remote.range_display.title");return{fontSize:l().get(t,"size",16)+"px",color:l().get(t,"color","#333")}},fieldStyleMap(){let e=this.fieldConf,t=l().get(e,"range_remote.range_display.fields");return l().keyBy(t,"field")}},created(){},mounted(){this.getCurVal(),this.loadRemoteLabel()},methods:{getCurVal(){this.value&&(l().isString(this.value)||l().isArray(this.value))?this.curVal=this.value:this.curVal=this.isMultiple?[]:""},geFieldStyle(e){let t=l().get(this.fieldStyleMap,e);return{fontSize:l().get(t,"size",12)+"px",color:l().get(t,"color","#949494")}},async search(){let e=this.keyword,t=this.formName,n=l().get(this.fieldConf,"id");const r=this.orgInfo;let o=this.getSelectFields();o&&"{}"!==JSON.stringify(o)&&(r.fields=o);let i=await this.$bpm.searchSelectOpts(n,e,t,this,!1,r),s=this.transformOptions(i);this.formList=s},transformOptions(e){return l().map(e,(e=>({title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:l().map(e.f_fields,((e,t)=>({key:t,value:e})))})))},onHide(){this.opened=!1},onOpen(){this.getCurVal();let e=this.selectOptions();e&&e.length?this.formList=this.transformOptions(e):this.search()},toOpen(){this.opened=!0},isChecked(e){return l().includes(this.curVal,e)},onSubmit(){this.$emit("input",this.curVal),this.$emit("change",this.curVal),this.opened=!1},async loadRemoteLabel(){let e=this.value,t=l().get(this.fieldConf,"id");l().isEmpty(e)?this.label="未选择":(e=l().isArray(e)?e:[e],this.label=await this.$bpm.fetchLabelByValues(e,t,this.formName,this.row))}}},u=r(1900),d=(0,u.Z)(c,t,[],!1,null,null,null);d.options.__file="components/lib/bpmSelectFromForm/src/part/editor.vue";var f=d.exports,p={mixins:[r(5460).Z]},m=(0,u.Z)(p,void 0,void 0,!1,null,null,null);m.options.__file="components/lib/bpmSelectFromForm/src/part/reader.vue";var h=m.exports,v={name:"bpmSelectFromForm",components:{editorComponent:f,readerComponent:h},props:{value:{type:[String,Array],default(){return""}},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},orgInfo:{type:Object},formName:{type:String},isMultiple:{type:Boolean,default(){return!1}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?h:f}},watch:{curVal(e){this.$emit("input",e)},value(){console.log("selectFormForm_value",this.value),this.curVal=this.value}},mounted(){this.curVal=this.value}},y=r(3379),b=r.n(y),g=r(7795),_=r.n(g),x=r(569),C=r.n(x),S=r(3565),w=r.n(S),k=r(9216),V=r.n(k),O=r(4589),M=r.n(O),T=r(432),E={};E.styleTagTransform=M(),E.setAttributes=w(),E.insert=C().bind(null,"head"),E.domAPI=_(),E.insertStyleElement=V(),b()(T.Z,E),T.Z&&T.Z.locals&&T.Z.locals;var F=(0,u.Z)(v,e,[],!1,null,null,null);F.options.__file="components/lib/bpmSelectFromForm/src/main.vue";var N=F.exports;N.install=function(e){e.component(N.name,N)};var j=N}(),o}()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],t):"object"==typeof exports?exports.bpm2=t(require("lodash")):e.bpm2=t(e.lodash)}(self,(function(e){return function(){var t={9392:function(e,t,n){"use strict";var i=n(8081),o=n.n(i),r=n(3645),s=n.n(r)()(o());s.push([e.id,".select-from-form-editor {\n .fake-trigger {\n min-height: 40px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n border: 1px solid #d9dce3;\n border-radius: 4px;\n padding: 0 15px;\n cursor: pointer;\n }\n}\n.bpm-select-from-form-box{\n list-style: none;\n padding: 10px 0;\n max-height: calc(70vh - 220px);\n box-sizing: border-box;\n overflow: auto;\n\n .form-item{\n list-style: none;\n margin-bottom: 10px;\n }\n .subitem {\n margin-left: 24px;\n font-size: 12px;\n color: #949494;\n }\n}\n",""]),t.Z=s},432:function(e,t,n){"use strict";var i=n(8081),o=n.n(i),r=n(3645),s=n.n(r),l=n(9392),a=s()(o());a.i(l.Z),a.push([e.id,"\n",""]),t.Z=a},3645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,o,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(i)for(var l=0;l<this.length;l++){var a=this[l][0];null!=a&&(s[a]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);i&&s[u[0]]||(void 0!==r&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=r),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},8081:function(e){"use strict";e.exports=function(e){return e[1]}},3379:function(e){"use strict";var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var r={},s=[],l=0;l<e.length;l++){var a=e[l],c=i.base?a[0]+i.base:a[0],u=r[c]||0,f="".concat(c," ").concat(u);r[c]=u+1;var d=n(f),p={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==d)t[d].references++,t[d].updater(p);else{var m=o(p,i);i.byIndex=l,t.splice(l,0,{identifier:f,updater:m,references:1})}s.push(f)}return s}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var r=i(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<r.length;s++){var l=n(r[s]);t[l].references--}for(var a=i(e,o),c=0;c<r.length;c++){var u=n(r[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}r=a}}},569:function(e){"use strict";var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9216:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},3565:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7795:function(e){"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},4589:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},5460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{attrs:{title:e.label}},[e._v(e._s(e.label))])};i._withStripped=!0;var o=n(467),r=n.n(o),s={props:["value","fieldConf","row","formName","orgInfo"],data(){return{label:""}},watch:{value(){this.loadRemoteLabel()}},mounted(){this.loadRemoteLabel()},methods:{async loadRemoteLabel(){let e=this.value;if(r().isNil(e)||!e)return this.label=zj.z("未选择","c.not_selected");try{if(r().isObject(e))try{e=JSON.parse(e)}catch(e){console.log("error",e)}let t=r().isArray(e)?e:[e],n=r().get(this.fieldConf,"id");r().isEmpty(t)?this.label=zj.z("未选择","c.not_selected"):(t=r().isArray(t)?t:[t],this.label=await this.$bpm.fetchLabelByValues(t,n,this.formName,this.row))}finally{console.log("finally")}}}},l=(0,n(1900).Z)(s,i,[],!1,null,null,null);l.options.__file="components/lib/mixins/RemoteSelectReader.vue";var a=l.exports},1900:function(e,t,n){"use strict";function i(e,t,n,i,o,r,s,l){var a,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),s?(a=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=a):o&&(a=l?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),a)if(c.functional){c._injectStyles=a;var u=c.render;c.render=function(e,t){return a.call(t),u(e,t)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,a):[a]}return{exports:e,options:c}}n.d(t,{Z:function(){return i}})},6981:function(e){e.exports=function(){return this.ELEMENT}()},3371:function(e){e.exports=function(){return this.Vue}()},467:function(t){"use strict";t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={id:e,exports:{}};return t[e](r,r.exports,i),r.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var o={};return function(){"use strict";i.r(o),i.d(o,{default:function(){return N}});var e=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-from-form",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,formName:e.formName,orgInfo:e.orgInfo,uiType:e.uiType,isMultiple:e.isMultiple},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};e._withStripped=!0;var t=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-from-form-editor"},[n("div",{on:{click:e.toOpen}},[n("div",{staticClass:"fake-trigger"},[e._v(e._s(e.label))])]),e._v(" "),n("el-dialog",{attrs:{"append-to-body":!0,visible:e.opened,"before-close":e.onHide,title:e.fieldConf.name,width:"40%"},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"只展示前100条数据,通过搜索获取更多"},on:{change:e.debounceSearch},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),e._v(" "),n("div",{staticClass:"bpm-select-from-form-box"},[e.isMultiple?n("el-checkbox-group",{attrs:{max:e.maxCount},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},e._l(e.formList,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.titleStyle},[n("el-checkbox",{key:t.id,attrs:{label:t.id}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.id,staticClass:"subitem",style:e.geFieldStyle(t.key)},[e._v("\n "+e._s(t.value)+"\n ")])}))],2)})),0):n("el-radio-group",{model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},e._l(e.formList,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.titleStyle},[n("el-radio",{key:t.id,attrs:{label:t.id,value:t.id}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.id,staticClass:"subitem",style:e.geFieldStyle(t.key)},[e._v("\n "+e._s(t.key+": "+t.value)+"\n ")])}))],2)})),0)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("确 定")])],1)],1)],1)};t._withStripped=!0;var n=i(3371),r=i.n(n),s=i(467),l=i.n(s),a=i(6981);r().use(a.Dialog);var c={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],inject:["getSelectFields","selectOptions"],data(){return{curVal:"",label:"未选择",keyword:"",opened:!1,debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[]}},watch:{value(e){(l().isString(e)||l().isArray(e))&&(this.curVal=e),this.loadRemoteLabel()},selectOptionsList(e){this.fieldConf.default&&"Default"==this.fieldConf.default.type&&"EVCFirstElem"==this.fieldConf.default.value.type&&(this.formList=this.transformOptions(e),console.log("this.formList",this.formList),this.isMultiple?this.curVal=[this.formList[0].id]:this.curVal=this.formList[0].id,console.log("this.curVal",this.curVal),this.onSubmit()),console.log("fieldConf",this.fieldConf),console.log("selectOptionsList",e)}},computed:{selectOptionsList(){return this.selectOptions()},placeholder(){return this.fieldConf.desc||this.fieldConf.name},maxCount(){return l().get(this.fieldConf,"check.max_count")},titleStyle(){let e=this.fieldConf,t=l().get(e,"range_remote.range_display.title");return{fontSize:l().get(t,"size",16)+"px",color:l().get(t,"color","#333")}},fieldStyleMap(){let e=this.fieldConf,t=l().get(e,"range_remote.range_display.fields");return l().keyBy(t,"field")}},created(){},mounted(){this.getCurVal(),this.loadRemoteLabel()},methods:{getCurVal(){this.value&&(l().isString(this.value)||l().isArray(this.value))?this.curVal=this.value:this.curVal=this.isMultiple?[]:""},geFieldStyle(e){let t=l().get(this.fieldStyleMap,e);return{fontSize:l().get(t,"size",12)+"px",color:l().get(t,"color","#949494")}},async search(){let e=this.keyword,t=this.formName,n=l().get(this.fieldConf,"id");const i=this.orgInfo;let o=this.getSelectFields();o&&"{}"!==JSON.stringify(o)&&(i.fields=o);let r=await this.$bpm.searchSelectOpts(n,e,t,this,!1,i),s=this.transformOptions(r);this.formList=s},transformOptions(e){return l().map(e,(e=>({title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:l().map(e.f_fields,((e,t)=>({key:t,value:e})))})))},onHide(){this.opened=!1},onOpen(){this.getCurVal();let e=this.selectOptions();e&&e.length?this.formList=this.transformOptions(e):this.search()},toOpen(){this.opened=!0},isChecked(e){return l().includes(this.curVal,e)},onSubmit(){console.log("this.curVal",this.curVal),this.$emit("input",this.curVal),this.$emit("change",this.curVal),this.opened=!1},async loadRemoteLabel(){let e=this.value,t=l().get(this.fieldConf,"id");l().isEmpty(e)?this.label="未选择":(e=l().isArray(e)?e:[e],this.label=await this.$bpm.fetchLabelByValues(e,t,this.formName,this.row))}}},u=i(1900),f=(0,u.Z)(c,t,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectFromForm/src/part/editor.vue";var d=f.exports,p={mixins:[i(5460).Z]},m=(0,u.Z)(p,void 0,void 0,!1,null,null,null);m.options.__file="components/lib/bpmSelectFromForm/src/part/reader.vue";var h=m.exports,v={name:"bpmSelectFromForm",components:{editorComponent:d,readerComponent:h},props:{value:{type:[String,Array],default(){return""}},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},orgInfo:{type:Object},formName:{type:String},isMultiple:{type:Boolean,default(){return!1}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?h:d}},watch:{curVal(e){this.$emit("input",e)},value(){console.log("selectFormForm_value",this.value),this.curVal=this.value}},mounted(){this.curVal=this.value}},y=i(3379),b=i.n(y),g=i(7795),_=i.n(g),x=i(569),C=i.n(x),S=i(3565),w=i.n(S),V=i(9216),k=i.n(V),O=i(4589),L=i.n(O),E=i(432),M={};M.styleTagTransform=L(),M.setAttributes=w(),M.insert=C().bind(null,"head"),M.domAPI=_(),M.insertStyleElement=k(),b()(E.Z,M),E.Z&&E.Z.locals&&E.Z.locals;var F=(0,u.Z)(v,e,[],!1,null,null,null);F.options.__file="components/lib/bpmSelectFromForm/src/main.vue";var T=F.exports;T.install=function(e){e.component(T.name,T)};var N=T}(),o}()}));