qj-common 4.3.0 → 4.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +12 -12
- package/.eslintrc.js +25 -25
- package/.idea/common.iml +11 -11
- package/.idea/modules.xml +7 -7
- package/.idea/vcs.xml +5 -5
- package/.postcssrc.js +9 -9
- package/.prettierrc.js +7 -7
- package/.project +37 -37
- package/README.md +2 -2
- package/gulpfile.js +20 -20
- package/package.json +18 -18
- package/src/api/apimanage.js +146 -146
- package/src/api/common/index.js +192 -192
- package/src/api/login.js +160 -160
- package/src/api/shopFbu.js +515 -515
- package/src/api/upload.js +8 -8
- package/src/components/Bounced/index.vue +145 -145
- package/src/components/Breadcrumb/index.vue +71 -71
- package/src/components/Checkbox/index.vue +53 -53
- package/src/components/Hamburger/index.vue +48 -48
- package/src/components/Logistics/logic.vue +186 -186
- package/src/components/ScrollBar/index.vue +60 -60
- package/src/components/Sticky/index.vue +76 -76
- package/src/components/SvgIcon/index.vue +42 -42
- package/src/components/ThemePicker/index.vue +243 -243
- package/src/components/Tinymce/components/editorImage.vue +94 -94
- package/src/components/Tinymce/index.vue +166 -166
- package/src/components/Tinymce/plugins.js +7 -7
- package/src/components/Tinymce/toolbar.js +6 -6
- package/src/components/TreeTable/customEval.js +44 -44
- package/src/components/TreeTable/eval.js +29 -29
- package/src/components/TreeTable/index.vue +124 -124
- package/src/components/TreeTable/readme.md +89 -89
- package/src/components/TreeTableApi/customEval.js +49 -49
- package/src/components/TreeTableApi/eval.js +29 -29
- package/src/components/TreeTableApi/index.vue +124 -124
- package/src/components/TreeTableApi/readme.md +89 -89
- package/src/components/Upload/singleImage.vue +123 -123
- package/src/components/Upload/singleImage2.vue +118 -118
- package/src/components/Upload/singleImage3.vue +138 -138
- package/src/components/Upload/upload.vue +295 -295
- package/src/components/workOrderList/index.vue +158 -158
- package/src/dependencies.js +119 -119
- package/src/iconShop/demo.css +539 -539
- package/src/iconShop/demo_index.html +8445 -8445
- package/src/iconShop/iconfont.css +1451 -1451
- package/src/iconShop/iconfont.json +2522 -2522
- package/src/iconShop/iconfont.svg +1070 -1070
- package/src/iconfont/demo.css +539 -539
- package/src/iconfont/demo_index.html +5276 -5276
- package/src/iconfont/iconfont.css +905 -905
- package/src/iconfont/iconfont.json +1563 -1563
- package/src/iconfont/iconfont.svg +692 -692
- package/src/icons/index.js +9 -9
- package/src/lang/e.js +48 -48
- package/src/lang/en.js +48 -48
- package/src/lang/zh.js +48 -48
- package/src/main.js +62 -62
- package/src/permission.js +283 -283
- package/src/permissionForMall.backup.js +375 -375
- package/src/permissionForMall.js +375 -375
- package/src/preset.js +67 -67
- package/src/router/_import_common.js +1 -1
- package/src/router/_import_development.js +1 -1
- package/src/router/_import_production.js +1 -1
- package/src/store/getters.js +39 -39
- package/src/store/index.js +18 -18
- package/src/store/modules/app.js +34 -30
- package/src/store/modules/menu.js +82 -82
- package/src/store/modules/user.js +227 -227
- package/src/styles/element-ui.scss +1368 -1368
- package/src/styles/index.scss +166 -166
- package/src/styles/mixin.scss +27 -27
- package/src/styles/pc-ui.scss +1031 -1031
- package/src/styles/scrollBar.scss +21 -21
- package/src/styles/sidebar.scss +123 -123
- package/src/styles/transition.scss +32 -32
- package/src/styles/variables.scss +44 -44
- package/src/styles/wf-ui.scss +86 -86
- package/src/utils/auth.js +57 -57
- package/src/utils/dom.js +12 -12
- package/src/utils/getQueryString.js +5 -5
- package/src/utils/import.js +5 -5
- package/src/utils/index.js +355 -355
- package/src/utils/interceptor.js +34 -34
- package/src/utils/menu.js +116 -116
- package/src/utils/proapp.js +35 -35
- package/src/utils/query.js +26 -26
- package/src/utils/request.js +366 -366
- package/src/utils/routeMapping.js +39 -39
- package/src/utils/routeMapping.json +310 -310
- package/src/utils/utils.js +84 -84
- package/src/utils/validate.js +102 -102
- package/src/views/404.vue +72 -72
- package/src/views/Layout.vue +106 -106
- package/src/views/imgSwiper/index.vue +34 -34
- package/src/views/layout/Layout.vue +181 -170
- package/src/views/layout/components/AppMain.vue +20 -20
- package/src/views/layout/components/Footer.vue +22 -22
- package/src/views/layout/components/LeftNavbar.vue +318 -310
- package/src/views/layout/components/NavMenu.vue +15 -15
- package/src/views/layout/components/Navbar.vue +664 -661
- package/src/views/layout/components/Sidebar/SidebarItem.vue +116 -113
- package/src/views/layout/components/Sidebar/index.vue +203 -193
- package/src/views/layout/components/index.js +19 -19
- package/src/views/layout/theme/darkBlue/Layout.vue +140 -140
- package/src/views/layout/theme/darkBlue/components/AppMain.vue +38 -38
- package/src/views/layout/theme/darkBlue/components/Footer.vue +147 -147
- package/src/views/layout/theme/darkBlue/components/LeftNavbar(/345/261/225/347/244/272/345/205/250/351/203/250/350/217/234/345/215/225).vue +448 -448
- package/src/views/layout/theme/darkBlue/components/LeftNavbar.3.vue +191 -191
- package/src/views/layout/theme/darkBlue/components/LeftNavbar.vue +466 -466
- package/src/views/layout/theme/darkBlue/components/Navbar.vue +200 -200
- package/src/views/layout/theme/darkBlue/components/Sidebar/SidebarItem.vue +71 -71
- package/src/views/layout/theme/darkBlue/components/Sidebar/index.vue +49 -49
- package/src/views/layout/theme/darkBlue/components/index.js +15 -15
- package/src/views/layout-default/Layout.vue +134 -134
- package/src/views/layout-default/components/AppMain.vue +19 -19
- package/src/views/layout-default/components/Footer.vue +22 -22
- package/src/views/layout-default/components/LeftNavbar.vue +164 -164
- package/src/views/layout-default/components/Navbar.vue +295 -295
- package/src/views/layout-default/components/Sidebar/SidebarItem.vue +67 -67
- package/src/views/layout-default/components/Sidebar/index.vue +59 -59
- package/src/views/layout-default/components/index.js +4 -4
- package/src/views/layout-default/theme/darkBlue/Layout.vue +140 -140
- package/src/views/layout-default/theme/darkBlue/components/AppMain.vue +38 -38
- package/src/views/layout-default/theme/darkBlue/components/Footer.vue +147 -147
- package/src/views/layout-default/theme/darkBlue/components/LeftNavbar.vue +465 -465
- package/src/views/layout-default/theme/darkBlue/components/Navbar.vue +200 -200
- package/src/views/layout-default/theme/darkBlue/components/Sidebar/SidebarItem.vue +69 -69
- package/src/views/layout-default/theme/darkBlue/components/Sidebar/index.vue +49 -49
- package/src/views/layout-default/theme/darkBlue/components/index.js +15 -15
- package/src/views/pc/Internationalization.vue +80 -80
- package/src/views/pc/default/Layout.vue +442 -442
- package/src/views/pc/default/LayoutCard.vue +424 -424
- package/src/views/pc/default/assets/flex.scss +99 -99
- package/src/views/pc/default/footer-modules/DgFooter/index.vue +179 -179
- package/src/views/pc/default/footer-modules/DgFooter/indexSDX.vue +187 -187
- package/src/views/pc/default/footer-modules/footer.vue +171 -171
- package/src/views/pc/default/footer-modules/footerAns.vue +167 -167
- package/src/views/pc/default/footer-modules/footerBulk.vue +169 -169
- package/src/views/pc/default/footer-modules/footerDM.vue +254 -254
- package/src/views/pc/default/footer-modules/footerDefault.vue +267 -267
- package/src/views/pc/default/footer-modules/footerDefaultA.vue +270 -270
- package/src/views/pc/default/footer-modules/footerDefaultNew.vue +201 -201
- package/src/views/pc/default/footer-modules/footerHDB.vue +153 -153
- package/src/views/pc/default/footer-modules/footerHy.vue +63 -63
- package/src/views/pc/default/footer-modules/footerKYW.vue +163 -163
- package/src/views/pc/default/footer-modules/footerMh.vue +30 -30
- package/src/views/pc/default/footer-modules/footerNew.vue +116 -116
- package/src/views/pc/default/footer-modules/footer_yzj.vue +169 -169
- package/src/views/pc/default/footer-modules/footerayd.vue +85 -85
- package/src/views/pc/default/footer-modules/ymFooter.vue +154 -154
- package/src/views/pc/default/footer-modules/zgl.vue +250 -250
- package/src/views/pc/default/header-modules/DgHeader/Logo.vue +57 -57
- package/src/views/pc/default/header-modules/DgHeader/Search.vue +135 -135
- package/src/views/pc/default/header-modules/DgHeader/Settleup.vue +46 -46
- package/src/views/pc/default/header-modules/DgHeader/index.vue +38 -38
- package/src/views/pc/default/header-modules/active.vue +177 -177
- package/src/views/pc/default/header-modules/header.vue +97 -97
- package/src/views/pc/default/header-modules/headerA.vue +142 -142
- package/src/views/pc/default/header-modules/headerFLPT.vue +157 -157
- package/src/views/pc/default/header-modules/headerMh.vue +187 -187
- package/src/views/pc/default/header-modules/headerNew.vue +121 -121
- package/src/views/pc/default/header-modules/headerSDX.vue +304 -304
- package/src/views/pc/default/header-modules/headerStyle2.vue +173 -173
- package/src/views/pc/default/header-modules/headerStyle3.vue +190 -190
- package/src/views/pc/default/header-modules/headerStyle4.vue +163 -163
- package/src/views/pc/default/header-modules/headerStyleAns.vue +400 -400
- package/src/views/pc/default/header-modules/headerStyleBulk.vue +427 -427
- package/src/views/pc/default/header-modules/headerStyleDefalut.vue +209 -209
- package/src/views/pc/default/header-modules/headerStyleKYW.vue +435 -435
- package/src/views/pc/default/header-modules/headerStyle_yzj.vue +427 -427
- package/src/views/pc/default/header-modules/headerayd.vue +187 -187
- package/src/views/pc/default/header-modules/index.vue +466 -466
- package/src/views/pc/default/header-modules/ymHeader.vue +292 -292
- package/src/views/pc/default/header-modules/ysHeader.vue +248 -248
- package/src/views/pc/default/header-modules/zgl.vue +855 -855
- package/src/views/pc/default/leftMenu-modules/leftMenu-logo.vue +194 -194
- package/src/views/pc/default/leftMenu-modules/leftMenu-style2.vue +206 -206
- package/src/views/pc/default/leftMenu-modules/leftMenu-style3.vue +207 -207
- package/src/views/pc/default/leftMenu-modules/leftMenu-style4.vue +192 -192
- package/src/views/pc/default/leftMenu-modules/leftMenu.vue +183 -183
- package/src/views/pc/default/leftMenu-modules/leftMenuDefault.vue +212 -212
- package/src/views/pc/default/leftMenu-modules/leftMenuDefaultEn.vue +214 -214
- package/src/views/pc/default/leftMenu-modules/leftMenuDefaultFLPT.vue +220 -220
- package/src/views/pc/default/leftMenu-modules/leftMenuDefaultayd.vue +220 -220
- package/src/views/pc/default/nav-modules/nav.vue +52 -52
- package/src/views/pc/default/nav-modules/navAns.vue +60 -60
- package/src/views/pc/default/nav-modules/navBulk.vue +60 -60
- package/src/views/pc/default/top-modules/DgTopShortcut/index.vue +177 -177
- package/src/views/pc/default/top-modules/Toplg.vue +280 -280
- package/src/views/pc/default/top-modules/topA.vue +136 -136
- package/src/views/pc/default/top-modules/topAns.vue +261 -261
- package/src/views/pc/default/top-modules/topAns_yzj.vue +282 -282
- package/src/views/pc/default/top-modules/topBar.vue +304 -304
- package/src/views/pc/default/top-modules/topBulk.vue +280 -280
- package/src/views/pc/default/top-modules/topDefault.vue +244 -244
- package/src/views/pc/default/top-modules/topDefaultDM.vue +197 -197
- package/src/views/pc/default/top-modules/topDefaultNew.vue +271 -271
- package/src/views/pc/default/top-modules/topFLPT.vue +197 -197
- package/src/views/pc/default/top-modules/topHDB.vue +479 -479
- package/src/views/pc/default/top-modules/topKYW.vue +258 -258
- package/src/views/pc/default/top-modules/topMh.vue +174 -174
- package/src/views/pc/default/top-modules/topNew.vue +97 -97
- package/src/views/pc/default/top-modules/topSDX.vue +298 -298
- package/src/views/pc/default/top-modules/topSimple.vue +247 -247
- package/src/views/pc/default/top-modules/topSimpleHy.vue +256 -256
- package/src/views/pc/default/top-modules/topUcc.vue +264 -264
- package/src/views/pc/default/top-modules/topayd.vue +170 -170
- package/src/views/pc/default/top-modules/ymTop.vue +299 -299
- package/src/views/pc/default/top-modules/zgltop.vue +499 -499
- package/src/views/routerView.vue +9 -9
- package/src/views/templates/components/temp-select.vue +80 -80
- package/src/views/templates/components/temp-upload.vue +233 -233
- package/src/views/templates/readme.md +2 -2
- package/src/views/templates/templateInput.vue +421 -421
- package/src/views/templates/templateReadme.html +588 -588
- package/src/views/templates/templateReadme.md +619 -619
- package/src/views/templates/templateTable.vue +2243 -2243
- package/src/views/templates/templateTableData.vue +1883 -1883
- package/src/views/templates/templateUi/templateTableContent.vue +187 -187
- package/src/views/treeTemplate/index.vue +559 -559
- package/src/views/treeTemplate/treeTemplate.md +274 -274
- package/src/views/uploadDialog/index copy.vue +352 -352
- package/src/views/uploadDialog/index.vue +558 -558
- package/src/views/uploadDialog/indexOlay.vue +582 -582
- package/src/views/uploadDialog/indexPM.vue +578 -578
- package/src/views/uploadDialog/indexUpload.vue +543 -543
- package/src/views/uploadDialog/readme.md +45 -45
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="upload-container">
|
|
3
|
-
<el-button icon='el-icon-upload' size="mini" :style="{background:color,borderColor:color}" @click=" dialogVisible=true" type="primary">上传图片
|
|
4
|
-
</el-button>
|
|
5
|
-
<el-dialog append-to-body :visible.sync="dialogVisible">
|
|
6
|
-
<el-upload class="editor-slide-upload" action="https://httpbin.org/post" :multiple="true" :file-list="fileList" :show-file-list="true"
|
|
7
|
-
list-type="picture-card" :on-remove="handleRemove" :on-success="handleSuccess" :before-upload="beforeUpload">
|
|
8
|
-
<el-button size="small" type="primary">点击上传</el-button>
|
|
9
|
-
</el-upload>
|
|
10
|
-
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
11
|
-
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
|
12
|
-
</el-dialog>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
// import { getToken } from 'api/qiniu'
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
name: 'editorSlideUpload',
|
|
21
|
-
props: {
|
|
22
|
-
color: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: '#1890ff'
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
data() {
|
|
28
|
-
return {
|
|
29
|
-
dialogVisible: false,
|
|
30
|
-
listObj: {},
|
|
31
|
-
fileList: []
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
methods: {
|
|
35
|
-
checkAllSuccess() {
|
|
36
|
-
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
|
|
37
|
-
},
|
|
38
|
-
handleSubmit() {
|
|
39
|
-
const arr = Object.keys(this.listObj).map(v => this.listObj[v])
|
|
40
|
-
if (!this.checkAllSuccess()) {
|
|
41
|
-
this.$message('请等待所有图片上传成功 或 出现了网络问题,请刷新页面重新上传!')
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
console.log(arr)
|
|
45
|
-
this.$emit('successCBK', arr)
|
|
46
|
-
this.listObj = {}
|
|
47
|
-
this.fileList = []
|
|
48
|
-
this.dialogVisible = false
|
|
49
|
-
},
|
|
50
|
-
handleSuccess(response, file) {
|
|
51
|
-
const uid = file.uid
|
|
52
|
-
const objKeyArr = Object.keys(this.listObj)
|
|
53
|
-
for (let i = 0, len = objKeyArr.length; i < len; i++) {
|
|
54
|
-
if (this.listObj[objKeyArr[i]].uid === uid) {
|
|
55
|
-
this.listObj[objKeyArr[i]].url = response.files.file
|
|
56
|
-
this.listObj[objKeyArr[i]].hasSuccess = true
|
|
57
|
-
return
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
handleRemove(file) {
|
|
62
|
-
const uid = file.uid
|
|
63
|
-
const objKeyArr = Object.keys(this.listObj)
|
|
64
|
-
for (let i = 0, len = objKeyArr.length; i < len; i++) {
|
|
65
|
-
if (this.listObj[objKeyArr[i]].uid === uid) {
|
|
66
|
-
delete this.listObj[objKeyArr[i]]
|
|
67
|
-
return
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
beforeUpload(file) {
|
|
72
|
-
const _self = this
|
|
73
|
-
const _URL = window.URL || window.webkitURL
|
|
74
|
-
const fileName = file.uid
|
|
75
|
-
this.listObj[fileName] = {}
|
|
76
|
-
return new Promise((resolve, reject) => {
|
|
77
|
-
const img = new Image()
|
|
78
|
-
img.src = _URL.createObjectURL(file)
|
|
79
|
-
img.onload = function() {
|
|
80
|
-
_self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }
|
|
81
|
-
}
|
|
82
|
-
resolve(true)
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
90
|
-
.upload-container {
|
|
91
|
-
.editor-slide-upload {
|
|
92
|
-
margin-bottom: 20px;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div class="upload-container">
|
|
3
|
+
<el-button icon='el-icon-upload' size="mini" :style="{background:color,borderColor:color}" @click=" dialogVisible=true" type="primary">上传图片
|
|
4
|
+
</el-button>
|
|
5
|
+
<el-dialog append-to-body :visible.sync="dialogVisible">
|
|
6
|
+
<el-upload class="editor-slide-upload" action="https://httpbin.org/post" :multiple="true" :file-list="fileList" :show-file-list="true"
|
|
7
|
+
list-type="picture-card" :on-remove="handleRemove" :on-success="handleSuccess" :before-upload="beforeUpload">
|
|
8
|
+
<el-button size="small" type="primary">点击上传</el-button>
|
|
9
|
+
</el-upload>
|
|
10
|
+
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
11
|
+
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
|
12
|
+
</el-dialog>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
// import { getToken } from 'api/qiniu'
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'editorSlideUpload',
|
|
21
|
+
props: {
|
|
22
|
+
color: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: '#1890ff'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
data() {
|
|
28
|
+
return {
|
|
29
|
+
dialogVisible: false,
|
|
30
|
+
listObj: {},
|
|
31
|
+
fileList: []
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
checkAllSuccess() {
|
|
36
|
+
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
|
|
37
|
+
},
|
|
38
|
+
handleSubmit() {
|
|
39
|
+
const arr = Object.keys(this.listObj).map(v => this.listObj[v])
|
|
40
|
+
if (!this.checkAllSuccess()) {
|
|
41
|
+
this.$message('请等待所有图片上传成功 或 出现了网络问题,请刷新页面重新上传!')
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
console.log(arr)
|
|
45
|
+
this.$emit('successCBK', arr)
|
|
46
|
+
this.listObj = {}
|
|
47
|
+
this.fileList = []
|
|
48
|
+
this.dialogVisible = false
|
|
49
|
+
},
|
|
50
|
+
handleSuccess(response, file) {
|
|
51
|
+
const uid = file.uid
|
|
52
|
+
const objKeyArr = Object.keys(this.listObj)
|
|
53
|
+
for (let i = 0, len = objKeyArr.length; i < len; i++) {
|
|
54
|
+
if (this.listObj[objKeyArr[i]].uid === uid) {
|
|
55
|
+
this.listObj[objKeyArr[i]].url = response.files.file
|
|
56
|
+
this.listObj[objKeyArr[i]].hasSuccess = true
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
handleRemove(file) {
|
|
62
|
+
const uid = file.uid
|
|
63
|
+
const objKeyArr = Object.keys(this.listObj)
|
|
64
|
+
for (let i = 0, len = objKeyArr.length; i < len; i++) {
|
|
65
|
+
if (this.listObj[objKeyArr[i]].uid === uid) {
|
|
66
|
+
delete this.listObj[objKeyArr[i]]
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
beforeUpload(file) {
|
|
72
|
+
const _self = this
|
|
73
|
+
const _URL = window.URL || window.webkitURL
|
|
74
|
+
const fileName = file.uid
|
|
75
|
+
this.listObj[fileName] = {}
|
|
76
|
+
return new Promise((resolve, reject) => {
|
|
77
|
+
const img = new Image()
|
|
78
|
+
img.src = _URL.createObjectURL(file)
|
|
79
|
+
img.onload = function() {
|
|
80
|
+
_self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }
|
|
81
|
+
}
|
|
82
|
+
resolve(true)
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
90
|
+
.upload-container {
|
|
91
|
+
.editor-slide-upload {
|
|
92
|
+
margin-bottom: 20px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
95
|
</style>
|
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="tinymce-container editor-container">
|
|
3
|
-
<textarea class="tinymce-textarea" :id="tinymceId"></textarea>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import editorImage from './components/editorImage'
|
|
9
|
-
import plugins from './plugins'
|
|
10
|
-
import toolbar from './toolbar'
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
name: 'tinymce',
|
|
14
|
-
components: { editorImage },
|
|
15
|
-
props: {
|
|
16
|
-
id: {
|
|
17
|
-
type: String
|
|
18
|
-
},
|
|
19
|
-
value: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: ''
|
|
22
|
-
},
|
|
23
|
-
toolbar: {
|
|
24
|
-
type: Array,
|
|
25
|
-
required: false,
|
|
26
|
-
default() {
|
|
27
|
-
return []
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
menubar: {
|
|
31
|
-
default: 'file edit insert view format table'
|
|
32
|
-
},
|
|
33
|
-
height: {
|
|
34
|
-
type: Number,
|
|
35
|
-
required: false,
|
|
36
|
-
default: 360
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
data() {
|
|
40
|
-
return {
|
|
41
|
-
hasChange: false,
|
|
42
|
-
hasInit: false,
|
|
43
|
-
tinymceId: this.id || 'vue-tinymce-' + +new Date()
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
watch: {
|
|
47
|
-
value(val) {
|
|
48
|
-
if (!this.hasChange && this.hasInit) {
|
|
49
|
-
this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val))
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
mounted() {
|
|
54
|
-
this.initTinymce()
|
|
55
|
-
},
|
|
56
|
-
activated() {
|
|
57
|
-
this.initTinymce()
|
|
58
|
-
},
|
|
59
|
-
deactivated() {
|
|
60
|
-
this.destroyTinymce()
|
|
61
|
-
},
|
|
62
|
-
methods: {
|
|
63
|
-
initTinymce() {
|
|
64
|
-
const _this = this
|
|
65
|
-
window.tinymce.init({
|
|
66
|
-
selector: `#${this.tinymceId}`,
|
|
67
|
-
height: this.height,
|
|
68
|
-
body_class: 'panel-body ',
|
|
69
|
-
object_resizing: false,
|
|
70
|
-
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
|
|
71
|
-
menubar: this.menubar,
|
|
72
|
-
plugins: plugins,
|
|
73
|
-
end_container_on_empty_block: true,
|
|
74
|
-
powerpaste_word_import: 'clean',
|
|
75
|
-
code_dialog_height: 450,
|
|
76
|
-
code_dialog_width: 1000,
|
|
77
|
-
advlist_bullet_styles: 'square',
|
|
78
|
-
advlist_number_styles: 'default',
|
|
79
|
-
imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
|
|
80
|
-
default_link_target: '_blank',
|
|
81
|
-
link_title: false,
|
|
82
|
-
// language:'zh-CN',
|
|
83
|
-
init_instance_callback: editor => {
|
|
84
|
-
if (_this.value) {
|
|
85
|
-
editor.setContent(_this.value)
|
|
86
|
-
}
|
|
87
|
-
_this.hasInit = true
|
|
88
|
-
editor.on('NodeChange Change KeyUp SetContent', () => {
|
|
89
|
-
this.hasChange = true
|
|
90
|
-
this.$emit('input', editor.getContent())
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
// 整合七牛上传
|
|
94
|
-
// images_dataimg_filter(img) {
|
|
95
|
-
// setTimeout(() => {
|
|
96
|
-
// const $image = $(img);
|
|
97
|
-
// $image.removeAttr('width');
|
|
98
|
-
// $image.removeAttr('height');
|
|
99
|
-
// if ($image[0].height && $image[0].width) {
|
|
100
|
-
// $image.attr('data-wscntype', 'image');
|
|
101
|
-
// $image.attr('data-wscnh', $image[0].height);
|
|
102
|
-
// $image.attr('data-wscnw', $image[0].width);
|
|
103
|
-
// $image.addClass('wscnph');
|
|
104
|
-
// }
|
|
105
|
-
// }, 0);
|
|
106
|
-
// return img
|
|
107
|
-
// },
|
|
108
|
-
// images_upload_handler(blobInfo, success, failure, progress) {
|
|
109
|
-
// progress(0);
|
|
110
|
-
// const token = _this.$store.getters.token;
|
|
111
|
-
// getToken(token).then(response => {
|
|
112
|
-
// const url = response.data.qiniu_url;
|
|
113
|
-
// const formData = new FormData();
|
|
114
|
-
// formData.append('token', response.data.qiniu_token);
|
|
115
|
-
// formData.append('key', response.data.qiniu_key);
|
|
116
|
-
// formData.append('file', blobInfo.blob(), url);
|
|
117
|
-
// upload(formData).then(() => {
|
|
118
|
-
// success(url);
|
|
119
|
-
// progress(100);
|
|
120
|
-
// })
|
|
121
|
-
// }).catch(err => {
|
|
122
|
-
// failure('出现未知问题,刷新页面,或者联系程序员')
|
|
123
|
-
// console.log(err);
|
|
124
|
-
// });
|
|
125
|
-
// },
|
|
126
|
-
})
|
|
127
|
-
},
|
|
128
|
-
destroyTinymce() {
|
|
129
|
-
if (window.tinymce.get(this.tinymceId)) {
|
|
130
|
-
window.tinymce.get(this.tinymceId).destroy()
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
setContent(value) {
|
|
134
|
-
window.tinymce.get(this.tinymceId).setContent(value)
|
|
135
|
-
},
|
|
136
|
-
getContent() {
|
|
137
|
-
window.tinymce.get(this.tinymceId).getContent()
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
destroyed() {
|
|
141
|
-
this.destroyTinymce()
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
</script>
|
|
145
|
-
|
|
146
|
-
<style scoped>
|
|
147
|
-
.tinymce-container {
|
|
148
|
-
position: relative;
|
|
149
|
-
}
|
|
150
|
-
.tinymce-container>>>.mce-fullscreen {
|
|
151
|
-
z-index: 10000;
|
|
152
|
-
}
|
|
153
|
-
.tinymce-textarea {
|
|
154
|
-
visibility: hidden;
|
|
155
|
-
z-index: -1;
|
|
156
|
-
}
|
|
157
|
-
.editor-custom-btn-container {
|
|
158
|
-
position: absolute;
|
|
159
|
-
right: 4px;
|
|
160
|
-
top: 4px;
|
|
161
|
-
/*z-index: 2005;*/
|
|
162
|
-
}
|
|
163
|
-
.editor-upload-btn {
|
|
164
|
-
display: inline-block;
|
|
165
|
-
}
|
|
166
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tinymce-container editor-container">
|
|
3
|
+
<textarea class="tinymce-textarea" :id="tinymceId"></textarea>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import editorImage from './components/editorImage'
|
|
9
|
+
import plugins from './plugins'
|
|
10
|
+
import toolbar from './toolbar'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: 'tinymce',
|
|
14
|
+
components: { editorImage },
|
|
15
|
+
props: {
|
|
16
|
+
id: {
|
|
17
|
+
type: String
|
|
18
|
+
},
|
|
19
|
+
value: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ''
|
|
22
|
+
},
|
|
23
|
+
toolbar: {
|
|
24
|
+
type: Array,
|
|
25
|
+
required: false,
|
|
26
|
+
default() {
|
|
27
|
+
return []
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
menubar: {
|
|
31
|
+
default: 'file edit insert view format table'
|
|
32
|
+
},
|
|
33
|
+
height: {
|
|
34
|
+
type: Number,
|
|
35
|
+
required: false,
|
|
36
|
+
default: 360
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
hasChange: false,
|
|
42
|
+
hasInit: false,
|
|
43
|
+
tinymceId: this.id || 'vue-tinymce-' + +new Date()
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
watch: {
|
|
47
|
+
value(val) {
|
|
48
|
+
if (!this.hasChange && this.hasInit) {
|
|
49
|
+
this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val))
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
mounted() {
|
|
54
|
+
this.initTinymce()
|
|
55
|
+
},
|
|
56
|
+
activated() {
|
|
57
|
+
this.initTinymce()
|
|
58
|
+
},
|
|
59
|
+
deactivated() {
|
|
60
|
+
this.destroyTinymce()
|
|
61
|
+
},
|
|
62
|
+
methods: {
|
|
63
|
+
initTinymce() {
|
|
64
|
+
const _this = this
|
|
65
|
+
window.tinymce.init({
|
|
66
|
+
selector: `#${this.tinymceId}`,
|
|
67
|
+
height: this.height,
|
|
68
|
+
body_class: 'panel-body ',
|
|
69
|
+
object_resizing: false,
|
|
70
|
+
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
|
|
71
|
+
menubar: this.menubar,
|
|
72
|
+
plugins: plugins,
|
|
73
|
+
end_container_on_empty_block: true,
|
|
74
|
+
powerpaste_word_import: 'clean',
|
|
75
|
+
code_dialog_height: 450,
|
|
76
|
+
code_dialog_width: 1000,
|
|
77
|
+
advlist_bullet_styles: 'square',
|
|
78
|
+
advlist_number_styles: 'default',
|
|
79
|
+
imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
|
|
80
|
+
default_link_target: '_blank',
|
|
81
|
+
link_title: false,
|
|
82
|
+
// language:'zh-CN',
|
|
83
|
+
init_instance_callback: editor => {
|
|
84
|
+
if (_this.value) {
|
|
85
|
+
editor.setContent(_this.value)
|
|
86
|
+
}
|
|
87
|
+
_this.hasInit = true
|
|
88
|
+
editor.on('NodeChange Change KeyUp SetContent', () => {
|
|
89
|
+
this.hasChange = true
|
|
90
|
+
this.$emit('input', editor.getContent())
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
// 整合七牛上传
|
|
94
|
+
// images_dataimg_filter(img) {
|
|
95
|
+
// setTimeout(() => {
|
|
96
|
+
// const $image = $(img);
|
|
97
|
+
// $image.removeAttr('width');
|
|
98
|
+
// $image.removeAttr('height');
|
|
99
|
+
// if ($image[0].height && $image[0].width) {
|
|
100
|
+
// $image.attr('data-wscntype', 'image');
|
|
101
|
+
// $image.attr('data-wscnh', $image[0].height);
|
|
102
|
+
// $image.attr('data-wscnw', $image[0].width);
|
|
103
|
+
// $image.addClass('wscnph');
|
|
104
|
+
// }
|
|
105
|
+
// }, 0);
|
|
106
|
+
// return img
|
|
107
|
+
// },
|
|
108
|
+
// images_upload_handler(blobInfo, success, failure, progress) {
|
|
109
|
+
// progress(0);
|
|
110
|
+
// const token = _this.$store.getters.token;
|
|
111
|
+
// getToken(token).then(response => {
|
|
112
|
+
// const url = response.data.qiniu_url;
|
|
113
|
+
// const formData = new FormData();
|
|
114
|
+
// formData.append('token', response.data.qiniu_token);
|
|
115
|
+
// formData.append('key', response.data.qiniu_key);
|
|
116
|
+
// formData.append('file', blobInfo.blob(), url);
|
|
117
|
+
// upload(formData).then(() => {
|
|
118
|
+
// success(url);
|
|
119
|
+
// progress(100);
|
|
120
|
+
// })
|
|
121
|
+
// }).catch(err => {
|
|
122
|
+
// failure('出现未知问题,刷新页面,或者联系程序员')
|
|
123
|
+
// console.log(err);
|
|
124
|
+
// });
|
|
125
|
+
// },
|
|
126
|
+
})
|
|
127
|
+
},
|
|
128
|
+
destroyTinymce() {
|
|
129
|
+
if (window.tinymce.get(this.tinymceId)) {
|
|
130
|
+
window.tinymce.get(this.tinymceId).destroy()
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
setContent(value) {
|
|
134
|
+
window.tinymce.get(this.tinymceId).setContent(value)
|
|
135
|
+
},
|
|
136
|
+
getContent() {
|
|
137
|
+
window.tinymce.get(this.tinymceId).getContent()
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
destroyed() {
|
|
141
|
+
this.destroyTinymce()
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
</script>
|
|
145
|
+
|
|
146
|
+
<style scoped>
|
|
147
|
+
.tinymce-container {
|
|
148
|
+
position: relative;
|
|
149
|
+
}
|
|
150
|
+
.tinymce-container>>>.mce-fullscreen {
|
|
151
|
+
z-index: 10000;
|
|
152
|
+
}
|
|
153
|
+
.tinymce-textarea {
|
|
154
|
+
visibility: hidden;
|
|
155
|
+
z-index: -1;
|
|
156
|
+
}
|
|
157
|
+
.editor-custom-btn-container {
|
|
158
|
+
position: absolute;
|
|
159
|
+
right: 4px;
|
|
160
|
+
top: 4px;
|
|
161
|
+
/*z-index: 2005;*/
|
|
162
|
+
}
|
|
163
|
+
.editor-upload-btn {
|
|
164
|
+
display: inline-block;
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Any plugins you want to use has to be imported
|
|
2
|
-
// Detail plugins list see https://www.tinymce.com/docs/plugins/
|
|
3
|
-
// Custom builds see https://www.tinymce.com/download/custom-builds/
|
|
4
|
-
|
|
5
|
-
const plugins = ['advlist anchor autolink autoresize autosave bbcode code hr legacyoutput link lists nonbreaking noneditable pagebreak paste preview print searchreplace template textcolor ']
|
|
6
|
-
|
|
7
|
-
export default plugins
|
|
1
|
+
// Any plugins you want to use has to be imported
|
|
2
|
+
// Detail plugins list see https://www.tinymce.com/docs/plugins/
|
|
3
|
+
// Custom builds see https://www.tinymce.com/download/custom-builds/
|
|
4
|
+
|
|
5
|
+
const plugins = ['advlist anchor autolink autoresize autosave bbcode code hr legacyoutput link lists nonbreaking noneditable pagebreak paste preview print searchreplace template textcolor ']
|
|
6
|
+
|
|
7
|
+
export default plugins
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// Here is a list of the toolbar
|
|
2
|
-
// Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
|
|
3
|
-
|
|
4
|
-
const toolbar = ['bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak fullscreen insertdatetime media table emoticons forecolor backcolor']
|
|
5
|
-
|
|
6
|
-
export default toolbar
|
|
1
|
+
// Here is a list of the toolbar
|
|
2
|
+
// Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
|
|
3
|
+
|
|
4
|
+
const toolbar = ['bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak fullscreen insertdatetime media table emoticons forecolor backcolor']
|
|
5
|
+
|
|
6
|
+
export default toolbar
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
export default function treeToArray(data, expandAll, parent, level, item) {
|
|
4
|
-
const marLTemp = []
|
|
5
|
-
let tmp = []
|
|
6
|
-
Array.from(data).forEach(function(record) {
|
|
7
|
-
if (record._expanded === undefined) {
|
|
8
|
-
Vue.set(record, '_expanded', expandAll)
|
|
9
|
-
}
|
|
10
|
-
let _level = 1
|
|
11
|
-
if (level !== undefined && level !== null) {
|
|
12
|
-
_level = level + 1
|
|
13
|
-
}
|
|
14
|
-
Vue.set(record, '_level', _level)
|
|
15
|
-
// 如果有父元素
|
|
16
|
-
if (parent) {
|
|
17
|
-
Vue.set(record, 'parent', parent)
|
|
18
|
-
// 如果父元素有偏移量,需要计算在this的偏移量中
|
|
19
|
-
// 偏移量还与前面同级元素有关,需要加上前面所有元素的长度和
|
|
20
|
-
if (!marLTemp[_level]) {
|
|
21
|
-
marLTemp[_level] = 0
|
|
22
|
-
}
|
|
23
|
-
Vue.set(record, '_marginLeft', marLTemp[_level] + parent._marginLeft)
|
|
24
|
-
Vue.set(record, '_width', record[item] / parent[item] * parent._width)
|
|
25
|
-
// 在本次计算过偏移量后加上自己长度,以供下一个元素使用
|
|
26
|
-
marLTemp[_level] += record._width
|
|
27
|
-
} else {
|
|
28
|
-
// 如果为根
|
|
29
|
-
// 初始化偏移量存储map
|
|
30
|
-
marLTemp[record.id] = []
|
|
31
|
-
// map中是一个数组,存储的是每级的长度和
|
|
32
|
-
// 初始情况下为0
|
|
33
|
-
marLTemp[record.id][_level] = 0
|
|
34
|
-
Vue.set(record, '_marginLeft', 0)
|
|
35
|
-
Vue.set(record, '_width', 1)
|
|
36
|
-
}
|
|
37
|
-
tmp.push(record)
|
|
38
|
-
if (record.children && record.children.length > 0) {
|
|
39
|
-
const children = treeToArray(record.children, expandAll, record, _level, item)
|
|
40
|
-
tmp = tmp.concat(children)
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
return tmp
|
|
44
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
export default function treeToArray(data, expandAll, parent, level, item) {
|
|
4
|
+
const marLTemp = []
|
|
5
|
+
let tmp = []
|
|
6
|
+
Array.from(data).forEach(function(record) {
|
|
7
|
+
if (record._expanded === undefined) {
|
|
8
|
+
Vue.set(record, '_expanded', expandAll)
|
|
9
|
+
}
|
|
10
|
+
let _level = 1
|
|
11
|
+
if (level !== undefined && level !== null) {
|
|
12
|
+
_level = level + 1
|
|
13
|
+
}
|
|
14
|
+
Vue.set(record, '_level', _level)
|
|
15
|
+
// 如果有父元素
|
|
16
|
+
if (parent) {
|
|
17
|
+
Vue.set(record, 'parent', parent)
|
|
18
|
+
// 如果父元素有偏移量,需要计算在this的偏移量中
|
|
19
|
+
// 偏移量还与前面同级元素有关,需要加上前面所有元素的长度和
|
|
20
|
+
if (!marLTemp[_level]) {
|
|
21
|
+
marLTemp[_level] = 0
|
|
22
|
+
}
|
|
23
|
+
Vue.set(record, '_marginLeft', marLTemp[_level] + parent._marginLeft)
|
|
24
|
+
Vue.set(record, '_width', record[item] / parent[item] * parent._width)
|
|
25
|
+
// 在本次计算过偏移量后加上自己长度,以供下一个元素使用
|
|
26
|
+
marLTemp[_level] += record._width
|
|
27
|
+
} else {
|
|
28
|
+
// 如果为根
|
|
29
|
+
// 初始化偏移量存储map
|
|
30
|
+
marLTemp[record.id] = []
|
|
31
|
+
// map中是一个数组,存储的是每级的长度和
|
|
32
|
+
// 初始情况下为0
|
|
33
|
+
marLTemp[record.id][_level] = 0
|
|
34
|
+
Vue.set(record, '_marginLeft', 0)
|
|
35
|
+
Vue.set(record, '_width', 1)
|
|
36
|
+
}
|
|
37
|
+
tmp.push(record)
|
|
38
|
+
if (record.children && record.children.length > 0) {
|
|
39
|
+
const children = treeToArray(record.children, expandAll, record, _level, item)
|
|
40
|
+
tmp = tmp.concat(children)
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
return tmp
|
|
44
|
+
}
|