You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
5.6 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-53f17d3b"],{6818:function(t,e,a){},bb5e:function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container"},[a("el-button",{staticStyle:{"margin-bottom":"15px"},attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(e){return t.goAdd()}}},[t._v(" "+t._s(t.$t("添加"))+" ")]),a("BaseTable",{ref:"baseTable",attrs:{request:t.request,"row-key":"id",indent:20},on:{success:t.tableSuccess}},[a("el-table-column",{attrs:{label:"ID",prop:"id",width:"160px"}}),a("el-table-column",{attrs:{label:t.$t("网站名称"),prop:"title","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:t.$t("网站域名"),prop:"domain","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-link",{attrs:{href:"http://"+e.row.domain,target:"_blank"}},[t._v(" "+t._s(e.row.domain)+" ")])]}}])}),a("el-table-column",{attrs:{label:t.$t("网站状态"),prop:"status",width:"180px"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":2,"active-text":t.$t("正常"),"inactive-text":t.$t("禁用"),"active-color":"var(--huocms-com-color-primary)","inactive-color":"rgba(0,0,0,0.2)"},on:{change:function(a){return t.disableUser(e.row)}},model:{value:e.row.status,callback:function(a){t.$set(e.row,"status",a)},expression:"scope.row.status"}})]}}])}),a("el-table-column",{attrs:{label:t.$t("操作"),fixed:"right",width:"150px",align:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("EditBtn",{on:{click:function(a){return t.editor(e.row)}}}),a("DelBtn",{attrs:{"confirm-content":t.$t("是否删除站点")},on:{success:function(a){return t.del(e.row)}}}),a("BaseDropdown",{on:{command:function(a){return t.handleCommand(a,e.row)}}},[[a("el-dropdown-item",{attrs:{command:"map"}},[t._v(" "+t._s(t.$t("生成sitemap"))+" ")]),a("el-dropdown-item",{attrs:{command:"child"}},[t._v(" "+t._s(t.$t("添加子站点"))+" ")])]],2)]}}])})],1),a("BaseDialog",{attrs:{title:t.addForm.id?t.$t("编辑"):t.$t("添加"),"dialog-show":t.dialogShow,width:"50%",footer:""},on:{"update:dialogShow":function(e){t.dialogShow=e},"update:dialog-show":function(e){t.dialogShow=e},submit:t.submit}},[a("el-form",{ref:"addForm",staticClass:"addForm",attrs:{model:t.addForm,rules:t.rules,"label-position":"top"}},[a("el-form-item",{attrs:{label:t.$t("上级站点"),prop:"parent_id"}},[a("el-select",{attrs:{disabled:!!t.addForm.id},on:{change:t.changeParent},model:{value:t.addForm.parent_id,callback:function(e){t.$set(t.addForm,"parent_id",e)},expression:"addForm.parent_id"}},[a("el-option",{attrs:{label:t.$t("作为上一级"),value:0}}),t._l(t.tableData,(function(t){return a("el-option",{key:t.id,attrs:{label:t.domain+"--"+t.title,value:t.id}})}))],2)],1),a("el-form-item",{attrs:{label:t.$t("网站名称"),prop:"title"}},[a("el-input",{model:{value:t.addForm.title,callback:function(e){t.$set(t.addForm,"title",e)},expression:"addForm.title"}})],1),a("el-form-item",{attrs:{label:t.$t("网站域名"),prop:"domain"}},[a("el-input",{model:{value:t.addForm.domain,callback:function(e){t.$set(t.addForm,"domain",e)},expression:"addForm.domain"}})],1),a("el-form-item",{attrs:{label:t.$t("状态")}},[a("el-select",{model:{value:t.addForm.status,callback:function(e){t.$set(t.addForm,"status",e)},expression:"addForm.status"}},[a("el-option",{attrs:{label:t.$t("正常"),value:1}}),a("el-option",{attrs:{label:t.$t("禁用"),value:2}})],1)],1)],1)],1)],1)},i=[],s=a("5530"),n=(a("14d9"),a("37cb")),d={data:function(){return{request:n["a"].websiteList,loading:!1,tableData:[],dialogShow:!1,addForm:{id:"",title:"",domain:"",status:"",parent_id:"0"},rules:{title:[{required:"true",message:this.$t("请输入网站名称"),trigger:"blur"}],domain:[{required:"true",message:this.$t("请输入网站域名"),trigger:"blur"}]},id:""}},created:function(){},methods:{handleCommand:function(t,e){switch(t){case"child":this.goAdd(e);break;case"map":this.siteMap(e);break}},tableSuccess:function(t){this.tableData=t.data},siteMap:function(t){var e=this;this.loading=!0,n["a"].sitemap({website_id:t.id}).then((function(t){0==t.code&&(e.$message.success(t.msg),window.open(t.data)),e.loading=!1}))},disableUser:function(t){var e=this,a={id:t.id,title:t.title,domain:t.domain,status:t.status};n["a"].setStatus(a).then((function(t){0==t.code&&(e.$message.success(t.msg),e.$refs.baseTable.getList())}))},goAdd:function(t){this.id="",this.addForm={},this.addForm.parent_id=t?t.id:0,this.addForm.status=1,this.dialogShow=!0},changeParent:function(t){this.$forceUpdate()},editor:function(t){this.addForm={title:t.title,domain:t.domain,status:t.status,id:t.id,parent_id:t.parent_id},this.dialogShow=!0},submit:function(){var t=this;this.$refs.addForm.validate((function(e){e?t.addForm.id?n["a"].websiteUpdate(Object(s["a"])({},t.addForm)).then((function(e){0==e.code&&(t.$message.success(e.msg),t.dialogShow=!1,t.getWebList(),t.$refs.baseTable.getList())})):n["a"].websiteSave(Object(s["a"])({},t.addForm)).then((function(e){0==e.code&&(t.$message.success(e.msg),t.dialogShow=!1,t.getWebList(),t.$refs.baseTable.getList())})):t.$message.error(t.$t("请填写必要信息"))}))},getWebList:function(){var t=this;n["a"].websiteList().then((function(e){t.$store.commit("tagsView/WEBLIST",e.data)}))},check:function(t){this.$router.push({name:"modelField",query:{id:t.id}})},del:function(t){var e=this;n["a"].websiteDelete({id:t.id}).then((function(t){0==t.code&&(e.$message.success(t.msg),e.$refs.baseTable.getList())}))}}},r=d,l=(a("df49"),a("2877")),c=Object(l["a"])(r,o,i,!1,null,"56087186",null);e["default"]=c.exports},df49:function(t,e,a){"use strict";a("6818")}}]);