@zhijiancloud/bpm 0.0.76 → 0.0.78
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/bpmArea.umd.js +1 -1
- package/dist/bpmField.umd.js +3 -3
- package/dist/bpmFormField.umd.js +3 -3
- package/dist/bpmMulFile.umd.js +1 -1
- package/dist/bpmSubForm.umd.js +1 -1
- package/dist/bpmSubFormField.umd.js +3 -3
- package/dist/css/bpmMulFile.css +1 -1
- package/dist/css/index.css +1 -1
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/bpmArea.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],t):"object"==typeof exports?exports.bpm2=t(require("lodash")):e.bpm2=t(e.lodash)}(self,(function(e){return function(){var t={4486:function(e,t,s){"use strict";function a(e,t,s,a,l,i,n,o){var r,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=s,c._compiled=!0),a&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),n?(r=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),l&&l.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(n)},c._ssrRegister=r):l&&(r=o?function(){l.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:l),r)if(c.functional){c._injectStyles=r;var d=c.render;c.render=function(e,t){return r.call(t),d(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,r):[r]}return{exports:e,options:c}}s.d(t,{A:function(){return a}})},7642:function(e){e.exports=function(){return this.ELEMENT}()},5554:function(e){e.exports=function(){return this.Vue}()},6773:function(t){"use strict";t.exports=e}},s={};function a(e){var l=s[e];if(void 0!==l)return l.exports;var i=s[e]={exports:{}};return t[e](i,i.exports,a),i.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return function(){"use strict";a.r(l),a.d(l,{default:function(){return M}});var e=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-area",attrs:{fieldConf:e.fieldConf,row:e.row,isMultiple:e.isMultiple,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};e._withStripped=!0;var t=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"select-area-editor"},[s("div",{on:{click:e.toOpen}},[e.label?s("div",[e._v("\n "+e._s(e.label)+"\n ")]):s("div",[s("el-button",{attrs:{size:"small",icon:"el-icon-location-outline"}},[e._v(" "+e._s(e.$z("选择区域","c.select_area")))])],1)]),e._v(" "),s("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),[s("div",[e._v("\n "+e._s(e.$z("当前选中","b2.common.selected"))+":\n "),s("el-tag",[e._v(e._s(e.label))])],1),e._v(" "),e.refresh?s("div",{staticClass:"subcategory-tree-box"},[s("div",{staticClass:"subcategory-tree",staticStyle:{"max-height":"550px",overflow:"auto"}},[s("el-tree",{ref:"tree",attrs:{props:e.defaultProps,lazy:"","show-checkbox":!1,load:e.onLazyTreeLoad,"expand-on-click-node":!0,"check-strictly":!0},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return s("span",{staticClass:"custom-tree-node"},[s("div",{staticClass:"tree-body-content"},[s("div",[e._v(e._s(a.label))]),e._v(" "),"strict"==e.tickStrategy&&a.lazy&&a.selectable?s("span",{on:{click:function(t){return t.stopPropagation(),e.expand(a.id,"force")}}},[e._v(e._s(e.$z("选择","c.choose")))]):e._e()])])}}],null,!1,3939466302)})],1)]):e._e()]),e._v(" "),e.openLocate?s("room-map-select",{attrs:{field:e.field,drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas},on:{save:e.savePlan}}):e._e()],1)};t._withStripped=!0;var s=a(5554),i=a.n(s),n=a(6773),o=a.n(n),r=a(7642),c=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",[e._v("\n slsls\n")])};c._withStripped=!0;var d=a(4486),h=(0,d.A)({},c,[],!1,null,null,null);h.options.__file="components/lib/bpmArea/src/part/room-map-select.vue";var p=h.exports;i().use(r.Dialog);var u={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:p},inject:["selectOptions"],data(){return{curVal:"",label:zj.z("选择区域","c.select_area"),keyword:"",opened:!1,debounceSearch:o().debounce(o().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"==o().get(this.fieldConf,"can","all")?"leaf-filtered":"strict"},openLocate(){return o().get(this.fieldConf,"enable_locate")},points(){return o().get(this.value,"all_points",[])},canSelect(){return o().get(this.fieldConf,"can")},getSelectOptions(){return this.selectOptions()}},mounted(){this.curVal=this.value,this.loadRemoteLabel()},methods:{handleNodeClick(e){this.selectedKey=o().get(e,"id","")},handleCheckChange(e,t,s){console.log(e,t,s)},toOpen(){this.opened=!0},toClose(){this.opened=!1},reset(){try{let e=this.value;this.selectedKey=o().get(e,"id","")}catch(e){this.selectedKey=""}},async onOpen(){if(o().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 s=[];console.log("node——onLazyTreeLoad",e),s=0==e.level?await this._loadNextCategoryList(""):await this._loadNextCategoryList(e.data.id),this.setCategoryInMap(s),console.log("list",s),t(s)}),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 o().map(e,(e=>{let s=e.drawing_md5s;s=o().compact(s);let a={id:e.id,lazy:e.is_parent,label:e.name,isLeaf:!e.is_parent,path_ids:e.path_ids,path_names:e.path_names,selectable:e.available,haspic:!!s.length,type:e.type};return"building_floor"==t&&3==e.type&&(a.lazy=!1),o().set(this.treeItemMap,e.id,a),a}))},async loadList(e){let t=this.search_keyword,s=JSON.stringify({id:e,path_ids:o().get(this.treeItemMap,`${e}.path_ids`),type:o().get(this.treeItemMap,`${e}.type`)}),a=zj.pageParam({father:s,q:t});e||delete a.father,this.selectFields&&(a.fields=this.selectFields);let l=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container});return console.log("data",l),l},setCategoryInMap(e){o().each(e,(e=>{o().set(this.allAreaMap,e.value,e)}))},selected(e,t){e=o().toString(e);let s=o().get(this.treeItemMap,e,null);s&&(s&&s.lazy&&!t||!e||!s.selectable||(this.label=s.label,s=o().cloneDeep(s),delete s.label,delete s.lazy,delete s.path_names,delete s.pathNames,delete s.selectable,delete s.haspic,delete s.children,this.value,this.$emit("input",[{id:s.id,path_ids:s.path_ids,all_points:[],type:s.type}]),this.loadRemoteLabel(),this.toClose()))},expand(e,t){if(e=o().toString(e),!o().get(this.treeItemMap,e,null).lazy||t)this.selected(e,t);else{let t=this.$refs.tree.isExpanded(o().toInteger(e));this.$refs.tree.setExpanded(o().toInteger(e),!t)}},savePlan(e){this.curVal.all_points=o().cloneDeep(e),this.$emit("input",this.curVal.all_points),this.$emit("change",this.curVal.all_points)},async search(){let e=this.search_keyword;if(this.keyword=e,this.expandedKeys=[],!e)return;this.$bpm.setFuncGIO("区域搜索");let t=await this._loadNextCategoryList("");this.changeLazy(t),this.filterNodes=t},changeLazy(e){this.setCategoryInMap(e),o().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(!o().isNil(e)&&e)try{this.loading=!0,e=o().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=o().get(t,"subareas",[]),this.drawingMd5s=o().get(t,"drawing_md5s",[]);let s=o().join(t.path_names,"/");this.label=`${s}${s?"/":""}${t.name}`}finally{this.loading=!1}else this.label=""},onHide(){this.opened=!1}}},f=(0,d.A)(u,t,[],!1,null,null,null);f.options.__file="components/lib/bpmArea/src/part/editor.vue";var m=f.exports,g=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"select-area-editor"},[s("div",{on:{click:function(t){return t.stopPropagation(),e.toOpen.apply(null,arguments)}}},[e.labels.length>0?s("div",[e._l(e.labels,(function(t){return s("el-tag",{key:t,staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t))])})),e._v(" "),s("i",{staticClass:"el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.delAllItem()}}})],2):s("div",[s("el-button",{attrs:{size:"small",icon:"el-icon-location-outline"}},[e._v(" "+e._s(e.$z("选择区域","c.select_area")))])],1)]),e._v(" "),s("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),[s("div",[e._v("\n "+e._s(e.$z("当前选中","b2.common.selected"))+":\n "),e._l(e.labelObjs,(function(t,a){return[a<5?s("el-tag",{key:t.id,staticStyle:{"margin-right":"10px","margin-top":"5px"},attrs:{closable:""},on:{close:function(s){return e.delHandle(t)}}},[e._v(e._s(t.pathNames))]):e._e()]})),e._v(" "),e.labelObjs.length>5?s("el-dropdown",[s("el-button",{attrs:{type:"primary"}},[e._v("\n "+e._s(e.$z("更多","c.more"))),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e._l(e.labelObjs,(function(t,a){return[a>=5?s("el-dropdown-item",{key:t.id},[s("el-tag",{staticStyle:{"margin-right":"10px","margin-top":"5px"},attrs:{closable:""},on:{close:function(s){return e.delHandle(t)}}},[e._v(e._s(t.pathNames))])],1):e._e()]}))],2)],1):e._e()],2),e._v(" "),e.refresh?s("div",{staticClass:"subcategory-tree-box"},[s("div",{staticClass:"subcategory-tree",staticStyle:{"max-height":"550px",overflow:"auto"}},[s("el-tree",{ref:"tree",attrs:{props:e.defaultProps,lazy:"","node-key":"id","show-checkbox":!0,load:e.onLazyTreeLoad,"expand-on-click-node":!1,"check-on-click-node":!0,"check-strictly":!0},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return s("span",{staticClass:"custom-tree-node"},[s("div",{staticClass:"tree-body-content"},[s("div",[e._v(e._s(a.label))]),e._v(" "),"strict"==e.tickStrategy&&a.lazy&&a.selectable?s("span",{on:{click:function(t){return t.stopPropagation(),e.expand(a.id,"force")}}},[e._v(e._s(e.$z("选择","c.choose")))]):e._e()])])}}],null,!1,3939466302)})],1),e._v(" "),s("div",{staticStyle:{display:"flex","flex-direction":"row-reverse"}},[s("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确认","c.confirm")))]),e._v(" "),s("el-button",{staticStyle:{"margin-right":"10px"},on:{click:function(t){return e.clear()}}},[e._v(e._s(e.$z("重置","c.reset")))])],1)]):e._e()]),e._v(" "),e.openLocate?s("room-map-select",{attrs:{field:e.field,drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas},on:{save:e.savePlan}}):e._e()],1)};g._withStripped=!0,i().use(r.Dialog);var y={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:p},inject:["selectOptions"],data(){return{curVal:[],label:zj.z("选择区域","c.select_area"),labels:[],labelObjs:[],keyword:"",opened:!1,debounceSearch:o().debounce(o().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[],treeItemMap:{},subareas:[],drawingMd5s:[],refresh:!0,selectedKeys:[],selectedItems:[],defaultProps:{children:"children",label:"label",isLeaf:"isLeaf"},selectList:[],allAreaMap:{}}},watch:{value(){this.curVal=this.value,this.selectedKeys=o().map(this.curVal,(e=>e.id)),console.log("this.selectedKeys",this.selectedKeys),this.loadRemoteLabel()},selectedKeys(e){e&&this.selected(e)},getSelectOptions(e){this.refresh=!1,this.selectList=e,setTimeout((()=>{this.refresh=!0}),500)}},computed:{tickStrategy(){return"leaf_only"==o().get(this.fieldConf,"can","all")?"leaf-filtered":"strict"},openLocate(){return o().get(this.fieldConf,"enable_locate")},points(){return o().get(this.value,"all_points",[])},canSelect(){return o().get(this.fieldConf,"can")},getSelectOptions(){return this.selectOptions()}},mounted(){this.curVal=this.value,this.loadRemoteLabel()},methods:{delAllItem(){this.clear(),this.$nextTick((()=>{this.onSubmit()}))},delHandle(e){console.log("del_item",e),this.selectedKeys=o().filter(this.selectedKeys,(t=>t!=e.id)),this.setCheckedNode(this.selectedKeys)},handleNodeClick(e){console.log("data",e)},setCheckedNode(e){let t=[];t=e||o().map(this.value,(e=>e.id)),console.log("this.curVal",this.curVal),console.log("_keys",t),this.$refs.tree&&this.$refs.tree.setCheckedKeys(t)},handleCheckChange(e,t,s){console.log("checked_data",e),t?this.selectedKeys.push(e.id):this.selectedKeys=o().filter(this.selectedKeys,(t=>t!=e.id)),console.log("this.selectedKeys",this.selectedKeys),console.log(e,t,s)},toOpen(){this.opened=!0},toClose(){this.opened=!1},reset(){this.selectedKeys=[]},onSubmit(){console.log("this.selectItems",this.selectedItems),this.$emit("input",this.selectedItems),this.toClose()},async onOpen(){this.opened=!0},clear(){this.selectedKeys=[],this.selectedItems=[],this.labels=[],this.labelObjs=[],this.curVal=[],this.setCheckedNode([])},onLazyTreeLoad(e,t){setTimeout((async()=>{let s=[];console.log("node——onLazyTreeLoad",e),0==e.level?(s=await this._loadNextCategoryList(""),this.setCheckedNode()):s=await this._loadNextCategoryList(e.data.id),this.setCategoryInMap(s),console.log("list",s),t(s)}),500)},async _loadNextCategoryList(e){let t=await this.loadList(e);return console.log("data_tree",t),this.transformResultToTree(t)},transformResultToTree(e){let t=this.canSelect;return this.loading=!1,o().map(e,(e=>{let s=!0;switch(console.log("canSelect",t),t){case"any":s=!0;break;case"leaf_only":s=!e.is_parent;break;case"building":s=2==e.type;break;case"floor":s=3==e.type;break;case"building_floor":s=2==e.type||3==e.type;break;case"suite":s=4==e.type||5==e.type;break;case"suite_ex":s=4==e.type||5==e.type||6==e.type}let a=o().join(e.path_names,"/"),l={id:e.id,lazy:e.is_parent,isLeaf:!e.is_parent,label:e.name,type:e.type,path_ids:e.path_ids,path_names:e.path_names,pathNames:`${a}${a?"/":""}${e.name}`,tickable:s,noTick:!s};return console.log("tran_data",l),"building_floor"==t&&3==e.type&&(l.lazy=!1,l.isLeaf=!0),o().set(this.treeItemMap,e.id,l),l}))},async loadList(e){let t=this.search_keyword,s=JSON.stringify({id:e,path_ids:o().get(this.treeItemMap,`${e}.path_ids`),type:o().get(this.treeItemMap,`${e}.type`)}),a=zj.pageParam({father:s,q:t});e||delete a.father,this.selectFields&&(a.fields=this.selectFields);let l=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container});return console.log("data",l),l},setCategoryInMap(e){o().each(e,(e=>{o().set(this.allAreaMap,e.value,e)}))},selected(e,t){this.selectedItems=[],console.log("keys",e),e&&e.length>0&&o().each(e,(e=>{e=o().toString(e);let t=o().get(this.treeItemMap,e,null);console.log("—item",t),t&&(this.label=t.label,t=o().cloneDeep(t),console.log("item",t),this.selectedItems.push({id:t.id,path_ids:t.path_ids,all_points:[],type:t.type}))})),console.log("this.selectedItems",this.selectedItems),this.curVal=o().cloneDeep(this.selectedItems),console.log("this.curVal",this.curVal),this.loadRemoteLabel()},expand(e,t){if(e=o().toString(e),!o().get(this.treeItemMap,e,null).lazy||t)this.selected(e,t);else{let t=this.$refs.tree.isExpanded(o().toInteger(e));this.$refs.tree.setExpanded(o().toInteger(e),!t)}},savePlan(e){this.curVal.all_points=o().cloneDeep(e),this.$emit("input",this.curVal.all_points),this.$emit("change",this.curVal.all_points)},async search(){let e=this.search_keyword;if(this.keyword=e,this.expandedKeys=[],!e)return;this.$bpm.setFuncGIO("区域搜索");let t=await this._loadNextCategoryList("");this.changeLazy(t),this.filterNodes=t},changeLazy(e){this.setCategoryInMap(e),o().each(e,(e=>{this.expandedKeys.push(e.value),e.lazy=!1,e.isLeaf=!0,e.expandable=!0,e.children&&this.changeLazy(e.children)}))},async loadRemoteLabel(){if(this.curVal)if(!o().isNil(this.curVal)&&this.curVal&&0!=this.curVal.length)try{let e=[];o().each(this.curVal,(t=>{e.push(JSON.stringify(t))})),this.loading=!0,console.log("list",e);let t=await this.$bpm.fetchLabelByValues(e,this.fieldConf.id,this.formName,this,"id");this.subareas=o().get(t,"subareas",[]),this.drawingMd5s=o().get(t,"drawing_md5s",[]),this.labels=[];let s=o().map(t,(e=>{let t=o().join(e.path_names,"/");return e.pathNames=`${t}${t?"/":""}${e.name}`,o().set(this.treeItemMap,e.id,e),e.pathNames}));this.labelObjs=o().cloneDeep(t),this.labels=o().cloneDeep(s),s=o().join(s,", "),this.label=s}finally{this.loading=!1}else this.label=zj.z("选择区域","c.select_area")},onHide(){this.opened=!1}}},b=(0,d.A)(y,g,[],!1,null,null,null);b.options.__file="components/lib/bpmArea/src/part/multi-editor.vue";var v=b.exports,C=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"area-reader"},[e.isMultiple?[e.openLocate?e._l(e.labelObjs,(function(t){return s("div",{key:t.id},[s("el-tag",{staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t.pathNames))]),e._v(" "),e.openLocate?s("room-map-select",{attrs:{drawingMd5s:t.drawingMd5s,defaultPoints:e.points,subareas:t.subareas}}):e._e()],1)})):e._l(e.labelObjs,(function(t){return s("el-tag",{key:t.id,staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t.pathNames))])}))]:[s("span",{attrs:{title:e.label}},[e._v(e._s(e.label)+" "),s("i",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"el-icon-loading",attrs:{size:"14px"}})]),e._v(" "),e.openLocate?s("room-map-select",{attrs:{drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas}}):e._e()]],2)};C._withStripped=!0;var w={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:p},data(){return{label:"",labelObjs:[],loading:!1,subareas:[],drawingMd5s:[],curVal:[]}},watch:{value(){this.curVal=this.value,this.isMultiple?this.loadRemoteLabels():this.loadRemoteLabel()}},computed:{openLocate(){return _.get(this.fieldConf,"enable_locate")},points(){return _.get(this.value,"all_points",[])}},mounted(){this.curVal=this.value,this.isMultiple?this.loadRemoteLabels():this.loadRemoteLabel()},methods:{async loadRemoteLabel(){console.log("this.value",this.value);let e=this.value[0];if(!_.isNil(e)&&e)try{this.loading=!0,e=_.cloneDeep(e),delete e.all_points,delete e.path_ids,delete e.type,e=JSON.stringify(e);let t=await this.$bpm.fetchLabelByValue(e,this.fieldConf.id,this.formName,this,"id",this.row);this.subareas=_.get(t,"subareas",[]),this.drawingMd5s=_.get(t,"drawing_md5s",[]);let s=_.join(t.path_names,"/");this.label=`${s}${s?"/":""}${t.name}`,this.loading=!1}finally{this.loading=!1}else this.label=zj.z("未选择","c.not_selected")},async loadRemoteLabels(){if(!_.isNil(this.curVal)&&this.curVal&&0!=this.curVal.length)try{let e=[];_.each(this.curVal,(t=>{e.push(JSON.stringify(t))})),this.loading=!0,console.log("list",e);let t=await this.$bpm.fetchLabelByValues(e,this.fieldConf.id,this.formName,this,"id");this.labels=[];let s=_.map(t,(e=>{let t=_.join(e.path_names,"/");return e.pathNames=`${t}${t?"/":""}${e.name}`,_.set(this.treeItemMap,e.id,e),e.pathNames}));this.labelObjs=_.cloneDeep(t),this.labels=_.cloneDeep(s),s=_.join(s,", "),this.label=s,console.log("this.labelObjs",this.labelObjs)}finally{this.loading=!1}}}},L=(0,d.A)(w,C,[],!1,null,null,null);L.options.__file="components/lib/bpmArea/src/part/reader.vue";var x=L.exports,$={name:"BpmArea",components:{editorComponent:m,multiEditorComponent:v,readerComponent:x},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?x:this.isMultiple?v:m}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},k=(0,d.A)($,e,[],!1,null,null,null);k.options.__file="components/lib/bpmArea/src/main.vue";var S=k.exports;S.install=function(e){e.component(S.name,S)};var M=S}(),l}()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],t):"object"==typeof exports?exports.bpm2=t(require("lodash")):e.bpm2=t(e.lodash)}(self,(function(e){return function(){var t={4486:function(e,t,s){"use strict";function a(e,t,s,a,l,i,n,o){var r,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=s,c._compiled=!0),a&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),n?(r=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),l&&l.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(n)},c._ssrRegister=r):l&&(r=o?function(){l.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:l),r)if(c.functional){c._injectStyles=r;var d=c.render;c.render=function(e,t){return r.call(t),d(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,r):[r]}return{exports:e,options:c}}s.d(t,{A:function(){return a}})},7642:function(e){e.exports=function(){return this.ELEMENT}()},5554:function(e){e.exports=function(){return this.Vue}()},6773:function(t){"use strict";t.exports=e}},s={};function a(e){var l=s[e];if(void 0!==l)return l.exports;var i=s[e]={exports:{}};return t[e](i,i.exports,a),i.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return function(){"use strict";a.r(l),a.d(l,{default:function(){return M}});var e=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._g(e._b({tag:"component",staticClass:"bpm-area",attrs:{fieldConf:e.fieldConf,row:e.row,isMultiple:e.isMultiple,mode:e.mode,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1),e.$listeners))};e._withStripped=!0;var t=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"select-area-editor"},[s("div",{on:{click:e.toOpen}},[e.label?s("div",[e._v("\n "+e._s(e.label)+"\n ")]):s("div",[s("el-button",{attrs:{size:"small",icon:"el-icon-location-outline"}},[e._v(" "+e._s(e.$z("选择区域","c.select_area")))])],1)]),e._v(" "),s("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),[s("div",[e._v("\n "+e._s(e.$z("当前选中","b2.common.selected"))+":\n "),s("el-tag",[e._v(e._s(e.label))])],1),e._v(" "),e.refresh?s("div",{staticClass:"subcategory-tree-box"},[s("div",{staticClass:"subcategory-tree",staticStyle:{"max-height":"550px",overflow:"auto"}},[s("el-tree",{ref:"tree",attrs:{props:e.defaultProps,lazy:"","show-checkbox":!1,load:e.onLazyTreeLoad,"expand-on-click-node":!0,"check-strictly":!0},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return s("span",{staticClass:"custom-tree-node"},[s("div",{staticClass:"tree-body-content"},[s("div",[e._v(e._s(a.label))]),e._v(" "),"strict"==e.tickStrategy&&a.lazy&&a.selectable?s("span",{on:{click:function(t){return t.stopPropagation(),e.expand(a.id,"force")}}},[e._v(e._s(e.$z("选择","c.choose")))]):e._e()])])}}],null,!1,3939466302)})],1)]):e._e()]),e._v(" "),e.openLocate?s("room-map-select",{attrs:{field:e.field,drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas},on:{save:e.savePlan}}):e._e()],1)};t._withStripped=!0;var s=a(5554),i=a.n(s),n=a(6773),o=a.n(n),r=a(7642),c=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",[e._v("\n slsls\n")])};c._withStripped=!0;var d=a(4486),h=(0,d.A)({},c,[],!1,null,null,null);h.options.__file="components/lib/bpmArea/src/part/room-map-select.vue";var p=h.exports;i().use(r.Dialog);var u={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:p},inject:["selectOptions"],data(){return{curVal:"",label:zj.z("选择区域","c.select_area"),keyword:"",opened:!1,debounceSearch:o().debounce(o().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"==o().get(this.fieldConf,"can","all")?"leaf-filtered":"strict"},openLocate(){return o().get(this.fieldConf,"enable_locate")},points(){return o().get(this.value,"all_points",[])},canSelect(){return o().get(this.fieldConf,"can")},getSelectOptions(){return this.selectOptions?this.selectOptions():[]}},mounted(){this.curVal=this.value,this.loadRemoteLabel()},methods:{handleNodeClick(e){this.selectedKey=o().get(e,"id","")},handleCheckChange(e,t,s){console.log(e,t,s)},toOpen(){this.opened=!0},toClose(){this.opened=!1},reset(){try{let e=this.value;this.selectedKey=o().get(e,"id","")}catch(e){this.selectedKey=""}},async onOpen(){if(o().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 s=[];console.log("node——onLazyTreeLoad",e),s=0==e.level?await this._loadNextCategoryList(""):await this._loadNextCategoryList(e.data.id),this.setCategoryInMap(s),console.log("list",s),t(s)}),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 o().map(e,(e=>{let s=e.drawing_md5s;s=o().compact(s);let a={id:e.id,lazy:e.is_parent,label:e.name,isLeaf:!e.is_parent,path_ids:e.path_ids,path_names:e.path_names,selectable:e.available,haspic:!!s.length,type:e.type};return"building_floor"==t&&3==e.type&&(a.lazy=!1),o().set(this.treeItemMap,e.id,a),a}))},async loadList(e){let t=this.search_keyword,s=JSON.stringify({id:e,path_ids:o().get(this.treeItemMap,`${e}.path_ids`),type:o().get(this.treeItemMap,`${e}.type`)}),a=zj.pageParam({father:s,q:t});e||delete a.father,this.selectFields&&(a.fields=this.selectFields);let l=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container});return console.log("data",l),l},setCategoryInMap(e){o().each(e,(e=>{o().set(this.allAreaMap,e.value,e)}))},selected(e,t){e=o().toString(e);let s=o().get(this.treeItemMap,e,null);s&&(s&&s.lazy&&!t||!e||!s.selectable||(this.label=s.label,s=o().cloneDeep(s),delete s.label,delete s.lazy,delete s.path_names,delete s.pathNames,delete s.selectable,delete s.haspic,delete s.children,this.value,this.$emit("input",[{id:s.id,path_ids:s.path_ids,all_points:[],type:s.type}]),this.loadRemoteLabel(),this.toClose()))},expand(e,t){if(e=o().toString(e),!o().get(this.treeItemMap,e,null).lazy||t)this.selected(e,t);else{let t=this.$refs.tree.isExpanded(o().toInteger(e));this.$refs.tree.setExpanded(o().toInteger(e),!t)}},savePlan(e){this.curVal.all_points=o().cloneDeep(e),this.$emit("input",this.curVal.all_points),this.$emit("change",this.curVal.all_points)},async search(){let e=this.search_keyword;if(this.keyword=e,this.expandedKeys=[],!e)return;this.$bpm.setFuncGIO("区域搜索");let t=await this._loadNextCategoryList("");this.changeLazy(t),this.filterNodes=t},changeLazy(e){this.setCategoryInMap(e),o().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(!o().isNil(e)&&e)try{this.loading=!0,e=o().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=o().get(t,"subareas",[]),this.drawingMd5s=o().get(t,"drawing_md5s",[]);let s=o().join(t.path_names,"/");this.label=`${s}${s?"/":""}${t.name}`}finally{this.loading=!1}else this.label=""},onHide(){this.opened=!1}}},f=(0,d.A)(u,t,[],!1,null,null,null);f.options.__file="components/lib/bpmArea/src/part/editor.vue";var m=f.exports,g=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"select-area-editor"},[s("div",{on:{click:function(t){return t.stopPropagation(),e.toOpen.apply(null,arguments)}}},[e.labels.length>0?s("div",[e._l(e.labels,(function(t){return s("el-tag",{key:t,staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t))])})),e._v(" "),s("i",{staticClass:"el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.delAllItem()}}})],2):s("div",[s("el-button",{attrs:{size:"small",icon:"el-icon-location-outline"}},[e._v(" "+e._s(e.$z("选择区域","c.select_area")))])],1)]),e._v(" "),s("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),[s("div",[e._v("\n "+e._s(e.$z("当前选中","b2.common.selected"))+":\n "),e._l(e.labelObjs,(function(t,a){return[a<5?s("el-tag",{key:t.id,staticStyle:{"margin-right":"10px","margin-top":"5px"},attrs:{closable:""},on:{close:function(s){return e.delHandle(t)}}},[e._v(e._s(t.pathNames))]):e._e()]})),e._v(" "),e.labelObjs.length>5?s("el-dropdown",[s("el-button",{attrs:{type:"primary"}},[e._v("\n "+e._s(e.$z("更多","c.more"))),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e._l(e.labelObjs,(function(t,a){return[a>=5?s("el-dropdown-item",{key:t.id},[s("el-tag",{staticStyle:{"margin-right":"10px","margin-top":"5px"},attrs:{closable:""},on:{close:function(s){return e.delHandle(t)}}},[e._v(e._s(t.pathNames))])],1):e._e()]}))],2)],1):e._e()],2),e._v(" "),e.refresh?s("div",{staticClass:"subcategory-tree-box"},[s("div",{staticClass:"subcategory-tree",staticStyle:{"max-height":"550px",overflow:"auto"}},[s("el-tree",{ref:"tree",attrs:{props:e.defaultProps,lazy:"","node-key":"id","show-checkbox":!0,load:e.onLazyTreeLoad,"expand-on-click-node":!1,"check-on-click-node":!0,"check-strictly":!0},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;return s("span",{staticClass:"custom-tree-node"},[s("div",{staticClass:"tree-body-content"},[s("div",[e._v(e._s(a.label))]),e._v(" "),"strict"==e.tickStrategy&&a.lazy&&a.selectable?s("span",{on:{click:function(t){return t.stopPropagation(),e.expand(a.id,"force")}}},[e._v(e._s(e.$z("选择","c.choose")))]):e._e()])])}}],null,!1,3939466302)})],1),e._v(" "),s("div",{staticStyle:{display:"flex","flex-direction":"row-reverse"}},[s("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v(e._s(e.$z("确认","c.confirm")))]),e._v(" "),s("el-button",{staticStyle:{"margin-right":"10px"},on:{click:function(t){return e.clear()}}},[e._v(e._s(e.$z("重置","c.reset")))])],1)]):e._e()]),e._v(" "),e.openLocate?s("room-map-select",{attrs:{field:e.field,drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas},on:{save:e.savePlan}}):e._e()],1)};g._withStripped=!0,i().use(r.Dialog);var y={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:p},inject:["selectOptions"],data(){return{curVal:[],label:zj.z("选择区域","c.select_area"),labels:[],labelObjs:[],keyword:"",opened:!1,debounceSearch:o().debounce(o().bind(this.search,this),150,{trailing:!0,leading:!1}),formList:[],treeItemMap:{},subareas:[],drawingMd5s:[],refresh:!0,selectedKeys:[],selectedItems:[],defaultProps:{children:"children",label:"label",isLeaf:"isLeaf"},selectList:[],allAreaMap:{}}},watch:{value(){this.curVal=this.value,this.selectedKeys=o().map(this.curVal,(e=>e.id)),console.log("this.selectedKeys",this.selectedKeys),this.loadRemoteLabel()},selectedKeys(e){e&&this.selected(e)},getSelectOptions(e){this.refresh=!1,this.selectList=e,setTimeout((()=>{this.refresh=!0}),500)}},computed:{tickStrategy(){return"leaf_only"==o().get(this.fieldConf,"can","all")?"leaf-filtered":"strict"},openLocate(){return o().get(this.fieldConf,"enable_locate")},points(){return o().get(this.value,"all_points",[])},canSelect(){return o().get(this.fieldConf,"can")},getSelectOptions(){return this.selectOptions?this.selectOptions():[]}},mounted(){this.curVal=this.value,this.loadRemoteLabel()},methods:{delAllItem(){this.clear(),this.$nextTick((()=>{this.onSubmit()}))},delHandle(e){console.log("del_item",e),this.selectedKeys=o().filter(this.selectedKeys,(t=>t!=e.id)),this.setCheckedNode(this.selectedKeys)},handleNodeClick(e){console.log("data",e)},setCheckedNode(e){let t=[];t=e||o().map(this.value,(e=>e.id)),console.log("this.curVal",this.curVal),console.log("_keys",t),this.$refs.tree&&this.$refs.tree.setCheckedKeys(t)},handleCheckChange(e,t,s){console.log("checked_data",e),t?this.selectedKeys.push(e.id):this.selectedKeys=o().filter(this.selectedKeys,(t=>t!=e.id)),console.log("this.selectedKeys",this.selectedKeys),console.log(e,t,s)},toOpen(){this.opened=!0},toClose(){this.opened=!1},reset(){this.selectedKeys=[]},onSubmit(){console.log("this.selectItems",this.selectedItems),this.$emit("input",this.selectedItems),this.toClose()},async onOpen(){this.opened=!0},clear(){this.selectedKeys=[],this.selectedItems=[],this.labels=[],this.labelObjs=[],this.curVal=[],this.setCheckedNode([])},onLazyTreeLoad(e,t){setTimeout((async()=>{let s=[];console.log("node——onLazyTreeLoad",e),0==e.level?(s=await this._loadNextCategoryList(""),this.setCheckedNode()):s=await this._loadNextCategoryList(e.data.id),this.setCategoryInMap(s),console.log("list",s),t(s)}),500)},async _loadNextCategoryList(e){let t=await this.loadList(e);return console.log("data_tree",t),this.transformResultToTree(t)},transformResultToTree(e){let t=this.canSelect;return this.loading=!1,o().map(e,(e=>{let s=!0;switch(console.log("canSelect",t),t){case"any":s=!0;break;case"leaf_only":s=!e.is_parent;break;case"building":s=2==e.type;break;case"floor":s=3==e.type;break;case"building_floor":s=2==e.type||3==e.type;break;case"suite":s=4==e.type||5==e.type;break;case"suite_ex":s=4==e.type||5==e.type||6==e.type}let a=o().join(e.path_names,"/"),l={id:e.id,lazy:e.is_parent,isLeaf:!e.is_parent,label:e.name,type:e.type,path_ids:e.path_ids,path_names:e.path_names,pathNames:`${a}${a?"/":""}${e.name}`,tickable:s,noTick:!s};return console.log("tran_data",l),"building_floor"==t&&3==e.type&&(l.lazy=!1,l.isLeaf=!0),o().set(this.treeItemMap,e.id,l),l}))},async loadList(e){let t=this.search_keyword,s=JSON.stringify({id:e,path_ids:o().get(this.treeItemMap,`${e}.path_ids`),type:o().get(this.treeItemMap,`${e}.type`)}),a=zj.pageParam({father:s,q:t});e||delete a.father,this.selectFields&&(a.fields=this.selectFields);let l=await this.$bpm.loadSelectLinkageResult({fieldId:this.fieldConf.id,params:a,cusFormName:this.formName,field:this,container:this.container});return console.log("data",l),l},setCategoryInMap(e){o().each(e,(e=>{o().set(this.allAreaMap,e.value,e)}))},selected(e,t){this.selectedItems=[],console.log("keys",e),e&&e.length>0&&o().each(e,(e=>{e=o().toString(e);let t=o().get(this.treeItemMap,e,null);console.log("—item",t),t&&(this.label=t.label,t=o().cloneDeep(t),console.log("item",t),this.selectedItems.push({id:t.id,path_ids:t.path_ids,all_points:[],type:t.type}))})),console.log("this.selectedItems",this.selectedItems),this.curVal=o().cloneDeep(this.selectedItems),console.log("this.curVal",this.curVal),this.loadRemoteLabel()},expand(e,t){if(e=o().toString(e),!o().get(this.treeItemMap,e,null).lazy||t)this.selected(e,t);else{let t=this.$refs.tree.isExpanded(o().toInteger(e));this.$refs.tree.setExpanded(o().toInteger(e),!t)}},savePlan(e){this.curVal.all_points=o().cloneDeep(e),this.$emit("input",this.curVal.all_points),this.$emit("change",this.curVal.all_points)},async search(){let e=this.search_keyword;if(this.keyword=e,this.expandedKeys=[],!e)return;this.$bpm.setFuncGIO("区域搜索");let t=await this._loadNextCategoryList("");this.changeLazy(t),this.filterNodes=t},changeLazy(e){this.setCategoryInMap(e),o().each(e,(e=>{this.expandedKeys.push(e.value),e.lazy=!1,e.isLeaf=!0,e.expandable=!0,e.children&&this.changeLazy(e.children)}))},async loadRemoteLabel(){if(this.curVal)if(!o().isNil(this.curVal)&&this.curVal&&0!=this.curVal.length)try{let e=[];o().each(this.curVal,(t=>{e.push(JSON.stringify(t))})),this.loading=!0,console.log("list",e);let t=await this.$bpm.fetchLabelByValues(e,this.fieldConf.id,this.formName,this,"id");this.subareas=o().get(t,"subareas",[]),this.drawingMd5s=o().get(t,"drawing_md5s",[]),this.labels=[];let s=o().map(t,(e=>{let t=o().join(e.path_names,"/");return e.pathNames=`${t}${t?"/":""}${e.name}`,o().set(this.treeItemMap,e.id,e),e.pathNames}));this.labelObjs=o().cloneDeep(t),this.labels=o().cloneDeep(s),s=o().join(s,", "),this.label=s}finally{this.loading=!1}else this.label=zj.z("选择区域","c.select_area")},onHide(){this.opened=!1}}},b=(0,d.A)(y,g,[],!1,null,null,null);b.options.__file="components/lib/bpmArea/src/part/multi-editor.vue";var v=b.exports,C=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"area-reader"},[e.isMultiple?[e.openLocate?e._l(e.labelObjs,(function(t){return s("div",{key:t.id},[s("el-tag",{staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t.pathNames))]),e._v(" "),e.openLocate?s("room-map-select",{attrs:{drawingMd5s:t.drawingMd5s,defaultPoints:e.points,subareas:t.subareas}}):e._e()],1)})):e._l(e.labelObjs,(function(t){return s("el-tag",{key:t.id,staticStyle:{"margin-right":"10px","margin-top":"5px"}},[e._v(e._s(t.pathNames))])}))]:[s("span",{attrs:{title:e.label}},[e._v(e._s(e.label)+" "),s("i",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"el-icon-loading",attrs:{size:"14px"}})]),e._v(" "),e.openLocate?s("room-map-select",{attrs:{drawingMd5s:e.drawingMd5s,defaultPoints:e.points,subareas:e.subareas}}):e._e()]],2)};C._withStripped=!0;var w={props:["value","fieldConf","row","formName","orgInfo","isMultiple"],components:{RoomMapSelect:p},data(){return{label:"",labelObjs:[],loading:!1,subareas:[],drawingMd5s:[],curVal:[]}},watch:{value(){this.curVal=this.value,this.isMultiple?this.loadRemoteLabels():this.loadRemoteLabel()}},computed:{openLocate(){return _.get(this.fieldConf,"enable_locate")},points(){return _.get(this.value,"all_points",[])}},mounted(){this.curVal=this.value,this.isMultiple?this.loadRemoteLabels():this.loadRemoteLabel()},methods:{async loadRemoteLabel(){console.log("this.value",this.value);let e=this.value[0];if(!_.isNil(e)&&e)try{this.loading=!0,e=_.cloneDeep(e),delete e.all_points,delete e.path_ids,delete e.type,e=JSON.stringify(e);let t=await this.$bpm.fetchLabelByValue(e,this.fieldConf.id,this.formName,this,"id",this.row);this.subareas=_.get(t,"subareas",[]),this.drawingMd5s=_.get(t,"drawing_md5s",[]);let s=_.join(t.path_names,"/");this.label=`${s}${s?"/":""}${t.name}`,this.loading=!1}finally{this.loading=!1}else this.label=zj.z("未选择","c.not_selected")},async loadRemoteLabels(){if(!_.isNil(this.curVal)&&this.curVal&&0!=this.curVal.length)try{let e=[];_.each(this.curVal,(t=>{e.push(JSON.stringify(t))})),this.loading=!0,console.log("list",e);let t=await this.$bpm.fetchLabelByValues(e,this.fieldConf.id,this.formName,this,"id");this.labels=[];let s=_.map(t,(e=>{let t=_.join(e.path_names,"/");return e.pathNames=`${t}${t?"/":""}${e.name}`,_.set(this.treeItemMap,e.id,e),e.pathNames}));this.labelObjs=_.cloneDeep(t),this.labels=_.cloneDeep(s),s=_.join(s,", "),this.label=s,console.log("this.labelObjs",this.labelObjs)}finally{this.loading=!1}}}},L=(0,d.A)(w,C,[],!1,null,null,null);L.options.__file="components/lib/bpmArea/src/part/reader.vue";var x=L.exports,$={name:"BpmArea",components:{editorComponent:m,multiEditorComponent:v,readerComponent:x},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?x:this.isMultiple?v:m}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},k=(0,d.A)($,e,[],!1,null,null,null);k.options.__file="components/lib/bpmArea/src/main.vue";var S=k.exports;S.install=function(e){e.component(S.name,S)};var M=S}(),l}()}));
|