1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5b011e38"],{"24c7":function(e,t,a){"use strict";a("c7f3")},"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="},3579:function(e,t,a){},"4b51":function(e,t,a){},6953:function(e,t,a){"use strict";a("3579")},c7f3:function(e,t,a){},e76f: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:""}}},r=o,s=(a("24c7"),a("2877")),n=Object(s["a"])(r,l,i,!1,null,"16610408",null);t["default"]=n.exports},ef6c: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:{multiple:!1,"multiple-limit":1,filterable:"",remote:"","reserve-keyword":"",placeholder:"请输入所属站点","remote-method":e.getWebNavList,loading:e.webSiteLoading},on:{change:e.selectWebSite},model:{value:e.siteName,callback:function(t){e.siteName=t},expression:"siteName"}},e._l(e.webSiteList,(function(e){return l("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)]),l("el-col",{staticClass:"left",attrs:{span:6}},[l("div",{staticClass:"searchBox"},[l("div",{staticClass:"searchTitle"},[e._v("链接名称")]),l("el-input",{attrs:{placeholder:"请输入链接名称"},model:{value:e.webName,callback:function(t){e.webName=t},expression:"webName"}})],1)]),l("el-col",{staticClass:"right",attrs:{span:10}},[l("div",{staticClass:"btnList"},[l("button",{staticClass:"search",on:{click:e.goSearch}},[e._v("搜索")]),l("button",{staticClass:"reset",on:{click:e.reset}},[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",{staticClass:"my-table",staticStyle:{width:"100%"},attrs:{data:e.tableData}},[l("el-table-column",{attrs:{fixed:"",prop:"id",label:"编号",width:"70"}}),l("el-table-column",{attrs:{prop:"website_name",label:"关联网站",width:"180"}}),l("el-table-column",{attrs:{prop:"title",label:"链接名称",width:"160"}}),l("el-table-column",{attrs:{prop:"url",label:"链接网址",width:"180"}}),l("el-table-column",{attrs:{prop:"type",label:"类型",width:"90"}}),l("el-table-column",{attrs:{label:"网站LOGO",width:"150"},scopedSlots:e._u([{key:"default",fn:function(e){return[l("img",{staticClass:"uploadImage",attrs:{src:e.row.logo_url,alt:""}})]}}])}),l("el-table-column",{attrs:{prop:"sort",label:"排序",width:"90"}}),l("el-table-column",{attrs:{prop:"created_at",label:"创建时间",width:"180"}}),l("el-table-column",{attrs:{prop:"updated_at",label:"修改时间",width:"180"}}),l("el-table-column",{attrs:{fixed:"right",label:"操作",width:"220"},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,t.row)}}},[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%","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":"100px"}},[l("div",{staticClass:"dialogText"},[l("el-form-item",{attrs:{label:"关联网站:",prop:"correlationWeb"}},[l("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.correlationWeb,callback:function(t){e.$set(e.ruleForm,"correlationWeb",t)},expression:"ruleForm.correlationWeb"}},e._l(e.webSiteList,(function(e){return l("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),l("el-form-item",{attrs:{label:"链接名称:",prop:"webName"}},[l("el-input",{attrs:{placeholder:"请输入链接名称"},model:{value:e.ruleForm.webName,callback:function(t){e.$set(e.ruleForm,"webName",t)},expression:"ruleForm.webName"}})],1),l("el-form-item",{attrs:{label:"链接地址:",prop:"webUrl"}},[l("el-input",{attrs:{placeholder:"请输入链接地址"},model:{value:e.ruleForm.webUrl,callback:function(t){e.$set(e.ruleForm,"webUrl",t)},expression:"ruleForm.webUrl"}})],1),l("el-form-item",{attrs:{label:"类型:",prop:"type"}},[l("el-radio",{attrs:{label:"1"},model:{value:e.ruleForm.type,callback:function(t){e.$set(e.ruleForm,"type",t)},expression:"ruleForm.type"}},[e._v("图片")]),l("el-radio",{attrs:{label:"2"},model:{value:e.ruleForm.type,callback:function(t){e.$set(e.ruleForm,"type",t)},expression:"ruleForm.type"}},[e._v("文本")]),l("el-radio",{attrs:{label:"3"},model:{value:e.ruleForm.type,callback:function(t){e.$set(e.ruleForm,"type",t)},expression:"ruleForm.type"}},[e._v("底部")])],1),l("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"2"!=this.ruleForm.type,expression:"this.ruleForm.type != '2'"}],staticClass:"custom-align-right",class:["custom-form-item"],attrs:{label:"网站logo:",prop:"","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}},[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.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?l("div",{staticClass:"delete-button",on:{click:e.handleDelete}},[l("i",{staticClass:"el-icon-delete"})]):e._e()],1)])]),l("el-form-item",{attrs:{label:"网站介绍:",prop:""}},[l("el-input",{attrs:{type:"textarea",rows:3,placeholder:"请输入网站介绍",resize:"none"},model:{value:e.ruleForm.webDesc,callback:function(t){e.$set(e.ruleForm,"webDesc",t)},expression:"ruleForm.webDesc"}})],1),l("el-form-item",{attrs:{label:"排序:",prop:"sort"}},[l("el-input",{attrs:{placeholder:"请输入排序"},model:{value:e.ruleForm.sort,callback:function(t){e.$set(e.ruleForm,"sort",t)},expression:"ruleForm.sort"}})],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:e.submitForm}},[e._v("提交")])],1)])],1)],1)},i=[],o=a("b85c"),r=a("ade3"),s=(a("4e82"),a("e76f")),n=(a("4b51"),a("b775")),c=function(e){return Object(n["a"])({url:"/link/getLinkList",method:"get",params:e})},u=function(e){return Object(n["a"])({url:"/link/createLink",method:"post",data:e})},b=function(e){return Object(n["a"])({url:"/link/delLink",method:"post",data:e})},m=function(e){return Object(n["a"])({url:"/link/updateLink",method:"post",data:e})},d={components:{tableTitle:s["default"]},data:function(){var e,t=function(e,t,a){0==t.length?a(new Error("该项不能为空!")):a()};return e={tableDivTitle:"友情链接列表",webName:"",activeId:"",activeType:"",disabled:!0,siteName:""},Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(e,"webName",""),"logoUrl",""),"hovering",!1),"total",0),"page",1),"pageSize",10),"tableData",[]),"dialogTableVisible",!1),"dialogName",""),"webSiteList",[]),Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(Object(r["a"])(e,"webSiteLoading",!1),"options",[]),"value",[]),"list",[]),"value",""),"radio","1"),"textarea",""),"formLabelWidth","120px"),"website_id",""),"ruleForm",{correlationWeb:"",webName:"",webUrl:"",type:"1",webLogo:"",webDesc:"",sort:""}),Object(r["a"])(e,"rules",{correlationWeb:[{required:!0,trigger:"blur",validator:t}],webName:[{required:!0,trigger:"blur",validator:t}],webUrl:[{required:!0,trigger:"blur",validator:t}],type:[{required:!0,trigger:"blur",validator:t}],sort:[{required:!0,trigger:"blur",validator:t}]})},methods:{getData:function(){var e=this;c({page:this.page,pageSize:this.pageSize}).then((function(t){console.log(t),e.tableData=t.data.rows,e.total=t.data.count;var a,l=Object(o["a"])(e.tableData);try{for(l.s();!(a=l.n()).done;){var i=a.value;"1"==i.type?i.type="图片":"2"==i.type?i.type="文字":"3"==i.type&&(i.type="底部")}}catch(r){l.e(r)}finally{l.f()}}))},deleteRow:function(e,t){var a=this;this.activeId=e,this.$confirm("注意:删除后,该条信息及其绑定关系全部删除","是否确认删除该条信息?",{confirmButtonText:"确定",cancelButtonText:"取消"}).then((function(){console.log("当前删除:"+e),b({id:a.activeId}).then((function(e){console.log(e),200==e.code?(a.$message({type:"success",message:"删除成功!"}),a.getData()):0==e.code&&a.$message({type:"error",message:e.message})}))})).catch((function(){a.$message({type:"warning",message:"已取消"})}))},handleSizeChange:function(e){this.page=e,this.getData()},handleCurrentChange:function(e){this.page=e,this.getData()},goSearch:function(){var e=this;c({page:this.page,pageSize:this.pageSize,website_id:this.siteName,title:this.webName}).then((function(t){console.log(t),e.tableData=t.data.rows,e.total=t.data.count;var a,l=Object(o["a"])(e.tableData);try{for(l.s();!(a=l.n()).done;){var i=a.value;"1"==i.type?i.type="图片":"2"==i.type?i.type="文字":"3"==i.type&&(i.type="底部")}}catch(r){l.e(r)}finally{l.f()}}))},reset:function(){this.siteName="",this.webName="",this.getData()},addWebsite:function(){this.dialogTableVisible=!0,this.dialogName="添加",this.ruleForm.correlationWeb="",this.ruleForm.webName="",this.ruleForm.webUrl="",this.ruleForm.type="1",this.logoUrl="http://183.131.25.186:9501/image/20241225/17350893036168.png",this.ruleForm.webLogo="http://183.131.25.186:9501/image/20241225/17350893036168.png",this.ruleForm.webDesc="",this.ruleForm.sort=0},goEdit:function(e,t){this.dialogTableVisible=!0,this.dialogName="编辑",console.log(e,t),this.activeId=e,this.website_id=t.website_id,this.ruleForm.correlationWeb=t.website_name,this.ruleForm.webName=t.title,this.ruleForm.webUrl=t.url,this.ruleForm.webLogo=t.logo_url,this.logoUrl=t.logo_url,this.ruleForm.webDesc=t.describe,this.ruleForm.sort=t.sort,"图片"==t.type?this.ruleForm.type="1":"文字"==t.type?this.ruleForm.type="2":"底部"==t.type&&(this.ruleForm.type="3")},submitForm:function(){var e=this;if(""!=this.ruleForm.correlationWeb){if("添加"==this.dialogName&&("2"==this.ruleForm.type?u({title:this.ruleForm.webName,website_id:this.website_id,sort:this.ruleForm.sort,url:this.ruleForm.webUrl,type:this.ruleForm.type,logo_url:"",describe:this.ruleForm.webDesc}).then((function(t){console.log(t),200==t.code?(e.$message({message:"添加成功",type:"success"}),e.dialogTableVisible=!1,e.getData()):e.$message.error(t.message)})):u({title:this.ruleForm.webName,website_id:this.website_id,sort:this.ruleForm.sort,url:this.ruleForm.webUrl,type:this.ruleForm.type,logo_url:this.ruleForm.webLogo,describe:this.ruleForm.webDesc}).then((function(t){console.log(t),200==t.code?(e.$message({message:"添加成功",type:"success"}),e.dialogTableVisible=!1,e.getData()):e.$message.error(t.message)}))),"编辑"==this.dialogName){if(" "==this.website_id)return this.$message.error("请输入并选择关联网站"),void(this.dialogTableVisible=!0);"2"==this.ruleForm.type?m({title:this.ruleForm.webName,website_id:this.website_id,sort:this.ruleForm.sort,url:this.ruleForm.webUrl,type:this.ruleForm.type,logo_url:"",describe:this.ruleForm.webDesc,id:this.activeId}).then((function(t){console.log(t),200==t.code?(e.$message({message:"修改成功",type:"success"}),e.dialogTableVisible=!1,e.getData()):e.$message({message:t.message,type:"error"})})):m({title:this.ruleForm.webName,website_id:this.website_id,sort:this.ruleForm.sort,url:this.ruleForm.webUrl,type:this.ruleForm.type,logo_url:this.ruleForm.webLogo,describe:this.ruleForm.webDesc,id:this.activeId}).then((function(t){console.log(t),200==t.code?(e.$message({message:"修改成功",type:"success"}),e.dialogTableVisible=!1,e.getData()):e.$message({message:t.message,type:"error"})}))}}else this.$message.error("请输入并选择关联网站名称")},cancelForm:function(){this.dialogTableVisible=!1},beforeAvatarUpload:function(e){var t=this;console.log(e);var 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){console.log("res",e),t.logoUrl=e.data.imgUrl,t.ruleForm.webLogo=e.data.imgUrl,console.log(e.data.imgUrl)})).catch((function(){t.$message({type:"info",message:"网络错误,请重试!"})})),!1},handleDelete:function(){this.logoUrl=""},selectWebSite:function(e){this.siteName=e},detectionWebSite:function(e){console.log(e),this.website_id=e},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 r=a.value,s={};s.key=r.id,s.value=r.id,s.label=r.website_name,l.push(s)}}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()}},p=d,g=(a("6953"),a("2877")),h=Object(g["a"])(p,l,i,!1,null,"1db9ece1",null);t["default"]=h.exports}}]);
|