feat: 明细表中的选人组件可以将文字部分保存到独立字段,以加快渲染速度

This commit is contained in:
gaoyunqi
2024-05-16 17:13:32 +08:00
parent 92fd90f35d
commit 21eb71d35d
4 changed files with 479 additions and 427 deletions

View File

@ -27,25 +27,22 @@ export function changeToPinyin(label: string, isUpper?: boolean) {
/* 如果没有下划线,不需要处理
如果有下划线,用下划线切割,第一个下划线左边的全部小写,后面的首字母大写,首字母后面的全部小写 */
export function camelCaseString(string: string, skipNoUnderline = false) {
if (!string) return;
if (skipNoUnderline && string.indexOf('_') < 0) {
return string;
}
const stringLower = string.toLowerCase();
const len = stringLower.length;
let str = '';
for (let i = 0; i < len; i++) {
const c = stringLower.charAt(i);
if (c === '_') {
if (++i < len) {
str = str.concat(stringLower.charAt(i).toUpperCase());
}
} else {
str = str.concat(c);
export function camelCaseString(string: string) {
if (!string) return;
const stringLower = string.toLowerCase();
const len = stringLower.length;
let str = '';
for (let i = 0; i < len; i++) {
const c = stringLower.charAt(i);
if (c === '_') {
if (++i < len) {
str = str.concat(stringLower.charAt(i).toUpperCase());
}
} else {
str = str.concat(c);
}
}
}
return str;
return str;
}
export async function apiConfigFunc(apiConfig, isCustomForm = false, formModel?, index?) {

20
src/utils/stringUtil.js Normal file
View File

@ -0,0 +1,20 @@
export function camelCaseString(string) {
if (!string) return;
if (string.indexOf('_') < 0) {
return string;
}
const stringLower = string.toLowerCase();
const len = stringLower.length;
let str = '';
for (let i = 0; i < len; i++) {
const c = stringLower.charAt(i);
if (c === '_') {
if (++i < len) {
str = str.concat(stringLower.charAt(i).toUpperCase());
}
} else {
str = str.concat(c);
}
}
return str;
}