1 line
3.5 KiB
JavaScript
1 line
3.5 KiB
JavaScript
|
"use strict";(self["webpackChunktft_mes"]=self["webpackChunktft_mes"]||[]).push([[2674],{2674:function(t,e,i){i.r(e),i.d(e,{default:function(){return g}});var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"report-classification"},[e("search-bar",{ref:"searchBarForm",attrs:{formConfigs:t.formConfig},on:{headBtnClick:t.buttonClick}}),e("base-table",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,"table-props":t.tableProps,"table-data":t.tableData,"max-height":t.tableH}},[t.tableBtn.length?e("method-btn",{attrs:{slot:"handleBtn",width:80,label:"操作","method-list":t.tableBtn},on:{clickBtn:t.handleClick},slot:"handleBtn"}):t._e()],1),e("pagination",{attrs:{page:t.listQuery.current,limit:t.listQuery.size,total:t.total},on:{"update:page":function(e){return t.$set(t.listQuery,"current",e)},"update:limit":function(e){return t.$set(t.listQuery,"size",e)},pagination:function(e){return t.getList()}}}),e("base-dialog",{attrs:{dialogTitle:t.addOrEditTitle,dialogVisible:t.centervisible,"before-close":t.handleCancel},on:{cancel:t.handleCancel,confirm:t.handleConfirm}},[e("report-class-add",{ref:"reportClass",on:{successSubmit:t.successSubmit}})],1)],1)},a=[],r=i(475),l=function(){var t=this,e=t._self._c;return e("el-form",{ref:"form",attrs:{rules:t.rules,"label-width":"100px",model:t.form}},[e("el-form-item",{attrs:{label:"报表分类名",prop:"name"}},[e("el-input",{model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1)],1)},n=[],o={name:"ReportClassAdd",data(){return{form:{id:"",name:""},isEdit:!1,rules:{name:[{required:!0,message:"请输入报表分类名",trigger:"blur"}]}}},methods:{init(t){t?(this.isEdit=!0,this.form.id=t):(this.isEdit=!1,this.form.id="")},submitForm(){this.$refs["form"].validate((t=>{if(!t)return!1;this.isEdit,this.$emit("successSubmit")}))},formClear(){this.$refs.form.resetFields(),this.isEdit=!1}}},d=o,c=i(1001),m=(0,c.Z)(d,l,n,!1,null,null,null),u=m.exports;const h=[{prop:"name",label:"报表分类名"}],f=[{type:"edit",btnName:"编辑"},{type:"delete",btnName:"删除"}];var b={name:"ReportClassification",components:{ReportClassAdd:u},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:h,tableData:[],tableBtn:f,tableH:(0,r.NC)(330),total:0,listQuery:{current:1,size:20},centervisible:!1,addOrEditTitle:""}},mounted(){window.addEventListener("resize",(()=>{this.tableH=(0,r.NC)(265)})),this.getList()},methods:{getList(){let t=[];for(let e=0;e<30;e++){let i={};i.name="分类名"+e,i.id=e+1,t.push(i)}this.tableData=t,this.total=30},handleClick(t){console.log(t),"edit"===t.type?(this.addOrEditTitle="编辑",this.$nextTick((()=>{this.$refs.reportClass.init(t.data.id)})),this.centervisible=!0):this.$confirm('确认删除报表分类名"'+t.data.name+'"吗?',{type:"warning"}).then((()=>{})).catch((()=>{}))},buttonClick(t){switch(t.btnName){case"search":this.listQuery.name=t.name,this.listQuery.current=1,this.getList();break;default:this.addOrEditTitle="新增",this.centervisible=!0,this.$nextTick((()=>{this.$refs.reportClass.init()}))}},handleCancel(){this.$refs.reportClass.formClear(),this.centervisible=!1,this.addOrEditTitle=""},handleConfirm(){this.$refs.reportClass.submitForm()},successSubmit(){this.handleCancel(),this.getList()}}},p=b,C=(0,c.Z)(p,s,a,!1,null,null,null),g=C.exports}}]);
|