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
e2224b7c
Commit
e2224b7c
authored
Apr 16, 2020
by
张超
🎱
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
2e42b603
f411f96c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
140 additions
and
34 deletions
+140
-34
polaris.js
src/api/polaris.js
+4
-0
config.js
src/config.js
+2
-2
zh-CN.json
src/locales/zh-CN.json
+10
-0
PublishView.vue
src/views/Editor/dialogs/PublishView.vue
+89
-30
PxSkinEditor.vue
src/views/Editor/dialogs/PxSkinEditor.vue
+11
-0
PxSkinEditorDialog.vue
src/views/Editor/dialogs/PxSkinEditorDialog.vue
+24
-2
No files found.
src/api/polaris.js
View file @
e2224b7c
...
...
@@ -19,3 +19,7 @@ export async function getSkins(projectId, env) {
export
async
function
sendDingTalk
()
{
return
await
fetchApi
(
`/polaris/sendMessage`
,
{
method
:
'post'
})
}
export
async
function
getDevPersons
(){
return
await
fetchApi
(
'/api/editor/devPersons'
,
{
method
:
'get'
});
}
\ No newline at end of file
src/config.js
View file @
e2224b7c
...
...
@@ -6,7 +6,7 @@ export let API_HOST;
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
//API_HOST = '//10.10.95.74:7777';
//API_HOST = '//192.168.1.16:7777';
API_HOST
=
'//10.10.94.107
:3000'
;
API_HOST
=
'//10.10.35.210
:3000'
;
//API_HOST = '//192.168.0.105:7777';
//API_HOST = '//localhost:3002';
//API_HOST = window.__data.apiHost;
...
...
src/locales/zh-CN.json
View file @
e2224b7c
...
...
@@ -196,6 +196,7 @@
"Dependencies missing"
:
"依赖缺失"
,
"missingDependenciesNotice"
:
"<i class=
\"
el-icon-warning
\"
></i>依赖缺失,请到【<span style=
\"
font-weight: bold,
\"
>详情>包管理</span>】进行安装"
,
"Pack manager"
:
"打包管理"
,
"Select QA"
:
"选择QA人员"
,
"Publish"
:
"发布"
,
"Publish config"
:
"发布配置"
,
"Publish to projectx"
:
"发布到星速台"
,
...
...
@@ -340,6 +341,15 @@
"test"
:
"测试环境"
,
"prod"
:
"线上环境"
},
"QAList"
:[
"崔立强"
,
"李培培"
,
"劳奇峰"
,
"任建锋"
,
"张婷婷"
,
"王炽"
,
"王鸿源"
],
"tplOperates"
:
[
"新增"
,
"修改"
,
...
...
src/views/Editor/dialogs/PublishView.vue
View file @
e2224b7c
...
...
@@ -3,6 +3,7 @@
<span
class=
"px-project-name"
>
{{
pxProjectName
}}
</span>
<div
class=
"operate-bar"
>
<el-select
size=
"small"
v-model=
"env"
placeholder=
"请选择环境"
@
change=
"changeEnv"
>
<el-option
v-for=
"(item, key) in pxEnvs"
:key=
"key"
:label=
"item"
:value=
"key"
></el-option>
...
...
@@ -36,6 +37,16 @@
</el-popconfirm>
<el-button
v-if=
"skinId && operate!==0"
size=
"small"
@
click=
"getUrl"
>
获取链接
</el-button>
</div>
<div
class=
"operate-bar"
v-if=
"env==='prod'&&isProd"
>
<div
class=
"el-form-item el-form-item--mini"
style=
"padding:10px 0 10px 0"
>
<label
class=
"el-form-item__label"
style=
"width: 60px;text-align: left;padding-right:0px"
>
QA人员:
</label>
<div
class=
"el-form-item__content"
style=
"margin-left: 60px;"
>
<el-select
class=
"env-select"
size=
"mini"
v-model=
"qa"
placeholder=
"请选择QA人员"
@
change=
"changeQA"
>
<el-option
v-for=
"item in QAList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.pid"
></el-option>
</el-select>
</div>
</div>
</div>
</div>
</
template
>
...
...
@@ -45,7 +56,8 @@
import
{
getSkins
,
saveSkin
,
sendDingTalk
sendDingTalk
,
getDevPersons
}
from
"../../../../src/api/polaris"
;
import
{
pxHostMapping
}
from
"../../../utils"
;
...
...
@@ -68,7 +80,11 @@
pxProjectName
:
""
,
skins
:
[],
pxPid
:
""
,
name
:
""
name
:
""
,
QAList
:[],
qa
:
null
,
pid
:
null
,
isProd
:
null
};
},
computed
:
{
...
...
@@ -86,12 +102,26 @@
this
.
skinId
=
""
;
this
.
getSkinsList
();
},
async
changeQA
(
e
)
{
console
.
log
(
e
)
this
.
pid
=
e
},
async
getSkinsList
()
{
const
{
env
}
=
this
;
const
{
pxEnv
}
=
this
.
options
;
const
pxPid
=
this
.
pxPid
=
pxEnv
[
env
];
console
.
log
(
"getDevPersons"
,
getDevPersons
())
this
.
QAList
=
await
getDevPersons
()
this
.
QAList
=
this
.
QAList
.
filter
((
item
)
=>
{
return
item
.
level
==
1
})
console
.
log
(
this
.
qa
)
this
.
qa
=
this
.
QAList
[
0
].
pid
if
(
!
pxPid
)
{
this
.
$message
({
message
:
this
.
$t
(
'Please config projectID'
,
{
env
}),
...
...
@@ -99,8 +129,13 @@
});
return
;
}
try
{
//const data = await getSkins(pxPid, env);
try
{
const
data
=
await
getSkins
(
pxPid
,
env
);
this
.
isProd
=
data
.
isProd
this
.
pxProjectName
=
data
.
name
;
this
.
skins
=
data
.
skins
;
if
(
data
.
success
!==
false
)
{
this
.
pxProjectName
=
data
.
name
;
this
.
skins
=
data
.
skins
;
...
...
@@ -126,12 +161,23 @@
this
.
skins
=
[];
}
}
}
catch
(
e
)
{
this
.
invalidTicketNotice
();
}
}
catch
(
e
)
{
this
.
pxProjectName
=
''
;
this
.
skins
=
[];
throw
new
Error
(
e
.
message
);
}
},
async
invalidTicketNotice
(){
const
{
env
}
=
this
;
this
.
pxProjectName
=
''
;
this
.
skins
=
[];
await
this
.
$alert
(
this
.
$t
(
'SSO is invalid'
));
window
.
open
(
'/sso/login?env='
+
env
,
'_blank'
);
},
hasIndex
()
{
return
this
.
skins
.
some
(
v
=>
v
.
type
===
"1"
);
},
...
...
@@ -158,16 +204,29 @@
return
;
}
}
const
data
=
{
// const data = {
// projectId: pxPid,
// type: (operate + 1).toString(),
// currentHtmlType: (tplType + 1).toString(),
// skinId,
// tpl,
// name,
// env: env
// };
//const {html} = this.skin;
const
params
=
{
projectId
:
pxPid
,
type
:
(
operate
+
1
).
toString
()
,
currentHtmlType
:
(
tplTyp
e
+
1
).
toString
(),
skinId
,
tpl
,
operate
:
operate
+
1
,
type
:(
operat
e
+
1
).
toString
(),
id
:
skinId
,
html
:
tpl
,
name
,
env
:
env
env
,
isProd
:
true
,
qas
:
[
this
.
qa
],
};
const
{
ret
}
=
await
saveSkin
(
data
);
//const {ret} = await saveSkin(data);
const
{
ret
}
=
await
saveSkin
(
params
);
if
(
ret
.
success
!==
false
)
{
this
.
$message
({
message
:
`操作成功`
,
...
...
src/views/Editor/dialogs/PxSkinEditor.vue
View file @
e2224b7c
...
...
@@ -27,7 +27,16 @@
<div
slot=
"footer"
class=
"dialog-footer"
>
<div>
</div>
<div>
<!--
<div
class=
"el-form-item el-form-item--mini"
style=
"padding:10px 0 10px 0"
>
<label
class=
"el-form-item__label"
style=
"width: 60px;text-align: left;padding-right:0px"
>
QA人员:
</label>
<div
class=
"el-form-item__content"
style=
"margin-left: 60px;"
>
<el-select
size=
"small"
v-model=
"qa"
placeholder=
"请选择QA人员"
@
change=
"changeQA"
>
<el-option
v-for=
"item in QAList"
:key=
"item"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
</div>
</div>
-->
<el-button
size=
"mini"
@
click=
"clickClose"
>
{{
$t
(
"Close"
)
}}
</el-button>
<el-popconfirm
v-if=
"skin"
class=
"save-button"
@
onConfirm=
"clickSave"
placement=
"top"
:title=
"$t('Click save will overwrite and apply immediately',
{name: this.pxProjectName, skin: skin.name})">
...
...
@@ -50,6 +59,8 @@
data
()
{
return
{
visible
:
false
,
// QAList:this.$t("QAList"),
// qa:this.$t("QAList")[0],
pxProjectName
:
''
,
skin
:
null
,
operate
:
0
,
...
...
src/views/Editor/dialogs/PxSkinEditorDialog.vue
View file @
e2224b7c
...
...
@@ -12,6 +12,12 @@
<el-option
v-for=
"(item, key) in pxEnvs"
:key=
"key"
:label=
"item"
:value=
"key"
></el-option>
</el-select>
<span
class=
"px-project-name"
>
{{
pxProjectName
}}
</span>
<span
v-if=
"env==='prod'&&isProd"
>
<span
style=
"padding-left:10px;"
>
QA人员:
</span>
<el-select
class=
"env-select"
size=
"mini"
v-model=
"qa"
placeholder=
"请选择QA人员"
@
change=
"changeQA"
>
<el-option
v-for=
"item in QAList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.pid"
></el-option>
</el-select>
</span>
</div>
<el-table
class=
"mock-table"
:data=
"skins"
height=
"100%"
stripe
size=
"mini"
>
<el-table-column
...
...
@@ -83,7 +89,7 @@
import
EnabledSetter
from
"../components/EnabledSetter"
;
import
MonacoEditor
from
"vue-monaco"
;
import
PxConfigPopover
from
"../components/PxConfigPopover"
;
import
{
getSkins
,
saveSkin
}
from
"../../../api/polaris"
;
import
{
getSkins
,
saveSkin
,
getDevPersons
}
from
"../../../api/polaris"
;
import
{
playWaiting
,
pxHostMapping
}
from
"../../../utils"
;
import
copy
from
"copy-to-clipboard"
;
import
PxSkinEditor
from
"./PxSkinEditor"
;
...
...
@@ -99,6 +105,9 @@
pxProjectName
:
''
,
skins
:
[],
env
:
'dev'
,
QAList
:[],
qa
:
null
,
isProd
:
null
}
},
computed
:
{
...
...
@@ -136,6 +145,9 @@
type
:
"success"
});
},
changeQA
(
pid
){
console
.
log
(
this
.
qa
)
},
deleteItem
(
skin
)
{
try
{
this
.
saveSkin
(
skin
,
2
);
...
...
@@ -166,6 +178,15 @@
const
{
pxEnv
}
=
this
.
options
;
const
pxPid
=
this
.
pxPid
=
pxEnv
[
env
];
console
.
log
(
"getDevPersons"
,
getDevPersons
())
this
.
QAList
=
await
getDevPersons
()
this
.
QAList
=
this
.
QAList
.
filter
((
item
)
=>
{
return
item
.
level
==
1
})
console
.
log
(
this
.
qa
)
this
.
qa
=
this
.
QAList
[
0
].
pid
if
(
!
pxPid
)
{
this
.
$message
({
message
:
this
.
$t
(
'Please config projectID'
,
{
env
}),
...
...
@@ -175,6 +196,7 @@
}
try
{
const
data
=
await
getSkins
(
pxPid
,
env
);
this
.
isProd
=
data
.
isProd
this
.
pxProjectName
=
data
.
name
;
this
.
skins
=
data
.
skins
;
}
catch
(
e
)
{
...
...
@@ -203,7 +225,7 @@
name
,
env
,
isProd
:
true
,
qas
:
[
2085
],
qas
:
[
this
.
qa
],
};
const
{
ret
}
=
await
playWaiting
(
saveSkin
(
params
),
this
.
$t
(
'In processing'
));
if
(
ret
.
success
!==
false
)
{
...
...
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