2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4d0356d8"],{"312d":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{class:e.mainDiv},[a("div",[a("a-button",{staticStyle:{float:"right"},attrs:{type:"primary"},on:{click:function(t){return e.tripTo()}}},[e._v(" 返回 ")])],1),a("div",{staticClass:"header_write"},[e._v(e._s(e.infoData.header))]),e._l(e.infoData.contents,(function(t,i){return a("div",{key:i},[a("div",{staticStyle:{"font-weight":"600"}},[e._v(e._s(t.title)+":")]),a("quill-editor",{ref:i,refInFor:!0,staticStyle:{"margin-top":"20px"},attrs:{id:i},on:{blur:function(t){return e.onEditorBlur(t,i)},focus:function(t){return e.onEditorFocus(t,i)},change:function(t){return e.onEditorChange(t)}},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"item.content"}})],1)})),a("div",{staticStyle:{"font-weight":"600"}},[e._v("图片上传")]),a("div",[a("div",{staticClass:"clearfix"},[a("a-upload",{attrs:{action:"/week/fileUploadAndDownload/upload","list-type":"picture-card","file-list":e.fileList,showUploadList:e.showUploadList,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.canEdit?a("div",[a("a-icon",{attrs:{type:"plus"}}),a("div",{staticClass:"ant-upload-text"},[e._v(" Upload ")])],1):e._e()]),a("a-modal",{attrs:{visible:e.previewVisible,footer:null},on:{cancel:e.handleCancel}},[a("img",{staticStyle:{width:"100%"},attrs:{alt:"example",src:e.previewImage}})])],1)]),a("div",{staticStyle:{"font-weight":"600"}},[e._v("文件上传")]),a("div",[a("div",{staticClass:"clearfix"},[a("a-upload",{attrs:{action:"/week/fileUploadAndDownload/upload","file-list":e.fileList2,showUploadList:e.showUploadList,headers:{"x-token":e.xToken,"x-user-id":e.xUserId},remove:e.removeFile},on:{change:e.handleChange2}},[e.canEdit?a("div",[a("a-button",[a("a-icon",{attrs:{type:"upload"}}),e._v(" Upload ")],1)],1):e._e()])],1)]),e._m(0),a("a-select",{class:e.sendToClass,staticStyle:{width:"100%"},attrs:{mode:"multiple",placeholder:"请选择人员",disabled:!e.canEdit},on:{change:e.userChange},model:{value:e.sends,callback:function(t){e.sends=t},expression:"sends"}},e._l(e.userList,(function(t){return a("a-select-option",{key:t.ID},[e._v(" "+e._s(t.userName)+" ")])})),1),"cannotSubmit"===e.sendToClass?a("span",{staticStyle:{color:"red"}},[e._v("请选择人员")]):e._e(),e.canEdit?a("div",{staticStyle:{"text-align":"center"}},[a("a-button",{staticStyle:{width:"400px","margin-top":"20px"},attrs:{type:"primary"},on:{click:e.editReports}},[e._v(" 提交周报 ")])],1):e._e(),a("div",{staticStyle:{margin:"20px 0","font-size":"18px","font-weight":"600"}},[e._v("评论")]),e._l(e.commentsList,(function(t,i){return a("div",[0!==i?a("hr"):e._e(),a("div",{staticStyle:{"font-size":"16px","font-weight":"600"}},[e._v(e._s(t.userName)+":")]),a("div",[e._v(" "+e._s(t.comment))]),a("div",{staticStyle:{width:"100%","text-align":"right"}},[e._v(e._s(t.CreatedAt))])])})),a("div",[a("a-textarea",{attrs:{placeholder:"请输入评论",rows:4},model:{value:e.comment,callback:function(t){e.comment=t},expression:"comment"}}),a("div",{staticStyle:{width:"100%","text-align":"center"}},[a("a-button",{staticStyle:{"margin-top":"20px"},attrs:{type:"primary"},on:{click:e.addComment}},[e._v(" 提交评论 ")])],1)],1)],2)},s=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{"font-weight":"600",margin:"20px 0 0 0"}},[a("span",{staticStyle:{color:"red"}},[e._v("*")]),e._v("发送给")])}],n=a("1da1"),o=a("b85c"),r=(a("96cf"),a("d3b7"),a("a9e3"),a("b0c0"),a("7c15")),l=a("953d");a("a753"),a("8096"),a("14e1");function c(e){return new Promise((function(t,a){var i=new FileReader;i.readAsDataURL(e),i.onload=function(){return t(i.result)},i.onerror=function(e){return a(e)}}))}var d={name:"InfoComponent",components:{quillEditor:l["quillEditor"]},created:function(){this.infoId=JSON.parse(this.$route.query.data),this.findUserList(),this.findData()},data:function(){return{mainDiv:"top0",infoId:"",infoData:{},canEdit:!1,showUploadList:{},fileList:[],previewVisible:!1,previewImage:"",xToken:sessionStorage.getItem("login"),xUserId:sessionStorage.getItem("userId"),pictures:[],fileList2:[],template:{},userList:[],sends:[],attachments:[],sendTo:[],sendToClass:"canSubmit",commentsList:[],comment:""}},methods:{tripTo:function(){this.$router.push("viewWeeklyReport")},findData:function(){var e=this;this.$axios.get(r["a"].FIND_REPORT_BY_ID.url+"?id=".concat(this.infoId)).then((function(t){0===t.data.code?(e.infoData=t.data.data.rewtReports,e.infoData.userId===Number(sessionStorage.getItem("userId"))?e.canEdit=!0:(e.showUploadList={showRemoveIcon:!1},setTimeout((function(){var e,t=Object(o["a"])(document.getElementsByClassName("ql-toolbar"));try{for(t.s();!(e=t.n()).done;){var a=e.value;a.style.display="none"}}catch(i){t.e(i)}finally{t.f()}}),80),e.mainDiv="top1"),e.findComments(e.infoData.ID)):e.$message.error(t.data.msg)}))},setData:function(){this.template=this.infoData.contents;for(var e=[],t=0;t<this.infoData.pictures.length;t++){var a={};a.uid=t,a.name=this.infoData.pictures[t].name,a.key=this.infoData.pictures[t].key,a.url=this.BASEURL+r["a"].DOWNLOAD_FILE.url+"?fileName="+this.infoData.pictures[t].key,a.status="done",e.push(a)}this.fileList=e;for(var i=[],s=0;s<this.infoData.attachments.length;s++){var n={};n.uid=s,n.name=this.infoData.attachments[s].name,n.key=this.infoData.attachments[s].key,n.url=this.BASEURL+r["a"].DOWNLOAD_FILE.url+"?fileName="+this.infoData.attachments[s].key,n.status="done",i.push(n)}this.fileList2=i;var l,c=[],d=Object(o["a"])(this.infoData.sendTo);try{for(d.s();!(l=d.n()).done;){var u,f=l.value,h=!1,m=Object(o["a"])(this.userList);try{for(m.s();!(u=m.n()).done;){var p=u.value;p.ID===f.id&&(h=!0)}}catch(g){m.e(g)}finally{m.f()}if(!h){var v={};v.ID=f.id,v.userName=f.name,this.userList.push(v)}c.push(f.id)}}catch(g){d.e(g)}finally{d.f()}this.sends=c},handleCancel:function(){this.previewVisible=!1},handlePreview:function(e){var t=this;return Object(n["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(e.url||e.preview){a.next=4;break}return a.next=3,c(e.originFileObj);case 3:e.preview=a.sent;case 4:t.previewImage=e.url||e.preview,t.previewVisible=!0;case 6:case"end":return a.stop()}}),a)})))()},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;if(this.canEdit){var a={};e.response?a.key=e.response.data.file.key:a.key=e.key;var i,s=[],n=Object(o["a"])(this.fileList);try{for(n.s();!(i=n.n()).done;){var l=i.value;l.response?l.response.data.file.key!==a.key&&s.push(l):l.key!==a.key&&s.push(l)}}catch(h){n.e(h)}finally{n.f()}this.fileList=s;var c,d=[],u=Object(o["a"])(this.fileList2);try{for(u.s();!(c=u.n()).done;){var f=c.value;f.response?f.response.data.file.key!==a.key&&d.push(f):f.key!==a.key&&d.push(f)}}catch(h){u.e(h)}finally{u.f()}this.fileList2=d,this.$axios.post(r["a"].DELETE_FILE.url,a).then((function(e){0===e.data.code?t.$message.success(e.data.msg):t.$message.error(e.data.msg)}))}},onEditorBlur:function(e,t){document.getElementById(t).children[0].style.zIndex="1"},onEditorFocus:function(e,t){this.canEdit?e.enable(!0):e.enable(!1),document.getElementById(t).children[0].style.zIndex="2"},onEditorChange:function(){},findUserList:function(){var e=this,t={page:1,pageSize:99999};this.$axios.post(r["a"].GET_USER_LIST.url,t).then((function(t){0===t.data.code?(e.userList=t.data.data.list,e.setData()):e.$message.error(t.data.msg)}))},userChange:function(e){var t=[];if(e.length>0){var a,i=Object(o["a"])(this.userList);try{for(i.s();!(a=i.n()).done;){var s,n=a.value,r=Object(o["a"])(e);try{for(r.s();!(s=r.n()).done;){var l=s.value;if(n.ID===l){var c={};c.id=l,c.name=n.userName,t.push(c)}}}catch(d){r.e(d)}finally{r.f()}}}catch(d){i.e(d)}finally{i.f()}}this.sendTo=t,this.sendTo.length>0&&(this.sendToClass="canSubmit")},editReports:function(){var e=this,t=[];if(this.fileList.length>0){var a,i=Object(o["a"])(this.fileList);try{for(i.s();!(a=i.n()).done;){var s=a.value,n={};s.response?(n.key=s.response.data.file.key,n.name=s.response.data.file.name):(n.key=s.key,n.name=s.name),t.push(n)}}catch(m){i.e(m)}finally{i.f()}}this.pictures=t;var l=[];if(this.fileList2.length>0){var c,d=Object(o["a"])(this.fileList2);try{for(d.s();!(c=d.n()).done;){var u=c.value,f={};u.response?(f.key=u.response.data.file.key,f.name=u.response.data.file.name):(f.key=u.key,f.name=u.name),l.push(f)}}catch(m){d.e(m)}finally{d.f()}}if(this.attachments=l,0===this.sendTo.length)this.sendToClass="cannotSubmit";else{var h={};h.id=this.infoData.ID,h.userId=sessionStorage.getItem("userId"),h.userName=sessionStorage.getItem("userName"),h.sendTo=this.sendTo,h.pictures=this.pictures,h.attachments=this.attachments,h.header=this.infoData.header,h.contents=this.infoData.contents,this.$axios.put(r["a"].EDIT_REPORT.url,h).then((function(t){0===t.data.code?(e.$message.success(t.data.msg),e.fileList=[],e.previewVisible=!1,e.previewImage="",e.pictures=[],e.fileList2=[],e.template={},e.userList=[],e.attachments=[],e.sendTo=[],e.findData()):e.$message.error(t.data.msg)}))}},findComments:function(e){var t=this;this.$axios.get(r["a"].FIND_COMMENT_LIST.url+"?reportId=".concat(e,"&page=1&pageSise=99999")).then((function(e){0===e.data.code?t.commentsList=e.data.data.list:t.$message.error(e.data.msg)}))},addComment:function(){var e=this,t={};t.reportId=this.infoData.ID,t.userName=sessionStorage.getItem("userName"),t.comment=this.comment,this.$axios.post(r["a"].ADD_COMMENT.url,t).then((function(t){0===t.data.code?(e.$message.success(t.data.msg),e.findComments(e.infoData.ID),e.comment=""):e.$message.error(t.data.msg)}))}},computed:{editor:function(){return this.$refs.myQuillEditor.quill}}},u=d,f=(a("37c1"),a("2877")),h=Object(f["a"])(u,i,s,!1,null,null,null);t["default"]=h.exports},"34f2":function(e,t,a){},"37c1":function(e,t,a){"use strict";a("34f2")}}]);
|
||
//# sourceMappingURL=chunk-4d0356d8.b62142b4.js.map
|