File tree 3 files changed +14
-96
lines changed
3 files changed +14
-96
lines changed Original file line number Diff line number Diff line change @@ -75,13 +75,24 @@ def change_text(com_box, current_text):
75
75
com_box .setCurrentText ('List<%s>' % current_text )
76
76
77
77
78
+ def change_background_color (com_box , current_text ):
79
+ if current_text == '' :
80
+ com_box .setStyleSheet ("background-color:rgb(220,20,60)" )
81
+ elif current_text == 'Object' :
82
+ com_box .setStyleSheet ("background-color:rgb(255,246,143)" )
83
+ else :
84
+ com_box .setStyleSheet ("" )
85
+
86
+
78
87
# 生成字段类型下拉框
79
88
def get_type_combobox (line ):
80
89
com_box = QtWidgets .QComboBox ()
81
90
com_box .setEditable (True )
82
91
obj_type = int (line [- 1 ]) if line [- 1 ].isdigit () else 0
83
92
global last_list_com_box
84
93
94
+ com_box .currentTextChanged .connect (partial (change_background_color , com_box ))
95
+
85
96
if last_list_com_box is not None :
86
97
com_box .currentTextChanged .connect (partial (change_text , last_list_com_box ))
87
98
last_list_com_box = None
@@ -102,6 +113,8 @@ def get_type_combobox(line):
102
113
# 将该list字段的编辑框临时保存,用于与下一个字段的类型绑定
103
114
last_list_com_box = com_box
104
115
116
+ # 为text至不合法的输入框设置颜色
117
+ change_background_color (com_box , com_box .currentText ())
105
118
return com_box
106
119
107
120
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ def add_param_to_code(code, param):
120
120
tcode = check_level_type (t )
121
121
122
122
if tcode == 2 :
123
- code = code .replace (': $%s' % n , ': ${%s != null?\' \" $%s \" \' :\' null\' }' % (n , n ))
123
+ code = code .replace (': $%s' % n , ': ${%s != null?\' ${JSON.encode(%s)} \' :\' null\' }' % (n , n ))
124
124
125
125
# dict类型处理,只需要修改construction中的输出方式
126
126
elif tcode == 4 :
You can’t perform that action at this time.
0 commit comments