chunk-67a054c9.722b5804.js 6.4 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-67a054c9"],{"0955":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("base-form",{ref:"ruleForm",attrs:{noLabel:!1,data:t.searchData}})},s=[],n=a("5530"),r={props:{listLoading:Boolean},inject:["parentData"],mixins:mixins,data:function(){return{searchData:[{label:"类型名称",disabled:!0,key:"dict_name"},{label:"类型代号",disabled:!0,key:"dict_type"}]}},mounted:function(){var t=this.parentData.$route.query||{};this.setDefaultValue(t,"searchData")},methods:{searchHandle:function(){var t=this.$refs.ruleForm.baseForm,e=Object(n["a"])({},t);this.$emit("change",e)},add:function(){this.$emit("add")}}},o=r,c=a("2877"),l=Object(c["a"])(o,i,s,!1,null,null,null);e["default"]=l.exports},"4fef":function(t,e,a){"use strict";a.r(e);var i=a("ade3"),s=a("5530");a("4e82"),a("e9c4"),a("a9e3");e["default"]={data:function(){return{listLoading:!1,tableData:[],currentPage:1,pageSize:10,totalRecords:1,listConfig:{},operations:[]}},created:function(){var t=this;this.$nextTick((function(){t.noCreated||t.fetchData()}))},methods:{searchHandle:function(t){this.currentPage=1,this.searchForm=t,this.fetchData()},sizeChange:function(t){this.pageSize=t,this.currentPage=1,this.fetchData()},pageHandle:function(t){this.currentPage=t,this.fetchData()},sortChange:function(t){this.currentPage=1;var e=Object(s["a"])({},this.searchForm);"ascending"===t.order?e.sort=JSON.stringify(Object(i["a"])({},t.prop,"asc")):e.sort=JSON.stringify(Object(i["a"])({},t.prop,"desc")),this.searchForm=Object(s["a"])({},e),this.fetchData(e)},fetchData:function(t){var e=this;if(this.apiStr){var a={page:this.currentPage,page_size:this.pageSize};t?a=Object(s["a"])(Object(s["a"])({},a),t):this.searchForm&&(a=Object(s["a"])(Object(s["a"])({},a),this.searchForm)),this.getDataBefore&&this.getDataBefore(a),this.listLoading=!0;var i=this.apiStr.split(".");this.$api[i[0]][i[1]](a).then((function(t){return 1===e.currentPage&&(e.pageSize=t.page_size||1),e.totalRecords=t.total?Number(t.total):0,e.tableData=t.list||[],e.listLoading=!1,e.getMoreData&&e.getMoreData(t,a),t})).catch((function(t){e.listLoading=!1}))}}}}},7486:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("search-form"),a("table-list",{attrs:{listLoading:t.listLoading,data:t.tableData2,columns:t.listConfig,currentPage:t.currentPage,pageSize:t.pageSize,totalRecords:t.totalRecords,isAdd:!0},on:{currentChange:t.pageHandle,sizeChange:t.sizeChange,add:t.openPopup}}),a("dict-edit",{attrs:{isShow:t.isPopupShow,curObj:t.curObj},on:{close:t.closePopup}})],1)},s=[],n=a("2909"),r=(a("d81d"),a("a9e3"),a("ed08"),a("0955")),o=a("b7d0"),c=a("4fef"),l={components:{SearchForm:r["default"],DictEdit:o["default"]},provide:function(){return{parentData:this}},mixins:[c["default"]],data:function(){return{apiStr:"base.admdictdatalist",searchForm:null,isPopupShow:!1,noCreated:!0,curObj:{},curId:"",curType:""}},computed:{tableData2:function(){var t=Object(n["a"])(this.tableData);return t.map((function(t){1===Number(t.system)&&(t.nosys=!0)})),t}},mounted:function(){this.listConfig={rows:[{label:"排序",prop:"dict_sort"},{label:"值",prop:"dict_value"},{label:"名称",prop:"dict_label"},{label:"自定义值1",prop:"option1"},{label:"自定义值2",prop:"option2"},{label:"说明",prop:"remark"},{label:"更新人",prop:"update_by"},{label:"更新时间",prop:"update_at"},{label:"操作",width:200,type:"handle2",operations:[{label:"编辑",func:this.openPopup,btnType:"primary"},{label:"删除",func:this.delHandle,btnType:"danger",hide:"nosys"}]}]};var t=this.$route.query;t.dict_type&&(this.curType=t.dict_type||"",this.searchForm={dict_type:t.dict_type},this.fetchData())},methods:{delHandle:function(t){var e=this,a="确定要删除此字典吗?";this.$msg(a,"confirm",(function(){e.$api.base.dictdatadel({data_id:t.id}).then((function(t){e.$msgs("删除成功!"),e.fetchData()}))}),null,!0)},statusHandle:function(t){var e=this,a=1===Number(t.status)?2:1,i=1===Number(t.status)?"停用":"启用";this.$msg("确定要".concat(i,"该字典吗?"),"confirm",(function(){e.$api.base.dictupdate({id:t.id,status:a}).then((function(t){e.$msgs("".concat(i,"成功!")),e.fetchData()}))}),null,!0)},openPopup:function(t){this.curObj=t||{},this.isPopupShow=!0},closePopup:function(t){this.isPopupShow=!1,t&&this.fetchData()}}},u=l,d=a("2877"),h=Object(d["a"])(u,i,s,!1,null,null,null);e["default"]=h.exports},b7d0:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"show-close":!1,"close-on-click-modal":!1,visible:t.isShow,title:this.curObj&&this.curObj.typeName?"编辑字典":"添加字典",fullscreen:!1,width:"470px","custom-class":"xl-dialog",center:""},on:{"update:visible":function(e){t.isShow=e}}},[a("base-form",{ref:"ruleForm",staticStyle:{width:"400px"},attrs:{data:t.formData,isInline:!1,labelWidth:"100px"}},[a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn t2",on:{click:t.close}},[t._v("关 闭")]),a("el-button",{staticClass:"xl-form-btn t1",on:{click:function(e){return t.close("confirm")}}},[t._v("确定")]),this.curObj.id?t._e():a("el-button",{staticClass:"xl-form-btn t1",on:{click:function(e){return t.close("next")}}},[t._v("继续添加")])],1)])],1)},s=[],n=a("5530"),r={props:{isShow:Boolean,curObj:Object},inject:["parentData"],mixins:mixins,data:function(){return{formData:[],loading:!0}},watch:{isShow:function(t){if(t){var e=Object(n["a"])({},this.curObj),a=!1;e.id&&(a=!0),this.formData=[{label:"值",key:"dict_value",disabled:a,rules:1},{label:"名称",key:"dict_label",rules:1},{label:"排序",key:"dict_sort"},{label:"自定义值1",key:"option1"},{label:"自定义值2",key:"option2"},{label:"说明",key:"remark"}],this.setDefaultValue(e)}}},methods:{close:function(t){var e=this;"confirm"===t||"next"===t?this.$refs["ruleForm"].$refs["baseForm"].validate((function(a){if(a){var i=e.$refs.ruleForm.baseForm,s=Object(n["a"])({},i);s.dict_type=e.parentData.curType;var r="dictdataadd";e.curObj&&e.curObj.id&&(s.data_id=e.curObj.id,r="dictdataedit"),e.$api.base[r](s).then((function(a){e.$msgs("保存成功!"),"next"===t?e.setDefaultValue():e.$emit("close",s)}))}})):(this.$emit("close"),this.setDefaultValue())}}},o=r,c=a("2877"),l=Object(c["a"])(o,i,s,!1,null,null,null);e["default"]=l.exports}}]);