chunk-a88b7d08.a2097c8a.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a88b7d08"],{"206d":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAJ5JREFUWAnt2DEKwDAMA8Ck9Cl9e/Ko9i8uXrUIBQ8eVMhgUEW4Zggdo+jZe7+5iurGXVUUEU9VV/ZclWWVXd6Yqmkxi6kCat5nzGKqgJr3GbOYKqDm256xmbfO6kueqoP5OefXVgw3ezyvtSLXcQG82FbMG4MvRUeLUSIIWAxA6GgxSgQBiwEIHS1GiSBgMQChY1uxsn+weR2mDELgB3FmFp5YffVrAAAAAElFTkSuQmCC"},3305:function(t,e,a){"use strict";a("9208")},4091:function(t,e,a){},"472f":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"ele-body"},[a("el-card",{attrs:{shadow:"never"}},[a("el-form",{staticClass:"ele-form-search",attrs:{model:t.table.where,"label-width":"77px"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.table.reload()},submit:function(t){t.preventDefault()}}},[a("el-row",{attrs:{gutter:15}},[a("el-col",{attrs:{md:6,sm:12}},[a("el-form-item",{attrs:{label:"标题:"}},[a("el-input",{attrs:{placeholder:"请输入文章标题关键词",clearable:""},model:{value:t.table.where.title,callback:function(e){t.$set(t.table.where,"title",e)},expression:"table.where.title"}})],1)],1),a("el-col",{attrs:{md:6,sm:12}},[a("el-form-item",{attrs:{label:"状态:"}},[a("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择状态",clearable:""},model:{value:t.table.where.status,callback:function(e){t.$set(t.table.where,"status",e)},expression:"table.where.status"}},[a("el-option",{attrs:{label:"全部",value:"0"}}),a("el-option",{attrs:{label:"已发布",value:"1"}}),a("el-option",{attrs:{label:"待发布",value:"2"}})],1)],1)],1),a("el-col",{attrs:{md:6,sm:12}},[a("div",{staticClass:"ele-form-actions"},[a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.$refs.table.reload()}}},[t._v("查询 ")]),a("el-button",{on:{click:function(e){(t.table.where={type:2})&&t.$refs.table.reload()}}},[t._v("重置")])],1)])],1)],1),a("div",{staticClass:"ele-table-tool ele-table-tool-default"},[t.permission.includes("sys:article_page:add")?a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:function(e){t.showEdit=!0}}},[t._v("添加 ")]):t._e(),t.permission.includes("sys:article_page:dall")?a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(e){return t.remove()}}},[t._v("批量删除 ")]):t._e()],1),a("ele-data-table",{ref:"table",attrs:{config:t.table,choose:t.choose,height:"calc(100vh - 315px)","highlight-current-row":""},on:{"update:choose":function(e){t.choose=e}},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.index;return[a("el-table-column",{attrs:{type:"selection",width:"45",align:"center",fixed:"left"}}),a("el-table-column",{attrs:{type:"index",index:i,label:"ID",width:"60",align:"center",fixed:"left","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[a("span",{domProps:{textContent:t._s(i.id)}})]}}],null,!0)}),a("el-table-column",{attrs:{label:"图片","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){var e=t.row;return[a("el-avatar",{attrs:{shape:"square",size:35,src:e.thumb}})]}}],null,!0)}),a("el-table-column",{attrs:{prop:"title",label:"标题","show-overflow-tooltip":"",align:"center","min-width":"200"}}),a("el-table-column",{attrs:{prop:"description",label:"描述","show-overflow-tooltip":"",align:"center","min-width":"250"}}),a("el-table-column",{attrs:{prop:"sort",label:"排序",sortable:"custom",align:"center","show-overflow-tooltip":"","min-width":"100"}}),a("el-table-column",{attrs:{prop:"status",label:"状态",resizable:!1,align:"center","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[a("el-switch",{attrs:{"active-value":1,"inactive-value":2},on:{change:function(e){return t.editStatus(i)}},model:{value:i.status,callback:function(e){t.$set(i,"status",e)},expression:"row.status"}})]}}],null,!0)}),a("el-table-column",{attrs:{label:"发布时间",sortable:"custom","show-overflow-tooltip":"",align:"center","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[t._v(t._s(a.publish_at))]}}],null,!0)}),a("el-table-column",{attrs:{label:"创建时间",sortable:"custom","show-overflow-tooltip":"",align:"center","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[t._v(t._s(t._f("toDateString")(a.create_time)))]}}],null,!0)}),a("el-table-column",{attrs:{label:"操作",width:"130px",align:"center",resizable:!1,fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[t.permission.includes("sys:article_page:edit")?a("el-link",{attrs:{icon:"el-icon-edit",type:"primary",underline:!1},on:{click:function(e){return t.edit(i)}}},[t._v("修改")]):t._e(),a("el-popconfirm",{staticClass:"ele-action",attrs:{title:"确定要删除此文章信息吗?"},on:{confirm:function(e){return t.remove(i)}}},[t.permission.includes("sys:article_page:delete")?a("el-link",{attrs:{slot:"reference",icon:"el-icon-delete",type:"danger",underline:!1},slot:"reference"},[t._v("删除")]):t._e()],1)]}}],null,!0)})]}}])})],1),a("el-dialog",{attrs:{title:t.editForm.id?"修改单页文章信息":"新增单页文章信息",visible:t.showEdit,width:"800px","destroy-on-close":!0,"custom-class":"ele-dialog-form","lock-scroll":!1},on:{"update:visible":function(e){t.showEdit=e},closed:function(e){t.editForm={status:2}}}},[a("el-form",{ref:"editForm",attrs:{model:t.editForm,rules:t.editRules,"label-width":"82px"}},[a("el-form-item",{attrs:{label:"图片:",visible:t.showEdit},on:{"update:visible":function(e){t.showEdit=e}}},[a("uploadImage",{attrs:{limit:1},model:{value:t.editForm.thumb,callback:function(e){t.$set(t.editForm,"thumb",e)},expression:"editForm.thumb"}})],1),a("el-row",{attrs:{gutter:15}},[a("el-col",{attrs:{sm:24}},[a("el-col",{attrs:{sm:15}},[a("el-form-item",{attrs:{label:"文章标题:",prop:"title"}},[a("el-input",{attrs:{placeholder:"请输入文章标题",clearable:""},model:{value:t.editForm.title,callback:function(e){t.$set(t.editForm,"title",e)},expression:"editForm.title"}})],1),a("el-form-item",{attrs:{label:"发布日期:",prop:"publish_at"}},[a("el-date-picker",{attrs:{type:"datetime",size:"small",placeholder:"发布日期","value-format":"yyyy-MM-dd","unlink-panels":""},model:{value:t.editForm.publish_at,callback:function(e){t.$set(t.editForm,"publish_at",e)},expression:"editForm.publish_at"}})],1)],1),a("el-col",{attrs:{sm:24}},[a("el-form-item",{attrs:{label:"文章描述:",prop:"description"}},[a("el-input",{attrs:{placeholder:"请输入文章描述",rows:6,type:"textarea"},model:{value:t.editForm.description,callback:function(e){t.$set(t.editForm,"description",e)},expression:"editForm.description"}})],1),a("el-form-item",{attrs:{label:"文章详情:",prop:"content"}},[a("tinymce-editor",{attrs:{init:t.editContent},model:{value:t.editForm.content,callback:function(e){t.$set(t.editForm,"content",e)},expression:"editForm.content"}})],1),a("el-form-item",{attrs:{label:"排序号:",prop:"sort"}},[a("el-input-number",{staticClass:"ele-fluid ele-text-left",attrs:{"controls-position":"right",min:0,placeholder:"请输入排序号"},model:{value:t.editForm.sort,callback:function(e){t.$set(t.editForm,"sort",e)},expression:"editForm.sort"}})],1),a("el-form-item",{attrs:{label:"发布状态:"}},[a("el-radio-group",{model:{value:t.editForm.status,callback:function(e){t.$set(t.editForm,"status",e)},expression:"editForm.status"}},[a("el-radio",{attrs:{label:1}},[t._v("已发布")]),a("el-radio",{attrs:{label:2}},[t._v("待发布")])],1)],1)],1)],1)],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.showEdit=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.save}},[t._v("保存")])],1)],1)],1)},o=[],s=(a("d81d"),a("5530")),l=a("2f62"),r=a("cbc3"),n=a("432e"),c={name:"SysArticlePage",components:{uploadImage:r["a"],tinymceEditor:n["a"]},data:function(){return{table:{url:"/article/index",where:{status:"0",cate_id:"0",type:2}},choose:[],showEdit:!1,editForm:{id:0,status:2,form:1,thumb:"",title:"",type:2},cates:[],editRules:{title:[{required:!0,message:"请输入文章标题",trigger:"blur"}],status:[{required:!0,message:"请选择发布状态",trigger:"blur"}]}}},computed:Object(s["a"])(Object(s["a"])({},Object(l["b"])(["permission"])),{},{editContent:function(){return{menubar:!1,file_picker_callback:this.file_picker_callback,skin_url:"dark"===this.$store.state.theme.theme?"/tinymce/skins/ui/oxide-dark":"/tinymce/skins/ui/oxide",content_css:"dark"===this.$store.state.theme.theme?"/tinymce/skins/content/dark/content.css":"/tinymce/skins/content/default/content.css"}}}),mounted:function(){},methods:{edit:function(t){this.editForm=Object.assign({},t),this.editForm.albums||(this.editForm.albums=[]),this.showEdit=!0},save:function(){var t=this;this.$refs["editForm"].validate((function(e){if(!e)return!1;t.editForm.type=2;var a=t.$loading({lock:!0});t.$http.post("/article/edit",t.editForm).then((function(e){a.close(),0===e.data.code?(t.showEdit=!1,t.$message({type:"success",message:e.data.msg}),t.$refs.table.reload()):t.$message.error(e.data.msg)})).catch((function(e){a.close(),t.$message.error(e.message)}))}))},remove:function(t){var e=this;if(t){var a=this.$loading({lock:!0});this.$http.post("/article/delete",{id:t.id}).then((function(t){a.close(),0===t.data.code?(e.$message({type:"success",message:t.data.msg}),e.$refs.table.reload()):e.$message.error(t.data.msg)})).catch((function(t){a.close(),e.$message.error(t.message)}))}else{if(0===this.choose.length)return this.$message.error("请至少选择一条数据");var i=this.choose.map((function(t){return t.id}));this.$confirm("确定要删除选中的信息吗?","提示",{type:"warning"}).then((function(){var t=e.$loading({lock:!0});e.$http.post("/article/delete",{id:i}).then((function(a){t.close(),0===a.data.code?(e.$message({type:"success",message:a.data.msg}),e.$refs.table.reload()):e.$message.error(a.data.msg)})).catch((function(a){t.close(),e.$message.error(a.message)}))})).catch((function(){return 0}))}},editStatus:function(t){var e=this,a=this.$loading({lock:!0}),i=Object.assign({},t);this.$http.post("/article/status",i).then((function(i){a.close(),0===i.data.code?e.$message({type:"success",message:i.data.msg}):(t.status=t.status?1:2,e.$message.error(i.data.msg))})).catch((function(t){a.close(),e.$message.error(t.message)}))}}},u=c,d=(a("3305"),a("2877")),m=Object(d["a"])(u,i,o,!1,null,"000d6e5d",null);e["default"]=m.exports},"5cc6":function(t,e,a){var i=a("74e8");i("Uint8",(function(t){return function(e,a,i){return t(this,e,a,i)}}))},9208:function(t,e,a){},c19f:function(t,e,a){"use strict";var i=a("23e7"),o=a("da84"),s=a("621a"),l=a("2626"),r="ArrayBuffer",n=s[r],c=o[r];i({global:!0,forced:c!==n},{ArrayBuffer:n}),l(r)},cbc3:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"finish_room"},[a("div",{staticClass:"finish_room2"},[a("div",{staticClass:"img-list"},t._l(t.photo,(function(e,i){return a("div",{key:i,staticClass:"room_img"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.url,expression:"item.url"}]}),a("div",{staticClass:"im-button",attrs:{disabled:!t.disabled},on:{click:function(e){return t.deleteImg(i)}}},[a("div",{staticClass:"im-close"}),a("div",{staticClass:"im-close1"})])])})),0),t.photo.length<t.limit?a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"room_add_img"},[t._m(0),a("input",{attrs:{disabled:t.disabled,type:"file"},on:{change:t.add_img}})]):t._e()])])},o=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",{staticStyle:{"margin-top":"35px"}},[i("img",{attrs:{src:a("206d")}})])}],s=(a("a434"),a("c19f"),a("a9e3"),a("d3b7"),a("ac1f"),a("1276"),a("5cc6"),a("9a8c"),a("a975"),a("735e"),a("c1ac"),a("d139"),a("3a7b"),a("d5d6"),a("82f8"),a("e91f"),a("60bd"),a("5f96"),a("3280"),a("3fcc"),a("ca91"),a("25a1"),a("cd26"),a("3c5d"),a("2954"),a("649e"),a("219c"),a("170b"),a("b39a"),a("72f7"),a("bc3a")),l=a.n(s),r={name:"uploadImage",props:{limit:{type:Number,default:function(){return 1}},disabled:{type:Boolean,default:function(){return!1}},isCompress:{type:Boolean,default:function(){return!1}},value:{}},data:function(){return{photo:[],deleteStatus:!1,loading:!1}},watch:{photo:function(){1==this.limit?this.$emit("input",this.photo.length>0?this.photo[0].url:""):this.$emit("input",this.photo)},value:function(){1==this.limit?this.value instanceof Array?this.photo=[]:this.photo=this.value?[{url:this.value}]:[]:this.photo=this.value}},mounted:function(){1==this.limit?this.value instanceof Array?this.photo=[]:this.photo=this.value?[{url:this.value}]:[]:this.value instanceof Array?this.photo=this.value:this.photo=[]},methods:{deleteImg:function(t){this.photo&&this.photo instanceof Array&&this.photo.splice(t,1)},compress:function(t){var e=null,a=document.createElement("canvas"),i=t.height/t.width;a.width=720,a.height=720*i;var o=a.getContext("2d");return o.clearRect(0,0,a.width,a.height),o.drawImage(t,0,0,a.width,a.height),e=a.toDataURL("image/jpeg"),e},dataURItoBlob:function(t){for(var e=window.atob(t.split(",")[1]),a=t.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(e.length),o=new Uint8Array(i),s=0;s<e.length;s++)o[s]=e.charCodeAt(s);return new window.Blob([i],{type:a})},add_img:function(t){var e=t.target.files[0];if(/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(t.target.value)){var a=10485760,i=e.size;if(i>a)return t.target.value="",void this.$notify.error({title:"上传图片错误",message:"上传图片不能超过10M"});this.loading=!0;var o=new FileReader,s=this;o.readAsDataURL(e);var r=new Image;o.onload=function(a){r.src=this.result,r.onload=function(){var i=a.target.result,o=e;s.isCompress&&(i=s.compress(r),o=s.dataURItoBlob(i));var n=new window.FormData;n.append("file",o),l()({method:"POST",url:"/upload/uploadImage",data:n,timeout:1e6,headers:{"Content-Type":"multipart/form-data"}}).then((function(a){console.log(a.data),t.target.value="","undefined"!=typeof s.photo&&""!=s.photo||(s.photo=[]),console.log(s.photo),s.photo.push({fileName:e.fileName,url:a.data.data}),s.loading=!1})).catch((function(e){t.target.value="",s.loading=!1,console.log(e)}))}}}else t.target.value="",this.$notify.error({title:"上传图片错误",message:"请上传gif|jpg|jpeg|png|GIF|JPG|PNG格式图片"})}}},n=r,c=(a("e5ee"),a("2877")),u=Object(c["a"])(n,i,o,!1,null,"2ed5cae0",null);e["a"]=u.exports},e5ee:function(t,e,a){"use strict";a("4091")}}]);