File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {nextTick, ref} from "vue";
33
44const props = defineProps <{
55 value: string | null | undefined ;
6- onChange ? : (value : string ) => Promise <boolean >;
6+ onChangeCallback ? : (value : string ) => Promise <boolean >;
77}>();
88const emit = defineEmits ({
99 change : (value : string ) => true ,
@@ -21,8 +21,8 @@ const doEnter = () => {
2121 });
2222};
2323const doConfirm = () => {
24- if (props .onChange ) {
25- props .onChange (valueEdit .value ).then ((ok ) => {
24+ if (props .onChangeCallback ) {
25+ props .onChangeCallback (valueEdit .value ).then ((ok ) => {
2626 if (ok ) {
2727 visible .value = false ;
2828 emit (" change" , valueEdit .value );
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ export type TaskBiz = {
6565 successFunc : ( bizId : string , bizParam : any ) => Promise < void > ;
6666 // Make sure the "failFunc" function always not throw an error
6767 failFunc : ( bizId : string , msg : string , bizParam : any ) => Promise < void > ;
68+ // request cancel callback, when user request cancel a task, will call this function
69+ requestCancelFunc ?: ( bizId : string , bizParam : any ) => Promise < void > ;
6870 // ----------------------------------------------------
6971 // the following not use in schedule, only for biz
7072 [ key : string ] : any ;
@@ -353,6 +355,11 @@ export const taskStore = defineStore("task", {
353355 expire : TimeUtil . timestampMS ( ) + 60 * 60 * 1000 ,
354356 } ;
355357 this . fireChange ( { biz, bizId} , 'requestCancel' )
358+ if ( this . bizMap [ biz ] ?. requestCancelFunc ) {
359+ this . bizMap [ biz ] ?. requestCancelFunc ?.( bizId , { } ) . catch ( e => {
360+ $mapi . log . error ( "Task.RequestCancelFunc.Error" , e . toString ( ) ) . then ( ) ;
361+ } ) ;
362+ }
356363 } ,
357364 shouldCancel ( biz : string , bizId : string ) {
358365 // expire old
You can’t perform that action at this time.
0 commit comments