Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
InJoyU
vue-element-admin
提交
168150ff
V
vue-element-admin
项目概览
InJoyU
/
vue-element-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-element-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
168150ff
编写于
4月 26, 2017
作者:
P
Pan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine code
上级
db83dd50
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
54 addition
and
157 deletion
+54
-157
src/components/Charts/keyboard.vue
src/components/Charts/keyboard.vue
+1
-2
src/components/MDinput/index.vue
src/components/MDinput/index.vue
+24
-134
src/components/MdEditor/index.vue
src/components/MdEditor/index.vue
+10
-7
src/components/PanThumb/index.vue
src/components/PanThumb/index.vue
+1
-1
src/components/Tinymce/index.vue
src/components/Tinymce/index.vue
+11
-3
src/directive/sticky.js
src/directive/sticky.js
+6
-8
src/router/index.js
src/router/index.js
+0
-1
src/views/components/markdown.vue
src/views/components/markdown.vue
+1
-1
未找到文件。
src/components/Charts/keyboard.vue
浏览文件 @
168150ff
...
...
@@ -105,8 +105,7 @@
return
idx
*
20
;
}
}]
}
)
})
}
}
}
...
...
src/components/MDinput/index.vue
浏览文件 @
168150ff
<
template
>
<div
class=
"material-input__component"
:class=
"computedClasses"
>
<input
v-if=
"type === 'email'"
type=
"email"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'url'"
type=
"url"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'number'"
type=
"number"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:max=
"max"
:min=
"min"
:minlength=
"minlength"
:maxlength=
"maxlength"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'password'"
type=
"password"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:max=
"max"
:min=
"min"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'tel'"
type=
"tel"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'text'"
type=
"text"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:minlength=
"minlength"
:maxlength=
"maxlength"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'email'"
type=
"email"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'url'"
type=
"url"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'number'"
type=
"number"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:max=
"max"
:min=
"min"
:minlength=
"minlength"
:maxlength=
"maxlength"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'password'"
type=
"password"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:max=
"max"
:min=
"min"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'tel'"
type=
"tel"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<input
v-if=
"type === 'text'"
type=
"text"
class=
"material-input"
:name=
"name"
:id=
"id"
:placeholder=
"placeholder"
v-model=
"valueCopy"
:readonly=
"readonly"
:disabled=
"disabled"
:autocomplete=
"autocomplete"
:minlength=
"minlength"
:maxlength=
"maxlength"
:required=
"required"
@
focus=
"handleFocus(true)"
@
blur=
"handleFocus(false)"
@
input=
"handleModelInput"
>
<span
class=
"material-input-bar"
></span>
...
...
@@ -137,6 +33,7 @@
</
template
>
<
script
>
// source:https://github.com/wemake-services/vue-material-input/blob/master/src/components/MaterialInput.vue
export
default
{
name
:
'
material-input
'
,
computed
:
{
...
...
@@ -148,12 +45,8 @@
return
{
'
material--active
'
:
this
.
focus
,
'
material--disabled
'
:
this
.
disabled
,
'
material--has-errors
'
:
Boolean
(
!
this
.
valid
||
(
this
.
errorMessages
&&
this
.
errorMessages
.
length
)),
'
material--raised
'
:
Boolean
(
this
.
focus
||
this
.
valueCopy
||
// has value
'
material--has-errors
'
:
Boolean
(
!
this
.
valid
||
(
this
.
errorMessages
&&
this
.
errorMessages
.
length
)),
'
material--raised
'
:
Boolean
(
this
.
focus
||
this
.
valueCopy
||
// has value
(
this
.
placeholder
&&
!
this
.
valueCopy
))
// has placeholder
}
}
...
...
@@ -166,8 +59,8 @@
}
},
beforeMount
()
{
// Here we are following the Vue2 convention on custom v-model:
// https://github.com/vuejs/vue/issues/2873#issuecomment-223759341
// Here we are following the Vue2 convention on custom v-model:
// https://github.com/vuejs/vue/issues/2873#issuecomment-223759341
this
.
copyValue
(
this
.
value
)
},
methods
:
{
...
...
@@ -179,8 +72,7 @@
this
.
focus
=
focused
},
handleValidation
()
{
this
.
valid
=
this
.
$el
?
this
.
$el
.
querySelector
(
'
.material-input
'
).
validity
.
valid
:
this
.
valid
this
.
valid
=
this
.
$el
?
this
.
$el
.
querySelector
(
'
.material-input
'
).
validity
.
valid
:
this
.
valid
},
copyValue
(
value
)
{
this
.
valueCopy
=
value
...
...
@@ -388,8 +280,6 @@
}
// Errors:
&
.material--has-errors
{
// These styles are required
// for custom validation:
&
.material--active
.material-label
{
color
:
$color-red
;
}
...
...
src/components/MdEditor/index.vue
浏览文件 @
168150ff
<
template
>
<div
class=
'simplemde-container'
>
<div
class=
'simplemde-container'
:style=
"
{height:height+'px',zIndex:zIndex}"
>
<textarea
:id=
'id'
>
</textarea>
</div>
...
...
@@ -24,11 +24,16 @@ export default {
type
:
String
,
default
:
''
},
height
:
{
type
:
Number
,
default
:
150
},
zIndex
:
{
type
:
Number
,
default
:
10
},
toolbar
:
{
type
:
Array
// default() {
// return ['bold', '|', 'link']
// }
}
},
data
()
{
...
...
@@ -58,7 +63,6 @@ export default {
if
(
this
.
value
)
{
this
.
simplemde
.
value
(
this
.
value
);
}
this
.
simplemde
.
codemirror
.
on
(
'
change
'
,
()
=>
{
if
(
this
.
hasChange
)
{
this
.
hasChange
=
true
...
...
@@ -74,7 +78,7 @@ export default {
<
style
>
.simplemde-container
.CodeMirror
{
height
:
150px
;
/*height: 150px;*/
min-height
:
150px
;
}
.simplemde-container
.CodeMirror-scroll
{
...
...
@@ -102,7 +106,6 @@ export default {
font-weight
:
bold
;
color
:
#E61E1E
;
}
</
style
>
src/components/PanThumb/index.vue
浏览文件 @
168150ff
...
...
@@ -2,7 +2,7 @@
<div
class=
"pan-item"
:style=
"
{zIndex:zIndex,height:height,width:width}">
<div
class=
"pan-info"
>
<div
class=
"pan-info-roles-container"
>
<slot>
pan
</slot>
<slot></slot>
</div>
</div>
<img
class=
"pan-thumb"
:src=
"image"
>
...
...
src/components/Tinymce/index.vue
浏览文件 @
168150ff
<
template
>
<div
class=
'tinymce-container editor-container'
>
<textarea
class=
'tinymce-textarea'
:id=
"id"
></textarea>
<!--业务需求可删除-->
<div
class=
"editor-custom-btn-container"
>
<editorSlide
v-if=
"customButton.indexOf('editorSlide')>=0"
color=
"#3A71A8"
class=
"editor-upload-btn"
@
successCBK=
"slideSuccessCBK"
></editorSlide>
<editorAudio
v-if=
"customButton.indexOf('editorAudio')>=0"
color=
"#30B08F"
class=
"editor-upload-btn"
@
successCBK=
"aduioSuccessCBK"
></editorAudio>
<editorVideo
v-if=
"customButton.indexOf('editorVideo')>=0"
color=
"#E65D6E"
class=
"editor-upload-btn"
@
successCBK=
"videoSuccessCBK"
></editorVideo>
<editorImage
v-if=
"customButton.indexOf('editorImage')>=0"
color=
"#20a0ff"
class=
"editor-upload-btn"
@
successCBK=
"imageSuccessCBK"
></editorImage>
<!--业务需求可删除-->
</div>
</div>
</
template
>
<
script
>
// tinymce 在最外层目录static下 ,由index.html直接引入,挂载在window下。不通过impot,不打包
// 业务需求可删除
import
editorAudio
from
'
./components/editorAudio
'
;
import
editorVideo
from
'
./components/editorVideo
'
;
import
editorSlide
from
'
./components/editorSlide
'
;
import
editorImage
from
'
./components/editorImage
'
;
import
{
getToken
,
upload
}
from
'
api/qiniu
'
;
import
{
getToken
,
upload
}
from
'
api/qiniu
'
;
// 七牛
// 业务需求可删除
export
default
{
name
:
'
tinymce
'
,
components
:
{
editorImage
,
editorAudio
,
editorSlide
,
editorVideo
},
components
:
{
editorImage
,
editorAudio
,
editorSlide
,
editorVideo
},
// 业务需求可删除
props
:
{
id
:
{
type
:
String
,
...
...
@@ -100,6 +105,7 @@
this
.
$emit
(
'
input
'
,
editor
.
getContent
({
format
:
'
raw
'
}));
});
},
// 整合七牛上传
// images_dataimg_filter(img) {
// setTimeout(() => {
// const $image = $(img);
...
...
@@ -149,7 +155,7 @@
}
});
editor
.
addButton
(
'
p
'
,
{
title
:
'
正文
'
,
// tooltip text seen on mouseover
title
:
'
正文
'
,
text
:
'
正文
'
,
onclick
()
{
editor
.
execCommand
(
'
mceToggleFormat
'
,
false
,
'
p
'
);
...
...
@@ -167,6 +173,7 @@
});
},
methods
:
{
/* 业务代码可删除 start*/
imageSuccessCBK
(
arr
)
{
console
.
log
(
arr
)
const
_this
=
this
;
...
...
@@ -212,6 +219,7 @@
node
.
className
=
'
wscnph editor-placeholder
'
;
tinymce
.
get
(
this
.
id
).
insertContent
(
node
.
outerHTML
)
}
/* 业务代码可删除 end*/
},
destroyed
()
{
tinymce
.
get
(
this
.
id
).
destroy
();
...
...
src/directive/sticky.js
浏览文件 @
168150ff
...
...
@@ -11,14 +11,12 @@
elStyle
.
position
=
'
-webkit-sticky
'
;
elStyle
.
position
=
'
sticky
'
;
// if the browser support css sticky(Currently Safari, Firefox and Chrome Canary)
// if (~elStyle.position.indexOf('sticky')) {
// elStyle.top = `${stickyTop}px`;
// elStyle.zIndex = zIndex;
// return
// }
// if the browser support css sticky(Currently Safari, Firefox and Chrome Canary)
// if (~elStyle.position.indexOf('sticky')) {
// elStyle.top = `${stickyTop}px`;
// elStyle.zIndex = zIndex;
// return
// }
const
elHeight
=
el
.
getBoundingClientRect
().
height
;
const
elWidth
=
el
.
getBoundingClientRect
().
width
;
elStyle
.
cssText
=
`top:
${
stickyTop
}
px; z-index:
${
zIndex
}
`
;
...
...
src/router/index.js
浏览文件 @
168150ff
...
...
@@ -5,7 +5,6 @@ import Router from 'vue-router';
import
Layout
from
'
../views/layout/Layout
'
;
// dashboard
// import dashboard from '../views/dashboard/index';
const
dashboard
=
resolve
=>
require
([
'
../views/dashboard/index
'
],
resolve
);
/* error page*/
...
...
src/views/components/markdown.vue
浏览文件 @
168150ff
...
...
@@ -2,7 +2,7 @@
<div
class=
"components-container"
>
<code>
公司做的后台主要是一个cms系统,公司也是已自媒体为核心的,所以富文本是后台很核心的功能。在选择富文本的过程中也走了不少的弯路,市面上常见的富文本都基本用过了,最终选择了tinymce
</code>
<div
class=
"editor-container"
>
<MdEditor
id=
'contentEditor'
ref=
"contentEditor"
v-model=
'content'
:height=
"
150"
></MdEditor>
<MdEditor
id=
'contentEditor'
ref=
"contentEditor"
v-model=
'content'
:height=
"
300"
:zIndex=
'20'
></MdEditor>
</div>
</div>
</
template
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录