chunk-2214a5a2.083a0311.js 15 KB

123456
  1. /*!
  2. * build: Hopaheal
  3. * copyright: Mead
  4. * time: 2022-6-7 11:38:49
  5. */
  6. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2214a5a2"],{"6de0":function(e,t,r){},"7b81":function(e,t,r){},b44a:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"department-management-container"},[a("vab-query-form",[a("vab-query-form-left-panel",{attrs:{span:12}},[a("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.handleEdit}},[e._v(" 添加 ")]),a("el-button",{attrs:{icon:"el-icon-delete",type:"danger"},on:{click:e.handleDelete}},[e._v(" 批量删除 ")])],1),a("vab-query-form-right-panel",{attrs:{span:12}},[a("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",[a("el-input",{attrs:{clearable:"",placeholder:"请输入名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData.apply(null,arguments)}},model:{value:e.queryForm.name,callback:function(t){e.$set(e.queryForm,"name","string"===typeof t?t.trim():t)},expression:"queryForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{border:"",data:e.list,"default-expand-all":"","row-key":"id","tree-props":{children:"children"}},on:{"selection-change":e.setSelectRows},scopedSlots:e._u([{key:"empty",fn:function(){return[a("el-image",{staticClass:"vab-data-empty",attrs:{src:r("f1f0")}})]},proxy:!0}])},[a("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection"}}),a("el-table-column",{attrs:{label:"标题","min-width":"120",prop:"name","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"图片","min-width":"220",prop:"cover_resource","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.row;return[a("img",{staticClass:"banner",attrs:{src:t.cover_resource.url}})]}}])}),a("el-table-column",{attrs:{label:"位置","min-width":"120",prop:"position_name","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"状态","min-width":"80",prop:"status","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[1==r.status?a("el-tag",[e._v("正常")]):e._e(),0==r.status?a("el-tag",{attrs:{type:"danger"}},[e._v("禁用")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:"排序","min-width":"120",prop:"sort","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("div",{staticClass:"edit"},[e.editForm.id==r.id&&1==e.editStatus?a("i",{staticClass:"el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.cancelSort(r)}}}):e._e(),e.editForm.id!==r.id||0==e.editStatus?a("span",{staticClass:"sort-num"},[e._v(" "+e._s(r.sort)+" ")]):e._e(),e.editForm.id==r.id&&1==e.editStatus?a("el-input",{ref:"getFocus",staticClass:"input-sort",on:{input:e.inputSort},model:{value:r.sort,callback:function(t){e.$set(r,"sort",t)},expression:"row.sort"}}):e._e(),e.editForm.id!==r.id||0==e.editStatus?a("i",{staticClass:"el-icon-edit",on:{click:function(t){return e.changeSort(r)}}}):e._e(),e.editForm.id==r.id&&1==e.editStatus?a("i",{staticClass:"el-icon-circle-check",on:{click:function(t){return t.stopPropagation(),e.sureChange.apply(null,arguments)}}}):e._e()],1)]}}])}),a("el-table-column",{attrs:{align:"center",label:"开始时间","min-width":"120",prop:"start_time","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"结束时间","min-width":"120",prop:"end_time","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"操作",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),a("el-button",{attrs:{disabled:!!r.children,type:"text"},on:{click:function(t){return e.handleDelete(r)}}},[e._v(" 删除 ")])]}}])})],1),a("el-pagination",{attrs:{background:"","current-page":e.queryForm.page,layout:e.layout,"page-size":e.queryForm.per_page,"page-sizes":[15,20,30,40,50,100],total:e.total},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}}),a("edit",{ref:"edit",on:{"fetch-data":e.getList}})],1)},n=[],o=r("1da1"),s=(r("4e82"),r("d81d"),r("96cf"),r("b623")),i=r("d116"),l={name:"BannerManagementEdit",components:{Edit:i["default"]},data:function(){return{list:[],listLoading:!0,layout:"total, sizes, prev, pager, next, jumper",total:0,selectRows:"",queryForm:{name:"",page:1,per_page:15},editForm:{},oldSort:0,editStatus:0,flag:!1}},created:function(){this.getList()},methods:{queryData:function(){this.queryForm.page=1,this.getList()},getList:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(s["getList"])(e.queryForm);case 3:r=t.sent,a=r.data,console.log(a,"部门列表"),n=a.list,o=a.meta,e.list=n,e.total=o.pagination.total,e.listLoading=!1;case 10:case"end":return t.stop()}}),t)})))()},changeSort:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:t.editStatus=1,t.editForm=e,t.oldSort=e.sort,t.$nextTick((function(){t.$refs["getFocus"].focus()}));case 4:case"end":return r.stop()}}),r)})))()},cancelSort:function(e){e.sort=this.oldSort,this.editStatus=0},inputSort:function(e){console.log(e,"000000000"),this.editForm.sort=e},sureChange:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log("触发change事件"),e.editStatus=0,e.oldSort===e.editForm.sort){t.next=12;break}return t.next=5,Object(s["doEdit"])(e.editForm);case 5:r=t.sent,a=r.message,console.log(a,"message"),e.$baseMessage(a,"success",!1,"vab-hey-message-success"),e.getList(),t.next=13;break;case 12:return t.abrupt("return");case 13:case"end":return t.stop()}}),t)})))()},setSelectRows:function(e){this.selectRows=e},handleEdit:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},handleDelete:function(e){var t=this;if(console.log(e),e.id)this.$baseConfirm("你确定要删除当前项吗",null,Object(o["a"])(regeneratorRuntime.mark((function r(){var a,n;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,Object(s["doDelete"])({ids:[e.id]});case 2:return a=r.sent,n=a.message,t.$baseMessage(n,"success",!1,"vab-hey-message-success"),r.next=7,t.getList();case 7:case"end":return r.stop()}}),r)}))));else if(this.selectRows.length>0){var r=this.selectRows.map((function(e){return e.id}));this.$baseConfirm("你确定要删除选中项吗",null,Object(o["a"])(regeneratorRuntime.mark((function e(){var a,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["doDelete"])({ids:r});case 2:return a=e.sent,n=a.message,t.$baseMessage(n,"success",!1,"vab-hey-message-success"),e.next=7,t.getList();case 7:case"end":return e.stop()}}),e)}))))}else this.$baseMessage("未选中任何行","error",!1,"vab-hey-message-error")},handleSizeChange:function(e){this.queryForm.per_page=e,this.getList()},handleCurrentChange:function(e){this.queryForm.page=e,this.getList()}}},c=l,u=(r("b5e3"),r("2877")),m=Object(u["a"])(c,a,n,!1,null,"4dac0004",null);t["default"]=m.exports},b5e3:function(e,t,r){"use strict";r("6de0")},b623:function(e,t,r){"use strict";r.r(t),r.d(t,"getList",(function(){return n})),r.d(t,"doAdd",(function(){return o})),r.d(t,"doEdit",(function(){return s})),r.d(t,"doDelete",(function(){return i})),r.d(t,"getSetting",(function(){return l}));var a=r("b775");function n(e){return Object(a["default"])({url:"/base/banner",method:"get",params:e})}function o(e){return Object(a["default"])({url:"/base/banner",method:"post",data:e})}function s(e){return Object(a["default"])({url:"/base/banner/"+e.id,method:"put",data:e})}function i(e){return Object(a["default"])({url:"/base/banner/delete",method:"post",data:e})}function l(e){return Object(a["default"])({url:"/base/common/enums",method:"get",params:e})}},c12c:function(e,t,r){"use strict";r("7b81")},d116:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"40%"},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close},scopedSlots:e._u([{key:"footer",fn:function(){return[r("el-button",{on:{click:e.close}},[e._v("取 消")]),"编辑"==e.title?r("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v(" 确 定 ")]):e._e(),"添加"==e.title?r("el-button",{attrs:{type:"primary"},on:{click:e.add}},[e._v(" 添 加 ")]):e._e()]},proxy:!0}])},[r("el-form",{ref:"form",attrs:{"label-width":"100px",model:e.form,rules:e.rules}},[r("el-form-item",{attrs:{label:"标题:",prop:"name"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),r("el-form-item",{attrs:{label:"位置:",prop:"position"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{"default-first-option":"",placeholder:"请选择位置"},model:{value:e.form.position,callback:function(t){e.$set(e.form,"position",t)},expression:"form.position"}},e._l(e.banner_type,(function(e){return r("el-option",{key:e.type,attrs:{label:e.name,value:e.type}})})),1)],1),r("el-form-item",{attrs:{label:"点击类型:",prop:"click_type"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{"default-first-option":"",placeholder:"请选择点击类型"},model:{value:e.form.click_type,callback:function(t){e.$set(e.form,"click_type",t)},expression:"form.click_type"}},e._l(e.click_type,(function(e){return r("el-option",{key:e.type,attrs:{label:e.name,value:e.type}})})),1)],1),1==e.form.click_type?r("el-form-item",{attrs:{label:"跳转链接:",prop:"click_body"}},[r("el-input",{model:{value:e.form.click_body,callback:function(t){e.$set(e.form,"click_body",t)},expression:"form.click_body"}})],1):e._e(),r("el-form-item",{attrs:{label:"开始时间:",prop:"start_time"}},[r("el-date-picker",{attrs:{format:"yyyy-MM-dd HH:mm:ss",placeholder:"选择日期时间",type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.form.start_time,callback:function(t){e.$set(e.form,"start_time",t)},expression:"form.start_time"}})],1),r("el-form-item",{attrs:{label:"结束时间:",prop:"end_time"}},[r("el-date-picker",{attrs:{format:"yyyy-MM-dd HH:mm:ss",placeholder:"选择日期时间",type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.form.end_time,callback:function(t){e.$set(e.form,"end_time",t)},expression:"form.end_time"}})],1),r("el-form-item",{attrs:{label:"轮播图:",prop:"cover"}},[r("el-upload",{staticClass:"upload-demo",attrs:{action:e.action,data:e.uploadData,"file-list":e.fileList,limit:e.limit,"list-type":"picture",multiple:"","on-error":e.uploadErr,"on-success":e.uploadSuccess}},[r("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.clearFile}},[e._v(" "+e._s("添加"==e.title?"上传照片":"重新上传")+" ")]),r("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 只能上传jpg/png文件,且不超过500kb ")])],1)],1),"编辑"==e.title&&e.imageUrl?r("el-form-item",{attrs:{label:"",prop:"cover"}},[r("div",{staticClass:"ref-image"},[r("img",{attrs:{src:e.imageUrl}})])]):e._e(),r("el-form-item",{attrs:{label:"排序:",prop:"sort"}},[r("el-input",{attrs:{type:"number"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),r("el-form-item",{attrs:{label:"状态:",prop:"status"}},[r("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[r("el-radio",{attrs:{label:1}},[e._v("正常")]),r("el-radio",{attrs:{label:0}},[e._v("禁用")])],1)],1)],1)],1)},n=[],o=r("1da1"),s=(r("96cf"),r("b623")),i=r("f121"),l={name:"MenuManagementEdit",data:function(){return{form:{status:1,sort:0,click_type:0,position:"home",cover:""},click_type:[{type:0,name:"无操作"},{type:1,name:"链接跳转"}],banner_type:[{type:"home",name:"首页轮播图"}],action:"",uploadShow:!0,uploadData:{file_type:"img",type:"banners"},fileList:[],limit:1,imageUrl:"",rules:{name:[{required:!0,trigger:"blur",message:"请填写轮播图名称"}],position:[{required:!0,trigger:"change",message:"请选择轮播图位置"}],click_type:[{required:!0,trigger:"change",message:"请选择点击类型"}],start_time:[{required:!0,trigger:"change",message:"请选择开始时间"}],end_time:[{required:!0,trigger:"change",message:"请选择结束时间"}],cover:[{required:!0,trigger:"blur",message:"请上传图片"}],sort:[{required:!0,trigger:"blur",message:"请填写排序"}],status:[{required:!0,trigger:"change",message:"请选择状态"}]},title:"",dialogFormVisible:!1}},created:function(){this.action=i["baseURL"]+"/base/common/upload",this.fileList=[],this.getSetting()},methods:{getSetting:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var r,a,n,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.banner_type=[],t.next=3,Object(s["getSetting"])();case 3:for(o in r=t.sent,a=r.data,n=a.BannerPositionEnum,n)console.log(o,"item"),e.banner_type.push({type:o,name:n[o]});console.log(a,"+++++++++++");case 8:case"end":return t.stop()}}),t)})))()},showEdit:function(e){this.fileList=[],e?(this.title="编辑",this.form=Object.assign({},e),this.imageUrl=this.form.cover_resource.url):this.title="添加",this.dialogFormVisible=!0},uploadSuccess:function(e){console.log(e,"图片上传成功"),this.form.cover=e.data.id,console.log(this.form,"form"),this.$refs.form.validateField("cover")},uploadErr:function(){this.$message.error("上传失败,请重新上传")},clearFile:function(){console.log("上传之前"),this.imageUrl=""},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},save:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=8;break}return t.next=3,Object(s["doEdit"])(e.form);case 3:a=t.sent,n=a.message,e.$baseMessage(n,"success",!1,"vab-hey-message-success"),e.$emit("fetch-data"),e.close();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},add:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=8;break}return t.next=3,Object(s["doAdd"])(e.form);case 3:a=t.sent,n=a.message,e.$baseMessage(n,"success",!1,"vab-hey-message-success"),e.$emit("fetch-data"),e.close();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},c=l,u=(r("c12c"),r("2877")),m=Object(u["a"])(c,a,n,!1,null,"56d1148e",null);t["default"]=m.exports},f1f0:function(e,t,r){e.exports=r.p+"static/img/data_empty.475a2a1e.png"}}]);