Commit 4521c621935f170dfef6a5cefc7b9d2a1e865130

Authored by ww
1 parent 23ccfde9

fix: DEFECT-1022 action type echo number

... ... @@ -132,13 +132,13 @@
132 132 const provideOrgid = ref('');
133 133
134 134 const { createMessage } = useMessage();
135   - const triggerData = ref([]);
136   - const conditionData = ref([]);
137   - const actionData = ref([]);
  135 + const triggerData = ref<number[]>([]);
  136 + const conditionData = ref<number[]>([]);
  137 + const actionData = ref<number[]>([]);
138 138 const skipUnwrap = {
139   - triggerItemRefs: ref([]),
140   - conditionItemRefs: ref([]),
141   - actionItemRefs: ref([]),
  139 + triggerItemRefs: ref<InstanceType<typeof TriggerOrCondition>[]>([]),
  140 + conditionItemRefs: ref<InstanceType<typeof TriggerOrCondition>[]>([]),
  141 + actionItemRefs: ref<InstanceType<typeof Action>[]>([]),
142 142 };
143 143 const title = computed(
144 144 () => `${isUpdate.value === 3 ? '查看' : isUpdate.value ? '编辑' : '新增'}场景联动`
... ... @@ -387,6 +387,7 @@
387 387 doActions.forEach((action, index) => {
388 388 nextTick(() => {
389 389 const selectProductId = ref('');
  390 + console.log('doActions', unref(skipUnwrap.actionItemRefs));
390 391 // 设置执行动作外层值
391 392 unref(skipUnwrap.actionItemRefs)[index].setFieldsFormValueFun({
392 393 ...action,
... ...
... ... @@ -81,6 +81,7 @@
81 81
82 82 <script lang="ts">
83 83 import { defineComponent } from 'vue';
  84 + import { isNumber } from '/@/utils/is';
84 85 export default defineComponent({
85 86 components: {
86 87 VNodes: (_, { attrs }) => {
... ... @@ -261,9 +262,13 @@
261 262 };
262 263
263 264 const setFieldsFormValueFun = (fieldsValue) => {
  265 + console.log(getFieldsValue());
  266 +
264 267 setFieldsValue({
265 268 ...fieldsValue,
266   - ...(fieldsValue.commandType ? { commandType: String(fieldsValue.commandType) } : {}),
  269 + ...(isNumber(fieldsValue.commandType)
  270 + ? { commandType: String(fieldsValue.commandType) }
  271 + : {}),
267 272 });
268 273 };
269 274 //ft-add
... ...