@@ -144,6 +144,8 @@ import { createSkillsMethods } from './modules/skills.methods.mjs';
144144 confirmDialogConfirmText : '确认' ,
145145 confirmDialogCancelText : '取消' ,
146146 confirmDialogDanger : false ,
147+ confirmDialogConfirmDisabled : false ,
148+ confirmDialogDisableWhen : null ,
147149 confirmDialogResolver : null ,
148150 configTemplateContent : '' ,
149151 configTemplateApplying : false ,
@@ -3554,6 +3556,7 @@ import { createSkillsMethods } from './modules/skills.methods.mjs';
35543556 if ( typeof this . confirmDialogResolver === 'function' ) {
35553557 this . confirmDialogResolver ( false ) ;
35563558 }
3559+ const confirmDisabled = options . confirmDisabled ;
35573560 this . confirmDialogTitle = typeof options . title === 'string' && options . title . trim ( )
35583561 ? options . title . trim ( )
35593562 : '请确认操作' ;
@@ -3565,11 +3568,23 @@ import { createSkillsMethods } from './modules/skills.methods.mjs';
35653568 ? options . cancelText . trim ( )
35663569 : '取消' ;
35673570 this . confirmDialogDanger = ! ! options . danger ;
3571+ this . confirmDialogConfirmDisabled = typeof confirmDisabled === 'function' ? false : ! ! confirmDisabled ;
3572+ this . confirmDialogDisableWhen = typeof confirmDisabled === 'function' ? confirmDisabled : null ;
35683573 this . showConfirmDialog = true ;
35693574 return new Promise ( ( resolve ) => {
35703575 this . confirmDialogResolver = resolve ;
35713576 } ) ;
35723577 } ,
3578+ isConfirmDialogDisabled ( ) {
3579+ if ( typeof this . confirmDialogDisableWhen === 'function' ) {
3580+ try {
3581+ return ! ! this . confirmDialogDisableWhen . call ( this ) ;
3582+ } catch ( _ ) {
3583+ return false ;
3584+ }
3585+ }
3586+ return ! ! this . confirmDialogConfirmDisabled ;
3587+ } ,
35733588 resolveConfirmDialog ( confirmed ) {
35743589 const resolver = typeof this . confirmDialogResolver === 'function'
35753590 ? this . confirmDialogResolver
@@ -3580,6 +3595,8 @@ import { createSkillsMethods } from './modules/skills.methods.mjs';
35803595 this . confirmDialogConfirmText = '确认' ;
35813596 this . confirmDialogCancelText = '取消' ;
35823597 this . confirmDialogDanger = false ;
3598+ this . confirmDialogConfirmDisabled = false ;
3599+ this . confirmDialogDisableWhen = null ;
35833600 this . confirmDialogResolver = null ;
35843601 if ( resolver ) {
35853602 resolver ( ! ! confirmed ) ;
0 commit comments