| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-56b37b26"],{"09f4":function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),Math.easeInOutQuad=function(t,e,n,a){return t/=a/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function i(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(t,e,n){var o=s(),r=t-o,c=20,l=0;e="undefined"===typeof e?500:e;var u=function t(){l+=c;var s=Math.easeInOutQuad(l,o,r,e);i(s),l<e?a(t):n&&"function"===typeof n&&n()};u()}},"10c7":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{staticClass:"tenant-view",attrs:{title:t.$t("common.view"),width:t.width,visible:t.isVisible},on:{"update:visible":function(e){t.isVisible=e}}},[n("el-row",{attrs:{gutter:10}},[n("el-col",{attrs:{xs:24,sm:24}},[n("div",{staticClass:"img-wrapper"},[n("img",{attrs:{src:t.tenant.logo}})])])],1),t._v(" "),n("el-row",{attrs:{gutter:10}},[n("el-col",{attrs:{xs:24,sm:12}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-user"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.tenant.code")+":"))]),t._v("\n "+t._s(t.tenant.code)+"\n ")])]),t._v(" "),n("el-col",{attrs:{xs:24,sm:12}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-suitcase"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.tenant.name")+":"))]),t._v("\n "+t._s(t.tenant.name)+"\n ")])])],1),t._v(" "),n("el-row",{attrs:{gutter:10}},[n("el-col",{attrs:{xs:24,sm:12}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-trophy"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.tenant.type")+":"))]),t._v("\n "+t._s(t.tenant.type.desc)+"\n ")])]),t._v(" "),n("el-col",{attrs:{xs:24,sm:12}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-phone-outline"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.tenant.status")+":"))]),t._v("\n "+t._s(t.tenant.status.desc)+"\n ")])])],1),t._v(" "),n("el-row",{attrs:{gutter:10}},[n("el-col",{attrs:{xs:24,sm:12}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-star-off"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.tenant.duty")+":"))]),t._v("\n "+t._s(t.tenant.duty)+"\n ")])]),t._v(" "),n("el-col",{attrs:{xs:24,sm:12}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-bangzhu"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.tenant.expirationTime")+":"))]),t._v("\n "+t._s(t.tenant.expirationTime?t.tenant.expirationTime:"永久")+"\n ")])])],1),t._v(" "),n("el-row",{attrs:{gutter:10}},[n("el-col",{attrs:{xs:24,sm:12}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-time"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.createTime")+":"))]),t._v("\n "+t._s(t.tenant.createTime)+"\n ")])]),t._v(" "),n("el-col",{attrs:{xs:24,sm:12}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-brush"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.updateTime")+":"))]),t._v("\n "+t._s(t.tenant.updateTime)+"\n ")])])],1),t._v(" "),n("el-row",{attrs:{gutter:10}},[n("el-col",{attrs:{xs:24,sm:24}},[n("div",{staticClass:"view-item"},[n("i",{staticClass:"el-icon-date"}),t._v(" "),n("span",[t._v(t._s(t.$t("table.tenant.describe")+":"))]),t._v("\n "+t._s(t.tenant.describe)+"\n ")])])],1)],1)},i=[],s=n("5530"),o={name:"TenantView",filters:{passwordErrorLockTimeFilter:function(t){return"0"===t?"当天23点59分":t}},props:{dialogVisible:{type:Boolean,default:!1}},data:function(){return{screenWidth:0,width:this.initWidth(),tenant:{type:{desc:""},status:{desc:""}}}},computed:{isVisible:{get:function(){return this.dialogVisible},set:function(){this.close()}}},mounted:function(){var t=this;window.onresize=function(){return function(){t.width=t.initWidth()}()}},methods:{initWidth:function(){return this.screenWidth=document.body.clientWidth,this.screenWidth<550?"95%":this.screenWidth<990?"580px":this.screenWidth<1400?"600px":"650px"},setTenant:function(t){this.tenant=Object(s["a"])({},t)},close:function(){this.$emit("close")}}},r=o,c=(n("49a0"),n("2877")),l=Object(c["a"])(r,a,i,!1,null,"a2b0d48e",null);e["default"]=l.exports},1720:function(t,e,n){"use strict";var a=n("d7fc"),i=n.n(a);i.a},1771:function(t,e,n){"use strict";n.d(e,"f",(function(){return c})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return h})),n.d(e,"e",(function(){return f}));var a=n("5530"),i=(n("aef6"),n("f559"),n("28a5"),n("6762"),n("2fdb"),n("b85c")),s=n("c2cf"),o=n("ebb5"),r=void 0,c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"===typeof t&&(t=[t]),t&&t.length>0&&s["a"].enums({codes:t}).then((function(n){var a,s=n.data,o=Object(i["a"])(t);try{for(o.s();!(a=o.n()).done;){var r=a.value;e[r]=s.data[r]}}catch(c){o.e(c)}finally{o.f()}}))},l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(t,e)},u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c(t,e)},d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"===typeof t&&(t=[t]),t&&t.length>0&&o["a"].list({codes:t}).then((function(n){var a,s=n.data,o=Object(i["a"])(t);try{for(o.s();!(a=o.n()).done;){var r=a.value;e[r]=s.data[r]}}catch(c){o.e(c)}finally{o.f()}}))},h=function(t){var e=t.data,n=e.type;if(n.includes("application/json")){var a=new FileReader;a.onload=function(t){if(2===t.target.readyState){var e=JSON.parse(t.target.result);r.$message({message:e.msg,type:"warning"})}},a.readAsText(e)}else{var i=t.headers["content-disposition"],s="下载文件.zip";if(i)for(var o=i.split(";"),c=0;c<o.length;c++){var l=o[c];if(null!==l&&""!==l){var u=l.split("=");if(null!==u&&u.length>0&&"filename"===u[0].trim().toLowerCase()){s=decodeURI(u[1]);break}}}(s.startsWith("'")||s.startsWith('"'))&&(s.endsWith("'")||s.endsWith('"'))&&(s=s.substring(1,s.length-1));var d=new Blob([e]),h=document.createElement("a");h.href=window.URL.createObjectURL(d),h.download=s,h.click(),window.URL.revokeObjectURL(h.href)}},f=function(t){var e={size:10,current:1,sort:"id",order:"descending",model:{},map:{},timeRange:null};return t?Object(a["a"])(Object(a["a"])({},e),t):e}},"1e3c":function(t,e,n){"use strict";var a=n("e413"),i=n.n(a);i.a},"2f21":function(t,e,n){"use strict";var a=n("79e5");t.exports=function(t,e){return!!t&&a((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},"324f":function(t,e,n){},"49a0":function(t,e,n){"use strict";var a=n("324f"),i=n.n(a);i.a},5575:function(t,e,n){},"55dd":function(t,e,n){"use strict";var a=n("5ca1"),i=n("d8e8"),s=n("4bf8"),o=n("79e5"),r=[].sort,c=[1,2,3];a(a.P+a.F*(o((function(){c.sort(void 0)}))||!o((function(){c.sort(null)}))||!n("2f21")(r)),"Array",{sort:function(t){return void 0===t?r.call(s(this)):r.call(s(this),i(t))}})},7016:function(t,e,n){"use strict";var a=n("5575"),i=n.n(a);i.a},a888:function(t,e,n){"use strict";n("a481"),n("6762"),n("2fdb");var a={bind:function(t,e,n){var a=t.querySelector(".el-dialog__header"),i=t.querySelector(".el-dialog");a.style.cssText+=";cursor:move;",i.style.cssText+=";top:0px;";var s=function(){return window.document.currentStyle?function(t,e){return t.currentStyle[e]}:function(t,e){return getComputedStyle(t,!1)[e]}}();a.onmousedown=function(t){var e=t.clientX-a.offsetLeft,o=t.clientY-a.offsetTop,r=i.offsetWidth,c=i.offsetHeight,l=document.body.clientWidth,u=document.body.clientHeight,d=i.offsetLeft,h=l-i.offsetLeft-r,f=i.offsetTop,p=u-i.offsetTop-c,m=s(i,"left"),b=s(i,"top");m.includes("%")?(m=+document.body.clientWidth*(+m.replace(/\%/g,"")/100),b=+document.body.clientHeight*(+b.replace(/\%/g,"")/100)):(m=+m.replace(/\px/g,""),b=+b.replace(/\px/g,"")),document.onmousemove=function(t){var a=t.clientX-e,s=t.clientY-o;-a>d?a=-d:a>h&&(a=h),-s>f?s=-f:s>p&&(s=p),i.style.cssText+=";left:".concat(a+m,"px;top:").concat(s+b,"px;"),n.child.$emit("dragDialog")},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null}}}},i=function(t){t.directive("el-drag-dialog",a)};window.Vue&&(window["el-drag-dialog"]=a,Vue.use(i)),a.install=i;e["a"]=a},aef6:function(t,e,n){"use strict";var a=n("5ca1"),i=n("9def"),s=n("d2c8"),o="endsWith",r=""[o];a(a.P+a.F*n("5147")(o),"String",{endsWith:function(t){var e=s(this,t,o),n=arguments.length>1?arguments[1]:void 0,a=i(e.length),c=void 0===n?a:Math.min(i(n),a),l=String(t);return r?r.call(e,l,c):e.slice(c-l.length,c)===l}})},c2cf:function(t,e,n){"use strict";var a=n("5530"),i=n("9256"),s=n("5657"),o={generateId:{url:"/authority/common/generateId",method:"GET"}};e["a"]={uploadFile:"".concat("http://106.14.142.95:10000").concat("/api","/file/attachment/upload"),enums:function(t){return Object(i["a"])({method:"GET",url:"/oauth/enums",data:t})},export:function(t,e){return Object(i["a"])({method:"POST",url:t,responseType:"blob",data:e})},loadImg:function(t){var e=s["a"].get("TOKEN",""),n=s["a"].get("TENANT","");return"".concat("http://106.14.142.95:10000").concat("/api","/file/attachment/download/").concat(t.bizType,"/").concat(t.bizId,"?token=").concat(e,"&tenant=").concat(n)},generateId:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},o.generateId),{},{data:t}))},getAttachment:function(t){return Object(i["a"])({url:"/file/attachment",method:"get",data:t})},deleteAttachment:function(t){return Object(i["a"])({url:"/file/attachment",method:"delete",data:t})},downloadAttachment:function(t){return Object(i["a"])({url:"/file/attachment/download",method:"get",responseType:"blob",data:t})},downloadAttachmentBiz:function(t){return Object(i["a"])({url:"/file/attachment/download/biz",method:"get",responseType:"blob",data:t})}}},c3e0:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{attrs:{"close-on-click-modal":!1,"close-on-press-escape":!1,title:t.title,visible:t.isVisible,width:t.width,top:"50px"},on:{"update:visible":function(e){t.isVisible=e}}},[n("el-form",{ref:"form",attrs:{model:t.tenant,rules:t.rules,"label-position":"right","label-width":"130px"}},[n("el-form-item",{attrs:{label:"产线名称:",prop:"name"}},[n("el-input",{staticStyle:{width:"93%"},attrs:{disabled:"edit"===t.type},model:{value:t.tenant.name,callback:function(e){t.$set(t.tenant,"name",e)},expression:"tenant.name"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"产线编码:",prop:"code"}},[n("el-input",{staticStyle:{width:"93%"},model:{value:t.tenant.code,callback:function(e){t.$set(t.tenant,"code",e)},expression:"tenant.code"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"类型:",prop:"type"}},[[n("el-radio",{attrs:{label:"0"},model:{value:t.tenant.type,callback:function(e){t.$set(t.tenant,"type",e)},expression:"tenant.type"}},[t._v("柔性")]),t._v(" "),n("el-radio",{attrs:{label:"1"},model:{value:t.tenant.type,callback:function(e){t.$set(t.tenant,"type",e)},expression:"tenant.type"}},[t._v("刚性")])]],2),t._v(" "),n("el-form-item",{attrs:{label:"状态:",prop:"status"}},[[n("el-radio",{attrs:{label:"1"},model:{value:t.tenant.status,callback:function(e){t.$set(t.tenant,"status",e)},expression:"tenant.status"}},[t._v("启用")]),t._v(" "),n("el-radio",{attrs:{label:"0"},model:{value:t.tenant.status,callback:function(e){t.$set(t.tenant,"status",e)},expression:"tenant.status"}},[t._v("停用")])]],2),t._v(" "),n("el-form-item",{attrs:{label:"描述:",prop:"remark"}},[n("el-input",{staticStyle:{width:"93%"},attrs:{type:"textarea",rows:5},model:{value:t.tenant.remark,callback:function(e){t.$set(t.tenant,"remark",e)},expression:"tenant.remark"}}),t._v(" "),n("el-tooltip",{staticClass:"item",attrs:{content:"不超过500个字符。",effect:"dark",placement:"top-end"}},[n("i",{staticClass:"el-icon-question"})])],1)],1),t._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{plain:"",type:"warning"},on:{click:function(e){t.isVisible=!1}}},[t._v(t._s(t.$t("common.cancel")))]),t._v(" "),n("el-button",{attrs:{plain:"",type:"primary",disabled:t.confirmDisabled},on:{click:t.submitForm}},[t._v(t._s(t.$t("common.confirm")))])],1)],1)},i=[],s=n("5530"),o=(n("c2cf"),n("5657"),n("d679")),r=n("b170"),c=(n("27ae"),{name:"TenantEdit",props:{dialogVisible:{type:Boolean,default:!1},title:{type:String,default:""},factoryId:{type:String,default:""},enterpriseId:{type:String,default:""}},data:function(){var t=this;return{type:"add",updateFileData:{bizType:"TENANT_LOGO",bizId:""},tenant:this.initTenant(),screenWidth:0,width:this.initWidth(),confirmDisabled:!1,roles:[],rules:{name:[{required:!0,message:"产线名称必填",trigger:"blur"}],code:[{required:!0,message:"产线编码必填",trigger:"blur"},{min:1,max:50,message:this.$t("rules.range4to10"),trigger:"blur"},{validator:function(e,n,a){"add"===t.type?Object(r["d"])(n)?a():a("产线编码只能是字母、数字或_"):a()},trigger:"blur"}]}}},computed:{isVisible:{get:function(){return this.dialogVisible},set:function(){this.close(),this.reset()}}},mounted:function(){var t=this;window.onresize=function(){return function(){t.width=t.initWidth()}()}},methods:{initTenant:function(){return{id:"",code:"",name:"",status:"1",remark:""}},initWidth:function(){return this.screenWidth=document.body.clientWidth,this.screenWidth<991?"90%":this.screenWidth<1400?"45%":"800px"},setTenant:function(t){this.tenant=Object(s["a"])({},t),this.updateFileData.bizId=this.tenant.id},close:function(){this.$emit("close")},submitForm:function(){var t=this;this.$refs.form.validate((function(e){if(!e)return!1;t.confirmDisabled=!0,"add"===t.type?(t.tenant.workshopId=t.factoryId,t.tenant.tenantId=t.enterpriseId,t.save()):t.update()}))},save:function(){var t=this;o["a"].save(this.tenant).then((function(e){var n=e.data;n.isSuccess&&(t.isVisible=!1,t.$message({message:t.$t("tips.createSuccess"),type:"success"}),t.$emit("success"))})).finally((function(){return t.confirmDisabled=!1,!0}))},update:function(){var t=this;o["a"].update(this.tenant).then((function(e){var n=e.data;n.isSuccess&&(t.isVisible=!1,t.$message({message:t.$t("tips.updateSuccess"),type:"success"}),t.$emit("success"))})).finally((function(){return t.confirmDisabled=!1,!0}))},reset:function(){this.$refs.form.clearValidate(),this.$refs.form.resetFields(),this.tenant=this.initTenant()}}}),l=c,u=(n("1720"),n("2877")),d=Object(u["a"])(l,a,i,!1,null,null,null);e["default"]=d.exports},d5b4:function(t,e,n){"use strict";var a=n("5530"),i=n("9256"),s={getList:{method:"POST",url:"/authority/factory/all"},page:{method:"POST",url:"/authority/factory/page"},save:{method:"POST",url:"/authority/factory"},update:{method:"POST",url:"/authority/factory/update"},remove:{method:"POST",url:"/authority/factory/delete"},updateStatus:{method:"POST",url:"/authority/factory/updateStatus"}};e["a"]={getList:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.getList),{},{data:t}))},page:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.page),{},{data:t}))},save:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.save),{},{data:t}))},update:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.update),{},{data:t}))},remove:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.remove),{},{data:t}))},updateStatus:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.updateStatus),{},{data:t}))},getFactoryTree:function(t){return Object(i["a"])({method:"GET",url:"/authority/factory/factoryTree/".concat(t)})}}},d679:function(t,e,n){"use strict";var a=n("5530"),i=n("9256"),s={getList:{method:"POST",url:"/authority/productionline/all"},page:{method:"POST",url:"/authority/productionline/page"},save:{method:"POST",url:"/authority/productionline"},update:{method:"POST",url:"/authority/productionline/update"},remove:{method:"DELETE",url:"/authority/productionline"},removeMore:{method:"POST",url:"/authority/productionline/delete"},updateStatus:{method:"POST",url:"/authority/productionline/updateStatus"}};e["a"]={getList:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.getList),{},{data:t}))},page:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.page),{},{data:t}))},save:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.save),{},{data:t}))},update:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.update),{},{data:t}))},remove:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.remove),{},{data:t}))},removeMore:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.removeMore),{},{data:t}))},updateStatus:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.updateStatus),{},{data:t}))},detail:function(t){return Object(i["a"])({method:"GET",url:"/authority/workshop/".concat(t)})}}},d7fc:function(t,e,n){},e413:function(t,e,n){},ebb5:function(t,e,n){"use strict";var a=n("5530"),i=n("9256"),s={page:{method:"POST",url:"/authority/dictionaryItem/page"},update:{method:"PUT",url:"/authority/dictionaryItem"},save:{method:"POST",url:"/authority/dictionaryItem"},delete:{method:"DELETE",url:"/authority/dictionaryItem"},list:{method:"GET",url:"/oauth/dictionaryItem/codes"},preview:{method:"POST",url:"/authority/dictionaryItem/preview"},export:{method:"POST",url:"/authority/dictionaryItem/export"},import:{method:"POST",url:"/authority/dictionaryItem/import"}};e["a"]={page:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.page),{},{data:t}))},save:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.save),{},{data:t}))},update:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.update),{},{data:t}))},delete:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.delete),{},{data:t}))},list:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.list),{},{data:t}))},preview:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.preview),{},{data:t}))},export:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.export),{},{responseType:"blob",data:t}))},import:function(t){return Object(i["a"])(Object(a["a"])(Object(a["a"])({},s.import),{},{data:t}))}}},fb82:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-row",{staticClass:"filter-container",attrs:{gutter:20}},[n("el-col",{attrs:{span:6}},[n("el-input",{attrs:{placeholder:"输入关键字进行过滤",size:"medium"},model:{value:t.filterText,callback:function(e){t.filterText=e},expression:"filterText"}}),t._v(" "),n("el-tree",{ref:"tree",staticClass:"filter-tree",attrs:{data:t.treeData,props:t.defaultProps,"default-expand-all":"","show-checkbox":"","node-key":"id","check-strictly":!0,"expand-on-click-node":!0,"filter-node-method":t.filterNode},on:{"node-click":t.handleNodeClick,check:t.checkBoxFun},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.node;e.data;return n("span",{staticClass:"custom-tree-node"},[n("span",{staticClass:"treeTitleSpan",attrs:{title:a.label}},[t._v(t._s(a.label))]),t._v(" "),n("span",{staticClass:"tiaozhuanA"},[n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return t.goMeun(a)}}},[t._v("\n\t\t Go\n\t\t ")])],1)])}}])})],1),t._v(" "),n("el-col",{attrs:{span:18}},[n("el-row",{staticClass:"filter-container"},[n("el-col",[n("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"medium"},on:{click:t.add}},[t._v("新增产线")]),t._v(" "),n("el-button",{attrs:{type:"success",icon:"el-icon-edit",size:"medium"},on:{click:t.editOne}},[t._v("修改产线")]),t._v(" "),n("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"medium"},on:{click:t.tableDelete}},[t._v("删除产线")]),t._v(" "),n("el-button",{attrs:{type:"primary",icon:"el-icon-check",size:"medium"},on:{click:function(e){return t.updateActiveStatus("1")}}},[t._v(t._s(t.$t("table.qiyong")))]),t._v(" "),n("el-button",{attrs:{type:"info",icon:"el-icon-warning-outline",size:"medium"},on:{click:function(e){return t.updateActiveStatus("0")}}},[t._v("停用")]),t._v(" "),n("el-button",{attrs:{type:"primary",icon:"el-icon-files",size:"medium"},on:{click:t.factoryMgr}},[t._v("边缘盒子管理")])],1)],1),t._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],key:t.tableKey,ref:"table",staticStyle:{width:"100%"},attrs:{data:t.tableData.records,border:"",fit:"","row-key":"id"},on:{"filter-change":t.filterChange,"selection-change":t.onSelectChange,"sort-change":t.sortChange,"cell-click":t.cellClick}},[n("el-table-column",{attrs:{align:"center",type:"selection",width:"40px","reserve-selection":!0}}),t._v(" "),n("el-table-column",{attrs:{prop:"name",label:"产线名称","show-overflow-tooltip":!0,width:"150px"}}),t._v(" "),n("el-table-column",{attrs:{prop:"code",label:"编号","show-overflow-tooltip":!0,align:"center",width:"100px"}}),t._v(" "),n("el-table-column",{attrs:{prop:"type",label:"类型",align:"center",width:"90px"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("el-tag",{attrs:{type:"1"==a.type?"success":"info"}},[t._v("\n\t\t \t"+t._s("1"==a.type?"刚性":"柔性")+"\n\t\t ")])]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"status",label:"状态",align:"center",width:"90px"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("el-tag",{attrs:{type:"1"==a.status?"success":"info"}},[t._v("\n\t\t \t"+t._s("1"==a.status?"启用":"停用")+"\n\t\t ")])]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"remark",label:"描述","show-overflow-tooltip":!0}}),t._v(" "),n("el-table-column",{attrs:{label:t.$t("table.operation"),fixed:"right",align:"center","column-key":"operation",width:"180px"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("el-tooltip",{staticClass:"item",attrs:{content:"边缘盒子管理",effect:"dark",placement:"top-start"}},[n("i",{staticClass:"el-icon-cpu table-operation",staticStyle:{color:"#2db7f5"},on:{click:function(e){return t.factoryRowMgr(a)}}})]),t._v(" "),n("el-tooltip",{staticClass:"item",attrs:{content:"拓扑图结",effect:"dark",placement:"top-start"}},[n("i",{staticClass:"el-icon-connection table-operation",staticStyle:{color:"#13ce66"},on:{click:function(e){return t.view(a)}}})]),t._v(" "),n("el-tooltip",{staticClass:"item",attrs:{content:"修改",effect:"dark",placement:"top-start"}},[n("i",{staticClass:"el-icon-edit table-operation",staticStyle:{color:"#2db7f5"},on:{click:function(e){return t.edit(a)}}})]),t._v(" "),n("el-tooltip",{staticClass:"item",attrs:{content:"删除",effect:"dark",placement:"top-start"}},[n("i",{staticClass:"el-icon-delete table-operation",staticStyle:{color:"#f50"},on:{click:function(e){return t.singleDelete(a)}}})]),t._v(" "),n("el-tooltip",{staticClass:"item",attrs:{content:"停用",effect:"dark",placement:"top-start"}},[n("i",{staticClass:"el-icon-warning-outline table-operation",staticStyle:{color:"#f50"},on:{click:function(e){return t.dongJieRow(a)}}})])]}}])})],1),t._v(" "),n("pagination",{directives:[{name:"show",rawName:"v-show",value:t.tableData.total>0,expression:"tableData.total > 0"}],attrs:{limit:t.queryParams.size,page:t.queryParams.current,total:Number(t.tableData.total)},on:{"update:limit":function(e){return t.$set(t.queryParams,"size",e)},"update:page":function(e){return t.$set(t.queryParams,"current",e)},pagination:t.fetch}})],1)],1),t._v(" "),n("tenant-edit",{ref:"edit",attrs:{"dialog-visible":t.dialog.isVisible,title:t.dialog.title,factoryId:t.workShopId,enterpriseId:t.enterpriseId},on:{close:t.editClose,success:t.editSuccess}}),t._v(" "),n("tenant-view",{ref:"view",attrs:{"dialog-visible":t.tenantViewVisible},on:{close:t.viewClose}}),t._v(" "),n("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{"close-on-click-modal":!1,"close-on-press-escape":!0,title:"预览",width:"80%",top:"50px",visible:t.preview.isVisible},on:{"update:visible":function(e){return t.$set(t.preview,"isVisible",e)}}},[n("el-scrollbar",[n("div",{domProps:{innerHTML:t._s(t.preview.context)}})])],1)],1)},i=[],s=(n("28a5"),n("6762"),n("2fdb"),n("55dd"),n("ac6a"),n("20d6"),n("5530")),o=(n("386d"),n("333d")),r=n("c3e0"),c=n("10c7"),l=n("d5b4"),u=n("d679"),d=n("a888"),h=n("1771"),f={name:"TenantManage",directives:{elDragDialog:d["a"]},components:{Pagination:o["a"],TenantEdit:r["default"],TenantView:c["default"]},data:function(){return{enterpriseId:"",factoryId:"",workShopId:"",queryObj:{},filterText:"",treeData:[],defaultProps:{children:"children",label:"name"},dialog:{isVisible:!1,title:""},preview:{isVisible:!1,context:""},tenantViewVisible:!1,tableKey:0,queryParams:Object(h["e"])({}),selection:[],loading:!1,tableData:{total:0},enums:{TenantTypeEnum:{},TenantStatusEnum:{}},menuUrl:["/enterpriseMgr/factoryMgr","/enterpriseMgr/workshopMgr","/enterpriseMgr/productionLineMgr","/enterpriseMgr/edgeBoxMgr","/enterpriseMgr/productionResourcesMgr"]}},created:function(){this.enterpriseId=this.$route.query.id,this.factoryId=this.$route.query.factoryId,this.queryObj=this.$route.query,this.workShopId=this.$route.query.workShopId,console.log("路由传参【产线】数据queryObj:",this.queryObj),this.getFactoryTree()},watch:{$route:function(){this.$route.fullPath.indexOf("/enterpriseMgr/productionLineMgr")>-1&&(this.queryObj=this.$route.query,console.log("产线的路由监听:",this.$route),this.$refs.table.clearSelection())},queryObj:{deep:!0,immediate:!1,handler:function(){console.log("form数据:",this.queryObj),this.enterpriseId=this.$route.query.id,this.factoryId=this.$route.query.factoryId,this.queryObj=this.$route.query,this.workShopId=this.$route.query.workShopId,this.reSearchData()}},filterText:function(t){this.$refs.tree.filter(t)}},computed:{},mounted:function(){this.fetch()},methods:{filterNode:function(t,e){return!t||-1!==e.label.indexOf(t)},handleNodeClick:function(t){console.log(t)},goMeun:function(t){var e=this;console.log("【node】-点击事件: ",t);var n="",a=this.queryObj;"1"==t.data.lev&&(n=this.menuUrl[0]),"2"==t.data.lev&&(n=this.menuUrl[1]),"3"==t.data.lev&&(n=this.menuUrl[2],a.workShopId=t.data.parentId),"4"==t.data.lev&&(n=this.menuUrl[3],a.productionLineId=t.data.parentId),"5"==t.data.lev&&(n=this.menuUrl[4],a.edgeBoxId=t.data.parentId);var i={path:n,query:a};console.log("【Go】-点击事件: ",i),n==this.$route.path?(this.workShopId=a.workShopId,this.search(),this.getFactoryTree()):this.$store.dispatch("tagsView/delView",this.$route).then((function(t){e.$router.push(i)}))},reSearchData:function(){this.search(),this.factoryId&&this.getFactoryTree()},checkBoxFun:function(t,e){console.log("【树-checkbox】node: ",this.workShopId),this.$refs.tree.setCheckedKeys([this.workShopId])},factoryMgr:function(){var t=this;this.selection.length?this.selection.length>1?this.$message({message:"请只能选择一条数据!",type:"warning"}):(this.queryObj.productionLineId=this.selection[0].id,this.$store.dispatch("tagsView/delView",this.$route).then((function(e){t.$router.push({path:"/enterpriseMgr/edgeBoxMgr",query:t.queryObj})}))):this.$message({message:"请至少选择一条数据!",type:"warning"})},factoryRowMgr:function(t){var e=this;this.queryObj.productionLineId=t.id,this.$store.dispatch("tagsView/delView",this.$route).then((function(t){e.$router.push({path:"/enterpriseMgr/edgeBoxMgr",query:e.queryObj})}))},viewClose:function(){this.tenantViewVisible=!1},editClose:function(){this.dialog.isVisible=!1},editSuccess:function(){this.search(),this.getFactoryTree()},onSelectChange:function(t){this.selection=t},search:function(){this.fetch(Object(s["a"])({},this.queryParams))},reset:function(){this.queryParams=Object(h["e"])({}),this.$refs.table.clearSort(),this.$refs.table.clearFilter(),this.search()},add:function(){this.$refs.edit.type="add",this.dialog.title=this.$t("common.add"),this.dialog.isVisible=!0},tableDelete:function(){this.selection.length?this.selection.length>1?this.$message({message:"只能选择一条数据!",type:"warning"}):this.batchDelete():this.$message({message:this.$t("tips.noDataSelected"),type:"warning"})},remove:function(){var t=this;this.$confirm("删除租户数据后,会将整个产线及其所有产线一些的数据全部删除。确认删除?",this.$t("common.tips"),{distinguishCancelAndClose:!0,confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){u["a"].removeMore(t.selection[0]).then((function(e){var n=e.data;n.isSuccess&&(t.$message({message:"删除成功",type:"success"}),t.search(),t.getFactoryTree())}))})).catch((function(){console.log("已经取消删除!")}))},singleDelete:function(t){this.$refs.table.clearSelection(),this.$refs.table.toggleRowSelection(t,!0),this.batchDelete()},batchDelete:function(){var t=this;if(this.selection.length){var e=this.selection.findIndex((function(t){return t.readonly}));e>-1?this.$message({message:this.$t("tips.systemData"),type:"warning"}):this.$confirm("删除租户数据后,会将整个产线及其所有产线一些的数据全部删除。确认删除?",this.$t("common.tips"),{distinguishCancelAndClose:!0,confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var e=[],n=!1;t.selection.forEach((function(t){t.readonly?n=!0:e.push(t.id)})),n?t.$message({message:t.$t("tips.systemData"),type:"warning"}):t.delete(e)})).catch((function(){console.log("已经取消删除!")}))}else this.$message({message:this.$t("tips.noDataSelected"),type:"warning"})},clearSelections:function(){this.$refs.table.clearSelection()},delete:function(t){var e=this;u["a"].remove({ids:t}).then((function(t){var n=t.data;n.isSuccess&&(e.$message({message:e.$t("tips.deleteSuccess"),type:"success"}),e.search(),e.getFactoryTree(),e.$refs.table.clearSelection())}))},updateActiveStatus:function(t){var e=this;if(this.selection.length)if(this.selection.length>1)this.$message({message:"请只能选择一条数据!",type:"warning"});else{var n={};n=this.selection[0],n.status=t;var a="冻结成功!";"1"==t&&(a="启用成功!"),u["a"].update(n).then((function(t){200==t.status&&(e.$message({message:a,type:"success"}),e.search())}))}else this.$message({message:"请至少选择一条数据!",type:"warning"})},dongJieRow:function(t){var e=this;this.$refs.table.clearSelection(),this.$refs.table.toggleRowSelection(t,!0);var n={};n=t,n.status="0",u["a"].update(n).then((function(t){200==t.status&&(e.$message({message:"暂停成功!",type:"success"}),e.search())}))},view:function(t){this.$refs.view.setTenant(t),this.tenantViewVisible=!0},editOne:function(){this.selection.length?this.selection.length>1?this.$message({message:"请只能选择一条数据!",type:"warning"}):(console.log("选择的数据:",this.selection[0]),this.edit(this.selection[0])):this.$message({message:"请至少选择一条数据!",type:"warning"})},edit:function(t){t.readonly?this.$message({message:this.$t("tips.systemData"),type:"warning"}):(this.$refs.edit.setTenant(t),this.$refs.edit.type="edit",this.dialog.title=this.$t("common.edit"),this.dialog.isVisible=!0)},fetch:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.loading=!0,this.queryParams.current=e.current?e.current:this.queryParams.current,this.queryParams.size=e.size?e.size:this.queryParams.size,this.queryParams.model.workshopId=this.workShopId,u["a"].page(this.queryParams).then((function(e){var n=e.data;n.isSuccess&&(t.tableData=n.data)})).finally((function(){return t.loading=!1}))},getFactoryTree:function(){var t=this;l["a"].getFactoryTree(this.factoryId).then((function(e){var n=e.data;console.log("Tree的数据:",n),n.isSuccess&&(t.treeData=n.data,t.$refs.tree.setCheckedKeys([t.workShopId]))})).finally((function(){return t.loading=!1}))},sortChange:function(t){this.queryParams.sort=t.prop,this.queryParams.order=t.order,this.queryParams.sort&&this.search()},filterChange:function(t){for(var e in t)if(e.includes(".")){var n={};n[e.split(".")[1]]=t[e][0],this.queryParams.model[e.split(".")[0]]=n}else this.queryParams.model[e]=t[e][0];this.search()},cellClick:function(t,e){var n=this;if("operation"!==e["columnKey"]){var a=!1;this.selection.forEach((function(e){e.id===t.id&&(a=!0,n.$refs.table.toggleRowSelection(t))})),a||this.$refs.table.toggleRowSelection(t,!0)}}}},p=f,m=(n("7016"),n("1e3c"),n("2877")),b=Object(m["a"])(p,a,i,!1,null,"435b1afa",null);e["default"]=b.exports}}]);
|