chunk-5fdcd7ad.d1f2467c.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5fdcd7ad"],{"14b8":function(e,t,a){},"2e2a":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAS5SURBVHgB1ZpNTBtHFMffzK7tePlQEkKTgClESVw1KZIlKrVGTUpLVDUtqFIPXMu511zba2+9tteeKpWeKiBppRAREmo1gRREiApFDU2guAGjBOM1tndmss/RErDX9qyNP/KTvOvdebOa/8zbmTczS8ABv9xeb/BwrZ4lWQOUAcWtRPUkS35+qTEim4cUMhidjLcDJ52CiyYQ3AOVgNAEB7KmUFj+9MKhxbymuRJ+nYidZJz0CBBlqW1ZCJAoKHQ6lxBbAdcm9SBLiU6oIRQgc5d7tFDm/SwBVyfi73PO34AahFK68MlF78199/ZejNyIddVq4REs27VxPbj33q6A639sNZlXXVDjMBCd+H5a17sCEnH1I3hFYORlRacFoKJq9zZOEAxarFZIC0ix2vX7XKQ46cCzigdKFGwBcML838y/8Yz4UimhuVxEP9tOZluaifQIWipmzXeYpxAZui/c2oY+KJsxvC6abt9jg7E4+DPTjh6GUNd5ZbhSQvQn2g+0cVNvks2Ahb9xh12xKzyy+RSC42b61rbQoAKoR6MN1EmGqXnel0pBXsGYfmeOfwgVwONtqKcsqUj1Plj7kaeiW8Z2bV30QiWIJzzSLbC6ztpkbTkHbekRl7YvBWkBySTxggMSKWf2xSItoPkYWQEHtB0HR/bFIi3gjI8+phR0Gds6jSw01hMp21Jx1AudeV0ZkrELnCM/Q4VwJCAYIKHWE8pwPpt2Hx3C1oIKoTq0h0vvkpGlFTo79xfv29bBjz0OutbhRpg9d1a9frq1Mr5v4VgAgjVs/r6HGsCRC9UiNSNg6ZHRhhEuOKQoFzpI9ke3AmYXjcipVjIcDCghmfxVbQG76BaDwcVlMfjbhDEg84yqCsgX3YY3ofenq6mvC4XmVRMQmmHBQtHtTpL4Rm6yr/4zWyqXTVUEYK0+XBX9MrbYQrfuGl/mSq+KgNA9VnBitBdsCWwxu7SieyHs8v5ZFd1ucxTufFMZk50HT9w1etG/wSH/b4iAecrqmYoSMDxuDOL817oOT7Je32sw0tut5o2TQn8a3Q9XQap3yURPgO0EybELYfe2t/AWK0+g78dR4xu7wQh9HvMt/gtfQJGoxD6UV8HrSUBKLnQf+93oz9f86NdT8+IKDkaaBx573RCJxqEtngAfBn1QAlTNnl8obhZVE/HotltVCj5g+oERwFoGCVDIM/zBwXHsiJi1u0+NEw3RAnnTI+aDpeKb/yDwdygzmfe2wlqEDrxFkultnBxYw32pLlAKuOKX2cthmQcGSDL9EpuH5VyZZRazyonLBRFcrsy8zwVbw3NaAKFiOdcDtmKiaivXONN7J6B+ZzfGuBS6kLbBw8cX69YEe6Eok5bjdAyqwCG3WOnuUr+1m6Ki+2CZ8f/uQOZyKVMGh6z4pOdtOhZuJzPoSjFdtO0koWwrbljj9Ros+k8pY+dPk5z7wwoV49b/fbuUuIGGe1BQgHzRYbHUeyEutZakwHTfhbpp6/KV32a13+iWbIlKIsyN7n6ZjW6L0Vs7fmC8qxY+NUCft17a7PQCoBDCoYODOFnJjz0IJxEK8fuXPziynNcUHICb4UbCDKHK+LlNgurbn73XXDC8sXgOkdYWBuX7PgUAAAAASUVORK5CYII="},"3bfd":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",[l("div",{staticClass:"title"},[l("el-row",[l("el-col",{staticClass:"left",attrs:{span:6}},[l("div",{staticClass:"searchBox"},[l("div",{staticClass:"searchTitle"},[e._v("模板风格")]),l("el-select",{attrs:{clearable:"",placeholder:"请选择模板风格"},model:{value:e.templateStyle,callback:function(t){e.templateStyle=t},expression:"templateStyle"}},e._l(e.options,(function(e){return l("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)]),l("el-col",{staticClass:"left",attrs:{span:6}},[l("div",{staticClass:"searchBox"},[l("div",{staticClass:"searchTitle"},[e._v("版块")]),l("el-input",{attrs:{clearable:"",placeholder:"请输入版块名称"},model:{value:e.plateName,callback:function(t){e.plateName=t},expression:"plateName"}})],1)]),l("el-col",{staticClass:"right",attrs:{span:8}},[l("div",{staticClass:"btnList"},[l("button",{staticClass:"search",on:{click:e.goSearch}},[e._v("搜索")]),l("button",{staticClass:"reset",on:{click:e.goReset}},[e._v("重置")])])])],1)],1),l("div",{staticClass:"layerBox"},[l("tableTitle",{attrs:{name:e.tableDivTitle}}),l("button",{staticClass:"btn",on:{click:e.addWebsite}},[e._v("添加版块")]),l("el-row",[[l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.plateLoading,expression:"plateLoading"}],staticClass:"my-table",staticStyle:{width:"100%"},attrs:{data:e.tableData}},[l("el-table-column",{attrs:{fixed:"",prop:"id",label:"编号",width:"90"}}),l("el-table-column",{attrs:{prop:"sector_name",label:"版块",width:""}}),l("el-table-column",{attrs:{prop:"sector_code",label:"版块代码",width:""}}),l("el-table-column",{attrs:{prop:"created_at",label:"添加时间",width:""}}),l("el-table-column",{attrs:{prop:"updated_at",label:"修改时间",width:""}}),l("el-table-column",{attrs:{fixed:"right",label:"操作",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[l("div",{staticClass:"listBtnBox"},[l("div",{staticClass:"listDeleteBtn",on:{click:function(a){return e.deleteRow(t.row.id)}}},[l("i",{staticClass:"el-icon-delete"}),e._v(" 删除 ")]),l("div",{staticClass:"listEditBtn",on:{click:function(a){return e.goEdit(t.row.id,t.row)}}},[l("i",{staticClass:"el-icon-edit-outline"}),e._v(" 编辑 ")])])]}}])})],1)]],2)],1),l("div",{staticClass:"alignBox"},[l("el-row",[l("el-col",{attrs:{span:24}},[l("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),l("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}}},[l("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"120px"}},[l("div",{staticClass:"dialogText"},[l("el-form-item",{attrs:{label:"关联风格名称:",prop:"templateStyle"}},[l("el-select",{attrs:{placeholder:"请选择关联风格名称",disabled:"编辑"===this.dialogName},on:{change:e.changeTemplateStyle},model:{value:e.ruleForm.templateStyle,callback:function(t){e.$set(e.ruleForm,"templateStyle",t)},expression:"ruleForm.templateStyle"}},e._l(e.options,(function(e){return l("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),l("el-form-item",{attrs:{label:"版块名称:",prop:"plateName"}},[l("el-input",{attrs:{placeholder:"请输入版块名称"},model:{value:e.ruleForm.plateName,callback:function(t){e.$set(e.ruleForm,"plateName",t)},expression:"ruleForm.plateName"}})],1),l("el-form-item",{attrs:{label:"版块代码:",prop:"plateCode"}},[l("el-input",{attrs:{placeholder:"请输入版块代码",disabled:"编辑"===this.dialogName},model:{value:e.ruleForm.plateCode,callback:function(t){e.$set(e.ruleForm,"plateCode",t)},expression:"ruleForm.plateCode"}})],1),l("el-form-item",{attrs:{label:"页面类型:",prop:"pageType"}},[l("el-checkbox-group",{attrs:{disabled:"编辑"===this.dialogName},on:{change:e.changeCheckbox},model:{value:e.ruleForm.pageType,callback:function(t){e.$set(e.ruleForm,"pageType",t)},expression:"ruleForm.pageType"}},e._l(e.checkList,(function(t,a){return l("el-checkbox",{key:a,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)],1),l("el-form-item",{staticClass:"custom-align-right",class:["custom-form-item"],attrs:{label:"组件展示图:",prop:"image","label-width":e.formLabelWidth}},[l("div",{staticClass:"uploaderBox"},[l("div",{staticClass:"avatar-upload-container",on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},[l("el-upload",{staticClass:"avatar-uploader",attrs:{action:"#","show-file-list":!1,"before-upload":e.beforeAvatarUpload,disabled:"编辑"===this.dialogName}},[e.logoUrl?l("img",{staticClass:"avatar",attrs:{src:e.logoUrl}}):l("div",{staticClass:"chooseImgDiv"},[l("div",[l("img",{attrs:{src:a("2e2a")}}),l("div",[e._v("选择图片")])])]),l("input",{directives:[{name:"model",rawName:"v-model",value:e.ruleForm.image,expression:"ruleForm.image"}],attrs:{type:"hidden",name:"logo"},domProps:{value:e.ruleForm.image},on:{input:function(t){t.target.composing||e.$set(e.ruleForm,"image",t.target.value)}}})]),e.hovering&&e.logoUrl&&"添加"==e.dialogName?l("div",{staticClass:"delete-button",on:{click:e.handleDelete}},[l("i",{staticClass:"el-icon-delete"})]):e._e()],1)])])],1),l("div",{staticClass:"dialogBtn"},[l("el-button",{attrs:{type:"info"},on:{click:e.cancelForm}},[e._v("取消")]),l("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("ruleForm")}}},[e._v("提交")])],1)])],1)],1)},i=[],o=a("b85c"),s=a("53ca"),r=(a("e9c4"),a("b64b"),a("d3b7"),a("0643"),a("4e3e"),a("159b"),a("6968")),n=(a("4b51"),a("87e2")),c=a("c956"),u={components:{tableTitle:r["default"]},data:function(){var e=function(e,t,a){0==t.length?a(new Error("该项不能为空!")):a()};return{tableDivTitle:"版块列表",dialogTableVisible:!1,dialogName:"编辑",plateLoading:!0,tableData:[],options:[],templateStyle:"",plateName:"",pageType:"",value:"",checkList:[{value:"1",label:"首页"},{value:"2",label:"分类页"},{value:"3",label:"列表页"},{value:"4",label:"详情页"},{value:"5",label:"搜索页"},{value:"6",label:"特殊列表页"},{value:"7",label:"特殊详情页"}],activeid:"",newArr:[],page:1,pageSize:10,total:0,formLabelWidth:"",ruleForm:{templateStyle:"",plateName:"",plateCode:"",pageType:[],image:""},rules:{templateStyle:[{required:!0,trigger:"blur",validator:e}],plateName:[{required:!0,trigger:"blur",validator:e}],plateCode:[{required:!0,trigger:"blur",validator:e}],pageType:[{required:!0,trigger:"blur",validator:e}],image:[{required:!0,trigger:"blur",validator:e}]},logoUrl:"",hovering:!1}},methods:{getData:function(){var e=this;""!=this.templateStyle||""!=this.plateName?Object(n["c"])({page:this.page,page_size:this.pageSize,template_class_id:this.templateStyle,sector_name:this.plateName}).then((function(t){console.log(t),e.tableData=t.data.data,e.total=t.data.total})):Object(n["c"])({page:this.page,page_size:this.pageSize}).then((function(t){console.log(t),200==t.code&&(e.plateLoading=!1),e.tableData=t.data.data,e.total=t.data.total}))},getStyleList:function(){var e=this;Object(c["c"])({page:this.page,page_size:this.pageSize}).then((function(t){console.log("模板风格列表",t),e.options=t.data}))},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(n["b"])({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:"已取消删除"})}))},changeCheckbox:function(e){var t=this;console.log(e),this.newArr=[],e.forEach((function(e){"object"===Object(s["a"])(e)&&e.hasOwnProperty("__ob__")||t.newArr.push(e)})),this.pageType=JSON.stringify(this.newArr),console.log(this.pageType)},changeTemplateStyle:function(e){console.log("风格id",e),console.log(this.ruleForm.templateStyle)},handleSizeChange:function(e){this.page=e,this.getData()},handleCurrentChange:function(e){this.page=e,this.getData()},goSearch:function(){var e=this;Object(n["c"])({page:this.page,page_size:this.pageSize,template_class_id:this.templateStyle,sector_name:this.plateName}).then((function(t){console.log(t),e.tableData=t.data.data,e.total=t.data.total}))},goReset:function(){this.templateStyle="",this.plateName="",this.page=1,this.pageSize=10,this.getData()},goEdit:function(e,t){this.dialogName="编辑",this.activeid=e,this.dialogTableVisible=!0,console.log(e,t),this.hovering=!1,this.ruleForm.templateStyle=t.template_class_id,this.ruleForm.plateName=t.sector_name,this.ruleForm.plateCode=t.sector_code,this.ruleForm.pageType=JSON.parse(JSON.parse(t.page_type)),this.ruleForm.image=t.sector_img,this.logoUrl=t.sector_img},addWebsite:function(){this.dialogTableVisible=!0,this.dialogName="添加",this.ruleForm.templateStyle="",this.ruleForm.plateName="",this.ruleForm.plateCode="",this.ruleForm.pageType=[],this.ruleForm.image="",this.logoUrl=""},submitForm:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return console.log("error submit!!"),!1;console.log("submit!")})),"添加"==this.dialogName&&Object(n["a"])({template_id:this.ruleForm.templateStyle,sector_name:this.ruleForm.plateName,sector_code:this.ruleForm.plateCode,page_type:this.pageType,sector_img:this.ruleForm.image}).then((function(e){if(console.log(e),200!=e.code)return e.code,t.$message({message:e.message,type:"error"}),void(t.dialogTableVisible=!0);t.$message({message:"添加成功",type:"success"}),t.dialogTableVisible=!1,t.getData()})),""==this.website_id&&(this.$message({message:"请输入并选择网站名称",type:"error"}),this.dialogVisible=!0),"编辑"==this.dialogName&&Object(n["d"])({id:this.activeid,sector_name:this.ruleForm.plateName}).then((function(e){console.log(e),200==e.code&&(t.$message({message:"编辑成功",type:"success"}),t.dialogTableVisible=!1),0==e.code&&(t.$message({message:e.message,type:"error"}),t.dialogTableVisible=!0),t.getData()}))},cancelForm:function(){this.dialogTableVisible=!1},beforeAvatarUpload:function(e){var t=this,a="image/jpeg"===e.type,l="image/png"===e.type,i=e.size/1024/1024<2;if(!a&&!l)return this.$message.error("上传图片只能是 JPG 或 PNG 格式!"),!1;if(!i)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.image=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},l=[];this.$store.dispatch("pool/getNavWebList",a).then((function(e){console.log(e.data);var a,i=Object(o["a"])(e.data);try{for(i.s();!(a=i.n()).done;){var s=a.value,r={};r.key=s.id,r.value=s.id,r.label=s.website_name,l.push(r)}}catch(n){i.e(n)}finally{i.f()}t.webSiteList=l,t.webSiteLoading=!1})).catch((function(){t.$message({type:"info",message:"网络错误,请重试!"})}))}else this.navList=[]}},mounted:function(){this.getData(),this.getStyleList()}},d=u,p=(a("55e6"),a("2877")),m=Object(p["a"])(d,l,i,!1,null,"36152fef",null);t["default"]=m.exports},4423:function(e,t,a){"use strict";a("9187")},"4b51":function(e,t,a){},"55e6":function(e,t,a){"use strict";a("14b8")},6968:function(e,t,a){"use strict";a.r(t);var l=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)+" ")])},i=[],o={props:{name:{type:String,required:!0}},data:function(){return{someData:""}}},s=o,r=(a("4423"),a("2877")),n=Object(r["a"])(s,l,i,!1,null,"fe16b7a0",null);t["default"]=n.exports},"87e2":function(e,t,a){"use strict";a.d(t,"c",(function(){return i})),a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"d",(function(){return r}));var l=a("b775"),i=function(e){return Object(l["a"])({url:"/public/getSectorList",method:"post",data:e})},o=function(e){return Object(l["a"])({url:"/public/addSector",method:"post",data:e})},s=function(e){return Object(l["a"])({url:"/public/delSector",method:"post",data:e})},r=function(e){return Object(l["a"])({url:"/public/updateSector",method:"post",data:e})}},9187:function(e,t,a){},c956:function(e,t,a){"use strict";a.d(t,"c",(function(){return i})),a.d(t,"d",(function(){return o})),a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return r})),a.d(t,"e",(function(){return n}));var l=a("b775"),i=function(e){return Object(l["a"])({url:"/public/getTemplateClass",method:"post",data:e})},o=function(e){return Object(l["a"])({url:"/public/getTemplateList",method:"post",data:e})},s=function(e){return Object(l["a"])({url:"/public/addTemplate",method:"post",data:e})},r=function(e){return Object(l["a"])({url:"/public/delTemplate",method:"post",data:e})},n=function(e){return Object(l["a"])({url:"/public/updateTemplate",method:"post",data:e})}},e9c4:function(e,t,a){var l=a("23e7"),i=a("d066"),o=a("d039"),s=i("JSON","stringify"),r=/[\uD800-\uDFFF]/g,n=/^[\uD800-\uDBFF]$/,c=/^[\uDC00-\uDFFF]$/,u=function(e,t,a){var l=a.charAt(t-1),i=a.charAt(t+1);return n.test(e)&&!c.test(i)||c.test(e)&&!n.test(l)?"\\u"+e.charCodeAt(0).toString(16):e},d=o((function(){return'"\\udf06\\ud834"'!==s("\udf06\ud834")||'"\\udead"'!==s("\udead")}));s&&l({target:"JSON",stat:!0,forced:d},{stringify:function(e,t,a){var l=s.apply(null,arguments);return"string"==typeof l?l.replace(r,u):l}})}}]);