goweb-gin-demo/web/dist/assets/js/chunk-c731a980.54be1077.js

2 lines
6.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c731a980"],{"455c":function(e,t,i){},4741:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticStyle:{margin:"50px 0"}},[i("div",{staticClass:"header_write"},[e._v(e._s(e.template.header))]),e._l(e.template.contents,(function(t,a){return i("div",{key:a},[i("div",{staticStyle:{"font-weight":"600"}},[e._v(e._s(t.title)+"")]),i("quill-editor",{ref:a,refInFor:!0,staticStyle:{"margin-top":"20px"},attrs:{id:a},on:{blur:function(t){return e.onEditorBlur(t,a)},focus:function(t){return e.onEditorFocus(t,a)},change:function(t){return e.onEditorChange(t)}},model:{value:t.content,callback:function(i){e.$set(t,"content",i)},expression:"item.content"}})],1)})),i("div",{staticStyle:{"font-weight":"600"}},[e._v("图片上传")]),i("div",[i("div",{staticClass:"clearfix"},[i("a-upload",{attrs:{action:"/week/fileUploadAndDownload/upload","list-type":"picture-card","file-list":e.fileList,accept:".png,.jpeg,.jpg",headers:{"x-token":e.xToken,"x-user-id":e.xUserId},remove:e.removeFile},on:{preview:e.handlePreview,change:e.handleChange}},[e.fileList.length<8?i("div",[i("a-icon",{attrs:{type:"plus"}}),i("div",{staticClass:"ant-upload-text"},[e._v(" Upload ")])],1):e._e()]),i("a-modal",{attrs:{visible:e.previewVisible,footer:null},on:{cancel:e.handleCancel}},[i("img",{staticStyle:{width:"100%"},attrs:{alt:"example",src:e.previewImage}})])],1)]),i("div",{staticStyle:{"font-weight":"600"}},[e._v("文件上传")]),i("div",[i("div",{staticClass:"clearfix"},[i("a-upload",{attrs:{action:"/week/fileUploadAndDownload/upload","file-list":e.fileList2,headers:{"x-token":e.xToken,"x-user-id":e.xUserId},remove:e.removeFile},on:{change:e.handleChange2}},[i("div",[i("a-button",[i("a-icon",{attrs:{type:"upload"}}),e._v(" Upload ")],1)],1)])],1)]),e._m(0),i("a-select",{class:e.sendToClass,staticStyle:{width:"100%"},attrs:{mode:"multiple",placeholder:"请选择人员"},on:{change:e.userChange},model:{value:e.sends,callback:function(t){e.sends=t},expression:"sends"}},e._l(e.userList,(function(t){return i("a-select-option",{key:t.ID},[e._v(" "+e._s(t.userName)+" ")])})),1),"cannotSubmit"===e.sendToClass?i("span",{staticStyle:{color:"red"}},[e._v("请选择人员")]):e._e(),i("div",{staticStyle:{"text-align":"center"}},[i("a-button",{staticStyle:{width:"400px","margin-top":"20px"},attrs:{type:"primary"},on:{click:e.addReports}},[e._v(" 提交 ")])],1)],2)},s=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticStyle:{"font-weight":"600",margin:"20px 0 0 0"}},[i("span",{staticStyle:{color:"red"}},[e._v("*")]),e._v("发送给")])}],n=i("b85c"),r=i("1da1"),o=(i("96cf"),i("d3b7"),i("b0c0"),i("a9e3"),i("7c15")),l=i("953d");i("a753"),i("8096"),i("14e1");function c(e){return new Promise((function(t,i){var a=new FileReader;a.readAsDataURL(e),a.onload=function(){return t(a.result)},a.onerror=function(e){return i(e)}}))}var d={name:"WriteWeeklyReport",components:{quillEditor:l["quillEditor"]},data:function(){return{fileList:[],previewVisible:!1,previewImage:"",xToken:sessionStorage.getItem("login"),xUserId:sessionStorage.getItem("userId"),pictures:[],fileList2:[],template:{},userList:[],sends:[],attachments:[],sendToClass:"canSubmit",sendTo:[]}},created:function(){this.findTempl(),this.findUserList()},methods:{handleCancel:function(){this.previewVisible=!1},handlePreview:function(e){var t=this;return Object(r["a"])(regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.url||e.preview){i.next=4;break}return i.next=3,c(e.originFileObj);case 3:e.preview=i.sent;case 4:t.previewImage=e.url||e.preview,t.previewVisible=!0;case 6:case"end":return i.stop()}}),i)})))()},handleChange:function(e){var t=e.fileList;this.fileList=t},handleChange2:function(e){var t=e.fileList;this.fileList2=t},removeFile:function(e){var t=this,i={};i.key=e.response.data.file.key;var a,s=[],r=Object(n["a"])(this.fileList);try{for(r.s();!(a=r.n()).done;){var l=a.value;l.response.data.file.key!==i.key&&s.push(l)}}catch(h){r.e(h)}finally{r.f()}this.fileList=s;var c,d=[],u=Object(n["a"])(this.fileList2);try{for(u.s();!(c=u.n()).done;){var f=c.value;f.response.data.file.key!==i.key&&d.push(f)}}catch(h){u.e(h)}finally{u.f()}this.fileList2=d,this.$axios.post(o["a"].DELETE_FILE.url,i).then((function(e){0===e.data.code?t.$message.success(e.data.msg):t.$message.error(e.data.msg)}))},findTempl:function(){var e=this;this.$axios.get(o["a"].GET_TEMPLATE_LIST.url).then((function(t){0===t.data.code?t.data.data.total>0?e.template=t.data.data.list[0]:e.$message.error("请先创建周报模板"):e.$message.error(t.data.msg)}))},onEditorBlur:function(e,t){document.getElementById(t).children[0].style.zIndex="1"},onEditorFocus:function(e,t){document.getElementById(t).children[0].style.zIndex="2"},onEditorChange:function(){},findUserList:function(){var e=this,t={page:1,pageSize:99999};this.$axios.post(o["a"].GET_USER_LIST.url,t).then((function(t){0===t.data.code?e.userList=t.data.data.list:e.$message.error(t.data.msg)}))},userChange:function(e){var t=[];if(e.length>0){var i,a=Object(n["a"])(this.userList);try{for(a.s();!(i=a.n()).done;){var s,r=i.value,o=Object(n["a"])(e);try{for(o.s();!(s=o.n()).done;){var l=s.value;if(r.ID===l){var c={};c.id=l,c.name=r.userName,t.push(c)}}}catch(d){o.e(d)}finally{o.f()}}}catch(d){a.e(d)}finally{a.f()}}this.sendTo=t,this.sendTo.length>0&&(this.sendToClass="canSubmit")},addReports:function(){var e=this,t=[];if(this.fileList.length>0){var i,a=Object(n["a"])(this.fileList);try{for(a.s();!(i=a.n()).done;){var s=i.value,r={};r.key=s.response.data.file.key,r.name=s.response.data.file.name,t.push(r)}}catch(p){a.e(p)}finally{a.f()}}this.pictures=t;var l=[];if(this.fileList2.length>0){var c,d=Object(n["a"])(this.fileList2);try{for(d.s();!(c=d.n()).done;){var u=c.value,f={};f.key=u.response.data.file.key,f.name=u.response.data.file.name,l.push(f)}}catch(p){d.e(p)}finally{d.f()}}if(this.attachments=l,0===this.sendTo.length)this.sendToClass="cannotSubmit";else{var h={};h.userId=Number(sessionStorage.getItem("userId")),h.userName=sessionStorage.getItem("userName"),h.sendTo=this.sendTo,h.pictures=this.pictures,h.attachments=this.attachments,h.header=this.template.header,h.contents=this.template.contents,this.$axios.post(o["a"].ADD_REPORT.url,h).then((function(t){0===t.data.code?(e.$message.success(t.data.msg),e.findTempl(),e.findTempl(),e.fileList=[],e.previewVisible=!1,e.previewImage="",e.pictures=[],e.fileList2=[],e.template={},e.userList=[],e.attachments=[],e.sendTo=[],e.sends=[]):e.$message.error(t.data.msg)}))}}},computed:{editor:function(){return this.$refs.myQuillEditor.quill}}},u=d,f=(i("d8bf"),i("2877")),h=Object(f["a"])(u,a,s,!1,null,null,null);t["default"]=h.exports},d8bf:function(e,t,i){"use strict";i("455c")}}]);
//# sourceMappingURL=chunk-c731a980.54be1077.js.map