"use strict";(self["webpackChunkvoghion_vue_admin"]=self["webpackChunkvoghion_vue_admin"]||[]).push([[72763],{72763:function(e,t,a){a.r(t),a.d(t,{default:function(){return g}});var o=function(){var e=this,t=e._self._c;return t("el-card",[t("el-form",{attrs:{model:e.formData,inline:""}},[t("el-form-item",{attrs:{label:"设备号："}},[t("el-input",{attrs:{placeholder:"请输入设备号"},model:{value:e.formData.deviceCode,callback:function(t){e.$set(e.formData,"deviceCode",t)},expression:"formData.deviceCode"}})],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.fetchDataSource(1)}}},[e._v("搜索")]),t("el-button",{on:{click:e.onReset}},[e._v("重置")])],1)],1),t("div",{staticStyle:{"margin-bottom":"12px"}},[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.$refs["operationDialogElRef"].onShow()}}},[e._v("新增")]),t("el-button",{attrs:{type:"primary"},on:{click:e.onPublish}},[e._v("发布")])],1),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.dataSource.records,"row-key":"workFlowId",border:""}},[e._l(e.columns,(function(a){return t("el-table-column",e._b({key:a.prop,attrs:{"header-align":"center",align:"center"}},"el-table-column",a,!1))})),t("el-table-column",{attrs:{"header-align":"center",align:"center",fixed:"right",label:"操作"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.$refs["operationDialogElRef"].onShow(a)}}},[e._v("修改")]),t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onDelete(a)}}},[e._v("删除")])]}}])})],2),t("div",{staticClass:"g-pagination-container"},[t("el-pagination",{attrs:{"current-page":e.dataSource.current,"page-sizes":[20,50,100],"page-size":e.dataSource.size,layout:"sizes, prev, pager, next, jumper",background:"",total:e.dataSource.total},on:{"size-change":function(t){return e.fetchDataSource(null,t)},"current-change":function(t){return e.fetchDataSource(t)}}})],1),t("OperationDialog",{ref:"operationDialogElRef",on:{success:function(t){return e.fetchDataSource(1)}}})],1)},r=[],i=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.isEdit?"修改":"新增",width:"600px",visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("el-form",{ref:"ruleForm",attrs:{model:e.formData,"label-width":"auto"}},[t("el-form-item",{attrs:{label:"设备号：",prop:"deviceCode",rules:{required:!0,message:"请填写设备号",trigger:"blur"}}},[t("el-input",{attrs:{disabled:e.isEdit,placeholder:"请填写设备号"},model:{value:e.formData.deviceCode,callback:function(t){e.$set(e.formData,"deviceCode",t)},expression:"formData.deviceCode"}})],1),t("el-form-item",{attrs:{label:"分桶：",prop:"bucket",rules:{required:!0,message:"请填写分桶",trigger:"blur"}}},[t("el-input",{attrs:{placeholder:"请填写分桶"},model:{value:e.formData.bucket,callback:function(t){e.$set(e.formData,"bucket",t)},expression:"formData.bucket"}})],1)],1),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{loading:e.loading},on:{click:function(t){e.dialogVisible=!1}}},[e._v(" 取消 ")]),t("el-button",{attrs:{loading:e.loading,type:"primary"},on:{click:e.onConfirm}},[e._v(" 确定 ")])],1)],1)},n=[],l=a(21807),s={data(){return{dialogVisible:!1,loading:!1,formData:{},isEdit:!1}},methods:{onConfirm(){this.$refs["ruleForm"].validate((e=>{if(!e)return console.log("error submit!!"),!1;{this.loading=!0;const{layerId:e}=this.$route.query,t=this.isEdit?l.vf:l.$v;t({layerId:e,...this.formData}).then((e=>{e&&(this.dialogVisible=!1,this.$message.success("操作成功"),this.$emit("success"))})).finally((()=>{this.loading=!1}))}}))},onShow(e){this.dialogVisible=!0,this.isEdit=!!e,this.formData=e||{}}}},c=s,u=a(81656),d=(0,u.A)(c,i,n,!1,null,null,null),f=d.exports,m={components:{OperationDialog:f},data(){return{loading:!1,formData:{},dataSource:{size:20,current:1,records:[],total:0},columns:[{prop:"deviceCode",label:"设备号"},{prop:"bucket",label:"分桶"},{prop:"publishTime",label:"发布时间"},{prop:"createTime",label:"创建时间"},{prop:"updateTime",label:"修改时间"}]}},mounted(){this.fetchDataSource(1)},methods:{onReset(){this.formData={},this.fetchDataSource(1)},onPublish(){const{layerId:e}=this.$route.query;this.$confirm("是否发布?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{(0,l.bv)({layerId:e}).then((e=>{e&&this.$message.success("发布成功!")}))})).catch((()=>{this.$message.info("已取消发布!")}))},onDelete({id:e}){this.$confirm("是否删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{(0,l.V5)(e).then((e=>{e&&this.$message.success("删除成功!")}))})).catch((()=>{this.$message.info("已取消删除!")}))},fetchDataSource(e,t){this.loading=!0,(0,l.kZ)({pageNow:e||this.dataSource.current,pageSize:t||this.dataSource.size,...this.formData,...this.$route.query}).then((e=>{e&&(this.dataSource={...e,records:e.records||[]})})).finally((()=>{this.loading=!1}))}}},h=m,p=(0,u.A)(h,o,r,!1,null,null,null),g=p.exports}}]);