fix: 发布验证
This commit is contained in:
@@ -18,7 +18,7 @@ const canPlanetPublishMxdAndHotArea = function (data) {
|
|||||||
let type = 0;
|
let type = 0;
|
||||||
let title = "推荐提示";
|
let title = "推荐提示";
|
||||||
data.questions &&
|
data.questions &&
|
||||||
data.questions.forEach((s) => {
|
data.questions.forEach((s) => {
|
||||||
if (s.question_type === 105 && s.config.design_version <= 0) {
|
if (s.question_type === 105 && s.config.design_version <= 0) {
|
||||||
isFb = false;
|
isFb = false;
|
||||||
content = createVNode(<div>maxdiff未生成设计,请先进行生成设计才能进行发布</div>);
|
content = createVNode(<div>maxdiff未生成设计,请先进行生成设计才能进行发布</div>);
|
||||||
@@ -46,10 +46,10 @@ const canPlanetPublishMxdAndHotArea = function (data) {
|
|||||||
title: title,
|
title: title,
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
content: content,
|
content: content,
|
||||||
onOk () { },
|
onOk() { },
|
||||||
width: "640px",
|
width: "640px",
|
||||||
height: "364px",
|
height: "364px",
|
||||||
onCancel () { },
|
onCancel() { },
|
||||||
class: "test",
|
class: "test",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -67,19 +67,18 @@ const canPlanetPublish3D = function (data) {
|
|||||||
const qSteams = [];
|
const qSteams = [];
|
||||||
let title = "";
|
let title = "";
|
||||||
data.questions &&
|
data.questions &&
|
||||||
data.questions.forEach((s) => {
|
data.questions.forEach((s) => {
|
||||||
if (QUESTION_TYPE.contains(s.question_type)) {
|
if (QUESTION_TYPE.contains(s.question_type)) {
|
||||||
try {
|
try {
|
||||||
if(s.config.is_three_dimensions && !s.config.scene){
|
if (s.config.is_three_dimensions && !s.config.scene) {
|
||||||
qSteams.push(`(${s.title})`);
|
canFB = false;
|
||||||
|
qSteams.push(`(${s.title})`);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(error)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.warn(error)
|
|
||||||
}
|
}
|
||||||
canFB = false;
|
});
|
||||||
qSteams.push(`(${s.title})`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!canFB === true) {
|
if (!canFB === true) {
|
||||||
const titleStr = qSteams.join(",");
|
const titleStr = qSteams.join(",");
|
||||||
@@ -89,22 +88,22 @@ const canPlanetPublish3D = function (data) {
|
|||||||
title: title,
|
title: title,
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
content: content,
|
content: content,
|
||||||
onOk () { },
|
onOk() { },
|
||||||
width: "640px",
|
width: "640px",
|
||||||
height: "364px",
|
height: "364px",
|
||||||
onCancel () { },
|
onCancel() { },
|
||||||
class: "test",
|
class: "test",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 判断问卷是否可以发布(原本应该后端实现,前端实现会有并发的问题,但后端表示做不了)
|
* 判断问卷是否可以发布(原本应该后端实现,前端实现会有并发的问题,但后端表示做不了)
|
||||||
*/
|
*/
|
||||||
export const canPlanetPublish = async function(sn) {
|
export const canPlanetPublish = async function (sn) {
|
||||||
|
|
||||||
let num = window.location.href.indexOf("code=");
|
let num = window.location.href.indexOf("code=");
|
||||||
let code;
|
let code;
|
||||||
if (num > -1) {
|
if (num > -1) {
|
||||||
@@ -114,8 +113,8 @@ export const canPlanetPublish = async function(sn) {
|
|||||||
}
|
}
|
||||||
const { data } = await getQuestionList(sn, code);
|
const { data } = await getQuestionList(sn, code);
|
||||||
|
|
||||||
if(!canPlanetPublishMxdAndHotArea(data)) return false;
|
if (!canPlanetPublishMxdAndHotArea(data)) return false;
|
||||||
if(!canPlanetPublish3D(data)) return false;
|
if (!canPlanetPublish3D(data)) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user