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
edad743b
Commit
edad743b
authored
Aug 31, 2018
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编写
parent
7738ab17
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
440 additions
and
175 deletions
+440
-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
+15
-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 @
edad743b
...
@@ -5,7 +5,7 @@ const prodEnv = require('./prod.env');
...
@@ -5,7 +5,7 @@ const prodEnv = require('./prod.env');
module
.
exports
=
merge
(
prodEnv
,
{
module
.
exports
=
merge
(
prodEnv
,
{
NODE_ENV
:
'"development"'
,
NODE_ENV
:
'"development"'
,
API_URL
:
'"/"'
,
API_URL
:
'"/"'
,
MAX_FILESIZE
:
'1024*1024*
5
'
,
MAX_FILESIZE
:
'1024*1024*
10
'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
INVITE_URL
:
'"http://wechat.test.singsingenglish.com"'
,
INVITE_URL
:
'"http://wechat.test.singsingenglish.com"'
,
});
});
config/prod.env.js
View file @
edad743b
...
@@ -3,5 +3,5 @@ module.exports = {
...
@@ -3,5 +3,5 @@ module.exports = {
NODE_ENV
:
'"production"'
,
NODE_ENV
:
'"production"'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
API_URL
:
'"/"'
,
API_URL
:
'"/"'
,
MAX_FILESIZE
:
'1024*1024*
5
'
,
MAX_FILESIZE
:
'1024*1024*
10
'
,
}
}
config/test.env.js
View file @
edad743b
...
@@ -6,5 +6,5 @@ module.exports = merge(prodEnv, {
...
@@ -6,5 +6,5 @@ module.exports = merge(prodEnv, {
NODE_ENV
:
'"production"'
,
NODE_ENV
:
'"production"'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
IMAGE_URL_HEAD
:
'"http://cdn.singsingenglish.com/"'
,
API_URL
:
'"/"'
,
API_URL
:
'"/"'
,
MAX_FILESIZE
:
'1024*1024*
5
'
,
MAX_FILESIZE
:
'1024*1024*
10
'
,
})
})
src/assets/mould/refueling1/radio.png
View replaced file @
7738ab17
View file @
edad743b
8.99 KB
|
W:
|
H:
3.89 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/components/resources/editor.vue
View file @
edad743b
This diff is collapsed.
Click to expand it.
src/components/resources/editorDialog.vue
View file @
edad743b
...
@@ -23,14 +23,27 @@
...
@@ -23,14 +23,27 @@
</el-card>
</el-card>
</div>
</div>
</div>
</div>
</el-aside>
</el-aside>
<el-main>
<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-main>
</el-container>
</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>
</el-dialog>
</el-dialog>
</
template
>
</
template
>
...
@@ -39,6 +52,8 @@
...
@@ -39,6 +52,8 @@
import
addUrl
from
'../../assets/editor/Group 7.png'
import
addUrl
from
'../../assets/editor/Group 7.png'
import
{
MOULDLIST
}
from
"../../util/resourceMould"
;
import
{
MOULDLIST
}
from
"../../util/resourceMould"
;
import
editor
from
'./editor'
import
editor
from
'./editor'
import
{
addCategoryApi
}
from
"../../service/api"
;
export
default
{
export
default
{
props
:[
props
:[
'editorObj'
'editorObj'
...
@@ -50,6 +65,7 @@
...
@@ -50,6 +65,7 @@
return
{
return
{
selectedMould
:[],
selectedMould
:[],
addUrl
:
addUrl
,
addUrl
:
addUrl
,
showDialog
:
false
,
mouldList
:
MOULDLIST
,
mouldList
:
MOULDLIST
,
age
:[
0
,
0
],
age
:[
0
,
0
],
level
:[
0
,
0
],
level
:[
0
,
0
],
...
...
src/service/api.js
View file @
edad743b
...
@@ -143,12 +143,12 @@ const getCategoryUrl = `${_baseUrl}api/admin/category/list/0`;
...
@@ -143,12 +143,12 @@ const getCategoryUrl = `${_baseUrl}api/admin/category/list/0`;
export
const
getCategoryApi
=
function
(
pid
)
{
export
const
getCategoryApi
=
function
(
pid
)
{
return
Vue
.
prototype
.
$fetch
(
getCategoryUrl
,{
'pid'
:
pid
})
return
Vue
.
prototype
.
$fetch
(
getCategoryUrl
,{
'pid'
:
pid
})
};
};
//删除
元素
分类
//删除分类
const
delCategoryUrl
=
`
${
_baseUrl
}
api/admin/category`
;
const
delCategoryUrl
=
`
${
_baseUrl
}
api/admin/category`
;
export
const
delCategoryApi
=
function
(
id
)
{
export
const
delCategoryApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$del
(
`
${
delCategoryUrl
}
/
${
id
}
`
)
return
Vue
.
prototype
.
$del
(
`
${
delCategoryUrl
}
/
${
id
}
`
)
};
};
//
元素
排序修改
//
分类
排序修改
const
sortCategoryUrl
=
`
${
_baseUrl
}
api/admin/category/sort`
;
const
sortCategoryUrl
=
`
${
_baseUrl
}
api/admin/category/sort`
;
export
const
sortCategoryApi
=
function
(
json
)
{
export
const
sortCategoryApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$patch
(
sortCategoryUrl
,
json
)
return
Vue
.
prototype
.
$patch
(
sortCategoryUrl
,
json
)
...
@@ -158,6 +158,21 @@ const getCateDetailListUrl = `${_baseUrl}api/admin/element/list/0`;
...
@@ -158,6 +158,21 @@ const getCateDetailListUrl = `${_baseUrl}api/admin/element/list/0`;
export
const
getCateListApi
=
function
(
id
)
{
export
const
getCateListApi
=
function
(
id
)
{
return
Vue
.
prototype
.
$fetch
(
getCateDetailListUrl
,
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`
;
const
getSingleListUrl
=
`
${
_baseUrl
}
api/admin/item/stock/list`
;
export
const
getSingleListApi
=
function
(
name
)
{
export
const
getSingleListApi
=
function
(
name
)
{
...
@@ -256,8 +271,8 @@ export const getMediaListApi = function (json) {
...
@@ -256,8 +271,8 @@ export const getMediaListApi = function (json) {
// const getGoodsListUrl = `${_baseUrl}api/admin/goods/list`;
// const getGoodsListUrl = `${_baseUrl}api/admin/goods/list`;
// 文件上传
// 文件上传
const
uploadFileUrl
=
`
${
_baseUrl
}
api/public/upload/zone`
;
const
uploadFileUrl
=
`
${
_baseUrl
}
api/public/upload/zone`
;
export
const
uploadFileApi
=
function
(
data
)
{
export
const
uploadFileApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$upload
(
uploadFileUrl
,
data
)
return
Vue
.
prototype
.
$upload
(
uploadFileUrl
,
json
)
};
};
// 获取菜单列表
// 获取菜单列表
const
getMenuListUrl
=
`
${
_baseUrl
}
api/admin/category/list/2`
;
const
getMenuListUrl
=
`
${
_baseUrl
}
api/admin/category/list/2`
;
...
...
src/service/index.js
View file @
edad743b
import
axios
from
'axios'
;
import
axios
from
'axios'
;
import
md5
from
'js-md5'
;
import
md5
from
'js-md5'
;
import
store
from
"@/store"
import
{
MessageBox
,
Message
}
from
'element-ui'
;
import
{
MessageBox
,
Message
}
from
'element-ui'
;
import
router
from
'../router'
import
router
from
'../router'
import
Cookie
from
'../util/cookie'
import
Cookie
from
'../util/cookie'
...
@@ -65,29 +66,34 @@ axios.interceptors.response.use(
...
@@ -65,29 +66,34 @@ axios.interceptors.response.use(
* @param params
* @param params
* @returns {Promise}
* @returns {Promise}
*/
*/
export
function
upload
(
url
,
data
)
{
export
function
upload
(
url
,
json
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
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
y
=
0
;
let
fun
=
function
(){
let
fun
=
function
(){
let
formData
=
new
FormData
();
let
formData
=
new
FormData
();
let
file
=
data
.
slice
(
y
*
process
.
env
.
MAX_FILESIZE
,(
y
+
1
)
*
process
.
env
.
MAX_FILESIZE
)
let
file
=
json
.
file
.
slice
(
y
*
process
.
env
.
MAX_FILESIZE
,(
y
+
1
)
*
process
.
env
.
MAX_FILESIZE
);
console
.
log
(
data
)
console
.
log
(
json
.
file
);
formData
.
append
(
'chunk'
,
y
);
formData
.
append
(
'chunk'
,
y
);
formData
.
append
(
'file_name'
,
data
.
name
);
formData
.
append
(
'file_name'
,
json
.
file
.
name
);
formData
.
append
(
'count'
,
size
);
formData
.
append
(
'count'
,
size
);
formData
.
append
(
'file'
,
file
);
formData
.
append
(
'file'
,
file
);
axios
.
post
(
url
,
formData
,{
headers
:
{
axios
.
post
(
url
,
formData
,{
headers
:
{
'Content-Type'
:
'multipart/form-data'
'Content-Type'
:
'multipart/form-data'
},
timeout
:
60000
})
},
timeout
:
60000
,
onUploadProgress
:
progressEvent
=>
{
let
progress
=
((
Number
(
progressEvent
.
loaded
)
+
Number
(
y
*
process
.
env
.
MAX_FILESIZE
))
/
Number
(
json
.
file
.
size
)
*
100
|
0
);
console
.
log
((
Number
(
progressEvent
.
loaded
),
Number
(
y
*
process
.
env
.
MAX_FILESIZE
),
progress
));
store
.
dispatch
(
'setProgress'
,{
type
:
'change'
,
id
:
json
.
file
.
uid
,
num
:
progress
});
},})
.
then
(
response
=>
{
.
then
(
response
=>
{
if
(
response
.
data
.
code
===
200
){
if
(
response
.
data
.
code
===
200
){
y
++
;
if
(
y
+
1
<
size
){
if
(
y
<
size
){
y
++
;
fun
()
fun
()
}
else
{
}
else
{
y
=
0
;
resolve
(
response
.
data
.
data
);
resolve
(
response
.
data
.
data
);
}
}
}
else
{
}
else
{
...
...
src/store/actions.js
View file @
edad743b
...
@@ -7,4 +7,7 @@ export default{
...
@@ -7,4 +7,7 @@ export default{
setUserName
({
commit
},
name
){
setUserName
({
commit
},
name
){
commit
(
'setUserName'
,
name
);
commit
(
'setUserName'
,
name
);
},
},
setProgress
({
commit
},
data
){
commit
(
'progress'
,
data
);
},
}
}
src/store/index.js
View file @
edad743b
...
@@ -14,6 +14,7 @@ export default new vuex.Store({
...
@@ -14,6 +14,7 @@ export default new vuex.Store({
menuList
:
menu
,
menuList
:
menu
,
menuType
:
false
,
menuType
:
false
,
nowTab
:
'first'
,
nowTab
:
'first'
,
progressList
:[],
openedTab
:[
openedTab
:[
{
{
value
:
'首页'
,
value
:
'首页'
,
...
...
src/store/mutations.js
View file @
edad743b
...
@@ -19,6 +19,19 @@ const mutations={
...
@@ -19,6 +19,19 @@ const mutations={
},
},
changeParentRouter
(
state
,
data
){
changeParentRouter
(
state
,
data
){
state
.
menuList
.
find
((
a
)
=>
{
return
a
.
name
===
data
.
name
}).
routerName
=
data
.
to
.
name
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
;
export
default
mutations
;
src/util/resourceMould.js
View file @
edad743b
...
@@ -41,8 +41,8 @@ export const MOULDLIST = [
...
@@ -41,8 +41,8 @@ export const MOULDLIST = [
name
:
'玩-video-1'
,
name
:
'玩-video-1'
,
key
:
'play1'
,
key
:
'play1'
,
content
:{
content
:{
videoUrl
:
''
,
videoUrl
:
[]
,
banner
:
""
,
banner
:
[]
,
nextIndex
:
''
,
nextIndex
:
''
,
lastIndex
:
''
,
lastIndex
:
''
,
tabRadio
:{
tabRadio
:{
...
@@ -54,11 +54,24 @@ export const MOULDLIST = [
...
@@ -54,11 +54,24 @@ export const MOULDLIST = [
title
:
'唱学加油包'
,
title
:
'唱学加油包'
,
imgUrl
:
RefuelingUrl
,
imgUrl
:
RefuelingUrl
,
name
:
'加油包-1'
,
name
:
'加油包-1'
,
key
:
'refueling1'
key
:
'refueling1'
,
content
:{
radio
:[],
banner
:[],
nextIndex
:
''
,
nextType
:
true
,
lastIndex
:
''
,
}
},{
},{
title
:
'爸妈秀宝贝'
,
title
:
'爸妈秀宝贝'
,
imgUrl
:
showBabyUrl
,
imgUrl
:
showBabyUrl
,
name
:
'秀宝贝-1'
,
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