Skip to content

Commit 385ec5a

Browse files
committed
refine
1 parent 33a4369 commit 385ec5a

File tree

18 files changed

+34
-113
lines changed

18 files changed

+34
-113
lines changed

src/api/article.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import fetch from 'utils/fetch'
22

3-
export function getList () {
3+
export function getList() {
44
return fetch({
55
url: '/article/list',
66
method: 'get'
77
})
88
}
99

10-
export function getArticle () {
10+
export function getArticle() {
1111
return fetch({
1212
url: '/article/detail',
1313
method: 'get'

src/api/article_table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import fetch from 'utils/fetch'
22

3-
export function fetchList (query) {
3+
export function fetchList(query) {
44
return fetch({
55
url: '/article_table/list',
66
method: 'get',
77
params: query
88
})
99
}
1010

11-
export function fetchPv (pv) {
11+
export function fetchPv(pv) {
1212
return fetch({
1313
url: '/article_table/pv',
1414
method: 'get',

src/api/login.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fetch from 'utils/fetch'
22

3-
export function loginByUsername (username, password) {
3+
export function loginByUsername(username, password) {
44
const data = {
55
username,
66
password
@@ -12,14 +12,14 @@ export function loginByUsername (username, password) {
1212
})
1313
}
1414

15-
export function logout () {
15+
export function logout() {
1616
return fetch({
1717
url: '/login/logout',
1818
method: 'post'
1919
})
2020
}
2121

22-
export function getInfo (token) {
22+
export function getInfo(token) {
2323
return fetch({
2424
url: '/user/info',
2525
method: 'get',

src/api/qiniu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fetch from 'utils/fetch'
22

3-
export function getToken () {
3+
export function getToken() {
44
return fetch({
55
url: '/qiniu/upload/token', // 假地址 自行替换
66
method: 'get'

src/api/remoteSearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fetch from 'utils/fetch'
22

3-
export function userSearch (name) {
3+
export function userSearch(name) {
44
return fetch({
55
url: '/search/user',
66
method: 'get',

src/components/Tinymce/index.vue

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ export default {
5252
height: this.height,
5353
body_class: 'panel-body ',
5454
object_resizing: false,
55-
// language: 'zh_CN',
56-
// language_url: '/static/tinymce/langs/zh_CN.js',
5755
toolbar: this.toolbar,
5856
menubar: this.menubar,
59-
plugins: 'advlist,autolink,code,paste,textcolor, colorpicker,fullscreen,link,lists,media,wordcount, imagetools,watermark',
57+
plugins: 'advlist,autolink,code,paste,textcolor, colorpicker,fullscreen,link,lists,media,wordcount, imagetools',
6058
end_container_on_empty_block: true,
6159
powerpaste_word_import: 'clean',
6260
code_dialog_height: 450,
@@ -160,14 +158,4 @@ export default {
160158
visibility: hidden;
161159
z-index: -1;
162160
}
163-
164-
.editor-custom-btn-container {
165-
position: absolute;
166-
right: 15px;
167-
top: 18px;
168-
}
169-
170-
.editor-upload-btn {
171-
display: inline-block;
172-
}
173161
</style>

src/components/twoDndList/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@
33
<div class="twoDndList-list" :style="{width:width1}">
44
<h3>{{list1Title}}</h3>
55
<draggable :list="list1" class="dragArea" :options="{group:'article'}">
6-
<div class="list-complete-item" v-for="element in list1" :key='element'>
6+
<div class="list-complete-item" v-for="element in list1" :key='element.id'>
77
<div class="list-complete-item-handle">[{{element.author}}] {{element.title}}</div>
88
<div style="position:absolute;right:0px;">
99
<span style="float: right ;margin-top: -20px;margin-right:5px;" @click="deleteEle(element)">
10-
<i style="color:#ff4949" class="el-icon-delete"></i>
11-
</span>
10+
<i style="color:#ff4949" class="el-icon-delete"></i>
11+
</span>
1212
</div>
1313
</div>
1414
</draggable>
1515
</div>
16-
1716
<div class="twoDndList-list" :style="{width:width2}">
1817
<h3>{{list2Title}}</h3>
1918
<draggable :list="filterList2" class="dragArea" :options="{group:'article'}">
20-
<div class="list-complete-item" v-for="element in filterList2" :key='element'>
19+
<div class="list-complete-item" v-for="element in filterList2" :key='element.id'>
2120
<div class='list-complete-item-handle2' @click="pushEle(element)"> [{{element.author}}] {{element.title}}</div>
2221
</div>
2322
</draggable>
@@ -27,6 +26,7 @@
2726

2827
<script>
2928
import draggable from 'vuedraggable'
29+
3030
export default {
3131
name: 'twoDndList',
3232
components: { draggable },

src/router/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export const asyncRouterMap = [
6565
{ path: 'index', component: _import('components/index'), name: '介绍 ' },
6666
{ path: 'tinymce', component: _import('components/tinymce'), name: '富文本编辑器' },
6767
{ path: 'markdown', component: _import('components/markdown'), name: 'Markdown' },
68-
{ path: 'jsoneditor', component: _import('components/jsoneditor'), name: 'JSON编辑器' },
69-
{ path: 'dndlist', component: _import('components/dndlist'), name: '列表拖拽' },
68+
{ path: 'jsoneditor', component: _import('components/jsonEditor'), name: 'JSON编辑器' },
69+
{ path: 'dndlist', component: _import('components/dndList'), name: '列表拖拽' },
7070
{ path: 'splitpane', component: _import('components/splitpane'), name: 'SplitPane' },
7171
{ path: 'avatarupload', component: _import('components/avatarUpload'), name: '头像上传' },
7272
{ path: 'dropzone', component: _import('components/dropzone'), name: 'Dropzone' },

src/store/modules/user.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,16 @@ const user = {
115115
// 动态修改权限
116116
ChangeRole({ commit }, role) {
117117
return new Promise(resolve => {
118-
commit('SET_ROLES', [role])
119118
commit('SET_TOKEN', role)
120119
setToken(role)
121-
resolve()
120+
getInfo(role).then(response => {
121+
const data = response.data
122+
commit('SET_ROLES', data.role)
123+
commit('SET_NAME', data.name)
124+
commit('SET_AVATAR', data.avatar)
125+
commit('SET_INTRODUCTION', data.introduction)
126+
resolve()
127+
})
122128
})
123129
}
124130
}

src/views/charts/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="components-container" >
33
<code>
4-
这里的所有的图表都基于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>
4+
这里的所有的图表都基于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>
55
</code>
66
</div>
77
</template>

src/views/charts/keyboard2.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="components-container" style='height:100vh'>
33
<div class='chart-container'>
4-
<keyboard-chart2 id='apple' height='100%' width='100%'></keyboard-chart2>
4+
<keyboard-chart2 height='100%' width='100%'></keyboard-chart2>
55
</div>
66
</div>
77
</template>

src/views/charts/mixChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="components-container" style='height:100vh'>
33
<div class='chart-container'>
4-
<mix-chart id='apple' height='100%' width='100%'></mix-chart>
4+
<mix-chart height='100%' width='100%'></mix-chart>
55
</div>
66
</div>
77
</template>

src/views/components/dndlist.vue renamed to src/views/components/dndList.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</template>
99

1010
<script>
11-
import DndList from 'components/twoDndList'
11+
import DndList from '@/components/twoDndList'
1212
import { getList } from 'api/article'
1313
1414
export default {
@@ -28,7 +28,6 @@ export default {
2828
getList(this.listQuery).then(response => {
2929
this.list1 = response.data.splice(0, 5)
3030
this.list2 = response.data
31-
console.log(this.list1, this.list2)
3231
})
3332
}
3433
}

src/views/components/jsoneditor.vue renamed to src/views/components/jsonEditor.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<template>
22
<div class="components-container" style='height:100vh'>
3-
<code>jsonEditor is base on <a href="https://github.com/codemirror/CodeMirror" target="_blank">CodeMirrorr</a>,lint base on json-lint </code>
3+
<code>jsonEditor is base on <a href="https://github.com/codemirror/CodeMirror" target="_blank">CodeMirrorr</a> , lint base on json-lint </code>
44
<div class="editor-container">
55
<json-editor ref="jsonEditor" v-model="value"></json-editor>
66
</div>
77
</div>
88
</template>
99

1010
<script>
11-
import jsonEditor from 'components/jsonEditor'
11+
import jsonEditor from '@/components/jsonEditor'
1212
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":"能源化工"}]'
1313
1414
export default {

src/views/components/markdown.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</template>
1111

1212
<script>
13-
import MdEditor from 'components/MdEditor'
13+
import MdEditor from '@/components/MarkdownEditor'
1414
export default {
1515
components: { MdEditor },
1616
data() {

src/views/components/tinymce.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="components-container">
3-
<code>公司做的后台主要是一个cms系统,公司也是以自媒体为核心的,所以富文本是后台很核心的功能。在选择富文本的过程中也走了不少的弯路,市面上常见的富文本都基本用过了,最终选择了Tinymce<a target='_blank' href='https://segmentfault.com/a/1190000009762198#articleHeader13'> 相关文章 </a></code>
3+
<code>公司做的后台主要是一个cms系统,公司也是以自媒体为核心的,所以富文本是后台很核心的功能。在选择富文本的过程中也走了不少的弯路,市面上常见的富文本都基本用过了,最终选择了Tinymce<a target='_blank' href='https://segmentfault.com/a/1190000009762198#articleHeader13'> 相关文章 </a> <a target='_blank' href='https://www.tinymce.com/'> 官网 </a></code>
44
<div>
55
<Tinymce :height=200 ref="editor" v-model="content"></Tinymce>
66
</div>
@@ -9,7 +9,7 @@
99
</template>
1010

1111
<script>
12-
import Tinymce from 'components/Tinymce'
12+
import Tinymce from '@/components/Tinymce'
1313
1414
export default {
1515
components: { Tinymce },

static/tinymce/plugins/watermark/plugin.min.js

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)