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 line
12 KiB
1 line
12 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d237792"],{faef:function(e,t,n){"use strict";n.r(t);var l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"68px"}},[n("el-form-item",{attrs:{label:"所属栏目",prop:"categoryId"}},[n("el-input",{attrs:{placeholder:"请输入所属栏目",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.categoryId,callback:function(t){e.$set(e.queryParams,"categoryId",t)},expression:"queryParams.categoryId"}})],1),n("el-form-item",{attrs:{label:"文章标题",prop:"contentTitle"}},[n("el-input",{attrs:{placeholder:"请输入文章标题",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.contentTitle,callback:function(t){e.$set(e.queryParams,"contentTitle",t)},expression:"queryParams.contentTitle"}})],1),n("el-form-item",{attrs:{label:"发布时间",prop:"contentDatetime"}},[n("el-date-picker",{attrs:{clearable:"",type:"date","value-format":"yyyy-MM-dd",placeholder:"请选择发布时间"},model:{value:e.queryParams.contentDatetime,callback:function(t){e.$set(e.queryParams,"contentDatetime",t)},expression:"queryParams.contentDatetime"}})],1),n("el-form-item",{attrs:{label:"删除标记",prop:"del"}},[n("el-input",{attrs:{placeholder:"请输入删除标记",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.del,callback:function(t){e.$set(e.queryParams,"del",t)},expression:"queryParams.del"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),n("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),n("el-row",{staticClass:"mb8",attrs:{gutter:10}},[n("el-col",{attrs:{span:1.5}},[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["cms:content:add"],expression:"['cms:content:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),n("el-col",{attrs:{span:1.5}},[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["cms:content:edit"],expression:"['cms:content:edit']"}],attrs:{type:"success",plain:"",icon:"el-icon-edit",size:"mini",disabled:e.single},on:{click:e.handleUpdate}},[e._v("修改")])],1),n("el-col",{attrs:{span:1.5}},[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["cms:content:remove"],expression:"['cms:content:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:e.multiple},on:{click:e.handleDelete}},[e._v("删除")])],1),n("el-col",{attrs:{span:1.5}},[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["cms:content:export"],expression:"['cms:content:export']"}],attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini"},on:{click:e.handleExport}},[e._v("导出")])],1),n("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.contentList},on:{"selection-change":e.handleSelectionChange}},[n("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),n("el-table-column",{attrs:{label:"",align:"center",prop:"id"}}),n("el-table-column",{attrs:{label:"所属栏目",align:"center",prop:"categoryId"}}),n("el-table-column",{attrs:{label:"文章标题",align:"center",prop:"contentTitle"}}),n("el-table-column",{attrs:{label:"文章来源",align:"center",prop:"contentSource"}}),n("el-table-column",{attrs:{label:"文章作者",align:"center",prop:"contentAuthor"}}),n("el-table-column",{attrs:{label:"发布时间",align:"center",prop:"contentDatetime",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e.parseTime(t.row.contentDatetime,"{y}-{m}-{d}")))])]}}])}),n("el-table-column",{attrs:{label:"点击次数",align:"center",prop:"contentHit"}}),n("el-table-column",{attrs:{label:"文章为链接",align:"center",prop:"contentOutLink"}}),n("el-table-column",{attrs:{label:"修改时间",align:"center",prop:"updateDate",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e.parseTime(t.row.updateDate,"{y}-{m}-{d}")))])]}}])}),n("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["cms:content:edit"],expression:"['cms:content:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(n){return e.handleUpdate(t.row)}}},[e._v("修改")]),n("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["cms:content:remove"],expression:"['cms:content:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(n){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),n("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),n("el-dialog",{attrs:{title:e.title,visible:e.open,width:"880px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[n("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"90px"}},[n("el-form-item",{attrs:{label:"所属栏目",prop:"categoryId"}},[n("el-select",{attrs:{placeholder:"请选择所属栏目"},model:{value:e.form.categoryId,callback:function(t){e.$set(e.form,"categoryId",t)},expression:"form.categoryId"}},e._l(e.dict.type.cms_column,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),n("el-form-item",{attrs:{label:"文章标题",prop:"contentTitle"}},[n("el-input",{attrs:{placeholder:"请输入文章标题"},model:{value:e.form.contentTitle,callback:function(t){e.$set(e.form,"contentTitle",t)},expression:"form.contentTitle"}})],1),n("el-form-item",{attrs:{label:"文章副标题",prop:"contentShortTitle"}},[n("el-input",{attrs:{placeholder:"请输入文章副标题"},model:{value:e.form.contentShortTitle,callback:function(t){e.$set(e.form,"contentShortTitle",t)},expression:"form.contentShortTitle"}})],1),n("el-form-item",{attrs:{label:"文章内容",prop:"contentDetails"}},[n("editor",{attrs:{"min-height":192},model:{value:e.form.contentDetails,callback:function(t){e.$set(e.form,"contentDetails",t)},expression:"form.contentDetails"}})],1),n("el-form-item",{attrs:{label:"关键字",prop:"contentKeyword"}},[n("el-input",{attrs:{placeholder:"请输入关键字"},model:{value:e.form.contentKeyword,callback:function(t){e.$set(e.form,"contentKeyword",t)},expression:"form.contentKeyword"}})],1),n("el-form-item",{attrs:{label:"描述",prop:"contentDescription"}},[n("el-input",{attrs:{type:"textarea",placeholder:"请输入描述"},model:{value:e.form.contentDescription,callback:function(t){e.$set(e.form,"contentDescription",t)},expression:"form.contentDescription"}})],1),n("el-form-item",{attrs:{label:"文章缩略图",prop:"contentImg"}},[n("image-upload",{model:{value:e.form.contentImg,callback:function(t){e.$set(e.form,"contentImg",t)},expression:"form.contentImg"}})],1),n("el-form-item",{attrs:{label:"文章来源",prop:"contentSource"}},[n("el-input",{attrs:{placeholder:"请输入文章来源"},model:{value:e.form.contentSource,callback:function(t){e.$set(e.form,"contentSource",t)},expression:"form.contentSource"}})],1),n("el-form-item",{attrs:{label:"文章作者",prop:"contentAuthor"}},[n("el-input",{attrs:{placeholder:"请输入文章作者"},model:{value:e.form.contentAuthor,callback:function(t){e.$set(e.form,"contentAuthor",t)},expression:"form.contentAuthor"}})],1),n("el-form-item",{attrs:{label:"是否显示",prop:"contentDisplay"}},[n("el-select",{attrs:{placeholder:"请选择是否显示"},model:{value:e.form.contentDisplay,callback:function(t){e.$set(e.form,"contentDisplay",t)},expression:"form.contentDisplay"}},e._l(e.dict.type.sys_yes_no,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),n("el-form-item",{attrs:{label:"发布时间",prop:"contentDatetime"}},[n("el-date-picker",{attrs:{clearable:"",type:"date","value-format":"yyyy-MM-dd",placeholder:"请选择发布时间"},model:{value:e.form.contentDatetime,callback:function(t){e.$set(e.form,"contentDatetime",t)},expression:"form.contentDatetime"}})],1),n("el-form-item",{attrs:{label:"文章外链接",prop:"contentOutLink"}},[n("el-input",{attrs:{placeholder:"请输入文章外链接"},model:{value:e.form.contentOutLink,callback:function(t){e.$set(e.form,"contentOutLink",t)},expression:"form.contentOutLink"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),n("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},o=[],a=n("5530"),r=(n("d81d"),n("b775"));function i(e){return Object(r["a"])({url:"/cms/content/list",method:"get",params:e})}function c(e){return Object(r["a"])({url:"/cms/content/"+e,method:"get"})}function s(e){return Object(r["a"])({url:"/cms/content",method:"post",data:e})}function u(e){return Object(r["a"])({url:"/cms/content",method:"put",data:e})}function m(e){return Object(r["a"])({url:"/cms/content/"+e,method:"delete"})}var p={name:"Content",dicts:["cms_column","sys_yes_no"],data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,contentList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,categoryId:null,contentDetails:null,contentTitle:null,contentShortTitle:null,contentKeyword:null,contentDescription:null,contentImg:null,contentSource:null,contentAuthor:null,contentDisplay:null,contentType:null,contentDatetime:null,contentSort:null,contentTags:null,contentHit:null,contentOutLink:null,hasDetailHtml:null,updateDate:null,hasListHtml:null,createDate:null,del:null},form:{},rules:{}}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.loading=!0,i(this.queryParams).then((function(t){e.contentList=t.rows,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:null,categoryId:null,contentDetails:null,contentTitle:null,contentShortTitle:null,contentKeyword:null,contentDescription:null,contentImg:null,contentSource:null,contentAuthor:null,contentDisplay:null,contentType:null,contentDatetime:null,contentSort:null,contentTags:null,contentHit:null,contentOutLink:null,hasDetailHtml:null,updateDate:null,hasListHtml:null,updateBy:null,createDate:null,createBy:null,del:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title="添加文章"},handleUpdate:function(e){var t=this;this.reset();var n=e.id||this.ids;c(n).then((function(e){t.form=e.data,t.open=!0,t.title="修改文章"}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.id?u(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()})):s(e.form).then((function(t){e.$modal.msgSuccess("新增成功"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,n=e.id||this.ids;this.$modal.confirm('是否确认删除文章编号为"'+n+'"的数据项?').then((function(){return m(n)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("cms/content/export",Object(a["a"])({},this.queryParams),"content_".concat((new Date).getTime(),".xlsx"))}}},d=p,f=n("2877"),h=Object(f["a"])(d,l,o,!1,null,null,null);t["default"]=h.exports}}]); |