| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[20],{423:function(e,t,r){var content=r(480);"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,r(4).default)("a03c9f0a",content,!0,{sourceMap:!1})},479:function(e,t,r){"use strict";var o=r(423);r.n(o).a},480:function(e,t,r){(e.exports=r(3)(!1)).push([e.i,".table[data-v-71bf4afc]{height:calc(100% - 40px)}.avatar-uploader .el-upload[data-v-71bf4afc]{border:1px dashed #d9d9d9;border-radius:6px;cursor:pointer;position:relative;overflow:hidden}.avatar-uploader .el-upload[data-v-71bf4afc]:hover{border-color:#409eff}.avatar-uploader-icon[data-v-71bf4afc]{font-size:28px;color:#8c939d;width:178px;height:178px;line-height:178px;text-align:center}.avatar[data-v-71bf4afc]{width:178px;height:178px;display:block}",""])},532:function(e,t,r){"use strict";r.r(t);r(168);var o=r(5),n=(r(39),r(6)),l=["ID","昵称","排序","配图","添加时间","操作"],c=["uid","nickname","order","url","create_date","ctrls"],d={data:function(){return{isEdit:!1,ruleForm:{},rules:{id:[{required:!0,message:"请填写开发者ID",trigger:"blur"}],url:[{type:"string",required:!0,message:"请上传配图",trigger:"change"}]},centerDialogVisible:!1,totalCount:0,currentPage:1,tableHeaders:l,tableProps:c,tableData:[]}},mounted:function(){this.getTableData()},methods:{clickSubmit:function(){var e=Object(n.a)(regeneratorRuntime.mark(function e(){var t,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t="/api/admin/developer/addRecommendDeveloper",this.isEdit&&(t="/api/admin/developer/editRecommendDeveloper"),e.next=4,this.$post(t,this.ruleForm);case 4:r=e.sent,r.data,this.getTableData(),this.centerDialogVisible=!1;case 8:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),clickAdd:function(){this.ruleForm={},this.isEdit=!1,this.centerDialogVisible=!0},handleAvatarSuccess:function(e,t){this.$set(this.ruleForm,"url",e.data.file_url_abs)},beforeAvatarUpload:function(e){var t="image/jpeg"===e.type||"image/png"===e.type,r=e.size/1024/1024<2;return t||this.$message.error("上传头像图片只能是 JPG 或 PNG 格式!"),r||this.$message.error("上传头像图片大小不能超过 2MB!"),t&&r},clickDel:function(i,e){var t=this,r=e.id;this.$confirm("此操作将永久删除, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(n.a)(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$post("/api/admin/developer/deleteRecommendDeveloper",{id:r});case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:t.$message({type:"success",message:"删除成功!"}),t.getTableData();case 7:case"end":return e.stop()}},e)}))).catch(function(){t.$message({type:"info",message:"已取消删除"})})},clickEdit:function(i,e){var t=e.uid,r=e.order,o=e.url,n=e.id;this.ruleForm={uid:t,order:r,url:o,id:n},this.isEdit=!0,this.centerDialogVisible=!0},clickUID:function(i){window.open(i.seo_uri)},tableRowClassName:function(e){var t=e.row,r=(e.rowIndex,"");return"已结算"===t.p_status_name&&(r="success-row"),r},formatTableData:function(data){return data.map(function(i){return Object(o.a)({},i)})},getTableData:function(){var e=Object(n.a)(regeneratorRuntime.mark(function e(){var t,r,data,o=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:1,this.tableData=[],e.next=4,this.$post("/api/admin/developer/getRecommendList",{page:t,page_size:9});case 4:r=e.sent,data=r.data.list,this.tableData=this.formatTableData(data),this.totalCount=Number(data.total),this.totalPage=data.totalPage;case 9:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}},m=(r(479),r(2)),component=Object(m.a)(d,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"cloud-balance"}},[r("el-button",{on:{click:e.clickAdd}},[e._v("添加")]),e._v(" "),r("div",{staticClass:"table"},[e.tableData.length?r("el-table",{staticStyle:{width:"100%"},attrs:{height:"100%",border:"",data:e.tableData,"row-class-name":e.tableRowClassName}},e._l(e.tableProps,function(t,o){return r("el-table-column",{key:o,attrs:{prop:t,align:"center",label:e.tableHeaders[o]},scopedSlots:e._u([{key:"default",fn:function(o){return["uid"===t?r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.clickUID(o.row)}}},[e._v(e._s(o.row[t]))]):"url"===t?r("img",{staticStyle:{display:"block",width:"100px",height:"80px"},attrs:{src:o.row[t],alt:"url"}}):"ctrls"===t?r("section",{staticClass:"ctrls"},[r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.clickEdit(o.$index,o.row)}}},[e._v("编辑")]),e._v(" "),r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.clickDel(o.$index,o.row)}}},[e._v("删除")])],1):r("span",[e._v(e._s(o.row[t]))])]}}],null,!0)})}),1):e._e()],1),e._v(" "),r("el-dialog",{attrs:{title:"添加展示",visible:e.centerDialogVisible,width:"50%",center:""},on:{"update:visible":function(t){e.centerDialogVisible=t}}},[r("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"UID",prop:"uid"}},[r("el-input",{attrs:{type:"number",disabled:e.isEdit},model:{value:e.ruleForm.uid,callback:function(t){e.$set(e.ruleForm,"uid",t)},expression:"ruleForm.uid"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"排序",prop:"order"}},[r("el-input",{attrs:{type:"number"},model:{value:e.ruleForm.order,callback:function(t){e.$set(e.ruleForm,"order",t)},expression:"ruleForm.order"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"配图",prop:"url"}},[r("el-upload",{staticClass:"avatar-uploader",attrs:{action:"/api/admin/developer/uploadImg","show-file-list":!1,"on-success":e.handleAvatarSuccess,"before-upload":e.beforeAvatarUpload}},[e.ruleForm.url?r("img",{staticClass:"avatar",attrs:{src:e.ruleForm.url}}):r("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.centerDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.clickSubmit}},[e._v("确 定")])],1)],1)],1)},[],!1,null,"71bf4afc",null);t.default=component.exports}}]);
|