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
Hide 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) {
...
@@ -19,3 +19,7 @@ export async function getSkins(projectId, env) {
export
async
function
sendDingTalk
()
{
export
async
function
sendDingTalk
()
{
return
await
fetchApi
(
`/polaris/sendMessage`
,
{
method
:
'post'
})
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,8 +6,8 @@ export let API_HOST;
...
@@ -6,8 +6,8 @@ export let API_HOST;
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
//API_HOST = '//10.10.95.74:7777';
//API_HOST = '//10.10.95.74:7777';
//API_HOST = '//192.168.1.16: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 = '//192.168.0.105:7777';
//API_HOST = '//localhost:3002';
//API_HOST = '//localhost:3002';
//API_HOST = window.__data.apiHost;
//API_HOST = window.__data.apiHost;
//API_HOST = 'http://beacon.duiba.com.cn';
//API_HOST = 'http://beacon.duiba.com.cn';
...
...
src/locales/zh-CN.json
View file @
e2224b7c
...
@@ -196,6 +196,7 @@
...
@@ -196,6 +196,7 @@
"Dependencies missing"
:
"依赖缺失"
,
"Dependencies missing"
:
"依赖缺失"
,
"missingDependenciesNotice"
:
"<i class=
\"
el-icon-warning
\"
></i>依赖缺失,请到【<span style=
\"
font-weight: bold,
\"
>详情>包管理</span>】进行安装"
,
"missingDependenciesNotice"
:
"<i class=
\"
el-icon-warning
\"
></i>依赖缺失,请到【<span style=
\"
font-weight: bold,
\"
>详情>包管理</span>】进行安装"
,
"Pack manager"
:
"打包管理"
,
"Pack manager"
:
"打包管理"
,
"Select QA"
:
"选择QA人员"
,
"Publish"
:
"发布"
,
"Publish"
:
"发布"
,
"Publish config"
:
"发布配置"
,
"Publish config"
:
"发布配置"
,
"Publish to projectx"
:
"发布到星速台"
,
"Publish to projectx"
:
"发布到星速台"
,
...
@@ -340,6 +341,15 @@
...
@@ -340,6 +341,15 @@
"test"
:
"测试环境"
,
"test"
:
"测试环境"
,
"prod"
:
"线上环境"
"prod"
:
"线上环境"
},
},
"QAList"
:[
"崔立强"
,
"李培培"
,
"劳奇峰"
,
"任建锋"
,
"张婷婷"
,
"王炽"
,
"王鸿源"
],
"tplOperates"
:
[
"tplOperates"
:
[
"新增"
,
"新增"
,
"修改"
,
"修改"
,
...
...
src/views/Editor/dialogs/PublishView.vue
View file @
e2224b7c
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<span
class=
"px-project-name"
>
<span
class=
"px-project-name"
>
{{
pxProjectName
}}
{{
pxProjectName
}}
</span>
</span>
<div
class=
"operate-bar"
>
<div
class=
"operate-bar"
>
<el-select
size=
"small"
v-model=
"env"
placeholder=
"请选择环境"
@
change=
"changeEnv"
>
<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>
<el-option
v-for=
"(item, key) in pxEnvs"
:key=
"key"
:label=
"item"
:value=
"key"
></el-option>
...
@@ -36,6 +37,16 @@
...
@@ -36,6 +37,16 @@
</el-popconfirm>
</el-popconfirm>
<el-button
v-if=
"skinId && operate!==0"
size=
"small"
@
click=
"getUrl"
>
获取链接
</el-button>
<el-button
v-if=
"skinId && operate!==0"
size=
"small"
@
click=
"getUrl"
>
获取链接
</el-button>
</div>
</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>
</div>
</
template
>
</
template
>
...
@@ -45,7 +56,8 @@
...
@@ -45,7 +56,8 @@
import
{
import
{
getSkins
,
getSkins
,
saveSkin
,
saveSkin
,
sendDingTalk
sendDingTalk
,
getDevPersons
}
from
"../../../../src/api/polaris"
;
}
from
"../../../../src/api/polaris"
;
import
{
pxHostMapping
}
from
"../../../utils"
;
import
{
pxHostMapping
}
from
"../../../utils"
;
...
@@ -68,7 +80,11 @@
...
@@ -68,7 +80,11 @@
pxProjectName
:
""
,
pxProjectName
:
""
,
skins
:
[],
skins
:
[],
pxPid
:
""
,
pxPid
:
""
,
name
:
""
name
:
""
,
QAList
:[],
qa
:
null
,
pid
:
null
,
isProd
:
null
};
};
},
},
computed
:
{
computed
:
{
...
@@ -86,12 +102,26 @@
...
@@ -86,12 +102,26 @@
this
.
skinId
=
""
;
this
.
skinId
=
""
;
this
.
getSkinsList
();
this
.
getSkinsList
();
},
},
async
changeQA
(
e
)
{
console
.
log
(
e
)
this
.
pid
=
e
},
async
getSkinsList
()
{
async
getSkinsList
()
{
const
{
env
}
=
this
;
const
{
env
}
=
this
;
const
{
pxEnv
}
=
this
.
options
;
const
{
pxEnv
}
=
this
.
options
;
const
pxPid
=
this
.
pxPid
=
pxEnv
[
env
];
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
)
{
if
(
!
pxPid
)
{
this
.
$message
({
this
.
$message
({
message
:
this
.
$t
(
'Please config projectID'
,
{
env
}),
message
:
this
.
$t
(
'Please config projectID'
,
{
env
}),
...
@@ -100,38 +130,54 @@
...
@@ -100,38 +130,54 @@
return
;
return
;
}
}
try
{
try
{
const
data
=
await
getSkins
(
pxPid
,
env
);
//const data = await getSkins(pxPid, env);
if
(
data
.
success
!==
false
)
{
try
{
const
data
=
await
getSkins
(
pxPid
,
env
);
this
.
isProd
=
data
.
isProd
this
.
pxProjectName
=
data
.
name
;
this
.
pxProjectName
=
data
.
name
;
this
.
skins
=
data
.
skins
;
this
.
skins
=
data
.
skins
;
}
else
{
if
(
data
.
success
!==
false
)
{
// 如果是测试环境,ticket过期,则重新获取ticket
this
.
pxProjectName
=
data
.
name
;
if
(
env
===
"test"
&&
data
.
notLogin
)
{
this
.
skins
=
data
.
skins
;
localStorage
.
setItem
(
"ticket"
,
""
);
this
.
getSkinsList
(
this
.
pxPid
);
}
else
if
(
env
===
"prod"
&&
data
.
notLogin
)
{
localStorage
.
setItem
(
"prod_ticket"
,
""
);
this
.
$message
({
message
:
this
.
$t
(
'Online ticket is invalid'
),
type
:
"info"
});
this
.
pxProjectName
=
''
;
this
.
skins
=
[];
}
else
{
}
else
{
this
.
$message
({
// 如果是测试环境,ticket过期,则重新获取ticket
message
:
data
.
message
,
if
(
env
===
"test"
&&
data
.
notLogin
)
{
type
:
"error"
localStorage
.
setItem
(
"ticket"
,
""
);
});
this
.
getSkinsList
(
this
.
pxPid
);
this
.
pxProjectName
=
''
;
}
else
if
(
env
===
"prod"
&&
data
.
notLogin
)
{
this
.
skins
=
[];
localStorage
.
setItem
(
"prod_ticket"
,
""
);
this
.
$message
({
message
:
this
.
$t
(
'Online ticket is invalid'
),
type
:
"info"
});
this
.
pxProjectName
=
''
;
this
.
skins
=
[];
}
else
{
this
.
$message
({
message
:
data
.
message
,
type
:
"error"
});
this
.
pxProjectName
=
''
;
this
.
skins
=
[];
}
}
}
}
catch
(
e
)
{
this
.
invalidTicketNotice
();
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
pxProjectName
=
''
;
this
.
pxProjectName
=
''
;
this
.
skins
=
[];
this
.
skins
=
[];
throw
new
Error
(
e
.
message
);
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
()
{
hasIndex
()
{
return
this
.
skins
.
some
(
v
=>
v
.
type
===
"1"
);
return
this
.
skins
.
some
(
v
=>
v
.
type
===
"1"
);
},
},
...
@@ -158,16 +204,29 @@
...
@@ -158,16 +204,29 @@
return
;
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
,
projectId
:
pxPid
,
type
:
(
operate
+
1
).
toString
()
,
operate
:
operate
+
1
,
currentHtmlType
:
(
tplTyp
e
+
1
).
toString
(),
type
:(
operat
e
+
1
).
toString
(),
skinId
,
id
:
skinId
,
tpl
,
html
:
tpl
,
name
,
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
)
{
if
(
ret
.
success
!==
false
)
{
this
.
$message
({
this
.
$message
({
message
:
`操作成功`
,
message
:
`操作成功`
,
...
...
src/views/Editor/dialogs/PxSkinEditor.vue
View file @
e2224b7c
...
@@ -27,7 +27,16 @@
...
@@ -27,7 +27,16 @@
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div>
<div>
</div>
</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-button
size=
"mini"
@
click=
"clickClose"
>
{{
$t
(
"Close"
)
}}
</el-button>
<el-popconfirm
v-if=
"skin"
class=
"save-button"
@
onConfirm=
"clickSave"
placement=
"top"
<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})">
:title=
"$t('Click save will overwrite and apply immediately',
{name: this.pxProjectName, skin: skin.name})">
...
@@ -50,6 +59,8 @@
...
@@ -50,6 +59,8 @@
data
()
{
data
()
{
return
{
return
{
visible
:
false
,
visible
:
false
,
// QAList:this.$t("QAList"),
// qa:this.$t("QAList")[0],
pxProjectName
:
''
,
pxProjectName
:
''
,
skin
:
null
,
skin
:
null
,
operate
:
0
,
operate
:
0
,
...
...
src/views/Editor/dialogs/PxSkinEditorDialog.vue
View file @
e2224b7c
...
@@ -12,6 +12,12 @@
...
@@ -12,6 +12,12 @@
<el-option
v-for=
"(item, key) in pxEnvs"
:key=
"key"
:label=
"item"
:value=
"key"
></el-option>
<el-option
v-for=
"(item, key) in pxEnvs"
:key=
"key"
:label=
"item"
:value=
"key"
></el-option>
</el-select>
</el-select>
<span
class=
"px-project-name"
>
{{
pxProjectName
}}
</span>
<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>
</div>
<el-table
class=
"mock-table"
:data=
"skins"
height=
"100%"
stripe
size=
"mini"
>
<el-table
class=
"mock-table"
:data=
"skins"
height=
"100%"
stripe
size=
"mini"
>
<el-table-column
<el-table-column
...
@@ -83,7 +89,7 @@
...
@@ -83,7 +89,7 @@
import
EnabledSetter
from
"../components/EnabledSetter"
;
import
EnabledSetter
from
"../components/EnabledSetter"
;
import
MonacoEditor
from
"vue-monaco"
;
import
MonacoEditor
from
"vue-monaco"
;
import
PxConfigPopover
from
"../components/PxConfigPopover"
;
import
PxConfigPopover
from
"../components/PxConfigPopover"
;
import
{
getSkins
,
saveSkin
}
from
"../../../api/polaris"
;
import
{
getSkins
,
saveSkin
,
getDevPersons
}
from
"../../../api/polaris"
;
import
{
playWaiting
,
pxHostMapping
}
from
"../../../utils"
;
import
{
playWaiting
,
pxHostMapping
}
from
"../../../utils"
;
import
copy
from
"copy-to-clipboard"
;
import
copy
from
"copy-to-clipboard"
;
import
PxSkinEditor
from
"./PxSkinEditor"
;
import
PxSkinEditor
from
"./PxSkinEditor"
;
...
@@ -99,6 +105,9 @@
...
@@ -99,6 +105,9 @@
pxProjectName
:
''
,
pxProjectName
:
''
,
skins
:
[],
skins
:
[],
env
:
'dev'
,
env
:
'dev'
,
QAList
:[],
qa
:
null
,
isProd
:
null
}
}
},
},
computed
:
{
computed
:
{
...
@@ -136,6 +145,9 @@
...
@@ -136,6 +145,9 @@
type
:
"success"
type
:
"success"
});
});
},
},
changeQA
(
pid
){
console
.
log
(
this
.
qa
)
},
deleteItem
(
skin
)
{
deleteItem
(
skin
)
{
try
{
try
{
this
.
saveSkin
(
skin
,
2
);
this
.
saveSkin
(
skin
,
2
);
...
@@ -166,6 +178,15 @@
...
@@ -166,6 +178,15 @@
const
{
pxEnv
}
=
this
.
options
;
const
{
pxEnv
}
=
this
.
options
;
const
pxPid
=
this
.
pxPid
=
pxEnv
[
env
];
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
)
{
if
(
!
pxPid
)
{
this
.
$message
({
this
.
$message
({
message
:
this
.
$t
(
'Please config projectID'
,
{
env
}),
message
:
this
.
$t
(
'Please config projectID'
,
{
env
}),
...
@@ -175,6 +196,7 @@
...
@@ -175,6 +196,7 @@
}
}
try
{
try
{
const
data
=
await
getSkins
(
pxPid
,
env
);
const
data
=
await
getSkins
(
pxPid
,
env
);
this
.
isProd
=
data
.
isProd
this
.
pxProjectName
=
data
.
name
;
this
.
pxProjectName
=
data
.
name
;
this
.
skins
=
data
.
skins
;
this
.
skins
=
data
.
skins
;
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -203,7 +225,7 @@
...
@@ -203,7 +225,7 @@
name
,
name
,
env
,
env
,
isProd
:
true
,
isProd
:
true
,
qas
:
[
2085
],
qas
:
[
this
.
qa
],
};
};
const
{
ret
}
=
await
playWaiting
(
saveSkin
(
params
),
this
.
$t
(
'In processing'
));
const
{
ret
}
=
await
playWaiting
(
saveSkin
(
params
),
this
.
$t
(
'In processing'
));
if
(
ret
.
success
!==
false
)
{
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