Browse Source

fix: dataColumns output

Ahmad Kholid 3 years ago
parent
commit
acbefe164f
2 changed files with 4 additions and 6 deletions
  1. 1 1
      src/components/newtab/workflow/edit/EditForms.vue
  2. 3 5
      src/utils/reference-data.js

+ 1 - 1
src/components/newtab/workflow/edit/EditForms.vue

@@ -7,7 +7,7 @@
     >
       {{ t('workflow.blocks.forms.getValue') }}
     </ui-checkbox>
-    <template v-if="data.getValue">
+    <template v-if="data.getValue && !hideBase">
       <ui-checkbox
         :model-value="data.saveData"
         class="mb-2 ml-2"

+ 3 - 5
src/utils/reference-data.js

@@ -17,14 +17,12 @@ export function parseKey(key) {
   if (dataKey !== 'dataColumns') return { dataKey, path: path || '' };
 
   const pathArr = path?.split('.') ?? [];
-  let dataPath = '';
+  let dataPath = path;
 
   if (pathArr.length === 1) {
     dataPath = `0.${pathArr[0]}`;
-  } else if (typeof +pathArr[0] !== 'number') {
-    const firstPath = pathArr.shift();
-
-    dataPath = `0.${firstPath}.${pathArr.join('.')}`;
+  } else if (typeof +pathArr[0] !== 'number' || Number.isNaN(+pathArr[0])) {
+    dataPath = `0.${pathArr.join('.')}`;
   }
 
   if (dataPath.endsWith('.')) dataPath = dataPath.slice(0, -1);