@zhijiancloud/bpm 1.0.99 → 1.2.0
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 +3 -3
- package/dist/bpmFormField.umd.js +3 -3
- package/dist/bpmOcr.umd.js +1 -1
- package/dist/bpmQuote.umd.js +1 -1
- package/dist/bpmSelectUser.umd.js +1 -1
- package/dist/bpmSubForm.umd.js +1 -1
- package/dist/bpmSubFormField.umd.js +3 -3
- package/dist/bpmVideo.umd.js +1 -1
- package/dist/css/bpmTime.css +1 -0
- package/dist/css/index.css +1 -1
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/bpmQuote.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(){"use strict";var t={7520:function(e,t,a){a.d(t,{Q:function(){return o}});let n=[{key:"lt",name:"早于"},{key:"gt",name:"晚于"},{key:"gte",name:"不早于"},{key:"lte",name:"不晚于"}],l=[{key:"in",name:"在列表中"}],i=[{key:"in",name:"在列表中"},{key:"all",name:"包含所有"}];const o={Text:{name:"单行文本",hasBpmField:!0,tableColWidth:240,actions:[{key:"contains",name:"包含"},{key:"eq",name:"等于"}],attrs:["type","value_type","id","name","linkage"]},TextArea:{name:"多行文本",hasBpmField:!0,tableColWidth:300,actions:[{key:"contains",name:"包含"},{key:"eq",name:"等于"}],attrs:["type","value_type","id","name","linkage"]},SerialNumber:{name:"流水号",hasBpmField:!0,actions:[{key:"contains",name:"包含"}],options:{type:"Text"},attrs:["type","id","name","linkage"]},Number:{name:"数字",hasBpmField:!0,tableColWidth:200,actions:[{key:"eq",name:"等于"},{key:"gt",name:"大于"},{key:"gte",name:"大于等于"},{key:"lt",name:"小于"},{key:"lte",name:"小于等于"},{key:"ne",name:"不等于"}],attrs:["type","id","name","value_type","is_int","view.precision","linkage"]},DateTime:{name:"日期时间选择器",tableColWidth:240,hasBpmField:!0,actions:n,attrs:["type","id","name","check.format","view.format","linkage"]},Date:{name:"日期选择器",tableColWidth:240,hasBpmField:!0,actions:n,attrs:["type","id","name","check.format","view.format","linkage"]},Time:{name:"时间选择器",hasBpmField:!0,tableColWidth:240,actions:n,attrs:["type","id","name","check.format","view.format","linkage"]},Timestamp:{name:"※时间戳",tableColWidth:240,actions:n,attrs:["type","id","name","check.format","view.format","linkage"]},Select:{name:"单选",hasBpmField:!0,tableColWidth:220,actions:l,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},Status:{name:"状态",hasBpmField:!0,tableColWidth:150,actions:l,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},MulSelect:{name:"多选",hasBpmField:!0,tableColWidth:220,actions:i,attrs:["type","id","name","value_type","result_type","style","range_enum","linkage"]},SelectFromForm:{name:"远程单项选择",hasBpmField:!0,tableColWidth:200,actions:l,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:i,attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},SelectFromMulForm:{name:"关联组件",hasBpmField:!0,tableColWidth:200,actions:i,attrs:["type","id","name","range_remote","value_type"]},SelectProject:{name:"项目单项选择",hasBpmField:!0,tableColWidth:200,actions:l,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:i,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:l,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:i,options:{type:"MulSelectUser"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectURUser:{name:"用户单项选择(新)",hasBpmField:!0,tableColWidth:400,actions:l,options:{type:"MulSelectURUser"},attrs:["type","id","name","range_remote","value_type","filters","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectURUser:{name:"用户多项选择(新)",hasBpmField:!0,tableColWidth:400,actions:i,options:{type:"MulSelectURUser"},attrs:["type","id","name","range_remote","value_type","filters","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectRootCategory:{name:"根任务类型选择",hasBpmField:!0,tableColWidth:200,actions:[{key:"eq",name:"等于"}],attrs:["type","id","name","category_cls","value_type","linkage"]},SelectCheckItem:{name:"检查项单项选择",hasBpmField:!0,actions:l,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:i,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:l,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:i,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:l,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:l,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:l,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:i,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,"未通过"]]}},MulAudit:{name:"多人审批",hasBpmField:!0,actions:[{key:"ar_eq",name:"审批结果等于"},{key:"ar_in",name:"审批结果在列表中"}],actionOptions:[{value:0,label:"未审批"},{value:1,label:"审批通过"},{value:2,label:"审批未通过"}],attrs:["type","id","name","linkage"],options:{result_type:"Array",value_type:"int",type:"MulSelect",style:"default",range_enum:[[0,"未审批"],[1,"通过"],[2,"未通过"]]}},MulArea:{name:"区域多项选择",hasBpmField:!0,tableColWidth:260,actions:i,attrs:["type","id","name","value_type","can","linkage"]},Area:{name:"区域单项选择",hasBpmField:!0,tableColWidth:260,actions:l,options:{type:"MulArea"},attrs:["type","id","name","value_type","can","linkage"]},SelectFormId:{name:"表单单项选择",hasBpmField:!0,tableColWidth:200,actions:l,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},MulSelectFormId:{name:"表单多项选择",hasBpmField:!0,tableColWidth:200,actions:l,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},SelectFromField:{name:"远程单选(从字段)",hasBpmField:!0,tableColWidth:200,actions:l,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:l,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:!0},Order:{name:"排序控件",hasBpmField:!1},SubForm:{name:"子表单",hasBpmField:!0},XSubForm:{name:"子表单(增强版)",hasBpmField:!0},TreeSubForm:{name:"树子表单",hasBpmField:!0},GroupSubForm:{name:"分组子表单",hasBpmField:!0},OrderSubForm:{name:"排序子表单",hasBpmField:!0},AreaElevation:{name:"区域快速选择器",hasBpmField:!0,tableColWidth:200},RichText:{name:"富文本编辑框",hasBpmField:!0,tableColWidth:100},Appointment:{name:"时段预约",hasBpmField:!0,tableColWidth:120},Rating:{name:"评分",hasBpmField:!0,tableColWidth:250},MapLocation:{name:"地图位置",hasBpmField:!0,tableColWidth:250},ExternalFormLink:{name:"外链表单组件",hasBpmField:!0,tableColWidth:200,actions:i,attrs:["type","id","name","range_remote","value_type"]}}},4747:function(e,t,a){var n=a(1601),l=a.n(n),i=a(6314);a.n(i)()(l()).push([e.id,".bpm-quote-form-list {\n width: 100%;\n}\n.bpm-quote-title-link {\n cursor: pointer;\n color: #409eff;\n}\n.bpm-quote-empty {\n padding: 16px 0;\n color: #909399;\n text-align: center;\n}\n.bpm-quote-table {\n width: 100%;\n}\n.bpm-quote-table .el-table__cell.bpm-td {\n padding: 0;\n}\n.bpm-quote-table .el-table__cell.bpm-td > .cell {\n padding: 0 10px;\n overflow: auto;\n}\n",""])},6314:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var a="",n=void 0!==t[5];return t[4]&&(a+="@supports (".concat(t[4],") {")),t[2]&&(a+="@media ".concat(t[2]," {")),n&&(a+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),a+=e(t),n&&(a+="}"),t[2]&&(a+="}"),t[4]&&(a+="}"),a}).join("")},t.i=function(e,a,n,l,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(n)for(var r=0;r<this.length;r++){var s=this[r][0];null!=s&&(o[s]=!0)}for(var m=0;m<e.length;m++){var p=[].concat(e[m]);n&&o[p[0]]||(void 0!==i&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=i),a&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=a):p[2]=a),l&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=l):p[4]="".concat(l)),t.push(p))}},t}},1601:function(e){e.exports=function(e){return e[1]}},4486:function(e,t,a){function n(e,t,a,n,l,i,o,r){var s,m="function"==typeof e?e.options:e;if(t&&(m.render=t,m.staticRenderFns=a,m._compiled=!0),n&&(m.functional=!0),i&&(m._scopeId="data-v-"+i),o?(s=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(o)},m._ssrRegister=s):l&&(s=r?function(){l.call(this,(m.functional?this.parent:this).$root.$options.shadowRoot)}:l),s)if(m.functional){m._injectStyles=s;var p=m.render;m.render=function(e,t){return s.call(t),p(e,t)}}else{var d=m.beforeCreate;m.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:m}}a.d(t,{A:function(){return n}})},6773:function(t){t.exports=e}},a={};function n(e){var l=a[e];if(void 0!==l)return l.exports;var i=a[e]={id:e,exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};n.r(l),n.d(l,{default:function(){return k}});var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._b({tag:"component",staticClass:"bpm-quote",attrs:{fieldConf:e.fieldConf,row:e.row,isMultiple:e.isMultiple,mode:e.mode,formName:e.formName,container:e.container,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1))};i._withStripped=!0;var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"bpm-quote-edit"},[a("form-list",{attrs:{"quote-content":e.quoteContent,"form-name":e.formName,container:e.container,"link-open-type":e.linkOpenType,"detail-dialog-width":e.detailDialogWidth}})],1)};o._withStripped=!0;var r=n(6773),s=n.n(r),m=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"bpm-quote-form-list"},[e.tableData.length?a("el-table",{staticClass:"bpm-quote-table",attrs:{data:e.tableData,border:"",size:"small","header-cell-class-name":"bpm-th","cell-class-name":"bpm-td","span-method":e.rowspanMethod}},[a("el-table-column",{attrs:{label:e.$z("标题","c.title"),"min-width":"220",fixed:"left"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"bpm-quote-title-link",on:{click:function(a){return e.openFormDetailPage(t.row)}}},[a("i",{staticClass:"el-icon-tickets",staticStyle:{"margin-right":"5px"}}),e._v(" "),a("span",[e._v(e._s(t.row.title))])])]}}],null,!1,3830925498)}),e._v(" "),e._l(e.columns,function(t){return[t.isSubForm?a("el-table-column",{key:t.key+"-subform",attrs:{prop:t.key,label:t.label,"min-width":t.minWidth}},[t.fieldConf.show_index?a("el-table-column",{attrs:{prop:"subfield__index",label:t.fieldConf.index_label||e.$z("序号","b2.common.subform_index"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(n){return[e.getSubformRow(n.row,t.key)?a("div",[e._v("\n "+e._s(n.row.i+1)+"\n ")]):e._e()]}}],null,!0)}):e._e(),e._v(" "),e._l(t.subColumns,function(n){return a("el-table-column",{key:n.id,attrs:{prop:"subfield__"+n.id,label:n.name,"min-width":e.getColumnWidth(n),"class-name":"subform-cell","label-class-name":"subform-header-cell"},scopedSlots:e._u([{key:"default",fn:function(l){return[e.getSubformRow(l.row,t.key)?a("bpm-field",{attrs:{type:n.type,"field-conf":n,value:e.getSubformRow(l.row,t.key)[n.id],row:l.row,"form-name":e.formDef.id||e.formName,mode:"view","ui-type":"table",container:e.container}}):e._e()]}}],null,!0)})})],2):a("el-table-column",{key:t.key+"-field",attrs:{prop:"f_fields."+t.key,label:t.label,"min-width":t.minWidth},scopedSlots:e._u([{key:"default",fn:function(n){return[["Select","Status","SelectProject","SelectUser","SelectFromForm"].includes(t.fieldConf.type)?a("span",[e._v("\n "+e._s(n.row.f_fields&&n.row.f_fields[t.key])+"\n ")]):a("bpm-field",{attrs:{type:t.fieldConf.type,"field-conf":t.fieldConf,value:n.row.f_fields&&n.row.f_fields[t.key],row:n.row,"form-name":e.formDef.id||e.formName,mode:"view","ui-type":"table",container:e.container}})]}}],null,!0)})]})],2):a("div",{staticClass:"bpm-quote-empty"},[e._v("\n "+e._s(e.$z("暂无数据","c.no_data"))+"\n ")]),e._v(" "),a("el-dialog",{attrs:{"append-to-body":!0,visible:e.formDetailDialog.visible,"close-on-click-modal":!1,title:e.formDetailDialog.title,width:e.detailDialogWidth,top:"5vh"},on:{"update:visible":function(t){return e.$set(e.formDetailDialog,"visible",t)}}},[e.formDetailDialog.visible?a("iframe",{staticClass:"detail-form-iframe",attrs:{src:e.formDetailDialog.iframe_url,frameborder:"0",width:"100%",height:e.iframeHeight+"px"}}):e._e()])],1)};m._withStripped=!0;var p=n(7520),d={name:"BpmQuoteFormList",props:{quoteContent:{type:Object,default(){return{}}},formName:{type:String,default:""},container:{type:Object,default(){return{}}},linkOpenType:{type:String,default:"dialog"},detailDialogWidth:{type:String,default:"80%"}},data(){return{formDetailDialog:{visible:!1,title:"",iframe_url:""},iframeHeight:850}},computed:{formDef(){return s().get(this.quoteContent,"definition.form",{})},elements(){return s().get(this.formDef,"elements",[])},columns(){return s().chain(this.elements).filter(e=>s().get(e,"perm.visible",!0)).filter(e=>e.type&&-1!==e.type.indexOf("SubForm")||s().get(p.Q,[e.type,"hasBpmField"],!0)).map(e=>{const t=e.type&&-1!==e.type.indexOf("SubForm"),a=t?s().filter(s().get(e,"elements",[]),e=>s().get(e,"perm.visible",!0)&&s().get(p.Q,[e.type,"hasBpmField"],!0)):[];return{key:e.id,label:e.name,fieldConf:e,isSubForm:t,subColumns:a,minWidth:t?this.getSubformColWidth(a):this.getColumnWidth(e)}}).value()},subFormKeys(){return s().chain(this.columns).filter({isSubForm:!0}).map("key").value()},tableData(){return this.getFlatTableData(s().get(this.quoteContent,"data",[]),this.subFormKeys)}},created(){let e=.85*window.innerHeight-84;this.iframeHeight=e},methods:{openFormDetailPage(e){if(zj.pageParam().hidden_form_title)return!1;const t=this.formDef.id;if(!t)return!1;let a=this.formDef.type;a="ProcessForm"===a?"processform":"DataForm"===a?"dataform":s().toLower(a||"");const n=zj.pageParam().project_id,l=zj.pageParam().page_level||"project";let i=`/public/bpm3/app/table.html?form_name=${t}&form_type=${a}&form_id=${e.form_id}&project_id=${n}&page_level=${l}#/detail`;"dialog"===this.linkOpenType?(i=`/public/bpm3/app/table.html?is_mirco_app=1&form_name=${t}&form_type=${a}&form_id=${e.form_id}&project_id=${n}&hidden_form_title=1&page_level=${l}#/detail`,this.formDetailDialog.iframe_url=i,this.formDetailDialog.visible=!0,this.formDetailDialog.title=e.title):window.open(i,"_blank")},getColumnWidth(e){return s().get(e,"display.column_width")||s().get(p.Q,[e.type,"tableColWidth"])||120},getSubformColWidth(e){return s().sumBy(e,e=>Number(this.getColumnWidth(e))||120)||120},getSubformRow(e,t){return s().get(e,["f_fields",t,e.i],null)},getFlatTableData(e,t){if(!t||!t.length)return s().cloneDeep(e);const a=[];return s().each(e,e=>{const n=s().cloneDeep(e);s().each(t,e=>{const t=s().get(n,["f_fields",e],[]);s().isArray(t)&&s().set(n,["f_fields",e],s().filter(t,e=>!s().get(e,"_meta.is_deleted",!1)))});const l=s().max(s().map(t,e=>s().get(n,["f_fields",e],[]).length))||0;if(0!==l)for(let e=0;e<l;e++)a.push({...n,hasRowspan:!0,rowspan:0===e?l:0,colspan:0===e?1:0,i:e});else a.push(n)}),a},rowspanMethod({row:e,column:t}){if(e.hasRowspan&&t&&t.property&&0!==t.property.indexOf("subfield__"))return{rowspan:e.rowspan,colspan:e.colspan}}}},u=(n(4747),n(4486)),c=(0,u.A)(d,m,[],!1,null,null,null);c.options.__file="components/lib/bpmQuote/src/part/form-list.vue";var f={components:{FormList:c.exports},props:{value:{},fieldConf:{},row:{},formName:{},container:{},isMultiple:{type:Boolean,default(){return!1}},readonly:{type:Boolean,default(){return!1}}},data(){return{quoteContent:{},elements:[],tabIndex:0,list:[],elementsList:[],isQuote:!0,curVal:null,initTimer:null}},watch:{quoteContent(e){e&&(this.$bpm.quoteContentMap||(this.$bpm.quoteContentMap={}),this.$bpm.quoteContentMap[this.fieldConf.id]=s().cloneDeep(this.quoteContent))},value(e){"loadData"==e?this.loadQuoteData():this.onFieldValueChange()}},computed:{linkOpenType(){return s().get(this.fieldConf,"style.link_open_type","dialog")},detailDialogWidth(){return this.getDetailDialogWidth()}},created(){this.curVal=this.isMultiple?[]:null},mounted(){this.initTimer=setTimeout(async()=>{this.loadQuoteData()},500)},methods:{getDetailDialogWidth(){const e=s().get(this.fieldConf,"style.dialog_width");return e?s().isNumber(e)?`${e}%`:String(e):"80%"},async loadQuoteData(){let e=s().get(this.fieldConf,"scope",null);console.log("loadQuoteData_scope",e);let t=null;if(!s().isEmpty(e)&&e){let a=e.depends;s().each(a,e=>{t||(t={}),this.container&&this.container.formData&&this.container.formData[e]&&(t[e]=this.container.formData[e])})}let a=this.fieldConf.id,n=await this.$bpm.searchSelectOpts(a,"",this.formName,null,!1,t?{fields:JSON.stringify(t)}:{},!0);this.quoteContent=n,console.log("bpmQuote quoteContent: ",this.quoteContent),this.curVal=s().map(n.data,"form_id"),this.$emit("input",this.curVal),this.$emit("change",this.curVal)},onDataLoaded(){this.onFieldValueChange()},onFieldValueChange(){},async loadRemoteLabel(){let e=this.curVal;if("loadData"!=e)if(s().isEmpty(e))this.quoteContent={data:[],definition:{}};else try{this.loading=!0;let t=await this.$bpm.loadQuteTitle(e,this.fieldConf.id,this.formName,this.row);this.quoteContent=t}finally{this.loading=!1}}},beforeDestroy(){this.$bpm&&this.$bpm.quoteContentMap&&delete this.$bpm.quoteContentMap[this.fieldKey]}},_=(0,u.A)(f,o,[],!1,null,null,null);_.options.__file="components/lib/bpmQuote/src/part/editor.vue";var h=_.exports,g=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"bpm-quote-reader"},[a("editor-component",e._b({attrs:{value:e.value,"field-conf":e.fieldConf,row:e.row,"form-name":e.formName,container:e.container,"is-multiple":e.isMultiple,readonly:!0},on:{input:function(t){return e.$emit("input",t)},change:function(t){return e.$emit("change",t)}}},"editor-component",e.$attrs,!1))],1)};g._withStripped=!0;var y={components:{EditorComponent:h},props:{value:{},fieldConf:{},row:{},formName:{},container:{},isMultiple:{type:Boolean,default(){return!1}}}},b=(0,u.A)(y,g,[],!1,null,null,null);b.options.__file="components/lib/bpmQuote/src/part/reader.vue";var v=b.exports,C={name:"BpmQuote",components:{editorComponent:h,readerComponent:v},props:{value:{type:[String,Array,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"}},isMultiple:{type:Boolean,default(){return!1}},formName:{type:String}},data(){return{curVal:null}},computed:{curComponent(){return"view"==this.mode?v:h}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},F=(0,u.A)(C,i,[],!1,null,null,null);F.options.__file="components/lib/bpmQuote/src/main.vue";var S=F.exports;S.install=function(e){e.component(S.name,S)};var k=S;return 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(){"use strict";var t={7520:function(e,t,a){a.d(t,{Q:function(){return o}});let n=[{key:"lt",name:"早于"},{key:"gt",name:"晚于"},{key:"gte",name:"不早于"},{key:"lte",name:"不晚于"}],l=[{key:"in",name:"在列表中"}],i=[{key:"in",name:"在列表中"},{key:"all",name:"包含所有"}];const o={Text:{name:"单行文本",hasBpmField:!0,tableColWidth:240,actions:[{key:"contains",name:"包含"},{key:"eq",name:"等于"}],attrs:["type","value_type","id","name","linkage"]},TextArea:{name:"多行文本",hasBpmField:!0,tableColWidth:300,actions:[{key:"contains",name:"包含"},{key:"eq",name:"等于"}],attrs:["type","value_type","id","name","linkage"]},SerialNumber:{name:"流水号",hasBpmField:!0,actions:[{key:"contains",name:"包含"}],options:{type:"Text"},attrs:["type","id","name","linkage"]},Number:{name:"数字",hasBpmField:!0,tableColWidth:200,actions:[{key:"eq",name:"等于"},{key:"gt",name:"大于"},{key:"gte",name:"大于等于"},{key:"lt",name:"小于"},{key:"lte",name:"小于等于"},{key:"ne",name:"不等于"}],attrs:["type","id","name","value_type","is_int","view.precision","linkage"]},DateTime:{name:"日期时间选择器",tableColWidth:240,hasBpmField:!0,actions:n,attrs:["type","id","name","check.format","view.format","linkage"]},Date:{name:"日期选择器",tableColWidth:240,hasBpmField:!0,actions:n,attrs:["type","id","name","check.format","view.format","linkage"]},Time:{name:"时间选择器",hasBpmField:!0,tableColWidth:240,actions:n,attrs:["type","id","name","check.format","view.format","linkage"]},Timestamp:{name:"※时间戳",tableColWidth:240,actions:n,attrs:["type","id","name","check.format","view.format","linkage"]},Select:{name:"单选",hasBpmField:!0,tableColWidth:220,actions:l,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},Status:{name:"状态",hasBpmField:!0,tableColWidth:150,actions:l,options:{type:"MulSelect"},attrs:["type","id","name","value_type","style","range_enum","linkage"]},MulSelect:{name:"多选",hasBpmField:!0,tableColWidth:220,actions:i,attrs:["type","id","name","value_type","result_type","style","range_enum","linkage"]},SelectFromForm:{name:"远程单项选择",hasBpmField:!0,tableColWidth:200,actions:l,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:i,attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.form","range_remote.depends","linkage"]},SelectFromMulForm:{name:"关联组件",hasBpmField:!0,tableColWidth:200,actions:i,attrs:["type","id","name","range_remote","value_type"]},SelectProject:{name:"项目单项选择",hasBpmField:!0,tableColWidth:200,actions:l,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:i,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:l,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:i,options:{type:"MulSelectUser"},attrs:["type","id","name","range_remote","value_type","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectURUser:{name:"用户单项选择(新)",hasBpmField:!0,tableColWidth:400,actions:l,options:{type:"MulSelectURUser"},attrs:["type","id","name","range_remote","value_type","filters","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},MulSelectURUser:{name:"用户多项选择(新)",hasBpmField:!0,tableColWidth:400,actions:i,options:{type:"MulSelectURUser"},attrs:["type","id","name","range_remote","value_type","filters","range_remote.filter_expression","range_remote.store_field","range_remote.display_field","range_remote.depends","linkage"]},SelectRootCategory:{name:"根任务类型选择",hasBpmField:!0,tableColWidth:200,actions:[{key:"eq",name:"等于"}],attrs:["type","id","name","category_cls","value_type","linkage"]},SelectCheckItem:{name:"检查项单项选择",hasBpmField:!0,actions:l,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:i,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:l,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:i,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:l,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:l,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:l,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:i,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,"未通过"]]}},MulAudit:{name:"多人审批",hasBpmField:!0,actions:[{key:"ar_eq",name:"审批结果等于"},{key:"ar_in",name:"审批结果在列表中"}],actionOptions:[{value:0,label:"未审批"},{value:1,label:"审批通过"},{value:2,label:"审批未通过"}],attrs:["type","id","name","linkage"],options:{result_type:"Array",value_type:"int",type:"MulSelect",style:"default",range_enum:[[0,"未审批"],[1,"通过"],[2,"未通过"]]}},MulArea:{name:"区域多项选择",hasBpmField:!0,tableColWidth:260,actions:i,attrs:["type","id","name","value_type","can","linkage"]},Area:{name:"区域单项选择",hasBpmField:!0,tableColWidth:260,actions:l,options:{type:"MulArea"},attrs:["type","id","name","value_type","can","linkage"]},SelectFormId:{name:"表单单项选择",hasBpmField:!0,tableColWidth:200,actions:l,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},MulSelectFormId:{name:"表单多项选择",hasBpmField:!0,tableColWidth:200,actions:l,options:{type:"MulSelectFormId"},attrs:["type","id","name","value_type","form_select_type","linkage"]},SelectFromField:{name:"远程单选(从字段)",hasBpmField:!0,tableColWidth:200,actions:l,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:l,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},Ocr:{name:"OCR识别",hasBpmField:!0,tableColWidth:160},MulImage:{name:"图片",hasBpmField:!0,tableColWidth:150},Signature:{name:"签名",hasBpmField:!0},OnlineEditor:{name:"在线文档编辑器"},Spliter:{name:"分割线",hasBpmField:!1},Stepper:{name:"步进器",hasBpmField:!1},Quote:{name:"跨表单数据引用",hasBpmField:!0},Order:{name:"排序控件",hasBpmField:!1},SubForm:{name:"子表单",hasBpmField:!0},XSubForm:{name:"子表单(增强版)",hasBpmField:!0},TreeSubForm:{name:"树子表单",hasBpmField:!0},GroupSubForm:{name:"分组子表单",hasBpmField:!0},OrderSubForm:{name:"排序子表单",hasBpmField:!0},AreaElevation:{name:"区域快速选择器",hasBpmField:!0,tableColWidth:200},RichText:{name:"富文本编辑框",hasBpmField:!0,tableColWidth:100},Appointment:{name:"时段预约",hasBpmField:!0,tableColWidth:120},Rating:{name:"评分",hasBpmField:!0,tableColWidth:250},MapLocation:{name:"地图位置",hasBpmField:!0,tableColWidth:250},ExternalFormLink:{name:"外链表单组件",hasBpmField:!0,tableColWidth:200,actions:i,attrs:["type","id","name","range_remote","value_type"]}}},4747:function(e,t,a){var n=a(1601),l=a.n(n),i=a(6314);a.n(i)()(l()).push([e.id,".bpm-quote-form-list {\n width: 100%;\n}\n.bpm-quote-title-link {\n cursor: pointer;\n color: #409eff;\n}\n.bpm-quote-empty {\n padding: 16px 0;\n color: #909399;\n text-align: center;\n}\n.bpm-quote-table {\n width: 100%;\n}\n.bpm-quote-table .el-table__cell.bpm-td {\n padding: 0;\n}\n.bpm-quote-table .el-table__cell.bpm-td > .cell {\n padding: 0 10px;\n overflow: auto;\n}\n",""])},6314:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var a="",n=void 0!==t[5];return t[4]&&(a+="@supports (".concat(t[4],") {")),t[2]&&(a+="@media ".concat(t[2]," {")),n&&(a+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),a+=e(t),n&&(a+="}"),t[2]&&(a+="}"),t[4]&&(a+="}"),a}).join("")},t.i=function(e,a,n,l,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(n)for(var r=0;r<this.length;r++){var s=this[r][0];null!=s&&(o[s]=!0)}for(var m=0;m<e.length;m++){var p=[].concat(e[m]);n&&o[p[0]]||(void 0!==i&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=i),a&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=a):p[2]=a),l&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=l):p[4]="".concat(l)),t.push(p))}},t}},1601:function(e){e.exports=function(e){return e[1]}},4486:function(e,t,a){function n(e,t,a,n,l,i,o,r){var s,m="function"==typeof e?e.options:e;if(t&&(m.render=t,m.staticRenderFns=a,m._compiled=!0),n&&(m.functional=!0),i&&(m._scopeId="data-v-"+i),o?(s=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(o)},m._ssrRegister=s):l&&(s=r?function(){l.call(this,(m.functional?this.parent:this).$root.$options.shadowRoot)}:l),s)if(m.functional){m._injectStyles=s;var p=m.render;m.render=function(e,t){return s.call(t),p(e,t)}}else{var d=m.beforeCreate;m.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:m}}a.d(t,{A:function(){return n}})},6773:function(t){t.exports=e}},a={};function n(e){var l=a[e];if(void 0!==l)return l.exports;var i=a[e]={id:e,exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};n.r(l),n.d(l,{default:function(){return k}});var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._b({tag:"component",staticClass:"bpm-quote",attrs:{fieldConf:e.fieldConf,row:e.row,isMultiple:e.isMultiple,mode:e.mode,formName:e.formName,container:e.container,uiType:e.uiType},on:{change:e.handleChange},model:{value:e.curVal,callback:function(t){e.curVal=t},expression:"curVal"}},"component",e.$attrs,!1))};i._withStripped=!0;var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"bpm-quote-edit"},[a("form-list",{attrs:{"quote-content":e.quoteContent,"form-name":e.formName,container:e.container,"link-open-type":e.linkOpenType,"detail-dialog-width":e.detailDialogWidth}})],1)};o._withStripped=!0;var r=n(6773),s=n.n(r),m=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"bpm-quote-form-list"},[e.tableData.length?a("el-table",{staticClass:"bpm-quote-table",attrs:{data:e.tableData,border:"",size:"small","header-cell-class-name":"bpm-th","cell-class-name":"bpm-td","span-method":e.rowspanMethod}},[a("el-table-column",{attrs:{label:e.$z("标题","c.title"),"min-width":"220",fixed:"left"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"bpm-quote-title-link",on:{click:function(a){return e.openFormDetailPage(t.row)}}},[a("i",{staticClass:"el-icon-tickets",staticStyle:{"margin-right":"5px"}}),e._v(" "),a("span",[e._v(e._s(t.row.title))])])]}}],null,!1,3830925498)}),e._v(" "),e._l(e.columns,function(t){return[t.isSubForm?a("el-table-column",{key:t.key+"-subform",attrs:{prop:t.key,label:t.label,"min-width":t.minWidth}},[t.fieldConf.show_index?a("el-table-column",{attrs:{prop:"subfield__index",label:t.fieldConf.index_label||e.$z("序号","b2.common.subform_index"),width:"100"},scopedSlots:e._u([{key:"default",fn:function(n){return[e.getSubformRow(n.row,t.key)?a("div",[e._v("\n "+e._s(n.row.i+1)+"\n ")]):e._e()]}}],null,!0)}):e._e(),e._v(" "),e._l(t.subColumns,function(n){return a("el-table-column",{key:n.id,attrs:{prop:"subfield__"+n.id,label:n.name,"min-width":e.getColumnWidth(n),"class-name":"subform-cell","label-class-name":"subform-header-cell"},scopedSlots:e._u([{key:"default",fn:function(l){return[e.getSubformRow(l.row,t.key)?a("bpm-field",{attrs:{type:n.type,"field-conf":n,value:e.getSubformRow(l.row,t.key)[n.id],row:l.row,"form-name":e.formDef.id||e.formName,mode:"view","ui-type":"table",container:e.container}}):e._e()]}}],null,!0)})})],2):a("el-table-column",{key:t.key+"-field",attrs:{prop:"f_fields."+t.key,label:t.label,"min-width":t.minWidth},scopedSlots:e._u([{key:"default",fn:function(n){return[["Select","Status","SelectProject","SelectUser","SelectFromForm"].includes(t.fieldConf.type)?a("span",[e._v("\n "+e._s(n.row.f_fields&&n.row.f_fields[t.key])+"\n ")]):a("bpm-field",{attrs:{type:t.fieldConf.type,"field-conf":t.fieldConf,value:n.row.f_fields&&n.row.f_fields[t.key],row:n.row,"form-name":e.formDef.id||e.formName,mode:"view","ui-type":"table",container:e.container}})]}}],null,!0)})]})],2):a("div",{staticClass:"bpm-quote-empty"},[e._v("\n "+e._s(e.$z("暂无数据","c.no_data"))+"\n ")]),e._v(" "),a("el-dialog",{attrs:{"append-to-body":!0,visible:e.formDetailDialog.visible,"close-on-click-modal":!1,title:e.formDetailDialog.title,width:e.detailDialogWidth,top:"5vh"},on:{"update:visible":function(t){return e.$set(e.formDetailDialog,"visible",t)}}},[e.formDetailDialog.visible?a("iframe",{staticClass:"detail-form-iframe",attrs:{src:e.formDetailDialog.iframe_url,frameborder:"0",width:"100%",height:e.iframeHeight+"px"}}):e._e()])],1)};m._withStripped=!0;var p=n(7520),d={name:"BpmQuoteFormList",props:{quoteContent:{type:Object,default(){return{}}},formName:{type:String,default:""},container:{type:Object,default(){return{}}},linkOpenType:{type:String,default:"dialog"},detailDialogWidth:{type:String,default:"80%"}},data(){return{formDetailDialog:{visible:!1,title:"",iframe_url:""},iframeHeight:850}},computed:{formDef(){return s().get(this.quoteContent,"definition.form",{})},elements(){return s().get(this.formDef,"elements",[])},columns(){return s().chain(this.elements).filter(e=>s().get(e,"perm.visible",!0)).filter(e=>e.type&&-1!==e.type.indexOf("SubForm")||s().get(p.Q,[e.type,"hasBpmField"],!0)).map(e=>{const t=e.type&&-1!==e.type.indexOf("SubForm"),a=t?s().filter(s().get(e,"elements",[]),e=>s().get(e,"perm.visible",!0)&&s().get(p.Q,[e.type,"hasBpmField"],!0)):[];return{key:e.id,label:e.name,fieldConf:e,isSubForm:t,subColumns:a,minWidth:t?this.getSubformColWidth(a):this.getColumnWidth(e)}}).value()},subFormKeys(){return s().chain(this.columns).filter({isSubForm:!0}).map("key").value()},tableData(){return this.getFlatTableData(s().get(this.quoteContent,"data",[]),this.subFormKeys)}},created(){let e=.85*window.innerHeight-84;this.iframeHeight=e},methods:{openFormDetailPage(e){if(zj.pageParam().hidden_form_title)return!1;const t=this.formDef.id;if(!t)return!1;let a=this.formDef.type;a="ProcessForm"===a?"processform":"DataForm"===a?"dataform":s().toLower(a||"");const n=zj.pageParam().project_id,l=zj.pageParam().page_level||"project";let i=`/public/bpm3/app/table.html?form_name=${t}&form_type=${a}&form_id=${e.form_id}&project_id=${n}&page_level=${l}#/detail`;"dialog"===this.linkOpenType?(i=`/public/bpm3/app/table.html?is_mirco_app=1&form_name=${t}&form_type=${a}&form_id=${e.form_id}&project_id=${n}&hidden_form_title=1&page_level=${l}#/detail`,this.formDetailDialog.iframe_url=i,this.formDetailDialog.visible=!0,this.formDetailDialog.title=e.title):window.open(i,"_blank")},getColumnWidth(e){return s().get(e,"display.column_width")||s().get(p.Q,[e.type,"tableColWidth"])||120},getSubformColWidth(e){return s().sumBy(e,e=>Number(this.getColumnWidth(e))||120)||120},getSubformRow(e,t){return s().get(e,["f_fields",t,e.i],null)},getFlatTableData(e,t){if(!t||!t.length)return s().cloneDeep(e);const a=[];return s().each(e,e=>{const n=s().cloneDeep(e);s().each(t,e=>{const t=s().get(n,["f_fields",e],[]);s().isArray(t)&&s().set(n,["f_fields",e],s().filter(t,e=>!s().get(e,"_meta.is_deleted",!1)))});const l=s().max(s().map(t,e=>s().get(n,["f_fields",e],[]).length))||0;if(0!==l)for(let e=0;e<l;e++)a.push({...n,hasRowspan:!0,rowspan:0===e?l:0,colspan:0===e?1:0,i:e});else a.push(n)}),a},rowspanMethod({row:e,column:t}){if(e.hasRowspan&&t&&t.property&&0!==t.property.indexOf("subfield__"))return{rowspan:e.rowspan,colspan:e.colspan}}}},u=(n(4747),n(4486)),c=(0,u.A)(d,m,[],!1,null,null,null);c.options.__file="components/lib/bpmQuote/src/part/form-list.vue";var f={components:{FormList:c.exports},props:{value:{},fieldConf:{},row:{},formName:{},container:{},isMultiple:{type:Boolean,default(){return!1}},readonly:{type:Boolean,default(){return!1}}},data(){return{quoteContent:{},elements:[],tabIndex:0,list:[],elementsList:[],isQuote:!0,curVal:null,initTimer:null}},watch:{quoteContent(e){e&&(this.$bpm.quoteContentMap||(this.$bpm.quoteContentMap={}),this.$bpm.quoteContentMap[this.fieldConf.id]=s().cloneDeep(this.quoteContent))},value(e){"loadData"==e?this.loadQuoteData():this.onFieldValueChange()}},computed:{linkOpenType(){return s().get(this.fieldConf,"style.link_open_type","dialog")},detailDialogWidth(){return this.getDetailDialogWidth()}},created(){this.curVal=this.isMultiple?[]:null},mounted(){this.initTimer=setTimeout(async()=>{this.loadQuoteData()},500)},methods:{getDetailDialogWidth(){const e=s().get(this.fieldConf,"style.dialog_width");return e?s().isNumber(e)?`${e}%`:String(e):"80%"},async loadQuoteData(){let e=s().get(this.fieldConf,"scope",null);console.log("loadQuoteData_scope",e);let t=null;if(!s().isEmpty(e)&&e){let a=e.depends;s().each(a,e=>{t||(t={}),this.container&&this.container.formData&&this.container.formData[e]&&(t[e]=this.container.formData[e])})}let a=this.fieldConf.id,n=await this.$bpm.searchSelectOpts(a,"",this.formName,null,!1,t?{fields:JSON.stringify(t)}:{},!0);this.quoteContent=n,console.log("bpmQuote quoteContent: ",this.quoteContent),this.curVal=s().map(n.data,"form_id"),this.$emit("input",this.curVal),this.$emit("change",this.curVal)},onDataLoaded(){this.onFieldValueChange()},onFieldValueChange(){},async loadRemoteLabel(){let e=this.curVal;if("loadData"!=e)if(s().isEmpty(e))this.quoteContent={data:[],definition:{}};else try{this.loading=!0;let t=await this.$bpm.loadQuteTitle(e,this.fieldConf.id,this.formName,this.row);this.quoteContent=t}finally{this.loading=!1}}},beforeDestroy(){this.$bpm&&this.$bpm.quoteContentMap&&delete this.$bpm.quoteContentMap[this.fieldKey]}},_=(0,u.A)(f,o,[],!1,null,null,null);_.options.__file="components/lib/bpmQuote/src/part/editor.vue";var h=_.exports,g=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"bpm-quote-reader"},[a("editor-component",e._b({attrs:{value:e.value,"field-conf":e.fieldConf,row:e.row,"form-name":e.formName,container:e.container,"is-multiple":e.isMultiple,readonly:!0},on:{input:function(t){return e.$emit("input",t)},change:function(t){return e.$emit("change",t)}}},"editor-component",e.$attrs,!1))],1)};g._withStripped=!0;var y={components:{EditorComponent:h},props:{value:{},fieldConf:{},row:{},formName:{},container:{},isMultiple:{type:Boolean,default(){return!1}}}},b=(0,u.A)(y,g,[],!1,null,null,null);b.options.__file="components/lib/bpmQuote/src/part/reader.vue";var v=b.exports,C={name:"BpmQuote",components:{editorComponent:h,readerComponent:v},props:{value:{type:[String,Array,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"}},isMultiple:{type:Boolean,default(){return!1}},formName:{type:String}},data(){return{curVal:null}},computed:{curComponent(){return"view"==this.mode?v:h}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},F=(0,u.A)(C,i,[],!1,null,null,null);F.options.__file="components/lib/bpmQuote/src/main.vue";var S=F.exports;S.install=function(e){e.component(S.name,S)};var k=S;return l}()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash"),require("qs")):"function"==typeof define&&define.amd?define(["lodash","qs"],t):"object"==typeof exports?exports.bpm2=t(require("lodash"),require("qs")):e.bpm2=t(e.lodash,e.qs)}(self,function(e,t){return function(){var i={5281:function(e,t,i){"use strict";i.d(t,{A:function(){return d}});var s=i(9795),l=i(6773),a=i.n(l),n=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,i)=>{this._queue.push({keys:e,resolve:t,reject:i}),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 i=a().keys(t);this._fnBatchLoad(i).then(s=>{a().each(i,(e,i)=>{t[e]=s[i]}),a().each(e,({keys:e,resolve:i})=>{i(a().map(e,e=>t[e]))})}).catch(t=>{a().each(e,({reject:e})=>e(t))})}},o=i(5360),r=i.n(o);const u=async(e,t,i)=>{if(t.setNetworking(!0),t.netHeader&&(e.headers={common:t.netHeader}),e.params=_.merge({},e.params,i),t.env.ignore_levels&&_.set(e.params,"ignore_levels",!0),(0,s.Fr)()){let t=zj.utils.pageParam().token;e.params=_.merge({token:t,platform:"phone"},e.params)}e.isSilentOnErr=e=>{let t=_.get(e,"data.result");return t>=19e6||t<=19999999};let l=_.cloneDeep(e);if(l.can_custom_org_params){let e=_.cloneDeep(_.get(t,"orgInfo",{}));e.custom_page_level&&(l.params.page_level=e.custom_page_level),e.custom_group_id&&(l.params.group_id=e.custom_group_id),e.custom_team_id&&(l.params.team_id=e.custom_team_id),e.custom_project_id&&(l.params.project_id=e.custom_project_id)}let a=await zj.net.request(l);return t.setNetworking(!1),a},c={},h={};var d={assistSelectEntranceForm:{getListDefinition(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l}){return u({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${i}/list_definition/`,method:"GET"},e,s)},getOptions(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a){return u({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${i}/list_search/`,method:"GET",params:a},e,s)},getListSelected(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a){return u({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${i}/list_selected/`,method:"GET",params:a},e,s)}},assistField:{getBatchLoader(e,{formDefId:t,fieldDefId:i,orgInfo:s,uniqueId:l}){const a=`${t}/${i}`,o=c[a]||new n(async a=>{let n=`/app_flow/v1/papi/assist_field/${t}/${i}/list_title/`;const o=await u({url:n,method:"GET",params:{values:JSON.stringify(a)}},e,s),r=_.get(o,"data.data.data",{});let c=[];return _.map(a,e=>{l?(e=JSON.parse(e),e=_.get(e,`${l}`),c=_.concat(c,r[e])):c=_.concat(c,r[e])}),c});return c[a]=o,o},getTitle(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a){return u({url:`/app_flow/v1/papi/assist_field/${t}/${i}/list_title/`,method:"GET",params:{values:JSON.stringify(a)}},e,s)},async searchSelectOpts(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a={},n=""){n&&(a.q=n);let o=l?`/app_flow/v1/papi/dm/assist_field/${t}/${i}/search_title/`:`/app_flow/v1/papi/assist_field/${t}/${i}/search_title/`,r=`${t}/${i}/${n}/${JSON.stringify(s)}/${JSON.stringify(a)}`,c={};return h[r]&&"loading"==h[r]?await this.waitCacheMapData(r):(!h[r]||(new Date).getTime()-h[r].last_time>6e4?(h[r]="loading",c=await u({url:o,method:l?"GET":"POST",data:a,can_custom_org_params:!0},e,s),h[r]={last_time:(new Date).getTime(),result:c}):h[r].result&&(c=h[r].result),c)},waitCacheMapData(e){return new Promise(t=>{let i=setInterval(()=>{h[e]&&"loading"!=h[e]&&h[e].result&&(clearInterval(i),t(h[e].result))},100)})},async selectFromMulFormSearchOpts(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a={},n=""){n&&(a.q=n);let o=l?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${i}/search_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${i}/search_title/`,r=`select_form_mul_form_search_${t}/${i}/${n}/${JSON.stringify(s)}/${JSON.stringify(a)}`,c={};return h[r]&&"loading"==h[r]?await this.waitCacheMapData(r):(!h[r]||(new Date).getTime()-h[r].last_time>6e4?(h[r]="loading",c=await u({url:o,method:"GET",params:a},e,s),h[r]={last_time:(new Date).getTime(),result:c}):h[r].result&&(c=h[r].result),c)},selectFromMulFormListTitleLoader(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l}){const a=`${t}/${i}`,o=c[a]||new n(async a=>{let n=l?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${i}/list_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${i}/list_title/`;const o=await u({url:n,method:"GET",params:{values:JSON.stringify(a)}},e,s),r=_.get(o.data,"data.items",[]),c={};r.forEach(e=>{Object.keys(e.data).forEach(t=>{let i=e.data[t];c[t]={form_def_id:_.get(e,"definition.form.id"),form_title:_.get(e,"definition.form.name"),label:i}})});let h=[];return a.forEach(e=>{h.push(c[e])}),h});return c[a]=o,o},async selectFromMulFormListTitle(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a){let n=l?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${i}/list_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${i}/list_title/`,o=`select_form_mul_form_list_title_${t}/${i}}/${JSON.stringify(s)}/${JSON.stringify(a)}`,r={};return h[o]&&"loading"==h[o]?await this.waitCacheMapData(o):(!h[o]||(new Date).getTime()-h[o].last_time>6e4?(h[o]="loading",r=await u({url:n,method:"GET",params:{values:JSON.stringify(a)}},e,s),h[o]={last_time:(new Date).getTime(),result:r}):h[o].result&&(r=h[o].result),r)}},assistTreeField:{searchSelectOpts(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a={},n=""){return n&&(a.q=n),u({url:l?`/app_flow/v1/papi/dm/assist_tree_field/${t}/${i}/search_title/`:`/app_flow/v1/papi/assist_tree_field/${t}/${i}/search_title/`,method:"GET",params:a,can_custom_org_params:!0},e,s)}},assistUserTaskCC:{searchSelectOpts(e,{formDefId:t,node:i,orgInfo:s,isDm:l},a={},n=""){return n&&(a.q=n),u({url:`/app_flow/v1/papi/assist_user_task_cc/${t}/${i}/search_title/`,method:"GET",params:a},e,s)}},OCR:{getCreatedTaskList(e){return zj.net.w.noapi({url:"/base_srv_module/v2/gapi/task/async_notify_list",method:"POST",data:r().stringify({group_id:zj.pageParam().group_id||0,file_md5:e})})},getTaskId(e){return zj.net.w.noapi({url:"/base_srv_module/v2/gapi/task/async_notify_submit",method:"POST",data:r().stringify({group_id:zj.pageParam().group_id||0,name:"OCR识别MD5_"+e,vendor_code:"csmart",enable_notify:0,task_type:1,creator:zj.app.accessInfo.user_id,file_md5:e})})},getOcrResult(e){return zj.net.w.noapi({url:"/base_srv_module/v2/gapi/task/detail",method:"POST",data:r().stringify(e)})},ocrCreateForm(e,t){return zj.net.w.noapi.json({url:"/app_flow/v1/papi/ocr_create/submit",method:"POST",params:t,data:e})}}}},9795:function(e,t,i){"use strict";function s(){for(var e=["iphone","ipod","ipad","android","mobile","blackberry","webos","incognito","webmate","bada","nokia","lg","ucweb","skyfire"],t=navigator.userAgent.toLowerCase(),i=!1,s=0,l=e.length;s<l;s++)-1!=t.indexOf(e[s])&&(i=!0);return i}i.d(t,{Fr:function(){return s}}),i(6773),i(5360)},4967:function(e,t,i){"use strict";i.d(t,{A:function(){return r}});var s=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{staticClass:"bpm-text-view",class:e.uiType+"-text-view "+e.fieldConf.type+"-view",attrs:{title:e.label}},[e._v(e._s(e.label))])};s._withStripped=!0;var l=i(6773),a=i.n(l),n={props:["value","fieldConf","row","formName","orgInfo"],data(){return{label:""}},watch:{value(){this.loadRemoteLabel()}},mounted(){this.loadRemoteLabel()},methods:{async loadRemoteLabel(){let e=this.value;if(a().isNil(e)||!e)return this.label=zj.z("未选择","c.not_selected");try{let t=a().isArray(e)?e:[e],i=a().get(this.fieldConf,"id");a().isEmpty(t)?this.label=zj.z("未选择","c.not_selected"):(t=a().isArray(t)?t:[t],this.label=await this.$bpm.fetchLabelByValues(t,i,this.formName,this.row),this.$emit("assist_field_label_loaded",this.label))}finally{}}}},o=(0,i(4486).A)(n,s,[],!1,null,null,null);o.options.__file="components/lib/mixins/RemoteSelectReader.vue";var r=o.exports},4486:function(e,t,i){"use strict";function s(e,t,i,s,l,a,n,o){var r,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=i,u._compiled=!0),s&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),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)},u._ssrRegister=r):l&&(r=o?function(){l.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:l),r)if(u.functional){u._injectStyles=r;var c=u.render;u.render=function(e,t){return r.call(t),c(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,r):[r]}return{exports:e,options:u}}i.d(t,{A:function(){return s}})},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},5360:function(e){"use strict";e.exports=t}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var a=s[e]={exports:{}};return i[e](a,a.exports,l),a.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){"use strict";l.r(a),l.d(a,{default:function(){return $}});var e=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._b({ref:"inner-component",tag:"component",staticClass:"bpm-select-form-field",attrs:{value:e.curVal,type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.mode,orgInfo:e.orgInfo,formName:e.formName,uiType:e.uiType,isMultiple:e.multiple},on:{change:e.handleChange}},"component",e.$attrs,!1))};e._withStripped=!0;var t=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"bpm-select-edit",staticStyle:{display:"flex","align-items":"center"}},[i("el-select",e._b({key:e.isMultiple?"two":"one",attrs:{placeholder:e.placeholder,multiple:e.isMultiple,clearable:"",filterable:"",remote:e.options_max_count>99,"remote-method":e.options_max_count>99&&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._l(e.options,function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1),e._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:e.unitVisible&&e.showUnit,expression:"unitVisible && showUnit"}],staticStyle:{display:"flex"}},[i("span",{on:{click:function(t){e.unitVisible=!1}}},[e._v("《 ")]),e._v(" "),e.showUnit?i("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?i("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 i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1):e._e()],1)],1)};t._withStripped=!0;var i=l(5554),s=l.n(i),n=l(7642),o=l(5281),r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",["list"==e.uiType?i("div",[i("div",{staticStyle:{padding:"0px 10px"}},[i("el-input",{staticClass:"search-input",attrs:{"prefix-icon":"el-icon-search",placeholder:e.$z("输入关键字搜索","c.search_tip")},on:{input:e.debounceSearchTeams},model:{value:e.teamKeyword,callback:function(t){e.teamKeyword=t},expression:"teamKeyword"}})],1),e._v(" "),i("ul",{staticClass:"department-list"},e._l(e.teams,function(t){return i("li",{key:t.value,class:{"is-selected":t.value==e.selectedTeam},on:{click:function(i){return e.selectTeam(t)}}},[e._v(e._s(t.label))])}),0)]):i("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 i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1)};r._withStripped=!0;var u={name:"SelectUnit",props:["fieldConf","orgInfo","formDefId","uiType"],data(){return{selectedTeam:"",teams:[],teamMap:{},teamKeyword:"",debounceSearchTeams:_.debounce(_.bind(this.loadTeams,this),150,{trailing:!0,leading:!1})}},mounted(){this.loadTeams()},methods:{selectTeam(e){this.selectedTeam=e.value,this.handleUnitChange()},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),console.log("this.teams",this.teams),this.teamKeyword||this.teams.unshift({value:"",label:zj.z("全部","c.all_2")}),this.teamMap=_.keyBy(this.teams,"value")},remoteMethod(e){this.teamKeyword=e||"",this.debounceSearchTeams()}}},c=l(4486),h=(0,c.A)(u,r,[],!1,null,null,null);h.options.__file="components/lib/bpmSelectUser/src/part/select-unit.vue";var d=h.exports;s().use(n.Select),s().use(n.Option);var p={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:d},data(){return{curVal:"",options:[],allOptions:[],options_max_count:0,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)},curVal(e){e&&0!=e.length||(this.options=this.allOptions)},getSelectOptions:function(e){console.log("----selectOptions----",e),this.transformOptions(e),this.setDefaultVal()}},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&&this.loadSelectOpts(),this.curVal=this.value},methods:{async loadRemoteLabel(){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],i=_.get(this.fieldConf,"id");if(!_.isEmpty(t)){t=_.isArray(t)?t:[t];let e=await this.$bpm.fetchLabelByValues(t,i,this.formName,this.row);if(e=e.split(","),e&&e.length>0){let t=[];for(let i=0;i<this.curVal.length;i++)t.push({label:e[i],value:this.curVal[i]});this.options=t}}}finally{console.log("finally")}},handleUnitChange(e){let t=_.split(e,"$"),i=_.get(t,"0"),s=_.get(t,"1");this.unit={search_type:i,org_id:s},this.loadSelectOpts("",JSON.stringify(this.unit))},remoteMethod(e){let t="";this.showUnit&&this.unit.search_type&&(t=JSON.stringify(this.unit)),this.loadSelectOpts(e,t,!1)},async loadSelectOpts(e="",t="",i=!0){let s,l=this.fieldConf.id,a={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){const e=this.fieldConf.node;s=await o.A.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},a)}else s=await o.A.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:l,orgInfo:this.orgInfo,isDm:this.dm},a);const n=_.get(s.data,"data.data",[]);return this.transformOptions(n,i)},transformOptions(e,t=!0){let i=_.map(e,e=>({value:e[0],label:e[1]}));return this.options=this.options.concat(i),this.options_max_count<i.length&&(this.options_max_count=i.length),this.options=_.uniqBy(this.options,"value"),this.showUnit?(this.options=this.options.concat(i),this.options=_.uniqBy(this.options,"value"),this.unitChildsOptions=i,t&&this._setUnitChildCurVal(this.curVal)):this.options=i,this.allOptions=this.allOptions.concat(this.options),this.allOptions=_.uniqBy(this.allOptions,"value"),i},_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(this.isMultiple){_.each(e,e=>{_.isArray(this.curVal)&&(_.includes(this.curVal,e)||this.curVal.push(e))});let t=[];_.each(this.curVal,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)},setDefaultVal(){let e=_.get(this.options,"0.value");if(this.fieldConf.default&&"EVCFirstElem"==this.fieldConf.default.value.type){if(this.isMultiple)this.curVal=e;else if(this.curVal)this.curVal=e;else{let t=_.map(this.options,"value");_.includes(t,this.curVal)||(this.curVal=e)}this.$emit("input",this.curVal),this.$emit("change",this.curVal)}}}},f=(0,c.A)(p,t,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectUser/src/part/editor.vue";var m=f.exports,v=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"bpm-select-user-edit",staticStyle:{display:"flex","align-items":"center"}},[i("el-popover",{attrs:{placement:"bottom-start","popper-class":"select-user-board-popover",width:"600","visible-arrow":!1,trigger:"click"}},[i("div",{staticClass:"select-user-board"},[i("div",{staticClass:"derpartment-select"},[i("div",{staticClass:"title"},[e._v("\n "+e._s(e.$z("单位选择","b2.common.unit_selection"))+"\n ")]),e._v(" "),i("select-unit",{attrs:{uiType:"list",fieldConf:e.fieldConf,formDefId:e.formDefId,orgInfo:e.orgInfo},on:{change:e.handleUnitChange}})],1),e._v(" "),i("div",{staticClass:"staff-select"},[i("div",{staticClass:"title"},[e._v("\n "+e._s(e.$z("人员选择","b2.common.person_select"))+"\n ")]),e._v(" "),i("el-input",{staticClass:"search-input",attrs:{"prefix-icon":"el-icon-search",placeholder:e.$z("输入关键字搜索","c.search_tip")},on:{input:e.searchStaff},model:{value:e.staff_search_str,callback:function(t){e.staff_search_str=t},expression:"staff_search_str"}}),e._v(" "),i("div",{staticClass:"staff-select-list"},[e.isMultiple?i("el-checkbox-group",{on:{change:e.onUnitChildsChange},model:{value:e.unitChildCurVal,callback:function(t){e.unitChildCurVal=t},expression:"unitChildCurVal"}},e._l(e.unitChildsOptions,function(t){return i("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])}),1):i("el-radio-group",{on:{change:e.onUnitChildsChange},model:{value:e.unitChildCurVal,callback:function(t){e.unitChildCurVal=t},expression:"unitChildCurVal"}},e._l(e.unitChildsOptions,function(t){return i("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])}),1)],1)],1)]),e._v(" "),i("div",{staticClass:"select-item-box",attrs:{slot:"reference"},slot:"reference"},[e.selectedItems.length>0?[e._l(e.selectedItems,function(t,s){return[s<e.default_show_max?i("el-tag",{key:t.value,attrs:{size:"small",closable:""},on:{close:function(i){return e.delItem(t)}}},[e._v("\n "+e._s(t.label)+"\n ")]):e._e()]})]:i("div",{staticClass:"placeholder"},[i("span",[e._v(e._s(e.$z("请选择","c.please_select")))])]),e._v(" "),e.selectedItems.length>e.default_show_max?[i("el-dropdown",{attrs:{size:"mini","hide-on-click":!1}},[i("el-button",{attrs:{size:"mini"}},[e._v("\n "+e._s(e.$z("查看更多","c.see_more"))+"("+e._s(e.selectedItems.length-e.default_show_max)+")"),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e._l(e.selectedItems,function(t,s){return[s>=e.default_show_max?i("el-dropdown-item",{key:t.value},[i("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[i("span",[e._v(" "+e._s(t.label))]),e._v(" "),i("i",{staticClass:"el-icon-close",on:{click:function(i){return e.delItem(t)}}})])]):e._e()]})],2)],1)]:e._e()],2)])],1)};v._withStripped=!0,s().use(n.Select),s().use(n.Option);var g={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:d},data(){return{curVal:"",selectedItems:[],select_team:"",options:[],keyword:"",unit:{search_type:"",org_id:""},staff_search_str:"",unitVisible:!1,default_show_max:7,unitChildCurVal:"",unitChildsOptions:[],curValInterval:null}},watch:{curVal(e){this.curValInterval&&clearInterval(this.curValInterval),this.curValInterval=setInterval(()=>{this.options&&this.options.length>0&&(this.setSelectedItems(e),clearInterval(this.curValInterval))},500)},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(){const e=this.fieldConf.perm||{visible:!0};(e.visible||e.editable)&&this.loadSelectOpts(),this.curVal=this.value},methods:{setSelectedItems(e){let t=[];_.each(this.options,i=>{this.isMultiple?_.includes(e,i.value)&&t.push(i):e==i.value&&t.push(i)}),this.selectedItems=t,this._setUnitChildCurVal(this.curVal)},searchStaff(){this.select_team?this._debounceFun(this):this.options.length<100?this.unitChildsOptions=_.filter(this.options,e=>{if(-1!=_.lowerCase(e.label).indexOf(_.lowerCase(this.staff_search_str)))return e}):this._debounceFun(this)},_debounceFun:_.debounce(async e=>{e.remoteMethod(e.staff_search_str)},1e3,{leading:!1,trailing:!0}),delItem(e){this.curVal=_.filter(this.curVal,t=>{if(t!=e.value)return!0}),this._setUnitChildCurVal(this.curVal)},async loadRemoteLabel(){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],i=_.get(this.fieldConf,"id");if(!_.isEmpty(t)){t=_.isArray(t)?t:[t];let e=await this.$bpm.fetchLabelByValues(t,i,this.formName,this.row);if(e=-1!=e.indexOf(",")?e.split(","):e.split(","),e&&e.length>0){let t=[];if(_.isArray(this.curVal))for(let i=0;i<this.curVal.length;i++)t.push({label:e[i],value:this.curVal[i]});else t.push({label:e[0],value:this.curVal});this.options=t,this.selectedItems=t}}}finally{console.log("finally")}},handleUnitChange(e){if(this.select_team=e,e){let t=_.split(e,"$"),i=_.get(t,"0"),s=_.get(t,"1");this.unit={search_type:i,org_id:s},this.loadSelectOpts("",JSON.stringify(this.unit))}else this.unitChildsOptions=this.options,this._setUnitChildCurVal(this.curVal)},remoteMethod(e){let t="";this.showUnit&&this.unit.search_type&&(t=JSON.stringify(this.unit)),this.loadSelectOpts(e,t,!1)},async loadSelectOpts(e="",t="",i=!0){let s,l=this.fieldConf.id,a={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){const e=this.fieldConf.node;s=await o.A.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},a)}else s=await o.A.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:l,orgInfo:this.orgInfo,isDm:this.dm},a);const n=_.get(s.data,"data.data",[]);return this.transformOptions(n,i)},transformOptions(e,t=!0){let i=_.map(e,e=>({value:e[0],label:e[1]}));return this.options=this.options.concat(i),this.options=_.uniqBy(this.options,"value"),this.showUnit?(this.options=this.options.concat(i),this.options=_.uniqBy(this.options,"value"),this.unitChildsOptions=i,t&&this._setUnitChildCurVal(this.curVal)):this.options=i,i},_setUnitChildCurVal(e){if(this.isMultiple){let t=[];_.each(e,e=>{_.find(this.unitChildsOptions,{value:e})&&t.push(e)}),this.unitChildCurVal=t}else this.unitChildCurVal=e},onChange(e){this.$emit("input",e),this.$emit("change",e)},onUnitChildsChange(e){if(this.isMultiple){_.each(e,e=>{_.isArray(this.curVal)?_.includes(this.curVal,e)||this.curVal.push(e):this.curVal=[e]});let t=[];_.each(this.curVal,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)}},beforeDestroy(){this.curValInterval&&clearInterval(this.curValInterval),this._debounceFun&&this._debounceFun.cancel&&this._debounceFun.cancel()}},C=(0,c.A)(g,v,[],!1,null,null,null);C.options.__file="components/lib/bpmSelectUser/src/part/editor_mode_2.vue";var y=C.exports,b={mixins:[l(4967).A]},w=(0,c.A)(b,void 0,void 0,!1,null,null,null);w.options.__file="components/lib/bpmSelectUser/src/part/reader.vue";var V=w.exports,I={name:"BpmSelectFromField",components:{editorComponent:m,readerComponent:V,editorURComponent: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?V:"SelectURUser"==this.type||"MulSelectURUser"==this.type?y:m},multiple(){let e=this.isMultiple||0===this.type.indexOf("Mul");return"UserTaskCC"===this.type&&this.fieldConf.selecter&&(e=0===(this.fieldConf.selecter.type||"MulSelectUser4CC").indexOf("Mul")),e}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},O=(0,c.A)(I,e,[],!1,null,null,null);O.options.__file="components/lib/bpmSelectUser/src/main.vue";var S=O.exports;S.install=function(e){e.component(S.name,S)};var $=S}(),a}()});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash"),require("qs")):"function"==typeof define&&define.amd?define(["lodash","qs"],t):"object"==typeof exports?exports.bpm2=t(require("lodash"),require("qs")):e.bpm2=t(e.lodash,e.qs)}(self,function(e,t){return function(){var i={5281:function(e,t,i){"use strict";i.d(t,{A:function(){return d}});var s=i(9795),l=i(6773),a=i.n(l),n=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,i)=>{this._queue.push({keys:e,resolve:t,reject:i}),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 i=a().keys(t);this._fnBatchLoad(i).then(s=>{a().each(i,(e,i)=>{t[e]=s[i]}),a().each(e,({keys:e,resolve:i})=>{i(a().map(e,e=>t[e]))})}).catch(t=>{a().each(e,({reject:e})=>e(t))})}},o=i(5360),r=i.n(o);const u=async(e,t,i)=>{if(t.setNetworking(!0),t.netHeader&&(e.headers={common:t.netHeader}),e.params=_.merge({},e.params,i),t.env.ignore_levels&&_.set(e.params,"ignore_levels",!0),(0,s.Fr)()){let t=zj.utils.pageParam().token;e.params=_.merge({token:t,platform:"phone"},e.params)}e.isSilentOnErr=e=>{let t=_.get(e,"data.result");return t>=19e6||t<=19999999};let l=_.cloneDeep(e);if(l.can_custom_org_params){let e=_.cloneDeep(_.get(t,"orgInfo",{}));e.custom_page_level&&(l.params.page_level=e.custom_page_level),e.custom_group_id&&(l.params.group_id=e.custom_group_id),e.custom_team_id&&(l.params.team_id=e.custom_team_id),e.custom_project_id&&(l.params.project_id=e.custom_project_id)}let a=await zj.net.request(l);return t.setNetworking(!1),a},c={},h={};var d={assistSelectEntranceForm:{getListDefinition(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l}){return u({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${i}/list_definition/`,method:"GET"},e,s)},getOptions(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a){return u({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${i}/list_search/`,method:"GET",params:a},e,s)},getListSelected(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a){return u({url:`/app_flow/v1/papi/assist_select_entrance_form/${t}/${i}/list_selected/`,method:"GET",params:a},e,s)}},assistField:{getBatchLoader(e,{formDefId:t,fieldDefId:i,orgInfo:s,uniqueId:l}){const a=`${t}/${i}`,o=c[a]||new n(async a=>{let n=`/app_flow/v1/papi/assist_field/${t}/${i}/list_title/`;const o=await u({url:n,method:"GET",params:{values:JSON.stringify(a)}},e,s),r=_.get(o,"data.data.data",{});let c=[];return _.map(a,e=>{l?(e=JSON.parse(e),e=_.get(e,`${l}`),c=_.concat(c,r[e])):c=_.concat(c,r[e])}),c});return c[a]=o,o},getTitle(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a){return u({url:`/app_flow/v1/papi/assist_field/${t}/${i}/list_title/`,method:"GET",params:{values:JSON.stringify(a)}},e,s)},async searchSelectOpts(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a={},n=""){n&&(a.q=n);let o=l?`/app_flow/v1/papi/dm/assist_field/${t}/${i}/search_title/`:`/app_flow/v1/papi/assist_field/${t}/${i}/search_title/`,r=`${t}/${i}/${n}/${JSON.stringify(s)}/${JSON.stringify(a)}`,c={};return h[r]&&"loading"==h[r]?await this.waitCacheMapData(r):(!h[r]||(new Date).getTime()-h[r].last_time>6e4?(h[r]="loading",c=await u({url:o,method:l?"GET":"POST",data:a,can_custom_org_params:!0},e,s),h[r]={last_time:(new Date).getTime(),result:c}):h[r].result&&(c=h[r].result),c)},waitCacheMapData(e){return new Promise(t=>{let i=setInterval(()=>{h[e]&&"loading"!=h[e]&&h[e].result&&(clearInterval(i),t(h[e].result))},100)})},async selectFromMulFormSearchOpts(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a={},n=""){n&&(a.q=n);let o=l?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${i}/search_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${i}/search_title/`,r=`select_form_mul_form_search_${t}/${i}/${n}/${JSON.stringify(s)}/${JSON.stringify(a)}`,c={};return h[r]&&"loading"==h[r]?await this.waitCacheMapData(r):(!h[r]||(new Date).getTime()-h[r].last_time>6e4?(h[r]="loading",c=await u({url:o,method:"GET",params:a},e,s),h[r]={last_time:(new Date).getTime(),result:c}):h[r].result&&(c=h[r].result),c)},selectFromMulFormListTitleLoader(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l}){const a=`${t}/${i}`,o=c[a]||new n(async a=>{let n=l?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${i}/list_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${i}/list_title/`;const o=await u({url:n,method:"GET",params:{values:JSON.stringify(a)}},e,s),r=_.get(o.data,"data.items",[]),c={};r.forEach(e=>{Object.keys(e.data).forEach(t=>{let i=e.data[t];c[t]={form_def_id:_.get(e,"definition.form.id"),form_title:_.get(e,"definition.form.name"),label:i}})});let h=[];return a.forEach(e=>{h.push(c[e])}),h});return c[a]=o,o},async selectFromMulFormListTitle(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a){let n=l?`/app_flow/v1/papi/dm/assist_field/select_form_mul_form/${t}/${i}/list_title/`:`/app_flow/v1/papi/assist_field/select_form_mul_form/${t}/${i}/list_title/`,o=`select_form_mul_form_list_title_${t}/${i}}/${JSON.stringify(s)}/${JSON.stringify(a)}`,r={};return h[o]&&"loading"==h[o]?await this.waitCacheMapData(o):(!h[o]||(new Date).getTime()-h[o].last_time>6e4?(h[o]="loading",r=await u({url:n,method:"GET",params:{values:JSON.stringify(a)}},e,s),h[o]={last_time:(new Date).getTime(),result:r}):h[o].result&&(r=h[o].result),r)}},assistTreeField:{searchSelectOpts(e,{formDefId:t,fieldDefId:i,orgInfo:s,isDm:l},a={},n=""){return n&&(a.q=n),u({url:l?`/app_flow/v1/papi/dm/assist_tree_field/${t}/${i}/search_title/`:`/app_flow/v1/papi/assist_tree_field/${t}/${i}/search_title/`,method:"GET",params:a,can_custom_org_params:!0},e,s)}},assistUserTaskCC:{searchSelectOpts(e,{formDefId:t,node:i,orgInfo:s,isDm:l},a={},n=""){return n&&(a.q=n),u({url:`/app_flow/v1/papi/assist_user_task_cc/${t}/${i}/search_title/`,method:"GET",params:a},e,s)}},OCR:{getCreatedTaskList(e){return zj.net.w.noapi({url:"/base_srv_module/v2/gapi/task/async_notify_list",method:"POST",data:r().stringify({group_id:zj.pageParam().group_id||0,file_md5:e})})},getTaskId(e){return zj.net.w.noapi({url:"/base_srv_module/v2/gapi/task/async_notify_submit",method:"POST",data:r().stringify({group_id:zj.pageParam().group_id||0,name:"OCR识别MD5_"+e,vendor_code:"csmart",enable_notify:0,task_type:1,creator:zj.app.accessInfo.user_id,file_md5:e})})},getOcrResult(e){return zj.net.w.noapi({url:"/base_srv_module/v2/gapi/task/detail",method:"POST",data:r().stringify(e)})},ocrCreateForm(e,t){return zj.net.w.noapi.json({url:"/app_flow/v1/papi/ocr_create/submit",method:"POST",params:t,data:e})}}}},9795:function(e,t,i){"use strict";function s(){for(var e=["iphone","ipod","ipad","android","mobile","blackberry","webos","incognito","webmate","bada","nokia","lg","ucweb","skyfire"],t=navigator.userAgent.toLowerCase(),i=!1,s=0,l=e.length;s<l;s++)-1!=t.indexOf(e[s])&&(i=!0);return i}i.d(t,{Fr:function(){return s}}),i(6773),i(5360)},4967:function(e,t,i){"use strict";i.d(t,{A:function(){return r}});var s=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{staticClass:"bpm-text-view",class:e.uiType+"-text-view "+e.fieldConf.type+"-view",attrs:{title:e.label}},[e._v(e._s(e.label))])};s._withStripped=!0;var l=i(6773),a=i.n(l),n={props:["value","fieldConf","row","formName","orgInfo"],data(){return{label:""}},watch:{value(){this.loadRemoteLabel()}},mounted(){this.loadRemoteLabel()},methods:{async loadRemoteLabel(){let e=this.value;if(a().isNil(e)||!e)return this.label=zj.z("未选择","c.not_selected");try{let t=a().isArray(e)?e:[e],i=a().get(this.fieldConf,"id");a().isEmpty(t)?this.label=zj.z("未选择","c.not_selected"):(t=a().isArray(t)?t:[t],this.label=await this.$bpm.fetchLabelByValues(t,i,this.formName,this.row),this.$emit("assist_field_label_loaded",this.label))}finally{}}}},o=(0,i(4486).A)(n,s,[],!1,null,null,null);o.options.__file="components/lib/mixins/RemoteSelectReader.vue";var r=o.exports},4486:function(e,t,i){"use strict";function s(e,t,i,s,l,a,n,o){var r,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=i,u._compiled=!0),s&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),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)},u._ssrRegister=r):l&&(r=o?function(){l.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:l),r)if(u.functional){u._injectStyles=r;var c=u.render;u.render=function(e,t){return r.call(t),c(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,r):[r]}return{exports:e,options:u}}i.d(t,{A:function(){return s}})},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},5360:function(e){"use strict";e.exports=t}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var a=s[e]={exports:{}};return i[e](a,a.exports,l),a.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){"use strict";l.r(a),l.d(a,{default:function(){return $}});var e=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.curComponent,e._b({ref:"inner-component",tag:"component",staticClass:"bpm-select-form-field",attrs:{value:e.curVal,type:e.type,fieldConf:e.fieldConf,row:e.row,mode:e.mode,orgInfo:e.orgInfo,formName:e.formName,uiType:e.uiType,isMultiple:e.multiple},on:{change:e.handleChange}},"component",e.$attrs,!1))};e._withStripped=!0;var t=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"bpm-select-edit",staticStyle:{display:"flex","align-items":"center"}},[i("el-select",e._b({key:e.isMultiple?"two":"one",attrs:{placeholder:e.placeholder,multiple:e.isMultiple,clearable:"",filterable:"",remote:e.options_max_count>99,"remote-method":e.options_max_count>99&&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._l(e.options,function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1),e._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:e.unitVisible&&e.showUnit,expression:"unitVisible && showUnit"}],staticStyle:{display:"flex"}},[i("span",{on:{click:function(t){e.unitVisible=!1}}},[e._v("《 ")]),e._v(" "),e.showUnit?i("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?i("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 i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1):e._e()],1)],1)};t._withStripped=!0;var i=l(5554),s=l.n(i),n=l(7642),o=l(5281),r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",["list"==e.uiType?i("div",[i("div",{staticStyle:{padding:"0px 10px"}},[i("el-input",{staticClass:"search-input",attrs:{"prefix-icon":"el-icon-search",placeholder:e.$z("输入关键字搜索","c.search_tip")},on:{input:e.debounceSearchTeams},model:{value:e.teamKeyword,callback:function(t){e.teamKeyword=t},expression:"teamKeyword"}})],1),e._v(" "),i("ul",{staticClass:"department-list"},e._l(e.teams,function(t){return i("li",{key:t.value,class:{"is-selected":t.value==e.selectedTeam},on:{click:function(i){return e.selectTeam(t)}}},[e._v(e._s(t.label))])}),0)]):i("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 i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1)],1)};r._withStripped=!0;var u={name:"SelectUnit",props:["fieldConf","orgInfo","formDefId","uiType"],data(){return{selectedTeam:"",teams:[],teamMap:{},teamKeyword:"",debounceSearchTeams:_.debounce(_.bind(this.loadTeams,this),150,{trailing:!0,leading:!1})}},mounted(){this.loadTeams()},methods:{selectTeam(e){this.selectedTeam=e.value,this.handleUnitChange()},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),console.log("this.teams",this.teams),this.teamKeyword||this.teams.unshift({value:"",label:zj.z("全部","c.all_2")}),this.teamMap=_.keyBy(this.teams,"value")},remoteMethod(e){this.teamKeyword=e||"",this.debounceSearchTeams()}}},c=l(4486),h=(0,c.A)(u,r,[],!1,null,null,null);h.options.__file="components/lib/bpmSelectUser/src/part/select-unit.vue";var d=h.exports;s().use(n.Select),s().use(n.Option);var p={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:d},data(){return{curVal:"",options:[],allOptions:[],options_max_count:0,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)},curVal(e){e&&0!=e.length||(this.options=this.allOptions)},getSelectOptions:function(e){console.log("----selectOptions----",e),this.transformOptions(e),this.setDefaultVal()}},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&&this.loadSelectOpts(),this.curVal=this.value},methods:{async loadRemoteLabel(){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],i=_.get(this.fieldConf,"id");if(!_.isEmpty(t)){t=_.isArray(t)?t:[t];let e=await this.$bpm.fetchLabelByValues(t,i,this.formName,this.row);if(e=e.split(","),e&&e.length>0){let t=[];for(let i=0;i<this.curVal.length;i++)t.push({label:e[i],value:this.curVal[i]});this.options=t}}}finally{console.log("finally")}},handleUnitChange(e){let t=_.split(e,"$"),i=_.get(t,"0"),s=_.get(t,"1");this.unit={search_type:i,org_id:s},this.loadSelectOpts("",JSON.stringify(this.unit))},remoteMethod(e){let t="";this.showUnit&&this.unit.search_type&&(t=JSON.stringify(this.unit)),this.loadSelectOpts(e,t,!1)},async loadSelectOpts(e="",t="",i=!0){let s,l=this.fieldConf.id,a={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){const e=this.fieldConf.node;s=await o.A.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},a)}else s=await o.A.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:l,orgInfo:this.orgInfo,isDm:this.dm},a);const n=_.get(s.data,"data.data",[]);return this.transformOptions(n,i)},transformOptions(e,t=!0){let i=_.map(e,e=>({value:e[0],label:e[1]}));return this.options=this.options.concat(i),this.options_max_count<i.length&&(this.options_max_count=i.length),this.options=_.uniqBy(this.options,"value"),this.showUnit?(this.options=this.options.concat(i),this.options=_.uniqBy(this.options,"value"),this.unitChildsOptions=i,t&&this._setUnitChildCurVal(this.curVal)):this.options=i,this.allOptions=this.allOptions.concat(this.options),this.allOptions=_.uniqBy(this.allOptions,"value"),i},_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(this.isMultiple){_.each(e,e=>{_.isArray(this.curVal)&&(_.includes(this.curVal,e)||this.curVal.push(e))});let t=[];_.each(this.curVal,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)},setDefaultVal(){let e=_.get(this.options,"0.value");if(this.fieldConf.default&&"EVCFirstElem"==this.fieldConf.default.value.type){if(this.isMultiple)this.curVal=e;else if(this.curVal)this.curVal=e;else{let t=_.map(this.options,"value");_.includes(t,this.curVal)||(this.curVal=e)}this.$emit("input",this.curVal),this.$emit("change",this.curVal)}}}},f=(0,c.A)(p,t,[],!1,null,null,null);f.options.__file="components/lib/bpmSelectUser/src/part/editor.vue";var m=f.exports,v=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"bpm-select-user-edit",staticStyle:{display:"flex","align-items":"center"}},[i("el-popover",{attrs:{placement:"bottom-start","popper-class":"select-user-board-popover",width:"600","visible-arrow":!1,trigger:"click"}},[i("div",{staticClass:"select-user-board"},[i("div",{staticClass:"derpartment-select"},[i("div",{staticClass:"title"},[e._v("\n "+e._s(e.$z("单位选择","b2.common.unit_selection"))+"\n ")]),e._v(" "),i("select-unit",{attrs:{uiType:"list",fieldConf:e.fieldConf,formDefId:e.formDefId,orgInfo:e.orgInfo},on:{change:e.handleUnitChange}})],1),e._v(" "),i("div",{staticClass:"staff-select"},[i("div",{staticClass:"title"},[e._v("\n "+e._s(e.$z("人员选择","b2.common.person_select"))+"\n ")]),e._v(" "),i("el-input",{staticClass:"search-input",attrs:{"prefix-icon":"el-icon-search",placeholder:e.$z("输入关键字搜索","c.search_tip")},on:{input:e.searchStaff},model:{value:e.staff_search_str,callback:function(t){e.staff_search_str=t},expression:"staff_search_str"}}),e._v(" "),i("div",{staticClass:"staff-select-list"},[e.isMultiple?i("el-checkbox-group",{on:{change:e.onUnitChildsChange},model:{value:e.unitChildCurVal,callback:function(t){e.unitChildCurVal=t},expression:"unitChildCurVal"}},e._l(e.unitChildsOptions,function(t){return i("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])}),1):i("el-radio-group",{on:{change:e.onUnitChildsChange},model:{value:e.unitChildCurVal,callback:function(t){e.unitChildCurVal=t},expression:"unitChildCurVal"}},e._l(e.unitChildsOptions,function(t){return i("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])}),1)],1)],1)]),e._v(" "),i("div",{staticClass:"select-item-box",attrs:{slot:"reference"},slot:"reference"},[e.selectedItems.length>0?[e._l(e.selectedItems,function(t,s){return[s<e.default_show_max?i("el-tag",{key:t.value,attrs:{size:"small",closable:""},on:{close:function(i){return e.delItem(t)}}},[e._v("\n "+e._s(t.label)+"\n ")]):e._e()]})]:i("div",{staticClass:"placeholder"},[i("span",[e._v(e._s(e.$z("请选择","c.please_select")))])]),e._v(" "),e.selectedItems.length>e.default_show_max?[i("el-dropdown",{attrs:{size:"mini","hide-on-click":!1}},[i("el-button",{attrs:{size:"mini"}},[e._v("\n "+e._s(e.$z("查看更多","c.see_more"))+"("+e._s(e.selectedItems.length-e.default_show_max)+")"),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e._l(e.selectedItems,function(t,s){return[s>=e.default_show_max?i("el-dropdown-item",{key:t.value},[i("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[i("span",[e._v(" "+e._s(t.label))]),e._v(" "),i("i",{staticClass:"el-icon-close",on:{click:function(i){return e.delItem(t)}}})])]):e._e()]})],2)],1)]:e._e()],2)])],1)};v._withStripped=!0,s().use(n.Select),s().use(n.Option);var g={props:["type","value","fieldConf","row","formName","formDefId","orgInfo","dm","isMultiple"],components:{SelectUnit:d},data(){return{curVal:"",selectedItems:[],select_team:"",options:[],keyword:"",unit:{search_type:"",org_id:""},staff_search_str:"",unitVisible:!1,default_show_max:7,unitChildCurVal:"",unitChildsOptions:[],curValInterval:null}},watch:{curVal(e){this.curValInterval&&clearInterval(this.curValInterval),this.curValInterval=setInterval(()=>{this.options&&this.options.length>0&&(this.setSelectedItems(e),clearInterval(this.curValInterval))},500)},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(){const e=this.fieldConf.perm||{visible:!0};(e.visible||e.editable)&&this.loadSelectOpts(),this.curVal=this.value},methods:{setSelectedItems(e){let t=[];_.each(this.options,i=>{this.isMultiple?_.includes(e,i.value)&&t.push(i):e==i.value&&t.push(i)}),this.selectedItems=t,this._setUnitChildCurVal(this.curVal)},searchStaff(){this.select_team?this._debounceFun(this):this.options.length<100?this.unitChildsOptions=_.filter(this.options,e=>{if(-1!=_.lowerCase(e.label).indexOf(_.lowerCase(this.staff_search_str)))return e}):this._debounceFun(this)},_debounceFun:_.debounce(async e=>{e.remoteMethod(e.staff_search_str)},1e3,{leading:!1,trailing:!0}),delItem(e){this.curVal=_.filter(this.curVal,t=>{if(t!=e.value)return!0}),this._setUnitChildCurVal(this.curVal),this.onChange(this.curVal)},async loadRemoteLabel(){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],i=_.get(this.fieldConf,"id");if(!_.isEmpty(t)){t=_.isArray(t)?t:[t];let e=await this.$bpm.fetchLabelByValues(t,i,this.formName,this.row);if(e=-1!=e.indexOf(",")?e.split(","):e.split(","),e&&e.length>0){let t=[];if(_.isArray(this.curVal))for(let i=0;i<this.curVal.length;i++)t.push({label:e[i],value:this.curVal[i]});else t.push({label:e[0],value:this.curVal});this.options=t,this.selectedItems=t}}}finally{console.log("finally")}},handleUnitChange(e){if(this.select_team=e,e){let t=_.split(e,"$"),i=_.get(t,"0"),s=_.get(t,"1");this.unit={search_type:i,org_id:s},this.loadSelectOpts("",JSON.stringify(this.unit))}else this.unitChildsOptions=this.options,this._setUnitChildCurVal(this.curVal)},remoteMethod(e){let t="";this.showUnit&&this.unit.search_type&&(t=JSON.stringify(this.unit)),this.loadSelectOpts(e,t,!1)},async loadSelectOpts(e="",t="",i=!0){let s,l=this.fieldConf.id,a={q:e,spec:t};if("UserTaskCC"===this.fieldConf.type){const e=this.fieldConf.node;s=await o.A.assistUserTaskCC.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,node:e,orgInfo:this.orgInfo,isDm:this.dm},a)}else s=await o.A.assistField.searchSelectOpts(this.$bpm,{formDefId:this.formDefId,fieldDefId:l,orgInfo:this.orgInfo,isDm:this.dm},a);const n=_.get(s.data,"data.data",[]);return this.transformOptions(n,i)},transformOptions(e,t=!0){let i=_.map(e,e=>({value:e[0],label:e[1]}));return this.options=this.options.concat(i),this.options=_.uniqBy(this.options,"value"),this.showUnit?(this.options=this.options.concat(i),this.options=_.uniqBy(this.options,"value"),this.unitChildsOptions=i,t&&this._setUnitChildCurVal(this.curVal)):this.options=i,i},_setUnitChildCurVal(e){if(this.isMultiple){let t=[];_.each(e,e=>{_.find(this.unitChildsOptions,{value:e})&&t.push(e)}),this.unitChildCurVal=t}else this.unitChildCurVal=e},onChange(e){this.$emit("input",e),this.$emit("change",e)},onUnitChildsChange(e){if(this.isMultiple){_.each(e,e=>{_.isArray(this.curVal)?_.includes(this.curVal,e)||this.curVal.push(e):this.curVal=[e]});let t=[];_.each(this.curVal,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)}},beforeDestroy(){this.curValInterval&&clearInterval(this.curValInterval),this._debounceFun&&this._debounceFun.cancel&&this._debounceFun.cancel()}},C=(0,c.A)(g,v,[],!1,null,null,null);C.options.__file="components/lib/bpmSelectUser/src/part/editor_mode_2.vue";var y=C.exports,b={mixins:[l(4967).A]},w=(0,c.A)(b,void 0,void 0,!1,null,null,null);w.options.__file="components/lib/bpmSelectUser/src/part/reader.vue";var V=w.exports,I={name:"BpmSelectFromField",components:{editorComponent:m,readerComponent:V,editorURComponent: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?V:"SelectURUser"==this.type||"MulSelectURUser"==this.type?y:m},multiple(){let e=this.isMultiple||0===this.type.indexOf("Mul");return"UserTaskCC"===this.type&&this.fieldConf.selecter&&(e=0===(this.fieldConf.selecter.type||"MulSelectUser4CC").indexOf("Mul")),e}},watch:{value(){this.curVal=this.value}},mounted(){this.curVal=this.value},methods:{handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},O=(0,c.A)(I,e,[],!1,null,null,null);O.options.__file="components/lib/bpmSelectUser/src/main.vue";var S=O.exports;S.install=function(e){e.component(S.name,S)};var $=S}(),a}()});
|