1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a4224b20","chunk-2d0c45fa","chunk-2d0c9a89"],{"3b0e":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e._self._c;return t("a-modal",{style:e.modalStyle,attrs:{width:e.modalWidth,visible:e.visible,maskClosable:!1},on:{cancel:e.handleCancel}},[t("template",{slot:"footer"},[t("a-button",{on:{click:e.handleCancel}},[e._v("关闭")])],1),t("a-table",{ref:"table",attrs:{rowKey:"id",size:"middle",columns:e.columns,loading:e.loading,dataSource:e.dataSource,pagination:!1},scopedSlots:e._u([{key:"action",fn:function(a,i){return t("span",{},[t("a",{on:{click:function(t){return e.handleBack(i.id)}}},[t("a-icon",{attrs:{type:"redo"}}),e._v("字典取回")],1),t("a-divider",{attrs:{type:"vertical"}}),t("a",{on:{click:function(t){return e.handleDelete(i.id)}}},[t("a-icon",{attrs:{type:"scissor"}}),e._v("彻底删除")],1)],1)}}])})],2)},r=[],s=a("0fea"),n={name:"DictDeleteList",data:function(){return{modalWidth:"90%",modalStyle:{top:"20px"},title:"操作",visible:!1,loading:!1,dataSource:[],columns:[{title:"#",dataIndex:"",key:"rowIndex",width:120,align:"center",customRender:function(e,t,a){return parseInt(a)+1}},{title:"字典名称",align:"left",dataIndex:"dictName"},{title:"字典编号",align:"left",dataIndex:"dictCode"},{title:"描述",align:"left",dataIndex:"description"},{title:"操作",dataIndex:"action",align:"center",scopedSlots:{customRender:"action"}}]}},methods:{handleCancel:function(){this.visible=!1,this.$emit("refresh")},show:function(){this.visible=!0,this.loadData()},loadData:function(){var e=this;this.loading=!0,Object(s["c"])("/sys/dict/deleteList").then((function(t){e.loading=!1,t.success?e.dataSource=t.result:e.$message.warning(t.message)}))},handleBack:function(e){var t=this;Object(s["k"])("/sys/dict/back/"+e).then((function(e){e.success?(t.$message.success(e.message),t.loadData()):t.$message.warning(e.message)}))},handleDelete:function(e){var t=this,a=this.$createElement;this.$confirm({title:"彻底删除字典",content:a("div",[a("p",["您确定要彻底删除这个字典项吗?"]),a("p",{style:"color:red;"},["注意:彻底删除后将无法恢复,请谨慎操作!"])]),centered:!1,onOk:function(){var a=t;Object(s["a"])("/sys/dict/deletePhysic/"+e).then((function(e){e.success?(t.$message.success(e.message),t.loadData()):a.$message.warning(e.message)}))}})}}},l=n,o=a("2877"),c=Object(o["a"])(l,i,r,!1,null,"49f4861d",null);t["default"]=c.exports},"57ed":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:600,visible:e.visible,confirmLoading:e.confirmLoading,cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"字典名称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator.trim",value:["dictName",e.validatorRules.dictName],expression:"[ 'dictName', validatorRules.dictName]",modifiers:{trim:!0}}],attrs:{placeholder:"请输入字典名称"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"字典编码"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator.trim",value:["dictCode",e.validatorRules.dictCode],expression:"[ 'dictCode', validatorRules.dictCode]",modifiers:{trim:!0}}],attrs:{placeholder:"请输入字典编码"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"描述"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["description"],expression:"[ 'description']"}]})],1)],1)],1)],1)},r=[],s=a("88bc"),n=a.n(s),l=a("4ec3"),o={name:"DictModal",data:function(){return{value:1,title:"操作",visible:!1,model:{},labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,form:this.$form.createForm(this),validatorRules:{dictName:{rules:[{required:!0,message:"请输入字典名称!"}]},dictCode:{rules:[{required:!0,message:"请输入字典编码!"},{validator:this.validateDictCode}]}}}},created:function(){},methods:{validateDictCode:function(e,t,a){var i={tableName:"sys_dict",fieldName:"dict_code",fieldVal:t,dataId:this.model._id};this.model.dictCode!=t?Object(l["m"])(i).then((function(e){e.success?a():a(e.message)})):a()},handleChange:function(e){this.model.status=e},add:function(){this.edit({})},edit:function(e){var t=this;e._id?this.visiblekey=!0:this.visiblekey=!1,this.form.resetFields(),this.model=Object.assign({},e),this.visible=!0,this.$nextTick((function(){t.form.setFieldsValue(n()(t.model,"dictName","dictCode","description"))}))},handleOk:function(){var e=this,t=this;this.form.validateFields((function(a,i){if(!a){t.confirmLoading=!0,i.dictName=(i.dictName||"").trim(),i.dictCode=(i.dictCode||"").trim(),i.description=(i.description||"").trim();var r,s=Object.assign(e.model,i);r=e.model._id?Object(l["n"])(s):Object(l["a"])(s),r.then((function(e){e.success?(t.$message.success(e.message),t.$emit("ok")):t.$message.warning(e.message)})).finally((function(){t.confirmLoading=!1,t.close()}))}}))},handleCancel:function(){this.close()},close:function(){this.$emit("close"),this.visible=!1}}},c=o,d=a("2877"),u=Object(d["a"])(c,i,r,!1,null,null,null);t["default"]=u.exports},"59a0":function(e,t,a){"use strict";function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function r(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?i(Object(a),!0).forEach((function(t){s(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):i(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function s(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("a-drawer",{attrs:{title:"字典列表",width:e.screenWidth,visible:e.visible},on:{close:e.onClose}},[t("div",{style:{padding:"10px",border:"1px solid #e9e9e9",background:"#fff"}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{layout:"inline",form:e.form},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchQuery.apply(null,arguments)}}},[t("a-row",{attrs:{gutter:10}},[t("a-col",{attrs:{md:8,sm:12}},[t("a-form-item",{attrs:{label:"名称"}},[t("a-input",{staticStyle:{width:"120px"},attrs:{placeholder:"请输入名称"},model:{value:e.queryParam.itemText,callback:function(t){e.$set(e.queryParam,"itemText",t)},expression:"queryParam.itemText"}})],1)],1),t("a-col",{attrs:{md:9,sm:24}},[t("a-form-item",{staticStyle:{width:"170px"},attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-select",{attrs:{placeholder:"请选择"},model:{value:e.queryParam.status,callback:function(t){e.$set(e.queryParam,"status",t)},expression:"queryParam.status"}},[t("a-select-option",{attrs:{value:"1"}},[e._v("正常")]),t("a-select-option",{attrs:{value:"0"}},[e._v("禁用")])],1)],1)],1),t("a-col",{attrs:{md:7,sm:24}},[t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"left"}},[t("a-button",{attrs:{type:"primary"},on:{click:e.searchQuery}},[e._v("搜索")]),t("a-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary"},on:{click:e.searchReset}},[e._v("重置")])],1)])],1),t("a-row",[t("a-col",{attrs:{md:2,sm:24}},[t("a-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary"},on:{click:e.handleAdd}},[e._v("新增")])],1)],1)],1)],1),t("div",[t("a-table",{ref:"table",attrs:{rowKey:"itemValue",size:"middle",columns:e.columns,dataSource:e.dataSource,pagination:e.ipagination,loading:e.loading},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"action",fn:function(a,i){return t("span",{},[t("a",{on:{click:function(t){return e.handleEdit(r(r({},i),{},{dictId:e.dictId}))}}},[e._v("编辑")]),t("a-divider",{attrs:{type:"vertical"}}),t("a-popconfirm",{attrs:{title:"确定删除吗?"},on:{confirm:function(){return e.handleDelete({itemValue:i.itemValue,id:e.dictId})}}},[t("a",[e._v("删除")])])],1)}}])})],1)])]),t("dict-item-modal",{ref:"modalForm",on:{ok:e.modalFormOk}})],1)},l=[],o=a("88bc"),c=a.n(o),d=a("ca00"),u=a("8144"),m=a("b65a"),p={name:"DictItemList",mixins:[m["a"]],components:{DictItemModal:u["default"]},data:function(){return{columns:[{title:"名称",align:"center",dataIndex:"itemText"},{title:"数据值",align:"center",dataIndex:"itemValue"},{title:"操作",dataIndex:"action",align:"center",scopedSlots:{customRender:"action"}}],queryParam:{dictId:"",dictName:"",itemText:"",delFlag:"1",status:[]},title:"操作",visible:!1,screenWidth:800,model:{},dictId:"",status:1,labelCol:{xs:{span:5},sm:{span:5}},wrapperCol:{xs:{span:12},sm:{span:12}},form:this.$form.createForm(this),validatorRules:{itemText:{rules:[{required:!0,message:"请输入名称!"}]},itemValue:{rules:[{required:!0,message:"请输入数据值!"}]}},url:{list:"/admin/dictItem/list",delete:"/admin/dictItem/delete",deleteBatch:"/admin/dictItem/deleteBatch"}}},created:function(){this.resetScreenSize()},methods:{add:function(e){this.dictId=e,this.edit({})},edit:function(e){var t=this;e._id&&(this.dictId=e._id),this.queryParam={},this.form.resetFields(),this.model=Object.assign({},e),this.model.dictId=this.dictId,this.model.status=this.status,this.visible=!0,this.$nextTick((function(){t.form.setFieldsValue(c()(t.model,"itemText","itemValue"))})),this.loadData()},getQueryParams:function(){var e=Object.assign({},this.queryParam);return e.dictId=this.dictId,e.field=this.getQueryField(),e.pageNo=this.ipagination.current,e.pageSize=this.ipagination.pageSize,this.superQueryParams&&(e["superQueryParams"]=encodeURI(this.superQueryParams),e["superQueryMatchType"]=this.superQueryMatchType),Object(d["d"])(e)},handleAdd:function(){this.$refs.modalForm.add(this.dictId),this.$refs.modalForm.title="新增"},showDrawer:function(){this.visible=!0},onClose:function(){this.visible=!1,this.form.resetFields(),this.dataSource=[]},resetScreenSize:function(){var e=document.body.clientWidth;this.screenWidth=e<600?e:600}}},f=p,h=a("2877"),b=Object(h["a"])(f,n,l,!1,null,"37dfbd26",null);t["default"]=b.exports},"68b4":function(e,t,a){"use strict";a("ab84")},ab84:function(e,t,a){},b4e3:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{layout:"inline"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchQuery.apply(null,arguments)}}},[t("a-row",{attrs:{gutter:12}},[t("a-col",{attrs:{md:7,sm:8}},[t("a-form-item",{attrs:{label:"字典名称",labelCol:{span:6},wrapperCol:{span:14,offset:1}}},[t("a-input",{attrs:{placeholder:"请输入字典名称"},model:{value:e.queryParam.dictName,callback:function(t){e.$set(e.queryParam,"dictName",t)},expression:"queryParam.dictName"}})],1)],1),t("a-col",{attrs:{md:7,sm:8}},[t("a-form-item",{attrs:{label:"字典编号",labelCol:{span:6},wrapperCol:{span:14,offset:1}}},[t("a-input",{attrs:{placeholder:"请输入字典编号"},model:{value:e.queryParam.dictCode,callback:function(t){e.$set(e.queryParam,"dictCode",t)},expression:"queryParam.dictCode"}})],1)],1),t("a-col",{attrs:{md:7,sm:8}},[t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"left",overflow:"hidden"}},[t("a-button",{attrs:{type:"primary",icon:"search"},on:{click:e.searchQuery}},[e._v("查询")]),t("a-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary",icon:"reload"},on:{click:e.searchReset}},[e._v("重置")])],1)])],1)],1),t("div",{staticClass:"table-operator",staticStyle:{"border-top":"5px"}},[t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("添加")]),t("a-button",{attrs:{type:"primary",icon:"download"},on:{click:function(t){return e.handleExportXls("字典信息")}}},[e._v("导出")]),t("a-upload",{attrs:{name:"file",showUploadList:!1,multiple:!1,headers:e.tokenHeader,action:e.importExcelUrl},on:{change:e.handleImportExcel}},[t("a-button",{attrs:{type:"primary",icon:"import"}},[e._v("导入")])],1),t("a-button",{attrs:{type:"primary",icon:"sync"},on:{click:function(t){return e.refleshCache()}}},[e._v("刷新缓存")]),t("a-button",{attrs:{type:"primary",icon:"hdd"},on:{click:e.openDeleteList}},[e._v("回收站")])],1),t("a-table",{ref:"table",attrs:{rowKey:"_id",size:"middle",columns:e.columns,dataSource:e.dataSource,pagination:e.ipagination,loading:e.loading},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"action",fn:function(a,i){return t("span",{},[t("a",{on:{click:function(t){return e.handleEdit(i)}}},[t("a-icon",{attrs:{type:"edit"}}),e._v("\n 编辑\n ")],1),t("a-divider",{attrs:{type:"vertical"}}),t("a",{on:{click:function(t){return e.editDictItem(i)}}},[t("a-icon",{attrs:{type:"setting"}}),e._v(" 字典配置")],1),t("a-divider",{attrs:{type:"vertical"}}),t("a-popconfirm",{attrs:{title:"确定删除吗?"},on:{confirm:function(){return e.handleDelete(i._id)}}},[t("a",[e._v("删除")])])],1)}}])})],1),t("dict-modal",{ref:"modalForm",on:{ok:e.modalFormOk}}),t("dict-item-list",{ref:"dictItemList"}),t("dict-delete-list",{ref:"dictDeleteList",on:{refresh:function(){return e.loadData()}}})],1)},r=[],s=a("ca00"),n=a("b65a"),l=a("57ed"),o=a("59a0"),c=a("3b0e"),d=a("0fea"),u=a("9fb0"),m=a("2b0e"),p={name:"DictList",mixins:[n["a"]],components:{DictModal:l["default"],DictItemList:o["default"],DictDeleteList:c["default"]},data:function(){return{description:"这是数据字典页面",visible:!1,queryParam:{dictCode:"",dictName:""},columns:[{title:"#",dataIndex:"",key:"rowIndex",width:120,align:"center",customRender:function(e,t,a){return parseInt(a)+1}},{title:"字典名称",align:"left",dataIndex:"dictName"},{title:"字典编号",align:"left",dataIndex:"dictCode"},{title:"描述",align:"left",dataIndex:"description"},{title:"操作",dataIndex:"action",align:"center",scopedSlots:{customRender:"action"}}],dict:"",labelCol:{xs:{span:8},sm:{span:5}},wrapperCol:{xs:{span:16},sm:{span:19}},url:{list:"/admin/dict/list",delete:"/admin/dict/delete",exportXlsUrl:"sys/dict/exportXls",importExcelUrl:"sys/dict/importExcel",refleshCache:"sys/dict/refleshCache",queryAllDictItems:"sys/dict/queryAllDictItems"}}},computed:{importExcelUrl:function(){return"".concat(window._CONFIG["domianURL"],"/").concat(this.url.importExcelUrl)}},methods:{getQueryParams:function(){var e=Object.assign({},this.queryParam,this.isorter);return e.field=this.getQueryField(),e.pageNo=this.ipagination.current,e.pageSize=this.ipagination.pageSize,this.superQueryParams&&(e["superQueryParams"]=encodeURI(this.superQueryParams),e["superQueryMatchType"]=this.superQueryMatchType),Object(s["d"])(e)},cancelDict:function(){this.dict="",this.visible=!1,this.loadData()},editDictItem:function(e){this.$refs.dictItemList.edit(e)},searchReset:function(){var e=this;e.queryParam.dictName="",e.queryParam.dictCode="",e.loadData(this.ipagination.current)},openDeleteList:function(){this.$refs.dictDeleteList.show()},refleshCache:function(){var e=this;Object(d["c"])(this.url.refleshCache).then((function(t){t.success&&(Object(d["c"])(e.url.queryAllDictItems).then((function(e){e.success&&(m["default"].ls.remove(u["p"]),m["default"].ls.set(u["p"],e.result,6048e5))})),e.$message.success("刷新缓存完成!"))})).catch((function(t){e.$message.warn("刷新缓存失败!")}))}},watch:{openKeys:function(e){}}},f=p,h=(a("68b4"),a("2877")),b=Object(h["a"])(f,i,r,!1,null,"7311030c",null);t["default"]=b.exports}}]);
|