fix(lint): resolve shared form and utility warnings
parent
fb03afb6b7
commit
f32818c6aa
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -114,9 +114,9 @@ function cropped() {
|
|||
imgInfo,
|
||||
});
|
||||
};
|
||||
fileReader.onerror = () => {
|
||||
fileReader.addEventListener('error', () => {
|
||||
emit('cropendError');
|
||||
};
|
||||
});
|
||||
}, 'image/png');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in New Issue