fix:修复打分题失焦变NAN的问题

This commit is contained in:
du.meimei
2025-03-21 16:11:35 +08:00
parent f7474f147f
commit a253372576
29 changed files with 293 additions and 288 deletions

View File

@@ -30,13 +30,13 @@ function showModal(options) {
* @param {*} data
* @returns
*/
const canPlanetPublishPSM = function(data) {
const canPlanetPublishPSM = function (data) {
let isFb = true;
let message = '';
let title = '题目设置未完成';
const incompleteQuestionList = [];
data.questions
&& data.questions.forEach((s) => {
data.questions &&
data.questions.forEach((s) => {
if (s.question_type === 101 && s.config.price_gradient.length <= 0) {
isFb = false;
message = 'psm题目未完成设置请设置价格区间后投放';
@@ -60,15 +60,15 @@ const canPlanetPublishPSM = function(data) {
* @param {*} data
* @returns
*/
const canPlanetPublishMxdAndHotArea = function(data) {
const canPlanetPublishMxdAndHotArea = function (data) {
let isFb = true;
let message = '';
const qSteams = [];
const incompleteQuestionList = [];
let type = 0;
let title = '题目设置未完成';
data.questions
&& data.questions.forEach((s) => {
data.questions &&
data.questions.forEach((s) => {
if (s.question_type === 105 && s.config.design_version <= 0) {
isFb = false;
message = 'maxdiff题目未完成设置请生成设计后投放';
@@ -107,14 +107,14 @@ const canPlanetPublishMxdAndHotArea = function(data) {
* @param {*} data
* @returns
*/
const canPlanetPublish3D = function(data) {
const canPlanetPublish3D = function (data) {
{
let canFB = true;
let message = '';
const qSteams = [];
let title = '';
data.questions
&& data.questions.forEach((s) => {
data.questions &&
data.questions.forEach((s) => {
if (QUESTION_TYPE.contains(s.question_type)) {
try {
if (s.config.is_three_dimensions && !s.config.scene) {
@@ -144,15 +144,15 @@ const canPlanetPublish3D = function(data) {
let message = '';
const qSteams = [];
let title = '';
data.questions
&& data.questions.forEach((s) => {
data.questions &&
data.questions.forEach((s) => {
if (QUESTION_TYPE.contains(s.question_type)) {
try {
if (s.config.is_three_dimensions && s.config.is_binding_goods) {
const wares = [];
const _sceneInformation = s.config.scene_information;
const sceneInformation
= typeof _sceneInformation === 'string'
const sceneInformation =
typeof _sceneInformation === 'string'
? JSON.parse(_sceneInformation)
: _sceneInformation;
sceneInformation.shelves.forEach((shelf) => {
@@ -202,14 +202,14 @@ const canPlanetPublish3D = function(data) {
* @param {*} data
* @returns
*/
const canPlanetPublishImage = function(data) {
const canPlanetPublishImage = function (data) {
{
let canFB = true;
let message = '';
const qSteams = [];
let title = '';
data.questions
&& data.questions.forEach((s) => {
data.questions &&
data.questions.forEach((s) => {
if (s.question_type === 13) {
try {
if (s.options.length <= 0 || s.options.some((y) => y.length <= 0)) {
@@ -304,8 +304,8 @@ function canPublishRandom(data, publishType) {
if (!isValidated) {
errors.push({
message:
field.message
|| `请填写"${random.title}"中第${index + 1}组"随机题组"的"${field.name}"`
field.message ||
`请填写"${random.title}"中第${index + 1}组"随机题组"的"${field.name}"`
});
}
});
@@ -384,11 +384,11 @@ function isLoopingLogicValid(data, publishType) {
if (
(data?.cycle_pages || []).every((i) => {
return (
i.question_index
&& i.relation_type !== undefined
&& i.relation_type !== null
&& i.first_page
&& i.last_page
i.question_index &&
i.relation_type !== undefined &&
i.relation_type !== null &&
i.first_page &&
i.last_page
);
})
) {
@@ -412,7 +412,7 @@ function isLoopingLogicValid(data, publishType) {
* @param sn
* @param publishType undefined投放null投放0投放1预览2投放3测试
*/
export const canPlanetPublish = async function(sn, publishType) {
export const canPlanetPublish = async function (sn, publishType) {
const parsedPublishType = !publishType ? 2 : publishType;
const num = window.location.href.indexOf('code=');
let code;