"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[3791],{93791:(e,t,i)=>{i.r(t),i.d(t,{default:()=>L});i(74916),i(64765),i(68309);var a=function(){var e=this,t=e._self._c;return t("app-container",[t("search-area",{attrs:{size:"small"},on:{search:e.search}},[t("search-item",[t("el-select",{attrs:{size:"small",placeholder:"设备类型",clearable:""},model:{value:e.listQuery.deviceType,callback:function(t){e.$set(e.listQuery,"deviceType",t)},expression:"listQuery.deviceType"}},e._l(e.deviceTypeList,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1),t("search-item",[t("el-select",{attrs:{size:"small",placeholder:"通信方式",clearable:""},model:{value:e.listQuery.communication,callback:function(t){e.$set(e.listQuery,"communication",t)},expression:"listQuery.communication"}},e._l(e.commuList,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1)],1),t("normal-table",{ref:"table",attrs:{data:e.list,total:e.total,query:e.listQuery,columns:e.columns,"list-loading":e.listLoading,pagination:!0,size:"small"},on:{change:e.changePage}},[t("template",{slot:"btns"},[e.hasPerm("/deviceModels/add")?t("el-button",{staticClass:"edit_btn",attrs:{size:"small"},on:{click:e.add}},[e._v(" 新增 ")]):e._e()],1),t("template",{slot:"columns"},[t("el-table-column",{attrs:{label:"操作",align:"center",width:"160"},scopedSlots:e._u([{key:"default",fn:function(i){return[e.hasPerm("/deviceModels/update")?t("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){return e.edit(i.row)}}},[e._v(" 编辑 ")]):e._e(),e.hasPerm("/deviceModels/delete")?t("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){return e.del(i.row)}}},[e._v(" 删除 ")]):e._e()]}}])})],1)],2),t("edit-device",{ref:"editDevice",on:{watchChild:e.fetchData}})],1)},o=[],n=(i(91058),i(73210),function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{"append-to-body":"",title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[t("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.deviceForm,"label-width":"80px","label-well-code":"right"}},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"设备型号",prop:"modelName"}},[t("el-input",{attrs:{type:"text",clearable:"",placeholder:"请输入型号名称"},model:{value:e.deviceForm.modelName,callback:function(t){e.$set(e.deviceForm,"modelName","string"===typeof t?t.trim():t)},expression:"deviceForm.modelName"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"设备类型",prop:"deviceType"}},[t("el-select",{attrs:{placeholder:"请选择设备类型",clearable:""},model:{value:e.deviceForm.deviceType,callback:function(t){e.$set(e.deviceForm,"deviceType",t)},expression:"deviceForm.deviceType"}},e._l(e.deviceTypeList,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"通信方式",prop:"communication"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",multiple:"",placeholder:"请选择通信方式"},on:{change:e.selectChange},model:{value:e.deviceForm.communication,callback:function(t){e.$set(e.deviceForm,"communication",t)},expression:"deviceForm.communication"}},e._l(e.commuList,(function(e){return t("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1)],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:"detail"!==e.dialogStatus,expression:"dialogStatus === 'detail' ? false : true"}],staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.saveData}},[e._v(" 保存 ")]),t("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v(" 取消 ")])],1)],1)}),r=[],l=(i(23123),i(96647),i(83710),i(41539),i(39714),i(9632)),c=i(84471),s=i(80129),u=i.n(s);function d(e){return(0,c.Z)({url:"device/type",method:"get",params:e})}function m(e){return(0,c.Z)({url:"deviceModels/listPage",method:"get",params:e})}function p(e){return(0,c.Z)({url:"deviceModels/add",method:"post",params:e})}function f(e){return(0,c.Z)({url:"deviceModels/update",method:"post",params:e})}function h(e){return(0,c.Z)({url:"deviceModels/delete",method:"post",params:{deviceModelsId:e},paramsSerializer:function(e){return u().stringify(e,{indices:!1})}})}var v=i(25108);const g={name:"EditDeviceModel",data:function(){return{dialogFormVisible:!1,dialogStatus:"",deviceTypeList:[],commuList:[],textMap:{update:"编辑",create:"新增",detail:"详情"},deviceForm:{id:"",modelName:"",deviceType:"",communication:[]},rules:{id:[{required:!0,message:"型号编号不能为空",trigger:["blur","change"]}],modelName:[{required:!0,message:"型号名称必填",trigger:["blur","change"]}],deviceType:[{required:!0,message:"设备主键必填",trigger:["blur","change"]}],communication:[{required:!0,message:"通讯方式必选",trigger:["blur","change"]}]}}},created:function(){this.fetchDeviceType(),this.fetchcommunType()},methods:{selectChange:function(){v.log(this.deviceForm.communication)},fetchcommunType:function(){var e=this;(0,l.ej)().then((function(t){v.log(t,"通讯方式"),e.commuList=t.data}))},fetchDeviceType:function(){var e=this;d(this.listQuery).then((function(t){e.deviceTypeList=t.data}))},resetForm:function(){this.deviceForm={id:"",modelName:"",deviceType:"",communication:""}},initDialog:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;v.log(i,"========"),this.dialogFormVisible=!0,this.dialogStatus=e,"create"===this.dialogStatus?(this.resetForm(),this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))):"update"!==this.dialogStatus&&"detail"!==this.dialogStatus||(this.deviceForm={modelName:i.modelName,deviceType:i.deviceType,communication:i.communication.split(","),id:i.id})},saveData:function(){"update"===this.dialogStatus?this.updateData():"create"===this.dialogStatus&&this.createData()},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&(e.deviceForm.communication=e.deviceForm.communication.toString(),f(e.deviceForm).then((function(t){200===t.code&&(e.$message.success("修改成功"),e.$emit("watchChild"),e.dialogFormVisible=!1)})))}))},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&(e.deviceForm.communication=e.deviceForm.communication.toString(),p(e.deviceForm).then((function(t){200===t.code&&e.$confirm("新增成功,是否继续新增?","提示",{confirmButtonText:"是",cancelButtonText:"否",type:"info"}).then((function(){e.resetForm(),e.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))}))["catch"]((function(){e.$emit("watchChild"),e.dialogFormVisible=!1}))})))}))}}},y=g;var b=i(1001),T=(0,b.Z)(y,n,r,!1,null,"3e9162ba",null);const F=T.exports;var w=i(5094),Z=i(64171),D=i(25108);const x={name:"DeviceModel",components:{editDevice:F},data:function(){return{listQuery:{deviceType:"",communication:"",offset:1,limit:30,sort:"id",order:"asc"},total:0,commuList:[],deviceTypeList:[],columns:[{text:"设备类型",value:"deviceTypeName",align:"center"},{text:"设备型号",value:"modelName",align:"center"},{text:"通信方式",value:"communNameGroup",align:"center"}],list:[],listLoading:!0}},created:function(){this.fetchDeviceType(),this.fetchCommunType(),this.fetchData()},methods:{fetchCommunType:function(){var e=this;(0,w.CX)("communicationType").then((function(t){e.commuList=t.data}))},fetchDeviceType:function(){var e=this;(0,Z.l7)(this.listQuery).then((function(t){e.deviceTypeList=t.data}))},search:function(){this.fetchData(!1)},fetchData:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.listLoading=!0,t||(this.listQuery.offset=1),m(this.listQuery).then((function(t){D.log(t),e.list=t.data.rows,e.total=parseInt(t.data.total),e.listLoading=!1}))},del:function(e){var t=this;this.$confirm("确定要删除所选设备型号吗?","确认操作",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){h(e.id).then((function(e){200===e.code&&(t.$message.success("删除成功"),t.fetchData())}))}))},detail:function(e){this.$refs.editDevice.initDialog("detail",e)},add:function(){this.$refs.editDevice.initDialog("create")},edit:function(e){this.$refs.editDevice.initDialog("update",e)},changePage:function(e){e&&e.size&&(this.listQuery.limit=e.size),e&&e.page&&(this.listQuery.offset=e.page),this.fetchData()}}},k=x;var $=(0,b.Z)(k,a,o,!1,null,"b0206d66",null);const L=$.exports},64171:(e,t,i)=>{i.d(t,{FR:()=>f,FU:()=>d,Ix:()=>r,S6:()=>s,e5:()=>m,fj:()=>c,l7:()=>l,nY:()=>p,xl:()=>u});var a=i(84471),o=i(80129),n=i.n(o);function r(e){return(0,a.Z)({url:"device/list-page",method:"get",params:e})}function l(e){return(0,a.Z)({url:"device/type",method:"get",params:e})}function c(e){return(0,a.Z)({url:"device/model",method:"get",params:{deviceType:e}})}function s(e){return(0,a.Z)({url:"device/add",method:"post",params:e})}function u(e){return(0,a.Z)({url:"device/update",method:"post",params:e})}function d(e){return(0,a.Z)({url:"device/delete",method:"post",params:{ids:e},paramsSerializer:function(e){return n().stringify(e,{indices:!1})}})}function m(e){var t=new FormData;return t.append("file",e),(0,a.Z)({url:"device/batchImport",method:"post",timeout:24e4,headers:{"Content-Type":"multipart/form-data"},data:t})}function p(e){return(0,a.Z)({url:"device/batchExport",method:"get",timeout:12e4,params:e,responseType:"blob"})}function f(e){return(0,a.Z)({url:"/device/offline-list-page",method:"get",params:e})}},5094:(e,t,i)=>{i.d(t,{BR:()=>n,CX:()=>c,Q5:()=>l,p9:()=>o,rD:()=>r});var a=i(84471);function o(e){return(0,a.Z)({url:"sys/dict/listPage",method:"get",params:e})}function n(e){return(0,a.Z)({url:"sys/dict/add",method:"post",data:e})}function r(e){return(0,a.Z)({url:"sys/dict/update",method:"post",data:e})}function l(e){return(0,a.Z)({url:"sys/dict/delete",method:"post",data:{dictId:e}})}function c(e){return(0,a.Z)({url:"sys/dict/code/"+e,method:"get"})}},9632:(e,t,i)=>{i.d(t,{Ek:()=>m,HL:()=>v,M8:()=>c,ej:()=>u,fP:()=>y,jA:()=>d,jo:()=>s,jx:()=>f,ke:()=>h,lL:()=>g,o5:()=>T,vE:()=>l,yW:()=>p,z1:()=>b});var a=i(95082),o=i(84471),n=i(80129),r=i.n(n);function l(e){return(0,o.Z)({url:"well/list",method:"get",params:e})}function c(e){return(0,o.Z)({url:"well/info",method:"get",params:{id:e}})}function s(e){return(0,o.Z)({url:"/sys/dict/code/sluicewellType",method:"get",params:e})}function u(e){return(0,o.Z)({url:"/sys/dict/code/communicationType",method:"get",params:e})}function d(e){return(0,o.Z)({url:"well/add",method:"post",params:e})}function m(e){return(0,o.Z)({url:"well/update",method:"post",params:e})}function p(e){return(0,o.Z)({url:"well/delete",method:"post",params:{ids:e},paramsSerializer:function(e){return r().stringify(e,{indices:!1})}})}function f(e){var t=new FormData;return t.append("file",e),(0,o.Z)({url:"well/batchImport",method:"post",headers:{"Content-Type":"multipart/form-data"},data:t})}function h(e,t){return(0,o.Z)((0,a.Z)((0,a.Z)({url:"well/batchExport",method:"get",timeout:12e4,params:e},t),{},{responseType:"blob"}))}function v(e){return(0,o.Z)({url:"well/watchDataByWell",method:"get",params:{id:e}})}function g(e,t){return(0,o.Z)({url:"well/bfcf",method:"post",params:{wellId:e,bfzt:t}})}function y(e){return(0,o.Z)({url:"well/batchBfcf",method:"post",params:e})}function b(){return(0,o.Z)({url:"well/countByBfzt",method:"get"})}function T(e){return(0,o.Z)({url:"well/selectOne",method:"get",params:e})}}}]);