File tree Expand file tree Collapse file tree
dolphinscheduler-ui/src/views
projects/components/dependencies
security/worker-group-manage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export default defineComponent({
5959 }
6060
6161 const cancelToHandle = ( ) => {
62- ctx . emit ( 'update:show' , showRef )
62+ ctx . emit ( 'update:show' , showRef . value )
6363 }
6464
6565 const renderDownstreamDependencies = ( ) => {
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ export function useModal(
3232 const variables = reactive ( {
3333 workerGroupFormRef : ref ( ) ,
3434 model : {
35- id : ref < number > ( - 1 ) ,
35+ id : - 1 ,
3636 name : ref ( '' ) ,
37- addrList : ref < Array < number > > ( [ ] ) ,
37+ addrList : [ ] as string [ ] ,
3838 generalOptions : [ ]
3939 } ,
4040 saving : false ,
@@ -43,19 +43,10 @@ export function useModal(
4343 required : true ,
4444 trigger : [ 'input' , 'blur' ] ,
4545 validator ( ) {
46- if ( variables . model . name === '' ) {
46+ if ( ! variables . model . name || ! variables . model . name . trim ( ) ) {
4747 return new Error ( t ( 'security.worker_group.group_name_tips' ) )
4848 }
4949 }
50- } ,
51- addrList : {
52- required : true ,
53- trigger : [ 'input' , 'blur' ] ,
54- validator ( ) {
55- if ( variables . model . addrList . length < 1 ) {
56- return new Error ( t ( 'security.worker_group.worker_addresses_tips' ) )
57- }
58- }
5950 }
6051 }
6152 } )
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ const WorkerGroupModal = defineComponent({
107107 show = { this . showModalRef }
108108 onCancel = { this . cancelModal }
109109 onConfirm = { this . confirmModal }
110- confirmDisabled = { ! this . model . name || this . model . addrList . length < 1 }
110+ confirmDisabled = { ! this . model . name ?. trim ( ) }
111111 confirmClassName = 'btn-submit'
112112 cancelClassName = 'btn-cancel'
113113 confirmLoading = { this . saving }
Original file line number Diff line number Diff line change @@ -55,16 +55,18 @@ export function useTable() {
5555 key : 'addrList' ,
5656 render : ( row : WorkerGroupItem ) =>
5757 h ( NSpace , null , {
58- default : ( ) =>
59- row . addrList
60- . split ( ',' )
61- . map ( ( item : string ) =>
62- h (
63- NTag ,
64- { type : 'success' , size : 'small' } ,
65- { default : ( ) => item }
58+ default : ( ) => {
59+ const addrList = row . addrList ? row . addrList . split ( ',' ) : [ ]
60+ return addrList . length
61+ ? addrList . map ( ( item : string ) =>
62+ h (
63+ NTag ,
64+ { type : 'success' , size : 'small' } ,
65+ { default : ( ) => item }
66+ )
6667 )
67- )
68+ : h ( 'span' , { style : { color : '#999' } } , null )
69+ }
6870 } )
6971 } ,
7072 {
You can’t perform that action at this time.
0 commit comments