(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a8a3dde"],{"45a2":function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}));var o=n("b775"),r=n("d722");function a(e){return Object(o["a"])({url:r["a"].pageList,method:"get",params:e})}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"post";return"post"==t?Object(o["a"])({url:r["a"].pageEdit,method:t,data:e}):Object(o["a"])({url:r["a"].pageEdit,method:t,params:e})}},b831:function(e,t,n){},be94:function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("el-card",{staticClass:"box-card"},[n("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[n("span",[e._v("编辑页面")]),n("el-button",{staticStyle:{float:"right",padding:"0","margin-left":"14px"},attrs:{type:"text"},on:{click:function(t){return e.goto("/sys/basic/page")}}},[e._v(" 返回 ")]),n("el-button",{staticStyle:{float:"right",padding:"0"},attrs:{type:"text"},on:{click:function(t){return e.onSubmit("form")}}},[e._v(" 保存 ")])],1),n("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.infoLoading,expression:"infoLoading"}],ref:"form",staticClass:"common-form",attrs:{model:e.form,"label-width":"80px","inline-message":!0}},[n("el-form-item",{attrs:{label:"页面名称",prop:"name"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{disabled:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),n("el-form-item",{attrs:{label:"缓存时长",prop:"expire"}},[n("el-input",{staticStyle:{width:"200px"},attrs:{type:"number",disabled:0==e.form.enable_cache},model:{value:e.form.expire,callback:function(t){e.$set(e.form,"expire",e._n(t))},expression:"form.expire"}},[n("template",{slot:"append"},[e._v("秒")])],2)],1),n("el-form-item",{attrs:{label:"seo标题",prop:"seo_title"}},[n("el-input",{attrs:{id:"seo_title"},model:{value:e.form.seo_title,callback:function(t){e.$set(e.form,"seo_title",t)},expression:"form.seo_title"}}),n("br"),e._l(e.form.params,(function(t,o){return n("el-tag",{key:o,attrs:{type:"info"},on:{click:function(n){return e.handlerTagToTitle(t.value)}}},[e._v(e._s(t.name))])}))],2),n("el-form-item",{attrs:{label:"seo关键词",prop:"seo_keywords"}},[n("el-input",{attrs:{id:"seo_keywords"},model:{value:e.form.seo_keywords,callback:function(t){e.$set(e.form,"seo_keywords",t)},expression:"form.seo_keywords"}}),n("br"),e._l(e.form.params,(function(t,o){return n("el-tag",{key:o,attrs:{type:"info"},on:{click:function(n){return e.handlerTagToKeywords(t.value)}}},[e._v(e._s(t.name))])}))],2),n("el-form-item",{attrs:{label:"seo描述",prop:"seo_description"}},[n("el-input",{attrs:{id:"seo_description",type:"textarea",rows:"4"},model:{value:e.form.seo_description,callback:function(t){e.$set(e.form,"seo_description",t)},expression:"form.seo_description"}}),n("br"),e._l(e.form.params,(function(t,o){return n("el-tag",{key:o,attrs:{type:"info"},on:{click:function(n){return e.handlerTagToDescription(t.value)}}},[e._v(e._s(t.name))])}))],2),n("el-form-item",{attrs:{label:""}},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onSubmit("form")}}},[e._v("保存")]),n("el-button",{on:{click:function(t){return e.goto("/sys/basic/page")}}},[e._v("返回")])],1)],1)],1)],1)},r=[],a=(n("96cf"),n("1da1")),i=n("5530"),s=n("45a2"),c={data:function(){return{form:{id:"",expire:"",seo_title:"",seo_keywords:"",seo_description:""}}},created:function(){this.fetchInfo()},methods:{fetchInfo:function(){var e=this;this.infoLoading=!0,Object(s["a"])({id:this.$route.query.id},"get").then((function(t){e.form=Object(i["a"])({},t.data.info),e.infoLoading=!1})).catch((function(){}))},onSubmit:function(e){var t=this,n=this,o=Object(i["a"])({},this.form);Object(s["a"])(o).then((function(e){return t.$message.success(e.message),setTimeout((function(){n.$router.push("/sys/basic/page")}),1500),!0})).catch((function(){}))},goto:function(e){this.$router.push(e)},insertVariable:function(e,t){var n=this;return Object(a["a"])(regeneratorRuntime.mark((function o(){var r,a,i;return regeneratorRuntime.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(r=document.querySelector("#"+e),!r.selectionStart&&0!==r.selectionStart){o.next=11;break}return a=r.selectionStart,i=r.selectionEnd,n.form[e]=r.value.substring(0,a)+t+r.value.substring(i,r.value.length),o.next=7,n.$nextTick();case 7:r.focus(),r.setSelectionRange(i+t.length,i+t.length),o.next=12;break;case 11:n.form[e]=t;case 12:case"end":return o.stop()}}),o)})))()},handlerTagToTitle:function(e){e="{"+e+"}",this.insertVariable("seo_title",e)},handlerTagToKeywords:function(e){e="{"+e+"}",this.insertVariable("seo_keywords",e)},handlerTagToDescription:function(e){e="{"+e+"}",this.insertVariable("seo_description",e)}}},l=c,u=(n("de15"),n("2877")),f=Object(u["a"])(l,o,r,!1,null,"320c0fdb",null);t["default"]=f.exports},de15:function(e,t,n){"use strict";var o=n("b831"),r=n.n(o);r.a}}]);