chunk-0f01aa91.52f73449.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0f01aa91"],{"206d":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAJ5JREFUWAnt2DEKwDAMA8Ck9Cl9e/Ko9i8uXrUIBQ8eVMhgUEW4Zggdo+jZe7+5iurGXVUUEU9VV/ZclWWVXd6Yqmkxi6kCat5nzGKqgJr3GbOYKqDm256xmbfO6kueqoP5OefXVgw3ezyvtSLXcQG82FbMG4MvRUeLUSIIWAxA6GgxSgQBiwEIHS1GiSBgMQChY1uxsn+weR2mDELgB3FmFp5YffVrAAAAAElFTkSuQmCC"},"31cf":function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"ele-body"},[o("el-card",{attrs:{shadow:"never"}},[o("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()}}},[o("el-row",{attrs:{gutter:15}},[o("el-col",{attrs:{md:6,sm:12}},[o("el-form-item",{attrs:{label:"标题:"}},[o("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),o("el-col",{attrs:{md:6,sm:12}},[o("el-form-item",{attrs:{label:"状态:"}},[o("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"}},[o("el-option",{attrs:{label:"全部",value:"0"}}),o("el-option",{attrs:{label:"已发布",value:"1"}}),o("el-option",{attrs:{label:"待发布",value:"2"}})],1)],1)],1),o("el-col",{attrs:{md:6,sm:12}},[o("div",{staticClass:"ele-form-actions"},[o("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.$refs.table.reload()}}},[t._v("查询 ")]),o("el-button",{on:{click:function(e){(t.table.where={})&&t.$refs.table.reload()}}},[t._v("重置")])],1)])],1)],1),o("div",{staticClass:"ele-table-tool ele-table-tool-default"},[t.permission.includes("sys:works:add")?o("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:works:dall")?o("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),o("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 a=e.index;return[o("el-table-column",{attrs:{type:"selection",width:"45",align:"center",fixed:"left"}}),o("el-table-column",{attrs:{type:"index",index:a,label:"编号",width:"60",align:"center",fixed:"left","show-overflow-tooltip":""}}),o("el-table-column",{attrs:{label:"图片","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){var e=t.row;return[o("el-avatar",{attrs:{shape:"square",size:35,src:e.thumb}})]}}],null,!0)}),o("el-table-column",{attrs:{prop:"title",label:"名称","show-overflow-tooltip":"",align:"center","min-width":"200"}}),o("el-table-column",{attrs:{prop:"num",label:"岗位人数","show-overflow-tooltip":"",align:"center","min-width":"80"}}),o("el-table-column",{attrs:{prop:"view_num",label:"浏览量","show-overflow-tooltip":"",align:"center","min-width":"80"}}),o("el-table-column",{attrs:{prop:"status",label:"状态",resizable:!1,align:"center","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[o("el-switch",{attrs:{"active-value":1,"inactive-value":2},on:{change:function(e){return t.editStatus(a)}},model:{value:a.status,callback:function(e){t.$set(a,"status",e)},expression:"row.status"}})]}}],null,!0)}),o("el-table-column",{attrs:{prop:"description",label:"描述","show-overflow-tooltip":"",align:"center","min-width":"250"}}),o("el-table-column",{attrs:{prop:"sort",label:"排序",sortable:"custom",align:"center","show-overflow-tooltip":"","min-width":"100"}}),o("el-table-column",{attrs:{label:"发布时间",sortable:"custom","show-overflow-tooltip":"",align:"center","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){var o=e.row;return[t._v(t._s(o.publish_at))]}}],null,!0)}),o("el-table-column",{attrs:{label:"创建时间",sortable:"custom","show-overflow-tooltip":"",align:"center","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){var o=e.row;return[t._v(t._s(t._f("toDateString")(o.create_time)))]}}],null,!0)}),o("el-table-column",{attrs:{label:"操作",width:"130px",align:"center",resizable:!1,fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[t.permission.includes("sys:works:edit")?o("el-link",{attrs:{icon:"el-icon-edit",type:"primary",underline:!1},on:{click:function(e){return t.edit(a)}}},[t._v("修改")]):t._e(),o("el-popconfirm",{staticClass:"ele-action",attrs:{title:"确定要删除此工作信息吗?"},on:{confirm:function(e){return t.remove(a)}}},[t.permission.includes("sys:works:delete")?o("el-link",{attrs:{slot:"reference",icon:"el-icon-delete",type:"danger",underline:!1},slot:"reference"},[t._v("删除")]):t._e()],1)]}}],null,!0)})]}}])})],1),o("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}}}},[o("el-form",{ref:"editForm",attrs:{model:t.editForm,rules:t.editRules,"label-width":"82px"}},[o("el-form-item",{attrs:{label:"图片:",visible:t.showEdit},on:{"update:visible":function(e){t.showEdit=e}}},[o("uploadImage",{attrs:{limit:1},model:{value:t.editForm.thumb,callback:function(e){t.$set(t.editForm,"thumb",e)},expression:"editForm.thumb"}})],1),o("el-row",{attrs:{gutter:15}},[o("el-col",{attrs:{sm:24}},[o("el-col",{attrs:{sm:15}},[o("el-form-item",{attrs:{label:"工作标题:",prop:"title"}},[o("el-input",{attrs:{placeholder:"请输入工作标题",clearable:""},model:{value:t.editForm.title,callback:function(e){t.$set(t.editForm,"title",e)},expression:"editForm.title"}})],1),o("el-form-item",{attrs:{label:"岗位人数:",prop:"sort"}},[o("el-input",{attrs:{min:1,placeholder:"请输入岗位人数"},model:{value:t.editForm.num,callback:function(e){t.$set(t.editForm,"num",e)},expression:"editForm.num"}})],1),o("el-form-item",{attrs:{label:"发布日期:",prop:"publish_at"}},[o("el-date-picker",{attrs:{type:"datetime","value-format":"yyyy-MM-dd",size:"small",placeholder:"发布日期","unlink-panels":""},model:{value:t.editForm.publish_at,callback:function(e){t.$set(t.editForm,"publish_at",e)},expression:"editForm.publish_at"}})],1)],1),o("el-col",{attrs:{sm:24}},[o("el-form-item",{attrs:{label:"工作描述:",prop:"description"}},[o("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),o("el-form-item",{attrs:{label:"工作详情:",prop:"content"}},[o("tinymce-editor",{attrs:{init:t.editContent},model:{value:t.editForm.content,callback:function(e){t.$set(t.editForm,"content",e)},expression:"editForm.content"}})],1),o("el-form-item",{attrs:{label:"排序号:",prop:"sort"}},[o("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),o("el-form-item",{attrs:{label:"发布状态:"}},[o("el-radio-group",{model:{value:t.editForm.status,callback:function(e){t.$set(t.editForm,"status",e)},expression:"editForm.status"}},[o("el-radio",{attrs:{label:1}},[t._v("已发布")]),o("el-radio",{attrs:{label:2}},[t._v("待发布")])],1)],1)],1)],1)],1)],1),o("div",{attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.showEdit=!1}}},[t._v("取消")]),o("el-button",{attrs:{type:"primary"},on:{click:t.save}},[t._v("保存")])],1)],1)],1)},s=[],i=(o("d81d"),o("5530")),l=o("2f62"),r=o("cbc3"),n=o("432e"),c={name:"SysArticle",components:{uploadImage:r["a"],tinymceEditor:n["a"]},data:function(){return{table:{url:"/works/index",where:{status:"0"}},choose:[],showEdit:!1,editForm:{id:0,status:2,form:1,thumb:{},title:""},cates:[],editRules:{title:[{required:!0,message:"请输入工作标题",trigger:"blur"}],cate_id:[{required:!0,message:"请选择工作所属分类",trigger:"blur"}],status:[{required:!0,message:"请选择发布状态",trigger:"blur"}]}}},computed:Object(i["a"])(Object(i["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(){this.getCateOPtions()},methods:{getCateOPtions:function(){var t=this,e=this.$loading({lock:!0});this.$http.post("/goodscates/options",this.editForm).then((function(o){e.close(),0===o.data.code?t.cates="undefined"!=typeof o.data.data?o.data.data:{}:t.$message.error(o.data.msg)})).catch((function(o){e.close(),t.$message.error(o.message)}))},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;var o=t.$loading({lock:!0});t.$http.post("/works/edit",t.editForm).then((function(e){o.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){o.close(),t.$message.error(e.message)}))}))},remove:function(t){var e=this;if(t){var o=this.$loading({lock:!0});this.$http.post("/works/delete",{id:t.id}).then((function(t){o.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){o.close(),e.$message.error(t.message)}))}else{if(0===this.choose.length)return this.$message.error("请至少选择一条数据");var a=this.choose.map((function(t){return t.id}));this.$confirm("确定要删除选中的信息吗?","提示",{type:"warning"}).then((function(){var t=e.$loading({lock:!0});e.$http.post("/works/delete",{id:a}).then((function(o){t.close(),0===o.data.code?(e.$message({type:"success",message:o.data.msg}),e.$refs.table.reload()):e.$message.error(o.data.msg)})).catch((function(o){t.close(),e.$message.error(o.message)}))})).catch((function(){return 0}))}},editStatus:function(t){var e=this,o=this.$loading({lock:!0}),a=Object.assign({},t);this.$http.post("/works/status",a).then((function(a){o.close(),0===a.data.code?e.$message({type:"success",message:a.data.msg}):(t.status=t.status?1:2,e.$message.error(a.data.msg))})).catch((function(t){o.close(),e.$message.error(t.message)}))}}},u=c,d=(o("ca47"),o("2877")),m=Object(d["a"])(u,a,s,!1,null,"9294e942",null);e["default"]=m.exports},4091:function(t,e,o){},"5cc6":function(t,e,o){var a=o("74e8");a("Uint8",(function(t){return function(e,o,a){return t(this,e,o,a)}}))},c19f:function(t,e,o){"use strict";var a=o("23e7"),s=o("da84"),i=o("621a"),l=o("2626"),r="ArrayBuffer",n=i[r],c=s[r];a({global:!0,forced:c!==n},{ArrayBuffer:n}),l(r)},ca47:function(t,e,o){"use strict";o("e98b")},cbc3:function(t,e,o){"use strict";var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"finish_room"},[o("div",{staticClass:"finish_room2"},[o("div",{staticClass:"img-list"},t._l(t.photo,(function(e,a){return o("div",{key:a,staticClass:"room_img"},[o("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.url,expression:"item.url"}]}),o("div",{staticClass:"im-button",attrs:{disabled:!t.disabled},on:{click:function(e){return t.deleteImg(a)}}},[o("div",{staticClass:"im-close"}),o("div",{staticClass:"im-close1"})])])})),0),t.photo.length<t.limit?o("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"room_add_img"},[t._m(0),o("input",{attrs:{disabled:t.disabled,type:"file"},on:{change:t.add_img}})]):t._e()])])},s=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",{staticStyle:{"margin-top":"35px"}},[a("img",{attrs:{src:o("206d")}})])}],i=(o("a434"),o("c19f"),o("a9e3"),o("d3b7"),o("ac1f"),o("1276"),o("5cc6"),o("9a8c"),o("a975"),o("735e"),o("c1ac"),o("d139"),o("3a7b"),o("d5d6"),o("82f8"),o("e91f"),o("60bd"),o("5f96"),o("3280"),o("3fcc"),o("ca91"),o("25a1"),o("cd26"),o("3c5d"),o("2954"),o("649e"),o("219c"),o("170b"),o("b39a"),o("72f7"),o("bc3a")),l=o.n(i),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,o=document.createElement("canvas"),a=t.height/t.width;o.width=720,o.height=720*a;var s=o.getContext("2d");return s.clearRect(0,0,o.width,o.height),s.drawImage(t,0,0,o.width,o.height),e=o.toDataURL("image/jpeg"),e},dataURItoBlob:function(t){for(var e=window.atob(t.split(",")[1]),o=t.split(",")[0].split(":")[1].split(";")[0],a=new ArrayBuffer(e.length),s=new Uint8Array(a),i=0;i<e.length;i++)s[i]=e.charCodeAt(i);return new window.Blob([a],{type:o})},add_img:function(t){var e=t.target.files[0];if(/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(t.target.value)){var o=10485760,a=e.size;if(a>o)return t.target.value="",void this.$notify.error({title:"上传图片错误",message:"上传图片不能超过10M"});this.loading=!0;var s=new FileReader,i=this;s.readAsDataURL(e);var r=new Image;s.onload=function(o){r.src=this.result,r.onload=function(){var a=o.target.result,s=e;i.isCompress&&(a=i.compress(r),s=i.dataURItoBlob(a));var n=new window.FormData;n.append("file",s),l()({method:"POST",url:"/upload/uploadImage",data:n,timeout:1e6,headers:{"Content-Type":"multipart/form-data"}}).then((function(o){console.log(o.data),t.target.value="","undefined"!=typeof i.photo&&""!=i.photo||(i.photo=[]),console.log(i.photo),i.photo.push({fileName:e.fileName,url:o.data.data}),i.loading=!1})).catch((function(e){t.target.value="",i.loading=!1,console.log(e)}))}}}else t.target.value="",this.$notify.error({title:"上传图片错误",message:"请上传gif|jpg|jpeg|png|GIF|JPG|PNG格式图片"})}}},n=r,c=(o("e5ee"),o("2877")),u=Object(c["a"])(n,a,s,!1,null,"2ed5cae0",null);e["a"]=u.exports},e5ee:function(t,e,o){"use strict";o("4091")},e98b:function(t,e,o){}}]);