| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[98],{818:function(t,e,r){"use strict";r.r(e);var n=r(6),o=(r(30),{data:function(){return{list:[],special_list_seo:{},special_list_seo_dialog:!1}},mounted:function(){this.getList(),this.getConfig()},methods:{getConfig:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,data;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$post("/uapi/pub/getConfig",{key:"special_list_seo"});case 2:(r=e.sent)&&1===r.status&&(data=r.data,t.special_list_seo=JSON.parse(data));case 4:case"end":return e.stop()}}),e)})))()},getList:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$post("/uapi/news/special_list");case 2:(r=e.sent)&&1===r.status&&(t.list=r.data||[]);case 4:case"end":return e.stop()}}),e)})))()},set_config:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.special_list_seo,e.next=3,t.$post("/uapi/pub/setConfig",{key:"special_list_seo",value:JSON.stringify(r)});case 3:(n=e.sent)&&1===n.status&&t.$message({type:"success",message:"操作成功!"});case 5:case"end":return e.stop()}}),e)})))()},del:function(t){var e=this;return Object(n.a)(regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.$post("/uapi/news/special_del",{id:t});case 2:(n=r.sent)&&1===n.status&&(e.$message({type:"success",message:"操作成功!"}),e.getList());case 4:case"end":return r.stop()}}),r)})))()},status:function(t,e){var r=this;return Object(n.a)(regeneratorRuntime.mark((function n(){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,r.$post("/uapi/news/special_status",{status:e,id:t});case 2:(o=n.sent)&&1===o.status&&(r.$message({type:"success",message:"操作成功!"}),r.getList());case 4:case"end":return n.stop()}}),n)})))()},special_list_seo_dialog_show:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.special_list_seo_dialog=!0;case 1:case"end":return e.stop()}}),e)})))()}}}),l=r(4),component=Object(l.a)(o,(function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[e("el-button",{staticStyle:{"margin-top":"15px","margin-right":"30px",float:"left"},attrs:{type:"primary"},on:{click:function(e){return t.$router.push({path:"/main/special_add",query:{id:0}})}}},[t._v("添加专题")]),t._v(" "),e("el-button",{staticStyle:{"margin-top":"15px","margin-right":"30px",float:"left"},attrs:{type:"primary"},on:{click:t.special_list_seo_dialog_show}},[t._v("专题列表SEO配置")]),t._v(" "),e("div",{staticStyle:{clear:"both"}}),t._v(" "),e("div",{staticStyle:{"margin-bottom":"15px"}}),t._v(" "),e("div",[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.list,border:""}},[e("el-table-column",{attrs:{prop:"title",label:"标题"}}),t._v(" "),e("el-table-column",{attrs:{prop:"order",label:"排序"}}),t._v(" "),e("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(r){return[1==r.row.status?e("span",[t._v("已启用")]):t._e(),t._v(" "),2==r.row.status?e("span",{staticStyle:{color:"red"}},[t._v("已禁用")]):t._e()]}}])}),t._v(" "),e("el-table-column",{attrs:{prop:"addtime",label:"添加时间"}}),t._v(" "),e("el-table-column",{attrs:{prop:"ctrontorl",label:"操作",width:"320px"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.del(r.row.id)}}},[t._v("删除")]),t._v(" "),e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.$router.push({path:"/main/special_add",query:{id:r.row.id}})}}},[t._v("编辑")]),t._v(" "),1==r.row.status?e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.status(r.row.id,2)}}},[t._v("下架")]):t._e(),t._v(" "),2==r.row.status?e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.status(r.row.id,1)}}},[t._v("上架")]):t._e()]}}])})],1)],1),t._v(" "),e("el-dialog",{attrs:{title:"列表SEO配置",visible:t.special_list_seo_dialog,width:"500px"},on:{"update:visible":function(e){t.special_list_seo_dialog=e}}},[e("el-form",{attrs:{model:t.special_list_seo,"label-width":"70px"}},[e("el-form-item",{attrs:{label:"标题"}},[e("el-input",{attrs:{autocomplete:"off"},model:{value:t.special_list_seo.seo_title,callback:function(e){t.$set(t.special_list_seo,"seo_title",e)},expression:"special_list_seo.seo_title"}})],1),t._v(" "),e("el-form-item",{attrs:{label:"关键字"}},[e("el-input",{attrs:{autocomplete:"off"},model:{value:t.special_list_seo.seo_keywords,callback:function(e){t.$set(t.special_list_seo,"seo_keywords",e)},expression:"special_list_seo.seo_keywords"}})],1),t._v(" "),e("el-form-item",{attrs:{label:"描述"}},[e("el-input",{attrs:{autocomplete:"off"},model:{value:t.special_list_seo.seo_desc,callback:function(e){t.$set(t.special_list_seo,"seo_desc",e)},expression:"special_list_seo.seo_desc"}})],1)],1),t._v(" "),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"medium"},on:{click:function(e){t.special_list_seo_dialog=!1}}},[t._v("取消")]),t._v(" "),e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:t.set_config}},[t._v("确定")])],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);
|