Last active
November 16, 2022 08:41
-
-
Save jhxxs/b5b59645993c6111bbc5e7e1cdf4047b to your computer and use it in GitHub Desktop.
spanMethod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface NetConfigStep { | |
/* 配网引导内容 */ | |
content: { | |
[key: string]: string | |
} | |
/* 文件地址URL */ | |
file_url: string | |
id?: number | |
/* 配网类型,支持 BLE、AP、EZ、ZB、ZBN */ | |
paring_type: string | |
/* 展示类型:支持1.image,2.gif,3.视频 */ | |
show_type: number | |
/* 配网引导步骤 */ | |
step: number | |
isuploading?: boolean | |
} | |
export interface PNetConfigStep extends NetConfigStep { | |
/* 产品key */ | |
product_key?: string | |
// create_time?: number | |
// deleted?: number | |
// update_time?: number | |
} | |
export interface CNetConfigStep extends NetConfigStep { | |
/* 产品模版key */ | |
product_template_key?: string | |
} | |
const calculateRow = computed(() => | |
unref(data).reduce( | |
(prev, cur) => | |
Object.assign(prev, { | |
[cur.paring_type]: cur.step | |
}), | |
{} | |
) | |
) | |
function spanMethod(data: { | |
row: PNetConfigStep | CNetConfigStep | |
column: any | |
rowIndex: number | |
columnIndex: number | |
}) { | |
const maxStep = unref(calculateRow)[data.row.paring_type] | |
if (data.columnIndex == 0) { | |
if (maxStep > 1) { | |
if (data.row.step == 1) { | |
return [maxStep, 1] | |
} else { | |
return [0, 0] | |
} | |
} else { | |
return [1, 1] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment