API รายละเอียด Tree

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-30 14:57:13 +07:00
parent 7b7d6f628c
commit 20c854ce05
2 changed files with 66 additions and 20 deletions

View file

@ -242,6 +242,8 @@ function searchAndReplace(
const dialogAgency = ref<boolean>(false);
const actionType = ref<string>("");
const dataNode = ref<any>();
const treeId = ref<string>("");
function onClickAgency(level: number, node: any) {
dialogAgency.value = !dialogAgency.value;
orgLevel.value = level;
@ -250,9 +252,10 @@ function onClickAgency(level: number, node: any) {
}
const dialogDetail = ref<boolean>(false);
function onClickDetail() {
console.log(dialogDetail.value);
function onClickDetail(id: string, level: number) {
treeId.value = id;
dialogDetail.value = !dialogDetail.value;
orgLevel.value = level;
}
async function onClickEdit(node: any) {
@ -403,7 +406,7 @@ onMounted(async () => {
: item.type === 'ADD'
? onClickAgency(prop.node.orgLevel + 1, prop.node)
: item.type === 'DETAIL'
? onClickDetail()
? onClickDetail(prop.node.orgTreeId, prop.node.orgLevel)
: item.type === 'DEL'
? onClickDel(prop.node.orgLevel, prop.node.orgTreeId)
: null
@ -478,7 +481,11 @@ onMounted(async () => {
/>
<!-- รายละเอยดโครงสราง -->
<DialogStructureDetail v-model:structure-detail="dialogDetail" />
<DialogStructureDetail
v-model:structure-detail="dialogDetail"
v-model:treeId="treeId"
v-model:orgLevel="orgLevel"
/>
</template>
<style scoped></style>