@zhijiancloud/bpm 0.0.26 → 0.0.27
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
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")):"function"==typeof define&&define.amd?define(["lodash","qs","fecha","@antv/g6"],t):"object"==typeof exports?exports.bpm2=t(require("lodash"),require("qs"),require("fecha"),require("@antv/g6")):e.bpm2=t(e.lodash,e.qs,e.fecha,e["@antv/g6"])}(self,(function(e,t,i,o){return function(){var a={3532:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var i=n(4239),o=n(467),a=n.n(o),r=class{constructor(e,t={}){this._fnBatchLoad=e,this._options=t,this._queue=[]}async load(e){let t=await this.loads(e);return a().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={};a().each(e,(e=>{a().each(e.keys,(e=>t[e]=null))}));let n=a().keys(t);this._fnBatchLoad(n).then((i=>{a().each(n,((e,n)=>{t[e]=i[n]})),a().each(e,(({keys:e,resolve:n})=>{n(a().map(e,(e=>t[e])))}))})).catch((t=>{a().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,i.tq)()){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 o=await zj.net.request(e);return t.networking=!1,o},l={};var c={assistSelectEntranceForm:{getListDefinition(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o}){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_definition/`,method:"GET"},e,i)},getOptions(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_search/`,method:"GET",params:a},e,i)},getListSelected(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_selected/`,method:"GET",params:a},e,i)}},assistField:{getBatchLoader(e,{formDefId:t,fieldDefId:n,orgInfo:i,uniqueId:o}){const a=`${t}/${n}`,c=l[a]||new r((async a=>{console.log("assist_field/list_title requeset is call");let r=`/app_flow/v1/papi/assist_field/${t}/${n}/list_title/`;const l=await s({url:r,method:"GET",params:{values:JSON.stringify(a)}},e,i),c=_.get(l,"data.data.data",{});let u=[];return _.map(a,(e=>{o?(e=JSON.parse(e),e=_.get(e,`${o}`),u=_.concat(u,c[e])):u=_.concat(u,c[e])})),u}));return l[a]=c,c},getTitle(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a){return s({url:`/app_flow/v1/papi/assist_field/${t}/${n}/list_title/`,method:"GET",params:{values:JSON.stringify(a)}},e,i)},searchSelectOpts(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a={},r=""){return r&&(a.q=r),s({url:o?`/app_flow/v1/papi/dm/assist_field/${t}/${n}/search_title/`:`/app_flow/v1/papi/assist_field/${t}/${n}/search_title/`,method:"GET",params:a},e,i)}},assistTreeField:{searchSelectOpts(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a={},r=""){return r&&(a.q=r),s({url:o?`/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:a},e,i)}},assistUserTaskCC:{searchSelectOpts(e,{formDefId:t,node:n,orgInfo:i,isDm:o},a={},r=""){return r&&(a.q=r),s({url:`/app_flow/v1/papi/assist_user_task_cc/${t}/${n}/search_title/`,method:"GET",params:a},e,i)}}}},3783:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return $}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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}},[n("div",[e._v(e._s(e.label))])]),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("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 i=t.node;return n("span",{staticClass:"custom-tree-node"},[n("div",{staticClass:"tree-body-content"},[n("div",[e._v(e._s(i.label))]),e._v(" "),"strict"==e.tickStrategy&&i.lazy&&i.selectable?n("span",{on:{click:function(t){return t.stopPropagation(),e.expand(i.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)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(467),l=n.n(s),c=n(6981),u=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",[e._v("\n slsls\n")])};u._withStripped=!0;var d=n(1900),f=(0,d.Z)({},u,[],!1,null,null,null);f.options.__file="components/lib/bpmArea/src/part/room-map-select.vue";var h=f.exports;r().use(c.Dialog);var p={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:h},inject:["selectOptions"],data(){return{curVal:"",label:"选择区域",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()}},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 i={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&&(i.lazy=!1),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`)}),i=zj.pageParam({father:n,q:t});e||delete i.father,this.selectFields&&(i.fields=this.selectFields);let o=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:i,cusFormName:this.formName,field:this,container:this.container});return console.log("data",o),o},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)},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}}},m=(0,d.Z)(p,o,[],!1,null,null,null);m.options.__file="components/lib/bpmArea/src/part/editor.vue";var g=m.exports,v=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"area-reader"},[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()],1)};v._withStripped=!0;var b={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:h},data(){return{label:"",loading:!1,subareas:[],drawingMd5s:[],curVal:[]}},watch:{value(){this.curVal=this.value,this.loadRemoteLabel()}},computed:{openLocate(){return _.get(this.fieldConf,"enable_locate")},points(){return _.get(this.value,"all_points",[])}},mounted(){this.curVal=this.value,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="未选择"}}},y=(0,d.Z)(b,v,[],!1,null,null,null);y.options.__file="components/lib/bpmArea/src/part/reader.vue";var w=y.exports,S={name:"BpmArea",components:{editorComponent:g,readerComponent:w},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?w:(this.isMultiple,g)}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},C=(0,d.Z)(S,i,[],!1,null,null,null);C.options.__file="components/lib/bpmArea/src/main.vue";var x=C.exports;x.install=function(e){e.component(x.name,x)};var $=x},5756:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return O}});var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"area-elevation"},[e.curVal&&e.curVal.selected?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)};i._withStripped=!0;var o=n(6981),a=n(3371),r=n.n(a),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:"楼栋"}},[n("el-select",{attrs:{placeholder:"请选择楼栋",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:"楼层"}},[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-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._v(" "),"view"!=e.mode?n("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确 定")]):e._e()],1)],1)};s._withStripped=!0;var l=n(6407),c=n(3379),u=n.n(c),d=n(7795),f=n.n(d),h=n(569),p=n.n(h),m=n(3565),g=n.n(m),v=n(9216),b=n.n(v),y=n(4589),w=n.n(y),S=n(8459),C={};C.styleTagTransform=w(),C.setAttributes=g(),C.insert=p().bind(null,"head"),C.domAPI=f(),C.insertStyleElement=b(),u()(S.Z,C),S.Z&&S.Z.locals&&S.Z.locals;var x=n(1870),$={};$.styleTagTransform=w(),$.setAttributes=g(),$.insert=p().bind(null,"head"),$.domAPI=f(),$.insertStyleElement=b(),u()(x.Z,$),x.Z&&x.Z.locals&&x.Z.locals,r().use(l.SelectPositionTable),r().use(l.ColorIndication);var k={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)}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(){}},I=n(1900),E=(0,I.Z)(k,s,[],!1,null,null,null);E.options.__file="components/lib/bpmAreaElevation/src/part/dlgSelectSection.vue";var D=E.exports;r().use(o.Dialog);var P={name:"BpmAreaElevation",components:{dlgSelectSection:D},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:"未开始",color:"#fff",border_color:"#D8DADD",width:"100px"},{name:"task_ready",title:"进行中",color:"#FFE9BD",border_color:"#FFE9BD",width:"100px"},{name:"task_ing",title:"已完成",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)),"view"==this.mode?(this.button_title="",this.dialog_title="查看部位"):(this.button_title="选择部位",this.dialog_title="选择部位"),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 i={fields:{}};return i.fields[t]=this.container.formData[t],i.fields[n]=this.container.formData[n],this.sourceData=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:i,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={},i=[];this.fieldConf.test?_.each(this.fieldConf.status_range_enum,(e=>{n[e.id]=e,i.push(e)})):_.each(this.sourceData[1],(e=>{n[e.id]=e,i.push(e)})),console.log("statusMap",n);let o=(e,t,a)=>{let r=[];return _.each(e,(s=>{if(this.areaMap[s.id]=s,s.path_ids.length==t&&(0==a||_.last(s.path_ids)==a)){let a={title:s.name,key:s.id+"",path_names:s.path_names,state:!1,status:s.status};if(s.is_parent&&(a.childrens=o(e,t+1,s.id),a.childrens&&a.childrens.length>0)){let e=0,t=0,o=0;_.each(a.childrens,(n=>{n.status?(console.log("child",n),n.status==i[1].id?t+=1:n.status==i[2].id?o++:e++):e++})),console.log("_complete_count",o),console.log("_doing_count",t),console.log("_begin_count",e),o==a.childrens.length?s.status=i[2].id:e==a.childrens.length?s.status?_.each(a.childrens,(e=>{e.status=s.status,e.color=n[s.status].color})):s.status=i[0].id:s.status=i[1].id}s.status&&n[s.status]&&(a.color=n[s.status].color),r.push(a)}})),_.orderBy(r,["order"],["asc"]),1==t&&(r=_.reverse(r)),r};t=o(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)}}},T=(n(7157),(0,I.Z)(P,i,[],!1,null,null,null));T.options.__file="components/lib/bpmAreaElevation/src/main.vue";var F=T.exports;F.install=function(e){e.component(F.name,F)};var O=F},6972:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return G}});var i=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))};i._withStripped=!0;var o=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,color:e.resultColor?"#fff":"#333"}},[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,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-signature",{ref:"signature",attrs:{type:"Signature",mode:"edit","ui-type":"form",dm:e.dm,container:e.container},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(" "),e.isOpenAudit?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._e(),e._v(" "),e.curVal.auditor_name?n("el-form-item",{attrs:{label:e.$z("审批人","b2.common.approver")}},[e._v("\n "+e._s(e.curVal.auditor_name)+"\n ")]):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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981),u=n(5176);l().use(c.Dialog),l().use(c.DatePicker),l().use(u.default);var d={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!!r().get(this.fieldConf,"detail_allow",null)&&!!r().get(this.fieldConf,"detail_deny",null)},resultColor(){let e=r().get(this.curVal,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=r().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},getViewFont(){let e=this.curVal.result,t=1==e?"通过":-1==e?"":"不通过";return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.text","通过"):-1==e?"":r().get(this.fieldConf,"detail_deny.text","不通过")),t},judgment(){let e=this.curVal.result,t=r().get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.judgment"):r().get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.judgment||"must"==this.judgment},denyColor(){let e=r().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},signature(){let e=this.curVal.result,t=r().get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.signature"):r().get(this.fieldConf,"detail_deny.signature")),t},showSignature(){return"yes"==this.signature||"must"==this.signature},photo(){let e=this.curVal.result,t=r().get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.photo"):r().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 r().get(this.fieldConf,"check.required")},getCanvasBoxStyle(){return{height:"150px",width:"100%"}}},created(){this.loadProjBaseInfo()},mounted(){if(this.value){let e=r().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=r().merge(this.curVal,e)}this.useDetail&&(this.selectOptions=[{label:r().get(this.fieldConf,"detail_allow.text","通过"),value:1},{label:r().get(this.fieldConf,"detail_deny.text","不通过"),value:2}])},methods:{onHide(){this.opened=!1,this.showForm=!1},onOpen(){if(this.value){let e=r().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=r().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&&r().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}}},f=n(1900),h=(0,f.Z)(d,o,[],!1,null,null,null);h.options.__file="components/lib/bpmAudit/src/part/editor.vue";var p=h.exports,m=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)};m._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 v=n(1319),b=n.n(v),y={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,f.Z)(y,g,[],!1,null,null,null);w.options.__file="components/lib/bpmAudit/src/part/reader-detail.vue";var S=w.exports;l().use(c.Dialog),l().use(u.default);var C={components:{AuditReaderDetail:S},props:["value","fieldConf","row","uiType"],data(){return{opened:!1}},computed:{useDetail(){return!!r().get(this.fieldConf,"detail_allow",null)&&!!r().get(this.fieldConf,"detail_deny",null)},resultColor(){let e=r().get(this.value,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=r().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},denyColor(){let e=r().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},getViewFont(){let e=r().get(this.value,"result",-1),t=1==e?"通过":-1==e?"未审批":"不通过";return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.text","通过"):-1==e?"未审批":r().get(this.fieldConf,"detail_deny.text","不通过")),t},hasAudited(){return-1!=r().get(this.value,"result",-1)},showJudgment(){let e=r().get(this.fieldConf,"judgment");return"yes"==e||"must"==e},showSignature(){let e=r().get(this.fieldConf,"signature");return"yes"==e||"must"==e},showPhoto(){let e=r().get(this.fieldConf,"photo");return"yes"==e||"must"==e},isRequired(){return r().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}}},x=(0,f.Z)(C,m,[],!1,null,null,null);x.options.__file="components/lib/bpmAudit/src/part/reader.vue";var $=x.exports,k=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"}})};k._withStripped=!0;var I=function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"audit-with-others"})};I._withStripped=!0;var E={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:i},o){let a=window.atob(e.split(",")[1]),r=new ArrayBuffer(a.length),s=new Uint8Array(r);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let l,c=window.WebKitBlobBuilder||window.MozBlobBuilder;if(c){let e=new c;e.append(r),l=e.getBlob(t)}else l=new window.Blob([r],{type:t});let u=new FormData;u.append(i,l,n),zj.net.w.noapi({method:"POST",url:"/platform/v1/papi/app_file/upload/",data:u,processData:!1,contentType:!1}).then((e=>{o&&o(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)}))}}},D=(n(7602),n(6768),n(4540),(0,f.Z)(E,I,[],!1,null,"1f4bc398",null));D.options.__file="components/lib/bpmAudit/src/part/auditor/audit-with-others.vue";var P=D.exports,T=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)};T._withStripped=!0;var F={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)}}},O=(n(2577),(0,f.Z)(F,T,[],!1,null,"2709dffc",null));O.options.__file="components/lib/bpmAudit/src/part/auditor/audit-select.vue";var A=O.exports,M=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"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确 定","c.confirm")))])],1)])],1)};M._withStripped=!0;var j=n(6324);l().use(c.Dialog),l().use(c.DatePicker),l().use(u.default),l().use(j.default);var R={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,hasDraw:!1,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!!r().get(this.fieldConf,"detail_allow",null)&&!!r().get(this.fieldConf,"detail_deny",null)},judgment(){let e=this.result,t=r().get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.judgment"):r().get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.judgment||"must"==this.judgment},signature(){let e=this.result,t=r().get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.signature"):r().get(this.fieldConf,"detail_deny.signature")),t},allowColor(){let e=r().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?"primary":e},denyColor(){let e=r().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=r().get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.photo"):r().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?r().get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")):-1==e?"":r().get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail"))),t},userId(){return r().get(this.$bpm.userInfo,"user_id",0)},userName(){return r().get(this.$bpm.userInfo,"user_name","")},showReject(){return!!r().get(this.container,"formSchema.reject_targets")},rejectTargetMap(){let e=r().get(this.container,"formSchema.reject_targets");return r().keyBy(e,"node")},rejectTargetList(){console.log("this.container",this.container);let e=r().get(this.container,"formSchema.reject_targets"),t=r().get(this.container,"_formData.passed_nodes"),n=[];return r().each(e,(e=>{r().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}},created(){this.loadProjBaseInfo()},mounted(){if(this.value){let e=r().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=r().merge(this.curVal,e)}this.useDetail&&(this.selectOptions=[{label:r().get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")),value:1},{label:r().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=r().cloneDeep(this.passForm),this.form.result=1;else if(this.form=r().cloneDeep(this.notPassForm),this.form.result=2,1==this.rejectTargetList.length){let e=r().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&&r().isEmpty(e.photos)?this.$message({message:"请至少上传一张图片",type:"warning"}):(this._dealSubmit(e),this.openAuditDlg=!1):this.$message({message:"请填写意见",type:"warning"}):this.$message({message:"请完成签名",type:"warning"}):this.$message({message:"请选择审批结果",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&&r().set(t,"reject_target",this.getRejectTarget(e.reject_target)),this.curVal=t,this.$emit("change",this.curVal),console.log("this.container",this.container);let n=this.container.$parent;if(n){this.submiting=!0;try{n.doOperation()}catch(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"}:r().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=r().get(e,"data.data"),this.$bpm.setUserInfo(e.user_info)},async doOperation(e){console.log("this.fieldConf",this.fieldConf),setTimeout((()=>{let t=r().get(this.fieldConf,`opt_ass.${e}`),n=r().map(t,(e=>r().get(this.container,`eleMap.${e}`)));n=r().compact(n),this.optAss=n;let i=r().concat(t,this.fieldConf.id);i=r().compact(i),this.container.verfifyData(i,(()=>{this.result=e,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((()=>{}))}}},N=(0,f.Z)(R,M,[],!1,null,null,null);N.options.__file="components/lib/bpmAudit/src/part/auditor/audit-new.vue";var V={props:["value","fieldConf","row","container"],components:{AuditWithOthers:P,AuditSelect:A,AduitNew:N.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)}}},L=(0,f.Z)(V,k,[],!1,null,null,null);L.options.__file="components/lib/bpmAudit/src/part/auditor.vue";var z=L.exports,B={name:"BpmAudit",components:{editorComponent:p,readerComponent:$,auditorComponent:z},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}}},computed:{curComponent(){return"view"==this.mode?$:z}},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)}}},U=(n(6916),(0,f.Z)(B,i,[],!1,null,null,null));U.options.__file="components/lib/bpmAudit/src/main.vue";var q=U.exports;q.install=function(e){e.component(q.name,q)};var G=q},7802:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981);l().use(c.DatePicker);var u={data(){let e=this;return{curVal:"",pickerOptions:{disabledDate(t){return e.max&&e.min?t.getTime()>e.max&&t.getTime()<e.min:e.max&&!e.min?t.getTime()>e.max:!e.max&&e.min?t.getTime()<e.min:void 0}}}},props:["value","fieldConf","row","clearable","disabled","container"],watch:{curVal(e){console.log("val",e,this.checkFormat),this.$emit("input",e)},value(){this.curVal=this.value}},computed:{type(){let e=r().toLower(r().get(this.fieldConf,"type"));return this.isMonth?"month":e},isMonth(){return"C1M"==r().get(this.fieldConf,"range_type")},placeholder(){return this.fieldConf.desc||this.fieldConf.name},format(){let e=r().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},checkFormat(){let e=r().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:{analyzeLimit(e){console.log("this.fieldConf",this.fieldConf);let t=r().get(this.fieldConf,`check.${e}`);if(!t)return;let n=null,i=(new Date).getTime();switch(t.type){case"LimitDateOffset":var o=t.offset_days;n=this.deltaToDate(i,o);break;case"LimitDateOffsetByField":console.log("container",this.container);var a=t.offset_days,s=r().get(this.container,`formData.${t.field}`);if(!s)return 0;n=this.deltaToDate(s,a);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}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmDateTime/src/part/editor.vue";var h=f.exports,p=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{attrs:{title:e.dateTimeStr}},[e._v(e._s(e.dateTimeStr))])};p._withStripped=!0;var m=n(1319),g=n.n(m),v=n(4239),b={props:["value","fieldConf","row"],data(){return{dateTimeStr:""}},computed:{format(){return r().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?(r().isInteger(t)&&13!=r().toString(t).length&&(t*=1e3),(0,v.tq)()?(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(),g().format(e,this.format)):""}}},y=(0,d.Z)(b,p,[],!1,null,null,null);y.options.__file="components/lib/bpmDateTime/src/part/reader.vue";var _=y.exports,w={name:"BpmDateTime",components:{editorComponent:h,readerComponent:_},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?_:h}},data(){return{curVal:""}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},S=(0,d.Z)(w,i,[],!1,null,null,null);S.options.__file="components/lib/bpmDateTime/src/main.vue";var C=S.exports;C.install=function(e){e.component(C.name,C)};var x=C},6769:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};i._withStripped=!0;var o={name:"BpmField",mixins:[n(1606).Z]},a=(0,n(1900).Z)(o,i,[],!1,null,null,null);a.options.__file="components/lib/bpmField/src/main.vue";var r=a.exports;r.install=function(e){e.component(r.name,r)};var s=r},7882:function(e,t,n){"use strict";n.r(t);var i=n(6455);i.Z.install=function(e){e.component(i.Z.name,i.Z)},t.default=i.Z},1469:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return c}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};i._withStripped=!0;var o=n(3371),a=n.n(o),r={name:"BpmFormField",mixins:[n(1606).Z,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.$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 i=_.last(this.fieldPath);if(t.isSubForm){n||(n=[]);let o=this.rowIndex;if(n[o])return void this.$set(t.value[o],i,e);t.isXSubForm?a().set(n,o,t.getItem(o)):a().set(n,o,{}),n=n[o];try{a().set(t.value,o,n)}catch(e){console.log("error",t.value)}}else a().set(t.value,i,e),console.log("container.value",t.value,i,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,i)=>{i=_.replace(i,"&",".");let o=this.$watch(`row.f_fields.${i}`,(t=>{let n=!0;_.map(e,((e,t)=>{t=_.replace(t,"&",".");let i=_.get(this.row,`f_fields.${t}`);i=_.toString(i),n=n&&_.includes(e,i)})),this.fieldConf.perm.visible=n}),{immediate:0==n});n++,this.optAssWatchList.push(o)}))}}};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.$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:i})=>{let o=this._getFieldPath(!0),a=_.get(i,o),r=_.get(this.fieldConf,"check.required",!1);if((_.isNull(this.value)&&r||"SelectHouseOwner"==this.fieldConf.type&&(!this.value.name||!this.value.phone)&&r)&&_.unset(t,o),_.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||r||!a||_.unset(t,o)}let s=this.container,l=s.isSubForm,c=_.get(this.fieldConf,"optAssMap");if(!c||_.isEmpty(c))return;let u=!0;_.map(c,((e,t)=>{t=t.replace(/&/g,".");let n=_.split(t,".");n=_.last(n);let i=_.get(this.elementMap,`${n}.type`),o=!!i&&"Mul"==i.substr(0,3);this._getPath(n)!=n&&l&&(t=`${s.fieldConf.id}&${this.rowIndex}&${n}`),t=t.replace(/&/g,".");let a=_.get(this.form,`formData.${t}`);if(o);else{let t=_.toString(a);u=u&&_.includes(e,t)}})),u||_.unset(t,o)})),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:i})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||(this.topContainer.isCache?this.openRelyInitLoadOnCache(n,i):this.openInitRelyLoad(n,i))})),this.$bpm.$on("initRelyComplete",(async(e,t)=>{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:i})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||this.opeRelyById(n,i)}))},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"))},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],i=this.fieldConf,o=[],a=_.get(i,"perm.visible",!1);_.get(i,"check.required",!1)&&!this.isDetailMode&&o.push("q-field-required"),a&&!this.displayHidden||o.push("q-field-hidden"),this.readonly&&o.push("readonly");let r=_.get(this.fieldConf,"display.hide_name",!1),s=_.get(this.fieldConf,"display.is_tip",!1);r&&o.push("hide-name"),s&&o.push("tip-field"),n&&this.scrollToElement();let l=this.$bpm.isVerticalTypography,c=_.includes(["MulImage","SubForm","XSubForm","MulFile","Spliter","Signature"],i.type);return l=l&&!_.includes(["SubForm","XSubForm","Spliter"],i.type),l&&o.push("col-4"),"SelectHouseOwner"==i.type&&o.push("select-house-owner"),{filled:!0,hideHint:!0,disable:!_.get(i,"perm.editable",!0),error:!!n,errorLabel:_.get(n,"message",""),class:o,orientation:c||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 i=_.get(n,`f_fields.${e}.${t}`);this.value=i,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(this.valueUnWatch&&(this.valueUnWatch(),this.valueUnWatch=!1),e){let e=JSON.stringify(this.value);this.valueUnWatch=this.$watch("value",(async(t,n)=>{if(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),this.$emit("valueChanged"),this.setLocalCache(t),(!this.container.isSubForm||this.container.isSubForm&&(!_.isUndefined(n)||!_.isUndefined(t)))&&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}),{immediate:!1,deep:!0})}},setLocalCache(e){let t=this.fieldConf.id,n=this.container.mode,i=_.get(this.fieldConf,"value_type");this.$bpm.setLocalCache(n,`${t}.${i}`,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,console.log("this.selectList",this.selectList),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 i={fields:n,include_sup:!0},o=this.fieldConf.id,a=await this.$bpm.loadSelectRemoteForm({fieldId:o,params:i,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container});this.remoteData=a,this.loading=!1}},_getPath(e){let t=this.elements,n=e;return _.each(t,(t=>{_.each(t.elements||[],(i=>{i.id==e&&(n=t.id)}))})),n},getDependData(e){let t=this.topContainer.formData,n={};return"link_alert"===this.fieldConf.id&&console.log("link_alert: "+e,t),_.each(e,(e=>{let i=this._getPath(e),o=_.get(t,i);if(e!=i){let t=[];_.each(o,((n,i)=>{let o={},a=_.get(n,e);(a||0===a)&&_.set(o,e,a),_.hasIn(n,"_meta")&&_.set(o,"_meta",n._meta),t.push(o)})),n[i]&&(t=_.merge(n[i],t)),o=t}_.isArray(o)&&_.each(o,(e=>{_.unset(e,"isNew")})),i&&_.set(n,i,o)})),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:i},o){let a=_.get(this.fieldConf,"range_remote.depends",[]),r=this.getDependData(a);if(_.isEmpty(r))return;this.selectFields=JSON.stringify(r);let s={fields:JSON.stringify(r)};this.container.isSubForm&&_.set(s,"idx",this.rowIndex);let l=this.fieldConf.type;"OnlineEditor"==l&&(s={spec:JSON.stringify(r)}),t&&(s=_.merge(s,t));let c=null;return c=_.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),o&&o(c),c},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,i=n.isSubForm;_.map(e,((t,o)=>{o=o.replace(/&/g,".");let a=_.split(o,".");a=_.last(a);let r=this._getPath(a),s=_.get(this.elementMap,`${a}.type`),l=!!s&&"Mul"==s.substr(0,3);if(!s)return;let c=this.$watch(i?`form.formData.${n.fieldConf.id}`:`form.formData.${o}`,(()=>{let t=!0;_.map(e,((e,o)=>{r!=a&&i&&(o=`${n.fieldConf.id}&${this.rowIndex}&${a}`),o=o.replace(/&/g,".");let s=_.get(this.form,`formData.${o}`);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)})),i?this.displayHidden=!t:this.fieldConf.perm.visible=t,this.isDelete=!t}),{immediate:!0,deep:!!i});this.optAssWatchList.push(c)})),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)||!this.value)return;let n=await this.getRemoteByFieldMap();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(1900).Z)(r,i,[],!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 c=l},8357:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return j}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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",{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"},[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)}}},[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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(6981),l=n(4239),c=n(3371),u=n.n(c),d=n(5273),f=n.n(d),h=(n(7770),n(5403),n(2918)),p=n.n(h);var m={insertEXIF:function(e,t,n){if(e instanceof Blob){var i=this,o=new FileReader;o.onload=function(){i.insertEXIF(o.result,t,n)},o.readAsArrayBuffer(e)}else{var a=[].slice.call(new Uint8Array(e),0);if(255!==a[2]||224!==a[3])return e;var r=256*a[4]+a[5],s=[255,216].concat(t,a.slice(4+r));n(new Uint8Array(s))}},getEXIF:function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++){var i=e[n];255===i[0]&&225===i[1]&&(t=t.concat(i))}return t},getSegments:function(e,t){if(e instanceof Blob){var n=this,i=new FileReader;i.onload=function(){n.getSegments(i.result,t)},i.readAsArrayBuffer(e)}else{if(!e.length&&!e.byteLength)return[];var o,a,r=0,s=[],l=[].slice.call(new Uint8Array(e),0);let n=1;for(;n&&(255!==l[r]||218!==l[r+1])&&(255===l[r]&&216===l[r+1]?r+=2:(o=r+(256*l[r+2]+l[r+3])+2,a=l.slice(r,o),r=o,s.push(a)),!(r>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,"")),i=new Uint8Array(n.length),o=0,a=n.length;o<a;o++)i[o]=n.charCodeAt(o);return i},encode64:function(e){for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);return"data:image/jpeg;base64,"+window.btoa(t)}},g=n(5475),v=n.n(g);function b(e){let t="";v()(".viewer-in .address").length?(e&&(t='<i class="fa fa-map-marker"></i>'+e),v()(".viewer-in .address").html(t)):(e&&(t='<div class="address"><i class="fa fa-map-marker"></i>'+e+"</div>"),v()(".viewer-in .viewer-footer").append(t))}async function y(e){if(b(""),!function(e){return r().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=r().get(t,"url_list.0.path.0");b("定位信息加载中...");let i=document.createElement("img");i.src=n;let o=this;setTimeout((()=>{try{v().ajax({url:`${n}?exif`,success:e=>{e&&e.GPSLatitude?o.setPs(e):p().getData(i,(function(){var e=p().getAllTags(this);console.log("info",e),o.setPs(e)}))},error:()=>{p().getData(i,(function(){var e=p().getAllTags(this);console.log("info",e),o.setPs(e)}))}})}catch(e){p().getData(i,(function(){var e=p().getAllTags(this);o.setPs(e)}))}}),600)}function _(e){console.log("filePath",e);var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""}function w(){let e=(new Date).valueOf();return function(e){let t=0,n=e.length;for(let i=0;i<n;i++)t=31*t+e.charCodeAt(i),t>2147483647&&(t%=2147483648);return t}(function(e,t,n){let i="",o=6,a=["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 e=0;e<o;e++)i+=a[Math.round(Math.random()*(a.length-1))];return i}()+e.toString())}u().use(s.Upload),u().use(s.Button),u().use(s.Dialog);const S=n(8);u().use(f()),f().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 C=null,x={props:{value:{},fieldConf:{},row:{},extensions:{type:String,default(){return".gif,jpg,.jpeg,.png,.doc,.xlsx,.pdf,.docx,.xls,.dwg"}}},data(){return{curVal:[],fileList:[],opened:!1,officeUrl:"",windowH:0}},watch:{curVal(e){this.$emit("input",e)},value(){this.curVal=r().isArray(this.value)?this.value:[]}},computed:{url(){return r().get(this.fieldConf,"upload_url","/platform/v1/papi/app_file/upload/")},photo(){let e=[];return r().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),e},photoMd5s(){let e=[];return r().each(this.curVal,(t=>{this.isImageFile(t)&&e.push(t.md5)})),e},maxCountConf(){return r().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 C.Map("container",{resizeEnable:!0});e.plugin("AMap.Geolocation",(()=>{let t=new C.Geolocation({enableHighAccuracy:!0,timeout:1e4,maximumAge:0,convert:!0,showButton:!0,buttonPosition:"LB",buttonOffset:new C.Pixel(10,20),showMarker:!0,showCircle:!0,panToLocation:!0,zoomToAccuracy:!0});e.addControl(t),t.getCurrentPosition(),C.event.addListener(t,"complete",(e=>{this.position=e.position})),C.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 i in n)t[i]=n[i];document.head.appendChild(t)},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=r().filter(this.curVal,(e=>this.isImageFile(e)));y(r().get(n,t))},previewImg(e){let t=r().indexOf(this.photoMd5s,e.md5);this.$viewer.view(t)},isDwg(e){return r().endsWith(e.name,".dwg")},getFileTypeClass(e){let t=_(e.type);return t=t||_(e.name),r().endsWith(e.name,".dwg")&&(t="dwg"),r().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(){let e=this.fileList;r().each(e,((e,t)=>{!function(e,t){if(-1==e.type.indexOf("image"))t(null);else{let n=new FileReader,i=new Image;n.readAsDataURL(e),n.onload=function(){e.src=this.result,i.onload=function(){let t=i.width,n=i.height;e.width=t,e.height=n},i.src=e.src,function(e,t,n,i){var o=new Image;o.src=e.src,o.onload=function(){var e=this,o=e.width,a=e.height,r=o/a;o=t.width||o,a=t.height||o/r;var s=.7,l=document.createElement("canvas"),c=l.getContext("2d"),u=document.createAttribute("width");u.nodeValue=o;var d=document.createAttribute("height");d.nodeValue=a,l.setAttributeNode(u),l.setAttributeNode(d);try{p().getData(n,(function(){let n=p().getTag(this,"GPSLatitude");c.drawImage(e,0,0,o,a),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var r=l.toDataURL("image/jpeg",s);i(r,n)}))}catch(n){c.drawImage(e,0,0,o,a),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var f=l.toDataURL("image/jpeg",s);i(f,null)}}}(e,{quality:.4},e,t)}}}(e,((n,i)=>{n&&m.getSegments(new Blob([e]),(o=>{let a=this.dataURLtoFile(n,e.name),s=m.getEXIF(o);if(!r().isEmpty(s)&&i)m.insertEXIF(a,s,(n=>{let i=new Blob([n],{type:e.type});i.name=e.name,i.lastModifiedDate=new Date,this.fileList[t]=i}));else{let i={},o={},a={};i[S.ImageIFD.Make]="lse";let r=this.position.lat,s=this.position.lng;a[S.GPSIFD.GPSLatitudeRef]=r<0?"S":"N",a[S.GPSIFD.GPSLatitude]=S.GPSHelper.degToDmsRational(r),a[S.GPSIFD.GPSLongitudeRef]=s<0?"W":"E",a[S.GPSIFD.GPSLongitude]=S.GPSHelper.degToDmsRational(s),a[S.GPSIFD.GPSImgDirection]=[123456,100];let l={"0th":i,Exif:o,GPS:a},c=S.dump(l),u=S.insert(c,n),d=this.dataURLtoFile(u,e.name);this.fileList[t]=d}}))}))}))},dataURLtoFile(e,t){let n=e.split(","),i=n[0].match(/:(.*?);/)[1],o=atob(n[1]),a=o.length,r=new Uint8Array(a);for(;a--;)r[a]=o.charCodeAt(a);return new File([r],t,{type:i})},isImageFile(e){return r().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.QE)("/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=r().get(t,"url_list.0.path.0"),i=_(n);"application/pdf"==e.type&&(i="pdf"),"application/vnd.ms-excel"==e.type&&(i="ms-excel");let o=w(),a=`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"}[i]}&sign=${o}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(a="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),"pdf"==i){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),a=(0,l.tq)()?`/public/app3/bpm/view_pdf.html?url=${n}`:`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=a,this.opened=!0},onFail(e,t){let n=`${t.name}上传失败`;console.log("err:",n)},onUploaded(e,t){console.log("file",t);let n=r().isArray(this.curVal)?this.curVal:[];n.push({name:t.name,type:r().get(t,"raw.type"),md5:r().get(e,"data.file_md5")}),this.curVal=r().cloneDeep(n),console.log("this.curVal",this.curVal)},remove(e){this.curVal=r().filter(this.curVal,(t=>t.md5!=e)),this.$refs.uploader.queue=[]},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},$=x,k=n(1900),I=(0,k.Z)($,o,[],!1,null,null,null);I.options.__file="components/lib/bpmMulFile/src/part/editor.vue";var E=I.exports,D=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.value||0==e.value.length,expression:"!value || value.length == 0"}]},[e._v("\n "+e._s(e.$z("暂无文件或图片","c.no_files"))+"\n ")]),e._v(" "),n("viewer",{ref:"viewer",attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},e._l(e.value,(function(t){return n("span",{key:t.md5},[e.isImageFile(t)?n("div",{staticClass:"file-box"},[n("div",{staticClass:"file-icon",staticStyle:{height:"20px",border:"1px dashed #ececec"}},[n("img",{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 ")])]):n("span",{staticClass:"file-box",attrs:{target:"_blank"},on:{click:function(n){return e.reviewOnMobile(t)}}},[n("div",{staticClass:"text-center text-faded file-icon",on:{click:function(n){return e.preview(t)}}},[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 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")))])])])])})),0),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:""}})],1)};D._withStripped=!0,u().use(s.Dialog),u().use(f()),f().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}}),u().use(s.Dialog);var P={props:["value","fieldConf","row"],data(){return{vueLightId1:null,photo:[],officeUrl:"",opened:!1,windowH:0,type:"small"}},computed:{},watch:{value(){this.setPhoto()}},created(){},mounted(){let e=(new Date).getTime();this.vueLightId1=e+1,this.setPhoto(),this.windowH=document.body.clientHeight/100*99-50},methods:{isDwg(e){return r().endsWith(e.name,".dwg")},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=r().filter(this.value,(e=>this.isImageFile(e)));y(r().get(n,t))},setPhoto(){let e=[];r().each(this.value,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),this.photo=e},getFileTypeClass(e){let t=_(e.type);return"application/pdf"==e.type&&(t="fa-file-pdf-o"),r().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 r().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.QE)("/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=r().get(t,"url_list.0.path.0"),i=_(n);"application/pdf"==e.type&&(i="pdf"),"application/vnd.ms-excel"==e.type&&(i="ms-excel");let o=w(),a=`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"}[i]}&sign=${o}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(a="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),console.log("url",a),"pdf"==i){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),a=`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=a,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}`)},getFileType(e){var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},T=(0,k.Z)(P,D,[],!1,null,null,null);T.options.__file="components/lib/bpmMulFile/src/part/reader.vue";var F=T.exports,O={name:"BpmMulFile",components:{editorComponent:E,readerComponent:F},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?F:E}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},A=(0,k.Z)(O,i,[],!1,null,null,null);A.options.__file="components/lib/bpmMulFile/src/main.vue";var M=A.exports;M.install=function(e){e.component(M.name,M)};var j=M},5176:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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("点击上传")])],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("删除")])])})),0)]:[n("div",{staticClass:"col-auto",staticStyle:{"padding-top":"0px","font-size":"12px"}},[e._v("\n 未发现上传文件\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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(6981),l=n(4239),c=n(3371),u=n.n(c),d=n(5273),f=n.n(d),h=(n(7770),n(5403),n(2918)),p=n.n(h);var m={insertEXIF:function(e,t,n){if(e instanceof Blob){var i=this,o=new FileReader;o.onload=function(){i.insertEXIF(o.result,t,n)},o.readAsArrayBuffer(e)}else{var a=[].slice.call(new Uint8Array(e),0);if(255!==a[2]||224!==a[3])return e;var r=256*a[4]+a[5],s=[255,216].concat(t,a.slice(4+r));n(new Uint8Array(s))}},getEXIF:function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++){var i=e[n];255===i[0]&&225===i[1]&&(t=t.concat(i))}return t},getSegments:function(e,t){if(e instanceof Blob){var n=this,i=new FileReader;i.onload=function(){n.getSegments(i.result,t)},i.readAsArrayBuffer(e)}else{if(!e.length&&!e.byteLength)return[];var o,a,r=0,s=[],l=[].slice.call(new Uint8Array(e),0);let n=1;for(;n&&(255!==l[r]||218!==l[r+1])&&(255===l[r]&&216===l[r+1]?r+=2:(o=r+(256*l[r+2]+l[r+3])+2,a=l.slice(r,o),r=o,s.push(a)),!(r>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,"")),i=new Uint8Array(n.length),o=0,a=n.length;o<a;o++)i[o]=n.charCodeAt(o);return i},encode64:function(e){for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);return"data:image/jpeg;base64,"+window.btoa(t)}},g=n(5475),v=n.n(g);function b(e){let t="";v()(".viewer-in .address").length?(e&&(t='<i class="fa fa-map-marker"></i>'+e),v()(".viewer-in .address").html(t)):(e&&(t='<div class="address"><i class="fa fa-map-marker"></i>'+e+"</div>"),v()(".viewer-in .viewer-footer").append(t))}async function y(e){if(b(""),!function(e){return r().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=r().get(t,"url_list.0.path.0");b("定位信息加载中...");let i=document.createElement("img");i.src=n;let o=this;setTimeout((()=>{try{v().ajax({url:`${n}?exif`,success:e=>{e&&e.GPSLatitude?o.setPs(e):p().getData(i,(function(){var e=p().getAllTags(this);console.log("info",e),o.setPs(e)}))},error:()=>{p().getData(i,(function(){var e=p().getAllTags(this);console.log("info",e),o.setPs(e)}))}})}catch(e){p().getData(i,(function(){var e=p().getAllTags(this);o.setPs(e)}))}}),600)}function _(e){console.log("filePath",e);var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""}u().use(s.Upload),u().use(s.Button),u().use(s.Dialog);const w=n(8);u().use(f()),f().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,C={props:{type:{type:String,default:"MulImage"},value:{},fieldConf:{},row:{},extensions:{type:String,default(){return"jpg,.jpeg,.png,.dwg"}}},data(){return{curVal:[],fileList:[],opened:!1,officeUrl:"",windowH:0}},watch:{value(){this.curVal=this.isSign&&r().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 r().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),e},photoMd5s(){let e=[];return r().each(this.curVal,(t=>{this.isImageFile(t)&&e.push(t.md5)})),e},maxCountConf(){return r().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&&r().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 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 i in n)t[i]=n[i];document.head.appendChild(t)},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=r().filter(this.curVal,(e=>this.isImageFile(e)));y(r().get(n,t))},previewImg(e){let t=r().indexOf(this.photoMd5s,e.md5);this.$viewer.view(t)},isDwg(e){return r().endsWith(e.name,".dwg")},getFileTypeClass(e){let t=_(e.type);return t=t||_(e.name),r().endsWith(e.name,".dwg")&&(t="dwg"),r().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(){let e=this.fileList;r().each(e,((e,t)=>{!function(e,t){if(-1==e.type.indexOf("image"))t(null);else{let n=new FileReader,i=new Image;n.readAsDataURL(e),n.onload=function(){e.src=this.result,i.onload=function(){let t=i.width,n=i.height;e.width=t,e.height=n},i.src=e.src,function(e,t,n,i){var o=new Image;o.src=e.src,o.onload=function(){var e=this,o=e.width,a=e.height,r=o/a;o=t.width||o,a=t.height||o/r;var s=.7,l=document.createElement("canvas"),c=l.getContext("2d"),u=document.createAttribute("width");u.nodeValue=o;var d=document.createAttribute("height");d.nodeValue=a,l.setAttributeNode(u),l.setAttributeNode(d);try{p().getData(n,(function(){let n=p().getTag(this,"GPSLatitude");c.drawImage(e,0,0,o,a),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var r=l.toDataURL("image/jpeg",s);i(r,n)}))}catch(n){c.drawImage(e,0,0,o,a),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var f=l.toDataURL("image/jpeg",s);i(f,null)}}}(e,{quality:.4},e,t)}}}(e,((n,i)=>{n&&m.getSegments(new Blob([e]),(o=>{let a=this.dataURLtoFile(n,e.name),s=m.getEXIF(o);if(!r().isEmpty(s)&&i)m.insertEXIF(a,s,(n=>{let i=new Blob([n],{type:e.type});i.name=e.name,i.lastModifiedDate=new Date,this.fileList[t]=i}));else{let i={},o={},a={};i[w.ImageIFD.Make]="lse";let r=this.position.lat,s=this.position.lng;a[w.GPSIFD.GPSLatitudeRef]=r<0?"S":"N",a[w.GPSIFD.GPSLatitude]=w.GPSHelper.degToDmsRational(r),a[w.GPSIFD.GPSLongitudeRef]=s<0?"W":"E",a[w.GPSIFD.GPSLongitude]=w.GPSHelper.degToDmsRational(s),a[w.GPSIFD.GPSImgDirection]=[123456,100];let l={"0th":i,Exif:o,GPS:a},c=w.dump(l),u=w.insert(c,n),d=this.dataURLtoFile(u,e.name);this.fileList[t]=d}}))}))}))},dataURLtoFile(e,t){let n=e.split(","),i=n[0].match(/:(.*?);/)[1],o=atob(n[1]),a=o.length,r=new Uint8Array(a);for(;a--;)r[a]=o.charCodeAt(a);return new File([r],t,{type:i})},isImageFile(e){return r().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.QE)("/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=r().get(t,"url_list.0.path.0"),i=_(n);"application/pdf"==e.type&&(i="pdf"),"application/vnd.ms-excel"==e.type&&(i="ms-excel");let o=function(){let e=(new Date).valueOf();return function(e){let t=0,n=e.length;for(let i=0;i<n;i++)t=31*t+e.charCodeAt(i),t>2147483647&&(t%=2147483648);return t}(function(e,t,n){let i="",o=6,a=["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 e=0;e<o;e++)i+=a[Math.round(Math.random()*(a.length-1))];return i}()+e.toString())}(),a=`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"}[i]}&sign=${o}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(a="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),"pdf"==i){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),a=(0,l.tq)()?`/public/app3/bpm/view_pdf.html?url=${n}`:`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=a,this.opened=!0},onFail(e,t){let n=`${t.name}上传失败`;console.log("err:",n)},onUploaded(e,t){console.log("file",t);let n=r().isArray(this.curVal)?this.curVal:[];n.push({name:t.name,type:r().get(t,"raw.type"),md5:r().get(e,"data.file_md5")}),this.curVal=r().cloneDeep(n);let i=this.isSign?r().get(this.curVal,"0.md5",""):this.curVal;this.$emit("input",i)},remove(e){this.curVal=r().filter(this.curVal,(t=>t.md5!=e)),this.$refs.uploader.queue=[];let t=this.isSign?r().get(this.curVal,"0.md5",""):this.curVal;this.$emit("input",t)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},x=C,$=n(1900),k=(0,$.Z)(x,o,[],!1,null,null,null);k.options.__file="components/lib/bpmMulImage/src/part/editor.vue";var I=k.exports,E=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._v(" "),e.isSignature&&e.curVal&&e.curVal[0]?[n("img",{attrs:{src:e.fileLink(e.curVal[0]),alt:"电子签名",width:"100%",height:"100%"}})]: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:{height:"60px",border:"1px dashed #ececec",cursor:"pointer"}},[n("img",{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)};E._withStripped=!0,u().use(f()),f().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 D={props:["type","value","fieldConf","row"],data(){return{vueLightId1:null,photo:[],curVal:[],officeUrl:"",opened:!1,windowH:0}},computed:{is_mobile(){return(0,l.tq)()},isSignature(){return"Signature"===this.type}},watch:{value(){this.curVal=r().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,this.curVal=r().isString(this.value)?[{md5:this.value,name:"",type:"image/png"}]:this.value,this.setPhoto(),this.windowH=document.body.clientHeight/100*99-50},methods:{isDwg(e){return r().endsWith(e.name,".dwg")},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=r().filter(this.curVal,(e=>this.isImageFile(e)));y(r().get(n,t))},setPhoto(){let e=[];r().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),this.photo=e},getFileTypeClass(e){let t=_(e.type);return"application/pdf"==e.type&&(t="fa-file-pdf-o"),r().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 r().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.QE)("/platform/v1/papi/web_file/image_view/",n)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},P=(0,$.Z)(D,E,[],!1,null,null,null);P.options.__file="components/lib/bpmMulImage/src/part/reader.vue";var T=P.exports,F={name:"BpmMulImage",components:{editorComponent:I,readerComponent:T},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?T:I}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},O=(0,$.Z)(F,i,[],!1,null,null,null);O.options.__file="components/lib/bpmMulImage/src/main.vue";var A=O.exports;A.install=function(e){e.component(A.name,A)};var M=A},631:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return _}});var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-number",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981);l().use(c.InputNumber);var u={data(){return{curVal:null}},props:["value","fieldConf","row"],watch:{value(){this.curVal=this.value}},computed:{precision(){return r().get(this.fieldConf,"view.precision",0)}},methods:{handleChange(){this.$emit("input",this.curVal)}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmNumber/src/part/editor.vue";var h=f.exports,p={mixins:[n(1527).Z]},m=(0,d.Z)(p,void 0,void 0,!1,null,null,null);m.options.__file="components/lib/bpmNumber/src/part/reader.vue";var g=m.exports,v={name:"BpmNumber",components:{editorComponent:h,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:h}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},b=(0,d.Z)(v,i,[],!1,null,null,null);b.options.__file="components/lib/bpmNumber/src/main.vue";var y=b.exports;y.install=function(e){e.component(y.name,y)};var _=y},5596:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981);l().use(c.Select),l().use(c.Option);var u={components:{},props:["value","fieldConf","row","isMultiple"],data(){return{curVal:""}},watch:{value(){this.curVal=this.value?this.value:this.isMultiple?[]:""}},computed:{options(){let e=r().get(this.fieldConf,"range_enum");return r().map(e,(e=>({value:r().get(e,"0"),label:r().get(e,"1"),color:r().get(e,"2")})))},placeholder(){return this.fieldConf.desc||this.fieldConf.name},isRadiosStyle(){return"default"==r().get(this.fieldConf,"style")},isButtonStyle(){return"button"==r().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)}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmSelect/src/part/editor.vue";var h=f.exports,p=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._v(e._s(e.label))])};p._withStripped=!0;var m={props:["type","value","fieldConf","row"],data(){return{colorMap:{}}},computed:{_value(){return r().isArray(this.value)?this.value:[this.value]},rangeEnumMap(){let e=r().get(this.fieldConf,"range_enum"),t={};return r().each(e,(e=>{r().set(t,r().get(e,"0"),r().get(e,"1"))})),this.setColorMap(),t},label(){return r().get(this.rangeEnumMap,this.value,zj.z("未指定","b2.common. not_specified"))},isButton(){return"button"==r().get(this.fieldConf,"style")},isStatus(){return"Status"===this.type||"Status"===this.fieldConf.type}},methods:{setColorMap(){let e=r().get(this.fieldConf,"range_enum");this.colorMap={},r().each(e,(e=>{r().set(this.colorMap,r().get(e,"0"),r().get(e,"2"))}))}}},g=(0,d.Z)(m,p,[],!1,null,null,null);g.options.__file="components/lib/bpmSelect/src/part/reader.vue";var v=g.exports,b={name:"BpmSelect",components:{editorComponent:h,readerComponent:v},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?v:h}},watch:{curVal(e){this.$emit("input",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},y=(0,d.Z)(b,i,[],!1,null,null,null);y.options.__file="components/lib/bpmSelect/src/main.vue";var _=y.exports;_.install=function(e){e.component(_.name,_)};var w=_},8356:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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 i=t.node;return i.data.disabled?n("span",{},[e._v("\n "+e._s(i.label)+"\n ")]):n("el-option",{staticClass:"tree-options",attrs:{value:i.data.value,label:i.data.label}},[n("span",{staticStyle:{"padding-right":"30px","max-width":"500px",overflow:"hidden"}},[e._v("\n "+e._s(i.label)+"\n ")])])}}],null,!0)})],2)],1)};o._withStripped=!0;var a=n(3532),r=n(3371),s=n.n(r),l=n(467),c=n.n(l),u=n(6981);s().use(u.Tree),s().use(u.Select),s().use(u.Option);var d={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 c().get(this.fieldConf,"check.max_count")},tickStrategy(){return"leaf_only"==c().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=c().get(this.fieldConf,"id"),i={father:0===e.level?"":e.data.value||""},o=await a.Z.assistTreeField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm},i),r=c().get(o.data,"data.data",[]);t(this.transformResultToTree(r,e))},transformResultToTree(e,t){let n=c().get(this.fieldConf,"type");return"SelectCheckItem"==n||"MulSelectCheckItem"==n?c().map(e,(e=>{this.isMultiple||e[0]!==this.curVal||(this.defaultOptions=[]),this.isMultiple&&this.curVal.includes(e[0])&&(this.defaultOptions=c().filter(this.defaultOptions,(t=>t.value!==e[0])));let n=0===t.level?e[1]:t.data.label+" - "+e[1],i=!e[2];return{value:e[0],lazy:e[2],label:n,treeLabel:e[1],isLeaf:i,disabled:this.leafOnly&&!i}})):"SelectSort"==n||"MulSelectSort"==n?c().map(e,(e=>{this.isMultiple||e.value!==this.curVal||(this.defaultOptions=[]),this.isMultiple&&this.curVal.includes(e.value)&&(this.defaultOptions=c().filter(this.defaultOptions,(t=>t.value!==e.value)));let n=0===t.level?e.label:t.data.label+" - "+e.label,i=!e.lazy;return{value:e.value,lazy:e.lazy,label:n,treeLabel:e.label,isLeaf:i,disabled:this.leafOnly&&!i}})):void 0},async getDefaultOptions(){let e=c().isArray(this.curVal)?this.curVal:this.curVal?[this.curVal]:[];if(!e.length)return;const t=await a.Z.assistField.getTitle(this.$bpm,{formDefId:this.formDefId,fieldDefId:this.fieldConf.id,orgInfo:this.orgInfo,isDm:this.dm},e);console.log(t);const n=c().get(t.data,"data.data",{});let i=c().map(n,((e,t)=>({value:t,label:e})));console.log("default options: ",i),this.defaultOptions=i},onChange(e){this.$emit("input",e),this.$emit("change",e)}}},f=n(1900),h=(0,f.Z)(d,o,[],!1,null,null,null);h.options.__file="components/lib/bpmSelectCheckItem/src/part/editor.vue";var p=h.exports,m={mixins:[n(5460).Z]},g=(0,f.Z)(m,void 0,void 0,!1,null,null,null);g.options.__file="components/lib/bpmSelectCheckItem/src/part/reader.vue";var v=g.exports,b={name:"BpmSelectCheckItem",components:{editorComponent:p,readerComponent:v},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?v:p},multiple(){return this.isMultiple||0===this.type.indexOf("Mul")}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},y=n(3379),_=n.n(y),w=n(7795),S=n.n(w),C=n(569),x=n.n(C),$=n(3565),k=n.n($),I=n(9216),E=n.n(I),D=n(4589),P=n.n(D),T=n(1912),F={};F.styleTagTransform=P(),F.setAttributes=k(),F.insert=x().bind(null,"head"),F.domAPI=S(),F.insertStyleElement=E(),_()(T.Z,F),T.Z&&T.Z.locals&&T.Z.locals;var O=(0,f.Z)(b,i,[],!1,null,null,null);O.options.__file="components/lib/bpmSelectCheckItem/src/main.vue";var A=O.exports;A.install=function(e){e.component(A.name,A)};var M=A},2662:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var i=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.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(i){return n("div",{key:i.id},[n("label",{staticClass:"label"},[e._v(e._s(i.name))]),e._v(" "),n("span",[e._v(e._s(t.f_fields[i.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(i){return n("div",{key:i.id},[n("label",{staticClass:"label"},[e._v(e._s(i.name))]),e._v(" "),n("span",[e._v(e._s(t.f_fields[i.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:"数据筛选",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)};i._withStripped=!0;var o=n(3532),a=n(4239),r=n(6455);const s=["Area","MulArea"];var l={name:"BpmSelectEntranceForm",components:{BpmFieldsFilter:r.Z},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,a.tq)()},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 i=this.filterParams;this.keyword&&(i.q__contains=this.keyword),this.optionsLoading=!0;const a=(await o.Z.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(i)})).data.data;console.log("assist_select_entrance_form data: ",a);const r=_.map(a.data,(e=>(_.each(e.f_fields,(async(t,n)=>{if(this.shouldTransLabelKeys.includes(n))if(_.isArray(t)){const i=o.Z.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let a=await i.loads(...t);e.f_fields[n]=a.join(zj.z(",","c.comma"))}else{const i=o.Z.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let a=await i.load(t);e.f_fields[n]=a}})),{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=r;if(this.selectedItems.length){let e=_.map(this.selectedItems,(e=>e.id));s=_.filter(r,(t=>!e.includes(t.id)))}this.items="next"===e?_.concat(this.items,s):_.concat(this.selectedItems,s),this.pagination.action=e,this.pagination.lastAt=a.last_at,this.pagination.total=a.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 i=(await o.Z.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: ",i);const a=_.map(i.data,(e=>(_.each(e.f_fields,(async(t,n)=>{if(this.shouldTransLabelKeys.includes(n))if(_.isArray(t)){const i=o.Z.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let a=await i.loads(...t);e.f_fields[n]=a.join(zj.z(",","c.comma"))}else{const i=o.Z.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let a=await i.load(t);e.f_fields[n]=a}})),{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=a,"view"===this.mode&&(this.items=a)}finally{this.optionsLoading=!1}},async loadSchema(){let e=this.formDefId;const t=this.fieldConf.id,n=(await o.Z.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 i={},a=[],r=[];_.each(n.definition.form.elements,(e=>{if("Status"!==e.type)a.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]}})),i={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)&&r.push(e.id)})),this.descFields=a,this.statusField=i,this.shouldTransLabelKeys=r,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}}},c=(0,n(1900).Z)(l,i,[],!1,null,null,null);c.options.__file="components/lib/bpmSelectEntranceForm/src/main.vue";var u=c.exports;u.install=function(e){e.component(u.name,u)};var d=u},4092:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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:"","remote-method":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)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(6981),l=n(3532),c=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)};c._withStripped=!0;var u={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()}}},d=n(1900),f=(0,d.Z)(u,c,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectFromField/src/part/select-unit.vue";var h=f.exports;r().use(s.Select),r().use(s.Option);var p={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:h},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)}},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"),i=_.get(t,"1");this.unit={search_type:n,org_id:i},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)},async loadSelectOpts(e="",t=""){let n,i=this.fieldConf.id,o={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){console.log("UserTaskCC is getting options");const e=this.fieldConf.node;n=await l.Z.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},o)}else n=await l.Z.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:i,orgInfo:this.orgInfo,isDm:this.dm},o);const a=_.get(n.data,"data.data",[]);return this.transformOptions(a)},transformOptions(e){console.log("transformOptions origin: ",e);let t=_.map(e,(e=>({value:e[0],label:e[1]})));return this.options=t,console.log("options: ",t),t},onChange(e){this.$emit("input",e),this.$emit("change",e)}}},m=(0,d.Z)(p,o,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectFromField/src/part/editor.vue";var g=m.exports,v={mixins:[n(5460).Z]},b=(0,d.Z)(v,void 0,void 0,!1,null,null,null);b.options.__file="components/lib/bpmSelectFromField/src/part/reader.vue";var y=b.exports,w={name:"BpmSelectFromField",components:{editorComponent:g,readerComponent:y},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?y: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:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},S=(0,d.Z)(w,i,[],!1,null,null,null);S.options.__file="components/lib/bpmSelectFromField/src/main.vue";var C=S.exports;C.install=function(e){e.component(C.name,C)};var x=C},4512:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-from-form",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,formName:e.formName,orgInfo:e.orgInfo,uiType:e.uiType,isMultiple:e.isMultiple},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-from-form-editor"},[n("div",{on:{click:e.toOpen}},[n("div",{staticClass:"fake-trigger"},[e._v(e._s(e.label))])]),e._v(" "),n("el-dialog",{attrs:{"append-to-body":!0,visible:e.opened,"before-close":e.onHide,title:e.fieldConf.name,width:"40%"},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"只展示前100条数据,通过搜索获取更多"},on:{change:e.debounceSearch},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),e._v(" "),n("div",{staticClass:"bpm-select-from-form-box"},[e.isMultiple?n("el-checkbox-group",{attrs:{max:e.maxCount},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},e._l(e.formList,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.titleStyle},[n("el-checkbox",{key:t.id,attrs:{label:t.id}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.id,staticClass:"subitem",style:e.geFieldStyle(t.key)},[e._v("\n "+e._s(t.value)+"\n ")])}))],2)})),0):n("el-radio-group",{model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},e._l(e.formList,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.titleStyle},[n("el-radio",{key:t.id,attrs:{label:t.id,value:t.id}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.id,staticClass:"subitem",style:e.geFieldStyle(t.key)},[e._v("\n "+e._s(t.key+": "+t.value)+"\n ")])}))],2)})),0)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("确 定")])],1)],1)],1)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(467),l=n.n(s),c=n(6981);r().use(c.Dialog);var u={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],inject:["getSelectFields","selectOptions"],data(){return{curVal:"",label:"未选择",keyword:"",opened:!1,debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[]}},watch:{value(e){(l().isString(e)||l().isArray(e))&&(this.curVal=e),this.loadRemoteLabel()},selectOptionsList(e){this.fieldConf.default&&"Default"==this.fieldConf.default.type&&"EVCFirstElem"==this.fieldConf.default.value.type&&(this.formList=this.transformOptions(e),console.log("this.formList",this.formList),this.isMultiple?this.curVal=[this.formList[0].id]:this.curVal=this.formList[0].id,console.log("this.curVal",this.curVal),this.onSubmit()),console.log("fieldConf",this.fieldConf),console.log("selectOptionsList",e)}},computed:{selectOptionsList(){return this.selectOptions()},placeholder(){return this.fieldConf.desc||this.fieldConf.name},maxCount(){return l().get(this.fieldConf,"check.max_count")},titleStyle(){let e=this.fieldConf,t=l().get(e,"range_remote.range_display.title");return{fontSize:l().get(t,"size",16)+"px",color:l().get(t,"color","#333")}},fieldStyleMap(){let e=this.fieldConf,t=l().get(e,"range_remote.range_display.fields");return l().keyBy(t,"field")}},created(){},mounted(){this.getCurVal(),this.loadRemoteLabel()},methods:{getCurVal(){this.value&&(l().isString(this.value)||l().isArray(this.value))?this.curVal=this.value:this.curVal=this.isMultiple?[]:""},geFieldStyle(e){let t=l().get(this.fieldStyleMap,e);return{fontSize:l().get(t,"size",12)+"px",color:l().get(t,"color","#949494")}},async search(){let e=this.keyword,t=this.formName,n=l().get(this.fieldConf,"id");const i=this.orgInfo;let o=this.getSelectFields();o&&"{}"!==JSON.stringify(o)&&(i.fields=o);let a=await this.$bpm.searchSelectOpts(n,e,t,this,!1,i),r=this.transformOptions(a);this.formList=r},transformOptions(e){return l().map(e,(e=>({title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:l().map(e.f_fields,((e,t)=>({key:t,value:e})))})))},onHide(){this.opened=!1},onOpen(){this.getCurVal();let e=this.selectOptions();e&&e.length?this.formList=this.transformOptions(e):this.search()},toOpen(){this.opened=!0},isChecked(e){return l().includes(this.curVal,e)},onSubmit(){console.log("this.curVal",this.curVal),this.$emit("input",this.curVal),this.$emit("change",this.curVal),this.opened=!1},async loadRemoteLabel(){let e=this.value,t=l().get(this.fieldConf,"id");l().isEmpty(e)?this.label="未选择":(e=l().isArray(e)?e:[e],this.label=await this.$bpm.fetchLabelByValues(e,t,this.formName,this.row))}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectFromForm/src/part/editor.vue";var h=f.exports,p={mixins:[n(5460).Z]},m=(0,d.Z)(p,void 0,void 0,!1,null,null,null);m.options.__file="components/lib/bpmSelectFromForm/src/part/reader.vue";var g=m.exports,v={name:"bpmSelectFromForm",components:{editorComponent:h,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:h}},watch:{curVal(e){this.$emit("input",e)},value(){console.log("selectFormForm_value",this.value),this.curVal=this.value}},mounted(){this.curVal=this.value}},b=n(3379),y=n.n(b),_=n(7795),w=n.n(_),S=n(569),C=n.n(S),x=n(3565),$=n.n(x),k=n(9216),I=n.n(k),E=n(4589),D=n.n(E),P=n(432),T={};T.styleTagTransform=D(),T.setAttributes=$(),T.insert=C().bind(null,"head"),T.domAPI=w(),T.insertStyleElement=I(),y()(P.Z,T),P.Z&&P.Z.locals&&P.Z.locals;var F=(0,d.Z)(v,i,[],!1,null,null,null);F.options.__file="components/lib/bpmSelectFromForm/src/main.vue";var O=F.exports;O.install=function(e){e.component(O.name,O)};var A=O},1521:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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 已选名单:\n "),e._l(e.selectedLabels,(function(t,i){return n("el-tag",{directives:[{name:"show",rawName:"v-show",value:i<=5,expression:"index <= 5"}],key:i,attrs:{type:"success"}},[e._v(e._s(t)+"\n "),n("i",{staticClass:"fa fa-times-circle",on:{click:function(t){return e.deleteSelected(i)}}})])})),e._v(" "),e.selectedLabels.length>5?n("el-button",{attrs:{label:"查看全部"+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,i){return n("div",{key:i},[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(i)}}})])})),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._v(" "),n("div",[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入关键字搜索",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._v(" "),n("div",[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入关键字搜索",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 先选择表单\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("确 定")])],1)])],1)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(467),l=n.n(s),c=n(6981);r().use(c.Dialog);var u={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"),i=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(i.data,(e=>({value:e[0],label:e[1]})))},async search(){let e=this.formKeyword,t=this.formName,n=l().get(this.fieldConf,"id"),i=this.selectedApp,o=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/select_form_id/${t}/${n}/search_right_title/?q=${e}&left=${i}`,params:this.orgInfo});this.formList=l().map(o.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="未选择";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}),i=l().map(n.data);this.label=l().join(i,",")}},onHide(){this.opened=!1},onOpen(){this.loadApps()},isChecked(e){return l().includes(this.curVal,e)},onSubmit(){this.$emit("input",this.curVal),this.opened=!1},toOpen(){this.opened=!0},deleteSelected(e){let t=this.curVal;l().pullAt(t,e),this.curVal=l().cloneDeep(t)}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectFromId/src/part/editor.vue";var h=f.exports,p={mixins:[n(5460).Z]},m=(0,d.Z)(p,void 0,void 0,!1,null,null,null);m.options.__file="components/lib/bpmSelectFromId/src/part/reader.vue";var g=m.exports,v={name:"bpmSelectFromId",components:{editorComponent:h,readerComponent:g},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?g:h}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},b=n(3379),y=n.n(b),_=n(7795),w=n.n(_),S=n(569),C=n.n(S),x=n(3565),$=n.n(x),k=n(9216),I=n.n(k),E=n(4589),D=n.n(E),P=n(7957),T={};T.styleTagTransform=D(),T.setAttributes=$(),T.insert=C().bind(null,"head"),T.domAPI=w(),T.insertStyleElement=I(),y()(P.Z,T),P.Z&&P.Z.locals&&P.Z.locals;var F=(0,d.Z)(v,i,[],!1,null,null,null);F.options.__file="components/lib/bpmSelectFromId/src/main.vue";var O=F.exports;O.install=function(e){e.component(O.name,O)};var A=O},4189:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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 i=t.item;return[n("div",{staticClass:"name"},[e._v(e._s(i.value))]),e._v(" "),n("span",{staticClass:"addr"},[e._v(e._s(i.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)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(467),l=n.n(s),c=n(6981);r().use(c.Autocomplete);var u={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},curValue(e){this.$emit("input",e)},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}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectHouseOwner/src/part/editor.vue";var h=f.exports,p=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("--"))])])};p._withStripped=!0;var m=(0,d.Z)({props:["type","value","fieldConf","row"]},p,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectHouseOwner/src/part/reader.vue";var g=m.exports,v={name:"bpmSelectHouseOwner",components:{editorComponent:h,readerComponent:g},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?g:h}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},b=n(3379),y=n.n(b),_=n(7795),w=n.n(_),S=n(569),C=n.n(S),x=n(3565),$=n.n(x),k=n(9216),I=n.n(k),E=n(4589),D=n.n(E),P=n(8706),T={};T.styleTagTransform=D(),T.setAttributes=$(),T.insert=C().bind(null,"head"),T.domAPI=w(),T.insertStyleElement=I(),y()(P.Z,T),P.Z&&P.Z.locals&&P.Z.locals;var F=(0,d.Z)(v,i,[],!1,null,null,null);F.options.__file="components/lib/bpmSelectHouseOwner/src/main.vue";var O=F.exports;O.install=function(e){e.component(O.name,O)};var A=O},5014:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var i=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)};i._withStripped=!0;var o={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()}}},a=(n(5356),(0,n(1900).Z)(o,i,[],!1,null,null,null));a.options.__file="components/lib/bpmSelectIssue/src/main.vue";var r=a.exports;r.install=function(e){e.component(r.name,r)};var s=r},4078:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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:"",remote:"","remote-method":e.remoteMethod},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)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(6981),l=n(3532),c=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)};c._withStripped=!0;var u={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()}}},d=n(1900),f=(0,d.Z)(u,c,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectUser/src/part/select-unit.vue";var h=f.exports;r().use(s.Select),r().use(s.Option);var p={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:h},data(){return{curVal:"",options:[],keyword:"",unit:{search_type:"",org_id:""},unitVisible:!1,unitChildCurVal:"",unitChildsOptions:[]}},watch:{value(){this.curVal=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,!0);if(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"),i=_.get(t,"1");this.unit={search_type:n,org_id:i},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)},async loadSelectOpts(e="",t=""){let n,i=this.fieldConf.id,o={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){console.log("UserTaskCC is getting options");const e=this.fieldConf.node;n=await l.Z.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},o)}else n=await l.Z.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:i,orgInfo:this.orgInfo,isDm:this.dm},o);const a=_.get(n.data,"data.data",[]);return this.transformOptions(a)},transformOptions(e){console.log("transformOptions origin: ",e);let t=_.map(e,(e=>({value:e[0],label:e[1]})));return this.options=this.options.concat(t),this.options=_.uniqBy(this.options,"value"),this.showUnit?(this.options=this.options.concat(t),this.options=_.uniqBy(this.options,"value"),this.unitChildsOptions=t,this._setUnitChildCurVal(this.curVal)):this.options=t,console.log("options: ",t),t},_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)}}},m=(0,d.Z)(p,o,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectUser/src/part/editor.vue";var g=m.exports,v={mixins:[n(5460).Z]},b=(0,d.Z)(v,void 0,void 0,!1,null,null,null);b.options.__file="components/lib/bpmSelectUser/src/part/reader.vue";var y=b.exports,w={name:"BpmSelectFromField",components:{editorComponent:g,readerComponent:y},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?y: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:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},S=(0,d.Z)(w,i,[],!1,null,null,null);S.options.__file="components/lib/bpmSelectUser/src/main.vue";var C=S.exports;C.install=function(e){e.component(C.name,C)};var x=C},6324:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return u}});var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-signature",staticStyle:{position:"relative"}},["edit"===e.mode?[e.openLastSign&&e.lastSign?n("div",{staticClass:"canvas-box",staticStyle:{position:"absolute","border-color":"#fff"}},[n("bpm-mul-image",{staticClass:"signature-reader",attrs:{type:"Signature",value:e.curSign}})],1):e._e(),e._v(" "),n("div",{staticClass:"canvas-box"},[n("canvas",{ref:"canvasElem",staticStyle:{cursor:"crosshair",width:"100%",height:"320px"},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)};i._withStripped=!0;var o=n(5176);function a(e,t,n={},i={}){if(!(this instanceof a))return new a(e,n);if(!e)return;let{width:o,height:r}=window.getComputedStyle(e,null);o=o.replace("px",""),r=r.replace("px",""),console.log("canvas size: ",o,r),o=o&&"auto"!==o&&-1===o.indexOf("%")?o:600,r=r&&"auto"!==r&&-1===r.indexOf("%")?r:320,console.log(e),this.canvas=e,this.context=e.getContext("2d"),this.width=o,this.height=r;const s=this.context,l=window.devicePixelRatio;l?(e.style.width=`${o}px`,e.style.height=`${r}px`,e.height=r*l,e.width=o*l,s.scale(l,l)):(e.width=o,e.height=r),s.lineWidth=2,s.strokeStyle="black",s.lineCap="round",s.lineJoin="round",Object.assign(s,n);const c={},u=/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);u||(s.shadowBlur=1,s.shadowColor="black");let d=!1;const f=t=>n=>{if(n.preventDefault(),1===t&&(d=!0),1===t||d){const{left:i,top:o}=e.getBoundingClientRect();n=u?n.touches[0]:n,c.x=n.clientX-i+.5,c.y=n.clientY-o+.5,(e=>{switch(e){case 1:s.beginPath(),s.moveTo(c.x,c.y);break;case 2:s.lineTo(c.x,c.y),s.stroke()}})(t)}},h=f(1),p=f(2),m=window.requestAnimationFrame,g=m?e=>{m((()=>{p(e)}))}:p;if(u?(e.addEventListener("touchstart",h),e.addEventListener("touchmove",g)):(e.addEventListener("mousedown",h),e.addEventListener("mousemove",g),["mouseup","mouseleave"].forEach((t=>{e.addEventListener(t,(()=>{d=!1}))}))),"number"==typeof t)switch(this.degree=t,s.rotate(t*Math.PI/180),t){case-90:s.translate(-r,0);break;case 90:s.translate(0,-o);break;case-180:case 180:s.translate(-o,-r)}}a.prototype={scale(e,t,n=this.canvas){const i=n.width,o=n.height;if(t=t||o,(e=e||i)!==i||t!==o){const a=document.createElement("canvas"),r=a.getContext("2d");a.width=e,a.height=t,r.drawImage(n,0,0,i,o,0,0,e,t),n=a}return n},rotate(e,t=this.canvas){if(0!=(e=~~e)){const n=180,i=-90;e>n?e=n:e<i&&(e=i);const o=document.createElement("canvas"),a=o.getContext("2d"),r=t.height,s=t.width,l=e*Math.PI/180;switch(e){case-90:o.width=r,o.height=s,a.rotate(l),a.drawImage(t,-s,0);break;case 90:o.width=r,o.height=s,a.rotate(l),a.drawImage(t,0,-r);break;case 180:o.width=s,o.height=r,a.rotate(l),a.drawImage(t,-s,-r)}t=o}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],i=atob(t[1]);let o=i.length;const a=new Uint8Array(o);for(;o--;)a[o]=i.charCodeAt(o);return new Blob([a],{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,i){const o=new FormData,a=new XMLHttpRequest;a.withCredentials=!0,o.append("image",e,"sign"),a.open("POST",t,!0),a.onload=()=>{a.status>=200&&a.status<300||304===a.status?n(a.responseText):i()},a.onerror=e=>{"function"==typeof i?i(e):console.log(`upload img error: ${e}`)},a.send(o)}};var r=a,s={name:"BpmSignature",components:{BpmMulImage:o.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(){},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()})))}},methods:{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 r(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();console.log("Signature canvas img: ",e),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:i},o){let a=window.atob(e.split(",")[1]),r=new ArrayBuffer(a.length),s=new Uint8Array(r);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let l,c=window.WebKitBlobBuilder||window.MozBlobBuilder;if(c){let e=new c;e.append(r),l=e.getBlob(t)}else l=new window.Blob([r],{type:t});let u=new FormData;u.append(i,l,n),zj.net.w.noapi({method:"POST",url:"/platform/v1/papi/app_file/upload/",data:u,processData:!1,contentType:!1}).then((e=>{o&&o(e.file_md5)}))}}},l=(0,n(1900).Z)(s,i,[],!1,null,null,null);l.options.__file="components/lib/bpmSignature/src/main.vue";var c=l.exports;c.install=function(e){e.component(c.name,c)};var u=c},2284:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return v}});var i=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("查看子表单")]):"table"===e.showStyle?n("SubFormStyleTable",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,mode:e.mode,"max-height":e.maxHeight,"show-header":e.showHeader,resizable:e.resizable},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,"max-height":e.maxHeight},on:{change:e.handleChange}},"SubFormStyleCard",e.$attrs,!1)),e._v(" "),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,"max-height":e.dialogTableMaxHeight,"show-header":!0,resizable:!0},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},on:{change:e.handleChange}},"SubFormStyleCard",e.$attrs,!1))],1)])],1)};i._withStripped=!0;var o=n(3663),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-table",{staticStyle:{width:"100%"},attrs:{data:e.subformData,"max-height":e.maxHeight,"show-header":e.showHeader,resizable:e.resizable,border:"",stripe:""}},[e.showIndex?n("el-table-column",{attrs:{type:"index",label:e.indexLabel,width:100}}):e._e(),e._v(" "),e._l(e.columns,(function(t){return n("el-table-column",{key:t.key,attrs:{prop:t.id,label:t.label,"min-width":t.minWidth,sortable:t.sortable,"sort-by":t.sortBy},scopedSlots:e._u([{key:"default",fn:function(i){return[n("bpm-field",e._b({attrs:{type:t.data.type,fieldConf:t.data,mode:e.getFieldMode(t.data.perm),uiType:"table"},on:{change:e.handleChange},model:{value:i.row[t.id],callback:function(n){e.$set(i.row,t.id,n)},expression:"scope.row[col.id]"}},"bpm-field",e.$attrs,!1))]}}],null,!0)})})),e._v(" "),e.canRemove?n("el-table-column",{attrs:{prop:"delete",label:"操作",width:100},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{staticClass:"btn-delete",attrs:{type:"danger",icon:"el-icon-delete",circle:""},on:{click:function(n){return e.handleRemoveItem(t.$index)}}})]}}],null,!1,2399725298)}):e._e()],2),e._v(" "),e.canAdd?n("el-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"default",icon:"el-icon-plus"},on:{click:e.handleAddItem}},[e._v("添加项")]):e._e()],1)};a._withStripped=!0;var r={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}},data(){return{subformData:[]}},computed:{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},canRemove(){return"edit"===this.mode&&this.subformPerm.deletable},showIndex(){return!!this.fieldConf.show_index},indexLabel(){return this.fieldConf.index_label||zj.z("序号","c.b2.common.subform_index")}},watch:{value:{handler(e){e&&_.isArray(e)?this.subformData=e:this.subformData=[]},immediate:!0}},methods:{getFieldMode(e){let t=this.mode;return!e||"edit"!==t||e.editable||e.writable||(t="view"),t},handleChange(){"edit"===this.mode&&this.$emit("change",this.subformData)},handleAddItem(){let e=this.maxId+1,t={..._.cloneDeep(this.originItem),isNew:!0,_meta:{id:e,creator:this.userId,is_deleted:!1}};this.subformData.push(t)},handleRemoveItem(e){this.subformData.splice(e,1),this.handleChange()}}},s={name:"SubFormStyleTable",mixins:[r],props:{showHeader:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0}}},l=n(1900),c=(0,l.Z)(s,a,[],!1,null,null,null);c.options.__file="components/lib/bpmSubForm/src/table.vue";var u=c.exports,d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:{overflow:"auto"}},[e._l(e.subformData,(function(t,i){return n("el-card",{key:i,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(i+1)+"\n ")]):e._e(),e._v(" "),e._l(e.columns,(function(i){return n("el-form-item",{key:i.key,attrs:{label:i.label,required:i.data.check&&i.data.check.required}},[n("bpm-field",e._b({attrs:{type:i.data.type,fieldConf:i.data,mode:e.getFieldMode(i.data.perm),uiType:"form"},on:{change:e.handleChange},model:{value:t[i.id],callback:function(n){e.$set(t,i.id,n)},expression:"item[col.id]"}},"bpm-field",e.$attrs,!1))],1)}))],2),e._v(" "),e.canRemove?n("el-button",{staticClass:"btn-delete",attrs:{type:"danger",icon:"el-icon-delete",circle:""},on:{click:function(t){return e.handleRemoveItem(i)}}}):e._e()],1)})),e._v(" "),e.canAdd?n("el-button",{attrs:{type:"default",icon:"el-icon-plus"},on:{click:e.handleAddItem}},[e._v("添加项")]):e._e()],2)};d._withStripped=!0;var f={name:"SubFormStyleCard",mixins:[r]},h=(0,l.Z)(f,d,[],!1,null,null,null);h.options.__file="components/lib/bpmSubForm/src/card.vue";var p={name:"BpmSubForm",components:{SubFormStyleTable:u,SubFormStyleCard:h.exports},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}},data(){return{subformData:[],dialogTableMaxHeight:500,showSubForm:!1}},computed:{columns(){const e=this.fieldConf.elements||[],t=[];return e.forEach((e=>{const n=o.r[e.type]||{},i=e.perm||{visible:!0,editable:!0,writable:!0};if(this.dm||i.visible){let o=this.mode;"edit"!==o||i.editable||i.writable||(o="view"),t.push({key:e.id,id:e.id,label:e.name||e.id,minWidth:n.tableColWidth||100,sortable:!0,sortBy:e.id,fieldMode:o,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}}},watch:{value:{handler(e){e&&_.isArray(e)?this.subformData=e:this.subformData=[]},immediate:!0}},created(){this.dialogTableMaxHeight=Math.floor(window.innerHeight/100*70-114)},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},m=(0,l.Z)(p,i,[],!1,null,"e0a458ce",null);m.options.__file="components/lib/bpmSubForm/src/main.vue";var g=m.exports;g.install=function(e){e.component(g.name,g)};var v=g},3791:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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,clearable:e.clearable,disabled:e.disabled},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981);l().use(c.TimeSelect);var u={data(){return{curVal:""}},props:["value","fieldConf","row","clearable","disabled"],watch:{curVal(e){this.$emit("input",e)},value(){this.curVal=this.value}},computed:{format(){return r().get(this.fieldConf,"view.format")},checkFormat(){return r().get(this.fieldConf,"check.format")}},mounted(){this.curVal=this.value},methods:{}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmTime/src/part/editor.vue";var h=f.exports,p=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",[e._v(e._s(e.value))])};p._withStripped=!0;var m={props:["value","fieldConf","row"],data(){return{}},computed:{},watch:{},mounted(){},methods:{}},g=(0,d.Z)(m,p,[],!1,null,null,null);g.options.__file="components/lib/bpmTime/src/part/reader.vue";var v=g.exports,b={name:"BpmTime",components:{editorComponent:h,readerComponent:v},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?v:h}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},y=(0,d.Z)(b,i,[],!1,null,null,null);y.options.__file="components/lib/bpmTime/src/main.vue";var _=y.exports;_.install=function(e){e.component(_.name,_)};var w=_},7924:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return r}});var i=function(){var e=this;e.$createElement;return e._self._c,e._m(0)};i._withStripped=!0;var o=(0,n(1900).Z)({name:"Demo"},i,[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);o.options.__file="components/lib/demo/src/main.vue";var a=o.exports;a.install=function(e){e.component(a.name,a)};var r=a},367:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return r}});var i=function(){var e=this;e.$createElement;return e._self._c,e._m(0)};i._withStripped=!0;var o=(0,n(1900).Z)({name:"Demo2"},i,[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);o.options.__file="components/lib/demo2/src/main.vue";var a=o.exports;a.install=function(e){e.component(a.name,a)};var r=a},3663:function(e,t,n){"use strict";n.d(t,{r:function(){return r}});let i=[{key:"lt",name:"早于"},{key:"gt",name:"晚于"},{key:"gte",name:"不早于"},{key:"lte",name:"不晚于"}],o=[{key:"in",name:"在列表中"}],a=[{key:"in",name:"在列表中"},{key:"all",name:"包含所有"}];const r={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:180,hasBpmField:!0,actions:i,attrs:["type","id","name","check.format","view.format","linkage"]},Date:{name:"日期选择器",hasBpmField:!0,actions:i,attrs:["type","id","name","check.format","view.format","linkage"]},Time:{name:"时间选择器",hasBpmField:!0,actions:i,attrs:["type","id","name","check.format","view.format","linkage"]},Timestamp:{name:"※时间戳",actions:i,attrs:["type","id","name","check.format","view.format","linkage"]},Select:{name:"单选",hasBpmField:!0,tableColWidth:220,actions:o,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},Status:{name:"状态",hasBpmField:!0,tableColWidth:150,actions:o,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},MulSelect:{name:"多选",hasBpmField:!0,tableColWidth:220,actions:a,attrs:["type","id","name","value_type","result_type","style","range_enum","linkage"]},SelectFromForm:{name:"远程单项选择",hasBpmField:!0,tableColWidth:200,actions:o,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:a,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"]},SelectProject:{name:"项目单项选择",hasBpmField:!0,tableColWidth:200,actions:o,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:a,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:o,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:a,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:200,actions:o,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:200,actions:a,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:o,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:a,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:o,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:a,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:o,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:o,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:o,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:a,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:"区域多项选择",actions:a,attrs:["type","id","name","value_type","can","linkage"]},Area:{name:"区域单项选择",actions:o,options:{type:"MulArea"},attrs:["type","id","name","value_type","can","linkage"]},SelectFormId:{name:"表单单项选择",hasBpmField:!0,tableColWidth:200,actions:o,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},MulSelectFormId:{name:"表单多项选择",hasBpmField:!0,tableColWidth:200,actions:o,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},SelectFromField:{name:"远程单选(从字段)",hasBpmField:!0,tableColWidth:200,actions:o,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:o,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}}},4239:function(e,t,n){"use strict";n.d(t,{QE:function(){return s},tq:function(){return l}});var i=n(467),o=n.n(i),a=n(6656),r=n.n(a);function s(e,t={}){o().isFunction(e)&&(e=e(t));let n=o().get(e.match(/\?([^#]+)/),"1");if(n){let i=r().parse(n);i=function(...e){return o().assignIn({},...e)}(i,t),e=o().replace(e,n,r().stringify(i))}else e=e+"?"+r().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,i=0,o=e.length;i<o;i++)-1!=t.indexOf(e[i])&&(n=!0);return n}},1503:function(e,t,n){var i={"./bpmArea/index.js":3783,"./bpmAreaElevation/index.js":5756,"./bpmAudit/index.js":6972,"./bpmDateTime/index.js":7802,"./bpmField/index.js":6769,"./bpmFieldsFilter/index.js":7882,"./bpmFormField/index.js":1469,"./bpmMulFile/index.js":8357,"./bpmMulImage/index.js":5176,"./bpmNumber/index.js":631,"./bpmSelect/index.js":5596,"./bpmSelectCheckItem/index.js":8356,"./bpmSelectEntranceForm/index.js":2662,"./bpmSelectFromField/index.js":4092,"./bpmSelectFromForm/index.js":4512,"./bpmSelectFromId/index.js":1521,"./bpmSelectHouseOwner/index.js":4189,"./bpmSelectIssue/index.js":5014,"./bpmSelectUser/index.js":4078,"./bpmSignature/index.js":6324,"./bpmSpliter/index.ts":3832,"./bpmSubForm/index.js":2284,"./bpmText/index.ts":6872,"./bpmTime/index.js":3791,"./demo/index.js":7924,"./demo2/index.js":367,"./index.ts":9492};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}o.keys=function(){return Object.keys(i)},o.resolve=a,e.exports=o,o.id=1503},1581: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=void 0;const i=n(7159),o=n(3924),a=n(1240),r=n(98),s=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(r,s):r;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)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=n(7426);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=n(6646);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},7023: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 i 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=i;class o 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 i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function a(e,...t){const n=[e[0]];let i=0;for(;i<t.length;)l(n,t[i]),n.push(e[++i]);return new o(n)}t._Code=o,t.nil=new o(""),t._=a;const r=new o("+");function s(e,...t){const n=[u(e[0])];let i=0;for(;i<t.length;)n.push(r),l(n,t[i]),n.push(r,u(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===r){const n=c(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new o(n)}function l(e,t){var n;t instanceof o?e.push(...t._items):t instanceof i?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof i||'"'!==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 i?void 0:`"${e}${t.slice(1)}`}function u(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 o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):a`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},3487: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 i=n(7023),o=n(8490);var a=n(7023);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return a.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return a.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return a.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return a.Name}});var r=n(8490);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),t.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._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?o.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class c 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 i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=T(this.rhs,e,t),this}get names(){return P(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends s{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p 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=T(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class m 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 i=n.length;for(;i--;){const o=n[i];o.optimizeNames(e,t)||(F(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>D(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends m{}class b extends g{}b.kind="else";class y extends g{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 b(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(O(e),t instanceof y?[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=T(this.condition,e,t),this}get names(){const e=super.names;return P(e,this.condition),this.else&&D(e,this.else.names),e}}y.kind="if";class _ extends g{}_.kind="for";class w extends _{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=T(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}}class S extends _{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:i,to:a}=this;return`for(${t} ${n}=${i}; ${n}<${a}; ${n}++)`+super.render(e)}get names(){const e=P(super.names,this.from);return P(e,this.to)}}class C extends _{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}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=T(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}}class x extends g{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)}}x.kind="func";class $ extends m{render(e){return"return "+super.render(e)}}$.kind="return";class k extends g{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,i;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}}class I extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}I.kind="catch";class E extends g{render(e){return"finally"+super.render(e)}}function D(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function P(e,t){return t instanceof i._CodeOrName?D(e,t.names):e}function T(e,t,n){return e instanceof i.Name?a(e):(o=e)instanceof i._Code&&o._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==n[e.str]))?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=a(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function a(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function F(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function O(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${R(e)}`}E.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 o.Scope({parent:e}),this._nodes=[new v]}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,i){const o=this._scope.toName(t);return void 0!==n&&i&&(this._constants[o.str]=n),this._leafNode(new l(e,o,n)),o}const(e,t,n){return this._def(o.varKinds.const,e,t,n)}let(e,t,n){return this._def(o.varKinds.let,e,t,n)}var(e,t,n){return this._def(o.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==i.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[n,o]of e)t.length>1&&t.push(","),t.push(n),(n!==o||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,o));return t.push("}"),new i._Code(t)}if(e,t,n){if(this._blockNode(new y(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 y(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(y,b)}_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,i,a=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const r=this._scope.toName(e);return this._for(new S(a,r,t,n),(()=>i(r)))}forOf(e,t,n,a=o.varKinds.const){const r=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(r,i._`${e}[${t}]`),n(r)}))}return this._for(new C("of",a,r,t),(()=>n(r)))}forIn(e,t,n,a=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const r=this._scope.toName(e);return this._for(new C("in",a,r,t),(()=>n(r)))}endFor(){return this._endBlockNode(_)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new $;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode($)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new k;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new I(e),t(e)}return n&&(this._currNode=i.finally=new E,this.code(n)),this._endBlockNode(I,E)}throw(e){return this._leafNode(new h(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=i.nil,n,o){return this._blockNode(new x(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(x)}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 y))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=O;const A=j(t.operators.AND);t.and=function(...e){return e.reduce(A)};const M=j(t.operators.OR);function j(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${R(t)} ${e} ${R(n)}`}function R(e){return e instanceof i.Name?e:i._`(${e})`}t.or=function(...e){return e.reduce(M)}},8490: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 i=n(7023);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var a;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(a=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class r{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.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=r;class s extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${n}]`}}t.ValueScopeName=s;const l=i._`\n`;t.ValueScope=class extends r{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.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 i=this.toName(e),{prefix:o}=i,a=null!==(n=t.key)&&void 0!==n?n:t.ref;let r=this._values[o];if(r){const e=r.get(a);if(e)return e}else r=this._values[o]=new Map;r.set(a,i);const s=this._scope[o]||(this._scope[o]=[]),l=s.length;return s[l]=t.ref,i.setValue(t,{property:o,itemIndex:l}),i}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 i._`${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,r={},s){let l=i.nil;for(const c in e){const u=e[c];if(!u)continue;const d=r[c]=r[c]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,a.Started);let r=n(e);if(r){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${r};${this.opts._n}`}else{if(!(r=null==s?void 0:s(e)))throw new o(e);l=i._`${l}${r}${this.opts._n}`}d.set(e,a.Completed)}))}return l}}},4181: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 i=n(3487),o=n(6776),a=n(2141);function r(e,t){const n=e.const("err",t);e.if(i._`${a.default.vErrors} === null`,(()=>e.assign(a.default.vErrors,i._`[${n}]`)),i._`${a.default.vErrors}.push(${n})`),e.code(i._`${a.default.errors}++`)}function s(e,t){const{gen:n,validateName:o,schemaEnv:a}=e;a.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,a){const{it:l}=e,{gen:u,compositeRule:d,allErrors:f}=l,h=c(e,n,o);(null!=a?a:d||f)?r(u,h):s(l,i._`[${h}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:o}=e,{gen:l,compositeRule:u,allErrors:d}=o;r(l,c(e,n,i)),u||d||s(o,a.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(a.default.errors,t),e.if(i._`${a.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${a.default.vErrors}.length`,t)),(()=>e.assign(a.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:r,it:s}){if(void 0===r)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",r,a.default.errors,(r=>{e.const(l,i._`${a.default.vErrors}[${r}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(a.default.instancePath,s.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign(i._`${l}.schema`,n),e.assign(i._`${l}.data`,o))}))};const l={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function c(e,t,n){const{createErrors:o}=e.it;return!1===o?i._`{}`:function(e,t,n={}){const{gen:o,it:r}=e,s=[u(r,n),d(e,n)];return function(e,{params:t,message:n},o){const{keyword:r,data:s,schemaValue:c,it:u}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:p}=u;o.push([l.keyword,r],[l.params,"function"==typeof t?t(e):t||i._`{}`]),d.messages&&o.push([l.message,"function"==typeof n?n(e):n]),d.verbose&&o.push([l.schema,c],[l.parentSchema,i._`${h}${p}`],[a.default.data,s]),f&&o.push([l.propertyName,f])}(e,t,s),o.object(...s)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[a.default.instancePath,(0,i.strConcat)(a.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:a}){let r=a?t:i.str`${t}/${e}`;return n&&(r=i.str`${r}${(0,o.getErrorPath)(n,o.Type.Str)}`),[l.schemaPath,r]}},5173: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 i=n(3487),o=n(7426),a=n(2141),r=n(2531),s=n(6776),l=n(4815);class c{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,r.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 u(e){const t=f.call(this,e);if(t)return t;const n=(0,r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:c}=this.opts.code,{ownProperties:u}=this.opts,d=new i.CodeGen(this.scope,{es5:s,lines:c,ownProperties:u});let h;e.$async&&(h=d.scopeValue("Error",{ref:o.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const p=d.scopeName("validate");e.validateName=p;const m={gen:d,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(a.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${a.default.self}`,`${a.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{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:p,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function d(e){return(0,r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function f(e){for(const i of this._compilations)if(n=e,(t=i).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return i;var t,n}function h(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||p.call(this,e,t)}function p(e,t){const n=this.opts.uriResolver.parse(t),i=(0,r._getFullPath)(this.opts.uriResolver,n);let o=(0,r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===o)return g.call(this,n,e);const a=(0,r.normalizeId)(i),s=this.refs[a]||this.schemas[a];if("string"==typeof s){const t=p.call(this,e,s);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==s?void 0:s.schema)){if(s.validate||u.call(this,s),a===(0,r.normalizeId)(t)){const{schema:t}=s,{schemaId:n}=this.opts,i=t[n];return i&&(o=(0,r.resolveUrl)(this.opts.uriResolver,o,i)),new c({schema:t,schemaId:n,root:e,baseId:o})}return g.call(this,n,s)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,n){var i;n=(0,r.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let a=h.call(this,e,n);if(void 0===a){const o=null===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:r}=this.opts;o&&(a=new c({schema:o,schemaId:r,root:e,baseId:t}))}return void 0!==a?e.refs[n]=d.call(this,a):void 0},t.getCompilingSchema=f,t.resolveSchema=p;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:i}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,s.unescapeFragment)(i)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!m.has(i)&&o&&(t=(0,r.resolveUrl)(this.opts.uriResolver,t,o))}let a;if("boolean"!=typeof n&&n.$ref&&!(0,s.schemaHasRulesButRef)(n,this.RULES)){const e=(0,r.resolveUrl)(this.opts.uriResolver,t,n.$ref);a=p.call(this,i,e)}const{schemaId:l}=this.opts;return a=a||new c({schema:n,schemaId:l,root:i,baseId:t}),a.schema!==a.root.schema?a:void 0}},2141:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(3487),o={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t.default=o},6646:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2531);class o extends Error{constructor(e,t,n,o){super(o||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,i.resolveUrl)(e,t,n),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(e,this.missingRef))}}t.default=o},2531: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 i=n(6776),o=n(4063),a=n(9461),r=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&&c(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 c(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!r.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=c(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=h(t));const i=e.parse(t);return d(e,i)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const f=/#\/?$/;function h(e){return e?e.replace(f,""):""}t.normalizeId=h,t.resolveUrl=function(e,t,n){return n=h(n),e.resolve(t,n)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:i}=this.opts,r=h(e[n]||t),s={"":r},l=u(i,r,!1),c={},d=new Set;return a(e,{allKeys:!0},((e,t,i,o)=>{if(void 0===o)return;const a=l+t;let r=s[o];function u(t){const n=this.opts.uriResolver.resolve;if(t=h(r?n(r,t):t),d.has(t))throw m(t);d.add(t);let i=this.refs[t];return"string"==typeof i&&(i=this.refs[i]),"object"==typeof i?f(e,i.schema,t):t!==h(a)&&("#"===t[0]?(f(e,c[t],t),c[t]=e):this.refs[t]=a),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[n]&&(r=u.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=r})),c;function f(e,t,n){if(void 0!==t&&!o(e,t))throw m(n)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},3141: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:{}}}},6776: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 i=n(3487),o=n(7023);function a(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=i.RULES.keywords;for(const n in t)o[n]||p(e,`unknown keyword: "${n}"`)}function r(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 c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(a,r,s,l)=>{const c=void 0===s?r:s instanceof i.Name?(r instanceof i.Name?e(a,r,s):t(a,r,s),s):r instanceof i.Name?(t(a,s,r),r):n(r,s);return l!==i.Name||c instanceof i.Name?c:o(a,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(i._`${t}${(0,i.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||(a(e,t),!r(t,e.self.RULES.all))},t.checkUnknownRules=a,t.schemaHasRules=r,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,o,a){if(!a){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(o)}`},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:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,i._`${n} || {}`).code(i._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,i._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,i._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>e.assign(n,!0===t||i._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const f={};var h;function p(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:f[t.code]||(f[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof i.Name){const o=t===h.Num;return n?o?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:o?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,i.getProperty)(e).toString():"/"+s(e)},t.checkStrictMode=p},8876:function(e,t){"use strict";function n(e,t){return t.rules.some((t=>i(e,t)))}function i(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},i){const o=t.RULES.types[i];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=i},5667:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=n(4181),o=n(3487),a=n(2141),r={message:"boolean schema is false"};function s(e,t){const{gen:n,data:o}=e,a={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(a,r,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:i}=e;!1===n?s(e,!1):"object"==typeof n&&!0===n.$async?t.return(a.default.data):(t.assign(o._`${i}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:i}=e;!1===i?(n.var(t,!1),s(e)):n.var(t,!0)}},453: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 i=n(3141),o=n(8876),a=n(4181),r=n(3487),s=n(6776);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.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||(t.DataType={})),t.getSchemaTypes=function(e){const t=c(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=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:i,opts:a}=e,s=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,a.coerceTypes),c=t.length>0&&!(0===s.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(c){const o=f(t,i,a.strictNumbers,l.Wrong);n.if(o,(()=>{s.length?function(e,t,n){const{gen:i,data:o,opts:a}=e,s=i.let("dataType",r._`typeof ${o}`),l=i.let("coerced",r._`undefined`);"array"===a.coerceTypes&&i.if(r._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>i.assign(o,r._`${o}[0]`).assign(s,r._`typeof ${o}`).if(f(t,o,a.strictNumbers),(()=>i.assign(l,o))))),i.if(r._`${l} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===a.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(r._`${s} == "number" || ${s} == "boolean"`).assign(l,r._`"" + ${o}`).elseIf(r._`${o} === null`).assign(l,r._`""`);case"number":return void i.elseIf(r._`${s} == "boolean" || ${o} === null
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash"),require("qs"),require("fecha"),require("@antv/g6")):"function"==typeof define&&define.amd?define(["lodash","qs","fecha","@antv/g6"],t):"object"==typeof exports?exports.bpm2=t(require("lodash"),require("qs"),require("fecha"),require("@antv/g6")):e.bpm2=t(e.lodash,e.qs,e.fecha,e["@antv/g6"])}(self,(function(e,t,i,o){return function(){var a={3532:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var i=n(4239),o=n(467),a=n.n(o),r=class{constructor(e,t={}){this._fnBatchLoad=e,this._options=t,this._queue=[]}async load(e){let t=await this.loads(e);return a().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={};a().each(e,(e=>{a().each(e.keys,(e=>t[e]=null))}));let n=a().keys(t);this._fnBatchLoad(n).then((i=>{a().each(n,((e,n)=>{t[e]=i[n]})),a().each(e,(({keys:e,resolve:n})=>{n(a().map(e,(e=>t[e])))}))})).catch((t=>{a().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,i.tq)()){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 o=await zj.net.request(e);return t.networking=!1,o},l={};var c={assistSelectEntranceForm:{getListDefinition(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o}){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_definition/`,method:"GET"},e,i)},getOptions(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_search/`,method:"GET",params:a},e,i)},getListSelected(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a){return s({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${n}/list_selected/`,method:"GET",params:a},e,i)}},assistField:{getBatchLoader(e,{formDefId:t,fieldDefId:n,orgInfo:i,uniqueId:o}){const a=`${t}/${n}`,c=l[a]||new r((async a=>{console.log("assist_field/list_title requeset is call");let r=`/app_flow/v1/papi/assist_field/${t}/${n}/list_title/`;const l=await s({url:r,method:"GET",params:{values:JSON.stringify(a)}},e,i),c=_.get(l,"data.data.data",{});let u=[];return _.map(a,(e=>{o?(e=JSON.parse(e),e=_.get(e,`${o}`),u=_.concat(u,c[e])):u=_.concat(u,c[e])})),u}));return l[a]=c,c},getTitle(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a){return s({url:`/app_flow/v1/papi/assist_field/${t}/${n}/list_title/`,method:"GET",params:{values:JSON.stringify(a)}},e,i)},searchSelectOpts(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a={},r=""){return r&&(a.q=r),s({url:o?`/app_flow/v1/papi/dm/assist_field/${t}/${n}/search_title/`:`/app_flow/v1/papi/assist_field/${t}/${n}/search_title/`,method:"GET",params:a},e,i)}},assistTreeField:{searchSelectOpts(e,{formDefId:t,fieldDefId:n,orgInfo:i,isDm:o},a={},r=""){return r&&(a.q=r),s({url:o?`/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:a},e,i)}},assistUserTaskCC:{searchSelectOpts(e,{formDefId:t,node:n,orgInfo:i,isDm:o},a={},r=""){return r&&(a.q=r),s({url:`/app_flow/v1/papi/assist_user_task_cc/${t}/${n}/search_title/`,method:"GET",params:a},e,i)}}}},3783:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return $}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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}},[n("div",[e._v(e._s(e.label))])]),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("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 i=t.node;return n("span",{staticClass:"custom-tree-node"},[n("div",{staticClass:"tree-body-content"},[n("div",[e._v(e._s(i.label))]),e._v(" "),"strict"==e.tickStrategy&&i.lazy&&i.selectable?n("span",{on:{click:function(t){return t.stopPropagation(),e.expand(i.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)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(467),l=n.n(s),c=n(6981),u=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",[e._v("\n slsls\n")])};u._withStripped=!0;var d=n(1900),f=(0,d.Z)({},u,[],!1,null,null,null);f.options.__file="components/lib/bpmArea/src/part/room-map-select.vue";var h=f.exports;r().use(c.Dialog);var p={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:h},inject:["selectOptions"],data(){return{curVal:"",label:"选择区域",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()}},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 i={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&&(i.lazy=!1),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`)}),i=zj.pageParam({father:n,q:t});e||delete i.father,this.selectFields&&(i.fields=this.selectFields);let o=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:i,cusFormName:this.formName,field:this,container:this.container});return console.log("data",o),o},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)},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}}},m=(0,d.Z)(p,o,[],!1,null,null,null);m.options.__file="components/lib/bpmArea/src/part/editor.vue";var g=m.exports,v=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"area-reader"},[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()],1)};v._withStripped=!0;var b={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:h},data(){return{label:"",loading:!1,subareas:[],drawingMd5s:[],curVal:[]}},watch:{value(){this.curVal=this.value,this.loadRemoteLabel()}},computed:{openLocate(){return _.get(this.fieldConf,"enable_locate")},points(){return _.get(this.value,"all_points",[])}},mounted(){this.curVal=this.value,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="未选择"}}},y=(0,d.Z)(b,v,[],!1,null,null,null);y.options.__file="components/lib/bpmArea/src/part/reader.vue";var w=y.exports,S={name:"BpmArea",components:{editorComponent:g,readerComponent:w},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?w:(this.isMultiple,g)}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},C=(0,d.Z)(S,i,[],!1,null,null,null);C.options.__file="components/lib/bpmArea/src/main.vue";var x=C.exports;x.install=function(e){e.component(x.name,x)};var $=x},5756:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return O}});var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"area-elevation"},[e.curVal&&e.curVal.selected?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)};i._withStripped=!0;var o=n(6981),a=n(3371),r=n.n(a),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:"楼栋"}},[n("el-select",{attrs:{placeholder:"请选择楼栋",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:"楼层"}},[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-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._v(" "),"view"!=e.mode?n("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确 定")]):e._e()],1)],1)};s._withStripped=!0;var l=n(6407),c=n(3379),u=n.n(c),d=n(7795),f=n.n(d),h=n(569),p=n.n(h),m=n(3565),g=n.n(m),v=n(9216),b=n.n(v),y=n(4589),w=n.n(y),S=n(8459),C={};C.styleTagTransform=w(),C.setAttributes=g(),C.insert=p().bind(null,"head"),C.domAPI=f(),C.insertStyleElement=b(),u()(S.Z,C),S.Z&&S.Z.locals&&S.Z.locals;var x=n(1870),$={};$.styleTagTransform=w(),$.setAttributes=g(),$.insert=p().bind(null,"head"),$.domAPI=f(),$.insertStyleElement=b(),u()(x.Z,$),x.Z&&x.Z.locals&&x.Z.locals,r().use(l.SelectPositionTable),r().use(l.ColorIndication);var k={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)}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(){}},I=n(1900),E=(0,I.Z)(k,s,[],!1,null,null,null);E.options.__file="components/lib/bpmAreaElevation/src/part/dlgSelectSection.vue";var D=E.exports;r().use(o.Dialog);var P={name:"BpmAreaElevation",components:{dlgSelectSection:D},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:"未开始",color:"#fff",border_color:"#D8DADD",width:"100px"},{name:"task_ready",title:"进行中",color:"#FFE9BD",border_color:"#FFE9BD",width:"100px"},{name:"task_ing",title:"已完成",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)),"view"==this.mode?(this.button_title="",this.dialog_title="查看部位"):(this.button_title="选择部位",this.dialog_title="选择部位"),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 i={fields:{}};return i.fields[t]=this.container.formData[t],i.fields[n]=this.container.formData[n],this.sourceData=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:i,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={},i=[];this.fieldConf.test?_.each(this.fieldConf.status_range_enum,(e=>{n[e.id]=e,i.push(e)})):_.each(this.sourceData[1],(e=>{n[e.id]=e,i.push(e)})),console.log("statusMap",n);let o=(e,t,a)=>{let r=[];return _.each(e,(s=>{if(this.areaMap[s.id]=s,s.path_ids.length==t&&(0==a||_.last(s.path_ids)==a)){let a={title:s.name,key:s.id+"",path_names:s.path_names,state:!1,status:s.status};if(s.is_parent&&(a.childrens=o(e,t+1,s.id),a.childrens&&a.childrens.length>0)){let e=0,t=0,o=0;_.each(a.childrens,(n=>{n.status?(console.log("child",n),n.status==i[1].id?t+=1:n.status==i[2].id?o++:e++):e++})),console.log("_complete_count",o),console.log("_doing_count",t),console.log("_begin_count",e),o==a.childrens.length?s.status=i[2].id:e==a.childrens.length?s.status?_.each(a.childrens,(e=>{e.status=s.status,e.color=n[s.status].color})):s.status=i[0].id:s.status=i[1].id}s.status&&n[s.status]&&(a.color=n[s.status].color),r.push(a)}})),_.orderBy(r,["order"],["asc"]),1==t&&(r=_.reverse(r)),r};t=o(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)}}},T=(n(7157),(0,I.Z)(P,i,[],!1,null,null,null));T.options.__file="components/lib/bpmAreaElevation/src/main.vue";var F=T.exports;F.install=function(e){e.component(F.name,F)};var O=F},6972:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return G}});var i=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))};i._withStripped=!0;var o=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,color:e.resultColor?"#fff":"#333"}},[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,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-signature",{ref:"signature",attrs:{type:"Signature",mode:"edit","ui-type":"form",dm:e.dm,container:e.container},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(" "),e.isOpenAudit?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._e(),e._v(" "),e.curVal.auditor_name?n("el-form-item",{attrs:{label:e.$z("审批人","b2.common.approver")}},[e._v("\n "+e._s(e.curVal.auditor_name)+"\n ")]):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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981),u=n(5176);l().use(c.Dialog),l().use(c.DatePicker),l().use(u.default);var d={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!!r().get(this.fieldConf,"detail_allow",null)&&!!r().get(this.fieldConf,"detail_deny",null)},resultColor(){let e=r().get(this.curVal,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=r().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},getViewFont(){let e=this.curVal.result,t=1==e?"通过":-1==e?"":"不通过";return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.text","通过"):-1==e?"":r().get(this.fieldConf,"detail_deny.text","不通过")),t},judgment(){let e=this.curVal.result,t=r().get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.judgment"):r().get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.judgment||"must"==this.judgment},denyColor(){let e=r().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},signature(){let e=this.curVal.result,t=r().get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.signature"):r().get(this.fieldConf,"detail_deny.signature")),t},showSignature(){return"yes"==this.signature||"must"==this.signature},photo(){let e=this.curVal.result,t=r().get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.photo"):r().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 r().get(this.fieldConf,"check.required")},getCanvasBoxStyle(){return{height:"150px",width:"100%"}}},created(){this.loadProjBaseInfo()},mounted(){if(this.value){let e=r().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=r().merge(this.curVal,e)}this.useDetail&&(this.selectOptions=[{label:r().get(this.fieldConf,"detail_allow.text","通过"),value:1},{label:r().get(this.fieldConf,"detail_deny.text","不通过"),value:2}])},methods:{onHide(){this.opened=!1,this.showForm=!1},onOpen(){if(this.value){let e=r().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=r().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&&r().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}}},f=n(1900),h=(0,f.Z)(d,o,[],!1,null,null,null);h.options.__file="components/lib/bpmAudit/src/part/editor.vue";var p=h.exports,m=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)};m._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 v=n(1319),b=n.n(v),y={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,f.Z)(y,g,[],!1,null,null,null);w.options.__file="components/lib/bpmAudit/src/part/reader-detail.vue";var S=w.exports;l().use(c.Dialog),l().use(u.default);var C={components:{AuditReaderDetail:S},props:["value","fieldConf","row","uiType"],data(){return{opened:!1}},computed:{useDetail(){return!!r().get(this.fieldConf,"detail_allow",null)&&!!r().get(this.fieldConf,"detail_deny",null)},resultColor(){let e=r().get(this.value,"result",-1),t=1==e?this.allowColor:-1==e?null:this.denyColor;return this.useDetail?t:null},allowColor(){let e=r().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},denyColor(){let e=r().get(this.fieldConf,"detail_deny.color","#fff");return"#fff"==e||"#ffffff"==e?null:e},getViewFont(){let e=r().get(this.value,"result",-1),t=1==e?"通过":-1==e?"未审批":"不通过";return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.text","通过"):-1==e?"未审批":r().get(this.fieldConf,"detail_deny.text","不通过")),t},hasAudited(){return-1!=r().get(this.value,"result",-1)},showJudgment(){let e=r().get(this.fieldConf,"judgment");return"yes"==e||"must"==e},showSignature(){let e=r().get(this.fieldConf,"signature");return"yes"==e||"must"==e},showPhoto(){let e=r().get(this.fieldConf,"photo");return"yes"==e||"must"==e},isRequired(){return r().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}}},x=(0,f.Z)(C,m,[],!1,null,null,null);x.options.__file="components/lib/bpmAudit/src/part/reader.vue";var $=x.exports,k=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"}})};k._withStripped=!0;var I=function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"audit-with-others"})};I._withStripped=!0;var E={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:i},o){let a=window.atob(e.split(",")[1]),r=new ArrayBuffer(a.length),s=new Uint8Array(r);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let l,c=window.WebKitBlobBuilder||window.MozBlobBuilder;if(c){let e=new c;e.append(r),l=e.getBlob(t)}else l=new window.Blob([r],{type:t});let u=new FormData;u.append(i,l,n),zj.net.w.noapi({method:"POST",url:"/platform/v1/papi/app_file/upload/",data:u,processData:!1,contentType:!1}).then((e=>{o&&o(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)}))}}},D=(n(7602),n(6768),n(4540),(0,f.Z)(E,I,[],!1,null,"1f4bc398",null));D.options.__file="components/lib/bpmAudit/src/part/auditor/audit-with-others.vue";var P=D.exports,T=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)};T._withStripped=!0;var F={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)}}},O=(n(2577),(0,f.Z)(F,T,[],!1,null,"2709dffc",null));O.options.__file="components/lib/bpmAudit/src/part/auditor/audit-select.vue";var A=O.exports,M=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"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确 定","c.confirm")))])],1)])],1)};M._withStripped=!0;var j=n(6324);l().use(c.Dialog),l().use(c.DatePicker),l().use(u.default),l().use(j.default);var R={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,hasDraw:!1,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!!r().get(this.fieldConf,"detail_allow",null)&&!!r().get(this.fieldConf,"detail_deny",null)},judgment(){let e=this.result,t=r().get(this.fieldConf,"judgment");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.judgment"):r().get(this.fieldConf,"detail_deny.judgment")),t},showJudgment(){return"yes"==this.judgment||"must"==this.judgment},signature(){let e=this.result,t=r().get(this.fieldConf,"signature");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.signature"):r().get(this.fieldConf,"detail_deny.signature")),t},allowColor(){let e=r().get(this.fieldConf,"detail_allow.color","#fff");return"#fff"==e||"#ffffff"==e?"primary":e},denyColor(){let e=r().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=r().get(this.fieldConf,"photo");return this.useDetail&&(t=1==e?r().get(this.fieldConf,"detail_allow.photo"):r().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?r().get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")):-1==e?"":r().get(this.fieldConf,"detail_deny.text",zj.z("不通过","b2.common.fail"))),t},userId(){return r().get(this.$bpm.userInfo,"user_id",0)},userName(){return r().get(this.$bpm.userInfo,"user_name","")},showReject(){return!!r().get(this.container,"formSchema.reject_targets")},rejectTargetMap(){let e=r().get(this.container,"formSchema.reject_targets");return r().keyBy(e,"node")},rejectTargetList(){console.log("this.container",this.container);let e=r().get(this.container,"formSchema.reject_targets"),t=r().get(this.container,"_formData.passed_nodes"),n=[];return r().each(e,(e=>{r().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}},created(){this.loadProjBaseInfo()},mounted(){if(this.value){let e=r().cloneDeep(this.value);e.audit_at=1e3*e.audit_at,this.curVal=r().merge(this.curVal,e)}this.useDetail&&(this.selectOptions=[{label:r().get(this.fieldConf,"detail_allow.text",zj.z("通过","b2.common.pass")),value:1},{label:r().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=r().cloneDeep(this.passForm),this.form.result=1;else if(this.form=r().cloneDeep(this.notPassForm),this.form.result=2,1==this.rejectTargetList.length){let e=r().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&&r().isEmpty(e.photos)?this.$message({message:"请至少上传一张图片",type:"warning"}):(this._dealSubmit(e),this.openAuditDlg=!1):this.$message({message:"请填写意见",type:"warning"}):this.$message({message:"请完成签名",type:"warning"}):this.$message({message:"请选择审批结果",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&&r().set(t,"reject_target",this.getRejectTarget(e.reject_target)),this.curVal=t,this.$emit("change",this.curVal),console.log("this.container",this.container);let n=this.container.$parent;if(n){this.submiting=!0;try{n.doOperation()}catch(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"}:r().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=r().get(e,"data.data"),this.$bpm.setUserInfo(e.user_info)},async doOperation(e){console.log("this.fieldConf",this.fieldConf),setTimeout((()=>{let t=r().get(this.fieldConf,`opt_ass.${e}`),n=r().map(t,(e=>r().get(this.container,`eleMap.${e}`)));n=r().compact(n),this.optAss=n;let i=r().concat(t,this.fieldConf.id);i=r().compact(i),this.container.verfifyData(i,(()=>{this.result=e,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((()=>{}))}}},N=(0,f.Z)(R,M,[],!1,null,null,null);N.options.__file="components/lib/bpmAudit/src/part/auditor/audit-new.vue";var V={props:["value","fieldConf","row","container"],components:{AuditWithOthers:P,AuditSelect:A,AduitNew:N.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)}}},L=(0,f.Z)(V,k,[],!1,null,null,null);L.options.__file="components/lib/bpmAudit/src/part/auditor.vue";var z=L.exports,B={name:"BpmAudit",components:{editorComponent:p,readerComponent:$,auditorComponent:z},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}}},computed:{curComponent(){return"view"==this.mode?$:z}},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)}}},U=(n(6916),(0,f.Z)(B,i,[],!1,null,null,null));U.options.__file="components/lib/bpmAudit/src/main.vue";var q=U.exports;q.install=function(e){e.component(q.name,q)};var G=q},7802:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981);l().use(c.DatePicker);var u={data(){let e=this;return{curVal:"",pickerOptions:{disabledDate(t){return e.max&&e.min?t.getTime()>e.max&&t.getTime()<e.min:e.max&&!e.min?t.getTime()>e.max:!e.max&&e.min?t.getTime()<e.min:void 0}}}},props:["value","fieldConf","row","clearable","disabled","container"],watch:{curVal(e){console.log("val",e,this.checkFormat),this.$emit("input",e)},value(){this.curVal=this.value}},computed:{type(){let e=r().toLower(r().get(this.fieldConf,"type"));return this.isMonth?"month":e},isMonth(){return"C1M"==r().get(this.fieldConf,"range_type")},placeholder(){return this.fieldConf.desc||this.fieldConf.name},format(){let e=r().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},checkFormat(){let e=r().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:{analyzeLimit(e){console.log("this.fieldConf",this.fieldConf);let t=r().get(this.fieldConf,`check.${e}`);if(!t)return;let n=null,i=(new Date).getTime();switch(t.type){case"LimitDateOffset":var o=t.offset_days;n=this.deltaToDate(i,o);break;case"LimitDateOffsetByField":console.log("container",this.container);var a=t.offset_days,s=r().get(this.container,`formData.${t.field}`);if(!s)return 0;n=this.deltaToDate(s,a);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}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmDateTime/src/part/editor.vue";var h=f.exports,p=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{attrs:{title:e.dateTimeStr}},[e._v(e._s(e.dateTimeStr))])};p._withStripped=!0;var m=n(1319),g=n.n(m),v=n(4239),b={props:["value","fieldConf","row"],data(){return{dateTimeStr:""}},computed:{format(){return r().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?(r().isInteger(t)&&13!=r().toString(t).length&&(t*=1e3),(0,v.tq)()?(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(),g().format(e,this.format)):""}}},y=(0,d.Z)(b,p,[],!1,null,null,null);y.options.__file="components/lib/bpmDateTime/src/part/reader.vue";var _=y.exports,w={name:"BpmDateTime",components:{editorComponent:h,readerComponent:_},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?_:h}},data(){return{curVal:""}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},S=(0,d.Z)(w,i,[],!1,null,null,null);S.options.__file="components/lib/bpmDateTime/src/main.vue";var C=S.exports;C.install=function(e){e.component(C.name,C)};var x=C},6769:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};i._withStripped=!0;var o={name:"BpmField",mixins:[n(1606).Z]},a=(0,n(1900).Z)(o,i,[],!1,null,null,null);a.options.__file="components/lib/bpmField/src/main.vue";var r=a.exports;r.install=function(e){e.component(r.name,r)};var s=r},7882:function(e,t,n){"use strict";n.r(t);var i=n(6455);i.Z.install=function(e){e.component(i.Z.name,i.Z)},t.default=i.Z},1469:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return c}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners)):e._e()};i._withStripped=!0;var o=n(3371),a=n.n(o),r={name:"BpmFormField",mixins:[n(1606).Z,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.$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 i=_.last(this.fieldPath);if(t.isSubForm){n||(n=[]);let o=this.rowIndex;if(n[o])return void this.$set(t.value[o],i,e);t.isXSubForm?a().set(n,o,t.getItem(o)):a().set(n,o,{}),n=n[o];try{a().set(t.value,o,n)}catch(e){console.log("error",t.value)}}else a().set(t.value,i,e),console.log("container.value",t.value,i,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,i)=>{i=_.replace(i,"&",".");let o=this.$watch(`row.f_fields.${i}`,(t=>{let n=!0;_.map(e,((e,t)=>{t=_.replace(t,"&",".");let i=_.get(this.row,`f_fields.${t}`);i=_.toString(i),n=n&&_.includes(e,i)})),this.fieldConf.perm.visible=n}),{immediate:0==n});n++,this.optAssWatchList.push(o)}))}}};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.$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:i})=>{let o=this._getFieldPath(!0),a=_.get(i,o),r=_.get(this.fieldConf,"check.required",!1);if((_.isNull(this.value)&&r||"SelectHouseOwner"==this.fieldConf.type&&(!this.value.name||!this.value.phone)&&r)&&_.unset(t,o),_.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||r||!a||_.unset(t,o)}let s=this.container,l=s.isSubForm,c=_.get(this.fieldConf,"optAssMap");if(!c||_.isEmpty(c))return;let u=!0;_.map(c,((e,t)=>{t=t.replace(/&/g,".");let n=_.split(t,".");n=_.last(n);let i=_.get(this.elementMap,`${n}.type`),o=!!i&&"Mul"==i.substr(0,3);this._getPath(n)!=n&&l&&(t=`${s.fieldConf.id}&${this.rowIndex}&${n}`),t=t.replace(/&/g,".");let a=_.get(this.form,`formData.${t}`);if(o);else{let t=_.toString(a);u=u&&_.includes(e,t)}})),u||_.unset(t,o)})),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:i})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||(this.topContainer.isCache?this.openRelyInitLoadOnCache(n,i):this.openInitRelyLoad(n,i))})),this.$bpm.$on("initRelyComplete",(async(e,t)=>{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:i})=>{e!=this.fieldConf.id||this.container.isSubForm&&(_.isNil(t)||!this.container.isSubForm||t!=this.rowIndex)||this.opeRelyById(n,i)}))},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"))},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],i=this.fieldConf,o=[],a=_.get(i,"perm.visible",!1);_.get(i,"check.required",!1)&&!this.isDetailMode&&o.push("q-field-required"),a&&!this.displayHidden||o.push("q-field-hidden"),this.readonly&&o.push("readonly");let r=_.get(this.fieldConf,"display.hide_name",!1),s=_.get(this.fieldConf,"display.is_tip",!1);r&&o.push("hide-name"),s&&o.push("tip-field"),n&&this.scrollToElement();let l=this.$bpm.isVerticalTypography,c=_.includes(["MulImage","SubForm","XSubForm","MulFile","Spliter","Signature"],i.type);return l=l&&!_.includes(["SubForm","XSubForm","Spliter"],i.type),l&&o.push("col-4"),"SelectHouseOwner"==i.type&&o.push("select-house-owner"),{filled:!0,hideHint:!0,disable:!_.get(i,"perm.editable",!0),error:!!n,errorLabel:_.get(n,"message",""),class:o,orientation:c||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 i=_.get(n,`f_fields.${e}.${t}`);this.value=i,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(this.valueUnWatch&&(this.valueUnWatch(),this.valueUnWatch=!1),e){let e=JSON.stringify(this.value);this.valueUnWatch=this.$watch("value",(async(t,n)=>{if(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),this.$emit("valueChanged"),this.setLocalCache(t),(!this.container.isSubForm||this.container.isSubForm&&(!_.isUndefined(n)||!_.isUndefined(t)))&&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}),{immediate:!1,deep:!0})}},setLocalCache(e){let t=this.fieldConf.id,n=this.container.mode,i=_.get(this.fieldConf,"value_type");this.$bpm.setLocalCache(n,`${t}.${i}`,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,console.log("this.selectList",this.selectList),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 i={fields:n,include_sup:!0},o=this.fieldConf.id,a=await this.$bpm.loadSelectRemoteForm({fieldId:o,params:i,cusFormName:this.container.cusFormId||_.get(this.container,"form.cusFormId"),container:this.container});this.remoteData=a,this.loading=!1}},_getPath(e){let t=this.elements,n=e;return _.each(t,(t=>{_.each(t.elements||[],(i=>{i.id==e&&(n=t.id)}))})),n},getDependData(e){let t=this.topContainer.formData,n={};return"link_alert"===this.fieldConf.id&&console.log("link_alert: "+e,t),_.each(e,(e=>{let i=this._getPath(e),o=_.get(t,i);if(e!=i){let t=[];_.each(o,((n,i)=>{let o={},a=_.get(n,e);(a||0===a)&&_.set(o,e,a),_.hasIn(n,"_meta")&&_.set(o,"_meta",n._meta),t.push(o)})),n[i]&&(t=_.merge(n[i],t)),o=t}_.isArray(o)&&_.each(o,(e=>{_.unset(e,"isNew")})),i&&_.set(n,i,o)})),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:i},o){let a=_.get(this.fieldConf,"range_remote.depends",[]),r=this.getDependData(a);if(_.isEmpty(r))return;this.selectFields=JSON.stringify(r);let s={fields:JSON.stringify(r)};this.container.isSubForm&&_.set(s,"idx",this.rowIndex);let l=this.fieldConf.type;"OnlineEditor"==l&&(s={spec:JSON.stringify(r)}),t&&(s=_.merge(s,t));let c=null;return c=_.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),o&&o(c),c},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,i=n.isSubForm;_.map(e,((t,o)=>{o=o.replace(/&/g,".");let a=_.split(o,".");a=_.last(a);let r=this._getPath(a),s=_.get(this.elementMap,`${a}.type`),l=!!s&&"Mul"==s.substr(0,3);if(!s)return;let c=this.$watch(i?`form.formData.${n.fieldConf.id}`:`form.formData.${o}`,(()=>{let t=!0;_.map(e,((e,o)=>{r!=a&&i&&(o=`${n.fieldConf.id}&${this.rowIndex}&${a}`),o=o.replace(/&/g,".");let s=_.get(this.form,`formData.${o}`);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)})),i?this.displayHidden=!t:this.fieldConf.perm.visible=t,this.isDelete=!t}),{immediate:!0,deep:!!i});this.optAssWatchList.push(c)})),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)||!this.value)return;let n=await this.getRemoteByFieldMap();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(1900).Z)(r,i,[],!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 c=l},8357:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return j}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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",{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"},[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)}}},[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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(6981),l=n(4239),c=n(3371),u=n.n(c),d=n(5273),f=n.n(d),h=(n(7770),n(5403),n(2918)),p=n.n(h);var m={insertEXIF:function(e,t,n){if(e instanceof Blob){var i=this,o=new FileReader;o.onload=function(){i.insertEXIF(o.result,t,n)},o.readAsArrayBuffer(e)}else{var a=[].slice.call(new Uint8Array(e),0);if(255!==a[2]||224!==a[3])return e;var r=256*a[4]+a[5],s=[255,216].concat(t,a.slice(4+r));n(new Uint8Array(s))}},getEXIF:function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++){var i=e[n];255===i[0]&&225===i[1]&&(t=t.concat(i))}return t},getSegments:function(e,t){if(e instanceof Blob){var n=this,i=new FileReader;i.onload=function(){n.getSegments(i.result,t)},i.readAsArrayBuffer(e)}else{if(!e.length&&!e.byteLength)return[];var o,a,r=0,s=[],l=[].slice.call(new Uint8Array(e),0);let n=1;for(;n&&(255!==l[r]||218!==l[r+1])&&(255===l[r]&&216===l[r+1]?r+=2:(o=r+(256*l[r+2]+l[r+3])+2,a=l.slice(r,o),r=o,s.push(a)),!(r>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,"")),i=new Uint8Array(n.length),o=0,a=n.length;o<a;o++)i[o]=n.charCodeAt(o);return i},encode64:function(e){for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);return"data:image/jpeg;base64,"+window.btoa(t)}},g=n(5475),v=n.n(g);function b(e){let t="";v()(".viewer-in .address").length?(e&&(t='<i class="fa fa-map-marker"></i>'+e),v()(".viewer-in .address").html(t)):(e&&(t='<div class="address"><i class="fa fa-map-marker"></i>'+e+"</div>"),v()(".viewer-in .viewer-footer").append(t))}async function y(e){if(b(""),!function(e){return r().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=r().get(t,"url_list.0.path.0");b("定位信息加载中...");let i=document.createElement("img");i.src=n;let o=this;setTimeout((()=>{try{v().ajax({url:`${n}?exif`,success:e=>{e&&e.GPSLatitude?o.setPs(e):p().getData(i,(function(){var e=p().getAllTags(this);console.log("info",e),o.setPs(e)}))},error:()=>{p().getData(i,(function(){var e=p().getAllTags(this);console.log("info",e),o.setPs(e)}))}})}catch(e){p().getData(i,(function(){var e=p().getAllTags(this);o.setPs(e)}))}}),600)}function _(e){console.log("filePath",e);var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""}function w(){let e=(new Date).valueOf();return function(e){let t=0,n=e.length;for(let i=0;i<n;i++)t=31*t+e.charCodeAt(i),t>2147483647&&(t%=2147483648);return t}(function(e,t,n){let i="",o=6,a=["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 e=0;e<o;e++)i+=a[Math.round(Math.random()*(a.length-1))];return i}()+e.toString())}u().use(s.Upload),u().use(s.Button),u().use(s.Dialog);const S=n(8);u().use(f()),f().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 C=null,x={props:{value:{},fieldConf:{},row:{},extensions:{type:String,default(){return".gif,jpg,.jpeg,.png,.doc,.xlsx,.pdf,.docx,.xls,.dwg"}}},data(){return{curVal:[],fileList:[],opened:!1,officeUrl:"",windowH:0}},watch:{curVal(e){this.$emit("input",e)},value(){this.curVal=r().isArray(this.value)?this.value:[]}},computed:{url(){return r().get(this.fieldConf,"upload_url","/platform/v1/papi/app_file/upload/")},photo(){let e=[];return r().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),e},photoMd5s(){let e=[];return r().each(this.curVal,(t=>{this.isImageFile(t)&&e.push(t.md5)})),e},maxCountConf(){return r().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 C.Map("container",{resizeEnable:!0});e.plugin("AMap.Geolocation",(()=>{let t=new C.Geolocation({enableHighAccuracy:!0,timeout:1e4,maximumAge:0,convert:!0,showButton:!0,buttonPosition:"LB",buttonOffset:new C.Pixel(10,20),showMarker:!0,showCircle:!0,panToLocation:!0,zoomToAccuracy:!0});e.addControl(t),t.getCurrentPosition(),C.event.addListener(t,"complete",(e=>{this.position=e.position})),C.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 i in n)t[i]=n[i];document.head.appendChild(t)},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=r().filter(this.curVal,(e=>this.isImageFile(e)));y(r().get(n,t))},previewImg(e){let t=r().indexOf(this.photoMd5s,e.md5);this.$viewer.view(t)},isDwg(e){return r().endsWith(e.name,".dwg")},getFileTypeClass(e){let t=_(e.type);return t=t||_(e.name),r().endsWith(e.name,".dwg")&&(t="dwg"),r().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(){let e=this.fileList;r().each(e,((e,t)=>{!function(e,t){if(-1==e.type.indexOf("image"))t(null);else{let n=new FileReader,i=new Image;n.readAsDataURL(e),n.onload=function(){e.src=this.result,i.onload=function(){let t=i.width,n=i.height;e.width=t,e.height=n},i.src=e.src,function(e,t,n,i){var o=new Image;o.src=e.src,o.onload=function(){var e=this,o=e.width,a=e.height,r=o/a;o=t.width||o,a=t.height||o/r;var s=.7,l=document.createElement("canvas"),c=l.getContext("2d"),u=document.createAttribute("width");u.nodeValue=o;var d=document.createAttribute("height");d.nodeValue=a,l.setAttributeNode(u),l.setAttributeNode(d);try{p().getData(n,(function(){let n=p().getTag(this,"GPSLatitude");c.drawImage(e,0,0,o,a),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var r=l.toDataURL("image/jpeg",s);i(r,n)}))}catch(n){c.drawImage(e,0,0,o,a),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var f=l.toDataURL("image/jpeg",s);i(f,null)}}}(e,{quality:.4},e,t)}}}(e,((n,i)=>{n&&m.getSegments(new Blob([e]),(o=>{let a=this.dataURLtoFile(n,e.name),s=m.getEXIF(o);if(!r().isEmpty(s)&&i)m.insertEXIF(a,s,(n=>{let i=new Blob([n],{type:e.type});i.name=e.name,i.lastModifiedDate=new Date,this.fileList[t]=i}));else{let i={},o={},a={};i[S.ImageIFD.Make]="lse";let r=this.position.lat,s=this.position.lng;a[S.GPSIFD.GPSLatitudeRef]=r<0?"S":"N",a[S.GPSIFD.GPSLatitude]=S.GPSHelper.degToDmsRational(r),a[S.GPSIFD.GPSLongitudeRef]=s<0?"W":"E",a[S.GPSIFD.GPSLongitude]=S.GPSHelper.degToDmsRational(s),a[S.GPSIFD.GPSImgDirection]=[123456,100];let l={"0th":i,Exif:o,GPS:a},c=S.dump(l),u=S.insert(c,n),d=this.dataURLtoFile(u,e.name);this.fileList[t]=d}}))}))}))},dataURLtoFile(e,t){let n=e.split(","),i=n[0].match(/:(.*?);/)[1],o=atob(n[1]),a=o.length,r=new Uint8Array(a);for(;a--;)r[a]=o.charCodeAt(a);return new File([r],t,{type:i})},isImageFile(e){return r().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.QE)("/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=r().get(t,"url_list.0.path.0"),i=_(n);"application/pdf"==e.type&&(i="pdf"),"application/vnd.ms-excel"==e.type&&(i="ms-excel");let o=w(),a=`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"}[i]}&sign=${o}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(a="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),"pdf"==i){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),a=(0,l.tq)()?`/public/app3/bpm/view_pdf.html?url=${n}`:`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=a,this.opened=!0},onFail(e,t){let n=`${t.name}上传失败`;console.log("err:",n)},onUploaded(e,t){console.log("file",t);let n=r().isArray(this.curVal)?this.curVal:[];n.push({name:t.name,type:r().get(t,"raw.type"),md5:r().get(e,"data.file_md5")}),this.curVal=r().cloneDeep(n),console.log("this.curVal",this.curVal)},remove(e){this.curVal=r().filter(this.curVal,(t=>t.md5!=e)),this.$refs.uploader.queue=[]},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},$=x,k=n(1900),I=(0,k.Z)($,o,[],!1,null,null,null);I.options.__file="components/lib/bpmMulFile/src/part/editor.vue";var E=I.exports,D=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.value||0==e.value.length,expression:"!value || value.length == 0"}]},[e._v("\n "+e._s(e.$z("暂无文件或图片","c.no_files"))+"\n ")]),e._v(" "),n("viewer",{ref:"viewer",attrs:{images:e.photo,rebuild:""},on:{inited:e.inited}},e._l(e.value,(function(t){return n("span",{key:t.md5},[e.isImageFile(t)?n("div",{staticClass:"file-box"},[n("div",{staticClass:"file-icon",staticStyle:{height:"20px",border:"1px dashed #ececec"}},[n("img",{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 ")])]):n("span",{staticClass:"file-box",attrs:{target:"_blank"},on:{click:function(n){return e.reviewOnMobile(t)}}},[n("div",{staticClass:"text-center text-faded file-icon",on:{click:function(n){return e.preview(t)}}},[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 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")))])])])])})),0),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:""}})],1)};D._withStripped=!0,u().use(s.Dialog),u().use(f()),f().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}}),u().use(s.Dialog);var P={props:["value","fieldConf","row"],data(){return{vueLightId1:null,photo:[],officeUrl:"",opened:!1,windowH:0,type:"small"}},computed:{},watch:{value(){this.setPhoto()}},created(){},mounted(){let e=(new Date).getTime();this.vueLightId1=e+1,this.setPhoto(),this.windowH=document.body.clientHeight/100*99-50},methods:{isDwg(e){return r().endsWith(e.name,".dwg")},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=r().filter(this.value,(e=>this.isImageFile(e)));y(r().get(n,t))},setPhoto(){let e=[];r().each(this.value,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),this.photo=e},getFileTypeClass(e){let t=_(e.type);return"application/pdf"==e.type&&(t="fa-file-pdf-o"),r().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 r().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.QE)("/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=r().get(t,"url_list.0.path.0"),i=_(n);"application/pdf"==e.type&&(i="pdf"),"application/vnd.ms-excel"==e.type&&(i="ms-excel");let o=w(),a=`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"}[i]}&sign=${o}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(a="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),console.log("url",a),"pdf"==i){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),a=`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=a,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}`)},getFileType(e){var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},T=(0,k.Z)(P,D,[],!1,null,null,null);T.options.__file="components/lib/bpmMulFile/src/part/reader.vue";var F=T.exports,O={name:"BpmMulFile",components:{editorComponent:E,readerComponent:F},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?F:E}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},A=(0,k.Z)(O,i,[],!1,null,null,null);A.options.__file="components/lib/bpmMulFile/src/main.vue";var M=A.exports;M.install=function(e){e.component(M.name,M)};var j=M},5176:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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("点击上传")])],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("删除")])])})),0)]:[n("div",{staticClass:"col-auto",staticStyle:{"padding-top":"0px","font-size":"12px"}},[e._v("\n 未发现上传文件\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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(6981),l=n(4239),c=n(3371),u=n.n(c),d=n(5273),f=n.n(d),h=(n(7770),n(5403),n(2918)),p=n.n(h);var m={insertEXIF:function(e,t,n){if(e instanceof Blob){var i=this,o=new FileReader;o.onload=function(){i.insertEXIF(o.result,t,n)},o.readAsArrayBuffer(e)}else{var a=[].slice.call(new Uint8Array(e),0);if(255!==a[2]||224!==a[3])return e;var r=256*a[4]+a[5],s=[255,216].concat(t,a.slice(4+r));n(new Uint8Array(s))}},getEXIF:function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++){var i=e[n];255===i[0]&&225===i[1]&&(t=t.concat(i))}return t},getSegments:function(e,t){if(e instanceof Blob){var n=this,i=new FileReader;i.onload=function(){n.getSegments(i.result,t)},i.readAsArrayBuffer(e)}else{if(!e.length&&!e.byteLength)return[];var o,a,r=0,s=[],l=[].slice.call(new Uint8Array(e),0);let n=1;for(;n&&(255!==l[r]||218!==l[r+1])&&(255===l[r]&&216===l[r+1]?r+=2:(o=r+(256*l[r+2]+l[r+3])+2,a=l.slice(r,o),r=o,s.push(a)),!(r>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,"")),i=new Uint8Array(n.length),o=0,a=n.length;o<a;o++)i[o]=n.charCodeAt(o);return i},encode64:function(e){for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);return"data:image/jpeg;base64,"+window.btoa(t)}},g=n(5475),v=n.n(g);function b(e){let t="";v()(".viewer-in .address").length?(e&&(t='<i class="fa fa-map-marker"></i>'+e),v()(".viewer-in .address").html(t)):(e&&(t='<div class="address"><i class="fa fa-map-marker"></i>'+e+"</div>"),v()(".viewer-in .viewer-footer").append(t))}async function y(e){if(b(""),!function(e){return r().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=r().get(t,"url_list.0.path.0");b("定位信息加载中...");let i=document.createElement("img");i.src=n;let o=this;setTimeout((()=>{try{v().ajax({url:`${n}?exif`,success:e=>{e&&e.GPSLatitude?o.setPs(e):p().getData(i,(function(){var e=p().getAllTags(this);console.log("info",e),o.setPs(e)}))},error:()=>{p().getData(i,(function(){var e=p().getAllTags(this);console.log("info",e),o.setPs(e)}))}})}catch(e){p().getData(i,(function(){var e=p().getAllTags(this);o.setPs(e)}))}}),600)}function _(e){console.log("filePath",e);var t=e.lastIndexOf(".");return-1!=t?e.substring(t+1,e.length).toLowerCase():""}u().use(s.Upload),u().use(s.Button),u().use(s.Dialog);const w=n(8);u().use(f()),f().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,C={props:{type:{type:String,default:"MulImage"},value:{},fieldConf:{},row:{},extensions:{type:String,default(){return"jpg,.jpeg,.png,.dwg"}}},data(){return{curVal:[],fileList:[],opened:!1,officeUrl:"",windowH:0}},watch:{value(){this.curVal=this.isSign&&r().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 r().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),e},photoMd5s(){let e=[];return r().each(this.curVal,(t=>{this.isImageFile(t)&&e.push(t.md5)})),e},maxCountConf(){return r().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&&r().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 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 i in n)t[i]=n[i];document.head.appendChild(t)},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=r().filter(this.curVal,(e=>this.isImageFile(e)));y(r().get(n,t))},previewImg(e){let t=r().indexOf(this.photoMd5s,e.md5);this.$viewer.view(t)},isDwg(e){return r().endsWith(e.name,".dwg")},getFileTypeClass(e){let t=_(e.type);return t=t||_(e.name),r().endsWith(e.name,".dwg")&&(t="dwg"),r().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(){let e=this.fileList;r().each(e,((e,t)=>{!function(e,t){if(-1==e.type.indexOf("image"))t(null);else{let n=new FileReader,i=new Image;n.readAsDataURL(e),n.onload=function(){e.src=this.result,i.onload=function(){let t=i.width,n=i.height;e.width=t,e.height=n},i.src=e.src,function(e,t,n,i){var o=new Image;o.src=e.src,o.onload=function(){var e=this,o=e.width,a=e.height,r=o/a;o=t.width||o,a=t.height||o/r;var s=.7,l=document.createElement("canvas"),c=l.getContext("2d"),u=document.createAttribute("width");u.nodeValue=o;var d=document.createAttribute("height");d.nodeValue=a,l.setAttributeNode(u),l.setAttributeNode(d);try{p().getData(n,(function(){let n=p().getTag(this,"GPSLatitude");c.drawImage(e,0,0,o,a),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var r=l.toDataURL("image/jpeg",s);i(r,n)}))}catch(n){c.drawImage(e,0,0,o,a),t.quality&&t.quality<=1&&t.quality>0&&(s=t.quality);var f=l.toDataURL("image/jpeg",s);i(f,null)}}}(e,{quality:.4},e,t)}}}(e,((n,i)=>{n&&m.getSegments(new Blob([e]),(o=>{let a=this.dataURLtoFile(n,e.name),s=m.getEXIF(o);if(!r().isEmpty(s)&&i)m.insertEXIF(a,s,(n=>{let i=new Blob([n],{type:e.type});i.name=e.name,i.lastModifiedDate=new Date,this.fileList[t]=i}));else{let i={},o={},a={};i[w.ImageIFD.Make]="lse";let r=this.position.lat,s=this.position.lng;a[w.GPSIFD.GPSLatitudeRef]=r<0?"S":"N",a[w.GPSIFD.GPSLatitude]=w.GPSHelper.degToDmsRational(r),a[w.GPSIFD.GPSLongitudeRef]=s<0?"W":"E",a[w.GPSIFD.GPSLongitude]=w.GPSHelper.degToDmsRational(s),a[w.GPSIFD.GPSImgDirection]=[123456,100];let l={"0th":i,Exif:o,GPS:a},c=w.dump(l),u=w.insert(c,n),d=this.dataURLtoFile(u,e.name);this.fileList[t]=d}}))}))}))},dataURLtoFile(e,t){let n=e.split(","),i=n[0].match(/:(.*?);/)[1],o=atob(n[1]),a=o.length,r=new Uint8Array(a);for(;a--;)r[a]=o.charCodeAt(a);return new File([r],t,{type:i})},isImageFile(e){return r().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.QE)("/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=r().get(t,"url_list.0.path.0"),i=_(n);"application/pdf"==e.type&&(i="pdf"),"application/vnd.ms-excel"==e.type&&(i="ms-excel");let o=function(){let e=(new Date).valueOf();return function(e){let t=0,n=e.length;for(let i=0;i<n;i++)t=31*t+e.charCodeAt(i),t>2147483647&&(t%=2147483648);return t}(function(e,t,n){let i="",o=6,a=["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 e=0;e<o;e++)i+=a[Math.round(Math.random()*(a.length-1))];return i}()+e.toString())}(),a=`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"}[i]}&sign=${o}`;if("wps"!=(await zj.net.w.noapi({url:"/zj_of/v1/papi/file/using_engine/"})).engine&&(a="https://view.officeapps.live.com/op/embed.aspx?src="+encodeURIComponent(n)),"pdf"==i){let e=n.lastIndexOf(".com");n=n.substring(e+4,n.length),n=encodeURIComponent(n),a=(0,l.tq)()?`/public/app3/bpm/view_pdf.html?url=${n}`:`/public/bpm/app/view_pdf.html?url=${n}`}this.officeUrl=a,this.opened=!0},onFail(e,t){let n=`${t.name}上传失败`;console.log("err:",n)},onUploaded(e,t){console.log("file",t);let n=r().isArray(this.curVal)?this.curVal:[];n.push({name:t.name,type:r().get(t,"raw.type"),md5:r().get(e,"data.file_md5")}),this.curVal=r().cloneDeep(n);let i=this.isSign?r().get(this.curVal,"0.md5",""):this.curVal;this.$emit("input",i)},remove(e){this.curVal=r().filter(this.curVal,(t=>t.md5!=e)),this.$refs.uploader.queue=[];let t=this.isSign?r().get(this.curVal,"0.md5",""):this.curVal;this.$emit("input",t)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},x=C,$=n(1900),k=(0,$.Z)(x,o,[],!1,null,null,null);k.options.__file="components/lib/bpmMulImage/src/part/editor.vue";var I=k.exports,E=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._v(" "),e.isSignature&&e.curVal&&e.curVal[0]?[n("img",{attrs:{src:e.fileLink(e.curVal[0]),alt:"电子签名",width:"100%",height:"100%"}})]: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:{height:"60px",border:"1px dashed #ececec",cursor:"pointer"}},[n("img",{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)};E._withStripped=!0,u().use(f()),f().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 D={props:["type","value","fieldConf","row"],data(){return{vueLightId1:null,photo:[],curVal:[],officeUrl:"",opened:!1,windowH:0}},computed:{is_mobile(){return(0,l.tq)()},isSignature(){return"Signature"===this.type}},watch:{value(){this.curVal=r().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,this.curVal=r().isString(this.value)?[{md5:this.value,name:"",type:"image/png"}]:this.value,this.setPhoto(),this.windowH=document.body.clientHeight/100*99-50},methods:{isDwg(e){return r().endsWith(e.name,".dwg")},inited(e){e.options.view=this.view,this.$viewer=e},view(e){let t=e.detail.index,n=r().filter(this.curVal,(e=>this.isImageFile(e)));y(r().get(n,t))},setPhoto(){let e=[];r().each(this.curVal,(t=>{if(this.isImageFile(t)){let n=this.fileLink(t,600);e.push(n)}})),this.photo=e},getFileTypeClass(e){let t=_(e.type);return"application/pdf"==e.type&&(t="fa-file-pdf-o"),r().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 r().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.QE)("/platform/v1/papi/web_file/image_view/",n)},onHide(){this.opened=!1},onOpen(){this.opened=!0}}},P=(0,$.Z)(D,E,[],!1,null,null,null);P.options.__file="components/lib/bpmMulImage/src/part/reader.vue";var T=P.exports,F={name:"BpmMulImage",components:{editorComponent:I,readerComponent:T},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?T:I}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},O=(0,$.Z)(F,i,[],!1,null,null,null);O.options.__file="components/lib/bpmMulImage/src/main.vue";var A=O.exports;A.install=function(e){e.component(A.name,A)};var M=A},631:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return _}});var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-number",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,uiType:e.uiType},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981);l().use(c.InputNumber);var u={data(){return{curVal:null}},props:["value","fieldConf","row"],watch:{value(){this.curVal=this.value}},computed:{precision(){return r().get(this.fieldConf,"view.precision",0)}},methods:{handleChange(){this.$emit("input",this.curVal)}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmNumber/src/part/editor.vue";var h=f.exports,p={mixins:[n(1527).Z]},m=(0,d.Z)(p,void 0,void 0,!1,null,null,null);m.options.__file="components/lib/bpmNumber/src/part/reader.vue";var g=m.exports,v={name:"BpmNumber",components:{editorComponent:h,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:h}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},b=(0,d.Z)(v,i,[],!1,null,null,null);b.options.__file="components/lib/bpmNumber/src/main.vue";var y=b.exports;y.install=function(e){e.component(y.name,y)};var _=y},5596:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981);l().use(c.Select),l().use(c.Option);var u={components:{},props:["value","fieldConf","row","isMultiple"],data(){return{curVal:""}},watch:{value(){this.curVal=this.value?this.value:this.isMultiple?[]:""}},computed:{options(){let e=r().get(this.fieldConf,"range_enum");return r().map(e,(e=>({value:r().get(e,"0"),label:r().get(e,"1"),color:r().get(e,"2")})))},placeholder(){return this.fieldConf.desc||this.fieldConf.name},isRadiosStyle(){return"default"==r().get(this.fieldConf,"style")},isButtonStyle(){return"button"==r().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)}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmSelect/src/part/editor.vue";var h=f.exports,p=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._v(e._s(e.label))])};p._withStripped=!0;var m={props:["type","value","fieldConf","row"],data(){return{colorMap:{}}},computed:{_value(){return r().isArray(this.value)?this.value:[this.value]},rangeEnumMap(){let e=r().get(this.fieldConf,"range_enum"),t={};return r().each(e,(e=>{r().set(t,r().get(e,"0"),r().get(e,"1"))})),this.setColorMap(),t},label(){return r().get(this.rangeEnumMap,this.value,zj.z("未指定","b2.common. not_specified"))},isButton(){return"button"==r().get(this.fieldConf,"style")},isStatus(){return"Status"===this.type||"Status"===this.fieldConf.type}},methods:{setColorMap(){let e=r().get(this.fieldConf,"range_enum");this.colorMap={},r().each(e,(e=>{r().set(this.colorMap,r().get(e,"0"),r().get(e,"2"))}))}}},g=(0,d.Z)(m,p,[],!1,null,null,null);g.options.__file="components/lib/bpmSelect/src/part/reader.vue";var v=g.exports,b={name:"BpmSelect",components:{editorComponent:h,readerComponent:v},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?v:h}},watch:{curVal(e){this.$emit("input",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},y=(0,d.Z)(b,i,[],!1,null,null,null);y.options.__file="components/lib/bpmSelect/src/main.vue";var _=y.exports;_.install=function(e){e.component(_.name,_)};var w=_},8356:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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 i=t.node;return i.data.disabled?n("span",{},[e._v("\n "+e._s(i.label)+"\n ")]):n("el-option",{staticClass:"tree-options",attrs:{value:i.data.value,label:i.data.label}},[n("span",{staticStyle:{"padding-right":"30px","max-width":"500px",overflow:"hidden"}},[e._v("\n "+e._s(i.label)+"\n ")])])}}],null,!0)})],2)],1)};o._withStripped=!0;var a=n(3532),r=n(3371),s=n.n(r),l=n(467),c=n.n(l),u=n(6981);s().use(u.Tree),s().use(u.Select),s().use(u.Option);var d={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 c().get(this.fieldConf,"check.max_count")},tickStrategy(){return"leaf_only"==c().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=c().get(this.fieldConf,"id"),i={father:0===e.level?"":e.data.value||""},o=await a.Z.assistTreeField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:n,orgInfo:this.orgInfo,isDm:this.dm},i),r=c().get(o.data,"data.data",[]);t(this.transformResultToTree(r,e))},transformResultToTree(e,t){let n=c().get(this.fieldConf,"type");return"SelectCheckItem"==n||"MulSelectCheckItem"==n?c().map(e,(e=>{this.isMultiple||e[0]!==this.curVal||(this.defaultOptions=[]),this.isMultiple&&this.curVal.includes(e[0])&&(this.defaultOptions=c().filter(this.defaultOptions,(t=>t.value!==e[0])));let n=0===t.level?e[1]:t.data.label+" - "+e[1],i=!e[2];return{value:e[0],lazy:e[2],label:n,treeLabel:e[1],isLeaf:i,disabled:this.leafOnly&&!i}})):"SelectSort"==n||"MulSelectSort"==n?c().map(e,(e=>{this.isMultiple||e.value!==this.curVal||(this.defaultOptions=[]),this.isMultiple&&this.curVal.includes(e.value)&&(this.defaultOptions=c().filter(this.defaultOptions,(t=>t.value!==e.value)));let n=0===t.level?e.label:t.data.label+" - "+e.label,i=!e.lazy;return{value:e.value,lazy:e.lazy,label:n,treeLabel:e.label,isLeaf:i,disabled:this.leafOnly&&!i}})):void 0},async getDefaultOptions(){let e=c().isArray(this.curVal)?this.curVal:this.curVal?[this.curVal]:[];if(!e.length)return;const t=await a.Z.assistField.getTitle(this.$bpm,{formDefId:this.formDefId,fieldDefId:this.fieldConf.id,orgInfo:this.orgInfo,isDm:this.dm},e);console.log(t);const n=c().get(t.data,"data.data",{});let i=c().map(n,((e,t)=>({value:t,label:e})));console.log("default options: ",i),this.defaultOptions=i},onChange(e){this.$emit("input",e),this.$emit("change",e)}}},f=n(1900),h=(0,f.Z)(d,o,[],!1,null,null,null);h.options.__file="components/lib/bpmSelectCheckItem/src/part/editor.vue";var p=h.exports,m={mixins:[n(5460).Z]},g=(0,f.Z)(m,void 0,void 0,!1,null,null,null);g.options.__file="components/lib/bpmSelectCheckItem/src/part/reader.vue";var v=g.exports,b={name:"BpmSelectCheckItem",components:{editorComponent:p,readerComponent:v},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?v:p},multiple(){return this.isMultiple||0===this.type.indexOf("Mul")}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},y=n(3379),_=n.n(y),w=n(7795),S=n.n(w),C=n(569),x=n.n(C),$=n(3565),k=n.n($),I=n(9216),E=n.n(I),D=n(4589),P=n.n(D),T=n(1912),F={};F.styleTagTransform=P(),F.setAttributes=k(),F.insert=x().bind(null,"head"),F.domAPI=S(),F.insertStyleElement=E(),_()(T.Z,F),T.Z&&T.Z.locals&&T.Z.locals;var O=(0,f.Z)(b,i,[],!1,null,null,null);O.options.__file="components/lib/bpmSelectCheckItem/src/main.vue";var A=O.exports;A.install=function(e){e.component(A.name,A)};var M=A},2662:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var i=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.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(i){return n("div",{key:i.id},[n("label",{staticClass:"label"},[e._v(e._s(i.name))]),e._v(" "),n("span",[e._v(e._s(t.f_fields[i.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(i){return n("div",{key:i.id},[n("label",{staticClass:"label"},[e._v(e._s(i.name))]),e._v(" "),n("span",[e._v(e._s(t.f_fields[i.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:"数据筛选",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)};i._withStripped=!0;var o=n(3532),a=n(4239),r=n(6455);const s=["Area","MulArea"];var l={name:"BpmSelectEntranceForm",components:{BpmFieldsFilter:r.Z},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,a.tq)()},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 i=this.filterParams;this.keyword&&(i.q__contains=this.keyword),this.optionsLoading=!0;const a=(await o.Z.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(i)})).data.data;console.log("assist_select_entrance_form data: ",a);const r=_.map(a.data,(e=>(_.each(e.f_fields,(async(t,n)=>{if(this.shouldTransLabelKeys.includes(n))if(_.isArray(t)){const i=o.Z.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let a=await i.loads(...t);e.f_fields[n]=a.join(zj.z(",","c.comma"))}else{const i=o.Z.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let a=await i.load(t);e.f_fields[n]=a}})),{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=r;if(this.selectedItems.length){let e=_.map(this.selectedItems,(e=>e.id));s=_.filter(r,(t=>!e.includes(t.id)))}this.items="next"===e?_.concat(this.items,s):_.concat(this.selectedItems,s),this.pagination.action=e,this.pagination.lastAt=a.last_at,this.pagination.total=a.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 i=(await o.Z.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: ",i);const a=_.map(i.data,(e=>(_.each(e.f_fields,(async(t,n)=>{if(this.shouldTransLabelKeys.includes(n))if(_.isArray(t)){const i=o.Z.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let a=await i.loads(...t);e.f_fields[n]=a.join(zj.z(",","c.comma"))}else{const i=o.Z.assistField.getBatchLoader(this.$bpm,{formDefId:this.formSchema.id,fieldDefId:n,orgInfo:this.orgInfo});let a=await i.load(t);e.f_fields[n]=a}})),{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=a,"view"===this.mode&&(this.items=a)}finally{this.optionsLoading=!1}},async loadSchema(){let e=this.formDefId;const t=this.fieldConf.id,n=(await o.Z.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 i={},a=[],r=[];_.each(n.definition.form.elements,(e=>{if("Status"!==e.type)a.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]}})),i={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)&&r.push(e.id)})),this.descFields=a,this.statusField=i,this.shouldTransLabelKeys=r,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}}},c=(0,n(1900).Z)(l,i,[],!1,null,null,null);c.options.__file="components/lib/bpmSelectEntranceForm/src/main.vue";var u=c.exports;u.install=function(e){e.component(u.name,u)};var d=u},4092:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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:"","remote-method":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)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(6981),l=n(3532),c=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)};c._withStripped=!0;var u={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()}}},d=n(1900),f=(0,d.Z)(u,c,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectFromField/src/part/select-unit.vue";var h=f.exports;r().use(s.Select),r().use(s.Option);var p={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:h},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)}},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"),i=_.get(t,"1");this.unit={search_type:n,org_id:i},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)},async loadSelectOpts(e="",t=""){let n,i=this.fieldConf.id,o={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){console.log("UserTaskCC is getting options");const e=this.fieldConf.node;n=await l.Z.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},o)}else n=await l.Z.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:i,orgInfo:this.orgInfo,isDm:this.dm},o);const a=_.get(n.data,"data.data",[]);return this.transformOptions(a)},transformOptions(e){console.log("transformOptions origin: ",e);let t=_.map(e,(e=>({value:e[0],label:e[1]})));return this.options=t,console.log("options: ",t),t},onChange(e){this.$emit("input",e),this.$emit("change",e)}}},m=(0,d.Z)(p,o,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectFromField/src/part/editor.vue";var g=m.exports,v={mixins:[n(5460).Z]},b=(0,d.Z)(v,void 0,void 0,!1,null,null,null);b.options.__file="components/lib/bpmSelectFromField/src/part/reader.vue";var y=b.exports,w={name:"BpmSelectFromField",components:{editorComponent:g,readerComponent:y},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?y: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:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},S=(0,d.Z)(w,i,[],!1,null,null,null);S.options.__file="components/lib/bpmSelectFromField/src/main.vue";var C=S.exports;C.install=function(e){e.component(C.name,C)};var x=C},4512:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-select-from-form",attrs:{fieldConf:e.fieldConf,row:e.row,mode:e.mode,formName:e.formName,orgInfo:e.orgInfo,uiType:e.uiType,isMultiple:e.isMultiple},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"select-from-form-editor"},[n("div",{on:{click:e.toOpen}},[n("div",{staticClass:"fake-trigger"},[e._v(e._s(e.label))])]),e._v(" "),n("el-dialog",{attrs:{"append-to-body":!0,visible:e.opened,"before-close":e.onHide,title:e.fieldConf.name,width:"40%"},on:{"update:visible":function(t){e.opened=t},open:e.onOpen}},[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"只展示前100条数据,通过搜索获取更多"},on:{change:e.debounceSearch},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),e._v(" "),n("div",{staticClass:"bpm-select-from-form-box"},[e.isMultiple?n("el-checkbox-group",{attrs:{max:e.maxCount},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},e._l(e.formList,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.titleStyle},[n("el-checkbox",{key:t.id,attrs:{label:t.id}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.id,staticClass:"subitem",style:e.geFieldStyle(t.key)},[e._v("\n "+e._s(t.value)+"\n ")])}))],2)})),0):n("el-radio-group",{model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},e._l(e.formList,(function(t){return n("div",{key:t.id,staticClass:"form-item"},[n("div",{style:e.titleStyle},[n("el-radio",{key:t.id,attrs:{label:t.id,value:t.id}},[e._v(e._s(t.title))])],1),e._v(" "),e._l(t.fields,(function(t){return n("div",{key:t.id,staticClass:"subitem",style:e.geFieldStyle(t.key)},[e._v("\n "+e._s(t.key+": "+t.value)+"\n ")])}))],2)})),0)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("确 定")])],1)],1)],1)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(467),l=n.n(s),c=n(6981);r().use(c.Dialog);var u={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],inject:["getSelectFields","selectOptions"],data(){return{curVal:"",label:"未选择",keyword:"",opened:!1,debounceSearch:l().debounce(l().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[]}},watch:{value(e){(l().isString(e)||l().isArray(e))&&(this.curVal=e),this.loadRemoteLabel()},selectOptionsList(e){this.fieldConf.default&&"Default"==this.fieldConf.default.type&&"EVCFirstElem"==this.fieldConf.default.value.type&&(this.formList=this.transformOptions(e),console.log("this.formList",this.formList),this.isMultiple?this.curVal=[this.formList[0].id]:this.curVal=this.formList[0].id,console.log("this.curVal",this.curVal),this.onSubmit()),console.log("fieldConf",this.fieldConf),console.log("selectOptionsList",e)}},computed:{selectOptionsList(){return this.selectOptions()},placeholder(){return this.fieldConf.desc||this.fieldConf.name},maxCount(){return l().get(this.fieldConf,"check.max_count")},titleStyle(){let e=this.fieldConf,t=l().get(e,"range_remote.range_display.title");return{fontSize:l().get(t,"size",16)+"px",color:l().get(t,"color","#333")}},fieldStyleMap(){let e=this.fieldConf,t=l().get(e,"range_remote.range_display.fields");return l().keyBy(t,"field")}},created(){},mounted(){this.getCurVal(),this.loadRemoteLabel()},methods:{getCurVal(){this.value&&(l().isString(this.value)||l().isArray(this.value))?this.curVal=this.value:this.curVal=this.isMultiple?[]:""},geFieldStyle(e){let t=l().get(this.fieldStyleMap,e);return{fontSize:l().get(t,"size",12)+"px",color:l().get(t,"color","#949494")}},async search(){let e=this.keyword,t=this.formName,n=l().get(this.fieldConf,"id");const i=this.orgInfo;let o=this.getSelectFields();o&&"{}"!==JSON.stringify(o)&&(i.fields=o);let a=await this.$bpm.searchSelectOpts(n,e,t,this,!1,i),r=this.transformOptions(a);this.formList=r},transformOptions(e){return l().map(e,(e=>({title:e.title,id:e.form_id,form_id:e.form_id,f_fields:e.f_fields,fields:l().map(e.f_fields,((e,t)=>({key:t,value:e})))})))},onHide(){this.opened=!1},onOpen(){this.getCurVal();let e=this.selectOptions();e&&e.length?this.formList=this.transformOptions(e):this.search()},toOpen(){this.opened=!0},isChecked(e){return l().includes(this.curVal,e)},onSubmit(){console.log("this.curVal",this.curVal),this.$emit("input",this.curVal),this.$emit("change",this.curVal),this.opened=!1},async loadRemoteLabel(){let e=this.value,t=l().get(this.fieldConf,"id");l().isEmpty(e)?this.label="未选择":(e=l().isArray(e)?e:[e],this.label=await this.$bpm.fetchLabelByValues(e,t,this.formName,this.row))}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectFromForm/src/part/editor.vue";var h=f.exports,p={mixins:[n(5460).Z]},m=(0,d.Z)(p,void 0,void 0,!1,null,null,null);m.options.__file="components/lib/bpmSelectFromForm/src/part/reader.vue";var g=m.exports,v={name:"bpmSelectFromForm",components:{editorComponent:h,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:h}},watch:{curVal(e){this.$emit("input",e)},value(){console.log("selectFormForm_value",this.value),this.curVal=this.value}},mounted(){this.curVal=this.value}},b=n(3379),y=n.n(b),_=n(7795),w=n.n(_),S=n(569),C=n.n(S),x=n(3565),$=n.n(x),k=n(9216),I=n.n(k),E=n(4589),D=n.n(E),P=n(432),T={};T.styleTagTransform=D(),T.setAttributes=$(),T.insert=C().bind(null,"head"),T.domAPI=w(),T.insertStyleElement=I(),y()(P.Z,T),P.Z&&P.Z.locals&&P.Z.locals;var F=(0,d.Z)(v,i,[],!1,null,null,null);F.options.__file="components/lib/bpmSelectFromForm/src/main.vue";var O=F.exports;O.install=function(e){e.component(O.name,O)};var A=O},1521:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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 已选名单:\n "),e._l(e.selectedLabels,(function(t,i){return n("el-tag",{directives:[{name:"show",rawName:"v-show",value:i<=5,expression:"index <= 5"}],key:i,attrs:{type:"success"}},[e._v(e._s(t)+"\n "),n("i",{staticClass:"fa fa-times-circle",on:{click:function(t){return e.deleteSelected(i)}}})])})),e._v(" "),e.selectedLabels.length>5?n("el-button",{attrs:{label:"查看全部"+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,i){return n("div",{key:i},[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(i)}}})])})),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._v(" "),n("div",[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入关键字搜索",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._v(" "),n("div",[n("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入关键字搜索",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 先选择表单\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("确 定")])],1)])],1)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(467),l=n.n(s),c=n(6981);r().use(c.Dialog);var u={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"),i=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(i.data,(e=>({value:e[0],label:e[1]})))},async search(){let e=this.formKeyword,t=this.formName,n=l().get(this.fieldConf,"id"),i=this.selectedApp,o=await zj.net.w.noapi({url:`/app_flow/v1/papi/dm/assist_field/select_form_id/${t}/${n}/search_right_title/?q=${e}&left=${i}`,params:this.orgInfo});this.formList=l().map(o.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="未选择";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}),i=l().map(n.data);this.label=l().join(i,",")}},onHide(){this.opened=!1},onOpen(){this.loadApps()},isChecked(e){return l().includes(this.curVal,e)},onSubmit(){this.$emit("input",this.curVal),this.opened=!1},toOpen(){this.opened=!0},deleteSelected(e){let t=this.curVal;l().pullAt(t,e),this.curVal=l().cloneDeep(t)}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectFromId/src/part/editor.vue";var h=f.exports,p={mixins:[n(5460).Z]},m=(0,d.Z)(p,void 0,void 0,!1,null,null,null);m.options.__file="components/lib/bpmSelectFromId/src/part/reader.vue";var g=m.exports,v={name:"bpmSelectFromId",components:{editorComponent:h,readerComponent:g},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?g:h}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},b=n(3379),y=n.n(b),_=n(7795),w=n.n(_),S=n(569),C=n.n(S),x=n(3565),$=n.n(x),k=n(9216),I=n.n(k),E=n(4589),D=n.n(E),P=n(7957),T={};T.styleTagTransform=D(),T.setAttributes=$(),T.insert=C().bind(null,"head"),T.domAPI=w(),T.insertStyleElement=I(),y()(P.Z,T),P.Z&&P.Z.locals&&P.Z.locals;var F=(0,d.Z)(v,i,[],!1,null,null,null);F.options.__file="components/lib/bpmSelectFromId/src/main.vue";var O=F.exports;O.install=function(e){e.component(O.name,O)};var A=O},4189:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return A}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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 i=t.item;return[n("div",{staticClass:"name"},[e._v(e._s(i.value))]),e._v(" "),n("span",{staticClass:"addr"},[e._v(e._s(i.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)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(467),l=n.n(s),c=n(6981);r().use(c.Autocomplete);var u={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},curValue(e){this.$emit("input",e)},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}}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectHouseOwner/src/part/editor.vue";var h=f.exports,p=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("--"))])])};p._withStripped=!0;var m=(0,d.Z)({props:["type","value","fieldConf","row"]},p,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectHouseOwner/src/part/reader.vue";var g=m.exports,v={name:"bpmSelectHouseOwner",components:{editorComponent:h,readerComponent:g},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?g:h}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},b=n(3379),y=n.n(b),_=n(7795),w=n.n(_),S=n(569),C=n.n(S),x=n(3565),$=n.n(x),k=n(9216),I=n.n(k),E=n(4589),D=n.n(E),P=n(8706),T={};T.styleTagTransform=D(),T.setAttributes=$(),T.insert=C().bind(null,"head"),T.domAPI=w(),T.insertStyleElement=I(),y()(P.Z,T),P.Z&&P.Z.locals&&P.Z.locals;var F=(0,d.Z)(v,i,[],!1,null,null,null);F.options.__file="components/lib/bpmSelectHouseOwner/src/main.vue";var O=F.exports;O.install=function(e){e.component(O.name,O)};var A=O},5014:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var i=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)};i._withStripped=!0;var o={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()}}},a=(n(5356),(0,n(1900).Z)(o,i,[],!1,null,null,null));a.options.__file="components/lib/bpmSelectIssue/src/main.vue";var r=a.exports;r.install=function(e){e.component(r.name,r)};var s=r},4078:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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:"",remote:"","remote-method":e.remoteMethod},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)};o._withStripped=!0;var a=n(3371),r=n.n(a),s=n(6981),l=n(3532),c=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)};c._withStripped=!0;var u={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()}}},d=n(1900),f=(0,d.Z)(u,c,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectUser/src/part/select-unit.vue";var h=f.exports;r().use(s.Select),r().use(s.Option);var p={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:h},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"),i=_.get(t,"1");this.unit={search_type:n,org_id:i},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)},async loadSelectOpts(e="",t=""){let n,i=this.fieldConf.id,o={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){console.log("UserTaskCC is getting options");const e=this.fieldConf.node;n=await l.Z.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},o)}else n=await l.Z.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:i,orgInfo:this.orgInfo,isDm:this.dm},o);const a=_.get(n.data,"data.data",[]);return this.transformOptions(a)},transformOptions(e){console.log("transformOptions origin: ",e);let t=_.map(e,(e=>({value:e[0],label:e[1]})));return this.options=this.options.concat(t),this.options=_.uniqBy(this.options,"value"),this.showUnit?(this.options=this.options.concat(t),this.options=_.uniqBy(this.options,"value"),this.unitChildsOptions=t,this._setUnitChildCurVal(this.curVal)):this.options=t,console.log("options: ",t),t},_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)}}},m=(0,d.Z)(p,o,[],!1,null,null,null);m.options.__file="components/lib/bpmSelectUser/src/part/editor.vue";var g=m.exports,v={mixins:[n(5460).Z]},b=(0,d.Z)(v,void 0,void 0,!1,null,null,null);b.options.__file="components/lib/bpmSelectUser/src/part/reader.vue";var y=b.exports,w={name:"BpmSelectFromField",components:{editorComponent:g,readerComponent:y},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?y: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:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},S=(0,d.Z)(w,i,[],!1,null,null,null);S.options.__file="components/lib/bpmSelectUser/src/main.vue";var C=S.exports;C.install=function(e){e.component(C.name,C)};var x=C},6324:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return u}});var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bpm-signature",staticStyle:{position:"relative"}},["edit"===e.mode?[e.openLastSign&&e.lastSign?n("div",{staticClass:"canvas-box",staticStyle:{position:"absolute","border-color":"#fff"}},[n("bpm-mul-image",{staticClass:"signature-reader",attrs:{type:"Signature",value:e.curSign}})],1):e._e(),e._v(" "),n("div",{staticClass:"canvas-box"},[n("canvas",{ref:"canvasElem",staticStyle:{cursor:"crosshair",width:"100%",height:"320px"},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)};i._withStripped=!0;var o=n(5176);function a(e,t,n={},i={}){if(!(this instanceof a))return new a(e,n);if(!e)return;let{width:o,height:r}=window.getComputedStyle(e,null);o=o.replace("px",""),r=r.replace("px",""),console.log("canvas size: ",o,r),o=o&&"auto"!==o&&-1===o.indexOf("%")?o:600,r=r&&"auto"!==r&&-1===r.indexOf("%")?r:320,console.log(e),this.canvas=e,this.context=e.getContext("2d"),this.width=o,this.height=r;const s=this.context,l=window.devicePixelRatio;l?(e.style.width=`${o}px`,e.style.height=`${r}px`,e.height=r*l,e.width=o*l,s.scale(l,l)):(e.width=o,e.height=r),s.lineWidth=2,s.strokeStyle="black",s.lineCap="round",s.lineJoin="round",Object.assign(s,n);const c={},u=/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);u||(s.shadowBlur=1,s.shadowColor="black");let d=!1;const f=t=>n=>{if(n.preventDefault(),1===t&&(d=!0),1===t||d){const{left:i,top:o}=e.getBoundingClientRect();n=u?n.touches[0]:n,c.x=n.clientX-i+.5,c.y=n.clientY-o+.5,(e=>{switch(e){case 1:s.beginPath(),s.moveTo(c.x,c.y);break;case 2:s.lineTo(c.x,c.y),s.stroke()}})(t)}},h=f(1),p=f(2),m=window.requestAnimationFrame,g=m?e=>{m((()=>{p(e)}))}:p;if(u?(e.addEventListener("touchstart",h),e.addEventListener("touchmove",g)):(e.addEventListener("mousedown",h),e.addEventListener("mousemove",g),["mouseup","mouseleave"].forEach((t=>{e.addEventListener(t,(()=>{d=!1}))}))),"number"==typeof t)switch(this.degree=t,s.rotate(t*Math.PI/180),t){case-90:s.translate(-r,0);break;case 90:s.translate(0,-o);break;case-180:case 180:s.translate(-o,-r)}}a.prototype={scale(e,t,n=this.canvas){const i=n.width,o=n.height;if(t=t||o,(e=e||i)!==i||t!==o){const a=document.createElement("canvas"),r=a.getContext("2d");a.width=e,a.height=t,r.drawImage(n,0,0,i,o,0,0,e,t),n=a}return n},rotate(e,t=this.canvas){if(0!=(e=~~e)){const n=180,i=-90;e>n?e=n:e<i&&(e=i);const o=document.createElement("canvas"),a=o.getContext("2d"),r=t.height,s=t.width,l=e*Math.PI/180;switch(e){case-90:o.width=r,o.height=s,a.rotate(l),a.drawImage(t,-s,0);break;case 90:o.width=r,o.height=s,a.rotate(l),a.drawImage(t,0,-r);break;case 180:o.width=s,o.height=r,a.rotate(l),a.drawImage(t,-s,-r)}t=o}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],i=atob(t[1]);let o=i.length;const a=new Uint8Array(o);for(;o--;)a[o]=i.charCodeAt(o);return new Blob([a],{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,i){const o=new FormData,a=new XMLHttpRequest;a.withCredentials=!0,o.append("image",e,"sign"),a.open("POST",t,!0),a.onload=()=>{a.status>=200&&a.status<300||304===a.status?n(a.responseText):i()},a.onerror=e=>{"function"==typeof i?i(e):console.log(`upload img error: ${e}`)},a.send(o)}};var r=a,s={name:"BpmSignature",components:{BpmMulImage:o.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(){},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()})))}},methods:{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 r(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();console.log("Signature canvas img: ",e),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:i},o){let a=window.atob(e.split(",")[1]),r=new ArrayBuffer(a.length),s=new Uint8Array(r);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let l,c=window.WebKitBlobBuilder||window.MozBlobBuilder;if(c){let e=new c;e.append(r),l=e.getBlob(t)}else l=new window.Blob([r],{type:t});let u=new FormData;u.append(i,l,n),zj.net.w.noapi({method:"POST",url:"/platform/v1/papi/app_file/upload/",data:u,processData:!1,contentType:!1}).then((e=>{o&&o(e.file_md5)}))}}},l=(0,n(1900).Z)(s,i,[],!1,null,null,null);l.options.__file="components/lib/bpmSignature/src/main.vue";var c=l.exports;c.install=function(e){e.component(c.name,c)};var u=c},2284:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return v}});var i=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("查看子表单")]):"table"===e.showStyle?n("SubFormStyleTable",e._b({attrs:{value:e.subformData,columns:e.columns,subformPerm:e.subformPerm,fieldConf:e.fieldConf,mode:e.mode,"max-height":e.maxHeight,"show-header":e.showHeader,resizable:e.resizable},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,"max-height":e.maxHeight},on:{change:e.handleChange}},"SubFormStyleCard",e.$attrs,!1)),e._v(" "),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,"max-height":e.dialogTableMaxHeight,"show-header":!0,resizable:!0},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},on:{change:e.handleChange}},"SubFormStyleCard",e.$attrs,!1))],1)])],1)};i._withStripped=!0;var o=n(3663),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-table",{staticStyle:{width:"100%"},attrs:{data:e.subformData,"max-height":e.maxHeight,"show-header":e.showHeader,resizable:e.resizable,border:"",stripe:""}},[e.showIndex?n("el-table-column",{attrs:{type:"index",label:e.indexLabel,width:100}}):e._e(),e._v(" "),e._l(e.columns,(function(t){return n("el-table-column",{key:t.key,attrs:{prop:t.id,label:t.label,"min-width":t.minWidth,sortable:t.sortable,"sort-by":t.sortBy},scopedSlots:e._u([{key:"default",fn:function(i){return[n("bpm-field",e._b({attrs:{type:t.data.type,fieldConf:t.data,mode:e.getFieldMode(t.data.perm),uiType:"table"},on:{change:e.handleChange},model:{value:i.row[t.id],callback:function(n){e.$set(i.row,t.id,n)},expression:"scope.row[col.id]"}},"bpm-field",e.$attrs,!1))]}}],null,!0)})})),e._v(" "),e.canRemove?n("el-table-column",{attrs:{prop:"delete",label:"操作",width:100},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{staticClass:"btn-delete",attrs:{type:"danger",icon:"el-icon-delete",circle:""},on:{click:function(n){return e.handleRemoveItem(t.$index)}}})]}}],null,!1,2399725298)}):e._e()],2),e._v(" "),e.canAdd?n("el-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"default",icon:"el-icon-plus"},on:{click:e.handleAddItem}},[e._v("添加项")]):e._e()],1)};a._withStripped=!0;var r={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}},data(){return{subformData:[]}},computed:{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},canRemove(){return"edit"===this.mode&&this.subformPerm.deletable},showIndex(){return!!this.fieldConf.show_index},indexLabel(){return this.fieldConf.index_label||zj.z("序号","c.b2.common.subform_index")}},watch:{value:{handler(e){e&&_.isArray(e)?this.subformData=e:this.subformData=[]},immediate:!0}},methods:{getFieldMode(e){let t=this.mode;return!e||"edit"!==t||e.editable||e.writable||(t="view"),t},handleChange(){"edit"===this.mode&&this.$emit("change",this.subformData)},handleAddItem(){let e=this.maxId+1,t={..._.cloneDeep(this.originItem),isNew:!0,_meta:{id:e,creator:this.userId,is_deleted:!1}};this.subformData.push(t)},handleRemoveItem(e){this.subformData.splice(e,1),this.handleChange()}}},s={name:"SubFormStyleTable",mixins:[r],props:{showHeader:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0}}},l=n(1900),c=(0,l.Z)(s,a,[],!1,null,null,null);c.options.__file="components/lib/bpmSubForm/src/table.vue";var u=c.exports,d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:{overflow:"auto"}},[e._l(e.subformData,(function(t,i){return n("el-card",{key:i,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(i+1)+"\n ")]):e._e(),e._v(" "),e._l(e.columns,(function(i){return n("el-form-item",{key:i.key,attrs:{label:i.label,required:i.data.check&&i.data.check.required}},[n("bpm-field",e._b({attrs:{type:i.data.type,fieldConf:i.data,mode:e.getFieldMode(i.data.perm),uiType:"form"},on:{change:e.handleChange},model:{value:t[i.id],callback:function(n){e.$set(t,i.id,n)},expression:"item[col.id]"}},"bpm-field",e.$attrs,!1))],1)}))],2),e._v(" "),e.canRemove?n("el-button",{staticClass:"btn-delete",attrs:{type:"danger",icon:"el-icon-delete",circle:""},on:{click:function(t){return e.handleRemoveItem(i)}}}):e._e()],1)})),e._v(" "),e.canAdd?n("el-button",{attrs:{type:"default",icon:"el-icon-plus"},on:{click:e.handleAddItem}},[e._v("添加项")]):e._e()],2)};d._withStripped=!0;var f={name:"SubFormStyleCard",mixins:[r]},h=(0,l.Z)(f,d,[],!1,null,null,null);h.options.__file="components/lib/bpmSubForm/src/card.vue";var p={name:"BpmSubForm",components:{SubFormStyleTable:u,SubFormStyleCard:h.exports},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}},data(){return{subformData:[],dialogTableMaxHeight:500,showSubForm:!1}},computed:{columns(){const e=this.fieldConf.elements||[],t=[];return e.forEach((e=>{const n=o.r[e.type]||{},i=e.perm||{visible:!0,editable:!0,writable:!0};if(this.dm||i.visible){let o=this.mode;"edit"!==o||i.editable||i.writable||(o="view"),t.push({key:e.id,id:e.id,label:e.name||e.id,minWidth:n.tableColWidth||100,sortable:!0,sortBy:e.id,fieldMode:o,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}}},watch:{value:{handler(e){e&&_.isArray(e)?this.subformData=e:this.subformData=[]},immediate:!0}},created(){this.dialogTableMaxHeight=Math.floor(window.innerHeight/100*70-114)},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},m=(0,l.Z)(p,i,[],!1,null,"e0a458ce",null);m.options.__file="components/lib/bpmSubForm/src/main.vue";var g=m.exports;g.install=function(e){e.component(g.name,g)};var v=g},3791:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var i=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},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};i._withStripped=!0;var o=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,clearable:e.clearable,disabled:e.disabled},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}})],1)};o._withStripped=!0;var a=n(467),r=n.n(a),s=n(3371),l=n.n(s),c=n(6981);l().use(c.TimeSelect);var u={data(){return{curVal:""}},props:["value","fieldConf","row","clearable","disabled"],watch:{curVal(e){this.$emit("input",e)},value(){this.curVal=this.value}},computed:{format(){return r().get(this.fieldConf,"view.format")},checkFormat(){return r().get(this.fieldConf,"check.format")}},mounted(){this.curVal=this.value},methods:{}},d=n(1900),f=(0,d.Z)(u,o,[],!1,null,null,null);f.options.__file="components/lib/bpmTime/src/part/editor.vue";var h=f.exports,p=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",[e._v(e._s(e.value))])};p._withStripped=!0;var m={props:["value","fieldConf","row"],data(){return{}},computed:{},watch:{},mounted(){},methods:{}},g=(0,d.Z)(m,p,[],!1,null,null,null);g.options.__file="components/lib/bpmTime/src/part/reader.vue";var v=g.exports,b={name:"BpmTime",components:{editorComponent:h,readerComponent:v},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?v:h}},watch:{curVal(e){this.$emit("input",e),this.$emit("change",e)},value(){this.curVal=this.value}},mounted(){this.curVal=this.value}},y=(0,d.Z)(b,i,[],!1,null,null,null);y.options.__file="components/lib/bpmTime/src/main.vue";var _=y.exports;_.install=function(e){e.component(_.name,_)};var w=_},7924:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return r}});var i=function(){var e=this;e.$createElement;return e._self._c,e._m(0)};i._withStripped=!0;var o=(0,n(1900).Z)({name:"Demo"},i,[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);o.options.__file="components/lib/demo/src/main.vue";var a=o.exports;a.install=function(e){e.component(a.name,a)};var r=a},367:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return r}});var i=function(){var e=this;e.$createElement;return e._self._c,e._m(0)};i._withStripped=!0;var o=(0,n(1900).Z)({name:"Demo2"},i,[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);o.options.__file="components/lib/demo2/src/main.vue";var a=o.exports;a.install=function(e){e.component(a.name,a)};var r=a},3663:function(e,t,n){"use strict";n.d(t,{r:function(){return r}});let i=[{key:"lt",name:"早于"},{key:"gt",name:"晚于"},{key:"gte",name:"不早于"},{key:"lte",name:"不晚于"}],o=[{key:"in",name:"在列表中"}],a=[{key:"in",name:"在列表中"},{key:"all",name:"包含所有"}];const r={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:180,hasBpmField:!0,actions:i,attrs:["type","id","name","check.format","view.format","linkage"]},Date:{name:"日期选择器",hasBpmField:!0,actions:i,attrs:["type","id","name","check.format","view.format","linkage"]},Time:{name:"时间选择器",hasBpmField:!0,actions:i,attrs:["type","id","name","check.format","view.format","linkage"]},Timestamp:{name:"※时间戳",actions:i,attrs:["type","id","name","check.format","view.format","linkage"]},Select:{name:"单选",hasBpmField:!0,tableColWidth:220,actions:o,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},Status:{name:"状态",hasBpmField:!0,tableColWidth:150,actions:o,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},MulSelect:{name:"多选",hasBpmField:!0,tableColWidth:220,actions:a,attrs:["type","id","name","value_type","result_type","style","range_enum","linkage"]},SelectFromForm:{name:"远程单项选择",hasBpmField:!0,tableColWidth:200,actions:o,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:a,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"]},SelectProject:{name:"项目单项选择",hasBpmField:!0,tableColWidth:200,actions:o,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:a,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:o,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:a,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:200,actions:o,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:200,actions:a,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:o,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:a,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:o,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:a,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:o,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:o,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:o,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:a,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:"区域多项选择",actions:a,attrs:["type","id","name","value_type","can","linkage"]},Area:{name:"区域单项选择",actions:o,options:{type:"MulArea"},attrs:["type","id","name","value_type","can","linkage"]},SelectFormId:{name:"表单单项选择",hasBpmField:!0,tableColWidth:200,actions:o,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},MulSelectFormId:{name:"表单多项选择",hasBpmField:!0,tableColWidth:200,actions:o,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},SelectFromField:{name:"远程单选(从字段)",hasBpmField:!0,tableColWidth:200,actions:o,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:o,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}}},4239:function(e,t,n){"use strict";n.d(t,{QE:function(){return s},tq:function(){return l}});var i=n(467),o=n.n(i),a=n(6656),r=n.n(a);function s(e,t={}){o().isFunction(e)&&(e=e(t));let n=o().get(e.match(/\?([^#]+)/),"1");if(n){let i=r().parse(n);i=function(...e){return o().assignIn({},...e)}(i,t),e=o().replace(e,n,r().stringify(i))}else e=e+"?"+r().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,i=0,o=e.length;i<o;i++)-1!=t.indexOf(e[i])&&(n=!0);return n}},1503:function(e,t,n){var i={"./bpmArea/index.js":3783,"./bpmAreaElevation/index.js":5756,"./bpmAudit/index.js":6972,"./bpmDateTime/index.js":7802,"./bpmField/index.js":6769,"./bpmFieldsFilter/index.js":7882,"./bpmFormField/index.js":1469,"./bpmMulFile/index.js":8357,"./bpmMulImage/index.js":5176,"./bpmNumber/index.js":631,"./bpmSelect/index.js":5596,"./bpmSelectCheckItem/index.js":8356,"./bpmSelectEntranceForm/index.js":2662,"./bpmSelectFromField/index.js":4092,"./bpmSelectFromForm/index.js":4512,"./bpmSelectFromId/index.js":1521,"./bpmSelectHouseOwner/index.js":4189,"./bpmSelectIssue/index.js":5014,"./bpmSelectUser/index.js":4078,"./bpmSignature/index.js":6324,"./bpmSpliter/index.ts":3832,"./bpmSubForm/index.js":2284,"./bpmText/index.ts":6872,"./bpmTime/index.js":3791,"./demo/index.js":7924,"./demo2/index.js":367,"./index.ts":9492};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}o.keys=function(){return Object.keys(i)},o.resolve=a,e.exports=o,o.id=1503},1581: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=void 0;const i=n(7159),o=n(3924),a=n(1240),r=n(98),s=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(r,s):r;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)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=n(7426);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=n(6646);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},7023: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 i 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=i;class o 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 i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function a(e,...t){const n=[e[0]];let i=0;for(;i<t.length;)l(n,t[i]),n.push(e[++i]);return new o(n)}t._Code=o,t.nil=new o(""),t._=a;const r=new o("+");function s(e,...t){const n=[u(e[0])];let i=0;for(;i<t.length;)n.push(r),l(n,t[i]),n.push(r,u(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===r){const n=c(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new o(n)}function l(e,t){var n;t instanceof o?e.push(...t._items):t instanceof i?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof i||'"'!==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 i?void 0:`"${e}${t.slice(1)}`}function u(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 o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):a`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},3487: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 i=n(7023),o=n(8490);var a=n(7023);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return a.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return a.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return a.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return a.Name}});var r=n(8490);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),t.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._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?o.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class c 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 i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=T(this.rhs,e,t),this}get names(){return P(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends s{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p 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=T(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class m 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 i=n.length;for(;i--;){const o=n[i];o.optimizeNames(e,t)||(F(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>D(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends m{}class b extends g{}b.kind="else";class y extends g{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 b(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(O(e),t instanceof y?[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=T(this.condition,e,t),this}get names(){const e=super.names;return P(e,this.condition),this.else&&D(e,this.else.names),e}}y.kind="if";class _ extends g{}_.kind="for";class w extends _{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=T(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}}class S extends _{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:i,to:a}=this;return`for(${t} ${n}=${i}; ${n}<${a}; ${n}++)`+super.render(e)}get names(){const e=P(super.names,this.from);return P(e,this.to)}}class C extends _{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}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=T(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}}class x extends g{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)}}x.kind="func";class $ extends m{render(e){return"return "+super.render(e)}}$.kind="return";class k extends g{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,i;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}}class I extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}I.kind="catch";class E extends g{render(e){return"finally"+super.render(e)}}function D(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function P(e,t){return t instanceof i._CodeOrName?D(e,t.names):e}function T(e,t,n){return e instanceof i.Name?a(e):(o=e)instanceof i._Code&&o._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==n[e.str]))?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=a(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function a(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function F(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function O(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${R(e)}`}E.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 o.Scope({parent:e}),this._nodes=[new v]}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,i){const o=this._scope.toName(t);return void 0!==n&&i&&(this._constants[o.str]=n),this._leafNode(new l(e,o,n)),o}const(e,t,n){return this._def(o.varKinds.const,e,t,n)}let(e,t,n){return this._def(o.varKinds.let,e,t,n)}var(e,t,n){return this._def(o.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==i.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[n,o]of e)t.length>1&&t.push(","),t.push(n),(n!==o||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,o));return t.push("}"),new i._Code(t)}if(e,t,n){if(this._blockNode(new y(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 y(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(y,b)}_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,i,a=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const r=this._scope.toName(e);return this._for(new S(a,r,t,n),(()=>i(r)))}forOf(e,t,n,a=o.varKinds.const){const r=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(r,i._`${e}[${t}]`),n(r)}))}return this._for(new C("of",a,r,t),(()=>n(r)))}forIn(e,t,n,a=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const r=this._scope.toName(e);return this._for(new C("in",a,r,t),(()=>n(r)))}endFor(){return this._endBlockNode(_)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new $;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode($)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new k;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new I(e),t(e)}return n&&(this._currNode=i.finally=new E,this.code(n)),this._endBlockNode(I,E)}throw(e){return this._leafNode(new h(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=i.nil,n,o){return this._blockNode(new x(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(x)}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 y))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=O;const A=j(t.operators.AND);t.and=function(...e){return e.reduce(A)};const M=j(t.operators.OR);function j(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${R(t)} ${e} ${R(n)}`}function R(e){return e instanceof i.Name?e:i._`(${e})`}t.or=function(...e){return e.reduce(M)}},8490: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 i=n(7023);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var a;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(a=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class r{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.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=r;class s extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${n}]`}}t.ValueScopeName=s;const l=i._`\n`;t.ValueScope=class extends r{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.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 i=this.toName(e),{prefix:o}=i,a=null!==(n=t.key)&&void 0!==n?n:t.ref;let r=this._values[o];if(r){const e=r.get(a);if(e)return e}else r=this._values[o]=new Map;r.set(a,i);const s=this._scope[o]||(this._scope[o]=[]),l=s.length;return s[l]=t.ref,i.setValue(t,{property:o,itemIndex:l}),i}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 i._`${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,r={},s){let l=i.nil;for(const c in e){const u=e[c];if(!u)continue;const d=r[c]=r[c]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,a.Started);let r=n(e);if(r){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${r};${this.opts._n}`}else{if(!(r=null==s?void 0:s(e)))throw new o(e);l=i._`${l}${r}${this.opts._n}`}d.set(e,a.Completed)}))}return l}}},4181: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 i=n(3487),o=n(6776),a=n(2141);function r(e,t){const n=e.const("err",t);e.if(i._`${a.default.vErrors} === null`,(()=>e.assign(a.default.vErrors,i._`[${n}]`)),i._`${a.default.vErrors}.push(${n})`),e.code(i._`${a.default.errors}++`)}function s(e,t){const{gen:n,validateName:o,schemaEnv:a}=e;a.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,a){const{it:l}=e,{gen:u,compositeRule:d,allErrors:f}=l,h=c(e,n,o);(null!=a?a:d||f)?r(u,h):s(l,i._`[${h}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:o}=e,{gen:l,compositeRule:u,allErrors:d}=o;r(l,c(e,n,i)),u||d||s(o,a.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(a.default.errors,t),e.if(i._`${a.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${a.default.vErrors}.length`,t)),(()=>e.assign(a.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:r,it:s}){if(void 0===r)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",r,a.default.errors,(r=>{e.const(l,i._`${a.default.vErrors}[${r}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(a.default.instancePath,s.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign(i._`${l}.schema`,n),e.assign(i._`${l}.data`,o))}))};const l={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function c(e,t,n){const{createErrors:o}=e.it;return!1===o?i._`{}`:function(e,t,n={}){const{gen:o,it:r}=e,s=[u(r,n),d(e,n)];return function(e,{params:t,message:n},o){const{keyword:r,data:s,schemaValue:c,it:u}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:p}=u;o.push([l.keyword,r],[l.params,"function"==typeof t?t(e):t||i._`{}`]),d.messages&&o.push([l.message,"function"==typeof n?n(e):n]),d.verbose&&o.push([l.schema,c],[l.parentSchema,i._`${h}${p}`],[a.default.data,s]),f&&o.push([l.propertyName,f])}(e,t,s),o.object(...s)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[a.default.instancePath,(0,i.strConcat)(a.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:a}){let r=a?t:i.str`${t}/${e}`;return n&&(r=i.str`${r}${(0,o.getErrorPath)(n,o.Type.Str)}`),[l.schemaPath,r]}},5173: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 i=n(3487),o=n(7426),a=n(2141),r=n(2531),s=n(6776),l=n(4815);class c{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,r.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 u(e){const t=f.call(this,e);if(t)return t;const n=(0,r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:c}=this.opts.code,{ownProperties:u}=this.opts,d=new i.CodeGen(this.scope,{es5:s,lines:c,ownProperties:u});let h;e.$async&&(h=d.scopeValue("Error",{ref:o.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const p=d.scopeName("validate");e.validateName=p;const m={gen:d,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(a.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${a.default.self}`,`${a.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{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:p,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function d(e){return(0,r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function f(e){for(const i of this._compilations)if(n=e,(t=i).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return i;var t,n}function h(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||p.call(this,e,t)}function p(e,t){const n=this.opts.uriResolver.parse(t),i=(0,r._getFullPath)(this.opts.uriResolver,n);let o=(0,r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===o)return g.call(this,n,e);const a=(0,r.normalizeId)(i),s=this.refs[a]||this.schemas[a];if("string"==typeof s){const t=p.call(this,e,s);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==s?void 0:s.schema)){if(s.validate||u.call(this,s),a===(0,r.normalizeId)(t)){const{schema:t}=s,{schemaId:n}=this.opts,i=t[n];return i&&(o=(0,r.resolveUrl)(this.opts.uriResolver,o,i)),new c({schema:t,schemaId:n,root:e,baseId:o})}return g.call(this,n,s)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,n){var i;n=(0,r.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let a=h.call(this,e,n);if(void 0===a){const o=null===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:r}=this.opts;o&&(a=new c({schema:o,schemaId:r,root:e,baseId:t}))}return void 0!==a?e.refs[n]=d.call(this,a):void 0},t.getCompilingSchema=f,t.resolveSchema=p;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:i}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,s.unescapeFragment)(i)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!m.has(i)&&o&&(t=(0,r.resolveUrl)(this.opts.uriResolver,t,o))}let a;if("boolean"!=typeof n&&n.$ref&&!(0,s.schemaHasRulesButRef)(n,this.RULES)){const e=(0,r.resolveUrl)(this.opts.uriResolver,t,n.$ref);a=p.call(this,i,e)}const{schemaId:l}=this.opts;return a=a||new c({schema:n,schemaId:l,root:i,baseId:t}),a.schema!==a.root.schema?a:void 0}},2141:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(3487),o={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t.default=o},6646:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2531);class o extends Error{constructor(e,t,n,o){super(o||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,i.resolveUrl)(e,t,n),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(e,this.missingRef))}}t.default=o},2531: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 i=n(6776),o=n(4063),a=n(9461),r=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&&c(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 c(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!r.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=c(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=h(t));const i=e.parse(t);return d(e,i)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const f=/#\/?$/;function h(e){return e?e.replace(f,""):""}t.normalizeId=h,t.resolveUrl=function(e,t,n){return n=h(n),e.resolve(t,n)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:i}=this.opts,r=h(e[n]||t),s={"":r},l=u(i,r,!1),c={},d=new Set;return a(e,{allKeys:!0},((e,t,i,o)=>{if(void 0===o)return;const a=l+t;let r=s[o];function u(t){const n=this.opts.uriResolver.resolve;if(t=h(r?n(r,t):t),d.has(t))throw m(t);d.add(t);let i=this.refs[t];return"string"==typeof i&&(i=this.refs[i]),"object"==typeof i?f(e,i.schema,t):t!==h(a)&&("#"===t[0]?(f(e,c[t],t),c[t]=e):this.refs[t]=a),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[n]&&(r=u.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=r})),c;function f(e,t,n){if(void 0!==t&&!o(e,t))throw m(n)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},3141: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:{}}}},6776: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 i=n(3487),o=n(7023);function a(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=i.RULES.keywords;for(const n in t)o[n]||p(e,`unknown keyword: "${n}"`)}function r(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 c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(a,r,s,l)=>{const c=void 0===s?r:s instanceof i.Name?(r instanceof i.Name?e(a,r,s):t(a,r,s),s):r instanceof i.Name?(t(a,s,r),r):n(r,s);return l!==i.Name||c instanceof i.Name?c:o(a,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(i._`${t}${(0,i.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||(a(e,t),!r(t,e.self.RULES.all))},t.checkUnknownRules=a,t.schemaHasRules=r,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,o,a){if(!a){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(o)}`},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:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,i._`${n} || {}`).code(i._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,i._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,i._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>e.assign(n,!0===t||i._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const f={};var h;function p(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:f[t.code]||(f[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(h=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof i.Name){const o=t===h.Num;return n?o?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:o?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,i.getProperty)(e).toString():"/"+s(e)},t.checkStrictMode=p},8876:function(e,t){"use strict";function n(e,t){return t.rules.some((t=>i(e,t)))}function i(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},i){const o=t.RULES.types[i];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=i},5667:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=n(4181),o=n(3487),a=n(2141),r={message:"boolean schema is false"};function s(e,t){const{gen:n,data:o}=e,a={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(a,r,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:i}=e;!1===n?s(e,!1):"object"==typeof n&&!0===n.$async?t.return(a.default.data):(t.assign(o._`${i}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:i}=e;!1===i?(n.var(t,!1),s(e)):n.var(t,!0)}},453: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 i=n(3141),o=n(8876),a=n(4181),r=n(3487),s=n(6776);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.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||(t.DataType={})),t.getSchemaTypes=function(e){const t=c(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=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:i,opts:a}=e,s=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,a.coerceTypes),c=t.length>0&&!(0===s.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(c){const o=f(t,i,a.strictNumbers,l.Wrong);n.if(o,(()=>{s.length?function(e,t,n){const{gen:i,data:o,opts:a}=e,s=i.let("dataType",r._`typeof ${o}`),l=i.let("coerced",r._`undefined`);"array"===a.coerceTypes&&i.if(r._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>i.assign(o,r._`${o}[0]`).assign(s,r._`typeof ${o}`).if(f(t,o,a.strictNumbers),(()=>i.assign(l,o))))),i.if(r._`${l} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===a.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(r._`${s} == "number" || ${s} == "boolean"`).assign(l,r._`"" + ${o}`).elseIf(r._`${o} === null`).assign(l,r._`""`);case"number":return void i.elseIf(r._`${s} == "boolean" || ${o} === null
|
|
3
3
|
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(l,r._`+${o}`);case"integer":return void i.elseIf(r._`${s} === "boolean" || ${o} === null
|
|
4
4
|
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,r._`+${o}`);case"boolean":return void i.elseIf(r._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf(r._`${o} === "true" || ${o} === 1`).assign(l,!0);case"null":return i.elseIf(r._`${o} === "" || ${o} === 0 || ${o} === false`),void i.assign(l,null);case"array":i.elseIf(r._`${s} === "string" || ${s} === "number"
|
|
5
5
|
|| ${s} === "boolean" || ${o} === null`).assign(l,r._`[${o}]`)}}i.else(),p(e),i.endIf(),i.if(r._`${l} !== undefined`,(()=>{i.assign(o,l),function({gen:e,parentData:t,parentDataProperty:n},i){e.if(r._`${t} !== undefined`,(()=>e.assign(r._`${t}[${n}]`,i)))}(e,l)}))}(e,t,s):p(e)}))}return c};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,i=l.Correct){const o=i===l.Correct?r.operators.EQ:r.operators.NEQ;let a;switch(e){case"null":return r._`${t} ${o} null`;case"array":a=r._`Array.isArray(${t})`;break;case"object":a=r._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=s(r._`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=s();break;default:return r._`typeof ${t} ${o} ${e}`}return i===l.Correct?a:(0,r.not)(a);function s(e=r.nil){return(0,r.and)(r._`typeof ${t} == "number"`,e,n?r._`isFinite(${t})`:r.nil)}}function f(e,t,n,i){if(1===e.length)return d(e[0],t,n,i);let o;const a=(0,s.toHash)(e);if(a.array&&a.object){const e=r._`typeof ${t} != "object"`;o=a.null?e:r._`!${t} || ${e}`,delete a.null,delete a.array,delete a.object}else o=r.nil;a.number&&delete a.integer;for(const e in a)o=(0,r.and)(o,d(e,t,n,i));return o}t.checkDataType=d,t.checkDataTypes=f;const h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?r._`{type: ${e}}`:r._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:n,schema:i}=e,o=(0,s.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:o,schemaValue:o,parentSchema:i,params:{},it:e}}(e);(0,a.reportError)(t,h)}t.reportTypeError=p},313:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const i=n(3487),o=n(6776);function a(e,t,n){const{gen:a,compositeRule:r,data:s,opts:l}=e;if(void 0===n)return;const c=i._`${s}${(0,i.getProperty)(t)}`;if(r)return void(0,o.checkStrictMode)(e,`default is ignored for: ${c}`);let u=i._`${c} === undefined`;"empty"===l.useDefaults&&(u=i._`${u} || ${c} === null || ${c} === ""`),a.if(u,i._`${c} = ${(0,i.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:i}=e.schema;if("object"===t&&n)for(const t in n)a(e,t,n[t].default);else"array"===t&&Array.isArray(i)&&i.forEach(((t,n)=>a(e,n,t.default)))}},4815:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const i=n(5667),o=n(453),a=n(8876),r=n(453),s=n(313),l=n(5005),c=n(3099),u=n(3487),d=n(2141),f=n(2531),h=n(6776),p=n(4181);function m({gen:e,validateName:t,schema:n,schemaEnv:i,opts:o},a){o.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,i.$async,(()=>{e.code(u._`"use strict"; ${g(n,o)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,o),e.code(a)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(o)}`,i.$async,(()=>e.code(g(n,o)).code(a)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function v({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 b(e){return"boolean"!=typeof e.schema}function y(e){(0,h.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:i,self:o}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function _(e,t){if(e.opts.jtd)return S(e,[],!1,t);const n=(0,o.getSchemaTypes)(e.schema);S(e,n,!(0,o.coerceAndCheckDataType)(e,n),t)}function w({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:o}){const a=n.$comment;if(!0===o.$comment)e.code(u._`${d.default.self}.logger.log(${a})`);else if("function"==typeof o.$comment){const n=u.str`${i}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${a}, ${n}, ${o}.schema)`)}}function S(e,t,n,i){const{gen:o,schema:s,data:l,allErrors:c,opts:f,self:p}=e,{RULES:m}=p;function g(h){(0,a.shouldUseGroup)(s,h)&&(h.type?(o.if((0,r.checkDataType)(h.type,l,f.strictNumbers)),C(e,h),1===t.length&&t[0]===h.type&&n&&(o.else(),(0,r.reportTypeError)(e)),o.endIf()):C(e,h),c||o.if(u._`${d.default.errors} === ${i||0}`))}!s.$ref||!f.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(s,m)?(f.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{x(e.dataTypes,t)||$(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const i of e.dataTypes)x(t,i)?n.push(i):t.includes("integer")&&"number"===i&&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"))&&$(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const i in n){const o=n[i];if("object"==typeof o&&(0,a.shouldUseRule)(e.schema,o)){const{type:n}=o.definition;n.length&&!n.some((e=>{return i=e,(n=t).includes(i)||"number"===i&&n.includes("integer");var n,i}))&&$(e,`missing type "${n.join(",")}" for keyword "${i}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):o.block((()=>I(e,"$ref",m.all.$ref.definition)))}function C(e,t){const{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,s.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,a.shouldUseRule)(i,n)&&I(e,n.keyword,n.definition,t.type)}))}function x(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function $(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(y(e),v(e))?function(e){const{schema:t,opts:n,gen:i}=e;m(e,(()=>{n.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}(e),i.let(d.default.vErrors,null),i.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",u._`${n}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),_(e),function(e){const{gen:t,schemaEnv:n,validateName:i,ValidationError:o,opts:a}=e;n.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${o}(${d.default.vErrors})`))):(t.assign(u._`${i}.errors`,d.default.vErrors),a.unevaluated&&function({gen:e,evaluated:t,props:n,items:i}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),i instanceof u.Name&&e.assign(u._`${t}.items`,i)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,i.topBoolOrEmptySchema)(e)))};class k{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,h.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",P(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",d.default.errors))}result(e,t,n){this.failResult((0,u.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,u.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(u._`${t} !== undefined && (${(0,u.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?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.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=u.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:n,schemaCode:i,schemaType:o,def:a}=this;n.if((0,u.or)(u._`${i} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:i,it:o}=this;return(0,u.or)(function(){if(n.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return u._`${(0,r.checkDataTypes)(e,t,o.opts.strictNumbers,r.DataType.Wrong)}`}return u.nil}(),function(){if(i.validateSchema){const n=e.scopeValue("validate$data",{ref:i.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(n,this.it,e),(0,c.extendSubschemaMode)(n,e);const o={...this.it,...n,items:void 0,props:void 0};return function(e,t){b(e)&&(y(e),v(e))?function(e,t){const{schema:n,gen:i,opts:o}=e;o.$comment&&n.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,f.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 a=i.const("_errs",d.default.errors);_(e,a),i.var(t,u._`${a} === ${d.default.errors}`)}(e,t):(0,i.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:n,gen:i}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=h.mergeEvaluated.props(i,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=h.mergeEvaluated.items(i,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:i}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return i.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function I(e,t,n,i){const o=new k(e,n,t);"code"in n?n.code(o,i):o.$data&&n.validate?(0,l.funcKeywordCode)(o,n):"macro"in n?(0,l.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,l.funcKeywordCode)(o,n)}t.KeywordCxt=k;const E=/^\/(?:[^~]|~0|~1)*$/,D=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function P(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let o,a;if(""===e)return d.default.rootData;if("/"===e[0]){if(!E.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,a=d.default.rootData}else{const r=D.exec(e);if(!r)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+r[1];if(o=r[2],"#"===o){if(s>=t)throw new Error(l("property/index",s));return i[t-s]}if(s>t)throw new Error(l("data",s));if(a=n[t-s],!o)return a}let r=a;const s=o.split("/");for(const e of s)e&&(a=u._`${a}${(0,u.getProperty)((0,h.unescapeJsonPointer)(e))}`,r=u._`${r} && ${a}`);return r;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=P},5005:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const i=n(3487),o=n(2141),a=n(412),r=n(4181);function s(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,(()=>t.assign(n,i._`${o.parentData}[${o.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,i.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:o,schema:a,parentSchema:r,it:s}=e,c=t.macro.call(s.self,a,r,s),u=l(n,o,c);!1!==s.opts.validateSchema&&s.self.validateSchema(c,!0);const d=n.name("valid");e.subschema({schema:c,schemaPath:i.nil,errSchemaPath:`${s.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:c,keyword:u,schema:d,parentSchema:f,$data:h,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!h&&t.compile?t.compile.call(p.self,d,f,p):t.validate,g=l(c,u,m),v=c.let("valid");function b(n=(t.async?i._`await `:i.nil)){const r=p.opts.passContext?o.default.this:o.default.self,s=!("compile"in t&&!h||!1===t.schema);c.assign(v,i._`${n}${(0,a.callValidateCode)(e,g,r,s)}`,t.modifying)}function y(e){var n;c.if((0,i.not)(null!==(n=t.valid)&&void 0!==n?n:v),e)}e.block$data(v,(function(){if(!1===t.errors)b(),t.modifying&&s(e),y((()=>e.error()));else{const n=t.async?function(){const e=c.let("ruleErrs",null);return c.try((()=>b(i._`await `)),(t=>c.assign(v,!1).if(i._`${t} instanceof ${p.ValidationError}`,(()=>c.assign(e,i._`${t}.errors`)),(()=>c.throw(t))))),e}():function(){const e=i._`${g}.errors`;return c.assign(e,null),b(i.nil),e}();t.modifying&&s(e),y((()=>function(e,t){const{gen:n}=e;n.if(i._`Array.isArray(${t})`,(()=>{n.assign(o.default.vErrors,i._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,i._`${o.default.vErrors}.length`),(0,r.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:v)},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:i},o,a){if(Array.isArray(o.keyword)?!o.keyword.includes(a):o.keyword!==a)throw new Error("ajv implementation error");const r=o.dependencies;if(null==r?void 0:r.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${a}: ${r.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[a])){const e=`keyword "${a}" value is invalid at path "${i}": `+n.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},3099:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const i=n(3487),o=n(6776);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:a,schemaPath:r,errSchemaPath:s,topSchemaRef:l}){if(void 0!==t&&void 0!==a)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const a=e.schema[t];return void 0===n?{schema:a,schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}${(0,i.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(n)}`}}if(void 0!==a){if(void 0===r||void 0===s||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:a,schemaPath:r,topSchemaRef:l,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:a,data:r,dataTypes:s,propertyName:l}){if(void 0!==r&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==n){const{errorPath:r,dataPathArr:s,opts:l}=t;u(c.let("data",i._`${t.data}${(0,i.getProperty)(n)}`,!0)),e.errorPath=i.str`${r}${(0,o.getErrorPath)(n,a,l.jsPropertySyntax)}`,e.parentDataProperty=i._`${n}`,e.dataPathArr=[...s,e.parentDataProperty]}function u(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!==r&&(u(r instanceof i.Name?r:c.let("data",r,!0)),void 0!==l&&(e.propertyName=l)),s&&(e.dataTypes=s)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:o,allErrors:a}){void 0!==i&&(e.compositeRule=i),void 0!==o&&(e.createErrors=o),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}},7159: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 i=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return i.KeywordCxt}});var o=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const a=n(7426),r=n(6646),s=n(3141),l=n(5173),c=n(3487),u=n(2531),d=n(453),f=n(6776),h=n(4775),p=n(3589),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={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."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function _(e){var t,n,i,o,a,r,s,l,c,u,d,f,h,g,v,b,y,_,w,S,C,x,$,k,I;const E=e.strict,D=null===(t=e.code)||void 0===t?void 0:t.optimize,P=!0===D||void 0===D?1:D||0,T=null!==(i=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==i?i:m,F=null!==(o=e.uriResolver)&&void 0!==o?o:p.default;return{strictSchema:null===(r=null!==(a=e.strictSchema)&&void 0!==a?a:E)||void 0===r||r,strictNumbers:null===(l=null!==(s=e.strictNumbers)&&void 0!==s?s:E)||void 0===l||l,strictTypes:null!==(u=null!==(c=e.strictTypes)&&void 0!==c?c:E)&&void 0!==u?u:"log",strictTuples:null!==(f=null!==(d=e.strictTuples)&&void 0!==d?d:E)&&void 0!==f?f:"log",strictRequired:null!==(g=null!==(h=e.strictRequired)&&void 0!==h?h:E)&&void 0!==g&&g,code:e.code?{...e.code,optimize:P,regExp:T}:{optimize:P,regExp:T},loopRequired:null!==(v=e.loopRequired)&&void 0!==v?v:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(y=e.meta)||void 0===y||y,messages:null===(_=e.messages)||void 0===_||_,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(C=e.addUsedSchema)||void 0===C||C,validateSchema:null===(x=e.validateSchema)||void 0===x||x,validateFormats:null===($=e.validateFormats)||void 0===$||$,unicodeRegExp:null===(k=e.unicodeRegExp)||void 0===k||k,int32range:null===(I=e.int32range)||void 0===I||I,uriResolver:F}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,..._(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:v,es5:t,lines:n}),this.logger=function(e){if(!1===e)return E;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 i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,s.getRules)(),S.call(this,b,e,"NOT SUPPORTED"),S.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=I.call(this),e.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&k.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),x.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let i=h;"id"===n&&(i={...h},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[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 i=n(t);return"$async"in n||(this.errors=n.errors),i}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 i.call(this,e,t);async function i(e,t){await o.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||a.call(this,n)}async function o(e){e&&!this.getSchema(e)&&await i.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof r.default))throw t;return s.call(this,t),await l.call(this,t.missingSchema),a.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 c.call(this,e);this.refs[e]||await o.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function c(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,i=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,i);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,i,!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 i=this.validate(n,e);if(!i&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return i}getSchema(e){let t;for(;"string"==typeof(t=C.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:n});if(t=l.resolveSchema.call(this,i,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=C.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,u.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(P.call(this,n,t),!t)return(0,f.eachItem)(n,(e=>T.call(this,e))),this;O.call(this,t);const i={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(n,0===i.type.length?e=>T.call(this,e,i):e=>i.type.forEach((t=>T.call(this,e,i,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 i of t){const t=i.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:i}=t.definition,a=o[e];i&&a&&(o[e]=M(a))}}return e}_removeAllSchemas(e,t){for(const n in e){const i=e[n];t&&!t.test(n)||("string"==typeof i?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,t,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let a;const{schemaId:r}=this.opts;if("object"==typeof e)a=e[r];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,u.normalizeId)(a||n);const c=u.getSchemaRefs.call(this,e,n);return s=new l.SchemaEnv({schema:e,schemaId:r,meta:t,baseId:n,localRefs:c}),this._cache.set(s.schema,s),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=s),i&&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 S(e,t,n,i="error"){for(const o in e){const a=o;a in t&&this.logger[i](`${n}: option ${o}. ${e[a]}`)}}function C(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function x(){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 $(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function k(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 I(){const e={...this.opts};for(const t of g)delete e[t];return e}t.default=w,w.ValidationError=a.default,w.MissingRefError=r.default;const E={log(){},warn(){},error(){}},D=/^[a-z_$][a-z0-9_$:-]*$/i;function P(e,t){const{RULES:n}=this;if((0,f.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!D.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 T(e,t,n){var i;const o=null==t?void 0:t.post;if(n&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:a}=this;let r=o?a.post:a.rules.find((({type:e})=>e===n));if(r||(r={type:n,rules:[]},a.rules.push(r)),a.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?F.call(this,r,s,t.before):r.rules.push(s),a.all[e]=s,null===(i=t.implements)||void 0===i||i.forEach((e=>this.addKeyword(e)))}function F(e,t,n){const i=e.rules.findIndex((e=>e.keyword===n));i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function O(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=M(t)),e.validateSchema=this.compile(t,!0))}const A={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function M(e){return{anyOf:[e,A]}}},3510:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(4063);i.code='require("ajv/dist/runtime/equal").default',t.default=i},4499:function(e,t){"use strict";function n(e){const t=e.length;let n,i=0,o=0;for(;o<t;)i++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),56320==(64512&n)&&o++);return i}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.code='require("ajv/dist/runtime/ucs2length").default'},3589:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(540);i.code='require("ajv/dist/runtime/uri").default',t.default=i},7426: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},4783:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const i=n(3487),o=n(6776),a={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:i}=t;Array.isArray(i)?r(e,i):(0,o.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(e,t){const{gen:n,schema:a,data:r,keyword:s,it:l}=e;l.items=!0;const c=n.const("len",i._`${r}.length`);if(!1===a)e.setParams({len:t.length}),e.pass(i._`${c} <= ${t.length}`);else if("object"==typeof a&&!(0,o.alwaysValidSchema)(l,a)){const a=n.var("valid",i._`${c} <= ${t.length}`);n.if((0,i.not)(a),(()=>function(a){n.forRange("i",t.length,c,(t=>{e.subschema({keyword:s,dataProp:t,dataPropType:o.Type.Num},a),l.allErrors||n.if((0,i.not)(a),(()=>n.break()))}))}(a))),e.ok(a)}}t.validateAdditionalItems=r,t.default=a},9351:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(412),o=n(3487),a=n(2141),r=n(6776),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:s,data:l,errsCount:c,it:u}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:d,opts:f}=u;if(u.props=!0,"all"!==f.removeAdditional&&(0,r.alwaysValidSchema)(u,n))return;const h=(0,i.allSchemaProperties)(s.properties),p=(0,i.allSchemaProperties)(s.patternProperties);function m(e){t.code(o._`delete ${l}[${e}]`)}function g(i){if("all"===f.removeAdditional||f.removeAdditional&&!1===n)m(i);else{if(!1===n)return e.setParams({additionalProperty:i}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,r.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===f.removeAdditional?(v(i,n,!1),t.if((0,o.not)(n),(()=>{e.reset(),m(i)}))):(v(i,n),d||t.if((0,o.not)(n),(()=>t.break())))}}}function v(t,n,i){const o={keyword:"additionalProperties",dataProp:t,dataPropType:r.Type.Str};!1===i&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,n)}t.forIn("key",l,(n=>{h.length||p.length?t.if(function(n){let a;if(h.length>8){const e=(0,r.schemaRefOrVal)(u,s.properties,"properties");a=(0,i.isOwnProperty)(t,e,n)}else a=h.length?(0,o.or)(...h.map((e=>o._`${n} === ${e}`))):o.nil;return p.length&&(a=(0,o.or)(a,...p.map((t=>o._`${(0,i.usePattern)(e,t)}.test(${n})`)))),(0,o.not)(a)}(n),(()=>g(n))):g(n)})),e.ok(o._`${c} === ${a.default.errors}`)}};t.default=s},1125:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6776),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const a=t.name("valid");n.forEach(((t,n)=>{if((0,i.alwaysValidSchema)(o,t))return;const r=e.subschema({keyword:"allOf",schemaProp:n},a);e.ok(a),e.mergeEvaluated(r)}))}};t.default=o},19:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(412).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=i},9864:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(3487),o=n(6776),a={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?i.str`must contain at least ${e} valid item(s)`:i.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?i._`{minContains: ${e}}`:i._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:r,it:s}=e;let l,c;const{minContains:u,maxContains:d}=a;s.opts.next?(l=void 0===u?1:u,c=d):l=1;const f=t.const("len",i._`${r}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,o.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,o.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(s,n)){let t=i._`${f} >= ${l}`;return void 0!==c&&(t=i._`${t} && ${f} <= ${c}`),void e.pass(t)}s.items=!0;const h=t.name("valid");function p(){const e=t.name("_valid"),n=t.let("count",0);m(e,(()=>t.if(e,(()=>function(e){t.code(i._`${e}++`),void 0===c?t.if(i._`${e} >= ${l}`,(()=>t.assign(h,!0).break())):(t.if(i._`${e} > ${c}`,(()=>t.assign(h,!1).break())),1===l?t.assign(h,!0):t.if(i._`${e} >= ${l}`,(()=>t.assign(h,!0))))}(n)))))}function m(n,i){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},n),i()}))}void 0===c&&1===l?m(h,(()=>t.if(h,(()=>t.break())))):0===l?(t.let(h,!0),void 0!==c&&t.if(i._`${r}.length > 0`,p)):(t.let(h,!1),p()),e.result(h,(()=>e.reset()))}};t.default=a},7772:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const i=n(3487),o=n(6776),a=n(412);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const o=1===t?"property":"properties";return i.str`must have ${o} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:o}})=>i._`{property: ${e},
|