|
|
@ -232,7 +232,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, onMounted } from 'vue'; |
|
|
|
import { ref, onActivated } from 'vue'; |
|
|
|
import { Environment, axios, SessionManager, NotifyManager, DialogManager, Formater, Options, Tools } from 'platform-core'; |
|
|
|
import SelectRoleGrid from '../shared/SelectRoleGrid.vue'; |
|
|
|
import SelectOrgTreeGrid from '../shared/SelectOrgTreeGrid.vue'; |
|
|
@ -251,8 +251,13 @@ const currentSelectedUserId = ref(''); |
|
|
|
|
|
|
|
const refreshRelationshipComponents = (id) => { |
|
|
|
currentSelectedUserId.value = id; |
|
|
|
roleGridRef.value?.refresh(); |
|
|
|
orgTreeGridRef.value?.refresh(); |
|
|
|
if (currentSelectedUserId.value) { |
|
|
|
roleGridRef.value?.refresh(); |
|
|
|
orgTreeGridRef.value?.refresh(); |
|
|
|
} else { |
|
|
|
roleGridRef.value?.clear(); |
|
|
|
orgTreeGridRef.value?.clear(); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const selectIn = (ids: string[], gridComponent, dialogComponent) => { |
|
|
@ -311,18 +316,21 @@ const update = (ids, gridComponent) => { |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
axios.get(Environment.apiContextPath('/api/system/corporation?pageable=false')).then((response) => { |
|
|
|
const options = []; |
|
|
|
const corporationMap = {}; |
|
|
|
if (response.data?.content && response.data?.content.length > 0) { |
|
|
|
for (const item of response.data.content) { |
|
|
|
options.push({ label: item.name, value: item.code }); |
|
|
|
corporationMap[item.code] = item.name; |
|
|
|
onActivated(() => { |
|
|
|
refreshRelationshipComponents(currentSelectedUserId.value); |
|
|
|
if (SessionManager.isPrimaryCorporation()) { |
|
|
|
axios.get(Environment.apiContextPath('/api/system/corporation?pageable=false')).then((response) => { |
|
|
|
const options = []; |
|
|
|
const corporationMap = {}; |
|
|
|
if (response.data?.content && response.data?.content.length > 0) { |
|
|
|
for (const item of response.data.content) { |
|
|
|
options.push({ label: item.name, value: item.code }); |
|
|
|
corporationMap[item.code] = item.name; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
corporationOptionRef.value = options; |
|
|
|
corporationMapRef.value = corporationMap; |
|
|
|
}); |
|
|
|
corporationOptionRef.value = options; |
|
|
|
corporationMapRef.value = corporationMap; |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
</script> |
|
|
|