Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
InJoyU
vue-element-admin
提交
385ec5a7
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,发现更多精彩内容 >>
提交
385ec5a7
编写于
8月 23, 2017
作者:
P
Pan
提交者:
花裤衩
8月 28, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine
上级
33a4369c
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
34 addition
and
113 deletion
+34
-113
src/api/article.js
src/api/article.js
+2
-2
src/api/article_table.js
src/api/article_table.js
+2
-2
src/api/login.js
src/api/login.js
+3
-3
src/api/qiniu.js
src/api/qiniu.js
+1
-1
src/api/remoteSearch.js
src/api/remoteSearch.js
+1
-1
src/components/MarkdownEditor/index.vue
src/components/MarkdownEditor/index.vue
+0
-0
src/components/Tinymce/index.vue
src/components/Tinymce/index.vue
+1
-13
src/components/twoDndList/index.vue
src/components/twoDndList/index.vue
+5
-5
src/router/index.js
src/router/index.js
+2
-2
src/store/modules/user.js
src/store/modules/user.js
+8
-2
src/views/charts/index.vue
src/views/charts/index.vue
+1
-1
src/views/charts/keyboard2.vue
src/views/charts/keyboard2.vue
+1
-1
src/views/charts/mixChart.vue
src/views/charts/mixChart.vue
+1
-1
src/views/components/dndList.vue
src/views/components/dndList.vue
+1
-2
src/views/components/jsonEditor.vue
src/views/components/jsonEditor.vue
+2
-2
src/views/components/markdown.vue
src/views/components/markdown.vue
+1
-1
src/views/components/tinymce.vue
src/views/components/tinymce.vue
+2
-2
static/tinymce/plugins/watermark/plugin.min.js
static/tinymce/plugins/watermark/plugin.min.js
+0
-72
未找到文件。
src/api/article.js
浏览文件 @
385ec5a7
import
fetch
from
'
utils/fetch
'
export
function
getList
()
{
export
function
getList
()
{
return
fetch
({
url
:
'
/article/list
'
,
method
:
'
get
'
})
}
export
function
getArticle
()
{
export
function
getArticle
()
{
return
fetch
({
url
:
'
/article/detail
'
,
method
:
'
get
'
...
...
src/api/article_table.js
浏览文件 @
385ec5a7
import
fetch
from
'
utils/fetch
'
export
function
fetchList
(
query
)
{
export
function
fetchList
(
query
)
{
return
fetch
({
url
:
'
/article_table/list
'
,
method
:
'
get
'
,
...
...
@@ -8,7 +8,7 @@ export function fetchList (query) {
})
}
export
function
fetchPv
(
pv
)
{
export
function
fetchPv
(
pv
)
{
return
fetch
({
url
:
'
/article_table/pv
'
,
method
:
'
get
'
,
...
...
src/api/login.js
浏览文件 @
385ec5a7
import
fetch
from
'
utils/fetch
'
export
function
loginByUsername
(
username
,
password
)
{
export
function
loginByUsername
(
username
,
password
)
{
const
data
=
{
username
,
password
...
...
@@ -12,14 +12,14 @@ export function loginByUsername (username, password) {
})
}
export
function
logout
()
{
export
function
logout
()
{
return
fetch
({
url
:
'
/login/logout
'
,
method
:
'
post
'
})
}
export
function
getInfo
(
token
)
{
export
function
getInfo
(
token
)
{
return
fetch
({
url
:
'
/user/info
'
,
method
:
'
get
'
,
...
...
src/api/qiniu.js
浏览文件 @
385ec5a7
import
fetch
from
'
utils/fetch
'
export
function
getToken
()
{
export
function
getToken
()
{
return
fetch
({
url
:
'
/qiniu/upload/token
'
,
// 假地址 自行替换
method
:
'
get
'
...
...
src/api/remoteSearch.js
浏览文件 @
385ec5a7
import
fetch
from
'
utils/fetch
'
export
function
userSearch
(
name
)
{
export
function
userSearch
(
name
)
{
return
fetch
({
url
:
'
/search/user
'
,
method
:
'
get
'
,
...
...
src/components/M
d
Editor/index.vue
→
src/components/M
arkdown
Editor/index.vue
浏览文件 @
385ec5a7
文件已移动
src/components/Tinymce/index.vue
浏览文件 @
385ec5a7
...
...
@@ -52,11 +52,9 @@ export default {
height
:
this
.
height
,
body_class
:
'
panel-body
'
,
object_resizing
:
false
,
// language: 'zh_CN',
// language_url: '/static/tinymce/langs/zh_CN.js',
toolbar
:
this
.
toolbar
,
menubar
:
this
.
menubar
,
plugins
:
'
advlist,autolink,code,paste,textcolor, colorpicker,fullscreen,link,lists,media,wordcount, imagetools
,watermark
'
,
plugins
:
'
advlist,autolink,code,paste,textcolor, colorpicker,fullscreen,link,lists,media,wordcount, imagetools
'
,
end_container_on_empty_block
:
true
,
powerpaste_word_import
:
'
clean
'
,
code_dialog_height
:
450
,
...
...
@@ -160,14 +158,4 @@ export default {
visibility
:
hidden
;
z-index
:
-1
;
}
.editor-custom-btn-container
{
position
:
absolute
;
right
:
15px
;
top
:
18px
;
}
.editor-upload-btn
{
display
:
inline-block
;
}
</
style
>
src/components/twoDndList/index.vue
浏览文件 @
385ec5a7
...
...
@@ -3,21 +3,20 @@
<div
class=
"twoDndList-list"
:style=
"
{width:width1}">
<h3>
{{
list1Title
}}
</h3>
<draggable
:list=
"list1"
class=
"dragArea"
:options=
"
{group:'article'}">
<div
class=
"list-complete-item"
v-for=
"element in list1"
:key=
'element'
>
<div
class=
"list-complete-item"
v-for=
"element in list1"
:key=
'element
.id
'
>
<div
class=
"list-complete-item-handle"
>
[
{{
element
.
author
}}
]
{{
element
.
title
}}
</div>
<div
style=
"position:absolute;right:0px;"
>
<span
style=
"float: right ;margin-top: -20px;margin-right:5px;"
@
click=
"deleteEle(element)"
>
<i
style=
"color:#ff4949"
class=
"el-icon-delete"
></i>
</span>
<i
style=
"color:#ff4949"
class=
"el-icon-delete"
></i>
</span>
</div>
</div>
</draggable>
</div>
<div
class=
"twoDndList-list"
:style=
"
{width:width2}">
<h3>
{{
list2Title
}}
</h3>
<draggable
:list=
"filterList2"
class=
"dragArea"
:options=
"
{group:'article'}">
<div
class=
"list-complete-item"
v-for=
"element in filterList2"
:key=
'element'
>
<div
class=
"list-complete-item"
v-for=
"element in filterList2"
:key=
'element
.id
'
>
<div
class=
'list-complete-item-handle2'
@
click=
"pushEle(element)"
>
[
{{
element
.
author
}}
]
{{
element
.
title
}}
</div>
</div>
</draggable>
...
...
@@ -27,6 +26,7 @@
<
script
>
import
draggable
from
'
vuedraggable
'
export
default
{
name
:
'
twoDndList
'
,
components
:
{
draggable
},
...
...
src/router/index.js
浏览文件 @
385ec5a7
...
...
@@ -65,8 +65,8 @@ export const asyncRouterMap = [
{
path
:
'
index
'
,
component
:
_import
(
'
components/index
'
),
name
:
'
介绍
'
},
{
path
:
'
tinymce
'
,
component
:
_import
(
'
components/tinymce
'
),
name
:
'
富文本编辑器
'
},
{
path
:
'
markdown
'
,
component
:
_import
(
'
components/markdown
'
),
name
:
'
Markdown
'
},
{
path
:
'
jsoneditor
'
,
component
:
_import
(
'
components/json
e
ditor
'
),
name
:
'
JSON编辑器
'
},
{
path
:
'
dndlist
'
,
component
:
_import
(
'
components/dnd
l
ist
'
),
name
:
'
列表拖拽
'
},
{
path
:
'
jsoneditor
'
,
component
:
_import
(
'
components/json
E
ditor
'
),
name
:
'
JSON编辑器
'
},
{
path
:
'
dndlist
'
,
component
:
_import
(
'
components/dnd
L
ist
'
),
name
:
'
列表拖拽
'
},
{
path
:
'
splitpane
'
,
component
:
_import
(
'
components/splitpane
'
),
name
:
'
SplitPane
'
},
{
path
:
'
avatarupload
'
,
component
:
_import
(
'
components/avatarUpload
'
),
name
:
'
头像上传
'
},
{
path
:
'
dropzone
'
,
component
:
_import
(
'
components/dropzone
'
),
name
:
'
Dropzone
'
},
...
...
src/store/modules/user.js
浏览文件 @
385ec5a7
...
...
@@ -115,10 +115,16 @@ const user = {
// 动态修改权限
ChangeRole
({
commit
},
role
)
{
return
new
Promise
(
resolve
=>
{
commit
(
'
SET_ROLES
'
,
[
role
])
commit
(
'
SET_TOKEN
'
,
role
)
setToken
(
role
)
resolve
()
getInfo
(
role
).
then
(
response
=>
{
const
data
=
response
.
data
commit
(
'
SET_ROLES
'
,
data
.
role
)
commit
(
'
SET_NAME
'
,
data
.
name
)
commit
(
'
SET_AVATAR
'
,
data
.
avatar
)
commit
(
'
SET_INTRODUCTION
'
,
data
.
introduction
)
resolve
()
})
})
}
}
...
...
src/views/charts/index.vue
浏览文件 @
385ec5a7
<
template
>
<div
class=
"components-container"
>
<code>
这里的所有的图表都基于ECharts,实例代码来源
<a
href=
'http://gallery.echartsjs.com/explore.html#sort=rank~timeframe=all~author=all'
target=
'_blank'
>
gallery
</a><br/>
其实ECharts封装的很好了,用vue封装是很简单的事情,建议大家自己来封装。
<a
target=
'_blank'
class=
'lin'
href=
"https://segmentfault.com/a/1190000009762198#articleHeader16"
>
相关教程
</a>
这里的所有的图表都基于ECharts,实例代码来源
<a
href=
'http://gallery.echartsjs.com/explore.html#sort=rank~timeframe=all~author=all'
target=
'_blank'
>
gallery
</a><br/>
其实ECharts封装的很好了,用vue封装是很简单的事情,建议大家自己来封装。
<a
target=
'_blank'
class=
'lin'
href=
"https://segmentfault.com/a/1190000009762198#articleHeader16"
>
相关教程
</a>
</code>
</div>
</
template
>
src/views/charts/keyboard2.vue
浏览文件 @
385ec5a7
<
template
>
<div
class=
"components-container"
style=
'height:100vh'
>
<div
class=
'chart-container'
>
<keyboard-chart2
id=
'apple'
height=
'100%'
width=
'100%'
></keyboard-chart2>
<keyboard-chart2
height=
'100%'
width=
'100%'
></keyboard-chart2>
</div>
</div>
</
template
>
...
...
src/views/charts/mixChart.vue
浏览文件 @
385ec5a7
<
template
>
<div
class=
"components-container"
style=
'height:100vh'
>
<div
class=
'chart-container'
>
<mix-chart
id=
'apple'
height=
'100%'
width=
'100%'
></mix-chart>
<mix-chart
height=
'100%'
width=
'100%'
></mix-chart>
</div>
</div>
</
template
>
...
...
src/views/components/dnd
l
ist.vue
→
src/views/components/dnd
L
ist.vue
浏览文件 @
385ec5a7
...
...
@@ -8,7 +8,7 @@
</
template
>
<
script
>
import
DndList
from
'
components/twoDndList
'
import
DndList
from
'
@/
components/twoDndList
'
import
{
getList
}
from
'
api/article
'
export
default
{
...
...
@@ -28,7 +28,6 @@ export default {
getList
(
this
.
listQuery
).
then
(
response
=>
{
this
.
list1
=
response
.
data
.
splice
(
0
,
5
)
this
.
list2
=
response
.
data
console
.
log
(
this
.
list1
,
this
.
list2
)
})
}
}
...
...
src/views/components/json
e
ditor.vue
→
src/views/components/json
E
ditor.vue
浏览文件 @
385ec5a7
<
template
>
<div
class=
"components-container"
style=
'height:100vh'
>
<code>
jsonEditor is base on
<a
href=
"https://github.com/codemirror/CodeMirror"
target=
"_blank"
>
CodeMirrorr
</a>
,
lint base on json-lint
</code>
<code>
jsonEditor is base on
<a
href=
"https://github.com/codemirror/CodeMirror"
target=
"_blank"
>
CodeMirrorr
</a>
,
lint base on json-lint
</code>
<div
class=
"editor-container"
>
<json-editor
ref=
"jsonEditor"
v-model=
"value"
></json-editor>
</div>
...
...
@@ -8,7 +8,7 @@
</
template
>
<
script
>
import
jsonEditor
from
'
components/jsonEditor
'
import
jsonEditor
from
'
@/
components/jsonEditor
'
const
jsonData
=
'
[{"items":[{"market_type":"forexdata","symbol":"XAUUSD"},{"market_type":"forexdata","symbol":"UKOIL"},{"market_type":"forexdata","symbol":"CORN"}],"name":""},{"items":[{"market_type":"forexdata","symbol":"XAUUSD"},{"market_type":"forexdata","symbol":"XAGUSD"},{"market_type":"forexdata","symbol":"AUTD"},{"market_type":"forexdata","symbol":"AGTD"}],"name":"贵金属"},{"items":[{"market_type":"forexdata","symbol":"CORN"},{"market_type":"forexdata","symbol":"WHEAT"},{"market_type":"forexdata","symbol":"SOYBEAN"},{"market_type":"forexdata","symbol":"SUGAR"}],"name":"农产品"},{"items":[{"market_type":"forexdata","symbol":"UKOIL"},{"market_type":"forexdata","symbol":"USOIL"},{"market_type":"forexdata","symbol":"NGAS"}],"name":"能源化工"}]
'
export
default
{
...
...
src/views/components/markdown.vue
浏览文件 @
385ec5a7
...
...
@@ -10,7 +10,7 @@
</
template
>
<
script
>
import
MdEditor
from
'
components/Md
Editor
'
import
MdEditor
from
'
@/components/Markdown
Editor
'
export
default
{
components
:
{
MdEditor
},
data
()
{
...
...
src/views/components/tinymce.vue
浏览文件 @
385ec5a7
<
template
>
<div
class=
"components-container"
>
<code>
公司做的后台主要是一个cms系统,公司也是以自媒体为核心的,所以富文本是后台很核心的功能。在选择富文本的过程中也走了不少的弯路,市面上常见的富文本都基本用过了,最终选择了Tinymce
<a
target=
'_blank'
href=
'https://segmentfault.com/a/1190000009762198#articleHeader13'
>
相关文章
</a></code>
<code>
公司做的后台主要是一个cms系统,公司也是以自媒体为核心的,所以富文本是后台很核心的功能。在选择富文本的过程中也走了不少的弯路,市面上常见的富文本都基本用过了,最终选择了Tinymce
<a
target=
'_blank'
href=
'https://segmentfault.com/a/1190000009762198#articleHeader13'
>
相关文章
</a>
<a
target=
'_blank'
href=
'https://www.tinymce.com/'
>
官网
</a>
</code>
<div>
<Tinymce
:height=
200
ref=
"editor"
v-model=
"content"
></Tinymce>
</div>
...
...
@@ -9,7 +9,7 @@
</
template
>
<
script
>
import
Tinymce
from
'
components/Tinymce
'
import
Tinymce
from
'
@/
components/Tinymce
'
export
default
{
components
:
{
Tinymce
},
...
...
static/tinymce/plugins/watermark/plugin.min.js
已删除
100644 → 0
浏览文件 @
33a4369c
(
function
()
{
const
qiniuOption
=
{
watermark
:
'
aHR0cHM6Ly93ZGwud2FsbHN0cmVldGNuLmNvbS8yM2Y0ZWE2Ny1hZjI1LTQ3ZTItYTFlYy1iNzJjNzkzYWNlOGE=
'
,
weexWatermark
:
'
aHR0cHM6Ly93cGltZy53YWxsc3Rjbi5jb20vMGQxMmMwN2ItNjViMS00NjA4LTllMTctODUyMDRhOTc3YzY5
'
,
dissolve
:
30
,
dx
:
20
,
dy
:
20
,
watermarkScale
:
0
};
tinymce
.
create
(
'
tinymce.plugins.WaterMarkPlugin
'
,
{
init
(
ed
)
{
ed
.
addCommand
(
'
mceWaterMark
'
,
()
=>
{
const
target
=
ed
.
selection
.
getNode
();
const
src
=
$
(
target
).
attr
(
'
src
'
)
+
'
?watermark/1/image/
'
+
qiniuOption
.
watermark
+
'
/dissolve/
'
+
qiniuOption
.
dissolve
+
'
/gravity/Center/dx/
'
+
qiniuOption
.
dx
+
'
/dy/
'
+
qiniuOption
.
dy
+
'
/ws/
'
+
qiniuOption
.
watermarkScale
ed
.
windowManager
.
open
({
title
:
'
七牛水印
'
,
width
:
600
,
height
:
500
,
body
:
[{
type
:
'
container
'
,
html
:
`<div class="mce-container" hidefocus="1" tabindex="-1" >
<div class="mce-container-body mce-container-watermark-body">
<div style="margin-bottom:10px;">
<label><input checked='true' style="margin-left: 20px;margin-right: 5px;" name="image-watermarkType" data-type="watermark" class="note-image-watermarkType" type="radio" />见闻</label>
<label><input style="margin-left: 20px;margin-right: 5px;" name="image-watermarkType" data-type="weexWatermark" class="note-image-watermarkType" type="radio" />WEEX</label>
</div>
<div style='min-height:600px;'>
<label><input style="margin-left: 20px;margin-right: 5px;" name="image-watermark" data-position="NorthWest" class="note-image-watermark" type="radio" />左上</label>
<label><input style="margin-left: 20px;margin-right: 5px;" name="image-watermark" data-position="SouthWest" class="note-image-watermark" type="radio" />左下</label>
<label><input style="margin-left: 20px;margin-right: 5px;" name="image-watermark" data-position="NorthEast" class="note-image-watermark" type="radio" /><span>右上</span></label>
<label><input style="margin-left: 20px;margin-right: 5px;" name="image-watermark" data-position="SouthEast" class="note-image-watermark" type="radio" /><span>右下</span></label>
<label><input checked='true' style="margin-left: 20px;margin-right: 5px;" name="image-watermark" data-position="Center" class="note-image-watermark" type="radio" /><span>正中央</span></label>
<img src=
${
src
}
style="display: block;margin: 20px auto;max-height: 420px;max-width: 100%;" class="watermark-preview">
</div>
</div>
</div>`
}],
onSubmit
()
{
const
src
=
$
(
'
.mce-container-watermark-body .watermark-preview
'
).
attr
(
'
src
'
);
$
(
target
).
attr
(
'
src
'
,
src
);
ed
.
undoManager
.
add
()
// setTimeout(() => {
// ed.insertContent('a')
// }, 100);
}
});
$
(
'
.mce-container-watermark-body input[type="radio"]
'
).
on
(
'
click
'
,
()
=>
{
const
$watermarkImg
=
$
(
'
.mce-container-watermark-body .watermark-preview
'
)
const
baseSrc
=
$watermarkImg
.
attr
(
'
src
'
).
split
(
'
?
'
)[
0
];
const
position
=
$
(
'
.mce-container-watermark-body input[name="image-watermark"]:checked
'
).
attr
(
'
data-position
'
);
const
type
=
$
(
'
.mce-container-watermark-body input[name="image-watermarkType"]:checked
'
).
attr
(
'
data-type
'
);
const
query
=
setQuery
(
position
,
type
);
$watermarkImg
.
attr
(
'
src
'
,
baseSrc
+
query
);
})
});
function
setQuery
(
postion
,
type
)
{
return
'
?watermark/1/image/
'
+
qiniuOption
[
type
]
+
'
/dissolve/
'
+
qiniuOption
.
dissolve
+
'
/gravity/
'
+
postion
+
'
/dx/
'
+
qiniuOption
.
dx
+
'
/dy/
'
+
qiniuOption
.
dy
+
'
/ws/
'
+
qiniuOption
.
watermarkScale
}
// Register buttons
ed
.
addButton
(
'
watermark
'
,
{
title
:
'
watermark
'
,
text
:
'
水印
'
,
cmd
:
'
mceWaterMark
'
});
}
});
tinymce
.
PluginManager
.
add
(
'
watermark
'
,
tinymce
.
plugins
.
WaterMarkPlugin
);
}());
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录