Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
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
劳工
zeroing-editor
Commits
c81bbbaa
Commit
c81bbbaa
authored
Nov 23, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加自定义模块支持
证书详情编辑弹窗
parent
24b63e1e
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
294 additions
and
77 deletions
+294
-77
en.json
src/locales/en.json
+3
-2
zh-CN.json
src/locales/zh-CN.json
+3
-2
index.js
src/store/index.js
+4
-0
env.js
src/store/modules/env.js
+2
-0
project.js
src/store/modules/project.js
+8
-1
editor.scss
src/themes/light/editor.scss
+41
-30
Editor.vue
src/views/Editor.vue
+4
-10
DetailsDialog.vue
src/views/Editor/dialogs/DetailsDialog.vue
+59
-0
CustomEditor.vue
src/views/Editor/dialogs/editors/CustomEditor.vue
+40
-0
DataMappingEditor.vue
src/views/Editor/dialogs/editors/DataMappingEditor.vue
+58
-0
EnvEditor.vue
src/views/Editor/dialogs/editors/EnvEditor.vue
+58
-0
ProjectEditor.vue
src/views/Editor/dialogs/editors/ProjectEditor.vue
+14
-32
No files found.
src/locales/en.json
View file @
c81bbbaa
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
"Close"
:
"Close"
,
"Close"
:
"Close"
,
"Still Close"
:
"Still Close"
,
"Still Close"
:
"Still Close"
,
"Save"
:
"Save"
,
"Save"
:
"Save"
,
"Reset"
:
"Reset"
,
"Copy"
:
"Copy"
,
"Copy"
:
"Copy"
,
"Exit"
:
"Exit"
,
"Exit"
:
"Exit"
,
"Props"
:
"Props"
,
"Props"
:
"Props"
,
...
@@ -15,7 +16,8 @@
...
@@ -15,7 +16,8 @@
"Export"
:
"Export"
,
"Export"
:
"Export"
,
"Upload"
:
"Upload"
,
"Upload"
:
"Upload"
,
"Edit"
:
"Edit"
,
"Edit"
:
"Edit"
,
"Env"
:
"Env"
,
"EditEnv"
:
"EditEnv"
,
"EditCustomModule"
:
"EditCustomModule"
,
"ID"
:
"ID"
,
"ID"
:
"ID"
,
"Name"
:
"Name"
,
"Name"
:
"Name"
,
"Alias"
:
"Alias"
,
"Alias"
:
"Alias"
,
...
@@ -115,7 +117,6 @@
...
@@ -115,7 +117,6 @@
"details"
:
"Details"
,
"details"
:
"Details"
,
"preview"
:
"Preview"
,
"preview"
:
"Preview"
,
"pack"
:
"Pack"
,
"pack"
:
"Pack"
,
"data-mapping"
:
"DataMapping"
,
"exit"
:
"Exit"
,
"exit"
:
"Exit"
,
"undo"
:
"Undo"
,
"undo"
:
"Undo"
,
"redo"
:
"Redo"
"redo"
:
"Redo"
...
...
src/locales/zh-CN.json
View file @
c81bbbaa
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
"Close"
:
"关闭"
,
"Close"
:
"关闭"
,
"Still Close"
:
"仍然关闭"
,
"Still Close"
:
"仍然关闭"
,
"Save"
:
"保存"
,
"Save"
:
"保存"
,
"Reset"
:
"重置"
,
"Copy"
:
"复制"
,
"Copy"
:
"复制"
,
"Exit"
:
"退出"
,
"Exit"
:
"退出"
,
"Props"
:
"属性"
,
"Props"
:
"属性"
,
...
@@ -15,7 +16,8 @@
...
@@ -15,7 +16,8 @@
"Export"
:
"导出"
,
"Export"
:
"导出"
,
"Upload"
:
"上传"
,
"Upload"
:
"上传"
,
"Edit"
:
"编辑"
,
"Edit"
:
"编辑"
,
"Env"
:
"环境"
,
"EditEnv"
:
"编辑环境"
,
"EditCustomModule"
:
"编辑自定义模块"
,
"ID"
:
"ID"
,
"ID"
:
"ID"
,
"Name"
:
"名字"
,
"Name"
:
"名字"
,
"Alias"
:
"别名"
,
"Alias"
:
"别名"
,
...
@@ -115,7 +117,6 @@
...
@@ -115,7 +117,6 @@
"details"
:
"详情"
,
"details"
:
"详情"
,
"preview"
:
"预览"
,
"preview"
:
"预览"
,
"pack"
:
"发布"
,
"pack"
:
"发布"
,
"data-mapping"
:
"数据映射"
,
"exit"
:
"退出"
,
"exit"
:
"退出"
,
"undo"
:
"撤销"
,
"undo"
:
"撤销"
,
"redo"
:
"重做"
"redo"
:
"重做"
...
...
src/store/index.js
View file @
c81bbbaa
...
@@ -40,8 +40,12 @@ export default new Vuex.Store({
...
@@ -40,8 +40,12 @@ export default new Vuex.Store({
'addDataMapping'
,
'addDataMapping'
,
'deleteDataMapping'
,
'deleteDataMapping'
,
'modifyDataMapping'
,
'modifyDataMapping'
,
'addEnvMapping'
,
'deleteEnvMapping'
,
'modifyEnvMapping'
,
'modifyActiveView'
,
'modifyActiveView'
,
'behavior_save'
,
'behavior_save'
,
'modifyCustoms'
,
]
]
})
})
]
]
...
...
src/store/modules/env.js
View file @
c81bbbaa
...
@@ -18,12 +18,14 @@ export const envStore = {
...
@@ -18,12 +18,14 @@ export const envStore = {
},
},
processes
:
[],
processes
:
[],
scripts
:
[],
scripts
:
[],
customs
:
[],
},
},
mutations
:
{
mutations
:
{
updateEnv
(
state
,
env
)
{
updateEnv
(
state
,
env
)
{
Object
.
assign
(
state
,
env
);
Object
.
assign
(
state
,
env
);
state
.
processes
=
parseItem
(
state
.
processes
);
state
.
processes
=
parseItem
(
state
.
processes
);
state
.
scripts
=
parseItem
(
state
.
scripts
);
state
.
scripts
=
parseItem
(
state
.
scripts
);
state
.
customs
=
parseItem
(
state
.
customs
);
state
.
initialized
=
true
;
state
.
initialized
=
true
;
},
},
...
...
src/store/modules/project.js
View file @
c81bbbaa
...
@@ -43,6 +43,7 @@ export const projectStore = {
...
@@ -43,6 +43,7 @@ export const projectStore = {
assets
:
[],
assets
:
[],
dataMapping
:
[],
dataMapping
:
[],
processes
:
[],
processes
:
[],
customs
:
[],
},
},
activeComponent
:
{},
activeComponent
:
{},
activeComponentCopy
:
{},
// 当前选中节点的镜像,用来处理拖拽时数据变化频繁的问题
activeComponentCopy
:
{},
// 当前选中节点的镜像,用来处理拖拽时数据变化频繁的问题
...
@@ -65,19 +66,21 @@ export const projectStore = {
...
@@ -65,19 +66,21 @@ export const projectStore = {
const
localData
=
state
.
data
;
const
localData
=
state
.
data
;
if
(
data
)
{
if
(
data
)
{
const
{
views
,
assets
,
dataMapping
,
processes
,
options
,
}
=
JSON
.
parse
(
data
);
const
{
views
,
assets
,
dataMapping
,
processes
,
options
,
customs
,
}
=
JSON
.
parse
(
data
);
Vue
.
set
(
localData
,
'options'
,
options
||
getDefaultOptions
());
Vue
.
set
(
localData
,
'options'
,
options
||
getDefaultOptions
());
Vue
.
set
(
localData
,
'views'
,
views
||
[]);
Vue
.
set
(
localData
,
'views'
,
views
||
[]);
Vue
.
set
(
localData
,
'assets'
,
assets
||
[]);
Vue
.
set
(
localData
,
'assets'
,
assets
||
[]);
Vue
.
set
(
localData
,
'dataMapping'
,
dataMapping
||
[]);
Vue
.
set
(
localData
,
'dataMapping'
,
dataMapping
||
[]);
Vue
.
set
(
localData
,
'processes'
,
processes
||
[]);
Vue
.
set
(
localData
,
'processes'
,
processes
||
[]);
Vue
.
set
(
localData
,
'customs'
,
customs
||
[]);
}
else
{
}
else
{
Vue
.
set
(
localData
,
'options'
,
getDefaultOptions
());
Vue
.
set
(
localData
,
'options'
,
getDefaultOptions
());
Vue
.
set
(
localData
,
'views'
,
[]);
Vue
.
set
(
localData
,
'views'
,
[]);
Vue
.
set
(
localData
,
'assets'
,
[]);
Vue
.
set
(
localData
,
'assets'
,
[]);
Vue
.
set
(
localData
,
'dataMapping'
,
[]);
Vue
.
set
(
localData
,
'dataMapping'
,
[]);
Vue
.
set
(
localData
,
'processes'
,
[]);
Vue
.
set
(
localData
,
'processes'
,
[]);
Vue
.
set
(
localData
,
'customs'
,
[]);
}
}
},
},
/**
/**
...
@@ -344,6 +347,10 @@ export const projectStore = {
...
@@ -344,6 +347,10 @@ export const projectStore = {
modifyEnvMapping
(
state
)
{
modifyEnvMapping
(
state
)
{
},
},
modifyCustoms
(
state
,
customs
){
state
.
data
.
customs
=
customs
;
},
},
},
getters
:
{
getters
:
{
project
(
state
)
{
project
(
state
)
{
...
...
src/themes/light/editor.scss
View file @
c81bbbaa
...
@@ -25,11 +25,11 @@
...
@@ -25,11 +25,11 @@
}
}
}
}
.right-part
{
.right-part
{
color
:
$--color-text-regular
;
color
:
$--color-text-regular
;
line-height
:
15px
;
line-height
:
15px
;
.el-button
{
.el-button
{
padding
:
2px
;
padding
:
2px
;
}
}
}
}
...
@@ -44,49 +44,60 @@
...
@@ -44,49 +44,60 @@
background-color
:
$--pane-background-color
;
background-color
:
$--pane-background-color
;
}
}
.data-mapping-dialog
{
.mapping-list
{
height
:
200px
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
button
{
button
{
align-self
:
flex-start
;
align-self
:
flex-start
;
margin-bottom
:
5px
;
}
}
.scrollbar
{
.item
+
.item
{
flex
:
1
;
margin-top
:
5px
;
.view
{
padding-right
:
10px
;
}
.item
+
.item
{
margin-top
:
10px
;
}
}
.item
{
.item
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
&
:hover
{
&
:hover
{
&
>
button
{
&
>
button
{
visibility
:
visible
;
visibility
:
visible
;
}
}
}
}
.el-icon-connection
{
.el-icon-connection
{
padding
:
0
5px
;
padding
:
0
5px
;
}
}
button
{
button
{
margin-left
:
5px
;
margin-left
:
5px
;
visibility
:
hidden
;
visibility
:
hidden
;
}
}
}
}
}
.details-dialog
{
.operate-bar
{
display
:
flex
;
justify-content
:
flex-end
;
padding
:
5px
;
}
}
}
.scrollbar
{
height
:
40vh
;
.project-details-dialog
{
.view
{
padding-right
:
10px
;
.custom-module-list
{
display
:
flex
;
flex-direction
:
column
;
.item
+
.item
{
margin-top
:
5px
;
}
}
}
}
}
}
src/views/Editor.vue
View file @
c81bbbaa
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
</split-panes>
</split-panes>
<inspector
splitpanes-min=
"20"
:splitpanes-size=
"getSize(0, 1)"
></inspector>
<inspector
splitpanes-min=
"20"
:splitpanes-size=
"getSize(0, 1)"
></inspector>
</split-panes>
</split-panes>
<project-details-dialog
ref=
"projectDialogsDialog"
/>
<details-dialog
ref=
"dialogsDialog"
/>
<data-mapping-dialog
ref=
"dataMappingDialog"
/>
</div>
</div>
</
template
>
</
template
>
...
@@ -24,16 +23,14 @@
...
@@ -24,16 +23,14 @@
import
Views
from
"./Editor/Views"
;
import
Views
from
"./Editor/Views"
;
import
Playground
from
"./Editor/Playground"
;
import
Playground
from
"./Editor/Playground"
;
import
Assets
from
"./Editor/Assets"
;
import
Assets
from
"./Editor/Assets"
;
import
ProjectDetailsDialog
from
"./Editor/dialogs/ProjectDetailsDialog"
;
import
DetailsDialog
from
"./Editor/dialogs/DetailsDialog"
;
import
DataMappingDialog
from
"./Editor/dialogs/DataMappingDialog"
;
import
{
playWaiting
}
from
"../utils"
;
import
{
playWaiting
}
from
"../utils"
;
import
i18n
from
"../i18n"
;
import
i18n
from
"../i18n"
;
export
default
{
export
default
{
name
:
'Editor'
,
name
:
'Editor'
,
components
:
{
components
:
{
DataMappingDialog
,
DetailsDialog
,
ProjectDetailsDialog
,
Assets
,
Assets
,
Playground
,
Playground
,
Views
,
Views
,
...
@@ -155,7 +152,7 @@
...
@@ -155,7 +152,7 @@
}
}
break
;
break
;
case
'details'
:
case
'details'
:
this
.
$refs
.
projectD
ialogsDialog
.
show
();
this
.
$refs
.
d
ialogsDialog
.
show
();
break
;
break
;
case
'pack'
:
case
'pack'
:
const
loading
=
this
.
$loading
({
const
loading
=
this
.
$loading
({
...
@@ -195,9 +192,6 @@
...
@@ -195,9 +192,6 @@
case
'redo'
:
case
'redo'
:
this
.
$store
.
commit
(
'undoRedo'
,
-
1
);
this
.
$store
.
commit
(
'undoRedo'
,
-
1
);
break
;
break
;
case
'data-mapping'
:
this
.
$refs
.
dataMappingDialog
.
show
();
break
;
case
'exit'
:
case
'exit'
:
const
{
projectID
}
=
this
.
$route
.
params
;
const
{
projectID
}
=
this
.
$route
.
params
;
if
(
await
this
.
localVersionExist
(
projectID
))
{
if
(
await
this
.
localVersionExist
(
projectID
))
{
...
...
src/views/Editor/dialogs/DetailsDialog.vue
0 → 100644
View file @
c81bbbaa
<
template
>
<el-dialog
:title=
"$t('Project details')"
width=
"70%"
:visible
.
sync=
"visible"
@
open=
"onOpen"
:close-on-click-modal=
"false"
:append-to-body=
"true"
:show-close=
"false"
custom-class=
"details-dialog"
>
<el-tabs
v-model=
"activeName"
>
<el-tab-pane
label=
"项目"
name=
"project"
>
<project-editor/>
</el-tab-pane>
<el-tab-pane
label=
"环境常量"
name=
"env"
>
<env-editor/>
</el-tab-pane>
<el-tab-pane
label=
"数据映射"
name=
"data-mapping"
>
<data-mapping-editor/>
</el-tab-pane>
<el-tab-pane
label=
"自定义模块"
name=
"custom"
>
<custom-editor/>
</el-tab-pane>
</el-tabs>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"onClose"
>
{{
$t
(
'Close'
)
}}
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
import
ProjectEditor
from
"./editors/ProjectEditor"
;
import
EnvEditor
from
"./editors/EnvEditor"
;
import
CustomEditor
from
"./editors/CustomEditor"
;
import
DataMappingEditor
from
"./editors/DataMappingEditor"
;
export
default
{
name
:
"DetailsDialog"
,
components
:
{
DataMappingEditor
,
CustomEditor
,
EnvEditor
,
ProjectEditor
},
data
()
{
return
{
visible
:
false
,
activeName
:
'project'
,
}
},
methods
:
{
show
()
{
this
.
visible
=
true
;
},
onClose
()
{
this
.
visible
=
false
;
},
onOpen
()
{
},
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
src/views/Editor/dialogs/editors/CustomEditor.vue
0 → 100644
View file @
c81bbbaa
<
template
>
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
view-class=
"view"
>
<el-checkbox-group
:value=
"customs"
class=
"custom-module-list"
@
input=
"onChange"
>
<el-checkbox
class=
"item"
v-for=
"customMeta in customMetas"
:key=
"customMeta.id"
:label=
"customMeta.id"
>
{{
customMeta
.
alias
||
customMeta
.
name
}}
</el-checkbox>
</el-checkbox-group>
</el-scrollbar>
</
template
>
<
script
>
import
{
mapState
,
mapMutations
}
from
'vuex'
export
default
{
name
:
"CustomEditor"
,
data
()
{
return
{
visible
:
false
,
}
},
computed
:
{
...
mapState
({
customMetas
:
state
=>
state
.
env
.
customs
,
customs
:
state
=>
state
.
project
.
data
.
customs
,
}),
},
methods
:
{
...
mapMutations
([
'modifyCustoms'
,
]),
onChange
(
v
){
this
.
modifyCustoms
(
v
);
}
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
src/views/Editor/dialogs/
DataMappingDialog
.vue
→
src/views/Editor/dialogs/
editors/DataMappingEditor
.vue
View file @
c81bbbaa
<
template
>
<
template
>
<el-dialog
:title=
"$t('Data mapping')"
width=
"70%"
:visible
.
sync=
"visible"
@
open=
"onOpen"
:append-to-body=
"true"
:close-on-click-modal=
"false"
>
<div
class=
"data-mapping-dialog"
>
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
view-class=
"view"
>
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
view-class=
"view"
>
<div
class=
"mapping-list"
>
<el-button
icon=
"el-icon-plus"
size=
"mini"
circle
@
click=
"onAdd"
/>
<div
class=
"item"
v-for=
"(link, index) in mapping"
>
<div
class=
"item"
v-for=
"(link, index) in mapping"
>
<el-input
size=
"mini"
style=
"width: 30%"
v-model=
"link.name"
@
change=
"onChange"
/>
<el-input
size=
"mini"
style=
"width: 30%"
v-model=
"link.name"
@
change=
"onChange"
/>
<el-icon
class=
"el-icon-connection"
/>
<el-icon
class=
"el-icon-connection"
/>
<el-input
size=
"mini"
v-model=
"link.path"
@
change=
"onChange"
/>
<el-input
size=
"mini"
v-model=
"link.path"
@
change=
"onChange"
/>
<el-button
icon=
"el-icon-minus"
circle
size=
"mini
"
@
click=
"toDeleteItem(link, index)"
/>
<el-button
icon=
"el-icon-minus"
circle
size=
"mini"
type=
"danger
"
@
click=
"toDeleteItem(link, index)"
/>
</div>
</div>
</el-scrollbar>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
type=
"primary"
@
click=
"onAdd"
>
{{
$t
(
'Add'
)
}}
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"onConfirm"
>
{{
$t
(
'Confirm'
)
}}
</el-button>
</div>
</div>
</el-
dialog
>
</el-
scrollbar
>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapState
,
mapMutations
}
from
'vuex'
import
{
mapState
,
mapMutations
}
from
'vuex'
export
default
{
export
default
{
name
:
"DataMapping
Dialog
"
,
name
:
"DataMapping
Editor
"
,
data
()
{
data
()
{
return
{
return
{
visible
:
false
,
visible
:
false
,
...
@@ -30,20 +24,17 @@
...
@@ -30,20 +24,17 @@
},
},
computed
:
{
computed
:
{
...
mapState
({
...
mapState
({
mapping
:
state
=>
state
.
project
.
data
.
dataMapping
,
mapping
:
state
=>
state
.
project
.
data
.
dataMapping
,
}),
}),
},
},
methods
:
{
methods
:
{
show
()
{
this
.
visible
=
true
;
},
onAdd
()
{
onAdd
()
{
this
.
addDataMapping
();
this
.
addDataMapping
();
},
},
onChange
(){
onChange
()
{
this
.
modifyDataMapping
();
this
.
modifyDataMapping
();
},
},
toDeleteItem
(
link
,
index
){
toDeleteItem
(
link
,
index
)
{
this
.
$confirm
(
this
.
$t
(
'Are you sure to delete this item'
),
this
.
$t
(
'Alert'
),
{
this
.
$confirm
(
this
.
$t
(
'Are you sure to delete this item'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Confirm'
),
confirmButtonText
:
this
.
$t
(
'Confirm'
),
cancelButtonText
:
this
.
$t
(
'Cancel'
),
cancelButtonText
:
this
.
$t
(
'Cancel'
),
...
@@ -52,12 +43,6 @@
...
@@ -52,12 +43,6 @@
this
.
deleteDataMapping
(
index
);
this
.
deleteDataMapping
(
index
);
}).
catch
((
e
)
=>
{
}).
catch
((
e
)
=>
{
});
});
},
onConfirm
()
{
this
.
visible
=
false
;
},
onOpen
()
{
},
},
...
mapMutations
([
...
mapMutations
([
'addDataMapping'
,
'addDataMapping'
,
...
...
src/views/Editor/dialogs/
EnvEditorDialog
.vue
→
src/views/Editor/dialogs/
editors/EnvEditor
.vue
View file @
c81bbbaa
<
template
>
<
template
>
<el-dialog
:title=
"$t('Env editor')"
width=
"70%"
:visible
.
sync=
"visible"
@
open=
"onOpen"
:append-to-body=
"true"
:close-on-click-modal=
"false"
>
<div
class=
"data-mapping-dialog"
>
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
view-class=
"view"
>
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
view-class=
"view"
>
<div
class=
"mapping-list"
>
<el-button
icon=
"el-icon-plus"
size=
"mini"
circle
@
click=
"onAdd"
/>
<div
class=
"item"
v-for=
"(link, index) in env"
>
<div
class=
"item"
v-for=
"(link, index) in env"
>
<el-input
size=
"mini"
style=
"width: 30%"
v-model=
"link.name"
@
change=
"onChange"
/>
<el-input
size=
"mini"
style=
"width: 30%"
v-model=
"link.name"
@
change=
"onChange"
/>
<el-icon
class=
"el-icon-connection"
/>
<el-icon
class=
"el-icon-connection"
/>
<el-input
size=
"mini"
v-model=
"link.value"
@
change=
"onChange"
/>
<el-input
size=
"mini"
v-model=
"link.value"
@
change=
"onChange"
/>
<el-button
icon=
"el-icon-minus"
circle
size=
"mini
"
@
click=
"toDeleteItem(link, index)"
/>
<el-button
icon=
"el-icon-minus"
circle
size=
"mini"
type=
"danger
"
@
click=
"toDeleteItem(link, index)"
/>
</div>
</div>
</el-scrollbar>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
type=
"primary"
@
click=
"onAdd"
>
{{
$t
(
'Add'
)
}}
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"onConfirm"
>
{{
$t
(
'Confirm'
)
}}
</el-button>
</div>
</div>
</el-
dialog
>
</el-
scrollbar
>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapState
,
mapMutations
}
from
'vuex'
import
{
mapState
,
mapMutations
}
from
'vuex'
export
default
{
export
default
{
name
:
"EnvEditor
Dialog
"
,
name
:
"EnvEditor"
,
data
()
{
data
()
{
return
{
return
{
visible
:
false
,
visible
:
false
,
...
@@ -30,20 +24,17 @@
...
@@ -30,20 +24,17 @@
},
},
computed
:
{
computed
:
{
...
mapState
({
...
mapState
({
env
:
state
=>
state
.
project
.
data
.
options
.
env
,
env
:
state
=>
state
.
project
.
data
.
options
.
env
,
}),
}),
},
},
methods
:
{
methods
:
{
show
()
{
this
.
visible
=
true
;
},
onAdd
()
{
onAdd
()
{
this
.
addEnvMapping
();
this
.
addEnvMapping
();
},
},
onChange
(){
onChange
()
{
this
.
modifyEnvMapping
();
this
.
modifyEnvMapping
();
},
},
toDeleteItem
(
link
,
index
){
toDeleteItem
(
link
,
index
)
{
this
.
$confirm
(
this
.
$t
(
'Are you sure to delete this item'
),
this
.
$t
(
'Alert'
),
{
this
.
$confirm
(
this
.
$t
(
'Are you sure to delete this item'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Confirm'
),
confirmButtonText
:
this
.
$t
(
'Confirm'
),
cancelButtonText
:
this
.
$t
(
'Cancel'
),
cancelButtonText
:
this
.
$t
(
'Cancel'
),
...
@@ -52,17 +43,8 @@
...
@@ -52,17 +43,8 @@
this
.
deleteEnvMapping
(
index
);
this
.
deleteEnvMapping
(
index
);
}).
catch
((
e
)
=>
{
}).
catch
((
e
)
=>
{
});
});
},
onConfirm
()
{
this
.
visible
=
false
;
},
onOpen
()
{
},
},
...
mapMutations
([
...
mapMutations
([
'addDataMapping'
,
'deleteDataMapping'
,
'modifyDataMapping'
,
'addEnvMapping'
,
'addEnvMapping'
,
'deleteEnvMapping'
,
'deleteEnvMapping'
,
'modifyEnvMapping'
,
'modifyEnvMapping'
,
...
...
src/views/Editor/dialogs/
ProjectDetailsDialog
.vue
→
src/views/Editor/dialogs/
editors/ProjectEditor
.vue
View file @
c81bbbaa
<
template
>
<
template
>
<el-dialog
:title=
"$t('Project details')"
width=
"70%"
:visible
.
sync=
"visible"
@
open=
"onOpen"
<div>
:close-on-click-modal=
"false"
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
view-class=
"view"
>
:append-to-body=
"true"
:show-close=
"false"
>
<div
class=
"project-details-dialog"
>
<el-form
@
submit
.
native
.
prevent
ref=
"form"
:model=
"options"
size=
"mini"
label-position=
"right"
<el-form
@
submit
.
native
.
prevent
ref=
"form"
:model=
"options"
size=
"mini"
label-position=
"right"
label-width=
"150px"
>
label-width=
"150px"
>
<el-form-item
prop=
"pageTitle"
:label=
"$t('Page title')"
>
<el-form-item
prop=
"pageTitle"
:label=
"$t('Page title')"
>
...
@@ -53,23 +49,20 @@
...
@@ -53,23 +49,20 @@
<el-input
type=
"textarea"
v-model=
"options.tpl"
:rows=
"10"
/>
<el-input
type=
"textarea"
v-model=
"options.tpl"
:rows=
"10"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</el-scrollbar>
<div
class=
"operate-bar"
>
<el-button
size=
"mini"
@
click=
"onReset"
>
{{
$t
(
'Reset'
)
}}
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"onSave"
>
{{
$t
(
'Save'
)
}}
</el-button>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"onEditEnv"
>
{{
$t
(
'Env'
)
}}
</el-button>
<el-button
size=
"mini"
@
click=
"onCancel"
>
{{
$t
(
'Cancel'
)
}}
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"onConfirm"
>
{{
$t
(
'Save'
)
}}
</el-button>
</div>
</div>
<env-editor-dialog
ref=
"envEditorDialog"
/>
</el-dialog>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapState
,
mapGetters
,
mapMutations
}
from
'vuex'
;
import
{
mapState
,
mapGetters
,
mapMutations
}
from
'vuex'
;
import
EnvEditorDialog
from
"./EnvEditorDialog"
;
export
default
{
export
default
{
name
:
"Project
DetailsDialog
"
,
name
:
"Project
Editor
"
,
components
:
{
EnvEditorDialog
},
components
:
{},
data
()
{
data
()
{
const
scaleMode
=
this
.
$t
(
'scaleMode'
);
const
scaleMode
=
this
.
$t
(
'scaleMode'
);
const
rendererType
=
this
.
$t
(
'rendererType'
);
const
rendererType
=
this
.
$t
(
'rendererType'
);
...
@@ -88,26 +81,15 @@
...
@@ -88,26 +81,15 @@
])
])
},
},
methods
:
{
methods
:
{
show
()
{
...
mapMutations
([
this
.
visible
=
true
;
'modifyProject'
,
},
]),
onEditEnv
()
{
onReset
()
{
this
.
$refs
.
envEditorDialog
.
show
();
},
onCancel
()
{
this
.
$refs
.
form
.
resetFields
();
this
.
$refs
.
form
.
resetFields
();
this
.
visible
=
false
;
},
},
onConfirm
()
{
onSave
()
{
this
.
visible
=
false
;
this
.
modifyProject
();
this
.
modifyProject
();
},
},
onOpen
()
{
},
...
mapMutations
([
'modifyProject'
,
]),
}
}
}
}
</
script
>
</
script
>
...
...
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