fix(lint): resolve shared form and utility warnings
parent
fb03afb6b7
commit
f32818c6aa
|
|
@ -194,6 +194,7 @@ export function useApiSelect(option: ApiSelectProps) {
|
||||||
if (props.parseFunc) {
|
if (props.parseFunc) {
|
||||||
// 解析字符串函数
|
// 解析字符串函数
|
||||||
// oxlint-disable-next-line typescript/no-implied-eval
|
// 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}`)();
|
parse = new Function(`return ${props.parseFunc}`)();
|
||||||
}
|
}
|
||||||
return parse;
|
return parse;
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ const apiSelectRule = [
|
||||||
type: 'input',
|
type: 'input',
|
||||||
field: 'labelField',
|
field: 'labelField',
|
||||||
title: 'label 属性',
|
title: 'label 属性',
|
||||||
info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}',
|
info: `可以使用 el 表达式:\${属性},来实现复杂数据组合。如:\${nickname}-\${id}`,
|
||||||
props: {
|
props: {
|
||||||
placeholder: 'nickname',
|
placeholder: 'nickname',
|
||||||
},
|
},
|
||||||
|
|
@ -142,7 +142,7 @@ const apiSelectRule = [
|
||||||
type: 'input',
|
type: 'input',
|
||||||
field: 'valueField',
|
field: 'valueField',
|
||||||
title: 'value 属性',
|
title: 'value 属性',
|
||||||
info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}',
|
info: `可以使用 el 表达式:\${属性},来实现复杂数据组合。如:\${nickname}-\${id}`,
|
||||||
props: {
|
props: {
|
||||||
placeholder: 'id',
|
placeholder: 'id',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ function useFormSchema(): VbenFormSchema[] {
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
suffix: () => {
|
suffix: () => {
|
||||||
const addr = formApi.form.values?.registerAddress;
|
const addr = formApi.form.values?.registerAddress;
|
||||||
if (addr == null) {
|
if (addr === null || addr === undefined) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
return h(
|
return h(
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ function validateSku() {
|
||||||
let validate = true;
|
let validate = true;
|
||||||
|
|
||||||
for (const sku of formData.value!.skus!) {
|
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);
|
const value = getNestedValue(sku, rule.name);
|
||||||
if (!rule.rule(value)) {
|
if (!rule.rule(value)) {
|
||||||
validate = false;
|
validate = false;
|
||||||
|
|
|
||||||
|
|
@ -114,9 +114,9 @@ function cropped() {
|
||||||
imgInfo,
|
imgInfo,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
fileReader.onerror = () => {
|
fileReader.addEventListener('error', () => {
|
||||||
emit('cropendError');
|
emit('cropendError');
|
||||||
};
|
});
|
||||||
}, 'image/png');
|
}, 'image/png');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,7 @@ export function useApiSelect(option: ApiSelectProps) {
|
||||||
if (props.parseFunc) {
|
if (props.parseFunc) {
|
||||||
// 解析字符串函数
|
// 解析字符串函数
|
||||||
// oxlint-disable-next-line typescript/no-implied-eval
|
// 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}`)();
|
parse = new Function(`return ${props.parseFunc}`)();
|
||||||
}
|
}
|
||||||
return parse;
|
return parse;
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ const apiSelectRule = [
|
||||||
type: 'input',
|
type: 'input',
|
||||||
field: 'labelField',
|
field: 'labelField',
|
||||||
title: 'label 属性',
|
title: 'label 属性',
|
||||||
info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}',
|
info: `可以使用 el 表达式:\${属性},来实现复杂数据组合。如:\${nickname}-\${id}`,
|
||||||
props: {
|
props: {
|
||||||
placeholder: 'nickname',
|
placeholder: 'nickname',
|
||||||
},
|
},
|
||||||
|
|
@ -142,7 +142,7 @@ const apiSelectRule = [
|
||||||
type: 'input',
|
type: 'input',
|
||||||
field: 'valueField',
|
field: 'valueField',
|
||||||
title: 'value 属性',
|
title: 'value 属性',
|
||||||
info: '可以使用 el 表达式:${属性},来实现复杂数据组合。如:${nickname}-${id}',
|
info: `可以使用 el 表达式:\${属性},来实现复杂数据组合。如:\${nickname}-\${id}`,
|
||||||
props: {
|
props: {
|
||||||
placeholder: 'id',
|
placeholder: 'id',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ function validateSku() {
|
||||||
let validate = true;
|
let validate = true;
|
||||||
|
|
||||||
for (const sku of formData.value!.skus!) {
|
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);
|
const value = getNestedValue(sku, rule.name);
|
||||||
if (!rule.rule(value)) {
|
if (!rule.rule(value)) {
|
||||||
validate = false;
|
validate = false;
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,6 @@ function convertServerMenuToRouteRecordStringComponent(
|
||||||
return;
|
return;
|
||||||
} else if (menu.children && menu.parentId === 0) {
|
} else if (menu.children && menu.parentId === 0) {
|
||||||
menu.component = 'BasicLayout';
|
menu.component = 'BasicLayout';
|
||||||
} else if (!menu.children) {
|
|
||||||
menu.component = menu.component as string;
|
|
||||||
}
|
}
|
||||||
if (menu.component === 'Layout') {
|
if (menu.component === 'Layout') {
|
||||||
menu.component = 'BasicLayout';
|
menu.component = 'BasicLayout';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue