Commit 4521c621935f170dfef6a5cefc7b9d2a1e865130

Authored by ww
1 parent 23ccfde9

fix: DEFECT-1022 action type echo number

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