@zhijiancloud/bpm 0.0.78 → 0.0.80
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/dist/bpmField.umd.js +1 -1
- package/dist/bpmFormField.umd.js +1 -1
- package/dist/bpmSelectCheckItem.umd.js +1 -1
- package/dist/bpmSelectEntranceForm.umd.js +1 -1
- package/dist/bpmSelectFromField.umd.js +1 -1
- package/dist/bpmSelectFromMulForm.umd.js +1 -1
- package/dist/bpmSelectUser.umd.js +1 -1
- package/dist/bpmSubForm.umd.js +1 -1
- package/dist/bpmSubFormField.umd.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/bpmField.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see bpmField.umd.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash"),require("qs"),require("fecha"),require("@antv/g6"),require("element-tiptap")):"function"==typeof define&&define.amd?define(["lodash","qs","fecha","@antv/g6","element-tiptap"],t):"object"==typeof exports?exports.bpm2=t(require("lodash"),require("qs"),require("fecha"),require("@antv/g6"),require("element-tiptap")):e.bpm2=t(e.lodash,e.qs,e.fecha,e["@antv/g6"],e["element-tiptap"])}(self,(function(e,t,a,i,r){return function(){var o={5281:function(e,t,n){"use strict";n.d(t,{A:function(){return c}});var a=n(9795),i=n(6773),r=n.n(i),o=class{constructor(e,t={}){this._fnBatchLoad=e,this._options=t,this._queue=[]}async load(e){let t=await this.loads(e);return r().get(t,"0")}loads(...e){return new Promise(((t,n)=>{this._queue.push({keys:e,resolve:t,reject:n}),1==this._queue.length&&this.nextTick((()=>{this.process()}))}))}nextTick(e){setTimeout(e,0)}process(){let e=this._queue;this._queue=[];let t={};r().each(e,(e=>{r().each(e.keys,(e=>t[e]=null))}));let n=r().keys(t);this._fnBatchLoad(n).then((a=>{r().each(n,((e,n)=>{t[e]=a[n]})),r().each(e,(({keys:e,resolve:n})=>{n(r().map(e,(e=>t[e])))}))})).catch((t=>{r().each(e,(({reject:e})=>e(t)))}))}};const s=async(e,t,n)=>{if(console.log("netHeader",t.netHeader),t.networking=!0,t.netHeader&&(e.headers={common:t.netHeader}),e.params=_.merge({},e.params,n),t.env.ignore_levels&&_.set(e.params,"ignore_levels",!0),(0,a.Fr)()){let t=zj.utils.pageParam().token;e.params=_.merge({token:t,platform:"phone"},e.params)}e.isSilentOnErr=e=>{let t=_.get(e,"data.result");return t>=19e6||t<=19999999};let i=await zj.net.request(e);return t.networking=!1,i},l={},d={};var c={assistSelectEntranceForm:{getListDefinition(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i}){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_definition/`,method:"GET"},e,a)},getOptions(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_search/`,method:"GET",params:r},e,a)},getListSelected(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_selected/`,method:"GET",params:r},e,a)}},assistField:{getBatchLoader(e,{formDefId:t,fieldDefId:n,orgInfo:a,uniqueId:i}){const r=`${t}/${n}`,d=l[r]||new o((async r=>{console.log("assist_field/list_title requeset is call");let o=`/app_flow/v1/papi/assist_field/${t}/${n}/list_title/`;const l=await s({url:o,method:"GET",params:{values:JSON.stringify(r)}},e,a),d=_.get(l,"data.data.data",{});let c=[];return _.map(r,(e=>{i?(e=JSON.parse(e),e=_.get(e,`${i}`),c=_.concat(c,d[e])):c=_.concat(c,d[e])})),c}));return l[r]=d,d},getTitle(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r){return s({url:`/app_flow/v1/papi/assist_field/${t}/${n}/list_title/`,method:"GET",params:{values:JSON.stringify(r)}},e,a)},async searchSelectOpts(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r={},o=""){console.log("selectOpts: ",t,n,a,i),o&&(r.q=o);let l=i?`/app_flow/v1/papi/dm/assist_field/${t}/${n}/search_title/`:`/app_flow/v1/papi/assist_field/${t}/${n}/search_title/`,c=`${t}/${n}/${o}`,u={};return!d[c]||(new Date).getTime()-d[c].last_time>2e3?(u=await s({url:l,method:"POST",data:r},e,a),console.log("searchSelectOpts",u),d[c]={last_time:(new Date).getTime(),result:u}):u=d[c].result,u},selectFromMulFormSearchOpts(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r={},o=""){return o&&(r.q=o),s({url:i?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${n}/search_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${n}/search_title/`,method:"GET",params:r},e,a)},selectFromMulFormListTitleLoader(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i}){const r=`${t}/${n}`,d=l[r]||new o((async r=>{let o=i?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${n}/list_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${n}/list_title/`;const l=await s({url:o,method:"GET",params:{values:JSON.stringify(r)}},e,a);console.log(l);const d=_.get(l.data,"data.items",[]),c={};d.forEach((e=>{Object.keys(e.data).forEach((t=>{let n=e.data[t];c[t]={form_def_id:_.get(e,"definition.form.id"),form_title:_.get(e,"definition.form.name"),label:n}}))}));let u=[];return r.forEach((e=>{u.push(c[e])})),u}));return l[r]=d,d},selectFromMulFormListTitle(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r){return s({url:i?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${n}/list_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${n}/list_title/`,method:"GET",params:{values:JSON.stringify(r)}},e,a)}},assistTreeField:{searchSelectOpts(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r={},o=""){return o&&(r.q=o),s({url:i?`/app_flow/v1/papi/dm/assist_tree_field/${t}/${n}/search_title/`:`/app_flow/v1/papi/assist_tree_field/${t}/${n}/search_title/`,method:"GET",params:r},e,a)}},assistUserTaskCC:{searchSelectOpts(e,{formDefId:t,node:n,orgInfo:a,isDm:i},r={},o=""){return o&&(r.q=o),s({url:`/app_flow/v1/papi/assist_user_task_cc/${t}/${n}/search_title/`,method:"GET",params:r},e,a)}}}},2042:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return T}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-area",attrs:{fieldConf:e.fieldConf,row:e.row,isMultiple:e.isMultiple,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-area-editor"},[n("div",{on:{click:e.toOpen}},[e.label?n("div",[e._v("\n "+e._s(e.label)+"\n ")]):n("div",[n("el-button",{attrs:{size:"small",icon:"el-icon-location-outline"}},[e._v(" "+e._s(e.$z("选择区域","c.select_area")))])],1)]),e._v(" "),n("el-dialog",e._g(e._b({attrs:{visible:e.opened,"before-close":e.onHide,width:"65%",title:e.fieldConf.name,fullscreen:!1,"append-to-body":""},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("div",[e._v("\n "+e._s(e.$z("当前选中","b2.common.selected"))+":\n "),n("el-tag",[e._v(e._s(e.label))])],1),e._v(" "),e.refresh?n("div",{staticClass:"subcategory-tree-box"},[n("div",{staticClass:"subcategory-tree",staticStyle:{"max-height":"550px",overflow:"auto"}},[n("el-tree",{ref:"tree",attrs:{props:e.defaultProps,lazy:"","show-checkbox":!1,load:e.onLazyTreeLoad,"expand-on-click-node":!0,"check-strictly":!0},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return n("span",{staticClass:"custom-tree-node"},[n("div",{staticClass:"tree-body-content"},[n("div",[e._v(e._s(a.label))]),e._v(" "),"strict"==e.tickStrategy&&a.lazy&&a.selectable?n("span",{on:{click:function(t){return t.stopPropagation(),e.expand(a.id,"force")}}},[e._v(e._s(e.$z("选择","c.choose")))]):e._e()])])}}],null,!1,3939466302)})],1)]):e._e()]),e._v(" "),e.openLocate?n("room-map-select",{attrs:{field:e.field,drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas},on:{save:e.savePlan}}):e._e()],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(6773),l=n.n(s),d=n(7642),c=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",[e._v("\n slsls\n")])};c._withStripped=!0;var u=n(4486),m=(0,u.A)({},c,[],!1,null,null,null);m.options.__file="components/lib/bpmArea/src/part/room-map-select.vue";var f=m.exports;o().use(d.Dialog);var h={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:f},inject:["selectOptions"],data(){return{curVal:"",label:zj.z("选择区域","c.select_area"),keyword:"",opened:!1,debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[],treeItemMap:{},subareas:[],drawingMd5s:[],refresh:!0,selectedKey:"",defaultProps:{children:"children",label:"label",isLeaf:"isLeaf"},selectList:[],allAreaMap:{}}},watch:{value(){this.curVal=this.value,this.loadRemoteLabel()},selectedKey(e){e&&this.selected(e)},getSelectOptions(e){this.refresh=!1,this.selectList=e,setTimeout((()=>{this.refresh=!0}),500)}},computed:{tickStrategy(){return"leaf_only"==l().get(this.fieldConf,"can","all")?"leaf-filtered":"strict"},openLocate(){return l().get(this.fieldConf,"enable_locate")},points(){return l().get(this.value,"all_points",[])},canSelect(){return l().get(this.fieldConf,"can")},getSelectOptions(){return this.selectOptions?this.selectOptions():[]}},mounted(){this.curVal=this.value,this.loadRemoteLabel()},methods:{handleNodeClick(e){this.selectedKey=l().get(e,"id","")},handleCheckChange(e,t,n){console.log(e,t,n)},toOpen(){this.opened=!0},toClose(){this.opened=!1},reset(){try{let e=this.value;this.selectedKey=l().get(e,"id","")}catch(e){this.selectedKey=""}},async onOpen(){if(l().isEmpty(this.selectList)||!this.selectList){let e=await this.loadList("");console.log("onOpendata",e),this.selectList=e,this.reset()}this.opened=!0},clear(){this.removeValue(),this.resetLabel(),this.selectedKey=""},onLazyTreeLoad(e,t){setTimeout((async()=>{let n=[];console.log("node——onLazyTreeLoad",e),n=0==e.level?await this._loadNextCategoryList(""):await this._loadNextCategoryList(e.data.id),this.setCategoryInMap(n),console.log("list",n),t(n)}),500)},async _loadNextCategoryList(e){let t=await this.loadList(e);return console.log("data_tree",t),this.transformResultToTree(t)},transformResultToTree(e){let t=this.canSelect;return l().map(e,(e=>{let n=e.drawing_md5s;n=l().compact(n);let a={id:e.id,lazy:e.is_parent,label:e.name,isLeaf:!e.is_parent,path_ids:e.path_ids,path_names:e.path_names,selectable:e.available,haspic:!!n.length,type:e.type};return"building_floor"==t&&3==e.type&&(a.lazy=!1),l().set(this.treeItemMap,e.id,a),a}))},async loadList(e){let t=this.search_keyword,n=JSON.stringify({id:e,path_ids:l().get(this.treeItemMap,`${e}.path_ids`),type:l().get(this.treeItemMap,`${e}.type`)}),a=zj.pageParam({father:n,q:t});e||delete a.father,this.selectFields&&(a.fields=this.selectFields);let i=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container});return console.log("data",i),i},setCategoryInMap(e){l().each(e,(e=>{l().set(this.allAreaMap,e.value,e)}))},selected(e,t){e=l().toString(e);let n=l().get(this.treeItemMap,e,null);n&&(n&&n.lazy&&!t||!e||!n.selectable||(this.label=n.label,n=l().cloneDeep(n),delete n.label,delete n.lazy,delete n.path_names,delete n.pathNames,delete n.selectable,delete n.haspic,delete n.children,this.value,this.$emit("input",[{id:n.id,path_ids:n.path_ids,all_points:[],type:n.type}]),this.loadRemoteLabel(),this.toClose()))},expand(e,t){if(e=l().toString(e),!l().get(this.treeItemMap,e,null).lazy||t)this.selected(e,t);else{let t=this.$refs.tree.isExpanded(l().toInteger(e));this.$refs.tree.setExpanded(l().toInteger(e),!t)}},savePlan(e){this.curVal.all_points=l().cloneDeep(e),this.$emit("input",this.curVal.all_points),this.$emit("change",this.curVal.all_points)},async search(){let e=this.search_keyword;if(this.keyword=e,this.expandedKeys=[],!e)return;this.$bpm.setFuncGIO("区域搜索");let t=await this._loadNextCategoryList("");this.changeLazy(t),this.filterNodes=t},changeLazy(e){this.setCategoryInMap(e),l().each(e,(e=>{this.expandedKeys.push(e.value),e.lazy=!1,e.expandable=!0,e.children&&this.changeLazy(e.children)}))},async loadRemoteLabel(){if(!this.value)return;let e=this.value[0];if(!l().isNil(e)&&e)try{this.loading=!0,e=l().cloneDeep(e),delete e.all_points,delete e.path_ids,delete e.type,e=JSON.stringify(e);let t=await this.$bpm.fetchLabelByValue(e,this.fieldConf.id,this.formName,this,"id",this.row);this.subareas=l().get(t,"subareas",[]),this.drawingMd5s=l().get(t,"drawing_md5s",[]);let n=l().join(t.path_names,"/");this.label=`${n}${n?"/":""}${t.name}`}finally{this.loading=!1}else this.label=""},onHide(){this.opened=!1}}},p=(0,u.A)(h,i,[],!1,null,null,null);p.options.__file="components/lib/bpmArea/src/part/editor.vue";var g=p.exports,y=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-area-editor"},[n("div",{on:{click:function(t){return t.stopPropagation(),e.toOpen.apply(null,arguments)}}},[e.labels.length>0?n("div",[e._l(e.labels,(function(t){return n("el-tag",{key:t,staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t))])})),e._v(" "),n("i",{staticClass:"el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.delAllItem()}}})],2):n("div",[n("el-button",{attrs:{size:"small",icon:"el-icon-location-outline"}},[e._v(" "+e._s(e.$z("选择区域","c.select_area")))])],1)]),e._v(" "),n("el-dialog",e._g(e._b({attrs:{visible:e.opened,"before-close":e.onHide,width:"65%",title:e.fieldConf.name,fullscreen:!1,"append-to-body":""},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("div",[e._v("\n "+e._s(e.$z("当前选中","b2.common.selected"))+":\n "),e._l(e.labelObjs,(function(t,a){return[a<5?n("el-tag",{key:t.id,staticStyle:{"margin-right":"10px","margin-top":"5px"},attrs:{closable:""},on:{close:function(n){return e.delHandle(t)}}},[e._v(e._s(t.pathNames))]):e._e()]})),e._v(" "),e.labelObjs.length>5?n("el-dropdown",[n("el-button",{attrs:{type:"primary"}},[e._v("\n "+e._s(e.$z("更多","c.more"))),n("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e._l(e.labelObjs,(function(t,a){return[a>=5?n("el-dropdown-item",{key:t.id},[n("el-tag",{staticStyle:{"margin-right":"10px","margin-top":"5px"},attrs:{closable:""},on:{close:function(n){return e.delHandle(t)}}},[e._v(e._s(t.pathNames))])],1):e._e()]}))],2)],1):e._e()],2),e._v(" "),e.refresh?n("div",{staticClass:"subcategory-tree-box"},[n("div",{staticClass:"subcategory-tree",staticStyle:{"max-height":"550px",overflow:"auto"}},[n("el-tree",{ref:"tree",attrs:{props:e.defaultProps,lazy:"","node-key":"id","show-checkbox":!0,load:e.onLazyTreeLoad,"expand-on-click-node":!1,"check-on-click-node":!0,"check-strictly":!0},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return n("span",{staticClass:"custom-tree-node"},[n("div",{staticClass:"tree-body-content"},[n("div",[e._v(e._s(a.label))]),e._v(" "),"strict"==e.tickStrategy&&a.lazy&&a.selectable?n("span",{on:{click:function(t){return t.stopPropagation(),e.expand(a.id,"force")}}},[e._v(e._s(e.$z("选择","c.choose")))]):e._e()])])}}],null,!1,3939466302)})],1),e._v(" "),n("div",{staticStyle:{display:"flex","flex-direction":"row-reverse"}},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确认","c.confirm")))]),e._v(" "),n("el-button",{staticStyle:{"margin-right":"10px"},on:{click:function(t){return e.clear()}}},[e._v(e._s(e.$z("重置","c.reset")))])],1)]):e._e()]),e._v(" "),e.openLocate?n("room-map-select",{attrs:{field:e.field,drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas},on:{save:e.savePlan}}):e._e()],1)};y._withStripped=!0,o().use(d.Dialog);var b={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:f},inject:["selectOptions"],data(){return{curVal:[],label:zj.z("选择区域","c.select_area"),labels:[],labelObjs:[],keyword:"",opened:!1,debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[],treeItemMap:{},subareas:[],drawingMd5s:[],refresh:!0,selectedKeys:[],selectedItems:[],defaultProps:{children:"children",label:"label",isLeaf:"isLeaf"},selectList:[],allAreaMap:{}}},watch:{value(){this.curVal=this.value,this.selectedKeys=l().map(this.curVal,(e=>e.id)),console.log("this.selectedKeys",this.selectedKeys),this.loadRemoteLabel()},selectedKeys(e){e&&this.selected(e)},getSelectOptions(e){this.refresh=!1,this.selectList=e,setTimeout((()=>{this.refresh=!0}),500)}},computed:{tickStrategy(){return"leaf_only"==l().get(this.fieldConf,"can","all")?"leaf-filtered":"strict"},openLocate(){return l().get(this.fieldConf,"enable_locate")},points(){return l().get(this.value,"all_points",[])},canSelect(){return l().get(this.fieldConf,"can")},getSelectOptions(){return this.selectOptions?this.selectOptions():[]}},mounted(){this.curVal=this.value,this.loadRemoteLabel()},methods:{delAllItem(){this.clear(),this.$nextTick((()=>{this.onSubmit()}))},delHandle(e){console.log("del_item",e),this.selectedKeys=l().filter(this.selectedKeys,(t=>t!=e.id)),this.setCheckedNode(this.selectedKeys)},handleNodeClick(e){console.log("data",e)},setCheckedNode(e){let t=[];t=e||l().map(this.value,(e=>e.id)),console.log("this.curVal",this.curVal),console.log("_keys",t),this.$refs.tree&&this.$refs.tree.setCheckedKeys(t)},handleCheckChange(e,t,n){console.log("checked_data",e),t?this.selectedKeys.push(e.id):this.selectedKeys=l().filter(this.selectedKeys,(t=>t!=e.id)),console.log("this.selectedKeys",this.selectedKeys),console.log(e,t,n)},toOpen(){this.opened=!0},toClose(){this.opened=!1},reset(){this.selectedKeys=[]},onSubmit(){console.log("this.selectItems",this.selectedItems),this.$emit("input",this.selectedItems),this.toClose()},async onOpen(){this.opened=!0},clear(){this.selectedKeys=[],this.selectedItems=[],this.labels=[],this.labelObjs=[],this.curVal=[],this.setCheckedNode([])},onLazyTreeLoad(e,t){setTimeout((async()=>{let n=[];console.log("node——onLazyTreeLoad",e),0==e.level?(n=await this._loadNextCategoryList(""),this.setCheckedNode()):n=await this._loadNextCategoryList(e.data.id),this.setCategoryInMap(n),console.log("list",n),t(n)}),500)},async _loadNextCategoryList(e){let t=await this.loadList(e);return console.log("data_tree",t),this.transformResultToTree(t)},transformResultToTree(e){let t=this.canSelect;return this.loading=!1,l().map(e,(e=>{let n=!0;switch(console.log("canSelect",t),t){case"any":n=!0;break;case"leaf_only":n=!e.is_parent;break;case"building":n=2==e.type;break;case"floor":n=3==e.type;break;case"building_floor":n=2==e.type||3==e.type;break;case"suite":n=4==e.type||5==e.type;break;case"suite_ex":n=4==e.type||5==e.type||6==e.type}let a=l().join(e.path_names,"/"),i={id:e.id,lazy:e.is_parent,isLeaf:!e.is_parent,label:e.name,type:e.type,path_ids:e.path_ids,path_names:e.path_names,pathNames:`${a}${a?"/":""}${e.name}`,tickable:n,noTick:!n};return console.log("tran_data",i),"building_floor"==t&&3==e.type&&(i.lazy=!1,i.isLeaf=!0),l().set(this.treeItemMap,e.id,i),i}))},async loadList(e){let t=this.search_keyword,n=JSON.stringify({id:e,path_ids:l().get(this.treeItemMap,`${e}.path_ids`),type:l().get(this.treeItemMap,`${e}.type`)}),a=zj.pageParam({father:n,q:t});e||delete a.father,this.selectFields&&(a.fields=this.selectFields);let i=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container});return console.log("data",i),i},setCategoryInMap(e){l().each(e,(e=>{l().set(this.allAreaMap,e.value,e)}))},selected(e,t){this.selectedItems=[],console.log("keys",e),e&&e.length>0&&l().each(e,(e=>{e=l().toString(e);let t=l().get(this.treeItemMap,e,null);console.log("—item",t),t&&(this.label=t.label,t=l().cloneDeep(t),console.log("item",t),this.selectedItems.push({id:t.id,path_ids:t.path_ids,all_points:[],type:t.type}))})),console.log("this.selectedItems",this.selectedItems),this.curVal=l().cloneDeep(this.selectedItems),console.log("this.curVal",this.curVal),this.loadRemoteLabel()},expand(e,t){if(e=l().toString(e),!l().get(this.treeItemMap,e,null).lazy||t)this.selected(e,t);else{let t=this.$refs.tree.isExpanded(l().toInteger(e));this.$refs.tree.setExpanded(l().toInteger(e),!t)}},savePlan(e){this.curVal.all_points=l().cloneDeep(e),this.$emit("input",this.curVal.all_points),this.$emit("change",this.curVal.all_points)},async search(){let e=this.search_keyword;if(this.keyword=e,this.expandedKeys=[],!e)return;this.$bpm.setFuncGIO("区域搜索");let t=await this._loadNextCategoryList("");this.changeLazy(t),this.filterNodes=t},changeLazy(e){this.setCategoryInMap(e),l().each(e,(e=>{this.expandedKeys.push(e.value),e.lazy=!1,e.isLeaf=!0,e.expandable=!0,e.children&&this.changeLazy(e.children)}))},async loadRemoteLabel(){if(this.curVal)if(!l().isNil(this.curVal)&&this.curVal&&0!=this.curVal.length)try{let e=[];l().each(this.curVal,(t=>{e.push(JSON.stringify(t))})),this.loading=!0,console.log("list",e);let t=await this.$bpm.fetchLabelByValues(e,this.fieldConf.id,this.formName,this,"id");this.subareas=l().get(t,"subareas",[]),this.drawingMd5s=l().get(t,"drawing_md5s",[]),this.labels=[];let n=l().map(t,(e=>{let t=l().join(e.path_names,"/");return e.pathNames=`${t}${t?"/":""}${e.name}`,l().set(this.treeItemMap,e.id,e),e.pathNames}));this.labelObjs=l().cloneDeep(t),this.labels=l().cloneDeep(n),n=l().join(n,", "),this.label=n}finally{this.loading=!1}else this.label=zj.z("选择区域","c.select_area")},onHide(){this.opened=!1}}},v=(0,u.A)(b,y,[],!1,null,null,null);v.options.__file="components/lib/bpmArea/src/part/multi-editor.vue";var w=v.exports,M=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"area-reader"},[e.isMultiple?[e.openLocate?e._l(e.labelObjs,(function(t){return n("div",{key:t.id},[n("el-tag",{staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t.pathNames))]),e._v(" "),e.openLocate?n("room-map-select",{attrs:{drawingMd5s:t.drawingMd5s,defaultPoints:e.points,subareas:t.subareas}}):e._e()],1)})):e._l(e.labelObjs,(function(t){return n("el-tag",{key:t.id,staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t.pathNames))])}))]:[n("span",{attrs:{title:e.label}},[e._v(e._s(e.label)+" "),n("i",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"el-icon-loading",attrs:{size:"14px"}})]),e._v(" "),e.openLocate?n("room-map-select",{attrs:{drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas}}):e._e()]],2)};M._withStripped=!0;var L={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:f},data(){return{label:"",labelObjs:[],loading:!1,subareas:[],drawingMd5s:[],curVal:[]}},watch:{value(){this.curVal=this.value,this.isMultiple?this.loadRemoteLabels():this.loadRemoteLabel()}},computed:{openLocate(){return _.get(this.fieldConf,"enable_locate")},points(){return _.get(this.value,"all_points",[])}},mounted(){this.curVal=this.value,this.isMultiple?this.loadRemoteLabels():this.loadRemoteLabel()},methods:{async loadRemoteLabel(){console.log("this.value",this.value);let e=this.value[0];if(!_.isNil(e)&&e)try{this.loading=!0,e=_.cloneDeep(e),delete e.all_points,delete e.path_ids,delete e.type,e=JSON.stringify(e);let t=await this.$bpm.fetchLabelByValue(e,this.fieldConf.id,this.formName,this,"id",this.row);this.subareas=_.get(t,"subareas",[]),this.drawingMd5s=_.get(t,"drawing_md5s",[]);let n=_.join(t.path_names,"/");this.label=`${n}${n?"/":""}${t.name}`,this.loading=!1}finally{this.loading=!1}else this.label=zj.z("未选择","c.not_selected")},async loadRemoteLabels(){if(!_.isNil(this.curVal)&&this.curVal&&0!=this.curVal.length)try{let e=[];_.each(this.curVal,(t=>{e.push(JSON.stringify(t))})),this.loading=!0,console.log("list",e);let t=await this.$bpm.fetchLabelByValues(e,this.fieldConf.id,this.formName,this,"id");this.labels=[];let n=_.map(t,(e=>{let t=_.join(e.path_names,"/");return e.pathNames=`${t}${t?"/":""}${e.name}`,_.set(this.treeItemMap,e.id,e),e.pathNames}));this.labelObjs=_.cloneDeep(t),this.labels=_.cloneDeep(n),n=_.join(n,", "),this.label=n,console.log("this.labelObjs",this.labelObjs)}finally{this.loading=!1}}}},k=(0,u.A)(L,M,[],!1,null,null,null);k.options.__file="components/lib/bpmArea/src/part/reader.vue";var S=k.exports,D={name:"BpmArea",components:{editorComponent:g,multiEditorComponent:w,readerComponent:S},props:{value:{type:[String,Array,Number]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},isMultiple:{type:Boolean,default(){return!1}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?S:this.isMultiple?w:g}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},x=(0,u.A)(D,a,[],!1,null,null,null);x.options.__file="components/lib/bpmArea/src/main.vue";var Y=x.exports;Y.install=function(e){e.component(Y.name,Y)};var T=Y},7930:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return P}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"area-elevation"},[e.curVal&&e.curVal.selected?["table"==e.uiType?[n("el-popover",{attrs:{placement:"top-start",width:"500",trigger:"hover"}},[n("div",{staticStyle:{display:"flex","flex-flow":"wrap",margin:"10px"}},e._l(e.curVal.selected,(function(t){return n("div",{key:t.key,staticClass:"area-elevation-select-box",staticStyle:{"margin-left":"5px","margin-top":"5px"}},[n("el-tag",{staticClass:"area-elevation-select-item"},[e._v(e._s(t.name))])],1)})),0),e._v(" "),n("div",{attrs:{slot:"reference"},slot:"reference"},[e.curVal.selected&&e.curVal.selected.length>2?[e._l(e.curVal.selected,(function(t,a){return n("div",{key:t.key,staticClass:"area-elevation-select-box"},[a<2?n("el-tag",{staticClass:"area-elevation-select-item"},[e._v(e._s(t.name))]):e._e()],1)})),e._v(" "),n("div",{staticClass:"area-elevation-select-box"},[n("el-tag",{staticClass:"area-elevation-select-item"},[e._v("+"+e._s(e.curVal.selected.length-2))])],1)]:e._l(e.curVal.selected,(function(t){return n("div",{key:t.key,staticClass:"area-elevation-select-box"},[n("el-tag",{staticClass:"area-elevation-select-item"},[e._v(e._s(t.name))])],1)}))],2)])]:e._l(e.curVal.selected,(function(t){return n("div",{key:t.key,staticClass:"area-elevation-select-box"},[n("el-tag",{staticClass:"area-elevation-select-item"},[e._v(e._s(t.name))])],1)}))]:e._e(),e._v(" "),e.loading?n("i",{staticClass:"el-icon-loading"}):n("el-button",{attrs:{type:"view"==e.mode?"text":"plain",size:"small",icon:"el-icon-location-outline"},on:{click:function(t){return e.openSelectSectionDlg()}}},[e._v(e._s(e.button_title))]),e._v(" "),n("dlg-select-section",{attrs:{mode:e.mode,dialog_title:e.dialog_title,areaMap:e.areaMap,allTreeData:e.allTreeData,colorConfig:e.colorConfig,value:e.curVal,show:e.dlg.show},on:{close:e.colseSelectSectionDlg}})],2)};a._withStripped=!0;var i=n(7642),r=n(5554),o=n.n(r),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.dialog_title,visible:e.dialogVisible,width:"80%","append-to-body":"","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-form",{ref:"form",attrs:{inline:!0,model:e.form,"label-width":"100px"}},[n("el-row",[n("el-form-item",{attrs:{label:e.$z("楼栋","c.building")}},[n("el-select",{attrs:{placeholder:e.$z("请选择楼栋","c.select_a_building"),disabled:"view"==e.mode},on:{change:e.changeBuilding},model:{value:e.form.building_id,callback:function(t){e.$set(e.form,"building_id",t)},expression:"form.building_id"}},e._l(e.buildingOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.title,value:e.key}})})),1)],1),e._v(" "),n("el-form-item",{attrs:{label:e.$z("楼层","c.floor")}},[n("el-select",{attrs:{multiple:"",placeholder:"请选择楼层",disabled:"view"==e.mode},on:{change:e.filterData},model:{value:e.form.storey_ids,callback:function(t){e.$set(e.form,"storey_ids",t)},expression:"form.storey_ids"}},e._l(e.floor_options,(function(e){return n("el-option",{key:e.key,attrs:{label:e.title,value:e.key}})})),1)],1),e._v(" "),n("el-form-item",{attrs:{label:"关建字筛选"}},[n("el-input",{attrs:{placeholder:"请输入",disabled:"view"==e.mode},on:{input:e.filterData},model:{value:e.form.keyword,callback:function(t){e.$set(e.form,"keyword",t)},expression:"form.keyword"}})],1)],1),e._v(" "),n("el-row",[n("el-col",{attrs:{span:10}},[n("el-form-item",{attrs:{label:"展示方式"}},[n("el-radio-group",{attrs:{disabled:e.show_level_disable||"view"==e.mode},model:{value:e.form.show_level,callback:function(t){e.$set(e.form,"show_level",t)},expression:"form.show_level"}},[n("el-radio",{attrs:{label:3}},[e._v("展示到3级")]),e._v(" "),n("el-radio",{attrs:{label:4}},[e._v("展示到4级")])],1)],1)],1),e._v(" "),n("el-col",{attrs:{span:6}},[n("zj-color-indication",{staticStyle:{float:"right"},attrs:{colorConfig:e.colorConfig}})],1)],1)],1),e._v(" "),n("div",{staticStyle:{margin:"0 20px 20px 20px"}},[e._v("已选项:"),e._l(e.selectedItem,(function(t){return n("el-tag",{key:t.key,staticStyle:{margin:"5px"},attrs:{closable:"view"!=e.mode},on:{close:function(n){return e.removeItem(t)}}},[e._v("\n "+e._s(t.name)+"\n ")])}))],2),e._v(" "),n("zj-pc-select-position-table",{attrs:{data:e.treeData,readonly:"view"==e.mode},model:{value:e.selectedItem,callback:function(t){e.selectedItem=t},expression:"selectedItem"}}),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){return e.close()}}},[e._v(e._s(e.$z("取消","c.cancel")))]),e._v(" "),"view"!=e.mode?n("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v(e._s(e.$z("确定","c.confirm")))]):e._e()],1)],1)};s._withStripped=!0;var l=n(6902),d=n(5072),c=n.n(d),u=n(7825),m=n.n(u),f=n(7659),h=n.n(f),p=n(5056),g=n.n(p),y=n(540),b=n.n(y),v=n(1113),w=n.n(v),M=n(2392),L={};L.styleTagTransform=w(),L.setAttributes=g(),L.insert=h().bind(null,"head"),L.domAPI=m(),L.insertStyleElement=b(),c()(M.A,L),M.A&&M.A.locals&&M.A.locals;var k=n(3231),S={};S.styleTagTransform=w(),S.setAttributes=g(),S.insert=h().bind(null,"head"),S.domAPI=m(),S.insertStyleElement=b(),c()(k.A,S),k.A&&k.A.locals&&k.A.locals,o().use(l.SelectPositionTable),o().use(l.ColorIndication);var D={props:{allTreeData:{type:Array,default:function(){return[]}},mode:{type:String,default(){return"view"}},areaMap:{type:Object,default:function(){return{}}},colorConfig:{type:Object,default:function(){return{}}},value:{type:[String,Array,Number,Object]},statusList:{type:Array,default:function(){return[]}},show:{type:Boolean,default:!1},all_level:{type:Number,default:0},dialog_title:{type:String,default:"选择部位"}},watch:{"form.show_level"(e,t){this.selectedItemMap["level_"+t]=this.selectedItem,this.filterData()},allTreeData(e){this.buildingOptions=e},value:{handler(e){},immediate:!0},show(e){if(this.dialogVisible=e,e){if(this.value&&this.value.building_ids?(this.form.building_id=this.value.building_ids[0]+"",this.form.building_ids=this.value.building_ids):this.allTreeData&&this.allTreeData.length>0&&(this.form.building_id=this.allTreeData[0].key,this.form.building_ids=[this.allTreeData[0].key]),this.value&&this.value.storey_ids){let e=[];_.each(this.value.storey_ids,(t=>{e.push(t+"")}))}this.value&&this.value.selected?(this.selectedItem=this.value.selectedItem,this.form.keyword=this.value.keyword,this.form.show_level=this.value.show_level):this.selectedItem=[],this.loadBuildingData()}},selectedItem:{handler(e){},deep:!0}},data(){return{dialogVisible:!1,show_level_disable:!1,form:{building_id:"1",storey_ids:[],show_level:4,keyword:""},buildingOptions:[],floor_options:[],selectedItem:[],treeData:[],buildingTreeData:[],selectedItemMap:{level_3:[],level_4:[]}}},methods:{confirm(){let e=[];_.each(this.selectedItem,(t=>{this.areaMap[t.key]&&e.push(this.areaMap[t.key])}));let t=[];_.each(this.form.storey_ids,(e=>{t.push(parseInt(e))}));let n={selectedItem:this.selectedItem,selected:e,building_ids:[parseInt(this.form.building_id)],storey_ids:t,keyword:this.form.keyword,show_level:parseInt(this.form.show_level)};this.$emit("close",n)},close(){this.dialogVisible=!1,this.$emit("close",!1)},handleClose(e){this.$emit("close",!1)},filterData(){if(this.treeData=_.cloneDeep(this.buildingTreeData.filter((e=>this.form.storey_ids.length>0?_.includes(this.form.storey_ids,e.key)?e:void 0:e))),3==this.form.show_level&&_.each(this.treeData,(e=>{_.each(e.childrens,(e=>{delete e.childrens}))})),4==this.form.show_level){let e=this.selectedItemMap.level_3;e&&e.length>0&&(_.each(this.treeData,(t=>{_.each(t.childrens,(t=>{_.find(e,{key:t.key})&&_.each(t.childrens,(n=>{e.push({key:n.key,name:t.name+"-"+n.title})}))}))})),this.selectedItem=e)}console.log("treeData",this.treeData),this.filterKeyWord()},changeBuilding(){this.loadBuildingData()},loadBuildingData(){let e=_.find(this.allTreeData,{key:this.form.building_id});e&&(e.childrens?this.buildingTreeData=_.cloneDeep(e.childrens):this.buildingTreeData=[],this.buildingTreeData.length>0&&(this.buildingTreeData[0].childrens&&this.buildingTreeData[0].childrens[0].childrens&&this.buildingTreeData[0].childrens[0].childrens.length>0?this.show_level_disable=!1:(this.form.show_level=3,this.show_level_disable=!0)),this.floor_options=this.buildingTreeData,this.filterData())},filterKeyWord(){this.form.keyword&&(this.treeData=this.treeData.filter((e=>{let t=!1;if(e.childrens&&e.childrens.length>0&&(e.childrens=e.childrens.filter((e=>{if(-1!=e.title.indexOf(this.form.keyword)||-1!=this.form.keyword.indexOf(e.title))return t=!0,e;if(e.childrens&&e.childrens.length>0){let n=!1;if(_.each(e.childrens,(e=>{-1==e.title.indexOf(this.form.keyword)&&-1==this.form.keyword.indexOf(e.title)||(n=!0,t=!0)})),n)return e}}))),t)return e})))},removeItem(e){this.selectedItem=_.filter(this.selectedItem,(function(t){return t.key!=e.key}))}},mounted(){}},x=n(4486),Y=(0,x.A)(D,s,[],!1,null,null,null);Y.options.__file="components/lib/bpmAreaElevation/src/part/dlgSelectSection.vue";var T=Y.exports;o().use(i.Dialog);var C={name:"BpmAreaElevation",components:{dlgSelectSection:T},props:{value:{type:[String,Array,Number,Object]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},container:{type:Object,default(){return{}}},formName:{type:String},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},isMultiple:{type:Boolean,default(){return!1}}},data(){return{sourceData:[],allTreeData:[],areaMap:{},dlg:{show:!1},curVal:{building_id:"",storey_ids:[],selected:[],keyword:"",show_level:"4"},loading:!1,button_title:"",dialog_title:"",colorConfig:{data:[{name:"task_no",title:zj.z("未开始","c.not_started"),color:"#fff",border_color:"#D8DADD",width:"100px"},{name:"task_ready",title:zj.z("进行中","c.in_progress"),color:"#FFE9BD",border_color:"#FFE9BD",width:"100px"},{name:"task_ing",title:zj.z("已完成","c.completed"),color:"#B4EFCE",border_color:"#B4EFCE",width:"100px"}]}}},computed:{},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.value&&(this.curVal=this.value)}},mounted(){this.fieldConf.test&&(this.formateData(this.fieldConf.range_enum),this.getColorConfig(this.fieldConf.status_range_enum)),console.log("uiType",this.uiType),"view"==this.mode?(this.button_title="",this.dialog_title=zj.z("查看部位","c.view_part")):(this.button_title=zj.z("选择部位","c.select_part"),this.dialog_title=zj.z("选择部位","c.select_part")),this.curVal=this.value},methods:{async loadList(e){let t=this.fieldConf.area||"",n=this.fieldConf.status_scope.depends[0]||"";if(!t||!n)return console.log("没有配置联区域字段或检查项依赖自段"),!1;let a={fields:{}};return console.log("_area_field",t),console.log("_checkitem_field",n),console.log("row",this.row),console.log("this.container",this.container),this.container&&this.container.formData&&(t&&(a.fields[t]=this.container.formData[t]),n&&(a.fields[n]=this.container.formData[n])),this.row&&(t&&(a.fields[t]=this.row.f_fields[t]),n&&(a.fields[n]=this.row.f_fields[n])),this.sourceData=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container}),console.log("this.sourceData",this.sourceData),this.sourceData},formateData(e){console.log("source_data",e);let t=[],n={},a=[];this.fieldConf.test?_.each(this.fieldConf.status_range_enum,(e=>{n[e.id]=e,a.push(e)})):_.each(this.sourceData[1],(e=>{n[e.id]=e,a.push(e)})),console.log("statusMap",n);let i=(e,t,r)=>{let o=[];return _.each(e,(s=>{if(this.areaMap[s.id]=s,s.path_ids.length==t&&(0==r||_.last(s.path_ids)==r)){let r={title:s.name,key:s.id+"",path_names:s.path_names,state:!1,status:s.status};if(s.is_parent&&(r.childrens=i(e,t+1,s.id),r.childrens&&r.childrens.length>0)){let e=0,t=0,i=0;_.each(r.childrens,(n=>{n.status?(console.log("child",n),n.status==a[1].id?t+=1:n.status==a[2].id?i++:e++):e++})),console.log("_complete_count",i),console.log("_doing_count",t),console.log("_begin_count",e),i==r.childrens.length?s.status=a[2].id:e==r.childrens.length?s.status?_.each(r.childrens,(e=>{e.status=s.status,e.color=n[s.status].color})):s.status=a[0].id:(s.status=a[1].id,s.color=n[s.status].color)}s.status?n[s.status]&&(r.color=n[s.status].color):(r.status=a[0].id,r.color=n[r.status].color),o.push(r)}})),_.orderBy(o,["order"],["asc"]),1==t&&(o=_.reverse(o)),o};t=i(e,0,0),console.log("_treeData",t),this.allTreeData=t},async openSelectSectionDlg(){console.log("row",this.row),console.log("fieldConf",this.fieldConf),console.log("container",this.container),this.fieldConf.test||(this.loading=!0,await this.loadList(),this.loading=!1,this.formateData(this.sourceData[0]),this.getColorConfig(this.sourceData[1])),this.dlg.show=!0},colseSelectSectionDlg(e){console.log("confirm_Data",e),this.dlg.show=!1,e&&(this.curVal=e,this.$emit("input",e))},getColorConfig(e){let t={data:[]};e&&e.length>0&&(_.each(e,(e=>{let n={name:e.id,title:e.name,color:e.color||"#ffffff",border_color:e.color||"#D8DADD",width:"100px"};"#ffffff"!=n.color&&"#FFFFFF"!=n.color||(n.border_color="#D8DADD"),t.data.push(n)})),this.colorConfig=t)}}},j=(n(8173),(0,x.A)(C,a,[],!1,null,null,null));j.options.__file="components/lib/bpmAreaElevation/src/main.vue";var $=j.exports;$.install=function(e){e.component($.name,$)};var P=$},4789:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return B}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-audit",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType,container:e.container},on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"audit-editor"},[n("div",[n("div",{on:{click:function(t){e.opened=!0}}},[n("span",{staticClass:"aduit-result-title",style:{background:e.resultColor||"none",color:e.resultColor?"#fff":"#333",cursor:"pointer"}},[e._v(e._s(e.getViewFont)+" "),n("i",{staticClass:"el-icon-arrow-right",staticStyle:{"font-size":"14px"}})])])]),e._v(" "),n("el-dialog",{staticClass:"audit-modal",attrs:{visible:e.opened,modal:!1,"append-to-body":!0,title:e.fieldConf.name},on:{"update:visible":function(t){e.opened=t},close:e.onHide,open:e.onOpen}},[n("div",[n("el-form",{ref:"form",staticClass:"audit-modal-content",attrs:{model:e.curVal,"label-width":"120px"}},[n("el-form-item",{attrs:{label:e.$z("审批结果:","b2.common.approval_results")}},[n("span",{staticClass:"aduit-result-title",style:{background:e.resultColor,color:e.resultColor?"#fff":"#333"}},[e._v(e._s(e.getViewFont))])]),e._v(" "),e.curVal&&e.curVal.reject_target?n("el-form-item",{attrs:{label:e.$z("回退节点:","b2.common.fallback_node")}},[e._v("\n "+e._s(e.curVal.reject_target.name||e.$z("上一个节点","b2.common.previous_node"))+"\n ")]):e._e(),e._v(" "),e.showSignature?n("el-form-item",{attrs:{label:e.$z("签名:","b2.common.sign"),required:e.isSignatureMust}},[n("bpm-mul-image",{attrs:{fieldConf:{type:"Signature"},mode:"edit"},model:{value:e.curVal.signature,callback:function(t){e.$set(e.curVal,"signature",t)},expression:"curVal.signature"}})],1):e._e(),e._v(" "),e.showJudgment?n("el-form-item",{attrs:{label:e.$z("填写意见:","b2.common.fill_comment"),required:e.isJudgmentMust}},[n("el-input",{attrs:{type:"textarea",placeholder:e.$z("请输入评审意见","b2.common.en_comment")},model:{value:e.curVal.judgment,callback:function(t){e.$set(e.curVal,"judgment",t)},expression:"curVal.judgment"}})],1):e._e(),e._v(" "),e.showPhoto?n("el-form-item",{attrs:{label:e.$z("拍照:","b2.common.photograph"),required:e.isPhotoMust}},[n("bpm-mul-image",{attrs:{fieldConf:{type:"MulImage"},mode:"edit"},model:{value:e.curVal.photos,callback:function(t){e.$set(e.curVal,"photos",t)},expression:"curVal.photos"}})],1):e._e(),e._v(" "),n("el-form-item",{attrs:{label:e.$z("审批日期:","b2.common.audit_date")}},[n("el-date-picker",{ref:"dateSelect",attrs:{type:"datetime",placeholder:e.$z("选择日期时间","c.select_date_time"),format:e.auditFormat},model:{value:e.curVal.audit_at,callback:function(t){e.$set(e.curVal,"audit_at",t)},expression:"curVal.audit_at"}})],1),e._v(" "),e.curVal.auditor_name?n("el-form-item",{attrs:{label:e.$z("审批人","b2.common.approver")}},[n("el-input-number",{attrs:{min:1,step:1,controls:!1,"controls-position":"both",placeholder:e.$z("审批人","b2.common.approver")+" ID"},model:{value:e.curVal.auditor,callback:function(t){e.$set(e.curVal,"auditor",t)},expression:"curVal.auditor"}}),e._v(" "),n("el-input",{staticStyle:{"margin-top":"10px"},attrs:{placeholder:e.$z("审批人","b2.common.approver")+" "+e.$z("用户名","c.user_name")},model:{value:e.curVal.auditor_name,callback:function(t){e.$set(e.curVal,"auditor_name",t)},expression:"curVal.auditor_name"}})],1):e._e()],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.opened=!1}}},[e._v(e._s(e.$z("取消","c.cancel")))]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1)])],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642),c=n(2554);l().use(d.Dialog),l().use(d.DatePicker),l().use(c.default);var u={data(){return{curVal:{result:1,judgment:"",photos:[],reject_target:"",signature:"",auditor_name:"",audit_at:"",auditor:""},isOpenAudit:!1,opened:!1,dispMode:"nolink",auditFormat:"yyyy-MM-dd HH:mm:ss",userList:[]}},props:["type","value","fieldConf","row","dm","container"],computed:{useDetail(){return!!o().get(this.fieldConf,"detail_allow",null)&&!!o().get(this.fieldConf,"detail_deny",null)},resultColor(){let e=o().get(this.curVal,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=o().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},getViewFont(){let e=o().get(this.value,"result",-1),t=1==e?"通过":-1==e?"未审批":"不通过";return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.text","通过"):-1==e?"未审批":o().get(this.fieldConf,"detail_deny.text","不通过")),t},judgment(){let e=o().get(this.value,"result",-1),t=o().get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.judgment"):o().get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.judgment||"must"==this.judgment},denyColor(){let e=o().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},signature(){let e=o().get(this.value,"result",-1),t=o().get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.signature"):o().get(this.fieldConf,"detail_deny.signature")),t},showSignature(){return"yes"==this.signature||"must"==this.signature},photo(){let e=o().get(this.value,"result",-1),t=o().get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.photo"):o().get(this.fieldConf,"detail_deny.photo")),t},showPhoto(){return"yes"==this.photo||"must"==this.photo},isJudgmentMust(){return"must"==this.judgment},isSignatureMust(){return"must"==this.signature},isPhotoMust(){return"must"==this.photo},isRequired(){return o().get(this.fieldConf,"check.required")},getCanvasBoxStyle(){return{height:"150px",width:"100%"}}},created(){this.loadProjBaseInfo()},mounted(){if(this.value){let e=o().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=o().merge(this.curVal,e)}this.useDetail&&(this.selectOptions=[{label:o().get(this.fieldConf,"detail_allow.text","通过"),value:1},{label:o().get(this.fieldConf,"detail_deny.text","不通过"),value:2}])},methods:{onHide(){this.opened=!1,this.showForm=!1},onOpen(){if(this.value){let e=o().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=o().merge(this.curVal,e)}},async onSubmit(){let e=this.curVal;if(this.isRequired&&!e.result)return void this.$q.notify({message:"请选择审批结果",position:"top",type:"warning"});if(this.isSignatureMust&&!e.signature)return void this.$q.notify({message:"请完成签名",position:"top",type:"warning"});if(this.isJudgmentMust&&!e.judgment)return void this.$q.notify({message:"请填写意见",position:"top",type:"warning"});if(this.isPhotoMust&&o().isEmpty(e.photos))return void this.$q.notify({message:"请至少上传一张图片",position:"top",type:"warning"});let t={result:e.result,signature:e.signature,judgment:e.judgment,photos:e.photos,audit_at:e.audit_at/1e3,auditor:e.auditor,auditor_name:e.auditor_name};this.$emit("change",t),this.$emit("input",t),this.opened=!1},getRejectTarget(e){return"last_id"==e?{type:"RejectToLastUserNode"}:e},async loadProjBaseInfo(){let e=1==(await this.$bpm.getBaseSetting("open_audit")).value;this.isOpenAudit=e;let t=await this.$bpm.getBaseSetting("audit_dt_fmt");this.auditFormat=t.value||this.auditFormat}}},m=n(4486),f=(0,m.A)(u,i,[],!1,null,null,null);f.options.__file="components/lib/bpmAudit/src/part/editor.vue";var h=f.exports,p=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"audit-reader"},[n("div",[n("div",[e.useDialog?n("div",{on:{click:function(t){e.opened=!0}}},[n("span",{staticClass:"aduit-result-title",style:{background:e.resultColor,color:e.resultColor?"#fff":"#333",cursor:"pointer"}},[e._v(e._s(e.getViewFont)+" "),n("i",{staticClass:"el-icon-arrow-right",staticStyle:{"font-size":"14px"}})])]):n("div",[n("AuditReaderDetail",{attrs:{value:e.value,"field-conf":e.fieldConf,"result-color":e.resultColor,"get-view-font":e.getViewFont,"show-judgment":e.showJudgment,"show-signature":e.showSignature,"show-photo":e.showPhoto}})],1)])]),e._v(" "),e.showSignature||e.showJudgment||e.showPhoto?n("el-dialog",{staticClass:"audit-modal read-audit",attrs:{visible:e.opened,modal:!1,width:"40%",ok:!1,title:e.fieldConf.name},on:{"update:visible":function(t){e.opened=t},close:e.onHide}},[n("div",[n("AuditReaderDetail",{attrs:{value:e.value,"field-conf":e.fieldConf,"result-color":e.resultColor,"get-view-font":e.getViewFont,"show-judgment":e.showJudgment,"show-signature":e.showSignature,"show-photo":e.showPhoto}})],1)]):e._e()],1)};p._withStripped=!0;var g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.value?n("el-form",{staticClass:"audit-modal-content",attrs:{"label-width":"150px"}},[n("el-form-item",{attrs:{label:e.$z("审批结果","b2.common.approval_results"),required:!0}},[n("span",{staticClass:"aduit-result-title",style:{background:e.resultColor,color:e.resultColor?"#fff":"#333"}},[e._v(e._s(e.getViewFont))])]),e._v(" "),e.value&&e.value.reject_target?n("el-form-item",{attrs:{label:e.$z("回退节点","b2.common.fallback_node"),required:!0}},[e._v("\n "+e._s(e.value.reject_target.name||e.$z("上一个节点","b2.common.previous_node"))+"\n ")]):e._e(),e._v(" "),e.showJudgment?n("el-form-item",{attrs:{label:e.$z("审批意见","b2.common.approval_comment"),required:e.isJudgmentMust}},[n("span",{attrs:{title:e.value&&e.value.judgment}},[e._v("\n "+e._s(e.value&&e.value.judgment?e.value.judgment:e.$z("无","c.none")))])]):e._e(),e._v(" "),e.showPhoto&&e.value.photos&&e.value.photos.length?n("el-form-item",{attrs:{label:e.$z("拍照","b2.common.photograph"),required:e.isPhotoMust}},[n("bpm-mul-image",{attrs:{value:e.value.photos,fieldConf:{type:"MulImage"}}})],1):e._e(),e._v(" "),e.showSignature&&e.value.signature?n("el-form-item",{attrs:{label:e.$z("签名","b2.common.sign"),required:e.isSignatureMust}},[n("bpm-mul-image",{attrs:{value:e.value.signature,fieldConf:{type:"Signature"}}})],1):e._e(),e._v(" "),n("el-form-item",{attrs:{label:e.$z("审批人","b2.common.approver")}},[e._v(e._s(e.auditorName))]),e._v(" "),n("el-form-item",{attrs:{label:e.$z("审批时间","b2.common.processing_time")}},[e._v(e._s(e.auditAt))])],1):e._e()],1)};g._withStripped=!0;var y=n(4709),b=n.n(y),v={name:"AuditReaderDetail",props:["value","fieldConf","resultColor","getViewFont","showJudgment","showSignature","showPhoto"],data(){return{}},computed:{isJudgmentMust(){return"must"==_.get(this.fieldConf,"judgment")},isSignatureMust(){return"must"==_.get(this.fieldConf,"signature")},isPhotoMust(){return"must"==_.get(this.fieldConf,"photo")},auditAt(){let e=_.get(this.value,"audit_at");if(e)return e*=1e3,b().format(e,"YYYY-MM-DD HH:mm:ss")},auditorName(){return _.get(this.value,"auditor_name")}}},w=(0,m.A)(v,g,[],!1,null,null,null);w.options.__file="components/lib/bpmAudit/src/part/reader-detail.vue";var M=w.exports;l().use(d.Dialog),l().use(c.default);var L={components:{AuditReaderDetail:M},props:["value","fieldConf","row","uiType"],data(){return{opened:!1}},computed:{useDetail(){return!!o().get(this.fieldConf,"detail_allow",null)&&!!o().get(this.fieldConf,"detail_deny",null)},resultColor(){let e=o().get(this.value,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=o().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},denyColor(){let e=o().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},getViewFont(){let e=o().get(this.value,"result",-1),t=1==e?"通过":-1==e?"未审批":"不通过";return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.text","通过"):-1==e?"未审批":o().get(this.fieldConf,"detail_deny.text","不通过")),t},hasAudited(){return-1!=o().get(this.value,"result",-1)},showJudgment(){let e=o().get(this.fieldConf,"judgment");return"yes"==e||"must"==e},showSignature(){let e=o().get(this.fieldConf,"signature");return"yes"==e||"must"==e},showPhoto(){let e=o().get(this.fieldConf,"photo");return"yes"==e||"must"==e},isRequired(){return o().get(this.fieldConf,"check.required")},modalShow(){return(this.showSignature||this.showJudgment||this.showPhoto)&&this.hasAudited},useDialog(){return"table"===this.uiType}},mounted(){},methods:{onHide(){this.opened=!1}}},k=(0,m.A)(L,p,[],!1,null,null,null);k.options.__file="components/lib/bpmAudit/src/part/reader.vue";var S=k.exports,D=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.componentName,{tag:"component",attrs:{field:e.fieldConf,fieldConf:e.fieldConf,row:e.row,container:e.container},on:{change:e.changeVal},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})};D._withStripped=!0;var x=function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"audit-with-others"})};x._withStripped=!0;var Y={props:["value","fieldConf","row","container","dispMode"],components:{},data(){return{opened:!1,degree:0,selectOptions:[{label:zj.z("通过","b2.common.pass"),value:1},{label:zj.z("不通过","b2.common.fail"),value:2}],canvasBox:null,form:{result:1,judgment:"",photos:[],reject_target:""},hasDraw:!1,openLastSign:!1,lastSign:"",useNextUser:!1}},computed:{useDetail(){return!!_.get(this.fieldConf,"detail_allow",null)&&!!_.get(this.fieldConf,"detail_deny",null)},jucdgment(){let e=this.form.result,t=_.get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?_.get(this.fieldConf,"detail_allow.judgment"):_.get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.jucdgment||"must"==this.jucdgment},resultColor(){let e=_.get(this.value,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=_.get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},denyColor(){let e=_.get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},signature(){let e=this.form.result,t=_.get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?_.get(this.fieldConf,"detail_allow.signature"):_.get(this.fieldConf,"detail_deny.signature")),t},showSignature(){return"yes"==this.signature||"must"==this.signature},photo(){let e=this.form.result,t=_.get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?_.get(this.fieldConf,"detail_allow.photo"):_.get(this.fieldConf,"detail_deny.photo")),t},showPhoto(){return"yes"==this.photo||"must"==this.photo},isJudgmentMust(){return"must"==this.judgment},isSignatureMust(){return"must"==this.signature},isPhotoMust(){return"must"==this.photo},isRequired(){return _.get(this.fieldConf,"check.required")},getViewFont(){let e=_.get(this.value,"result",-1),t=1==e?zj.z("通过","b2.common.pass"):-1==e?"":zj.z("不通过","b2.common.fail");return this.useDetail&&(t=1==e?_.get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")):-1==e?"":_.get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail"))),t},getCanvasBoxStyle(){return{height:"150px",width:"100%"}},componentName(){return"MulImagePc"},userId(){return _.get(this.$bpm.userInfo,"user_id",0)},userName(){return _.get(this.$bpm.userInfo,"user_name","")},rejectTargetMap(){let e=_.get(this.container,"formSchema.reject_targets");return _.keyBy(e,"node")},rejectTargetList(){let e=_.get(this.container,"formSchema.reject_targets"),t=_.get(this.container,"_formData.passed_nodes"),n=[];return _.each(e,(e=>{_.includes(t,e.node)&&e.only_passed?n.push({label:e.name,value:e.node}):n.push({label:e.name||zj.z("上一个节点","b2.common.previous_node"),value:e.node||"last_id"})})),n}},mounted(){this.container.$on("afterFormSubmit",(e=>{!e&&this.openLastSign&&this.value.signature&&this.$bpm.postEleSign(this.value.signature,this.useNextUser)})),this.useDetail&&(this.selectOptions=[{label:_.get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")),value:1},{label:_.get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail")),value:2}])},methods:{onHide(){this.opened=!1},onOpen(){this.draw||(this.value&&(this.form=this.value),setTimeout((()=>{this.useNextUser=!1,this.handleInit()}),200))},handleInit(){if(!this.showSignature)return;let e=this.$bpm.userSign;this.openLastSign=e.open,this.openLastSign&&!this.form.signature&&e.for_next_use&&(this.form.signature=e.signature),e.for_next_use&&(this.lastSign=e.signature),e.for_next_use&&this.openLastSign&&(this.useNextUser=!0)},onDataLoaded(e){this.resetForm();let t={result:1,judgment:"",photos:[],reject_target:""};this.$emit("input",t),this.$emit("change",t),this.hasDraw=!1,this.draw&&this.draw.clear()},clearSignature(){this.hasDraw=!1,this.draw&&this.draw.clear(),this.lastSign=""},resetForm(){this.form={result:1,judgment:"",photos:[]}},async loadUserInfo(){this.$bpm.networking=!0;let e=await this.$bpm.requestAppendOrgParams({url:"/uc/common/user_info/",params:zj.utils.pageParam()});e=_.get(e,"data.data"),this.$bpm.networking=!1,console.log("info",e.user_info),this.$bpm.setUserInfo(e.user_info)},async onSubmit(){let e=this.form;if(!(zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId))return this.loadUserInfo(),void this.$message({message:zj.z("当前网络加载有问题,请重新进入","b2.common.network_err"),type:"warning"});if(2!=e.result||!this.showReject||e.reject_target)if(!this.isRequired||this.form.result)if(!this.isSignatureMust||this.form.signature||this.hasDraw)if(!this.isJudgmentMust||this.form.judgment||this.hasDraw)if(this.isPhotoMust&&_.isEmpty(this.form.photos))this.$message({message:zj.z("请至少上传一张图片","b2.common.least_one_image"),type:"warning"});else if(this.hasDraw){let t=this.draw.getPNGImage();this.uploadImage({basestr:t,type:"png",name:"签名图片.png",model:"userfile"},(t=>{let n={result:e.result,signature:t,judgment:e.judgment,photos:e.photos,audit_at:(new Date).getTime()/1e3,auditor:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId,auditor_name:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_name||this.userName};2==e.result&&this.showReject&&_.set(n,"reject_target",this.getRejectTarget(e.reject_target)),this.field.value=n,this.opened=!1}))}else{let t={result:e.result,signature:e.signature,judgment:e.judgment,photos:e.photos,audit_at:(new Date).getTime()/1e3,auditor:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId,auditor_name:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_name||this.userName};2==e.result&&this.showReject&&_.set(t,"reject_target",this.getRejectTarget(e.reject_target)),this.field.value=t,this.opened=!1}else this.$message({message:zj.z("请填写意见","b2.common.please_fill_comment"),type:"warning"});else this.$message({message:zj.z("请完成签名","b2.common.please_complete_sign"),type:"warning"});else this.$message({message:zj.z("请选择审批结果","b2.common.please_select_audit"),type:"warning"});else this.$message({message:zj.z("回退节点必填","b2.common.back_to_required"),type:"warning"})},getRejectTarget(e){let t=this.rejectTargetMap;return"last_id"==e?{type:"RejectToLastUserNode"}:_.get(t,e)},uploadImage({basestr:e,type:t,name:n,model:a},i){let r=window.atob(e.split(",")[1]),o=new ArrayBuffer(r.length),s=new Uint8Array(o);for(let e=0;e<r.length;e++)s[e]=r.charCodeAt(e);let l,d=window.WebKitBlobBuilder||window.MozBlobBuilder;if(d){let e=new d;e.append(o),l=e.getBlob(t)}else l=new window.Blob([o],{type:t});let c=new FormData;c.append(a,l,n),zj.net.w.noapi({method:"POST",url:"/platform/v1/papi/app_file/upload/",data:c,processData:!1,contentType:!1}).then((e=>{i&&i(e.file_md5)}))},handleSpeechToText(e){this.$refs.input.blur(),e.cancelBubble=!0,e.stopPropagation(),this.$bpm.getSpeechToText((e=>{e.text&&this.$set(this.form,"judgment",(this.form.judgment||"")+e.text)}))}}},T=(n(2487),n(8601),n(968),(0,m.A)(Y,x,[],!1,null,"1f4bc398",null));T.options.__file="components/lib/bpmAudit/src/part/auditor/audit-with-others.vue";var C=T.exports,j=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-select",{attrs:{placeholder:e.$z("请选择回退节点","b2.common.select_back_to")},model:{value:e.form.result,callback:function(t){e.$set(e.form,"result",t)},expression:"form.result"}},e._l(e.selectOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)};j._withStripped=!0;var $={props:["value","fieldConf","row","container"],data(){return{selectOptions:[{label:zj.z("通过","b2.common.pass"),value:1},{label:zj.z("不通过","b2.common.fail"),value:2}],form:{result:"",reject_target:""}}},computed:{userId(){return _.get(this.$bpm.userInfo,"user_id",0)},userName(){return _.get(this.$bpm.userInfo,"user_name","")},rejectTargetMap(){let e=_.get(this.field,"topContainer.formSchema.reject_targets");return _.keyBy(e,"node")},rejectTargetList(){let e=_.get(this.field,"topContainer.formSchema.reject_targets"),t=_.get(this.field,"topContainer._formData.passed_nodes"),n=[];return _.each(e,(e=>{_.includes(t,e.node)&&e.only_passed?n.push({label:e.name,value:e.node}):n.push({label:e.name||zj.z("上一个节点","b2.common.previous_node"),value:e.node||"last_id"})})),n}},watch:{form:{handler(e){if(!(zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId))return this.loadUserInfo(),void this.$message({message:zj.z("当前网络加载有问题,请重新进入","b2.common.network_err"),type:"warning"});if(2==e.result&&this.showReject&&!e.reject_target)return void this.$message({message:zj.z("回退节点必填","b2.common.back_to_required"),type:"warning"});let t={result:e,signature:"",audit_at:(new Date).getTime()/1e3,auditor:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId,auditor_name:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_name||this.userName};2==e.result&&this.showReject&&_.set(t,"reject_target",this.getRejectTarget(e.reject_target)),this.$emit("change",t),this.$emit("input",t)},deep:!0}},methods:{onDataLoaded(e){this.form.result=_.get(this.field.value,"result","")},getRejectTarget(e){let t=this.rejectTargetMap;return"last_id"==e?{type:"RejectToLastUserNode"}:_.get(t,e)}}},P=(n(744),(0,m.A)($,j,[],!1,null,"2709dffc",null));P.options.__file="components/lib/bpmAudit/src/part/auditor/audit-select.vue";var I=P.exports,F=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"audit-new"},[n("div",{staticClass:"submit-btns-container"},[n("el-button",{attrs:{disabled:e.submiting},on:{click:function(t){return e.doOperation(2)}}},[e._v(e._s(e.selectOptions[1].label))]),e._v(" "),n("el-button",{attrs:{type:"primary",disabled:e.submiting},on:{click:function(t){return e.doOperation(1)}}},[e._v(e._s(e.selectOptions[0].label))])],1),e._v(" "),n("el-dialog",{staticClass:"audit-modal",attrs:{visible:e.openAuditDlg,modal:!1,center:"",width:"60%",title:e.getViewFont},on:{"update:visible":function(t){e.openAuditDlg=t},close:e.onHide,open:e.onOpen}},[n("div",[n("el-form",{ref:"form",staticClass:"audit-modal-content",attrs:{model:e.form,"label-width":"150px"}},[2==e.form.result&&e.showReject?n("el-form-item",{attrs:{label:e.$z("回退节点","b2.common.fallback_node"),required:!0,prop:"reject_target"}},[n("el-select",{attrs:{placeholder:""},model:{value:e.form.reject_target,callback:function(t){e.$set(e.form,"reject_target",t)},expression:"form.reject_target"}},e._l(e.rejectTargetList,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),e._v(" "),e._l(e.optAss,(function(t){return n(t.component,{key:t.id,tag:"component",attrs:{conf:t,container:e.container}})})),e._v(" "),n("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.showSignature,expression:"showSignature"}],attrs:{required:e.isSignatureMust,label:e.$z("签名","b2.common.sign"),prop:"signature"}},[n("bpm-signature",{ref:"signature",attrs:{container:e.container},model:{value:e.form.signature,callback:function(t){e.$set(e.form,"signature",t)},expression:"form.signature"}})],1),e._v(" "),e.showJudgment?n("el-form-item",{attrs:{required:e.isJudgmentMust,label:e.$z("填写意见","b2.common.fill_comment"),prop:"judgment"}},[n("el-input",{attrs:{type:"textarea",placeholder:e.$z("请输入评审意见","b2.common.en_comment"),clearable:!!e.form.judgment},model:{value:e.form.judgment,callback:function(t){e.$set(e.form,"judgment",t)},expression:"form.judgment"}})],1):e._e(),e._v(" "),e.showPhoto?n("el-form-item",{attrs:{label:e.$z("拍照","b2.common.photograph"),required:e.isPhotoMust,prop:"photos"}},[n("bpm-mul-image",{attrs:{fieldConf:{type:"MulImage"},mode:"edit"},model:{value:e.form.photos,callback:function(t){e.$set(e.form,"photos",t)},expression:"form.photos"}})],1):e._e(),e._v(" "),e.isOpenAudit?n("el-form-item",{attrs:{required:"",label:e.$z("审批日期","b2.common.audit_date"),prop:"auditTime"}},[n("el-date-picker",{ref:"dateSelect",attrs:{type:"datetime",placeholder:e.$z("选择日期时间","c.select_date_time"),format:e.auditTimeFormat},model:{value:e.form.auditTime,callback:function(t){e.$set(e.form,"auditTime",t)},expression:"form.auditTime"}})],1):e._e()],2)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{disabled:!e.isSimulation&&e.submiting},on:{click:e.onCancel}},[e._v(e._s(e.$z("取消","c.cancel")))]),e._v(" "),n("el-button",{attrs:{type:"primary",disabled:!e.hasDraw},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1)])],1)};F._withStripped=!0;var E=n(1824);l().use(d.Dialog),l().use(d.DatePicker),l().use(c.default),l().use(E.default);var O={data(){return{curVal:{result:1,judgment:"",photos:[],reject_target:"",signature:"",auditor_name:"",audit_at:"",auditor:""},openAuditDlg:!1,result:1,form:{result:1,judgment:"",photos:[],signature:"",auditTime:(new Date).getTime()},passForm:{result:1,judgment:"",signature:"",photos:[],auditTime:(new Date).getTime()},notPassForm:{result:2,judgment:"",photos:[],signature:"",reject_target:"",auditTime:(new Date).getTime()},canvasBox:null,degree:0,submiting:!1,openLastSign:!1,lastSign:"",useNextUser:!1,selectOptions:[{label:zj.z("通过","b2.common.pass"),value:1},{label:zj.z("不通过","b2.common.fail"),value:2}],optAss:[],isOpenAudit:!1,auditTimeFormat:"yyyy-MM-dd HH:mm:ss"}},props:["value","fieldConf","row","container"],computed:{useDetail(){return!!o().get(this.fieldConf,"detail_allow",null)&&!!o().get(this.fieldConf,"detail_deny",null)},judgment(){let e=this.result,t=o().get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.judgment"):o().get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.judgment||"must"==this.judgment},signature(){let e=this.result,t=o().get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.signature"):o().get(this.fieldConf,"detail_deny.signature")),t},allowColor(){let e=o().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?"primary":e},denyColor(){let e=o().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?"primary":e},showSignature(){return"yes"==this.signature||"must"==this.signature},photo(){let e=this.result,t=o().get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.photo"):o().get(this.fieldConf,"detail_deny.photo")),t},showPhoto(){return"yes"==this.photo||"must"==this.photo},isJudgmentMust(){return"must"==this.judgment},isSignatureMust(){return"must"==this.signature},isPhotoMust(){return"must"==this.photo},showOpDialog(){return this.showSignature||this.showJudgment||this.showPhoto||2===this.result&&this.showReject||this.optAss.length},getCanvasBoxStyle(){return{height:"150px",width:"100%"}},componentName(){return"MulImage"},isMobile(){return this.$q.platform.is.mobile},getViewFont(){let e=this.result,t=1==e?zj.z("通过","b2.common.pass"):-1==e?"":zj.z("不通过","b2.common.fail");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")):-1==e?"":o().get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail"))),t},userId(){return o().get(this.$bpm.userInfo,"user_id",0)},userName(){return o().get(this.$bpm.userInfo,"user_name","")},showReject(){return!!o().get(this.container,"formSchema.reject_targets")},rejectTargetMap(){let e=o().get(this.container,"formSchema.reject_targets");return o().keyBy(e,"node")},rejectTargetList(){console.log("this.container",this.container);let e=o().get(this.container,"formSchema.reject_targets"),t=o().get(this.container,"_formData.passed_nodes"),n=[];return o().each(e,(e=>{o().includes(t,e.node)&&e.only_passed?n.push({label:e.name,value:e.node}):e.only_passed||n.push({label:e.name||zj.z("上一个节点","b2.common.previous_node"),value:e.node||"last_id"})})),n},isSimulation(){return this.$bpm.isSimulation},hasDraw(){return!this.isSignatureMust||!!this.form.signature}},created(){this.loadProjBaseInfo()},mounted(){if(this.value){let e=o().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=o().merge(this.curVal,e)}this.useDetail&&(this.selectOptions=[{label:o().get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")),value:1},{label:o().get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail")),value:2}])},methods:{onHide(){this.openAuditDlg=!1},onOpen(){if(1==this.result)this.form=o().cloneDeep(this.passForm),this.form.result=1;else if(this.form=o().cloneDeep(this.notPassForm),this.form.result=2,1==this.rejectTargetList.length){let e=o().get(this.rejectTargetList,"0.value");this.form.reject_target=e}else this.form.reject_target="";console.log("this.result",this.result),this.form.auditTime=(new Date).getTime()},async onSubmit(){let e=this.form;console.log("curVal",e),!this.isRequired||e.result?!this.isSignatureMust||e.signature?!this.isJudgmentMust||e.judgment?this.isPhotoMust&&o().isEmpty(e.photos)?this.$message({message:zj.z("请至少上传一张图片","b2.common.least_one_image"),type:"warning"}):(this._dealSubmit(e),this.openAuditDlg=!1):this.$message({message:zj.z("请填写意见","b2.common.please_fill_comment"),type:"warning"}):this.$message({message:zj.z("请完成签名","b2.common.please_complete_sign"),type:"warning"}):this.$message({message:zj.z("请选择审批结果","b2.common.please_select_audit"),type:"warning"})},_dealSubmit(e){let t={result:e.result,signature:e.signature,judgment:e.judgment,photos:e.photos,audit_at:e.auditTime/1e3,auditor:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId,auditor_name:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_name||this.userName};2==e.result&&this.showReject&&o().set(t,"reject_target",this.getRejectTarget(e.reject_target)),this.curVal=t,console.log("audit_value",t),this.$emit("change",this.curVal),console.log("this.container",this.container);let n=this.container.$parent;if(console.log("audit_modal",n),n){this.submiting=!0;try{2==this.result?n.doOperation(null,{needValidation:!1}):n.doOperation()}catch(e){console.log("error",e),this.submiting=!1}this.$bpm.$on("afterFormSubmit",(({mode:e,errors:t})=>{t||(console.log("BpmAudit New $bpm afterFormSubmit"),this.openAuditDlg=!1),this.submiting=!1}))}},getRejectTarget(e){let t=this.rejectTargetMap;return"last_id"==e?{type:"RejectToLastUserNode"}:o().get(t,e)},onCancel(){this.openAuditDlg=!1},async loadProjBaseInfo(){let e=1==(await this.$bpm.getBaseSetting("open_audit")).value;this.isOpenAudit=e;let t=await this.$bpm.getBaseSetting("audit_dt_fmt");this.auditFormat=t.value||this.auditFormat},async loadUserInfo(){let e=await this.$bpm.requestAppendOrgParams({url:"/uc/common/user_info/",params:zj.utils.pageParam()});e=o().get(e,"data.data"),this.$bpm.setUserInfo(e.user_info)},async doOperation(e){console.log("this.fieldConf",this.fieldConf),this.result=e,setTimeout((()=>{let t=o().get(this.fieldConf,`opt_ass.${e}`),n=o().map(t,(e=>o().get(this.container,`eleMap.${e}`)));n=o().compact(n),this.optAss=n;let a=o().concat(t,this.fieldConf.id);a=o().compact(a),console.log("excludeElemIds",a),this.container.verfifyData(a,(()=>{this.$nextTick((()=>{this.showOpDialog?this.openDialog():this.confirmOp()}))}))}),100)},openDialog(){this.openAuditDlg=!0,this.useNextUser=!1,setTimeout((()=>{this.$refs.signature&&(this.$refs.signature.initCanvas(),this.$refs.signature.handleInit())}),200)},confirmOp(){let e=1==this.result?this.selectOptions[0].label:this.selectOptions[1].label,t=zj.z("是否确认","b2.common.is_confirm")+e+zj.z("?","c.question_mark");this.form.auditTime=(new Date).getTime(),this.$confirm(t,e,{confirmButtonText:zj.z("确定","c.confirm"),cancelButtonText:zj.z("取消","c.cancel"),type:"warning"}).then((()=>{this._dealSubmit(this.form)})).catch((()=>{}))}}},A=(0,m.A)(O,F,[],!1,null,null,null);A.options.__file="components/lib/bpmAudit/src/part/auditor/audit-new.vue";var H={props:["value","fieldConf","row","container"],components:{AuditWithOthers:C,AuditSelect:I,AduitNew:A.exports},data(){return{curVal:{result:1,judgment:"",photos:[],reject_target:"",signature:"",auditor_name:"",audit_at:"",auditor:""}}},computed:{componentName(){let e=_.get(this.fieldConf,"signature"),t=_.get(this.fieldConf,"jucdgment"),n=_.get(this.fieldConf,"photo");return"collaboration"==_.get(this.container,"formSchema.audit_style")?"AduitNew":"yes"==e||"must"==e||"yes"==t||"must"==t||"yes"==n||"must"==n?"AuditWithOthers":"AuditSelect"}},mounted(){if(console.log("Auditor_container",this.container),this.value){let e=_.cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=_.merge(this.curVal,e)}},methods:{changeVal(e){this.$emit("input",e),this.$emit("change",e)}}},N=(0,m.A)(H,D,[],!1,null,null,null);N.options.__file="components/lib/bpmAudit/src/part/auditor.vue";var R=N.exports,z={name:"BpmAudit",components:{editorComponent:h,readerComponent:S,auditorComponent:R},props:{value:{type:[Object]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},container:{type:[Object,null],default(){return null}},dm:Boolean},computed:{curComponent(){return"view"==this.mode?S:this.dm?h:R}},data(){return{curVal:{}}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{onChange(e){console.log("onChange",_.cloneDeep(e)),this.$emit("input",e),this.$emit("change",e)}}},V=(n(1962),(0,m.A)(z,a,[],!1,null,null,null));V.options.__file="components/lib/bpmAudit/src/main.vue";var W=V.exports;W.install=function(e){e.component(W.name,W)};var B=W},1933:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,container:e.container,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-date-time-edit"},[n("el-date-picker",{attrs:{placeholder:e.placeholder,format:e.format,"picker-options":e.pickerOptions,"value-format":e.checkFormat,type:e.type,"default-value":e.defaultVal,clearable:e.clearable,disabled:e.disabled},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642);l().use(d.DatePicker);var c={data(){return{curVal:""}},props:["value","fieldConf","row","clearable","disabled","container"],watch:{value(){this.curVal=this.value}},computed:{type(){let e=o().toLower(o().get(this.fieldConf,"type"));return this.isMonth?"month":e},isMonth(){return"C1M"==o().get(this.fieldConf,"range_type")},placeholder(){return this.fieldConf.desc||this.fieldConf.name},format(){let e=o().get(this.fieldConf,"view.format");return e&&(e=e.replaceAll("Y","y"),e=e.replaceAll("D","d")),e},max(){let e=this.analyzeLimit("tmax");return console.log("max_date",e),e},min(){let e=this.analyzeLimit("tmin");return console.log("min_date",e),e},limit(){return o().get(this.fieldConf,"check.limit","")},pickerOptions(){let e=this;return{disabledDate(t){let n=!1,a=t.getDay(),i=t.getDate();if(e.max&&(n=t.getTime()>e.max.getTime()),!n&&e.min&&(n=t.getTime()<e.min.getTime()),!n&&e.limit){let t=e.limit.split(","),r=[],o=[],s=!1;t.forEach((e=>{let t=e.split("|");"W"===t[0]&&r.push(parseInt(t[1])),"M"===t[0]&&o.push(parseInt(t[1]))})),(r.length||o.length)&&(s=r.includes(a)||o.includes(i),n=!s)}return n}}},checkFormat(){let e=o().get(this.fieldConf,"check.format");return e&&(e=e.replaceAll("Y","y"),e=e.replaceAll("D","d")),e},defaultVal(){return new Date}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)},analyzeLimit(e){console.log("this.fieldConf",this.fieldConf);let t=o().get(this.fieldConf,`check.${e}`);if(!t)return;let n=null,a=(new Date).getTime();switch(t.type){case"LimitDateOffset":var i=t.offset_days;n=this.deltaToDate(a,i);break;case"LimitDateOffsetByField":console.log("container",this.container);var r=t.offset_days,s=o().get(this.container,`formData.${t.field}`);if(!s)return 0;n=this.deltaToDate(s,r);break;case"LimitDateByValue":var l=t.value;l=new Date(l).getTime(),this.deltaToDate(l,0)}return n},deltaToDate(e,t){let n=(e=new Date(e)).getDate()+t;return e.setDate(n),e.setHours(0,0,0,0),e}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmDateTime/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{attrs:{title:e.dateTimeStr}},[e._v(e._s(e.dateTimeStr))])};h._withStripped=!0;var p=n(4709),_=n.n(p),g=n(9795),y={props:["value","fieldConf","row"],data(){return{dateTimeStr:""}},computed:{format(){return o().get(this.fieldConf,"view.format")}},watch:{value(){this.dateTimeStr=this.formatViewTime()}},mounted(){this.dateTimeStr=this.formatViewTime()},methods:{formatViewTime(){let e,t=this.value;return t?(o().isInteger(t)&&13!=o().toString(t).length&&(t*=1e3),(0,g.Fr)()?(t=t.replace(/-/g,"/"),t=t.replace(/T/g," "),t=t.padEnd(10,"/01/01"),e=new Date(t).getTime()):e=new Date(t).getTime(),_().format(e,this.format)):""}}},b=(0,u.A)(y,h,[],!1,null,null,null);b.options.__file="components/lib/bpmDateTime/src/part/reader.vue";var v=b.exports,w={name:"BpmDateTime",components:{editorComponent:f,readerComponent:v},props:{value:{type:[String,Number]},fieldConf:{type:Object,default(){return{}}},container:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},computed:{curComponent(){return"view"==this.mode?v:f}},data(){return{curVal:""}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},M=(0,u.A)(w,a,[],!1,null,null,null);M.options.__file="components/lib/bpmDateTime/src/main.vue";var L=M.exports;L.install=function(e){e.component(L.name,L)};var k=L},9666:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.curComponent?n(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-field",attrs:{type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.fieldMode,uiType:e.uiType,formDefId:e.formDefId,orgInfo:e.orgInfo,dm:e.dm,clearable:e.clearable,disabled:e.fieldDisabled,isMultiple:e.isMul},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};a._withStripped=!0;var i={name:"BpmField",mixins:[n(1464).A]},r=(0,n(4486).A)(i,a,[],!1,null,null,null);r.options.__file="components/lib/bpmField/src/main.vue";var o=r.exports;o.install=function(e){e.component(o.name,o)};var s=o},9335:function(e,t,n){"use strict";n.r(t);var a=n(555);a.A.install=function(e){e.component(a.A.name,a.A)},t.default=a.A},4304:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.curComponent?n(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-field",attrs:{type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.fieldMode,uiType:e.uiType,formDefId:e.formDefId,orgInfo:e.orgInfo,dm:e.dm,clearable:e.clearable,disabled:e.fieldDisabled,isMultiple:e.isMul,container:e.container},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};a._withStripped=!0;var i=n(5554),r=n.n(i),o={name:"BpmFormField",mixins:[n(1464).A,function(){let e={props:["container","rowIndex","isNew","hideLabel"],data(){return{optAssWatchList:[],hasAddOptAssWatch:!1,defaultVal:null,firstListVal:null,loadedDefault:!1}},computed:{isSubForm(){return!1},topContainer(){return this.container.isSubForm?this.container.container:this.container},fieldSelf(){return this},fieldPath(){return this._getFieldPath()},readonly(){return!0},inner(){return this.$bpm.matchInnerComponent(this.fieldConf.type,this.readonly)}},created(){this.topContainer&&(this.topContainer.$once("beforeSchemaLoad",(e=>{this.clearOptAssWatch()})),this.topContainer.$once("dataLoaded",(e=>{this.addOptAssWatch()}))),this.isNew&&!this.hasAddOptAssWatch&&(this.addOptAssWatch(),this.$emit("update:isNew",!1))},methods:{async getConfDefaultValue(){let e=_.get(this.fieldConf,"default.value.type");e=e||_.get(this.fieldConf,"default.value.type");let t=_.get(this.fieldConf,"default.value.value"),n=_.get(this.fieldConf,"default.type");return this.defaultVal||this.loadedDefault?this.defaultVal:("EVCConfig"==n&&(t=_.get(this.fieldConf,"default.value"),this.defaultVal=t),"EVCExpression"==e||"EVCExpression"==n?(this.defaultVal=await this.$bpm.loadValDefault({fieldId:this.fieldConf.id,params:{},cusFormName:this.container.cusFormId,container:this.container}),this.loadedDefault=!0,this.defaultVal):("EVCFirstElem"==_.get(this.fieldConf,"default.value.type")&&(t=this.firstListVal),this.defaultVal=t,this.loadedDefault=!0,t))},getTypeValidEmptyValue(){let e=this.fieldConf.value_type,t=this.fieldConf.type;switch(e){case"int":return 0;case"struct":return"Mul"==t.substr(0,3)||"OnlineEditor"==t||this.isSubForm?[]:{};default:return"Mul"==t.substr(0,3)||"OnlineEditor"==t||this.isSubForm?[]:""}},removeValue(){let e=this.container,t=e.value;e.isSubForm&&(t=_.get(t,[this.rowIndex])),t&&(this.value=null)},_getFieldPath(e=!1){return this.container.isSubForm?e?[this.container.fieldConf.id,this.rowIndex,this.fieldConf.id]:[this.rowIndex,this.fieldConf.id]:[this.fieldConf.id]},_getValue(){console.log("this.container",this.container);let e="";return this.container&&(e=_.get(this.container.value,this.fieldPath)),e},isPromise(e){return!!e&&"function"==typeof e.then},_setValue(e){let t=this.container,n=_.cloneDeep(t.value);if(t.isQuote)return;let a=_.last(this.fieldPath);if(t.isSubForm){n||(n=[]);let i=this.rowIndex;if(n[i])return void this.$set(t.value[i],a,e);t.isXSubForm?r().set(n,i,t.getItem(i)):r().set(n,i,{}),n=n[i];try{r().set(t.value,i,n)}catch(e){console.log("error",t.value)}}else r().set(t.value,a,e),console.log("container.value",t.value,a,e)},clearOptAssWatch(){this.hasAddOptAssWatch=!1,_.each(this.optAssWatchList,(e=>{e()}))},addOptAssWatch(){this.hasAddOptAssWatch=!0;let e=_.get(this.fieldConf,"optAssMap"),t=_.get(this.fieldConf,"perm.visible");if(!e||_.isEmpty(e)||!t)return;let n=0;_.map(e,((t,a)=>{a=_.replace(a,"&",".");let i=this.$watch(`row.f_fields.${a}`,(t=>{let n=!0;_.map(e,((e,t)=>{t=_.replace(t,"&",".");let a=_.get(this.row,`f_fields.${t}`);a=_.toString(a),n=n&&_.includes(e,a)})),this.fieldConf.perm.visible=n}),{immediate:0==n});n++,this.optAssWatchList.push(i)}))}}};return _.merge(e,{data(){return{unWatchList:[],valueUnWatch:null,valDependIds:[],selectDependIds:[],remoteDependIds:[],selectFields:null,selectList:[],quoteContent:{},unSelectDependValWatchList:[],optAssWatchList:[],hasAddOptAssWatch:!1,scopeDependIds:[],subFormOldValMap:{},isDelete:!1,displayHidden:!1,differenceRowIndexs:[],topContainerMode:null,nextRely:null,loading:!1,firstFill:!0,hasFillDefault:!1,remoteData:[]}},created(){this.topContainer&&(this.topContainer.$once("beforeDataLoad",(e=>{this.toggleValueWatch(!1),this.clearOptAssWatch()})),this.topContainer.$once("dataLoaded",(e=>{this.getMemory(),this.addOptAssWatch()})),this.topContainer.$once("beforeReloadData",(e=>{this.toggleValueWatch(!1)}))),this.container.isSubForm&&(this.getMemory(),this.addOptAssWatch(),this.$emit("update:isNew",!1)),this.$bpm.$on("beforeFormSubmit",(({mode:e,formData:t,cc:n,_formData:a})=>{let i=this._getFieldPath(!0);console.log("beforeFormSubmit_fieldPath",i);let r=_.get(a,i);console.log("beforeFormSubmit_initVal",r);let o=_.get(this.fieldConf,"check.required",!1);if(console.log("beforeFormSubmit_required",o),console.log("beforeFormSubmit_fieldConf",this.fieldConf),console.log("beforeFormSubmit_value",this.value),(_.isNull(this.value)&&o||"SelectHouseOwner"==this.fieldConf.type&&(!this.value.name||!this.value.phone)&&o)&&(console.log("beforeFormSubmit_value",this.value),console.log("beforeFormSubmit_清掉-1",i),_.unset(t,i)),_.isArray(this.value)&&_.isEmpty(this.value)||_.isNil(this.value)||""==this.value&&0!==this.value){let e=_.get(this.fieldConf,"check.min_length");e=e||_.get(this.fieldConf,"check.min"),e=e||_.get(this.fieldConf,"check.min_count"),console.log("beforeFormSubmit_size",e),e||o||!r||(_.unset(t,i),console.log("beforeFormSubmit_清掉-2",i))}let s=this.container,l=s.isSubForm,d=_.get(this.fieldConf,"optAssMap");if(console.log("beforeFormSubmit_optAssMap",d),d&&!_.isEmpty(d)){let e=!0;_.map(d,((n,a)=>{console.log("beforeFormSubmit_visibleVals",n),console.log("beforeFormSubmit_before_field",a),a=a.replace(/&/g,"."),console.log("beforeFormSubmit_after_field",a);let r=_.split(a,".");console.log("beforeFormSubmit_before_relField",r),r=_.last(r),console.log("beforeFormSubmit_after_relField",r);let o=_.get(this.elementMap,`${r}.type`);console.log("beforeFormSubmit_typ",o);let d=!!o&&"Mul"==o.substr(0,3);console.log("beforeFormSubmit_isMul",d);let c=this._getPath(r);console.log("beforeFormSubmit_path",c),c!=r&&l&&(a=(a=`${s.fieldConf.id}&${this.rowIndex}&${r}`).replace(/&/g,".")),console.log("beforeFormSubmit_form_field",this.form),console.log("beforeFormSubmit_form",this.form),console.log("beforeFormSubmit_formData",t);let u=_.get(t,`${a}`)||_.get(this.form,`formData.${a}`);if(_.isNil(u)){let e=document.getElementById(`${i}`).style.display;console.log("beforeFormSubmit_displayHidden",e),"none"==e&&(console.log("beforeFormSubmit_清掉-4",i),_.unset(t,i))}else{if(console.log("beforeFormSubmit_field",a),console.log("beforeFormSubmit_formData_rely_val",u),d){let t=!1;_.each(u,(e=>{e=_.toString(e),console.log("beforeFormSubmit_formData_isIncludeInMull",t),_.includes(n,e)&&(t=!0)})),e=t}else{let t=_.toString(u);console.log("beforeFormSubmit_toString_value",t),e=e&&_.includes(n,t)}console.log("beforeFormSubmit_isInclude",e)}})),console.log("beforeFormSubmit_isInclude",e),e||(console.log("beforeFormSubmit_清掉-3",i),_.unset(t,i)),console.log("formData",t)}})),this.$bpm.$on("afterFormSubmit",(({mode:e,errors:t})=>{if(!t&&this.memorable){let t=this.fieldConf.id,n=_.get(this.fieldConf,"value_type");this.$bpm.setMemory(e,`${t}.${n}`,this.value)}})),this.$bpm.$on("handeInitRely",(async({id:e,rowIndex:t,oid:n,lastField:a})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||(this.topContainer.isCache?this.openRelyInitLoadOnCache(n,a):this.openInitRelyLoad(n,a))})),this.$bpm.$on("initRelyComplete",(async(e,t)=>{console.log("触发initRelyComplete"),e===this.container&&(this.hasFillDefault||await this.fillDefaultValue(),this.valueUnWatch||await this.toggleValueWatch(!0),this.addOptAssWatch(),t&&this.$emit("valueChanged"))})),this.$bpm.$on("handeRelyById",(({id:e,rowIndex:t,oid:n,lastField:a})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||(console.log("触发handeRelyById",e,n),this.opeRelyById(n,a))}))},provide(){return{getSelectFields:()=>this.selectFields,selectOptions:()=>this.selectList}},destroyed(){this.toggleValueWatch(!1),this.container.isQuote||(this.$bpm.$off("dataLoaded"),this.$bpm.$off("beforeFormSubmit"),this.$bpm.$off("handeInitRely"),this.$bpm.$off("initRelyComplete"),this.$bpm.$off("handeRelyById"))},watch:{"$store.getters.bpmLinkageBridge"(e){_.includes(e.to,this.fieldConf.id)&&(console.log("$store.getters.bpmLinkageBridge",e),e.calc_function&&this.form&&this.form.formData&&(console.log("bridge_link_complete_flag",this.link_complete_flag),this.$nextTick((()=>{console.log("bri_this.value",this.value),setTimeout((()=>{let t=_.cloneDeep(this.value);this.value=e.calc_function(this.form.formData),this.curVal=this.value,this.$emit("input",this.value),this.$emit("change",this.value),this.checkRely(this.value,t)}),3e3)}))))}},computed:{form(){return this.topContainer},isSubForm(){return-1!==this.fieldConf.type.indexOf("SubForm")},readonly(){return!_.get(this.fieldConf,"perm.editable",!1)},disWritable(){return!_.get(this.fieldConf,"perm.editable",!1)&&!_.get(this.fieldConf,"perm.writable",!1)},memorable(){return _.get(this.fieldConf,"perm.memorable",!1)},isDetailMode(){return"detail"==this.form.mode},isDeleteMode(){return"delete"==this.form.mode},elements(){return _.get(this.form,"formSchema.elements",[])},elementMap(){let e={},t=this.elements;return _.each(t,(t=>{_.set(e,t.id,t),_.each(t.elements||[],(n=>{_.set(e,t.id,t)}))})),e},description(){return _.get(this.fieldConf,"desc","")},hideName(){return _.get(this.fieldConf,"display.hide_name",!1)},visualAttrs(){let e=this._getFieldPath(!0).join("."),t=this.form.formErrors,n=!!t&&t[e],a=this.fieldConf,i=[],r=_.get(a,"perm.visible",!1);_.get(a,"check.required",!1)&&!this.isDetailMode&&i.push("q-field-required"),r&&!this.displayHidden||i.push("q-field-hidden"),this.readonly&&i.push("readonly");let o=_.get(this.fieldConf,"display.hide_name",!1),s=_.get(this.fieldConf,"display.is_tip",!1);o&&i.push("hide-name"),s&&i.push("tip-field"),n&&this.scrollToElement();let l=this.$bpm.isVerticalTypography,d=_.includes(["MulImage","SubForm","XSubForm","MulFile","Spliter","Signature"],a.type);return l=l&&!_.includes(["SubForm","XSubForm","Spliter"],a.type),l&&i.push("col-4"),"SelectHouseOwner"==a.type&&i.push("select-house-owner"),{filled:!0,hideHint:!0,disable:!_.get(a,"perm.editable",!0),error:!!n,errorLabel:_.get(n,"message",""),class:i,orientation:d||l?"vertical":"horizontal"}},isRelyId(){return _.includes(this.topContainer.relyIds,this.fieldConf.id)},isVerticalTypography(){return this.$bpm.isVerticalTypography}},mounted(){this.description&&this.insertDesc()},methods:{getMemory(){if(!this.memorable||this.value)return;let e=this.fieldConf.id,t=_.get(this.fieldConf,"value_type");this.topContainerMode=this.topContainer.mode,this.$bpm.checkMemory(this.topContainerMode,(n=>{let a=_.get(n,`f_fields.${e}.${t}`);this.value=a,this.setLocalCache(this.value)}),(()=>{}))},scrollToElement(){},async openRelyInitLoadOnCache(e,t){await this.loadSelectByDepends(),await this.loadRemoteByDepends(!0),this.$emit("valueChanged"),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.loading=!1,this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex,e,t)},async openInitRelyLoad(e,t){await this.loadSelectByDepends(),await this.loadRemoteByDepends(!0),await this.loadRemoteByFieldMap(e),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.$emit("valueChanged"),this.loading=!1,this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex,e,t)},async opeRelyById(e,t){await this.fillDefaultValue(),await this.loadSelectByDepends(),await this.loadRemoteByDepends(),await this.loadRemoteByFieldMap(e),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.loading=!1,this.container.handleNextRelyById&&await this.container.handleNextRelyById(this.rowIndex,e,t)},async getBreakResult(e){let t=this.$bpm.breakRelyMap,n=_.get(t,e);return _.includes(n,this.fieldConf.id)},async fillDefaultValue(){let e=this.topContainer.resetFields;if(_.includes(e,this.fieldConf.id))return this.value=null,this.setLocalCache(this.value),this.loading=!1,void(this.hasFillDefault=!0);if(_.isNil(this.value)){let e=await this.getConfDefaultValue();_.isNil(e)||(this.value=e,this.setLocalCache(this.value))}this.loading=!1,this.hasFillDefault=!0},async getConfDefaultValue(){if("EVCConfig"==_.get(this.conf,"default.value.type"))return _.get(this.conf,"default.value.value")},isPromise(e){return!!e&&"function"==typeof e.then},toggleValueWatch(e=!0){if(console.log("toggleValueWatch"),this.valueUnWatch&&(this.valueUnWatch(),this.valueUnWatch=!1),e){let e=JSON.stringify(this.value);this.valueUnWatch=this.$watch("value",(async(t,n)=>{if(console.log("第一层 formField: ",t,n),this.isSubForm||"Area"==this.fieldConf.type||"MulArea"==this.fieldConf.type){let n=JSON.stringify(t);if(e==n)return void(this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex))}else if(n==t)return void(this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex));e=JSON.stringify(t),this.checkRely(t,n)}),{immediate:"select_reviewed_person_signature"==this.fieldConf.id,deep:!0})}},handleChange(e,t){console.log("bpmFormFieldChange: ",e,t),this.$emit("input",e),this.$emit("change",e)},async checkRely(e,t){if(this.$emit("valueChanged"),"select_reviewed_person_signature"==this.fieldConf.id&&this.$store.commit("setBpmLinkageBridge",{form:this.fieldConf.id,to:["show_review_sign"],calc_function:e=>{let t=2;return t=e.select_reviewed_person_signature==zj.app.accessInfo.user_info.user_id?1:2,t}}),this.setLocalCache(e),(!this.container.isSubForm||this.container.isSubForm&&(!_.isUndefined(t)||!_.isUndefined(e)))&&this.container&&this.container.handleRelyById){await this.loadRemoteByFieldMap();let e=_.get(this.fieldConf,"mappings");e=_.keys(e),await this.container.handleRelyById(this.fieldConf.id,this.rowIndex,e)}this.firstFill=!1},setLocalCache(e){let t=this.fieldConf.id,n=this.container.mode,a=_.get(this.fieldConf,"value_type");this.$bpm.setLocalCache(n,`${t}.${a}`,e)},loadSelectListPre(e){this.$refs.fieldComp&&this.$refs.fieldComp.preSearch&&this.$refs.fieldComp.preSearch(e)},loadSelectByDepends(){this.readonly||(this.selectDependIds=_.get(this.fieldConf,"range_remote.depends",[]),this.loadSelectLinkage({fieldId:this.fieldConf.id},(e=>{if("Quote"==this.fieldConf.type)return this.value=_.map(e.data,"form_id"),this.quoteContent=e,void(this.loading=!1);this.selectList=e,this.loading=!1})))},async loadRemoteByDepends(e){if("OrderSubForm"==this.fieldConf.type&&(this.remoteDependIds=_.get(this.fieldConf,"remote.depends",[]),this.remoteDependIds.length||e)){let t=this.remoteDependIds,n=this.getDependData(t);if(_.map(n,((e,t)=>{_.isUndefined(e)&&_.unset(n,t)})),_.isEmpty(n)&&!e)return void(this.loading=!1);let a={fields:n,include_sup:!0},i=this.fieldConf.id,r=await this.$bpm.loadSelectRemoteForm({fieldId:i,params:a,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container});this.remoteData=r,this.loading=!1}},_getPath(e){let t=this.elements,n=e;return _.each(t,(t=>{_.each(t.elements||[],(a=>{a.id==e&&(n=t.id)}))})),n},getDependData(e){let t=this.topContainer.formData,n={};return _.each(e,(e=>{let a=this._getPath(e),i=_.get(t,a);if(e!=a){let t=[];_.each(i,((n,a)=>{let i={},r=_.get(n,e);(r||0===r)&&_.set(i,e,r),_.hasIn(n,"_meta")&&_.set(i,"_meta",n._meta),t.push(i)})),n[a]&&(t=_.merge(n[a],t)),i=t}_.isArray(i)&&_.each(i,(e=>{_.unset(e,"isNew")})),a&&_.set(n,a,i)})),n},loadSelectDepends(){let e=_.get(this.fieldConf,"range_remote.depends",[]),t=this.getDependData(e);_.isEmpty(t)||(this.selectFields=JSON.stringify(t))},async loadSelectLinkage({fieldId:e,mergeParams:t,dependVal:n,isForceLoad:a},i){let r=_.get(this.fieldConf,"range_remote.depends",[]),o=this.getDependData(r);if(_.isEmpty(o))return;this.selectFields=JSON.stringify(o);let s={fields:JSON.stringify(o)};this.container.isSubForm&&_.set(s,"idx",this.rowIndex);let l=this.fieldConf.type;"OnlineEditor"==l&&(s={spec:JSON.stringify(o)}),t&&(s=_.merge(s,t));let d=null;return d=_.includes(["MulSelectCheckItem","SelectRootCategory","SelectCheckItem","SelectSort","MulSelectSort"],l)?await this.$bpm.loadSelectLinkageResult({fieldId:e,params:s,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),filed:this.fieldSelf,container:this.container}):await this.$bpm.searchSelectOpts(e,"",this.container.cusFormId||_.get(this.container,"form.cusFormId"),this.fieldSelf,!1,s,!1),i&&i(d),d},addOptAssWatch(){if(this.hasAddOptAssWatch)return;let e=_.get(this.fieldConf,"optAssMap"),t=_.get(this.fieldConf,"perm.visible");if(!e||_.isEmpty(e)||!t)return;let n=this.container,a=n.isSubForm;_.map(e,((t,i)=>{i=i.replace(/&/g,".");let r=_.split(i,".");r=_.last(r);let o=this._getPath(r),s=_.get(this.elementMap,`${r}.type`),l=!!s&&"Mul"==s.substr(0,3);if(!s)return;let d=this.$watch(a?`form.formData.${n.fieldConf.id}`:`form.formData.${i}`,(()=>{console.log("BpmFormField watch ",a,n.fieldConf,i);let t=!0;_.map(e,((e,i)=>{o!=r&&a&&(i=`${n.fieldConf.id}&${this.rowIndex}&${r}`),i=i.replace(/&/g,".");let s=_.get(this.form,`formData.${i}`);if(l){let n=!1;_.each(s,(t=>{t=_.toString(t),_.includes(e,t)&&(n=!0)})),t=t&&n}else s=_.toString(s),t=t&&_.includes(e,s)})),a?this.displayHidden=!t:this.fieldConf.perm.visible=t,this.isDelete=!t,console.log("BpmFormField watch: visible",t)}),{immediate:!0,deep:!!a});this.optAssWatchList.push(d)})),this.hasAddOptAssWatch=!0},clearOptAssWatch(){this.hasAddOptAssWatch=!1,_.each(this.optAssWatchList,(e=>{e()}))},insertDesc(){this.$refs.field},async loadRemoteByFieldMap(e){let t=_.get(this.fieldConf,"mappings");if("SelectFromForm"!=this.fieldConf.type||!t||_.isEmpty(t))return;console.log("mappings",t);let n=await this.getRemoteByFieldMap();if(!n){let e={};_.each(t,(t=>{e[t.local_field_id]=null})),console.log("_mappingsResult",e),n=e}this.container&&this.container.changeValueByMapping&&this.container.changeValueByMapping(e,n)},async getRemoteByFieldMap(){let e=_.get(this.fieldConf,"mappings");if("SelectFromForm"!=this.fieldConf.type||!e||_.isEmpty(e)||!this.value)return;let t=_.get(this.fieldConf,"id");return(await this.$bpm.loadRmoteFieldMap({fieldId:t,params:{form_id:this.value},cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container})).data}}}),e}()]},s=(0,n(4486).A)(o,a,[],!1,null,null,null);s.options.__file="components/lib/bpmFormField/src/main.vue";var l=s.exports;l.install=function(e){e.component(l.name,l)};var d=l},2622:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-mul-file-edit"},[n("el-upload",{ref:"uploader",attrs:{action:e.url,name:"userfile","show-file-list":!1,multiple:"",limit:e.maxCount,accept:e.extensions,"before-upload":e.handleAdd,"on-success":e.onUploaded,"on-error":e.onFail,"file-list":e.fileList}},[n("el-button",{staticStyle:{"margin-top":"5px"},attrs:{slot:"trigger",size:"small",type:"primary",disabled:e.disabled},slot:"trigger"},[e._v(e._s(e.$z("点击上传","c.click_to_upload")))])],1),e._v(" "),n("div",[e.curVal&&e.curVal.length?[n("viewer",{staticStyle:{width:"100%"},attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},e._l(e.curVal,(function(t){return n("div",{key:t.md5,staticClass:"col-12 file-box",staticStyle:{"margin-top":"10px"}},[e.isImageFile(t)?n("span",{staticClass:"file-content",on:{click:function(n){return e.previewImg(t)}}},[n("img",{staticClass:"preview-image",attrs:{src:e.fileLink(t)}})]):n("span",{staticClass:"file-content",staticStyle:{"margin-left":"8px"},on:{click:function(n){return e.preview(t)}}},[n("div",{staticClass:"text-left file-icon"},[n("i",{staticClass:"fa",class:e.getFileTypeClass(t),attrs:{"aria-hidden":"true"}})])]),e._v(" "),n("div",{staticClass:"relative-position file-link ellipsis",attrs:{title:t.name}},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),n("div",{staticClass:"file-remove",on:{click:function(n){return e.remove(t.md5,t)}}},[n("span",{staticClass:"operation-btn"},[e._v(e._s(e.$z("删除","c.delete")))])])])})),0)]:[n("div",{staticClass:"col-auto",staticStyle:{"padding-top":"0px","font-size":"12px"}},[e._v("\n "+e._s(e.$z("未发现上传文件","b2.common.not_found_file"))+"\n ")])]],2),e._v(" "),n("el-dialog",e._g(e._b({staticClass:"file-modal",attrs:{visible:e.opened,"before-close":e.onHide,title:e.$z("文件预览","c.file_preview"),fullscreen:!0},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("iframe",{attrs:{src:e.officeUrl,width:"99%",height:e.windowH}})]),e._v(" "),n("img",{staticStyle:{display:"none"},attrs:{id:"image",src:""}}),e._v(" "),n("div",{staticStyle:{height:"100px",width:"109px",display:"none"},attrs:{id:"container"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(7642),l=n(9795),d=n(1335),c=n.n(d),u=n(5554),m=n.n(u),f=n(8245),h=(n(8085),n(7107),n(5093)),p=n.n(h);var _={insertEXIF:function(e,t,n){if(e instanceof Blob){var a=this,i=new FileReader;i.onload=function(){a.insertEXIF(i.result,t,n)},i.readAsArrayBuffer(e)}else{var r=[].slice.call(new Uint8Array(e),0);if(255!==r[2]||224!==r[3])return e;var o=256*r[4]+r[5],s=[255,216].concat(t,r.slice(4+o));n(new Uint8Array(s))}},getEXIF:function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++){var a=e[n];255===a[0]&&225===a[1]&&(t=t.concat(a))}return t},getSegments:function(e,t){if(e instanceof Blob){var n=this,a=new FileReader;a.onload=function(){n.getSegments(a.result,t)},a.readAsArrayBuffer(e)}else{if(!e.length&&!e.byteLength)return[];var i,r,o=0,s=[],l=[].slice.call(new Uint8Array(e),0);let n=1;for(;n&&(255!==l[o]||218!==l[o+1])&&(255===l[o]&&216===l[o+1]?o+=2:(i=o+(256*l[o+2]+l[o+3])+2,r=l.slice(o,i),o=i,s.push(r)),!(o>l.length)););t(s)}},decode64:function(e){var t="data:image/jpeg;base64,";if(e.slice(0,23)!==t)return[];for(var n=window.atob(e.replace(t,"")),a=new Uint8Array(n.length),i=0,r=n.length;i<r;i++)a[i]=n.charCodeAt(i);return a},encode64:function(e){for(var t="",n=0,a=e.length;n<a;n++)t+=String.fromCharCode(e[n]);return"data:image/jpeg;base64,"+window.btoa(t)}},g=n(5344),y=n.n(g);function b(e){let t="";y()(".viewer-in .address").length?(e&&(t='<i class="fa fa-map-marker"></i>'+e),y()(".viewer-in .address").html(t)):(e&&(t='<div class="address"><i class="fa fa-map-marker"></i>'+e+"</div>"),y()(".viewer-in .viewer-footer").append(t))}async function v(e){if(b(""),!function(e){return o().startsWith(e.type,"image")}(e))return;let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0");b("定位信息加载中...");let a=document.createElement("img");a.src=n;let i=this;setTimeout((()=>{try{y().ajax({url:`${n}?exif`,success:e=>{e&&e.GPSLatitude?i.setPs(e):c().getData(a,(function(){var e=c().getAllTags(this);console.log("info",e),i.setPs(e)}))},error:()=>{c().getData(a,(function(){var e=c().getAllTags(this);console.log("info",e),i.setPs(e)}))}})}catch(e){c().getData(a,(function(){var e=c().getAllTags(this);i.setPs(e)}))}}),600)}function w(e){console.log("filePath",e);var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""}function M(e){console.log("filePath",e);var t=e.lastIndexOf(".");let n="";return n=-1!=t?e.substring(t+1,e.length).toLowerCase():"other",console.log("fileSuffix",n),o().get({document:"fa-file-word-o",doc:"fa-file-word-o",docx:"fa-file-word-o",sheet:"fa-file-excel-o",xls:"fa-file-excel-o",xlsx:"fa-file-excel-o","ms-excel":"fa-file-excel-o",dwg:"fa-file-image-o",png:"fa-file-image-o",jpg:"fa-file-image-o",jfif:"fa-file-image-o",jpeg:"fa-file-image-o",pjpeg:"fa-file-image-o",gif:"fa-file-image-o",webp:"fa-file-image-o",svg:"fa-file-image-o",pdf:"fa-file-pdf-o",pptx:"fa-file-powerpoint-o",ppt:"fa-file-powerpoint-o",mp4:"fa-file-video-o",avi:"fa-file-video-o",mov:"fa-file-video-o",wmv:"fa-file-video-o",flv:"fa-file-video-o",mkv:"fa-file-video-o",webm:"fa-file-video-o",m4v:"fa-file-video-o","3gp":"fa-file-video-o",mpeg:"fa-file-video-o",rmvb:"fa-file-video-o",ts:"fa-file-video-o",vob:"fa-file-video-o",wav:"fa-file-audio-o",aiff:"fa-file-audio-o",pcm:"fa-file-audio-o",flac:"fa-file-audio-o",alac:"fa-file-audio-o",wma:"fa-file-audio-o",mp3:"fa-file-audio-o",ogg:"fa-file-audio-o",aac:"fa-file-audio-o",zip:"fa-file-archive-o",rar:"fa-file-archive-o",gz:"fa-file-archive-o",tgz:"fa-file-archive-o",bz2:"fa-file-archive-o",gar:"fa-file-archive-o",c:"fa-file-code-o",aspx:"fa-file-code-o",class:"fa-file-code-o",clw:"fa-file-code-o",cpp:"fa-file-code-o",cs:"fa-file-code-o",dll:"fa-file-code-o",dsp:"fa-file-code-o",h:"fa-file-code-o",hpp:"fa-file-code-o",html:"fa-file-code-o",jar:"fa-file-code-o",java:"fa-file-code-o",js:"fa-file-code-o",lib:"fa-file-code-o",ocx:"fa-file-code-o",py:"fa-file-code-o",pyc:"fa-file-code-o",xml:"fa-file-code-o",json:"fa-file-code-o",conf:"fa-file-code-o"},n,"fa-file-o")}function L(){let e=(new Date).valueOf();return function(e){let t=0,n=e.length;for(let a=0;a<n;a++)t=31*t+e.charCodeAt(a),t>2147483647&&(t%=2147483648);return t}(function(){let e="",t=6,n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let a=0;a<t;a++)e+=n[Math.round(Math.random()*(n.length-1))];return e}()+e.toString())}m().use(s.Upload),m().use(s.Button),m().use(s.Dialog);const k=n(3318);m().use(f.Ay),f.Ay.setDefaults({Options:{inline:!0,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!0,url:"data-source"}});var S=null,D={props:{value:{},fieldConf:{},row:{},extensions:{type:String,default(){return".webp,.gif,.jpg,.jpeg,.png,.heic,.heif,.doc,.xlsx,.pdf,.docx,.xls,.dwg"}}},data(){return{curVal:[],fileList:[],opened:!1,officeUrl:"",windowH:0,curExifInfo:{}}},watch:{value(){this.curVal=o().isArray(this.value)?this.value:[]}},computed:{url(){return o().get(this.fieldConf,"upload_url","/platform/v1/papi/app_file/upload/")},photo(){let e=[];return o().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),e},photoMd5s(){let e=[];return o().each(this.curVal,(t=>{this.isImageFile(t)&&e.push(t.md5)})),e},maxCountConf(){return o().get(this.fieldConf,"check.max_count")},maxCount(){return this.maxCountConf-this.curVal&&this.curVal.length},disabled(){return(this.curVal?this.curVal:[]).length>=this.maxCountConf}},created(){},mounted(){this.curVal=this.value,this.windowH=document.body.clientHeight/100*99-50,this.appendJs("https://webapi.amap.com/maps?v=1.4.15&key=c2195d5de1c163ebfb118bad93c8bbd3",(()=>{var e=new S.Map("container",{resizeEnable:!0});e.plugin("AMap.Geolocation",(()=>{let t=new S.Geolocation({enableHighAccuracy:!0,timeout:1e4,maximumAge:0,convert:!0,showButton:!0,buttonPosition:"LB",buttonOffset:new S.Pixel(10,20),showMarker:!0,showCircle:!0,panToLocation:!0,zoomToAccuracy:!0});e.addControl(t),t.getCurrentPosition(),S.event.addListener(t,"complete",(e=>{this.position=e.position})),S.event.addListener(t,"error",(e=>{console.log("定位出错-error",e)}))}))}))},methods:{appendJs(e){let t=document.createElement("script"),n={type:"text/javascript",async:/^http/.test(e)?"async":"",src:e};for(var a in n)t[a]=n[a];document.head.appendChild(t)},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=o().filter(this.curVal,(e=>this.isImageFile(e)));v(o().get(n,t))},previewImg(e){let t=o().indexOf(this.photoMd5s,e.md5);this.$viewer.view(t)},isDwg(e){return o().endsWith(e.name,".dwg")},getFileTypeClass(e){return M(e.name)},handleAdd(e){console.log("_file",e),c().getData(e,(()=>{let e=c().getAllTags(this);console.log("allEXIF",e)}));let t=this.fileList;o().each(t,((e,t)=>{console.log("handleAdd_file"),function(e,t){if(-1==e.type.indexOf("image"))t(null);else{let n=new FileReader,a=new Image;n.readAsDataURL(e),n.onload=function(){e.src=this.result,a.onload=function(){let t=a.width,n=a.height;e.width=t,e.height=n},a.src=e.src,function(e,t,n,a){var i=new Image;i.src=e.src,i.onload=function(){var e=this,i=e.width,r=e.height,o=i/r;i=t.width||i,r=t.height||i/o;var s=.7,l=document.createElement("canvas"),d=l.getContext("2d"),u=document.createAttribute("width");u.nodeValue=i;var m=document.createAttribute("height");m.nodeValue=r,l.setAttributeNode(u),l.setAttributeNode(m);try{c().getData(n,(function(){let n=c().getTag(this,"GPSLatitude");var o=c().getAllTags(this);console.log("exifInfo",o),d.drawImage(e,0,0,i,r),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var u=l.toDataURL("image/jpeg",s);a(u,n)}))}catch(n){d.drawImage(e,0,0,i,r),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var f=l.toDataURL("image/jpeg",s);a(f,null)}}}(e,{quality:.4},e,t)}}}(e,((n,a)=>{n&&_.getSegments(new Blob([e]),(i=>{let r=this.dataURLtoFile(n,e.name),s=_.getEXIF(i);if(console.log("exifInfo",s),!o().isEmpty(s)&&a)_.insertEXIF(r,s,(n=>{let a=new Blob([n],{type:e.type});a.name=e.name,a.lastModifiedDate=new Date,this.fileList[t]=a}));else{let a={},i={},r={};a[k.ImageIFD.Make]="lse";let o=this.position.lat,s=this.position.lng;r[k.GPSIFD.GPSLatitudeRef]=o<0?"S":"N",r[k.GPSIFD.GPSLatitude]=k.GPSHelper.degToDmsRational(o),r[k.GPSIFD.GPSLongitudeRef]=s<0?"W":"E",r[k.GPSIFD.GPSLongitude]=k.GPSHelper.degToDmsRational(s),r[k.GPSIFD.GPSImgDirection]=[123456,100];let l={"0th":a,Exif:i,GPS:r},d=k.dump(l),c=k.insert(d,n),u=this.dataURLtoFile(c,e.name);this.fileList[t]=u}}))}))}))},dataURLtoFile(e,t){let n=e.split(","),a=n[0].match(/:(.*?);/)[1],i=atob(n[1]),r=i.length,o=new Uint8Array(r);for(;r--;)o[r]=i.charCodeAt(r);return new File([o],t,{type:a})},isImageFile(e){return o().startsWith(e.type,"image")},itemSideImageAttr(e){let t={};return this.isImageFile(e)?t.image=this.fileLink(e):t.icon="fa fa-file",t},fileLink(e){if(!e||!e.md5)return;let t=this.isImageFile(e),n={file_md5:e.md5};return t||(n.is_file=1),(0,l.zC)("/platform/v1/papi/web_file/image_view/",n)},async preview(e){if("dwg/dwg"==e.type)return;let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0"),a=w(n);"application/pdf"==e.type&&(a="pdf"),"application/vnd.ms-excel"==e.type&&(a="ms-excel");let i=L(),r=`https://${window.location.host}/zj_of/v1/papi/file/read_only/?md5=${e.md5}&type=${{document:"Word.Document",docx:"Word.Document",doc:"Word.Document",sheet:"Excel.Sheet",pdf:"pdf",xlsx:"Excel.Sheet","ms-excel":"Excel.Sheet"}[a]}&sign=${i}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(r="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),"pdf"==a){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),r=(0,l.Fr)()?`/public/app3/bpm/view_pdf.html?url=${n}`:`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=r,this.opened=!0},onFail(e,t){let n=`${t.name}上传失败`;console.log("err:",n)},onUploaded(e,t){console.log("file",t);let n={};t.raw&&t.raw.exifdata&&(n=t.raw.exifdata);let a=null;a=n.DateTimeOriginal?p()(n.DateTimeOriginal,"YYYY:MM:DD HH:mm:ss").unix():n.ColorSpace?(new Date).getTime()/1e3:null;let i=o().isArray(this.curVal)?this.curVal:[],r={name:t.name,type:o().get(t,"raw.type"),md5:o().get(e,"data.file_md5"),upload_time:p()().unix(),take_photo_time:a};e&&e.data&&e.data.file_md5&&i.push(r),this.curVal=o().cloneDeep(i),console.log("this.curVal",this.curVal),this.handleChange()},remove(e){this.curVal=o().filter(this.curVal,(t=>t.md5!=e)),this.handleChange(),this.$refs.uploader.queue=[]},onHide(){this.opened=!1},onOpen(){this.opened=!0},handleChange(){this.$emit("input",this.curVal),this.$emit("change",this.curVal)}}},x=D,Y=n(4486),T=(0,Y.A)(x,i,[],!1,null,null,null);T.options.__file="components/lib/bpmMulFile/src/part/editor.vue";var C=T.exports,j=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-mul-file-reader"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!e.curVal||0==e.curVal.length,expression:"!curVal || curVal.length == 0"}]},[e._v("\n "+e._s(e.$z("暂无文件或图片","c.no_files"))+"\n ")]),e._v(" "),e.photo.length>0?n("viewer",{ref:"viewer",attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},[n("div",{staticStyle:{display:"flex","flex-wrap":"wrap"}},e._l(e.curVal,(function(t){return n("span",{key:t.md5},[e.isImageFile(t)?n("div",{staticClass:"file-box"},[n("div",{staticClass:"file-content",staticStyle:{height:"auto",border:"1px solid #ececec"}},[n("el-tooltip",{attrs:{content:t.name,placement:"bottom",effect:"dark"}},[n("img",{staticClass:"preview-image",attrs:{src:e.fileLink(t,600),alt:""}})])],1)]):[n("el-tooltip",{attrs:{placement:"bottom",effect:"dark",content:t.name}},[n("div",{staticClass:"file-box no-photo-file-box",attrs:{target:"_blank"},on:{click:function(n){return e.reviewOnMobile(t)}}},[n("div",{staticClass:"text-center file-icon",on:{click:function(n){return e.preview(t)}}},[n("i",{staticClass:"q-icon fa",class:e.getFileTypeClass(t),attrs:{"aria-hidden":"true"}})]),e._v(" "),n("span",{staticClass:"file-name"},[e._v(" "+e._s(t.name))]),e._v(" "),n("div",{staticClass:"overlay"},[e.isDwg(t)?e._e():n("el-button",{attrs:{type:"text",title:e.$z("预览","c.preview")},on:{click:function(n){return e.preview(t)}}},[n("i",{staticClass:"overlay-btn el-icon-view"})]),e._v(" "),n("el-button",{attrs:{type:"text",title:e.$z("下载","c.download")},on:{click:function(n){return e.download(t)}}},[n("i",{staticClass:"overlay-btn el-icon-download"})])],1)])])]],2)})),0)]):e._l(e.curVal,(function(t){return n("span",{key:t.md5},[n("div",{staticClass:"file-box",staticStyle:{"padding-left":"8px"},attrs:{target:"_blank"}},[n("div",{staticClass:"text-center file-icon",on:{click:function(n){return e.preview(t)}}},[n("i",{staticClass:"fa",class:e.getFileTypeClass(t),attrs:{"aria-hidden":"true"}})]),e._v(" "),n("div",{staticClass:"relative-position tc file-link ellipsis",attrs:{title:t.name},on:{click:function(n){return e.preview(t)}}},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),n("div",{staticClass:"operation-box"},[e.isDwg(t)?e._e():n("a",{staticClass:"operation-btn",attrs:{href:"javascript:;"},on:{click:function(n){return e.preview(t)}}},[e._v(e._s(e.$z("预览","c.preview")))]),e._v(" "),e.isDwg(t)?e._e():n("span",[e._v("|")]),e._v(" "),n("a",{staticClass:"operation-btn",attrs:{href:"javascript:;"},on:{click:function(n){return e.download(t)}}},[e._v(e._s(e.$z("下载","c.download")))])])])])})),e._v(" "),n("el-dialog",e._g(e._b({staticClass:"file-modal",attrs:{visible:e.opened,"before-close":e.onHide,modal:!1,title:e.$z("文件预览","c.file_preview"),fullscreen:!0},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("iframe",{attrs:{src:e.officeUrl,width:"99%",height:e.windowH}})]),e._v(" "),n("img",{staticStyle:{display:"none"},attrs:{id:"image",src:""}})],2)};j._withStripped=!0,m().use(s.Dialog),m().use(f.Ay),f.Ay.setDefaults({Options:{inline:!0,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!1,fullscreen:!1,keyboard:!0}}),m().use(s.Dialog);var $={props:["value","fieldConf","row"],data(){return{vueLightId1:null,curVal:[],photo:[],officeUrl:"",opened:!1,windowH:0,type:"small"}},computed:{},watch:{value(e){this.curVal=o().filter(e,(e=>e.md5)),this.setPhoto()}},created(){},mounted(){let e=(new Date).getTime();this.vueLightId1=e+1,this.curVal=o().filter(this.value,(e=>e.md5)),this.setPhoto(),this.windowH=document.body.clientHeight/100*99-50},methods:{isDwg(e){return o().endsWith(e.name,".dwg")},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=o().filter(this.value,(e=>this.isImageFile(e)));v(o().get(n,t))},setPhoto(){let e=[];o().each(this.value,(t=>{if(this.isImageFile(t)&&t.md5){let n=this.fileLink(t,600);e.push(n)}})),this.photo=e},getFileTypeClass(e){return M(e.name)},isImageFile(e){return o().startsWith(e.type,"image")},fileLink(e){if(!e||!e.md5)return;let t=this.isImageFile(e),n={file_md5:e.md5};return t||(n.is_file=1),(0,l.zC)("/platform/v1/papi/web_file/image_view/",n)},reviewOnMobile(e){},async preview(e){let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0"),a=w(n);"application/pdf"==e.type&&(a="pdf"),"application/vnd.ms-excel"==e.type&&(a="ms-excel");let i=L(),r=`https://${window.location.host}/zj_of/v1/papi/file/read_only/?md5=${e.md5}&type=${{document:"Word.Document",docx:"Word.Document",doc:"Word.Document",sheet:"Excel.Sheet",pdf:"pdf",xlsx:"Excel.Sheet","ms-excel":"Excel.Sheet"}[a]}&sign=${i}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(r="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),console.log("url",r),"pdf"==a){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),r=`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=r,this.opened=!0},async share(e){return await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`})},async toShare(e){console.log("fileInfo",e)},async download(e){window.open(`/platform/v1/papi/web_file/web_download/?file_md5=${e.md5}`)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},P=(0,Y.A)($,j,[],!1,null,null,null);P.options.__file="components/lib/bpmMulFile/src/part/reader.vue";var I=P.exports,F={name:"BpmMulFile",components:{editorComponent:C,readerComponent:I},props:{value:{},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},data(){return{curVal:[]}},computed:{curComponent(){return"view"==this.mode?I:C}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},E=(0,Y.A)(F,a,[],!1,null,null,null);E.options.__file="components/lib/bpmMulFile/src/main.vue";var O=E.exports;O.install=function(e){e.component(O.name,O)};var A=O},2554:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return E}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-mul-image",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange,imgLoadError:e.emitImgLoadError},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-mul-image-edit"},[n("el-upload",e._g(e._b({ref:"uploader",attrs:{action:e.url,name:"userfile","show-file-list":!1,multiple:"",limit:e.maxCount,accept:e.extensions,"before-upload":e.handleAdd,"on-success":e.onUploaded,"on-error":e.onFail,"file-list":e.fileList}},"el-upload",e.$attrs,!1),e.$listeners),[n("el-button",{attrs:{slot:"trigger",size:"small",type:"primary",disabled:e.disabled},slot:"trigger"},[e._v(e._s(e.$z("点击上传","c.click_to_upload")))])],1),e._v(" "),n("div",{staticClass:"row gutter-sm q-my-sm file-list"},[e.curVal&&e.curVal.length?[n("viewer",{staticClass:"row gutter-sm q-my-sm file-list",staticStyle:{width:"100%"},attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},e._l(e.curVal,(function(t){return n("div",{key:t.md5,staticClass:"col-12 file-box"},[e.isImageFile(t)?n("span",{staticClass:"file-content",on:{click:function(n){return e.previewImg(t)}}},[n("img",{staticClass:"preview-img",attrs:{src:e.fileLink(t)}})]):n("span",{staticClass:"file-content q-mb-xs",on:{click:function(n){return e.preview(t)}}},[n("div",{staticClass:"text-left text-faded"},[n("i",{staticClass:"q-icon fa fa-file-pdf-o",class:e.getFileTypeClass(t),attrs:{"aria-hidden":"true"}})])]),e._v(" "),n("div",{staticClass:"relative-position file-link ellipsis",attrs:{title:t.name}},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),n("div",{staticClass:"file-remove",on:{click:function(n){return e.remove(t.md5,t)}}},[e._v(e._s(e.$z("删除","c.delete")))])])})),0)]:[n("div",{staticClass:"col-auto",staticStyle:{"padding-top":"0px","font-size":"12px"}},[e._v("\n "+e._s(e.$z("未发现上传文件","b2.common.not_found_file"))+"\n ")])]],2),e._v(" "),n("img",{staticStyle:{display:"none"},attrs:{id:"image",src:""}}),e._v(" "),n("div",{staticStyle:{height:"100px",width:"109px",display:"none"},attrs:{id:"container"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(1335),l=n.n(s),d=n(5093),c=n.n(d),u=n(7642),m=n(9795),f=n(5554),h=n.n(f),p=n(8245);n(8085),n(7107);var _={insertEXIF:function(e,t,n){if(e instanceof Blob){var a=this,i=new FileReader;i.onload=function(){a.insertEXIF(i.result,t,n)},i.readAsArrayBuffer(e)}else{var r=[].slice.call(new Uint8Array(e),0);if(255!==r[2]||224!==r[3])return e;var o=256*r[4]+r[5],s=[255,216].concat(t,r.slice(4+o));n(new Uint8Array(s))}},getEXIF:function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++){var a=e[n];255===a[0]&&225===a[1]&&(t=t.concat(a))}return t},getSegments:function(e,t){if(e instanceof Blob){var n=this,a=new FileReader;a.onload=function(){n.getSegments(a.result,t)},a.readAsArrayBuffer(e)}else{if(!e.length&&!e.byteLength)return[];var i,r,o=0,s=[],l=[].slice.call(new Uint8Array(e),0);let n=1;for(;n&&(255!==l[o]||218!==l[o+1])&&(255===l[o]&&216===l[o+1]?o+=2:(i=o+(256*l[o+2]+l[o+3])+2,r=l.slice(o,i),o=i,s.push(r)),!(o>l.length)););t(s)}},decode64:function(e){var t="data:image/jpeg;base64,";if(e.slice(0,23)!==t)return[];for(var n=window.atob(e.replace(t,"")),a=new Uint8Array(n.length),i=0,r=n.length;i<r;i++)a[i]=n.charCodeAt(i);return a},encode64:function(e){for(var t="",n=0,a=e.length;n<a;n++)t+=String.fromCharCode(e[n]);return"data:image/jpeg;base64,"+window.btoa(t)}},g=n(5344),y=n.n(g);function b(e){let t="";y()(".viewer-in .address").length?(e&&(t='<i class="fa fa-map-marker"></i>'+e),y()(".viewer-in .address").html(t)):(e&&(t='<div class="address"><i class="fa fa-map-marker"></i>'+e+"</div>"),y()(".viewer-in .viewer-footer").append(t))}async function v(e){if(b(""),!function(e){return o().startsWith(e.type,"image")}(e))return;let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0");b("定位信息加载中...");let a=document.createElement("img");a.src=n;let i=this;setTimeout((()=>{try{y().ajax({url:`${n}?exif`,success:e=>{e&&e.GPSLatitude?i.setPs(e):l().getData(a,(function(){var e=l().getAllTags(this);console.log("info",e),i.setPs(e)}))},error:()=>{l().getData(a,(function(){var e=l().getAllTags(this);console.log("info",e),i.setPs(e)}))}})}catch(e){l().getData(a,(function(){var e=l().getAllTags(this);i.setPs(e)}))}}),600)}function w(e){console.log("filePath",e);var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""}h().use(u.Upload),h().use(u.Button),h().use(u.Dialog);const M=n(3318);h().use(p.Ay),p.Ay.setDefaults({Options:{inline:!0,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!0,url:"data-source"}});var L=null,k={props:{type:{type:String,default:"MulImage"},value:{},fieldConf:{},row:{},extensions:{type:String,default(){return".jpg,.jpeg,.png,.dwg,.heic,.heif,.webp"}}},data(){return{curVal:[],fileList:[],opened:!1,officeUrl:"",windowH:0}},watch:{value(){this.curVal=this.isSign&&o().isString(this.value)&&this.value?[{md5:this.value,name:"",type:"image/png"}]:this.value}},computed:{url(){return"/platform/v1/papi/app_file/upload/"},isSign(){return"Signature"===this.type||"Signature"==this.fieldConf.type},photo(){let e=[];return o().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),e},photoMd5s(){let e=[];return o().each(this.curVal,(t=>{this.isImageFile(t)&&e.push(t.md5)})),e},maxCountConf(){return o().get(this.fieldConf,"check.max_count")},maxCount(){return this.maxCountConf-this.curVal&&this.curVal.length},disabled(){return(this.curVal?this.curVal:[]).length>=this.maxCountConf}},created(){},mounted(){this.curVal=this.isSign&&o().isString(this.value)&&this.value?[{md5:this.value,name:"签名",type:"image/png"}]:this.value,this.windowH=document.body.clientHeight/100*99-50,this.appendJs("https://webapi.amap.com/maps?v=1.4.15&key=c2195d5de1c163ebfb118bad93c8bbd3",(()=>{var e=new L.Map("container",{resizeEnable:!0});e.plugin("AMap.Geolocation",(()=>{let t=new L.Geolocation({enableHighAccuracy:!0,timeout:1e4,maximumAge:0,convert:!0,showButton:!0,buttonPosition:"LB",buttonOffset:new L.Pixel(10,20),showMarker:!0,showCircle:!0,panToLocation:!0,zoomToAccuracy:!0});e.addControl(t),t.getCurrentPosition(),L.event.addListener(t,"complete",(e=>{this.position=e.position})),L.event.addListener(t,"error",(e=>{console.log("定位出错-error",e)}))}))}))},methods:{appendJs(e){let t=document.createElement("script"),n={type:"text/javascript",async:/^http/.test(e)?"async":"",src:e};for(var a in n)t[a]=n[a];document.head.appendChild(t)},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=o().filter(this.curVal,(e=>this.isImageFile(e)));v(o().get(n,t))},previewImg(e){let t=o().indexOf(this.photoMd5s,e.md5);this.$viewer.view(t)},isDwg(e){return o().endsWith(e.name,".dwg")},getFileTypeClass(e){let t=w(e.type);return t=t||w(e.name),o().endsWith(e.name,".dwg")&&(t="dwg"),o().get({document:"fa-file-word-o",sheet:"fa-file-excel-o",doc:"fa-file-word-o",docx:"fa-file-word-o",xlsx:"fa-file-excel-o","ms-excel":"fa-file-excel-o",dwg:"fa-file-image-o",png:"fa-file-image-o",jpg:"fa-file-image-o"},t)},handleAdd(e){console.log("_file",e),l().getData(e,(()=>{let e=l().getAllTags(this);console.log("allEXIF",e)}));let t=this.fileList;o().each(t,((e,t)=>{!function(e,t){if(-1==e.type.indexOf("image"))t(null);else{let n=new FileReader,a=new Image;n.readAsDataURL(e),n.onload=function(){e.src=this.result,a.onload=function(){let t=a.width,n=a.height;e.width=t,e.height=n},a.src=e.src,function(e,t,n,a){var i=new Image;i.src=e.src,i.onload=function(){var e=this,i=e.width,r=e.height,o=i/r;i=t.width||i,r=t.height||i/o;var s=.7,d=document.createElement("canvas"),c=d.getContext("2d"),u=document.createAttribute("width");u.nodeValue=i;var m=document.createAttribute("height");m.nodeValue=r,d.setAttributeNode(u),d.setAttributeNode(m);try{l().getData(n,(function(){let n=l().getTag(this,"GPSLatitude");c.drawImage(e,0,0,i,r),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var o=d.toDataURL("image/jpeg",s);a(o,n)}))}catch(n){c.drawImage(e,0,0,i,r),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var f=d.toDataURL("image/jpeg",s);a(f,null)}}}(e,{quality:.4},e,t)}}}(e,((n,a)=>{n&&_.getSegments(new Blob([e]),(i=>{let r=this.dataURLtoFile(n,e.name),s=_.getEXIF(i);if(!o().isEmpty(s)&&a)_.insertEXIF(r,s,(n=>{let a=new Blob([n],{type:e.type});a.name=e.name,a.lastModifiedDate=new Date,this.fileList[t]=a}));else{let a={},i={},r={};a[M.ImageIFD.Make]="lse";let o=this.position.lat,s=this.position.lng;r[M.GPSIFD.GPSLatitudeRef]=o<0?"S":"N",r[M.GPSIFD.GPSLatitude]=M.GPSHelper.degToDmsRational(o),r[M.GPSIFD.GPSLongitudeRef]=s<0?"W":"E",r[M.GPSIFD.GPSLongitude]=M.GPSHelper.degToDmsRational(s),r[M.GPSIFD.GPSImgDirection]=[123456,100];let l={"0th":a,Exif:i,GPS:r},d=M.dump(l),c=M.insert(d,n),u=this.dataURLtoFile(c,e.name);this.fileList[t]=u}}))}))}))},dataURLtoFile(e,t){let n=e.split(","),a=n[0].match(/:(.*?);/)[1],i=atob(n[1]),r=i.length,o=new Uint8Array(r);for(;r--;)o[r]=i.charCodeAt(r);return new File([o],t,{type:a})},isImageFile(e){return o().startsWith(e.type,"image")},itemSideImageAttr(e){let t={};return this.isImageFile(e)?t.image=this.fileLink(e):t.icon="fa fa-file",t},fileLink(e){if(!e||!e.md5)return;let t=this.isImageFile(e),n={file_md5:e.md5};return t||(n.is_file=1),(0,m.zC)("/platform/v1/papi/web_file/image_view/",n)},async preview(e){if("dwg/dwg"==e.type)return;let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0"),a=w(n);"application/pdf"==e.type&&(a="pdf"),"application/vnd.ms-excel"==e.type&&(a="ms-excel");let i=function(){let e=(new Date).valueOf();return function(e){let t=0,n=e.length;for(let a=0;a<n;a++)t=31*t+e.charCodeAt(a),t>2147483647&&(t%=2147483648);return t}(function(){let e="",t=6,n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let a=0;a<t;a++)e+=n[Math.round(Math.random()*(n.length-1))];return e}()+e.toString())}(),r=`https://${window.location.host}/zj_of/v1/papi/file/read_only/?md5=${e.md5}&type=${{document:"Word.Document",docx:"Word.Document",doc:"Word.Document",sheet:"Excel.Sheet",pdf:"pdf",xlsx:"Excel.Sheet","ms-excel":"Excel.Sheet"}[a]}&sign=${i}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(r="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),"pdf"==a){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),r=(0,m.Fr)()?`/public/app3/bpm/view_pdf.html?url=${n}`:`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=r,this.opened=!0},onFail(e,t){let n=`${t.name}上传失败`;console.log("err:",n)},onUploaded(e,t){console.log("file",t);let n={};t.raw&&t.raw.exifdata&&(n=t.raw.exifdata);let a=o().isArray(this.curVal)?this.curVal:[];a.push({name:t.name,type:o().get(t,"raw.type"),md5:o().get(e,"data.file_md5"),upload_time:c()().unix(),take_photo_time:n.DateTimeOriginal?c()(n.DateTimeOriginal,"YYYY:MM:DD HH:mm:ss").unix():null}),this.curVal=o().cloneDeep(a);let i=this.isSign?o().get(this.curVal,"0.md5",""):this.curVal;this.$emit("input",i),this.$emit("change",i)},remove(e){this.curVal=o().filter(this.curVal,(t=>t.md5!=e)),this.$refs.uploader.queue=[];let t=this.isSign?o().get(this.curVal,"0.md5",""):this.curVal;this.$emit("input",t),this.$emit("change",t)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},S=k,D=n(4486),x=(0,D.A)(S,i,[],!1,null,null,null);x.options.__file="components/lib/bpmMulImage/src/part/editor.vue";var Y=x.exports,T=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-mul-image-reader"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!e.curVal||0==e.curVal.length,expression:"!curVal || curVal.length == 0"}]},[e._v(e._s(e.$z("暂无图片","c.no_pictures")))]),e._v(" "),e.isSignature&&e.curVal&&e.curVal[0]?[n("img",{staticStyle:{width:"160px",height:"auto"},attrs:{src:e.fileLink(e.curVal[0]),alt:e.$z("电子签名","c.electronic_signature"),onerror:e.emitImgLoadError}})]:n("viewer",{ref:"viewer",attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},e._l(e.curVal,(function(t){return n("span",{key:t.md5},[e.isImageFile(t)?n("div",{staticClass:"file-box"},[n("div",{staticClass:"file-icon",staticStyle:{border:"1px dashed #ececec",cursor:"pointer"}},[n("img",{staticStyle:{width:"200px",height:"auto"},attrs:{src:e.fileLink(t,600),alt:""}})]),e._v(" "),n("div",{staticClass:"relative-position tc file-link ellipsis",attrs:{title:t.name}},[e._v("\n "+e._s(t.name)+"\n ")])]):e._e()])})),0),e._v(" "),n("img",{staticStyle:{display:"none"},attrs:{id:"image",src:""}})],2)};T._withStripped=!0,h().use(p.Ay),p.Ay.setDefaults({Options:{inline:!0,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!1,fullscreen:!1,keyboard:!0}});var C={props:["type","value","fieldConf","row"],data(){return{vueLightId1:null,photo:[],curVal:[],officeUrl:"",opened:!1,windowH:0}},computed:{is_mobile(){return(0,m.Fr)()},isSignature(){return"Signature"===this.fieldConf.type}},watch:{value(){console.log("img_curlVal",this.value),this.curVal=o().isString(this.value)?[{md5:this.value,name:"",type:"image/png"}]:this.value,this.setPhoto()}},created(){},mounted(){let e=(new Date).getTime();this.vueLightId1=e+1,console.log("this.value",this.value),this.curVal=o().isString(this.value)?[{md5:this.value,name:"",type:"image/png"}]:this.value,this.setPhoto(),this.windowH=document.body.clientHeight/100*99-50},methods:{emitImgLoadError(){this.$emit("imgLoadError")},isDwg(e){return o().endsWith(e.name,".dwg")},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=o().filter(this.curVal,(e=>this.isImageFile(e)));v(o().get(n,t))},setPhoto(){let e=[];o().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),this.photo=e},getFileTypeClass(e){let t=w(e.type);return"application/pdf"==e.type&&(t="fa-file-pdf-o"),o().get({document:"fa-file-word-o",sheet:"fa-file-excel-o",doc:"fa-file-word-o",docx:"fa-file-word-o",xlsx:"fa-file-excel-o","ms-excel":"fa-file-excel-o",dwg:"fa-file-image-o",png:"fa-file-image-o",jpg:"fa-file-image-o"},t)},isImageFile(e){return o().startsWith(e.type,"image")},fileLink(e){if(console.log("fileLink_tem",e),!e||!e.md5)return;let t=this.isImageFile(e),n={file_md5:e.md5};return t||(n.is_file=1),(0,m.zC)("/platform/v1/papi/web_file/image_view/",n)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},j=(0,D.A)(C,T,[],!1,null,null,null);j.options.__file="components/lib/bpmMulImage/src/part/reader.vue";var $=j.exports,P={name:"BpmMulImage",components:{editorComponent:Y,readerComponent:$},props:{value:{type:[String,Array]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?$:Y}},watch:{value(e){console.log("mulImage",e),this.curVal=e}},mounted(){this.curVal=this.value},methods:{emitImgLoadError(){this.$emit("imgLoadError")},handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},I=(0,D.A)(P,a,[],!1,null,null,null);I.options.__file="components/lib/bpmMulImage/src/main.vue";var F=I.exports;F.install=function(e){e.component(F.name,F)};var E=F},7698:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-number",attrs:{value:e.curVal,fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{position:"relative"}},[n("el-input-number",{ref:"component",attrs:{precision:e.precision},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642);l().use(d.InputNumber);var c={data(){return{curVal:null}},props:["value","fieldConf","row"],watch:{value(){this.curVal=Number(this.value)}},computed:{precision(){return o().get(this.fieldConf,"view.precision",0)}},methods:{handleChange(e){console.log("number change: ",e),this.$emit("change",this.curVal)}},mounted(){this.curVal=Number(this.value)}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmNumber/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{staticClass:"bpm-text-view",class:e.uiType+"-text-view "+e.fieldConf.type+"-view",attrs:{title:e._value}},[e._v("\n "+e._s(e._value||0===e._value?e._value:"--")+"\n")])};h._withStripped=!0;var p=n(9227),_={props:["value","fieldConf","row","uiType"],computed:{_value(){let e=o().get(this.row,this.fieldConf.id)||this.value;"string"==typeof e&&(e=e.trim()),console.log("Number_fieldConf",this.fieldConf);let t=o().get(this.fieldConf,"view.precision",0);this.fieldConf.view&&this.fieldConf.view.precision&&(e=o().round(e,this.fieldConf.view.precision)),o().get(this.fieldConf,"view.show_percent",!1)&&(e||0==e)&&(e=(100*e).toFixed(t-2>0?t-2:0)+"%");let n=o().get(this.fieldConf,"view.format",!1);if(n){let t=0;if(-1!=n.indexOf("{")){var a=n.match(/\{([^\}]+)\}/)[1];let i=n;t=p(e).format(a),e=i.replace(/\{[^\}]+\}/,t)}else e=p(e).format(n);return e}return e}}},g=(0,u.A)(_,h,[],!1,null,null,null);g.options.__file="components/lib/bpmNumber/src/part/reader.vue";var y=g.exports,b={name:"BpmNumber",components:{editorComponent:f,readerComponent:y},props:{value:{type:[String,Number]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?y:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},v=(0,u.A)(b,a,[],!1,null,null,null);v.options.__file="components/lib/bpmNumber/src/main.vue";var w=v.exports;w.install=function(e){e.component(w.name,w)};var M=w},5540:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-rich-text"},["table"==e.uiType?n("i",{staticClass:"el-icon-notebook-2",class:{active:e.curVal},on:{click:function(t){t.stopPropagation(),e.dialogVisible=!0}}}):n("el-tiptap",{attrs:{extensions:e.extensions,showMenubar:!e.readonly,readonly:e.readonly,placeholder:e.fieldConf.name},on:{onBlur:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}}),e._v(" "),"table"==e.uiType&&e.dialogVisible?n("el-dialog",{attrs:{title:e.fieldConf.name,visible:e.dialogVisible,width:"50%","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-tiptap",{attrs:{extensions:e.extensions,showMenubar:!e.readonly,readonly:e.readonly,placeholder:e.fieldConf.name},on:{onBlur:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1):e._e()],1)};a._withStripped=!0;var i=n(5554),r=n.n(i),o=n(3533),s=n(5072),l=n.n(s),d=n(7825),c=n.n(d),u=n(7659),m=n.n(u),f=n(5056),h=n.n(f),p=n(540),_=n.n(p),g=n(1113),y=n.n(g),b=n(2419),v={};v.styleTagTransform=y(),v.setAttributes=h(),v.insert=m().bind(null,"head"),v.domAPI=c(),v.insertStyleElement=_(),l()(b.A,v),b.A&&b.A.locals&&b.A.locals,r().use(o.ElementTiptapPlugin,{lang:"en",spellcheck:!0});var w={name:"BpmRichText",components:{"el-tiptap":o.ElementTiptap},props:{value:String,fieldConf:Object,mode:String,uiType:String},data(){return{curVal:"",extensions:[new o.Doc,new o.Text,new o.Paragraph,new o.Heading({level:5}),new o.Bold,new o.Underline({bubble:!0,menubar:!1}),new o.Italic,new o.Strike({bubble:!0,menubar:!1}),new o.Link,new o.Blockquote,new o.Table,new o.TableHeader,new o.TableCell,new o.TableRow,new o.ListItem,new o.BulletList,new o.OrderedList,new o.TodoList,new o.TodoItem,new o.TextAlign,new o.Indent,new o.LineHeight,new o.TextColor,new o.TextHighlight,new o.FontType,new o.FontSize,new o.SelectAll,new o.FormatClear,new o.History,new o.Fullscreen],dialogVisible:!1}},computed:{readonly(){return"view"===this.mode}},watch:{value:{handler(e){this.curVal=e},immediate:!0}},methods:{handleClose(){this.dialogVisible=!1},handleChange(e){console.log(e),console.log("this.curVal: ",this.curVal),this.$emit("input",this.curVal),this.$emit("change",this.curVal)}},mounted(){}},M=(0,n(4486).A)(w,a,[],!1,null,null,null);M.options.__file="components/lib/bpmRichText/src/main.vue";var L=M.exports;L.install=function(e){e.component(L.name,L)};var k=L},2865:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select",attrs:{fieldConf:e.fieldConf,row:e.row,isMultiple:e.isMultiple,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-select-edit"},[e.isRadiosStyle?[e.isMultiple?[n("el-checkbox-group",e._g(e._b({on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-checkbox-group",e.$attrs,!1),e.$listeners),e._l(e.options,(function(t){return n("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)]:[n("el-radio-group",e._g(e._b({on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-radio-group",e.$attrs,!1),e.$listeners),e._l(e.options,(function(t){return n("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)]]:e.isButtonStyle?[e.isMultiple?[n("el-checkbox-group",e._g(e._b({on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-checkbox-group",e.$attrs,!1),e.$listeners),e._l(e.options,(function(t){return n("el-checkbox-button",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)]:[n("el-radio-group",e._g(e._b({on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-radio-group",e.$attrs,!1),e.$listeners),e._l(e.options,(function(t){return n("el-radio-button",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)]]:[n("el-select",e._g(e._b({attrs:{placeholder:e.placeholder,multiple:e.isMultiple,clearable:"",filterable:""},on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-select",e.$attrs,!1),e.$listeners),e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)]],2)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642);l().use(d.Select),l().use(d.Option);var c={components:{},props:["value","fieldConf","row","isMultiple"],data(){return{curVal:""}},watch:{value(){this.curVal=this.value?this.value:this.isMultiple?[]:""}},computed:{options(){let e=o().get(this.fieldConf,"range_enum");return o().map(e,(e=>({value:o().get(e,"0"),label:o().get(e,"1"),color:o().get(e,"2")})))},placeholder(){return this.fieldConf.desc||this.fieldConf.name},isRadiosStyle(){return"default"==o().get(this.fieldConf,"style")},isButtonStyle(){return"button"==o().get(this.fieldConf,"style")}},created(){this.curVal=this.isMultiple?[]:""},mounted(){this.curVal=this.value?this.value:this.isMultiple?[]:""},methods:{onChange(e){this.$emit("input",e),this.$emit("change",e)}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmSelect/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isStatus&&e.rangeEnumMap[e.value]?n("span",{staticClass:"bpm-status_tag-status",style:{background:e.colorMap[e.value]}},[e._v(e._s(e.rangeEnumMap[e.value]))]):e.isStatus?n("span",{attrs:{title:e.label}}):e.isButton&&e.value?n("span",{staticClass:"bpm-btn-select",style:{color:e.colorMap[e.value],background:e.colorMap[e.value]+"3d"},attrs:{title:e.label}},[e._v(e._s(e.label))]):n("span",[e.labels&&e.labels.length>1?e._l(e.labels,(function(t){return n("el-tag",{key:t,staticStyle:{"margin-right":"8px"}},[e._v("\n "+e._s(t)+"\n ")])})):[e._v("\n "+e._s(e.label)+"\n ")]],2)};h._withStripped=!0;var p={props:["type","value","fieldConf","row"],data(){return{colorMap:{}}},computed:{_value(){return o().isArray(this.value)?this.value:[this.value]},rangeEnumMap(){let e=o().get(this.fieldConf,"range_enum"),t={};return o().each(e,(e=>{o().set(t,o().get(e,"0"),o().get(e,"1"))})),this.setColorMap(),t},labels(){return o().isArray(this.value)?o().map(this._value,(e=>o().get(this.rangeEnumMap,e))):[o().get(this.rangeEnumMap,this.value,zj.z("未指定","b2.common.not_specified"))]},label(){return o().isArray(this.value)?o().map(this._value,(e=>o().get(this.rangeEnumMap,e))).join(","):o().get(this.rangeEnumMap,this.value,zj.z("未指定","b2.common.not_specified"))},isButton(){return"button"==o().get(this.fieldConf,"style")},isStatus(){return"Status"===this.type||"Status"===this.fieldConf.type}},methods:{setColorMap(){let e=o().get(this.fieldConf,"range_enum");this.colorMap={},o().each(e,(e=>{o().set(this.colorMap,o().get(e,"0"),o().get(e,"2"))}))}}},_=(0,u.A)(p,h,[],!1,null,null,null);_.options.__file="components/lib/bpmSelect/src/part/reader.vue";var g=_.exports,y={name:"BpmSelect",components:{editorComponent:f,readerComponent:g},props:{value:{type:[String,Array,Number]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},isMultiple:{type:Boolean,default(){return!1}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?g:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},b=(0,u.A)(y,a,[],!1,null,null,null);b.options.__file="components/lib/bpmSelect/src/main.vue";var v=b.exports;v.install=function(e){e.component(v.name,v)};var w=v},8668:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return F}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-check-item",attrs:{fieldConf:e.fieldConf,row:e.row,orgInfo:e.orgInfo,formName:e.formName,mode:e.mode,isMultiple:e.multiple,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-select",{staticStyle:{width:"100%"},attrs:{"popper-class":"bpm-select-tree",multiple:e.isMultiple,placeholder:e.placeholder,"multiple-limit":e.maxCount},on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},[e._l(e.defaultOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),e._v(" "),n("el-tree",{attrs:{lazy:"",load:e.loadNode,"node-key":"value",props:{label:"treeLabel",children:"children",disabled:"disabled",isLeaf:"isLeaf"},indent:16},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return a.data.disabled?n("span",{},[e._v("\n "+e._s(a.label)+"\n ")]):n("el-option",{staticClass:"tree-options",attrs:{value:a.data.value,label:a.data.label}},[n("span",{staticStyle:{"padding-right":"30px","max-width":"500px",overflow:"hidden"}},[e._v("\n "+e._s(a.label)+"\n ")])])}}],null,!0)})],2)],1)};i._withStripped=!0;var r=n(5281),o=n(5554),s=n.n(o),l=n(6773),d=n.n(l),c=n(7642);s().use(c.Tree),s().use(c.Select),s().use(c.Option);var u={props:["value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],data(){return{curVal:"",defaultOptions:[]}},watch:{value(){this.curVal=this.value?this.value:this.isMultiple?[]:"",this.getDefaultOptions()}},computed:{placeholder(){return this.fieldConf.desc||this.fieldConf.name},maxCount(){return d().get(this.fieldConf,"check.max_count")},tickStrategy(){return"leaf_only"==d().get(this.fieldConf,"tree_select","all")?"leaf-filtered":"strict"},leafOnly(){return"leaf_only"===this.fieldConf.tree_select}},created(){this.curVal=this.isMultiple?[]:""},mounted(){this.curVal=this.value?this.value:this.isMultiple?[]:""},methods:{async loadNode(e,t){let n=d().get(this.fieldConf,"id"),a={father:0===e.level?"":e.data.value||""},i=await r.A.assistTreeField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm},a),o=d().get(i.data,"data.data",[]);t(this.transformResultToTree(o,e))},transformResultToTree(e,t){let n=d().get(this.fieldConf,"type");return"SelectCheckItem"==n||"MulSelectCheckItem"==n?d().map(e,(e=>{this.isMultiple||e[0]!==this.curVal||(this.defaultOptions=[]),this.isMultiple&&this.curVal.includes(e[0])&&(this.defaultOptions=d().filter(this.defaultOptions,(t=>t.value!==e[0])));let n=0===t.level?e[1]:t.data.label+" - "+e[1],a=!e[2];return{value:e[0],lazy:e[2],label:n,treeLabel:e[1],isLeaf:a,disabled:this.leafOnly&&!a}})):"SelectSort"==n||"MulSelectSort"==n?d().map(e,(e=>{this.isMultiple||e.value!==this.curVal||(this.defaultOptions=[]),this.isMultiple&&this.curVal.includes(e.value)&&(this.defaultOptions=d().filter(this.defaultOptions,(t=>t.value!==e.value)));let n=0===t.level?e.label:t.data.label+" - "+e.label,a=!e.lazy;return{value:e.value,lazy:e.lazy,label:n,treeLabel:e.label,isLeaf:a,disabled:this.leafOnly&&!a}})):void 0},async getDefaultOptions(){let e=d().isArray(this.curVal)?this.curVal:this.curVal?[this.curVal]:[];if(!e.length)return;const t=await r.A.assistField.getTitle(this.$bpm,{formDefId:this.formDefId,fieldDefId:this.fieldConf.id,orgInfo:this.orgInfo,isDm:this.dm},e);console.log(t);const n=d().get(t.data,"data.data",{});let a=d().map(n,((e,t)=>({value:t,label:e})));console.log("default options: ",a),this.defaultOptions=a},onChange(e){this.$emit("input",e),this.$emit("change",e)}}},m=n(4486),f=(0,m.A)(u,i,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectCheckItem/src/part/editor.vue";var h=f.exports,p={mixins:[n(7348).A]},_=(0,m.A)(p,void 0,void 0,!1,null,null,null);_.options.__file="components/lib/bpmSelectCheckItem/src/part/reader.vue";var g=_.exports,y={name:"BpmSelectCheckItem",components:{editorComponent:h,readerComponent:g},props:{value:{type:[String,Array]},type:{type:String,default:"SelectCheckItem"},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?g:h},multiple(){return this.isMultiple||0===this.type.indexOf("Mul")}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},b=n(5072),v=n.n(b),w=n(7825),M=n.n(w),L=n(7659),k=n.n(L),S=n(5056),D=n.n(S),x=n(540),Y=n.n(x),T=n(1113),C=n.n(T),j=n(347),$={};$.styleTagTransform=C(),$.setAttributes=D(),$.insert=k().bind(null,"head"),$.domAPI=M(),$.insertStyleElement=Y(),v()(j.A,$),j.A&&j.A.locals&&j.A.locals;var P=(0,m.A)(y,a,[],!1,null,null,null);P.options.__file="components/lib/bpmSelectCheckItem/src/main.vue";var I=P.exports;I.install=function(e){e.component(I.name,I)};var F=I},2179:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return u}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["view"===e.mode?n("div",{staticStyle:{display:"flex","max-width":"360px",cursor:"pointer"},attrs:{title:e.value},on:{click:e.openOptionsModal}},[n("span",{staticStyle:{flex:"1"}},[e._v("\n "+e._s(e.label||"--")+"\n ")]),e._v(" "),n("i",{staticClass:"fa fa-angle-right",attrs:{"aria-hidden":"true"}})]):n("div",{staticStyle:{display:"flex","max-width":"360px",cursor:"pointer"},attrs:{title:e.value},on:{click:e.openOptionsModal}},[n("span",{staticStyle:{flex:"1"}},[e._v("\n "+e._s(e.label||(e.loading?""+e.$z("加载中","c.loading"):""+e.$z("请选择","c.please_select")+e.fieldConf.name+"(多选)"))+"\n "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"typing_loader"})]),e._v(" "),n("i",{staticClass:"fa fa-angle-right",attrs:{"aria-hidden":"true"}})]),e._v(" "),n("el-dialog",{attrs:{title:e.fieldConf.name,visible:e.optionsModalShow,width:"50%",top:"10vh","custom-class":"bpm-select-entrance-form"},on:{"update:visible":function(t){e.optionsModalShow=t},close:e.handleClose}},[n("div",{staticClass:"main-wrap",style:{maxHeight:"70vh",overflow:"auto"}},["view"===e.mode?e._l(e.items,(function(t){return n("el-card",{key:t.form_id,staticClass:"select-option-card",attrs:{shadow:"hover","body-style":{padding:"10px 20px"}}},[n("div",{attrs:{slot:"header"},slot:"header"},[n("span",[e._v(e._s(t.title))])]),e._v(" "),n("div",{staticClass:"card-body-content"},[n("div",[n("span",{staticClass:"bpm-status_tag-status",style:{background:e.getStatus(t.f_fields[e.statusField.id],"color")}},[e._v(e._s(e.getStatus(t.f_fields[e.statusField.id],"label")))])]),e._v(" "),e._l(e.descFields,(function(a){return n("div",{key:a.id},[n("label",{staticClass:"label"},[e._v(e._s(a.name))]),e._v(" "),n("span",[e._v(e._s(t.f_fields[a.id]))])])}))],2)])})):[n("div",{staticClass:"search-wrap"},[e.enableSearchText?n("el-input",{attrs:{placeholder:e.$z("搜索","c.search_tip")},on:{input:e.debounceSearch},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}},[n("i",{staticClass:"el-input__icon el-icon-search",staticStyle:{cursor:"pointer"},attrs:{slot:"suffix"},on:{click:e.debounceSearch},slot:"suffix"})]):e._e(),e._v(" "),n("el-button",{staticStyle:{"margin-left":"10px"},on:{click:function(t){e.filterModalShow=!0}}},[n("i",{staticClass:"fa fa-filter",attrs:{"aria-hidden":"true"}})])],1),e._v(" "),n("ul",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:e.loadMore,expression:"loadMore"}],staticClass:"edit-list"},[n("el-checkbox-group",{model:{value:e.selectedVals,callback:function(t){e.selectedVals=t},expression:"selectedVals"}},e._l(e.items,(function(t){return n("li",{key:t.form_id,staticClass:"edit-list-item"},[n("el-checkbox",{staticClass:"checkbox",attrs:{label:t.id}},[e._v(e._s())]),e._v(" "),n("el-card",{key:t.form_id,staticClass:"select-option-card",attrs:{shadow:"hover","body-style":{padding:"10px 20px"}}},[n("div",{attrs:{slot:"header"},slot:"header"},[n("span",[e._v(e._s(t.title))])]),e._v(" "),n("div",{staticClass:"card-body-content"},[n("div",[n("span",{staticClass:"bpm-status_tag-status",style:{background:e.getStatus(t.f_fields[e.statusField.id],"color")}},[e._v(e._s(e.getStatus(t.f_fields[e.statusField.id],"label")))])]),e._v(" "),e._l(e.descFields,(function(a){return n("div",{key:a.id},[n("label",{staticClass:"label"},[e._v(e._s(a.name))]),e._v(" "),n("span",[e._v(e._s(t.f_fields[a.id]))])])}))],2)])],1)})),0)],1)],e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.optionsLoading,expression:"optionsLoading"}],staticStyle:{"text-align":"center",margin:"46px auto"}},[n("span",{staticClass:"typing_loader"})]),e._v(" "),e.optionsLoading||e.items.length?e._e():n("div",[e._v("\n "+e._s(e.$z("暂无记录信息","c.no_record"))+"\n ")])],2),e._v(" "),"edit"===e.mode?n("footer",{staticClass:"footer",attrs:{slot:"footer"},slot:"footer"},[n("div",[n("el-checkbox",{attrs:{label:e.$z("全选","c.select_all")},on:{change:e.handleCheckAll},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}}),e._v(" "),e.selectedLabel?n("span",{staticClass:"subtext"},[e._v(e._s(e.selectedLabel))]):e._e()],1),e._v(" "),n("el-button",{staticClass:"width-button",attrs:{type:"primary",disabled:!e.selectedVals.length},on:{click:e.onSubmit}},[e._v(e._s(e.$z("保存","c.save")))])],1):e._e()]),e._v(" "),n("el-dialog",{attrs:{title:e.$z("数据筛选","b2.common.data_filter"),visible:e.filterModalShow,width:"50%","custom-class":"bpm-select-entrance-form"},on:{"update:visible":function(t){e.filterModalShow=t},close:function(t){e.filterModalShow=!1}}},[n("div",{staticStyle:{"max-height":"70vh",overflow:"auto"}},[n("BpmFieldsFilter",{ref:"searchForm",attrs:{searchSchema:e.searchSchema,verifySchema:e.verifySchema,orgInfo:e.orgInfo,formDefId:e.formSchema.id,showAll:!0,queryExclude:!0},on:{search:e.handleFilterReady}})],1),e._v(" "),n("span",{attrs:{slot:"footer"},slot:"footer"},[n("el-button",{staticClass:"width-button",on:{click:e.handleResetFilter}},[e._v(e._s(e.$z("重置","c.reset")))]),e._v(" "),n("el-button",{staticClass:"width-button",attrs:{type:"primary"},on:{click:e.handleSubmitFilter}},[e._v(e._s(e.$z("查询","c.query")))])],1)])],1)};a._withStripped=!0;var i=n(5281),r=n(9795),o=n(555);const s=["Area","MulArea"];var l={name:"BpmSelectEntranceForm",components:{BpmFieldsFilter:o.A},props:{value:{type:Array,default(){return[]}},type:{type:String,default:"MulSelectEntranceForm"},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"view"},uiType:{type:String,default:"default"},formDefId:{type:String,default:""},orgInfo:{type:Object,default(){return{level:"group",level_id:0,group_id:0}}},formId:{type:String,default:""},dm:{type:Boolean,default(){return!1}},isMultiple:{type:Boolean,default(){return!0}}},data(){return{loading:!1,optionsModalShow:!1,items:[],selectedItems:[],selectedVals:[],optionsLoading:!1,statusField:{},descFields:[],shouldTransLabelKeys:[],formSchema:{},pagination:{action:"first",lastAt:null,total:0},checkAll:!1,filterModalShow:!1,searchSchema:{elements:[]},verifySchema:{},enableSearchText:!0,debounceSearch:_.debounce(_.bind(this.loadData,this),300,{trailing:!0,leading:!1}),keyword:"",filterParams:{}}},computed:{isMobile(){return(0,r.Fr)()},label(){const e=this.value;if(!e||!e.length)return"";let t=zj.z("已选择N条","c.number_is_selected");return _.template(t)({count:e.length})},selectedLabel(){if(!this.selectedVals.length)return"";let e=zj.z("选中N条","c.number_is_selected_2");return _.template(e)({count:this.selectedVals.length})}},methods:{getStatus(e,t){return((this.statusField.rangeEnumMap||{})[e]||{})[t]},async openOptionsModal(){this.optionsModalShow=!0,this.formSchema.id||await this.loadSchema(),this.value&&this.value.length&&await this.loadListSelected(),"edit"===this.mode&&(this.pagination.lastAt||(this.handleResetFilter(),this.loadData()),this.selectedVals=this.value||[])},handleClose(){this.optionsModalShow=!1,"edit"===this.mode&&(this.checkAll=!1,this.selectedVals=[])},handleResetFilter(){this.$refs.searchForm&&this.$refs.searchForm.reset()},handleSubmitFilter(){this.$refs.searchForm&&this.$refs.searchForm.submit()},handleFilterReady(e){this.filterParams=e||{},this.filterModalShow=!1,this.loadData()},handleCheckAll(e){this.selectedVals=e?_.map(this.items,(e=>e.id)):[]},onSubmit(){const e=_.cloneDeep(this.selectedVals);this.$emit("input",e),this.$emit("change",e),this.handleClose()},loadMore(){this.items.length<this.pagination.total&&this.loadData("next")},async loadData(e="first"){let t=this.formDefId;const n=this.fieldConf.id;e=["first","next","last","prev"].includes(e)?e:"first";let a=this.filterParams;this.keyword&&(a.q__contains=this.keyword),this.optionsLoading=!0;const r=(await i.A.assistSelectEntranceForm.getOptions(this.$bpm,{formDefId:t,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm},{action:e,limit:20,last_at:"first"===e?null:this.pagination.lastAt,fields:JSON.stringify(a)})).data.data;console.log("assist_select_entrance_form data: ",r);const o=_.map(r.data,(e=>(_.each(e.f_fields,(async(t,n)=>{if(this.shouldTransLabelKeys.includes(n))if(_.isArray(t)){const a=i.A.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let r=await a.loads(...t);e.f_fields[n]=r.join(zj.z(",","c.comma"))}else{const a=i.A.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let r=await a.load(t);e.f_fields[n]=r}})),{title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:_.map(e.f_fields,((e,t)=>({key:t,value:e})))})));let s=o;if(this.selectedItems.length){let e=_.map(this.selectedItems,(e=>e.id));s=_.filter(o,(t=>!e.includes(t.id)))}this.items="next"===e?_.concat(this.items,s):_.concat(this.selectedItems,s),this.pagination.action=e,this.pagination.lastAt=r.last_at,this.pagination.total=r.count,this.optionsLoading=!1},async loadListSelected(){let e=this.formId;e=encodeURIComponent(e);let t=this.formDefId;const n=this.fieldConf.id;this.optionsLoading=!0;try{const a=(await i.A.assistSelectEntranceForm.getListSelected(this.$bpm,{formDefId:t,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm},{form_id:e})).data.data;console.log("assist_select_entrance_form list_selected: ",a);const r=_.map(a.data,(e=>(_.each(e.f_fields,(async(t,n)=>{if(this.shouldTransLabelKeys.includes(n))if(_.isArray(t)){const a=i.A.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let r=await a.loads(...t);e.f_fields[n]=r.join(zj.z(",","c.comma"))}else{const a=i.A.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let r=await a.load(t);e.f_fields[n]=r}})),{title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:_.map(e.f_fields,((e,t)=>({key:t,value:e})))})));this.selectedItems=r,"view"===this.mode&&(this.items=r)}finally{this.optionsLoading=!1}},async loadSchema(){let e=this.formDefId;const t=this.fieldConf.id,n=(await i.A.assistSelectEntranceForm.getListDefinition(this.$bpm,{formDefId:e,fieldDefId:t,orgInfo:this.orgInfo,isDm:this.dm})).data.data;console.log("assist_select_entrance_form definition: ",n);let a={},r=[],o=[];_.each(n.definition.form.elements,(e=>{if("Status"!==e.type)r.push({id:e.id,name:e.name,value_type:e.value_type,type:e.type});else{let t={};e.range_enum.forEach((e=>{t[e[0]]={value:e[0],label:e[1],color:e[2]}})),a={id:e.id,name:e.name,value_type:e.value_type,type:e.type,rangeEnumMap:t}}(s.includes(e.type)||e.type.indexOf("Select")>-1)&&o.push(e.id)})),this.descFields=r,this.statusField=a,this.shouldTransLabelKeys=o,this.formSchema=n.definition.form,this.searchSchema=_.get(n,"definition.search",{elements:[]}),this.verifySchema=_.get(n,"schema.search",{});const l=!!this.searchSchema.elements&&_.find(this.searchSchema.elements,{id:"q__contains"});this.enableSearchText=this.searchSchema.enable_search_text&&l}}},d=(0,n(4486).A)(l,a,[],!1,null,null,null);d.options.__file="components/lib/bpmSelectEntranceForm/src/main.vue";var c=d.exports;c.install=function(e){e.component(c.name,c)};var u=c},9674:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-select-form-field",attrs:{type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.mode,orgInfo:e.orgInfo,formName:e.formName,uiType:e.uiType,isMultiple:e.multiple,allowCreate:e.allowCreate,allowRemote:e.allowRemote},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-select-edit",staticStyle:{display:"flex"}},[e.showUnit?n("select-unit",{attrs:{fieldConf:e.fieldConf,formDefId:e.formDefId,orgInfo:e.orgInfo},on:{change:e.handleUnitChange}}):e._e(),e._v(" "),n("el-select",e._g(e._b({key:e.isMultiple?"two":"one",staticStyle:{flex:"1"},attrs:{placeholder:e.placeholder,multiple:e.isMultiple,clearable:"",filterable:"",remote:"","allow-create":e.allowCreate,"remote-method":!!e.allowRemote&&e.remoteMethod},on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-select",e.$attrs,!1),e.$listeners),e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(7642),l=n(5281),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",{attrs:{placeholder:e.$z("单位选择","b2.common.unit_selection"),filterable:"",remote:""},on:{"remote-method":e.remoteMethod,change:e.handleUnitChange},model:{value:e.selectedTeam,callback:function(t){e.selectedTeam=t},expression:"selectedTeam"}},e._l(e.teams,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)};d._withStripped=!0;var c={name:"SelectUnit",props:["fieldConf","orgInfo","formDefId"],data(){return{selectedTeam:"",teams:[],teamMap:{},teamKeyword:"",debounceSearchTeams:_.debounce(_.bind(this.loadTeams,this),150,{trailing:!0,leading:!1})}},mounted(){this.loadTeams()},methods:{handleUnitChange(){this.$emit("change",this.selectedTeam)},async loadTeams(){let e=_.get(this.orgInfo,"page_level"),t=_.get(this.orgInfo,`${e}_id`);this.teams=await this.$bpm.searchTeamSelectOpts(this.fieldConf.id,{keyword:this.teamKeyword,[`${e}_id`]:t},this.formDefId),this.teamMap=_.keyBy(this.teams,"value")},remoteMethod(e){this.teamKeyword=e||"",this.debounceSearchTeams()}}},u=n(4486),m=(0,u.A)(c,d,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectFromField/src/part/select-unit.vue";var f=m.exports;o().use(s.Select),o().use(s.Option);var h={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple","allowCreate","allowRemote"],components:{SelectUnit:f},data(){return{curVal:"",options:[],keyword:"",unit:{search_type:"",org_id:""}}},watch:{value(){this.curVal=this.value},getSelectOptions:function(e){console.log("----selectOptions----",e),this.transformOptions(e,!0)}},inject:["selectOptions"],computed:{placeholder(){return this.fieldConf.desc||this.fieldConf.name},getSelectOptions(){return this.selectOptions?this.selectOptions():[]},showUnit(){return"SelectURUser"===this.type||"MulSelectURUser"===this.type}},created(){this.curVal=this.isMultiple?[]:""},mounted(){(this.fieldConf.perm||{visible:!0}).visible&&(console.log("mounted getting options"),this.loadSelectOpts()),this.curVal=this.value},methods:{handleUnitChange(e){let t=_.split(e,"$"),n=_.get(t,"0"),a=_.get(t,"1");this.unit={search_type:n,org_id:a},this.loadSelectOpts("",JSON.stringify(this.unit))},remoteMethod(e){let t="";this.showUnit&&this.unit.search_type&&(t=JSON.stringify(this.unit)),this.loadSelectOpts(e,t)},_setSelectItem(e){if(console.log("this.fieldConf",this.fieldConf),this.fieldConf.default&&"Default"==this.fieldConf.default.type&&"EVCFirstElem"==this.fieldConf.default.value.type&&(e&&e.length?(console.log("_setSelectItem_options",e),this.isMultiple?this.curVal=[e[0].value]:this.curVal=e[0].value):this.isMultiple?this.curVal=[]:this.curVal="",console.log("this.curVal",this.curVal),this.$emit("input",this.curVal),this.$emit("change",this.curVal)),this.isMultiple&&this.fieldConf.default&&"Default"==this.fieldConf.default.type&&"EVCAllElem"==this.fieldConf.default.value.type){let t=[];_.each(e,(e=>{t.push(e.value)})),this.curVal=t}this.$emit("input",this.curVal),this.$emit("change",this.curVal)},async loadSelectOpts(e="",t=""){let n,a=this.fieldConf.id,i={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){console.log("UserTaskCC is getting options");const e=this.fieldConf.node;n=await l.A.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},i)}else n=await l.A.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:a,orgInfo:this.orgInfo,isDm:this.dm},i);const r=_.get(n.data,"data.data",[]);return this.transformOptions(r,!1)},transformOptions(e,t=!0){console.log("transformOptions origin: ",e);let n=_.map(e,(e=>({value:e[0],label:e[1]})));return n=_.sortBy(n,["label"]),this.options=n,(this.options.length>0||t)&&this._setSelectItem(this.options),console.log("options: ",n),n},onChange(e){this.$emit("input",e),this.$emit("change",e)}}},p=(0,u.A)(h,i,[],!1,null,null,null);p.options.__file="components/lib/bpmSelectFromField/src/part/editor.vue";var g=p.exports,y={mixins:[n(7348).A]},b=(0,u.A)(y,void 0,void 0,!1,null,null,null);b.options.__file="components/lib/bpmSelectFromField/src/part/reader.vue";var v=b.exports,w={name:"BpmSelectFromField",components:{editorComponent:g,readerComponent:v},props:{value:{type:[Array,Number,String]},type:{type:String,default:"SelectFromField"},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?v:g},multiple(){let e=this.isMultiple||0===this.type.indexOf("Mul");return"UserTaskCC"===this.type&&this.fieldConf.selecter&&(e=0===(this.fieldConf.selecter.type||"MulSelectUser4CC").indexOf("Mul")),e},allowCreate(){return!(!this.fieldConf.range_remote||"add"!=this.fieldConf.range_remote.enable_add_item)},allowRemote(){return!(!this.fieldConf.range_remote||!this.fieldConf.range_remote.enable_remote_search)}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},M=(0,u.A)(w,a,[],!1,null,null,null);M.options.__file="components/lib/bpmSelectFromField/src/main.vue";var L=M.exports;L.install=function(e){e.component(L.name,L)};var k=L},1567:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return F}});var a=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},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=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:e.$z("只展示前100条数据,通过搜索获取更多","b2.common.see_100_data")},on:{input:e.throttleSearch},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",{on:{change:e.onSubmit},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(" "),e.isMultiple?n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1):e._e()],1)],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(6773),l=n.n(s),d=n(7642);o().use(d.Dialog);var c={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],inject:["getSelectFields","selectOptions"],data(){return{curVal:"",label:zj.z("未选择","c.not_selected"),keyword:"",opened:!1,throttleSearch:l().throttle(l().bind(this.search,this),1500,{trailing:!0,leading:!1}),formList:[]}},watch:{value(e){console.log("select_from_form_val",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),this.formList&&this.formList.length?(console.log("this.formList",this.formList),this.isMultiple?this.curVal=[this.formList[0].id]:this.curVal=this.formList[0].id):this.isMultiple?this.curVal=[]:this.curVal="",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 a=this.orgInfo;let i=this.getSelectFields();i&&"{}"!==JSON.stringify(i)&&(a.fields=i);let r=await this.$bpm.searchSelectOpts(n,e,t,this,!1,a),o=this.transformOptions(r);this.formList=o},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");console.log("values",e),l().isEmpty(e)?this.label=zj.z("未选择","c.not_selected"):(e=l().isArray(e)?e:[e],this.label=await this.$bpm.fetchLabelByValues(e,t,this.formName,this.row))}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectFromForm/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["show_ref"==e.mode?n("div",e._l(e.items,(function(t){return n("el-tag",{key:t,attrs:{type:"info"}},[e._v(e._s(t))])})),1):n("span",{attrs:{title:e.label}},[e._v(e._s(e.label))])])};h._withStripped=!0;var p={props:["value","fieldConf","row","formName","orgInfo"],data(){return{mode:"normal",label:"",items:[]}},watch:{value(){this.loadRemoteLabel()}},mounted(){this.loadRemoteLabel()},methods:{async loadRemoteLabel(){let e=this.value;if(l().isNil(e)||!e)return this.label=zj.z("未选择","c.not_selected");try{if(l().isObject(e))try{e=JSON.parse(e)}catch(e){console.log("error",e)}let t=l().isArray(e)?e:[e],n=l().get(this.fieldConf,"id");l().isEmpty(t)?this.label=zj.z("未选择","c.not_selected"):(t=l().isArray(t)?t:[t],"show_ref"==this.mode?this.items=t:this.label=await this.$bpm.fetchLabelByValues(t,n,this.formName,this.row))}finally{console.log("finally")}}}},_=(0,u.A)(p,h,[],!1,null,null,null);_.options.__file="components/lib/bpmSelectFromForm/src/part/reader.vue";var g=_.exports,y={name:"bpmSelectFromForm",components:{editorComponent:f,readerComponent:g},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?g:f}},watch:{value(){console.log("selectFormForm_value",this.value),this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},b=n(5072),v=n.n(b),w=n(7825),M=n.n(w),L=n(7659),k=n.n(L),S=n(5056),D=n.n(S),x=n(540),Y=n.n(x),T=n(1113),C=n.n(T),j=n(5726),$={};$.styleTagTransform=C(),$.setAttributes=D(),$.insert=k().bind(null,"head"),$.domAPI=M(),$.insertStyleElement=Y(),v()(j.A,$),j.A&&j.A.locals&&j.A.locals;var P=(0,u.A)(y,a,[],!1,null,null,null);P.options.__file="components/lib/bpmSelectFromForm/src/main.vue";var I=P.exports;I.install=function(e){e.component(I.name,I)};var F=I},2549:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-from-id",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType,orgInfo:e.orgInfo,formName:e.formName,isMultiple:e.isMultiple},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-from-id-editor"},[n("div",[n("div",{on:{click:e.toOpen}},[e._v(e._s(e.label))])]),e._v(" "),n("el-dialog",e._g(e._b({attrs:{visible:e.opened,"before-close":e.onHide,title:e.fieldConf.name,fullscreen:!0,"custom-class":"select-from-id-editor-dialog"},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("div",{attrs:{slot:"title"},slot:"title"},[n("div",[e._v("\n "+e._s(e.$z("已选名单","b2.common.selected_list"))+":\n "),e._l(e.selectedLabels,(function(t,a){return n("el-tag",{directives:[{name:"show",rawName:"v-show",value:a<=5,expression:"index <= 5"}],key:a,attrs:{type:"success"}},[e._v(e._s(t)+"\n "),n("i",{staticClass:"fa fa-times-circle",on:{click:function(t){return e.deleteSelected(a)}}})])})),e._v(" "),e.selectedLabels.length>5?n("el-button",{attrs:{label:""+(e.$z("查看全部","c.view_all")+e.selectedLabels.length)}},[n("i",{staticClass:"fa fa-sort-desc",attrs:{"aria-hidden":"true"}}),e._v(" "),n("el-popover",[n("div",{attrs:{separator:"",link:""}},e._l(e.selectedLabels,(function(t,a){return n("div",{key:a},[e._v("\n "+e._s(t)+"\n "),n("i",{staticClass:"fa fa-times",staticStyle:{float:"right","margin-left":"8px","font-size":"20px"},on:{click:function(t){return e.deleteSelected(a)}}})])})),0)])],1):e._e()],2)]),e._v(" "),n("div",{staticClass:"select-box"},[n("div",{staticClass:"select-box-left"},[n("div",{staticClass:"title"},[e._v(e._s(e.$z("选择应用","b2.common.select_form_id")))]),e._v(" "),n("div",[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:e.$z("请输入关键字搜索","c.search_tip"),clearale:!0},on:{change:e.debounceSearchApps},model:{value:e.appKeyword,callback:function(t){e.appKeyword=t},expression:"appKeyword"}})],1),e._v(" "),n("ul",{staticClass:"select-app"},e._l(e.apps,(function(t){return n("li",{key:t.value,staticClass:"select-app-item",class:t.value==e.selectedApp?"active":"",on:{click:function(n){return e.loadForms(t.value)}}},[e._v("\n "+e._s(t.label)+"\n ")])})),0)]),e._v(" "),e.selectedApp?n("div",{staticClass:"select-box-right"},[n("div",{staticClass:"title"},[e._v(e._s(e.$z("表单选择","c.form_select")))]),e._v(" "),n("div",[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:e.$z("请输入关键字搜索","c.search_tip"),clearale:!0},on:{change:e.debounceSearch},model:{value:e.formKeyword,callback:function(t){e.formKeyword=t},expression:"formKeyword"}})],1),e._v(" "),n("ul",{staticClass:"select-form"},e._l(e.formList,(function(t){return n("li",{key:t.value,staticClass:"select-form-item"},[e.isMultiple?n("el-checkbox",{attrs:{label:t.value},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},[e._v(e._s(t.label))]):n("el-radio",{attrs:{label:t.value},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},[e._v(e._s(t.label))])],1)})),0)]):n("div",{staticClass:"select-box-right"},[e._v("\n "+e._s(e.$z("先选择表单","b2.common.select_form_first"))+"\n ")])]),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1)])],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(6773),l=n.n(s),d=n(7642);o().use(d.Dialog);var c={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],data(){return{curVal:[],apps:[],label:"",opened:!1,debounceSearchApps:l().debounce(l().bind(this.loadApps,this),150,{trailing:!0,leading:!1}),debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),selectedLabels:[],formList:[],appKeyword:"",selectedApp:"",formKeyword:""}},watch:{curVal(){this.loadSelectedLabels()},value(){this.loadRemoteLabel(),this.curVal=this.value?this.value:this.isMultiple?[]:""}},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(){this.curVal=this.isMultiple?[]:""},mounted(){this.curVal=this.value?this.value:this.isMultiple?[]:"",this.loadRemoteLabel()},methods:{async loadApps(){let e=this.appKeyword,t=this.formName,n=l().get(this.fieldConf,"id"),a=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/select_form_id/${t}/${n}/search_left_title/?q=${e}`,params:this.orgInfo});this.apps=l().map(a.data,(e=>({value:e[0],label:e[1]})))},async search(){let e=this.formKeyword,t=this.formName,n=l().get(this.fieldConf,"id"),a=this.selectedApp,i=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/select_form_id/${t}/${n}/search_right_title/?q=${e}&left=${a}`,params:this.orgInfo});this.formList=l().map(i.data,(e=>({value:e[0],label:e[1]})))},loadForms(e){this.selectedApp=e,this.debounceSearch()},async loadSelectedLabels(){let e=this.curVal,t=l().get(this.fieldConf,"id");if(!l().isEmpty(e)){let n=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/${this.formName}/${t}/list_title/?values=${e}`,params:this.orgInfo});this.selectedLabels=l().cloneDeep(n)}},async loadRemoteLabel(){let e=this.value,t=l().get(this.fieldConf,"id");if(l().isEmpty(e))this.label=zj.z("未选择","c.not_selected");else{let n=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/${this.formName}/${t}/list_title/?values=${e}`,params:this.orgInfo}),a=l().map(n.data);this.label=l().join(a,",")}},onHide(){this.opened=!1},onOpen(){this.loadApps()},isChecked(e){return l().includes(this.curVal,e)},onSubmit(){this.$emit("input",this.curVal),this.$emit("change",this.curVal),this.opened=!1},toOpen(){this.opened=!0},deleteSelected(e){let t=this.curVal;l().pullAt(t,e),this.curVal=l().cloneDeep(t)}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectFromId/src/part/editor.vue";var f=m.exports,h={mixins:[n(7348).A]},p=(0,u.A)(h,void 0,void 0,!1,null,null,null);p.options.__file="components/lib/bpmSelectFromId/src/part/reader.vue";var _=p.exports,g={name:"bpmSelectFromId",components:{editorComponent:f,readerComponent:_},props:{value:{type:[String,Array]},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?_:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},y=n(5072),b=n.n(y),v=n(7825),w=n.n(v),M=n(7659),L=n.n(M),k=n(5056),S=n.n(k),D=n(540),x=n.n(D),Y=n(1113),T=n.n(Y),C=n(1243),j={};j.styleTagTransform=T(),j.setAttributes=S(),j.insert=L().bind(null,"head"),j.domAPI=w(),j.insertStyleElement=x(),b()(C.A,j),C.A&&C.A.locals&&C.A.locals;var $=(0,u.A)(g,a,[],!1,null,null,null);$.options.__file="components/lib/bpmSelectFromId/src/main.vue";var P=$.exports;P.install=function(e){e.component(P.name,P)};var I=P},6170:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var a=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:!0},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=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}},[e.formLabels.length?n("ul",{staticStyle:{"list-style":"none"}},e._l(e.formLabels,(function(t){return n("li",{key:t.form_id},[n("span",[e._v(e._s(t.form_title)+": ")]),e._v(" "),n("span",[e._v(e._s(t.label))])])})),0):n("div",{staticClass:"fake-trigger"},[e._v(e._s(e.$z("未选择","c.not_selected")))])]),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:e.$z("只展示前100条数据,通过搜索获取更多","b2.common.see_100_data")},on:{input:e.throttleSearch},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),e._v(" "),n("el-tabs",{staticStyle:{"margin-top":"20px"},attrs:{type:"card","tab-position":"top"},on:{"tab-click":e.hanldeTabClick}},e._l(e.rangeRemote,(function(t,a){return n("el-tab-pane",{key:t.form+a,attrs:{label:e.optionListArr[a]&&e.optionListArr[a].form_title||"表单"+a,name:t.form+a}},[e.optionListArr[a]&&e.optionListArr[a].options.length?n("div",{staticClass:"bpm-select-from-form-box"},[n("el-checkbox-group",{on:{change:e.handleChange},model:{value:e.curVal[a].form_ids,callback:function(t){e.$set(e.curVal[a],"form_ids",t)},expression:"curVal[index].form_ids"}},e._l(e.optionListArr[a].options,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.getTitleStyle(a)},[n("el-checkbox",{key:t.id,attrs:{label:t.id,disabled:e.setDisabled(t.id)}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.key,staticClass:"subitem",style:e.geFieldStyle(a,t.key)},[e._v("\n "+e._s(t.name)+": "+e._s(t.value)+"\n ")])}))],2)})),0)],1):n("div",[e._v(e._s(e.$z("暂无数据","c.no_data")))])])})),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(e._s(e.$z("确定","c.confirm")))])],1)],1)],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5281),l={props:["value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],inject:["getSelectFields","selectOptions"],data(){return{curVal:[],label:zj.z("未选择","c.not_selected"),formLabels:[],keyword:"",opened:!1,throttleSearch:o().throttle(o().bind(this.search,this),1500,{trailing:!0,leading:!1}),optionListArr:[],formList:[]}},watch:{value(e){console.log("select_from_form_val",e),this.getCurVal(e),this.loadRemoteLabel()}},computed:{rangeRemote(){return this.fieldConf.range_remote||[]},placeholder(){return this.fieldConf.desc||this.fieldConf.name},maxCount(){return o().get(this.fieldConf,"check.max_count")},allChecked(){let e=[];return this.curVal.forEach((t=>{e.push(...t.form_ids)})),e}},created(){},mounted(){this.getCurVal(this.value),this.loadRemoteLabel()},methods:{getCurVal(e){let t=o().cloneDeep(e);t&&o().isArray(t)&&t.length?this.curVal=t:this.curVal=this.rangeRemote.map((e=>({form_def_id:e.form,form_ids:[]})))},getTitleStyle(e){let t=this.fieldConf.range_remote||[],n=o().get(t[e],"range_display.title");return{fontSize:o().get(n,"size",16)+"px",color:o().get(n,"color","#333")}},geFieldStyle(e,t){let n=this.fieldConf.rangeRemote||[],a=o().get(n[e],"range_display.fields"),i=o().keyBy(a,"field"),r=o().get(i,t);return{fontSize:o().get(r,"size",12)+"px",color:o().get(r,"color","#949494")}},hanldeTabClick(e){console.log(e)},handleChange(e){console.log(e)},setDisabled(e){const t=this.allChecked.length;return!this.allChecked.includes(e)&&t>=this.maxCount},async search(){let e=this.keyword,t=o().get(this.fieldConf,"id");const n={q:e};if(this.getSelectFields){let e=this.getSelectFields();e&&"{}"!==JSON.stringify(e)&&(n.fields=e)}let a=await s.A.assistField.selectFromMulFormSearchOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:t,orgInfo:this.orgInfo,isDm:this.dm},n),i=o().get(a.data,"data.items"),r=this.transformOptions(i);console.log(r),this.optionListArr=r},transformOptions(e){return console.log(e),e.map((e=>{let t=o().get(e,"definition.form.elements",[]),n=o().keyBy(t,"id"),a=o().map(e.data,(e=>({title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:o().map(e.f_fields,((e,t)=>({key:t,name:n[t]&&n[t].name,value:e})))})));return{form_def_id:o().get(e,"definition.form.id"),form_title:o().get(e,"definition.form.name"),options:a}}))},onHide(){this.opened=!1},onOpen(){if(this.getCurVal(this.value),this.selectOptions){let e=this.selectOptions();if(e&&e.length)return void(this.formList=this.transformOptions(e))}this.search()},toOpen(){this.opened=!0},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.allChecked,t=o().get(this.fieldConf,"id");console.log("values",e);const n=s.A.assistField.selectFromMulFormListTitleLoader(this.$bpm,{formDefId:this.formDefId,fieldDefId:t,orgInfo:this.orgInfo,isDm:this.dm}),a=await n.loads(...e),i=o().groupBy(a,"form_def_id");console.log(i);let r=[];Object.keys(i).forEach((e=>{let t=i[e].map((e=>e.label));r.push({form_def_id:i[e][0].form_def_id,form_title:i[e][0].form_title,label:t.join(", ")})})),this.formLabels=r}}},d=n(4486),c=(0,d.A)(l,i,[],!1,null,null,null);c.options.__file="components/lib/bpmSelectFromMulForm/src/part/editor.vue";var u=c.exports,m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.formLabels.length?n("ul",{staticStyle:{"list-style":"none"}},e._l(e.formLabels,(function(t){return n("li",{key:t.form_id},[n("span",[e._v(e._s(t.form_title)+": ")]),e._v(" "),n("span",[e._v(e._s(t.label))])])})),0):n("div",[e._v(e._s(e.$z("未选择","c.not_selected")))])])};m._withStripped=!0;var f={props:["value","fieldConf","row","formDefId","orgInfo","dm"],data(){return{label:"",formLabels:[]}},computed:{allChecked(){let e=[];return this.value.forEach((t=>{e.push(...t.form_ids)})),e}},watch:{value(){this.loadRemoteLabel()}},mounted(){this.loadRemoteLabel()},methods:{async loadRemoteLabel(){let e=this.value;if(o().isNil(e)||!e||!o().isArray(e))return;let t=this.allChecked,n=o().get(this.fieldConf,"id");const a=s.A.assistField.selectFromMulFormListTitleLoader(this.$bpm,{formDefId:this.formDefId,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm}),i=await a.loads(...t),r=o().groupBy(i,"form_def_id");console.log(r);let l=[];Object.keys(r).forEach((e=>{let t=r[e].map((e=>e.label));l.push({form_def_id:r[e][0].form_def_id,form_title:r[e][0].form_title,label:t.join(", ")})})),this.formLabels=l}}},h=(0,d.A)(f,m,[],!1,null,null,null);h.options.__file="components/lib/bpmSelectFromMulForm/src/part/reader.vue";var p=h.exports,g={name:"BpmSelectFromMulForm",components:{editorComponent:u,readerComponent:p},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!0}}},data(){return{curVal:[]}},computed:{curComponent(){return"view"==this.mode?p:u}},watch:{value(e){console.log("SelectFormMulForm_value",this.value),this.curVal=e}},mounted(){this.curVal=this.value},methods:{transValue(e){if(!e||!_.isArray(e))return[];let t=[];return this.val.forEach((e=>{t.push(...e.form_ids)})),t},handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},y=n(5072),b=n.n(y),v=n(7825),w=n.n(v),M=n(7659),L=n.n(M),k=n(5056),S=n.n(k),D=n(540),x=n.n(D),Y=n(1113),T=n.n(Y),C=n(9850),j={};j.styleTagTransform=T(),j.setAttributes=S(),j.insert=L().bind(null,"head"),j.domAPI=w(),j.insertStyleElement=x(),b()(C.A,j),C.A&&C.A.locals&&C.A.locals;var $=(0,d.A)(g,a,[],!1,null,null,null);$.options.__file="components/lib/bpmSelectFromMulForm/src/main.vue";var P=$.exports;P.install=function(e){e.component(P.name,P)};var I=P},4413:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-house-owner",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType,orgInfo:e.orgInfo,formName:e.formName,isMultiple:e.isMultiple},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"house-owner"},[n("el-autocomplete",{staticClass:"bpm-autocomplete",attrs:{"fetch-suggestions":e.querySearch,placeholder:e.placeholder},on:{select:e.handleSelect},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.item;return[n("div",{staticClass:"name"},[e._v(e._s(a.value))]),e._v(" "),n("span",{staticClass:"addr"},[e._v(e._s(a.phone))])]}}]),model:{value:e.curVal.name,callback:function(t){e.$set(e.curVal,"name",t)},expression:"curVal.name"}}),e._v(" "),n("el-input",{staticClass:"bpm-default-input owner-phone",staticStyle:{"margin-top":"10px","user-select":"text"},attrs:{placeholder:e.$z("请输入业主电话","b2.common.select_owner_number")},model:{value:e.curVal.phone,callback:function(t){e.$set(e.curVal,"phone",t)},expression:"curVal.phone"}})],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(6773),l=n.n(s),d=n(7642);o().use(d.Autocomplete);var c={props:["value","fieldConf","row","formName","orgInfo","isMultiple","selectList"],data(){return{placeholder:zj.z("请选择或输入业主名称","b2.common.select_owner"),curValue:{id:"",name:"",phone:""},restaurants:[],firstListVal:""}},watch:{value:{handler(e){this.curValue=e||{id:null,name:"",phone:""}},deep:!0},selectList(e){"EVCFirstElem"==l().get(this.fieldConf,"default.value.type")&&(!this.curValue||this.curValue&&!this.curValue.name)&&(this.curValue=l().get(e,"0",null)),this.firstListVal=l().get(e,"0",null)}},methods:{querySearch(e,t){var n=[];l().each(this.selectList,(e=>{n.push({value:e.name,phone:e.phone,id:e.id})})),t(e?n.filter(this.createFilter(e)):n)},createFilter(e){return t=>0===t.value.toLowerCase().indexOf(e.toLowerCase())},handleSelect(e){let t=l().cloneDeep(e);t.name=t.value,delete t.value,this.curValue=t,this.$emit("input",this.curValue),this.$emit("change",this.curValue)}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectHouseOwner/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.value?n("div",{staticClass:"qs-content"},[n("div",[e._v(e._s(e.value.name))]),e._v(" "),n("div",{staticStyle:{"margin-top":"15px"}},[e._v(e._s(e.value.phone))])]):n("span",{staticClass:"qs-content",attrs:{title:e.value}},[e._v(e._s("--"))])])};h._withStripped=!0;var p=(0,u.A)({props:["type","value","fieldConf","row"]},h,[],!1,null,null,null);p.options.__file="components/lib/bpmSelectHouseOwner/src/part/reader.vue";var _=p.exports,g={name:"bpmSelectHouseOwner",components:{editorComponent:f,readerComponent:_},props:{value:{type:[String,Array]},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?_:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},y=n(5072),b=n.n(y),v=n(7825),w=n.n(v),M=n(7659),L=n.n(M),k=n(5056),S=n.n(k),D=n(540),x=n.n(D),Y=n(1113),T=n.n(Y),C=n(5129),j={};j.styleTagTransform=T(),j.setAttributes=S(),j.insert=L().bind(null,"head"),j.domAPI=w(),j.insertStyleElement=x(),b()(C.A,j),C.A&&C.A.locals&&C.A.locals;var $=(0,u.A)(g,a,[],!1,null,null,null);$.options.__file="components/lib/bpmSelectHouseOwner/src/main.vue";var P=$.exports;P.install=function(e){e.component(P.name,P)};var I=P},8500:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-select-issue q-field-no-input"},[n("div",{staticStyle:{display:"flex","max-width":"360px",cursor:"pointer"},on:{click:function(t){return e.toOpen()}}},[n("div",{staticClass:"select-user-label",staticStyle:{flex:"1"}},[e._v("\n "+e._s(e.value.length||"view"===e.mode?e.$z("已选问题","b2.common.selected_question")+" "+e.value.length:e.$z("选择问题","b2.common.choice_question"))+"\n ")]),e._v(" "),n("i",{staticClass:"fa fa-angle-right icon-right",attrs:{"aria-hidden":"true"}})]),e._v(" "),n("el-dialog",{attrs:{title:e.searchTitle,visible:e.opened,width:"90%",fullscreen:!0,"custom-class":"bpm-select-issue"},on:{"update:visible":function(t){e.opened=t},close:e.toClose}},[n("issue-list",{ref:"issue_list",attrs:{category_cls:e.category_cls,mode:e.issueMode,selectItems:e.selectedVals},on:{select:e.selectIssueList}}),e._v(" "),"edit"===e.mode?n("div",{staticClass:"modal-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:e.toClose}},[e._v(e._s(e.$z("取消","c.cancel")))]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1):e._e()],1)],1)};a._withStripped=!0;var i={name:"BpmSelectIssue",props:{value:{type:Array,default(){return[]}},type:{type:String,default:"MulSelectIssue"},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"view"},uiType:{type:String,default:"default"}},data(){return{issueMode:"view",searchTitle:zj.z("已选问题","b2.common.selected_question"),module_loaded:!1,loading:!1,opened:!1,selectedVals:[],category_cls:0}},watch:{value(e){this.selectedVals=_.clone(e)},mode(e){"view"===e?(this.issueMode="view",this.searchTitle=zj.z("已选问题","b2.common.selected_question")):(this.issueMode="add",this.searchTitle=zj.z("选择问题","b2.common.choice_question"))}},computed:{maxCount(){return _.hasIn(this.fieldConf,"check.max_count")?_.get(this.fieldConf,"check.max_count"):100}},mounted(){setTimeout((async()=>{"building_qm"==this.fieldConf.issue_src?(await zj.ui.loadPageComponent("IssueList","buildingqm3","list"),this.category_cls=23,console.log("动态加载安全检查模块组件")):(await zj.ui.loadPageComponent("IssueList","houseqm3","list"),this.category_cls=28,console.log("动态加载分户验收模块组件")),this.module_loaded=!0}),4)},methods:{selectIssueList(e){this.selectedVals=_.clone(e)},toClose(){this.opened=!1,this.selectedVals=[]},toOpen(){this.module_loaded&&(this.opened=!0,this.$nextTick((()=>{setTimeout((()=>{this.setDefaultSelected()}),4)})))},setDefaultSelected(){this.selectedVals=this.value?_.cloneDeep(this.value):[],this.$refs.issue_list&&(this.$refs.issue_list.selectedIds=_.clone(this.selectedVals),this.$refs.issue_list.loadIssueList())},onSubmit(){this.$emit("input",this.selectedVals),this.$emit("change",this.selectedVals),this.toClose()}}},r=(n(8310),(0,n(4486).A)(i,a,[],!1,null,null,null));r.options.__file="components/lib/bpmSelectIssue/src/main.vue";var o=r.exports;o.install=function(e){e.component(o.name,o)};var s=o},9049:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-select-form-field",attrs:{value:e.curVal,type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.mode,orgInfo:e.orgInfo,formName:e.formName,uiType:e.uiType,isMultiple:e.multiple},on:{change:e.handleChange}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-select-edit",staticStyle:{display:"flex","align-items":"center"}},[n("el-select",e._g(e._b({key:e.isMultiple?"two":"one",attrs:{placeholder:e.placeholder,multiple:e.isMultiple,clearable:"",filterable:""},on:{change:e.onChange,focus:function(t){e.unitVisible=!0}},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-select",e.$attrs,!1),e.$listeners),e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.unitVisible&&e.showUnit,expression:"unitVisible && showUnit"}],staticStyle:{display:"flex"}},[n("span",{on:{click:function(t){e.unitVisible=!1}}},[e._v("《 ")]),e._v(" "),e.showUnit?n("select-unit",{staticStyle:{"margin-left":"5px","margin-right":"5px"},attrs:{fieldConf:e.fieldConf,formDefId:e.formDefId,orgInfo:e.orgInfo},on:{change:e.handleUnitChange}}):e._e(),e._v(" "),e.showUnit?n("el-select",{key:e.isMultiple?"two":"one",attrs:{placeholder:e.placeholder,multiple:e.isMultiple,filterable:"",remote:"","remote-method":e.remoteMethod},on:{change:e.onUnitChildsChange},model:{value:e.unitChildCurVal,callback:function(t){e.unitChildCurVal=t},expression:"unitChildCurVal"}},e._l(e.unitChildsOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1):e._e()],1)],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(7642),l=n(5281),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",{attrs:{placeholder:e.$z("单位选择","b2.common.unit_selection"),filterable:"",remote:""},on:{"remote-method":e.remoteMethod,change:e.handleUnitChange},model:{value:e.selectedTeam,callback:function(t){e.selectedTeam=t},expression:"selectedTeam"}},e._l(e.teams,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)};d._withStripped=!0;var c={name:"SelectUnit",props:["fieldConf","orgInfo","formDefId"],data(){return{selectedTeam:"",teams:[],teamMap:{},teamKeyword:"",debounceSearchTeams:_.debounce(_.bind(this.loadTeams,this),150,{trailing:!0,leading:!1})}},mounted(){this.loadTeams()},methods:{handleUnitChange(){this.$emit("change",this.selectedTeam)},async loadTeams(){let e=_.get(this.orgInfo,"page_level"),t=_.get(this.orgInfo,`${e}_id`);this.teams=await this.$bpm.searchTeamSelectOpts(this.fieldConf.id,{keyword:this.teamKeyword,[`${e}_id`]:t},this.formDefId),this.teamMap=_.keyBy(this.teams,"value")},remoteMethod(e){this.teamKeyword=e||"",this.debounceSearchTeams()}}},u=n(4486),m=(0,u.A)(c,d,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectUser/src/part/select-unit.vue";var f=m.exports;o().use(s.Select),o().use(s.Option);var h={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:f},data(){return{curVal:"",options:[],keyword:"",unit:{search_type:"",org_id:""},unitVisible:!1,unitChildCurVal:"",unitChildsOptions:[]}},watch:{value(){this.curVal=this.value,console.log("this.value",this.value),0==this.options.length&&this.value&&this.loadRemoteLabel(),this.showUnit&&this._setUnitChildCurVal(this.curVal)},getSelectOptions:function(e){console.log("----selectOptions----",e),this.transformOptions(e)}},inject:["selectOptions"],computed:{placeholder(){return this.fieldConf.desc||this.fieldConf.name},getSelectOptions(){return this.selectOptions?this.selectOptions():[]},showUnit(){return"SelectURUser"===this.type||"MulSelectURUser"===this.type}},created(){this.curVal=this.isMultiple?[]:""},mounted(){(this.fieldConf.perm||{visible:!0}).visible&&(console.log("mounted getting options"),this.loadSelectOpts()),this.curVal=this.value},methods:{async loadRemoteLabel(){console.log("this.value",this.value);let e=this.value;try{if(_.isObject(e))try{e=JSON.parse(e)}catch(e){console.log("error",e)}let t=_.isArray(e)?e:[e],n=_.get(this.fieldConf,"id");if(!_.isEmpty(t)){t=_.isArray(t)?t:[t];let e=await this.$bpm.fetchLabelByValues(t,n,this.formName,this.row);if(e=e.split(","),console.log("res",e),e&&e.length>0){let t=[];for(let n=0;n<this.curVal.length;n++)t.push({label:e[n],value:this.curVal[n]});this.options=t}}}finally{console.log("finally")}},handleUnitChange(e){let t=_.split(e,"$"),n=_.get(t,"0"),a=_.get(t,"1");this.unit={search_type:n,org_id:a},this.loadSelectOpts("",JSON.stringify(this.unit))},remoteMethod(e){let t="";this.showUnit&&this.unit.search_type&&(t=JSON.stringify(this.unit)),this.loadSelectOpts(e,t,!1)},async loadSelectOpts(e="",t="",n=!0){let a,i=this.fieldConf.id,r={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){console.log("UserTaskCC is getting options");const e=this.fieldConf.node;a=await l.A.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},r)}else a=await l.A.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:i,orgInfo:this.orgInfo,isDm:this.dm},r);const o=_.get(a.data,"data.data",[]);return this.transformOptions(o,n)},transformOptions(e,t=!0){console.log("transformOptions origin: ",e);let n=_.map(e,(e=>({value:e[0],label:e[1]})));return this.options=this.options.concat(n),this.options=_.uniqBy(this.options,"value"),this.showUnit?(this.options=this.options.concat(n),this.options=_.uniqBy(this.options,"value"),this.unitChildsOptions=n,t&&this._setUnitChildCurVal(this.curVal)):this.options=n,console.log("options: ",n),n},_setUnitChildCurVal(e){if(this.isMultiple){let t=[];_.each(e,(e=>{_.find(this.unitChildsOptions,{value:e})&&t.push(e)})),this.unitChildCurVal=t}},onChange(e){this.$emit("input",e),this.$emit("change",e)},onUnitChildsChange(e){if(console.log("onUnitChildsChange",e),this.isMultiple){_.each(e,(e=>{_.isArray(this.curVal)&&(_.includes(this.curVal,e)||this.curVal.push(e))}));let t=[];_.each(this.curVal,(e=>{console.log("this.unitChildsOptions",this.unitChildsOptions),console.log("this.unitChildsOptions-item",e),!_.includes(this.unitChildCurVal,e)&&_.find(this.unitChildsOptions,{value:e})||t.push(e)})),this.curVal=t}else this.curVal=e;this.$emit("input",this.curVal),this.$emit("change",this.curVal)}}},p=(0,u.A)(h,i,[],!1,null,null,null);p.options.__file="components/lib/bpmSelectUser/src/part/editor.vue";var g=p.exports,y={mixins:[n(7348).A]},b=(0,u.A)(y,void 0,void 0,!1,null,null,null);b.options.__file="components/lib/bpmSelectUser/src/part/reader.vue";var v=b.exports,w={name:"BpmSelectFromField",components:{editorComponent:g,readerComponent:v},props:{value:{type:[Array,Number,String]},type:{type:String,default:"SelectFromField"},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?v:g},multiple(){let e=this.isMultiple||0===this.type.indexOf("Mul");return"UserTaskCC"===this.type&&this.fieldConf.selecter&&(e=0===(this.fieldConf.selecter.type||"MulSelectUser4CC").indexOf("Mul")),e}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},M=(0,u.A)(w,a,[],!1,null,null,null);M.options.__file="components/lib/bpmSelectUser/src/main.vue";var L=M.exports;L.install=function(e){e.component(L.name,L)};var k=L},1824:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return c}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-signature",staticStyle:{position:"relative","max-width":"600px"}},["edit"===e.mode?[e.openLastSign&&e.lastSign&&e.curSign?n("div",{staticStyle:{"border-color":"#fff"}},[n("bpm-mul-image",{staticClass:"signature-reader",attrs:{type:"Signature",value:e.curSign},on:{imgLoadError:e.handleImgLoadError}})],1):e._e(),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!(e.openLastSign&&e.lastSign&&e.curSign),expression:"!(openLastSign && lastSign && curSign)"}],staticClass:"canvas-box"},[n("canvas",{ref:"canvasElem",staticStyle:{cursor:"crosshair",width:"100%",height:"320px",border:"1px dashed #c9c5c5"},attrs:{height:"320",width:"600"}})]),e._v(" "),n("div",{staticClass:"action-wrap"},[e.openLastSign?n("el-checkbox",{staticStyle:{"margin-right":"10px"},attrs:{label:e.$z("保留签名以备下次调用","b2.common.sign_for_next_use")},model:{value:e.useNextUser,callback:function(t){e.useNextUser=t},expression:"useNextUser"}}):e._e(),e._v(" "),n("el-button",{attrs:{size:"default"},on:{click:e.clearSignature}},[e._v(e._s(e.$z("重置签名","b2.common.reset_sign")))])],1)]:n("bpm-mul-image",{staticClass:"signature-reader",attrs:{fieldConf:{type:"Signature"},value:e.curSign}})],2)};a._withStripped=!0;var i=n(2554);function r(e,t,n={},a={}){if(!(this instanceof r))return new r(e,n);if(!e)return;let{width:i,height:o}=window.getComputedStyle(e,null);i=i.replace("px",""),o=o.replace("px",""),console.log("canvas size: ",i,o),i=i&&"auto"!==i&&-1===i.indexOf("%")?i:600,o=o&&"auto"!==o&&-1===o.indexOf("%")?o:320,console.log(e),this.canvas=e,this.context=e.getContext("2d"),this.width=i,this.height=o;const s=this.context,l=window.devicePixelRatio;l?(e.style.width=`${i}px`,e.style.height=`${o}px`,e.height=o*l,e.width=i*l,s.scale(l,l)):(e.width=i,e.height=o),s.lineWidth=2,s.strokeStyle="black",s.lineCap="round",s.lineJoin="round",Object.assign(s,n);const d={},c=/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);c||(s.shadowBlur=1,s.shadowColor="black");let u=!1;const m=t=>n=>{if(n.preventDefault(),1===t&&(u=!0),1===t||u){const{left:a,top:i}=e.getBoundingClientRect();n=c?n.touches[0]:n,d.x=n.clientX-a+.5,d.y=n.clientY-i+.5,(e=>{switch(e){case 1:s.beginPath(),s.moveTo(d.x,d.y);break;case 2:s.lineTo(d.x,d.y),s.stroke()}})(t)}},f=m(1),h=m(2),p=window.requestAnimationFrame,_=p?e=>{p((()=>{h(e)}))}:h;if(c?(e.addEventListener("touchstart",f),e.addEventListener("touchmove",_)):(e.addEventListener("mousedown",f),e.addEventListener("mousemove",_),["mouseup","mouseleave"].forEach((t=>{e.addEventListener(t,(()=>{u=!1}))}))),"number"==typeof t)switch(this.degree=t,s.rotate(t*Math.PI/180),t){case-90:s.translate(-o,0);break;case 90:s.translate(0,-i);break;case-180:case 180:s.translate(-i,-o)}}r.prototype={scale(e,t,n=this.canvas){const a=n.width,i=n.height;if(t=t||i,(e=e||a)!==a||t!==i){const r=document.createElement("canvas"),o=r.getContext("2d");r.width=e,r.height=t,o.drawImage(n,0,0,a,i,0,0,e,t),n=r}return n},rotate(e,t=this.canvas){if(0!=(e=~~e)){const n=180,a=-90;e>n?e=n:e<a&&(e=a);const i=document.createElement("canvas"),r=i.getContext("2d"),o=t.height,s=t.width,l=e*Math.PI/180;switch(e){case-90:i.width=o,i.height=s,r.rotate(l),r.drawImage(t,-s,0);break;case 90:i.width=o,i.height=s,r.rotate(l),r.drawImage(t,0,-o);break;case 180:i.width=s,i.height=o,r.rotate(l),r.drawImage(t,-s,-o)}t=i}return t},getPNGImage(e=this.canvas){return e.toDataURL("image/png")},getJPGImage(e=this.canvas){return e.toDataURL("image/jpeg",.5)},downloadPNGImage(e){const t=e.replace("image/png","image/octet-stream;Content-Disposition:attachment;filename=test.png");window.location.href=t},dataURLtoBlob(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],a=atob(t[1]);let i=a.length;const r=new Uint8Array(i);for(;i--;)r[i]=a.charCodeAt(i);return new Blob([r],{type:n})},clear(){let e,t;switch(this.degree){case-90:case 90:e=this.height,t=this.width;break;default:e=this.width,t=this.height}this.context.clearRect(0,0,e,t)},upload(e,t,n,a){const i=new FormData,r=new XMLHttpRequest;r.withCredentials=!0,i.append("image",e,"sign"),r.open("POST",t,!0),r.onload=()=>{r.status>=200&&r.status<300||304===r.status?n(r.responseText):a()},r.onerror=e=>{"function"==typeof a?a(e):console.log(`upload img error: ${e}`)},r.send(i)}};var o=r,s={name:"BpmSignature",components:{BpmMulImage:i.default},props:{value:{type:String},type:{type:String,default:"Signature"},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"edit"},uiType:{type:String,default:"default"},container:{type:[Object,null],default(){return null}}},data(){return{curSign:"",hasDraw:!1,openLastSign:!0,lastSign:"",useNextUser:!0,canvas:null,timer:null}},watch:{value(e){console.log("bpmSignature_value",e),e&&(this.curSign=e)},curSign(e){console.log("curSign",e),this.$emit("input",e),this.$emit("change",e,{open:this.openLastSign,for_next_use:this.useNextUser,signature:this.curSign})}},created(){this.value&&(this.curSign=this.value)},mounted(){if("edit"===this.mode){setTimeout((()=>{this.initCanvas()}),300);let e=this.container;e&&(e.$on("afterFormSubmit",(e=>{console.log("Singnature topContainer afterFormSubmit"),!e&&this.openLastSign&&this.curSign&&(console.log("to save signature: ",this.curSign,this.useNextUser),this.$bpm.postEleSign(this.curSign,this.useNextUser))})),e.$on("dataLoaded",(e=>{console.log("Singnature topContainer dataLoaded"),this.onDataLoaded(e),this.curSign=null,this.handleInit()})))}},destroyed(){this.container&&!this.container.isQuote&&(this.container.$off("afterFormSubmit"),this.container.$off("dataLoaded"))},methods:{_getCanvasPixelCount(e){for(var t=e.getContext("2d"),n=t.getImageData(0,0,t.canvas.width,t.canvas.height).data,a=0,i=0;i<n.length;i+=4)0!==n[i+3]&&a++;return a},handleImgLoadError(){console.log("加载图片失败")},handleInit(){let e=this.$bpm.userSign;this.openLastSign=e.open,e.for_next_use&&(this.lastSign=e.signature),this.openLastSign&&this.lastSign&&(this.curSign=e.signature),e.for_next_use&&this.openLastSign&&(this.useNextUser=!0),this.$emit("input",this.curSign),this.$emit("change",this.curSign,e),console.log("userSign: ",e)},initCanvas(){if(this.hasDraw=!1,this.canvas&&(this.canvas.removeEventListener("touchstart",(function(){})),this.canvas.removeEventListener("mousedown",(function(){})),this.canvas.removeEventListener("touchend",(function(){})),this.canvas.removeEventListener("mouseup",(function(){}))),console.log("初始化initCanvas"),this.canvas=this.$refs.canvasElem,!this.canvas)return!1;this.draw=new o(this.canvas,-this.degree,{},{}),console.log("this.draw",this.draw),this.canvas.addEventListener("touchstart",(()=>{this.timer&&(clearTimeout(this.timer),this.timer=null),this.hasDraw=!0})),this.canvas.addEventListener("mousedown",(()=>{this.timer&&(clearTimeout(this.timer),this.timer=null),this.hasDraw=!0})),this.canvas.addEventListener("touchend",(()=>{this.timer||(this.timer=setTimeout((()=>{this.transToImg()}),1e3))})),this.canvas.addEventListener("mouseup",(()=>{this.timer||(console.log("mouseup"),this.timer=setTimeout((()=>{this.transToImg()}),1e3))})),this.canvas.addEventListener("mouseleave",(()=>{this.timer||(console.log("mouseleave"),this.timer=setTimeout((()=>{this.transToImg()}),1e3))}))},onDataLoaded(e){this.hasDraw=!1,this.draw&&this.draw.clear()},clearSignature(){this.hasDraw=!1,this.draw&&this.draw.clear(),this.curSign=null,this.lastSign="",setTimeout((()=>{this.initCanvas()}),300)},transToImg(){if(console.log("Canvas transToImg called"),this.draw){let e=this.draw.getPNGImage();if(console.log("Signature canvas img: ",e),this._getCanvasPixelCount(this.canvas)<2e3)return!1;this.uploadImage({basestr:e,type:"png",name:"签名图片.png",model:"userfile"},(e=>{this.curSign=e,this.timer=null,console.log("Signature img md5: ",e)}))}},uploadImage({basestr:e,type:t,name:n,model:a},i){let r=window.atob(e.split(",")[1]),o=new ArrayBuffer(r.length),s=new Uint8Array(o);for(let e=0;e<r.length;e++)s[e]=r.charCodeAt(e);let l,d=window.WebKitBlobBuilder||window.MozBlobBuilder;if(d){let e=new d;e.append(o),l=e.getBlob(t)}else l=new window.Blob([o],{type:t});let c=new FormData;c.append(a,l,n),zj.net.w.noapi({method:"POST",url:"/platform/v1/papi/app_file/upload/",data:c,processData:!1,contentType:!1}).then((e=>{i&&i(e.file_md5)}))}}},l=(0,n(4486).A)(s,a,[],!1,null,null,null);l.options.__file="components/lib/bpmSignature/src/main.vue";var d=l.exports;d.install=function(e){e.component(d.name,d)};var c=d},8243:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["table"===e.uiType?n("el-button",{attrs:{type:"text"},on:{click:function(t){e.showSubForm=!0}}},[e._v(e._s(e.$z("查看子表单","b2.common.view_subform")))]):"table"===e.showStyle?n("SubFormStyleTable",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,mode:e.mode,dm:e.dm,"max-height":e.maxHeight,"show-header":e.showHeader,resizable:e.resizable,"top-container":e.container,container:e.fieldSelf,linkageItem:e.linkageItem},on:{change:e.handleChange}},"SubFormStyleTable",e.$attrs,!1)):n("SubFormStyleCard",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,mode:e.mode,dm:e.dm,"max-height":e.maxHeight,"top-container":e.container,container:e.fieldSelf,linkageItem:e.linkageItem},on:{change:e.handleChange}},"SubFormStyleCard",e.$attrs,!1)),e._v(" "),"table"===e.uiType?n("el-dialog",{attrs:{title:e.subFormDialogTitle,visible:e.showSubForm,width:"50%"},on:{"update:visible":function(t){e.showSubForm=t},close:function(t){e.showSubForm=!1}}},[n("div",{staticStyle:{"max-height":"70vh",overflow:"auto"}},["table"===e.showStyle?n("SubFormStyleTable",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,mode:e.mode,dm:e.dm,"max-height":e.dialogTableMaxHeight,"show-header":!0,resizable:!0,"top-container":e.container,container:e.fieldSelf,linkageItem:e.linkageItem},on:{change:e.handleChange}},"SubFormStyleTable",e.$attrs,!1)):n("SubFormStyleCard",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,"top-container":e.container,container:e.fieldSelf,linkageItem:e.linkageItem,mode:e.mode,dm:e.dm},on:{change:e.handleChange}},"SubFormStyleCard",e.$attrs,!1))],1)]):e._e()],1)};a._withStripped=!0;var i=n(7520),r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.$z("单击可进行编辑","c.click_to_edit"),placement:"top",disabled:!("edit"==e.mode&&e.showSubformData.length>10&&!e.hadClickRow)}},[n("el-table",{key:"rowIndex",staticClass:"bpm-subform-table",staticStyle:{width:"100%"},attrs:{data:e.showSubformData,"max-height":e.maxHeight,"show-header":e.showHeader,resizable:e.resizable,border:"",stripe:""},on:{"row-click":e.rowClick}},[e.showIndex?n("el-table-column",{attrs:{type:"index",label:e.indexLabel,width:100},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.$index+1)+"\n\n "),e._l(e.hiddenColumns,(function(a){return[n("bpm-sub-form-field",e._b({directives:[{name:"show",rawName:"v-show",value:a.data.visible,expression:"col.data.visible"}],key:a.key,attrs:{type:a.data.type,fieldConf:a.data,mode:e.dm?e.mode:e.getFieldMode(a.data.perm,t.row),dm:e.dm,uiType:"table",rowIndex:t.row.rowIndex,container:e.container},on:{input:e.handleInput,change:e.handleChange},model:{value:t.row[a.id],callback:function(n){e.$set(t.row,a.id,n)},expression:"scope.row[col.id]"}},"bpm-sub-form-field",e.$attrs,!1))]}))]}}],null,!1,2409594641)}):e._e(),e._v(" "),e._l(e.showColumns,(function(t){return n("el-table-column",{key:t.key,attrs:{prop:t.id,label:(t.data.check&&t.data.check.required?"* ":"")+t.label,"min-width":t.minWidth,sortable:t.sortable,"sort-by":t.sortBy},scopedSlots:e._u([{key:"default",fn:function(a){return[n("bpm-sub-form-field",e._b({directives:[{name:"show",rawName:"v-show",value:t.data.visible,expression:"col.data.visible"}],attrs:{type:t.data.type,fieldConf:t.data,mode:e.dm?e.mode:e.getFieldMode(t.data.perm,a.row),dm:e.dm,uiType:"table",rowIndex:a.row.rowIndex,container:e.container},on:{input:e.handleInput,change:e.handleChange},model:{value:a.row[t.id],callback:function(n){e.$set(a.row,t.id,n)},expression:"scope.row[col.id]"}},"bpm-sub-form-field",e.$attrs,!1))]}}],null,!0)},[n("template",{slot:"header"},[t.data.check&&t.data.check.required?n("span",{staticStyle:{color:"#D84141"}},[e._v("* ")]):e._e(),e._v(" "),n("span",[e._v(e._s(t.label))])])],2)})),e._v(" "),e.canRemove&&e.countLimit.canRemove&&"edit"==e.mode?n("el-table-column",{attrs:{prop:"delete",label:e.$z("操作","c.operation"),width:100},scopedSlots:e._u([{key:"default",fn:function(t){return[e.canRemove&&e.countLimit.canRemove?n("el-button",{staticClass:"btn-delete",attrs:{type:"danger",icon:"el-icon-delete",circle:""},on:{click:function(n){return n.stopPropagation(),e.handleRemoveItem(t.row.rowIndex)}}}):e._e()]}}],null,!1,538655453)}):e._e()],2)],1),e._v(" "),e.canAdd&&e.countLimit.canAdd?n("el-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"default",icon:"el-icon-plus"},on:{click:e.handleAddItem}},[e._v(e._s(e.$z("添加项","c.add_item")))]):e._e()],1)};r._withStripped=!0;var o={props:{value:{type:Array,default(){return[]}},columns:{type:Array,default(){return[]}},subformPerm:{type:Object,default(){return{}}},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"view"},maxHeight:{type:[Number,String],default:500},container:{type:Object,default(){return{}}},topContainer:{type:Object,default(){return{}}}},data(){return{subformData:[],showSubformData:[],_oldVal:null,hasInit:!1,isEditingMap:{}}},computed:{form(){return this.topContainer},userId(){return _.get(this.$bpm.userInfo,"user_id",0)},maxId(){let e=_.map(this.subformData,"_meta.id");return _.max(e)||0},originItem(){let e={};const t={int:0,text:"",array:[],struct:[]};return this.columns.forEach((n=>{e[n.id]=t[n.data.value_type]||""})),e},canAdd(){return"edit"===this.mode&&(this.subformPerm.creatable||this.dm)},canRemove(){return"edit"===this.mode&&(this.subformPerm.deletable||this.dm)},min(){const e=_.get(this.fieldConf,"check.min_count",0),t=_.get(this.fieldConf,"check.xmin_count");return t?this.form.formData[t]||0:e},max(){const e=_.get(this.fieldConf,"check.max_count"),t=_.get(this.fieldConf,"check.xmax_count");return t?this.form.formData[t]||0:e},countLimit(){const e=this.min,t=this.max;let n=this.showSubformData.length;return{canAdd:!(t&&n>=t),canRemove:!(n<=e)}},showIndex(){return!!this.fieldConf.show_index},indexLabel(){return this.fieldConf.index_label||zj.z("序号","b2.common.subform_index")},groupField(){return _.get(this.fieldConf,"group_by.by","")},showField(){return _.get(this.fieldConf,"is_show_field")},readonly(){return!_.get(this.fieldConf,"perm.editable",!1)}},watch:{value:{handler(e){e&&_.isArray(e)?this.subformData=e:this.subformData=[]},immediate:!0},subformData:{handler(e){this.showSubformData=this.setData(e),console.log("this.showSubformData",this.showSubformData)},deep:!0,immediate:!0},min(e,t){this.addItemByMin(e)},max(e,t){let n=this.showSubformData.length;if(e&&n>e){let t=n-e,a=0;for(let e=this.subformData.length;e>0;e--){let n=this.subformData[e-1];n.visible&&a<t&&(this.handleRemoveItem(n.rowIndex,n),a++)}}}},mounted(){this.form.$once("dataLoaded",(e=>{this.addItemByMin(this.min)}))},methods:{getFieldMode(e,t){let n=this.mode;return!e||"edit"!==n||e.editable||e.writable?!this.isEditingMap[t._meta.id]&&this.showSubformData.length>10&&(n="view"):n="view",n},throttleEmit:_.throttle((function(){"edit"===this.mode&&(console.log("subForm change emit"),this.$emit("change",this.subformData))}),1e3),handleChange(e){console.log("field change: ",e),this.throttleEmit()},handleInput(e){console.log("field input: ",e)},async addItemByMin(e){if(_.get(this.fieldConf,"linkage"))return;let t=this.showSubformData.length;if(e&&t<e){let n=e-t;for(let e=0;e<n;e++)await this.handleAddItem()}},async handleAddItem(){let e=this.maxId+1,t=this.subformData.length,n=t>=1?this.subformData[t-1]:_.cloneDeep(this.originItem),a=_.get(this.fieldConf,"fill_in_last_fields",[]);n=_.pick(n,a),_.isEmpty(n)||delete n._meta,console.log("lastItem: ",n);let i={isNew:!0,_meta:{id:e,creator:this.userId,is_deleted:!1}};this.$set(this.isEditingMap,e,!0),i=_.merge(i,n),await this.linkageItem.fillDefault(i,[],this.mode),!this.subformData||_.isEmpty(this.subformData)?this.subformData=[i]:this.subformData.push(i),this.handleChange(),console.log("this.subformData",this.subformData);let{relyHandleList:r,firstId:o}=this.linkageItem.getRelyHandleList("sure000");_.set(this.relyHandleListMap,this.subformData.length-1,r),_.isEmpty(r)&&this.$bpm.$emit("initRelyComplete",this),o&&setTimeout((async()=>{let e=await this.linkageItem.loadLinkage(r,this.subformData,this.container.formData,this.fieldConf.id,this.subformData.length-1);_.map(e,((e,t)=>{this.$set(this.subformData[this.subformData.length-1],`${t}`,e)})),this.handleChange(),this.$bpm.$emit("handeInitRely",{id:o,rowIndex:this.subformData.length-1})}),500)},setData(e){let t=this.showField,n=_.filter(e,((e,n)=>{e.rowIndex=n;let a=!e._meta.is_deleted&&(!t||t&&(2==e[t]||!e[t]));return e.visible=a,a}));if(this.groupField&&this.$q.platform.is.desktop&&this.readonly){let e=_.groupBy(n,this.groupField);_.map(e,((e,t)=>{_.each(e,((e,n)=>{0==n&&(e._groupField=t)}))}))}return console.log("tableData",n),this._oldVal=JSON.stringify(e),n},handleRemoveItem(e,t){console.log("deleteRowIndex",e),console.log("deleteRowIndex.isEditingMap",this.isEditingMap),this.subformData[e].isNew?(console.log("删除子表单项"),this.subformData.splice(e,1)):(console.log("标记删除子表单项"),this.subformData[e]._meta.is_deleted=!0),this.handleChange()},handleEditItem(e){console.log("editRowIndex",e),this.subformData[e]&&this.$set(this.isEditingMap,this.subformData[e]._meta.id,!0)}}},s={name:"SubFormStyleTable",mixins:[o],props:{showHeader:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},linkageItem:{type:Object,default:function(){return{}}},mode:{type:String,default:"view"},dm:{type:Boolean,default(){return!1}}},data(){return{hadClickRow:!1}},methods:{rowClick(e,t,n){console.log("row",e),"edit"==this.mode&&this.showSubformData.length>10&&(this.hadClickRow=!0),this.handleEditItem(e.rowIndex,e)}},computed:{showColumns(){return _.filter(this.columns,(e=>{if(e.visible)return e}))},hiddenColumns(){return _.filter(this.columns,(e=>{if(!e.visible)return e}))}}},l=n(4486),d=(0,l.A)(s,r,[],!1,null,null,null);d.options.__file="components/lib/bpmSubForm/src/table.vue";var c=d.exports,u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:{overflow:"auto"}},[e._l(e.showSubformData,(function(t,a){return n("el-card",{key:a,staticClass:"bpm-subform-card",class:e.mode,attrs:{shadow:"hover","body-style":{padding:"10px 20px",overflow:"auto",position:"relative",paddingRight:e.canRemove?"70px":"20px"}}},[n("el-form",{attrs:{"label-width":"180px",inline:!1}},[e.showIndex?n("el-form-item",{attrs:{label:e.indexLabel}},[e._v("\n "+e._s(a+1)+"\n ")]):e._e(),e._v(" "),e._l(e.columns,(function(i){return n("el-form-item",{directives:[{name:"show",rawName:"v-show",value:i.visible&&i.data.visible,expression:"col.visible && col.data.visible"}],key:i.key,class:i.data.display&&(i.data.display.hide_name||"top"===i.data.display.label_position)?"no-label":"",attrs:{label:i.data.display&&(i.data.display.hide_name||"top"===i.data.display.label_position)?"":i.label,required:i.data.check&&i.data.check.required}},[i.data.display&&!i.data.display.hide_name&&"top"===i.data.display.label_position?n("div",{staticClass:"form-label-top"},[e._v(e._s(i.label))]):e._e(),e._v(" "),n("bpm-sub-form-field",e._b({ref:"bpmSubFormField",refInFor:!0,attrs:{type:i.data.type,fieldConf:i.data,mode:e.getFieldMode(i.data.perm,t),uiType:"form",rowIndex:a,container:e.container},on:{change:e.handleChange},model:{value:t[i.id],callback:function(n){e.$set(t,i.id,n)},expression:"item[col.id]"}},"bpm-sub-form-field",e.$attrs,!1))],1)}))],2),e._v(" "),e.canRemove&&e.countLimit.canRemove?n("el-button",{staticClass:"btn-delete",attrs:{type:"danger",icon:"el-icon-delete",circle:""},on:{click:function(n){return e.handleRemoveItem(t.rowIndex)}}}):e._e()],1)})),e._v(" "),e.canAdd&&e.countLimit.canAdd?n("el-button",{attrs:{type:"default",icon:"el-icon-plus"},on:{click:e.handleAddItem}},[e._v(e._s(e.$z("添加项","c.add_item")))]):e._e()],2)};u._withStripped=!0;var m={name:"SubFormStyleCard",mixins:[o],props:{linkageItem:{type:Object,default:function(){return{}}}}},f=(0,l.A)(m,u,[],!1,null,null,null);f.options.__file="components/lib/bpmSubForm/src/card.vue";var h=f.exports,p=n(4419);class g{constructor(e,t){this.penetrationZList=[],this.elementIdList=[],this.eleMap={},this.relyGraphData={nodes:[],edges:[]},this.elements=[],this.bpm=e,this.value=t}addStackArr(e,t,n){this.eleMap=t,this.elements=_.concat(this.elements,e),this.elementIdList=_.map(t,"id"),_.each(e,(e=>{n&&_.set(e,"parentId",n);let a=_.get(e,"linkage.depends",[]),i=_.get(e,"scope.depends",[]),r=_.get(e,"range_remote.depends",[]),o=_.concat(a,i);o=_.concat(o,r),n||(this.penetrationZList=_.concat(this.penetrationZList,o)),e.elements&&this.addStackArr(e.elements,t,e.id)})),this.createTopoGraph(e),this.penetrationZList=_.uniq(this.penetrationZList),this.penetrationZList=_.intersection(this.elementIdList,this.penetrationZList),this.relyGraphData.nodes.push({id:"sure000",name:"顶点"}),_.each(this.penetrationZList,(e=>{this.relyGraphData.edges.push({source:"sure000",target:e})}))}createTopoGraph(e){_.each(e,(e=>{let t=_.get(e,"mappings",[]),n=_.map(t,"local_field_id");_.each(n,(t=>{if(_.includes(this.elementIdList,t)){let n=_.get(this.eleMap,t);this.relyGraphData.nodes.push(n),this.relyGraphData.nodes.push(e),this.relyGraphData.edges.push({source:e.id,target:t})}}));let a=_.get(e,"linkage.depends",[]),i=_.get(e,"scope.depends",[]),r=_.get(e,"range_remote.depends",[]),o=_.concat(a,i);o=_.concat(o,r);let s=_.get(this.eleMap,e.id);if(_.each(o,(e=>{_.get(this.eleMap,e)||(_.pullAll(o,[e]),o=_.cloneDeep(o))})),o.length){let t=_.pullAll(this.penetrationZList,[e.id]);this.penetrationZList=_.cloneDeep(t)}_.each(o,(t=>{if(t&&e.id&&_.includes(this.elementIdList,t)){let n=_.get(this.eleMap,t);if(!n||!s)return;let a=s.id,i=_.get(this.eleMap,t);n&&!i&&(this.penetrationZList=_.replace(this.penetrationZList,t,a),this.penetrationZList=_.split(this.penetrationZList,",")),this.relyGraphData.nodes.push(e),this.relyGraphData.nodes.push(n),this.relyGraphData.edges.push({source:t,target:a})}e.elements&&this.createTopoGraph(e.elements)}))}))}getRelyHandleList(e,t){let n=[];const{breadthFirstSearch:a}=p.Algorithm;let i=null;return a(this.relyGraphData,e,{enter:({current:e,previous:t})=>{},leave:({current:a,previous:r})=>{i||a==e||t&&!_.includes(t,a)||(i=a),a!=e&&n.push(a)}}),{relyHandleList:n,firstId:i}}async loadLinkage(e,t,n,a,i){let r=[],o={};_.each(e,(e=>{let t=_.get(this.eleMap,e),a=_.get(t,"linkage.depends");if("Quote"==t.type&&(a=_.concat(a,_.get(t,"scope.depends"))),a=_.intersection(a,this.elementIdList),!_.isEmpty(a)){let t={calculate_type:"linkage",field_def_id:e},s=_.pick(n,a);o=_.merge(o,s),_.isNil(i)||_.set(t,"idx",i),r.push(t)}})),t&&_.set(o,a,t);let s=await this.bpm.loadResult({params:{cal_fields:r,fields:o}});return _.map(s.data,((e,t)=>{let n=_.get(this.eleMap,`${t}.type`);_.includes(["SelectFromForm","Quote"],n)&&(e=_.get(e,"data.form_id")),s.data[t]=e})),s.data}async fillDefault(e,t=[],n){let a=[];if(_.each(this.elements,(i=>{if(_.includes(t,i.id))return _.set(e,i.id,null),void this.setLocalCache(i.id,null,n);let r=_.get(e,i.id);if(!_.isNil(r))return;let o=_.get(i,"default.value.type");if("EVCConfig"==o){let t=_.get(i,"default.value.value",null);_.set(e,i.id,t),this.setLocalCache(i.id,t,n)}"EVCExpression"!=o&&"EVCFirstElem"!=o||a.push({calculate_type:"default",field_def_id:i.id})})),_.isEmpty(a))return;let i=await this.bpm.loadResult({params:{cal_fields:a}});_.map(i.data,((t,a)=>{let i=_.get(this.eleMap,`${a}.type`);_.includes(["SelectFromForm","Quote"],i)&&(t=_.get(t,"data.form_id")),_.includes(["MulSelectFromForm"],i)&&(t=_.map(t,"data.form_id")),_.set(e,a,t),this.setLocalCache(a,t,n)}))}setLocalCache(e,t,n){let a=_.get(this.eleMap,`${e}.value_type`);this.bpm.setLocalCache(n,`${e}.${a}`,t)}}var y={name:"BpmSubForm",components:{SubFormStyleTable:c,SubFormStyleCard:h},props:{value:{type:Array,default(){return[]}},type:{type:String,default:"XSubForm"},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"view"},uiType:{type:String,default:"default"},maxHeight:{type:[Number,String],default:500},showHeader:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},container:{type:Object,default:function(){return{}}},dm:{type:Boolean,default(){return!1}}},data(){return{subformData:[],dialogTableMaxHeight:500,showSubForm:!1,linkageItem:null,initLinkageFlag:!1,relyHandleList:[],relyHandleListMap:{}}},computed:{fieldSelf(){return this},columns(){const e=this.fieldConf.elements||[],t=[];return e.forEach((e=>{const n=i.Q[e.type]||{},a=e.perm||{visible:!0,editable:!0,writable:!0};if(this.dm||a.visible||a.editable||a.writable){e.visible=a.visible||this.dm;let i=this.mode;"edit"!==i||a.editable||a.writable||(i="view"),t.push({key:e.id,id:e.id,label:e.name||e.id,minWidth:n.tableColWidth||100,sortable:!0,sortBy:e.id,fieldMode:i,visible:a.visible,data:e})}})),t},subFormDialogTitle(){return this.fieldConf.name||this.fieldConf.id},showStyle(){return this.fieldConf.style||"table"},subformPerm(){return this.fieldConf.perm||{creatable:!1,deletable:!1,editable:!1,memorable:!1,modifiable:!1,visible:!0,writable:!1}},isSubForm(){return!0},elementIdList(){return _.map(this.fieldConf.elements,"id")},eleMap(){let e=this.fieldConf.elements,t=_.get(this.container,"formSchema.elements");return e=_.concat(e,t),_.keyBy(e,"id")}},watch:{value:{handler(e,t){e&&_.isArray(e)?(this.subformData=e,e!=t&&this.$nextTick((()=>{this.initLinkage()}))):this.subformData=[]},immediate:!0}},created(){this.linkageItem=new g(this.$bpm),this.dialogTableMaxHeight=Math.floor(window.innerHeight/100*70-114)},mounted(){this.linkageItem.addStackArr(this.fieldConf.elements,this.eleMap),console.log("重新渲染")},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)},initLinkage(){if(this.initLinkageFlag||0==this.subformData.length)return!1;console.log("初始化联动");let{relyHandleList:e}=this.linkageItem.getRelyHandleList("sure000");_.set(this.relyHandleListMap,this.value.length-1,e),console.log("relyHandleList",e),console.log("this.relyHandleListMap",this.relyHandleListMap),this.initLinkageFlag=!0,setTimeout((()=>{console.log("initRelyComplete_subFormInitLinkage",this),this.$bpm.$emit("initRelyComplete",this)}),1e3)},handleNextRely(e){console.log("sub-form-handleNextRely");let t=_.get(this.relyHandleListMap,e);console.log("sub-form-handleNextRely_relyHandleList",t),t&&t.shift(),_.isEmpty(t)&&this.$bpm.$emit("initRelyComplete",this);let n=_.head(t,e);n&&this.$bpm.$emit("handeInitRely",{id:n,rowIndex:e})},async handleRelyById(e,t){console.log("XSubForm handleRelyById"),console.log("sub-form-handleRelyById",e),console.log("sub-form-handleRelyById-rowIndex",t),console.log("sub-form-handleRelyById-this.elementIdList",this.elementIdList);let{relyHandleList:n,firstId:a}=this.linkageItem.getRelyHandleList(e);if(console.log("sub-form-handleRelyById-relyHandleList",n),console.log("sub-form-handleRelyById-firstId",a),_.set(this.relyHandleListMap,t,n),a){let e=await this.linkageItem.loadLinkage(n,this.value,this.container.formData,this.fieldConf.id,t);console.log("sub-form-handleRelyById-result",e),_.map(e,((e,n)=>{this.$set(this.value[t],`${n}`,e)})),this.$bpm.$emit("handeRelyById",{id:a,rowIndex:t})}},handleNextRelyById(e){console.log("sub-form-handleNextRelyById");let t=_.get(this.relyHandleListMap,e);console.log("sub-form-handleNextRelyById-relyHandleList",t),t.shift(),_.isEmpty(t)&&this.$bpm.$emit("initRelyComplete",this);let n=_.head(t);n&&this.$bpm.$emit("handeRelyById",{id:n,rowIndex:e})},setData(){}}},b=(0,l.A)(y,a,[],!1,null,"e0a458ce",null);b.options.__file="components/lib/bpmSubForm/src/main.vue";var v=b.exports;v.install=function(e){e.component(v.name,v)};var w=v},1849:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.curComponent?n(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-sub-form-field",attrs:{type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.fieldMode,uiType:e.uiType,formDefId:e.formDefId,orgInfo:e.orgInfo,dm:e.dm,clearable:e.clearable,disabled:e.fieldDisabled,isMultiple:e.isMul},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};a._withStripped=!0;var i=n(5554),r=n.n(i),o={name:"BpmSubFormField",mixins:[n(1464).A,function(){let e={props:["container","rowIndex","isNew","hideLabel"],data(){return{optAssWatchList:[],hasAddOptAssWatch:!1,defaultVal:null,firstListVal:null,loadedDefault:!1}},computed:{isSubForm(){return!1},topContainer(){return this.container.isSubForm?this.container.container:this.container},fieldSelf(){return this},fieldPath(){return this._getFieldPath()},readonly(){return!0},inner(){return this.$bpm.matchInnerComponent(this.fieldConf.type,this.readonly)}},created(){this.topContainer&&!this.dm&&(this.topContainer.$once("beforeSchemaLoad",(e=>{this.clearOptAssWatch()})),this.topContainer.$once("dataLoaded",(e=>{this.addOptAssWatch()}))),this.isNew&&!this.hasAddOptAssWatch&&(this.addOptAssWatch(),this.$emit("update:isNew",!1))},methods:{async getConfDefaultValue(){let e=_.get(this.fieldConf,"default.value.type");e=e||_.get(this.fieldConf,"default.value.type");let t=_.get(this.fieldConf,"default.value.value"),n=_.get(this.fieldConf,"default.type");return this.defaultVal||this.loadedDefault?this.defaultVal:("EVCConfig"==n&&(t=_.get(this.fieldConf,"default.value"),this.defaultVal=t),"EVCExpression"==e||"EVCExpression"==n?(this.defaultVal=await this.$bpm.loadValDefault({fieldId:this.fieldConf.id,params:{},cusFormName:this.container.cusFormId,container:this.container}),this.loadedDefault=!0,this.defaultVal):("EVCFirstElem"==_.get(this.fieldConf,"default.value.type")&&(t=this.firstListVal),this.defaultVal=t,this.loadedDefault=!0,t))},getTypeValidEmptyValue(){let e=this.fieldConf.value_type,t=this.fieldConf.type;switch(e){case"int":return 0;case"struct":return"Mul"==t.substr(0,3)||"OnlineEditor"==t||this.isSubForm?[]:{};default:return"Mul"==t.substr(0,3)||"OnlineEditor"==t||this.isSubForm?[]:""}},removeValue(){let e=this.container,t=e.value;e.isSubForm&&(t=_.get(t,[this.rowIndex])),t&&(this.value=null)},_getFieldPath(e=!1){return this.container.isSubForm?e?[this.container.fieldConf.id,this.rowIndex,this.fieldConf.id]:[this.rowIndex,this.fieldConf.id]:[this.fieldConf.id]},_getValue(){console.log("this.container",this.container);let e="";return this.container&&(e=_.get(this.container.value,this.fieldPath)),e},isPromise(e){return!!e&&"function"==typeof e.then},_setValue(e){let t=this.container,n=_.cloneDeep(t.value);if(t.isQuote)return;let a=_.last(this.fieldPath);if(t.isSubForm){n||(n=[]);let i=this.rowIndex;if(n[i])return void this.$set(t.value[i],a,e);t.isXSubForm?r().set(n,i,t.getItem(i)):r().set(n,i,{}),n=n[i];try{r().set(t.value,i,n)}catch(e){console.log("error",t.value)}}else r().set(t.value,a,e),console.log("container.value",t.value,a,e)},clearOptAssWatch(){this.hasAddOptAssWatch=!1,_.each(this.optAssWatchList,(e=>{e()}))},addOptAssWatch(){this.hasAddOptAssWatch=!0;let e=_.get(this.fieldConf,"optAssMap"),t=_.get(this.fieldConf,"perm.visible");if(!e||_.isEmpty(e)||!t)return;let n=0;_.map(e,((t,a)=>{a=_.replace(a,"&",".");let i=this.$watch(`row.f_fields.${a}`,(t=>{let n=!0;_.map(e,((e,t)=>{t=_.replace(t,"&",".");let a=_.get(this.row,`f_fields.${t}`);a=_.toString(a),n=n&&_.includes(e,a)})),this.fieldConf.perm.visible=n}),{immediate:0==n});n++,this.optAssWatchList.push(i)}))}}};return _.merge(e,{data(){return{unWatchList:[],valueUnWatch:null,valDependIds:[],selectDependIds:[],remoteDependIds:[],selectFields:null,selectList:[],quoteContent:{},unSelectDependValWatchList:[],optAssWatchList:[],hasAddOptAssWatch:!1,scopeDependIds:[],subFormOldValMap:{},isDelete:!1,displayHidden:!1,differenceRowIndexs:[],topContainerMode:null,nextRely:null,loading:!1,firstFill:!0,hasFillDefault:!1,remoteData:[]}},created(){this.topContainer&&!this.dm&&(this.topContainer.$once("beforeDataLoad",(e=>{this.toggleValueWatch(!1),this.clearOptAssWatch()})),this.topContainer.$once("dataLoaded",(e=>{this.getMemory(),this.addOptAssWatch()})),this.topContainer.$once("beforeReloadData",(e=>{this.toggleValueWatch(!1)}))),this.getMemory(),this.addOptAssWatch(),this.$emit("update:isNew",!1),this.$bpm.$on("beforeFormSubmit",(({mode:e,formData:t,cc:n,_formData:a})=>{console.log("触发SubForm ,beforeFormSubmit");let i=this._getFieldPath(!0),r=_.get(a,i),o=_.get(this.fieldConf,"check.required",!1);if((_.isNull(this.value)&&o||"SelectHouseOwner"==this.fieldConf.type&&(!this.value.name||!this.value.phone)&&o)&&_.unset(t,i),_.isArray(this.value)&&_.isEmpty(this.value)||_.isNil(this.value)||""==this.value&&0!==this.value){let e=_.get(this.fieldConf,"check.min_length");e=e||_.get(this.fieldConf,"check.min"),e=e||_.get(this.fieldConf,"check.min_count"),e||o||!r||_.unset(t,i)}let s=this.container,l=s.isSubForm,d=_.get(this.fieldConf,"optAssMap");if(!d||_.isEmpty(d))return;let c=!0;_.map(d,((e,t)=>{t=t.replace(/&/g,".");let n=_.split(t,".");n=_.last(n);let a=_.get(this.elementMap,`${n}.type`),i=!!a&&"Mul"==a.substr(0,3);this._getPath(n)!=n&&l&&(t=`${s.fieldConf.id}&${this.rowIndex}&${n}`),t=t.replace(/&/g,".");let r=_.get(this.form,`formData.${t}`);if(i);else{let t=_.toString(r);c=c&&_.includes(e,t)}})),c||_.unset(t,i)})),this.$bpm.$on("afterFormSubmit",(({mode:e,errors:t})=>{if(console.log("触发SubForm ,afterFormSubmit"),!t&&this.memorable){let t=this.fieldConf.id,n=_.get(this.fieldConf,"value_type");this.$bpm.setMemory(e,`${t}.${n}`,this.value)}})),this.$bpm.$on("handeInitRely",(async({id:e,rowIndex:t,oid:n,lastField:a})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||(this.topContainer.isCache?this.openRelyInitLoadOnCache(n,a):this.openInitRelyLoad(n,a))})),this.$bpm.$on("initRelyComplete",(async(e,t)=>{e===this.container?(console.log("触发SubForm initRelyComplete"),this.hasFillDefault||await this.fillDefaultValue(),this.valueUnWatch||await this.toggleValueWatch(!0),this.addOptAssWatch(),t&&this.$emit("valueChanged")):console.log("container不等,没能触发SubForm initRelyComplete")})),this.$bpm.$on("handeRelyById",(({id:e,rowIndex:t,oid:n,lastField:a})=>{console.log("触发SubForm ,handeRelyById",e),console.log("触发SubForm ,handeRelyById_rowIndex",t),console.log("触发SubForm ,handeRelyById_oid",n),console.log("触发SubForm ,handeRelyById_lastField",a),console.log("SubForm-this.fieldConf",this.fieldConf),console.log("SubForm-this.container",this.container),e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||this.opeRelyById(n,a)}))},provide(){return{getSelectFields:()=>this.selectFields,selectOptions:()=>this.selectList}},destroyed(){this.toggleValueWatch(!1),console.log("this.container.isQuote",this.container.isQuote)},computed:{form(){return this.topContainer},readonly(){return!_.get(this.fieldConf,"perm.editable",!1)},disWritable(){return!_.get(this.fieldConf,"perm.editable",!1)&&!_.get(this.fieldConf,"perm.writable",!1)},memorable(){return _.get(this.fieldConf,"perm.memorable",!1)},isDetailMode(){return"detail"==this.form.mode},isDeleteMode(){return"delete"==this.form.mode},elements(){return _.get(this.form,"formSchema.elements",[])},elementMap(){let e={},t=this.elements;return _.each(t,(t=>{_.set(e,t.id,t),_.each(t.elements||[],(n=>{_.set(e,t.id,t)}))})),e},description(){return _.get(this.fieldConf,"desc","")},hideName(){return _.get(this.fieldConf,"display.hide_name",!1)},visualAttrs(){let e=this._getFieldPath(!0).join("."),t=this.form.formErrors,n=!!t&&t[e],a=this.fieldConf,i=[],r=_.get(a,"perm.visible",!1);_.get(a,"check.required",!1)&&!this.isDetailMode&&i.push("q-field-required"),r&&!this.displayHidden||i.push("q-field-hidden"),this.readonly&&i.push("readonly");let o=_.get(this.fieldConf,"display.hide_name",!1),s=_.get(this.fieldConf,"display.is_tip",!1);o&&i.push("hide-name"),s&&i.push("tip-field"),n&&this.scrollToElement();let l=this.$bpm.isVerticalTypography,d=_.includes(["MulImage","SubForm","XSubForm","MulFile","Spliter","Signature"],a.type);return l=l&&!_.includes(["SubForm","XSubForm","Spliter"],a.type),l&&i.push("col-4"),"SelectHouseOwner"==a.type&&i.push("select-house-owner"),{filled:!0,hideHint:!0,disable:!_.get(a,"perm.editable",!0),error:!!n,errorLabel:_.get(n,"message",""),class:i,orientation:d||l?"vertical":"horizontal"}},isRelyId(){return _.includes(this.topContainer.relyIds,this.fieldConf.id)},isVerticalTypography(){return this.$bpm.isVerticalTypography}},mounted(){this.description&&this.insertDesc()},methods:{getMemory(){if(!this.memorable||this.value)return;let e=this.fieldConf.id,t=_.get(this.fieldConf,"value_type");this.topContainerMode=this.topContainer.mode,this.$bpm.checkMemory(this.topContainerMode,(n=>{let a=_.get(n,`f_fields.${e}.${t}`);this.value=a,this.setLocalCache(this.value)}),(()=>{}))},scrollToElement(){},async openRelyInitLoadOnCache(e,t){await this.loadSelectByDepends(),await this.loadRemoteByDepends(!0),this.$emit("valueChanged"),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.loading=!1,this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex,e,t)},async openInitRelyLoad(e,t){console.log("SubForm-openInitRelyLoad"),await this.loadSelectByDepends(),await this.loadRemoteByDepends(!0),await this.loadRemoteByFieldMap(e),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.$emit("valueChanged"),this.loading=!1,this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex,e,t)},async opeRelyById(e,t){await this.fillDefaultValue(),await this.loadSelectByDepends(),await this.loadRemoteByDepends(),await this.loadRemoteByFieldMap(e),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.loading=!1,this.container.handleNextRelyById&&await this.container.handleNextRelyById(this.rowIndex,e,t)},async getBreakResult(e){let t=this.$bpm.breakRelyMap,n=_.get(t,e);return _.includes(n,this.fieldConf.id)},async fillDefaultValue(){let e=this.topContainer.resetFields;if(_.includes(e,this.fieldConf.id))return this.value=null,this.setLocalCache(this.value),this.loading=!1,void(this.hasFillDefault=!0);if(_.isNil(this.value)){let e=await this.getConfDefaultValue();_.isNil(e)||(this.value=e,this.setLocalCache(this.value))}this.loading=!1,this.hasFillDefault=!0},async getConfDefaultValue(){if("EVCConfig"==_.get(this.conf,"default.value.type"))return _.get(this.conf,"default.value.value")},isPromise(e){return!!e&&"function"==typeof e.then},toggleValueWatch(e=!0){if(this.valueUnWatch&&(this.valueUnWatch(),this.valueUnWatch=!1),e){let e=JSON.stringify(this.value);this.valueUnWatch=this.$watch("value",(async(t,n)=>{if(console.log("subformField: ",t,n),this.$bpm.SubFormLinkingCount?this.$bpm.SubFormLinkingCount++:this.$bpm.SubFormLinkingCount=1,this.$bpm.SubFormLinkingCount>6)return console.log("subForm组件联动触发过多,终止剩余触发"),!1;if(this.$bpm.SubFormLinkingCountSetTimeOut&&(clearTimeout(this.$bpm.SubFormLinkingCountSetTimeOut),this.$bpm.SubFormLinkingCountSetTimeOut=null),this.$bpm.SubFormLinkingCountSetTimeOut=setTimeout((()=>{this.$bpm.SubFormLinkingCount=0}),3e3),this.isSubForm||"Area"==this.fieldConf.type||"MulArea"==this.fieldConf.type){let n=JSON.stringify(t);if(e==n)return void(this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex))}else if(n==t)return void(this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex));if(e=JSON.stringify(t),console.log("subForm组件触发了,valueChanged"),this.$emit("valueChanged"),this.setLocalCache(t),console.log("subFormthis.container",this.container),console.log("subFormthis.fieldConf",this.fieldConf),(!this.container.isSubForm||this.container.isSubForm&&(!_.isUndefined(n)||!_.isUndefined(t)))&&this.container&&this.container.handleRelyById){await this.loadRemoteByFieldMap();let e=_.get(this.fieldConf,"mappings");console.log("subFormMappings",e),e=_.keys(e),await this.container.handleRelyById(this.fieldConf.id,this.rowIndex,e)}this.firstFill=!1}),{immediate:!1,deep:!0})}},setLocalCache(e){let t=this.fieldConf.id,n=this.container.mode,a=_.get(this.fieldConf,"value_type");this.$bpm.setLocalCache(n,`${t}.${a}`,e)},loadSelectListPre(e){this.$refs.fieldComp&&this.$refs.fieldComp.preSearch&&this.$refs.fieldComp.preSearch(e)},loadSelectByDepends(){this.readonly||(this.selectDependIds=_.get(this.fieldConf,"range_remote.depends",[]),this.loadSelectLinkage({fieldId:this.fieldConf.id},(e=>{if("Quote"==this.fieldConf.type)return this.value=_.map(e.data,"form_id"),this.quoteContent=e,void(this.loading=!1);this.selectList=e,this.loading=!1})))},async loadRemoteByDepends(e){if("OrderSubForm"==this.fieldConf.type&&(this.remoteDependIds=_.get(this.fieldConf,"remote.depends",[]),this.remoteDependIds.length||e)){let t=this.remoteDependIds,n=this.getDependData(t);if(_.map(n,((e,t)=>{_.isUndefined(e)&&_.unset(n,t)})),_.isEmpty(n)&&!e)return void(this.loading=!1);let a={fields:n,include_sup:!0},i=this.fieldConf.id,r=await this.$bpm.loadSelectRemoteForm({fieldId:i,params:a,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container});this.remoteData=r,this.loading=!1}},_getPath(e){let t=this.elements,n=e;return _.each(t,(t=>{_.each(t.elements||[],(a=>{a.id==e&&(n=t.id)}))})),n},getDependData(e){let t=this.topContainer.formData,n={};return _.each(e,(e=>{let a=this._getPath(e),i=_.get(t,a);if(e!=a){let t=[];_.each(i,((n,a)=>{let i={},r=_.get(n,e);(r||0===r)&&_.set(i,e,r),_.hasIn(n,"_meta")&&_.set(i,"_meta",n._meta),t.push(i)})),n[a]&&(t=_.merge(n[a],t)),i=t}_.isArray(i)&&_.each(i,(e=>{_.unset(e,"isNew")})),a&&_.set(n,a,i)})),n},loadSelectDepends(){let e=_.get(this.fieldConf,"range_remote.depends",[]),t=this.getDependData(e);_.isEmpty(t)||(this.selectFields=JSON.stringify(t))},async loadSelectLinkage({fieldId:e,mergeParams:t,dependVal:n,isForceLoad:a},i){let r=_.get(this.fieldConf,"range_remote.depends",[]),o=this.getDependData(r);if(console.log("dependData",o),_.isEmpty(o))return;this.selectFields=JSON.stringify(o);let s={fields:JSON.stringify(o)};this.container.isSubForm&&_.set(s,"idx",this.rowIndex);let l=this.fieldConf.type;"OnlineEditor"==l&&(s={spec:JSON.stringify(o)}),t&&(s=_.merge(s,t));let d=null;return d=_.includes(["MulSelectCheckItem","SelectRootCategory","SelectCheckItem","SelectSort","MulSelectSort"],l)?await this.$bpm.loadSelectLinkageResult({fieldId:e,params:s,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),filed:this.fieldSelf,container:this.container}):await this.$bpm.searchSelectOpts(e,"",this.container.cusFormId||_.get(this.container,"form.cusFormId"),this.fieldSelf,!1,s,!1),i&&i(d),d},addOptAssWatch(){if(this.hasAddOptAssWatch)return;let e=_.get(this.fieldConf,"optAssMap"),t=_.get(this.fieldConf,"perm.visible");if(!e||_.isEmpty(e)||!t)return;let n=this.container,a=n.isSubForm;_.map(e,((t,i)=>{i=i.replace(/&/g,".");let r=_.split(i,".");r=_.last(r);let o=this._getPath(r);const s=_.get(this.elementMap,n.fieldConf.id),l=_.get(s,"elements",[]),d=_.keyBy(l,"id");let c=_.get(d,`${r}.type`),u=!!c&&"Mul"==c.substr(0,3);if(!c)return;let m=this.$watch(`form.formData.${n.fieldConf.id}`,(()=>{let t=!0;_.map(e,((e,i)=>{o!=r&&a&&(i=`${n.fieldConf.id}&${this.rowIndex}&${r}`),i=i.replace(/&/g,".");let s=_.get(this.form,`formData.${i}`);if(u){let n=!1;_.each(s,(t=>{t=_.toString(t),_.includes(e,t)&&(n=!0)})),t=t&&n}else s=_.toString(s),t=t&&_.includes(e,s)})),a?(this.displayHidden=!t,this.fieldConf.visible=t):this.fieldConf.perm.visible=t,this.isDelete=!t,console.log("BpmSubFormField watch: visible",t)}),{immediate:!0,deep:!0});this.optAssWatchList.push(m)})),this.hasAddOptAssWatch=!0},clearOptAssWatch(){this.hasAddOptAssWatch=!1,_.each(this.optAssWatchList,(e=>{e()}))},insertDesc(){this.$refs.field},async loadRemoteByFieldMap(e){let t=_.get(this.fieldConf,"mappings");if(console.log("mappings",t),"SelectFromForm"!=this.fieldConf.type||!t||_.isEmpty(t))return;let n=await this.getRemoteByFieldMap();if(!n){let e={};_.each(t,(t=>{e[t.local_field_id]=null})),console.log("_mappingsResult",e),n=e}this.container&&this.container.changeValueByMapping&&this.container.changeValueByMapping(e,n)},async getRemoteByFieldMap(){let e=_.get(this.fieldConf,"mappings");if("SelectFromForm"!=this.fieldConf.type||!e||_.isEmpty(e)||!this.value)return;let t=_.get(this.fieldConf,"id");return(await this.$bpm.loadRmoteFieldMap({fieldId:t,params:{form_id:this.value},cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container})).data}}}),e}()]},s=(0,n(4486).A)(o,a,[],!1,null,null,null);s.options.__file="components/lib/bpmSubFormField/src/main.vue";var l=s.exports;l.install=function(e){e.component(l.name,l)};var d=l},2656:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select",attrs:{value:e.curVal,fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-time-edit"},[n("el-time-select",{ref:"component",attrs:{"format-model":"number",format:e.format,"value-format":e.checkFormat,"picker-options":{start:"00:00",step:"00:15",end:"24:00"},clearable:e.clearable,disabled:e.disabled},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642);l().use(d.TimeSelect);var c={data(){return{curVal:""}},props:["value","fieldConf","row","clearable","disabled"],watch:{value(){this.curVal=this.value}},computed:{format(){return o().get(this.fieldConf,"view.format")},checkFormat(){return o().get(this.fieldConf,"check.format")}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("change",e)}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmTime/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",[e._v(e._s(e.value))])};h._withStripped=!0;var p={props:["value","fieldConf","row"],data(){return{}},computed:{},watch:{},mounted(){},methods:{}},_=(0,u.A)(p,h,[],!1,null,null,null);_.options.__file="components/lib/bpmTime/src/part/reader.vue";var g=_.exports,y={name:"BpmTime",components:{editorComponent:f,readerComponent:g},props:{value:{type:[String,Number]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?g:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},b=(0,u.A)(y,a,[],!1,null,null,null);b.options.__file="components/lib/bpmTime/src/main.vue";var v=b.exports;v.install=function(e){e.component(v.name,v)};var w=v},5881:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o}});var a=function(){var e=this;e.$createElement;return e._self._c,e._m(0)};a._withStripped=!0;var i=(0,n(4486).A)({name:"Demo"},a,[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"m-demo"},[e._v("demo1")])])}],!1,null,null,null);i.options.__file="components/lib/demo/src/main.vue";var r=i.exports;r.install=function(e){e.component(r.name,r)};var o=r},6751:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o}});var a=function(){var e=this;e.$createElement;return e._self._c,e._m(0)};a._withStripped=!0;var i=(0,n(4486).A)({name:"Demo2"},a,[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"m-demo"},[e._v("demo2")])])}],!1,null,null,null);i.options.__file="components/lib/demo2/src/main.vue";var r=i.exports;r.install=function(e){e.component(r.name,r)};var o=r},7520:function(e,t,n){"use strict";n.d(t,{Q:function(){return o}});let a=[{key:"lt",name:"早于"},{key:"gt",name:"晚于"},{key:"gte",name:"不早于"},{key:"lte",name:"不晚于"}],i=[{key:"in",name:"在列表中"}],r=[{key:"in",name:"在列表中"},{key:"all",name:"包含所有"}];const o={Text:{name:"单行文本",hasBpmField:!0,tableColWidth:240,actions:[{key:"contains",name:"包含"},{key:"eq",name:"等于"}],attrs:["type","value_type","id","name","linkage"]},TextArea:{name:"多行文本",hasBpmField:!0,tableColWidth:300,actions:[{key:"contains",name:"包含"},{key:"eq",name:"等于"}],attrs:["type","value_type","id","name","linkage"]},SerialNumber:{name:"流水号",hasBpmField:!0,actions:[{key:"contains",name:"包含"}],options:{type:"Text"},attrs:["type","id","name","linkage"]},Number:{name:"数字",hasBpmField:!0,tableColWidth:200,actions:[{key:"eq",name:"等于"},{key:"gt",name:"大于"},{key:"gte",name:"大于等于"},{key:"lt",name:"小于"},{key:"lte",name:"小于等于"},{key:"ne",name:"不等于"}],attrs:["type","id","name","value_type","is_int","view.precision","linkage"]},DateTime:{name:"日期时间选择器",tableColWidth:240,hasBpmField:!0,actions:a,attrs:["type","id","name","check.format","view.format","linkage"]},Date:{name:"日期选择器",tableColWidth:240,hasBpmField:!0,actions:a,attrs:["type","id","name","check.format","view.format","linkage"]},Time:{name:"时间选择器",hasBpmField:!0,tableColWidth:240,actions:a,attrs:["type","id","name","check.format","view.format","linkage"]},Timestamp:{name:"※时间戳",tableColWidth:240,actions:a,attrs:["type","id","name","check.format","view.format","linkage"]},Select:{name:"单选",hasBpmField:!0,tableColWidth:220,actions:i,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},Status:{name:"状态",hasBpmField:!0,tableColWidth:150,actions:i,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},MulSelect:{name:"多选",hasBpmField:!0,tableColWidth:220,actions:r,attrs:["type","id","name","value_type","result_type","style","range_enum","linkage"]},SelectFromForm:{name:"远程单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFromForm"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},MulSelectFromForm:{name:"远程多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},SelectFromMulForm:{name:"关联组件",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","range_remote","value_type"]},SelectProject:{name:"项目单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectProject"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectProject:{name:"项目多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectUser:{name:"用户单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectUser"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectUser:{name:"用户多项选择",hasBpmField:!0,tableColWidth:200,actions:r,options:{type:"MulSelectUser"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectURUser:{name:"用户单项选择(新)",hasBpmField:!0,tableColWidth:400,actions:i,options:{type:"MulSelectURUser"},attrs:["type","id","name","range_remote","value_type","filters","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectURUser:{name:"用户多项选择(新)",hasBpmField:!0,tableColWidth:400,actions:r,options:{type:"MulSelectURUser"},attrs:["type","id","name","range_remote","value_type","filters","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectRootCategory:{name:"根任务类型选择",hasBpmField:!0,tableColWidth:200,actions:[{key:"eq",name:"等于"}],attrs:["type","id","name","category_cls","value_type","linkage"]},SelectCheckItem:{name:"检查项单项选择",hasBpmField:!0,actions:i,tableColWidth:200,options:{type:"MulSelectCheckItem"},attrs:["type","id","name","category_cls","value_type","range_remote","root_category","tree_select","can_select","can_select.filter_expression","range_remote.filter_expression","range_remote.depends","linkage"]},MulSelectCheckItem:{name:"检查项多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","category_cls","value_type","range_remote","root_category","tree_select","can_select","can_select.filter_expression","range_remote.filter_expression","range_remote.depends","linkage"]},SelectSort:{name:"分类单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectSort"},attrs:["type","id","name","value_type","range_remote","tree_select","can_select","can_select.filter_expression","range_remote.filter_expression","range_remote.depends","linkage"]},MulSelectSort:{name:"分类多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","value_type","range_remote","tree_select","can_select","can_select.filter_expression","range_remote.filter_expression","range_remote.depends","linkage"]},SelectPartner:{name:"合作伙伴单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectPartner"},attrs:["type","id","name","value_type","range_remote","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectPartner:{name:"合作伙伴多项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectPartner"},attrs:["type","id","name","value_type","range_remote","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectOrg:{name:"单位单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectOrg"},attrs:["type","id","name","value_type","range_remote","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectOrg:{name:"单位多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","value_type","range_remote","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},Audit:{name:"审批",hasBpmField:!0,actions:[{key:"ar_eq",name:"审批结果等于"},{key:"ar_in",name:"审批结果在列表中"}],actionOptions:[{value:0,label:"未审批"},{value:1,label:"审批通过"},{value:2,label:"审批未通过"}],attrs:["type","id","name","linkage"],options:{result_type:"Array",value_type:"int",type:"MulSelect",style:"default",range_enum:[[0,"未审批"],[1,"通过"],[2,"未通过"]]}},MulArea:{name:"区域多项选择",hasBpmField:!0,tableColWidth:260,actions:r,attrs:["type","id","name","value_type","can","linkage"]},Area:{name:"区域单项选择",hasBpmField:!0,tableColWidth:260,actions:i,options:{type:"MulArea"},attrs:["type","id","name","value_type","can","linkage"]},SelectFormId:{name:"表单单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},MulSelectFormId:{name:"表单多项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},SelectFromField:{name:"远程单选(从字段)",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFromField"},attrs:["type","id","name","range_remote","style","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},MulSelectFromField:{name:"远程多选(从字段)",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFromField"},attrs:["type","id","name","range_remote","style","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},MulSelectEntranceForm:{name:"远程多项选择(从入口)",hasBpmField:!0},SelectHouseOwner:{name:"业主选择"},MulSelectIssue:{name:"问题选择"},MulFile:{name:"附件",hasBpmField:!0,tableColWidth:150},MulImage:{name:"图片",hasBpmField:!0,tableColWidth:150},Signature:{name:"签名",hasBpmField:!0},OnlineEditor:{name:"在线文档编辑器"},Spliter:{name:"分割线",hasBpmField:!1},Stepper:{name:"步进器",hasBpmField:!1},Quote:{name:"跨表单数据引用",hasBpmField:!1},Order:{name:"排序控件",hasBpmField:!1},SubForm:{name:"子表单",hasBpmField:!0},XSubForm:{name:"子表单(增强版)",hasBpmField:!0},OrderSubForm:{name:"排序子表单",hasBpmField:!0},AreaElevation:{name:"区域快速选择器",hasBpmField:!0,tableColWidth:200},RichText:{name:"富文本编辑框",hasBpmField:!0,tableColWidth:100}}},9795:function(e,t,n){"use strict";n.d(t,{Fr:function(){return l},zC:function(){return s}});var a=n(6773),i=n.n(a),r=n(5360),o=n.n(r);function s(e,t={}){i().isFunction(e)&&(e=e(t));let n=i().get(e.match(/\?([^#]+)/),"1");if(n){let a=o().parse(n);a=function(...e){return i().assignIn({},...e)}(a,t),e=i().replace(e,n,o().stringify(a))}else e=e+"?"+o().stringify(t);return e}function l(){for(var e=["iphone","ipod","ipad","android","mobile","blackberry","webos","incognito","webmate","bada","nokia","lg","ucweb","skyfire"],t=navigator.userAgent.toLowerCase(),n=!1,a=0,i=e.length;a<i;a++)-1!=t.indexOf(e[a])&&(n=!0);return n}},877:function(e,t,n){var a={"./bpmArea/index.js":2042,"./bpmAreaElevation/index.js":7930,"./bpmAudit/index.js":4789,"./bpmDateTime/index.js":1933,"./bpmField/index.js":9666,"./bpmFieldsFilter/index.js":9335,"./bpmFormField/index.js":4304,"./bpmMulFile/index.js":2622,"./bpmMulImage/index.js":2554,"./bpmNumber/index.js":7698,"./bpmRichText/index.js":5540,"./bpmSelect/index.js":2865,"./bpmSelectCheckItem/index.js":8668,"./bpmSelectEntranceForm/index.js":2179,"./bpmSelectFromField/index.js":9674,"./bpmSelectFromForm/index.js":1567,"./bpmSelectFromId/index.js":2549,"./bpmSelectFromMulForm/index.js":6170,"./bpmSelectHouseOwner/index.js":4413,"./bpmSelectIssue/index.js":8500,"./bpmSelectUser/index.js":9049,"./bpmSignature/index.js":1824,"./bpmSpliter/index.ts":9973,"./bpmSubForm/index.js":8243,"./bpmSubFormField/index.js":1849,"./bpmText/index.ts":1138,"./bpmTime/index.js":2656,"./demo/index.js":5881,"./demo2/index.js":6751,"./index.ts":5990};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=r,e.exports=i,i.id=877},6902:function(e){self,e.exports=function(){"use strict";var e={109:function(e,t,n){n.d(t,{default:function(){return s}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"color-indication"},e._l(e.colorConfig.data,(function(t){return n("div",{key:t.name,staticClass:"color-indication-item",style:{width:t.width}},["left"==e.textPlace?n("span",[e._v(e._s(t.title))]):e._e(),e._v(" "),n("div",{staticClass:"color-rect",style:{"background-color":t.color,"border-color":t.border_color}}),e._v(" "),"right"==e.textPlace?n("span",[e._v(e._s(t.title))]):e._e()])})),0)};a._withStripped=!0;var i={name:"ZjColorIndication",props:{colorConfig:{type:Object,default:function(){return{}}},textPlace:{type:String,default:"right"}}},r=(0,n(900).Z)(i,a,[],!1,null,"3d1ff590",null);r.options.__file="components/lib/color-indication/src/main.vue";var o=r.exports;o.install=function(e){e.component(o.name,o)};var s=o},924:function(e,t,n){n.d(t,{default:function(){return o}});var a=function(){var e=this;return e.$createElement,e._self._c,e._m(0)};a._withStripped=!0;var i=(0,n(900).Z)({name:"Demo"},a,[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"m-demo"},[e._v("demo1")])])}],!1,null,null,null);i.options.__file="components/lib/demo/src/main.vue";var r=i.exports;r.install=function(e){e.component(r.name,r)};var o=r},367:function(e,t,n){n.d(t,{default:function(){return o}});var a=function(){var e=this;return e.$createElement,e._self._c,e._m(0)};a._withStripped=!0;var i=(0,n(900).Z)({name:"Demo2"},a,[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"m-demo"},[e._v("demo2")])])}],!1,null,null,null);i.options.__file="components/lib/demo2/src/main.vue";var r=i.exports;r.install=function(e){e.component(r.name,r)};var o=r},622:function(e,t,n){n.d(t,{default:function(){return u}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-position-table"},[n("div",{staticClass:"select-position-table-content"},[n("div",{staticClass:"select-position-table-content-left",staticStyle:{width:"100px",overflow:"hidden"}},[n("table",{staticClass:"left-table"},[n("tbody",e._l(e.list,(function(t){return n("tr",{key:t.key},[n("td",{staticClass:"floor"},[n("div",[e._v(e._s(t.title))])]),e._v(" "),e._l(t.childrens,(function(a,i){return n("td",{key:a.key,staticStyle:{visibility:"hidden"}},[n("cell-item",{model:{value:t.childrens[i],callback:function(n){e.$set(t.childrens,i,n)},expression:"item.childrens[index]"}})],1)}))],2)})),0)])]),e._v(" "),n("div",{staticClass:"select-position-table-content-right"},[n("table",[n("tbody",e._l(e.list,(function(t){return n("tr",{key:t.key},e._l(t.childrens,(function(a,i){return n("td",{key:a.key},[n("cell-item",{attrs:{readonly:e.readonly},model:{value:t.childrens[i],callback:function(n){e.$set(t.childrens,i,n)},expression:"item.childrens[index]"}})],1)})),0)})),0)])])])])};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"position-table-cell"},[n("div",{staticClass:"cell-parent",class:{is_selected:e.curVal.state},style:{background:e.curVal.color}},[n("div",{staticClass:"parent",class:{"only-parent":e.curVal.childrens&&0==e.curVal.childrens.length||!e.curVal.childrens},on:{click:function(t){return e.troggleParent(e.curVal)}}},[e._v(e._s(e.curVal.title)+"\n "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.curVal.state,expression:"curVal.state"}],staticClass:"flag"},[n("i",{staticClass:"icon el-icon-check"})])]),e._v(" "),n("div",{staticClass:"cell-childs"},e._l(e.curVal.childrens,(function(t){return n("div",{key:t.key,staticClass:"cell-child",class:{is_child_selected:t.state&&!e.curVal.state},style:{background:t.color},on:{click:function(n){return e.troggleChild(t)}}},[e._v(e._s(t.title)+"\n\n "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.state&&!e.curVal.state,expression:"child_item.state && !curVal.state"}],staticClass:"flag"},[n("i",{staticClass:"icon el-icon-check"})])])})),0)])])};i._withStripped=!0;var r={props:{value:{type:Object,default:function(){return{}}},readonly:{type:Boolean,default:!1}},data(){return{curVal:{}}},watch:{value(e){this.curVal=e}},methods:{troggleParent(e){if(this.readonly)return!1;if(console.log("item",e),e.color&&"#FFFFFF"!=e.color&&"#ffffff"!=e.color&&"#FFF"!=e.color&&"#fff"!=e.color)return!1;let t=!1;if(_.each(this.curVal.childrens,(e=>{e.color&&"#FFFFFF"!=e.color&&"#ffffff"!=e.color&&"#FFF"!=e.color&&"#fff"!=e.color&&(t=!0)})),t)return!1;this.curVal.state=!this.curVal.state,_.each(this.curVal.childrens,(e=>{e.state=this.curVal.state})),this.setVal()},troggleChild(e){if(console.log("child_item",e),console.log("this.curVal",this.curVal),this.readonly)return!1;if(e.color&&"#FFFFFF"!=e.color&&"#ffffff"!=e.color&&"#FFF"!=e.color&&"#fff"!=e.color)return!1;e.state=!e.state;let t=!0;_.each(this.curVal.childrens,(e=>{e.state||(t=!1)})),this.curVal.state=t,this.setVal()},setVal(){this.$emit("input",this.curVal)}},mounted(){this.curVal=this.value}},o=n(900),s=(0,o.Z)(r,i,[],!1,null,null,null);s.options.__file="components/lib/select-position-table/src/widgets/cell-item.vue";var l={name:"ZjPcSelectPositionTable",components:{CellItem:s.exports},props:{value:{type:Array,default:function(){return[]}},data:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1},withParent:{type:Boolean,default:!0}},watch:{value:{handler(){this.setSelectedItem()},deep:!0},data:{handler(e){this.list=_.cloneDeep(e),this.setSelectedItem()},deep:!0,immediate:!0},list:{handler(e){this.getSelectedItem(e)},deep:!0}},data(){return{list:[]}},methods:{setSelectedItem(){_.each(this.list,(e=>{_.each(e.childrens,(e=>{if(e.childrens&&e.childrens.length>0){let t=0;_.each(e.childrens,(e=>{_.find(this.value,{key:e.key})?(e.state=!0,t++):e.state=!1})),t==e.childrens.length?e.state=!0:e.state=!1}else _.find(this.value,{key:e.key})?e.state=!0:e.state=!1}))}))},getSelectedItem(e){let t=[];_.each(e,(e=>{_.each(e.childrens,(n=>{n.childrens&&n.childrens.length>0?(_.each(n.childrens,(a=>{a.state&&t.push({name:e.title+"-"+n.title+"-"+a.title,key:a.key})})),this.withParent&&n.state&&t.push({name:e.title+"-"+n.title,key:n.key})):n.state&&t.push({name:e.title+"-"+n.title,key:n.key})}))})),this.$emit("input",t)}},mounted(){}},d=(0,o.Z)(l,a,[],!1,null,null,null);d.options.__file="components/lib/select-position-table/src/main.vue";var c=d.exports;c.install=function(e){e.component(c.name,c)};var u=c},387:function(e,t,n){n.d(t,{default:function(){return ut}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-popover",{ref:"col_config",attrs:{"popper-class":"table-cloumn-configer",placement:"bottom",width:"200",trigger:"click"}},[n("div",{staticClass:"content"},[n("div",[e.showConfirm?n("div",{staticClass:"btn-grp"},[n("el-button",{attrs:{round:"",size:"mini",disabled:!e.editing},on:{click:e.reset}},[e._v(e._s(e.$z("重置","c.reset"))+"\n ")]),e._v(" "),n("el-button",{attrs:{type:"primary",round:"",size:"mini",disabled:!e.editing},on:{click:e.submit}},[e._v(e._s(e.$z("确定","c.confirm"))+"\n ")])],1):e._e(),e._v(" "),n("div",{staticClass:"tip"},[e._v("\n "+e._s(e.$z("提示:拖拽可排序","b2.common.tip_can_drap_sort")))])]),e._v(" "),n("ul",{staticClass:"col-config-list"},e._l(e.cols_config,(function(t,a){return n("li",{key:""+a,staticStyle:{cursor:"grab"}},[n("el-checkbox",{on:{change:function(t){return e.checkboxClick()}},model:{value:t.show,callback:function(n){e.$set(t,"show",n)},expression:"col.show"}}),e._v(" "),n("div",{staticClass:"item-name",attrs:{title:t.label}},[e._v("\n "+e._s(t.label)+"\n ")])],1)})),0)]),e._v(" "),e._t("default",(function(){return[n("i",{staticClass:"el-icon-s-tools",staticStyle:{"font-size":"20px",color:"#666",cursor:"pointer"},attrs:{title:"设置字段"}})]}),{slot:"reference"})],2)],1)};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)}function d(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}a._withStripped=!0;var c=d(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),u=d(/Edge/i),m=d(/firefox/i),f=d(/safari/i)&&!d(/chrome/i)&&!d(/android/i),h=d(/iP(ad|od|hone)/i),p=d(/chrome/i)&&d(/android/i),g={capture:!1,passive:!1};function y(e,t,n){e.addEventListener(t,n,!c&&g)}function b(e,t,n){e.removeEventListener(t,n,!c&&g)}function v(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function w(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function M(e,t,n,a){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&v(e,t):v(e,t))||a&&e===n)return e;if(e===n)break}while(e=w(e))}return null}var L,k=/\s+/g;function S(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(k," ").replace(" "+t+" "," ");e.className=(a+(n?" "+t:"")).replace(k," ")}}function D(e,t,n){var a=e&&e.style;if(a){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in a||-1!==t.indexOf("webkit")||(t="-webkit-"+t),a[t]=n+("string"==typeof n?"":"px")}}function x(e,t){var n="";if("string"==typeof e)n=e;else do{var a=D(e,"transform");a&&"none"!==a&&(n=a+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Y(e,t,n){if(e){var a=e.getElementsByTagName(t),i=0,r=a.length;if(n)for(;i<r;i++)n(a[i],i);return a}return[]}function T(){return document.scrollingElement||document.documentElement}function C(e,t,n,a,i){if(e.getBoundingClientRect||e===window){var r,o,s,l,d,u,m;if(e!==window&&e.parentNode&&e!==T()?(o=(r=e.getBoundingClientRect()).top,s=r.left,l=r.bottom,d=r.right,u=r.height,m=r.width):(o=0,s=0,l=window.innerHeight,d=window.innerWidth,u=window.innerHeight,m=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!c))do{if(i&&i.getBoundingClientRect&&("none"!==D(i,"transform")||n&&"static"!==D(i,"position"))){var f=i.getBoundingClientRect();o-=f.top+parseInt(D(i,"border-top-width")),s-=f.left+parseInt(D(i,"border-left-width")),l=o+r.height,d=s+r.width;break}}while(i=i.parentNode);if(a&&e!==window){var h=x(i||e),p=h&&h.a,_=h&&h.d;h&&(l=(o/=_)+(u/=_),d=(s/=p)+(m/=p))}return{top:o,left:s,bottom:l,right:d,width:m,height:u}}}function j(e){var t=C(e),n=parseInt(D(e,"padding-left")),a=parseInt(D(e,"padding-top")),i=parseInt(D(e,"padding-right")),r=parseInt(D(e,"padding-bottom"));return t.top+=a+parseInt(D(e,"border-top-width")),t.left+=n+parseInt(D(e,"border-left-width")),t.width=e.clientWidth-n-i,t.height=e.clientHeight-a-r,t.bottom=t.top+t.height,t.right=t.left+t.width,t}function $(e,t,n){for(var a=O(e,!0),i=C(e)[t];a;){var r=C(a)[n];if(!("top"===n||"left"===n?i>=r:i<=r))return a;if(a===T())break;a=O(a,!1)}return!1}function P(e,t,n,a){for(var i=0,r=0,o=e.children;r<o.length;){if("none"!==o[r].style.display&&o[r]!==He.ghost&&(a||o[r]!==He.dragged)&&M(o[r],n.draggable,e,!1)){if(i===t)return o[r];i++}r++}return null}function I(e,t){for(var n=e.lastElementChild;n&&(n===He.ghost||"none"===D(n,"display")||t&&!v(n,t));)n=n.previousElementSibling;return n||null}function F(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===He.clone||t&&!v(e,t)||n++;return n}function E(e){var t=0,n=0,a=T();if(e)do{var i=x(e),r=i.a,o=i.d;t+=e.scrollLeft*r,n+=e.scrollTop*o}while(e!==a&&(e=e.parentNode));return[t,n]}function O(e,t){if(!e||!e.getBoundingClientRect)return T();var n=e,a=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=D(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return T();if(a||t)return n;a=!0}}}while(n=n.parentNode);return T()}function A(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function H(e,t){return function(){if(!L){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),L=setTimeout((function(){L=void 0}),t)}}}function N(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function R(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var z="Sortable"+(new Date).getTime(),V=[],W={initializeByDefault:!0},B={mount:function(e){for(var t in W)W.hasOwnProperty(t)&&!(t in e)&&(e[t]=W[t]);V.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),V.push(e)},pluginEvent:function(e,t,n){var a=this;this.eventCanceled=!1,n.cancel=function(){a.eventCanceled=!0};var i=e+"Global";V.forEach((function(a){t[a.pluginName]&&(t[a.pluginName][i]&&t[a.pluginName][i](r({sortable:t},n)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](r({sortable:t},n)))}))},initializePlugins:function(e,t,n,a){for(var i in V.forEach((function(a){var i=a.pluginName;if(e.options[i]||a.initializeByDefault){var r=new a(e,t,e.options);r.sortable=e,r.options=e.options,e[i]=r,l(n,r.defaults)}})),e.options)if(e.options.hasOwnProperty(i)){var r=this.modifyOption(e,i,e.options[i]);void 0!==r&&(e.options[i]=r)}},getEventProperties:function(e,t){var n={};return V.forEach((function(a){"function"==typeof a.eventProperties&&l(n,a.eventProperties.call(t[a.pluginName],e))})),n},modifyOption:function(e,t,n){var a;return V.forEach((function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(a=i.optionListeners[t].call(e[i.pluginName],n))})),a}},U=["evt"],G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.evt,i=function(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,U);B.pluginEvent.bind(He)(e,t,r({dragEl:J,parentEl:K,ghostEl:X,rootEl:Z,nextEl:Q,lastDownEl:ee,cloneEl:te,cloneHidden:ne,dragStarted:pe,putSortable:le,activeSortable:He.active,originalEvent:a,oldIndex:ae,oldDraggableIndex:re,newIndex:ie,newDraggableIndex:oe,hideGhostForTarget:Fe,unhideGhostForTarget:Ee,cloneNowHidden:function(){ne=!0},cloneNowShown:function(){ne=!1},dispatchSortableEvent:function(e){q({sortable:t,name:e,originalEvent:a})}},i))};function q(e){!function(e){var t=e.sortable,n=e.rootEl,a=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,l=e.fromEl,d=e.oldIndex,m=e.newIndex,f=e.oldDraggableIndex,h=e.newDraggableIndex,p=e.originalEvent,_=e.putSortable,g=e.extraEventProperties;if(t=t||n&&n[z]){var y,b=t.options,v="on"+a.charAt(0).toUpperCase()+a.substr(1);!window.CustomEvent||c||u?(y=document.createEvent("Event")).initEvent(a,!0,!0):y=new CustomEvent(a,{bubbles:!0,cancelable:!0}),y.to=s||n,y.from=l||n,y.item=i||n,y.clone=o,y.oldIndex=d,y.newIndex=m,y.oldDraggableIndex=f,y.newDraggableIndex=h,y.originalEvent=p,y.pullMode=_?_.lastPutMode:void 0;var w=r(r({},g),B.getEventProperties(a,t));for(var M in w)y[M]=w[M];n&&n.dispatchEvent(y),b[v]&&b[v].call(t,y)}}(r({putSortable:le,cloneEl:te,targetEl:J,rootEl:Z,oldIndex:ae,oldDraggableIndex:re,newIndex:ie,newDraggableIndex:oe},e))}var J,K,X,Z,Q,ee,te,ne,ae,ie,re,oe,se,le,de,ce,ue,me,fe,he,pe,_e,ge,ye,be,ve=!1,we=!1,Me=[],Le=!1,ke=!1,Se=[],De=!1,xe=[],Ye="undefined"!=typeof document,Te=h,Ce=u||c?"cssFloat":"float",je=Ye&&!p&&!h&&"draggable"in document.createElement("div"),$e=function(){if(Ye){if(c)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Pe=function(e,t){var n=D(e),a=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=P(e,0,t),r=P(e,1,t),o=i&&D(i),s=r&&D(r),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+C(i).width,d=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&o.float&&"none"!==o.float){var c="left"===o.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==c?"horizontal":"vertical"}return i&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=a&&"none"===n[Ce]||r&&"none"===n[Ce]&&l+d>a)?"vertical":"horizontal"},Ie=function(e){function t(e,n){return function(a,i,r,o){var s=a.options.group.name&&i.options.group.name&&a.options.group.name===i.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(a,i,r,o),n)(a,i,r,o);var l=(n?a:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},a=e.group;a&&"object"==o(a)||(a={name:a}),n.name=a.name,n.checkPull=t(a.pull,!0),n.checkPut=t(a.put),n.revertClone=a.revertClone,e.group=n},Fe=function(){!$e&&X&&D(X,"display","none")},Ee=function(){!$e&&X&&D(X,"display","")};Ye&&!p&&document.addEventListener("click",(function(e){if(we)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),we=!1,!1}),!0);var Oe=function(e){if(J){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,r=e.clientY,Me.some((function(e){var t=e[z].options.emptyInsertThreshold;if(t&&!I(e)){var n=C(e),a=i>=n.left-t&&i<=n.right+t,s=r>=n.top-t&&r<=n.bottom+t;return a&&s?o=e:void 0}})),o);if(t){var n={};for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[z]._onDragOver(n)}}var i,r,o},Ae=function(e){J&&J.parentNode[z]._isOutsideThisEl(e.target)};function He(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=l({},t),e[z]=this;var n,a,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Pe(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==He.supportPointer&&"PointerEvent"in window&&!f,emptyInsertThreshold:5};for(var o in B.initializePlugins(this,e,i),i)!(o in t)&&(t[o]=i[o]);for(var s in Ie(t),this)"_"===s.charAt(0)&&"function"==typeof this[s]&&(this[s]=this[s].bind(this));this.nativeDraggable=!t.forceFallback&&je,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?y(e,"pointerdown",this._onTapStart):(y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Me.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),l(this,(a=[],{captureAnimationState:function(){a=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==D(e,"display")&&e!==He.ghost){a.push({target:e,rect:C(e)});var t=r({},a[a.length-1].rect);if(e.thisAnimationDuration){var n=x(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){a.push(e)},removeAnimationState:function(e){a.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var a in t)if(t.hasOwnProperty(a)&&t[a]===e[n][a])return Number(n);return-1}(a,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var i=!1,r=0;a.forEach((function(e){var n=0,a=e.target,o=a.fromRect,s=C(a),l=a.prevFromRect,d=a.prevToRect,c=e.rect,u=x(a,!0);u&&(s.top-=u.f,s.left-=u.e),a.toRect=s,a.thisAnimationDuration&&A(l,s)&&!A(o,s)&&(c.top-s.top)/(c.left-s.left)==(o.top-s.top)/(o.left-s.left)&&(n=function(e,t,n,a){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*a.animation}(c,l,d,t.options)),A(s,o)||(a.prevFromRect=o,a.prevToRect=s,n||(n=t.options.animation),t.animate(a,c,s,n)),n&&(i=!0,r=Math.max(r,n),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout((function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null}),n),a.thisAnimationDuration=n)})),clearTimeout(n),i?n=setTimeout((function(){"function"==typeof e&&e()}),r):"function"==typeof e&&e(),a=[]},animate:function(e,t,n,a){if(a){D(e,"transition",""),D(e,"transform","");var i=x(this.el),r=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(r||1),l=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!l,D(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),D(e,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),D(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){D(e,"transition",""),D(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),a)}}}))}function Ne(e,t,n,a,i,r,o,s){var l,d,m=e[z],f=m.options.onMove;return!window.CustomEvent||c||u?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=a,l.related=i||t,l.relatedRect=r||C(t),l.willInsertAfter=s,l.originalEvent=o,e.dispatchEvent(l),f&&(d=f.call(m,l,o)),d}function Re(e){e.draggable=!1}function ze(){De=!1}function Ve(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,a=0;n--;)a+=t.charCodeAt(n);return a.toString(36)}function We(e){return setTimeout(e,0)}function Be(e){return clearTimeout(e)}He.prototype={constructor:He,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(_e=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,J):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,a=this.options,i=a.preventOnFilter,r=e.type,o=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(o||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,d=a.filter;if(function(e){xe.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var a=t[n];a.checked&&xe.push(a)}}(n),!J&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||a.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!f||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=M(s,a.draggable,n,!1))&&s.animated||ee===s)){if(ae=F(s),re=F(s,a.draggable),"function"==typeof d){if(d.call(this,e,s,this))return q({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),G("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(d&&(d=d.split(",").some((function(a){if(a=M(l,a.trim(),n,!1))return q({sortable:t,rootEl:a,name:"filter",targetEl:s,fromEl:n,toEl:n}),G("filter",t,{evt:e}),!0}))))return void(i&&e.cancelable&&e.preventDefault());a.handle&&!M(l,a.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var a,i=this,r=i.el,o=i.options,s=r.ownerDocument;if(n&&!J&&n.parentNode===r){var l=C(n);if(Z=r,K=(J=n).parentNode,Q=J.nextSibling,ee=n,se=o.group,He.dragged=J,de={target:J,clientX:(t||e).clientX,clientY:(t||e).clientY},fe=de.clientX-l.left,he=de.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,J.style["will-change"]="all",a=function(){G("delayEnded",i,{evt:e}),He.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!m&&i.nativeDraggable&&(J.draggable=!0),i._triggerDragStart(e,t),q({sortable:i,name:"choose",originalEvent:e}),S(J,o.chosenClass,!0))},o.ignore.split(",").forEach((function(e){Y(J,e.trim(),Re)})),y(s,"dragover",Oe),y(s,"mousemove",Oe),y(s,"touchmove",Oe),y(s,"mouseup",i._onDrop),y(s,"touchend",i._onDrop),y(s,"touchcancel",i._onDrop),m&&this.nativeDraggable&&(this.options.touchStartThreshold=4,J.draggable=!0),G("delayStart",this,{evt:e}),!o.delay||o.delayOnTouchOnly&&!t||this.nativeDraggable&&(u||c))a();else{if(He.eventCanceled)return void this._onDrop();y(s,"mouseup",i._disableDelayedDrag),y(s,"touchend",i._disableDelayedDrag),y(s,"touchcancel",i._disableDelayedDrag),y(s,"mousemove",i._delayedDragTouchMoveHandler),y(s,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&y(s,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(a,o.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){J&&Re(J),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):y(document,t?"touchmove":"mousemove",this._onTouchMove):(y(J,"dragend",this),y(Z,"dragstart",this._onDragStart));try{document.selection?We((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ve=!1,Z&&J){G("dragStarted",this,{evt:t}),this.nativeDraggable&&y(document,"dragover",Ae);var n=this.options;!e&&S(J,n.dragClass,!1),S(J,n.ghostClass,!0),He.active=this,e&&this._appendGhost(),q({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ce){this._lastX=ce.clientX,this._lastY=ce.clientY,Fe();for(var e=document.elementFromPoint(ce.clientX,ce.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ce.clientX,ce.clientY))!==t;)t=e;if(J.parentNode[z]._isOutsideThisEl(e),t)do{if(t[z]&&t[z]._onDragOver({clientX:ce.clientX,clientY:ce.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Ee()}},_onTouchMove:function(e){if(de){var t=this.options,n=t.fallbackTolerance,a=t.fallbackOffset,i=e.touches?e.touches[0]:e,r=X&&x(X,!0),o=X&&r&&r.a,s=X&&r&&r.d,l=Te&&be&&E(be),d=(i.clientX-de.clientX+a.x)/(o||1)+(l?l[0]-Se[0]:0)/(o||1),c=(i.clientY-de.clientY+a.y)/(s||1)+(l?l[1]-Se[1]:0)/(s||1);if(!He.active&&!ve){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(X){r?(r.e+=d-(ue||0),r.f+=c-(me||0)):r={a:1,b:0,c:0,d:1,e:d,f:c};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");D(X,"webkitTransform",u),D(X,"mozTransform",u),D(X,"msTransform",u),D(X,"transform",u),ue=d,me=c,ce=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!X){var e=this.options.fallbackOnBody?document.body:Z,t=C(J,!0,Te,!0,e),n=this.options;if(Te){for(be=e;"static"===D(be,"position")&&"none"===D(be,"transform")&&be!==document;)be=be.parentNode;be!==document.body&&be!==document.documentElement?(be===document&&(be=T()),t.top+=be.scrollTop,t.left+=be.scrollLeft):be=T(),Se=E(be)}S(X=J.cloneNode(!0),n.ghostClass,!1),S(X,n.fallbackClass,!0),S(X,n.dragClass,!0),D(X,"transition",""),D(X,"transform",""),D(X,"box-sizing","border-box"),D(X,"margin",0),D(X,"top",t.top),D(X,"left",t.left),D(X,"width",t.width),D(X,"height",t.height),D(X,"opacity","0.8"),D(X,"position",Te?"absolute":"fixed"),D(X,"zIndex","100000"),D(X,"pointerEvents","none"),He.ghost=X,e.appendChild(X),D(X,"transform-origin",fe/parseInt(X.style.width)*100+"% "+he/parseInt(X.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,a=e.dataTransfer,i=n.options;G("dragStart",this,{evt:e}),He.eventCanceled?this._onDrop():(G("setupClone",this),He.eventCanceled||((te=R(J)).removeAttribute("id"),te.draggable=!1,te.style["will-change"]="",this._hideClone(),S(te,this.options.chosenClass,!1),He.clone=te),n.cloneId=We((function(){G("clone",n),He.eventCanceled||(n.options.removeCloneOnHide||Z.insertBefore(te,J),n._hideClone(),q({sortable:n,name:"clone"}))})),!t&&S(J,i.dragClass,!0),t?(we=!0,n._loopId=setInterval(n._emulateDragOver,50)):(b(document,"mouseup",n._onDrop),b(document,"touchend",n._onDrop),b(document,"touchcancel",n._onDrop),a&&(a.effectAllowed="move",i.setData&&i.setData.call(n,a,J)),y(document,"drop",n),D(J,"transform","translateZ(0)")),ve=!0,n._dragStartId=We(n._dragStarted.bind(n,t,e)),y(document,"selectstart",n),pe=!0,f&&D(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,a,i,o=this.el,s=e.target,l=this.options,d=l.group,c=He.active,u=se===d,m=l.sort,f=le||c,h=this,p=!1;if(!De){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=M(s,l.draggable,o,!0),H("dragOver"),He.eventCanceled)return p;if(J.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||h._ignoreWhileAnimating===s)return V(!1);if(we=!1,c&&!l.disabled&&(u?m||(a=K!==Z):le===this||(this.lastPutMode=se.checkPull(this,c,J,e))&&d.checkPut(this,c,J,e))){if(i="vertical"===this._getDirection(e,s),t=C(J),H("dragOverValid"),He.eventCanceled)return p;if(a)return K=Z,R(),this._hideClone(),H("revert"),He.eventCanceled||(Q?Z.insertBefore(J,Q):Z.appendChild(J)),V(!0);var _=I(o,l.draggable);if(!_||function(e,t,n){var a=C(I(n.el,n.options.draggable)),i=j(n.el);return t?e.clientX>i.right+10||e.clientY>a.bottom&&e.clientX>a.left:e.clientY>i.bottom+10||e.clientX>a.right&&e.clientY>a.top}(e,i,this)&&!_.animated){if(_===J)return V(!1);if(_&&o===e.target&&(s=_),s&&(n=C(s)),!1!==Ne(Z,o,J,t,s,n,e,!!s))return R(),_&&_.nextSibling?o.insertBefore(J,_.nextSibling):o.appendChild(J),K=o,W(),V(!0)}else if(_&&function(e,t,n){var a=C(P(n.el,0,n.options,!0)),i=j(n.el);return t?e.clientX<i.left-10||e.clientY<a.top&&e.clientX<a.right:e.clientY<i.top-10||e.clientY<a.bottom&&e.clientX<a.left}(e,i,this)){var g=P(o,0,l,!0);if(g===J)return V(!1);if(n=C(s=g),!1!==Ne(Z,o,J,t,s,n,e,!1))return R(),o.insertBefore(J,g),K=o,W(),V(!0)}else if(s.parentNode===o){n=C(s);var y,b,v,w=J.parentNode!==o,L=!function(e,t,n){var a=n?e.left:e.top,i=n?e.right:e.bottom,r=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return a===o||i===s||a+r/2===o+l/2}(J.animated&&J.toRect||t,s.animated&&s.toRect||n,i),k=i?"top":"left",x=$(s,"top","top")||$(J,"top","top"),Y=x?x.scrollTop:void 0;if(_e!==s&&(b=n[k],Le=!1,ke=!L&&l.invertSwap||w),y=function(e,t,n,a,i,r,o,s){var l=a?e.clientY:e.clientX,d=a?n.height:n.width,c=a?n.top:n.left,u=a?n.bottom:n.right,m=!1;if(!o)if(s&&ye<d*i){if(!Le&&(1===ge?l>c+d*r/2:l<u-d*r/2)&&(Le=!0),Le)m=!0;else if(1===ge?l<c+ye:l>u-ye)return-ge}else if(l>c+d*(1-i)/2&&l<u-d*(1-i)/2)return function(e){return F(J)<F(e)?1:-1}(t);return(m=m||o)&&(l<c+d*r/2||l>u-d*r/2)?l>c+d/2?1:-1:0}(e,s,n,i,L?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,ke,_e===s),0!==y){var T=F(J);do{T-=y,v=K.children[T]}while(v&&("none"===D(v,"display")||v===X))}if(0===y||v===s)return V(!1);_e=s,ge=y;var E=s.nextElementSibling,O=!1,A=Ne(Z,o,J,t,s,n,e,O=1===y);if(!1!==A)return 1!==A&&-1!==A||(O=1===A),De=!0,setTimeout(ze,30),R(),O&&!E?o.appendChild(J):s.parentNode.insertBefore(J,O?E:s),x&&N(x,0,Y-x.scrollTop),K=J.parentNode,void 0===b||ke||(ye=Math.abs(b-C(s)[k])),W(),V(!0)}if(o.contains(J))return V(!1)}return!1}function H(l,d){G(l,h,r({evt:e,isOwner:u,axis:i?"vertical":"horizontal",revert:a,dragRect:t,targetRect:n,canSort:m,fromSortable:f,target:s,completed:V,onMove:function(n,a){return Ne(Z,o,J,t,n,C(n),e,a)},changed:W},d))}function R(){H("dragOverAnimationCapture"),h.captureAnimationState(),h!==f&&f.captureAnimationState()}function V(t){return H("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(h),h!==f&&(S(J,le?le.options.ghostClass:c.options.ghostClass,!1),S(J,l.ghostClass,!0)),le!==h&&h!==He.active?le=h:h===He.active&&le&&(le=null),f===h&&(h._ignoreWhileAnimating=s),h.animateAll((function(){H("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(s===J&&!J.animated||s===o&&!s.animated)&&(_e=null),l.dragoverBubble||e.rootEl||s===document||(J.parentNode[z]._isOutsideThisEl(e.target),!t&&Oe(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),p=!0}function W(){ie=F(J),oe=F(J,l.draggable),q({sortable:h,name:"change",toEl:o,newIndex:ie,newDraggableIndex:oe,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){b(document,"mousemove",this._onTouchMove),b(document,"touchmove",this._onTouchMove),b(document,"pointermove",this._onTouchMove),b(document,"dragover",Oe),b(document,"mousemove",Oe),b(document,"touchmove",Oe)},_offUpEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._onDrop),b(e,"touchend",this._onDrop),b(e,"pointerup",this._onDrop),b(e,"touchcancel",this._onDrop),b(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ie=F(J),oe=F(J,n.draggable),G("drop",this,{evt:e}),K=J&&J.parentNode,ie=F(J),oe=F(J,n.draggable),He.eventCanceled||(ve=!1,ke=!1,Le=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Be(this.cloneId),Be(this._dragStartId),this.nativeDraggable&&(b(document,"drop",this),b(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),f&&D(document.body,"user-select",""),D(J,"transform",""),e&&(pe&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),X&&X.parentNode&&X.parentNode.removeChild(X),(Z===K||le&&"clone"!==le.lastPutMode)&&te&&te.parentNode&&te.parentNode.removeChild(te),J&&(this.nativeDraggable&&b(J,"dragend",this),Re(J),J.style["will-change"]="",pe&&!ve&&S(J,le?le.options.ghostClass:this.options.ghostClass,!1),S(J,this.options.chosenClass,!1),q({sortable:this,name:"unchoose",toEl:K,newIndex:null,newDraggableIndex:null,originalEvent:e}),Z!==K?(ie>=0&&(q({rootEl:K,name:"add",toEl:K,fromEl:Z,originalEvent:e}),q({sortable:this,name:"remove",toEl:K,originalEvent:e}),q({rootEl:K,name:"sort",toEl:K,fromEl:Z,originalEvent:e}),q({sortable:this,name:"sort",toEl:K,originalEvent:e})),le&&le.save()):ie!==ae&&ie>=0&&(q({sortable:this,name:"update",toEl:K,originalEvent:e}),q({sortable:this,name:"sort",toEl:K,originalEvent:e})),He.active&&(null!=ie&&-1!==ie||(ie=ae,oe=re),q({sortable:this,name:"end",toEl:K,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){G("nulling",this),Z=J=K=X=Q=te=ee=ne=de=ce=pe=ie=oe=ae=re=_e=ge=le=se=He.dragged=He.ghost=He.clone=He.active=null,xe.forEach((function(e){e.checked=!0})),xe.length=ue=me=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":J&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,a=0,i=n.length,r=this.options;a<i;a++)M(e=n[a],r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||Ve(e));return t},sort:function(e,t){var n={},a=this.el;this.toArray().forEach((function(e,t){var i=a.children[t];M(i,this.options.draggable,a,!1)&&(n[e]=i)}),this),t&&this.captureAnimationState(),e.forEach((function(e){n[e]&&(a.removeChild(n[e]),a.appendChild(n[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return M(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var a=B.modifyOption(this,e,t);n[e]=void 0!==a?a:t,"group"===e&&Ie(n)},destroy:function(){G("destroy",this);var e=this.el;e[z]=null,b(e,"mousedown",this._onTapStart),b(e,"touchstart",this._onTapStart),b(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(b(e,"dragover",this),b(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Me.splice(Me.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ne){if(G("hideClone",this),He.eventCanceled)return;D(te,"display","none"),this.options.removeCloneOnHide&&te.parentNode&&te.parentNode.removeChild(te),ne=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(ne){if(G("showClone",this),He.eventCanceled)return;J.parentNode!=Z||this.options.group.revertClone?Q?Z.insertBefore(te,Q):Z.appendChild(te):Z.insertBefore(te,J),this.options.group.revertClone&&this.animate(J,te),D(te,"display",""),ne=!1}}else this._hideClone()}},Ye&&y(document,"touchmove",(function(e){(He.active||ve)&&e.cancelable&&e.preventDefault()})),He.utils={on:y,off:b,css:D,find:Y,is:function(e,t){return!!M(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:H,closest:M,toggleClass:S,clone:R,index:F,nextTick:We,cancelNextTick:Be,detectDirection:Pe,getChild:P},He.get=function(e){return e[z]},He.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(He.utils=r(r({},He.utils),e.utils)),B.mount(e)}))},He.create=function(e,t){return new He(e,t)},He.version="1.15.1";var Ue,Ge,qe,Je,Ke,Xe,Ze=[],Qe=!1;function et(){Ze.forEach((function(e){clearInterval(e.pid)})),Ze=[]}function tt(){clearInterval(Xe)}var nt=H((function(e,t,n,a){if(t.scroll){var i,r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,d=T(),c=!1;Ge!==n&&(Ge=n,et(),Ue=t.scroll,i=t.scrollFn,!0===Ue&&(Ue=O(n,!0)));var u=0,m=Ue;do{var f=m,h=C(f),p=h.top,_=h.bottom,g=h.left,y=h.right,b=h.width,v=h.height,w=void 0,M=void 0,L=f.scrollWidth,k=f.scrollHeight,S=D(f),x=f.scrollLeft,Y=f.scrollTop;f===d?(w=b<L&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),M=v<k&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(w=b<L&&("auto"===S.overflowX||"scroll"===S.overflowX),M=v<k&&("auto"===S.overflowY||"scroll"===S.overflowY));var j=w&&(Math.abs(y-r)<=s&&x+b<L)-(Math.abs(g-r)<=s&&!!x),$=M&&(Math.abs(_-o)<=s&&Y+v<k)-(Math.abs(p-o)<=s&&!!Y);if(!Ze[u])for(var P=0;P<=u;P++)Ze[P]||(Ze[P]={});Ze[u].vx==j&&Ze[u].vy==$&&Ze[u].el===f||(Ze[u].el=f,Ze[u].vx=j,Ze[u].vy=$,clearInterval(Ze[u].pid),0==j&&0==$||(c=!0,Ze[u].pid=setInterval(function(){a&&0===this.layer&&He.active._onTouchMove(Ke);var t=Ze[this.layer].vy?Ze[this.layer].vy*l:0,n=Ze[this.layer].vx?Ze[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(He.dragged.parentNode[z],n,t,e,Ke,Ze[this.layer].el)||N(Ze[this.layer].el,n,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&m!==d&&(m=O(m,!1)));Qe=c}}),30),at=function(e){var t=e.originalEvent,n=e.putSortable,a=e.dragEl,i=e.activeSortable,r=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||i;o();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(d.clientX,d.clientY);s(),l&&!l.el.contains(c)&&(r("spill"),this.onSpill({dragEl:a,putSortable:n}))}};function it(){}function rt(){}it.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var a=P(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(t,a):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:at},l(it,{pluginName:"revertOnSpill"}),rt.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:at},l(rt,{pluginName:"removeOnSpill"}),He.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?y(document,"pointermove",this._handleFallbackAutoScroll):t.touches?y(document,"touchmove",this._handleFallbackAutoScroll):y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?b(document,"dragover",this._handleAutoScroll):(b(document,"pointermove",this._handleFallbackAutoScroll),b(document,"touchmove",this._handleFallbackAutoScroll),b(document,"mousemove",this._handleFallbackAutoScroll)),tt(),et(),clearTimeout(L),L=void 0},nulling:function(){Ke=Ge=Ue=Qe=Xe=qe=Je=null,Ze.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,a=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(a,i);if(Ke=e,t||this.options.forceAutoScrollFallback||u||c||f){nt(e,this.options,r,t);var o=O(r,!0);!Qe||Xe&&a===qe&&i===Je||(Xe&&tt(),Xe=setInterval((function(){var r=O(document.elementFromPoint(a,i),!0);r!==o&&(o=r,et()),nt(e,n.options,r,t)}),10),qe=a,Je=i)}else{if(!this.options.bubbleScroll||O(r,!0)===T())return void et();nt(e,this.options,O(r,!1),!1)}}},l(e,{pluginName:"scroll",initializeByDefault:!0})}),He.mount(rt,it);var ot=He,st={name:"ZjTableColumnConfiger",props:{defaultColumnShowCount:{type:Number,default:20},defaultColumnShowKeys:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},columnKey:{type:String,default:"id"},props:{type:Object,default(){return{label:"label"}}},showConfirm:{type:Boolean,default:!1},tag:{type:String,default:""},userId:{type:[String,Number],default:""}},watch:{columns(e){console.log("newValue",e),this.cols_config=this.getCustomerColsConfig(e),this.$emit("change",this.cols_config)}},data(){return{editing:!1,visible:!1,cols_config:[],ColsConfigTmp:[]}},methods:{reset(){this.cols_config=[],this.$nextTick((()=>{this.cols_config=this.getCustomerColsConfig(this.columns)})),this.editing=!1},submit(){this.update(),this.editing=!1},update(){console.log("update: ",this.cols_config),this.setCutomerColsConfig(),this.$emit("change",this.cols_config)},checkboxClick(){this.editing=!0,this.showConfirm||this.update()},initDragSort(){const e=this.$refs.col_config.$el.querySelectorAll(".col-config-list")[0];ot.create(e,{onEnd:({oldIndex:e,newIndex:t})=>{this.editing=!0;const n=this.ColsConfigTmp[e];this.ColsConfigTmp.splice(e,1),this.ColsConfigTmp.splice(t,0,n),console.log("this.ColsConfigTmp",this.ColsConfigTmp);const a=this.ColsConfigTmp.map((e=>e.id));console.log("newKeysArr: ",a),_.each(this.cols_config,(e=>{const t=a.indexOf(e.id);e.sort_index=t})),console.log("this.col_config: ",this.col_config),this.$forceUpdate(),this.showConfirm||this.update()}})},setCutomerColsConfig(){let e={},t="";e=localStorage.getItem("COLUMN_CUSTOMER_CONFIG")&&JSON.parse(localStorage.getItem("COLUMN_CUSTOMER_CONFIG"))||{},t=e[this.userId+this.tag],t?t.field_colunms_config=this.cols_config:t={field_colunms_config:this.cols_config},e[this.userId+this.tag]=t,localStorage.setItem("COLUMN_CUSTOMER_CONFIG",JSON.stringify(e))},setColWidth(e,t){_.each(this.cols_config,(n=>{n.id==e&&(n.width=t)})),this.setCutomerColsConfig()},getCustomerColsConfig(e){let t=[],n={},a=[],i={};i=localStorage.getItem("COLUMN_CUSTOMER_CONFIG")&&JSON.parse(localStorage.getItem("COLUMN_CUSTOMER_CONFIG"))||{},n=i[this.userId+this.tag],n&&n.field_colunms_config&&(a=n.field_colunms_config);let r=0;return _.each(e,(e=>{let n=_.find(a,{id:e[this.columnKey]});if(n)t.push({label:e[this.props.label],id:e[this.columnKey],show:n.show,sort_index:n.sort_index,width:n.width||""});else{let n=!1;n=_.isNil(e.default_show)?!!(r<=this.defaultColumnShowCount||_.includes(this.defaultColumnShowKeys,e[this.columnKey])):e.default_show,n&&r++,t.push({label:e[this.props.label],id:e[this.columnKey],show:n,sort_index:0,width:""})}})),t=_.sortBy(t,"sort_index"),this.ColsConfigTmp=_.cloneDeep(t),t}},mounted(){this.cols_config=this.getCustomerColsConfig(this.columns),this.initDragSort()}},lt=st,dt=(0,n(900).Z)(lt,a,[],!1,null,null,null);dt.options.__file="components/lib/table-column-configer/src/main.vue";var ct=dt.exports;ct.install=function(e){e.component(ct.name,ct)};var ut=ct},900:function(e,t,n){function a(e,t,n,a,i,r,o,s){var l,d="function"==typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),a&&(d.functional=!0),r&&(d._scopeId="data-v-"+r),o?(l=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__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},d._ssrRegister=l):i&&(l=s?function(){i.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(d.functional){d._injectStyles=l;var c=d.render;d.render=function(e,t){return l.call(t),c(e,t)}}else{var u=d.beforeCreate;d.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:d}}n.d(t,{Z:function(){return a}})}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){n.r(a),n.d(a,{ColorIndication:function(){return o.default},Demo:function(){return e.default},Demo2:function(){return t.default},SelectPositionTable:function(){return r.default},TableColumnConfiger:function(){return i.default}});var e=n(924),t=n(367),i=n(387),r=n(622),o=n(109);const s={Demo:e.default,Demo2:t.default,TableColumnConfiger:i.default,SelectPositionTable:r.default,ColorIndication:o.default},l=function(e){l.installed||Object.keys(s).forEach((t=>{e.component(s[t].name,s[t])}))};a.default={version:"0.0.10",install:l}}(),a}()},3282:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const a=n(4042),i=n(6144),r=n(6653),o=n(2079),s=["/properties"],l="http://json-schema.org/draft-07/schema";class d extends a.default{_addVocabularies(){super._addVocabularies(),i.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var c=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var m=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var f=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},1520:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=a;class i extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof a&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function r(e,...t){const n=[e[0]];let a=0;for(;a<t.length;)l(n,t[a]),n.push(e[++a]);return new i(n)}t._Code=i,t.nil=new i(""),t._=r;const o=new i("+");function s(e,...t){const n=[c(e[0])];let a=0;for(;a<t.length;)n.push(o),l(n,t[a]),n.push(o,c(e[++a]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){const n=d(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new i(n)}function l(e,t){var n;t instanceof i?e.push(...t._items):t instanceof a?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:c(Array.isArray(n)?n.join(","):n))}function d(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof a||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof a?void 0:`"${e}${t.slice(1)}`}function c(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=s,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},t.stringify=function(e){return new i(c(e))},t.safeStringify=c,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new i(`.${e}`):r`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new i(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new i(e.toString())}},9029:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const a=n(1520),i=n(7845);var r=n(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var o=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new a._Code(">"),GTE:new a._Code(">="),LT:new a._Code("<"),LTE:new a._Code("<="),EQ:new a._Code("==="),NEQ:new a._Code("!=="),NOT:new a._Code("!"),OR:new a._Code("||"),AND:new a._Code("&&"),ADD:new a._Code("+")};class s{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends s{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?i.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,e,t)),this}get names(){return this.rhs instanceof a._CodeOrName?this.rhs.names:{}}}class d extends s{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof a.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=j(this.rhs,e,t),this}get names(){return C(this.lhs instanceof a.Name?{}:{...this.lhs.names},this.rhs)}}class c extends d{constructor(e,t,n,a){super(e,n,a),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class m extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class f extends s{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends s{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=j(this.code,e,t),this}get names(){return this.code instanceof a._CodeOrName?this.code.names:{}}}class p extends s{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let a=n.length;for(;a--;){const i=n[a];i.optimizeNames(e,t)||($(e,i.names),n.splice(a,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>T(e,t.names)),{})}}class _ extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class g extends p{}class y extends _{}y.kind="else";class b extends _{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(P(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=j(this.condition,e,t),this}get names(){const e=super.names;return C(e,this.condition),this.else&&T(e,this.else.names),e}}b.kind="if";class v extends _{}v.kind="for";class w extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=j(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}}class M extends v{constructor(e,t,n,a){super(),this.varKind=e,this.name=t,this.from=n,this.to=a}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:n,from:a,to:r}=this;return`for(${t} ${n}=${a}; ${n}<${r}; ${n}++)`+super.render(e)}get names(){const e=C(super.names,this.from);return C(e,this.to)}}class L extends v{constructor(e,t,n,a){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=a}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=j(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}}class k extends _{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}k.kind="func";class S extends p{render(e){return"return "+super.render(e)}}S.kind="return";class D extends _{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,a;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(a=this.finally)||void 0===a||a.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}}class x extends _{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}x.kind="catch";class Y extends _{render(e){return"finally"+super.render(e)}}function T(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function C(e,t){return t instanceof a._CodeOrName?T(e,t.names):e}function j(e,t,n){return e instanceof a.Name?r(e):(i=e)instanceof a._Code&&i._items.some((e=>e instanceof a.Name&&1===t[e.str]&&void 0!==n[e.str]))?new a._Code(e._items.reduce(((e,t)=>(t instanceof a.Name&&(t=r(t)),t instanceof a._Code?e.push(...t._items):e.push(t),e)),[])):e;var i;function r(e){const a=n[e.str];return void 0===a||1!==t[e.str]?e:(delete t[e.str],a)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:a._`!${O(e)}`}Y.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,a){const i=this._scope.toName(t);return void 0!==n&&a&&(this._constants[i.str]=n),this._leafNode(new l(e,i,n)),i}const(e,t,n){return this._def(i.varKinds.const,e,t,n)}let(e,t,n){return this._def(i.varKinds.let,e,t,n)}var(e,t,n){return this._def(i.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new d(e,t,n))}add(e,n){return this._leafNode(new c(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==a.nil&&this._leafNode(new h(e)),this}object(...e){const t=["{"];for(const[n,i]of e)t.length>1&&t.push(","),t.push(n),(n!==i||this.opts.es5)&&(t.push(":"),(0,a.addCodeArg)(t,i));return t.push("}"),new a._Code(t)}if(e,t,n){if(this._blockNode(new b(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(b,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,n,a,r=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const o=this._scope.toName(e);return this._for(new M(r,o,t,n),(()=>a(o)))}forOf(e,t,n,r=i.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof a.Name?t:this.var("_arr",t);return this.forRange("_i",0,a._`${e}.length`,(t=>{this.var(o,a._`${e}[${t}]`),n(o)}))}return this._for(new L("of",r,o,t),(()=>n(o)))}forIn(e,t,n,r=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,a._`Object.keys(${t})`,n);const o=this._scope.toName(e);return this._for(new L("in",r,o,t),(()=>n(o)))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new m(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const a=new D;if(this._blockNode(a),this.code(e),t){const e=this.name("e");this._currNode=a.catch=new x(e),t(e)}return n&&(this._currNode=a.finally=new Y,this.code(n)),this._endBlockNode(x,Y)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=a.nil,n,i){return this._blockNode(new k(e,t,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=P;const I=E(t.operators.AND);t.and=function(...e){return e.reduce(I)};const F=E(t.operators.OR);function E(e){return(t,n)=>t===a.nil?n:n===a.nil?t:a._`${O(t)} ${e} ${O(n)}`}function O(e){return e instanceof a.Name?e:a._`(${e})`}t.or=function(...e){return e.reduce(F)}},7845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const a=n(1520);class i extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(r||(t.UsedValueState=r={})),t.varKinds={const:new a.Name("const"),let:new a.Name("let"),var:new a.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof a.Name?e:this.name(e)}name(e){return new a.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class s extends a.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=a._`.${new a.Name(t)}[${n}]`}}t.ValueScopeName=s;const l=a._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:a.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const a=this.toName(e),{prefix:i}=a,r=null!==(n=t.key)&&void 0!==n?n:t.ref;let o=this._values[i];if(o){const e=o.get(r);if(e)return e}else o=this._values[i]=new Map;o.set(r,a);const s=this._scope[i]||(this._scope[i]=[]),l=s.length;return s[l]=t.ref,a.setValue(t,{property:i,itemIndex:l}),a}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return a._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,o={},s){let l=a.nil;for(const d in e){const c=e[d];if(!c)continue;const u=o[d]=o[d]||new Map;c.forEach((e=>{if(u.has(e))return;u.set(e,r.Started);let o=n(e);if(o){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=a._`${l}${n} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==s?void 0:s(e)))throw new i(e);l=a._`${l}${o}${this.opts._n}`}u.set(e,r.Completed)}))}return l}}},8708:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const a=n(9029),i=n(4227),r=n(2023);function o(e,t){const n=e.const("err",t);e.if(a._`${r.default.vErrors} === null`,(()=>e.assign(r.default.vErrors,a._`[${n}]`)),a._`${r.default.vErrors}.push(${n})`),e.code(a._`${r.default.errors}++`)}function s(e,t){const{gen:n,validateName:i,schemaEnv:r}=e;r.$async?n.throw(a._`new ${e.ValidationError}(${t})`):(n.assign(a._`${i}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>a.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?a.str`"${e}" keyword must be ${t} ($data)`:a.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,i,r){const{it:l}=e,{gen:c,compositeRule:u,allErrors:m}=l,f=d(e,n,i);(null!=r?r:u||m)?o(c,f):s(l,a._`[${f}]`)},t.reportExtraError=function(e,n=t.keywordError,a){const{it:i}=e,{gen:l,compositeRule:c,allErrors:u}=i;o(l,d(e,n,a)),c||u||s(i,r.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(r.default.errors,t),e.if(a._`${r.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(a._`${r.default.vErrors}.length`,t)),(()=>e.assign(r.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:i,errsCount:o,it:s}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,r.default.errors,(o=>{e.const(l,a._`${r.default.vErrors}[${o}]`),e.if(a._`${l}.instancePath === undefined`,(()=>e.assign(a._`${l}.instancePath`,(0,a.strConcat)(r.default.instancePath,s.errorPath)))),e.assign(a._`${l}.schemaPath`,a.str`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign(a._`${l}.schema`,n),e.assign(a._`${l}.data`,i))}))};const l={keyword:new a.Name("keyword"),schemaPath:new a.Name("schemaPath"),params:new a.Name("params"),propertyName:new a.Name("propertyName"),message:new a.Name("message"),schema:new a.Name("schema"),parentSchema:new a.Name("parentSchema")};function d(e,t,n){const{createErrors:i}=e.it;return!1===i?a._`{}`:function(e,t,n={}){const{gen:i,it:o}=e,s=[c(o,n),u(e,n)];return function(e,{params:t,message:n},i){const{keyword:o,data:s,schemaValue:d,it:c}=e,{opts:u,propertyName:m,topSchemaRef:f,schemaPath:h}=c;i.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||a._`{}`]),u.messages&&i.push([l.message,"function"==typeof n?n(e):n]),u.verbose&&i.push([l.schema,d],[l.parentSchema,a._`${f}${h}`],[r.default.data,s]),m&&i.push([l.propertyName,m])}(e,t,s),i.object(...s)}(e,t,n)}function c({errorPath:e},{instancePath:t}){const n=t?a.str`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[r.default.instancePath,(0,a.strConcat)(r.default.instancePath,n)]}function u({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:a.str`${t}/${e}`;return n&&(o=a.str`${o}${(0,i.getErrorPath)(n,i.Type.Str)}`),[l.schemaPath,o]}},3835:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const a=n(9029),i=n(3558),r=n(2023),o=n(6939),s=n(4227),l=n(2586);class d{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function c(e){const t=m.call(this,e);if(t)return t;const n=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:d}=this.opts.code,{ownProperties:c}=this.opts,u=new a.CodeGen(this.scope,{es5:s,lines:d,ownProperties:c});let f;e.$async&&(f=u.scopeValue("Error",{ref:i.default,code:a._`require("ajv/dist/runtime/validation_error").default`}));const h=u.scopeName("validate");e.validateName=h;const p={gen:u,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[a.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,a.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:a.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:a._`""`,opts:this.opts,self:this};let _;try{this._compilations.add(e),(0,l.validateFunctionCode)(p),u.optimize(this.opts.code.optimize);const t=u.toString();_=`${u.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(_=this.opts.code.process(_,e));const n=new Function(`${r.default.self}`,`${r.default.scope}`,_)(this,this.scope.get());if(this.scope.value(h,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:h,validateCode:t,scopeValues:u._values}),this.opts.unevaluated){const{props:e,items:t}=p;n.evaluated={props:e instanceof a.Name?void 0:e,items:t instanceof a.Name?void 0:t,dynamicProps:e instanceof a.Name,dynamicItems:t instanceof a.Name},n.source&&(n.source.evaluated=(0,a.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,_&&this.logger.error("Error compiling schema, function code:",_),t}finally{this._compilations.delete(e)}}function u(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function m(e){for(const a of this._compilations)if(n=e,(t=a).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return a;var t,n}function f(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||h.call(this,e,t)}function h(e,t){const n=this.opts.uriResolver.parse(t),a=(0,o._getFullPath)(this.opts.uriResolver,n);let i=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&a===i)return _.call(this,n,e);const r=(0,o.normalizeId)(a),s=this.refs[r]||this.schemas[r];if("string"==typeof s){const t=h.call(this,e,s);if("object"!=typeof(null==t?void 0:t.schema))return;return _.call(this,n,t)}if("object"==typeof(null==s?void 0:s.schema)){if(s.validate||c.call(this,s),r===(0,o.normalizeId)(t)){const{schema:t}=s,{schemaId:n}=this.opts,a=t[n];return a&&(i=(0,o.resolveUrl)(this.opts.uriResolver,i,a)),new d({schema:t,schemaId:n,root:e,baseId:i})}return _.call(this,n,s)}}t.SchemaEnv=d,t.compileSchema=c,t.resolveRef=function(e,t,n){var a;n=(0,o.resolveUrl)(this.opts.uriResolver,t,n);const i=e.refs[n];if(i)return i;let r=f.call(this,e,n);if(void 0===r){const i=null===(a=e.localRefs)||void 0===a?void 0:a[n],{schemaId:o}=this.opts;i&&(r=new d({schema:i,schemaId:o,root:e,baseId:t}))}return void 0!==r?e.refs[n]=u.call(this,r):void 0},t.getCompilingSchema=m,t.resolveSchema=h;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(e,{baseId:t,schema:n,root:a}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const a of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,s.unescapeFragment)(a)];if(void 0===e)return;const i="object"==typeof(n=e)&&n[this.opts.schemaId];!p.has(a)&&i&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,i))}let r;if("boolean"!=typeof n&&n.$ref&&!(0,s.schemaHasRulesButRef)(n,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,n.$ref);r=h.call(this,a,e)}const{schemaId:l}=this.opts;return r=r||new d({schema:n,schemaId:l,root:a,baseId:t}),r.schema!==r.root.schema?r:void 0}},2023:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(9029),i={data:new a.Name("data"),valCxt:new a.Name("valCxt"),instancePath:new a.Name("instancePath"),parentData:new a.Name("parentData"),parentDataProperty:new a.Name("parentDataProperty"),rootData:new a.Name("rootData"),dynamicAnchors:new a.Name("dynamicAnchors"),vErrors:new a.Name("vErrors"),errors:new a.Name("errors"),this:new a.Name("this"),self:new a.Name("self"),scope:new a.Name("scope"),json:new a.Name("json"),jsonPos:new a.Name("jsonPos"),jsonLen:new a.Name("jsonLen"),jsonPart:new a.Name("jsonPart")};t.default=i},4551:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(6939);class i extends Error{constructor(e,t,n,i){super(i||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,a.resolveUrl)(e,t,n),this.missingSchema=(0,a.normalizeId)((0,a.getFullPath)(e,this.missingRef))}}t.default=i},6939:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const a=n(4227),i=n(2017),r=n(7106),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&d(e)<=t)};const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(s.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function d(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!o.has(n)&&("object"==typeof e[n]&&(0,a.eachItem)(e[n],(e=>t+=d(e))),t===1/0))return 1/0}return t}function c(e,t="",n){!1!==n&&(t=f(t));const a=e.parse(t);return u(e,a)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=c,t._getFullPath=u;const m=/#\/?$/;function f(e){return e?e.replace(m,""):""}t.normalizeId=f,t.resolveUrl=function(e,t,n){return n=f(n),e.resolve(t,n)};const h=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:a}=this.opts,o=f(e[n]||t),s={"":o},l=c(a,o,!1),d={},u=new Set;return r(e,{allKeys:!0},((e,t,a,i)=>{if(void 0===i)return;const r=l+t;let o=s[i];function c(t){const n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),u.has(t))throw p(t);u.add(t);let a=this.refs[t];return"string"==typeof a&&(a=this.refs[a]),"object"==typeof a?m(e,a.schema,t):t!==f(r)&&("#"===t[0]?(m(e,d[t],t),d[t]=e):this.refs[t]=r),t}function _(e){if("string"==typeof e){if(!h.test(e))throw new Error(`invalid anchor "${e}"`);c.call(this,`#${e}`)}}"string"==typeof e[n]&&(o=c.call(this,e[n])),_.call(this,e.$anchor),_.call(this,e.$dynamicAnchor),s[t]=o})),d;function m(e,t,n){if(void 0!==t&&!i(e,t))throw p(n)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},396:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4227:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const a=n(9029),i=n(1520);function r(e,t=e.schema){const{opts:n,self:a}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const i=a.RULES.keywords;for(const n in t)i[n]||h(e,`unknown keyword: "${n}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function s(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function d({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:i}){return(r,o,s,l)=>{const d=void 0===s?o:s instanceof a.Name?(o instanceof a.Name?e(r,o,s):t(r,o,s),s):o instanceof a.Name?(t(r,s,o),o):n(o,s);return l!==a.Name||d instanceof a.Name?d:i(r,d)}}function c(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",a._`{}`);return void 0!==t&&u(e,n,t),n}function u(e,t,n){Object.keys(n).forEach((n=>e.assign(a._`${t}${(0,a.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=r,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,i,r){if(!r){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return a._`${n}`}return a._`${e}${t}${(0,a.getProperty)(i)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(s(e))},t.escapeJsonPointer=s,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:d({mergeNames:(e,t,n)=>e.if(a._`${n} !== true && ${t} !== undefined`,(()=>{e.if(a._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,a._`${n} || {}`).code(a._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(a._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,a._`${n} || {}`),u(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:d({mergeNames:(e,t,n)=>e.if(a._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,a._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(a._`${n} !== true`,(()=>e.assign(n,!0===t||a._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=c,t.setEvaluated=u;const m={};var f;function h(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:m[t.code]||(m[t.code]=new i._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(f||(t.Type=f={})),t.getErrorPath=function(e,t,n){if(e instanceof a.Name){const i=t===f.Num;return n?i?a._`"[" + ${e} + "]"`:a._`"['" + ${e} + "']"`:i?a._`"/" + ${e}`:a._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,a.getProperty)(e).toString():"/"+s(e)},t.checkStrictMode=h},7887:function(e,t){"use strict";function n(e,t){return t.rules.some((t=>a(e,t)))}function a(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},a){const i=t.RULES.types[a];return i&&!0!==i&&n(e,i)},t.shouldUseGroup=n,t.shouldUseRule=a},8727:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const a=n(8708),i=n(9029),r=n(2023),o={message:"boolean schema is false"};function s(e,t){const{gen:n,data:i}=e,r={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,a.reportError)(r,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:a}=e;!1===n?s(e,!1):"object"==typeof n&&!0===n.$async?t.return(r.default.data):(t.assign(i._`${a}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:a}=e;!1===a?(n.var(t,!1),s(e)):n.var(t,!0)}},208:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const a=n(396),i=n(7887),r=n(8708),o=n(9029),s=n(4227);var l;function d(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(a.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l||(t.DataType=l={})),t.getSchemaTypes=function(e){const t=d(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=d,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:a,opts:r}=e,s=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,r.coerceTypes),d=t.length>0&&!(0===s.length&&1===t.length&&(0,i.schemaHasRulesForType)(e,t[0]));if(d){const i=m(t,a,r.strictNumbers,l.Wrong);n.if(i,(()=>{s.length?function(e,t,n){const{gen:a,data:i,opts:r}=e,s=a.let("dataType",o._`typeof ${i}`),l=a.let("coerced",o._`undefined`);"array"===r.coerceTypes&&a.if(o._`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,(()=>a.assign(i,o._`${i}[0]`).assign(s,o._`typeof ${i}`).if(m(t,i,r.strictNumbers),(()=>a.assign(l,i))))),a.if(o._`${l} !== undefined`);for(const e of n)(c.has(e)||"array"===e&&"array"===r.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void a.elseIf(o._`${s} == "number" || ${s} == "boolean"`).assign(l,o._`"" + ${i}`).elseIf(o._`${i} === null`).assign(l,o._`""`);case"number":return void a.elseIf(o._`${s} == "boolean" || ${i} === null
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash"),require("qs"),require("fecha"),require("@antv/g6"),require("element-tiptap")):"function"==typeof define&&define.amd?define(["lodash","qs","fecha","@antv/g6","element-tiptap"],t):"object"==typeof exports?exports.bpm2=t(require("lodash"),require("qs"),require("fecha"),require("@antv/g6"),require("element-tiptap")):e.bpm2=t(e.lodash,e.qs,e.fecha,e["@antv/g6"],e["element-tiptap"])}(self,(function(e,t,a,i,r){return function(){var o={5281:function(e,t,n){"use strict";n.d(t,{A:function(){return c}});var a=n(9795),i=n(6773),r=n.n(i),o=class{constructor(e,t={}){this._fnBatchLoad=e,this._options=t,this._queue=[]}async load(e){let t=await this.loads(e);return r().get(t,"0")}loads(...e){return new Promise(((t,n)=>{this._queue.push({keys:e,resolve:t,reject:n}),1==this._queue.length&&this.nextTick((()=>{this.process()}))}))}nextTick(e){setTimeout(e,0)}process(){let e=this._queue;this._queue=[];let t={};r().each(e,(e=>{r().each(e.keys,(e=>t[e]=null))}));let n=r().keys(t);this._fnBatchLoad(n).then((a=>{r().each(n,((e,n)=>{t[e]=a[n]})),r().each(e,(({keys:e,resolve:n})=>{n(r().map(e,(e=>t[e])))}))})).catch((t=>{r().each(e,(({reject:e})=>e(t)))}))}};const s=async(e,t,n)=>{if(console.log("netHeader",t.netHeader),t.networking=!0,t.netHeader&&(e.headers={common:t.netHeader}),e.params=_.merge({},e.params,n),t.env.ignore_levels&&_.set(e.params,"ignore_levels",!0),(0,a.Fr)()){let t=zj.utils.pageParam().token;e.params=_.merge({token:t,platform:"phone"},e.params)}e.isSilentOnErr=e=>{let t=_.get(e,"data.result");return t>=19e6||t<=19999999};let i=await zj.net.request(e);return t.networking=!1,i},l={},d={};var c={assistSelectEntranceForm:{getListDefinition(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i}){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_definition/`,method:"GET"},e,a)},getOptions(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_search/`,method:"GET",params:r},e,a)},getListSelected(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_selected/`,method:"GET",params:r},e,a)}},assistField:{getBatchLoader(e,{formDefId:t,fieldDefId:n,orgInfo:a,uniqueId:i}){const r=`${t}/${n}`,d=l[r]||new o((async r=>{console.log("assist_field/list_title requeset is call");let o=`/app_flow/v1/papi/assist_field/${t}/${n}/list_title/`;const l=await s({url:o,method:"GET",params:{values:JSON.stringify(r)}},e,a),d=_.get(l,"data.data.data",{});let c=[];return _.map(r,(e=>{i?(e=JSON.parse(e),e=_.get(e,`${i}`),c=_.concat(c,d[e])):c=_.concat(c,d[e])})),c}));return l[r]=d,d},getTitle(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r){return s({url:`/app_flow/v1/papi/assist_field/${t}/${n}/list_title/`,method:"GET",params:{values:JSON.stringify(r)}},e,a)},async searchSelectOpts(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r={},o=""){console.log("selectOpts: ",t,n,a,i),o&&(r.q=o);let l=i?`/app_flow/v1/papi/dm/assist_field/${t}/${n}/search_title/`:`/app_flow/v1/papi/assist_field/${t}/${n}/search_title/`,c=`${t}/${n}/${o}`,u={};return!d[c]||(new Date).getTime()-d[c].last_time>2e3?(u=await s({url:l,method:i?"GET":"POST",data:r},e,a),console.log("searchSelectOpts",u),d[c]={last_time:(new Date).getTime(),result:u}):u=d[c].result,u},selectFromMulFormSearchOpts(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r={},o=""){return o&&(r.q=o),s({url:i?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${n}/search_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${n}/search_title/`,method:"GET",params:r},e,a)},selectFromMulFormListTitleLoader(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i}){const r=`${t}/${n}`,d=l[r]||new o((async r=>{let o=i?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${n}/list_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${n}/list_title/`;const l=await s({url:o,method:"GET",params:{values:JSON.stringify(r)}},e,a);console.log(l);const d=_.get(l.data,"data.items",[]),c={};d.forEach((e=>{Object.keys(e.data).forEach((t=>{let n=e.data[t];c[t]={form_def_id:_.get(e,"definition.form.id"),form_title:_.get(e,"definition.form.name"),label:n}}))}));let u=[];return r.forEach((e=>{u.push(c[e])})),u}));return l[r]=d,d},selectFromMulFormListTitle(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r){return s({url:i?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${n}/list_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${n}/list_title/`,method:"GET",params:{values:JSON.stringify(r)}},e,a)}},assistTreeField:{searchSelectOpts(e,{formDefId:t,fieldDefId:n,orgInfo:a,isDm:i},r={},o=""){return o&&(r.q=o),s({url:i?`/app_flow/v1/papi/dm/assist_tree_field/${t}/${n}/search_title/`:`/app_flow/v1/papi/assist_tree_field/${t}/${n}/search_title/`,method:"GET",params:r},e,a)}},assistUserTaskCC:{searchSelectOpts(e,{formDefId:t,node:n,orgInfo:a,isDm:i},r={},o=""){return o&&(r.q=o),s({url:`/app_flow/v1/papi/assist_user_task_cc/${t}/${n}/search_title/`,method:"GET",params:r},e,a)}}}},2042:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return T}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-area",attrs:{fieldConf:e.fieldConf,row:e.row,isMultiple:e.isMultiple,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-area-editor"},[n("div",{on:{click:e.toOpen}},[e.label?n("div",[e._v("\n "+e._s(e.label)+"\n ")]):n("div",[n("el-button",{attrs:{size:"small",icon:"el-icon-location-outline"}},[e._v(" "+e._s(e.$z("选择区域","c.select_area")))])],1)]),e._v(" "),n("el-dialog",e._g(e._b({attrs:{visible:e.opened,"before-close":e.onHide,width:"65%",title:e.fieldConf.name,fullscreen:!1,"append-to-body":""},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("div",[e._v("\n "+e._s(e.$z("当前选中","b2.common.selected"))+":\n "),n("el-tag",[e._v(e._s(e.label))])],1),e._v(" "),e.refresh?n("div",{staticClass:"subcategory-tree-box"},[n("div",{staticClass:"subcategory-tree",staticStyle:{"max-height":"550px",overflow:"auto"}},[n("el-tree",{ref:"tree",attrs:{props:e.defaultProps,lazy:"","show-checkbox":!1,load:e.onLazyTreeLoad,"expand-on-click-node":!0,"check-strictly":!0},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return n("span",{staticClass:"custom-tree-node"},[n("div",{staticClass:"tree-body-content"},[n("div",[e._v(e._s(a.label))]),e._v(" "),"strict"==e.tickStrategy&&a.lazy&&a.selectable?n("span",{on:{click:function(t){return t.stopPropagation(),e.expand(a.id,"force")}}},[e._v(e._s(e.$z("选择","c.choose")))]):e._e()])])}}],null,!1,3939466302)})],1)]):e._e()]),e._v(" "),e.openLocate?n("room-map-select",{attrs:{field:e.field,drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas},on:{save:e.savePlan}}):e._e()],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(6773),l=n.n(s),d=n(7642),c=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",[e._v("\n slsls\n")])};c._withStripped=!0;var u=n(4486),m=(0,u.A)({},c,[],!1,null,null,null);m.options.__file="components/lib/bpmArea/src/part/room-map-select.vue";var f=m.exports;o().use(d.Dialog);var h={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:f},inject:["selectOptions"],data(){return{curVal:"",label:zj.z("选择区域","c.select_area"),keyword:"",opened:!1,debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[],treeItemMap:{},subareas:[],drawingMd5s:[],refresh:!0,selectedKey:"",defaultProps:{children:"children",label:"label",isLeaf:"isLeaf"},selectList:[],allAreaMap:{}}},watch:{value(){this.curVal=this.value,this.loadRemoteLabel()},selectedKey(e){e&&this.selected(e)},getSelectOptions(e){this.refresh=!1,this.selectList=e,setTimeout((()=>{this.refresh=!0}),500)}},computed:{tickStrategy(){return"leaf_only"==l().get(this.fieldConf,"can","all")?"leaf-filtered":"strict"},openLocate(){return l().get(this.fieldConf,"enable_locate")},points(){return l().get(this.value,"all_points",[])},canSelect(){return l().get(this.fieldConf,"can")},getSelectOptions(){return this.selectOptions?this.selectOptions():[]}},mounted(){this.curVal=this.value,this.loadRemoteLabel()},methods:{handleNodeClick(e){this.selectedKey=l().get(e,"id","")},handleCheckChange(e,t,n){console.log(e,t,n)},toOpen(){this.opened=!0},toClose(){this.opened=!1},reset(){try{let e=this.value;this.selectedKey=l().get(e,"id","")}catch(e){this.selectedKey=""}},async onOpen(){if(l().isEmpty(this.selectList)||!this.selectList){let e=await this.loadList("");console.log("onOpendata",e),this.selectList=e,this.reset()}this.opened=!0},clear(){this.removeValue(),this.resetLabel(),this.selectedKey=""},onLazyTreeLoad(e,t){setTimeout((async()=>{let n=[];console.log("node——onLazyTreeLoad",e),n=0==e.level?await this._loadNextCategoryList(""):await this._loadNextCategoryList(e.data.id),this.setCategoryInMap(n),console.log("list",n),t(n)}),500)},async _loadNextCategoryList(e){let t=await this.loadList(e);return console.log("data_tree",t),this.transformResultToTree(t)},transformResultToTree(e){let t=this.canSelect;return l().map(e,(e=>{let n=e.drawing_md5s;n=l().compact(n);let a={id:e.id,lazy:e.is_parent,label:e.name,isLeaf:!e.is_parent,path_ids:e.path_ids,path_names:e.path_names,selectable:e.available,haspic:!!n.length,type:e.type};return"building_floor"==t&&3==e.type&&(a.lazy=!1),l().set(this.treeItemMap,e.id,a),a}))},async loadList(e){let t=this.search_keyword,n=JSON.stringify({id:e,path_ids:l().get(this.treeItemMap,`${e}.path_ids`),type:l().get(this.treeItemMap,`${e}.type`)}),a=zj.pageParam({father:n,q:t});e||delete a.father,this.selectFields&&(a.fields=this.selectFields);let i=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container});return console.log("data",i),i},setCategoryInMap(e){l().each(e,(e=>{l().set(this.allAreaMap,e.value,e)}))},selected(e,t){e=l().toString(e);let n=l().get(this.treeItemMap,e,null);n&&(n&&n.lazy&&!t||!e||!n.selectable||(this.label=n.label,n=l().cloneDeep(n),delete n.label,delete n.lazy,delete n.path_names,delete n.pathNames,delete n.selectable,delete n.haspic,delete n.children,this.value,this.$emit("input",[{id:n.id,path_ids:n.path_ids,all_points:[],type:n.type}]),this.loadRemoteLabel(),this.toClose()))},expand(e,t){if(e=l().toString(e),!l().get(this.treeItemMap,e,null).lazy||t)this.selected(e,t);else{let t=this.$refs.tree.isExpanded(l().toInteger(e));this.$refs.tree.setExpanded(l().toInteger(e),!t)}},savePlan(e){this.curVal.all_points=l().cloneDeep(e),this.$emit("input",this.curVal.all_points),this.$emit("change",this.curVal.all_points)},async search(){let e=this.search_keyword;if(this.keyword=e,this.expandedKeys=[],!e)return;this.$bpm.setFuncGIO("区域搜索");let t=await this._loadNextCategoryList("");this.changeLazy(t),this.filterNodes=t},changeLazy(e){this.setCategoryInMap(e),l().each(e,(e=>{this.expandedKeys.push(e.value),e.lazy=!1,e.expandable=!0,e.children&&this.changeLazy(e.children)}))},async loadRemoteLabel(){if(!this.value)return;let e=this.value[0];if(!l().isNil(e)&&e)try{this.loading=!0,e=l().cloneDeep(e),delete e.all_points,delete e.path_ids,delete e.type,e=JSON.stringify(e);let t=await this.$bpm.fetchLabelByValue(e,this.fieldConf.id,this.formName,this,"id",this.row);this.subareas=l().get(t,"subareas",[]),this.drawingMd5s=l().get(t,"drawing_md5s",[]);let n=l().join(t.path_names,"/");this.label=`${n}${n?"/":""}${t.name}`}finally{this.loading=!1}else this.label=""},onHide(){this.opened=!1}}},p=(0,u.A)(h,i,[],!1,null,null,null);p.options.__file="components/lib/bpmArea/src/part/editor.vue";var g=p.exports,y=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-area-editor"},[n("div",{on:{click:function(t){return t.stopPropagation(),e.toOpen.apply(null,arguments)}}},[e.labels.length>0?n("div",[e._l(e.labels,(function(t){return n("el-tag",{key:t,staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t))])})),e._v(" "),n("i",{staticClass:"el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.delAllItem()}}})],2):n("div",[n("el-button",{attrs:{size:"small",icon:"el-icon-location-outline"}},[e._v(" "+e._s(e.$z("选择区域","c.select_area")))])],1)]),e._v(" "),n("el-dialog",e._g(e._b({attrs:{visible:e.opened,"before-close":e.onHide,width:"65%",title:e.fieldConf.name,fullscreen:!1,"append-to-body":""},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("div",[e._v("\n "+e._s(e.$z("当前选中","b2.common.selected"))+":\n "),e._l(e.labelObjs,(function(t,a){return[a<5?n("el-tag",{key:t.id,staticStyle:{"margin-right":"10px","margin-top":"5px"},attrs:{closable:""},on:{close:function(n){return e.delHandle(t)}}},[e._v(e._s(t.pathNames))]):e._e()]})),e._v(" "),e.labelObjs.length>5?n("el-dropdown",[n("el-button",{attrs:{type:"primary"}},[e._v("\n "+e._s(e.$z("更多","c.more"))),n("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e._l(e.labelObjs,(function(t,a){return[a>=5?n("el-dropdown-item",{key:t.id},[n("el-tag",{staticStyle:{"margin-right":"10px","margin-top":"5px"},attrs:{closable:""},on:{close:function(n){return e.delHandle(t)}}},[e._v(e._s(t.pathNames))])],1):e._e()]}))],2)],1):e._e()],2),e._v(" "),e.refresh?n("div",{staticClass:"subcategory-tree-box"},[n("div",{staticClass:"subcategory-tree",staticStyle:{"max-height":"550px",overflow:"auto"}},[n("el-tree",{ref:"tree",attrs:{props:e.defaultProps,lazy:"","node-key":"id","show-checkbox":!0,load:e.onLazyTreeLoad,"expand-on-click-node":!1,"check-on-click-node":!0,"check-strictly":!0},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return n("span",{staticClass:"custom-tree-node"},[n("div",{staticClass:"tree-body-content"},[n("div",[e._v(e._s(a.label))]),e._v(" "),"strict"==e.tickStrategy&&a.lazy&&a.selectable?n("span",{on:{click:function(t){return t.stopPropagation(),e.expand(a.id,"force")}}},[e._v(e._s(e.$z("选择","c.choose")))]):e._e()])])}}],null,!1,3939466302)})],1),e._v(" "),n("div",{staticStyle:{display:"flex","flex-direction":"row-reverse"}},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确认","c.confirm")))]),e._v(" "),n("el-button",{staticStyle:{"margin-right":"10px"},on:{click:function(t){return e.clear()}}},[e._v(e._s(e.$z("重置","c.reset")))])],1)]):e._e()]),e._v(" "),e.openLocate?n("room-map-select",{attrs:{field:e.field,drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas},on:{save:e.savePlan}}):e._e()],1)};y._withStripped=!0,o().use(d.Dialog);var b={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:f},inject:["selectOptions"],data(){return{curVal:[],label:zj.z("选择区域","c.select_area"),labels:[],labelObjs:[],keyword:"",opened:!1,debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[],treeItemMap:{},subareas:[],drawingMd5s:[],refresh:!0,selectedKeys:[],selectedItems:[],defaultProps:{children:"children",label:"label",isLeaf:"isLeaf"},selectList:[],allAreaMap:{}}},watch:{value(){this.curVal=this.value,this.selectedKeys=l().map(this.curVal,(e=>e.id)),console.log("this.selectedKeys",this.selectedKeys),this.loadRemoteLabel()},selectedKeys(e){e&&this.selected(e)},getSelectOptions(e){this.refresh=!1,this.selectList=e,setTimeout((()=>{this.refresh=!0}),500)}},computed:{tickStrategy(){return"leaf_only"==l().get(this.fieldConf,"can","all")?"leaf-filtered":"strict"},openLocate(){return l().get(this.fieldConf,"enable_locate")},points(){return l().get(this.value,"all_points",[])},canSelect(){return l().get(this.fieldConf,"can")},getSelectOptions(){return this.selectOptions?this.selectOptions():[]}},mounted(){this.curVal=this.value,this.loadRemoteLabel()},methods:{delAllItem(){this.clear(),this.$nextTick((()=>{this.onSubmit()}))},delHandle(e){console.log("del_item",e),this.selectedKeys=l().filter(this.selectedKeys,(t=>t!=e.id)),this.setCheckedNode(this.selectedKeys)},handleNodeClick(e){console.log("data",e)},setCheckedNode(e){let t=[];t=e||l().map(this.value,(e=>e.id)),console.log("this.curVal",this.curVal),console.log("_keys",t),this.$refs.tree&&this.$refs.tree.setCheckedKeys(t)},handleCheckChange(e,t,n){console.log("checked_data",e),t?this.selectedKeys.push(e.id):this.selectedKeys=l().filter(this.selectedKeys,(t=>t!=e.id)),console.log("this.selectedKeys",this.selectedKeys),console.log(e,t,n)},toOpen(){this.opened=!0},toClose(){this.opened=!1},reset(){this.selectedKeys=[]},onSubmit(){console.log("this.selectItems",this.selectedItems),this.$emit("input",this.selectedItems),this.toClose()},async onOpen(){this.opened=!0},clear(){this.selectedKeys=[],this.selectedItems=[],this.labels=[],this.labelObjs=[],this.curVal=[],this.setCheckedNode([])},onLazyTreeLoad(e,t){setTimeout((async()=>{let n=[];console.log("node——onLazyTreeLoad",e),0==e.level?(n=await this._loadNextCategoryList(""),this.setCheckedNode()):n=await this._loadNextCategoryList(e.data.id),this.setCategoryInMap(n),console.log("list",n),t(n)}),500)},async _loadNextCategoryList(e){let t=await this.loadList(e);return console.log("data_tree",t),this.transformResultToTree(t)},transformResultToTree(e){let t=this.canSelect;return this.loading=!1,l().map(e,(e=>{let n=!0;switch(console.log("canSelect",t),t){case"any":n=!0;break;case"leaf_only":n=!e.is_parent;break;case"building":n=2==e.type;break;case"floor":n=3==e.type;break;case"building_floor":n=2==e.type||3==e.type;break;case"suite":n=4==e.type||5==e.type;break;case"suite_ex":n=4==e.type||5==e.type||6==e.type}let a=l().join(e.path_names,"/"),i={id:e.id,lazy:e.is_parent,isLeaf:!e.is_parent,label:e.name,type:e.type,path_ids:e.path_ids,path_names:e.path_names,pathNames:`${a}${a?"/":""}${e.name}`,tickable:n,noTick:!n};return console.log("tran_data",i),"building_floor"==t&&3==e.type&&(i.lazy=!1,i.isLeaf=!0),l().set(this.treeItemMap,e.id,i),i}))},async loadList(e){let t=this.search_keyword,n=JSON.stringify({id:e,path_ids:l().get(this.treeItemMap,`${e}.path_ids`),type:l().get(this.treeItemMap,`${e}.type`)}),a=zj.pageParam({father:n,q:t});e||delete a.father,this.selectFields&&(a.fields=this.selectFields);let i=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container});return console.log("data",i),i},setCategoryInMap(e){l().each(e,(e=>{l().set(this.allAreaMap,e.value,e)}))},selected(e,t){this.selectedItems=[],console.log("keys",e),e&&e.length>0&&l().each(e,(e=>{e=l().toString(e);let t=l().get(this.treeItemMap,e,null);console.log("—item",t),t&&(this.label=t.label,t=l().cloneDeep(t),console.log("item",t),this.selectedItems.push({id:t.id,path_ids:t.path_ids,all_points:[],type:t.type}))})),console.log("this.selectedItems",this.selectedItems),this.curVal=l().cloneDeep(this.selectedItems),console.log("this.curVal",this.curVal),this.loadRemoteLabel()},expand(e,t){if(e=l().toString(e),!l().get(this.treeItemMap,e,null).lazy||t)this.selected(e,t);else{let t=this.$refs.tree.isExpanded(l().toInteger(e));this.$refs.tree.setExpanded(l().toInteger(e),!t)}},savePlan(e){this.curVal.all_points=l().cloneDeep(e),this.$emit("input",this.curVal.all_points),this.$emit("change",this.curVal.all_points)},async search(){let e=this.search_keyword;if(this.keyword=e,this.expandedKeys=[],!e)return;this.$bpm.setFuncGIO("区域搜索");let t=await this._loadNextCategoryList("");this.changeLazy(t),this.filterNodes=t},changeLazy(e){this.setCategoryInMap(e),l().each(e,(e=>{this.expandedKeys.push(e.value),e.lazy=!1,e.isLeaf=!0,e.expandable=!0,e.children&&this.changeLazy(e.children)}))},async loadRemoteLabel(){if(this.curVal)if(!l().isNil(this.curVal)&&this.curVal&&0!=this.curVal.length)try{let e=[];l().each(this.curVal,(t=>{e.push(JSON.stringify(t))})),this.loading=!0,console.log("list",e);let t=await this.$bpm.fetchLabelByValues(e,this.fieldConf.id,this.formName,this,"id");this.subareas=l().get(t,"subareas",[]),this.drawingMd5s=l().get(t,"drawing_md5s",[]),this.labels=[];let n=l().map(t,(e=>{let t=l().join(e.path_names,"/");return e.pathNames=`${t}${t?"/":""}${e.name}`,l().set(this.treeItemMap,e.id,e),e.pathNames}));this.labelObjs=l().cloneDeep(t),this.labels=l().cloneDeep(n),n=l().join(n,", "),this.label=n}finally{this.loading=!1}else this.label=zj.z("选择区域","c.select_area")},onHide(){this.opened=!1}}},v=(0,u.A)(b,y,[],!1,null,null,null);v.options.__file="components/lib/bpmArea/src/part/multi-editor.vue";var w=v.exports,M=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"area-reader"},[e.isMultiple?[e.openLocate?e._l(e.labelObjs,(function(t){return n("div",{key:t.id},[n("el-tag",{staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t.pathNames))]),e._v(" "),e.openLocate?n("room-map-select",{attrs:{drawingMd5s:t.drawingMd5s,defaultPoints:e.points,subareas:t.subareas}}):e._e()],1)})):e._l(e.labelObjs,(function(t){return n("el-tag",{key:t.id,staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t.pathNames))])}))]:[n("span",{attrs:{title:e.label}},[e._v(e._s(e.label)+" "),n("i",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"el-icon-loading",attrs:{size:"14px"}})]),e._v(" "),e.openLocate?n("room-map-select",{attrs:{drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas}}):e._e()]],2)};M._withStripped=!0;var L={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:f},data(){return{label:"",labelObjs:[],loading:!1,subareas:[],drawingMd5s:[],curVal:[]}},watch:{value(){this.curVal=this.value,this.isMultiple?this.loadRemoteLabels():this.loadRemoteLabel()}},computed:{openLocate(){return _.get(this.fieldConf,"enable_locate")},points(){return _.get(this.value,"all_points",[])}},mounted(){this.curVal=this.value,this.isMultiple?this.loadRemoteLabels():this.loadRemoteLabel()},methods:{async loadRemoteLabel(){console.log("this.value",this.value);let e=this.value[0];if(!_.isNil(e)&&e)try{this.loading=!0,e=_.cloneDeep(e),delete e.all_points,delete e.path_ids,delete e.type,e=JSON.stringify(e);let t=await this.$bpm.fetchLabelByValue(e,this.fieldConf.id,this.formName,this,"id",this.row);this.subareas=_.get(t,"subareas",[]),this.drawingMd5s=_.get(t,"drawing_md5s",[]);let n=_.join(t.path_names,"/");this.label=`${n}${n?"/":""}${t.name}`,this.loading=!1}finally{this.loading=!1}else this.label=zj.z("未选择","c.not_selected")},async loadRemoteLabels(){if(!_.isNil(this.curVal)&&this.curVal&&0!=this.curVal.length)try{let e=[];_.each(this.curVal,(t=>{e.push(JSON.stringify(t))})),this.loading=!0,console.log("list",e);let t=await this.$bpm.fetchLabelByValues(e,this.fieldConf.id,this.formName,this,"id");this.labels=[];let n=_.map(t,(e=>{let t=_.join(e.path_names,"/");return e.pathNames=`${t}${t?"/":""}${e.name}`,_.set(this.treeItemMap,e.id,e),e.pathNames}));this.labelObjs=_.cloneDeep(t),this.labels=_.cloneDeep(n),n=_.join(n,", "),this.label=n,console.log("this.labelObjs",this.labelObjs)}finally{this.loading=!1}}}},k=(0,u.A)(L,M,[],!1,null,null,null);k.options.__file="components/lib/bpmArea/src/part/reader.vue";var S=k.exports,D={name:"BpmArea",components:{editorComponent:g,multiEditorComponent:w,readerComponent:S},props:{value:{type:[String,Array,Number]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},isMultiple:{type:Boolean,default(){return!1}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?S:this.isMultiple?w:g}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},x=(0,u.A)(D,a,[],!1,null,null,null);x.options.__file="components/lib/bpmArea/src/main.vue";var Y=x.exports;Y.install=function(e){e.component(Y.name,Y)};var T=Y},7930:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return P}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"area-elevation"},[e.curVal&&e.curVal.selected?["table"==e.uiType?[n("el-popover",{attrs:{placement:"top-start",width:"500",trigger:"hover"}},[n("div",{staticStyle:{display:"flex","flex-flow":"wrap",margin:"10px"}},e._l(e.curVal.selected,(function(t){return n("div",{key:t.key,staticClass:"area-elevation-select-box",staticStyle:{"margin-left":"5px","margin-top":"5px"}},[n("el-tag",{staticClass:"area-elevation-select-item"},[e._v(e._s(t.name))])],1)})),0),e._v(" "),n("div",{attrs:{slot:"reference"},slot:"reference"},[e.curVal.selected&&e.curVal.selected.length>2?[e._l(e.curVal.selected,(function(t,a){return n("div",{key:t.key,staticClass:"area-elevation-select-box"},[a<2?n("el-tag",{staticClass:"area-elevation-select-item"},[e._v(e._s(t.name))]):e._e()],1)})),e._v(" "),n("div",{staticClass:"area-elevation-select-box"},[n("el-tag",{staticClass:"area-elevation-select-item"},[e._v("+"+e._s(e.curVal.selected.length-2))])],1)]:e._l(e.curVal.selected,(function(t){return n("div",{key:t.key,staticClass:"area-elevation-select-box"},[n("el-tag",{staticClass:"area-elevation-select-item"},[e._v(e._s(t.name))])],1)}))],2)])]:e._l(e.curVal.selected,(function(t){return n("div",{key:t.key,staticClass:"area-elevation-select-box"},[n("el-tag",{staticClass:"area-elevation-select-item"},[e._v(e._s(t.name))])],1)}))]:e._e(),e._v(" "),e.loading?n("i",{staticClass:"el-icon-loading"}):n("el-button",{attrs:{type:"view"==e.mode?"text":"plain",size:"small",icon:"el-icon-location-outline"},on:{click:function(t){return e.openSelectSectionDlg()}}},[e._v(e._s(e.button_title))]),e._v(" "),n("dlg-select-section",{attrs:{mode:e.mode,dialog_title:e.dialog_title,areaMap:e.areaMap,allTreeData:e.allTreeData,colorConfig:e.colorConfig,value:e.curVal,show:e.dlg.show},on:{close:e.colseSelectSectionDlg}})],2)};a._withStripped=!0;var i=n(7642),r=n(5554),o=n.n(r),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.dialog_title,visible:e.dialogVisible,width:"80%","append-to-body":"","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-form",{ref:"form",attrs:{inline:!0,model:e.form,"label-width":"100px"}},[n("el-row",[n("el-form-item",{attrs:{label:e.$z("楼栋","c.building")}},[n("el-select",{attrs:{placeholder:e.$z("请选择楼栋","c.select_a_building"),disabled:"view"==e.mode},on:{change:e.changeBuilding},model:{value:e.form.building_id,callback:function(t){e.$set(e.form,"building_id",t)},expression:"form.building_id"}},e._l(e.buildingOptions,(function(e){return n("el-option",{key:e.key,attrs:{label:e.title,value:e.key}})})),1)],1),e._v(" "),n("el-form-item",{attrs:{label:e.$z("楼层","c.floor")}},[n("el-select",{attrs:{multiple:"",placeholder:"请选择楼层",disabled:"view"==e.mode},on:{change:e.filterData},model:{value:e.form.storey_ids,callback:function(t){e.$set(e.form,"storey_ids",t)},expression:"form.storey_ids"}},e._l(e.floor_options,(function(e){return n("el-option",{key:e.key,attrs:{label:e.title,value:e.key}})})),1)],1),e._v(" "),n("el-form-item",{attrs:{label:"关建字筛选"}},[n("el-input",{attrs:{placeholder:"请输入",disabled:"view"==e.mode},on:{input:e.filterData},model:{value:e.form.keyword,callback:function(t){e.$set(e.form,"keyword",t)},expression:"form.keyword"}})],1)],1),e._v(" "),n("el-row",[n("el-col",{attrs:{span:10}},[n("el-form-item",{attrs:{label:"展示方式"}},[n("el-radio-group",{attrs:{disabled:e.show_level_disable||"view"==e.mode},model:{value:e.form.show_level,callback:function(t){e.$set(e.form,"show_level",t)},expression:"form.show_level"}},[n("el-radio",{attrs:{label:3}},[e._v("展示到3级")]),e._v(" "),n("el-radio",{attrs:{label:4}},[e._v("展示到4级")])],1)],1)],1),e._v(" "),n("el-col",{attrs:{span:6}},[n("zj-color-indication",{staticStyle:{float:"right"},attrs:{colorConfig:e.colorConfig}})],1)],1)],1),e._v(" "),n("div",{staticStyle:{margin:"0 20px 20px 20px"}},[e._v("已选项:"),e._l(e.selectedItem,(function(t){return n("el-tag",{key:t.key,staticStyle:{margin:"5px"},attrs:{closable:"view"!=e.mode},on:{close:function(n){return e.removeItem(t)}}},[e._v("\n "+e._s(t.name)+"\n ")])}))],2),e._v(" "),n("zj-pc-select-position-table",{attrs:{data:e.treeData,readonly:"view"==e.mode},model:{value:e.selectedItem,callback:function(t){e.selectedItem=t},expression:"selectedItem"}}),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){return e.close()}}},[e._v(e._s(e.$z("取消","c.cancel")))]),e._v(" "),"view"!=e.mode?n("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v(e._s(e.$z("确定","c.confirm")))]):e._e()],1)],1)};s._withStripped=!0;var l=n(6902),d=n(5072),c=n.n(d),u=n(7825),m=n.n(u),f=n(7659),h=n.n(f),p=n(5056),g=n.n(p),y=n(540),b=n.n(y),v=n(1113),w=n.n(v),M=n(2392),L={};L.styleTagTransform=w(),L.setAttributes=g(),L.insert=h().bind(null,"head"),L.domAPI=m(),L.insertStyleElement=b(),c()(M.A,L),M.A&&M.A.locals&&M.A.locals;var k=n(3231),S={};S.styleTagTransform=w(),S.setAttributes=g(),S.insert=h().bind(null,"head"),S.domAPI=m(),S.insertStyleElement=b(),c()(k.A,S),k.A&&k.A.locals&&k.A.locals,o().use(l.SelectPositionTable),o().use(l.ColorIndication);var D={props:{allTreeData:{type:Array,default:function(){return[]}},mode:{type:String,default(){return"view"}},areaMap:{type:Object,default:function(){return{}}},colorConfig:{type:Object,default:function(){return{}}},value:{type:[String,Array,Number,Object]},statusList:{type:Array,default:function(){return[]}},show:{type:Boolean,default:!1},all_level:{type:Number,default:0},dialog_title:{type:String,default:"选择部位"}},watch:{"form.show_level"(e,t){this.selectedItemMap["level_"+t]=this.selectedItem,this.filterData()},allTreeData(e){this.buildingOptions=e},value:{handler(e){},immediate:!0},show(e){if(this.dialogVisible=e,e){if(this.value&&this.value.building_ids?(this.form.building_id=this.value.building_ids[0]+"",this.form.building_ids=this.value.building_ids):this.allTreeData&&this.allTreeData.length>0&&(this.form.building_id=this.allTreeData[0].key,this.form.building_ids=[this.allTreeData[0].key]),this.value&&this.value.storey_ids){let e=[];_.each(this.value.storey_ids,(t=>{e.push(t+"")}))}this.value&&this.value.selected?(this.selectedItem=this.value.selectedItem,this.form.keyword=this.value.keyword,this.form.show_level=this.value.show_level):this.selectedItem=[],this.loadBuildingData()}},selectedItem:{handler(e){},deep:!0}},data(){return{dialogVisible:!1,show_level_disable:!1,form:{building_id:"1",storey_ids:[],show_level:4,keyword:""},buildingOptions:[],floor_options:[],selectedItem:[],treeData:[],buildingTreeData:[],selectedItemMap:{level_3:[],level_4:[]}}},methods:{confirm(){let e=[];_.each(this.selectedItem,(t=>{this.areaMap[t.key]&&e.push(this.areaMap[t.key])}));let t=[];_.each(this.form.storey_ids,(e=>{t.push(parseInt(e))}));let n={selectedItem:this.selectedItem,selected:e,building_ids:[parseInt(this.form.building_id)],storey_ids:t,keyword:this.form.keyword,show_level:parseInt(this.form.show_level)};this.$emit("close",n)},close(){this.dialogVisible=!1,this.$emit("close",!1)},handleClose(e){this.$emit("close",!1)},filterData(){if(this.treeData=_.cloneDeep(this.buildingTreeData.filter((e=>this.form.storey_ids.length>0?_.includes(this.form.storey_ids,e.key)?e:void 0:e))),3==this.form.show_level&&_.each(this.treeData,(e=>{_.each(e.childrens,(e=>{delete e.childrens}))})),4==this.form.show_level){let e=this.selectedItemMap.level_3;e&&e.length>0&&(_.each(this.treeData,(t=>{_.each(t.childrens,(t=>{_.find(e,{key:t.key})&&_.each(t.childrens,(n=>{e.push({key:n.key,name:t.name+"-"+n.title})}))}))})),this.selectedItem=e)}console.log("treeData",this.treeData),this.filterKeyWord()},changeBuilding(){this.loadBuildingData()},loadBuildingData(){let e=_.find(this.allTreeData,{key:this.form.building_id});e&&(e.childrens?this.buildingTreeData=_.cloneDeep(e.childrens):this.buildingTreeData=[],this.buildingTreeData.length>0&&(this.buildingTreeData[0].childrens&&this.buildingTreeData[0].childrens[0].childrens&&this.buildingTreeData[0].childrens[0].childrens.length>0?this.show_level_disable=!1:(this.form.show_level=3,this.show_level_disable=!0)),this.floor_options=this.buildingTreeData,this.filterData())},filterKeyWord(){this.form.keyword&&(this.treeData=this.treeData.filter((e=>{let t=!1;if(e.childrens&&e.childrens.length>0&&(e.childrens=e.childrens.filter((e=>{if(-1!=e.title.indexOf(this.form.keyword)||-1!=this.form.keyword.indexOf(e.title))return t=!0,e;if(e.childrens&&e.childrens.length>0){let n=!1;if(_.each(e.childrens,(e=>{-1==e.title.indexOf(this.form.keyword)&&-1==this.form.keyword.indexOf(e.title)||(n=!0,t=!0)})),n)return e}}))),t)return e})))},removeItem(e){this.selectedItem=_.filter(this.selectedItem,(function(t){return t.key!=e.key}))}},mounted(){}},x=n(4486),Y=(0,x.A)(D,s,[],!1,null,null,null);Y.options.__file="components/lib/bpmAreaElevation/src/part/dlgSelectSection.vue";var T=Y.exports;o().use(i.Dialog);var C={name:"BpmAreaElevation",components:{dlgSelectSection:T},props:{value:{type:[String,Array,Number,Object]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},container:{type:Object,default(){return{}}},formName:{type:String},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},isMultiple:{type:Boolean,default(){return!1}}},data(){return{sourceData:[],allTreeData:[],areaMap:{},dlg:{show:!1},curVal:{building_id:"",storey_ids:[],selected:[],keyword:"",show_level:"4"},loading:!1,button_title:"",dialog_title:"",colorConfig:{data:[{name:"task_no",title:zj.z("未开始","c.not_started"),color:"#fff",border_color:"#D8DADD",width:"100px"},{name:"task_ready",title:zj.z("进行中","c.in_progress"),color:"#FFE9BD",border_color:"#FFE9BD",width:"100px"},{name:"task_ing",title:zj.z("已完成","c.completed"),color:"#B4EFCE",border_color:"#B4EFCE",width:"100px"}]}}},computed:{},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.value&&(this.curVal=this.value)}},mounted(){this.fieldConf.test&&(this.formateData(this.fieldConf.range_enum),this.getColorConfig(this.fieldConf.status_range_enum)),console.log("uiType",this.uiType),"view"==this.mode?(this.button_title="",this.dialog_title=zj.z("查看部位","c.view_part")):(this.button_title=zj.z("选择部位","c.select_part"),this.dialog_title=zj.z("选择部位","c.select_part")),this.curVal=this.value},methods:{async loadList(e){let t=this.fieldConf.area||"",n=this.fieldConf.status_scope.depends[0]||"";if(!t||!n)return console.log("没有配置联区域字段或检查项依赖自段"),!1;let a={fields:{}};return console.log("_area_field",t),console.log("_checkitem_field",n),console.log("row",this.row),console.log("this.container",this.container),this.container&&this.container.formData&&(t&&(a.fields[t]=this.container.formData[t]),n&&(a.fields[n]=this.container.formData[n])),this.row&&(t&&(a.fields[t]=this.row.f_fields[t]),n&&(a.fields[n]=this.row.f_fields[n])),this.sourceData=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container}),console.log("this.sourceData",this.sourceData),this.sourceData},formateData(e){console.log("source_data",e);let t=[],n={},a=[];this.fieldConf.test?_.each(this.fieldConf.status_range_enum,(e=>{n[e.id]=e,a.push(e)})):_.each(this.sourceData[1],(e=>{n[e.id]=e,a.push(e)})),console.log("statusMap",n);let i=(e,t,r)=>{let o=[];return _.each(e,(s=>{if(this.areaMap[s.id]=s,s.path_ids.length==t&&(0==r||_.last(s.path_ids)==r)){let r={title:s.name,key:s.id+"",path_names:s.path_names,state:!1,status:s.status};if(s.is_parent&&(r.childrens=i(e,t+1,s.id),r.childrens&&r.childrens.length>0)){let e=0,t=0,i=0;_.each(r.childrens,(n=>{n.status?(console.log("child",n),n.status==a[1].id?t+=1:n.status==a[2].id?i++:e++):e++})),console.log("_complete_count",i),console.log("_doing_count",t),console.log("_begin_count",e),i==r.childrens.length?s.status=a[2].id:e==r.childrens.length?s.status?_.each(r.childrens,(e=>{e.status=s.status,e.color=n[s.status].color})):s.status=a[0].id:(s.status=a[1].id,s.color=n[s.status].color)}s.status?n[s.status]&&(r.color=n[s.status].color):(r.status=a[0].id,r.color=n[r.status].color),o.push(r)}})),_.orderBy(o,["order"],["asc"]),1==t&&(o=_.reverse(o)),o};t=i(e,0,0),console.log("_treeData",t),this.allTreeData=t},async openSelectSectionDlg(){console.log("row",this.row),console.log("fieldConf",this.fieldConf),console.log("container",this.container),this.fieldConf.test||(this.loading=!0,await this.loadList(),this.loading=!1,this.formateData(this.sourceData[0]),this.getColorConfig(this.sourceData[1])),this.dlg.show=!0},colseSelectSectionDlg(e){console.log("confirm_Data",e),this.dlg.show=!1,e&&(this.curVal=e,this.$emit("input",e))},getColorConfig(e){let t={data:[]};e&&e.length>0&&(_.each(e,(e=>{let n={name:e.id,title:e.name,color:e.color||"#ffffff",border_color:e.color||"#D8DADD",width:"100px"};"#ffffff"!=n.color&&"#FFFFFF"!=n.color||(n.border_color="#D8DADD"),t.data.push(n)})),this.colorConfig=t)}}},j=(n(8173),(0,x.A)(C,a,[],!1,null,null,null));j.options.__file="components/lib/bpmAreaElevation/src/main.vue";var $=j.exports;$.install=function(e){e.component($.name,$)};var P=$},4789:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return B}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-audit",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType,container:e.container},on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"audit-editor"},[n("div",[n("div",{on:{click:function(t){e.opened=!0}}},[n("span",{staticClass:"aduit-result-title",style:{background:e.resultColor||"none",color:e.resultColor?"#fff":"#333",cursor:"pointer"}},[e._v(e._s(e.getViewFont)+" "),n("i",{staticClass:"el-icon-arrow-right",staticStyle:{"font-size":"14px"}})])])]),e._v(" "),n("el-dialog",{staticClass:"audit-modal",attrs:{visible:e.opened,modal:!1,"append-to-body":!0,title:e.fieldConf.name},on:{"update:visible":function(t){e.opened=t},close:e.onHide,open:e.onOpen}},[n("div",[n("el-form",{ref:"form",staticClass:"audit-modal-content",attrs:{model:e.curVal,"label-width":"120px"}},[n("el-form-item",{attrs:{label:e.$z("审批结果:","b2.common.approval_results")}},[n("span",{staticClass:"aduit-result-title",style:{background:e.resultColor,color:e.resultColor?"#fff":"#333"}},[e._v(e._s(e.getViewFont))])]),e._v(" "),e.curVal&&e.curVal.reject_target?n("el-form-item",{attrs:{label:e.$z("回退节点:","b2.common.fallback_node")}},[e._v("\n "+e._s(e.curVal.reject_target.name||e.$z("上一个节点","b2.common.previous_node"))+"\n ")]):e._e(),e._v(" "),e.showSignature?n("el-form-item",{attrs:{label:e.$z("签名:","b2.common.sign"),required:e.isSignatureMust}},[n("bpm-mul-image",{attrs:{fieldConf:{type:"Signature"},mode:"edit"},model:{value:e.curVal.signature,callback:function(t){e.$set(e.curVal,"signature",t)},expression:"curVal.signature"}})],1):e._e(),e._v(" "),e.showJudgment?n("el-form-item",{attrs:{label:e.$z("填写意见:","b2.common.fill_comment"),required:e.isJudgmentMust}},[n("el-input",{attrs:{type:"textarea",placeholder:e.$z("请输入评审意见","b2.common.en_comment")},model:{value:e.curVal.judgment,callback:function(t){e.$set(e.curVal,"judgment",t)},expression:"curVal.judgment"}})],1):e._e(),e._v(" "),e.showPhoto?n("el-form-item",{attrs:{label:e.$z("拍照:","b2.common.photograph"),required:e.isPhotoMust}},[n("bpm-mul-image",{attrs:{fieldConf:{type:"MulImage"},mode:"edit"},model:{value:e.curVal.photos,callback:function(t){e.$set(e.curVal,"photos",t)},expression:"curVal.photos"}})],1):e._e(),e._v(" "),n("el-form-item",{attrs:{label:e.$z("审批日期:","b2.common.audit_date")}},[n("el-date-picker",{ref:"dateSelect",attrs:{type:"datetime",placeholder:e.$z("选择日期时间","c.select_date_time"),format:e.auditFormat},model:{value:e.curVal.audit_at,callback:function(t){e.$set(e.curVal,"audit_at",t)},expression:"curVal.audit_at"}})],1),e._v(" "),e.curVal.auditor_name?n("el-form-item",{attrs:{label:e.$z("审批人","b2.common.approver")}},[n("el-input-number",{attrs:{min:1,step:1,controls:!1,"controls-position":"both",placeholder:e.$z("审批人","b2.common.approver")+" ID"},model:{value:e.curVal.auditor,callback:function(t){e.$set(e.curVal,"auditor",t)},expression:"curVal.auditor"}}),e._v(" "),n("el-input",{staticStyle:{"margin-top":"10px"},attrs:{placeholder:e.$z("审批人","b2.common.approver")+" "+e.$z("用户名","c.user_name")},model:{value:e.curVal.auditor_name,callback:function(t){e.$set(e.curVal,"auditor_name",t)},expression:"curVal.auditor_name"}})],1):e._e()],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.opened=!1}}},[e._v(e._s(e.$z("取消","c.cancel")))]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1)])],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642),c=n(2554);l().use(d.Dialog),l().use(d.DatePicker),l().use(c.default);var u={data(){return{curVal:{result:1,judgment:"",photos:[],reject_target:"",signature:"",auditor_name:"",audit_at:"",auditor:""},isOpenAudit:!1,opened:!1,dispMode:"nolink",auditFormat:"yyyy-MM-dd HH:mm:ss",userList:[]}},props:["type","value","fieldConf","row","dm","container"],computed:{useDetail(){return!!o().get(this.fieldConf,"detail_allow",null)&&!!o().get(this.fieldConf,"detail_deny",null)},resultColor(){let e=o().get(this.curVal,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=o().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},getViewFont(){let e=o().get(this.value,"result",-1),t=1==e?"通过":-1==e?"未审批":"不通过";return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.text","通过"):-1==e?"未审批":o().get(this.fieldConf,"detail_deny.text","不通过")),t},judgment(){let e=o().get(this.value,"result",-1),t=o().get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.judgment"):o().get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.judgment||"must"==this.judgment},denyColor(){let e=o().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},signature(){let e=o().get(this.value,"result",-1),t=o().get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.signature"):o().get(this.fieldConf,"detail_deny.signature")),t},showSignature(){return"yes"==this.signature||"must"==this.signature},photo(){let e=o().get(this.value,"result",-1),t=o().get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.photo"):o().get(this.fieldConf,"detail_deny.photo")),t},showPhoto(){return"yes"==this.photo||"must"==this.photo},isJudgmentMust(){return"must"==this.judgment},isSignatureMust(){return"must"==this.signature},isPhotoMust(){return"must"==this.photo},isRequired(){return o().get(this.fieldConf,"check.required")},getCanvasBoxStyle(){return{height:"150px",width:"100%"}}},created(){this.loadProjBaseInfo()},mounted(){if(this.value){let e=o().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=o().merge(this.curVal,e)}this.useDetail&&(this.selectOptions=[{label:o().get(this.fieldConf,"detail_allow.text","通过"),value:1},{label:o().get(this.fieldConf,"detail_deny.text","不通过"),value:2}])},methods:{onHide(){this.opened=!1,this.showForm=!1},onOpen(){if(this.value){let e=o().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=o().merge(this.curVal,e)}},async onSubmit(){let e=this.curVal;if(this.isRequired&&!e.result)return void this.$q.notify({message:"请选择审批结果",position:"top",type:"warning"});if(this.isSignatureMust&&!e.signature)return void this.$q.notify({message:"请完成签名",position:"top",type:"warning"});if(this.isJudgmentMust&&!e.judgment)return void this.$q.notify({message:"请填写意见",position:"top",type:"warning"});if(this.isPhotoMust&&o().isEmpty(e.photos))return void this.$q.notify({message:"请至少上传一张图片",position:"top",type:"warning"});let t={result:e.result,signature:e.signature,judgment:e.judgment,photos:e.photos,audit_at:e.audit_at/1e3,auditor:e.auditor,auditor_name:e.auditor_name};this.$emit("change",t),this.$emit("input",t),this.opened=!1},getRejectTarget(e){return"last_id"==e?{type:"RejectToLastUserNode"}:e},async loadProjBaseInfo(){let e=1==(await this.$bpm.getBaseSetting("open_audit")).value;this.isOpenAudit=e;let t=await this.$bpm.getBaseSetting("audit_dt_fmt");this.auditFormat=t.value||this.auditFormat}}},m=n(4486),f=(0,m.A)(u,i,[],!1,null,null,null);f.options.__file="components/lib/bpmAudit/src/part/editor.vue";var h=f.exports,p=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"audit-reader"},[n("div",[n("div",[e.useDialog?n("div",{on:{click:function(t){e.opened=!0}}},[n("span",{staticClass:"aduit-result-title",style:{background:e.resultColor,color:e.resultColor?"#fff":"#333",cursor:"pointer"}},[e._v(e._s(e.getViewFont)+" "),n("i",{staticClass:"el-icon-arrow-right",staticStyle:{"font-size":"14px"}})])]):n("div",[n("AuditReaderDetail",{attrs:{value:e.value,"field-conf":e.fieldConf,"result-color":e.resultColor,"get-view-font":e.getViewFont,"show-judgment":e.showJudgment,"show-signature":e.showSignature,"show-photo":e.showPhoto}})],1)])]),e._v(" "),e.showSignature||e.showJudgment||e.showPhoto?n("el-dialog",{staticClass:"audit-modal read-audit",attrs:{visible:e.opened,modal:!1,width:"40%",ok:!1,title:e.fieldConf.name},on:{"update:visible":function(t){e.opened=t},close:e.onHide}},[n("div",[n("AuditReaderDetail",{attrs:{value:e.value,"field-conf":e.fieldConf,"result-color":e.resultColor,"get-view-font":e.getViewFont,"show-judgment":e.showJudgment,"show-signature":e.showSignature,"show-photo":e.showPhoto}})],1)]):e._e()],1)};p._withStripped=!0;var g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.value?n("el-form",{staticClass:"audit-modal-content",attrs:{"label-width":"150px"}},[n("el-form-item",{attrs:{label:e.$z("审批结果","b2.common.approval_results"),required:!0}},[n("span",{staticClass:"aduit-result-title",style:{background:e.resultColor,color:e.resultColor?"#fff":"#333"}},[e._v(e._s(e.getViewFont))])]),e._v(" "),e.value&&e.value.reject_target?n("el-form-item",{attrs:{label:e.$z("回退节点","b2.common.fallback_node"),required:!0}},[e._v("\n "+e._s(e.value.reject_target.name||e.$z("上一个节点","b2.common.previous_node"))+"\n ")]):e._e(),e._v(" "),e.showJudgment?n("el-form-item",{attrs:{label:e.$z("审批意见","b2.common.approval_comment"),required:e.isJudgmentMust}},[n("span",{attrs:{title:e.value&&e.value.judgment}},[e._v("\n "+e._s(e.value&&e.value.judgment?e.value.judgment:e.$z("无","c.none")))])]):e._e(),e._v(" "),e.showPhoto&&e.value.photos&&e.value.photos.length?n("el-form-item",{attrs:{label:e.$z("拍照","b2.common.photograph"),required:e.isPhotoMust}},[n("bpm-mul-image",{attrs:{value:e.value.photos,fieldConf:{type:"MulImage"}}})],1):e._e(),e._v(" "),e.showSignature&&e.value.signature?n("el-form-item",{attrs:{label:e.$z("签名","b2.common.sign"),required:e.isSignatureMust}},[n("bpm-mul-image",{attrs:{value:e.value.signature,fieldConf:{type:"Signature"}}})],1):e._e(),e._v(" "),n("el-form-item",{attrs:{label:e.$z("审批人","b2.common.approver")}},[e._v(e._s(e.auditorName))]),e._v(" "),n("el-form-item",{attrs:{label:e.$z("审批时间","b2.common.processing_time")}},[e._v(e._s(e.auditAt))])],1):e._e()],1)};g._withStripped=!0;var y=n(4709),b=n.n(y),v={name:"AuditReaderDetail",props:["value","fieldConf","resultColor","getViewFont","showJudgment","showSignature","showPhoto"],data(){return{}},computed:{isJudgmentMust(){return"must"==_.get(this.fieldConf,"judgment")},isSignatureMust(){return"must"==_.get(this.fieldConf,"signature")},isPhotoMust(){return"must"==_.get(this.fieldConf,"photo")},auditAt(){let e=_.get(this.value,"audit_at");if(e)return e*=1e3,b().format(e,"YYYY-MM-DD HH:mm:ss")},auditorName(){return _.get(this.value,"auditor_name")}}},w=(0,m.A)(v,g,[],!1,null,null,null);w.options.__file="components/lib/bpmAudit/src/part/reader-detail.vue";var M=w.exports;l().use(d.Dialog),l().use(c.default);var L={components:{AuditReaderDetail:M},props:["value","fieldConf","row","uiType"],data(){return{opened:!1}},computed:{useDetail(){return!!o().get(this.fieldConf,"detail_allow",null)&&!!o().get(this.fieldConf,"detail_deny",null)},resultColor(){let e=o().get(this.value,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=o().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},denyColor(){let e=o().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},getViewFont(){let e=o().get(this.value,"result",-1),t=1==e?"通过":-1==e?"未审批":"不通过";return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.text","通过"):-1==e?"未审批":o().get(this.fieldConf,"detail_deny.text","不通过")),t},hasAudited(){return-1!=o().get(this.value,"result",-1)},showJudgment(){let e=o().get(this.fieldConf,"judgment");return"yes"==e||"must"==e},showSignature(){let e=o().get(this.fieldConf,"signature");return"yes"==e||"must"==e},showPhoto(){let e=o().get(this.fieldConf,"photo");return"yes"==e||"must"==e},isRequired(){return o().get(this.fieldConf,"check.required")},modalShow(){return(this.showSignature||this.showJudgment||this.showPhoto)&&this.hasAudited},useDialog(){return"table"===this.uiType}},mounted(){},methods:{onHide(){this.opened=!1}}},k=(0,m.A)(L,p,[],!1,null,null,null);k.options.__file="components/lib/bpmAudit/src/part/reader.vue";var S=k.exports,D=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.componentName,{tag:"component",attrs:{field:e.fieldConf,fieldConf:e.fieldConf,row:e.row,container:e.container},on:{change:e.changeVal},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})};D._withStripped=!0;var x=function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"audit-with-others"})};x._withStripped=!0;var Y={props:["value","fieldConf","row","container","dispMode"],components:{},data(){return{opened:!1,degree:0,selectOptions:[{label:zj.z("通过","b2.common.pass"),value:1},{label:zj.z("不通过","b2.common.fail"),value:2}],canvasBox:null,form:{result:1,judgment:"",photos:[],reject_target:""},hasDraw:!1,openLastSign:!1,lastSign:"",useNextUser:!1}},computed:{useDetail(){return!!_.get(this.fieldConf,"detail_allow",null)&&!!_.get(this.fieldConf,"detail_deny",null)},jucdgment(){let e=this.form.result,t=_.get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?_.get(this.fieldConf,"detail_allow.judgment"):_.get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.jucdgment||"must"==this.jucdgment},resultColor(){let e=_.get(this.value,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=_.get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},denyColor(){let e=_.get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},signature(){let e=this.form.result,t=_.get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?_.get(this.fieldConf,"detail_allow.signature"):_.get(this.fieldConf,"detail_deny.signature")),t},showSignature(){return"yes"==this.signature||"must"==this.signature},photo(){let e=this.form.result,t=_.get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?_.get(this.fieldConf,"detail_allow.photo"):_.get(this.fieldConf,"detail_deny.photo")),t},showPhoto(){return"yes"==this.photo||"must"==this.photo},isJudgmentMust(){return"must"==this.judgment},isSignatureMust(){return"must"==this.signature},isPhotoMust(){return"must"==this.photo},isRequired(){return _.get(this.fieldConf,"check.required")},getViewFont(){let e=_.get(this.value,"result",-1),t=1==e?zj.z("通过","b2.common.pass"):-1==e?"":zj.z("不通过","b2.common.fail");return this.useDetail&&(t=1==e?_.get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")):-1==e?"":_.get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail"))),t},getCanvasBoxStyle(){return{height:"150px",width:"100%"}},componentName(){return"MulImagePc"},userId(){return _.get(this.$bpm.userInfo,"user_id",0)},userName(){return _.get(this.$bpm.userInfo,"user_name","")},rejectTargetMap(){let e=_.get(this.container,"formSchema.reject_targets");return _.keyBy(e,"node")},rejectTargetList(){let e=_.get(this.container,"formSchema.reject_targets"),t=_.get(this.container,"_formData.passed_nodes"),n=[];return _.each(e,(e=>{_.includes(t,e.node)&&e.only_passed?n.push({label:e.name,value:e.node}):n.push({label:e.name||zj.z("上一个节点","b2.common.previous_node"),value:e.node||"last_id"})})),n}},mounted(){this.container.$on("afterFormSubmit",(e=>{!e&&this.openLastSign&&this.value.signature&&this.$bpm.postEleSign(this.value.signature,this.useNextUser)})),this.useDetail&&(this.selectOptions=[{label:_.get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")),value:1},{label:_.get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail")),value:2}])},methods:{onHide(){this.opened=!1},onOpen(){this.draw||(this.value&&(this.form=this.value),setTimeout((()=>{this.useNextUser=!1,this.handleInit()}),200))},handleInit(){if(!this.showSignature)return;let e=this.$bpm.userSign;this.openLastSign=e.open,this.openLastSign&&!this.form.signature&&e.for_next_use&&(this.form.signature=e.signature),e.for_next_use&&(this.lastSign=e.signature),e.for_next_use&&this.openLastSign&&(this.useNextUser=!0)},onDataLoaded(e){this.resetForm();let t={result:1,judgment:"",photos:[],reject_target:""};this.$emit("input",t),this.$emit("change",t),this.hasDraw=!1,this.draw&&this.draw.clear()},clearSignature(){this.hasDraw=!1,this.draw&&this.draw.clear(),this.lastSign=""},resetForm(){this.form={result:1,judgment:"",photos:[]}},async loadUserInfo(){this.$bpm.networking=!0;let e=await this.$bpm.requestAppendOrgParams({url:"/uc/common/user_info/",params:zj.utils.pageParam()});e=_.get(e,"data.data"),this.$bpm.networking=!1,console.log("info",e.user_info),this.$bpm.setUserInfo(e.user_info)},async onSubmit(){let e=this.form;if(!(zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId))return this.loadUserInfo(),void this.$message({message:zj.z("当前网络加载有问题,请重新进入","b2.common.network_err"),type:"warning"});if(2!=e.result||!this.showReject||e.reject_target)if(!this.isRequired||this.form.result)if(!this.isSignatureMust||this.form.signature||this.hasDraw)if(!this.isJudgmentMust||this.form.judgment||this.hasDraw)if(this.isPhotoMust&&_.isEmpty(this.form.photos))this.$message({message:zj.z("请至少上传一张图片","b2.common.least_one_image"),type:"warning"});else if(this.hasDraw){let t=this.draw.getPNGImage();this.uploadImage({basestr:t,type:"png",name:"签名图片.png",model:"userfile"},(t=>{let n={result:e.result,signature:t,judgment:e.judgment,photos:e.photos,audit_at:(new Date).getTime()/1e3,auditor:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId,auditor_name:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_name||this.userName};2==e.result&&this.showReject&&_.set(n,"reject_target",this.getRejectTarget(e.reject_target)),this.field.value=n,this.opened=!1}))}else{let t={result:e.result,signature:e.signature,judgment:e.judgment,photos:e.photos,audit_at:(new Date).getTime()/1e3,auditor:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId,auditor_name:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_name||this.userName};2==e.result&&this.showReject&&_.set(t,"reject_target",this.getRejectTarget(e.reject_target)),this.field.value=t,this.opened=!1}else this.$message({message:zj.z("请填写意见","b2.common.please_fill_comment"),type:"warning"});else this.$message({message:zj.z("请完成签名","b2.common.please_complete_sign"),type:"warning"});else this.$message({message:zj.z("请选择审批结果","b2.common.please_select_audit"),type:"warning"});else this.$message({message:zj.z("回退节点必填","b2.common.back_to_required"),type:"warning"})},getRejectTarget(e){let t=this.rejectTargetMap;return"last_id"==e?{type:"RejectToLastUserNode"}:_.get(t,e)},uploadImage({basestr:e,type:t,name:n,model:a},i){let r=window.atob(e.split(",")[1]),o=new ArrayBuffer(r.length),s=new Uint8Array(o);for(let e=0;e<r.length;e++)s[e]=r.charCodeAt(e);let l,d=window.WebKitBlobBuilder||window.MozBlobBuilder;if(d){let e=new d;e.append(o),l=e.getBlob(t)}else l=new window.Blob([o],{type:t});let c=new FormData;c.append(a,l,n),zj.net.w.noapi({method:"POST",url:"/platform/v1/papi/app_file/upload/",data:c,processData:!1,contentType:!1}).then((e=>{i&&i(e.file_md5)}))},handleSpeechToText(e){this.$refs.input.blur(),e.cancelBubble=!0,e.stopPropagation(),this.$bpm.getSpeechToText((e=>{e.text&&this.$set(this.form,"judgment",(this.form.judgment||"")+e.text)}))}}},T=(n(2487),n(8601),n(968),(0,m.A)(Y,x,[],!1,null,"1f4bc398",null));T.options.__file="components/lib/bpmAudit/src/part/auditor/audit-with-others.vue";var C=T.exports,j=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-select",{attrs:{placeholder:e.$z("请选择回退节点","b2.common.select_back_to")},model:{value:e.form.result,callback:function(t){e.$set(e.form,"result",t)},expression:"form.result"}},e._l(e.selectOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)};j._withStripped=!0;var $={props:["value","fieldConf","row","container"],data(){return{selectOptions:[{label:zj.z("通过","b2.common.pass"),value:1},{label:zj.z("不通过","b2.common.fail"),value:2}],form:{result:"",reject_target:""}}},computed:{userId(){return _.get(this.$bpm.userInfo,"user_id",0)},userName(){return _.get(this.$bpm.userInfo,"user_name","")},rejectTargetMap(){let e=_.get(this.field,"topContainer.formSchema.reject_targets");return _.keyBy(e,"node")},rejectTargetList(){let e=_.get(this.field,"topContainer.formSchema.reject_targets"),t=_.get(this.field,"topContainer._formData.passed_nodes"),n=[];return _.each(e,(e=>{_.includes(t,e.node)&&e.only_passed?n.push({label:e.name,value:e.node}):n.push({label:e.name||zj.z("上一个节点","b2.common.previous_node"),value:e.node||"last_id"})})),n}},watch:{form:{handler(e){if(!(zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId))return this.loadUserInfo(),void this.$message({message:zj.z("当前网络加载有问题,请重新进入","b2.common.network_err"),type:"warning"});if(2==e.result&&this.showReject&&!e.reject_target)return void this.$message({message:zj.z("回退节点必填","b2.common.back_to_required"),type:"warning"});let t={result:e,signature:"",audit_at:(new Date).getTime()/1e3,auditor:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId,auditor_name:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_name||this.userName};2==e.result&&this.showReject&&_.set(t,"reject_target",this.getRejectTarget(e.reject_target)),this.$emit("change",t),this.$emit("input",t)},deep:!0}},methods:{onDataLoaded(e){this.form.result=_.get(this.field.value,"result","")},getRejectTarget(e){let t=this.rejectTargetMap;return"last_id"==e?{type:"RejectToLastUserNode"}:_.get(t,e)}}},P=(n(744),(0,m.A)($,j,[],!1,null,"2709dffc",null));P.options.__file="components/lib/bpmAudit/src/part/auditor/audit-select.vue";var I=P.exports,F=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"audit-new"},[n("div",{staticClass:"submit-btns-container"},[n("el-button",{attrs:{disabled:e.submiting},on:{click:function(t){return e.doOperation(2)}}},[e._v(e._s(e.selectOptions[1].label))]),e._v(" "),n("el-button",{attrs:{type:"primary",disabled:e.submiting},on:{click:function(t){return e.doOperation(1)}}},[e._v(e._s(e.selectOptions[0].label))])],1),e._v(" "),n("el-dialog",{staticClass:"audit-modal",attrs:{visible:e.openAuditDlg,modal:!1,center:"",width:"60%",title:e.getViewFont},on:{"update:visible":function(t){e.openAuditDlg=t},close:e.onHide,open:e.onOpen}},[n("div",[n("el-form",{ref:"form",staticClass:"audit-modal-content",attrs:{model:e.form,"label-width":"150px"}},[2==e.form.result&&e.showReject?n("el-form-item",{attrs:{label:e.$z("回退节点","b2.common.fallback_node"),required:!0,prop:"reject_target"}},[n("el-select",{attrs:{placeholder:""},model:{value:e.form.reject_target,callback:function(t){e.$set(e.form,"reject_target",t)},expression:"form.reject_target"}},e._l(e.rejectTargetList,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),e._v(" "),e._l(e.optAss,(function(t){return n(t.component,{key:t.id,tag:"component",attrs:{conf:t,container:e.container}})})),e._v(" "),n("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.showSignature,expression:"showSignature"}],attrs:{required:e.isSignatureMust,label:e.$z("签名","b2.common.sign"),prop:"signature"}},[n("bpm-signature",{ref:"signature",attrs:{container:e.container},model:{value:e.form.signature,callback:function(t){e.$set(e.form,"signature",t)},expression:"form.signature"}})],1),e._v(" "),e.showJudgment?n("el-form-item",{attrs:{required:e.isJudgmentMust,label:e.$z("填写意见","b2.common.fill_comment"),prop:"judgment"}},[n("el-input",{attrs:{type:"textarea",placeholder:e.$z("请输入评审意见","b2.common.en_comment"),clearable:!!e.form.judgment},model:{value:e.form.judgment,callback:function(t){e.$set(e.form,"judgment",t)},expression:"form.judgment"}})],1):e._e(),e._v(" "),e.showPhoto?n("el-form-item",{attrs:{label:e.$z("拍照","b2.common.photograph"),required:e.isPhotoMust,prop:"photos"}},[n("bpm-mul-image",{attrs:{fieldConf:{type:"MulImage"},mode:"edit"},model:{value:e.form.photos,callback:function(t){e.$set(e.form,"photos",t)},expression:"form.photos"}})],1):e._e(),e._v(" "),e.isOpenAudit?n("el-form-item",{attrs:{required:"",label:e.$z("审批日期","b2.common.audit_date"),prop:"auditTime"}},[n("el-date-picker",{ref:"dateSelect",attrs:{type:"datetime",placeholder:e.$z("选择日期时间","c.select_date_time"),format:e.auditTimeFormat},model:{value:e.form.auditTime,callback:function(t){e.$set(e.form,"auditTime",t)},expression:"form.auditTime"}})],1):e._e()],2)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{disabled:!e.isSimulation&&e.submiting},on:{click:e.onCancel}},[e._v(e._s(e.$z("取消","c.cancel")))]),e._v(" "),n("el-button",{attrs:{type:"primary",disabled:!e.hasDraw},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1)])],1)};F._withStripped=!0;var E=n(1824);l().use(d.Dialog),l().use(d.DatePicker),l().use(c.default),l().use(E.default);var O={data(){return{curVal:{result:1,judgment:"",photos:[],reject_target:"",signature:"",auditor_name:"",audit_at:"",auditor:""},openAuditDlg:!1,result:1,form:{result:1,judgment:"",photos:[],signature:"",auditTime:(new Date).getTime()},passForm:{result:1,judgment:"",signature:"",photos:[],auditTime:(new Date).getTime()},notPassForm:{result:2,judgment:"",photos:[],signature:"",reject_target:"",auditTime:(new Date).getTime()},canvasBox:null,degree:0,submiting:!1,openLastSign:!1,lastSign:"",useNextUser:!1,selectOptions:[{label:zj.z("通过","b2.common.pass"),value:1},{label:zj.z("不通过","b2.common.fail"),value:2}],optAss:[],isOpenAudit:!1,auditTimeFormat:"yyyy-MM-dd HH:mm:ss"}},props:["value","fieldConf","row","container"],computed:{useDetail(){return!!o().get(this.fieldConf,"detail_allow",null)&&!!o().get(this.fieldConf,"detail_deny",null)},judgment(){let e=this.result,t=o().get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.judgment"):o().get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.judgment||"must"==this.judgment},signature(){let e=this.result,t=o().get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.signature"):o().get(this.fieldConf,"detail_deny.signature")),t},allowColor(){let e=o().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?"primary":e},denyColor(){let e=o().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?"primary":e},showSignature(){return"yes"==this.signature||"must"==this.signature},photo(){let e=this.result,t=o().get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.photo"):o().get(this.fieldConf,"detail_deny.photo")),t},showPhoto(){return"yes"==this.photo||"must"==this.photo},isJudgmentMust(){return"must"==this.judgment},isSignatureMust(){return"must"==this.signature},isPhotoMust(){return"must"==this.photo},showOpDialog(){return this.showSignature||this.showJudgment||this.showPhoto||2===this.result&&this.showReject||this.optAss.length},getCanvasBoxStyle(){return{height:"150px",width:"100%"}},componentName(){return"MulImage"},isMobile(){return this.$q.platform.is.mobile},getViewFont(){let e=this.result,t=1==e?zj.z("通过","b2.common.pass"):-1==e?"":zj.z("不通过","b2.common.fail");return this.useDetail&&(t=1==e?o().get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")):-1==e?"":o().get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail"))),t},userId(){return o().get(this.$bpm.userInfo,"user_id",0)},userName(){return o().get(this.$bpm.userInfo,"user_name","")},showReject(){return!!o().get(this.container,"formSchema.reject_targets")},rejectTargetMap(){let e=o().get(this.container,"formSchema.reject_targets");return o().keyBy(e,"node")},rejectTargetList(){console.log("this.container",this.container);let e=o().get(this.container,"formSchema.reject_targets"),t=o().get(this.container,"_formData.passed_nodes"),n=[];return o().each(e,(e=>{o().includes(t,e.node)&&e.only_passed?n.push({label:e.name,value:e.node}):e.only_passed||n.push({label:e.name||zj.z("上一个节点","b2.common.previous_node"),value:e.node||"last_id"})})),n},isSimulation(){return this.$bpm.isSimulation},hasDraw(){return!this.isSignatureMust||!!this.form.signature}},created(){this.loadProjBaseInfo()},mounted(){if(this.value){let e=o().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=o().merge(this.curVal,e)}this.useDetail&&(this.selectOptions=[{label:o().get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")),value:1},{label:o().get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail")),value:2}])},methods:{onHide(){this.openAuditDlg=!1},onOpen(){if(1==this.result)this.form=o().cloneDeep(this.passForm),this.form.result=1;else if(this.form=o().cloneDeep(this.notPassForm),this.form.result=2,1==this.rejectTargetList.length){let e=o().get(this.rejectTargetList,"0.value");this.form.reject_target=e}else this.form.reject_target="";console.log("this.result",this.result),this.form.auditTime=(new Date).getTime()},async onSubmit(){let e=this.form;console.log("curVal",e),!this.isRequired||e.result?!this.isSignatureMust||e.signature?!this.isJudgmentMust||e.judgment?this.isPhotoMust&&o().isEmpty(e.photos)?this.$message({message:zj.z("请至少上传一张图片","b2.common.least_one_image"),type:"warning"}):(this._dealSubmit(e),this.openAuditDlg=!1):this.$message({message:zj.z("请填写意见","b2.common.please_fill_comment"),type:"warning"}):this.$message({message:zj.z("请完成签名","b2.common.please_complete_sign"),type:"warning"}):this.$message({message:zj.z("请选择审批结果","b2.common.please_select_audit"),type:"warning"})},_dealSubmit(e){let t={result:e.result,signature:e.signature,judgment:e.judgment,photos:e.photos,audit_at:e.auditTime/1e3,auditor:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_id||this.userId,auditor_name:zj.app.accessInfo&&zj.app.accessInfo.user_info.user_name||this.userName};2==e.result&&this.showReject&&o().set(t,"reject_target",this.getRejectTarget(e.reject_target)),this.curVal=t,console.log("audit_value",t),this.$emit("change",this.curVal),console.log("this.container",this.container);let n=this.container.$parent;if(console.log("audit_modal",n),n){this.submiting=!0;try{2==this.result?n.doOperation(null,{needValidation:!1}):n.doOperation()}catch(e){console.log("error",e),this.submiting=!1}this.$bpm.$on("afterFormSubmit",(({mode:e,errors:t})=>{t||(console.log("BpmAudit New $bpm afterFormSubmit"),this.openAuditDlg=!1),this.submiting=!1}))}},getRejectTarget(e){let t=this.rejectTargetMap;return"last_id"==e?{type:"RejectToLastUserNode"}:o().get(t,e)},onCancel(){this.openAuditDlg=!1},async loadProjBaseInfo(){let e=1==(await this.$bpm.getBaseSetting("open_audit")).value;this.isOpenAudit=e;let t=await this.$bpm.getBaseSetting("audit_dt_fmt");this.auditFormat=t.value||this.auditFormat},async loadUserInfo(){let e=await this.$bpm.requestAppendOrgParams({url:"/uc/common/user_info/",params:zj.utils.pageParam()});e=o().get(e,"data.data"),this.$bpm.setUserInfo(e.user_info)},async doOperation(e){console.log("this.fieldConf",this.fieldConf),this.result=e,setTimeout((()=>{let t=o().get(this.fieldConf,`opt_ass.${e}`),n=o().map(t,(e=>o().get(this.container,`eleMap.${e}`)));n=o().compact(n),this.optAss=n;let a=o().concat(t,this.fieldConf.id);a=o().compact(a),console.log("excludeElemIds",a),this.container.verfifyData(a,(()=>{this.$nextTick((()=>{this.showOpDialog?this.openDialog():this.confirmOp()}))}))}),100)},openDialog(){this.openAuditDlg=!0,this.useNextUser=!1,setTimeout((()=>{this.$refs.signature&&(this.$refs.signature.initCanvas(),this.$refs.signature.handleInit())}),200)},confirmOp(){let e=1==this.result?this.selectOptions[0].label:this.selectOptions[1].label,t=zj.z("是否确认","b2.common.is_confirm")+e+zj.z("?","c.question_mark");this.form.auditTime=(new Date).getTime(),this.$confirm(t,e,{confirmButtonText:zj.z("确定","c.confirm"),cancelButtonText:zj.z("取消","c.cancel"),type:"warning"}).then((()=>{this._dealSubmit(this.form)})).catch((()=>{}))}}},A=(0,m.A)(O,F,[],!1,null,null,null);A.options.__file="components/lib/bpmAudit/src/part/auditor/audit-new.vue";var H={props:["value","fieldConf","row","container"],components:{AuditWithOthers:C,AuditSelect:I,AduitNew:A.exports},data(){return{curVal:{result:1,judgment:"",photos:[],reject_target:"",signature:"",auditor_name:"",audit_at:"",auditor:""}}},computed:{componentName(){let e=_.get(this.fieldConf,"signature"),t=_.get(this.fieldConf,"jucdgment"),n=_.get(this.fieldConf,"photo");return"collaboration"==_.get(this.container,"formSchema.audit_style")?"AduitNew":"yes"==e||"must"==e||"yes"==t||"must"==t||"yes"==n||"must"==n?"AuditWithOthers":"AuditSelect"}},mounted(){if(console.log("Auditor_container",this.container),this.value){let e=_.cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=_.merge(this.curVal,e)}},methods:{changeVal(e){this.$emit("input",e),this.$emit("change",e)}}},N=(0,m.A)(H,D,[],!1,null,null,null);N.options.__file="components/lib/bpmAudit/src/part/auditor.vue";var R=N.exports,z={name:"BpmAudit",components:{editorComponent:h,readerComponent:S,auditorComponent:R},props:{value:{type:[Object]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},container:{type:[Object,null],default(){return null}},dm:Boolean},computed:{curComponent(){return"view"==this.mode?S:this.dm?h:R}},data(){return{curVal:{}}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{onChange(e){console.log("onChange",_.cloneDeep(e)),this.$emit("input",e),this.$emit("change",e)}}},V=(n(1962),(0,m.A)(z,a,[],!1,null,null,null));V.options.__file="components/lib/bpmAudit/src/main.vue";var W=V.exports;W.install=function(e){e.component(W.name,W)};var B=W},1933:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,container:e.container,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-date-time-edit"},[n("el-date-picker",{attrs:{placeholder:e.placeholder,format:e.format,"picker-options":e.pickerOptions,"value-format":e.checkFormat,type:e.type,"default-value":e.defaultVal,clearable:e.clearable,disabled:e.disabled},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642);l().use(d.DatePicker);var c={data(){return{curVal:""}},props:["value","fieldConf","row","clearable","disabled","container"],watch:{value(){this.curVal=this.value}},computed:{type(){let e=o().toLower(o().get(this.fieldConf,"type"));return this.isMonth?"month":e},isMonth(){return"C1M"==o().get(this.fieldConf,"range_type")},placeholder(){return this.fieldConf.desc||this.fieldConf.name},format(){let e=o().get(this.fieldConf,"view.format");return e&&(e=e.replaceAll("Y","y"),e=e.replaceAll("D","d")),e},max(){let e=this.analyzeLimit("tmax");return console.log("max_date",e),e},min(){let e=this.analyzeLimit("tmin");return console.log("min_date",e),e},limit(){return o().get(this.fieldConf,"check.limit","")},pickerOptions(){let e=this;return{disabledDate(t){let n=!1,a=t.getDay(),i=t.getDate();if(e.max&&(n=t.getTime()>e.max.getTime()),!n&&e.min&&(n=t.getTime()<e.min.getTime()),!n&&e.limit){let t=e.limit.split(","),r=[],o=[],s=!1;t.forEach((e=>{let t=e.split("|");"W"===t[0]&&r.push(parseInt(t[1])),"M"===t[0]&&o.push(parseInt(t[1]))})),(r.length||o.length)&&(s=r.includes(a)||o.includes(i),n=!s)}return n}}},checkFormat(){let e=o().get(this.fieldConf,"check.format");return e&&(e=e.replaceAll("Y","y"),e=e.replaceAll("D","d")),e},defaultVal(){return new Date}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)},analyzeLimit(e){console.log("this.fieldConf",this.fieldConf);let t=o().get(this.fieldConf,`check.${e}`);if(!t)return;let n=null,a=(new Date).getTime();switch(t.type){case"LimitDateOffset":var i=t.offset_days;n=this.deltaToDate(a,i);break;case"LimitDateOffsetByField":console.log("container",this.container);var r=t.offset_days,s=o().get(this.container,`formData.${t.field}`);if(!s)return 0;n=this.deltaToDate(s,r);break;case"LimitDateByValue":var l=t.value;l=new Date(l).getTime(),this.deltaToDate(l,0)}return n},deltaToDate(e,t){let n=(e=new Date(e)).getDate()+t;return e.setDate(n),e.setHours(0,0,0,0),e}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmDateTime/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{attrs:{title:e.dateTimeStr}},[e._v(e._s(e.dateTimeStr))])};h._withStripped=!0;var p=n(4709),_=n.n(p),g=n(9795),y={props:["value","fieldConf","row"],data(){return{dateTimeStr:""}},computed:{format(){return o().get(this.fieldConf,"view.format")}},watch:{value(){this.dateTimeStr=this.formatViewTime()}},mounted(){this.dateTimeStr=this.formatViewTime()},methods:{formatViewTime(){let e,t=this.value;return t?(o().isInteger(t)&&13!=o().toString(t).length&&(t*=1e3),(0,g.Fr)()?(t=t.replace(/-/g,"/"),t=t.replace(/T/g," "),t=t.padEnd(10,"/01/01"),e=new Date(t).getTime()):e=new Date(t).getTime(),_().format(e,this.format)):""}}},b=(0,u.A)(y,h,[],!1,null,null,null);b.options.__file="components/lib/bpmDateTime/src/part/reader.vue";var v=b.exports,w={name:"BpmDateTime",components:{editorComponent:f,readerComponent:v},props:{value:{type:[String,Number]},fieldConf:{type:Object,default(){return{}}},container:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},computed:{curComponent(){return"view"==this.mode?v:f}},data(){return{curVal:""}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},M=(0,u.A)(w,a,[],!1,null,null,null);M.options.__file="components/lib/bpmDateTime/src/main.vue";var L=M.exports;L.install=function(e){e.component(L.name,L)};var k=L},9666:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.curComponent?n(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-field",attrs:{type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.fieldMode,uiType:e.uiType,formDefId:e.formDefId,orgInfo:e.orgInfo,dm:e.dm,clearable:e.clearable,disabled:e.fieldDisabled,isMultiple:e.isMul},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};a._withStripped=!0;var i={name:"BpmField",mixins:[n(1464).A]},r=(0,n(4486).A)(i,a,[],!1,null,null,null);r.options.__file="components/lib/bpmField/src/main.vue";var o=r.exports;o.install=function(e){e.component(o.name,o)};var s=o},9335:function(e,t,n){"use strict";n.r(t);var a=n(555);a.A.install=function(e){e.component(a.A.name,a.A)},t.default=a.A},4304:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.curComponent?n(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-field",attrs:{type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.fieldMode,uiType:e.uiType,formDefId:e.formDefId,orgInfo:e.orgInfo,dm:e.dm,clearable:e.clearable,disabled:e.fieldDisabled,isMultiple:e.isMul,container:e.container},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};a._withStripped=!0;var i=n(5554),r=n.n(i),o={name:"BpmFormField",mixins:[n(1464).A,function(){let e={props:["container","rowIndex","isNew","hideLabel"],data(){return{optAssWatchList:[],hasAddOptAssWatch:!1,defaultVal:null,firstListVal:null,loadedDefault:!1}},computed:{isSubForm(){return!1},topContainer(){return this.container.isSubForm?this.container.container:this.container},fieldSelf(){return this},fieldPath(){return this._getFieldPath()},readonly(){return!0},inner(){return this.$bpm.matchInnerComponent(this.fieldConf.type,this.readonly)}},created(){this.topContainer&&(this.topContainer.$once("beforeSchemaLoad",(e=>{this.clearOptAssWatch()})),this.topContainer.$once("dataLoaded",(e=>{this.addOptAssWatch()}))),this.isNew&&!this.hasAddOptAssWatch&&(this.addOptAssWatch(),this.$emit("update:isNew",!1))},methods:{async getConfDefaultValue(){let e=_.get(this.fieldConf,"default.value.type");e=e||_.get(this.fieldConf,"default.value.type");let t=_.get(this.fieldConf,"default.value.value"),n=_.get(this.fieldConf,"default.type");return this.defaultVal||this.loadedDefault?this.defaultVal:("EVCConfig"==n&&(t=_.get(this.fieldConf,"default.value"),this.defaultVal=t),"EVCExpression"==e||"EVCExpression"==n?(this.defaultVal=await this.$bpm.loadValDefault({fieldId:this.fieldConf.id,params:{},cusFormName:this.container.cusFormId,container:this.container}),this.loadedDefault=!0,this.defaultVal):("EVCFirstElem"==_.get(this.fieldConf,"default.value.type")&&(t=this.firstListVal),this.defaultVal=t,this.loadedDefault=!0,t))},getTypeValidEmptyValue(){let e=this.fieldConf.value_type,t=this.fieldConf.type;switch(e){case"int":return 0;case"struct":return"Mul"==t.substr(0,3)||"OnlineEditor"==t||this.isSubForm?[]:{};default:return"Mul"==t.substr(0,3)||"OnlineEditor"==t||this.isSubForm?[]:""}},removeValue(){let e=this.container,t=e.value;e.isSubForm&&(t=_.get(t,[this.rowIndex])),t&&(this.value=null)},_getFieldPath(e=!1){return this.container.isSubForm?e?[this.container.fieldConf.id,this.rowIndex,this.fieldConf.id]:[this.rowIndex,this.fieldConf.id]:[this.fieldConf.id]},_getValue(){console.log("this.container",this.container);let e="";return this.container&&(e=_.get(this.container.value,this.fieldPath)),e},isPromise(e){return!!e&&"function"==typeof e.then},_setValue(e){let t=this.container,n=_.cloneDeep(t.value);if(t.isQuote)return;let a=_.last(this.fieldPath);if(t.isSubForm){n||(n=[]);let i=this.rowIndex;if(n[i])return void this.$set(t.value[i],a,e);t.isXSubForm?r().set(n,i,t.getItem(i)):r().set(n,i,{}),n=n[i];try{r().set(t.value,i,n)}catch(e){console.log("error",t.value)}}else r().set(t.value,a,e),console.log("container.value",t.value,a,e)},clearOptAssWatch(){this.hasAddOptAssWatch=!1,_.each(this.optAssWatchList,(e=>{e()}))},addOptAssWatch(){this.hasAddOptAssWatch=!0;let e=_.get(this.fieldConf,"optAssMap"),t=_.get(this.fieldConf,"perm.visible");if(!e||_.isEmpty(e)||!t)return;let n=0;_.map(e,((t,a)=>{a=_.replace(a,"&",".");let i=this.$watch(`row.f_fields.${a}`,(t=>{let n=!0;_.map(e,((e,t)=>{t=_.replace(t,"&",".");let a=_.get(this.row,`f_fields.${t}`);a=_.toString(a),n=n&&_.includes(e,a)})),this.fieldConf.perm.visible=n}),{immediate:0==n});n++,this.optAssWatchList.push(i)}))}}};return _.merge(e,{data(){return{unWatchList:[],valueUnWatch:null,valDependIds:[],selectDependIds:[],remoteDependIds:[],selectFields:null,selectList:[],quoteContent:{},unSelectDependValWatchList:[],optAssWatchList:[],hasAddOptAssWatch:!1,scopeDependIds:[],subFormOldValMap:{},isDelete:!1,displayHidden:!1,differenceRowIndexs:[],topContainerMode:null,nextRely:null,loading:!1,firstFill:!0,hasFillDefault:!1,remoteData:[]}},created(){this.topContainer&&(this.topContainer.$once("beforeDataLoad",(e=>{this.toggleValueWatch(!1),this.clearOptAssWatch()})),this.topContainer.$once("dataLoaded",(e=>{this.getMemory(),this.addOptAssWatch()})),this.topContainer.$once("beforeReloadData",(e=>{this.toggleValueWatch(!1)}))),this.container.isSubForm&&(this.getMemory(),this.addOptAssWatch(),this.$emit("update:isNew",!1)),this.$bpm.$on("beforeFormSubmit",(({mode:e,formData:t,cc:n,_formData:a})=>{let i=this._getFieldPath(!0);console.log("beforeFormSubmit_fieldPath",i);let r=_.get(a,i);console.log("beforeFormSubmit_initVal",r);let o=_.get(this.fieldConf,"check.required",!1);if(console.log("beforeFormSubmit_required",o),console.log("beforeFormSubmit_fieldConf",this.fieldConf),console.log("beforeFormSubmit_value",this.value),(_.isNull(this.value)&&o||"SelectHouseOwner"==this.fieldConf.type&&(!this.value.name||!this.value.phone)&&o)&&(console.log("beforeFormSubmit_value",this.value),console.log("beforeFormSubmit_清掉-1",i),_.unset(t,i)),_.isArray(this.value)&&_.isEmpty(this.value)||_.isNil(this.value)||""==this.value&&0!==this.value){let e=_.get(this.fieldConf,"check.min_length");e=e||_.get(this.fieldConf,"check.min"),e=e||_.get(this.fieldConf,"check.min_count"),console.log("beforeFormSubmit_size",e),e||o||!r||(_.unset(t,i),console.log("beforeFormSubmit_清掉-2",i))}let s=this.container,l=s.isSubForm,d=_.get(this.fieldConf,"optAssMap");if(console.log("beforeFormSubmit_optAssMap",d),d&&!_.isEmpty(d)){let e=!0;_.map(d,((n,a)=>{console.log("beforeFormSubmit_visibleVals",n),console.log("beforeFormSubmit_before_field",a),a=a.replace(/&/g,"."),console.log("beforeFormSubmit_after_field",a);let r=_.split(a,".");console.log("beforeFormSubmit_before_relField",r),r=_.last(r),console.log("beforeFormSubmit_after_relField",r);let o=_.get(this.elementMap,`${r}.type`);console.log("beforeFormSubmit_typ",o);let d=!!o&&"Mul"==o.substr(0,3);console.log("beforeFormSubmit_isMul",d);let c=this._getPath(r);console.log("beforeFormSubmit_path",c),c!=r&&l&&(a=(a=`${s.fieldConf.id}&${this.rowIndex}&${r}`).replace(/&/g,".")),console.log("beforeFormSubmit_form_field",this.form),console.log("beforeFormSubmit_form",this.form),console.log("beforeFormSubmit_formData",t);let u=_.get(t,`${a}`)||_.get(this.form,`formData.${a}`);if(_.isNil(u)){let e=document.getElementById(`${i}`).style.display;console.log("beforeFormSubmit_displayHidden",e),"none"==e&&(console.log("beforeFormSubmit_清掉-4",i),_.unset(t,i))}else{if(console.log("beforeFormSubmit_field",a),console.log("beforeFormSubmit_formData_rely_val",u),d){let t=!1;_.each(u,(e=>{e=_.toString(e),console.log("beforeFormSubmit_formData_isIncludeInMull",t),_.includes(n,e)&&(t=!0)})),e=t}else{let t=_.toString(u);console.log("beforeFormSubmit_toString_value",t),e=e&&_.includes(n,t)}console.log("beforeFormSubmit_isInclude",e)}})),console.log("beforeFormSubmit_isInclude",e),e||(console.log("beforeFormSubmit_清掉-3",i),_.unset(t,i)),console.log("formData",t)}})),this.$bpm.$on("afterFormSubmit",(({mode:e,errors:t})=>{if(!t&&this.memorable){let t=this.fieldConf.id,n=_.get(this.fieldConf,"value_type");this.$bpm.setMemory(e,`${t}.${n}`,this.value)}})),this.$bpm.$on("handeInitRely",(async({id:e,rowIndex:t,oid:n,lastField:a})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||(this.topContainer.isCache?this.openRelyInitLoadOnCache(n,a):this.openInitRelyLoad(n,a))})),this.$bpm.$on("initRelyComplete",(async(e,t)=>{console.log("触发initRelyComplete"),e===this.container&&(this.hasFillDefault||await this.fillDefaultValue(),this.valueUnWatch||await this.toggleValueWatch(!0),this.addOptAssWatch(),t&&this.$emit("valueChanged"))})),this.$bpm.$on("handeRelyById",(({id:e,rowIndex:t,oid:n,lastField:a})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||(console.log("触发handeRelyById",e,n),this.opeRelyById(n,a))}))},provide(){return{getSelectFields:()=>this.selectFields,selectOptions:()=>this.selectList}},destroyed(){this.toggleValueWatch(!1),this.container.isQuote||(this.$bpm.$off("dataLoaded"),this.$bpm.$off("beforeFormSubmit"),this.$bpm.$off("handeInitRely"),this.$bpm.$off("initRelyComplete"),this.$bpm.$off("handeRelyById"))},watch:{"$store.getters.bpmLinkageBridge"(e){_.includes(e.to,this.fieldConf.id)&&(console.log("$store.getters.bpmLinkageBridge",e),e.calc_function&&this.form&&this.form.formData&&(console.log("bridge_link_complete_flag",this.link_complete_flag),this.$nextTick((()=>{console.log("bri_this.value",this.value),setTimeout((()=>{let t=_.cloneDeep(this.value);this.value=e.calc_function(this.form.formData),this.curVal=this.value,this.$emit("input",this.value),this.$emit("change",this.value),this.checkRely(this.value,t)}),3e3)}))))}},computed:{form(){return this.topContainer},isSubForm(){return-1!==this.fieldConf.type.indexOf("SubForm")},readonly(){return!_.get(this.fieldConf,"perm.editable",!1)},disWritable(){return!_.get(this.fieldConf,"perm.editable",!1)&&!_.get(this.fieldConf,"perm.writable",!1)},memorable(){return _.get(this.fieldConf,"perm.memorable",!1)},isDetailMode(){return"detail"==this.form.mode},isDeleteMode(){return"delete"==this.form.mode},elements(){return _.get(this.form,"formSchema.elements",[])},elementMap(){let e={},t=this.elements;return _.each(t,(t=>{_.set(e,t.id,t),_.each(t.elements||[],(n=>{_.set(e,t.id,t)}))})),e},description(){return _.get(this.fieldConf,"desc","")},hideName(){return _.get(this.fieldConf,"display.hide_name",!1)},visualAttrs(){let e=this._getFieldPath(!0).join("."),t=this.form.formErrors,n=!!t&&t[e],a=this.fieldConf,i=[],r=_.get(a,"perm.visible",!1);_.get(a,"check.required",!1)&&!this.isDetailMode&&i.push("q-field-required"),r&&!this.displayHidden||i.push("q-field-hidden"),this.readonly&&i.push("readonly");let o=_.get(this.fieldConf,"display.hide_name",!1),s=_.get(this.fieldConf,"display.is_tip",!1);o&&i.push("hide-name"),s&&i.push("tip-field"),n&&this.scrollToElement();let l=this.$bpm.isVerticalTypography,d=_.includes(["MulImage","SubForm","XSubForm","MulFile","Spliter","Signature"],a.type);return l=l&&!_.includes(["SubForm","XSubForm","Spliter"],a.type),l&&i.push("col-4"),"SelectHouseOwner"==a.type&&i.push("select-house-owner"),{filled:!0,hideHint:!0,disable:!_.get(a,"perm.editable",!0),error:!!n,errorLabel:_.get(n,"message",""),class:i,orientation:d||l?"vertical":"horizontal"}},isRelyId(){return _.includes(this.topContainer.relyIds,this.fieldConf.id)},isVerticalTypography(){return this.$bpm.isVerticalTypography}},mounted(){this.description&&this.insertDesc()},methods:{getMemory(){if(!this.memorable||this.value)return;let e=this.fieldConf.id,t=_.get(this.fieldConf,"value_type");this.topContainerMode=this.topContainer.mode,this.$bpm.checkMemory(this.topContainerMode,(n=>{let a=_.get(n,`f_fields.${e}.${t}`);this.value=a,this.setLocalCache(this.value)}),(()=>{}))},scrollToElement(){},async openRelyInitLoadOnCache(e,t){await this.loadSelectByDepends(),await this.loadRemoteByDepends(!0),this.$emit("valueChanged"),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.loading=!1,this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex,e,t)},async openInitRelyLoad(e,t){await this.loadSelectByDepends(),await this.loadRemoteByDepends(!0),await this.loadRemoteByFieldMap(e),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.$emit("valueChanged"),this.loading=!1,this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex,e,t)},async opeRelyById(e,t){await this.fillDefaultValue(),await this.loadSelectByDepends(),await this.loadRemoteByDepends(),await this.loadRemoteByFieldMap(e),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.loading=!1,this.container.handleNextRelyById&&await this.container.handleNextRelyById(this.rowIndex,e,t)},async getBreakResult(e){let t=this.$bpm.breakRelyMap,n=_.get(t,e);return _.includes(n,this.fieldConf.id)},async fillDefaultValue(){let e=this.topContainer.resetFields;if(_.includes(e,this.fieldConf.id))return this.value=null,this.setLocalCache(this.value),this.loading=!1,void(this.hasFillDefault=!0);if(_.isNil(this.value)){let e=await this.getConfDefaultValue();_.isNil(e)||(this.value=e,this.setLocalCache(this.value))}this.loading=!1,this.hasFillDefault=!0},async getConfDefaultValue(){if("EVCConfig"==_.get(this.conf,"default.value.type"))return _.get(this.conf,"default.value.value")},isPromise(e){return!!e&&"function"==typeof e.then},toggleValueWatch(e=!0){if(console.log("toggleValueWatch"),this.valueUnWatch&&(this.valueUnWatch(),this.valueUnWatch=!1),e){let e=JSON.stringify(this.value);this.valueUnWatch=this.$watch("value",(async(t,n)=>{if(console.log("第一层 formField: ",t,n),this.isSubForm||"Area"==this.fieldConf.type||"MulArea"==this.fieldConf.type){let n=JSON.stringify(t);if(e==n)return void(this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex))}else if(n==t)return void(this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex));e=JSON.stringify(t),this.checkRely(t,n)}),{immediate:"select_reviewed_person_signature"==this.fieldConf.id,deep:!0})}},handleChange(e,t){console.log("bpmFormFieldChange: ",e,t),this.$emit("input",e),this.$emit("change",e)},async checkRely(e,t){if(this.$emit("valueChanged"),"select_reviewed_person_signature"==this.fieldConf.id&&this.$store.commit("setBpmLinkageBridge",{form:this.fieldConf.id,to:["show_review_sign"],calc_function:e=>{let t=2;return t=e.select_reviewed_person_signature==zj.app.accessInfo.user_info.user_id?1:2,t}}),this.setLocalCache(e),(!this.container.isSubForm||this.container.isSubForm&&(!_.isUndefined(t)||!_.isUndefined(e)))&&this.container&&this.container.handleRelyById){await this.loadRemoteByFieldMap();let e=_.get(this.fieldConf,"mappings");e=_.keys(e),await this.container.handleRelyById(this.fieldConf.id,this.rowIndex,e)}this.firstFill=!1},setLocalCache(e){let t=this.fieldConf.id,n=this.container.mode,a=_.get(this.fieldConf,"value_type");this.$bpm.setLocalCache(n,`${t}.${a}`,e)},loadSelectListPre(e){this.$refs.fieldComp&&this.$refs.fieldComp.preSearch&&this.$refs.fieldComp.preSearch(e)},loadSelectByDepends(){this.readonly||(this.selectDependIds=_.get(this.fieldConf,"range_remote.depends",[]),this.loadSelectLinkage({fieldId:this.fieldConf.id},(e=>{if("Quote"==this.fieldConf.type)return this.value=_.map(e.data,"form_id"),this.quoteContent=e,void(this.loading=!1);this.selectList=e,this.loading=!1})))},async loadRemoteByDepends(e){if("OrderSubForm"==this.fieldConf.type&&(this.remoteDependIds=_.get(this.fieldConf,"remote.depends",[]),this.remoteDependIds.length||e)){let t=this.remoteDependIds,n=this.getDependData(t);if(_.map(n,((e,t)=>{_.isUndefined(e)&&_.unset(n,t)})),_.isEmpty(n)&&!e)return void(this.loading=!1);let a={fields:n,include_sup:!0},i=this.fieldConf.id,r=await this.$bpm.loadSelectRemoteForm({fieldId:i,params:a,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container});this.remoteData=r,this.loading=!1}},_getPath(e){let t=this.elements,n=e;return _.each(t,(t=>{_.each(t.elements||[],(a=>{a.id==e&&(n=t.id)}))})),n},getDependData(e){let t=this.topContainer.formData,n={};return _.each(e,(e=>{let a=this._getPath(e),i=_.get(t,a);if(e!=a){let t=[];_.each(i,((n,a)=>{let i={},r=_.get(n,e);(r||0===r)&&_.set(i,e,r),_.hasIn(n,"_meta")&&_.set(i,"_meta",n._meta),t.push(i)})),n[a]&&(t=_.merge(n[a],t)),i=t}_.isArray(i)&&_.each(i,(e=>{_.unset(e,"isNew")})),a&&_.set(n,a,i)})),n},loadSelectDepends(){let e=_.get(this.fieldConf,"range_remote.depends",[]),t=this.getDependData(e);_.isEmpty(t)||(this.selectFields=JSON.stringify(t))},async loadSelectLinkage({fieldId:e,mergeParams:t,dependVal:n,isForceLoad:a},i){let r=_.get(this.fieldConf,"range_remote.depends",[]),o=this.getDependData(r);if(_.isEmpty(o))return;this.selectFields=JSON.stringify(o);let s={fields:JSON.stringify(o)};this.container.isSubForm&&_.set(s,"idx",this.rowIndex);let l=this.fieldConf.type;"OnlineEditor"==l&&(s={spec:JSON.stringify(o)}),t&&(s=_.merge(s,t));let d=null;return d=_.includes(["MulSelectCheckItem","SelectRootCategory","SelectCheckItem","SelectSort","MulSelectSort"],l)?await this.$bpm.loadSelectLinkageResult({fieldId:e,params:s,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),filed:this.fieldSelf,container:this.container}):await this.$bpm.searchSelectOpts(e,"",this.container.cusFormId||_.get(this.container,"form.cusFormId"),this.fieldSelf,!1,s,!1),i&&i(d),d},addOptAssWatch(){if(this.hasAddOptAssWatch)return;let e=_.get(this.fieldConf,"optAssMap"),t=_.get(this.fieldConf,"perm.visible");if(!e||_.isEmpty(e)||!t)return;let n=this.container,a=n.isSubForm;_.map(e,((t,i)=>{i=i.replace(/&/g,".");let r=_.split(i,".");r=_.last(r);let o=this._getPath(r),s=_.get(this.elementMap,`${r}.type`),l=!!s&&"Mul"==s.substr(0,3);if(!s)return;let d=this.$watch(a?`form.formData.${n.fieldConf.id}`:`form.formData.${i}`,(()=>{console.log("BpmFormField watch ",a,n.fieldConf,i);let t=!0;_.map(e,((e,i)=>{o!=r&&a&&(i=`${n.fieldConf.id}&${this.rowIndex}&${r}`),i=i.replace(/&/g,".");let s=_.get(this.form,`formData.${i}`);if(l){let n=!1;_.each(s,(t=>{t=_.toString(t),_.includes(e,t)&&(n=!0)})),t=t&&n}else s=_.toString(s),t=t&&_.includes(e,s)})),a?this.displayHidden=!t:this.fieldConf.perm.visible=t,this.isDelete=!t,console.log("BpmFormField watch: visible",t)}),{immediate:!0,deep:!!a});this.optAssWatchList.push(d)})),this.hasAddOptAssWatch=!0},clearOptAssWatch(){this.hasAddOptAssWatch=!1,_.each(this.optAssWatchList,(e=>{e()}))},insertDesc(){this.$refs.field},async loadRemoteByFieldMap(e){let t=_.get(this.fieldConf,"mappings");if("SelectFromForm"!=this.fieldConf.type||!t||_.isEmpty(t))return;console.log("mappings",t);let n=await this.getRemoteByFieldMap();if(!n){let e={};_.each(t,(t=>{e[t.local_field_id]=null})),console.log("_mappingsResult",e),n=e}this.container&&this.container.changeValueByMapping&&this.container.changeValueByMapping(e,n)},async getRemoteByFieldMap(){let e=_.get(this.fieldConf,"mappings");if("SelectFromForm"!=this.fieldConf.type||!e||_.isEmpty(e)||!this.value)return;let t=_.get(this.fieldConf,"id");return(await this.$bpm.loadRmoteFieldMap({fieldId:t,params:{form_id:this.value},cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container})).data}}}),e}()]},s=(0,n(4486).A)(o,a,[],!1,null,null,null);s.options.__file="components/lib/bpmFormField/src/main.vue";var l=s.exports;l.install=function(e){e.component(l.name,l)};var d=l},2622:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-mul-file-edit"},[n("el-upload",{ref:"uploader",attrs:{action:e.url,name:"userfile","show-file-list":!1,multiple:"",limit:e.maxCount,accept:e.extensions,"before-upload":e.handleAdd,"on-success":e.onUploaded,"on-error":e.onFail,"file-list":e.fileList}},[n("el-button",{staticStyle:{"margin-top":"5px"},attrs:{slot:"trigger",size:"small",type:"primary",disabled:e.disabled},slot:"trigger"},[e._v(e._s(e.$z("点击上传","c.click_to_upload")))])],1),e._v(" "),n("div",[e.curVal&&e.curVal.length?[n("viewer",{staticStyle:{width:"100%"},attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},e._l(e.curVal,(function(t){return n("div",{key:t.md5,staticClass:"col-12 file-box",staticStyle:{"margin-top":"10px"}},[e.isImageFile(t)?n("span",{staticClass:"file-content",on:{click:function(n){return e.previewImg(t)}}},[n("img",{staticClass:"preview-image",attrs:{src:e.fileLink(t)}})]):n("span",{staticClass:"file-content",staticStyle:{"margin-left":"8px"},on:{click:function(n){return e.preview(t)}}},[n("div",{staticClass:"text-left file-icon"},[n("i",{staticClass:"fa",class:e.getFileTypeClass(t),attrs:{"aria-hidden":"true"}})])]),e._v(" "),n("div",{staticClass:"relative-position file-link ellipsis",attrs:{title:t.name}},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),n("div",{staticClass:"file-remove",on:{click:function(n){return e.remove(t.md5,t)}}},[n("span",{staticClass:"operation-btn"},[e._v(e._s(e.$z("删除","c.delete")))])])])})),0)]:[n("div",{staticClass:"col-auto",staticStyle:{"padding-top":"0px","font-size":"12px"}},[e._v("\n "+e._s(e.$z("未发现上传文件","b2.common.not_found_file"))+"\n ")])]],2),e._v(" "),n("el-dialog",e._g(e._b({staticClass:"file-modal",attrs:{visible:e.opened,"before-close":e.onHide,title:e.$z("文件预览","c.file_preview"),fullscreen:!0},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("iframe",{attrs:{src:e.officeUrl,width:"99%",height:e.windowH}})]),e._v(" "),n("img",{staticStyle:{display:"none"},attrs:{id:"image",src:""}}),e._v(" "),n("div",{staticStyle:{height:"100px",width:"109px",display:"none"},attrs:{id:"container"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(7642),l=n(9795),d=n(1335),c=n.n(d),u=n(5554),m=n.n(u),f=n(8245),h=(n(8085),n(7107),n(5093)),p=n.n(h);var _={insertEXIF:function(e,t,n){if(e instanceof Blob){var a=this,i=new FileReader;i.onload=function(){a.insertEXIF(i.result,t,n)},i.readAsArrayBuffer(e)}else{var r=[].slice.call(new Uint8Array(e),0);if(255!==r[2]||224!==r[3])return e;var o=256*r[4]+r[5],s=[255,216].concat(t,r.slice(4+o));n(new Uint8Array(s))}},getEXIF:function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++){var a=e[n];255===a[0]&&225===a[1]&&(t=t.concat(a))}return t},getSegments:function(e,t){if(e instanceof Blob){var n=this,a=new FileReader;a.onload=function(){n.getSegments(a.result,t)},a.readAsArrayBuffer(e)}else{if(!e.length&&!e.byteLength)return[];var i,r,o=0,s=[],l=[].slice.call(new Uint8Array(e),0);let n=1;for(;n&&(255!==l[o]||218!==l[o+1])&&(255===l[o]&&216===l[o+1]?o+=2:(i=o+(256*l[o+2]+l[o+3])+2,r=l.slice(o,i),o=i,s.push(r)),!(o>l.length)););t(s)}},decode64:function(e){var t="data:image/jpeg;base64,";if(e.slice(0,23)!==t)return[];for(var n=window.atob(e.replace(t,"")),a=new Uint8Array(n.length),i=0,r=n.length;i<r;i++)a[i]=n.charCodeAt(i);return a},encode64:function(e){for(var t="",n=0,a=e.length;n<a;n++)t+=String.fromCharCode(e[n]);return"data:image/jpeg;base64,"+window.btoa(t)}},g=n(5344),y=n.n(g);function b(e){let t="";y()(".viewer-in .address").length?(e&&(t='<i class="fa fa-map-marker"></i>'+e),y()(".viewer-in .address").html(t)):(e&&(t='<div class="address"><i class="fa fa-map-marker"></i>'+e+"</div>"),y()(".viewer-in .viewer-footer").append(t))}async function v(e){if(b(""),!function(e){return o().startsWith(e.type,"image")}(e))return;let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0");b("定位信息加载中...");let a=document.createElement("img");a.src=n;let i=this;setTimeout((()=>{try{y().ajax({url:`${n}?exif`,success:e=>{e&&e.GPSLatitude?i.setPs(e):c().getData(a,(function(){var e=c().getAllTags(this);console.log("info",e),i.setPs(e)}))},error:()=>{c().getData(a,(function(){var e=c().getAllTags(this);console.log("info",e),i.setPs(e)}))}})}catch(e){c().getData(a,(function(){var e=c().getAllTags(this);i.setPs(e)}))}}),600)}function w(e){console.log("filePath",e);var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""}function M(e){console.log("filePath",e);var t=e.lastIndexOf(".");let n="";return n=-1!=t?e.substring(t+1,e.length).toLowerCase():"other",console.log("fileSuffix",n),o().get({document:"fa-file-word-o",doc:"fa-file-word-o",docx:"fa-file-word-o",sheet:"fa-file-excel-o",xls:"fa-file-excel-o",xlsx:"fa-file-excel-o","ms-excel":"fa-file-excel-o",dwg:"fa-file-image-o",png:"fa-file-image-o",jpg:"fa-file-image-o",jfif:"fa-file-image-o",jpeg:"fa-file-image-o",pjpeg:"fa-file-image-o",gif:"fa-file-image-o",webp:"fa-file-image-o",svg:"fa-file-image-o",pdf:"fa-file-pdf-o",pptx:"fa-file-powerpoint-o",ppt:"fa-file-powerpoint-o",mp4:"fa-file-video-o",avi:"fa-file-video-o",mov:"fa-file-video-o",wmv:"fa-file-video-o",flv:"fa-file-video-o",mkv:"fa-file-video-o",webm:"fa-file-video-o",m4v:"fa-file-video-o","3gp":"fa-file-video-o",mpeg:"fa-file-video-o",rmvb:"fa-file-video-o",ts:"fa-file-video-o",vob:"fa-file-video-o",wav:"fa-file-audio-o",aiff:"fa-file-audio-o",pcm:"fa-file-audio-o",flac:"fa-file-audio-o",alac:"fa-file-audio-o",wma:"fa-file-audio-o",mp3:"fa-file-audio-o",ogg:"fa-file-audio-o",aac:"fa-file-audio-o",zip:"fa-file-archive-o",rar:"fa-file-archive-o",gz:"fa-file-archive-o",tgz:"fa-file-archive-o",bz2:"fa-file-archive-o",gar:"fa-file-archive-o",c:"fa-file-code-o",aspx:"fa-file-code-o",class:"fa-file-code-o",clw:"fa-file-code-o",cpp:"fa-file-code-o",cs:"fa-file-code-o",dll:"fa-file-code-o",dsp:"fa-file-code-o",h:"fa-file-code-o",hpp:"fa-file-code-o",html:"fa-file-code-o",jar:"fa-file-code-o",java:"fa-file-code-o",js:"fa-file-code-o",lib:"fa-file-code-o",ocx:"fa-file-code-o",py:"fa-file-code-o",pyc:"fa-file-code-o",xml:"fa-file-code-o",json:"fa-file-code-o",conf:"fa-file-code-o"},n,"fa-file-o")}function L(){let e=(new Date).valueOf();return function(e){let t=0,n=e.length;for(let a=0;a<n;a++)t=31*t+e.charCodeAt(a),t>2147483647&&(t%=2147483648);return t}(function(){let e="",t=6,n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let a=0;a<t;a++)e+=n[Math.round(Math.random()*(n.length-1))];return e}()+e.toString())}m().use(s.Upload),m().use(s.Button),m().use(s.Dialog);const k=n(3318);m().use(f.Ay),f.Ay.setDefaults({Options:{inline:!0,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!0,url:"data-source"}});var S=null,D={props:{value:{},fieldConf:{},row:{},extensions:{type:String,default(){return".webp,.gif,.jpg,.jpeg,.png,.heic,.heif,.doc,.xlsx,.pdf,.docx,.xls,.dwg"}}},data(){return{curVal:[],fileList:[],opened:!1,officeUrl:"",windowH:0,curExifInfo:{}}},watch:{value(){this.curVal=o().isArray(this.value)?this.value:[]}},computed:{url(){return o().get(this.fieldConf,"upload_url","/platform/v1/papi/app_file/upload/")},photo(){let e=[];return o().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),e},photoMd5s(){let e=[];return o().each(this.curVal,(t=>{this.isImageFile(t)&&e.push(t.md5)})),e},maxCountConf(){return o().get(this.fieldConf,"check.max_count")},maxCount(){return this.maxCountConf-this.curVal&&this.curVal.length},disabled(){return(this.curVal?this.curVal:[]).length>=this.maxCountConf}},created(){},mounted(){this.curVal=this.value,this.windowH=document.body.clientHeight/100*99-50,this.appendJs("https://webapi.amap.com/maps?v=1.4.15&key=c2195d5de1c163ebfb118bad93c8bbd3",(()=>{var e=new S.Map("container",{resizeEnable:!0});e.plugin("AMap.Geolocation",(()=>{let t=new S.Geolocation({enableHighAccuracy:!0,timeout:1e4,maximumAge:0,convert:!0,showButton:!0,buttonPosition:"LB",buttonOffset:new S.Pixel(10,20),showMarker:!0,showCircle:!0,panToLocation:!0,zoomToAccuracy:!0});e.addControl(t),t.getCurrentPosition(),S.event.addListener(t,"complete",(e=>{this.position=e.position})),S.event.addListener(t,"error",(e=>{console.log("定位出错-error",e)}))}))}))},methods:{appendJs(e){let t=document.createElement("script"),n={type:"text/javascript",async:/^http/.test(e)?"async":"",src:e};for(var a in n)t[a]=n[a];document.head.appendChild(t)},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=o().filter(this.curVal,(e=>this.isImageFile(e)));v(o().get(n,t))},previewImg(e){let t=o().indexOf(this.photoMd5s,e.md5);this.$viewer.view(t)},isDwg(e){return o().endsWith(e.name,".dwg")},getFileTypeClass(e){return M(e.name)},handleAdd(e){console.log("_file",e),c().getData(e,(()=>{let e=c().getAllTags(this);console.log("allEXIF",e)}));let t=this.fileList;o().each(t,((e,t)=>{console.log("handleAdd_file"),function(e,t){if(-1==e.type.indexOf("image"))t(null);else{let n=new FileReader,a=new Image;n.readAsDataURL(e),n.onload=function(){e.src=this.result,a.onload=function(){let t=a.width,n=a.height;e.width=t,e.height=n},a.src=e.src,function(e,t,n,a){var i=new Image;i.src=e.src,i.onload=function(){var e=this,i=e.width,r=e.height,o=i/r;i=t.width||i,r=t.height||i/o;var s=.7,l=document.createElement("canvas"),d=l.getContext("2d"),u=document.createAttribute("width");u.nodeValue=i;var m=document.createAttribute("height");m.nodeValue=r,l.setAttributeNode(u),l.setAttributeNode(m);try{c().getData(n,(function(){let n=c().getTag(this,"GPSLatitude");var o=c().getAllTags(this);console.log("exifInfo",o),d.drawImage(e,0,0,i,r),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var u=l.toDataURL("image/jpeg",s);a(u,n)}))}catch(n){d.drawImage(e,0,0,i,r),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var f=l.toDataURL("image/jpeg",s);a(f,null)}}}(e,{quality:.4},e,t)}}}(e,((n,a)=>{n&&_.getSegments(new Blob([e]),(i=>{let r=this.dataURLtoFile(n,e.name),s=_.getEXIF(i);if(console.log("exifInfo",s),!o().isEmpty(s)&&a)_.insertEXIF(r,s,(n=>{let a=new Blob([n],{type:e.type});a.name=e.name,a.lastModifiedDate=new Date,this.fileList[t]=a}));else{let a={},i={},r={};a[k.ImageIFD.Make]="lse";let o=this.position.lat,s=this.position.lng;r[k.GPSIFD.GPSLatitudeRef]=o<0?"S":"N",r[k.GPSIFD.GPSLatitude]=k.GPSHelper.degToDmsRational(o),r[k.GPSIFD.GPSLongitudeRef]=s<0?"W":"E",r[k.GPSIFD.GPSLongitude]=k.GPSHelper.degToDmsRational(s),r[k.GPSIFD.GPSImgDirection]=[123456,100];let l={"0th":a,Exif:i,GPS:r},d=k.dump(l),c=k.insert(d,n),u=this.dataURLtoFile(c,e.name);this.fileList[t]=u}}))}))}))},dataURLtoFile(e,t){let n=e.split(","),a=n[0].match(/:(.*?);/)[1],i=atob(n[1]),r=i.length,o=new Uint8Array(r);for(;r--;)o[r]=i.charCodeAt(r);return new File([o],t,{type:a})},isImageFile(e){return o().startsWith(e.type,"image")},itemSideImageAttr(e){let t={};return this.isImageFile(e)?t.image=this.fileLink(e):t.icon="fa fa-file",t},fileLink(e){if(!e||!e.md5)return;let t=this.isImageFile(e),n={file_md5:e.md5};return t||(n.is_file=1),(0,l.zC)("/platform/v1/papi/web_file/image_view/",n)},async preview(e){if("dwg/dwg"==e.type)return;let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0"),a=w(n);"application/pdf"==e.type&&(a="pdf"),"application/vnd.ms-excel"==e.type&&(a="ms-excel");let i=L(),r=`https://${window.location.host}/zj_of/v1/papi/file/read_only/?md5=${e.md5}&type=${{document:"Word.Document",docx:"Word.Document",doc:"Word.Document",sheet:"Excel.Sheet",pdf:"pdf",xlsx:"Excel.Sheet","ms-excel":"Excel.Sheet"}[a]}&sign=${i}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(r="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),"pdf"==a){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),r=(0,l.Fr)()?`/public/app3/bpm/view_pdf.html?url=${n}`:`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=r,this.opened=!0},onFail(e,t){let n=`${t.name}上传失败`;console.log("err:",n)},onUploaded(e,t){console.log("file",t);let n={};t.raw&&t.raw.exifdata&&(n=t.raw.exifdata);let a=null;a=n.DateTimeOriginal?p()(n.DateTimeOriginal,"YYYY:MM:DD HH:mm:ss").unix():n.ColorSpace?(new Date).getTime()/1e3:null;let i=o().isArray(this.curVal)?this.curVal:[],r={name:t.name,type:o().get(t,"raw.type"),md5:o().get(e,"data.file_md5"),upload_time:p()().unix(),take_photo_time:a};e&&e.data&&e.data.file_md5&&i.push(r),this.curVal=o().cloneDeep(i),console.log("this.curVal",this.curVal),this.handleChange()},remove(e){this.curVal=o().filter(this.curVal,(t=>t.md5!=e)),this.handleChange(),this.$refs.uploader.queue=[]},onHide(){this.opened=!1},onOpen(){this.opened=!0},handleChange(){this.$emit("input",this.curVal),this.$emit("change",this.curVal)}}},x=D,Y=n(4486),T=(0,Y.A)(x,i,[],!1,null,null,null);T.options.__file="components/lib/bpmMulFile/src/part/editor.vue";var C=T.exports,j=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-mul-file-reader"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!e.curVal||0==e.curVal.length,expression:"!curVal || curVal.length == 0"}]},[e._v("\n "+e._s(e.$z("暂无文件或图片","c.no_files"))+"\n ")]),e._v(" "),e.photo.length>0?n("viewer",{ref:"viewer",attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},[n("div",{staticStyle:{display:"flex","flex-wrap":"wrap"}},e._l(e.curVal,(function(t){return n("span",{key:t.md5},[e.isImageFile(t)?n("div",{staticClass:"file-box"},[n("div",{staticClass:"file-content",staticStyle:{height:"auto",border:"1px solid #ececec"}},[n("el-tooltip",{attrs:{content:t.name,placement:"bottom",effect:"dark"}},[n("img",{staticClass:"preview-image",attrs:{src:e.fileLink(t,600),alt:""}})])],1)]):[n("el-tooltip",{attrs:{placement:"bottom",effect:"dark",content:t.name}},[n("div",{staticClass:"file-box no-photo-file-box",attrs:{target:"_blank"},on:{click:function(n){return e.reviewOnMobile(t)}}},[n("div",{staticClass:"text-center file-icon",on:{click:function(n){return e.preview(t)}}},[n("i",{staticClass:"q-icon fa",class:e.getFileTypeClass(t),attrs:{"aria-hidden":"true"}})]),e._v(" "),n("span",{staticClass:"file-name"},[e._v(" "+e._s(t.name))]),e._v(" "),n("div",{staticClass:"overlay"},[e.isDwg(t)?e._e():n("el-button",{attrs:{type:"text",title:e.$z("预览","c.preview")},on:{click:function(n){return e.preview(t)}}},[n("i",{staticClass:"overlay-btn el-icon-view"})]),e._v(" "),n("el-button",{attrs:{type:"text",title:e.$z("下载","c.download")},on:{click:function(n){return e.download(t)}}},[n("i",{staticClass:"overlay-btn el-icon-download"})])],1)])])]],2)})),0)]):e._l(e.curVal,(function(t){return n("span",{key:t.md5},[n("div",{staticClass:"file-box",staticStyle:{"padding-left":"8px"},attrs:{target:"_blank"}},[n("div",{staticClass:"text-center file-icon",on:{click:function(n){return e.preview(t)}}},[n("i",{staticClass:"fa",class:e.getFileTypeClass(t),attrs:{"aria-hidden":"true"}})]),e._v(" "),n("div",{staticClass:"relative-position tc file-link ellipsis",attrs:{title:t.name},on:{click:function(n){return e.preview(t)}}},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),n("div",{staticClass:"operation-box"},[e.isDwg(t)?e._e():n("a",{staticClass:"operation-btn",attrs:{href:"javascript:;"},on:{click:function(n){return e.preview(t)}}},[e._v(e._s(e.$z("预览","c.preview")))]),e._v(" "),e.isDwg(t)?e._e():n("span",[e._v("|")]),e._v(" "),n("a",{staticClass:"operation-btn",attrs:{href:"javascript:;"},on:{click:function(n){return e.download(t)}}},[e._v(e._s(e.$z("下载","c.download")))])])])])})),e._v(" "),n("el-dialog",e._g(e._b({staticClass:"file-modal",attrs:{visible:e.opened,"before-close":e.onHide,modal:!1,title:e.$z("文件预览","c.file_preview"),fullscreen:!0},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("iframe",{attrs:{src:e.officeUrl,width:"99%",height:e.windowH}})]),e._v(" "),n("img",{staticStyle:{display:"none"},attrs:{id:"image",src:""}})],2)};j._withStripped=!0,m().use(s.Dialog),m().use(f.Ay),f.Ay.setDefaults({Options:{inline:!0,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!1,fullscreen:!1,keyboard:!0}}),m().use(s.Dialog);var $={props:["value","fieldConf","row"],data(){return{vueLightId1:null,curVal:[],photo:[],officeUrl:"",opened:!1,windowH:0,type:"small"}},computed:{},watch:{value(e){this.curVal=o().filter(e,(e=>e.md5)),this.setPhoto()}},created(){},mounted(){let e=(new Date).getTime();this.vueLightId1=e+1,this.curVal=o().filter(this.value,(e=>e.md5)),this.setPhoto(),this.windowH=document.body.clientHeight/100*99-50},methods:{isDwg(e){return o().endsWith(e.name,".dwg")},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=o().filter(this.value,(e=>this.isImageFile(e)));v(o().get(n,t))},setPhoto(){let e=[];o().each(this.value,(t=>{if(this.isImageFile(t)&&t.md5){let n=this.fileLink(t,600);e.push(n)}})),this.photo=e},getFileTypeClass(e){return M(e.name)},isImageFile(e){return o().startsWith(e.type,"image")},fileLink(e){if(!e||!e.md5)return;let t=this.isImageFile(e),n={file_md5:e.md5};return t||(n.is_file=1),(0,l.zC)("/platform/v1/papi/web_file/image_view/",n)},reviewOnMobile(e){},async preview(e){let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0"),a=w(n);"application/pdf"==e.type&&(a="pdf"),"application/vnd.ms-excel"==e.type&&(a="ms-excel");let i=L(),r=`https://${window.location.host}/zj_of/v1/papi/file/read_only/?md5=${e.md5}&type=${{document:"Word.Document",docx:"Word.Document",doc:"Word.Document",sheet:"Excel.Sheet",pdf:"pdf",xlsx:"Excel.Sheet","ms-excel":"Excel.Sheet"}[a]}&sign=${i}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(r="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),console.log("url",r),"pdf"==a){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),r=`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=r,this.opened=!0},async share(e){return await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`})},async toShare(e){console.log("fileInfo",e)},async download(e){window.open(`/platform/v1/papi/web_file/web_download/?file_md5=${e.md5}`)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},P=(0,Y.A)($,j,[],!1,null,null,null);P.options.__file="components/lib/bpmMulFile/src/part/reader.vue";var I=P.exports,F={name:"BpmMulFile",components:{editorComponent:C,readerComponent:I},props:{value:{},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},data(){return{curVal:[]}},computed:{curComponent(){return"view"==this.mode?I:C}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},E=(0,Y.A)(F,a,[],!1,null,null,null);E.options.__file="components/lib/bpmMulFile/src/main.vue";var O=E.exports;O.install=function(e){e.component(O.name,O)};var A=O},2554:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return E}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-mul-image",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange,imgLoadError:e.emitImgLoadError},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-mul-image-edit"},[n("el-upload",e._g(e._b({ref:"uploader",attrs:{action:e.url,name:"userfile","show-file-list":!1,multiple:"",limit:e.maxCount,accept:e.extensions,"before-upload":e.handleAdd,"on-success":e.onUploaded,"on-error":e.onFail,"file-list":e.fileList}},"el-upload",e.$attrs,!1),e.$listeners),[n("el-button",{attrs:{slot:"trigger",size:"small",type:"primary",disabled:e.disabled},slot:"trigger"},[e._v(e._s(e.$z("点击上传","c.click_to_upload")))])],1),e._v(" "),n("div",{staticClass:"row gutter-sm q-my-sm file-list"},[e.curVal&&e.curVal.length?[n("viewer",{staticClass:"row gutter-sm q-my-sm file-list",staticStyle:{width:"100%"},attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},e._l(e.curVal,(function(t){return n("div",{key:t.md5,staticClass:"col-12 file-box"},[e.isImageFile(t)?n("span",{staticClass:"file-content",on:{click:function(n){return e.previewImg(t)}}},[n("img",{staticClass:"preview-img",attrs:{src:e.fileLink(t)}})]):n("span",{staticClass:"file-content q-mb-xs",on:{click:function(n){return e.preview(t)}}},[n("div",{staticClass:"text-left text-faded"},[n("i",{staticClass:"q-icon fa fa-file-pdf-o",class:e.getFileTypeClass(t),attrs:{"aria-hidden":"true"}})])]),e._v(" "),n("div",{staticClass:"relative-position file-link ellipsis",attrs:{title:t.name}},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),n("div",{staticClass:"file-remove",on:{click:function(n){return e.remove(t.md5,t)}}},[e._v(e._s(e.$z("删除","c.delete")))])])})),0)]:[n("div",{staticClass:"col-auto",staticStyle:{"padding-top":"0px","font-size":"12px"}},[e._v("\n "+e._s(e.$z("未发现上传文件","b2.common.not_found_file"))+"\n ")])]],2),e._v(" "),n("img",{staticStyle:{display:"none"},attrs:{id:"image",src:""}}),e._v(" "),n("div",{staticStyle:{height:"100px",width:"109px",display:"none"},attrs:{id:"container"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(1335),l=n.n(s),d=n(5093),c=n.n(d),u=n(7642),m=n(9795),f=n(5554),h=n.n(f),p=n(8245);n(8085),n(7107);var _={insertEXIF:function(e,t,n){if(e instanceof Blob){var a=this,i=new FileReader;i.onload=function(){a.insertEXIF(i.result,t,n)},i.readAsArrayBuffer(e)}else{var r=[].slice.call(new Uint8Array(e),0);if(255!==r[2]||224!==r[3])return e;var o=256*r[4]+r[5],s=[255,216].concat(t,r.slice(4+o));n(new Uint8Array(s))}},getEXIF:function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++){var a=e[n];255===a[0]&&225===a[1]&&(t=t.concat(a))}return t},getSegments:function(e,t){if(e instanceof Blob){var n=this,a=new FileReader;a.onload=function(){n.getSegments(a.result,t)},a.readAsArrayBuffer(e)}else{if(!e.length&&!e.byteLength)return[];var i,r,o=0,s=[],l=[].slice.call(new Uint8Array(e),0);let n=1;for(;n&&(255!==l[o]||218!==l[o+1])&&(255===l[o]&&216===l[o+1]?o+=2:(i=o+(256*l[o+2]+l[o+3])+2,r=l.slice(o,i),o=i,s.push(r)),!(o>l.length)););t(s)}},decode64:function(e){var t="data:image/jpeg;base64,";if(e.slice(0,23)!==t)return[];for(var n=window.atob(e.replace(t,"")),a=new Uint8Array(n.length),i=0,r=n.length;i<r;i++)a[i]=n.charCodeAt(i);return a},encode64:function(e){for(var t="",n=0,a=e.length;n<a;n++)t+=String.fromCharCode(e[n]);return"data:image/jpeg;base64,"+window.btoa(t)}},g=n(5344),y=n.n(g);function b(e){let t="";y()(".viewer-in .address").length?(e&&(t='<i class="fa fa-map-marker"></i>'+e),y()(".viewer-in .address").html(t)):(e&&(t='<div class="address"><i class="fa fa-map-marker"></i>'+e+"</div>"),y()(".viewer-in .viewer-footer").append(t))}async function v(e){if(b(""),!function(e){return o().startsWith(e.type,"image")}(e))return;let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0");b("定位信息加载中...");let a=document.createElement("img");a.src=n;let i=this;setTimeout((()=>{try{y().ajax({url:`${n}?exif`,success:e=>{e&&e.GPSLatitude?i.setPs(e):l().getData(a,(function(){var e=l().getAllTags(this);console.log("info",e),i.setPs(e)}))},error:()=>{l().getData(a,(function(){var e=l().getAllTags(this);console.log("info",e),i.setPs(e)}))}})}catch(e){l().getData(a,(function(){var e=l().getAllTags(this);i.setPs(e)}))}}),600)}function w(e){console.log("filePath",e);var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""}h().use(u.Upload),h().use(u.Button),h().use(u.Dialog);const M=n(3318);h().use(p.Ay),p.Ay.setDefaults({Options:{inline:!0,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!0,url:"data-source"}});var L=null,k={props:{type:{type:String,default:"MulImage"},value:{},fieldConf:{},row:{},extensions:{type:String,default(){return".jpg,.jpeg,.png,.dwg,.heic,.heif,.webp"}}},data(){return{curVal:[],fileList:[],opened:!1,officeUrl:"",windowH:0}},watch:{value(){this.curVal=this.isSign&&o().isString(this.value)&&this.value?[{md5:this.value,name:"",type:"image/png"}]:this.value}},computed:{url(){return"/platform/v1/papi/app_file/upload/"},isSign(){return"Signature"===this.type||"Signature"==this.fieldConf.type},photo(){let e=[];return o().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),e},photoMd5s(){let e=[];return o().each(this.curVal,(t=>{this.isImageFile(t)&&e.push(t.md5)})),e},maxCountConf(){return o().get(this.fieldConf,"check.max_count")},maxCount(){return this.maxCountConf-this.curVal&&this.curVal.length},disabled(){return(this.curVal?this.curVal:[]).length>=this.maxCountConf}},created(){},mounted(){this.curVal=this.isSign&&o().isString(this.value)&&this.value?[{md5:this.value,name:"签名",type:"image/png"}]:this.value,this.windowH=document.body.clientHeight/100*99-50,this.appendJs("https://webapi.amap.com/maps?v=1.4.15&key=c2195d5de1c163ebfb118bad93c8bbd3",(()=>{var e=new L.Map("container",{resizeEnable:!0});e.plugin("AMap.Geolocation",(()=>{let t=new L.Geolocation({enableHighAccuracy:!0,timeout:1e4,maximumAge:0,convert:!0,showButton:!0,buttonPosition:"LB",buttonOffset:new L.Pixel(10,20),showMarker:!0,showCircle:!0,panToLocation:!0,zoomToAccuracy:!0});e.addControl(t),t.getCurrentPosition(),L.event.addListener(t,"complete",(e=>{this.position=e.position})),L.event.addListener(t,"error",(e=>{console.log("定位出错-error",e)}))}))}))},methods:{appendJs(e){let t=document.createElement("script"),n={type:"text/javascript",async:/^http/.test(e)?"async":"",src:e};for(var a in n)t[a]=n[a];document.head.appendChild(t)},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=o().filter(this.curVal,(e=>this.isImageFile(e)));v(o().get(n,t))},previewImg(e){let t=o().indexOf(this.photoMd5s,e.md5);this.$viewer.view(t)},isDwg(e){return o().endsWith(e.name,".dwg")},getFileTypeClass(e){let t=w(e.type);return t=t||w(e.name),o().endsWith(e.name,".dwg")&&(t="dwg"),o().get({document:"fa-file-word-o",sheet:"fa-file-excel-o",doc:"fa-file-word-o",docx:"fa-file-word-o",xlsx:"fa-file-excel-o","ms-excel":"fa-file-excel-o",dwg:"fa-file-image-o",png:"fa-file-image-o",jpg:"fa-file-image-o"},t)},handleAdd(e){console.log("_file",e),l().getData(e,(()=>{let e=l().getAllTags(this);console.log("allEXIF",e)}));let t=this.fileList;o().each(t,((e,t)=>{!function(e,t){if(-1==e.type.indexOf("image"))t(null);else{let n=new FileReader,a=new Image;n.readAsDataURL(e),n.onload=function(){e.src=this.result,a.onload=function(){let t=a.width,n=a.height;e.width=t,e.height=n},a.src=e.src,function(e,t,n,a){var i=new Image;i.src=e.src,i.onload=function(){var e=this,i=e.width,r=e.height,o=i/r;i=t.width||i,r=t.height||i/o;var s=.7,d=document.createElement("canvas"),c=d.getContext("2d"),u=document.createAttribute("width");u.nodeValue=i;var m=document.createAttribute("height");m.nodeValue=r,d.setAttributeNode(u),d.setAttributeNode(m);try{l().getData(n,(function(){let n=l().getTag(this,"GPSLatitude");c.drawImage(e,0,0,i,r),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var o=d.toDataURL("image/jpeg",s);a(o,n)}))}catch(n){c.drawImage(e,0,0,i,r),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var f=d.toDataURL("image/jpeg",s);a(f,null)}}}(e,{quality:.4},e,t)}}}(e,((n,a)=>{n&&_.getSegments(new Blob([e]),(i=>{let r=this.dataURLtoFile(n,e.name),s=_.getEXIF(i);if(!o().isEmpty(s)&&a)_.insertEXIF(r,s,(n=>{let a=new Blob([n],{type:e.type});a.name=e.name,a.lastModifiedDate=new Date,this.fileList[t]=a}));else{let a={},i={},r={};a[M.ImageIFD.Make]="lse";let o=this.position.lat,s=this.position.lng;r[M.GPSIFD.GPSLatitudeRef]=o<0?"S":"N",r[M.GPSIFD.GPSLatitude]=M.GPSHelper.degToDmsRational(o),r[M.GPSIFD.GPSLongitudeRef]=s<0?"W":"E",r[M.GPSIFD.GPSLongitude]=M.GPSHelper.degToDmsRational(s),r[M.GPSIFD.GPSImgDirection]=[123456,100];let l={"0th":a,Exif:i,GPS:r},d=M.dump(l),c=M.insert(d,n),u=this.dataURLtoFile(c,e.name);this.fileList[t]=u}}))}))}))},dataURLtoFile(e,t){let n=e.split(","),a=n[0].match(/:(.*?);/)[1],i=atob(n[1]),r=i.length,o=new Uint8Array(r);for(;r--;)o[r]=i.charCodeAt(r);return new File([o],t,{type:a})},isImageFile(e){return o().startsWith(e.type,"image")},itemSideImageAttr(e){let t={};return this.isImageFile(e)?t.image=this.fileLink(e):t.icon="fa fa-file",t},fileLink(e){if(!e||!e.md5)return;let t=this.isImageFile(e),n={file_md5:e.md5};return t||(n.is_file=1),(0,m.zC)("/platform/v1/papi/web_file/image_view/",n)},async preview(e){if("dwg/dwg"==e.type)return;let t=await zj.net.w.noapi({url:`/platform/v1/papi/app_file/download/?file_md5=${e.md5}&webp=0`}),n=o().get(t,"url_list.0.path.0"),a=w(n);"application/pdf"==e.type&&(a="pdf"),"application/vnd.ms-excel"==e.type&&(a="ms-excel");let i=function(){let e=(new Date).valueOf();return function(e){let t=0,n=e.length;for(let a=0;a<n;a++)t=31*t+e.charCodeAt(a),t>2147483647&&(t%=2147483648);return t}(function(){let e="",t=6,n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(let a=0;a<t;a++)e+=n[Math.round(Math.random()*(n.length-1))];return e}()+e.toString())}(),r=`https://${window.location.host}/zj_of/v1/papi/file/read_only/?md5=${e.md5}&type=${{document:"Word.Document",docx:"Word.Document",doc:"Word.Document",sheet:"Excel.Sheet",pdf:"pdf",xlsx:"Excel.Sheet","ms-excel":"Excel.Sheet"}[a]}&sign=${i}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(r="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),"pdf"==a){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),r=(0,m.Fr)()?`/public/app3/bpm/view_pdf.html?url=${n}`:`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=r,this.opened=!0},onFail(e,t){let n=`${t.name}上传失败`;console.log("err:",n)},onUploaded(e,t){console.log("file",t);let n={};t.raw&&t.raw.exifdata&&(n=t.raw.exifdata);let a=o().isArray(this.curVal)?this.curVal:[];a.push({name:t.name,type:o().get(t,"raw.type"),md5:o().get(e,"data.file_md5"),upload_time:c()().unix(),take_photo_time:n.DateTimeOriginal?c()(n.DateTimeOriginal,"YYYY:MM:DD HH:mm:ss").unix():null}),this.curVal=o().cloneDeep(a);let i=this.isSign?o().get(this.curVal,"0.md5",""):this.curVal;this.$emit("input",i),this.$emit("change",i)},remove(e){this.curVal=o().filter(this.curVal,(t=>t.md5!=e)),this.$refs.uploader.queue=[];let t=this.isSign?o().get(this.curVal,"0.md5",""):this.curVal;this.$emit("input",t),this.$emit("change",t)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},S=k,D=n(4486),x=(0,D.A)(S,i,[],!1,null,null,null);x.options.__file="components/lib/bpmMulImage/src/part/editor.vue";var Y=x.exports,T=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-mul-image-reader"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!e.curVal||0==e.curVal.length,expression:"!curVal || curVal.length == 0"}]},[e._v(e._s(e.$z("暂无图片","c.no_pictures")))]),e._v(" "),e.isSignature&&e.curVal&&e.curVal[0]?[n("img",{staticStyle:{width:"160px",height:"auto"},attrs:{src:e.fileLink(e.curVal[0]),alt:e.$z("电子签名","c.electronic_signature"),onerror:e.emitImgLoadError}})]:n("viewer",{ref:"viewer",attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},e._l(e.curVal,(function(t){return n("span",{key:t.md5},[e.isImageFile(t)?n("div",{staticClass:"file-box"},[n("div",{staticClass:"file-icon",staticStyle:{border:"1px dashed #ececec",cursor:"pointer"}},[n("img",{staticStyle:{width:"200px",height:"auto"},attrs:{src:e.fileLink(t,600),alt:""}})]),e._v(" "),n("div",{staticClass:"relative-position tc file-link ellipsis",attrs:{title:t.name}},[e._v("\n "+e._s(t.name)+"\n ")])]):e._e()])})),0),e._v(" "),n("img",{staticStyle:{display:"none"},attrs:{id:"image",src:""}})],2)};T._withStripped=!0,h().use(p.Ay),p.Ay.setDefaults({Options:{inline:!0,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!1,fullscreen:!1,keyboard:!0}});var C={props:["type","value","fieldConf","row"],data(){return{vueLightId1:null,photo:[],curVal:[],officeUrl:"",opened:!1,windowH:0}},computed:{is_mobile(){return(0,m.Fr)()},isSignature(){return"Signature"===this.fieldConf.type}},watch:{value(){console.log("img_curlVal",this.value),this.curVal=o().isString(this.value)?[{md5:this.value,name:"",type:"image/png"}]:this.value,this.setPhoto()}},created(){},mounted(){let e=(new Date).getTime();this.vueLightId1=e+1,console.log("this.value",this.value),this.curVal=o().isString(this.value)?[{md5:this.value,name:"",type:"image/png"}]:this.value,this.setPhoto(),this.windowH=document.body.clientHeight/100*99-50},methods:{emitImgLoadError(){this.$emit("imgLoadError")},isDwg(e){return o().endsWith(e.name,".dwg")},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=o().filter(this.curVal,(e=>this.isImageFile(e)));v(o().get(n,t))},setPhoto(){let e=[];o().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),this.photo=e},getFileTypeClass(e){let t=w(e.type);return"application/pdf"==e.type&&(t="fa-file-pdf-o"),o().get({document:"fa-file-word-o",sheet:"fa-file-excel-o",doc:"fa-file-word-o",docx:"fa-file-word-o",xlsx:"fa-file-excel-o","ms-excel":"fa-file-excel-o",dwg:"fa-file-image-o",png:"fa-file-image-o",jpg:"fa-file-image-o"},t)},isImageFile(e){return o().startsWith(e.type,"image")},fileLink(e){if(console.log("fileLink_tem",e),!e||!e.md5)return;let t=this.isImageFile(e),n={file_md5:e.md5};return t||(n.is_file=1),(0,m.zC)("/platform/v1/papi/web_file/image_view/",n)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},j=(0,D.A)(C,T,[],!1,null,null,null);j.options.__file="components/lib/bpmMulImage/src/part/reader.vue";var $=j.exports,P={name:"BpmMulImage",components:{editorComponent:Y,readerComponent:$},props:{value:{type:[String,Array]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?$:Y}},watch:{value(e){console.log("mulImage",e),this.curVal=e}},mounted(){this.curVal=this.value},methods:{emitImgLoadError(){this.$emit("imgLoadError")},handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},I=(0,D.A)(P,a,[],!1,null,null,null);I.options.__file="components/lib/bpmMulImage/src/main.vue";var F=I.exports;F.install=function(e){e.component(F.name,F)};var E=F},7698:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-number",attrs:{value:e.curVal,fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{position:"relative"}},[n("el-input-number",{ref:"component",attrs:{precision:e.precision},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642);l().use(d.InputNumber);var c={data(){return{curVal:null}},props:["value","fieldConf","row"],watch:{value(){this.curVal=Number(this.value)}},computed:{precision(){return o().get(this.fieldConf,"view.precision",0)}},methods:{handleChange(e){console.log("number change: ",e),this.$emit("change",this.curVal)}},mounted(){this.curVal=Number(this.value)}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmNumber/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{staticClass:"bpm-text-view",class:e.uiType+"-text-view "+e.fieldConf.type+"-view",attrs:{title:e._value}},[e._v("\n "+e._s(e._value||0===e._value?e._value:"--")+"\n")])};h._withStripped=!0;var p=n(9227),_={props:["value","fieldConf","row","uiType"],computed:{_value(){let e=o().get(this.row,this.fieldConf.id)||this.value;"string"==typeof e&&(e=e.trim()),console.log("Number_fieldConf",this.fieldConf);let t=o().get(this.fieldConf,"view.precision",0);this.fieldConf.view&&this.fieldConf.view.precision&&(e=o().round(e,this.fieldConf.view.precision)),o().get(this.fieldConf,"view.show_percent",!1)&&(e||0==e)&&(e=(100*e).toFixed(t-2>0?t-2:0)+"%");let n=o().get(this.fieldConf,"view.format",!1);if(n){let t=0;if(-1!=n.indexOf("{")){var a=n.match(/\{([^\}]+)\}/)[1];let i=n;t=p(e).format(a),e=i.replace(/\{[^\}]+\}/,t)}else e=p(e).format(n);return e}return e}}},g=(0,u.A)(_,h,[],!1,null,null,null);g.options.__file="components/lib/bpmNumber/src/part/reader.vue";var y=g.exports,b={name:"BpmNumber",components:{editorComponent:f,readerComponent:y},props:{value:{type:[String,Number]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?y:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},v=(0,u.A)(b,a,[],!1,null,null,null);v.options.__file="components/lib/bpmNumber/src/main.vue";var w=v.exports;w.install=function(e){e.component(w.name,w)};var M=w},5540:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-rich-text"},["table"==e.uiType?n("i",{staticClass:"el-icon-notebook-2",class:{active:e.curVal},on:{click:function(t){t.stopPropagation(),e.dialogVisible=!0}}}):n("el-tiptap",{attrs:{extensions:e.extensions,showMenubar:!e.readonly,readonly:e.readonly,placeholder:e.fieldConf.name},on:{onBlur:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}}),e._v(" "),"table"==e.uiType&&e.dialogVisible?n("el-dialog",{attrs:{title:e.fieldConf.name,visible:e.dialogVisible,width:"50%","before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-tiptap",{attrs:{extensions:e.extensions,showMenubar:!e.readonly,readonly:e.readonly,placeholder:e.fieldConf.name},on:{onBlur:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1):e._e()],1)};a._withStripped=!0;var i=n(5554),r=n.n(i),o=n(3533),s=n(5072),l=n.n(s),d=n(7825),c=n.n(d),u=n(7659),m=n.n(u),f=n(5056),h=n.n(f),p=n(540),_=n.n(p),g=n(1113),y=n.n(g),b=n(2419),v={};v.styleTagTransform=y(),v.setAttributes=h(),v.insert=m().bind(null,"head"),v.domAPI=c(),v.insertStyleElement=_(),l()(b.A,v),b.A&&b.A.locals&&b.A.locals,r().use(o.ElementTiptapPlugin,{lang:"en",spellcheck:!0});var w={name:"BpmRichText",components:{"el-tiptap":o.ElementTiptap},props:{value:String,fieldConf:Object,mode:String,uiType:String},data(){return{curVal:"",extensions:[new o.Doc,new o.Text,new o.Paragraph,new o.Heading({level:5}),new o.Bold,new o.Underline({bubble:!0,menubar:!1}),new o.Italic,new o.Strike({bubble:!0,menubar:!1}),new o.Link,new o.Blockquote,new o.Table,new o.TableHeader,new o.TableCell,new o.TableRow,new o.ListItem,new o.BulletList,new o.OrderedList,new o.TodoList,new o.TodoItem,new o.TextAlign,new o.Indent,new o.LineHeight,new o.TextColor,new o.TextHighlight,new o.FontType,new o.FontSize,new o.SelectAll,new o.FormatClear,new o.History,new o.Fullscreen],dialogVisible:!1}},computed:{readonly(){return"view"===this.mode}},watch:{value:{handler(e){this.curVal=e},immediate:!0}},methods:{handleClose(){this.dialogVisible=!1},handleChange(e){console.log(e),console.log("this.curVal: ",this.curVal),this.$emit("input",this.curVal),this.$emit("change",this.curVal)}},mounted(){}},M=(0,n(4486).A)(w,a,[],!1,null,null,null);M.options.__file="components/lib/bpmRichText/src/main.vue";var L=M.exports;L.install=function(e){e.component(L.name,L)};var k=L},2865:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select",attrs:{fieldConf:e.fieldConf,row:e.row,isMultiple:e.isMultiple,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-select-edit"},[e.isRadiosStyle?[e.isMultiple?[n("el-checkbox-group",e._g(e._b({on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-checkbox-group",e.$attrs,!1),e.$listeners),e._l(e.options,(function(t){return n("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)]:[n("el-radio-group",e._g(e._b({on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-radio-group",e.$attrs,!1),e.$listeners),e._l(e.options,(function(t){return n("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)]]:e.isButtonStyle?[e.isMultiple?[n("el-checkbox-group",e._g(e._b({on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-checkbox-group",e.$attrs,!1),e.$listeners),e._l(e.options,(function(t){return n("el-checkbox-button",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)]:[n("el-radio-group",e._g(e._b({on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-radio-group",e.$attrs,!1),e.$listeners),e._l(e.options,(function(t){return n("el-radio-button",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)]]:[n("el-select",e._g(e._b({attrs:{placeholder:e.placeholder,multiple:e.isMultiple,clearable:"",filterable:""},on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-select",e.$attrs,!1),e.$listeners),e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)]],2)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642);l().use(d.Select),l().use(d.Option);var c={components:{},props:["value","fieldConf","row","isMultiple"],data(){return{curVal:""}},watch:{value(){this.curVal=this.value?this.value:this.isMultiple?[]:""}},computed:{options(){let e=o().get(this.fieldConf,"range_enum");return o().map(e,(e=>({value:o().get(e,"0"),label:o().get(e,"1"),color:o().get(e,"2")})))},placeholder(){return this.fieldConf.desc||this.fieldConf.name},isRadiosStyle(){return"default"==o().get(this.fieldConf,"style")},isButtonStyle(){return"button"==o().get(this.fieldConf,"style")}},created(){this.curVal=this.isMultiple?[]:""},mounted(){this.curVal=this.value?this.value:this.isMultiple?[]:""},methods:{onChange(e){this.$emit("input",e),this.$emit("change",e)}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmSelect/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isStatus&&e.rangeEnumMap[e.value]?n("span",{staticClass:"bpm-status_tag-status",style:{background:e.colorMap[e.value]}},[e._v(e._s(e.rangeEnumMap[e.value]))]):e.isStatus?n("span",{attrs:{title:e.label}}):e.isButton&&e.value?n("span",{staticClass:"bpm-btn-select",style:{color:e.colorMap[e.value],background:e.colorMap[e.value]+"3d"},attrs:{title:e.label}},[e._v(e._s(e.label))]):n("span",[e.labels&&e.labels.length>1?e._l(e.labels,(function(t){return n("el-tag",{key:t,staticStyle:{"margin-right":"8px"}},[e._v("\n "+e._s(t)+"\n ")])})):[e._v("\n "+e._s(e.label)+"\n ")]],2)};h._withStripped=!0;var p={props:["type","value","fieldConf","row"],data(){return{colorMap:{}}},computed:{_value(){return o().isArray(this.value)?this.value:[this.value]},rangeEnumMap(){let e=o().get(this.fieldConf,"range_enum"),t={};return o().each(e,(e=>{o().set(t,o().get(e,"0"),o().get(e,"1"))})),this.setColorMap(),t},labels(){return o().isArray(this.value)?o().map(this._value,(e=>o().get(this.rangeEnumMap,e))):[o().get(this.rangeEnumMap,this.value,zj.z("未指定","b2.common.not_specified"))]},label(){return o().isArray(this.value)?o().map(this._value,(e=>o().get(this.rangeEnumMap,e))).join(","):o().get(this.rangeEnumMap,this.value,zj.z("未指定","b2.common.not_specified"))},isButton(){return"button"==o().get(this.fieldConf,"style")},isStatus(){return"Status"===this.type||"Status"===this.fieldConf.type}},methods:{setColorMap(){let e=o().get(this.fieldConf,"range_enum");this.colorMap={},o().each(e,(e=>{o().set(this.colorMap,o().get(e,"0"),o().get(e,"2"))}))}}},_=(0,u.A)(p,h,[],!1,null,null,null);_.options.__file="components/lib/bpmSelect/src/part/reader.vue";var g=_.exports,y={name:"BpmSelect",components:{editorComponent:f,readerComponent:g},props:{value:{type:[String,Array,Number]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}},isMultiple:{type:Boolean,default(){return!1}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?g:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},b=(0,u.A)(y,a,[],!1,null,null,null);b.options.__file="components/lib/bpmSelect/src/main.vue";var v=b.exports;v.install=function(e){e.component(v.name,v)};var w=v},8668:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return F}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-check-item",attrs:{fieldConf:e.fieldConf,row:e.row,orgInfo:e.orgInfo,formName:e.formName,mode:e.mode,isMultiple:e.multiple,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-select",{staticStyle:{width:"100%"},attrs:{"popper-class":"bpm-select-tree",multiple:e.isMultiple,placeholder:e.placeholder,"multiple-limit":e.maxCount},on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},[e._l(e.defaultOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),e._v(" "),n("el-tree",{attrs:{lazy:"",load:e.loadNode,"node-key":"value",props:{label:"treeLabel",children:"children",disabled:"disabled",isLeaf:"isLeaf"},indent:16},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return a.data.disabled?n("span",{},[e._v("\n "+e._s(a.label)+"\n ")]):n("el-option",{staticClass:"tree-options",attrs:{value:a.data.value,label:a.data.label}},[n("span",{staticStyle:{"padding-right":"30px","max-width":"500px",overflow:"hidden"}},[e._v("\n "+e._s(a.label)+"\n ")])])}}],null,!0)})],2)],1)};i._withStripped=!0;var r=n(5281),o=n(5554),s=n.n(o),l=n(6773),d=n.n(l),c=n(7642);s().use(c.Tree),s().use(c.Select),s().use(c.Option);var u={props:["value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],data(){return{curVal:"",defaultOptions:[]}},watch:{value(){this.curVal=this.value?this.value:this.isMultiple?[]:"",this.getDefaultOptions()}},computed:{placeholder(){return this.fieldConf.desc||this.fieldConf.name},maxCount(){return d().get(this.fieldConf,"check.max_count")},tickStrategy(){return"leaf_only"==d().get(this.fieldConf,"tree_select","all")?"leaf-filtered":"strict"},leafOnly(){return"leaf_only"===this.fieldConf.tree_select}},created(){this.curVal=this.isMultiple?[]:""},mounted(){this.curVal=this.value?this.value:this.isMultiple?[]:""},methods:{async loadNode(e,t){let n=d().get(this.fieldConf,"id"),a={father:0===e.level?"":e.data.value||""},i=await r.A.assistTreeField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm},a),o=d().get(i.data,"data.data",[]);t(this.transformResultToTree(o,e))},transformResultToTree(e,t){let n=d().get(this.fieldConf,"type");return"SelectCheckItem"==n||"MulSelectCheckItem"==n?d().map(e,(e=>{this.isMultiple||e[0]!==this.curVal||(this.defaultOptions=[]),this.isMultiple&&this.curVal.includes(e[0])&&(this.defaultOptions=d().filter(this.defaultOptions,(t=>t.value!==e[0])));let n=0===t.level?e[1]:t.data.label+" - "+e[1],a=!e[2];return{value:e[0],lazy:e[2],label:n,treeLabel:e[1],isLeaf:a,disabled:this.leafOnly&&!a}})):"SelectSort"==n||"MulSelectSort"==n?d().map(e,(e=>{this.isMultiple||e.value!==this.curVal||(this.defaultOptions=[]),this.isMultiple&&this.curVal.includes(e.value)&&(this.defaultOptions=d().filter(this.defaultOptions,(t=>t.value!==e.value)));let n=0===t.level?e.label:t.data.label+" - "+e.label,a=!e.lazy;return{value:e.value,lazy:e.lazy,label:n,treeLabel:e.label,isLeaf:a,disabled:this.leafOnly&&!a}})):void 0},async getDefaultOptions(){let e=d().isArray(this.curVal)?this.curVal:this.curVal?[this.curVal]:[];if(!e.length)return;const t=await r.A.assistField.getTitle(this.$bpm,{formDefId:this.formDefId,fieldDefId:this.fieldConf.id,orgInfo:this.orgInfo,isDm:this.dm},e);console.log(t);const n=d().get(t.data,"data.data",{});let a=d().map(n,((e,t)=>({value:t,label:e})));console.log("default options: ",a),this.defaultOptions=a},onChange(e){this.$emit("input",e),this.$emit("change",e)}}},m=n(4486),f=(0,m.A)(u,i,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectCheckItem/src/part/editor.vue";var h=f.exports,p={mixins:[n(7348).A]},_=(0,m.A)(p,void 0,void 0,!1,null,null,null);_.options.__file="components/lib/bpmSelectCheckItem/src/part/reader.vue";var g=_.exports,y={name:"BpmSelectCheckItem",components:{editorComponent:h,readerComponent:g},props:{value:{type:[String,Array]},type:{type:String,default:"SelectCheckItem"},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?g:h},multiple(){return this.isMultiple||0===this.type.indexOf("Mul")}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},b=n(5072),v=n.n(b),w=n(7825),M=n.n(w),L=n(7659),k=n.n(L),S=n(5056),D=n.n(S),x=n(540),Y=n.n(x),T=n(1113),C=n.n(T),j=n(347),$={};$.styleTagTransform=C(),$.setAttributes=D(),$.insert=k().bind(null,"head"),$.domAPI=M(),$.insertStyleElement=Y(),v()(j.A,$),j.A&&j.A.locals&&j.A.locals;var P=(0,m.A)(y,a,[],!1,null,null,null);P.options.__file="components/lib/bpmSelectCheckItem/src/main.vue";var I=P.exports;I.install=function(e){e.component(I.name,I)};var F=I},2179:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return u}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["view"===e.mode?n("div",{staticStyle:{display:"flex","max-width":"360px",cursor:"pointer"},attrs:{title:e.value},on:{click:e.openOptionsModal}},[n("span",{staticStyle:{flex:"1"}},[e._v("\n "+e._s(e.label||"--")+"\n ")]),e._v(" "),n("i",{staticClass:"fa fa-angle-right",attrs:{"aria-hidden":"true"}})]):n("div",{staticStyle:{display:"flex","max-width":"360px",cursor:"pointer"},attrs:{title:e.value},on:{click:e.openOptionsModal}},[n("span",{staticStyle:{flex:"1"}},[e._v("\n "+e._s(e.label||(e.loading?""+e.$z("加载中","c.loading"):""+e.$z("请选择","c.please_select")+e.fieldConf.name+"(多选)"))+"\n "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"typing_loader"})]),e._v(" "),n("i",{staticClass:"fa fa-angle-right",attrs:{"aria-hidden":"true"}})]),e._v(" "),n("el-dialog",{attrs:{title:e.fieldConf.name,visible:e.optionsModalShow,width:"50%",top:"10vh","custom-class":"bpm-select-entrance-form"},on:{"update:visible":function(t){e.optionsModalShow=t},close:e.handleClose}},[n("div",{staticClass:"main-wrap",style:{maxHeight:"70vh",overflow:"auto"}},["view"===e.mode?e._l(e.items,(function(t){return n("el-card",{key:t.form_id,staticClass:"select-option-card",attrs:{shadow:"hover","body-style":{padding:"10px 20px"}}},[n("div",{attrs:{slot:"header"},slot:"header"},[n("span",[e._v(e._s(t.title))])]),e._v(" "),n("div",{staticClass:"card-body-content"},[n("div",[n("span",{staticClass:"bpm-status_tag-status",style:{background:e.getStatus(t.f_fields[e.statusField.id],"color")}},[e._v(e._s(e.getStatus(t.f_fields[e.statusField.id],"label")))])]),e._v(" "),e._l(e.descFields,(function(a){return n("div",{key:a.id},[n("label",{staticClass:"label"},[e._v(e._s(a.name))]),e._v(" "),n("span",[e._v(e._s(t.f_fields[a.id]))])])}))],2)])})):[n("div",{staticClass:"search-wrap"},[e.enableSearchText?n("el-input",{attrs:{placeholder:e.$z("搜索","c.search_tip")},on:{input:e.debounceSearch},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}},[n("i",{staticClass:"el-input__icon el-icon-search",staticStyle:{cursor:"pointer"},attrs:{slot:"suffix"},on:{click:e.debounceSearch},slot:"suffix"})]):e._e(),e._v(" "),n("el-button",{staticStyle:{"margin-left":"10px"},on:{click:function(t){e.filterModalShow=!0}}},[n("i",{staticClass:"fa fa-filter",attrs:{"aria-hidden":"true"}})])],1),e._v(" "),n("ul",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:e.loadMore,expression:"loadMore"}],staticClass:"edit-list"},[n("el-checkbox-group",{model:{value:e.selectedVals,callback:function(t){e.selectedVals=t},expression:"selectedVals"}},e._l(e.items,(function(t){return n("li",{key:t.form_id,staticClass:"edit-list-item"},[n("el-checkbox",{staticClass:"checkbox",attrs:{label:t.id}},[e._v(e._s())]),e._v(" "),n("el-card",{key:t.form_id,staticClass:"select-option-card",attrs:{shadow:"hover","body-style":{padding:"10px 20px"}}},[n("div",{attrs:{slot:"header"},slot:"header"},[n("span",[e._v(e._s(t.title))])]),e._v(" "),n("div",{staticClass:"card-body-content"},[n("div",[n("span",{staticClass:"bpm-status_tag-status",style:{background:e.getStatus(t.f_fields[e.statusField.id],"color")}},[e._v(e._s(e.getStatus(t.f_fields[e.statusField.id],"label")))])]),e._v(" "),e._l(e.descFields,(function(a){return n("div",{key:a.id},[n("label",{staticClass:"label"},[e._v(e._s(a.name))]),e._v(" "),n("span",[e._v(e._s(t.f_fields[a.id]))])])}))],2)])],1)})),0)],1)],e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.optionsLoading,expression:"optionsLoading"}],staticStyle:{"text-align":"center",margin:"46px auto"}},[n("span",{staticClass:"typing_loader"})]),e._v(" "),e.optionsLoading||e.items.length?e._e():n("div",[e._v("\n "+e._s(e.$z("暂无记录信息","c.no_record"))+"\n ")])],2),e._v(" "),"edit"===e.mode?n("footer",{staticClass:"footer",attrs:{slot:"footer"},slot:"footer"},[n("div",[n("el-checkbox",{attrs:{label:e.$z("全选","c.select_all")},on:{change:e.handleCheckAll},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}}),e._v(" "),e.selectedLabel?n("span",{staticClass:"subtext"},[e._v(e._s(e.selectedLabel))]):e._e()],1),e._v(" "),n("el-button",{staticClass:"width-button",attrs:{type:"primary",disabled:!e.selectedVals.length},on:{click:e.onSubmit}},[e._v(e._s(e.$z("保存","c.save")))])],1):e._e()]),e._v(" "),n("el-dialog",{attrs:{title:e.$z("数据筛选","b2.common.data_filter"),visible:e.filterModalShow,width:"50%","custom-class":"bpm-select-entrance-form"},on:{"update:visible":function(t){e.filterModalShow=t},close:function(t){e.filterModalShow=!1}}},[n("div",{staticStyle:{"max-height":"70vh",overflow:"auto"}},[n("BpmFieldsFilter",{ref:"searchForm",attrs:{searchSchema:e.searchSchema,verifySchema:e.verifySchema,orgInfo:e.orgInfo,formDefId:e.formSchema.id,showAll:!0,queryExclude:!0},on:{search:e.handleFilterReady}})],1),e._v(" "),n("span",{attrs:{slot:"footer"},slot:"footer"},[n("el-button",{staticClass:"width-button",on:{click:e.handleResetFilter}},[e._v(e._s(e.$z("重置","c.reset")))]),e._v(" "),n("el-button",{staticClass:"width-button",attrs:{type:"primary"},on:{click:e.handleSubmitFilter}},[e._v(e._s(e.$z("查询","c.query")))])],1)])],1)};a._withStripped=!0;var i=n(5281),r=n(9795),o=n(555);const s=["Area","MulArea"];var l={name:"BpmSelectEntranceForm",components:{BpmFieldsFilter:o.A},props:{value:{type:Array,default(){return[]}},type:{type:String,default:"MulSelectEntranceForm"},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"view"},uiType:{type:String,default:"default"},formDefId:{type:String,default:""},orgInfo:{type:Object,default(){return{level:"group",level_id:0,group_id:0}}},formId:{type:String,default:""},dm:{type:Boolean,default(){return!1}},isMultiple:{type:Boolean,default(){return!0}}},data(){return{loading:!1,optionsModalShow:!1,items:[],selectedItems:[],selectedVals:[],optionsLoading:!1,statusField:{},descFields:[],shouldTransLabelKeys:[],formSchema:{},pagination:{action:"first",lastAt:null,total:0},checkAll:!1,filterModalShow:!1,searchSchema:{elements:[]},verifySchema:{},enableSearchText:!0,debounceSearch:_.debounce(_.bind(this.loadData,this),300,{trailing:!0,leading:!1}),keyword:"",filterParams:{}}},computed:{isMobile(){return(0,r.Fr)()},label(){const e=this.value;if(!e||!e.length)return"";let t=zj.z("已选择N条","c.number_is_selected");return _.template(t)({count:e.length})},selectedLabel(){if(!this.selectedVals.length)return"";let e=zj.z("选中N条","c.number_is_selected_2");return _.template(e)({count:this.selectedVals.length})}},methods:{getStatus(e,t){return((this.statusField.rangeEnumMap||{})[e]||{})[t]},async openOptionsModal(){this.optionsModalShow=!0,this.formSchema.id||await this.loadSchema(),this.value&&this.value.length&&await this.loadListSelected(),"edit"===this.mode&&(this.pagination.lastAt||(this.handleResetFilter(),this.loadData()),this.selectedVals=this.value||[])},handleClose(){this.optionsModalShow=!1,"edit"===this.mode&&(this.checkAll=!1,this.selectedVals=[])},handleResetFilter(){this.$refs.searchForm&&this.$refs.searchForm.reset()},handleSubmitFilter(){this.$refs.searchForm&&this.$refs.searchForm.submit()},handleFilterReady(e){this.filterParams=e||{},this.filterModalShow=!1,this.loadData()},handleCheckAll(e){this.selectedVals=e?_.map(this.items,(e=>e.id)):[]},onSubmit(){const e=_.cloneDeep(this.selectedVals);this.$emit("input",e),this.$emit("change",e),this.handleClose()},loadMore(){this.items.length<this.pagination.total&&this.loadData("next")},async loadData(e="first"){let t=this.formDefId;const n=this.fieldConf.id;e=["first","next","last","prev"].includes(e)?e:"first";let a=this.filterParams;this.keyword&&(a.q__contains=this.keyword),this.optionsLoading=!0;const r=(await i.A.assistSelectEntranceForm.getOptions(this.$bpm,{formDefId:t,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm},{action:e,limit:20,last_at:"first"===e?null:this.pagination.lastAt,fields:JSON.stringify(a)})).data.data;console.log("assist_select_entrance_form data: ",r);const o=_.map(r.data,(e=>(_.each(e.f_fields,(async(t,n)=>{if(this.shouldTransLabelKeys.includes(n))if(_.isArray(t)){const a=i.A.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let r=await a.loads(...t);e.f_fields[n]=r.join(zj.z(",","c.comma"))}else{const a=i.A.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let r=await a.load(t);e.f_fields[n]=r}})),{title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:_.map(e.f_fields,((e,t)=>({key:t,value:e})))})));let s=o;if(this.selectedItems.length){let e=_.map(this.selectedItems,(e=>e.id));s=_.filter(o,(t=>!e.includes(t.id)))}this.items="next"===e?_.concat(this.items,s):_.concat(this.selectedItems,s),this.pagination.action=e,this.pagination.lastAt=r.last_at,this.pagination.total=r.count,this.optionsLoading=!1},async loadListSelected(){let e=this.formId;e=encodeURIComponent(e);let t=this.formDefId;const n=this.fieldConf.id;this.optionsLoading=!0;try{const a=(await i.A.assistSelectEntranceForm.getListSelected(this.$bpm,{formDefId:t,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm},{form_id:e})).data.data;console.log("assist_select_entrance_form list_selected: ",a);const r=_.map(a.data,(e=>(_.each(e.f_fields,(async(t,n)=>{if(this.shouldTransLabelKeys.includes(n))if(_.isArray(t)){const a=i.A.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let r=await a.loads(...t);e.f_fields[n]=r.join(zj.z(",","c.comma"))}else{const a=i.A.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let r=await a.load(t);e.f_fields[n]=r}})),{title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:_.map(e.f_fields,((e,t)=>({key:t,value:e})))})));this.selectedItems=r,"view"===this.mode&&(this.items=r)}finally{this.optionsLoading=!1}},async loadSchema(){let e=this.formDefId;const t=this.fieldConf.id,n=(await i.A.assistSelectEntranceForm.getListDefinition(this.$bpm,{formDefId:e,fieldDefId:t,orgInfo:this.orgInfo,isDm:this.dm})).data.data;console.log("assist_select_entrance_form definition: ",n);let a={},r=[],o=[];_.each(n.definition.form.elements,(e=>{if("Status"!==e.type)r.push({id:e.id,name:e.name,value_type:e.value_type,type:e.type});else{let t={};e.range_enum.forEach((e=>{t[e[0]]={value:e[0],label:e[1],color:e[2]}})),a={id:e.id,name:e.name,value_type:e.value_type,type:e.type,rangeEnumMap:t}}(s.includes(e.type)||e.type.indexOf("Select")>-1)&&o.push(e.id)})),this.descFields=r,this.statusField=a,this.shouldTransLabelKeys=o,this.formSchema=n.definition.form,this.searchSchema=_.get(n,"definition.search",{elements:[]}),this.verifySchema=_.get(n,"schema.search",{});const l=!!this.searchSchema.elements&&_.find(this.searchSchema.elements,{id:"q__contains"});this.enableSearchText=this.searchSchema.enable_search_text&&l}}},d=(0,n(4486).A)(l,a,[],!1,null,null,null);d.options.__file="components/lib/bpmSelectEntranceForm/src/main.vue";var c=d.exports;c.install=function(e){e.component(c.name,c)};var u=c},9674:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-select-form-field",attrs:{type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.mode,orgInfo:e.orgInfo,formName:e.formName,uiType:e.uiType,isMultiple:e.multiple,allowCreate:e.allowCreate,allowRemote:e.allowRemote},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-select-edit",staticStyle:{display:"flex"}},[e.showUnit?n("select-unit",{attrs:{fieldConf:e.fieldConf,formDefId:e.formDefId,orgInfo:e.orgInfo},on:{change:e.handleUnitChange}}):e._e(),e._v(" "),n("el-select",e._g(e._b({key:e.isMultiple?"two":"one",staticStyle:{flex:"1"},attrs:{placeholder:e.placeholder,multiple:e.isMultiple,clearable:"",filterable:"",remote:"","allow-create":e.allowCreate,"remote-method":!!e.allowRemote&&e.remoteMethod},on:{change:e.onChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-select",e.$attrs,!1),e.$listeners),e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(7642),l=n(5281),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",{attrs:{placeholder:e.$z("单位选择","b2.common.unit_selection"),filterable:"",remote:""},on:{"remote-method":e.remoteMethod,change:e.handleUnitChange},model:{value:e.selectedTeam,callback:function(t){e.selectedTeam=t},expression:"selectedTeam"}},e._l(e.teams,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)};d._withStripped=!0;var c={name:"SelectUnit",props:["fieldConf","orgInfo","formDefId"],data(){return{selectedTeam:"",teams:[],teamMap:{},teamKeyword:"",debounceSearchTeams:_.debounce(_.bind(this.loadTeams,this),150,{trailing:!0,leading:!1})}},mounted(){this.loadTeams()},methods:{handleUnitChange(){this.$emit("change",this.selectedTeam)},async loadTeams(){let e=_.get(this.orgInfo,"page_level"),t=_.get(this.orgInfo,`${e}_id`);this.teams=await this.$bpm.searchTeamSelectOpts(this.fieldConf.id,{keyword:this.teamKeyword,[`${e}_id`]:t},this.formDefId),this.teamMap=_.keyBy(this.teams,"value")},remoteMethod(e){this.teamKeyword=e||"",this.debounceSearchTeams()}}},u=n(4486),m=(0,u.A)(c,d,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectFromField/src/part/select-unit.vue";var f=m.exports;o().use(s.Select),o().use(s.Option);var h={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple","allowCreate","allowRemote"],components:{SelectUnit:f},data(){return{curVal:"",options:[],keyword:"",unit:{search_type:"",org_id:""}}},watch:{value(){this.curVal=this.value},getSelectOptions:function(e){console.log("----selectOptions----",e),this.transformOptions(e,!0)}},inject:["selectOptions"],computed:{placeholder(){return this.fieldConf.desc||this.fieldConf.name},getSelectOptions(){return this.selectOptions?this.selectOptions():[]},showUnit(){return"SelectURUser"===this.type||"MulSelectURUser"===this.type}},created(){this.curVal=this.isMultiple?[]:""},mounted(){(this.fieldConf.perm||{visible:!0}).visible&&(console.log("mounted getting options"),this.loadSelectOpts()),this.curVal=this.value},methods:{handleUnitChange(e){let t=_.split(e,"$"),n=_.get(t,"0"),a=_.get(t,"1");this.unit={search_type:n,org_id:a},this.loadSelectOpts("",JSON.stringify(this.unit))},remoteMethod(e){let t="";this.showUnit&&this.unit.search_type&&(t=JSON.stringify(this.unit)),this.loadSelectOpts(e,t)},_setSelectItem(e){if(console.log("this.fieldConf",this.fieldConf),this.fieldConf.default&&"Default"==this.fieldConf.default.type&&"EVCFirstElem"==this.fieldConf.default.value.type&&(e&&e.length?(console.log("_setSelectItem_options",e),this.isMultiple?this.curVal=[e[0].value]:this.curVal=e[0].value):this.isMultiple?this.curVal=[]:this.curVal="",console.log("this.curVal",this.curVal),this.$emit("input",this.curVal),this.$emit("change",this.curVal)),this.isMultiple&&this.fieldConf.default&&"Default"==this.fieldConf.default.type&&"EVCAllElem"==this.fieldConf.default.value.type){let t=[];_.each(e,(e=>{t.push(e.value)})),this.curVal=t}this.$emit("input",this.curVal),this.$emit("change",this.curVal)},async loadSelectOpts(e="",t=""){let n,a=this.fieldConf.id,i={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){console.log("UserTaskCC is getting options");const e=this.fieldConf.node;n=await l.A.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},i)}else n=await l.A.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:a,orgInfo:this.orgInfo,isDm:this.dm},i);const r=_.get(n.data,"data.data",[]);return this.transformOptions(r,!1)},transformOptions(e,t=!0){console.log("transformOptions origin: ",e);let n=_.map(e,(e=>({value:e[0],label:e[1]})));return n=_.sortBy(n,["label"]),this.options=n,(this.options.length>0||t)&&this._setSelectItem(this.options),console.log("options: ",n),n},onChange(e){this.$emit("input",e),this.$emit("change",e)}}},p=(0,u.A)(h,i,[],!1,null,null,null);p.options.__file="components/lib/bpmSelectFromField/src/part/editor.vue";var g=p.exports,y={mixins:[n(7348).A]},b=(0,u.A)(y,void 0,void 0,!1,null,null,null);b.options.__file="components/lib/bpmSelectFromField/src/part/reader.vue";var v=b.exports,w={name:"BpmSelectFromField",components:{editorComponent:g,readerComponent:v},props:{value:{type:[Array,Number,String]},type:{type:String,default:"SelectFromField"},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?v:g},multiple(){let e=this.isMultiple||0===this.type.indexOf("Mul");return"UserTaskCC"===this.type&&this.fieldConf.selecter&&(e=0===(this.fieldConf.selecter.type||"MulSelectUser4CC").indexOf("Mul")),e},allowCreate(){return!(!this.fieldConf.range_remote||"add"!=this.fieldConf.range_remote.enable_add_item)},allowRemote(){return!(!this.fieldConf.range_remote||!this.fieldConf.range_remote.enable_remote_search)}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},M=(0,u.A)(w,a,[],!1,null,null,null);M.options.__file="components/lib/bpmSelectFromField/src/main.vue";var L=M.exports;L.install=function(e){e.component(L.name,L)};var k=L},1567:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return F}});var a=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},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=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:e.$z("只展示前100条数据,通过搜索获取更多","b2.common.see_100_data")},on:{input:e.throttleSearch},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",{on:{change:e.onSubmit},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(" "),e.isMultiple?n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1):e._e()],1)],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(6773),l=n.n(s),d=n(7642);o().use(d.Dialog);var c={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],inject:["getSelectFields","selectOptions"],data(){return{curVal:"",label:zj.z("未选择","c.not_selected"),keyword:"",opened:!1,throttleSearch:l().throttle(l().bind(this.search,this),1500,{trailing:!0,leading:!1}),formList:[]}},watch:{value(e){console.log("select_from_form_val",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),this.formList&&this.formList.length?(console.log("this.formList",this.formList),this.isMultiple?this.curVal=[this.formList[0].id]:this.curVal=this.formList[0].id):this.isMultiple?this.curVal=[]:this.curVal="",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 a=this.orgInfo;let i=this.getSelectFields();i&&"{}"!==JSON.stringify(i)&&(a.fields=i);let r=await this.$bpm.searchSelectOpts(n,e,t,this,!1,a),o=this.transformOptions(r);this.formList=o},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");console.log("values",e),l().isEmpty(e)?this.label=zj.z("未选择","c.not_selected"):(e=l().isArray(e)?e:[e],this.label=await this.$bpm.fetchLabelByValues(e,t,this.formName,this.row))}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectFromForm/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["show_ref"==e.mode?n("div",e._l(e.items,(function(t){return n("el-tag",{key:t,attrs:{type:"info"}},[e._v(e._s(t))])})),1):n("span",{attrs:{title:e.label}},[e._v(e._s(e.label))])])};h._withStripped=!0;var p={props:["value","fieldConf","row","formName","orgInfo"],data(){return{mode:"normal",label:"",items:[]}},watch:{value(){this.loadRemoteLabel()}},mounted(){this.loadRemoteLabel()},methods:{async loadRemoteLabel(){let e=this.value;if(l().isNil(e)||!e)return this.label=zj.z("未选择","c.not_selected");try{if(l().isObject(e))try{e=JSON.parse(e)}catch(e){console.log("error",e)}let t=l().isArray(e)?e:[e],n=l().get(this.fieldConf,"id");l().isEmpty(t)?this.label=zj.z("未选择","c.not_selected"):(t=l().isArray(t)?t:[t],"show_ref"==this.mode?this.items=t:this.label=await this.$bpm.fetchLabelByValues(t,n,this.formName,this.row))}finally{console.log("finally")}}}},_=(0,u.A)(p,h,[],!1,null,null,null);_.options.__file="components/lib/bpmSelectFromForm/src/part/reader.vue";var g=_.exports,y={name:"bpmSelectFromForm",components:{editorComponent:f,readerComponent:g},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?g:f}},watch:{value(){console.log("selectFormForm_value",this.value),this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},b=n(5072),v=n.n(b),w=n(7825),M=n.n(w),L=n(7659),k=n.n(L),S=n(5056),D=n.n(S),x=n(540),Y=n.n(x),T=n(1113),C=n.n(T),j=n(5726),$={};$.styleTagTransform=C(),$.setAttributes=D(),$.insert=k().bind(null,"head"),$.domAPI=M(),$.insertStyleElement=Y(),v()(j.A,$),j.A&&j.A.locals&&j.A.locals;var P=(0,u.A)(y,a,[],!1,null,null,null);P.options.__file="components/lib/bpmSelectFromForm/src/main.vue";var I=P.exports;I.install=function(e){e.component(I.name,I)};var F=I},2549:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-from-id",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType,orgInfo:e.orgInfo,formName:e.formName,isMultiple:e.isMultiple},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-from-id-editor"},[n("div",[n("div",{on:{click:e.toOpen}},[e._v(e._s(e.label))])]),e._v(" "),n("el-dialog",e._g(e._b({attrs:{visible:e.opened,"before-close":e.onHide,title:e.fieldConf.name,fullscreen:!0,"custom-class":"select-from-id-editor-dialog"},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},"el-dialog",e.$attrs,!1),e.$listeners),[n("div",{attrs:{slot:"title"},slot:"title"},[n("div",[e._v("\n "+e._s(e.$z("已选名单","b2.common.selected_list"))+":\n "),e._l(e.selectedLabels,(function(t,a){return n("el-tag",{directives:[{name:"show",rawName:"v-show",value:a<=5,expression:"index <= 5"}],key:a,attrs:{type:"success"}},[e._v(e._s(t)+"\n "),n("i",{staticClass:"fa fa-times-circle",on:{click:function(t){return e.deleteSelected(a)}}})])})),e._v(" "),e.selectedLabels.length>5?n("el-button",{attrs:{label:""+(e.$z("查看全部","c.view_all")+e.selectedLabels.length)}},[n("i",{staticClass:"fa fa-sort-desc",attrs:{"aria-hidden":"true"}}),e._v(" "),n("el-popover",[n("div",{attrs:{separator:"",link:""}},e._l(e.selectedLabels,(function(t,a){return n("div",{key:a},[e._v("\n "+e._s(t)+"\n "),n("i",{staticClass:"fa fa-times",staticStyle:{float:"right","margin-left":"8px","font-size":"20px"},on:{click:function(t){return e.deleteSelected(a)}}})])})),0)])],1):e._e()],2)]),e._v(" "),n("div",{staticClass:"select-box"},[n("div",{staticClass:"select-box-left"},[n("div",{staticClass:"title"},[e._v(e._s(e.$z("选择应用","b2.common.select_form_id")))]),e._v(" "),n("div",[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:e.$z("请输入关键字搜索","c.search_tip"),clearale:!0},on:{change:e.debounceSearchApps},model:{value:e.appKeyword,callback:function(t){e.appKeyword=t},expression:"appKeyword"}})],1),e._v(" "),n("ul",{staticClass:"select-app"},e._l(e.apps,(function(t){return n("li",{key:t.value,staticClass:"select-app-item",class:t.value==e.selectedApp?"active":"",on:{click:function(n){return e.loadForms(t.value)}}},[e._v("\n "+e._s(t.label)+"\n ")])})),0)]),e._v(" "),e.selectedApp?n("div",{staticClass:"select-box-right"},[n("div",{staticClass:"title"},[e._v(e._s(e.$z("表单选择","c.form_select")))]),e._v(" "),n("div",[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:e.$z("请输入关键字搜索","c.search_tip"),clearale:!0},on:{change:e.debounceSearch},model:{value:e.formKeyword,callback:function(t){e.formKeyword=t},expression:"formKeyword"}})],1),e._v(" "),n("ul",{staticClass:"select-form"},e._l(e.formList,(function(t){return n("li",{key:t.value,staticClass:"select-form-item"},[e.isMultiple?n("el-checkbox",{attrs:{label:t.value},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},[e._v(e._s(t.label))]):n("el-radio",{attrs:{label:t.value},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},[e._v(e._s(t.label))])],1)})),0)]):n("div",{staticClass:"select-box-right"},[e._v("\n "+e._s(e.$z("先选择表单","b2.common.select_form_first"))+"\n ")])]),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1)])],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(6773),l=n.n(s),d=n(7642);o().use(d.Dialog);var c={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],data(){return{curVal:[],apps:[],label:"",opened:!1,debounceSearchApps:l().debounce(l().bind(this.loadApps,this),150,{trailing:!0,leading:!1}),debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),selectedLabels:[],formList:[],appKeyword:"",selectedApp:"",formKeyword:""}},watch:{curVal(){this.loadSelectedLabels()},value(){this.loadRemoteLabel(),this.curVal=this.value?this.value:this.isMultiple?[]:""}},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(){this.curVal=this.isMultiple?[]:""},mounted(){this.curVal=this.value?this.value:this.isMultiple?[]:"",this.loadRemoteLabel()},methods:{async loadApps(){let e=this.appKeyword,t=this.formName,n=l().get(this.fieldConf,"id"),a=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/select_form_id/${t}/${n}/search_left_title/?q=${e}`,params:this.orgInfo});this.apps=l().map(a.data,(e=>({value:e[0],label:e[1]})))},async search(){let e=this.formKeyword,t=this.formName,n=l().get(this.fieldConf,"id"),a=this.selectedApp,i=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/select_form_id/${t}/${n}/search_right_title/?q=${e}&left=${a}`,params:this.orgInfo});this.formList=l().map(i.data,(e=>({value:e[0],label:e[1]})))},loadForms(e){this.selectedApp=e,this.debounceSearch()},async loadSelectedLabels(){let e=this.curVal,t=l().get(this.fieldConf,"id");if(!l().isEmpty(e)){let n=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/${this.formName}/${t}/list_title/?values=${e}`,params:this.orgInfo});this.selectedLabels=l().cloneDeep(n)}},async loadRemoteLabel(){let e=this.value,t=l().get(this.fieldConf,"id");if(l().isEmpty(e))this.label=zj.z("未选择","c.not_selected");else{let n=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/${this.formName}/${t}/list_title/?values=${e}`,params:this.orgInfo}),a=l().map(n.data);this.label=l().join(a,",")}},onHide(){this.opened=!1},onOpen(){this.loadApps()},isChecked(e){return l().includes(this.curVal,e)},onSubmit(){this.$emit("input",this.curVal),this.$emit("change",this.curVal),this.opened=!1},toOpen(){this.opened=!0},deleteSelected(e){let t=this.curVal;l().pullAt(t,e),this.curVal=l().cloneDeep(t)}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectFromId/src/part/editor.vue";var f=m.exports,h={mixins:[n(7348).A]},p=(0,u.A)(h,void 0,void 0,!1,null,null,null);p.options.__file="components/lib/bpmSelectFromId/src/part/reader.vue";var _=p.exports,g={name:"bpmSelectFromId",components:{editorComponent:f,readerComponent:_},props:{value:{type:[String,Array]},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?_:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},y=n(5072),b=n.n(y),v=n(7825),w=n.n(v),M=n(7659),L=n.n(M),k=n(5056),S=n.n(k),D=n(540),x=n.n(D),Y=n(1113),T=n.n(Y),C=n(1243),j={};j.styleTagTransform=T(),j.setAttributes=S(),j.insert=L().bind(null,"head"),j.domAPI=w(),j.insertStyleElement=x(),b()(C.A,j),C.A&&C.A.locals&&C.A.locals;var $=(0,u.A)(g,a,[],!1,null,null,null);$.options.__file="components/lib/bpmSelectFromId/src/main.vue";var P=$.exports;P.install=function(e){e.component(P.name,P)};var I=P},6170:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var a=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:!0},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=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}},[e.formLabels.length?n("ul",{staticStyle:{"list-style":"none"}},e._l(e.formLabels,(function(t){return n("li",{key:t.form_id},[n("span",[e._v(e._s(t.form_title)+": ")]),e._v(" "),n("span",[e._v(e._s(t.label))])])})),0):n("div",{staticClass:"fake-trigger"},[e._v(e._s(e.$z("未选择","c.not_selected")))])]),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:e.$z("只展示前100条数据,通过搜索获取更多","b2.common.see_100_data")},on:{input:e.throttleSearch},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),e._v(" "),n("el-tabs",{staticStyle:{"margin-top":"20px"},attrs:{type:"card","tab-position":"top"},on:{"tab-click":e.hanldeTabClick}},e._l(e.rangeRemote,(function(t,a){return n("el-tab-pane",{key:t.form+a,attrs:{label:e.optionListArr[a]&&e.optionListArr[a].form_title||"表单"+a,name:t.form+a}},[e.optionListArr[a]&&e.optionListArr[a].options.length?n("div",{staticClass:"bpm-select-from-form-box"},[n("el-checkbox-group",{on:{change:e.handleChange},model:{value:e.curVal[a].form_ids,callback:function(t){e.$set(e.curVal[a],"form_ids",t)},expression:"curVal[index].form_ids"}},e._l(e.optionListArr[a].options,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.getTitleStyle(a)},[n("el-checkbox",{key:t.id,attrs:{label:t.id,disabled:e.setDisabled(t.id)}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.key,staticClass:"subitem",style:e.geFieldStyle(a,t.key)},[e._v("\n "+e._s(t.name)+": "+e._s(t.value)+"\n ")])}))],2)})),0)],1):n("div",[e._v(e._s(e.$z("暂无数据","c.no_data")))])])})),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(e._s(e.$z("确定","c.confirm")))])],1)],1)],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5281),l={props:["value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],inject:["getSelectFields","selectOptions"],data(){return{curVal:[],label:zj.z("未选择","c.not_selected"),formLabels:[],keyword:"",opened:!1,throttleSearch:o().throttle(o().bind(this.search,this),1500,{trailing:!0,leading:!1}),optionListArr:[],formList:[]}},watch:{value(e){console.log("select_from_form_val",e),this.getCurVal(e),this.loadRemoteLabel()}},computed:{rangeRemote(){return this.fieldConf.range_remote||[]},placeholder(){return this.fieldConf.desc||this.fieldConf.name},maxCount(){return o().get(this.fieldConf,"check.max_count")},allChecked(){let e=[];return this.curVal.forEach((t=>{e.push(...t.form_ids)})),e}},created(){},mounted(){this.getCurVal(this.value),this.loadRemoteLabel()},methods:{getCurVal(e){let t=o().cloneDeep(e);t&&o().isArray(t)&&t.length?this.curVal=t:this.curVal=this.rangeRemote.map((e=>({form_def_id:e.form,form_ids:[]})))},getTitleStyle(e){let t=this.fieldConf.range_remote||[],n=o().get(t[e],"range_display.title");return{fontSize:o().get(n,"size",16)+"px",color:o().get(n,"color","#333")}},geFieldStyle(e,t){let n=this.fieldConf.rangeRemote||[],a=o().get(n[e],"range_display.fields"),i=o().keyBy(a,"field"),r=o().get(i,t);return{fontSize:o().get(r,"size",12)+"px",color:o().get(r,"color","#949494")}},hanldeTabClick(e){console.log(e)},handleChange(e){console.log(e)},setDisabled(e){const t=this.allChecked.length;return!this.allChecked.includes(e)&&t>=this.maxCount},async search(){let e=this.keyword,t=o().get(this.fieldConf,"id");const n={q:e};if(this.getSelectFields){let e=this.getSelectFields();e&&"{}"!==JSON.stringify(e)&&(n.fields=e)}let a=await s.A.assistField.selectFromMulFormSearchOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:t,orgInfo:this.orgInfo,isDm:this.dm},n),i=o().get(a.data,"data.items"),r=this.transformOptions(i);console.log(r),this.optionListArr=r},transformOptions(e){return console.log(e),e.map((e=>{let t=o().get(e,"definition.form.elements",[]),n=o().keyBy(t,"id"),a=o().map(e.data,(e=>({title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:o().map(e.f_fields,((e,t)=>({key:t,name:n[t]&&n[t].name,value:e})))})));return{form_def_id:o().get(e,"definition.form.id"),form_title:o().get(e,"definition.form.name"),options:a}}))},onHide(){this.opened=!1},onOpen(){if(this.getCurVal(this.value),this.selectOptions){let e=this.selectOptions();if(e&&e.length)return void(this.formList=this.transformOptions(e))}this.search()},toOpen(){this.opened=!0},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.allChecked,t=o().get(this.fieldConf,"id");console.log("values",e);const n=s.A.assistField.selectFromMulFormListTitleLoader(this.$bpm,{formDefId:this.formDefId,fieldDefId:t,orgInfo:this.orgInfo,isDm:this.dm}),a=await n.loads(...e),i=o().groupBy(a,"form_def_id");console.log(i);let r=[];Object.keys(i).forEach((e=>{let t=i[e].map((e=>e.label));r.push({form_def_id:i[e][0].form_def_id,form_title:i[e][0].form_title,label:t.join(", ")})})),this.formLabels=r}}},d=n(4486),c=(0,d.A)(l,i,[],!1,null,null,null);c.options.__file="components/lib/bpmSelectFromMulForm/src/part/editor.vue";var u=c.exports,m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.formLabels.length?n("ul",{staticStyle:{"list-style":"none"}},e._l(e.formLabels,(function(t){return n("li",{key:t.form_id},[n("span",[e._v(e._s(t.form_title)+": ")]),e._v(" "),n("span",[e._v(e._s(t.label))])])})),0):n("div",[e._v(e._s(e.$z("未选择","c.not_selected")))])])};m._withStripped=!0;var f={props:["value","fieldConf","row","formDefId","orgInfo","dm"],data(){return{label:"",formLabels:[]}},computed:{allChecked(){let e=[];return this.value.forEach((t=>{e.push(...t.form_ids)})),e}},watch:{value(){this.loadRemoteLabel()}},mounted(){this.loadRemoteLabel()},methods:{async loadRemoteLabel(){let e=this.value;if(o().isNil(e)||!e||!o().isArray(e))return;let t=this.allChecked,n=o().get(this.fieldConf,"id");const a=s.A.assistField.selectFromMulFormListTitleLoader(this.$bpm,{formDefId:this.formDefId,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm}),i=await a.loads(...t),r=o().groupBy(i,"form_def_id");console.log(r);let l=[];Object.keys(r).forEach((e=>{let t=r[e].map((e=>e.label));l.push({form_def_id:r[e][0].form_def_id,form_title:r[e][0].form_title,label:t.join(", ")})})),this.formLabels=l}}},h=(0,d.A)(f,m,[],!1,null,null,null);h.options.__file="components/lib/bpmSelectFromMulForm/src/part/reader.vue";var p=h.exports,g={name:"BpmSelectFromMulForm",components:{editorComponent:u,readerComponent:p},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!0}}},data(){return{curVal:[]}},computed:{curComponent(){return"view"==this.mode?p:u}},watch:{value(e){console.log("SelectFormMulForm_value",this.value),this.curVal=e}},mounted(){this.curVal=this.value},methods:{transValue(e){if(!e||!_.isArray(e))return[];let t=[];return this.val.forEach((e=>{t.push(...e.form_ids)})),t},handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},y=n(5072),b=n.n(y),v=n(7825),w=n.n(v),M=n(7659),L=n.n(M),k=n(5056),S=n.n(k),D=n(540),x=n.n(D),Y=n(1113),T=n.n(Y),C=n(9850),j={};j.styleTagTransform=T(),j.setAttributes=S(),j.insert=L().bind(null,"head"),j.domAPI=w(),j.insertStyleElement=x(),b()(C.A,j),C.A&&C.A.locals&&C.A.locals;var $=(0,d.A)(g,a,[],!1,null,null,null);$.options.__file="components/lib/bpmSelectFromMulForm/src/main.vue";var P=$.exports;P.install=function(e){e.component(P.name,P)};var I=P},4413:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-house-owner",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType,orgInfo:e.orgInfo,formName:e.formName,isMultiple:e.isMultiple},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"house-owner"},[n("el-autocomplete",{staticClass:"bpm-autocomplete",attrs:{"fetch-suggestions":e.querySearch,placeholder:e.placeholder},on:{select:e.handleSelect},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.item;return[n("div",{staticClass:"name"},[e._v(e._s(a.value))]),e._v(" "),n("span",{staticClass:"addr"},[e._v(e._s(a.phone))])]}}]),model:{value:e.curVal.name,callback:function(t){e.$set(e.curVal,"name",t)},expression:"curVal.name"}}),e._v(" "),n("el-input",{staticClass:"bpm-default-input owner-phone",staticStyle:{"margin-top":"10px","user-select":"text"},attrs:{placeholder:e.$z("请输入业主电话","b2.common.select_owner_number")},model:{value:e.curVal.phone,callback:function(t){e.$set(e.curVal,"phone",t)},expression:"curVal.phone"}})],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(6773),l=n.n(s),d=n(7642);o().use(d.Autocomplete);var c={props:["value","fieldConf","row","formName","orgInfo","isMultiple","selectList"],data(){return{placeholder:zj.z("请选择或输入业主名称","b2.common.select_owner"),curValue:{id:"",name:"",phone:""},restaurants:[],firstListVal:""}},watch:{value:{handler(e){this.curValue=e||{id:null,name:"",phone:""}},deep:!0},selectList(e){"EVCFirstElem"==l().get(this.fieldConf,"default.value.type")&&(!this.curValue||this.curValue&&!this.curValue.name)&&(this.curValue=l().get(e,"0",null)),this.firstListVal=l().get(e,"0",null)}},methods:{querySearch(e,t){var n=[];l().each(this.selectList,(e=>{n.push({value:e.name,phone:e.phone,id:e.id})})),t(e?n.filter(this.createFilter(e)):n)},createFilter(e){return t=>0===t.value.toLowerCase().indexOf(e.toLowerCase())},handleSelect(e){let t=l().cloneDeep(e);t.name=t.value,delete t.value,this.curValue=t,this.$emit("input",this.curValue),this.$emit("change",this.curValue)}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectHouseOwner/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.value?n("div",{staticClass:"qs-content"},[n("div",[e._v(e._s(e.value.name))]),e._v(" "),n("div",{staticStyle:{"margin-top":"15px"}},[e._v(e._s(e.value.phone))])]):n("span",{staticClass:"qs-content",attrs:{title:e.value}},[e._v(e._s("--"))])])};h._withStripped=!0;var p=(0,u.A)({props:["type","value","fieldConf","row"]},h,[],!1,null,null,null);p.options.__file="components/lib/bpmSelectHouseOwner/src/part/reader.vue";var _=p.exports,g={name:"bpmSelectHouseOwner",components:{editorComponent:f,readerComponent:_},props:{value:{type:[String,Array]},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?_:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},y=n(5072),b=n.n(y),v=n(7825),w=n.n(v),M=n(7659),L=n.n(M),k=n(5056),S=n.n(k),D=n(540),x=n.n(D),Y=n(1113),T=n.n(Y),C=n(5129),j={};j.styleTagTransform=T(),j.setAttributes=S(),j.insert=L().bind(null,"head"),j.domAPI=w(),j.insertStyleElement=x(),b()(C.A,j),C.A&&C.A.locals&&C.A.locals;var $=(0,u.A)(g,a,[],!1,null,null,null);$.options.__file="components/lib/bpmSelectHouseOwner/src/main.vue";var P=$.exports;P.install=function(e){e.component(P.name,P)};var I=P},8500:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-select-issue q-field-no-input"},[n("div",{staticStyle:{display:"flex","max-width":"360px",cursor:"pointer"},on:{click:function(t){return e.toOpen()}}},[n("div",{staticClass:"select-user-label",staticStyle:{flex:"1"}},[e._v("\n "+e._s(e.value.length||"view"===e.mode?e.$z("已选问题","b2.common.selected_question")+" "+e.value.length:e.$z("选择问题","b2.common.choice_question"))+"\n ")]),e._v(" "),n("i",{staticClass:"fa fa-angle-right icon-right",attrs:{"aria-hidden":"true"}})]),e._v(" "),n("el-dialog",{attrs:{title:e.searchTitle,visible:e.opened,width:"90%",fullscreen:!0,"custom-class":"bpm-select-issue"},on:{"update:visible":function(t){e.opened=t},close:e.toClose}},[n("issue-list",{ref:"issue_list",attrs:{category_cls:e.category_cls,mode:e.issueMode,selectItems:e.selectedVals},on:{select:e.selectIssueList}}),e._v(" "),"edit"===e.mode?n("div",{staticClass:"modal-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:e.toClose}},[e._v(e._s(e.$z("取消","c.cancel")))]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确定","c.confirm")))])],1):e._e()],1)],1)};a._withStripped=!0;var i={name:"BpmSelectIssue",props:{value:{type:Array,default(){return[]}},type:{type:String,default:"MulSelectIssue"},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"view"},uiType:{type:String,default:"default"}},data(){return{issueMode:"view",searchTitle:zj.z("已选问题","b2.common.selected_question"),module_loaded:!1,loading:!1,opened:!1,selectedVals:[],category_cls:0}},watch:{value(e){this.selectedVals=_.clone(e)},mode(e){"view"===e?(this.issueMode="view",this.searchTitle=zj.z("已选问题","b2.common.selected_question")):(this.issueMode="add",this.searchTitle=zj.z("选择问题","b2.common.choice_question"))}},computed:{maxCount(){return _.hasIn(this.fieldConf,"check.max_count")?_.get(this.fieldConf,"check.max_count"):100}},mounted(){setTimeout((async()=>{"building_qm"==this.fieldConf.issue_src?(await zj.ui.loadPageComponent("IssueList","buildingqm3","list"),this.category_cls=23,console.log("动态加载安全检查模块组件")):(await zj.ui.loadPageComponent("IssueList","houseqm3","list"),this.category_cls=28,console.log("动态加载分户验收模块组件")),this.module_loaded=!0}),4)},methods:{selectIssueList(e){this.selectedVals=_.clone(e)},toClose(){this.opened=!1,this.selectedVals=[]},toOpen(){this.module_loaded&&(this.opened=!0,this.$nextTick((()=>{setTimeout((()=>{this.setDefaultSelected()}),4)})))},setDefaultSelected(){this.selectedVals=this.value?_.cloneDeep(this.value):[],this.$refs.issue_list&&(this.$refs.issue_list.selectedIds=_.clone(this.selectedVals),this.$refs.issue_list.loadIssueList())},onSubmit(){this.$emit("input",this.selectedVals),this.$emit("change",this.selectedVals),this.toClose()}}},r=(n(8310),(0,n(4486).A)(i,a,[],!1,null,null,null));r.options.__file="components/lib/bpmSelectIssue/src/main.vue";var o=r.exports;o.install=function(e){e.component(o.name,o)};var s=o},9049:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-select-form-field",attrs:{value:e.curVal,type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.mode,orgInfo:e.orgInfo,formName:e.formName,uiType:e.uiType,isMultiple:e.multiple},on:{change:e.handleChange}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-select-edit",staticStyle:{display:"flex","align-items":"center"}},[n("el-select",e._g(e._b({key:e.isMultiple?"two":"one",attrs:{placeholder:e.placeholder,multiple:e.isMultiple,clearable:"",filterable:""},on:{change:e.onChange,focus:function(t){e.unitVisible=!0}},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"el-select",e.$attrs,!1),e.$listeners),e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.unitVisible&&e.showUnit,expression:"unitVisible && showUnit"}],staticStyle:{display:"flex"}},[n("span",{on:{click:function(t){e.unitVisible=!1}}},[e._v("《 ")]),e._v(" "),e.showUnit?n("select-unit",{staticStyle:{"margin-left":"5px","margin-right":"5px"},attrs:{fieldConf:e.fieldConf,formDefId:e.formDefId,orgInfo:e.orgInfo},on:{change:e.handleUnitChange}}):e._e(),e._v(" "),e.showUnit?n("el-select",{key:e.isMultiple?"two":"one",attrs:{placeholder:e.placeholder,multiple:e.isMultiple,filterable:"",remote:"","remote-method":e.remoteMethod},on:{change:e.onUnitChildsChange},model:{value:e.unitChildCurVal,callback:function(t){e.unitChildCurVal=t},expression:"unitChildCurVal"}},e._l(e.unitChildsOptions,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1):e._e()],1)],1)};i._withStripped=!0;var r=n(5554),o=n.n(r),s=n(7642),l=n(5281),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",{attrs:{placeholder:e.$z("单位选择","b2.common.unit_selection"),filterable:"",remote:""},on:{"remote-method":e.remoteMethod,change:e.handleUnitChange},model:{value:e.selectedTeam,callback:function(t){e.selectedTeam=t},expression:"selectedTeam"}},e._l(e.teams,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)};d._withStripped=!0;var c={name:"SelectUnit",props:["fieldConf","orgInfo","formDefId"],data(){return{selectedTeam:"",teams:[],teamMap:{},teamKeyword:"",debounceSearchTeams:_.debounce(_.bind(this.loadTeams,this),150,{trailing:!0,leading:!1})}},mounted(){this.loadTeams()},methods:{handleUnitChange(){this.$emit("change",this.selectedTeam)},async loadTeams(){let e=_.get(this.orgInfo,"page_level"),t=_.get(this.orgInfo,`${e}_id`);this.teams=await this.$bpm.searchTeamSelectOpts(this.fieldConf.id,{keyword:this.teamKeyword,[`${e}_id`]:t},this.formDefId),this.teamMap=_.keyBy(this.teams,"value")},remoteMethod(e){this.teamKeyword=e||"",this.debounceSearchTeams()}}},u=n(4486),m=(0,u.A)(c,d,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectUser/src/part/select-unit.vue";var f=m.exports;o().use(s.Select),o().use(s.Option);var h={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:f},data(){return{curVal:"",options:[],keyword:"",unit:{search_type:"",org_id:""},unitVisible:!1,unitChildCurVal:"",unitChildsOptions:[]}},watch:{value(){this.curVal=this.value,console.log("this.value",this.value),0==this.options.length&&this.value&&this.loadRemoteLabel(),this.showUnit&&this._setUnitChildCurVal(this.curVal)},getSelectOptions:function(e){console.log("----selectOptions----",e),this.transformOptions(e)}},inject:["selectOptions"],computed:{placeholder(){return this.fieldConf.desc||this.fieldConf.name},getSelectOptions(){return this.selectOptions?this.selectOptions():[]},showUnit(){return"SelectURUser"===this.type||"MulSelectURUser"===this.type}},created(){this.curVal=this.isMultiple?[]:""},mounted(){(this.fieldConf.perm||{visible:!0}).visible&&(console.log("mounted getting options"),this.loadSelectOpts()),this.curVal=this.value},methods:{async loadRemoteLabel(){console.log("this.value",this.value);let e=this.value;try{if(_.isObject(e))try{e=JSON.parse(e)}catch(e){console.log("error",e)}let t=_.isArray(e)?e:[e],n=_.get(this.fieldConf,"id");if(!_.isEmpty(t)){t=_.isArray(t)?t:[t];let e=await this.$bpm.fetchLabelByValues(t,n,this.formName,this.row);if(e=e.split(","),console.log("res",e),e&&e.length>0){let t=[];for(let n=0;n<this.curVal.length;n++)t.push({label:e[n],value:this.curVal[n]});this.options=t}}}finally{console.log("finally")}},handleUnitChange(e){let t=_.split(e,"$"),n=_.get(t,"0"),a=_.get(t,"1");this.unit={search_type:n,org_id:a},this.loadSelectOpts("",JSON.stringify(this.unit))},remoteMethod(e){let t="";this.showUnit&&this.unit.search_type&&(t=JSON.stringify(this.unit)),this.loadSelectOpts(e,t,!1)},async loadSelectOpts(e="",t="",n=!0){let a,i=this.fieldConf.id,r={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){console.log("UserTaskCC is getting options");const e=this.fieldConf.node;a=await l.A.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},r)}else a=await l.A.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:i,orgInfo:this.orgInfo,isDm:this.dm},r);const o=_.get(a.data,"data.data",[]);return this.transformOptions(o,n)},transformOptions(e,t=!0){console.log("transformOptions origin: ",e);let n=_.map(e,(e=>({value:e[0],label:e[1]})));return this.options=this.options.concat(n),this.options=_.uniqBy(this.options,"value"),this.showUnit?(this.options=this.options.concat(n),this.options=_.uniqBy(this.options,"value"),this.unitChildsOptions=n,t&&this._setUnitChildCurVal(this.curVal)):this.options=n,console.log("options: ",n),n},_setUnitChildCurVal(e){if(this.isMultiple){let t=[];_.each(e,(e=>{_.find(this.unitChildsOptions,{value:e})&&t.push(e)})),this.unitChildCurVal=t}},onChange(e){this.$emit("input",e),this.$emit("change",e)},onUnitChildsChange(e){if(console.log("onUnitChildsChange",e),this.isMultiple){_.each(e,(e=>{_.isArray(this.curVal)&&(_.includes(this.curVal,e)||this.curVal.push(e))}));let t=[];_.each(this.curVal,(e=>{console.log("this.unitChildsOptions",this.unitChildsOptions),console.log("this.unitChildsOptions-item",e),!_.includes(this.unitChildCurVal,e)&&_.find(this.unitChildsOptions,{value:e})||t.push(e)})),this.curVal=t}else this.curVal=e;this.$emit("input",this.curVal),this.$emit("change",this.curVal)}}},p=(0,u.A)(h,i,[],!1,null,null,null);p.options.__file="components/lib/bpmSelectUser/src/part/editor.vue";var g=p.exports,y={mixins:[n(7348).A]},b=(0,u.A)(y,void 0,void 0,!1,null,null,null);b.options.__file="components/lib/bpmSelectUser/src/part/reader.vue";var v=b.exports,w={name:"BpmSelectFromField",components:{editorComponent:g,readerComponent:v},props:{value:{type:[Array,Number,String]},type:{type:String,default:"SelectFromField"},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?v:g},multiple(){let e=this.isMultiple||0===this.type.indexOf("Mul");return"UserTaskCC"===this.type&&this.fieldConf.selecter&&(e=0===(this.fieldConf.selecter.type||"MulSelectUser4CC").indexOf("Mul")),e}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},M=(0,u.A)(w,a,[],!1,null,null,null);M.options.__file="components/lib/bpmSelectUser/src/main.vue";var L=M.exports;L.install=function(e){e.component(L.name,L)};var k=L},1824:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return c}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-signature",staticStyle:{position:"relative","max-width":"600px"}},["edit"===e.mode?[e.openLastSign&&e.lastSign&&e.curSign?n("div",{staticStyle:{"border-color":"#fff"}},[n("bpm-mul-image",{staticClass:"signature-reader",attrs:{type:"Signature",value:e.curSign},on:{imgLoadError:e.handleImgLoadError}})],1):e._e(),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!(e.openLastSign&&e.lastSign&&e.curSign),expression:"!(openLastSign && lastSign && curSign)"}],staticClass:"canvas-box"},[n("canvas",{ref:"canvasElem",staticStyle:{cursor:"crosshair",width:"100%",height:"320px",border:"1px dashed #c9c5c5"},attrs:{height:"320",width:"600"}})]),e._v(" "),n("div",{staticClass:"action-wrap"},[e.openLastSign?n("el-checkbox",{staticStyle:{"margin-right":"10px"},attrs:{label:e.$z("保留签名以备下次调用","b2.common.sign_for_next_use")},model:{value:e.useNextUser,callback:function(t){e.useNextUser=t},expression:"useNextUser"}}):e._e(),e._v(" "),n("el-button",{attrs:{size:"default"},on:{click:e.clearSignature}},[e._v(e._s(e.$z("重置签名","b2.common.reset_sign")))])],1)]:n("bpm-mul-image",{staticClass:"signature-reader",attrs:{fieldConf:{type:"Signature"},value:e.curSign}})],2)};a._withStripped=!0;var i=n(2554);function r(e,t,n={},a={}){if(!(this instanceof r))return new r(e,n);if(!e)return;let{width:i,height:o}=window.getComputedStyle(e,null);i=i.replace("px",""),o=o.replace("px",""),console.log("canvas size: ",i,o),i=i&&"auto"!==i&&-1===i.indexOf("%")?i:600,o=o&&"auto"!==o&&-1===o.indexOf("%")?o:320,console.log(e),this.canvas=e,this.context=e.getContext("2d"),this.width=i,this.height=o;const s=this.context,l=window.devicePixelRatio;l?(e.style.width=`${i}px`,e.style.height=`${o}px`,e.height=o*l,e.width=i*l,s.scale(l,l)):(e.width=i,e.height=o),s.lineWidth=2,s.strokeStyle="black",s.lineCap="round",s.lineJoin="round",Object.assign(s,n);const d={},c=/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);c||(s.shadowBlur=1,s.shadowColor="black");let u=!1;const m=t=>n=>{if(n.preventDefault(),1===t&&(u=!0),1===t||u){const{left:a,top:i}=e.getBoundingClientRect();n=c?n.touches[0]:n,d.x=n.clientX-a+.5,d.y=n.clientY-i+.5,(e=>{switch(e){case 1:s.beginPath(),s.moveTo(d.x,d.y);break;case 2:s.lineTo(d.x,d.y),s.stroke()}})(t)}},f=m(1),h=m(2),p=window.requestAnimationFrame,_=p?e=>{p((()=>{h(e)}))}:h;if(c?(e.addEventListener("touchstart",f),e.addEventListener("touchmove",_)):(e.addEventListener("mousedown",f),e.addEventListener("mousemove",_),["mouseup","mouseleave"].forEach((t=>{e.addEventListener(t,(()=>{u=!1}))}))),"number"==typeof t)switch(this.degree=t,s.rotate(t*Math.PI/180),t){case-90:s.translate(-o,0);break;case 90:s.translate(0,-i);break;case-180:case 180:s.translate(-i,-o)}}r.prototype={scale(e,t,n=this.canvas){const a=n.width,i=n.height;if(t=t||i,(e=e||a)!==a||t!==i){const r=document.createElement("canvas"),o=r.getContext("2d");r.width=e,r.height=t,o.drawImage(n,0,0,a,i,0,0,e,t),n=r}return n},rotate(e,t=this.canvas){if(0!=(e=~~e)){const n=180,a=-90;e>n?e=n:e<a&&(e=a);const i=document.createElement("canvas"),r=i.getContext("2d"),o=t.height,s=t.width,l=e*Math.PI/180;switch(e){case-90:i.width=o,i.height=s,r.rotate(l),r.drawImage(t,-s,0);break;case 90:i.width=o,i.height=s,r.rotate(l),r.drawImage(t,0,-o);break;case 180:i.width=s,i.height=o,r.rotate(l),r.drawImage(t,-s,-o)}t=i}return t},getPNGImage(e=this.canvas){return e.toDataURL("image/png")},getJPGImage(e=this.canvas){return e.toDataURL("image/jpeg",.5)},downloadPNGImage(e){const t=e.replace("image/png","image/octet-stream;Content-Disposition:attachment;filename=test.png");window.location.href=t},dataURLtoBlob(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],a=atob(t[1]);let i=a.length;const r=new Uint8Array(i);for(;i--;)r[i]=a.charCodeAt(i);return new Blob([r],{type:n})},clear(){let e,t;switch(this.degree){case-90:case 90:e=this.height,t=this.width;break;default:e=this.width,t=this.height}this.context.clearRect(0,0,e,t)},upload(e,t,n,a){const i=new FormData,r=new XMLHttpRequest;r.withCredentials=!0,i.append("image",e,"sign"),r.open("POST",t,!0),r.onload=()=>{r.status>=200&&r.status<300||304===r.status?n(r.responseText):a()},r.onerror=e=>{"function"==typeof a?a(e):console.log(`upload img error: ${e}`)},r.send(i)}};var o=r,s={name:"BpmSignature",components:{BpmMulImage:i.default},props:{value:{type:String},type:{type:String,default:"Signature"},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"edit"},uiType:{type:String,default:"default"},container:{type:[Object,null],default(){return null}}},data(){return{curSign:"",hasDraw:!1,openLastSign:!0,lastSign:"",useNextUser:!0,canvas:null,timer:null}},watch:{value(e){console.log("bpmSignature_value",e),e&&(this.curSign=e)},curSign(e){console.log("curSign",e),this.$emit("input",e),this.$emit("change",e,{open:this.openLastSign,for_next_use:this.useNextUser,signature:this.curSign})}},created(){this.value&&(this.curSign=this.value)},mounted(){if("edit"===this.mode){setTimeout((()=>{this.initCanvas()}),300);let e=this.container;e&&(e.$on("afterFormSubmit",(e=>{console.log("Singnature topContainer afterFormSubmit"),!e&&this.openLastSign&&this.curSign&&(console.log("to save signature: ",this.curSign,this.useNextUser),this.$bpm.postEleSign(this.curSign,this.useNextUser))})),e.$on("dataLoaded",(e=>{console.log("Singnature topContainer dataLoaded"),this.onDataLoaded(e),this.curSign=null,this.handleInit()})))}},destroyed(){this.container&&!this.container.isQuote&&(this.container.$off("afterFormSubmit"),this.container.$off("dataLoaded"))},methods:{_getCanvasPixelCount(e){for(var t=e.getContext("2d"),n=t.getImageData(0,0,t.canvas.width,t.canvas.height).data,a=0,i=0;i<n.length;i+=4)0!==n[i+3]&&a++;return a},handleImgLoadError(){console.log("加载图片失败")},handleInit(){let e=this.$bpm.userSign;this.openLastSign=e.open,e.for_next_use&&(this.lastSign=e.signature),this.openLastSign&&this.lastSign&&(this.curSign=e.signature),e.for_next_use&&this.openLastSign&&(this.useNextUser=!0),this.$emit("input",this.curSign),this.$emit("change",this.curSign,e),console.log("userSign: ",e)},initCanvas(){if(this.hasDraw=!1,this.canvas&&(this.canvas.removeEventListener("touchstart",(function(){})),this.canvas.removeEventListener("mousedown",(function(){})),this.canvas.removeEventListener("touchend",(function(){})),this.canvas.removeEventListener("mouseup",(function(){}))),console.log("初始化initCanvas"),this.canvas=this.$refs.canvasElem,!this.canvas)return!1;this.draw=new o(this.canvas,-this.degree,{},{}),console.log("this.draw",this.draw),this.canvas.addEventListener("touchstart",(()=>{this.timer&&(clearTimeout(this.timer),this.timer=null),this.hasDraw=!0})),this.canvas.addEventListener("mousedown",(()=>{this.timer&&(clearTimeout(this.timer),this.timer=null),this.hasDraw=!0})),this.canvas.addEventListener("touchend",(()=>{this.timer||(this.timer=setTimeout((()=>{this.transToImg()}),1e3))})),this.canvas.addEventListener("mouseup",(()=>{this.timer||(console.log("mouseup"),this.timer=setTimeout((()=>{this.transToImg()}),1e3))})),this.canvas.addEventListener("mouseleave",(()=>{this.timer||(console.log("mouseleave"),this.timer=setTimeout((()=>{this.transToImg()}),1e3))}))},onDataLoaded(e){this.hasDraw=!1,this.draw&&this.draw.clear()},clearSignature(){this.hasDraw=!1,this.draw&&this.draw.clear(),this.curSign=null,this.lastSign="",setTimeout((()=>{this.initCanvas()}),300)},transToImg(){if(console.log("Canvas transToImg called"),this.draw){let e=this.draw.getPNGImage();if(console.log("Signature canvas img: ",e),this._getCanvasPixelCount(this.canvas)<2e3)return!1;this.uploadImage({basestr:e,type:"png",name:"签名图片.png",model:"userfile"},(e=>{this.curSign=e,this.timer=null,console.log("Signature img md5: ",e)}))}},uploadImage({basestr:e,type:t,name:n,model:a},i){let r=window.atob(e.split(",")[1]),o=new ArrayBuffer(r.length),s=new Uint8Array(o);for(let e=0;e<r.length;e++)s[e]=r.charCodeAt(e);let l,d=window.WebKitBlobBuilder||window.MozBlobBuilder;if(d){let e=new d;e.append(o),l=e.getBlob(t)}else l=new window.Blob([o],{type:t});let c=new FormData;c.append(a,l,n),zj.net.w.noapi({method:"POST",url:"/platform/v1/papi/app_file/upload/",data:c,processData:!1,contentType:!1}).then((e=>{i&&i(e.file_md5)}))}}},l=(0,n(4486).A)(s,a,[],!1,null,null,null);l.options.__file="components/lib/bpmSignature/src/main.vue";var d=l.exports;d.install=function(e){e.component(d.name,d)};var c=d},8243:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",["table"===e.uiType?n("el-button",{attrs:{type:"text"},on:{click:function(t){e.showSubForm=!0}}},[e._v(e._s(e.$z("查看子表单","b2.common.view_subform")))]):"table"===e.showStyle?n("SubFormStyleTable",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,mode:e.mode,dm:e.dm,"max-height":e.maxHeight,"show-header":e.showHeader,resizable:e.resizable,"top-container":e.container,container:e.fieldSelf,linkageItem:e.linkageItem},on:{change:e.handleChange}},"SubFormStyleTable",e.$attrs,!1)):n("SubFormStyleCard",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,mode:e.mode,dm:e.dm,"max-height":e.maxHeight,"top-container":e.container,container:e.fieldSelf,linkageItem:e.linkageItem},on:{change:e.handleChange}},"SubFormStyleCard",e.$attrs,!1)),e._v(" "),"table"===e.uiType?n("el-dialog",{attrs:{title:e.subFormDialogTitle,visible:e.showSubForm,width:"50%"},on:{"update:visible":function(t){e.showSubForm=t},close:function(t){e.showSubForm=!1}}},[n("div",{staticStyle:{"max-height":"70vh",overflow:"auto"}},["table"===e.showStyle?n("SubFormStyleTable",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,mode:e.mode,dm:e.dm,"max-height":e.dialogTableMaxHeight,"show-header":!0,resizable:!0,"top-container":e.container,container:e.fieldSelf,linkageItem:e.linkageItem},on:{change:e.handleChange}},"SubFormStyleTable",e.$attrs,!1)):n("SubFormStyleCard",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,"top-container":e.container,container:e.fieldSelf,linkageItem:e.linkageItem,mode:e.mode,dm:e.dm},on:{change:e.handleChange}},"SubFormStyleCard",e.$attrs,!1))],1)]):e._e()],1)};a._withStripped=!0;var i=n(7520),r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.$z("单击可进行编辑","c.click_to_edit"),placement:"top",disabled:!("edit"==e.mode&&e.showSubformData.length>10&&!e.hadClickRow)}},[n("el-table",{key:"rowIndex",staticClass:"bpm-subform-table",staticStyle:{width:"100%"},attrs:{data:e.showSubformData,"max-height":e.maxHeight,"show-header":e.showHeader,resizable:e.resizable,border:"",stripe:""},on:{"row-click":e.rowClick}},[e.showIndex?n("el-table-column",{attrs:{type:"index",label:e.indexLabel,width:100},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.$index+1)+"\n\n "),e._l(e.hiddenColumns,(function(a){return[n("bpm-sub-form-field",e._b({directives:[{name:"show",rawName:"v-show",value:a.data.visible,expression:"col.data.visible"}],key:a.key,attrs:{type:a.data.type,fieldConf:a.data,mode:e.dm?e.mode:e.getFieldMode(a.data.perm,t.row),dm:e.dm,uiType:"table",rowIndex:t.row.rowIndex,container:e.container},on:{input:e.handleInput,change:function(n){return e.handleChange(n,t.row)}},model:{value:t.row[a.id],callback:function(n){e.$set(t.row,a.id,n)},expression:"scope.row[col.id]"}},"bpm-sub-form-field",e.$attrs,!1))]}))]}}],null,!1,3273917629)}):e._e(),e._v(" "),e._l(e.showColumns,(function(t){return n("el-table-column",{key:t.key,attrs:{prop:t.id,label:(t.data.check&&t.data.check.required?"* ":"")+t.label,"min-width":t.minWidth,sortable:t.sortable,"sort-by":t.sortBy},scopedSlots:e._u([{key:"default",fn:function(a){return[n("bpm-sub-form-field",e._b({directives:[{name:"show",rawName:"v-show",value:t.data.visible,expression:"col.data.visible"}],attrs:{type:t.data.type,fieldConf:t.data,mode:e.dm?e.mode:e.getFieldMode(t.data.perm,a.row),dm:e.dm,uiType:"table",rowIndex:a.row.rowIndex,container:e.container},on:{input:e.handleInput,change:function(t){return e.handleChange(t,a.row)}},model:{value:a.row[t.id],callback:function(n){e.$set(a.row,t.id,n)},expression:"scope.row[col.id]"}},"bpm-sub-form-field",e.$attrs,!1))]}}],null,!0)},[n("template",{slot:"header"},[t.data.check&&t.data.check.required?n("span",{staticStyle:{color:"#D84141"}},[e._v("* ")]):e._e(),e._v(" "),n("span",[e._v(e._s(t.label))])])],2)})),e._v(" "),e.canRemove&&e.countLimit.canRemove&&"edit"==e.mode?n("el-table-column",{attrs:{prop:"delete",label:e.$z("操作","c.operation"),width:100},scopedSlots:e._u([{key:"default",fn:function(t){return[e.canRemove&&e.countLimit.canRemove?n("el-button",{staticClass:"btn-delete",attrs:{type:"danger",icon:"el-icon-delete",circle:""},on:{click:function(n){return n.stopPropagation(),e.handleRemoveItem(t.row.rowIndex)}}}):e._e()]}}],null,!1,538655453)}):e._e()],2)],1),e._v(" "),e.canAdd&&e.countLimit.canAdd?n("el-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"default",icon:"el-icon-plus"},on:{click:e.handleAddItem}},[e._v(e._s(e.$z("添加项","c.add_item")))]):e._e()],1)};r._withStripped=!0;var o=n(9795),s={props:{value:{type:Array,default(){return[]}},columns:{type:Array,default(){return[]}},subformPerm:{type:Object,default(){return{}}},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"view"},maxHeight:{type:[Number,String],default:500},container:{type:Object,default(){return{}}},topContainer:{type:Object,default(){return{}}}},data(){return{subformData:[],originSubformData:[],originSubformDataMap:{},showSubformData:[],_oldVal:null,hasInit:!1,isEditingMap:{}}},computed:{form(){return this.topContainer},userId(){return _.get(this.$bpm.userInfo,"user_id",0)},originItem(){let e={};const t={int:0,text:"",array:[],struct:[]};return this.columns.forEach((n=>{e[n.id]=t[n.data.value_type]||""})),e},canAdd(){return"edit"===this.mode&&(this.subformPerm.creatable||this.dm)},canRemove(){return"edit"===this.mode&&(this.subformPerm.deletable||this.dm)},min(){const e=_.get(this.fieldConf,"check.min_count",0),t=_.get(this.fieldConf,"check.xmin_count");return t?this.form.formData[t]||0:e},max(){const e=_.get(this.fieldConf,"check.max_count"),t=_.get(this.fieldConf,"check.xmax_count");return t?this.form.formData[t]||0:e},countLimit(){const e=this.min,t=this.max;let n=this.showSubformData.length;return{canAdd:!(t&&n>=t),canRemove:!(n<=e)}},showIndex(){return!!this.fieldConf.show_index},indexLabel(){return this.fieldConf.index_label||zj.z("序号","b2.common.subform_index")},groupField(){return _.get(this.fieldConf,"group_by.by","")},showField(){return _.get(this.fieldConf,"is_show_field")},readonly(){return!_.get(this.fieldConf,"perm.editable",!1)}},watch:{value:{handler(e){e&&_.isArray(e)?(this.subformData=e,0==this.originSubformData.length&&(this.originSubformData=_.cloneDeep(e),_.each(this.originSubformData,(e=>{let t=_.cloneDeep(e);delete t._meta,this.originSubformDataMap[e._meta.id]=t})))):this.subformData=[]},immediate:!0},subformData:{handler(e){this.showSubformData=this.setData(e),console.log("this.showSubformData",this.showSubformData)},deep:!0,immediate:!0},min(e,t){this.addItemByMin(e)},max(e,t){let n=this.showSubformData.length;if(e&&n>e){let t=n-e,a=0;for(let e=this.subformData.length;e>0;e--){let n=this.subformData[e-1];n.visible&&a<t&&(this.handleRemoveItem(n.rowIndex,n),a++)}}}},mounted(){this.form.$once("dataLoaded",(e=>{this.addItemByMin(this.min)}))},methods:{getFieldMode(e,t){let n=this.mode;return!e||"edit"!==n||e.editable||e.writable?!this.isEditingMap[t._meta.id]&&this.showSubformData.length>10&&(n="view"):n="view",n},throttleEmit:_.throttle((function(){"edit"===this.mode&&(console.log("subForm change emit"),this.$emit("change",this.subformData))}),1e3),handleChange(e,t,n){console.log("field change: ",e),console.log("field change row: ",e);let a=!1;if(t&&t._meta&&t._meta.id){let e=this.originSubformDataMap[t._meta.id];for(let n in t)e[n]==t[n]||_.includes(["_meta","rowIndex","visible"],n)||(a=!0);a&&(t._meta.update_time=parseInt((new Date).getTime()/1e3),t._meta.updater=this.userId,t._meta.last_value=e)}this.throttleEmit()},handleInput(e){console.log("field input: ",e)},async addItemByMin(e){if(_.get(this.fieldConf,"linkage"))return;let t=this.showSubformData.length;if(e&&t<e){let n=e-t;for(let e=0;e<n;e++)await this.handleAddItem()}},async handleAddItem(){let e=(0,o.uR)(),t=this.subformData.length,n=t>=1?this.subformData[t-1]:_.cloneDeep(this.originItem),a=_.get(this.fieldConf,"fill_in_last_fields",[]);n=_.pick(n,a),_.isEmpty(n)||delete n._meta,console.log("lastItem: ",n);let i={isNew:!0,_meta:{id:e,creator:this.userId,create_time:parseInt((new Date).getTime()/1e3),update_time:parseInt((new Date).getTime()/1e3),updater:this.userId,last_value:null,deleter:0,is_deleted:!1}};this.$set(this.isEditingMap,e,!0),i=_.merge(i,n),await this.linkageItem.fillDefault(i,[],this.mode),!this.subformData||_.isEmpty(this.subformData)?this.subformData=[i]:this.subformData.push(i),this.handleChange(),console.log("this.subformData",this.subformData);let{relyHandleList:r,firstId:s}=this.linkageItem.getRelyHandleList("sure000");_.set(this.relyHandleListMap,this.subformData.length-1,r),_.isEmpty(r)&&this.$bpm.$emit("initRelyComplete",this),s&&setTimeout((async()=>{let e=await this.linkageItem.loadLinkage(r,this.subformData,this.container.formData,this.fieldConf.id,this.subformData.length-1);_.map(e,((e,t)=>{this.$set(this.subformData[this.subformData.length-1],`${t}`,e)})),this.handleChange(),this.$bpm.$emit("handeInitRely",{id:s,rowIndex:this.subformData.length-1})}),500)},setData(e){let t=this.showField,n=_.filter(e,((e,n)=>{e.rowIndex=n;let a=!e._meta.is_deleted&&(!t||t&&(2==e[t]||!e[t]));return e.visible=a,a}));if(this.groupField&&this.$q.platform.is.desktop&&this.readonly){let e=_.groupBy(n,this.groupField);_.map(e,((e,t)=>{_.each(e,((e,n)=>{0==n&&(e._groupField=t)}))}))}return console.log("tableData",n),this._oldVal=JSON.stringify(e),n},handleRemoveItem(e,t){console.log("deleteRowIndex",e),console.log("deleteRowIndex.isEditingMap",this.isEditingMap),this.subformData[e]&&this.subformData[e].isNew?(console.log("删除子表单项"),this.subformData.splice(e,1)):(console.log("标记删除子表单项"),this.subformData[e]._meta.is_deleted=!0,this.subformData[e]._meta.deleter=this.userId,this.subformData[e]._meta.update_time=parseInt((new Date).getTime()/1e3)),this.handleChange()},handleEditItem(e,t){console.log("editRowIndex",e),this.subformData[e]&&this.$set(this.isEditingMap,this.subformData[e]._meta.id,!0)}}},l={name:"SubFormStyleTable",mixins:[s],props:{showHeader:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},linkageItem:{type:Object,default:function(){return{}}},mode:{type:String,default:"view"},dm:{type:Boolean,default(){return!1}}},data(){return{hadClickRow:!1}},methods:{rowClick(e,t,n){console.log("row",e),"edit"==this.mode&&this.showSubformData.length>10&&(this.hadClickRow=!0),this.handleEditItem(e.rowIndex,e)}},computed:{showColumns(){return _.filter(this.columns,(e=>{if(e.visible)return e}))},hiddenColumns(){return _.filter(this.columns,(e=>{if(!e.visible)return e}))}}},d=n(4486),c=(0,d.A)(l,r,[],!1,null,null,null);c.options.__file="components/lib/bpmSubForm/src/table.vue";var u=c.exports,m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:{overflow:"auto"}},[e._l(e.showSubformData,(function(t,a){return n("el-card",{key:a,staticClass:"bpm-subform-card",class:e.mode,attrs:{shadow:"hover","body-style":{padding:"10px 20px",overflow:"auto",position:"relative",paddingRight:e.canRemove?"70px":"20px"}}},[n("el-form",{attrs:{"label-width":"180px",inline:!1}},[e.showIndex?n("el-form-item",{attrs:{label:e.indexLabel}},[e._v("\n "+e._s(a+1)+"\n ")]):e._e(),e._v(" "),e._l(e.columns,(function(i){return n("el-form-item",{directives:[{name:"show",rawName:"v-show",value:i.visible&&i.data.visible,expression:"col.visible && col.data.visible"}],key:i.key,class:i.data.display&&(i.data.display.hide_name||"top"===i.data.display.label_position)?"no-label":"",attrs:{label:i.data.display&&(i.data.display.hide_name||"top"===i.data.display.label_position)?"":i.label,required:i.data.check&&i.data.check.required}},[i.data.display&&!i.data.display.hide_name&&"top"===i.data.display.label_position?n("div",{staticClass:"form-label-top"},[e._v(e._s(i.label))]):e._e(),e._v(" "),n("bpm-sub-form-field",e._b({ref:"bpmSubFormField",refInFor:!0,attrs:{type:i.data.type,fieldConf:i.data,mode:e.getFieldMode(i.data.perm,t),uiType:"form",rowIndex:a,container:e.container},on:{change:e.handleChange},model:{value:t[i.id],callback:function(n){e.$set(t,i.id,n)},expression:"item[col.id]"}},"bpm-sub-form-field",e.$attrs,!1))],1)}))],2),e._v(" "),e.canRemove&&e.countLimit.canRemove?n("el-button",{staticClass:"btn-delete",attrs:{type:"danger",icon:"el-icon-delete",circle:""},on:{click:function(n){return e.handleRemoveItem(t.rowIndex)}}}):e._e()],1)})),e._v(" "),e.canAdd&&e.countLimit.canAdd?n("el-button",{attrs:{type:"default",icon:"el-icon-plus"},on:{click:e.handleAddItem}},[e._v(e._s(e.$z("添加项","c.add_item")))]):e._e()],2)};m._withStripped=!0;var f={name:"SubFormStyleCard",mixins:[s],props:{linkageItem:{type:Object,default:function(){return{}}}}},h=(0,d.A)(f,m,[],!1,null,null,null);h.options.__file="components/lib/bpmSubForm/src/card.vue";var p=h.exports,g=n(4419);class y{constructor(e,t){this.penetrationZList=[],this.elementIdList=[],this.eleMap={},this.relyGraphData={nodes:[],edges:[]},this.elements=[],this.bpm=e,this.value=t}addStackArr(e,t,n){this.eleMap=t,this.elements=_.concat(this.elements,e),this.elementIdList=_.map(t,"id"),_.each(e,(e=>{n&&_.set(e,"parentId",n);let a=_.get(e,"linkage.depends",[]),i=_.get(e,"scope.depends",[]),r=_.get(e,"range_remote.depends",[]),o=_.concat(a,i);o=_.concat(o,r),n||(this.penetrationZList=_.concat(this.penetrationZList,o)),e.elements&&this.addStackArr(e.elements,t,e.id)})),this.createTopoGraph(e),this.penetrationZList=_.uniq(this.penetrationZList),this.penetrationZList=_.intersection(this.elementIdList,this.penetrationZList),this.relyGraphData.nodes.push({id:"sure000",name:"顶点"}),_.each(this.penetrationZList,(e=>{this.relyGraphData.edges.push({source:"sure000",target:e})}))}createTopoGraph(e){_.each(e,(e=>{let t=_.get(e,"mappings",[]),n=_.map(t,"local_field_id");_.each(n,(t=>{if(_.includes(this.elementIdList,t)){let n=_.get(this.eleMap,t);this.relyGraphData.nodes.push(n),this.relyGraphData.nodes.push(e),this.relyGraphData.edges.push({source:e.id,target:t})}}));let a=_.get(e,"linkage.depends",[]),i=_.get(e,"scope.depends",[]),r=_.get(e,"range_remote.depends",[]),o=_.concat(a,i);o=_.concat(o,r);let s=_.get(this.eleMap,e.id);if(_.each(o,(e=>{_.get(this.eleMap,e)||(_.pullAll(o,[e]),o=_.cloneDeep(o))})),o.length){let t=_.pullAll(this.penetrationZList,[e.id]);this.penetrationZList=_.cloneDeep(t)}_.each(o,(t=>{if(t&&e.id&&_.includes(this.elementIdList,t)){let n=_.get(this.eleMap,t);if(!n||!s)return;let a=s.id,i=_.get(this.eleMap,t);n&&!i&&(this.penetrationZList=_.replace(this.penetrationZList,t,a),this.penetrationZList=_.split(this.penetrationZList,",")),this.relyGraphData.nodes.push(e),this.relyGraphData.nodes.push(n),this.relyGraphData.edges.push({source:t,target:a})}e.elements&&this.createTopoGraph(e.elements)}))}))}getRelyHandleList(e,t){let n=[];const{breadthFirstSearch:a}=g.Algorithm;let i=null;return a(this.relyGraphData,e,{enter:({current:e,previous:t})=>{},leave:({current:a,previous:r})=>{i||a==e||t&&!_.includes(t,a)||(i=a),a!=e&&n.push(a)}}),{relyHandleList:n,firstId:i}}async loadLinkage(e,t,n,a,i){let r=[],o={};_.each(e,(e=>{let t=_.get(this.eleMap,e),a=_.get(t,"linkage.depends");if("Quote"==t.type&&(a=_.concat(a,_.get(t,"scope.depends"))),a=_.intersection(a,this.elementIdList),!_.isEmpty(a)){let t={calculate_type:"linkage",field_def_id:e},s=_.pick(n,a);o=_.merge(o,s),_.isNil(i)||_.set(t,"idx",i),r.push(t)}})),t&&_.set(o,a,t);let s=await this.bpm.loadResult({params:{cal_fields:r,fields:o}});return _.map(s.data,((e,t)=>{let n=_.get(this.eleMap,`${t}.type`);_.includes(["SelectFromForm","Quote"],n)&&(e=_.get(e,"data.form_id")),s.data[t]=e})),s.data}async fillDefault(e,t=[],n){let a=[];if(_.each(this.elements,(i=>{if(_.includes(t,i.id))return _.set(e,i.id,null),void this.setLocalCache(i.id,null,n);let r=_.get(e,i.id);if(!_.isNil(r))return;let o=_.get(i,"default.value.type");if("EVCConfig"==o){let t=_.get(i,"default.value.value",null);_.set(e,i.id,t),this.setLocalCache(i.id,t,n)}"EVCExpression"!=o&&"EVCFirstElem"!=o||a.push({calculate_type:"default",field_def_id:i.id})})),_.isEmpty(a))return;let i=await this.bpm.loadResult({params:{cal_fields:a}});_.map(i.data,((t,a)=>{let i=_.get(this.eleMap,`${a}.type`);_.includes(["SelectFromForm","Quote"],i)&&(t=_.get(t,"data.form_id")),_.includes(["MulSelectFromForm"],i)&&(t=_.map(t,"data.form_id")),_.set(e,a,t),this.setLocalCache(a,t,n)}))}setLocalCache(e,t,n){let a=_.get(this.eleMap,`${e}.value_type`);this.bpm.setLocalCache(n,`${e}.${a}`,t)}}var b={name:"BpmSubForm",components:{SubFormStyleTable:u,SubFormStyleCard:p},props:{value:{type:Array,default(){return[]}},type:{type:String,default:"XSubForm"},fieldConf:{type:Object,default(){return{}}},mode:{type:String,default:"view"},uiType:{type:String,default:"default"},maxHeight:{type:[Number,String],default:500},showHeader:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},container:{type:Object,default:function(){return{}}},dm:{type:Boolean,default(){return!1}}},data(){return{subformData:[],dialogTableMaxHeight:500,showSubForm:!1,linkageItem:null,initLinkageFlag:!1,relyHandleList:[],relyHandleListMap:{}}},computed:{fieldSelf(){return this},columns(){const e=this.fieldConf.elements||[],t=[];return e.forEach((e=>{const n=i.Q[e.type]||{},a=e.perm||{visible:!0,editable:!0,writable:!0};if(this.dm||a.visible||a.editable||a.writable){e.visible=a.visible||this.dm;let i=this.mode;"edit"!==i||a.editable||a.writable||(i="view"),t.push({key:e.id,id:e.id,label:e.name||e.id,minWidth:n.tableColWidth||100,sortable:!0,sortBy:e.id,fieldMode:i,visible:a.visible,data:e})}})),t},subFormDialogTitle(){return this.fieldConf.name||this.fieldConf.id},showStyle(){return this.fieldConf.style||"table"},subformPerm(){return this.fieldConf.perm||{creatable:!1,deletable:!1,editable:!1,memorable:!1,modifiable:!1,visible:!0,writable:!1}},isSubForm(){return!0},elementIdList(){return _.map(this.fieldConf.elements,"id")},eleMap(){let e=this.fieldConf.elements,t=_.get(this.container,"formSchema.elements");return e=_.concat(e,t),_.keyBy(e,"id")}},watch:{value:{handler(e,t){e&&_.isArray(e)?(this.subformData=e,e!=t&&this.$nextTick((()=>{this.initLinkage()}))):this.subformData=[]},immediate:!0}},created(){this.linkageItem=new y(this.$bpm),this.dialogTableMaxHeight=Math.floor(window.innerHeight/100*70-114)},mounted(){this.linkageItem.addStackArr(this.fieldConf.elements,this.eleMap),console.log("重新渲染")},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)},initLinkage(){if(this.initLinkageFlag||0==this.subformData.length)return!1;console.log("初始化联动");let{relyHandleList:e}=this.linkageItem.getRelyHandleList("sure000");_.set(this.relyHandleListMap,this.value.length-1,e),console.log("relyHandleList",e),console.log("this.relyHandleListMap",this.relyHandleListMap),this.initLinkageFlag=!0,setTimeout((()=>{console.log("initRelyComplete_subFormInitLinkage",this),this.$bpm.$emit("initRelyComplete",this)}),1e3)},handleNextRely(e){console.log("sub-form-handleNextRely");let t=_.get(this.relyHandleListMap,e);console.log("sub-form-handleNextRely_relyHandleList",t),t&&t.shift(),_.isEmpty(t)&&this.$bpm.$emit("initRelyComplete",this);let n=_.head(t,e);n&&this.$bpm.$emit("handeInitRely",{id:n,rowIndex:e})},async handleRelyById(e,t){console.log("XSubForm handleRelyById"),console.log("sub-form-handleRelyById",e),console.log("sub-form-handleRelyById-rowIndex",t),console.log("sub-form-handleRelyById-this.elementIdList",this.elementIdList);let{relyHandleList:n,firstId:a}=this.linkageItem.getRelyHandleList(e);if(console.log("sub-form-handleRelyById-relyHandleList",n),console.log("sub-form-handleRelyById-firstId",a),_.set(this.relyHandleListMap,t,n),a){let e=await this.linkageItem.loadLinkage(n,this.value,this.container.formData,this.fieldConf.id,t);console.log("sub-form-handleRelyById-result",e),_.map(e,((e,n)=>{this.$set(this.value[t],`${n}`,e)})),this.$bpm.$emit("handeRelyById",{id:a,rowIndex:t})}},handleNextRelyById(e){console.log("sub-form-handleNextRelyById");let t=_.get(this.relyHandleListMap,e);console.log("sub-form-handleNextRelyById-relyHandleList",t),t.shift(),_.isEmpty(t)&&this.$bpm.$emit("initRelyComplete",this);let n=_.head(t);n&&this.$bpm.$emit("handeRelyById",{id:n,rowIndex:e})},setData(){}}},v=(0,d.A)(b,a,[],!1,null,"e0a458ce",null);v.options.__file="components/lib/bpmSubForm/src/main.vue";var w=v.exports;w.install=function(e){e.component(w.name,w)};var M=w},1849:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.curComponent?n(e.curComponent,e._g(e._b({ref:"inner-component",tag:"component",staticClass:"bpm-sub-form-field",attrs:{type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.fieldMode,uiType:e.uiType,formDefId:e.formDefId,orgInfo:e.orgInfo,dm:e.dm,clearable:e.clearable,disabled:e.fieldDisabled,isMultiple:e.isMul},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};a._withStripped=!0;var i=n(5554),r=n.n(i),o={name:"BpmSubFormField",mixins:[n(1464).A,function(){let e={props:["container","rowIndex","isNew","hideLabel"],data(){return{optAssWatchList:[],hasAddOptAssWatch:!1,defaultVal:null,firstListVal:null,loadedDefault:!1}},computed:{isSubForm(){return!1},topContainer(){return this.container.isSubForm?this.container.container:this.container},fieldSelf(){return this},fieldPath(){return this._getFieldPath()},readonly(){return!0},inner(){return this.$bpm.matchInnerComponent(this.fieldConf.type,this.readonly)}},created(){this.topContainer&&!this.dm&&(this.topContainer.$once("beforeSchemaLoad",(e=>{this.clearOptAssWatch()})),this.topContainer.$once("dataLoaded",(e=>{this.addOptAssWatch()}))),this.isNew&&!this.hasAddOptAssWatch&&(this.addOptAssWatch(),this.$emit("update:isNew",!1))},methods:{async getConfDefaultValue(){let e=_.get(this.fieldConf,"default.value.type");e=e||_.get(this.fieldConf,"default.value.type");let t=_.get(this.fieldConf,"default.value.value"),n=_.get(this.fieldConf,"default.type");return this.defaultVal||this.loadedDefault?this.defaultVal:("EVCConfig"==n&&(t=_.get(this.fieldConf,"default.value"),this.defaultVal=t),"EVCExpression"==e||"EVCExpression"==n?(this.defaultVal=await this.$bpm.loadValDefault({fieldId:this.fieldConf.id,params:{},cusFormName:this.container.cusFormId,container:this.container}),this.loadedDefault=!0,this.defaultVal):("EVCFirstElem"==_.get(this.fieldConf,"default.value.type")&&(t=this.firstListVal),this.defaultVal=t,this.loadedDefault=!0,t))},getTypeValidEmptyValue(){let e=this.fieldConf.value_type,t=this.fieldConf.type;switch(e){case"int":return 0;case"struct":return"Mul"==t.substr(0,3)||"OnlineEditor"==t||this.isSubForm?[]:{};default:return"Mul"==t.substr(0,3)||"OnlineEditor"==t||this.isSubForm?[]:""}},removeValue(){let e=this.container,t=e.value;e.isSubForm&&(t=_.get(t,[this.rowIndex])),t&&(this.value=null)},_getFieldPath(e=!1){return this.container.isSubForm?e?[this.container.fieldConf.id,this.rowIndex,this.fieldConf.id]:[this.rowIndex,this.fieldConf.id]:[this.fieldConf.id]},_getValue(){console.log("this.container",this.container);let e="";return this.container&&(e=_.get(this.container.value,this.fieldPath)),e},isPromise(e){return!!e&&"function"==typeof e.then},_setValue(e){let t=this.container,n=_.cloneDeep(t.value);if(t.isQuote)return;let a=_.last(this.fieldPath);if(t.isSubForm){n||(n=[]);let i=this.rowIndex;if(n[i])return void this.$set(t.value[i],a,e);t.isXSubForm?r().set(n,i,t.getItem(i)):r().set(n,i,{}),n=n[i];try{r().set(t.value,i,n)}catch(e){console.log("error",t.value)}}else r().set(t.value,a,e),console.log("container.value",t.value,a,e)},clearOptAssWatch(){this.hasAddOptAssWatch=!1,_.each(this.optAssWatchList,(e=>{e()}))},addOptAssWatch(){this.hasAddOptAssWatch=!0;let e=_.get(this.fieldConf,"optAssMap"),t=_.get(this.fieldConf,"perm.visible");if(!e||_.isEmpty(e)||!t)return;let n=0;_.map(e,((t,a)=>{a=_.replace(a,"&",".");let i=this.$watch(`row.f_fields.${a}`,(t=>{let n=!0;_.map(e,((e,t)=>{t=_.replace(t,"&",".");let a=_.get(this.row,`f_fields.${t}`);a=_.toString(a),n=n&&_.includes(e,a)})),this.fieldConf.perm.visible=n}),{immediate:0==n});n++,this.optAssWatchList.push(i)}))}}};return _.merge(e,{data(){return{unWatchList:[],valueUnWatch:null,valDependIds:[],selectDependIds:[],remoteDependIds:[],selectFields:null,selectList:[],quoteContent:{},unSelectDependValWatchList:[],optAssWatchList:[],hasAddOptAssWatch:!1,scopeDependIds:[],subFormOldValMap:{},isDelete:!1,displayHidden:!1,differenceRowIndexs:[],topContainerMode:null,nextRely:null,loading:!1,firstFill:!0,hasFillDefault:!1,remoteData:[]}},created(){this.topContainer&&!this.dm&&(this.topContainer.$once("beforeDataLoad",(e=>{this.toggleValueWatch(!1),this.clearOptAssWatch()})),this.topContainer.$once("dataLoaded",(e=>{this.getMemory(),this.addOptAssWatch()})),this.topContainer.$once("beforeReloadData",(e=>{this.toggleValueWatch(!1)}))),this.getMemory(),this.addOptAssWatch(),this.$emit("update:isNew",!1),this.$bpm.$on("beforeFormSubmit",(({mode:e,formData:t,cc:n,_formData:a})=>{console.log("触发SubForm ,beforeFormSubmit");let i=this._getFieldPath(!0),r=_.get(a,i),o=_.get(this.fieldConf,"check.required",!1);if((_.isNull(this.value)&&o||"SelectHouseOwner"==this.fieldConf.type&&(!this.value.name||!this.value.phone)&&o)&&_.unset(t,i),_.isArray(this.value)&&_.isEmpty(this.value)||_.isNil(this.value)||""==this.value&&0!==this.value){let e=_.get(this.fieldConf,"check.min_length");e=e||_.get(this.fieldConf,"check.min"),e=e||_.get(this.fieldConf,"check.min_count"),e||o||!r||_.unset(t,i)}let s=this.container,l=s.isSubForm,d=_.get(this.fieldConf,"optAssMap");if(!d||_.isEmpty(d))return;let c=!0;_.map(d,((e,t)=>{t=t.replace(/&/g,".");let n=_.split(t,".");n=_.last(n);let a=_.get(this.elementMap,`${n}.type`),i=!!a&&"Mul"==a.substr(0,3);this._getPath(n)!=n&&l&&(t=`${s.fieldConf.id}&${this.rowIndex}&${n}`),t=t.replace(/&/g,".");let r=_.get(this.form,`formData.${t}`);if(i);else{let t=_.toString(r);c=c&&_.includes(e,t)}})),c||_.unset(t,i)})),this.$bpm.$on("afterFormSubmit",(({mode:e,errors:t})=>{if(console.log("触发SubForm ,afterFormSubmit"),!t&&this.memorable){let t=this.fieldConf.id,n=_.get(this.fieldConf,"value_type");this.$bpm.setMemory(e,`${t}.${n}`,this.value)}})),this.$bpm.$on("handeInitRely",(async({id:e,rowIndex:t,oid:n,lastField:a})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||(this.topContainer.isCache?this.openRelyInitLoadOnCache(n,a):this.openInitRelyLoad(n,a))})),this.$bpm.$on("initRelyComplete",(async(e,t)=>{e===this.container?(console.log("触发SubForm initRelyComplete"),this.hasFillDefault||await this.fillDefaultValue(),this.valueUnWatch||await this.toggleValueWatch(!0),this.addOptAssWatch(),t&&this.$emit("valueChanged")):console.log("container不等,没能触发SubForm initRelyComplete")})),this.$bpm.$on("handeRelyById",(({id:e,rowIndex:t,oid:n,lastField:a})=>{console.log("触发SubForm ,handeRelyById",e),console.log("触发SubForm ,handeRelyById_rowIndex",t),console.log("触发SubForm ,handeRelyById_oid",n),console.log("触发SubForm ,handeRelyById_lastField",a),console.log("SubForm-this.fieldConf",this.fieldConf),console.log("SubForm-this.container",this.container),e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||this.opeRelyById(n,a)}))},provide(){return{getSelectFields:()=>this.selectFields,selectOptions:()=>this.selectList}},destroyed(){this.toggleValueWatch(!1),console.log("this.container.isQuote",this.container.isQuote)},computed:{form(){return this.topContainer},readonly(){return!_.get(this.fieldConf,"perm.editable",!1)},disWritable(){return!_.get(this.fieldConf,"perm.editable",!1)&&!_.get(this.fieldConf,"perm.writable",!1)},memorable(){return _.get(this.fieldConf,"perm.memorable",!1)},isDetailMode(){return"detail"==this.form.mode},isDeleteMode(){return"delete"==this.form.mode},elements(){return _.get(this.form,"formSchema.elements",[])},elementMap(){let e={},t=this.elements;return _.each(t,(t=>{_.set(e,t.id,t),_.each(t.elements||[],(n=>{_.set(e,t.id,t)}))})),e},description(){return _.get(this.fieldConf,"desc","")},hideName(){return _.get(this.fieldConf,"display.hide_name",!1)},visualAttrs(){let e=this._getFieldPath(!0).join("."),t=this.form.formErrors,n=!!t&&t[e],a=this.fieldConf,i=[],r=_.get(a,"perm.visible",!1);_.get(a,"check.required",!1)&&!this.isDetailMode&&i.push("q-field-required"),r&&!this.displayHidden||i.push("q-field-hidden"),this.readonly&&i.push("readonly");let o=_.get(this.fieldConf,"display.hide_name",!1),s=_.get(this.fieldConf,"display.is_tip",!1);o&&i.push("hide-name"),s&&i.push("tip-field"),n&&this.scrollToElement();let l=this.$bpm.isVerticalTypography,d=_.includes(["MulImage","SubForm","XSubForm","MulFile","Spliter","Signature"],a.type);return l=l&&!_.includes(["SubForm","XSubForm","Spliter"],a.type),l&&i.push("col-4"),"SelectHouseOwner"==a.type&&i.push("select-house-owner"),{filled:!0,hideHint:!0,disable:!_.get(a,"perm.editable",!0),error:!!n,errorLabel:_.get(n,"message",""),class:i,orientation:d||l?"vertical":"horizontal"}},isRelyId(){return _.includes(this.topContainer.relyIds,this.fieldConf.id)},isVerticalTypography(){return this.$bpm.isVerticalTypography}},mounted(){this.description&&this.insertDesc()},methods:{getMemory(){if(!this.memorable||this.value)return;let e=this.fieldConf.id,t=_.get(this.fieldConf,"value_type");this.topContainerMode=this.topContainer.mode,this.$bpm.checkMemory(this.topContainerMode,(n=>{let a=_.get(n,`f_fields.${e}.${t}`);this.value=a,this.setLocalCache(this.value)}),(()=>{}))},scrollToElement(){},async openRelyInitLoadOnCache(e,t){await this.loadSelectByDepends(),await this.loadRemoteByDepends(!0),this.$emit("valueChanged"),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.loading=!1,this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex,e,t)},async openInitRelyLoad(e,t){console.log("SubForm-openInitRelyLoad"),await this.loadSelectByDepends(),await this.loadRemoteByDepends(!0),await this.loadRemoteByFieldMap(e),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.$emit("valueChanged"),this.loading=!1,this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex,e,t)},async opeRelyById(e,t){await this.fillDefaultValue(),await this.loadSelectByDepends(),await this.loadRemoteByDepends(),await this.loadRemoteByFieldMap(e),t==this.fieldConf.id&&(this.container.relyLoading=!1),this.loading=!1,this.container.handleNextRelyById&&await this.container.handleNextRelyById(this.rowIndex,e,t)},async getBreakResult(e){let t=this.$bpm.breakRelyMap,n=_.get(t,e);return _.includes(n,this.fieldConf.id)},async fillDefaultValue(){let e=this.topContainer.resetFields;if(_.includes(e,this.fieldConf.id))return this.value=null,this.setLocalCache(this.value),this.loading=!1,void(this.hasFillDefault=!0);if(_.isNil(this.value)){let e=await this.getConfDefaultValue();_.isNil(e)||(this.value=e,this.setLocalCache(this.value))}this.loading=!1,this.hasFillDefault=!0},async getConfDefaultValue(){if("EVCConfig"==_.get(this.conf,"default.value.type"))return _.get(this.conf,"default.value.value")},isPromise(e){return!!e&&"function"==typeof e.then},toggleValueWatch(e=!0){if(this.valueUnWatch&&(this.valueUnWatch(),this.valueUnWatch=!1),e){let e=JSON.stringify(this.value);this.valueUnWatch=this.$watch("value",(async(t,n)=>{if(console.log("subformField: ",t,n),this.$bpm.SubFormLinkingCount?this.$bpm.SubFormLinkingCount++:this.$bpm.SubFormLinkingCount=1,this.$bpm.SubFormLinkingCount>6)return console.log("subForm组件联动触发过多,终止剩余触发"),!1;if(this.$bpm.SubFormLinkingCountSetTimeOut&&(clearTimeout(this.$bpm.SubFormLinkingCountSetTimeOut),this.$bpm.SubFormLinkingCountSetTimeOut=null),this.$bpm.SubFormLinkingCountSetTimeOut=setTimeout((()=>{this.$bpm.SubFormLinkingCount=0}),3e3),this.isSubForm||"Area"==this.fieldConf.type||"MulArea"==this.fieldConf.type){let n=JSON.stringify(t);if(e==n)return void(this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex))}else if(n==t)return void(this.container.handleNextRely&&await this.container.handleNextRely(this.rowIndex));if(e=JSON.stringify(t),console.log("subForm组件触发了,valueChanged"),this.$emit("valueChanged"),this.setLocalCache(t),console.log("subFormthis.container",this.container),console.log("subFormthis.fieldConf",this.fieldConf),(!this.container.isSubForm||this.container.isSubForm&&(!_.isUndefined(n)||!_.isUndefined(t)))&&this.container&&this.container.handleRelyById){await this.loadRemoteByFieldMap();let e=_.get(this.fieldConf,"mappings");console.log("subFormMappings",e),e=_.keys(e),await this.container.handleRelyById(this.fieldConf.id,this.rowIndex,e)}this.firstFill=!1}),{immediate:!1,deep:!0})}},setLocalCache(e){let t=this.fieldConf.id,n=this.container.mode,a=_.get(this.fieldConf,"value_type");this.$bpm.setLocalCache(n,`${t}.${a}`,e)},loadSelectListPre(e){this.$refs.fieldComp&&this.$refs.fieldComp.preSearch&&this.$refs.fieldComp.preSearch(e)},loadSelectByDepends(){this.readonly||(this.selectDependIds=_.get(this.fieldConf,"range_remote.depends",[]),this.loadSelectLinkage({fieldId:this.fieldConf.id},(e=>{if("Quote"==this.fieldConf.type)return this.value=_.map(e.data,"form_id"),this.quoteContent=e,void(this.loading=!1);this.selectList=e,this.loading=!1})))},async loadRemoteByDepends(e){if("OrderSubForm"==this.fieldConf.type&&(this.remoteDependIds=_.get(this.fieldConf,"remote.depends",[]),this.remoteDependIds.length||e)){let t=this.remoteDependIds,n=this.getDependData(t);if(_.map(n,((e,t)=>{_.isUndefined(e)&&_.unset(n,t)})),_.isEmpty(n)&&!e)return void(this.loading=!1);let a={fields:n,include_sup:!0},i=this.fieldConf.id,r=await this.$bpm.loadSelectRemoteForm({fieldId:i,params:a,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container});this.remoteData=r,this.loading=!1}},_getPath(e){let t=this.elements,n=e;return _.each(t,(t=>{_.each(t.elements||[],(a=>{a.id==e&&(n=t.id)}))})),n},getDependData(e){let t=this.topContainer.formData,n={};return _.each(e,(e=>{let a=this._getPath(e),i=_.get(t,a);if(e!=a){let t=[];_.each(i,((n,a)=>{let i={},r=_.get(n,e);(r||0===r)&&_.set(i,e,r),_.hasIn(n,"_meta")&&_.set(i,"_meta",n._meta),t.push(i)})),n[a]&&(t=_.merge(n[a],t)),i=t}_.isArray(i)&&_.each(i,(e=>{_.unset(e,"isNew")})),a&&_.set(n,a,i)})),n},loadSelectDepends(){let e=_.get(this.fieldConf,"range_remote.depends",[]),t=this.getDependData(e);_.isEmpty(t)||(this.selectFields=JSON.stringify(t))},async loadSelectLinkage({fieldId:e,mergeParams:t,dependVal:n,isForceLoad:a},i){let r=_.get(this.fieldConf,"range_remote.depends",[]),o=this.getDependData(r);if(console.log("dependData",o),_.isEmpty(o))return;this.selectFields=JSON.stringify(o);let s={fields:JSON.stringify(o)};this.container.isSubForm&&_.set(s,"idx",this.rowIndex);let l=this.fieldConf.type;"OnlineEditor"==l&&(s={spec:JSON.stringify(o)}),t&&(s=_.merge(s,t));let d=null;return d=_.includes(["MulSelectCheckItem","SelectRootCategory","SelectCheckItem","SelectSort","MulSelectSort"],l)?await this.$bpm.loadSelectLinkageResult({fieldId:e,params:s,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),filed:this.fieldSelf,container:this.container}):await this.$bpm.searchSelectOpts(e,"",this.container.cusFormId||_.get(this.container,"form.cusFormId"),this.fieldSelf,!1,s,!1),i&&i(d),d},addOptAssWatch(){if(this.hasAddOptAssWatch)return;let e=_.get(this.fieldConf,"optAssMap"),t=_.get(this.fieldConf,"perm.visible");if(!e||_.isEmpty(e)||!t)return;let n=this.container,a=n.isSubForm;_.map(e,((t,i)=>{i=i.replace(/&/g,".");let r=_.split(i,".");r=_.last(r);let o=this._getPath(r);const s=_.get(this.elementMap,n.fieldConf.id),l=_.get(s,"elements",[]),d=_.keyBy(l,"id");let c=_.get(d,`${r}.type`),u=!!c&&"Mul"==c.substr(0,3);if(!c)return;let m=this.$watch(`form.formData.${n.fieldConf.id}`,(()=>{let t=!0;_.map(e,((e,i)=>{o!=r&&a&&(i=`${n.fieldConf.id}&${this.rowIndex}&${r}`),i=i.replace(/&/g,".");let s=_.get(this.form,`formData.${i}`);if(u){let n=!1;_.each(s,(t=>{t=_.toString(t),_.includes(e,t)&&(n=!0)})),t=t&&n}else s=_.toString(s),t=t&&_.includes(e,s)})),a?(this.displayHidden=!t,this.fieldConf.visible=t):this.fieldConf.perm.visible=t,this.isDelete=!t,console.log("BpmSubFormField watch: visible",t)}),{immediate:!0,deep:!0});this.optAssWatchList.push(m)})),this.hasAddOptAssWatch=!0},clearOptAssWatch(){this.hasAddOptAssWatch=!1,_.each(this.optAssWatchList,(e=>{e()}))},insertDesc(){this.$refs.field},async loadRemoteByFieldMap(e){let t=_.get(this.fieldConf,"mappings");if(console.log("mappings",t),"SelectFromForm"!=this.fieldConf.type||!t||_.isEmpty(t))return;let n=await this.getRemoteByFieldMap();if(!n){let e={};_.each(t,(t=>{e[t.local_field_id]=null})),console.log("_mappingsResult",e),n=e}this.container&&this.container.changeValueByMapping&&this.container.changeValueByMapping(e,n)},async getRemoteByFieldMap(){let e=_.get(this.fieldConf,"mappings");if("SelectFromForm"!=this.fieldConf.type||!e||_.isEmpty(e)||!this.value)return;let t=_.get(this.fieldConf,"id");return(await this.$bpm.loadRmoteFieldMap({fieldId:t,params:{form_id:this.value},cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container})).data}}}),e}()]},s=(0,n(4486).A)(o,a,[],!1,null,null,null);s.options.__file="components/lib/bpmSubFormField/src/main.vue";var l=s.exports;l.install=function(e){e.component(l.name,l)};var d=l},2656:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select",attrs:{value:e.curVal,fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange}},"component",e.$attrs,!1),e.$listeners))};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-time-edit"},[n("el-time-select",{ref:"component",attrs:{"format-model":"number",format:e.format,"value-format":e.checkFormat,"picker-options":{start:"00:00",step:"00:15",end:"24:00"},clearable:e.clearable,disabled:e.disabled},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};i._withStripped=!0;var r=n(6773),o=n.n(r),s=n(5554),l=n.n(s),d=n(7642);l().use(d.TimeSelect);var c={data(){return{curVal:""}},props:["value","fieldConf","row","clearable","disabled"],watch:{value(){this.curVal=this.value}},computed:{format(){return o().get(this.fieldConf,"view.format")},checkFormat(){return o().get(this.fieldConf,"check.format")}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("change",e)}}},u=n(4486),m=(0,u.A)(c,i,[],!1,null,null,null);m.options.__file="components/lib/bpmTime/src/part/editor.vue";var f=m.exports,h=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",[e._v(e._s(e.value))])};h._withStripped=!0;var p={props:["value","fieldConf","row"],data(){return{}},computed:{},watch:{},mounted(){},methods:{}},_=(0,u.A)(p,h,[],!1,null,null,null);_.options.__file="components/lib/bpmTime/src/part/reader.vue";var g=_.exports,y={name:"BpmTime",components:{editorComponent:f,readerComponent:g},props:{value:{type:[String,Number]},fieldConf:{type:Object,default(){return{}}},row:{type:Object,default(){return{}}},mode:{type:String,default(){return"view"}},uiType:{type:String,default(){return"default"}}},data(){return{curVal:""}},computed:{curComponent(){return"view"==this.mode?g:f}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},b=(0,u.A)(y,a,[],!1,null,null,null);b.options.__file="components/lib/bpmTime/src/main.vue";var v=b.exports;v.install=function(e){e.component(v.name,v)};var w=v},5881:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o}});var a=function(){var e=this;e.$createElement;return e._self._c,e._m(0)};a._withStripped=!0;var i=(0,n(4486).A)({name:"Demo"},a,[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"m-demo"},[e._v("demo1")])])}],!1,null,null,null);i.options.__file="components/lib/demo/src/main.vue";var r=i.exports;r.install=function(e){e.component(r.name,r)};var o=r},6751:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o}});var a=function(){var e=this;e.$createElement;return e._self._c,e._m(0)};a._withStripped=!0;var i=(0,n(4486).A)({name:"Demo2"},a,[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"m-demo"},[e._v("demo2")])])}],!1,null,null,null);i.options.__file="components/lib/demo2/src/main.vue";var r=i.exports;r.install=function(e){e.component(r.name,r)};var o=r},7520:function(e,t,n){"use strict";n.d(t,{Q:function(){return o}});let a=[{key:"lt",name:"早于"},{key:"gt",name:"晚于"},{key:"gte",name:"不早于"},{key:"lte",name:"不晚于"}],i=[{key:"in",name:"在列表中"}],r=[{key:"in",name:"在列表中"},{key:"all",name:"包含所有"}];const o={Text:{name:"单行文本",hasBpmField:!0,tableColWidth:240,actions:[{key:"contains",name:"包含"},{key:"eq",name:"等于"}],attrs:["type","value_type","id","name","linkage"]},TextArea:{name:"多行文本",hasBpmField:!0,tableColWidth:300,actions:[{key:"contains",name:"包含"},{key:"eq",name:"等于"}],attrs:["type","value_type","id","name","linkage"]},SerialNumber:{name:"流水号",hasBpmField:!0,actions:[{key:"contains",name:"包含"}],options:{type:"Text"},attrs:["type","id","name","linkage"]},Number:{name:"数字",hasBpmField:!0,tableColWidth:200,actions:[{key:"eq",name:"等于"},{key:"gt",name:"大于"},{key:"gte",name:"大于等于"},{key:"lt",name:"小于"},{key:"lte",name:"小于等于"},{key:"ne",name:"不等于"}],attrs:["type","id","name","value_type","is_int","view.precision","linkage"]},DateTime:{name:"日期时间选择器",tableColWidth:240,hasBpmField:!0,actions:a,attrs:["type","id","name","check.format","view.format","linkage"]},Date:{name:"日期选择器",tableColWidth:240,hasBpmField:!0,actions:a,attrs:["type","id","name","check.format","view.format","linkage"]},Time:{name:"时间选择器",hasBpmField:!0,tableColWidth:240,actions:a,attrs:["type","id","name","check.format","view.format","linkage"]},Timestamp:{name:"※时间戳",tableColWidth:240,actions:a,attrs:["type","id","name","check.format","view.format","linkage"]},Select:{name:"单选",hasBpmField:!0,tableColWidth:220,actions:i,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},Status:{name:"状态",hasBpmField:!0,tableColWidth:150,actions:i,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},MulSelect:{name:"多选",hasBpmField:!0,tableColWidth:220,actions:r,attrs:["type","id","name","value_type","result_type","style","range_enum","linkage"]},SelectFromForm:{name:"远程单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFromForm"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},MulSelectFromForm:{name:"远程多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},SelectFromMulForm:{name:"关联组件",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","range_remote","value_type"]},SelectProject:{name:"项目单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectProject"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectProject:{name:"项目多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectUser:{name:"用户单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectUser"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectUser:{name:"用户多项选择",hasBpmField:!0,tableColWidth:200,actions:r,options:{type:"MulSelectUser"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectURUser:{name:"用户单项选择(新)",hasBpmField:!0,tableColWidth:400,actions:i,options:{type:"MulSelectURUser"},attrs:["type","id","name","range_remote","value_type","filters","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectURUser:{name:"用户多项选择(新)",hasBpmField:!0,tableColWidth:400,actions:r,options:{type:"MulSelectURUser"},attrs:["type","id","name","range_remote","value_type","filters","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectRootCategory:{name:"根任务类型选择",hasBpmField:!0,tableColWidth:200,actions:[{key:"eq",name:"等于"}],attrs:["type","id","name","category_cls","value_type","linkage"]},SelectCheckItem:{name:"检查项单项选择",hasBpmField:!0,actions:i,tableColWidth:200,options:{type:"MulSelectCheckItem"},attrs:["type","id","name","category_cls","value_type","range_remote","root_category","tree_select","can_select","can_select.filter_expression","range_remote.filter_expression","range_remote.depends","linkage"]},MulSelectCheckItem:{name:"检查项多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","category_cls","value_type","range_remote","root_category","tree_select","can_select","can_select.filter_expression","range_remote.filter_expression","range_remote.depends","linkage"]},SelectSort:{name:"分类单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectSort"},attrs:["type","id","name","value_type","range_remote","tree_select","can_select","can_select.filter_expression","range_remote.filter_expression","range_remote.depends","linkage"]},MulSelectSort:{name:"分类多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","value_type","range_remote","tree_select","can_select","can_select.filter_expression","range_remote.filter_expression","range_remote.depends","linkage"]},SelectPartner:{name:"合作伙伴单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectPartner"},attrs:["type","id","name","value_type","range_remote","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectPartner:{name:"合作伙伴多项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectPartner"},attrs:["type","id","name","value_type","range_remote","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectOrg:{name:"单位单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectOrg"},attrs:["type","id","name","value_type","range_remote","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectOrg:{name:"单位多项选择",hasBpmField:!0,tableColWidth:200,actions:r,attrs:["type","id","name","value_type","range_remote","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},Audit:{name:"审批",hasBpmField:!0,actions:[{key:"ar_eq",name:"审批结果等于"},{key:"ar_in",name:"审批结果在列表中"}],actionOptions:[{value:0,label:"未审批"},{value:1,label:"审批通过"},{value:2,label:"审批未通过"}],attrs:["type","id","name","linkage"],options:{result_type:"Array",value_type:"int",type:"MulSelect",style:"default",range_enum:[[0,"未审批"],[1,"通过"],[2,"未通过"]]}},MulArea:{name:"区域多项选择",hasBpmField:!0,tableColWidth:260,actions:r,attrs:["type","id","name","value_type","can","linkage"]},Area:{name:"区域单项选择",hasBpmField:!0,tableColWidth:260,actions:i,options:{type:"MulArea"},attrs:["type","id","name","value_type","can","linkage"]},SelectFormId:{name:"表单单项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},MulSelectFormId:{name:"表单多项选择",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},SelectFromField:{name:"远程单选(从字段)",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFromField"},attrs:["type","id","name","range_remote","style","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},MulSelectFromField:{name:"远程多选(从字段)",hasBpmField:!0,tableColWidth:200,actions:i,options:{type:"MulSelectFromField"},attrs:["type","id","name","range_remote","style","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},MulSelectEntranceForm:{name:"远程多项选择(从入口)",hasBpmField:!0},SelectHouseOwner:{name:"业主选择"},MulSelectIssue:{name:"问题选择"},MulFile:{name:"附件",hasBpmField:!0,tableColWidth:150},MulImage:{name:"图片",hasBpmField:!0,tableColWidth:150},Signature:{name:"签名",hasBpmField:!0},OnlineEditor:{name:"在线文档编辑器"},Spliter:{name:"分割线",hasBpmField:!1},Stepper:{name:"步进器",hasBpmField:!1},Quote:{name:"跨表单数据引用",hasBpmField:!1},Order:{name:"排序控件",hasBpmField:!1},SubForm:{name:"子表单",hasBpmField:!0},XSubForm:{name:"子表单(增强版)",hasBpmField:!0},OrderSubForm:{name:"排序子表单",hasBpmField:!0},AreaElevation:{name:"区域快速选择器",hasBpmField:!0,tableColWidth:200},RichText:{name:"富文本编辑框",hasBpmField:!0,tableColWidth:100}}},9795:function(e,t,n){"use strict";n.d(t,{Fr:function(){return l},uR:function(){return d},zC:function(){return s}});var a=n(6773),i=n.n(a),r=n(5360),o=n.n(r);function s(e,t={}){i().isFunction(e)&&(e=e(t));let n=i().get(e.match(/\?([^#]+)/),"1");if(n){let a=o().parse(n);a=function(...e){return i().assignIn({},...e)}(a,t),e=i().replace(e,n,o().stringify(a))}else e=e+"?"+o().stringify(t);return e}function l(){for(var e=["iphone","ipod","ipad","android","mobile","blackberry","webos","incognito","webmate","bada","nokia","lg","ucweb","skyfire"],t=navigator.userAgent.toLowerCase(),n=!1,a=0,i=e.length;a<i;a++)-1!=t.indexOf(e[a])&&(n=!0);return n}function d(){for(var e=[],t="0123456789abcdef",n=0;n<36;n++)e[n]=t.substr(Math.floor(16*Math.random()),1);return e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}},877:function(e,t,n){var a={"./bpmArea/index.js":2042,"./bpmAreaElevation/index.js":7930,"./bpmAudit/index.js":4789,"./bpmDateTime/index.js":1933,"./bpmField/index.js":9666,"./bpmFieldsFilter/index.js":9335,"./bpmFormField/index.js":4304,"./bpmMulFile/index.js":2622,"./bpmMulImage/index.js":2554,"./bpmNumber/index.js":7698,"./bpmRichText/index.js":5540,"./bpmSelect/index.js":2865,"./bpmSelectCheckItem/index.js":8668,"./bpmSelectEntranceForm/index.js":2179,"./bpmSelectFromField/index.js":9674,"./bpmSelectFromForm/index.js":1567,"./bpmSelectFromId/index.js":2549,"./bpmSelectFromMulForm/index.js":6170,"./bpmSelectHouseOwner/index.js":4413,"./bpmSelectIssue/index.js":8500,"./bpmSelectUser/index.js":9049,"./bpmSignature/index.js":1824,"./bpmSpliter/index.ts":9973,"./bpmSubForm/index.js":8243,"./bpmSubFormField/index.js":1849,"./bpmText/index.ts":1138,"./bpmTime/index.js":2656,"./demo/index.js":5881,"./demo2/index.js":6751,"./index.ts":5990};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=r,e.exports=i,i.id=877},6902:function(e){self,e.exports=function(){"use strict";var e={109:function(e,t,n){n.d(t,{default:function(){return s}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"color-indication"},e._l(e.colorConfig.data,(function(t){return n("div",{key:t.name,staticClass:"color-indication-item",style:{width:t.width}},["left"==e.textPlace?n("span",[e._v(e._s(t.title))]):e._e(),e._v(" "),n("div",{staticClass:"color-rect",style:{"background-color":t.color,"border-color":t.border_color}}),e._v(" "),"right"==e.textPlace?n("span",[e._v(e._s(t.title))]):e._e()])})),0)};a._withStripped=!0;var i={name:"ZjColorIndication",props:{colorConfig:{type:Object,default:function(){return{}}},textPlace:{type:String,default:"right"}}},r=(0,n(900).Z)(i,a,[],!1,null,"3d1ff590",null);r.options.__file="components/lib/color-indication/src/main.vue";var o=r.exports;o.install=function(e){e.component(o.name,o)};var s=o},924:function(e,t,n){n.d(t,{default:function(){return o}});var a=function(){var e=this;return e.$createElement,e._self._c,e._m(0)};a._withStripped=!0;var i=(0,n(900).Z)({name:"Demo"},a,[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"m-demo"},[e._v("demo1")])])}],!1,null,null,null);i.options.__file="components/lib/demo/src/main.vue";var r=i.exports;r.install=function(e){e.component(r.name,r)};var o=r},367:function(e,t,n){n.d(t,{default:function(){return o}});var a=function(){var e=this;return e.$createElement,e._self._c,e._m(0)};a._withStripped=!0;var i=(0,n(900).Z)({name:"Demo2"},a,[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h1",{staticClass:"m-demo"},[e._v("demo2")])])}],!1,null,null,null);i.options.__file="components/lib/demo2/src/main.vue";var r=i.exports;r.install=function(e){e.component(r.name,r)};var o=r},622:function(e,t,n){n.d(t,{default:function(){return u}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-position-table"},[n("div",{staticClass:"select-position-table-content"},[n("div",{staticClass:"select-position-table-content-left",staticStyle:{width:"100px",overflow:"hidden"}},[n("table",{staticClass:"left-table"},[n("tbody",e._l(e.list,(function(t){return n("tr",{key:t.key},[n("td",{staticClass:"floor"},[n("div",[e._v(e._s(t.title))])]),e._v(" "),e._l(t.childrens,(function(a,i){return n("td",{key:a.key,staticStyle:{visibility:"hidden"}},[n("cell-item",{model:{value:t.childrens[i],callback:function(n){e.$set(t.childrens,i,n)},expression:"item.childrens[index]"}})],1)}))],2)})),0)])]),e._v(" "),n("div",{staticClass:"select-position-table-content-right"},[n("table",[n("tbody",e._l(e.list,(function(t){return n("tr",{key:t.key},e._l(t.childrens,(function(a,i){return n("td",{key:a.key},[n("cell-item",{attrs:{readonly:e.readonly},model:{value:t.childrens[i],callback:function(n){e.$set(t.childrens,i,n)},expression:"item.childrens[index]"}})],1)})),0)})),0)])])])])};a._withStripped=!0;var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"position-table-cell"},[n("div",{staticClass:"cell-parent",class:{is_selected:e.curVal.state},style:{background:e.curVal.color}},[n("div",{staticClass:"parent",class:{"only-parent":e.curVal.childrens&&0==e.curVal.childrens.length||!e.curVal.childrens},on:{click:function(t){return e.troggleParent(e.curVal)}}},[e._v(e._s(e.curVal.title)+"\n "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.curVal.state,expression:"curVal.state"}],staticClass:"flag"},[n("i",{staticClass:"icon el-icon-check"})])]),e._v(" "),n("div",{staticClass:"cell-childs"},e._l(e.curVal.childrens,(function(t){return n("div",{key:t.key,staticClass:"cell-child",class:{is_child_selected:t.state&&!e.curVal.state},style:{background:t.color},on:{click:function(n){return e.troggleChild(t)}}},[e._v(e._s(t.title)+"\n\n "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.state&&!e.curVal.state,expression:"child_item.state && !curVal.state"}],staticClass:"flag"},[n("i",{staticClass:"icon el-icon-check"})])])})),0)])])};i._withStripped=!0;var r={props:{value:{type:Object,default:function(){return{}}},readonly:{type:Boolean,default:!1}},data(){return{curVal:{}}},watch:{value(e){this.curVal=e}},methods:{troggleParent(e){if(this.readonly)return!1;if(console.log("item",e),e.color&&"#FFFFFF"!=e.color&&"#ffffff"!=e.color&&"#FFF"!=e.color&&"#fff"!=e.color)return!1;let t=!1;if(_.each(this.curVal.childrens,(e=>{e.color&&"#FFFFFF"!=e.color&&"#ffffff"!=e.color&&"#FFF"!=e.color&&"#fff"!=e.color&&(t=!0)})),t)return!1;this.curVal.state=!this.curVal.state,_.each(this.curVal.childrens,(e=>{e.state=this.curVal.state})),this.setVal()},troggleChild(e){if(console.log("child_item",e),console.log("this.curVal",this.curVal),this.readonly)return!1;if(e.color&&"#FFFFFF"!=e.color&&"#ffffff"!=e.color&&"#FFF"!=e.color&&"#fff"!=e.color)return!1;e.state=!e.state;let t=!0;_.each(this.curVal.childrens,(e=>{e.state||(t=!1)})),this.curVal.state=t,this.setVal()},setVal(){this.$emit("input",this.curVal)}},mounted(){this.curVal=this.value}},o=n(900),s=(0,o.Z)(r,i,[],!1,null,null,null);s.options.__file="components/lib/select-position-table/src/widgets/cell-item.vue";var l={name:"ZjPcSelectPositionTable",components:{CellItem:s.exports},props:{value:{type:Array,default:function(){return[]}},data:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1},withParent:{type:Boolean,default:!0}},watch:{value:{handler(){this.setSelectedItem()},deep:!0},data:{handler(e){this.list=_.cloneDeep(e),this.setSelectedItem()},deep:!0,immediate:!0},list:{handler(e){this.getSelectedItem(e)},deep:!0}},data(){return{list:[]}},methods:{setSelectedItem(){_.each(this.list,(e=>{_.each(e.childrens,(e=>{if(e.childrens&&e.childrens.length>0){let t=0;_.each(e.childrens,(e=>{_.find(this.value,{key:e.key})?(e.state=!0,t++):e.state=!1})),t==e.childrens.length?e.state=!0:e.state=!1}else _.find(this.value,{key:e.key})?e.state=!0:e.state=!1}))}))},getSelectedItem(e){let t=[];_.each(e,(e=>{_.each(e.childrens,(n=>{n.childrens&&n.childrens.length>0?(_.each(n.childrens,(a=>{a.state&&t.push({name:e.title+"-"+n.title+"-"+a.title,key:a.key})})),this.withParent&&n.state&&t.push({name:e.title+"-"+n.title,key:n.key})):n.state&&t.push({name:e.title+"-"+n.title,key:n.key})}))})),this.$emit("input",t)}},mounted(){}},d=(0,o.Z)(l,a,[],!1,null,null,null);d.options.__file="components/lib/select-position-table/src/main.vue";var c=d.exports;c.install=function(e){e.component(c.name,c)};var u=c},387:function(e,t,n){n.d(t,{default:function(){return ut}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-popover",{ref:"col_config",attrs:{"popper-class":"table-cloumn-configer",placement:"bottom",width:"200",trigger:"click"}},[n("div",{staticClass:"content"},[n("div",[e.showConfirm?n("div",{staticClass:"btn-grp"},[n("el-button",{attrs:{round:"",size:"mini",disabled:!e.editing},on:{click:e.reset}},[e._v(e._s(e.$z("重置","c.reset"))+"\n ")]),e._v(" "),n("el-button",{attrs:{type:"primary",round:"",size:"mini",disabled:!e.editing},on:{click:e.submit}},[e._v(e._s(e.$z("确定","c.confirm"))+"\n ")])],1):e._e(),e._v(" "),n("div",{staticClass:"tip"},[e._v("\n "+e._s(e.$z("提示:拖拽可排序","b2.common.tip_can_drap_sort")))])]),e._v(" "),n("ul",{staticClass:"col-config-list"},e._l(e.cols_config,(function(t,a){return n("li",{key:""+a,staticStyle:{cursor:"grab"}},[n("el-checkbox",{on:{change:function(t){return e.checkboxClick()}},model:{value:t.show,callback:function(n){e.$set(t,"show",n)},expression:"col.show"}}),e._v(" "),n("div",{staticClass:"item-name",attrs:{title:t.label}},[e._v("\n "+e._s(t.label)+"\n ")])],1)})),0)]),e._v(" "),e._t("default",(function(){return[n("i",{staticClass:"el-icon-s-tools",staticStyle:{"font-size":"20px",color:"#666",cursor:"pointer"},attrs:{title:"设置字段"}})]}),{slot:"reference"})],2)],1)};function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)}function d(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}a._withStripped=!0;var c=d(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),u=d(/Edge/i),m=d(/firefox/i),f=d(/safari/i)&&!d(/chrome/i)&&!d(/android/i),h=d(/iP(ad|od|hone)/i),p=d(/chrome/i)&&d(/android/i),g={capture:!1,passive:!1};function y(e,t,n){e.addEventListener(t,n,!c&&g)}function b(e,t,n){e.removeEventListener(t,n,!c&&g)}function v(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function w(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function M(e,t,n,a){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&v(e,t):v(e,t))||a&&e===n)return e;if(e===n)break}while(e=w(e))}return null}var L,k=/\s+/g;function S(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(k," ").replace(" "+t+" "," ");e.className=(a+(n?" "+t:"")).replace(k," ")}}function D(e,t,n){var a=e&&e.style;if(a){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in a||-1!==t.indexOf("webkit")||(t="-webkit-"+t),a[t]=n+("string"==typeof n?"":"px")}}function x(e,t){var n="";if("string"==typeof e)n=e;else do{var a=D(e,"transform");a&&"none"!==a&&(n=a+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Y(e,t,n){if(e){var a=e.getElementsByTagName(t),i=0,r=a.length;if(n)for(;i<r;i++)n(a[i],i);return a}return[]}function T(){return document.scrollingElement||document.documentElement}function C(e,t,n,a,i){if(e.getBoundingClientRect||e===window){var r,o,s,l,d,u,m;if(e!==window&&e.parentNode&&e!==T()?(o=(r=e.getBoundingClientRect()).top,s=r.left,l=r.bottom,d=r.right,u=r.height,m=r.width):(o=0,s=0,l=window.innerHeight,d=window.innerWidth,u=window.innerHeight,m=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!c))do{if(i&&i.getBoundingClientRect&&("none"!==D(i,"transform")||n&&"static"!==D(i,"position"))){var f=i.getBoundingClientRect();o-=f.top+parseInt(D(i,"border-top-width")),s-=f.left+parseInt(D(i,"border-left-width")),l=o+r.height,d=s+r.width;break}}while(i=i.parentNode);if(a&&e!==window){var h=x(i||e),p=h&&h.a,_=h&&h.d;h&&(l=(o/=_)+(u/=_),d=(s/=p)+(m/=p))}return{top:o,left:s,bottom:l,right:d,width:m,height:u}}}function j(e){var t=C(e),n=parseInt(D(e,"padding-left")),a=parseInt(D(e,"padding-top")),i=parseInt(D(e,"padding-right")),r=parseInt(D(e,"padding-bottom"));return t.top+=a+parseInt(D(e,"border-top-width")),t.left+=n+parseInt(D(e,"border-left-width")),t.width=e.clientWidth-n-i,t.height=e.clientHeight-a-r,t.bottom=t.top+t.height,t.right=t.left+t.width,t}function $(e,t,n){for(var a=O(e,!0),i=C(e)[t];a;){var r=C(a)[n];if(!("top"===n||"left"===n?i>=r:i<=r))return a;if(a===T())break;a=O(a,!1)}return!1}function P(e,t,n,a){for(var i=0,r=0,o=e.children;r<o.length;){if("none"!==o[r].style.display&&o[r]!==He.ghost&&(a||o[r]!==He.dragged)&&M(o[r],n.draggable,e,!1)){if(i===t)return o[r];i++}r++}return null}function I(e,t){for(var n=e.lastElementChild;n&&(n===He.ghost||"none"===D(n,"display")||t&&!v(n,t));)n=n.previousElementSibling;return n||null}function F(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===He.clone||t&&!v(e,t)||n++;return n}function E(e){var t=0,n=0,a=T();if(e)do{var i=x(e),r=i.a,o=i.d;t+=e.scrollLeft*r,n+=e.scrollTop*o}while(e!==a&&(e=e.parentNode));return[t,n]}function O(e,t){if(!e||!e.getBoundingClientRect)return T();var n=e,a=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=D(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return T();if(a||t)return n;a=!0}}}while(n=n.parentNode);return T()}function A(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function H(e,t){return function(){if(!L){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),L=setTimeout((function(){L=void 0}),t)}}}function N(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function R(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var z="Sortable"+(new Date).getTime(),V=[],W={initializeByDefault:!0},B={mount:function(e){for(var t in W)W.hasOwnProperty(t)&&!(t in e)&&(e[t]=W[t]);V.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),V.push(e)},pluginEvent:function(e,t,n){var a=this;this.eventCanceled=!1,n.cancel=function(){a.eventCanceled=!0};var i=e+"Global";V.forEach((function(a){t[a.pluginName]&&(t[a.pluginName][i]&&t[a.pluginName][i](r({sortable:t},n)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](r({sortable:t},n)))}))},initializePlugins:function(e,t,n,a){for(var i in V.forEach((function(a){var i=a.pluginName;if(e.options[i]||a.initializeByDefault){var r=new a(e,t,e.options);r.sortable=e,r.options=e.options,e[i]=r,l(n,r.defaults)}})),e.options)if(e.options.hasOwnProperty(i)){var r=this.modifyOption(e,i,e.options[i]);void 0!==r&&(e.options[i]=r)}},getEventProperties:function(e,t){var n={};return V.forEach((function(a){"function"==typeof a.eventProperties&&l(n,a.eventProperties.call(t[a.pluginName],e))})),n},modifyOption:function(e,t,n){var a;return V.forEach((function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(a=i.optionListeners[t].call(e[i.pluginName],n))})),a}},U=["evt"],G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.evt,i=function(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,U);B.pluginEvent.bind(He)(e,t,r({dragEl:J,parentEl:K,ghostEl:X,rootEl:Z,nextEl:Q,lastDownEl:ee,cloneEl:te,cloneHidden:ne,dragStarted:pe,putSortable:le,activeSortable:He.active,originalEvent:a,oldIndex:ae,oldDraggableIndex:re,newIndex:ie,newDraggableIndex:oe,hideGhostForTarget:Fe,unhideGhostForTarget:Ee,cloneNowHidden:function(){ne=!0},cloneNowShown:function(){ne=!1},dispatchSortableEvent:function(e){q({sortable:t,name:e,originalEvent:a})}},i))};function q(e){!function(e){var t=e.sortable,n=e.rootEl,a=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,l=e.fromEl,d=e.oldIndex,m=e.newIndex,f=e.oldDraggableIndex,h=e.newDraggableIndex,p=e.originalEvent,_=e.putSortable,g=e.extraEventProperties;if(t=t||n&&n[z]){var y,b=t.options,v="on"+a.charAt(0).toUpperCase()+a.substr(1);!window.CustomEvent||c||u?(y=document.createEvent("Event")).initEvent(a,!0,!0):y=new CustomEvent(a,{bubbles:!0,cancelable:!0}),y.to=s||n,y.from=l||n,y.item=i||n,y.clone=o,y.oldIndex=d,y.newIndex=m,y.oldDraggableIndex=f,y.newDraggableIndex=h,y.originalEvent=p,y.pullMode=_?_.lastPutMode:void 0;var w=r(r({},g),B.getEventProperties(a,t));for(var M in w)y[M]=w[M];n&&n.dispatchEvent(y),b[v]&&b[v].call(t,y)}}(r({putSortable:le,cloneEl:te,targetEl:J,rootEl:Z,oldIndex:ae,oldDraggableIndex:re,newIndex:ie,newDraggableIndex:oe},e))}var J,K,X,Z,Q,ee,te,ne,ae,ie,re,oe,se,le,de,ce,ue,me,fe,he,pe,_e,ge,ye,be,ve=!1,we=!1,Me=[],Le=!1,ke=!1,Se=[],De=!1,xe=[],Ye="undefined"!=typeof document,Te=h,Ce=u||c?"cssFloat":"float",je=Ye&&!p&&!h&&"draggable"in document.createElement("div"),$e=function(){if(Ye){if(c)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Pe=function(e,t){var n=D(e),a=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=P(e,0,t),r=P(e,1,t),o=i&&D(i),s=r&&D(r),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+C(i).width,d=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+C(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&o.float&&"none"!==o.float){var c="left"===o.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==c?"horizontal":"vertical"}return i&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=a&&"none"===n[Ce]||r&&"none"===n[Ce]&&l+d>a)?"vertical":"horizontal"},Ie=function(e){function t(e,n){return function(a,i,r,o){var s=a.options.group.name&&i.options.group.name&&a.options.group.name===i.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(a,i,r,o),n)(a,i,r,o);var l=(n?a:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},a=e.group;a&&"object"==o(a)||(a={name:a}),n.name=a.name,n.checkPull=t(a.pull,!0),n.checkPut=t(a.put),n.revertClone=a.revertClone,e.group=n},Fe=function(){!$e&&X&&D(X,"display","none")},Ee=function(){!$e&&X&&D(X,"display","")};Ye&&!p&&document.addEventListener("click",(function(e){if(we)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),we=!1,!1}),!0);var Oe=function(e){if(J){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,r=e.clientY,Me.some((function(e){var t=e[z].options.emptyInsertThreshold;if(t&&!I(e)){var n=C(e),a=i>=n.left-t&&i<=n.right+t,s=r>=n.top-t&&r<=n.bottom+t;return a&&s?o=e:void 0}})),o);if(t){var n={};for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[z]._onDragOver(n)}}var i,r,o},Ae=function(e){J&&J.parentNode[z]._isOutsideThisEl(e.target)};function He(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=l({},t),e[z]=this;var n,a,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Pe(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==He.supportPointer&&"PointerEvent"in window&&!f,emptyInsertThreshold:5};for(var o in B.initializePlugins(this,e,i),i)!(o in t)&&(t[o]=i[o]);for(var s in Ie(t),this)"_"===s.charAt(0)&&"function"==typeof this[s]&&(this[s]=this[s].bind(this));this.nativeDraggable=!t.forceFallback&&je,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?y(e,"pointerdown",this._onTapStart):(y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Me.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),l(this,(a=[],{captureAnimationState:function(){a=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==D(e,"display")&&e!==He.ghost){a.push({target:e,rect:C(e)});var t=r({},a[a.length-1].rect);if(e.thisAnimationDuration){var n=x(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){a.push(e)},removeAnimationState:function(e){a.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var a in t)if(t.hasOwnProperty(a)&&t[a]===e[n][a])return Number(n);return-1}(a,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var i=!1,r=0;a.forEach((function(e){var n=0,a=e.target,o=a.fromRect,s=C(a),l=a.prevFromRect,d=a.prevToRect,c=e.rect,u=x(a,!0);u&&(s.top-=u.f,s.left-=u.e),a.toRect=s,a.thisAnimationDuration&&A(l,s)&&!A(o,s)&&(c.top-s.top)/(c.left-s.left)==(o.top-s.top)/(o.left-s.left)&&(n=function(e,t,n,a){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*a.animation}(c,l,d,t.options)),A(s,o)||(a.prevFromRect=o,a.prevToRect=s,n||(n=t.options.animation),t.animate(a,c,s,n)),n&&(i=!0,r=Math.max(r,n),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout((function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null}),n),a.thisAnimationDuration=n)})),clearTimeout(n),i?n=setTimeout((function(){"function"==typeof e&&e()}),r):"function"==typeof e&&e(),a=[]},animate:function(e,t,n,a){if(a){D(e,"transition",""),D(e,"transform","");var i=x(this.el),r=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(r||1),l=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!l,D(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),D(e,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),D(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){D(e,"transition",""),D(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),a)}}}))}function Ne(e,t,n,a,i,r,o,s){var l,d,m=e[z],f=m.options.onMove;return!window.CustomEvent||c||u?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=a,l.related=i||t,l.relatedRect=r||C(t),l.willInsertAfter=s,l.originalEvent=o,e.dispatchEvent(l),f&&(d=f.call(m,l,o)),d}function Re(e){e.draggable=!1}function ze(){De=!1}function Ve(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,a=0;n--;)a+=t.charCodeAt(n);return a.toString(36)}function We(e){return setTimeout(e,0)}function Be(e){return clearTimeout(e)}He.prototype={constructor:He,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(_e=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,J):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,a=this.options,i=a.preventOnFilter,r=e.type,o=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(o||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,d=a.filter;if(function(e){xe.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var a=t[n];a.checked&&xe.push(a)}}(n),!J&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||a.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!f||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=M(s,a.draggable,n,!1))&&s.animated||ee===s)){if(ae=F(s),re=F(s,a.draggable),"function"==typeof d){if(d.call(this,e,s,this))return q({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),G("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(d&&(d=d.split(",").some((function(a){if(a=M(l,a.trim(),n,!1))return q({sortable:t,rootEl:a,name:"filter",targetEl:s,fromEl:n,toEl:n}),G("filter",t,{evt:e}),!0}))))return void(i&&e.cancelable&&e.preventDefault());a.handle&&!M(l,a.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var a,i=this,r=i.el,o=i.options,s=r.ownerDocument;if(n&&!J&&n.parentNode===r){var l=C(n);if(Z=r,K=(J=n).parentNode,Q=J.nextSibling,ee=n,se=o.group,He.dragged=J,de={target:J,clientX:(t||e).clientX,clientY:(t||e).clientY},fe=de.clientX-l.left,he=de.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,J.style["will-change"]="all",a=function(){G("delayEnded",i,{evt:e}),He.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!m&&i.nativeDraggable&&(J.draggable=!0),i._triggerDragStart(e,t),q({sortable:i,name:"choose",originalEvent:e}),S(J,o.chosenClass,!0))},o.ignore.split(",").forEach((function(e){Y(J,e.trim(),Re)})),y(s,"dragover",Oe),y(s,"mousemove",Oe),y(s,"touchmove",Oe),y(s,"mouseup",i._onDrop),y(s,"touchend",i._onDrop),y(s,"touchcancel",i._onDrop),m&&this.nativeDraggable&&(this.options.touchStartThreshold=4,J.draggable=!0),G("delayStart",this,{evt:e}),!o.delay||o.delayOnTouchOnly&&!t||this.nativeDraggable&&(u||c))a();else{if(He.eventCanceled)return void this._onDrop();y(s,"mouseup",i._disableDelayedDrag),y(s,"touchend",i._disableDelayedDrag),y(s,"touchcancel",i._disableDelayedDrag),y(s,"mousemove",i._delayedDragTouchMoveHandler),y(s,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&y(s,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(a,o.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){J&&Re(J),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):y(document,t?"touchmove":"mousemove",this._onTouchMove):(y(J,"dragend",this),y(Z,"dragstart",this._onDragStart));try{document.selection?We((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ve=!1,Z&&J){G("dragStarted",this,{evt:t}),this.nativeDraggable&&y(document,"dragover",Ae);var n=this.options;!e&&S(J,n.dragClass,!1),S(J,n.ghostClass,!0),He.active=this,e&&this._appendGhost(),q({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ce){this._lastX=ce.clientX,this._lastY=ce.clientY,Fe();for(var e=document.elementFromPoint(ce.clientX,ce.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ce.clientX,ce.clientY))!==t;)t=e;if(J.parentNode[z]._isOutsideThisEl(e),t)do{if(t[z]&&t[z]._onDragOver({clientX:ce.clientX,clientY:ce.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Ee()}},_onTouchMove:function(e){if(de){var t=this.options,n=t.fallbackTolerance,a=t.fallbackOffset,i=e.touches?e.touches[0]:e,r=X&&x(X,!0),o=X&&r&&r.a,s=X&&r&&r.d,l=Te&&be&&E(be),d=(i.clientX-de.clientX+a.x)/(o||1)+(l?l[0]-Se[0]:0)/(o||1),c=(i.clientY-de.clientY+a.y)/(s||1)+(l?l[1]-Se[1]:0)/(s||1);if(!He.active&&!ve){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(X){r?(r.e+=d-(ue||0),r.f+=c-(me||0)):r={a:1,b:0,c:0,d:1,e:d,f:c};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");D(X,"webkitTransform",u),D(X,"mozTransform",u),D(X,"msTransform",u),D(X,"transform",u),ue=d,me=c,ce=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!X){var e=this.options.fallbackOnBody?document.body:Z,t=C(J,!0,Te,!0,e),n=this.options;if(Te){for(be=e;"static"===D(be,"position")&&"none"===D(be,"transform")&&be!==document;)be=be.parentNode;be!==document.body&&be!==document.documentElement?(be===document&&(be=T()),t.top+=be.scrollTop,t.left+=be.scrollLeft):be=T(),Se=E(be)}S(X=J.cloneNode(!0),n.ghostClass,!1),S(X,n.fallbackClass,!0),S(X,n.dragClass,!0),D(X,"transition",""),D(X,"transform",""),D(X,"box-sizing","border-box"),D(X,"margin",0),D(X,"top",t.top),D(X,"left",t.left),D(X,"width",t.width),D(X,"height",t.height),D(X,"opacity","0.8"),D(X,"position",Te?"absolute":"fixed"),D(X,"zIndex","100000"),D(X,"pointerEvents","none"),He.ghost=X,e.appendChild(X),D(X,"transform-origin",fe/parseInt(X.style.width)*100+"% "+he/parseInt(X.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,a=e.dataTransfer,i=n.options;G("dragStart",this,{evt:e}),He.eventCanceled?this._onDrop():(G("setupClone",this),He.eventCanceled||((te=R(J)).removeAttribute("id"),te.draggable=!1,te.style["will-change"]="",this._hideClone(),S(te,this.options.chosenClass,!1),He.clone=te),n.cloneId=We((function(){G("clone",n),He.eventCanceled||(n.options.removeCloneOnHide||Z.insertBefore(te,J),n._hideClone(),q({sortable:n,name:"clone"}))})),!t&&S(J,i.dragClass,!0),t?(we=!0,n._loopId=setInterval(n._emulateDragOver,50)):(b(document,"mouseup",n._onDrop),b(document,"touchend",n._onDrop),b(document,"touchcancel",n._onDrop),a&&(a.effectAllowed="move",i.setData&&i.setData.call(n,a,J)),y(document,"drop",n),D(J,"transform","translateZ(0)")),ve=!0,n._dragStartId=We(n._dragStarted.bind(n,t,e)),y(document,"selectstart",n),pe=!0,f&&D(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,a,i,o=this.el,s=e.target,l=this.options,d=l.group,c=He.active,u=se===d,m=l.sort,f=le||c,h=this,p=!1;if(!De){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=M(s,l.draggable,o,!0),H("dragOver"),He.eventCanceled)return p;if(J.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||h._ignoreWhileAnimating===s)return V(!1);if(we=!1,c&&!l.disabled&&(u?m||(a=K!==Z):le===this||(this.lastPutMode=se.checkPull(this,c,J,e))&&d.checkPut(this,c,J,e))){if(i="vertical"===this._getDirection(e,s),t=C(J),H("dragOverValid"),He.eventCanceled)return p;if(a)return K=Z,R(),this._hideClone(),H("revert"),He.eventCanceled||(Q?Z.insertBefore(J,Q):Z.appendChild(J)),V(!0);var _=I(o,l.draggable);if(!_||function(e,t,n){var a=C(I(n.el,n.options.draggable)),i=j(n.el);return t?e.clientX>i.right+10||e.clientY>a.bottom&&e.clientX>a.left:e.clientY>i.bottom+10||e.clientX>a.right&&e.clientY>a.top}(e,i,this)&&!_.animated){if(_===J)return V(!1);if(_&&o===e.target&&(s=_),s&&(n=C(s)),!1!==Ne(Z,o,J,t,s,n,e,!!s))return R(),_&&_.nextSibling?o.insertBefore(J,_.nextSibling):o.appendChild(J),K=o,W(),V(!0)}else if(_&&function(e,t,n){var a=C(P(n.el,0,n.options,!0)),i=j(n.el);return t?e.clientX<i.left-10||e.clientY<a.top&&e.clientX<a.right:e.clientY<i.top-10||e.clientY<a.bottom&&e.clientX<a.left}(e,i,this)){var g=P(o,0,l,!0);if(g===J)return V(!1);if(n=C(s=g),!1!==Ne(Z,o,J,t,s,n,e,!1))return R(),o.insertBefore(J,g),K=o,W(),V(!0)}else if(s.parentNode===o){n=C(s);var y,b,v,w=J.parentNode!==o,L=!function(e,t,n){var a=n?e.left:e.top,i=n?e.right:e.bottom,r=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return a===o||i===s||a+r/2===o+l/2}(J.animated&&J.toRect||t,s.animated&&s.toRect||n,i),k=i?"top":"left",x=$(s,"top","top")||$(J,"top","top"),Y=x?x.scrollTop:void 0;if(_e!==s&&(b=n[k],Le=!1,ke=!L&&l.invertSwap||w),y=function(e,t,n,a,i,r,o,s){var l=a?e.clientY:e.clientX,d=a?n.height:n.width,c=a?n.top:n.left,u=a?n.bottom:n.right,m=!1;if(!o)if(s&&ye<d*i){if(!Le&&(1===ge?l>c+d*r/2:l<u-d*r/2)&&(Le=!0),Le)m=!0;else if(1===ge?l<c+ye:l>u-ye)return-ge}else if(l>c+d*(1-i)/2&&l<u-d*(1-i)/2)return function(e){return F(J)<F(e)?1:-1}(t);return(m=m||o)&&(l<c+d*r/2||l>u-d*r/2)?l>c+d/2?1:-1:0}(e,s,n,i,L?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,ke,_e===s),0!==y){var T=F(J);do{T-=y,v=K.children[T]}while(v&&("none"===D(v,"display")||v===X))}if(0===y||v===s)return V(!1);_e=s,ge=y;var E=s.nextElementSibling,O=!1,A=Ne(Z,o,J,t,s,n,e,O=1===y);if(!1!==A)return 1!==A&&-1!==A||(O=1===A),De=!0,setTimeout(ze,30),R(),O&&!E?o.appendChild(J):s.parentNode.insertBefore(J,O?E:s),x&&N(x,0,Y-x.scrollTop),K=J.parentNode,void 0===b||ke||(ye=Math.abs(b-C(s)[k])),W(),V(!0)}if(o.contains(J))return V(!1)}return!1}function H(l,d){G(l,h,r({evt:e,isOwner:u,axis:i?"vertical":"horizontal",revert:a,dragRect:t,targetRect:n,canSort:m,fromSortable:f,target:s,completed:V,onMove:function(n,a){return Ne(Z,o,J,t,n,C(n),e,a)},changed:W},d))}function R(){H("dragOverAnimationCapture"),h.captureAnimationState(),h!==f&&f.captureAnimationState()}function V(t){return H("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(h),h!==f&&(S(J,le?le.options.ghostClass:c.options.ghostClass,!1),S(J,l.ghostClass,!0)),le!==h&&h!==He.active?le=h:h===He.active&&le&&(le=null),f===h&&(h._ignoreWhileAnimating=s),h.animateAll((function(){H("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(s===J&&!J.animated||s===o&&!s.animated)&&(_e=null),l.dragoverBubble||e.rootEl||s===document||(J.parentNode[z]._isOutsideThisEl(e.target),!t&&Oe(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),p=!0}function W(){ie=F(J),oe=F(J,l.draggable),q({sortable:h,name:"change",toEl:o,newIndex:ie,newDraggableIndex:oe,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){b(document,"mousemove",this._onTouchMove),b(document,"touchmove",this._onTouchMove),b(document,"pointermove",this._onTouchMove),b(document,"dragover",Oe),b(document,"mousemove",Oe),b(document,"touchmove",Oe)},_offUpEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._onDrop),b(e,"touchend",this._onDrop),b(e,"pointerup",this._onDrop),b(e,"touchcancel",this._onDrop),b(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ie=F(J),oe=F(J,n.draggable),G("drop",this,{evt:e}),K=J&&J.parentNode,ie=F(J),oe=F(J,n.draggable),He.eventCanceled||(ve=!1,ke=!1,Le=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Be(this.cloneId),Be(this._dragStartId),this.nativeDraggable&&(b(document,"drop",this),b(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),f&&D(document.body,"user-select",""),D(J,"transform",""),e&&(pe&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),X&&X.parentNode&&X.parentNode.removeChild(X),(Z===K||le&&"clone"!==le.lastPutMode)&&te&&te.parentNode&&te.parentNode.removeChild(te),J&&(this.nativeDraggable&&b(J,"dragend",this),Re(J),J.style["will-change"]="",pe&&!ve&&S(J,le?le.options.ghostClass:this.options.ghostClass,!1),S(J,this.options.chosenClass,!1),q({sortable:this,name:"unchoose",toEl:K,newIndex:null,newDraggableIndex:null,originalEvent:e}),Z!==K?(ie>=0&&(q({rootEl:K,name:"add",toEl:K,fromEl:Z,originalEvent:e}),q({sortable:this,name:"remove",toEl:K,originalEvent:e}),q({rootEl:K,name:"sort",toEl:K,fromEl:Z,originalEvent:e}),q({sortable:this,name:"sort",toEl:K,originalEvent:e})),le&&le.save()):ie!==ae&&ie>=0&&(q({sortable:this,name:"update",toEl:K,originalEvent:e}),q({sortable:this,name:"sort",toEl:K,originalEvent:e})),He.active&&(null!=ie&&-1!==ie||(ie=ae,oe=re),q({sortable:this,name:"end",toEl:K,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){G("nulling",this),Z=J=K=X=Q=te=ee=ne=de=ce=pe=ie=oe=ae=re=_e=ge=le=se=He.dragged=He.ghost=He.clone=He.active=null,xe.forEach((function(e){e.checked=!0})),xe.length=ue=me=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":J&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,a=0,i=n.length,r=this.options;a<i;a++)M(e=n[a],r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||Ve(e));return t},sort:function(e,t){var n={},a=this.el;this.toArray().forEach((function(e,t){var i=a.children[t];M(i,this.options.draggable,a,!1)&&(n[e]=i)}),this),t&&this.captureAnimationState(),e.forEach((function(e){n[e]&&(a.removeChild(n[e]),a.appendChild(n[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return M(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var a=B.modifyOption(this,e,t);n[e]=void 0!==a?a:t,"group"===e&&Ie(n)},destroy:function(){G("destroy",this);var e=this.el;e[z]=null,b(e,"mousedown",this._onTapStart),b(e,"touchstart",this._onTapStart),b(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(b(e,"dragover",this),b(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Me.splice(Me.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ne){if(G("hideClone",this),He.eventCanceled)return;D(te,"display","none"),this.options.removeCloneOnHide&&te.parentNode&&te.parentNode.removeChild(te),ne=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(ne){if(G("showClone",this),He.eventCanceled)return;J.parentNode!=Z||this.options.group.revertClone?Q?Z.insertBefore(te,Q):Z.appendChild(te):Z.insertBefore(te,J),this.options.group.revertClone&&this.animate(J,te),D(te,"display",""),ne=!1}}else this._hideClone()}},Ye&&y(document,"touchmove",(function(e){(He.active||ve)&&e.cancelable&&e.preventDefault()})),He.utils={on:y,off:b,css:D,find:Y,is:function(e,t){return!!M(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:H,closest:M,toggleClass:S,clone:R,index:F,nextTick:We,cancelNextTick:Be,detectDirection:Pe,getChild:P},He.get=function(e){return e[z]},He.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(He.utils=r(r({},He.utils),e.utils)),B.mount(e)}))},He.create=function(e,t){return new He(e,t)},He.version="1.15.1";var Ue,Ge,qe,Je,Ke,Xe,Ze=[],Qe=!1;function et(){Ze.forEach((function(e){clearInterval(e.pid)})),Ze=[]}function tt(){clearInterval(Xe)}var nt=H((function(e,t,n,a){if(t.scroll){var i,r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,d=T(),c=!1;Ge!==n&&(Ge=n,et(),Ue=t.scroll,i=t.scrollFn,!0===Ue&&(Ue=O(n,!0)));var u=0,m=Ue;do{var f=m,h=C(f),p=h.top,_=h.bottom,g=h.left,y=h.right,b=h.width,v=h.height,w=void 0,M=void 0,L=f.scrollWidth,k=f.scrollHeight,S=D(f),x=f.scrollLeft,Y=f.scrollTop;f===d?(w=b<L&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),M=v<k&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(w=b<L&&("auto"===S.overflowX||"scroll"===S.overflowX),M=v<k&&("auto"===S.overflowY||"scroll"===S.overflowY));var j=w&&(Math.abs(y-r)<=s&&x+b<L)-(Math.abs(g-r)<=s&&!!x),$=M&&(Math.abs(_-o)<=s&&Y+v<k)-(Math.abs(p-o)<=s&&!!Y);if(!Ze[u])for(var P=0;P<=u;P++)Ze[P]||(Ze[P]={});Ze[u].vx==j&&Ze[u].vy==$&&Ze[u].el===f||(Ze[u].el=f,Ze[u].vx=j,Ze[u].vy=$,clearInterval(Ze[u].pid),0==j&&0==$||(c=!0,Ze[u].pid=setInterval(function(){a&&0===this.layer&&He.active._onTouchMove(Ke);var t=Ze[this.layer].vy?Ze[this.layer].vy*l:0,n=Ze[this.layer].vx?Ze[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(He.dragged.parentNode[z],n,t,e,Ke,Ze[this.layer].el)||N(Ze[this.layer].el,n,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&m!==d&&(m=O(m,!1)));Qe=c}}),30),at=function(e){var t=e.originalEvent,n=e.putSortable,a=e.dragEl,i=e.activeSortable,r=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||i;o();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(d.clientX,d.clientY);s(),l&&!l.el.contains(c)&&(r("spill"),this.onSpill({dragEl:a,putSortable:n}))}};function it(){}function rt(){}it.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var a=P(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(t,a):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:at},l(it,{pluginName:"revertOnSpill"}),rt.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:at},l(rt,{pluginName:"removeOnSpill"}),He.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?y(document,"pointermove",this._handleFallbackAutoScroll):t.touches?y(document,"touchmove",this._handleFallbackAutoScroll):y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?b(document,"dragover",this._handleAutoScroll):(b(document,"pointermove",this._handleFallbackAutoScroll),b(document,"touchmove",this._handleFallbackAutoScroll),b(document,"mousemove",this._handleFallbackAutoScroll)),tt(),et(),clearTimeout(L),L=void 0},nulling:function(){Ke=Ge=Ue=Qe=Xe=qe=Je=null,Ze.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,a=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(a,i);if(Ke=e,t||this.options.forceAutoScrollFallback||u||c||f){nt(e,this.options,r,t);var o=O(r,!0);!Qe||Xe&&a===qe&&i===Je||(Xe&&tt(),Xe=setInterval((function(){var r=O(document.elementFromPoint(a,i),!0);r!==o&&(o=r,et()),nt(e,n.options,r,t)}),10),qe=a,Je=i)}else{if(!this.options.bubbleScroll||O(r,!0)===T())return void et();nt(e,this.options,O(r,!1),!1)}}},l(e,{pluginName:"scroll",initializeByDefault:!0})}),He.mount(rt,it);var ot=He,st={name:"ZjTableColumnConfiger",props:{defaultColumnShowCount:{type:Number,default:20},defaultColumnShowKeys:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},columnKey:{type:String,default:"id"},props:{type:Object,default(){return{label:"label"}}},showConfirm:{type:Boolean,default:!1},tag:{type:String,default:""},userId:{type:[String,Number],default:""}},watch:{columns(e){console.log("newValue",e),this.cols_config=this.getCustomerColsConfig(e),this.$emit("change",this.cols_config)}},data(){return{editing:!1,visible:!1,cols_config:[],ColsConfigTmp:[]}},methods:{reset(){this.cols_config=[],this.$nextTick((()=>{this.cols_config=this.getCustomerColsConfig(this.columns)})),this.editing=!1},submit(){this.update(),this.editing=!1},update(){console.log("update: ",this.cols_config),this.setCutomerColsConfig(),this.$emit("change",this.cols_config)},checkboxClick(){this.editing=!0,this.showConfirm||this.update()},initDragSort(){const e=this.$refs.col_config.$el.querySelectorAll(".col-config-list")[0];ot.create(e,{onEnd:({oldIndex:e,newIndex:t})=>{this.editing=!0;const n=this.ColsConfigTmp[e];this.ColsConfigTmp.splice(e,1),this.ColsConfigTmp.splice(t,0,n),console.log("this.ColsConfigTmp",this.ColsConfigTmp);const a=this.ColsConfigTmp.map((e=>e.id));console.log("newKeysArr: ",a),_.each(this.cols_config,(e=>{const t=a.indexOf(e.id);e.sort_index=t})),console.log("this.col_config: ",this.col_config),this.$forceUpdate(),this.showConfirm||this.update()}})},setCutomerColsConfig(){let e={},t="";e=localStorage.getItem("COLUMN_CUSTOMER_CONFIG")&&JSON.parse(localStorage.getItem("COLUMN_CUSTOMER_CONFIG"))||{},t=e[this.userId+this.tag],t?t.field_colunms_config=this.cols_config:t={field_colunms_config:this.cols_config},e[this.userId+this.tag]=t,localStorage.setItem("COLUMN_CUSTOMER_CONFIG",JSON.stringify(e))},setColWidth(e,t){_.each(this.cols_config,(n=>{n.id==e&&(n.width=t)})),this.setCutomerColsConfig()},getCustomerColsConfig(e){let t=[],n={},a=[],i={};i=localStorage.getItem("COLUMN_CUSTOMER_CONFIG")&&JSON.parse(localStorage.getItem("COLUMN_CUSTOMER_CONFIG"))||{},n=i[this.userId+this.tag],n&&n.field_colunms_config&&(a=n.field_colunms_config);let r=0;return _.each(e,(e=>{let n=_.find(a,{id:e[this.columnKey]});if(n)t.push({label:e[this.props.label],id:e[this.columnKey],show:n.show,sort_index:n.sort_index,width:n.width||""});else{let n=!1;n=_.isNil(e.default_show)?!!(r<=this.defaultColumnShowCount||_.includes(this.defaultColumnShowKeys,e[this.columnKey])):e.default_show,n&&r++,t.push({label:e[this.props.label],id:e[this.columnKey],show:n,sort_index:0,width:""})}})),t=_.sortBy(t,"sort_index"),this.ColsConfigTmp=_.cloneDeep(t),t}},mounted(){this.cols_config=this.getCustomerColsConfig(this.columns),this.initDragSort()}},lt=st,dt=(0,n(900).Z)(lt,a,[],!1,null,null,null);dt.options.__file="components/lib/table-column-configer/src/main.vue";var ct=dt.exports;ct.install=function(e){e.component(ct.name,ct)};var ut=ct},900:function(e,t,n){function a(e,t,n,a,i,r,o,s){var l,d="function"==typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),a&&(d.functional=!0),r&&(d._scopeId="data-v-"+r),o?(l=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__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},d._ssrRegister=l):i&&(l=s?function(){i.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(d.functional){d._injectStyles=l;var c=d.render;d.render=function(e,t){return l.call(t),c(e,t)}}else{var u=d.beforeCreate;d.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:d}}n.d(t,{Z:function(){return a}})}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){n.r(a),n.d(a,{ColorIndication:function(){return o.default},Demo:function(){return e.default},Demo2:function(){return t.default},SelectPositionTable:function(){return r.default},TableColumnConfiger:function(){return i.default}});var e=n(924),t=n(367),i=n(387),r=n(622),o=n(109);const s={Demo:e.default,Demo2:t.default,TableColumnConfiger:i.default,SelectPositionTable:r.default,ColorIndication:o.default},l=function(e){l.installed||Object.keys(s).forEach((t=>{e.component(s[t].name,s[t])}))};a.default={version:"0.0.10",install:l}}(),a}()},3282:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const a=n(4042),i=n(6144),r=n(6653),o=n(2079),s=["/properties"],l="http://json-schema.org/draft-07/schema";class d extends a.default{_addVocabularies(){super._addVocabularies(),i.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var c=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var m=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var f=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},1520:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=a;class i extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof a&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function r(e,...t){const n=[e[0]];let a=0;for(;a<t.length;)l(n,t[a]),n.push(e[++a]);return new i(n)}t._Code=i,t.nil=new i(""),t._=r;const o=new i("+");function s(e,...t){const n=[c(e[0])];let a=0;for(;a<t.length;)n.push(o),l(n,t[a]),n.push(o,c(e[++a]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){const n=d(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new i(n)}function l(e,t){var n;t instanceof i?e.push(...t._items):t instanceof a?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:c(Array.isArray(n)?n.join(","):n))}function d(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof a||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof a?void 0:`"${e}${t.slice(1)}`}function c(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=s,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},t.stringify=function(e){return new i(c(e))},t.safeStringify=c,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new i(`.${e}`):r`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new i(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new i(e.toString())}},9029:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const a=n(1520),i=n(7845);var r=n(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var o=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new a._Code(">"),GTE:new a._Code(">="),LT:new a._Code("<"),LTE:new a._Code("<="),EQ:new a._Code("==="),NEQ:new a._Code("!=="),NOT:new a._Code("!"),OR:new a._Code("||"),AND:new a._Code("&&"),ADD:new a._Code("+")};class s{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends s{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?i.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,e,t)),this}get names(){return this.rhs instanceof a._CodeOrName?this.rhs.names:{}}}class d extends s{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof a.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=j(this.rhs,e,t),this}get names(){return C(this.lhs instanceof a.Name?{}:{...this.lhs.names},this.rhs)}}class c extends d{constructor(e,t,n,a){super(e,n,a),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class m extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class f extends s{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends s{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=j(this.code,e,t),this}get names(){return this.code instanceof a._CodeOrName?this.code.names:{}}}class p extends s{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let a=n.length;for(;a--;){const i=n[a];i.optimizeNames(e,t)||($(e,i.names),n.splice(a,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>T(e,t.names)),{})}}class _ extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class g extends p{}class y extends _{}y.kind="else";class b extends _{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(P(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=j(this.condition,e,t),this}get names(){const e=super.names;return C(e,this.condition),this.else&&T(e,this.else.names),e}}b.kind="if";class v extends _{}v.kind="for";class w extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=j(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}}class M extends v{constructor(e,t,n,a){super(),this.varKind=e,this.name=t,this.from=n,this.to=a}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:n,from:a,to:r}=this;return`for(${t} ${n}=${a}; ${n}<${r}; ${n}++)`+super.render(e)}get names(){const e=C(super.names,this.from);return C(e,this.to)}}class L extends v{constructor(e,t,n,a){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=a}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=j(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}}class k extends _{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}k.kind="func";class S extends p{render(e){return"return "+super.render(e)}}S.kind="return";class D extends _{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,a;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(a=this.finally)||void 0===a||a.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}}class x extends _{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}x.kind="catch";class Y extends _{render(e){return"finally"+super.render(e)}}function T(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function C(e,t){return t instanceof a._CodeOrName?T(e,t.names):e}function j(e,t,n){return e instanceof a.Name?r(e):(i=e)instanceof a._Code&&i._items.some((e=>e instanceof a.Name&&1===t[e.str]&&void 0!==n[e.str]))?new a._Code(e._items.reduce(((e,t)=>(t instanceof a.Name&&(t=r(t)),t instanceof a._Code?e.push(...t._items):e.push(t),e)),[])):e;var i;function r(e){const a=n[e.str];return void 0===a||1!==t[e.str]?e:(delete t[e.str],a)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:a._`!${O(e)}`}Y.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,a){const i=this._scope.toName(t);return void 0!==n&&a&&(this._constants[i.str]=n),this._leafNode(new l(e,i,n)),i}const(e,t,n){return this._def(i.varKinds.const,e,t,n)}let(e,t,n){return this._def(i.varKinds.let,e,t,n)}var(e,t,n){return this._def(i.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new d(e,t,n))}add(e,n){return this._leafNode(new c(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==a.nil&&this._leafNode(new h(e)),this}object(...e){const t=["{"];for(const[n,i]of e)t.length>1&&t.push(","),t.push(n),(n!==i||this.opts.es5)&&(t.push(":"),(0,a.addCodeArg)(t,i));return t.push("}"),new a._Code(t)}if(e,t,n){if(this._blockNode(new b(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(b,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,n,a,r=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const o=this._scope.toName(e);return this._for(new M(r,o,t,n),(()=>a(o)))}forOf(e,t,n,r=i.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof a.Name?t:this.var("_arr",t);return this.forRange("_i",0,a._`${e}.length`,(t=>{this.var(o,a._`${e}[${t}]`),n(o)}))}return this._for(new L("of",r,o,t),(()=>n(o)))}forIn(e,t,n,r=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,a._`Object.keys(${t})`,n);const o=this._scope.toName(e);return this._for(new L("in",r,o,t),(()=>n(o)))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new m(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const a=new D;if(this._blockNode(a),this.code(e),t){const e=this.name("e");this._currNode=a.catch=new x(e),t(e)}return n&&(this._currNode=a.finally=new Y,this.code(n)),this._endBlockNode(x,Y)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=a.nil,n,i){return this._blockNode(new k(e,t,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=P;const I=E(t.operators.AND);t.and=function(...e){return e.reduce(I)};const F=E(t.operators.OR);function E(e){return(t,n)=>t===a.nil?n:n===a.nil?t:a._`${O(t)} ${e} ${O(n)}`}function O(e){return e instanceof a.Name?e:a._`(${e})`}t.or=function(...e){return e.reduce(F)}},7845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const a=n(1520);class i extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(r||(t.UsedValueState=r={})),t.varKinds={const:new a.Name("const"),let:new a.Name("let"),var:new a.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof a.Name?e:this.name(e)}name(e){return new a.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class s extends a.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=a._`.${new a.Name(t)}[${n}]`}}t.ValueScopeName=s;const l=a._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:a.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const a=this.toName(e),{prefix:i}=a,r=null!==(n=t.key)&&void 0!==n?n:t.ref;let o=this._values[i];if(o){const e=o.get(r);if(e)return e}else o=this._values[i]=new Map;o.set(r,a);const s=this._scope[i]||(this._scope[i]=[]),l=s.length;return s[l]=t.ref,a.setValue(t,{property:i,itemIndex:l}),a}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return a._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,o={},s){let l=a.nil;for(const d in e){const c=e[d];if(!c)continue;const u=o[d]=o[d]||new Map;c.forEach((e=>{if(u.has(e))return;u.set(e,r.Started);let o=n(e);if(o){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=a._`${l}${n} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==s?void 0:s(e)))throw new i(e);l=a._`${l}${o}${this.opts._n}`}u.set(e,r.Completed)}))}return l}}},8708:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const a=n(9029),i=n(4227),r=n(2023);function o(e,t){const n=e.const("err",t);e.if(a._`${r.default.vErrors} === null`,(()=>e.assign(r.default.vErrors,a._`[${n}]`)),a._`${r.default.vErrors}.push(${n})`),e.code(a._`${r.default.errors}++`)}function s(e,t){const{gen:n,validateName:i,schemaEnv:r}=e;r.$async?n.throw(a._`new ${e.ValidationError}(${t})`):(n.assign(a._`${i}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>a.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?a.str`"${e}" keyword must be ${t} ($data)`:a.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,i,r){const{it:l}=e,{gen:c,compositeRule:u,allErrors:m}=l,f=d(e,n,i);(null!=r?r:u||m)?o(c,f):s(l,a._`[${f}]`)},t.reportExtraError=function(e,n=t.keywordError,a){const{it:i}=e,{gen:l,compositeRule:c,allErrors:u}=i;o(l,d(e,n,a)),c||u||s(i,r.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(r.default.errors,t),e.if(a._`${r.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(a._`${r.default.vErrors}.length`,t)),(()=>e.assign(r.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:i,errsCount:o,it:s}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,r.default.errors,(o=>{e.const(l,a._`${r.default.vErrors}[${o}]`),e.if(a._`${l}.instancePath === undefined`,(()=>e.assign(a._`${l}.instancePath`,(0,a.strConcat)(r.default.instancePath,s.errorPath)))),e.assign(a._`${l}.schemaPath`,a.str`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign(a._`${l}.schema`,n),e.assign(a._`${l}.data`,i))}))};const l={keyword:new a.Name("keyword"),schemaPath:new a.Name("schemaPath"),params:new a.Name("params"),propertyName:new a.Name("propertyName"),message:new a.Name("message"),schema:new a.Name("schema"),parentSchema:new a.Name("parentSchema")};function d(e,t,n){const{createErrors:i}=e.it;return!1===i?a._`{}`:function(e,t,n={}){const{gen:i,it:o}=e,s=[c(o,n),u(e,n)];return function(e,{params:t,message:n},i){const{keyword:o,data:s,schemaValue:d,it:c}=e,{opts:u,propertyName:m,topSchemaRef:f,schemaPath:h}=c;i.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||a._`{}`]),u.messages&&i.push([l.message,"function"==typeof n?n(e):n]),u.verbose&&i.push([l.schema,d],[l.parentSchema,a._`${f}${h}`],[r.default.data,s]),m&&i.push([l.propertyName,m])}(e,t,s),i.object(...s)}(e,t,n)}function c({errorPath:e},{instancePath:t}){const n=t?a.str`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[r.default.instancePath,(0,a.strConcat)(r.default.instancePath,n)]}function u({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:a.str`${t}/${e}`;return n&&(o=a.str`${o}${(0,i.getErrorPath)(n,i.Type.Str)}`),[l.schemaPath,o]}},3835:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const a=n(9029),i=n(3558),r=n(2023),o=n(6939),s=n(4227),l=n(2586);class d{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function c(e){const t=m.call(this,e);if(t)return t;const n=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:d}=this.opts.code,{ownProperties:c}=this.opts,u=new a.CodeGen(this.scope,{es5:s,lines:d,ownProperties:c});let f;e.$async&&(f=u.scopeValue("Error",{ref:i.default,code:a._`require("ajv/dist/runtime/validation_error").default`}));const h=u.scopeName("validate");e.validateName=h;const p={gen:u,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[a.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,a.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:a.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:a._`""`,opts:this.opts,self:this};let _;try{this._compilations.add(e),(0,l.validateFunctionCode)(p),u.optimize(this.opts.code.optimize);const t=u.toString();_=`${u.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(_=this.opts.code.process(_,e));const n=new Function(`${r.default.self}`,`${r.default.scope}`,_)(this,this.scope.get());if(this.scope.value(h,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:h,validateCode:t,scopeValues:u._values}),this.opts.unevaluated){const{props:e,items:t}=p;n.evaluated={props:e instanceof a.Name?void 0:e,items:t instanceof a.Name?void 0:t,dynamicProps:e instanceof a.Name,dynamicItems:t instanceof a.Name},n.source&&(n.source.evaluated=(0,a.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,_&&this.logger.error("Error compiling schema, function code:",_),t}finally{this._compilations.delete(e)}}function u(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function m(e){for(const a of this._compilations)if(n=e,(t=a).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return a;var t,n}function f(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||h.call(this,e,t)}function h(e,t){const n=this.opts.uriResolver.parse(t),a=(0,o._getFullPath)(this.opts.uriResolver,n);let i=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&a===i)return _.call(this,n,e);const r=(0,o.normalizeId)(a),s=this.refs[r]||this.schemas[r];if("string"==typeof s){const t=h.call(this,e,s);if("object"!=typeof(null==t?void 0:t.schema))return;return _.call(this,n,t)}if("object"==typeof(null==s?void 0:s.schema)){if(s.validate||c.call(this,s),r===(0,o.normalizeId)(t)){const{schema:t}=s,{schemaId:n}=this.opts,a=t[n];return a&&(i=(0,o.resolveUrl)(this.opts.uriResolver,i,a)),new d({schema:t,schemaId:n,root:e,baseId:i})}return _.call(this,n,s)}}t.SchemaEnv=d,t.compileSchema=c,t.resolveRef=function(e,t,n){var a;n=(0,o.resolveUrl)(this.opts.uriResolver,t,n);const i=e.refs[n];if(i)return i;let r=f.call(this,e,n);if(void 0===r){const i=null===(a=e.localRefs)||void 0===a?void 0:a[n],{schemaId:o}=this.opts;i&&(r=new d({schema:i,schemaId:o,root:e,baseId:t}))}return void 0!==r?e.refs[n]=u.call(this,r):void 0},t.getCompilingSchema=m,t.resolveSchema=h;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(e,{baseId:t,schema:n,root:a}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const a of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,s.unescapeFragment)(a)];if(void 0===e)return;const i="object"==typeof(n=e)&&n[this.opts.schemaId];!p.has(a)&&i&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,i))}let r;if("boolean"!=typeof n&&n.$ref&&!(0,s.schemaHasRulesButRef)(n,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,n.$ref);r=h.call(this,a,e)}const{schemaId:l}=this.opts;return r=r||new d({schema:n,schemaId:l,root:a,baseId:t}),r.schema!==r.root.schema?r:void 0}},2023:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(9029),i={data:new a.Name("data"),valCxt:new a.Name("valCxt"),instancePath:new a.Name("instancePath"),parentData:new a.Name("parentData"),parentDataProperty:new a.Name("parentDataProperty"),rootData:new a.Name("rootData"),dynamicAnchors:new a.Name("dynamicAnchors"),vErrors:new a.Name("vErrors"),errors:new a.Name("errors"),this:new a.Name("this"),self:new a.Name("self"),scope:new a.Name("scope"),json:new a.Name("json"),jsonPos:new a.Name("jsonPos"),jsonLen:new a.Name("jsonLen"),jsonPart:new a.Name("jsonPart")};t.default=i},4551:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(6939);class i extends Error{constructor(e,t,n,i){super(i||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,a.resolveUrl)(e,t,n),this.missingSchema=(0,a.normalizeId)((0,a.getFullPath)(e,this.missingRef))}}t.default=i},6939:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const a=n(4227),i=n(2017),r=n(7106),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&d(e)<=t)};const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(s.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function d(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!o.has(n)&&("object"==typeof e[n]&&(0,a.eachItem)(e[n],(e=>t+=d(e))),t===1/0))return 1/0}return t}function c(e,t="",n){!1!==n&&(t=f(t));const a=e.parse(t);return u(e,a)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=c,t._getFullPath=u;const m=/#\/?$/;function f(e){return e?e.replace(m,""):""}t.normalizeId=f,t.resolveUrl=function(e,t,n){return n=f(n),e.resolve(t,n)};const h=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:a}=this.opts,o=f(e[n]||t),s={"":o},l=c(a,o,!1),d={},u=new Set;return r(e,{allKeys:!0},((e,t,a,i)=>{if(void 0===i)return;const r=l+t;let o=s[i];function c(t){const n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),u.has(t))throw p(t);u.add(t);let a=this.refs[t];return"string"==typeof a&&(a=this.refs[a]),"object"==typeof a?m(e,a.schema,t):t!==f(r)&&("#"===t[0]?(m(e,d[t],t),d[t]=e):this.refs[t]=r),t}function _(e){if("string"==typeof e){if(!h.test(e))throw new Error(`invalid anchor "${e}"`);c.call(this,`#${e}`)}}"string"==typeof e[n]&&(o=c.call(this,e[n])),_.call(this,e.$anchor),_.call(this,e.$dynamicAnchor),s[t]=o})),d;function m(e,t,n){if(void 0!==t&&!i(e,t))throw p(n)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},396:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4227:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const a=n(9029),i=n(1520);function r(e,t=e.schema){const{opts:n,self:a}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const i=a.RULES.keywords;for(const n in t)i[n]||h(e,`unknown keyword: "${n}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function s(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function d({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:i}){return(r,o,s,l)=>{const d=void 0===s?o:s instanceof a.Name?(o instanceof a.Name?e(r,o,s):t(r,o,s),s):o instanceof a.Name?(t(r,s,o),o):n(o,s);return l!==a.Name||d instanceof a.Name?d:i(r,d)}}function c(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",a._`{}`);return void 0!==t&&u(e,n,t),n}function u(e,t,n){Object.keys(n).forEach((n=>e.assign(a._`${t}${(0,a.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=r,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,i,r){if(!r){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return a._`${n}`}return a._`${e}${t}${(0,a.getProperty)(i)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(s(e))},t.escapeJsonPointer=s,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:d({mergeNames:(e,t,n)=>e.if(a._`${n} !== true && ${t} !== undefined`,(()=>{e.if(a._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,a._`${n} || {}`).code(a._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(a._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,a._`${n} || {}`),u(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:d({mergeNames:(e,t,n)=>e.if(a._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,a._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(a._`${n} !== true`,(()=>e.assign(n,!0===t||a._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=c,t.setEvaluated=u;const m={};var f;function h(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:m[t.code]||(m[t.code]=new i._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(f||(t.Type=f={})),t.getErrorPath=function(e,t,n){if(e instanceof a.Name){const i=t===f.Num;return n?i?a._`"[" + ${e} + "]"`:a._`"['" + ${e} + "']"`:i?a._`"/" + ${e}`:a._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,a.getProperty)(e).toString():"/"+s(e)},t.checkStrictMode=h},7887:function(e,t){"use strict";function n(e,t){return t.rules.some((t=>a(e,t)))}function a(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},a){const i=t.RULES.types[a];return i&&!0!==i&&n(e,i)},t.shouldUseGroup=n,t.shouldUseRule=a},8727:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const a=n(8708),i=n(9029),r=n(2023),o={message:"boolean schema is false"};function s(e,t){const{gen:n,data:i}=e,r={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,a.reportError)(r,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:a}=e;!1===n?s(e,!1):"object"==typeof n&&!0===n.$async?t.return(r.default.data):(t.assign(i._`${a}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:a}=e;!1===a?(n.var(t,!1),s(e)):n.var(t,!0)}},208:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const a=n(396),i=n(7887),r=n(8708),o=n(9029),s=n(4227);var l;function d(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(a.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l||(t.DataType=l={})),t.getSchemaTypes=function(e){const t=d(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=d,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:a,opts:r}=e,s=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,r.coerceTypes),d=t.length>0&&!(0===s.length&&1===t.length&&(0,i.schemaHasRulesForType)(e,t[0]));if(d){const i=m(t,a,r.strictNumbers,l.Wrong);n.if(i,(()=>{s.length?function(e,t,n){const{gen:a,data:i,opts:r}=e,s=a.let("dataType",o._`typeof ${i}`),l=a.let("coerced",o._`undefined`);"array"===r.coerceTypes&&a.if(o._`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,(()=>a.assign(i,o._`${i}[0]`).assign(s,o._`typeof ${i}`).if(m(t,i,r.strictNumbers),(()=>a.assign(l,i))))),a.if(o._`${l} !== undefined`);for(const e of n)(c.has(e)||"array"===e&&"array"===r.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void a.elseIf(o._`${s} == "number" || ${s} == "boolean"`).assign(l,o._`"" + ${i}`).elseIf(o._`${i} === null`).assign(l,o._`""`);case"number":return void a.elseIf(o._`${s} == "boolean" || ${i} === null
|
|
3
3
|
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(l,o._`+${i}`);case"integer":return void a.elseIf(o._`${s} === "boolean" || ${i} === null
|
|
4
4
|
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,o._`+${i}`);case"boolean":return void a.elseIf(o._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf(o._`${i} === "true" || ${i} === 1`).assign(l,!0);case"null":return a.elseIf(o._`${i} === "" || ${i} === 0 || ${i} === false`),void a.assign(l,null);case"array":a.elseIf(o._`${s} === "string" || ${s} === "number"
|
|
5
5
|
|| ${s} === "boolean" || ${i} === null`).assign(l,o._`[${i}]`)}}a.else(),h(e),a.endIf(),a.if(o._`${l} !== undefined`,(()=>{a.assign(i,l),function({gen:e,parentData:t,parentDataProperty:n},a){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${n}]`,a)))}(e,l)}))}(e,t,s):h(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,n,a=l.Correct){const i=a===l.Correct?o.operators.EQ:o.operators.NEQ;let r;switch(e){case"null":return o._`${t} ${i} null`;case"array":r=o._`Array.isArray(${t})`;break;case"object":r=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":r=s(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":r=s();break;default:return o._`typeof ${t} ${i} ${e}`}return a===l.Correct?r:(0,o.not)(r);function s(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,n?o._`isFinite(${t})`:o.nil)}}function m(e,t,n,a){if(1===e.length)return u(e[0],t,n,a);let i;const r=(0,s.toHash)(e);if(r.array&&r.object){const e=o._`typeof ${t} != "object"`;i=r.null?e:o._`!${t} || ${e}`,delete r.null,delete r.array,delete r.object}else i=o.nil;r.number&&delete r.integer;for(const e in r)i=(0,o.and)(i,u(e,t,n,a));return i}t.checkDataType=u,t.checkDataTypes=m;const f={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function h(e){const t=function(e){const{gen:t,data:n,schema:a}=e,i=(0,s.schemaRefOrVal)(e,a,"type");return{gen:t,keyword:"type",data:n,schema:a.type,schemaCode:i,schemaValue:i,parentSchema:a,params:{},it:e}}(e);(0,r.reportError)(t,f)}t.reportTypeError=h},7870:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const a=n(9029),i=n(4227);function r(e,t,n){const{gen:r,compositeRule:o,data:s,opts:l}=e;if(void 0===n)return;const d=a._`${s}${(0,a.getProperty)(t)}`;if(o)return void(0,i.checkStrictMode)(e,`default is ignored for: ${d}`);let c=a._`${d} === undefined`;"empty"===l.useDefaults&&(c=a._`${c} || ${d} === null || ${d} === ""`),r.if(c,a._`${d} = ${(0,a.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:a}=e.schema;if("object"===t&&n)for(const t in n)r(e,t,n[t].default);else"array"===t&&Array.isArray(a)&&a.forEach(((t,n)=>r(e,n,t.default)))}},2586:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const a=n(8727),i=n(208),r=n(7887),o=n(208),s=n(7870),l=n(3673),d=n(4495),c=n(9029),u=n(2023),m=n(6939),f=n(4227),h=n(8708);function p({gen:e,validateName:t,schema:n,schemaEnv:a,opts:i},r){i.code.es5?e.func(t,c._`${u.default.data}, ${u.default.valCxt}`,a.$async,(()=>{e.code(c._`"use strict"; ${_(n,i)}`),function(e,t){e.if(u.default.valCxt,(()=>{e.var(u.default.instancePath,c._`${u.default.valCxt}.${u.default.instancePath}`),e.var(u.default.parentData,c._`${u.default.valCxt}.${u.default.parentData}`),e.var(u.default.parentDataProperty,c._`${u.default.valCxt}.${u.default.parentDataProperty}`),e.var(u.default.rootData,c._`${u.default.valCxt}.${u.default.rootData}`),t.dynamicRef&&e.var(u.default.dynamicAnchors,c._`${u.default.valCxt}.${u.default.dynamicAnchors}`)}),(()=>{e.var(u.default.instancePath,c._`""`),e.var(u.default.parentData,c._`undefined`),e.var(u.default.parentDataProperty,c._`undefined`),e.var(u.default.rootData,u.default.data),t.dynamicRef&&e.var(u.default.dynamicAnchors,c._`{}`)}))}(e,i),e.code(r)})):e.func(t,c._`${u.default.data}, ${function(e){return c._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${e.dynamicRef?c._`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}(i)}`,a.$async,(()=>e.code(_(n,i)).code(r)))}function _(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?c._`/*# sourceURL=${n} */`:c.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function b(e){(0,f.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:a,self:i}=e;t.$ref&&a.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function v(e,t){if(e.opts.jtd)return M(e,[],!1,t);const n=(0,i.getSchemaTypes)(e.schema);M(e,n,!(0,i.coerceAndCheckDataType)(e,n),t)}function w({gen:e,schemaEnv:t,schema:n,errSchemaPath:a,opts:i}){const r=n.$comment;if(!0===i.$comment)e.code(c._`${u.default.self}.logger.log(${r})`);else if("function"==typeof i.$comment){const n=c.str`${a}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(c._`${u.default.self}.opts.$comment(${r}, ${n}, ${i}.schema)`)}}function M(e,t,n,a){const{gen:i,schema:s,data:l,allErrors:d,opts:m,self:h}=e,{RULES:p}=h;function _(f){(0,r.shouldUseGroup)(s,f)&&(f.type?(i.if((0,o.checkDataType)(f.type,l,m.strictNumbers)),L(e,f),1===t.length&&t[0]===f.type&&n&&(i.else(),(0,o.reportTypeError)(e)),i.endIf()):L(e,f),d||i.if(c._`${u.default.errors} === ${a||0}`))}!s.$ref||!m.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(s,p)?(m.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{k(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const a of e.dataTypes)k(t,a)?n.push(a):t.includes("integer")&&"number"===a&&n.push("integer");e.dataTypes=n}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&S(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const a in n){const i=n[a];if("object"==typeof i&&(0,r.shouldUseRule)(e.schema,i)){const{type:n}=i.definition;n.length&&!n.some((e=>{return a=e,(n=t).includes(a)||"number"===a&&n.includes("integer");var n,a}))&&S(e,`missing type "${n.join(",")}" for keyword "${a}"`)}}}(e,e.dataTypes))}(e,t),i.block((()=>{for(const e of p.rules)_(e);_(p.post)}))):i.block((()=>x(e,"$ref",p.all.$ref.definition)))}function L(e,t){const{gen:n,schema:a,opts:{useDefaults:i}}=e;i&&(0,s.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,r.shouldUseRule)(a,n)&&x(e,n.keyword,n.definition,t.type)}))}function k(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,f.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){y(e)&&(b(e),g(e))?function(e){const{schema:t,opts:n,gen:a}=e;p(e,(()=>{n.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,f.checkStrictMode)(e,"default is ignored in the schema root")}(e),a.let(u.default.vErrors,null),a.let(u.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",c._`${n}.evaluated`),t.if(c._`${e.evaluated}.dynamicProps`,(()=>t.assign(c._`${e.evaluated}.props`,c._`undefined`))),t.if(c._`${e.evaluated}.dynamicItems`,(()=>t.assign(c._`${e.evaluated}.items`,c._`undefined`)))}(e),v(e),function(e){const{gen:t,schemaEnv:n,validateName:a,ValidationError:i,opts:r}=e;n.$async?t.if(c._`${u.default.errors} === 0`,(()=>t.return(u.default.data)),(()=>t.throw(c._`new ${i}(${u.default.vErrors})`))):(t.assign(c._`${a}.errors`,u.default.vErrors),r.unevaluated&&function({gen:e,evaluated:t,props:n,items:a}){n instanceof c.Name&&e.assign(c._`${t}.props`,n),a instanceof c.Name&&e.assign(c._`${t}.items`,a)}(e),t.return(c._`${u.default.errors} === 0`))}(e)}))}(e):p(e,(()=>(0,a.topBoolOrEmptySchema)(e)))};class D{constructor(e,t,n){if((0,l.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",C(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",u.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(c._`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?h.reportExtraError:h.reportError)(this,this.def.error,t)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=c.nil,t=c.nil){if(!this.$data)return;const{gen:n,schemaCode:a,schemaType:i,def:r}=this;n.if((0,c.or)(c._`${a} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||r.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:a,it:i}=this;return(0,c.or)(function(){if(n.length){if(!(t instanceof c.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return c._`${(0,o.checkDataTypes)(e,t,i.opts.strictNumbers,o.DataType.Wrong)}`}return c.nil}(),function(){if(a.validateSchema){const n=e.scopeValue("validate$data",{ref:a.validateSchema});return c._`!${n}(${t})`}return c.nil}())}subschema(e,t){const n=(0,d.getSubschema)(this.it,e);(0,d.extendSubschemaData)(n,this.it,e),(0,d.extendSubschemaMode)(n,e);const i={...this.it,...n,items:void 0,props:void 0};return function(e,t){y(e)&&(b(e),g(e))?function(e,t){const{schema:n,gen:a,opts:i}=e;i.$comment&&n.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,m.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const r=a.const("_errs",u.default.errors);v(e,r),a.var(t,c._`${r} === ${u.default.errors}`)}(e,t):(0,a.boolOrEmptySchema)(e,t)}(i,t),i}mergeEvaluated(e,t){const{it:n,gen:a}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=f.mergeEvaluated.props(a,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=f.mergeEvaluated.items(a,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:a}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return a.if(t,(()=>this.mergeEvaluated(e,c.Name))),!0}}function x(e,t,n,a){const i=new D(e,n,t);"code"in n?n.code(i,a):i.$data&&n.validate?(0,l.funcKeywordCode)(i,n):"macro"in n?(0,l.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,l.funcKeywordCode)(i,n)}t.KeywordCxt=D;const Y=/^\/(?:[^~]|~0|~1)*$/,T=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function C(e,{dataLevel:t,dataNames:n,dataPathArr:a}){let i,r;if(""===e)return u.default.rootData;if("/"===e[0]){if(!Y.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,r=u.default.rootData}else{const o=T.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+o[1];if(i=o[2],"#"===i){if(s>=t)throw new Error(l("property/index",s));return a[t-s]}if(s>t)throw new Error(l("data",s));if(r=n[t-s],!i)return r}let o=r;const s=i.split("/");for(const e of s)e&&(r=c._`${r}${(0,c.getProperty)((0,f.unescapeJsonPointer)(e))}`,o=c._`${o} && ${r}`);return o;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=C},3673:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const a=n(9029),i=n(2023),r=n(5765),o=n(8708);function s(e){const{gen:t,data:n,it:i}=e;t.if(i.parentData,(()=>t.assign(n,a._`${i.parentData}[${i.parentDataProperty}]`)))}function l(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,a.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:i,schema:r,parentSchema:o,it:s}=e,d=t.macro.call(s.self,r,o,s),c=l(n,i,d);!1!==s.opts.validateSchema&&s.self.validateSchema(d,!0);const u=n.name("valid");e.subschema({schema:d,schemaPath:a.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:d,keyword:c,schema:u,parentSchema:m,$data:f,it:h}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,t);const p=!f&&t.compile?t.compile.call(h.self,u,m,h):t.validate,_=l(d,c,p),g=d.let("valid");function y(n=(t.async?a._`await `:a.nil)){const o=h.opts.passContext?i.default.this:i.default.self,s=!("compile"in t&&!f||!1===t.schema);d.assign(g,a._`${n}${(0,r.callValidateCode)(e,_,o,s)}`,t.modifying)}function b(e){var n;d.if((0,a.not)(null!==(n=t.valid)&&void 0!==n?n:g),e)}e.block$data(g,(function(){if(!1===t.errors)y(),t.modifying&&s(e),b((()=>e.error()));else{const n=t.async?function(){const e=d.let("ruleErrs",null);return d.try((()=>y(a._`await `)),(t=>d.assign(g,!1).if(a._`${t} instanceof ${h.ValidationError}`,(()=>d.assign(e,a._`${t}.errors`)),(()=>d.throw(t))))),e}():function(){const e=a._`${_}.errors`;return d.assign(e,null),y(a.nil),e}();t.modifying&&s(e),b((()=>function(e,t){const{gen:n}=e;n.if(a._`Array.isArray(${t})`,(()=>{n.assign(i.default.vErrors,a._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,a._`${i.default.vErrors}.length`),(0,o.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:g)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:a},i,r){if(Array.isArray(i.keyword)?!i.keyword.includes(r):i.keyword!==r)throw new Error("ajv implementation error");const o=i.dependencies;if(null==o?void 0:o.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${r}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[r])){const e=`keyword "${r}" value is invalid at path "${a}": `+n.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},4495:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const a=n(9029),i=n(4227);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:s,topSchemaRef:l}){if(void 0!==t&&void 0!==r)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const r=e.schema[t];return void 0===n?{schema:r,schemaPath:a._`${e.schemaPath}${(0,a.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:r[n],schemaPath:a._`${e.schemaPath}${(0,a.getProperty)(t)}${(0,a.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,i.escapeFragment)(n)}`}}if(void 0!==r){if(void 0===o||void 0===s||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:l,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:s,propertyName:l}){if(void 0!==o&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:d}=t;if(void 0!==n){const{errorPath:o,dataPathArr:s,opts:l}=t;c(d.let("data",a._`${t.data}${(0,a.getProperty)(n)}`,!0)),e.errorPath=a.str`${o}${(0,i.getErrorPath)(n,r,l.jsPropertySyntax)}`,e.parentDataProperty=a._`${n}`,e.dataPathArr=[...s,e.parentDataProperty]}function c(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==o&&(c(o instanceof a.Name?o:d.let("data",o,!0)),void 0!==l&&(e.propertyName=l)),s&&(e.dataTypes=s)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:a,createErrors:i,allErrors:r}){void 0!==a&&(e.compositeRule=a),void 0!==i&&(e.createErrors=i),void 0!==r&&(e.allErrors=r),e.jtdDiscriminator=t,e.jtdMetadata=n}},4042:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var a=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var i=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});const r=n(3558),o=n(4551),s=n(396),l=n(3835),d=n(9029),c=n(6939),u=n(208),m=n(4227),f=n(3837),h=n(5944),p=(e,t)=>new RegExp(e,t);p.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,n,a,i,r,o,s,l,d,c,u,m,f,_,g,y,b,v,w,M,L,k,S,D,x;const Y=e.strict,T=null===(t=e.code)||void 0===t?void 0:t.optimize,C=!0===T||void 0===T?1:T||0,j=null!==(a=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==a?a:p,$=null!==(i=e.uriResolver)&&void 0!==i?i:h.default;return{strictSchema:null===(o=null!==(r=e.strictSchema)&&void 0!==r?r:Y)||void 0===o||o,strictNumbers:null===(l=null!==(s=e.strictNumbers)&&void 0!==s?s:Y)||void 0===l||l,strictTypes:null!==(c=null!==(d=e.strictTypes)&&void 0!==d?d:Y)&&void 0!==c?c:"log",strictTuples:null!==(m=null!==(u=e.strictTuples)&&void 0!==u?u:Y)&&void 0!==m?m:"log",strictRequired:null!==(_=null!==(f=e.strictRequired)&&void 0!==f?f:Y)&&void 0!==_&&_,code:e.code?{...e.code,optimize:C,regExp:j}:{optimize:C,regExp:j},loopRequired:null!==(g=e.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(y=e.loopEnum)&&void 0!==y?y:200,meta:null===(b=e.meta)||void 0===b||b,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(M=e.schemaId)&&void 0!==M?M:"$id",addUsedSchema:null===(L=e.addUsedSchema)||void 0===L||L,validateSchema:null===(k=e.validateSchema)||void 0===k||k,validateFormats:null===(S=e.validateFormats)||void 0===S||S,unicodeRegExp:null===(D=e.unicodeRegExp)||void 0===D||D,int32range:null===(x=e.int32range)||void 0===x||x,uriResolver:$}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new d.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=function(e){if(!1===e)return Y;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const a=e.validateFormats;e.validateFormats=!1,this.RULES=(0,s.getRules)(),M.call(this,y,e,"NOT SUPPORTED"),M.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=x.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&D.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),k.call(this),e.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let a=f;"id"===n&&(a={...f},a.id=a.$id,delete a.$id),t&&e&&this.addMetaSchema(a,a[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const a=n(t);return"$async"in n||(this.errors=n.errors),a}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return a.call(this,e,t);async function a(e,t){await i.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||r.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await a.call(this,{$ref:e},!0)}async function r(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return s.call(this,t),await l.call(this,t.missingSchema),r.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const n=await d.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function d(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,a=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,a);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,a,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const a=this.validate(n,e);if(!a&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return a}getSchema(e){let t;for(;"string"==typeof(t=L.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,a=new l.SchemaEnv({schema:{},schemaId:n});if(t=l.resolveSchema.call(this,a,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=L.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,c.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(C.call(this,n,t),!t)return(0,m.eachItem)(n,(e=>j.call(this,e))),this;P.call(this,t);const a={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,m.eachItem)(n,0===a.type.length?e=>j.call(this,e,a):e=>a.type.forEach((t=>j.call(this,e,a,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const a of t){const t=a.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:a}=t.definition,r=i[e];a&&r&&(i[e]=F(r))}}return e}_removeAllSchemas(e,t){for(const n in e){const a=e[n];t&&!t.test(n)||("string"==typeof a?delete e[n]:a&&!a.meta&&(this._cache.delete(a.schema),delete e[n]))}}_addSchema(e,t,n,a=this.opts.validateSchema,i=this.opts.addUsedSchema){let r;const{schemaId:o}=this.opts;if("object"==typeof e)r=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let s=this._cache.get(e);if(void 0!==s)return s;n=(0,c.normalizeId)(r||n);const d=c.getSchemaRefs.call(this,e,n);return s=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:d}),this._cache.set(s.schema,s),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=s),a&&this.validateSchema(e,!0),s}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function M(e,t,n,a="error"){for(const i in e){const r=i;r in t&&this.logger[a](`${n}: option ${i}. ${e[r]}`)}}function L(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function k(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function D(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function x(){const e={...this.opts};for(const t of _)delete e[t];return e}w.ValidationError=r.default,w.MissingRefError=o.default,t.default=w;const Y={log(){},warn(){},error(){}},T=/^[a-z_$][a-z0-9_$:-]*$/i;function C(e,t){const{RULES:n}=this;if((0,m.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!T.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function j(e,t,n){var a;const i=null==t?void 0:t.post;if(n&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:r}=this;let o=i?r.post:r.rules.find((({type:e})=>e===n));if(o||(o={type:n,rules:[]},r.rules.push(o)),r.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?$.call(this,o,s,t.before):o.rules.push(s),r.all[e]=s,null===(a=t.implements)||void 0===a||a.forEach((e=>this.addKeyword(e)))}function $(e,t,n){const a=e.rules.findIndex((e=>e.keyword===n));a>=0?e.rules.splice(a,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function P(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=F(t)),e.validateSchema=this.compile(t,!0))}const I={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function F(e){return{anyOf:[e,I]}}},6250:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(2017);a.code='require("ajv/dist/runtime/equal").default',t.default=a},3853:function(e,t){"use strict";function n(e){const t=e.length;let n,a=0,i=0;for(;i<t;)a++,n=e.charCodeAt(i++),n>=55296&&n<=56319&&i<t&&(n=e.charCodeAt(i),56320==(64512&n)&&i++);return a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.code='require("ajv/dist/runtime/ucs2length").default'},5944:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(8343);a.code='require("ajv/dist/runtime/uri").default',t.default=a},3558:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},5457:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const a=n(9029),i=n(4227),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>a.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>a._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:a}=t;Array.isArray(a)?o(e,a):(0,i.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function o(e,t){const{gen:n,schema:r,data:o,keyword:s,it:l}=e;l.items=!0;const d=n.const("len",a._`${o}.length`);if(!1===r)e.setParams({len:t.length}),e.pass(a._`${d} <= ${t.length}`);else if("object"==typeof r&&!(0,i.alwaysValidSchema)(l,r)){const r=n.var("valid",a._`${d} <= ${t.length}`);n.if((0,a.not)(r),(()=>function(r){n.forRange("i",t.length,d,(t=>{e.subschema({keyword:s,dataProp:t,dataPropType:i.Type.Num},r),l.allErrors||n.if((0,a.not)(r),(()=>n.break()))}))}(r))),e.ok(r)}}t.validateAdditionalItems=o,t.default=r},8660:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(5765),i=n(9029),r=n(2023),o=n(4227),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>i._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:s,data:l,errsCount:d,it:c}=e;if(!d)throw new Error("ajv implementation error");const{allErrors:u,opts:m}=c;if(c.props=!0,"all"!==m.removeAdditional&&(0,o.alwaysValidSchema)(c,n))return;const f=(0,a.allSchemaProperties)(s.properties),h=(0,a.allSchemaProperties)(s.patternProperties);function p(e){t.code(i._`delete ${l}[${e}]`)}function _(a){if("all"===m.removeAdditional||m.removeAdditional&&!1===n)p(a);else{if(!1===n)return e.setParams({additionalProperty:a}),e.error(),void(u||t.break());if("object"==typeof n&&!(0,o.alwaysValidSchema)(c,n)){const n=t.name("valid");"failing"===m.removeAdditional?(g(a,n,!1),t.if((0,i.not)(n),(()=>{e.reset(),p(a)}))):(g(a,n),u||t.if((0,i.not)(n),(()=>t.break())))}}}function g(t,n,a){const i={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===a&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,n)}t.forIn("key",l,(n=>{f.length||h.length?t.if(function(n){let r;if(f.length>8){const e=(0,o.schemaRefOrVal)(c,s.properties,"properties");r=(0,a.isOwnProperty)(t,e,n)}else r=f.length?(0,i.or)(...f.map((e=>i._`${n} === ${e}`))):i.nil;return h.length&&(r=(0,i.or)(r,...h.map((t=>i._`${(0,a.usePattern)(e,t)}.test(${n})`)))),(0,i.not)(r)}(n),(()=>_(n))):_(n)})),e.ok(i._`${d} === ${r.default.errors}`)}};t.default=s},5844:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(4227),i={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const r=t.name("valid");n.forEach(((t,n)=>{if((0,a.alwaysValidSchema)(i,t))return;const o=e.subschema({keyword:"allOf",schemaProp:n},r);e.ok(r),e.mergeEvaluated(o)}))}};t.default=i},6505:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=a},2661:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(9029),i=n(4227),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?a.str`must contain at least ${e} valid item(s)`:a.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?a._`{minContains: ${e}}`:a._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:s}=e;let l,d;const{minContains:c,maxContains:u}=r;s.opts.next?(l=void 0===c?1:c,d=u):l=1;const m=t.const("len",a._`${o}.length`);if(e.setParams({min:l,max:d}),void 0===d&&0===l)return void(0,i.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==d&&l>d)return(0,i.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,i.alwaysValidSchema)(s,n)){let t=a._`${m} >= ${l}`;return void 0!==d&&(t=a._`${t} && ${m} <= ${d}`),void e.pass(t)}s.items=!0;const f=t.name("valid");function h(){const e=t.name("_valid"),n=t.let("count",0);p(e,(()=>t.if(e,(()=>function(e){t.code(a._`${e}++`),void 0===d?t.if(a._`${e} >= ${l}`,(()=>t.assign(f,!0).break())):(t.if(a._`${e} > ${d}`,(()=>t.assign(f,!1).break())),1===l?t.assign(f,!0):t.if(a._`${e} >= ${l}`,(()=>t.assign(f,!0))))}(n)))))}function p(n,a){t.forRange("i",0,m,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:i.Type.Num,compositeRule:!0},n),a()}))}void 0===d&&1===l?p(f,(()=>t.if(f,(()=>t.break())))):0===l?(t.let(f,!0),void 0!==d&&t.if(a._`${o}.length > 0`,h)):(t.let(f,!1),h()),e.result(f,(()=>e.reset()))}};t.default=r},3025:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const a=n(9029),i=n(4227),r=n(5765);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const i=1===t?"property":"properties";return a.str`must have ${i} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:i}})=>a._`{property: ${e},
|