Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions ui/src/views/function-lib/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
{{ $t('common.copy') }}
</el-dropdown-item>
<el-dropdown-item
v-if="item.init_field_list?.length > 0"
:disabled="item.permission_type === 'PUBLIC' && !canEdit(item)"
@click.stop="configInitParams(item)"
>
Expand Down Expand Up @@ -508,7 +509,10 @@ function importFunctionLib(file: any) {
})
}

function getList() {
async function getList() {
if (userOptions.value?.length === 0) {
await getUserList()
}
const params = {
...(searchValue.value && { name: searchValue.value }),
...(functionType.value && { function_type: functionType.value }),
Expand Down Expand Up @@ -544,28 +548,26 @@ function refresh(data: any) {
getList()
}

function getUserList() {
applicationApi.getUserList('FUNCTION', loading).then((res) => {
if (res.data) {
userOptions.value = res.data.map((item: any) => {
return {
label: item.username,
value: item.id
}
})
if (user.userInfo) {
const selectUserIdValue = localStorage.getItem(user.userInfo.id + 'function')
if (selectUserIdValue && userOptions.value.find((v) => v.value === selectUserIdValue)) {
selectUserId.value = selectUserIdValue
}
async function getUserList() {
const res = await applicationApi.getUserList('FUNCTION', loading)
if (res.data) {
userOptions.value = res.data.map((item: any) => {
return {
label: item.username,
value: item.id
}
})
if (user.userInfo) {
const selectUserIdValue = localStorage.getItem(user.userInfo.id + 'function')
if (selectUserIdValue && userOptions.value.find((v) => v.value === selectUserIdValue)) {
selectUserId.value = selectUserIdValue
}
// getList()
}
})
}
}

onMounted(() => {
getUserList()

})
</script>
<style lang="scss" scoped>
Expand Down