Commit e37cb6f2ab477958cc55f18d77c1180c72cf797f

Authored by fengwotao
1 parent c2836752

fix:DEFECT-1177 新增点击触发器和执行动作时,如果没选择组织,提示框提示先选择组织

... ... @@ -128,6 +128,7 @@
128 128 import { findOperation } from './config/formatData';
129 129 import { formatToDateTime } from '/@/utils/dateUtil';
130 130 import ObjectModelValidateForm from '/@/components/Form/src/externalCompns/components/ObjectModelValidateForm/ObjectModelValidateForm.vue';
  131 + import { isEmpty } from '/@/utils/is';
131 132 import { add } from '/@/components/Form/src/componentMap';
132 133
133 134 add('ObjectModelValidateForm', ObjectModelValidateForm);
... ... @@ -156,7 +157,7 @@
156 157 const id = ref(undefined);
157 158 const tenantId = ref(undefined);
158 159 const isView = ref(true);
159   - const [registerForm, { resetFields, validate, setFieldsValue }] = useForm({
  160 + const [registerForm, { resetFields, validate, setFieldsValue, getFieldsValue }] = useForm({
160 161 labelWidth: 120,
161 162 schemas: formSchema,
162 163 showActionButtonGroup: false,
... ... @@ -617,12 +618,25 @@
617 618 // item.updateFieldAlarmConfig(alarmConfigList);
618 619 // });
619 620 // }
  621 +
  622 + const isEmptyThrowError = (obj) => {
  623 + if (isEmpty(obj)) {
  624 + createMessage.error('请选择组织');
  625 + throw Error('请选择组织');
  626 + }
  627 + if (!Reflect.get(obj, 'organizationId')) {
  628 + createMessage.error('请选择组织');
  629 + throw Error('请选择组织');
  630 + }
  631 + };
  632 +
620 633 // 添加触发器
621 634 const addTrigger = () => {
622 635 unref(triggerData).push(Date.now());
623 636 nextTick(() => {
624 637 setFields(skipUnwrap.triggerItemRefs);
625 638 });
  639 + isEmptyThrowError(getFieldsValue());
626 640 };
627 641 // 添加执行条件
628 642 const addCondition = () => {
... ... @@ -630,6 +644,7 @@
630 644 nextTick(() => {
631 645 setFields(skipUnwrap.conditionItemRefs);
632 646 });
  647 + isEmptyThrowError(getFieldsValue());
633 648 };
634 649 // 添加执行动作
635 650 const addAction = () => {
... ... @@ -637,6 +652,7 @@
637 652 nextTick(() => {
638 653 setFields(skipUnwrap.actionItemRefs);
639 654 });
  655 + isEmptyThrowError(getFieldsValue());
640 656 };
641 657
642 658 /**
... ...