Commit 5337c8a5 authored by 任建锋's avatar 任建锋

编辑器添加QA

parent 3c50201e
......@@ -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,11 +6,11 @@ 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.93.88:7777';
API_HOST = '//10.10.35.210:3000';
//API_HOST = '//192.168.0.105:7777';
//API_HOST = '//localhost:3002';
API_HOST = window.__data.apiHost;
//API_HOST = '';
//API_HOST = window.__data.apiHost;
//API_HOST = 'http://beacon.duiba.com.cn';
} else {
API_HOST = window.__data.apiHost;
}
......
......@@ -42,8 +42,8 @@
<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 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>
......@@ -68,7 +68,6 @@
},
data() {
return {
QAList:this.$t("QAList"),
pxEnvs: this.$t("pxEnvs"),
tplOperates: this.$t("tplOperates"),
tplTypes: this.$t("tplTypes"),
......@@ -82,7 +81,9 @@
skins: [],
pxPid: "",
name: "",
qa:this.$t("QAList")[0]
QAList:[],
qa:null,
pid:null,
};
},
computed: {
......@@ -110,6 +111,13 @@
const {pxEnv} = this.options;
const pxPid = this.pxPid = pxEnv[env];
console.log("getDevPersons",getDevPersons())
this.QAList=await getDevPersons()
this.qa=this.QAList[0]
this.pid=this.QAList[0].pid;
if (!pxPid) {
this.$message({
message: this.$t('Please config projectID', {env}),
......@@ -176,16 +184,29 @@
return;
}
}
const data = {
// const data = {
// projectId: pxPid,
// type: (operate + 1).toString(),
// currentHtmlType: (tplType + 1).toString(),
// skinId,
// tpl,
// name,
// env: env
// };
const {html} = 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,
name,
env: env
env,
isProd: true,
qas: [this.pid],
};
const {ret} = await saveSkin(data);
//const {ret} = await saveSkin(data);
const {ret} = await saveSkin(params);
if (ret.success !== false) {
this.$message({
message: `操作成功`,
......
......@@ -15,7 +15,7 @@
<span v-if="env==='prod'">
<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" :label="item" :value="item"></el-option>
<el-option v-for="item in QAList" :key="item.id" :label="item.name" :value="item.pid"></el-option>
</el-select>
</span>
</div>
......@@ -89,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";
......@@ -105,8 +105,9 @@
pxProjectName: '',
skins: [],
env: 'dev',
QAList:this.$t("QAList"),
qa:this.$t("QAList")[0],
QAList:[],
qa:null,
pid:null,
}
},
computed: {
......@@ -144,6 +145,10 @@
type: "success"
});
},
changeQA(pid){
console.log(pid)
this.pid=pid
},
deleteItem(skin) {
try {
this.saveSkin(skin, 2);
......@@ -174,6 +179,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
})
this.qa=this.QAList[0]
this.pid=this.QAList[0].pid;
if (!pxPid) {
this.$message({
message: this.$t('Please config projectID', {env}),
......@@ -211,7 +225,7 @@
name,
env,
isProd: true,
qas: [921],
qas: [this.pid],
};
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