Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
wanli
evm-store
Commits
79eb2e3c
Commit
79eb2e3c
authored
Mar 16, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
5e559b46
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
115 deletions
+185
-115
backend/model/apps.py
backend/model/apps.py
+1
-1
frontend/src/views/app-store/index.vue
frontend/src/views/app-store/index.vue
+184
-114
No files found.
backend/model/apps.py
View file @
79eb2e3c
...
@@ -21,7 +21,7 @@ class Apps(db.Entity):
...
@@ -21,7 +21,7 @@ class Apps(db.Entity):
app_version
=
Optional
(
str
,
default
=
""
)
app_version
=
Optional
(
str
,
default
=
""
)
app_url
=
Optional
(
str
,
default
=
""
)
app_url
=
Optional
(
str
,
default
=
""
)
category
=
Optional
(
str
,
default
=
""
)
category
=
Optional
(
str
,
default
=
""
)
app_icon
=
Optional
(
"Annex"
,
reverse
=
"app_icon"
,
cascade_delete
=
True
)
app_icon
=
Optional
(
"Annex"
,
reverse
=
"app_icon"
)
app_desc
=
Optional
(
str
,
default
=
""
)
app_desc
=
Optional
(
str
,
default
=
""
)
app_annex
=
Set
(
"Annex"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_annex
=
Set
(
"Annex"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_user
=
Optional
(
"AppUser"
,
reverse
=
"app"
,
cascade_delete
=
True
)
app_user
=
Optional
(
"AppUser"
,
reverse
=
"app"
,
cascade_delete
=
True
)
...
...
frontend/src/views/app-store/index.vue
View file @
79eb2e3c
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-form
:inline=
"true"
ref=
"form"
:model=
"form"
size=
"mini"
>
<el-form
:inline=
"true"
ref=
"form"
:model=
"form"
size=
"mini"
>
<el-form-item><el-button
type=
"warning"
@
click=
"onAdd"
>
添加应用
</el-button></el-form-item>
<el-form-item
><el-button
type=
"warning"
@
click=
"onAdd"
>
添加应用
</el-button
></el-form-item
>
<!--
<el-form-item><el-button
type=
"success"
@
click=
"onAddFramework"
>
添加系统页面
</el-button></el-form-item>
-->
<!--
<el-form-item><el-button
type=
"success"
@
click=
"onAddFramework"
>
添加系统页面
</el-button></el-form-item>
-->
<!--
<el-form-item><el-button
type=
"success"
@
click=
"onAddFramework"
>
上传JSON配置文件
</el-button></el-form-item>
-->
<!--
<el-form-item><el-button
type=
"success"
@
click=
"onAddFramework"
>
上传JSON配置文件
</el-button></el-form-item>
-->
</el-form>
</el-form>
...
@@ -61,7 +65,12 @@
...
@@ -61,7 +65,12 @@
label=
"更新者"
label=
"更新者"
width=
"150"
width=
"150"
></el-table-column>
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
min-width=
"180"
fixed=
"right"
>
<el-table-column
label=
"操作"
align=
"center"
min-width=
"180"
fixed=
"right"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
<el-button
size=
"mini"
size=
"mini"
...
@@ -97,24 +106,54 @@
...
@@ -97,24 +106,54 @@
></el-pagination>
></el-pagination>
</div>
</div>
<el-dialog
:title=
"dialogTitle"
:visible.sync=
"dialogVisible"
width=
"45%"
>
<el-dialog
:title=
"dialogTitle"
:visible.sync=
"dialogVisible"
width=
"45%"
>
<el-form
:model=
"post"
status-icon
ref=
"post"
size=
"medium"
label-width=
"100px"
>
<el-form
:model=
"post"
status-icon
ref=
"post"
size=
"medium"
label-width=
"100px"
>
<el-form-item
label=
"应用排序"
prop=
"sort"
>
<el-form-item
label=
"应用排序"
prop=
"sort"
>
<el-input
type=
"number"
v-model.number=
"post.sort"
autocomplete=
"off"
></el-input>
<el-input
type=
"number"
v-model.number=
"post.sort"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"应用名称"
prop=
"app_name"
>
<el-form-item
label=
"应用名称"
prop=
"app_name"
>
<el-input
type=
"text"
v-model=
"post.app_name"
autocomplete=
"off"
></el-input>
<el-input
type=
"text"
v-model=
"post.app_name"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"应用版本号"
prop=
"app_version"
>
<el-form-item
label=
"应用版本号"
prop=
"app_version"
>
<el-input
type=
"text"
v-model=
"post.app_version"
autocomplete=
"off"
></el-input>
<el-input
type=
"text"
v-model=
"post.app_version"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"应用路径"
prop=
"app_url"
>
<el-form-item
label=
"应用路径"
prop=
"app_url"
>
<el-input
type=
"text"
v-model=
"post.app_url"
autocomplete=
"off"
></el-input>
<el-input
type=
"text"
v-model=
"post.app_url"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"应用类别"
prop=
"category"
>
<el-form-item
label=
"应用类别"
prop=
"category"
>
<el-input
type=
"text"
v-model=
"post.category"
autocomplete=
"off"
></el-input>
<el-input
type=
"text"
v-model=
"post.category"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"应用描述"
prop=
"app_desc"
>
<el-form-item
label=
"应用描述"
prop=
"app_desc"
>
<el-input
type=
"text"
v-model=
"post.app_desc"
autocomplete=
"off"
></el-input>
<el-input
type=
"text"
v-model=
"post.app_desc"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"应用Logo"
prop=
"app_icon"
>
<el-form-item
label=
"应用Logo"
prop=
"app_icon"
>
<el-upload
<el-upload
...
@@ -132,6 +171,7 @@
...
@@ -132,6 +171,7 @@
<el-form-item
label=
"应用文件"
prop=
"app_files"
>
<el-form-item
label=
"应用文件"
prop=
"app_files"
>
<el-upload
<el-upload
drag
drag
ref=
"upload"
:action=
"`${window.location.protocol}//${window.location.host}/api/v1/evm_store/upload`"
:action=
"`${window.location.protocol}//${window.location.host}/api/v1/evm_store/upload`"
:on-remove=
"handleRemove"
:on-remove=
"handleRemove"
:on-success=
"handleUploadSuccess"
:on-success=
"handleUploadSuccess"
...
@@ -143,14 +183,24 @@
...
@@ -143,14 +183,24 @@
将文件拖到此处,或
<em>
点击上传
</em>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
.evue和资源文件
<el-button
size=
"small"
type=
"text"
@
click=
"clear"
>
清空上传
</el-button
>
</div>
</div>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
size=
"medium"
plain
@
click=
"submitForm('post')"
>
提交
</el-button>
<el-button
<el-button
type=
"success"
size=
"medium"
plain
@
click=
"onReset('form')"
>
重置
</el-button>
type=
"primary"
size=
"medium"
plain
@
click=
"submitForm('post')"
>
提交
</el-button
>
<el-button
type=
"success"
size=
"medium"
plain
@
click=
"onReset('form')"
>
重置
</el-button
>
<el-button
size=
"medium"
@
click=
"dialogVisible = false"
>
关闭
</el-button>
<el-button
size=
"medium"
@
click=
"dialogVisible = false"
>
关闭
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
...
@@ -179,8 +229,12 @@
...
@@ -179,8 +229,12 @@
:file-list=
"fileList"
:file-list=
"fileList"
>
>
<i
class=
"el-icon-upload"
></i>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传jpg/png文件,且不超过500kb
</div>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传jpg/png文件,且不超过500kb
</div>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -192,7 +246,14 @@
...
@@ -192,7 +246,14 @@
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
getAppsList
,
deleteApp
,
addApp
,
updateApp
,
getBuildApp
,
addFramework
}
from
"
@/api/app-store
"
;
import
{
getAppsList
,
deleteApp
,
addApp
,
updateApp
,
getBuildApp
,
addFramework
,
}
from
"
@/api/app-store
"
;
import
{
mapTrim
,
checkURL
,
download
}
from
"
@/utils/index
"
;
import
{
mapTrim
,
checkURL
,
download
}
from
"
@/utils/index
"
;
export
default
{
export
default
{
...
@@ -216,8 +277,8 @@ export default {
...
@@ -216,8 +277,8 @@ export default {
desc
:
null
,
desc
:
null
,
type
:
null
,
type
:
null
,
assets
:
{
assets
:
{
files
:
[]
files
:
[],
}
},
},
},
currentIndex
:
0
,
currentIndex
:
0
,
currentValue
:
null
,
currentValue
:
null
,
...
@@ -240,6 +301,9 @@ export default {
...
@@ -240,6 +301,9 @@ export default {
window
:
()
=>
window
,
window
:
()
=>
window
,
},
},
methods
:
{
methods
:
{
clear
()
{
this
.
$refs
.
upload
.
clearFiles
();
},
fetchData
(
params
)
{
fetchData
(
params
)
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
getAppsList
(
params
)
getAppsList
(
params
)
...
@@ -264,17 +328,21 @@ export default {
...
@@ -264,17 +328,21 @@ export default {
this
.
fetchData
(
mapTrim
(
this
.
form
));
this
.
fetchData
(
mapTrim
(
this
.
form
));
},
},
handleBuild
(
index
,
row
)
{
handleBuild
(
index
,
row
)
{
console
.
log
(
index
)
console
.
log
(
index
);
getBuildApp
(
row
.
uuid
).
then
(
res
=>
{
getBuildApp
(
row
.
uuid
)
download
(
res
.
data
.
app_name
,
res
.
data
.
app_path
)
.
then
((
res
)
=>
{
this
.
$message
.
success
(
res
.
message
)
download
(
res
.
data
.
app_name
,
res
.
data
.
app_path
);
}).
catch
(
err
=>
{
this
.
$message
.
success
(
res
.
message
);
console
.
log
(
err
)
this
.
$message
.
error
(
err
.
message
)
})
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
this
.
$message
.
error
(
err
.
message
);
});
},
},
handleEdit
(
index
,
row
)
{
handleEdit
(
index
,
row
)
{
this
.
post
=
Object
.
assign
(
row
);
this
.
post
=
Object
.
assign
(
row
);
this
.
fileList
=
[];
this
.
imageUrl
=
null
;
this
.
currentIndex
=
index
;
this
.
currentIndex
=
index
;
this
.
currentValue
=
row
;
this
.
currentValue
=
row
;
this
.
dialogTitle
=
"
编辑
"
;
this
.
dialogTitle
=
"
编辑
"
;
...
@@ -308,15 +376,15 @@ export default {
...
@@ -308,15 +376,15 @@ export default {
handleUploadSuccess
(
res
)
{
handleUploadSuccess
(
res
)
{
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
if
(
!
checkURL
(
res
.
data
.
filepath
))
if
(
!
checkURL
(
res
.
data
.
filepath
))
res
.
data
.
filepath
=
`
${
window
.
location
.
origin
}
/
${
res
.
data
.
filepath
}
`
res
.
data
.
filepath
=
`
${
window
.
location
.
origin
}
/
${
res
.
data
.
filepath
}
`
;
this
.
post
.
app_files
.
push
(
res
.
data
)
this
.
post
.
app_files
.
push
(
res
.
data
);
}
}
},
},
handleAvatarSuccess
(
res
,
file
)
{
handleAvatarSuccess
(
res
,
file
)
{
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
if
(
!
checkURL
(
res
.
data
.
filepath
))
if
(
!
checkURL
(
res
.
data
.
filepath
))
res
.
data
.
filepath
=
`
${
window
.
location
.
origin
}
/
${
res
.
data
.
filepath
}
`
res
.
data
.
filepath
=
`
${
window
.
location
.
origin
}
/
${
res
.
data
.
filepath
}
`
;
this
.
post
.
app_icon
=
res
.
data
this
.
post
.
app_icon
=
res
.
data
;
}
}
this
.
imageUrl
=
URL
.
createObjectURL
(
file
.
raw
);
this
.
imageUrl
=
URL
.
createObjectURL
(
file
.
raw
);
},
},
...
@@ -338,7 +406,7 @@ export default {
...
@@ -338,7 +406,7 @@ export default {
this
.
imageUrl
=
null
;
this
.
imageUrl
=
null
;
},
},
handleRemove
(
file
)
{
handleRemove
(
file
)
{
for
(
let
i
=
0
;
i
<
this
.
post
.
app_files
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
post
.
app_files
.
length
;
i
++
)
{
if
(
this
.
post
.
app_files
[
i
].
uuid
==
file
.
response
.
data
.
uuid
)
{
if
(
this
.
post
.
app_files
[
i
].
uuid
==
file
.
response
.
data
.
uuid
)
{
this
.
post
.
app_files
.
splice
(
i
,
1
);
this
.
post
.
app_files
.
splice
(
i
,
1
);
break
;
break
;
...
@@ -348,7 +416,7 @@ export default {
...
@@ -348,7 +416,7 @@ export default {
},
},
handleFrameworkRemove
()
{},
handleFrameworkRemove
()
{},
handleFrameworkSuccess
(
res
)
{
handleFrameworkSuccess
(
res
)
{
this
.
framework
.
assets
.
files
.
push
(
res
.
data
)
this
.
framework
.
assets
.
files
.
push
(
res
.
data
);
},
},
submitForm
(
formName
)
{
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
...
@@ -383,12 +451,14 @@ export default {
...
@@ -383,12 +451,14 @@ export default {
});
});
},
},
addFramework
()
{
addFramework
()
{
addFramework
(
this
.
framework
).
then
(
res
=>
{
addFramework
(
this
.
framework
)
this
.
$message
.
success
(
res
.
message
)
.
then
((
res
)
=>
{
this
.
frameworkDialog
=
false
this
.
$message
.
success
(
res
.
message
);
}).
catch
(
err
=>
{
this
.
frameworkDialog
=
false
;
this
.
$message
.
error
(
err
.
message
)
})
})
.
catch
((
err
)
=>
{
this
.
$message
.
error
(
err
.
message
);
});
},
},
onAddFramework
()
{
onAddFramework
()
{
this
.
frameworkDialog
=
true
;
this
.
frameworkDialog
=
true
;
...
...
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