parent
0c39baeb49
commit
f74290bdda
|
|
@ -201,13 +201,25 @@ export function calculateFileSize(size: number | string): string;
|
||||||
export function idCardGetDateAndGender(idCard: string): { sex: "1" | "0"; date: string };
|
export function idCardGetDateAndGender(idCard: string): { sex: "1" | "0"; date: string };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取select中指定项组成的数组
|
* 获取匹配项
|
||||||
*/
|
*/
|
||||||
export function getSelectAppointItemList<T>(options: {
|
export function getMatchedItems<T>(options: {
|
||||||
/** 获取的数组 */
|
/** 获取的数组 */
|
||||||
list: any[];
|
list: any[];
|
||||||
/** 获取的值 */
|
/** 获取的值 */
|
||||||
value: any[];
|
value: (number | string)[];
|
||||||
|
/** 获取的id字段名 */
|
||||||
|
idKey?: string;
|
||||||
|
}): T[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取未匹配项
|
||||||
|
*/
|
||||||
|
export function getUnmatchedItems<T>(options: {
|
||||||
|
/** 获取的数组 */
|
||||||
|
list: any[];
|
||||||
|
/** 获取的值 */
|
||||||
|
value: (number | string)[];
|
||||||
/** 获取的id字段名 */
|
/** 获取的id字段名 */
|
||||||
idKey?: string;
|
idKey?: string;
|
||||||
}): T[];
|
}): T[];
|
||||||
|
|
|
||||||
|
|
@ -343,13 +343,21 @@ export function idCardGetDateAndGender(idCard) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取select中指定项组成的数组
|
* 获取匹配项
|
||||||
*/
|
*/
|
||||||
export function getSelectAppointItemList(options) {
|
export function getMatchedItems(options) {
|
||||||
const { list, value, idKey = "bianma" } = options;
|
const { list, value, idKey = "bianma" } = options;
|
||||||
return list.filter(item => value.includes(item[idKey]));
|
return list.filter(item => value.includes(item[idKey]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取未匹配项
|
||||||
|
*/
|
||||||
|
export function getUnmatchedItems(options) {
|
||||||
|
const { list, value, idKey = "bianma" } = options;
|
||||||
|
return list.filter(item => !value.includes(item[idKey]));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* json转换为树形结构
|
* json转换为树形结构
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue