text: webpackJsonp([40],{RqyI:function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=t("//Fk"),i=t.n(a),o=t("SJI6"),s=t("jvWE"),l={name:"",data:function(){return{fTypeID:"",introduceTypeList:[],introduceTypeList1:[],props:{label:"ht_it_Name",value:"ht_it_ID",children:"SubList"},addOptions:{loginUserID:"huileyou",loginUserPass:"123",operateUserID:"操作员编码",operateUserName:"操作员名称",pcName:"",data:{ht_it_Name:"",ht_it_ParentID:"",ht_it_Describe:"",ht_it_ImagePath:"",ht_it_ParentName:""}},ImageURL:[],ImageURL1:[],recommendName:"",total:0,isLoading:!1,addDialog:!1,updateDialog:!1,formLabelWidth:"120px"}},computed:Object(o.mapGetters)(["hotelIntroduceTypeList","hotelRecommendTypeList","updateHotelRecommendTypeObj"]),created:function(){this.initHotelIntroduceType(),this.initData(this.recommendName,1)},methods:{initHotelIntroduceType:function(){return this.$store.dispatch("initHotelIntroduceType",{loginUserID:"huileyou",loginUserPass:"123",operateUserID:"",operateUserName:"",pcName:"",ht_it_ID:""})},handleCurrentChange:function(n){this.initData(this.recommendName,n)},search:function(){this.initData(this.recommendName,1),this.initData(this.recommendName)},uploadImg:function(n){return new i.a(function(e,t){lrz(n).then(function(n){e(n.base64.split(",")[1])})})},uploadToOSS:function(n){return new i.a(function(e,t){var a=new FormData;a.append("fileToUpload",n);var i=new XMLHttpRequest;i.open("POST",s.a+"/OSSFile/PostToOSS"),i.send(a),i.onreadystatechange=function(){if(4==i.readyState&&200==i.status&&i.responseText){var n=i.responseText;e(JSON.parse(n))}}})},uploaNode:function(){var n=this;this.ImageURL=[],this.ImageURL1=[],setTimeout(function(){n.$refs.upload&&n.$refs.upload.addEventListener("change",function(e){for(var t=0;t<n.$refs.upload.files.length;t++)n.uploadToOSS(n.$refs.upload.files[t]).then(function(e){e?n.ImageURL.push(e.data):n.$notify({message:"图片地址不存在!",type:"error"})})}),n.$refs.upload1&&n.$refs.upload1.addEventListener("change",function(e){for(var t=0;t<n.$refs.upload1.files.length;t++)n.uploadToOSS(n.$refs.upload1.files[t]).then(function(e){e?n.ImageURL1.push(e.data):n.$notify({message:"图片地址不存在!",type:"error"})})})},30)},initData:function(n,e){var t=this,a={loginUserID:"huileyou",loginUserPass:"123",operateUserID:"操作员编码",operateUserName:"操作员名称",pcName:"",ht_it_ID:"",ht_it_Name:n||"",ht_it_ParentID:""};this.isLoading=!0,e?(a.page=e||1,a.rows=5,this.$store.dispatch("initHotelRecommendType",a).then(function(n){t.total=n,t.isLoading=!1},function(n){t.$notify({message:n,type:"error"})})):this.$store.dispatch("initHotelRecommendTypeAll",a).then(function(){t.isLoading=!1},function(n){t.$notify({message:n,type:"error"})})},Add:function(){this.addDialog=!0,this.$store.commit("setTranstionFalse"),this.uploaNode()},addSubmit:function(){var n=this;this.addOptions.data.ht_it_ParentID=this.introduceTypeList[this.introduceTypeList.length-1],this.addOptions.data.ht_it_ImagePath=this.ImageURL.join(","),this.$store.dispatch("AddHotelRecommendType",this.addOptions).then(function(e){n.$notify({message:e,type:"success"}),n.initData(n.recommendName,1)},function(e){n.$notify({message:e,type:"error"})}),this.addDialog=!1},Update:function(n){this.updateDialog=!0,this.$store.commit("setTranstionFalse"),this.$store.commit("initUpdateHotelRecommendType",n),this.uploaNode()},updateSubmit:function(){var n=this;this.updateHotelRecommendTypeObj.ht_it_ParentID=this.introduceTypeList1[this.introduceTypeList1.length-1];var e={loginUserID:"huileyou",loginUserPass:"123",operateUserID:"操作员编码",operateUserName:"操作员名称",pcName:"",data:this.updateHotelRecommendTypeObj};e.data.sm_aa_Image=this.ImageURL1.join(","),this.$store.dispatch("UpdateHotelRecommendType",e).then(function(e){n.$notify({message:e,type:"success"}),n.initData(n.recommendName,1)},function(e){n.$notify({message:e,type:"error"})}),this.updateDialog=!1},Delete:function(n){var e=this,t={loginUserID:"huileyou",loginUserPass:"123",operateUserID:"操作员编码",operateUserName:"操作员名称",pcName:"",data:{ht_it_ID:n}};this.$store.dispatch("DeleteHotelRecommendType",t).then(function(n){e.$notify({message:n,type:"success"}),e.initData(e.recommendName,1)},function(n){e.$notify({message:n,type:"error"})})}}},r={render:function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[t("section",{attrs:{id:"wrap"}},[t("h1",{staticClass:"userClass"},[n._v("酒店推荐类型")]),n._v(" "),t("el-col",{staticClass:"formSearch",attrs:{span:24}},[t("el-form",{attrs:{inline:!0}},[t("el-form-item",[t("span",[n._v("推荐类型名称筛选:")])]),n._v(" "),t("el-form-item",[t("el-input",{attrs:{type:"text","auto-complete":"off",placeholder:"推荐类型名称",size:"small"},model:{value:n.recommendName,callback:function(e){n.recommendName=e},expression:"recommendName"}})],1),n._v(" "),t("el-form-item",[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:n.search}},[n._v("查询")]),n._v(" "),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:n.Add}},[n._v("新增")])],1)],1)],1),n._v(" "),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:n.isLoading,expression:"isLoading"}],staticStyle:{width:"100%"},attrs:{data:n.hotelRecommendTypeList,"highlight-current-row":""}},[t("el-table-column",{attrs:{align:"center",label:"推荐类型编码",prop:"ht_it_ID"}}),n._v(" "),t("el-table-column",{attrs:{align:"center",label:"推荐类型名称",prop:"ht_it_Name"}}),n._v(" "),t("el-table-column",{attrs:{align:"center",label:"类型父级名称",prop:"ht_it_ParentName"}}),n._v(" "),t("el-table-column",{attrs:{align:"center",label:"推荐描述",prop:"ht_it_Describe"}}),n._v(" "),t("el-table-column",{attrs:{align:"center",label:"图片路径"},scopedSlots:n._u([{key:"default",fn:function(n){return[t("img",{directives:[{name:"lazy",rawName:"v-lazy",value:n.row.ht_it_ImagePath,expression:"scope.row.ht_it_ImagePath"},{name:"show",rawName:"v-show",value:n.row.ht_it_ImagePath,expression:"scope.row.ht_it_ImagePath"}],staticStyle:{width:"100px"},attrs:{alt:""}})]}}])}),n._v(" "),t("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:n._u([{key:"default",fn:function(e){return[t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){n.Update(e.row.ht_it_ID)}}},[n._v("修改\n            ")]),n._v(" "),t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){n.Delete(e.row.ht_it_ID)}}},[n._v("删除\n            ")])]}}])})],1),n._v(" "),t("div",{staticClass:"block",staticStyle:{float:"right"}},[t("el-pagination",{directives:[{name:"show",rawName:"v-show",value:n.total,expression:"total"}],attrs:{"page-size":5,layout:"total, prev, pager, next",total:n.total},on:{"current-change":n.handleCurrentChange}})],1),n._v(" "),t("el-dialog",{attrs:{title:"添加推荐类型",visible:n.addDialog},on:{"update:visible":function(e){n.addDialog=e}}},[t("el-form",{attrs:{model:n.addOptions}},[t("el-form-item",{attrs:{label:"推荐父类型选择:","label-width":n.formLabelWidth}},[t("el-cascader",{attrs:{options:n.hotelIntroduceTypeList,"change-on-select":"",props:n.props,"show-all-levels":!1},model:{value:n.introduceTypeList,callback:function(e){n.introduceTypeList=e},expression:"introduceTypeList"}})],1),n._v(" "),t("el-form-item",{attrs:{label:"推荐类型名称:","label-width":n.formLabelWidth}},[t("el-input",{attrs:{placeholder:"请输入图片类型名称"},model:{value:n.addOptions.data.ht_it_Name,callback:function(e){n.$set(n.addOptions.data,"ht_it_Name",e)},expression:"addOptions.data.ht_it_Name"}})],1),n._v(" "),t("el-form-item",{attrs:{label:"推荐类型描述:","label-width":n.formLabelWidth}},[t("el-input",{attrs:{placeholder:"请输入类型描述"},model:{value:n.addOptions.data.ht_it_Describe,callback:function(e){n.$set(n.addOptions.data,"ht_it_Describe",e)},expression:"addOptions.data.ht_it_Describe"}})],1),n._v(" "),t("el-form-item",{attrs:{label:"推荐类型图片:","label-width":n.formLabelWidth}},[t("a",{staticClass:"file",attrs:{href:"javascript:;"}},[n._v("推荐类型图片上传\n            "),t("input",{ref:"upload",attrs:{type:"file",name:"",accept:"image/*",multiple:""}})]),n._v(" "),n._l(n.ImageURL,function(e){return t("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e,expression:"item"},{name:"show",rawName:"v-show",value:n.ImageURL.length,expression:"ImageURL.length"}],staticStyle:{width:"100px",height:"100px"},attrs:{src:"",alt:""}})})],2)],1),n._v(" "),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(e){n.addDialog=!1}}},[n._v("取 消")]),n._v(" "),t("el-button",{attrs:{type:"primary"},on:{click:n.addSubmit}},[n._v("确 定")])],1)],1),n._v(" "),t("el-dialog",{attrs:{title:"修改推荐类型",visible:n.updateDialog},on:{"update:visible":function(e){n.updateDialog=e}}},[t("el-form",{attrs:{model:n.updateHotelRecommendTypeObj}},[t("el-form-item",{attrs:{label:"推荐父类型选择:","label-width":n.formLabelWidth}},[t("el-cascader",{attrs:{options:n.hotelIntroduceTypeList,"change-on-select":"",props:n.props,"show-all-levels":!1},model:{value:n.introduceTypeList1,callback:function(e){n.introduceTypeList1=e},expression:"introduceTypeList1"}})],1),n._v(" "),t("el-form-item",{attrs:{label:"推荐类型名称:","label-width":n.formLabelWidth}},[t("el-input",{attrs:{placeholder:"请输入图片类型名称"},model:{value:n.updateHotelRecommendTypeObj.ht_it_Name,callback:function(e){n.$set(n.updateHotelRecommendTypeObj,"ht_it_Name",e)},expression:"updateHotelRecommendTypeObj.ht_it_Name"}})],1),n._v(" "),t("el-form-item",{attrs:{label:"推荐类型描述:","label-width":n.formLabelWidth}},[t("el-input",{attrs:{placeholder:"请输入类型描述"},model:{value:n.updateHotelRecommendTypeObj.ht_it_Describe,callback:function(e){n.$set(n.updateHotelRecommendTypeObj,"ht_it_Describe",e)},expression:"updateHotelRecommendTypeObj.ht_it_Describe"}})],1),n._v(" "),t("el-form-item",{attrs:{label:"推荐类型图片:","label-width":n.formLabelWidth}},[t("a",{staticClass:"file",attrs:{href:"javascript:;"}},[n._v("推荐类型图片上传\n            "),t("input",{ref:"upload1",attrs:{type:"file",name:"",accept:"image/*",multiple:""}})]),n._v(" "),n._l(n.ImageURL1,function(e){return t("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e,expression:"item"},{name:"show",rawName:"v-show",value:n.ImageURL1.length,expression:"ImageURL1.length"}],staticStyle:{width:"100px",height:"100px"},attrs:{src:"",alt:""}})})],2)],1),n._v(" "),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(e){n.updateDialog=!1}}},[n._v("取 消")]),n._v(" "),t("el-button",{attrs:{type:"primary"},on:{click:n.updateSubmit}},[n._v("确 定")])],1)],1)],1)])},staticRenderFns:[]};var c=t("VU/8")(l,r,!1,function(n){t("hgwL")},"data-v-08a7505f",null);e.default=c.exports},hgwL:function(n,e,t){var a=t("uemy");"string"==typeof a&&(a=[[n.i,a,""]]),a.locals&&(n.exports=a.locals);t("rjj0")("4747c522",a,!0)},uemy:function(n,e,t){(n.exports=t("FZ+f")(!1)).push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])}});