chunk-27af361c.4e148716.js 35 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-27af361c"],{"09f4":function(t,e,a){"use strict";a.d(e,"a",(function(){return r})),Math.easeInOutQuad=function(t,e,a,n){return t/=n/2,t<1?a/2*t*t+e:(t--,-a/2*(t*(t-2)-1)+e)};var n=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 o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function r(t,e,a){var r=o(),s=t-r,c=20,l=0;e="undefined"===typeof e?500:e;var u=function t(){l+=c;var o=Math.easeInOutQuad(l,r,s,e);i(o),l<e?n(t):a&&"function"===typeof a&&a()};u()}},"0c61":function(t,e,a){},1771:function(t,e,a){"use strict";a.d(e,"f",(function(){return c})),a.d(e,"c",(function(){return l})),a.d(e,"d",(function(){return u})),a.d(e,"b",(function(){return d})),a.d(e,"a",(function(){return h})),a.d(e,"e",(function(){return f}));var n=a("5530"),i=(a("aef6"),a("f559"),a("28a5"),a("6762"),a("2fdb"),a("b85c")),o=a("c2cf"),r=a("ebb5"),s=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&&o["a"].enums({codes:t}).then((function(a){var n,o=a.data,r=Object(i["a"])(t);try{for(r.s();!(n=r.n()).done;){var s=n.value;e[s]=o.data[s]}}catch(c){r.e(c)}finally{r.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&&r["a"].list({codes:t}).then((function(a){var n,o=a.data,r=Object(i["a"])(t);try{for(r.s();!(n=r.n()).done;){var s=n.value;e[s]=o.data[s]}}catch(c){r.e(c)}finally{r.f()}}))},h=function(t){var e=t.data,a=e.type;if(a.includes("application/json")){var n=new FileReader;n.onload=function(t){if(2===t.target.readyState){var e=JSON.parse(t.target.result);s.$message({message:e.msg,type:"warning"})}},n.readAsText(e)}else{var i=t.headers["content-disposition"],o="下载文件.zip";if(i)for(var r=i.split(";"),c=0;c<r.length;c++){var l=r[c];if(null!==l&&""!==l){var u=l.split("=");if(null!==u&&u.length>0&&"filename"===u[0].trim().toLowerCase()){o=decodeURI(u[1]);break}}}(o.startsWith("'")||o.startsWith('"'))&&(o.endsWith("'")||o.endsWith('"'))&&(o=o.substring(1,o.length-1));var d=new Blob([e]),h=document.createElement("a");h.href=window.URL.createObjectURL(d),h.download=o,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(n["a"])(Object(n["a"])({},e),t):e}},"1f56":function(t,e,a){},"2f21":function(t,e,a){"use strict";var n=a("79e5");t.exports=function(t,e){return!!t&&n((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},"32b6":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("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}}},[a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:24,sm:24}},[a("div",{staticClass:"img-wrapper"},[a("img",{attrs:{src:t.tenant.logo}})])])],1),t._v(" "),a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:24,sm:12}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-user"}),t._v(" "),a("span",[t._v(t._s(t.$t("table.tenant.code")+":"))]),t._v("\n "+t._s(t.tenant.code)+"\n ")])]),t._v(" "),a("el-col",{attrs:{xs:24,sm:12}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-suitcase"}),t._v(" "),a("span",[t._v(t._s(t.$t("table.tenant.name")+":"))]),t._v("\n "+t._s(t.tenant.name)+"\n ")])])],1),t._v(" "),a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:24,sm:12}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-trophy"}),t._v(" "),a("span",[t._v(t._s(t.$t("table.tenant.type")+":"))]),t._v("\n "+t._s(t.tenant.type.desc)+"\n ")])]),t._v(" "),a("el-col",{attrs:{xs:24,sm:12}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-phone-outline"}),t._v(" "),a("span",[t._v(t._s(t.$t("table.tenant.status")+":"))]),t._v("\n "+t._s(t.tenant.status.desc)+"\n ")])])],1),t._v(" "),a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:24,sm:12}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-star-off"}),t._v(" "),a("span",[t._v(t._s(t.$t("table.tenant.duty")+":"))]),t._v("\n "+t._s(t.tenant.duty)+"\n ")])]),t._v(" "),a("el-col",{attrs:{xs:24,sm:12}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-bangzhu"}),t._v(" "),a("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(" "),a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:24,sm:12}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-time"}),t._v(" "),a("span",[t._v(t._s(t.$t("table.createTime")+":"))]),t._v("\n "+t._s(t.tenant.createTime)+"\n ")])]),t._v(" "),a("el-col",{attrs:{xs:24,sm:12}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-brush"}),t._v(" "),a("span",[t._v(t._s(t.$t("table.updateTime")+":"))]),t._v("\n "+t._s(t.tenant.updateTime)+"\n ")])])],1),t._v(" "),a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:24,sm:24}},[a("div",{staticClass:"view-item"},[a("i",{staticClass:"el-icon-date"}),t._v(" "),a("span",[t._v(t._s(t.$t("table.tenant.describe")+":"))]),t._v("\n "+t._s(t.tenant.describe)+"\n ")])])],1)],1)},i=[],o=a("5530"),r={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(o["a"])({},t)},close:function(){this.$emit("close")}}},s=r,c=(a("dc6a"),a("2877")),l=Object(c["a"])(s,n,i,!1,null,"0c886af4",null);e["default"]=l.exports},"55dd":function(t,e,a){"use strict";var n=a("5ca1"),i=a("d8e8"),o=a("4bf8"),r=a("79e5"),s=[].sort,c=[1,2,3];n(n.P+n.F*(r((function(){c.sort(void 0)}))||!r((function(){c.sort(null)}))||!a("2f21")(s)),"Array",{sort:function(t){return void 0===t?s.call(o(this)):s.call(o(this),i(t))}})},"58e6":function(t,e,a){"use strict";var n=a("a171"),i=a.n(n);i.a},"5bcd":function(t,e,a){"use strict";var n=a("5530"),i=a("9256"),o={getList:{method:"POST",url:"/authority/productionresource/all"},page:{method:"POST",url:"/authority/productionresource/page"},save:{method:"POST",url:"/authority/productionresource"},update:{method:"POST",url:"/authority/productionresource/update"},remove:{method:"DELETE",url:"/authority/productionresource"},removeMore:{method:"POST",url:"/authority/productionresource/delete"},updateStatus:{method:"POST",url:"/authority/productionresource/updateStatus"}};e["a"]={getList:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.getList),{},{data:t}))},page:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.page),{},{data:t}))},save:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.save),{},{data:t}))},update:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.update),{},{data:t}))},remove:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.remove),{},{data:t}))},removeMore:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.removeMore),{},{data:t}))},updateStatus:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.updateStatus),{},{data:t}))},detail:function(t){return Object(i["a"])({method:"GET",url:"/authority/productionresource/".concat(t)})}}},"5caa":function(t,e,a){"use strict";a("96cf");var n=a("1da1"),i=a("5530"),o=a("9256"),r={getList:{method:"POST",url:"/authority/module/all"},page:{method:"POST",url:"/authority/module/page"},updateActiveStatus:{method:"POST",url:"/authority/module/update"},updateNew:{method:"POST",url:"/authority/module/update"},update:{method:"POST",url:"/authority/module/update"},save:{method:"POST",url:"/authority/module"},saveInit:{method:"POST",url:"/authority/module/init"},updateStatus:{method:"POST",url:"/authority/module/status"},remove:{method:"DELETE",url:"/authority/module"},delete:{method:"POST",url:"/authority/module/delete"},get:{method:"POST",url:"/authority/module/getById"},list:{method:"POST",url:"/authority/module/query"},preview:{method:"POST",url:"/authority/module/preview"},export:{method:"POST",url:"/authority/module/export"},import:{method:"POST",url:"/authority/module/import"}};e["a"]={getList:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.getList),{},{data:t}))},page:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.page),{},{data:t}))},save:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.save),{},{data:t}))},saveInit:function(){var t=Object(n["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.saveInit),{},{data:e})));case 1:case"end":return t.stop()}}),t)})));function e(e){return t.apply(this,arguments)}return e}(),updateNew:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.updateNew),{},{data:t}))},update:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.update),{},{data:t}))},updateStatus:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.updateStatus),{},{formData:!0,data:t}))},updateActiveStatus:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.updateActiveStatus),{},{data:t}))},remove:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.remove),{},{data:t}))},delete:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.delete),{},{data:t}))},list:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.list),{},{data:t}))},check:function(t){return Object(o["a"])({method:"GET",url:"/authority/module/check/".concat(t)})},checkField:function(t){return Object(o["a"])({method:"POST",url:"/authority/module/check",data:t})},getById:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.get),{},{data:t}))},get:function(t){return Object(o["a"])({method:"GET",url:"/authority/module/get/".concat(t)})},preview:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.preview),{},{data:t}))},export:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.export),{},{responseType:"blob",data:t}))},import:function(t){return Object(o["a"])(Object(i["a"])(Object(i["a"])({},r.import),{},{data:t}))}}},"78fe":function(t,e,a){"use strict";var n=a("1f56"),i=a.n(n);i.a},"9edd":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("el-row",{staticClass:"filter-container",attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("el-input",{attrs:{placeholder:"输入关键字进行过滤",size:"medium"},model:{value:t.filterText,callback:function(e){t.filterText=e},expression:"filterText"}}),t._v(" "),a("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 n=e.node;e.data;return a("span",{staticClass:"custom-tree-node"},[a("span",{staticClass:"treeTitleSpan",attrs:{title:n.label}},[t._v(t._s(n.label))]),t._v(" "),a("span",{staticClass:"tiaozhuanA"},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return t.goMeun(n)}}},[t._v("\n\t\t Go\n\t\t ")])],1)])}}])})],1),t._v(" "),a("el-col",{attrs:{span:18}},[a("el-row",{staticClass:"filter-container"},[a("el-col",[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"medium"},on:{click:t.add}},[t._v("新增边缘盒子")]),t._v(" "),a("el-button",{attrs:{type:"success",icon:"el-icon-edit",size:"medium"},on:{click:t.editOne}},[t._v("修改边缘盒子")]),t._v(" "),a("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"medium"},on:{click:t.tableDelete}},[t._v("删除边缘盒子")]),t._v(" "),a("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(" "),a("el-button",{attrs:{type:"info",icon:"el-icon-warning-outline",size:"medium"},on:{click:function(e){return t.updateActiveStatus("0")}}},[t._v("停用")]),t._v(" "),a("el-button",{attrs:{type:"primary",icon:"el-icon-s-grid",size:"medium"},on:{click:t.factoryMgr}},[t._v("生产资源管理")])],1)],1),t._v(" "),a("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}},[a("el-table-column",{attrs:{align:"center",type:"selection",width:"40px","reserve-selection":!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"name",label:"边缘盒子名称","show-overflow-tooltip":!0,width:"150px"}}),t._v(" "),a("el-table-column",{attrs:{prop:"code",label:"编号","show-overflow-tooltip":!0,align:"center",width:"100px"}}),t._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态",align:"center",width:"90px"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("el-tag",{attrs:{type:"1"==n.status?"success":"info"}},[t._v("\n\t\t \t"+t._s("1"==n.status?"启用":"停用")+"\n\t\t ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"remark",label:"描述","show-overflow-tooltip":!0}}),t._v(" "),a("el-table-column",{attrs:{label:t.$t("table.operation"),fixed:"right",align:"center","column-key":"operation",width:"160px"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("el-tooltip",{staticClass:"item",attrs:{content:"生产资源管理",effect:"dark",placement:"top-start"}},[a("i",{staticClass:"el-icon-s-grid table-operation",staticStyle:{color:"#2db7f5"},on:{click:function(e){return t.factoryRowMgr(n)}}})]),t._v(" "),a("el-tooltip",{staticClass:"item",attrs:{content:"修改",effect:"dark",placement:"top-start"}},[a("i",{staticClass:"el-icon-edit table-operation",staticStyle:{color:"#2db7f5"},on:{click:function(e){return t.edit(n)}}})]),t._v(" "),a("el-tooltip",{staticClass:"item",attrs:{content:"删除",effect:"dark",placement:"top-start"}},[a("i",{staticClass:"el-icon-delete table-operation",staticStyle:{color:"#f50"},on:{click:function(e){return t.singleDelete(n)}}})]),t._v(" "),a("el-tooltip",{staticClass:"item",attrs:{content:"停用",effect:"dark",placement:"top-start"}},[a("i",{staticClass:"el-icon-warning-outline table-operation",staticStyle:{color:"#f50"},on:{click:function(e){return t.dongJieRow(n)}}})])]}}])})],1),t._v(" "),a("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(" "),a("tenant-edit",{ref:"edit",attrs:{"dialog-visible":t.dialog.isVisible,title:t.dialog.title,factoryId:t.productionLineId},on:{close:t.editClose,success:t.editSuccess}}),t._v(" "),a("tenant-view",{ref:"view",attrs:{"dialog-visible":t.tenantViewVisible},on:{close:t.viewClose}}),t._v(" "),a("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)}}},[a("el-scrollbar",[a("div",{domProps:{innerHTML:t._s(t.preview.context)}})])],1)],1)},i=[],o=(a("28a5"),a("6762"),a("2fdb"),a("55dd"),a("ac6a"),a("20d6"),a("5530")),r=(a("386d"),a("333d")),s=a("fcac"),c=a("32b6"),l=a("d5b4"),u=a("5bcd"),d=a("a888"),h=a("1771"),f={name:"TenantManage",directives:{elDragDialog:d["a"]},components:{Pagination:r["a"],TenantEdit:s["default"],TenantView:c["default"]},data:function(){return{enterpriseId:"",factoryId:"",workShopId:"",productionLineId:"",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.factoryId=this.$route.query.factoryId,this.queryObj=this.$route.query,this.productionLineId=this.$route.query.productionLineId,console.log("路由传参【边缘盒子】数据queryObj:",this.queryObj),this.getFactoryTree()},watch:{$route:function(){this.$route.fullPath.indexOf("/enterpriseMgr/edgeBoxMgr")>-1&&(this.queryObj=this.$route.query,console.log("监听路由【边缘盒子】变化queryObj:",this.queryObj),this.$refs.table.clearSelection())},queryObj:{deep:!0,immediate:!1,handler:function(){console.log("form数据:",this.queryObj),this.factoryId=this.$route.query.factoryId,this.productionLineId=this.$route.query.productionLineId,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 a="",n=this.queryObj;"1"==t.data.lev&&(a=this.menuUrl[0]),"2"==t.data.lev&&(a=this.menuUrl[1]),"3"==t.data.lev&&(a=this.menuUrl[2],n.workShopId=t.data.parentId),"4"==t.data.lev&&(a=this.menuUrl[3],n.productionLineId=t.data.parentId),"5"==t.data.lev&&(a=this.menuUrl[4],n.edgeBoxId=t.data.parentId);var i={path:a,query:n};console.log("【Go】-点击事件: ",i),a==this.$route.path?(this.productionLineId=n.productionLineId,this.search(),this.getFactoryTree()):this.$store.dispatch("tagsView/delView",this.$route).then((function(t){e.$router.push(i)}))},checkBoxFun:function(t,e){console.log("【树-checkbox】node: ",this.workShopId),this.$refs.tree.setCheckedKeys([this.productionLineId])},reSearchData:function(){this.search(),this.factoryId&&this.getFactoryTree()},factoryMgr:function(){var t=this;this.selection.length?this.selection.length>1?this.$message({message:"请只能选择一条数据!",type:"warning"}):(this.queryObj.edgeBoxId=this.selection[0].id,this.$store.dispatch("tagsView/delView",this.$route).then((function(e){t.$router.push({path:"/enterpriseMgr/productionResourcesMgr",query:t.queryObj})}))):this.$message({message:"请至少选择一条数据!",type:"warning"})},factoryRowMgr:function(t){var e=this;this.queryObj.edgeBoxId=t.id,this.$store.dispatch("tagsView/delView",this.$route).then((function(t){e.$router.push({path:"/enterpriseMgr/productionResourcesMgr",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(o["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 a=e.data;a.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=[],a=!1;t.selection.forEach((function(t){t.readonly?a=!0:e.push(t.id)})),a?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 a=t.data;a.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 a={};a=this.selection[0],a.status=t;var n="冻结成功!";"1"==t&&(n="启用成功!"),u["a"].update(a).then((function(t){200==t.status&&(e.$message({message:n,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 a={};a=t,a.status="0",u["a"].update(a).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.productionlineId=this.productionLineId,this.queryParams.model.type={key:"1"},u["a"].page(this.queryParams).then((function(e){var a=e.data;a.isSuccess&&(t.tableData=a.data)})).finally((function(){return t.loading=!1}))},getFactoryTree:function(){var t=this;l["a"].getFactoryTree(this.factoryId).then((function(e){var a=e.data;console.log("Tree的数据:",a),a.isSuccess&&(t.treeData=a.data,t.$refs.tree.setCheckedKeys([t.productionLineId]))})).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 a={};a[e.split(".")[1]]=t[e][0],this.queryParams.model[e.split(".")[0]]=a}else this.queryParams.model[e]=t[e][0];this.search()},cellClick:function(t,e){var a=this;if("operation"!==e["columnKey"]){var n=!1;this.selection.forEach((function(e){e.id===t.id&&(n=!0,a.$refs.table.toggleRowSelection(t))})),n||this.$refs.table.toggleRowSelection(t,!0)}}}},m=f,p=(a("ce28"),a("78fe"),a("2877")),b=Object(p["a"])(m,n,i,!1,null,"e95e5f1a",null);e["default"]=b.exports},a171:function(t,e,a){},a888:function(t,e,a){"use strict";a("a481"),a("6762"),a("2fdb");var n={bind:function(t,e,a){var n=t.querySelector(".el-dialog__header"),i=t.querySelector(".el-dialog");n.style.cssText+=";cursor:move;",i.style.cssText+=";top:0px;";var o=function(){return window.document.currentStyle?function(t,e){return t.currentStyle[e]}:function(t,e){return getComputedStyle(t,!1)[e]}}();n.onmousedown=function(t){var e=t.clientX-n.offsetLeft,r=t.clientY-n.offsetTop,s=i.offsetWidth,c=i.offsetHeight,l=document.body.clientWidth,u=document.body.clientHeight,d=i.offsetLeft,h=l-i.offsetLeft-s,f=i.offsetTop,m=u-i.offsetTop-c,p=o(i,"left"),b=o(i,"top");p.includes("%")?(p=+document.body.clientWidth*(+p.replace(/\%/g,"")/100),b=+document.body.clientHeight*(+b.replace(/\%/g,"")/100)):(p=+p.replace(/\px/g,""),b=+b.replace(/\px/g,"")),document.onmousemove=function(t){var n=t.clientX-e,o=t.clientY-r;-n>d?n=-d:n>h&&(n=h),-o>f?o=-f:o>m&&(o=m),i.style.cssText+=";left:".concat(n+p,"px;top:").concat(o+b,"px;"),a.child.$emit("dragDialog")},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null}}}},i=function(t){t.directive("el-drag-dialog",n)};window.Vue&&(window["el-drag-dialog"]=n,Vue.use(i)),n.install=i;e["a"]=n},aef6:function(t,e,a){"use strict";var n=a("5ca1"),i=a("9def"),o=a("d2c8"),r="endsWith",s=""[r];n(n.P+n.F*a("5147")(r),"String",{endsWith:function(t){var e=o(this,t,r),a=arguments.length>1?arguments[1]:void 0,n=i(e.length),c=void 0===a?n:Math.min(i(a),n),l=String(t);return s?s.call(e,l,c):e.slice(c-l.length,c)===l}})},c2cf:function(t,e,a){"use strict";var n=a("5530"),i=a("9256"),o=a("5657"),r={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=o["a"].get("TOKEN",""),a=o["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(a)},generateId:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},r.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})}}},ce28:function(t,e,a){"use strict";var n=a("d315"),i=a.n(n);i.a},d315:function(t,e,a){},d5b4:function(t,e,a){"use strict";var n=a("5530"),i=a("9256"),o={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(n["a"])(Object(n["a"])({},o.getList),{},{data:t}))},page:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.page),{},{data:t}))},save:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.save),{},{data:t}))},update:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.update),{},{data:t}))},remove:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.remove),{},{data:t}))},updateStatus:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.updateStatus),{},{data:t}))},getFactoryTree:function(t){return Object(i["a"])({method:"GET",url:"/authority/factory/factoryTree/".concat(t)})}}},dc6a:function(t,e,a){"use strict";var n=a("0c61"),i=a.n(n);i.a},ebb5:function(t,e,a){"use strict";var n=a("5530"),i=a("9256"),o={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(n["a"])(Object(n["a"])({},o.page),{},{data:t}))},save:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.save),{},{data:t}))},update:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.update),{},{data:t}))},delete:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.delete),{},{data:t}))},list:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.list),{},{data:t}))},preview:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.preview),{},{data:t}))},export:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.export),{},{responseType:"blob",data:t}))},import:function(t){return Object(i["a"])(Object(n["a"])(Object(n["a"])({},o.import),{},{data:t}))}}},fcac:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("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}}},[a("el-form",{ref:"form",attrs:{model:t.tenant,rules:t.rules,"label-position":"right","label-width":"130px"}},[a("el-form-item",{attrs:{label:"边缘盒子名称:",prop:"name"}},[a("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(" "),a("el-form-item",{attrs:{label:"编码:",prop:"code"}},[a("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(" "),a("el-form-item",{attrs:{label:"模型:",prop:"describe"}},[[a("el-select",{staticStyle:{width:"93%"},attrs:{placeholder:"请选择"},model:{value:t.tenant.moduleId,callback:function(e){t.$set(t.tenant,"moduleId",e)},expression:"tenant.moduleId"}},t._l(t.moduleList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)]],2),t._v(" "),a("el-form-item",{attrs:{label:"状态:",prop:"status"}},[[a("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(" "),a("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(" "),a("el-form-item",{attrs:{label:"描述:",prop:"remark"}},[a("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(" "),a("el-tooltip",{staticClass:"item",attrs:{content:"不超过500个字符。",effect:"dark",placement:"top-end"}},[a("i",{staticClass:"el-icon-question"})])],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{plain:"",type:"warning"},on:{click:function(e){t.isVisible=!1}}},[t._v(t._s(t.$t("common.cancel")))]),t._v(" "),a("el-button",{attrs:{plain:"",type:"primary",disabled:t.confirmDisabled},on:{click:t.submitForm}},[t._v(t._s(t.$t("common.confirm")))])],1)],1)},i=[],o=a("5530"),r=(a("c2cf"),a("5657"),a("5bcd")),s=a("5caa"),c=a("b170"),l=(a("27ae"),{name:"TenantEdit",props:{dialogVisible:{type:Boolean,default:!1},title:{type:String,default:""},factoryId:{type:String,default:""}},data:function(){var t=this;return{moduleList:[],options:[{value:"选项1",label:"黄金糕"},{value:"选项2",label:"双皮奶"},{value:"选项3",label:"蚵仔煎"},{value:"选项4",label:"龙须面"},{value:"选项5",label:"北京烤鸭"}],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,a,n){"add"===t.type?Object(c["d"])(a)?n():n("企业编码只能是字母、数字或_"):n()},trigger:"blur"}]}}},created:function(){this.getModuleList()},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(o["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,t.tenant.type={key:"1"},"add"===t.type?(t.tenant.productionlineId=t.factoryId,t.save()):t.update()}))},save:function(){var t=this;r["a"].save(this.tenant).then((function(e){var a=e.data;a.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;r["a"].update(this.tenant).then((function(e){var a=e.data;a.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()},getModuleList:function(){var t=this;s["a"].getList({}).then((function(e){e=e.data,t.moduleList=e.data}))}}}),u=l,d=(a("58e6"),a("2877")),h=Object(d["a"])(u,n,i,!1,null,null,null);e["default"]=h.exports}}]);