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

编辑器添加QA

parent 3c50201e
...@@ -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
...@@ -6,11 +6,11 @@ export let API_HOST; ...@@ -6,11 +6,11 @@ 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.93.88:7777'; 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 = ''; //API_HOST = 'http://beacon.duiba.com.cn';
} else { } else {
API_HOST = window.__data.apiHost; API_HOST = window.__data.apiHost;
} }
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
<div class="el-form-item el-form-item--mini" style="padding:10px 0 10px 0"> <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> <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;"> <div class="el-form-item__content" style="margin-left: 60px;">
<el-select size="small" v-model="qa" placeholder="请选择QA人员" @change="changeQA"> <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> </el-select>
</div> </div>
</div> </div>
...@@ -68,7 +68,6 @@ ...@@ -68,7 +68,6 @@
}, },
data() { data() {
return { return {
QAList:this.$t("QAList"),
pxEnvs: this.$t("pxEnvs"), pxEnvs: this.$t("pxEnvs"),
tplOperates: this.$t("tplOperates"), tplOperates: this.$t("tplOperates"),
tplTypes: this.$t("tplTypes"), tplTypes: this.$t("tplTypes"),
...@@ -82,7 +81,9 @@ ...@@ -82,7 +81,9 @@
skins: [], skins: [],
pxPid: "", pxPid: "",
name: "", name: "",
qa:this.$t("QAList")[0] QAList:[],
qa:null,
pid:null,
}; };
}, },
computed: { computed: {
...@@ -110,6 +111,13 @@ ...@@ -110,6 +111,13 @@
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.qa=this.QAList[0]
this.pid=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}),
...@@ -176,16 +184,29 @@ ...@@ -176,16 +184,29 @@
return; 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, projectId: pxPid,
type: (operate + 1).toString(), operate: operate + 1,
currentHtmlType: (tplType + 1).toString(), type:(operate + 1).toString(),
skinId, id:skinId,
tpl, html,
name, 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) { if (ret.success !== false) {
this.$message({ this.$message({
message: `操作成功`, message: `操作成功`,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<span v-if="env==='prod'"> <span v-if="env==='prod'">
<span style="padding-left:10px;">QA人员:</span> <span style="padding-left:10px;">QA人员:</span>
<el-select class="env-select" size="mini" v-model="qa" placeholder="请选择QA人员" @change="changeQA"> <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> </el-select>
</span> </span>
</div> </div>
...@@ -89,7 +89,7 @@ ...@@ -89,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";
...@@ -105,8 +105,9 @@ ...@@ -105,8 +105,9 @@
pxProjectName: '', pxProjectName: '',
skins: [], skins: [],
env: 'dev', env: 'dev',
QAList:this.$t("QAList"), QAList:[],
qa:this.$t("QAList")[0], qa:null,
pid:null,
} }
}, },
computed: { computed: {
...@@ -144,6 +145,10 @@ ...@@ -144,6 +145,10 @@
type: "success" type: "success"
}); });
}, },
changeQA(pid){
console.log(pid)
this.pid=pid
},
deleteItem(skin) { deleteItem(skin) {
try { try {
this.saveSkin(skin, 2); this.saveSkin(skin, 2);
...@@ -174,6 +179,15 @@ ...@@ -174,6 +179,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
})
this.qa=this.QAList[0]
this.pid=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}),
...@@ -211,7 +225,7 @@ ...@@ -211,7 +225,7 @@
name, name,
env, env,
isProd: true, isProd: true,
qas: [921], qas: [this.pid],
}; };
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) {
......
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