1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3922093d"],{"1d55":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="},"2f64":function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("div",{staticClass:"title"},[o("el-row",[o("el-col",{staticClass:"left",attrs:{span:6}},[o("div",{staticClass:"searchBox"},[o("div",{staticClass:"searchTitle"},[e._v("版块")]),o("el-select",{attrs:{clearable:"",placeholder:"请选择版块"},model:{value:e.templateName,callback:function(t){e.templateName=t},expression:"templateName"}},e._l(e.options,(function(e){return o("el-option",{key:e.id,attrs:{label:e.sector_name,value:e.id}})})),1)],1)]),o("el-col",{staticClass:"left",attrs:{span:6}},[o("div",{staticClass:"searchBox"},[o("div",{staticClass:"searchTitle"},[e._v("组件名称")]),o("el-input",{attrs:{clearable:"",placeholder:"请输入组件名称"},model:{value:e.componentName,callback:function(t){e.componentName=t},expression:"componentName"}})],1)]),o("el-col",{staticClass:"right",attrs:{span:8}},[o("div",{staticClass:"btnList"},[o("button",{staticClass:"search",on:{click:e.goSearch}},[e._v("搜索")]),o("button",{staticClass:"reset",on:{click:e.goReset}},[e._v("重置")])])])],1)],1),o("div",{staticClass:"layerBox"},[o("tableTitle",{attrs:{name:e.tableDivTitle}}),o("button",{staticClass:"btn",on:{click:e.addWebsite}},[e._v("添加组件")]),o("el-row",[[o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.moduleLoading,expression:"moduleLoading"}],staticClass:"my-table",staticStyle:{width:"100%"},attrs:{data:e.tableData}},[o("el-table-column",{attrs:{fixed:"",prop:"id",label:"编号",width:"90"}}),o("el-table-column",{attrs:{prop:"component_name",label:"组件名称",width:""}}),o("el-table-column",{attrs:{prop:"component_code",label:"组件代码",width:""}}),o("el-table-column",{attrs:{prop:"created_at",label:"添加时间",width:""}}),o("el-table-column",{attrs:{prop:"updated_at",label:"修改时间",width:""}}),o("el-table-column",{attrs:{fixed:"right",label:"操作",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("div",{staticClass:"listBtnBox"},[o("div",{staticClass:"listDeleteBtn",on:{click:function(a){return e.deleteRow(t.row.id)}}},[o("i",{staticClass:"el-icon-delete"}),e._v(" 删除 ")]),o("div",{staticClass:"listEditBtn",on:{click:function(a){return e.goEdit(t.row.id,t.row)}}},[o("i",{staticClass:"el-icon-edit-outline"}),e._v(" 编辑 ")])])]}}])})],1)]],2)],1),o("div",{staticClass:"alignBox"},[o("el-row",[o("el-col",{attrs:{span:24}},[o("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),o("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}}},[o("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"120px"}},[o("div",{staticClass:"dialogText"},[o("el-form-item",{attrs:{label:"关联版块:",prop:"plateName"}},[o("el-cascader",{attrs:{options:e.styleOptions,props:e.cascaderProps,disabled:"编辑"===this.dialogName,placeholder:"请选择关联的版块名称",clearable:""},on:{change:e.handleChange},model:{value:e.ruleForm.plateName,callback:function(t){e.$set(e.ruleForm,"plateName",t)},expression:"ruleForm.plateName"}})],1),o("el-form-item",{attrs:{label:"组件名称:",prop:"component_name"}},[o("el-input",{attrs:{placeholder:"请输入组件名称"},model:{value:e.ruleForm.component_name,callback:function(t){e.$set(e.ruleForm,"component_name",t)},expression:"ruleForm.component_name"}})],1),o("el-form-item",{attrs:{label:"组件代码:",prop:"component_code"}},[o("el-input",{attrs:{placeholder:"请输入组件代码",disabled:"编辑"===this.dialogName},model:{value:e.ruleForm.component_code,callback:function(t){e.$set(e.ruleForm,"component_code",t)},expression:"ruleForm.component_code"}})],1),o("el-form-item",{staticClass:"custom-align-right",class:["custom-form-item"],attrs:{label:"组件展示图:",prop:"component_img","label-width":e.formLabelWidth}},[o("div",{staticClass:"uploaderBox"},[o("div",{staticClass:"avatar-upload-container",on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},[o("el-upload",{staticClass:"avatar-uploader",attrs:{action:"#","show-file-list":!1,"before-upload":e.beforeAvatarUpload,disabled:"编辑"===this.dialogName}},[e.logoUrl?o("img",{staticClass:"avatar",attrs:{src:e.logoUrl}}):o("div",{staticClass:"chooseImgDiv"},[o("div",[o("img",{attrs:{src:a("2e2a")}}),o("div",[e._v("选择图片")])])]),o("input",{directives:[{name:"model",rawName:"v-model",value:e.ruleForm.webLogo,expression:"ruleForm.webLogo"}],attrs:{type:"hidden",name:"logo"},domProps:{value:e.ruleForm.webLogo},on:{input:function(t){t.target.composing||e.$set(e.ruleForm,"webLogo",t.target.value)}}})]),e.hovering&&e.logoUrl&&"添加"==e.dialogName?o("div",{staticClass:"delete-button",on:{click:e.handleDelete}},[o("i",{staticClass:"el-icon-delete"})]):e._e()],1)])])],1),o("div",{staticClass:"dialogBtn"},[o("el-button",{attrs:{type:"info"},on:{click:e.cancelForm}},[e._v("取消")]),o("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("ruleForm")}}},[e._v("提交")])],1)])],1)],1)},i=[],l=a("b85c"),n=(a("d81d"),a("a573"),a("6968")),s=(a("4b51"),a("b775")),r=function(e){return Object(s["a"])({url:"/public/getComponentList",method:"post",data:e})},c=function(e){return Object(s["a"])({url:"/public/addComponent",method:"post",data:e})},d=function(e){return Object(s["a"])({url:"/public/delComponent",method:"post",data:e})},m=function(e){return Object(s["a"])({url:"/public/updateComponent",method:"post",data:e})},u=a("87e2"),p=a("c956"),g={components:{tableTitle:n["default"]},data:function(){var e=function(e,t,a){0==t.length?a(new Error("该项不能为空!")):a()};return{tableDivTitle:"组件列表",dialogTableVisible:!1,dialogName:"编辑",moduleLoading:!0,tableData:[],options:[],activeid:"",styleOptions:[],plateOptions:[],selectedId:"",selectedOptions:[],cascaderProps:{value:"id",label:"name",expandTrigger:"hover",checkStrictly:!0,children:"children"},templateName:"",componentName:"",logoUrl:"",hovering:!1,value:"",page:1,pageSize:10,total:0,formLabelWidth:"",template_id:"",sector_id:"",ruleForm:{plateName:"",component_name:"",component_code:"",component_img:""},rules:{plateName:[{required:!0,trigger:"blur",validator:e}],component_name:[{required:!0,trigger:"blur",validator:e}],component_code:[{required:!0,trigger:"blur",validator:e}],component_img:[{required:!0,trigger:"blur",validator:e}]}}},methods:{getData:function(){var e=this;""!=this.templateName||""!=this.componentName?r({page:this.page,page_size:this.pageSize,template_class_id:"",component_name:this.componentName,sector_id:this.templateName}).then((function(t){console.log(t),e.tableData=t.data.data,e.total=t.data.total})):r({page:this.page,page_size:this.pageSize}).then((function(t){console.log("组件",t),200==t.code&&(e.moduleLoading=!1,e.tableData=t.data.data,e.total=t.data.total)}))},getList:function(){var e=this;Object(u["c"])({page:this.page,page_size:1e3}).then((function(t){console.log("获取版块",t.data.data),e.options=t.data.data})),Object(p["c"])().then((function(t){console.log("风格",t.data),e.styleOptions=t.data;var a,o=Object(l["a"])(e.styleOptions);try{for(o.s();!(a=o.n()).done;){var i=a.value;i.children=[]}}catch(n){o.e(n)}finally{o.f()}}))},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),d({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:"已取消删除"})}))},handleChange:function(e){if(console.log("val",e),this.template_id=e[0],this.sector_id=e[1],console.log("当前选中的父级:",this.template_id),console.log("当前选中的子级:",this.sector_id),e.length>0){var t=e[e.length-1];this.fetchChildren(t)}},fetchChildren:function(e){var t=this;Object(u["c"])({page:this.page,page_size:1e3,template_class_id:e}).then((function(a){console.log("data",a.data.data),t.plateOptions=a.data.data,t.styleOptions=t.styleOptions.map((function(a){if(a.id===e){var o,i=[],n=Object(l["a"])(t.plateOptions);try{for(n.s();!(o=n.n()).done;){var s=o.value;i.push({id:s.id,name:s.sector_name})}}catch(r){n.e(r)}finally{n.f()}a.children=i}return a})),console.log(t.styleOptions)}))},handleSizeChange:function(e){this.page=e,this.getData()},handleCurrentChange:function(e){this.page=e,this.getData()},goSearch:function(){var e=this;r({page:this.page,page_size:this.pageSize,template_class_id:"",component_name:this.componentName,sector_id:this.templateName}).then((function(t){console.log(t),e.tableData=t.data.data,e.total=t.data.total}))},goReset:function(){this.templateName="",this.componentName="",this.page=1,this.pageSize=10,this.getData()},addWebsite:function(){this.dialogTableVisible=!0,this.dialogName="添加",this.ruleForm.plateName="",this.ruleForm.component_name="",this.ruleForm.component_code="",this.ruleForm.component_img="",this.logoUrl=""},goEdit:function(e,t){this.dialogName="编辑",this.activeid=e,this.dialogTableVisible=!0,console.log(e,t),this.getList(),this.template_id=t.template_class_id,this.sector_id=t.sector_id,this.ruleForm.plateName=t.template_class_name,this.ruleForm.plateName=[t.template_class_id,t.sector_id],this.ruleForm.plateName=[this.template_id,this.sector_id],this.ruleForm.component_name=t.component_name,this.ruleForm.component_code=t.component_code,this.ruleForm.component_img=t.component_img,this.logoUrl=t.component_img},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&&c({template_id:this.template_id,sector_id:this.sector_id,component_name:this.ruleForm.component_name,component_img:this.ruleForm.component_img,component_code:this.ruleForm.component_code}).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&&m({id:this.activeid,component_name:this.ruleForm.component_name}).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,o="image/png"===e.type,i=e.size/1024/1024<2;if(!a&&!o)return this.$message.error("上传图片只能是 JPG 或 PNG 格式!"),!1;if(!i)return this.$message.error("上传图片大小不能超过 2MB!"),!1;var l=new FormData;return l.append("file",e),this.$store.dispatch("pool/uploadFile",l).then((function(e){t.logoUrl=e.data.imgUrl,t.ruleForm.component_img=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)}},mounted:function(){this.getData(),this.getList()}},h=g,b=(a("555c"),a("2877")),f=Object(b["a"])(h,o,i,!1,null,"277238a6",null);t["default"]=f.exports},4423:function(e,t,a){"use strict";a("9187")},"4b51":function(e,t,a){},"555c":function(e,t,a){"use strict";a("1d55")},6968:function(e,t,a){"use strict";a.r(t);var o=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=[],l={props:{name:{type:String,required:!0}},data:function(){return{someData:""}}},n=l,s=(a("4423"),a("2877")),r=Object(s["a"])(n,o,i,!1,null,"fe16b7a0",null);t["default"]=r.exports},"87e2":function(e,t,a){"use strict";a.d(t,"c",(function(){return i})),a.d(t,"a",(function(){return l})),a.d(t,"b",(function(){return n})),a.d(t,"d",(function(){return s}));var o=a("b775"),i=function(e){return Object(o["a"])({url:"/public/getSectorList",method:"post",data:e})},l=function(e){return Object(o["a"])({url:"/public/addSector",method:"post",data:e})},n=function(e){return Object(o["a"])({url:"/public/delSector",method:"post",data:e})},s=function(e){return Object(o["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 l})),a.d(t,"a",(function(){return n})),a.d(t,"b",(function(){return s})),a.d(t,"e",(function(){return r}));var o=a("b775"),i=function(e){return Object(o["a"])({url:"/public/getTemplateClass",method:"post",data:e})},l=function(e){return Object(o["a"])({url:"/public/getTemplateList",method:"post",data:e})},n=function(e){return Object(o["a"])({url:"/public/addTemplate",method:"post",data:e})},s=function(e){return Object(o["a"])({url:"/public/delTemplate",method:"post",data:e})},r=function(e){return Object(o["a"])({url:"/public/updateTemplate",method:"post",data:e})}}}]);
|