star-horse-lowcode 2.7.25 → 2.7.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +41 -10
- package/dist/index.umd.js +1 -1
- package/dist/store/DesignForm.d.ts +4 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -99541,6 +99541,7 @@ const useDesignFormStore = defineStore("designForm", () => {
|
|
|
99541
99541
|
const allFormDataList = ref([]);
|
|
99542
99542
|
const formInfo = ref({});
|
|
99543
99543
|
const compList = ref([]);
|
|
99544
|
+
const compListNoLayer = ref([]);
|
|
99544
99545
|
const formData = ref({});
|
|
99545
99546
|
const currentComp = ref();
|
|
99546
99547
|
const currentItemType = ref("");
|
|
@@ -99643,63 +99644,92 @@ const useDesignFormStore = defineStore("designForm", () => {
|
|
|
99643
99644
|
const setCompList = (comps) => {
|
|
99644
99645
|
compList.value = comps;
|
|
99645
99646
|
};
|
|
99647
|
+
const selectItemById = (itemId) => {
|
|
99648
|
+
if (compListNoLayer.value?.length == 0) {
|
|
99649
|
+
loadCompNames();
|
|
99650
|
+
}
|
|
99651
|
+
return compListNoLayer.value?.find((item) => item.id == itemId);
|
|
99652
|
+
};
|
|
99646
99653
|
const loadCompNames = () => {
|
|
99647
99654
|
const innerFunc = (datas) => {
|
|
99648
99655
|
const selectList = [];
|
|
99656
|
+
const compList2 = [];
|
|
99649
99657
|
for (const index in datas) {
|
|
99650
99658
|
const temp = datas[index];
|
|
99651
99659
|
if (temp.itemType == "box" || temp.itemType == "dytable") {
|
|
99652
99660
|
const elements = temp.preps.elements;
|
|
99661
|
+
const children = [];
|
|
99653
99662
|
for (const sindex in elements) {
|
|
99654
99663
|
const columns = elements[sindex].columns;
|
|
99655
99664
|
for (const ssindex in columns) {
|
|
99656
99665
|
const column = columns[ssindex];
|
|
99657
99666
|
if (column.items && column.items.length > 0) {
|
|
99658
|
-
|
|
99659
|
-
...column.items?.map((item) => ({ name: item.preps?.label,
|
|
99667
|
+
children.push(
|
|
99668
|
+
...column.items?.map((item) => ({ name: item.preps?.label, id: item.preps?.id, compType: "item", type: item.preps?.itemType, value: item.preps?.name })).filter((item) => item.name)
|
|
99660
99669
|
);
|
|
99670
|
+
compList2.push(...column.items);
|
|
99661
99671
|
}
|
|
99662
99672
|
}
|
|
99663
99673
|
}
|
|
99674
|
+
selectList.push({
|
|
99675
|
+
name: temp.preps?.label ?? temp.preps?.itemNameLabel,
|
|
99676
|
+
value: temp.preps?.name,
|
|
99677
|
+
id: temp.preps?.id,
|
|
99678
|
+
type: temp.itemType,
|
|
99679
|
+
compType: "container",
|
|
99680
|
+
children
|
|
99681
|
+
});
|
|
99664
99682
|
} else if (temp.itemType == "table") {
|
|
99665
99683
|
const elements = temp.preps.elements;
|
|
99666
99684
|
const children = [];
|
|
99667
99685
|
for (const index2 in elements) {
|
|
99668
99686
|
const element = elements[index2];
|
|
99669
|
-
if (element.items
|
|
99687
|
+
if (element.items?.length > 0) {
|
|
99670
99688
|
children.push(
|
|
99671
|
-
...element.items?.map((item) => ({ name: item.preps?.label, value: item.preps?.name })).filter((item) => item.name)
|
|
99689
|
+
...element.items?.map((item) => ({ name: item.preps?.label, id: item.preps?.id, compType: "item", type: item.itemType ?? item.preps?.itemType, value: item.preps?.name })).filter((item) => item.name)
|
|
99672
99690
|
);
|
|
99691
|
+
compList2.push(...element.items);
|
|
99673
99692
|
}
|
|
99674
99693
|
}
|
|
99675
99694
|
selectList.push({
|
|
99676
99695
|
name: temp.preps?.label,
|
|
99677
99696
|
value: temp.preps?.batchFieldName,
|
|
99678
|
-
|
|
99697
|
+
id: temp.id,
|
|
99698
|
+
type: temp.itemType,
|
|
99699
|
+
compType: "container",
|
|
99679
99700
|
children
|
|
99680
99701
|
});
|
|
99681
99702
|
} else if (temp.itemType == "tab" || temp.itemType == "collapse" || temp.itemType == "card") {
|
|
99682
99703
|
const elements = temp.preps?.elements;
|
|
99683
99704
|
for (const index2 in elements) {
|
|
99684
99705
|
const element = elements[index2];
|
|
99706
|
+
const subItems = innerFunc(element.items);
|
|
99685
99707
|
selectList.push({
|
|
99686
99708
|
name: element.label,
|
|
99687
99709
|
value: element.objectName,
|
|
99688
|
-
|
|
99689
|
-
|
|
99710
|
+
id: temp.id,
|
|
99711
|
+
type: temp.itemType,
|
|
99712
|
+
compType: "container",
|
|
99713
|
+
children: subItems.selectList
|
|
99690
99714
|
});
|
|
99715
|
+
compList2.push(...subItems.compList);
|
|
99691
99716
|
}
|
|
99692
99717
|
} else {
|
|
99693
99718
|
selectList.push({
|
|
99694
99719
|
name: temp.preps?.label,
|
|
99695
99720
|
value: temp.preps?.name,
|
|
99696
|
-
|
|
99721
|
+
compType: "item",
|
|
99722
|
+
id: temp.preps?.id,
|
|
99723
|
+
type: temp.itemType ?? temp.preps?.itemType
|
|
99697
99724
|
});
|
|
99698
99725
|
}
|
|
99726
|
+
compList2.push(temp);
|
|
99699
99727
|
}
|
|
99700
|
-
return selectList;
|
|
99728
|
+
return { selectList, compList: compList2 };
|
|
99701
99729
|
};
|
|
99702
|
-
|
|
99730
|
+
const resultDatas = innerFunc(compList.value);
|
|
99731
|
+
compListNoLayer.value = resultDatas.compList;
|
|
99732
|
+
return resultDatas.selectList;
|
|
99703
99733
|
};
|
|
99704
99734
|
const addComp = (comp) => {
|
|
99705
99735
|
if (Array.isArray(comp)) {
|
|
@@ -99845,6 +99875,7 @@ const useDesignFormStore = defineStore("designForm", () => {
|
|
|
99845
99875
|
batchEditFieldVisible,
|
|
99846
99876
|
previewVisible,
|
|
99847
99877
|
shortKeyDisabled,
|
|
99878
|
+
selectItemById,
|
|
99848
99879
|
setAllFormDataList,
|
|
99849
99880
|
setSelfFormDataList,
|
|
99850
99881
|
setFormDataList,
|