(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7c4624a4"],{4851:function(e,t,n){},"5dce":function(e,t,n){"use strict";var r=n("4851"),i=n.n(r);i.a},"72bc":function(e,t,n){"use strict";var r=n("e57d"),i=n.n(r);i.a},c318:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"components-input-demo-presuffix"},[n("a-input",{attrs:{placeholder:"请点击选择车间",readOnly:"",disabled:e.disabled},on:{click:e.openModal},model:{value:e.textVals,callback:function(t){e.textVals=t},expression:"textVals"}},[n("a-icon",{attrs:{slot:"prefix",type:"cluster",title:"车间选择控件"},slot:"prefix"}),e.storeVals?n("a-icon",{attrs:{slot:"suffix",type:"close-circle",title:"清空"},on:{click:e.handleEmpty},slot:"suffix"}):e._e()],1),n("j-select-production-modal",{ref:"innerDepartSelectModal",attrs:{"modal-width":e.modalWidth,multi:e.multi,rootOpened:e.rootOpened,"production-id":e.value,store:e.storeField,text:e.textField,treeProductOpera:e.treeProductOpera},on:{ok:e.handleOK,initComp:e.initComp}})],1)},i=[],a=n("c3b6"),o=n("a9c5");function c(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=s(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function s(e,t){if(e){if("string"===typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u={name:"JSelectProduction",components:{JSelectProductionModal:a["default"]},props:{modalWidth:{type:Number,default:500,required:!1},multi:{type:Boolean,default:!1,required:!1},rootOpened:{type:Boolean,default:!0,required:!1},value:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},customReturnField:{type:String,default:""},backProduction:{type:Boolean,default:!1,required:!1},store:{type:String,default:"id",required:!1},text:{type:String,default:"productionName",required:!1},treeProductOpera:{type:Boolean,default:!1,required:!1}},data:function(){return{visible:!1,confirmLoading:!1,storeVals:"",textVals:""}},computed:{storeField:function(){var e=this.customReturnField;return e||(e=this.store),Object(o["c"])(e)},textField:function(){return Object(o["c"])(this.text)}},mounted:function(){this.storeVals=this.value},watch:{value:function(e){this.storeVals=e}},methods:{initComp:function(e){this.textVals=e},backProductInfo:function(){if(!0===this.backProduction&&this.storeVals&&this.storeVals.length>0){for(var e=this.storeVals.split(","),t=this.textVals.split(","),n=[],r=0;r<e.length;r++)n.push({value:e[r],text:t[r]});this.$emit("back",n)}},openModal:function(){this.$refs.innerDepartSelectModal.show()},handleOK:function(e){if(!e&&e.length<=0)this.textVals="",this.storeVals="";else{var t,n=[],r=[],i=c(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;n.push(a[this.storeField]),r.push(a[this.textField])}}catch(o){i.e(o)}finally{i.f()}this.storeVals=n.join(","),this.textVals=r.join(",")}this.$emit("change",this.storeVals),this.backProductInfo()},getDepartNames:function(){return this.departNames},handleEmpty:function(){this.handleOK("")}},model:{prop:"value",event:"change"}},d=u,h=(n("5dce"),n("2877")),f=Object(h["a"])(d,r,i,!1,null,"6af1d7b1",null);t["default"]=f.exports},c3b6:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("j-modal",{attrs:{title:"选择车间",width:e.modalWidth,visible:e.visible,confirmLoading:e.confirmLoading,wrapClassName:"j-production-select-modal",switchFullscreen:"",cancelText:"关闭"},on:{ok:e.handleSubmit,cancel:e.handleCancel,"update:fullscreen":e.isFullscreen}},[n("a-spin",{attrs:{tip:"Loading...",spinning:!1}},[n("a-input-search",{staticStyle:{"margin-bottom":"1px"},attrs:{placeholder:"请输入车间名称按回车进行搜索"},on:{search:e.onSearch}}),n("a-tree",{class:e.treeScreenClass,attrs:{checkable:"",treeData:e.treeData,checkStrictly:e.checkStrictly,autoExpandParent:e.autoExpandParent,expandedKeys:e.expandedKeys,checkedKeys:e.checkedKeys},on:{check:e.onCheck,select:e.onSelect,expand:e.onExpand},scopedSlots:e._u([{key:"title",fn:function(t){var r=t.title;return[r.indexOf(e.searchValue)>-1?n("span",[e._v("\n "+e._s(r.substr(0,r.indexOf(e.searchValue)))+"\n "),n("span",{staticStyle:{color:"#f50"}},[e._v(e._s(e.searchValue))]),e._v("\n "+e._s(r.substr(r.indexOf(e.searchValue)+e.searchValue.length))+"\n ")]):n("span",[e._v(e._s(r))])]}}])})],1)],1)},i=[],a=n("4ec3");function o(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=l(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function c(e){return d(e)||u(e)||l(e)||s()}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,t){if(e){if("string"===typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function u(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function d(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f={name:"JSelectProductionModal",props:["modalWidth","multi","rootOpened","productionId","store","text","treeOpera"],data:function(){return{visible:!1,confirmLoading:!1,treeData:[],autoExpandParent:!0,expandedKeys:[],dataList:[],checkedKeys:[],checkedRows:[],searchValue:"",checkStrictly:!1,fullscreen:!1}},created:function(){this.loadDepart()},watch:{productionId:function(){this.initDepartComponent()},visible:{handler:function(){this.initDepartComponent(!0)}}},computed:{treeScreenClass:function(){return{"my-dept-select-tree":!0,fullscreen:this.fullscreen}}},methods:{show:function(){this.visible=!0,this.checkedRows=[],this.checkedKeys=[]},loadDepart:function(){var e=this;Object(a["M"])().then((function(t){if(t.success){var n=c(t.result);e.reWriterWithSlot(n),e.treeData=n,e.initDepartComponent(),e.rootOpened&&e.initExpandedKeys(t.result)}}))},initDepartComponent:function(e){var t=[],n=1==e?"key":this.text;if(this.productionId){var r,i=this.productionId.split(","),a=o(this.dataList);try{for(a.s();!(r=a.n()).done;){var c=r.value;i.indexOf(c[this.store])>=0&&t.push(c[n])}}catch(s){a.e(s)}finally{a.f()}}1==e?this.checkedKeys=[].concat(t):this.$emit("initComp",t.join(","))},reWriterWithSlot:function(e){var t,n=o(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.children&&r.children.length>0){this.reWriterWithSlot(r.children);var i=Object.assign({},r);i.children={},this.dataList.push(i)}else this.dataList.push(r),r.scopedSlots={title:"title"}}}catch(a){n.e(a)}finally{n.f()}},initExpandedKeys:function(e){if(e&&e.length>0){var t,n=[],r=o(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.children&&i.children.length>0&&n.push(i.id)}}catch(a){r.e(a)}finally{r.f()}this.expandedKeys=[].concat(n)}else this.expandedKeys=[]},onCheck:function(e,t){var n=this;if(this.multi)this.checkStrictly?this.checkedKeys=e.checked:this.checkedKeys=e,this.checkedRows=this.getCheckedRows(this.checkedKeys);else{var r=e.checked.filter((function(e){return n.checkedKeys.indexOf(e)<0}));this.checkedKeys=c(r),this.checkedRows=0===this.checkedKeys.length?[]:[t.node.dataRef]}},onSelect:function(e,t){if(this.checkStrictly){var n=[];if(n.push(e[0]),this.checkedKeys&&0!==this.checkedKeys.length&&this.multi){var r,i=t.node.dataRef.key;if(this.checkedKeys.indexOf(i)>=0)this.checkedKeys=this.checkedKeys.filter((function(e){return e!==i}));else(r=this.checkedKeys).push.apply(r,n)}else this.checkedKeys=[].concat(n),this.checkedRows=[t.node.dataRef];this.checkedRows=this.getCheckedRows(this.checkedKeys)}},onExpand:function(e){this.expandedKeys=e,this.autoExpandParent=!1},handleSubmit:function(){if(this.checkedKeys&&0!=this.checkedKeys.length){var e=this.getCheckedRows(this.checkedKeys),t=this.checkedKeys.join(",");this.$emit("ok",e,t)}else this.$emit("ok","");this.handleClear()},handleCancel:function(){this.handleClear()},handleClear:function(){this.visible=!1,this.checkedKeys=[]},getParentKey:function(e,t){for(var n,r=0;r<t.length;r++){var i=t[r];i.children&&(i.children.some((function(t){return t.key===e}))?n=i.key:this.getParentKey(e,i.children)&&(n=this.getParentKey(e,i.children)))}return n},onSearch:function(e){var t=this,n=this.dataList.map((function(n){return n.title.indexOf(e)>-1?t.getParentKey(n.key,t.treeData):null})).filter((function(e,t,n){return e&&n.indexOf(e)===t}));Object.assign(this,{expandedKeys:n,searchValue:e,autoExpandParent:!0})},getCheckedRows:function(e){var t,n=function e(t,n){var r,i=o(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.id===n)return a;if(a.children instanceof Array){var c=e(a.children,n);if(null!=c)return c}}}catch(s){i.e(s)}finally{i.f()}return null},r=[],i=o(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,c=n(this.treeData,a);null!=c&&r.push(c)}}catch(s){i.e(s)}finally{i.f()}return r},switchCheckStrictly:function(e){1==e?this.checkStrictly=!1:2==e&&(this.checkStrictly=!0)},isFullscreen:function(e){this.fullscreen=e}}},p=f,y=(n("72bc"),n("2877")),m=Object(y["a"])(p,r,i,!1,null,"0f208d9f",null);t["default"]=m.exports},e57d:function(e,t,n){}}]);
|