1 line
9.9 KiB
JavaScript
1 line
9.9 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-20f561bd"],{5788:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"system-post"},[s("el-card",{directives:[{name:"show",rawName:"v-show",value:t.showSearch,expression:"showSearch"}],staticClass:"search-card"},[s("el-form",{ref:"queryForm",staticClass:"search-form",attrs:{model:t.queryParams,inline:!0,"label-width":"68px"},nativeOn:{submit:function(t){t.preventDefault()}}},[s("el-form-item",{attrs:{prop:"postCode"}},[s("el-input",{attrs:{placeholder:t.$t("system.post.236590-1"),clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery(e)}},model:{value:t.queryParams.postCode,callback:function(e){t.$set(t.queryParams,"postCode",e)},expression:"queryParams.postCode"}})],1),s("el-form-item",{attrs:{prop:"postName"}},[s("el-input",{attrs:{placeholder:t.$t("system.post.236590-3"),clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery(e)}},model:{value:t.queryParams.postName,callback:function(e){t.$set(t.queryParams,"postName",e)},expression:"queryParams.postName"}})],1),s("el-form-item",{attrs:{prop:"status"}},[s("el-select",{attrs:{placeholder:t.$t("system.post.236590-4"),clearable:""},model:{value:t.queryParams.status,callback:function(e){t.$set(t.queryParams,"status",e)},expression:"queryParams.status"}},t._l(t.dict.type.sys_normal_disable,(function(t){return s("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),s("div",{staticStyle:{float:"right"}},[s("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleQuery}},[t._v(t._s(t.$t("search")))]),s("el-button",{attrs:{icon:"el-icon-refresh"},on:{click:t.resetQuery}},[t._v(t._s(t.$t("reset")))])],1)],1)],1),s("el-card",[s("el-row",{staticStyle:{"margin-bottom":"16px"},attrs:{gutter:10}},[s("el-col",{attrs:{span:1.5}},[s("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:post:add"],expression:"['system:post:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"small"},on:{click:t.handleAdd}},[t._v(t._s(t.$t("add")))])],1),s("el-col",{attrs:{span:1.5}},[s("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:post:edit"],expression:"['system:post:edit']"}],attrs:{plain:"",icon:"el-icon-edit",size:"small",disabled:t.single},on:{click:t.handleUpdate}},[t._v(t._s(t.$t("update")))])],1),s("el-col",{attrs:{span:1.5}},[s("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:post:remove"],expression:"['system:post:remove']"}],attrs:{plain:"",icon:"el-icon-delete",size:"small",disabled:t.multiple},on:{click:t.handleDelete}},[t._v(t._s(t.$t("del")))])],1),s("el-col",{attrs:{span:1.5}},[s("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:post:export"],expression:"['system:post:export']"}],attrs:{plain:"",icon:"el-icon-download",size:"small"},on:{click:t.handleExport}},[t._v(t._s(t.$t("export")))])],1),s("right-toolbar",{attrs:{showSearch:t.showSearch},on:{"update:showSearch":function(e){t.showSearch=e},"update:show-search":function(e){t.showSearch=e},queryTable:t.getList}})],1),s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.postList,border:!1},on:{"selection-change":t.handleSelectionChange}},[s("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),s("el-table-column",{attrs:{label:t.$t("system.post.236590-5"),align:"center",prop:"postId","min-width":"90"}}),s("el-table-column",{attrs:{label:t.$t("system.post.236590-0"),align:"left",prop:"postCode","min-width":"200"}}),s("el-table-column",{attrs:{label:t.$t("system.post.236590-2"),align:"left",prop:"postName","min-width":"200"}}),s("el-table-column",{attrs:{label:t.$t("system.post.236590-6"),align:"center",prop:"postSort",width:"80"}}),s("el-table-column",{attrs:{label:t.$t("status"),align:"center",prop:"status",width:"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("dict-tag",{attrs:{options:t.dict.type.sys_normal_disable,value:e.row.status}})]}}])}),s("el-table-column",{attrs:{label:t.$t("creatTime"),align:"center",prop:"createTime",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("span",[t._v(t._s(t.parseTime(e.row.createTime)))])]}}])}),s("el-table-column",{attrs:{fixed:"right",label:t.$t("opation"),align:"center",width:"125"},scopedSlots:t._u([{key:"default",fn:function(e){return[s("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:post:edit"],expression:"['system:post:edit']"}],attrs:{size:"small",type:"text",icon:"el-icon-edit"},on:{click:function(s){return t.handleUpdate(e.row)}}},[t._v(t._s(t.$t("update")))]),s("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:post:remove"],expression:"['system:post:remove']"}],attrs:{size:"small",type:"text",icon:"el-icon-delete"},on:{click:function(s){return t.handleDelete(e.row)}}},[t._v(t._s(t.$t("del")))])]}}])})],1),s("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],staticStyle:{"margin-bottom":"20px"},attrs:{total:t.total,page:t.queryParams.pageNum,limit:t.queryParams.pageSize},on:{"update:page":function(e){return t.$set(t.queryParams,"pageNum",e)},"update:limit":function(e){return t.$set(t.queryParams,"pageSize",e)},pagination:t.getList}})],1),s("el-dialog",{attrs:{title:t.title,visible:t.open,width:"600px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[s("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"100px"}},[s("el-form-item",{attrs:{label:t.$t("system.post.236590-2"),prop:"postName"}},[s("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:t.$t("system.post.236590-3")},model:{value:t.form.postName,callback:function(e){t.$set(t.form,"postName",e)},expression:"form.postName"}})],1),s("el-form-item",{attrs:{label:t.$t("system.post.236590-0"),prop:"postCode"}},[s("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:t.$t("system.post.236590-1")},model:{value:t.form.postCode,callback:function(e){t.$set(t.form,"postCode",e)},expression:"form.postCode"}})],1),s("el-form-item",{attrs:{label:t.$t("system.post.236590-6"),prop:"postSort"}},[s("el-input-number",{staticStyle:{width:"400px"},attrs:{"controls-position":"right",min:0},model:{value:t.form.postSort,callback:function(e){t.$set(t.form,"postSort",e)},expression:"form.postSort"}})],1),s("el-form-item",{attrs:{label:t.$t("system.post.236590-4"),prop:"status"}},[s("el-radio-group",{model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},t._l(t.dict.type.sys_normal_disable,(function(e){return s("el-radio",{key:e.value,attrs:{label:Number(e.value)}},[t._v(t._s(e.label))])})),1)],1),s("el-form-item",{attrs:{label:t.$t("remark"),prop:"remark"}},[s("el-input",{staticStyle:{width:"400px"},attrs:{type:"textarea",placeholder:t.$t("plzInput"),autosize:{minRows:3,maxRows:5}},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1)],1),s("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v(t._s(t.$t("confirm")))]),s("el-button",{on:{click:t.cancel}},[t._v(t._s(t.$t("cancel")))])],1)],1)],1)},o=[],r=s("5530"),l=(s("d81d"),s("b775"));function i(t){return Object(l["a"])({url:"/system/post/list",method:"get",params:t})}function n(t){return Object(l["a"])({url:"/system/post/"+t,method:"get"})}function m(t){return Object(l["a"])({url:"/system/post",method:"post",data:t})}function p(t){return Object(l["a"])({url:"/system/post",method:"put",data:t})}function c(t){return Object(l["a"])({url:"/system/post/"+t,method:"delete"})}var u={name:"Post",dicts:["sys_normal_disable"],data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,postList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,postCode:void 0,postName:void 0,status:void 0},form:{},rules:{postName:[{required:!0,message:this.$t("system.post.236590-7"),trigger:"blur"}],postCode:[{required:!0,message:this.$t("system.post.236590-8"),trigger:"blur"}],postSort:[{required:!0,message:this.$t("system.post.236590-9"),trigger:"blur"}]}}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.loading=!0,i(this.queryParams).then((function(e){t.postList=e.rows,t.total=e.total,t.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={postId:void 0,postCode:void 0,postName:void 0,postSort:0,status:0,remark:void 0},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(t){this.ids=t.map((function(t){return t.postId})),this.single=1!=t.length,this.multiple=!t.length},handleAdd:function(){this.reset(),this.open=!0,this.title=this.$t("system.post.236590-10")},handleUpdate:function(t){var e=this;this.reset();var s=t.postId||this.ids;n(s).then((function(t){e.form=t.data,e.open=!0,e.title=e.$t("system.post.236590-11")}))},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){e&&(void 0!=t.form.postId?p(t.form).then((function(e){t.$modal.msgSuccess(t.$t("updateSuccess")),t.open=!1,t.getList()})):m(t.form).then((function(e){t.$modal.msgSuccess(t.$t("addSuccess")),t.open=!1,t.getList()})))}))},handleDelete:function(t){var e=this,s=t.postId||this.ids;this.$modal.confirm(this.$t("system.post.236590-12",[s])).then((function(){return c(s)})).then((function(){e.getList(),e.$modal.msgSuccess(e.$t("delSuccess"))})).catch((function(){}))},handleExport:function(){this.download("system/post/export",Object(r["a"])({},this.queryParams),"post_".concat((new Date).getTime(),".xlsx"))}}},d=u,h=(s("ce1b"),s("2877")),f=Object(h["a"])(d,a,o,!1,null,"0642323e",null);e["default"]=f.exports},ce1b:function(t,e,s){"use strict";s("ec9d")},ec9d:function(t,e,s){}}]); |