Browse Source

webpack5

master
陈裕财 4 years ago
parent
commit
1d863cbf49
  1. 2
      build/webpack.base.conf.js
  2. 8
      config/index.js
  3. 3
      index.html
  4. 6
      package.json
  5. 3
      src/components/Tinymce/Index.vue
  6. 300
      src/components/VueEditor/Index.vue
  7. 124
      src/components/editor/ImgEditor.vue
  8. 2
      src/views/mdp/workflow/re/procdefParames/ProcdefParamesSet.vue
  9. 2
      src/views/mdp/workflow/ru/procinstParames/ProcinstParamesStartSet.vue
  10. 2
      src/views/xm/core/components/headEditor.vue
  11. 2
      src/views/xm/core/xmExchange/TaskUserEditor.vue
  12. 2
      src/views/xm/core/xmFile/XmFileAdd.vue
  13. 2
      src/views/xm/core/xmFile/XmFileEdit.vue
  14. 2
      src/views/xm/core/xmMenuExchange/MenuUserEditor.vue
  15. 2
      src/views/xm/core/xmProject/XmProjectAssess.vue
  16. 2
      src/views/xm/core/xmQuestion/XmQuestionAdd.vue
  17. 2
      src/views/xm/core/xmQuestion/XmQuestionEdit.vue
  18. 2
      src/views/xm/core/xmTestCase/XmTestCaseAdd.vue
  19. 2
      src/views/xm/core/xmTestCase/XmTestCaseEdit.vue

2
build/webpack.base.conf.js

@ -100,7 +100,7 @@ module.exports = {
//...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
include: resolve('src'),
//include: resolve('src'),
use:[
threadLoaderConfig,
{

8
config/index.js

@ -11,7 +11,7 @@ module.exports = {
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
/**
'/api/m1/xm': {
target: 'http://localhost:7067',
changeOrigin: true,
@ -19,7 +19,7 @@ module.exports = {
'^/api/m1/xm': '/xm'
}
},
/**
'/api/m1/workflow': {
target: 'http://localhost:7080',
changeOrigin: true,
@ -58,7 +58,7 @@ module.exports = {
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: '#cheap-source-map',
devtool: 'eval',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
@ -90,7 +90,7 @@ module.exports = {
productionSourceMap: false,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
devtool: false,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.

3
index.html

@ -8,7 +8,8 @@
<title>项目管理系统</title>
</head>
<body>
<div id="app"></div>
<script src="./tinymce/tinymce.min.js"></script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

6
package.json

@ -17,7 +17,7 @@
"@jiaminghi/data-view": "^2.10.0",
"axios": "0.17.1",
"clipboard": "1.7.1",
"vue-clipboard2": "^0.3.3",
"vue-clipboard2": "^0.3.1",
"codemirror": "5.32.0",
"dayjs": "^1.8.29",
"decimal.js": "^10.2.0",
@ -42,8 +42,7 @@
"showdown": "1.8.5",
"simplemde": "1.11.2",
"sortablejs": "1.7.0",
"vue": "2.6.10",
"vue-clipboard2": "^0.3.1",
"vue": "2.6.14",
"vue-contextmenujs": "^1.3.10",
"vue-count-to": "1.0.13",
"vue-cropper": "^0.2.9",
@ -87,7 +86,6 @@
"file-loader": "^6.2.0",
"friendly-errors-plugin": "^1.1.2",
"friendly-errors-webpack-plugin": "^1.7.0",
"happypack": "^4.0.0",
"html-webpack-plugin": "^5.4.0",
"less": "^4.1.2",
"less-loader": "^10.2.0",

3
src/components/Tinymce/Index.vue

@ -6,10 +6,7 @@
</el-dialog>
</div>
</template>
<script>
import config from '@/common/config';//import
import UploadImage from '@/components/Image/UploadImage';
import { mapGetters } from 'vuex'

300
src/components/VueEditor/Index.vue

@ -1,300 +0,0 @@
<template>
<div>
<quill-editor style="width:100%;" v-model="content"
:options="editorOption"
:id="id"
ref="myTextEditor"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)">
<div :id="id+'_toolbar'" slot="toolbar">
<!-- Add a bold button -->
<button class="ql-bold">Bold</button>
<button class="ql-italic">Italic</button>
<button class="ql-underline">Underline</button>
<button class="ql-strike">Strike</button>
<button class="ql-header" value="1"></button>
<button class="ql-header" value="2"></button>
<button class="ql-header" value="3"></button>
<button class="ql-indent" value="+1"></button>
<button class="ql-indent" value="-1"></button>
<button class="ql-direction" value="rtl"></button>
<!-- Add font size dropdown -->
<select class="ql-size ql-picker">
<option value="small"></option>
<!-- Note a missing, thus falsy value, is used to reset to default -->
<option selected></option>
<option value="large"></option>
<option value="huge"></option>
</select>
<select class="ql-font">
<option selected="selected"></option>
<option value="serif"></option>
<option value="monospace"></option>
</select>
<select class="ql-color">
</select>
<select class="ql-background">
</select>
<!-- Add subscript and superscript buttons -->
<button class="ql-script" value="sub"></button>
<button class="ql-script" value="super"></button>
<button class="ql-link">链接</button>
<button class="ql-video">视频</button>
<!-- You can also add your own -->
<button id="custom-button-img" @click="mateImageButtonClick" style="width:80px;">图片库</button>
<el-upload ref="uploadFromFile" :action="uploadAction+'?userToken='+token" :on-change="fileChange" :accept="'image/*'" multiple :on-success="uploadSuccess" :on-error="handleUploadError" :show-file-list="false" :before-upload="beforeupload" :data="uploadOptions">
<el-button type="text">本地图片</el-button>
</el-upload>
</div>
</quill-editor>
<el-dialog title="裁剪图片" :visible.sync="shearMngVisible" top="0px" width="1100px" :lock-scroll="false" :close-on-click-modal="false" append-to-body>
<div slot="title">为了良好的客户体验app图片建议控制在50Kb左右宽400高300上限<br>如果是兼容pc的图片建议宽800高600为上限</div>
<shear-mng :imgWidth="myWidth" :imgHeight="myHeight" :image="image" :fullscreen.sync="fullscreen" :branch-id="uploadOptions.branchId" :category-id="image.categoryId" :remark="uploadOptions.remark" @cancel="shearMngVisible=false" @upload-success="uploadSuccess"></shear-mng>
</el-dialog>
<el-dialog title="选择图片" :visible.sync="addFormVisible" width="90%" top="0px" :close-on-click-modal="false" append-to-body>
<upload-image :branch-id="branchId" :multiple="true" :visible="addFormVisible" @cancel="addFormVisible=false" @confirm="handleConfirm"></upload-image>
</el-dialog>
</div>
</template>
<script>
import hljs from 'highlight.js'
//require styles
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import {quillEditor,Quill} from 'vue-quill-editor'
import { ImageDrop } from 'quill-image-drop-module'
import ImageResize from 'quill-image-resize-module'
Quill.register('modules/imageDrop', ImageDrop)
Quill.register('modules/imageResize', ImageResize)
import util from '@/common/js/util';//
import UploadImage from '@/components/Image/UploadImage';
import ShearMng from '@/components/Image/ShearSelectUpload';
import config from '@/common/config';//config
import { mapGetters } from 'vuex'
export default {
props:['branchId','categoryId','deptid','remark','value','imgWidth','imgHeight','id'],
watch: {
'value':function(val){
this.content = val;
},
'content':function(content){
this.$emit('input',content)
},
'imgWidth':function(val){
this.myWidth = val;
},
'imgHeight':function(val){
this.myHeight = val;
}
},
data() {
return {
name: '03-example',
content: "请填写内容/上传图片/视频等",
editorOption: {
modules: {
toolbar: '#'+this.id+'_toolbar',
history: {
delay: 1000,
maxStack: 50,
userOnly: false
},
imageDrop: true,
imageResize: {
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
}
}
},
fullscreen:false,
addFormVisible:false,
shearMngVisible:false,
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
image:{categoryId:'123'},
uploadOptions:{branchId:this.branchId,categoryId:this.categoryId,fileName:'',remark:'',deptid:this.deptid},//
previewVisible:false,
myWidth:this.imgWidth,
myHeight:this.imgHeight,//80||178
currentEditorIndex:0,//
uploadAction:config.getArcImagePath()+"/arc/image/upload",
}
},
components: {
quillEditor,
'upload-image':UploadImage,
'shear-mng':ShearMng
},
computed: {
...mapGetters([
'userInfo','token'
]),
contentCode() {
return hljs.highlightAuto(this.content).value
},
editor() {
return this.$refs.myTextEditor.quill
}
},
methods: {
onEditorBlur(editor) {
//console.log('editor blur!', editor)
},
onEditorFocus(editor) {
//console.log('editor focus!', editor)
},
onEditorReady(editor) {
console.log('editor ready!', editor)
this.content = this.value
},
imageButtonClick(ev) {
var oEvent = ev || event;
oEvent.preventDefault();
let addImgRange = this.editor.getSelection()
if(addImgRange==null){
this.currentEditorIndex=0
}else{
this.currentEditorIndex=addImgRange.index;
}
this.addFormVisible=true;
return false;
},
mateImageButtonClick(ev) {
var oEvent = ev || event;
oEvent.preventDefault();
let addImgRange = this.editor.getSelection()
if(addImgRange==null){
this.currentEditorIndex=0
}else{
this.currentEditorIndex=addImgRange.index;
}
this.addFormVisible=true;
return false;
},
handleConfirm(imgs){
const range = this.editor.getSelection();
var editorPosition=this.currentEditorIndex;
if(range!=null){
editorPosition=range.index;
}
imgs.forEach(i=>{
this.editor.insertEmbed(editorPosition, 'image', i.url, Quill.sources.USER)
editorPosition=editorPosition+1;
})
this.currentEditorIndex=editorPosition;
//this.shearMngVisible=true;
},
//64,
uploadSuccess(res){
const range = this.editor.getSelection();
var editorPosition=this.currentEditorIndex;
if(range!=null){
editorPosition=range.index;
}
this.editor.insertEmbed(editorPosition, 'image', res.data.url, Quill.sources.USER)
this.currentEditorIndex=editorPosition+1;
this.shearMngVisible=false;
/* }); */
//this.$emit('cancel');
},
handleUploadError : function(err, file, fileList){
this.$message({showClose: true, message: "文件上传失败,请检查文件是否过大,建议图片文件控制在500K内", type: "warning" });
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
converUrl(url){
if(url==null||url==''||url=='undefined'){
return url;
}
if(!url.indexOf('http')==0 && !url.indexOf('www')==0){
return config.getArcImagePath()+"/"+url;
}
return url;
},
previewImg(){
this.previewVisible=true;
},
beforeupload(file){
return true;
},
fileChange(file, fileList) {
var that = this;
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
console.log(file)
if(file.raw.type.indexOf('image')<0){
this.$message({showClose: true, message: "请选择图片文件", type: "warning" });
return false;
}
return true;
}
},
mounted() {
this.myWidth=this.imgWidth?this.imgWidth:400,
this.myHeight=this.imgHeight?this.imgHeight:300
console.log(this.$refs.uploadFromFile);
var that=this;
const imgHandler= function(isImage) {
console.log(isImage)
let addImgRange = that.editor.getSelection()
that.currentEditorIndex=addImgRange.index;
if (isImage) {
that.$refs.uploadFromFile.$el.querySelector(".el-upload input").click()
}
}
console.log(this.editor)
this.editor.getModule("toolbar").addHandler("image", imgHandler)
}
}
</script>
<style lang="scss">
.quill-editor,
.quill-code {
width: 50%;
float: left;
}
.quill-code {
height: auto;
border: none;
> .title {
border: 1px solid #ccc;
border-left: none;
height: 3em;
line-height: 3em;
text-indent: 1rem;
font-weight: bold;
}
> code {
width: 100%;
margin: 0;
padding: 1rem;
border: 1px solid #ccc;
border-top: none;
border-left: none;
border-radius: 0;
height: 30rem;
overflow-y: auto;
}
}
.quill-editor{
p {
>img {
float: left;
display: block;
}
}
}
</style>

124
src/components/editor/ImgEditor.vue

@ -1,124 +0,0 @@
<template>
<!--工具条1-->
<!--如果有更多工具条,放开此注释
<el-col :span="24" class="toolbar" size="small" style="padding-bottom: 0px;">
<el-col :span="4">
</el-col>
</el-col>
-->
<!--新增界面 Archive 档案信息表-->
<quill-editor ref="archiveContextEditor"
v-model="value"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)">
</quill-editor>
</template>
<script>
//begin
import { quillEditor,Quill } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { ImageDrop } from 'quill-image-drop-module'
import ImageResize from 'quill-image-resize-module'
Quill.register('modules/imageDrop', ImageDrop)
Quill.register('modules/imageResize', ImageResize)
//end
export default {
props:['value']
data() {
return {
editorOption: {
modules: {
toolbar: [
[{ 'size': ['small', false, 'large'] }],
['bold', 'italic'],
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
['link', 'image']
],
history: {
delay: 1000,
maxStack: 50,
userOnly: false
},
imageDrop: true,
imageResize: {
displayStyles: {
backgroundColor: 'black',
border: 'none',
color: 'white'
},
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
}
}
}
}
},
mounted() {
},
computed: {
contentCode() {
return hljs.highlightAuto(this.content).value
},
},
methods: {
onEditorBlur(editor) {
// console.log('editor blur!', editor)
},
onEditorFocus(editor) {
// console.log('editor focus!', editor)
},
onEditorReady(editor) {
// console.log('editor ready!', editor)
}
},
components: {
// 'archive-edit':ArchiveEdit
'quill-editor':quillEditor
},
}
</script>
<style>
.quill-editor:not(.bubble) .ql-container,
.quill-editor:not(.bubble) .ql-container .ql-editor {
height: 30rem;
padding-bottom: 1rem;
}
</style>
<style lang="scss" scoped>
.quill-editor,
.quill-code {
width: 50%;
float: left;
}
.quill-code {
height: auto;
border: none;
> .title {
border: 1px solid #ccc;
border-left: none;
height: 3em;
line-height: 3em;
text-indent: 1rem;
font-weight: bold;
}
> code {
width: 100%;
margin: 0;
padding: 1rem;
border: 1px solid #ccc;
border-top: none;
border-left: none;
border-radius: 0;
height: 30rem;
overflow-y: auto;
}
}
</style>

2
src/views/mdp/workflow/re/procdefParames/ProcdefParamesSet.vue

@ -250,7 +250,7 @@
import Sticky from '@/components/Sticky' // header
import { mapGetters } from 'vuex'
import AttachmentUpload from '@/views/mdp/arc/archiveAttachment/AttachmentUpload';
import VueEditor from '@/components/VueEditor/Index';
import VueEditor from '@/components/Tinymce/index';
import UsersSelect from '@/views/mdp/sys/user/UsersSelect';
import FormDefForFlowNode from '@/views/mdp/form/formDef/FormDefForFlowNode';

2
src/views/mdp/workflow/ru/procinstParames/ProcinstParamesStartSet.vue

@ -182,7 +182,7 @@
import { startProc } from '@/api/mdp/workflow/ru/execution';
import AttachmentUpload from '@/views/mdp/arc/archiveAttachment/AttachmentUpload';
import FormDataMngForFlowForm from '@/views/mdp/form/formData/FormDataMngForFlowForm';//
import VueEditor from '@/components/VueEditor/Index';
import VueEditor from '@/components/Tinymce/index';
import Sticky from '@/components/Sticky' // header
import { mapGetters } from 'vuex'

2
src/views/xm/core/components/headEditor.vue

@ -16,7 +16,7 @@
<script>
import util from '@/common/js/util';//
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import {sn} from '@/common/js/sequence';
export default {
props:["id","user","projectId","taskId","quoteId","replyId"],

2
src/views/xm/core/xmExchange/TaskUserEditor.vue

@ -17,7 +17,7 @@
<script>
import util from '@/common/js/util';//
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import {sn} from '@/common/js/sequence';
export default {
props:['id',"projectId","taskId",'user'],

2
src/views/xm/core/xmFile/XmFileAdd.vue

@ -35,7 +35,7 @@
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { addXmFile } from '@/api/xm/core/xmFile';
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; //
import {sn} from '@/common/js/sequence';

2
src/views/xm/core/xmFile/XmFileEdit.vue

@ -37,7 +37,7 @@
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { editXmFile } from '@/api/xm/core/xmFile';
import { mapGetters } from 'vuex'
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; //
export default {

2
src/views/xm/core/xmMenuExchange/MenuUserEditor.vue

@ -17,7 +17,7 @@
<script>
import util from '@/common/js/util';//
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import {sn} from '@/common/js/sequence';
export default {
props:['id',"productId","menuId",'user'],

2
src/views/xm/core/xmProject/XmProjectAssess.vue

@ -49,7 +49,7 @@
//import Sticky from '@/components/Sticky' // header
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { mapGetters } from 'vuex';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import { editAssess, listXmProject, delXmProject, batchDelXmProject } from '@/api/xm/core/xmProject';
export default {

2
src/views/xm/core/xmQuestion/XmQuestionAdd.vue

@ -109,7 +109,7 @@
import { mapGetters } from 'vuex';
import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; //
import {sn} from '@/common/js/sequence';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import XmGroupMng from '../xmProjectGroup/XmProjectGroupMng';
import xmMenuSelect from '../xmMenu/XmMenuSelect';

2
src/views/xm/core/xmQuestion/XmQuestionEdit.vue

@ -153,7 +153,7 @@
import {sn} from '@/common/js/sequence';
import XmGroupMng from '../xmProjectGroup/XmProjectGroupMng';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
import XmTaskList from '../xmTask/XmTaskList';
import xmMenuSelect from '../xmMenu/XmMenuSelect';

2
src/views/xm/core/xmTestCase/XmTestCaseAdd.vue

@ -48,7 +48,7 @@
import { addXmTestCase } from '@/api/xm/core/xmTestCase';
import { mapGetters } from 'vuex'
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
export default {
computed: {

2
src/views/xm/core/xmTestCase/XmTestCaseEdit.vue

@ -48,7 +48,7 @@
import { editXmTestCase } from '@/api/xm/core/xmTestCase';
import { mapGetters } from 'vuex'
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import VueEditor from '@/components/VueEditor';
import VueEditor from '@/components/Tinymce/index';
export default {
computed: {

Loading…
Cancel
Save