webpackJsonp([36],{BhMK:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=r("mvHQ"),o=r.n(a),n=(r("ftAF"),{created:function(){var t=this;this.$route.query.id&&this.$http.get({url:"/hotSearch/getOne",data:{id:this.$route.query.id}}).then(function(e){e.success&&(t.formData=e.data)})},data:function(){return{saving:!1,formData:{},rules:{keyWord:[{required:!0,message:"请输入关键词",trigger:"blur"}]}}},methods:{onSave:function(){var t=this;this.$refs.form.validate(function(e){if(!e)return!1;t.submit()})},submit:function(){var t=this,e=JSON.parse(o()(this.formData));this.$http.post({url:this.formData.id?"/hotSearch/update":"/hotSearch/save",data:e}).then(function(e){e.success?(t.$message.success("成功"),t.$router.go(-1)):t.$message.warning("失败")})},onDelete:function(){var t=this;this.$alert("删除将无法恢复，确认要删除么？","警告",{type:"error"}).then(function(){return t.$http.post({url:"/hotSearch/del",data:{id:t.formData.id}})}).then(function(){t.$message.success("删除成功"),t.$router.go(-1)}).catch(function(e){"cancel"===e?t.$message.info("删除取消"):t.$message.error("删除失败")})}}}),s={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("el-form",{ref:"form",staticStyle:{"max-width":"500px"},attrs:{model:t.formData,rules:t.rules,"label-width":"80px","label-position":"right",size:"small"}},[r("el-form-item",{attrs:{prop:"keyWord",label:"关键词"}},[r("el-input",{model:{value:t.formData.keyWord,callback:function(e){t.$set(t.formData,"keyWord",e)},expression:"formData.keyWord"}})],1),t._v(" "),r("el-form-item",{attrs:{prop:"hot",label:"热度"}},[r("el-input",{model:{value:t.formData.hot,callback:function(e){t.$set(t.formData,"hot",e)},expression:"formData.hot"}})],1),t._v(" "),r("el-form-item",[r("el-button",{attrs:{loading:t.$store.state.fetchingData,type:"primary"},on:{click:t.onSave}},[t._v("保存")]),t._v(" "),t.formData.id?r("el-button",{attrs:{type:"danger"},on:{click:t.onDelete}},[t._v("删除")]):t._e(),t._v(" "),r("el-button",{on:{click:function(e){t.$router.go(-1)}}},[t._v("取消")])],1)],1)],1)},staticRenderFns:[]};var i=r("VU/8")(n,s,!1,function(t){r("uQNG")},"data-v-697cd5c2",null);e.default=i.exports},uQNG:function(t,e){}});
//# sourceMappingURL=36.5e2e3763d7fc142b02a8.js.map