File tree Expand file tree Collapse file tree
views/projects/task/components/node/fields Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -924,7 +924,8 @@ export default {
924924 spark_submit_parameters : 'spark submit parameters' ,
925925 spark_submit_parameters_tips : 'spark submit parameters' ,
926926 is_production : 'is production' ,
927- is_production_tips : 'is production'
927+ is_production_tips : 'is production' ,
928+ json_format_tips : 'Json parameters format is abnormal'
928929 } ,
929930 menu : {
930931 fav : 'Favorites' ,
Original file line number Diff line number Diff line change @@ -894,7 +894,8 @@ export default {
894894 spark_submit_parameters : 'spark submit parameters' ,
895895 spark_submit_parameters_tips : 'spark submit parameters' ,
896896 is_production : 'is production' ,
897- is_production_tips : 'is production'
897+ is_production_tips : 'is production' ,
898+ json_format_tips : 'JSON参数格式异常'
898899 } ,
899900 menu : {
900901 fav : '收藏组件' ,
Original file line number Diff line number Diff line change 1818import type { IJsonItem } from '../types'
1919import { watch , ref } from 'vue'
2020import { useCustomParams } from '.'
21+ import utils from '@/utils'
22+ import { useI18n } from 'vue-i18n'
2123
2224export function useDatasync ( model : { [ field : string ] : any } ) : IJsonItem [ ] {
2325 const jsonSpan = ref ( 0 )
2426 const destinationLocationArnSpan = ref ( 0 )
2527 const sourceLocationArnSpan = ref ( 0 )
2628 const nameSpan = ref ( 0 )
2729 const cloudWatchLogGroupArnSpan = ref ( 0 )
30+ const { t } = useI18n ( )
2831
2932 const resetSpan = ( ) => {
3033 jsonSpan . value = model . jsonFormat ? 24 : 0
@@ -54,7 +57,15 @@ export function useDatasync(model: { [field: string]: any }): IJsonItem[] {
5457 type : 'editor' ,
5558 field : 'json' ,
5659 name : 'json' ,
57- span : jsonSpan
60+ span : jsonSpan ,
61+ validate : {
62+ trigger : [ 'input' , 'blur' ] ,
63+ validator ( ) {
64+ if ( model . json && ! utils . isJson ( model . json ) ) {
65+ return new Error ( t ( 'project.node.json_format_tips' ) )
66+ }
67+ }
68+ }
5869 } ,
5970 {
6071 type : 'input' ,
You can’t perform that action at this time.
0 commit comments