(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-1a41"],{"5W5M":function(t,e,a){"use strict";a.d(e,"g",function(){return o}),a.d(e,"b",function(){return n}),a.d(e,"d",function(){return s}),a.d(e,"i",function(){return c}),a.d(e,"f",function(){return l}),a.d(e,"e",function(){return u}),a.d(e,"a",function(){return m}),a.d(e,"c",function(){return p}),a.d(e,"h",function(){return d});var i=a("t3Un"),r=a("X4fA");function o(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/dictionary-types",method:"get",params:t||{}})}function n(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/adddictionary-types",method:"post",data:t})}function s(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/deldictionary-types",method:"post",data:t})}function c(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/putdictionary-types",method:"post",data:t})}function l(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/dictionary-items",method:"get",params:t||{}})}function u(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/dictionaryAllItems",method:"get",params:t||{}})}function m(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/adddictionary-items",method:"post",data:t})}function p(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/deldictionary-items",method:"post",data:t})}function d(t){return Object(i.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/putdictionary-items",method:"post",data:t})}},bb4u:function(t,e,a){"use strict";a.r(e);var i=a("bS4n"),r=a.n(i),o=a("8t5x"),n=a("5W5M"),s=a("7Qib"),c=a("8fCU"),l=a("jJIE"),u=a.n(l),m=(a("Yfch"),a("4f16")),p={name:"Dictionary",filters:{parseStatus:function(t){return 1==t?"启用":"禁用"}},computed:r()({},Object(o.b)(["userType"])),data:function(){return{pageSizeType:10,recordTotalType:0,currentPageType:1,pageTotalType:0,pageSizeItem:10,recordTotalItem:0,currentPageItem:1,pageTotalItem:0,tableKey:0,dictionaryTypeData:null,dictionaryItemData:null,typeListLoading:!1,itemListLoading:!1,selectRow:null,typeDataForm:{id:"",code:"",text:"",description:""},itemDataForm:{id:"",sort:"",text:"",value:"",status:1,dictionaryTypeId:"",description:""},typeQueryForm:{name:""},itemQueryForm:{name:""},typeDialogFormVisible:!1,typeDialogStatus:"",typeDataFormRules:{code:[{required:!0,message:"类型编码不能为空",trigger:"blur"}],text:[{required:!0,message:"类型名称不能为空",trigger:"blur"}]},itemDialogFormVisible:!1,itemDialogStatus:"",itemDataFormRules:{value:[{required:!0,message:"字典值不能为空",trigger:"blur"}],text:[{required:!0,message:"字典标签不能为空",trigger:"blur"}],sort:[{required:!0,message:"字典排序不能为空",trigger:"blur"}]}}},created:function(){this.getDictionaryTypeList()},methods:{getDictionaryTypeList:function(){var t=this,e={};e.pageIndex=t.currentPageType,e.pageSize=t.pageSizeType;var a=u.a.get("userName");for(var i in e.operator=a,t.queryForm)void 0!=t.queryForm[i]&&""!=t.queryForm[i].toString()&&(e[i]=t.queryForm[i]);t.typeListLoading=!0,Object(n.g)(e).then(function(e){var a=e.data;if(200==a.code){var i=a.result;t.recordTotalType=i.totalCount,t.pageSizeType=i.pageSize,t.pageTotalType=Object(s.a)(i.totalCount,i.pageSize),t.currentPageType=i.pageIndex,t.dictionaryTypeData=i.result}else Object(c.a)({error:a.message,vm:t});t.typeListLoading=!1}).catch(function(e){t.typeListLoading=!1,Object(c.a)({error:e,vm:t})})},getDictionaryItemList:function(){var t=this,e={};if(e.pageIndex=t.currentPageItem,e.pageSize=t.pageSizeItem,t.selectRow){e.dictionaryTypeId=t.selectRow.id;var a=u.a.get("userName");for(var i in e.operator=a,t.queryForm)void 0!=t.queryForm[i]&&""!=t.queryForm[i].toString()&&(e[i]=t.queryForm[i]);t.listLoading=!0,Object(n.f)(e).then(function(e){var a=e.data;if(200==a.code){var i=a.result;t.recordTotalItem=i.totalCount,t.pageSizeItem=i.pageSize,t.pageTotalItem=Object(s.a)(i.totalCount,i.pageSize),t.currentPageItem=i.pageIndex,t.dictionaryItemData=i.result}else Object(c.a)({error:a.message,vm:t});t.listLoading=!1}).catch(function(e){t.listLoading=!1,Object(c.a)({error:e,vm:t})})}},createHandle:function(t){"dictionaryType"==t?this.createTypeHandle():this.createItemHandle()},createTypeHandle:function(){var t=this;this.$refs.typeDataForm.validate(function(e){if(e){var a=u.a.get("userName");t.typeDataForm.operator=a,Object(n.b)(t.typeDataForm).then(function(e){var a=e.data;200==a.code?(t.typeDialogFormVisible=!1,t.$message({message:"创建成功",type:"success"}),t.getDictionaryTypeList()):Object(c.a)({error:a.message,vm:t})}).catch(function(e){Object(c.a)({error:e,vm:t})})}})},createItemHandle:function(){var t=this;this.$refs.itemDataForm.validate(function(e){if(e){var a=u.a.get("userName");t.itemDataForm.operator=a,Object(n.a)(t.itemDataForm).then(function(e){var a=e.data;200==a.code?(t.itemDialogFormVisible=!1,t.$message({message:"创建成功",type:"success"}),t.getDictionaryItemList()):Object(c.a)({error:a.message,vm:t})}).catch(function(e){Object(c.a)({error:e,vm:t})})}})},deleteHandle:function(t,e){var a=this;"dictionaryType"==e?m.MessageBox.confirm("确定删除"+t.text+"信息","确定删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.deleteTypeAction(t)}).catch(function(){console.log("已取消删除")}):m.MessageBox.confirm("确定删除"+t.text+"信息","确定删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){a.deleteItemAction(t)}).catch(function(){console.log("已取消删除")})},deleteTypeAction:function(t){var e=this,a={};a.id=t.id;var i=u.a.get("userName");a.operator=i,Object(n.d)(a).then(function(t){var a=t.data;200==a.code?(e.$message({message:"删除成功",type:"success"}),e.getDictionaryTypeList()):Object(c.a)({error:a.message,vm:e})}).catch(function(t){Object(c.a)({error:t,vm:e})})},deleteItemAction:function(t){var e=this,a={};a.id=t.id;var i=u.a.get("userName");a.operator=i,Object(n.c)(a).then(function(t){var a=t.data;200==a.code?(e.$message({message:"删除成功",type:"success"}),e.getDictionaryItemList()):Object(c.a)({error:a.message,vm:e})}).catch(function(t){Object(c.a)({error:t,vm:e})})},refreshHandle:function(t){"dictionaryType"==t?this.getDictionaryTypeList():this.getDictionaryItemList()},queryHandle:function(t){"dictionaryType"==t?(this.currentPageType=1,this.getDictionaryTypeList()):(this.currentPageItem=1,this.getDictionaryItemList())},resetTypeDataForm:function(){this.typeDataForm={id:"",code:"",text:"",description:""}},resetItemDataForm:function(){this.itemDataForm={id:"",sort:"",text:"",value:"",status:1,dictionaryTypeId:"",description:""}},showCreateHandle:function(t){var e=this;if("dictionaryType"==t)this.resetTypeDataForm(),this.typeDialogStatus="create",this.typeDialogFormVisible=!0,this.$nextTick(function(){e.$refs.typeDataForm.clearValidate()});else{if(this.resetItemDataForm(),this.itemDialogStatus="create",this.itemDialogFormVisible=!0,!this.selectRow)return void Object(c.a)({error:"当前为选择字典类型",vm:this});this.itemDataForm.dictionaryTypeId=this.selectRow.id,this.$nextTick(function(){e.$refs.itemDataForm.clearValidate()})}},updateHandle:function(t){"dictionaryType"==t?this.updateTypeHandle():this.updateItemHandle()},updateTypeHandle:function(){var t=this;this.$refs.typeDataForm.validate(function(e){var a=t;if(e){var i=u.a.get("userName");a.typeDataForm.operator=i,Object(n.i)(a.typeDataForm).then(function(t){var e=t.data;200==e.code?(a.typeDialogFormVisible=!1,a.$message({message:"更新成功",type:"success"}),a.getDictionaryTypeList()):Object(c.a)({error:e.message,vm:a})}).catch(function(t){Object(c.a)({error:t,vm:a})})}})},updateItemHandle:function(){var t=this;this.$refs.itemDataForm.validate(function(e){var a=t;if(e){var i=u.a.get("userName");a.itemDataForm.operator=i,Object(n.h)(a.itemDataForm).then(function(t){var e=t.data;200==e.code?(a.itemDialogFormVisible=!1,a.$message({message:"更新成功",type:"success"}),a.getDictionaryItemList()):Object(c.a)({error:e.message,vm:a})}).catch(function(t){Object(c.a)({error:t,vm:a})})}})},showEditHandle:function(t,e){var a=this;"dictionaryType"==e?(this.resetTypeDataForm(),this.typeDialogStatus="editor",this.typeDataForm.id=t.id,this.typeDataForm.code=t.code,this.typeDataForm.text=t.text,this.typeDataForm.description=t.description,this.typeDialogFormVisible=!0,this.$nextTick(function(){a.$refs.typeDataForm.clearValidate()})):(this.resetItemDataForm(),this.itemDialogStatus="editor",this.itemDataForm.id=t.id,this.itemDataForm.value=t.value,this.itemDataForm.text=t.text,this.itemDataForm.sort=t.sort,this.itemDataForm.status=t.status,this.itemDataForm.description=t.description,console.log(this.itemDataForm.status),this.itemDialogFormVisible=!0,this.$nextTick(function(){a.$refs.itemDataForm.clearValidate()}))},typeHandleSizeChange:function(t){this.pageSizeType=t,this.currentPageType=1,this.getDictionaryTypeList()},typeHandleCurrentChange:function(t){this.currentPageType=t,this.getDictionaryTypeList()},itemHandleSizeChange:function(t){this.pageSizeItem=t,this.currentPageItem=1,this.getDictionaryItemList()},itemHandleCurrentChange:function(t){this.currentPageItem=t,this.getDictionaryItemList()},tableCurrentChange:function(t,e){this.selectRow=t,t&&this.getDictionaryItemList()}}},d=a("ZrdR"),y=Object(d.a)(p,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("el-row",{attrs:{gutter:10}},[a("el-col",{attrs:{xs:24,sm:24,md:10,lg:10,xl:10}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("字典类型")])]),t._v(" "),a("div",{staticClass:"filter-container"},[a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-refresh"},on:{click:function(e){t.refreshHandle("dictionaryType")}}},[t._v("刷新")]),t._v(" "),1===t.userType?a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(e){t.showCreateHandle("dictionaryType")}}},[t._v("新增")]):t._e(),t._v(" "),a("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"输入名称"},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.queryHandle("dictionaryType")}},model:{value:t.typeQueryForm.name,callback:function(e){t.$set(t.typeQueryForm,"name",e)},expression:"typeQueryForm.name"}}),t._v(" "),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){t.queryHandle("dictionaryType")}}})],1),t._v(" "),a("div",{staticClass:"table_content"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.typeListLoading,expression:"typeListLoading"}],staticStyle:{width:"100%"},attrs:{data:t.dictionaryTypeData,border:"",fit:"","highlight-current-row":""},on:{"current-change":t.tableCurrentChange}},[a("el-table-column",{attrs:{label:"编码",prop:"code",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.code))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"名称",prop:"text",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.text))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"备注",prop:"description",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.description))])]}}])}),t._v(" "),1===t.userType?a("el-table-column",{attrs:{label:"操作",align:"center",width:"240","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.showEditHandle(e.row,"dictionaryType")}}},[t._v("编辑")]),t._v(" "),a("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(a){t.deleteHandle(e.row,"dictionaryType")}}},[t._v("删除")])]}}])}):t._e()],1),t._v(" "),a("br"),t._v(" "),a("el-pagination",{directives:[{name:"show",rawName:"v-show",value:t.recordTotalType>0,expression:"recordTotalType>0"}],attrs:{"current-page":t.currentPageType,"page-sizes":[10,20,30,50],"page-size":t.pageSizeType,total:t.recordTotalType,layout:"total, prev, pager, next,sizes",background:""},on:{"size-change":t.typeHandleSizeChange,"current-change":t.typeHandleCurrentChange}})],1)])],1),t._v(" "),a("el-col",{attrs:{xs:24,sm:24,md:14,lg:14,xl:14}},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("span",[t._v("字典详情\n "),t.selectRow?a("span",[t._v("\n >>"+t._s(t.selectRow.text)+"\n ")]):t._e()])]),t._v(" "),t.selectRow?a("div",[a("div",{staticClass:"filter-container"},[a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-refresh"},on:{click:function(e){t.refreshHandle("dictionaryItem")}}},[t._v("刷新")]),t._v(" "),1===t.userType?a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(e){t.showCreateHandle("dictionaryItem")}}},[t._v("新增")]):t._e(),t._v(" "),a("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"输入名称"},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.queryHandle("dictionaryItem")}},model:{value:t.itemQueryForm.name,callback:function(e){t.$set(t.itemQueryForm,"name",e)},expression:"itemQueryForm.name"}}),t._v(" "),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){t.queryHandle("dictionaryItem")}}})],1),t._v(" "),a("div",{staticClass:"table_content"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.itemListLoading,expression:"itemListLoading"}],staticStyle:{width:"100%"},attrs:{data:t.dictionaryItemData,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{label:"字典标签",prop:"text",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.text))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"字典值",prop:"value",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.value))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"排序",prop:"sort",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.sort))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"状态",prop:"status",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t._f("parseStatus")(e.row.status)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"备注",prop:"description",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.description))])]}}])}),t._v(" "),1===t.userType?a("el-table-column",{attrs:{label:"操作",align:"center",width:"240","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.showEditHandle(e.row,"dictionaryItem")}}},[t._v("编辑")]),t._v(" "),a("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(a){t.deleteHandle(e.row,"dictionaryItem")}}},[t._v("删除")])]}}])}):t._e()],1),t._v(" "),a("br"),t._v(" "),a("el-pagination",{directives:[{name:"show",rawName:"v-show",value:t.recordTotalItem>0,expression:"recordTotalItem>0"}],attrs:{"current-page":t.currentPageItem,"page-sizes":[10,20,30,50],"page-size":t.pageSizeItem,total:t.recordTotalItem,layout:"total, prev, pager, next,sizes",background:""},on:{"size-change":t.itemHandleSizeChange,"current-change":t.itemHandleCurrentChange}})],1)]):a("div",[a("span",[t._v("点击字典类型查看字典详情")])])])],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"create"===t.typeDialogStatus?"新增":"编辑",visible:t.typeDialogFormVisible,"modal-append-to-body":!1,width:"700px","close-on-click-modal":!1},on:{"update:visible":function(e){t.typeDialogFormVisible=e}}},[a("el-form",{ref:"typeDataForm",staticStyle:{"margin-left":"50px",width:"500px"},attrs:{rules:t.typeDataFormRules,model:t.typeDataForm,"label-position":"right","label-width":"140px","element-loading-text":"保存中..."}},[a("el-form-item",{attrs:{label:"类型编码:",prop:"code"}},[a("el-input",{model:{value:t.typeDataForm.code,callback:function(e){t.$set(t.typeDataForm,"code","string"==typeof e?e.trim():e)},expression:"typeDataForm.code"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"类型名称:",prop:"text"}},[a("el-input",{model:{value:t.typeDataForm.text,callback:function(e){t.$set(t.typeDataForm,"text","string"==typeof e?e.trim():e)},expression:"typeDataForm.text"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"备注:",prop:"description"}},[a("el-input",{attrs:{autosize:{minRows:2,maxRows:4},type:"textarea"},model:{value:t.typeDataForm.description,callback:function(e){t.$set(t.typeDataForm,"description","string"==typeof e?e.trim():e)},expression:"typeDataForm.description"}})],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.typeDialogFormVisible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){"create"===t.typeDialogStatus?t.createHandle("dictionaryType"):t.updateHandle("dictionaryType")}}},[t._v("确认")])],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"create"===t.itemDialogStatus?"新增":"编辑",visible:t.itemDialogFormVisible,"modal-append-to-body":!1,width:"700px","close-on-click-modal":!1},on:{"update:visible":function(e){t.itemDialogFormVisible=e}}},[a("el-form",{ref:"itemDataForm",staticStyle:{"margin-left":"50px",width:"500px"},attrs:{rules:t.itemDataFormRules,model:t.itemDataForm,"label-position":"right","label-width":"140px","element-loading-text":"保存中..."}},[a("el-form-item",{attrs:{label:"字典值(编码):",prop:"value"}},[a("el-input",{model:{value:t.itemDataForm.value,callback:function(e){t.$set(t.itemDataForm,"value","string"==typeof e?e.trim():e)},expression:"itemDataForm.value"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"字典标签:",prop:"text"}},[a("el-input",{model:{value:t.itemDataForm.text,callback:function(e){t.$set(t.itemDataForm,"text","string"==typeof e?e.trim():e)},expression:"itemDataForm.text"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"排序:",prop:"sort"}},[a("el-input-number",{attrs:{min:0,max:100},model:{value:t.itemDataForm.sort,callback:function(e){t.$set(t.itemDataForm,"sort",t._n(e))},expression:"itemDataForm.sort"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"是否启用"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-text":"启用","inactive-text":"禁用"},model:{value:t.itemDataForm.status,callback:function(e){t.$set(t.itemDataForm,"status",t._n(e))},expression:"itemDataForm.status"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"备注:",prop:"description"}},[a("el-input",{attrs:{autosize:{minRows:2,maxRows:4},type:"textarea"},model:{value:t.itemDataForm.description,callback:function(e){t.$set(t.itemDataForm,"description","string"==typeof e?e.trim():e)},expression:"itemDataForm.description"}})],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.itemDialogFormVisible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){"create"===t.itemDialogStatus?t.createHandle("dictionaryItem"):t.updateHandle("dictionaryItem")}}},[t._v("确认")])],1)],1)],1)},[],!1,null,null,null);y.options.__file="index.vue";e.default=y.exports}}]);