refactor: color, data structure
This commit is contained in:
parent
4ef5499242
commit
2fb2c3bc3d
4 changed files with 15 additions and 23 deletions
|
|
@ -116,6 +116,7 @@ const treeData = ref<BranchWithChildren[]>([]);
|
|||
const subBranch = ref<boolean>(false);
|
||||
const rowsBranch = ref<
|
||||
{
|
||||
id: string;
|
||||
name: string;
|
||||
branchName: string;
|
||||
address: string;
|
||||
|
|
@ -164,7 +165,8 @@ async function getTree() {
|
|||
rowsBranch.value = treeData.value
|
||||
.filter((v) => v.isHeadOffice)
|
||||
.map((v) => ({
|
||||
name: v.id,
|
||||
id: v.id,
|
||||
name: v.code,
|
||||
branchName: v.name,
|
||||
address: v.address,
|
||||
telephoneNo: v.telephoneNo,
|
||||
|
|
@ -362,7 +364,8 @@ async function fetchSubBranch(id: string) {
|
|||
|
||||
if (result) {
|
||||
rowsBranch.value = result.branch.map((v) => ({
|
||||
name: v.id,
|
||||
id: v.id,
|
||||
name: v.code,
|
||||
branchName: v.name,
|
||||
address: v.address,
|
||||
telephoneNo: v.telephoneNo,
|
||||
|
|
@ -666,7 +669,7 @@ onMounted(async () => {
|
|||
|
||||
<AppBox>
|
||||
<TableCardComponent
|
||||
@navigate="(v) => fetchSubBranch(v.name)"
|
||||
@navigate="(v) => fetchSubBranch(v.id)"
|
||||
@showCard="(v) => fetchCard(v.name)"
|
||||
:sub-branch="subBranch"
|
||||
:rows="rowsBranch"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue