chunk-0f1b.fc97e3d9.js 10 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0f1b"],{"6Fqm":function(t,e,i){"use strict";i.r(e);var n=i("FuOc"),o=i("8PMp"),a=i("rs3x"),r=i("X4fA"),s={data:function(){return{imgsFileList:[],uploadPath:a.b,listQuery:{},infoList:[],loading:!0,ids:[],single:!0,multiple:!0,total:0,secondList:[],title:"",open:!1,queryParams:{page:1,limit:10,companyId:void 0,typeId:void 0,secondName:void 0,postion:void 0,status:void 0,urlPath:void 0,deleteFlag:void 0,gmtCreate:void 0,gmtUpdate:void 0,userId:void 0,adminId:void 0},form:{},rules:{typeId:[{required:!0,message:"一级分类不能为空!",trigger:"blur"}],secondName:[{required:!0,message:"二分类不能为空!",trigger:"blur"}],postion:[{required:!0,message:"排序分类不能为空!",trigger:"blur"}]}}},computed:{headers:function(){return{accessToken:Object(r.a)()}}},created:function(){this.getList()},methods:{uploadOverrun:function(){this.$message({type:"error",message:"上传文件个数超出限制!最多上传2张图片!"})},handleimgsUrl:function(t,e,i){200===t.errno&&this.form.urlPath.push(t.url)},handleRemove:function(t,e){for(var i=0;i<this.form.urlPath.length;i++){var n;n=void 0===t.response?t.url:t.response.url,this.form.urlPath[i]===n&&this.form.urlPath.splice(i,1)}this.form.urlPath.length>0&&(this.form.pictureUrl=this.form.urlPath[0])},getList:function(){var t=this,e=this;this.loading=!0,Object(o.f)().then(function(e){t.infoList=e.data.data.items}),Object(n.e)(this.queryParams).then(function(i){t.secondList=i.data.data.items;for(var n=0;n<e.secondList.length;n++)e.secondList[n].urlPath?e.secondList[n].urlPath=e.secondList[n].urlPath.split(","):e.secondList[n].urlPath=[];console.log(e.secondList),t.total=i.data.data.count,t.loading=!1})},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:void 0,companyId:void 0,typeId:void 0,secondName:void 0,postion:void 0,status:"0",urlPath:[],deleteFlag:void 0,gmtCreate:void 0,gmtUpdate:void 0,userId:void 0,adminId:void 0},this.resetForm("form")},handleQuery:function(){this.queryParams.page=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(t){this.ids=t.map(function(t){return t.id}),this.single=1!=t.length,this.multiple=!t.length},handleAdd:function(){this.reset(),this.open=!0,this.title="添加二级分类",this.imgsFileList=[]},handleUpdate:function(t){var e=this;this.reset(),this.imgsFileList=[];var i=t.id||this.ids.join(",");Object(n.d)(i).then(function(t){t.data.data.urlPath=t.data.data.urlPath.split(",");for(var i=0;i<t.data.data.urlPath.length;i++)e.imgsFileList.push({url:t.data.data.urlPath[i]});e.form=t.data.data,e.open=!0,e.title="修改二级分类",console.log()})},submitForm:function(){var t=this;this.$refs.form.validate(function(e){e&&(t.form.urlPath=t.form.urlPath.toString(),void 0!=t.form.id?Object(n.f)(t.form).then(function(e){e.data?(t.msgSuccess("修改成功"),t.open=!1,t.getList()):t.msgError(e.msg)}):Object(n.a)(t.form).then(function(e){e.data?(t.msgSuccess("新增成功"),t.open=!1,t.getList()):t.msgError(e.msg)}))})},handleDelete:function(t){var e=this,i=t.id||this.ids.join(",");this.$confirm('是否确认删除二级分类编号为"'+i+'"的数据项?',"警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){return Object(n.b)(i)}).then(function(){e.getList(),e.msgSuccess("删除成功")}).catch(function(){})},handleExport:function(){var t=this,e=this.queryParams;this.$confirm("是否确认导出所有二级分类数据项?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){return Object(n.c)(e)}).then(function(e){t.download(e.data.data)}).catch(function(){})}}},u=i("KHd+"),l=Object(u.a)(s,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("el-row",{staticClass:"mb8",attrs:{gutter:10}},[i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["gubi:second:add"],expression:"['gubi:second:add']"}],attrs:{type:"primary",icon:"el-icon-plus",size:"mini"},on:{click:t.handleAdd}},[t._v("新增")])],1),t._v(" "),i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["gubi:second:edit"],expression:"['gubi:second:edit']"}],attrs:{type:"success",icon:"el-icon-edit",size:"mini",disabled:t.single},on:{click:t.handleUpdate}},[t._v("修改")])],1),t._v(" "),i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["gubi:second:remove"],expression:"['gubi:second:remove']"}],attrs:{type:"danger",icon:"el-icon-delete",size:"mini",disabled:t.multiple},on:{click:t.handleDelete}},[t._v("删除")])],1),t._v(" "),i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["gubi:second:export"],expression:"['gubi:second:export']"}],attrs:{type:"warning",icon:"el-icon-download",size:"mini"},on:{click:t.handleExport}},[t._v("导出")])],1)],1),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.secondList},on:{"selection-change":t.handleSelectionChange}},[i("el-table-column",{attrs:{label:"二级分名称",align:"center",prop:"secondName"}}),t._v(" "),i("el-table-column",{attrs:{align:"center",property:"urlPath",label:"图片"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.urlPath,function(t){return i("img",{attrs:{src:t,width:"40"}})})}}])}),t._v(" "),i("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["gubi:second:edit"],expression:"['gubi:second:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(i){t.handleUpdate(e.row)}}},[t._v("修改")]),t._v(" "),i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["gubi:second:remove"],expression:"['gubi:second:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(i){t.handleDelete(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),i("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.queryParams.page,limit:t.queryParams.limit},on:{"update:page":function(e){t.$set(t.queryParams,"page",e)},"update:limit":function(e){t.$set(t.queryParams,"limit",e)},pagination:t.getList}}),t._v(" "),i("el-dialog",{attrs:{title:t.title,visible:t.open,width:"500px"},on:{"update:visible":function(e){t.open=e}}},[i("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"80px"}},[i("el-form-item",{attrs:{label:"一级分类",prop:"typeId"}},[i("el-select",{staticClass:"filter-item",staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"请选择一级分类"},model:{value:t.form.typeId,callback:function(e){t.$set(t.form,"typeId",e)},expression:"form.typeId"}},t._l(t.infoList,function(t,e){return i("el-option",{key:e,attrs:{label:t.typeName,value:t.id}})}))],1),t._v(" "),i("el-form-item",{attrs:{label:"分类名称",prop:"secondName"}},[i("el-input",{attrs:{placeholder:"请输入二级分类"},model:{value:t.form.secondName,callback:function(e){t.$set(t.form,"secondName",e)},expression:"form.secondName"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"排序",prop:"postion"}},[i("el-input",{attrs:{placeholder:"请输入排序"},model:{value:t.form.postion,callback:function(e){t.$set(t.form,"postion",e)},expression:"form.postion"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"类目图片",prop:"picUrl"}},[i("el-upload",{attrs:{action:t.uploadPath,headers:t.headers,limit:2,"file-list":t.imgsFileList,"on-exceed":t.uploadOverrun,"on-success":t.handleimgsUrl,"on-remove":t.handleRemove,multiple:"",accept:".jpg, .jpeg, .png, .gif","list-type":"picture-card"}},[i("i",{staticClass:"el-icon-plus"})])],1)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),t._v(" "),i("el-button",{on:{click:t.cancel}},[t._v("取 消")])],1)],1)],1)},[],!1,null,null,null);l.options.__file="index.vue";e.default=l.exports},"8PMp":function(t,e,i){"use strict";i.d(e,"f",function(){return r}),i.d(e,"b",function(){return s}),i.d(e,"e",function(){return u}),i.d(e,"a",function(){return l}),i.d(e,"g",function(){return d}),i.d(e,"c",function(){return c}),i.d(e,"d",function(){return m});var n=i("QbLZ"),o=i.n(n),a=i("t3Un");function r(t){return Object(a.a)({method:"get",params:o()({_gp:"admin.gubi.gubiTypeInfo",_mt:"list"},t)})}function s(t){return Object(a.a)({method:"get",params:o()({_gp:"admin.gubi.gubiTypeInfo",_mt:"clearCache"},t)})}function u(t){return Object(a.a)({method:"get",params:{_gp:"admin.gubi.gubiTypeInfo",_mt:"get",id:t}})}function l(t){return Object(a.a)({method:"post",params:{_gp:"admin.gubi.gubiTypeInfo",_mt:"add",gubiTypeInfo:t}})}function d(t){return Object(a.a)({method:"post",params:{_gp:"admin.gubi.gubiTypeInfo",_mt:"update",gubiTypeInfo:t}})}function c(t){return Object(a.a)({method:"post",params:{_gp:"admin.gubi.gubiTypeInfo",_mt:"delete",id:t}})}function m(t){return Object(a.a)({method:"get",params:o()({_gp:"admin.gubi.gubiTypeInfo",_mt:"export"},t)})}},FuOc:function(t,e,i){"use strict";i.d(e,"e",function(){return r}),i.d(e,"d",function(){return s}),i.d(e,"a",function(){return u}),i.d(e,"f",function(){return l}),i.d(e,"b",function(){return d}),i.d(e,"c",function(){return c});var n=i("QbLZ"),o=i.n(n),a=i("t3Un");function r(t){return Object(a.a)({method:"get",params:o()({_gp:"admin.gubi.gubiTypeSecond",_mt:"list"},t)})}function s(t){return Object(a.a)({method:"get",params:{_gp:"admin.gubi.gubiTypeSecond",_mt:"get",id:t}})}function u(t){return Object(a.a)({method:"post",params:{_gp:"admin.gubi.gubiTypeSecond",_mt:"add",gubiTypeSecond:t}})}function l(t){return Object(a.a)({method:"post",params:{_gp:"admin.gubi.gubiTypeSecond",_mt:"update",gubiTypeSecond:t}})}function d(t){return Object(a.a)({method:"post",params:{_gp:"admin.gubi.gubiTypeSecond",_mt:"delete",id:t}})}function c(t){return Object(a.a)({method:"get",params:o()({_gp:"admin.gubi.gubiTypeSecond",_mt:"export"},t)})}},rs3x:function(t,e,i){"use strict";i.d(e,"b",function(){return o}),i.d(e,"a",function(){return a});var n=i("t3Un"),o="http://121.5.163.150:8181/upload/admin";function a(t){return Object(n.a)({url:o,method:"post",data:t})}}}]);