Commit d98c4f4ba0b3f03ffa13ce7f8cd9209ba468af21

Authored by fengwotao
1 parent 7479013e

pref:优化场景联动条件筛选 里面的数字操作值不能为负数

@@ -208,6 +208,7 @@ export const trigger_condition_schema: FormSchema[] = [ @@ -208,6 +208,7 @@ export const trigger_condition_schema: FormSchema[] = [
208 ifShow: ({ values }) => isTimeDuration(values.triggered), 208 ifShow: ({ values }) => isTimeDuration(values.triggered),
209 colProps: { span: 6 }, 209 colProps: { span: 6 },
210 slot: 'time', 210 slot: 'time',
  211 + rules: numberAndNonegativeRule,
211 }, 212 },
212 { 213 {
213 field: 'timeUnit', 214 field: 'timeUnit',
1 import { formatToDateTime } from '/@/utils/dateUtil'; 1 import { formatToDateTime } from '/@/utils/dateUtil';
2 import { Number_Operation, String_Operation, Boolean_Operation } from '/@/enums/operationEnum'; 2 import { Number_Operation, String_Operation, Boolean_Operation } from '/@/enums/operationEnum';
  3 +import { numberAndNonegativeRule } from '/@/utils/rules';
  4 +
3 // 生成触发器或执行条件JSON数据 5 // 生成触发器或执行条件JSON数据
4 export const genTriggerOrConditionData = (triggerData) => { 6 export const genTriggerOrConditionData = (triggerData) => {
5 const { 7 const {
@@ -244,6 +246,10 @@ export function isType(operationType) { @@ -244,6 +246,10 @@ export function isType(operationType) {
244 label: '操作值', 246 label: '操作值',
245 required: true, 247 required: true,
246 component: 'InputNumber', 248 component: 'InputNumber',
  249 + componentProps: {
  250 + min: 0,
  251 + max: 99999999999,
  252 + },
247 colProps: { 253 colProps: {
248 span: 8, 254 span: 8,
249 }, 255 },
@@ -256,7 +262,7 @@ export function isType(operationType) { @@ -256,7 +262,7 @@ export function isType(operationType) {
256 label: '忽略大小写', 262 label: '忽略大小写',
257 component: 'Checkbox', 263 component: 'Checkbox',
258 colProps: { 264 colProps: {
259 - span: 6, 265 + span: 4,
260 }, 266 },
261 }, 267 },
262 { 268 {
@@ -264,22 +270,20 @@ export function isType(operationType) { @@ -264,22 +270,20 @@ export function isType(operationType) {
264 label: '执行操作', 270 label: '执行操作',
265 component: 'Select', 271 component: 'Select',
266 required: true, 272 required: true,
267 -  
268 componentProps: { 273 componentProps: {
269 options: operationString, 274 options: operationString,
270 }, 275 },
271 colProps: { 276 colProps: {
272 - span: 7, 277 + span: 8,
273 }, 278 },
274 }, 279 },
275 { 280 {
276 field: 'value', 281 field: 'value',
277 label: '操作值', 282 label: '操作值',
278 required: true, 283 required: true,
279 -  
280 component: 'Input', 284 component: 'Input',
281 colProps: { 285 colProps: {
282 - span: 7, 286 + span: 9,
283 }, 287 },
284 }, 288 },
285 ]; 289 ];
@@ -330,7 +334,7 @@ export function isType(operationType) { @@ -330,7 +334,7 @@ export function isType(operationType) {
330 options: operationNumber_OR_TIME, 334 options: operationNumber_OR_TIME,
331 }, 335 },
332 colProps: { 336 colProps: {
333 - span: 7, 337 + span: 8,
334 }, 338 },
335 }, 339 },
336 { 340 {