Commit e2224b7c authored by 张超's avatar 张超 🎱

merge

parents 2e42b603 f411f96c
......@@ -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
......@@ -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;
......
......@@ -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": [
"新增",
"修改",
......
......@@ -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: (tplType + 1).toString(),
skinId,
tpl,
operate: operate + 1,
type:(operate + 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: `操作成功`,
......
......@@ -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,
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment