chunk-d005b488.575e2b50.js 17 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d005b488"],{"0d1e":function(e,t,a){},"1cd5":function(e,t,a){"use strict";a.d(t,"h",(function(){return l})),a.d(t,"a",(function(){return o})),a.d(t,"e",(function(){return r})),a.d(t,"j",(function(){return s})),a.d(t,"d",(function(){return n})),a.d(t,"b",(function(){return d})),a.d(t,"g",(function(){return c})),a.d(t,"c",(function(){return u})),a.d(t,"k",(function(){return m})),a.d(t,"f",(function(){return b})),a.d(t,"i",(function(){return h}));var i=a("b775"),l=function(e){return Object(i["a"])({url:"/order/getOrderListAdmin",method:"post",data:e})},o=function(e){return Object(i["a"])({url:"/order/applyOrderStatusAdmin",method:"post",data:e})},r=function(e){return Object(i["a"])({url:"/order/editPriceOrderAdmin",method:"post",data:e})},s=function(e){return Object(i["a"])({url:"/order/rejectOrderAdmin",method:"post",data:e})},n=function(e){return Object(i["a"])({url:"/order/delOrderAdmin",method:"post",data:e})},d=function(e){return Object(i["a"])({url:"/ad/createAdPlace",method:"post",data:e})},c=function(e){return Object(i["a"])({url:"/ad/getAdPlaceList",method:"get",params:e})},u=function(e){return Object(i["a"])({url:"/ad/delAdPlace",method:"post",data:e})},m=function(e){return Object(i["a"])({url:"/ad/updateAdPlace",method:"post",data:e})},b=function(e){return Object(i["a"])({url:"/ad/getAdList",method:"get",params:e})},h=function(e){return Object(i["a"])({url:"/order/getAD",method:"post",data:e})}},"2e2a":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAS5SURBVHgB1ZpNTBtHFMffzK7tePlQEkKTgClESVw1KZIlKrVGTUpLVDUtqFIPXMu511zba2+9tteeKpWeKiBppRAREmo1gRREiApFDU2guAGjBOM1tndmss/RErDX9qyNP/KTvOvdebOa/8zbmTczS8ABv9xeb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lqEDrxFkultnBxYw32pLlAKuOKX2cthmQcGSDL9EpuH5VyZZRazyonLBRFcrsy8zwVbw3NaAKFiOdcDtmKiaivXONN7J6B+ZzfGuBS6kLbBw8cX69YEe6Eok5bjdAyqwCG3WOnuUr+1m6Ki+2CZ8f/uQOZyKVMGh6z4pOdtOhZuJzPoSjFdtO0koWwrbljj9Ros+k8pY+dPk5z7wwoV49b/fbuUuIGGe1BQgHzRYbHUeyEutZakwHTfhbpp6/KV32a13+iWbIlKIsyN7n6ZjW6L0Vs7fmC8qxY+NUCft17a7PQCoBDCoYODOFnJjz0IJxEK8fuXPziynNcUHICb4UbCDKHK+LlNgurbn73XXDC8sXgOkdYWBuX7PgUAAAAASUVORK5CYII="},"2e57":function(e,t,a){"use strict";a("0d1e")},"2fe1":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("div",{staticClass:"title"},[i("el-row",[i("el-col",{staticClass:"left",attrs:{span:6}},[i("div",{staticClass:"searchBox"},[i("div",{staticClass:"searchTitle"},[e._v("网站名称")]),i("el-select",{attrs:{multiple:!1,"multiple-limit":1,filterable:"",remote:"","reserve-keyword":"",placeholder:"请输入网站名称","remote-method":e.getWebNavList,loading:e.webSiteLoading},on:{change:e.selectWebSite},model:{value:e.webSiteName_id,callback:function(t){e.webSiteName_id=t},expression:"webSiteName_id"}},e._l(e.webSiteList,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)]),i("el-col",{staticClass:"left",attrs:{span:6}},[i("div",{staticClass:"searchBox"},[i("div",{staticClass:"searchTitle"},[e._v("广告位名称")]),i("el-input",{staticClass:"input",attrs:{placeholder:"请输入广告位名称"},model:{value:e.adPlaceName,callback:function(t){e.adPlaceName=t},expression:"adPlaceName"}})],1)]),i("el-col",{staticClass:"right",attrs:{span:8}},[i("div",{staticClass:"btnList"},[i("button",{staticClass:"search",on:{click:e.goSearch}},[e._v("搜索")]),i("button",{staticClass:"reset",on:{click:e.goReset}},[e._v("重置")])])])],1)],1),i("div",{staticClass:"layerBox"},[i("tableTitle",{attrs:{name:e.tableDivTitle}}),i("button",{staticClass:"btn",on:{click:e.addWebsite}},[e._v("添加广告位")]),i("el-row",[[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"my-table",staticStyle:{width:"100%"},attrs:{data:e.tableData}},[i("el-table-column",{attrs:{fixed:"",prop:"id",label:"编号",width:"90"}}),i("el-table-column",{attrs:{prop:"website_name",label:"网站名称",width:"160"}}),i("el-table-column",{attrs:{prop:"name",label:"广告位名称",width:"220"}}),i("el-table-column",{attrs:{prop:"type_name",label:"广告类型",width:"110"}}),i("el-table-column",{attrs:{prop:"size",label:"宽/高 (PX)",width:"120"}}),i("el-table-column",{attrs:{prop:"price",label:"价格 (天)",width:"110"}}),i("el-table-column",{attrs:{prop:"created_at",label:"创建时间",width:"190"}}),i("el-table-column",{attrs:{prop:"updated_at",label:"修改时间",width:"190"}}),i("el-table-column",{attrs:{fixed:"right",label:"操作",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",{staticClass:"listBtnBox"},[i("div",{staticClass:"listDeleteBtn",on:{click:function(a){return e.deleteRow(t.row.id)}}},[i("i",{staticClass:"el-icon-delete"}),e._v("删除")]),i("div",{staticClass:"listEditBtn",on:{click:function(a){return e.goEdit(t.row.id,t.row)}}},[i("i",{staticClass:"el-icon-edit-outline"}),e._v("编辑")]),i("div",{staticClass:"listLookBtn",on:{click:function(a){return e.goLook(t.row.id)}}},[i("i",{staticClass:"el-icon-view"}),e._v("查看")])])]}}])})],1)]],2)],1),i("div",{staticClass:"alignBox"},[i("el-row",[i("el-col",{attrs:{span:24}},[i("el-pagination",{attrs:{background:"","current-page":e.page,"page-size":e.pageSize,layout:"total, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1)],1),i("el-dialog",{attrs:{title:e.dialogName,visible:e.dialogTableVisible,width:"50%",top:"8vh","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[i("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"100px"}},[i("div",{staticClass:"dialogText"},[i("el-form-item",{attrs:{label:"网站名称:",prop:"webName"}},[i("el-select",{attrs:{multiple:!1,"multiple-limit":1,filterable:"",remote:"","reserve-keyword":"",placeholder:"请输入网站名称","remote-method":e.getWebNavList,loading:e.webSiteLoading},on:{change:e.detectionWebSite},model:{value:e.ruleForm.webName,callback:function(t){e.$set(e.ruleForm,"webName",t)},expression:"ruleForm.webName"}},e._l(e.webSiteList,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),i("el-form-item",{attrs:{label:"广告位名称:",prop:"adName"}},[i("el-input",{attrs:{placeholder:"请输入广告位名称"},model:{value:e.ruleForm.adName,callback:function(t){e.$set(e.ruleForm,"adName",t)},expression:"ruleForm.adName"}})],1),i("el-form-item",{attrs:{label:"广告位介绍:",prop:"adDesc"}},[i("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入广告位介绍",resize:"none"},model:{value:e.ruleForm.adDesc,callback:function(t){e.$set(e.ruleForm,"adDesc",t)},expression:"ruleForm.adDesc"}})],1),i("el-form-item",{staticClass:"custom-align-right",class:["custom-form-item"],attrs:{label:"广告示例图:",prop:"adPhoto","label-width":e.formLabelWidth}},[i("div",{staticClass:"uploaderBox"},[i("div",{staticClass:"avatar-upload-container",on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},[i("el-upload",{staticClass:"avatar-uploader",attrs:{action:"#","show-file-list":!1,"before-upload":e.beforeAvatarUpload}},[e.logoUrl?i("img",{staticClass:"avatar",attrs:{src:e.logoUrl}}):i("div",{staticClass:"chooseImgDiv"},[i("div",[i("img",{attrs:{src:a("2e2a")}}),i("div",[e._v("选择图片")])])]),i("input",{directives:[{name:"model",rawName:"v-model",value:e.ruleForm.adPhoto,expression:"ruleForm.adPhoto"}],attrs:{type:"hidden",name:"logo"},domProps:{value:e.ruleForm.adPhoto},on:{input:function(t){t.target.composing||e.$set(e.ruleForm,"adPhoto",t.target.value)}}})]),e.hovering&&e.logoUrl?i("div",{staticClass:"delete-button",on:{click:e.handleDelete}},[i("i",{staticClass:"el-icon-delete"})]):e._e()],1)])]),i("el-form-item",{attrs:{label:"广告类型:",prop:"adType"}},[i("el-radio",{attrs:{label:"2"},model:{value:e.ruleForm.adType,callback:function(t){e.$set(e.ruleForm,"adType",t)},expression:"ruleForm.adType"}},[e._v("图片")])],1),i("el-form-item",{attrs:{label:"广告位大小:",prop:"adSize"}},[i("el-select",{attrs:{placeholder:"请选择广告位大小"},on:{change:e.change},model:{value:e.ruleForm.adSize,callback:function(t){e.$set(e.ruleForm,"adSize",t)},expression:"ruleForm.adSize"}},e._l(e.options,(function(e){return i("el-option",{key:e.id,attrs:{label:e.size,value:e.id}})})),1)],1),i("el-form-item",{attrs:{label:"价格:",prop:"price"}},[i("el-input",{attrs:{placeholder:"请输入价格"},model:{value:e.ruleForm.price,callback:function(t){e.$set(e.ruleForm,"price",t)},expression:"ruleForm.price"}})],1),i("el-form-item",{attrs:{label:"状态:",prop:"status"}},[i("el-radio",{attrs:{label:"1"},model:{value:e.ruleForm.status,callback:function(t){e.$set(e.ruleForm,"status",t)},expression:"ruleForm.status"}},[e._v("通过")]),i("el-radio",{attrs:{label:"2"},model:{value:e.ruleForm.status,callback:function(t){e.$set(e.ruleForm,"status",t)},expression:"ruleForm.status"}},[e._v("下架")])],1)],1),i("div",{staticClass:"dialogBtn"},[i("el-button",{attrs:{type:"info"},on:{click:e.cancelForm}},[e._v("取消")]),i("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")])],1)])],1)],1)},l=[],o=a("b85c"),r=(a("b0c0"),a("6ce0")),s=(a("4b51"),a("1cd5")),n={components:{tableTitle:r["default"]},data:function(){var e=function(e,t,a){0==t.length?a(new Error("该项不能为空!")):a()};return{tableDivTitle:"广告列表",dialogTableVisible:!1,dialogName:"编辑",loading:!0,tableData:[],webSiteList:[],webSiteLoading:!1,logoUrl:"",hovering:!1,value:"",activeid:"",page:1,pageSize:10,total:0,options:[],formLabelWidth:"",webSiteName_id:"",adPlaceName:"",website_id:"",ruleForm:{webName:"",adName:"",adDesc:"",adPhoto:"",adType:"",adSize:"",price:"",status:""},rules:{webName:[{required:!0,trigger:"blur",validator:e}],adName:[{required:!0,trigger:"blur",validator:e}],adDesc:[{required:!0,trigger:"blur",validator:e}],adPhoto:[{required:!0,trigger:"blur",validator:e}],adType:[{required:!0,trigger:"blur",validator:e}],adSize:[{required:!0,trigger:"blur",validator:e}],price:[{required:!0,trigger:"blur",validator:e}],status:[{required:!0,trigger:"blur",validator:e}]}}},methods:{getData:function(){var e=this;Object(s["g"])({page:this.page,pageSize:this.pageSize}).then((function(t){console.log(t.data.rows),e.tableData=t.data.rows,e.total=t.data.count,200==t.code&&(e.loading=!1);var a,i=Object(o["a"])(e.tableData);try{for(i.s();!(a=i.n()).done;){var l=a.value;l.size=l.width+"x"+l.height}}catch(r){i.e(r)}finally{i.f()}}))},getSize:function(){var e=this;Object(s["i"])().then((function(t){console.log(t.data),e.options=t.data;var a,i=Object(o["a"])(e.options);try{for(i.s();!(a=i.n()).done;){var l=a.value;l.size=l.width+"x"+l.height}}catch(r){i.e(r)}finally{i.f()}console.log(e.options)}))},change:function(){console.log(this.ruleForm.adSize)},deleteRow:function(e){var t=this;console.log(e);var a=new FormData;a.append("id",e),this.$confirm("注意:删除后,该条信息及其绑定关系全部删除","是否确认删除该条信息?",{confirmButtonText:"确定",cancelButtonText:"取消"}).then((function(){console.log("当前删除:"+e),Object(s["c"])({id:e}).then((function(e){console.log(e),(e.code=200)?(t.$message({message:"删除成功",type:"success"}),t.getData()):0==e.code&&t.$message({message:e.message,type:"error"})}))})).catch((function(){t.$message({type:"warning",message:"已取消删除"})}))},goGraph:function(){this.dialogVisible=!0},handleSizeChange:function(e){this.page=e,this.getData()},handleCurrentChange:function(e){this.page=e,this.getData()},goSearch:function(){var e=this;Object(s["g"])({page:this.page,pageSize:this.pageSize,name:this.adPlaceName,website_id:this.webSiteName_id}).then((function(t){console.log(t),e.tableData=t.data.rows,e.total=t.data.count;var a,i=Object(o["a"])(e.tableData);try{for(i.s();!(a=i.n()).done;){var l=a.value;l.size=l.width+"x"+l.height}}catch(r){i.e(r)}finally{i.f()}}))},goReset:function(){this.webSiteName_id="",this.adPlaceName="",this.getData()},goEdit:function(e,t){this.dialogName="编辑",this.activeid=e,this.dialogTableVisible=!0,console.log(e,t),this.website_id=t.website_id,this.ruleForm.webName=t.website_name,this.ruleForm.adName=t.name,this.ruleForm.adDesc=t.introduce,this.logoUrl=t.thumb,this.ruleForm.adPhoto=t.thumb,this.ruleForm.price=t.price,this.ruleForm.status=t.status,1==t.ad_size_id?this.ruleForm.adSize="1200x90":2==t.ad_size_id&&(this.ruleForm.adSize="420x560"),2==t.typeid&&(this.ruleForm.adType="2"),1==t.status?this.ruleForm.status="1":2==t.status&&(this.ruleForm.status="2")},goLook:function(e){this.activeid=e,this.$router.push({path:"/adPlaceDetail",query:{id:this.activeid}})},addWebsite:function(){this.dialogTableVisible=!0,this.dialogName="添加",this.ruleForm.webName="",this.ruleForm.adName="",this.ruleForm.adDesc="",this.ruleForm.adPhoto="",this.ruleForm.adSize="",this.ruleForm.adType="2",this.ruleForm.price="",this.ruleForm.status="",this.logoUrl=""},submitForm:function(){var e=this;""!=this.ruleForm.webName?("添加"==this.dialogName&&Object(s["b"])({name:this.ruleForm.adName,website_id:this.website_id,price:this.ruleForm.price,thumb:this.ruleForm.adPhoto,typeid:this.ruleForm.adType,ad_size_id:this.ruleForm.adSize,status:this.ruleForm.status,introduce:this.ruleForm.adDesc}).then((function(t){if(console.log(t),200!=t.code)return t.code,e.$message({message:t.message,type:"error"}),void(e.dialogTableVisible=!0);e.$message({message:"添加成功",type:"success"}),e.dialogTableVisible=!1,e.getData()})),""==this.website_id&&(this.$message({message:"请输入并选择网站名称",type:"error"}),this.dialogVisible=!0),"编辑"==this.dialogName&&Object(s["k"])({name:this.ruleForm.adName,website_id:this.website_id,price:this.ruleForm.price,thumb:this.ruleForm.adPhoto,typeid:this.ruleForm.adType,ad_size_id:this.ruleForm.adSize,status:this.ruleForm.status,introduce:this.ruleForm.adDesc,id:this.activeid}).then((function(t){console.log(t),200==t.code&&(e.$message({message:"编辑成功",type:"success"}),e.dialogTableVisible=!1),0==t.code&&(e.$message({message:t.message,type:"error"}),e.dialogTableVisible=!0),e.getData()}))):this.$message({message:"请将数据填写完整",type:"error"})},cancelForm:function(){this.dialogTableVisible=!1},beforeAvatarUpload:function(e){var t=this,a="image/jpeg"===e.type,i="image/png"===e.type,l=e.size/1024/1024<2;if(!a&&!i)return this.$message.error("上传图片只能是 JPG 或 PNG 格式!"),!1;if(!l)return this.$message.error("上传图片大小不能超过 2MB!"),!1;var o=new FormData;return o.append("file",e),this.$store.dispatch("pool/uploadFile",o).then((function(e){t.logoUrl=e.data.imgUrl,t.ruleForm.adPhoto=e.data.imgUrl,console.log(e.data.imgUrl)})).catch((function(){t.$message({type:"info",message:"网络错误,请重试!"})})),!1},handleDelete:function(){this.logoUrl=""},selectWebSite:function(e){this.webSiteName_id=e},detectionWebSite:function(e){console.log(e),this.website_id=e,console.log(this.website_id)},getWebNavList:function(e){var t=this;if(""!==e){this.webSiteLoading=!0;var a={keyword:e},i=[];this.$store.dispatch("pool/getNavWebList",a).then((function(e){console.log(e.data);var a,l=Object(o["a"])(e.data);try{for(l.s();!(a=l.n()).done;){var r=a.value,s={};s.key=r.id,s.value=r.id,s.label=r.website_name,i.push(s)}}catch(n){l.e(n)}finally{l.f()}t.webSiteList=i,t.webSiteLoading=!1})).catch((function(){t.$message({type:"info",message:"网络错误,请重试!"})}))}else this.navList=[]}},mounted:function(){this.getData(),this.getSize()}},d=n,c=(a("32c3"),a("2877")),u=Object(c["a"])(d,i,l,!1,null,"77b39537",null);t["default"]=u.exports},"32c3":function(e,t,a){"use strict";a("a2b5")},"4b51":function(e,t,a){},"6ce0":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tableTitle"},[a("span",{staticClass:"tableFloatLine"}),e._v(" "+e._s(e.name)+" ")])},l=[],o={props:{name:{type:String,required:!0}},data:function(){return{someData:""}}},r=o,s=(a("2e57"),a("2877")),n=Object(s["a"])(r,i,l,!1,null,"161b331a",null);t["default"]=n.exports},a2b5:function(e,t,a){}}]);