diff --git a/public/css/vc-ui.css b/public/css/vc-ui.css index ad954042e..8da501f8e 100755 --- a/public/css/vc-ui.css +++ b/public/css/vc-ui.css @@ -1417,7 +1417,7 @@ table.table-mail tr td { } .note-editor { - z-index: 3000!important; + /* z-index: 3000!important; */ } diff --git a/public/pages/examine/addExamineStaff/addExamineStaff.html b/public/pages/examine/addExamineStaff/addExamineStaff.html index 9fc6d9264..14791e827 100644 --- a/public/pages/examine/addExamineStaff/addExamineStaff.html +++ b/public/pages/examine/addExamineStaff/addExamineStaff.html @@ -31,6 +31,29 @@ +
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
diff --git a/public/pages/examine/addExamineStaff/addExamineStaff.js b/public/pages/examine/addExamineStaff/addExamineStaff.js index 17cbe90af..b6cf86483 100644 --- a/public/pages/examine/addExamineStaff/addExamineStaff.js +++ b/public/pages/examine/addExamineStaff/addExamineStaff.js @@ -7,6 +7,9 @@ orgName: '', staffName: '', staffId: '', + post: '', + introduction: '', + headerImg: '', projects: [], projectIds: [] @@ -14,9 +17,16 @@ }, _initMethod: function() { $that._listExamineProjects(); + $that._initTextArea(); }, _initEvent: function() { - + vc.on("addExamineStaff", "notifyUploadImage", function(_param) { + if (_param.length > 0) { + vc.component.addExamineStaffInfo.headerImg = _param[0].fileId; + } else { + vc.component.addExamineStaffInfo.headerImg = '' + } + }); }, methods: { @@ -92,7 +102,64 @@ }, _goBack: function() { vc.goBack(); - } + }, + _initTextArea: function() { + var $summernote = $('.summernote').summernote({ + lang: 'zh-CN', + height: 300, + placeholder: '必填,请输入员工简介', + callbacks: { + onImageUpload: function(files, editor, $editable) { + $that.sendFile($summernote, files); + }, + onChange: function(contents, $editable) { + vc.component.addExamineStaffInfo.introduction = contents; + } + }, + toolbar: [ + ['style', ['style']], + ['font', ['bold', 'italic', 'underline', 'clear']], + ['fontname', ['fontname']], + ['color', ['color']], + ['para', ['ul', 'ol', 'paragraph']], + ['height', ['height']], + ['table', ['table']], + ['insert', ['link', 'picture']], + ['view', ['fullscreen', 'codeview']], + ], + }); + }, + sendFile: function($summernote, files) { + console.log('上传图片', files); + var param = new FormData(); + param.append("uploadFile", files[0]); + param.append('communityId', vc.getCurrentCommunity().communityId); + vc.http.upload( + 'uploadFile', + 'uploadImage', + param, { + emulateJSON: true, + //添加请求头 + headers: { + "Content-Type": "multipart/form-data" + } + }, + function(json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + var data = JSON.parse(json); + //关闭model + //$summernote.summernote('insertImage', "/callComponent/download/getFile/file?fileId=" + data.fileId + "&communityId=" + vc.getCurrentCommunity().communityId); + $summernote.summernote('insertImage', data.url); + return; + } + vc.toast(json); + }, + function(errInfo, error) { + console.log('请求失败处理'); + vc.toast(errInfo); + }); + }, } });