(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-341d886c"],{"0fb8":function(e,t,a){},"4fef":function(e,t,a){"use strict";a.r(t);var i=a("ade3"),s=a("5530");a("4e82"),a("e9c4"),a("a9e3");t["default"]={data:function(){return{listLoading:!1,tableData:[],currentPage:1,pageSize:10,totalRecords:1,listConfig:{},operations:[]}},created:function(){var e=this;this.$nextTick((function(){e.noCreated||e.fetchData()}))},methods:{searchHandle:function(e){this.currentPage=1,this.searchForm=e,this.fetchData()},sizeChange:function(e){this.pageSize=e,this.currentPage=1,this.fetchData()},pageHandle:function(e){this.currentPage=e,this.fetchData()},sortChange:function(e){this.currentPage=1;var t=Object(s["a"])({},this.searchForm);"ascending"===e.order?t.sort=JSON.stringify(Object(i["a"])({},e.prop,"asc")):t.sort=JSON.stringify(Object(i["a"])({},e.prop,"desc")),this.searchForm=Object(s["a"])({},t),this.fetchData(t)},fetchData:function(e){var t=this;if(this.apiStr){var a={page:this.currentPage,page_size:this.pageSize};e?a=Object(s["a"])(Object(s["a"])({},a),e):this.searchForm&&(a=Object(s["a"])(Object(s["a"])({},a),this.searchForm)),this.getDataBefore&&this.getDataBefore(a),this.listLoading=!0;var i=this.apiStr.split(".");this.$api[i[0]][i[1]](a).then((function(e){return 1===t.currentPage&&(t.pageSize=e.page_size||1),t.totalRecords=e.total?Number(e.total):0,t.tableData=e.list||[],t.listLoading=!1,t.getMoreData&&t.getMoreData(e,a),e})).catch((function(e){t.listLoading=!1}))}}}}},"83d4":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:"app-container"},[a("search-form",{attrs:{"list-loading":e.listLoading},on:{change:e.searchHandle}}),a("table-list",{attrs:{"list-loading":e.listLoading,data:e.tableData2,columns:e.listConfig,"current-page":e.currentPage,"page-size":e.pageSize,"total-records":e.totalRecords,isAdd:!0},on:{currentChange:e.pageHandle,sizeChange:e.sizeChange,add:e.openPopup}}),a("popup-edit",{attrs:{isShow:e.isDtlShow,curObj:e.curObj},on:{close:e.closePopup}})],1)},s=[],l=a("2909"),n=(a("d81d"),a("ed08")),o=a("8761"),c=a("84e1"),r=a("4fef"),d={name:"index",components:{SearchForm:o["default"],PopupEdit:c["default"]},provide:function(){return{parentData:this}},mixins:[r["default"]],data:function(){return{apiStr:"other.admadvertslist",searchForm:null,isDtlShow:!1,curObj:{}}},computed:{tableData2:function(){var e=Object(l["a"])(this.tableData);return e.map((function(e){})),e}},created:function(){},mounted:function(){this.listConfig={rows:[{label:"广告标题",prop:"title"},{label:"广告图片",prop:"images",type:"img"},{label:"投放位置",prop:"ad_position",type:"flag",flags:Object(n["a"])(this.$dictData.ad_position)},{label:"开始时间",prop:"start_at"},{label:"结束时间",prop:"end_at"},{label:"链接类型",prop:"ad_link_type",type:"flag",flags:Object(n["a"])(this.$dictData.ad_link_type)},{label:"备注",prop:"remarked"},{label:"更新人",prop:"update_by"},{label:"更新时间",prop:"update_at"},{label:"操作",width:120,type:"handle2",operations:[{label:"编辑",func:this.openPopup,btnType:"primary"},{label:"删除",func:this.delHandle,btnType:"danger"}]}]}},methods:{delHandle:function(e){var t=this;this.$msg("您确定要删除该广告吗?","confirm",(function(){t.$api.other.admadvertsdel({id:e.id}).then((function(e){t.$msgs("已删除!"),t.fetchData()}))}),null,!0)},openPopup:function(e){e&&e.id?this.curObj=e:this.curObj={},this.isDtlShow=!0},closePopup:function(e){this.isDtlShow=!1,e&&this.fetchData()}}},p=d,u=a("2877"),h=Object(u["a"])(p,i,s,!1,null,null,null);t["default"]=h.exports},"84e1":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",[a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{"show-close":!1,"close-on-click-modal":!1,visible:e.isShow,title:e.curObj.id?"编辑广告":"添加广告",fullscreen:!1,width:"700px","custom-class":"xl-dialog",center:""},on:{"update:visible":function(t){e.isShow=t}}},[a("base-form",{ref:"ruleForm",staticClass:"lib-edit",attrs:{data:e.formData,"is-inline":!1,"label-width":"100px"}},[a("div",{staticStyle:{"padding-top":"20px"},attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn t2",on:{click:e.close}},[e._v("关 闭")]),a("el-button",{staticClass:"xl-form-btn t1",on:{click:function(t){return e.close("confirm")}}},[e._v("确定")])],1)]),e.posTips?a("div",{staticClass:"scoped-tips"},[e._v("当前投放位置的尺寸建议: "),a("span",{staticClass:"s"},[e._v(e._s(e.posTips))])]):e._e(),a("div",{staticClass:"scoped-tips2"},[e._v("注:当前时间超过结束时间,则投放结束")])],1)],1)},s=[],l=a("5530"),n={components:{},mixins:mixins,props:{isShow:Boolean,curObj:Object},inject:["parentData"],data:function(){return{formData:[],loading:!0,cObj:{},posTips:""}},watch:{isShow:function(e){var t=this;e&&e&&(this.curObj.id?this.$api.other.admadvertsdetail({id:this.curObj.id}).then((function(e){var a=e||{};a.startEndTime=[a.start_at,a.end_at],t.cObj=a||{},t.getDef()})):(this.cObj=this.curObj,this.getDef()))}},methods:{getDef:function(e){var t=Object(l["a"])({},this.cObj);if("linkType"===e){var a=this.$refs.ruleForm.baseForm;t=Object(l["a"])(Object(l["a"])({},this.cObj),a),delete t.link_type_value}"estate"===t.ad_link_type?this.formData=[{label:"广告标题",key:"title",class:"c-2",rules:1},{label:"投放位置",key:"ad_position",type:"select",class:"c-2",options:this.$dictData.ad_position,rules:1,changeHandle:this.posHandle},{label:"链接类型",key:"ad_link_type",type:"select",class:"c-2",options:this.$dictData.ad_link_type,changeHandle:this.linkTypeHandle},{label:"关联楼盘",key:"link_type_value",type:"selectRemote",class:"c-2",changeHandle:this.ltValHandle,remoteParams:{skey:"estate_name",api:"house.admestatelist",opKey:"estate_name",opVal:"id"},remoteOptions:[{keyRO:t.link_type_name,valRO:t.link_type_value}]},{label:"广告图片",key:"images",type:"uploads"},{label:"投放时间",label2:"开始时间",label3:"结束时间",key:"startEndTime",type:"datePicker",rules:1},{label:"备注",key:"remarked",type:"textarea"}]:"news"===t.ad_link_type?this.formData=[{label:"广告标题",key:"title",class:"c-2",rules:1},{label:"投放位置",key:"ad_position",type:"select",class:"c-2",options:this.$dictData.ad_position,rules:1,changeHandle:this.posHandle},{label:"链接类型",key:"ad_link_type",type:"select",class:"c-2",options:this.$dictData.ad_link_type,changeHandle:this.linkTypeHandle},{label:"关联文章",key:"link_type_value",type:"selectRemote",class:"c-2",changeHandle:this.ltValHandle,remoteParams:{skey:"title",api:"house.adminformationlist",opKey:"title",opVal:"id"},remoteOptions:[{keyRO:t.link_type_name,valRO:t.link_type_value}]},{label:"广告图片",key:"images",type:"uploads"},{label:"投放时间",label2:"开始时间",label3:"结束时间",key:"startEndTime",type:"datePicker",rules:1},{label:"备注",key:"remarked",type:"textarea"}]:"page"===t.ad_link_type?this.formData=[{label:"广告标题",key:"title",class:"c-2",rules:1},{label:"投放位置",key:"ad_position",type:"select",class:"c-2",options:this.$dictData.ad_position,rules:1,changeHandle:this.posHandle},{label:"链接类型",key:"ad_link_type",type:"select",class:"c-2",options:this.$dictData.ad_link_type,changeHandle:this.linkTypeHandle},{label:"关联页面",key:"link_type_value",class:"c-2"},{label:"广告图片",key:"images",type:"uploads"},{label:"投放时间",label2:"开始时间",label3:"结束时间",key:"startEndTime",type:"datePicker",rules:1},{label:"备注",key:"remarked",type:"textarea"}]:this.formData=[{label:"广告标题",key:"title",class:"c-2",rules:1},{label:"投放位置",key:"ad_position",type:"select",class:"c-2",options:this.$dictData.ad_position,rules:1,changeHandle:this.posHandle},{label:"链接类型",key:"ad_link_type",type:"select",class:"c-2",options:this.$dictData.ad_link_type,changeHandle:this.linkTypeHandle},{label:"广告图片",key:"images",type:"uploads"},{label:"投放时间",label2:"开始时间",label3:"结束时间",key:"startEndTime",type:"datePicker",rules:1},{label:"备注",key:"remarked",type:"textarea"}],this.setDefaultValue(t)},ltValHandle:function(e,t,a){this.cObj.link_type_name=a.keyRO},linkTypeHandle:function(e){this.getDef("linkType")},posHandle:function(e,t,a){this.posTips=a.option1},close:function(e){var t=this;"confirm"===e?this.$refs["ruleForm"].$refs["baseForm"].validate((function(e){if(e){var a=t.$refs.ruleForm.baseForm,i=Object(l["a"])({},a);t.curObj.id&&(i.id=t.curObj.id);var s="admadvertsadd";i.id&&(s="admadvertsedit"),i.start_at=i.startEndTime[0],i.end_at=i.startEndTime[1],delete i.startEndTime,i.link_type_name=t.cObj.link_type_name||t.cObj.link_type_value,t.$api.other[s](i).then((function(e){t.$msgs(i.id?"编辑成功":"新增成功"),t.$emit("close",i)}))}})):(this.$emit("close"),this.setDefaultValue())}}},o=n,c=(a("94ef"),a("2877")),r=Object(c["a"])(o,i,s,!1,null,"3522cfc0",null);t["default"]=r.exports},8761: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("base-form",{ref:"ruleForm",attrs:{slot:"content",data:e.searchData},slot:"content"},[a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn bgc1",attrs:{loading:e.listLoading,icon:"el-icon-search"},on:{click:e.searchHandle}},[e._v("查询")])],1)])},s=[],l=a("5530"),n={props:{listLoading:Boolean},inject:["parentData"],data:function(){return{searchData:[{label:"广告标题",key:"title"},{label:"广告状态",key:"ad_status",type:"select",class:"c-3",options:this.$dictData.ad_status},{label:"投放位置",key:"ad_position",type:"select",class:"c-3",options:this.$dictData.ad_position},{label:"链接类型",key:"ad_link_type",type:"select",class:"c-3",options:this.$dictData.ad_link_type}]}},methods:{searchHandle:function(){var e=this.$refs.ruleForm.baseForm,t=Object(l["a"])({},e);this.$emit("change",t)}}},o=n,c=a("2877"),r=Object(c["a"])(o,i,s,!1,null,null,null);t["default"]=r.exports},"94ef":function(e,t,a){"use strict";a("0fb8")}}]);