style: lint and format code

This commit is contained in:
钱冠学
2024-10-10 11:54:27 +08:00
parent aad93f8aed
commit a28db13dac
6 changed files with 18 additions and 12 deletions

View File

@@ -21,12 +21,12 @@ module.exports = {
'no-param-reassign': 0, 'no-param-reassign': 0,
'vue/no-use-v-if-with-v-for': 0, 'vue/no-use-v-if-with-v-for': 0,
'max-len': ['error', { 'max-len': ['error', {
'code': 120, code: 120,
'tabWidth': 2, tabWidth: 2,
'ignoreStrings': true, ignoreStrings: true,
'ignoreUrls': true, ignoreUrls: true,
'ignoreRegExpLiterals': true, ignoreRegExpLiterals: true,
'ignoreTemplateLiterals': true ignoreTemplateLiterals: true
}], }],
'import/extensions': 0, 'import/extensions': 0,
eqeqeq: 0, eqeqeq: 0,

View File

@@ -1097,7 +1097,8 @@ export default {
} else if (autoLogic.value) { } else if (autoLogic.value) {
list = autoList; list = autoList;
} }
const logicQuesList = skipLogic.value || quotaLogic.value || autoLogic.value ? skipLogicQuesList : showSkipLogicQuesList; const tempList = skipLogic.value || quotaLogic.value || autoLogic.value;
const logicQuesList = tempList ? skipLogicQuesList : showSkipLogicQuesList;
const copyList = JSON.parse(JSON.stringify(list.value)); const copyList = JSON.parse(JSON.stringify(list.value));
const quesType = logicQuesList.find((x) => x.question_index === e).question_type; const quesType = logicQuesList.find((x) => x.question_index === e).question_type;
const { config, optionsList, rowOptionsList, colOptionsList, classifyOptionsList } = getOptionListAndConfig( const { config, optionsList, rowOptionsList, colOptionsList, classifyOptionsList } = getOptionListAndConfig(

View File

@@ -54,8 +54,9 @@ export const validateOptionGroupMatrix = (info, option_groups) => {
return; return;
} }
info.config[option_groups].max = info.config[option_groups].option_group.reduce((ctx, cur) => ctx + cur.max, 0) || null; const temp = info.config[option_groups].option_group;
info.config[option_groups].min = info.config[option_groups].option_group.reduce((ctx, cur) => ctx + cur.min, 0) || null; info.config[option_groups].max = temp.reduce((ctx, cur) => ctx + cur.max, 0) || null;
info.config[option_groups].min = temp.reduce((ctx, cur) => ctx + cur.min, 0) || null;
if (info.config[option_groups].option_group.some((x) => !x.max)) info.config[option_groups].max = null; if (info.config[option_groups].option_group.some((x) => !x.max)) info.config[option_groups].max = null;

View File

@@ -83,7 +83,9 @@ export default {
loading.value = true; loading.value = true;
try { try {
await updateOneQuestionPerPage(store, param.is_one_page_one_question); await updateOneQuestionPerPage(store, param.is_one_page_one_question);
survey.value.is_one_page_one_question = param?.is_one_page_one_question ?? survey.value.is_one_page_one_question; if (![undefined, null].includes(param?.is_one_page_one_question)) {
survey.value.is_one_page_one_question = param?.is_one_page_one_question
}
const { questionInfo, quesSaveParam } = JSON.parse(JSON.stringify(store.state.common)); const { questionInfo, quesSaveParam } = JSON.parse(JSON.stringify(store.state.common));
quesSaveParam.newQuestion = []; quesSaveParam.newQuestion = [];

View File

@@ -1241,7 +1241,8 @@ function interceptorsHandle(store) {
const movedList = JSON.parse(JSON.stringify(questionInfo.questions)).filter( const movedList = JSON.parse(JSON.stringify(questionInfo.questions)).filter(
(i) => !checkedList.some((j) => j.question_index === i.question_index) (i) => !checkedList.some((j) => j.question_index === i.question_index)
); // 重排序后的列表 ); // 重排序后的列表
const endIndex = movedList.findIndex((i) => i.question_index === moveQuesIndex.value) + (moveLocation.value ? 1 : 0); const tempIndex = movedList.findIndex((i) => i.question_index === moveQuesIndex.value);
const endIndex = tempIndex + (moveLocation.value ? 1 : 0);
movedList.splice(endIndex, 0, ...checkedList); movedList.splice(endIndex, 0, ...checkedList);
const loopingStatus = loopingAvailable({ const loopingStatus = loopingAvailable({
cycles: questionInfo.cycle_pages || [], cycles: questionInfo.cycle_pages || [],

View File

@@ -584,7 +584,8 @@ export default {
start: 0, start: 0,
end: deal_questions?.length ?? 0 end: deal_questions?.length ?? 0
}; };
const prev = options.value?.[index]?.list?.filter((s, idx) => idx < index2).map((s) => s.end || s.start || 0) ?? 0; const temp = options.value?.[index]?.list;
const prev = temp?.filter((s, idx) => idx < index2).map((s) => s.end || s.start || 0) ?? 0;
const next = options.value?.[index]?.list?.filter((s, idx) => idx > index2).map((s) => s.start || s.end) ?? 0; const next = options.value?.[index]?.list?.filter((s, idx) => idx > index2).map((s) => s.start || s.end) ?? 0;
result.start = Math.max( result.start = Math.max(
...prev.filter(function (s) { ...prev.filter(function (s) {