File tree Expand file tree Collapse file tree 1 file changed +19
-18
lines changed
ui/src/views/function-lib Expand file tree Collapse file tree 1 file changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,10 @@ function importFunctionLib(file: any) {
509509 })
510510}
511511
512- function getList() {
512+ async function getList() {
513+ if (userOptions .value ?.length === 0 ) {
514+ await getUserList ()
515+ }
513516 const params = {
514517 ... (searchValue .value && { name: searchValue .value }),
515518 ... (functionType .value && { function_type: functionType .value }),
@@ -545,28 +548,26 @@ function refresh(data: any) {
545548 getList ()
546549}
547550
548- function getUserList() {
549- applicationApi .getUserList (' FUNCTION' , loading ).then ((res ) => {
550- if (res .data ) {
551- userOptions .value = res .data .map ((item : any ) => {
552- return {
553- label: item .username ,
554- value: item .id
555- }
556- })
557- if (user .userInfo ) {
558- const selectUserIdValue = localStorage .getItem (user .userInfo .id + ' function' )
559- if (selectUserIdValue && userOptions .value .find ((v ) => v .value === selectUserIdValue )) {
560- selectUserId .value = selectUserIdValue
561- }
551+ async function getUserList() {
552+ const res = await applicationApi .getUserList (' FUNCTION' , loading )
553+ if (res .data ) {
554+ userOptions .value = res .data .map ((item : any ) => {
555+ return {
556+ label: item .username ,
557+ value: item .id
558+ }
559+ })
560+ if (user .userInfo ) {
561+ const selectUserIdValue = localStorage .getItem (user .userInfo .id + ' function' )
562+ if (selectUserIdValue && userOptions .value .find ((v ) => v .value === selectUserIdValue )) {
563+ selectUserId .value = selectUserIdValue
562564 }
563- // getList()
564565 }
565- })
566+ }
566567}
567568
568569onMounted (() => {
569- getUserList ()
570+
570571})
571572 </script >
572573<style lang="scss" scoped>
You can’t perform that action at this time.
0 commit comments