修正ts类型
This commit is contained in:
@@ -58,22 +58,6 @@ export function convertBuildingToTree(buildings: any[]): Tree[] {
|
||||
});
|
||||
}
|
||||
|
||||
// 与业主关系
|
||||
export const ownerRelationshiplist = [
|
||||
{
|
||||
label: '业主',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '亲属',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '租户',
|
||||
value: 2
|
||||
}
|
||||
];
|
||||
|
||||
interface Tree {
|
||||
label: string;
|
||||
value: number;
|
||||
@@ -120,8 +104,6 @@ export function getHousePathById(treeData: Tree[], houseId: string | number, res
|
||||
return path;
|
||||
}
|
||||
|
||||
export const houseUselist = ['普通住宅', '商业用地', '商住两用', '其他'];
|
||||
|
||||
// 对字符串 图片地址,处理
|
||||
export function splitStringUrl(str: string, splitLabel: string = ',') {
|
||||
const list = str.split(splitLabel);
|
||||
@@ -149,25 +131,3 @@ export function hasFormData(formData: FormData): boolean {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** 方法渲燃模板数据 */
|
||||
type dataType = {
|
||||
'label': string;
|
||||
'value': string;
|
||||
'elTagType': string;
|
||||
'elTagClass': string;
|
||||
};
|
||||
/**
|
||||
* 通用:根据 value 从字典数组中获取 label
|
||||
* @param dict 字典数组
|
||||
* @param value 要匹配的值
|
||||
* @returns 匹配到的label,无则返回原value
|
||||
*/
|
||||
export function getDictLabel(dict: Ref<dataType>, value: number): string {
|
||||
// 空值直接返回
|
||||
if (value == null) return '-';
|
||||
|
||||
// 统一转字符串匹配
|
||||
const item = (dict.value || []).find((i) => String(i.value) === String(value));
|
||||
return item ? item.label : String(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user