fix(lint): resolve shared form and utility warnings

pull/336/head
xingyu4j 2026-03-14 13:28:45 +08:00
parent fb03afb6b7
commit f32818c6aa
9 changed files with 11 additions and 11 deletions

View File

@ -194,6 +194,7 @@ export function useApiSelect(option: ApiSelectProps) {
if (props.parseFunc) {
// 解析字符串函数
// oxlint-disable-next-line typescript/no-implied-eval
// oxlint-disable-next-line no-new-func, typescript/no-implied-eval
parse = new Function(`return ${props.parseFunc}`)();
}
return parse;

View File

@ -133,7 +133,7 @@ const apiSelectRule = [
type: 'input',
field: 'labelField',
title: 'label 属性',
info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}',
info: `可以使用 el 表达式:\${},来实现复杂数据组合。如:\${nickname}-\${id}`,
props: {
placeholder: 'nickname',
},
@ -142,7 +142,7 @@ const apiSelectRule = [
type: 'input',
field: 'valueField',
title: 'value 属性',
info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}',
info: `可以使用 el 表达式:\${},来实现复杂数据组合。如:\${nickname}-\${id}`,
props: {
placeholder: 'id',
},

View File

@ -118,7 +118,7 @@ function useFormSchema(): VbenFormSchema[] {
rules: 'required',
suffix: () => {
const addr = formApi.form.values?.registerAddress;
if (addr == null) {
if (addr === null || addr === undefined) {
return '';
}
return h(

View File

@ -110,7 +110,7 @@ function validateSku() {
let validate = true;
for (const sku of formData.value!.skus!) {
for (const rule of props?.ruleConfig as RuleConfig[]) {
for (const rule of props.ruleConfig as RuleConfig[]) {
const value = getNestedValue(sku, rule.name);
if (!rule.rule(value)) {
validate = false;

View File

@ -114,9 +114,9 @@ function cropped() {
imgInfo,
});
};
fileReader.onerror = () => {
fileReader.addEventListener('error', () => {
emit('cropendError');
};
});
}, 'image/png');
}

View File

@ -194,6 +194,7 @@ export function useApiSelect(option: ApiSelectProps) {
if (props.parseFunc) {
// 解析字符串函数
// oxlint-disable-next-line typescript/no-implied-eval
// oxlint-disable-next-line no-new-func, typescript/no-implied-eval
parse = new Function(`return ${props.parseFunc}`)();
}
return parse;

View File

@ -133,7 +133,7 @@ const apiSelectRule = [
type: 'input',
field: 'labelField',
title: 'label 属性',
info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}',
info: `可以使用 el 表达式:\${},来实现复杂数据组合。如:\${nickname}-\${id}`,
props: {
placeholder: 'nickname',
},
@ -142,7 +142,7 @@ const apiSelectRule = [
type: 'input',
field: 'valueField',
title: 'value 属性',
info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}',
info: `可以使用 el 表达式:\${},来实现复杂数据组合。如:\${nickname}-\${id}`,
props: {
placeholder: 'id',
},

View File

@ -116,7 +116,7 @@ function validateSku() {
let validate = true;
for (const sku of formData.value!.skus!) {
for (const rule of props?.ruleConfig as RuleConfig[]) {
for (const rule of props.ruleConfig as RuleConfig[]) {
const value = getNestedValue(sku, rule.name);
if (!rule.rule(value)) {
validate = false;

View File

@ -139,8 +139,6 @@ function convertServerMenuToRouteRecordStringComponent(
return;
} else if (menu.children && menu.parentId === 0) {
menu.component = 'BasicLayout';
} else if (!menu.children) {
menu.component = menu.component as string;
}
if (menu.component === 'Layout') {
menu.component = 'BasicLayout';