Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
new-sing
admin-base
Commits
4e44ee79
Commit
4e44ee79
authored
Aug 31, 2018
by
王
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' of
http://git.singsingenglish.com/new-sing/admin
into development
parents
e562ee35
14570439
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
441 additions
and
175 deletions
+441
-175
dev.env.js
config/dev.env.js
+1
-1
prod.env.js
config/prod.env.js
+1
-1
test.env.js
config/test.env.js
+1
-1
radio.png
src/assets/mould/refueling1/radio.png
+0
-0
editor.vue
src/components/resources/editor.vue
+350
-152
editorDialog.vue
src/components/resources/editorDialog.vue
+19
-3
api.js
src/service/api.js
+19
-4
index.js
src/service/index.js
+16
-9
actions.js
src/store/actions.js
+3
-0
index.js
src/store/index.js
+1
-0
mutations.js
src/store/mutations.js
+13
-0
resourceMould.js
src/util/resourceMould.js
+17
-4
No files found.
config/dev.env.js
View file @
4e44ee79
...
...
@@ -5,7 +5,7 @@ const prodEnv = require('./prod.env');
module
.
exports
=
merge
(
prodEnv
,
{
NODE_ENV
:
'"development"'
,
API_URL
:
'"/"'
,
MAX_FILESIZE
:
'1024*1024*
5
'
,
MAX_FILESIZE
:
'1024*1024*
10
'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
INVITE_URL
:
'"http://wechat.test.singsingenglish.com"'
,
});
config/prod.env.js
View file @
4e44ee79
...
...
@@ -3,5 +3,5 @@ module.exports = {
NODE_ENV
:
'"production"'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
API_URL
:
'"/"'
,
MAX_FILESIZE
:
'1024*1024*
5
'
,
MAX_FILESIZE
:
'1024*1024*
10
'
,
}
config/test.env.js
View file @
4e44ee79
...
...
@@ -6,5 +6,5 @@ module.exports = merge(prodEnv, {
NODE_ENV
:
'"production"'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
API_URL
:
'"/"'
,
MAX_FILESIZE
:
'1024*1024*
5
'
,
MAX_FILESIZE
:
'1024*1024*
10
'
,
})
src/assets/mould/refueling1/radio.png
View replaced file @
e562ee35
View file @
4e44ee79
8.99 KB
|
W:
|
H:
3.89 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/components/resources/editor.vue
View file @
4e44ee79
This diff is collapsed.
Click to expand it.
src/components/resources/editorDialog.vue
View file @
4e44ee79
...
...
@@ -23,14 +23,27 @@
</el-card>
</div>
</div>
</el-aside>
<el-main>
<editor
:selectedMould=
"selectedMould"
/>
<el-button
size=
"mini"
@
click=
"showDialog = true"
>
课程基本信息编辑
</el-button>
<el-button
size=
"mini"
>
保存
</el-button>
<editor
:selectedMould=
"selectedMould"
:editorObj=
"editorObj"
/>
</el-main>
</el-container>
<el-dialog>
<el-dialog
title=
"信息编辑"
:modal=
"false"
:visible
.
sync=
"showDialog"
width=
"30%"
>
<el-form>
<el-form-item>
</el-form-item>
</el-form>
</el-dialog>
</el-dialog>
</
template
>
...
...
@@ -39,6 +52,8 @@
import
addUrl
from
'../../assets/editor/Group 7.png'
import
{
MOULDLIST
}
from
"../../util/resourceMould"
;
import
editor
from
'./editor'
import
{
addCategoryApi
}
from
"../../service/api"
;
export
default
{
props
:[
'editorObj'
...
...
@@ -50,6 +65,7 @@
return
{
selectedMould
:[],
addUrl
:
addUrl
,
showDialog
:
false
,
mouldList
:
MOULDLIST
,
age
:[
0
,
0
],
level
:[
0
,
0
],
...
...
src/service/api.js
View file @
4e44ee79
...
...
@@ -143,12 +143,12 @@ const getCategoryUrl = `${_baseUrl}api/admin/category/list/0`;
export
const
getCategoryApi
=
function
(
pid
)
{
return
Vue
.
prototype
.
$fetch
(
getCategoryUrl
,{
'pid'
:
pid
})
};
//删除
元素
分类
//删除分类
const
delCategoryUrl
=
`
${
_baseUrl
}
api/admin/category`
;
export
const
delCategoryApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$del
(
`
${
delCategoryUrl
}
/
${
id
}
`
)
};
//
元素
排序修改
//
分类
排序修改
const
sortCategoryUrl
=
`
${
_baseUrl
}
api/admin/category/sort`
;
export
const
sortCategoryApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$patch
(
sortCategoryUrl
,
json
)
...
...
@@ -158,6 +158,21 @@ const getCateDetailListUrl = `${_baseUrl}api/admin/element/list/0`;
export
const
getCateListApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$fetch
(
getCateDetailListUrl
,
id
)
};
// 添加元素
const
addElementUrl
=
`
${
_baseUrl
}
api/admin/element/add/`
;
export
const
addElementApi
=
function
(
json
,
id
)
{
return
Vue
.
prototype
.
$post
(
`
${
addElementUrl
}${
id
}
`
,
json
)
};
// 查询元素详情
const
getElemenetDetailUrl
=
`
${
_baseUrl
}
api/admin/element/`
;
export
const
getElemenetDetailApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
getElemenetDetailUrl
}${
id
}
`
)
};
// 编辑元素
const
editElementUrl
=
`
${
_baseUrl
}
api/admin/element/`
;
export
const
editElementApi
=
function
(
id
,
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
editElementUrl
}${
id
}
`
,
json
)
};
// 获取单品列表
const
getSingleListUrl
=
`
${
_baseUrl
}
api/admin/item/stock/list`
;
export
const
getSingleListApi
=
function
(
name
)
{
...
...
@@ -256,8 +271,8 @@ export const getMediaListApi = function (json) {
// const getGoodsListUrl = `${_baseUrl}api/admin/goods/list`;
// 文件上传
const
uploadFileUrl
=
`
${
_baseUrl
}
api/public/upload/zone`
;
export
const
uploadFileApi
=
function
(
data
)
{
return
Vue
.
prototype
.
$upload
(
uploadFileUrl
,
data
)
export
const
uploadFileApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$upload
(
uploadFileUrl
,
json
)
};
// 获取菜单列表
const
getMenuListUrl
=
`
${
_baseUrl
}
api/admin/category/list/2`
;
...
...
src/service/index.js
View file @
4e44ee79
import
axios
from
'axios'
;
import
md5
from
'js-md5'
;
import
store
from
"@/store"
import
{
MessageBox
,
Message
}
from
'element-ui'
;
import
router
from
'../router'
import
Cookie
from
'../util/cookie'
...
...
@@ -65,29 +66,35 @@ axios.interceptors.response.use(
* @param params
* @returns {Promise}
*/
export
function
upload
(
url
,
data
)
{
export
function
upload
(
url
,
json
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
//开启分片
let
size
=
parseInt
(
Number
(
data
.
size
)
/
Number
(
process
.
env
.
MAX_FILESIZE
)
+
1
);
let
size
=
parseInt
(
Number
(
json
.
file
.
size
)
/
Number
(
process
.
env
.
MAX_FILESIZE
)
+
1
);
let
y
=
0
;
let
fun
=
function
(){
let
formData
=
new
FormData
();
let
file
=
data
.
slice
(
y
*
process
.
env
.
MAX_FILESIZE
,(
y
+
1
)
*
process
.
env
.
MAX_FILESIZE
)
console
.
log
(
data
)
let
file
=
json
.
file
.
slice
(
y
*
process
.
env
.
MAX_FILESIZE
,(
y
+
1
)
*
process
.
env
.
MAX_FILESIZE
);
console
.
log
(
json
.
file
);
formData
.
append
(
'chunk'
,
y
);
formData
.
append
(
'file_name'
,
data
.
name
);
formData
.
append
(
'file_name'
,
json
.
file
.
name
);
formData
.
append
(
'count'
,
size
);
formData
.
append
(
'file'
,
file
);
axios
.
post
(
url
,
formData
,{
headers
:
{
'Content-Type'
:
'multipart/form-data'
},
timeout
:
60000
})
},
timeout
:
60000
,
onUploadProgress
:
progressEvent
=>
{
if
(
store
.
state
.
progressList
.
find
(
i
=>
{
return
i
.
id
===
json
.
file
.
uid
})){
let
progress
=
((
Number
(
progressEvent
.
loaded
)
+
Number
(
y
*
process
.
env
.
MAX_FILESIZE
))
/
Number
(
json
.
file
.
size
)
*
100
|
0
);
store
.
dispatch
(
'setProgress'
,{
type
:
'change'
,
id
:
json
.
file
.
uid
,
num
:
progress
});
}
},})
.
then
(
response
=>
{
if
(
response
.
data
.
code
===
200
){
y
++
;
if
(
y
<
size
){
if
(
y
+
1
<
size
){
y
++
;
fun
()
}
else
{
y
=
0
;
resolve
(
response
.
data
.
data
);
}
}
else
{
...
...
src/store/actions.js
View file @
4e44ee79
...
...
@@ -7,4 +7,7 @@ export default{
setUserName
({
commit
},
name
){
commit
(
'setUserName'
,
name
);
},
setProgress
({
commit
},
data
){
commit
(
'progress'
,
data
);
},
}
src/store/index.js
View file @
4e44ee79
...
...
@@ -14,6 +14,7 @@ export default new vuex.Store({
menuList
:
menu
,
menuType
:
false
,
nowTab
:
'first'
,
progressList
:[],
openedTab
:[
{
value
:
'首页'
,
...
...
src/store/mutations.js
View file @
4e44ee79
...
...
@@ -19,6 +19,19 @@ const mutations={
},
changeParentRouter
(
state
,
data
){
state
.
menuList
.
find
((
a
)
=>
{
return
a
.
name
===
data
.
name
}).
routerName
=
data
.
to
.
name
},
progress
(
state
,
data
){
switch
(
data
.
type
)
{
case
'new'
:
state
.
progressList
.
push
({
num
:
0
,
id
:
data
.
id
});
break
;
case
'change'
:
state
.
progressList
.
find
((
x
)
=>
{
return
x
.
id
===
data
.
id
}).
num
=
data
.
num
;
break
;
case
'delete'
:
delete
state
.
progressList
.
find
((
x
)
=>
{
return
x
.
id
===
data
.
id
});
break
}
}
};
export
default
mutations
;
src/util/resourceMould.js
View file @
4e44ee79
...
...
@@ -41,8 +41,8 @@ export const MOULDLIST = [
name
:
'玩-video-1'
,
key
:
'play1'
,
content
:{
videoUrl
:
''
,
banner
:
""
,
videoUrl
:
[]
,
banner
:
[]
,
nextIndex
:
''
,
lastIndex
:
''
,
tabRadio
:{
...
...
@@ -54,11 +54,24 @@ export const MOULDLIST = [
title
:
'唱学加油包'
,
imgUrl
:
RefuelingUrl
,
name
:
'加油包-1'
,
key
:
'refueling1'
key
:
'refueling1'
,
content
:{
radio
:[],
banner
:[],
nextIndex
:
''
,
nextType
:
true
,
lastIndex
:
''
,
}
},{
title
:
'爸妈秀宝贝'
,
imgUrl
:
showBabyUrl
,
name
:
'秀宝贝-1'
,
key
:
'show1'
key
:
'show1'
,
content
:{
text
:
''
,
check
:
true
,
nextIndex
:
''
,
lastIndex
:
''
,
}
},
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment