1 rad
4.2 KiB
JavaScript
1 rad
4.2 KiB
JavaScript
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[2795],{2795:function(e,t,a){a.r(t),a.d(t,{default:function(){return y}});var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"report-classification"},[t("search-bar",{ref:"searchBarForm",attrs:{formConfigs:e.formConfig},on:{headBtnClick:e.buttonClick}}),t("base-table",{attrs:{page:e.listQuery.current,limit:e.listQuery.size,"table-props":e.tableProps,"table-data":e.tableData,"max-height":e.tableH}},[e.tableBtn.length?t("method-btn",{attrs:{slot:"handleBtn",width:180,label:"操作","method-list":e.tableBtn},on:{clickBtn:e.handleClick},slot:"handleBtn"}):e._e()],1),t("pagination",{attrs:{page:e.listQuery.current,limit:e.listQuery.size,total:e.total},on:{"update:page":function(t){return e.$set(e.listQuery,"current",t)},"update:limit":function(t){return e.$set(e.listQuery,"size",t)},pagination:function(t){return e.getList()}}}),t("base-dialog",{attrs:{dialogTitle:e.addOrEditTitle,dialogVisible:e.centervisible,"before-close":e.handleCancel},on:{cancel:e.handleCancel,confirm:e.handleConfirm}},[t("report-name-edit",{ref:"reportNameEdit",on:{successSubmit:e.successSubmit}})],1)],1)},r=[],s=a(475),n=function(){var e=this,t=e._self._c;return t("el-form",{ref:"form",attrs:{rules:e.rules,"label-width":"100px",model:e.form}},[t("el-form-item",{attrs:{label:"报表名称",prop:"name"}},[t("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"报表分类",prop:"type"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"报表分类"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.typeList,(function(e,a){return t("el-option",{key:a,attrs:{label:e.dataName,value:e.dataName}})})),1)],1)],1)},l=[],o={name:"ReportNameEdit",data(){return{form:{id:"",name:""},typeList:[{dataName:"能源",id:1},{dataName:"订单",id:2},{dataName:"设备",id:3},{dataName:"人员",id:4}],rules:{name:[{required:!0,message:"请输入报表分类名",trigger:"blur"}],type:[{required:!0,message:"请选择分类",trigger:"change"}]}}},methods:{init(e){e&&(this.form.id=e)},submitForm(){this.$refs["form"].validate((e=>{if(!e)return!1;this.$emit("successSubmit")}))},formClear(){this.$refs.form.resetFields()}}},m=o,d=a(1001),u=(0,d.Z)(m,n,l,!1,null,null,null),c=u.exports;const p=[{prop:"name",label:"报表名称"},{prop:"type",label:"报表分类"},{prop:"time",label:"添加时间"}],h=[{type:"view",btnName:"预览"},{type:"design",btnName:"设计"},{type:"edit",btnName:"编辑"},{type:"delete",btnName:"删除"}];var b={name:"ReportListDetail",components:{ReportNameEdit:c},data(){return{formConfig:[{type:"input",label:"关键字",placeholder:"报表名称",param:"name",width:300},{type:"button",btnName:"查询",name:"search",color:"primary"},{type:"separate"},{type:"button",btnName:"新增",name:"add",color:"success",plain:!0}],tableProps:p,tableData:[],tableBtn:h,tableH:(0,s.NC)(330),total:0,listQuery:{current:1,size:20},centervisible:!1,addOrEditTitle:""}},mounted(){window.addEventListener("resize",(()=>{this.tableH=(0,s.NC)(265)})),this.getList()},methods:{getList(){let e=[];for(let t=0;t<30;t++){let a={};a.name="名称"+t,a.type="分类"+t,a.time="2023-2-8 13:59:59",a.id=t+1,e.push(a)}this.tableData=e,this.total=30},handleClick(e){switch(e.type){case"view":this.$router.push({path:"/basicConfig/reportManagement/reportView"});break;case"design":this.$router.push({path:"/basicConfig/reportManagement/reportDesign"});break;case"edit":this.addOrEditTitle="编辑",this.centervisible=!0,this.$nextTick((()=>{this.$refs.reportNameEdit.init(e.data.id)}));break;default:this.$confirm('确认删除报表"'+e.data.name+'"吗?',{type:"warning"}).then((()=>{})).catch((()=>{}))}},buttonClick(e){switch(e.btnName){case"search":this.listQuery.name=e.name,this.listQuery.current=1,this.getList();break;default:this.$router.push({path:"/basicConfig/reportManagement/reportDesign"})}},handleCancel(){this.$refs.reportNameEdit.formClear(),this.centervisible=!1,this.addOrEditTitle=""},handleConfirm(){this.$refs.reportNameEdit.submitForm()},successSubmit(){this.handleCancel(),this.getList()}}},f=b,g=(0,d.Z)(f,i,r,!1,null,null,null),y=g.exports}}]); |