Skip to content

Commit

Permalink
fix: bug #10
Browse files Browse the repository at this point in the history
  • Loading branch information
haixin-fang committed Apr 13, 2024
1 parent f5bb38a commit 812a32a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starfish-editor",
"version": "1.1.20",
"version": "1.1.21",
"main": "dist/starfish-editor.umd.js",
"style": "dist/style.css",
"module": "dist/starfish-editor.es.js",
Expand Down
14 changes: 5 additions & 9 deletions packages/editor/src/utils/_.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { ElNotification } from "element-plus";
import { nanoid } from "nanoid";
import { AllFormItem, BaseComponentItem, PartialKey } from "@/type";
import formStore from "@/controller/form";
const fieldlist: string[] = [];
class Flex {
lastClickTime: number;
openTanc: boolean;

constructor() {
this.lastClickTime = 0;
this.openTanc = false; // 是否有弹窗
Expand Down Expand Up @@ -58,7 +58,7 @@ class Flex {
}
public deepClone(target: any): any {
// 定义一个变量
let result;
let result: any;
// 如果当前需要深拷贝的是一个对象的话
if (typeof target === "object") {
// 如果是一个数组的话
Expand Down Expand Up @@ -143,14 +143,10 @@ class Flex {
if (!item.data) {
item.data = item.formConfig.data();
}

if (!item.data.fieldName) {
item.data.fieldName = item.ControlType + "_" + this.generateMixed();
}
if (fieldlist.includes(item.data.fieldName)) {
item.data.fieldName = item.ControlType + "_" + this.generateMixed();
} else {
fieldlist.push(item.data.fieldName);
}
if (item.layout) {
if (item.ControlType == "Grid" && item.data.columns && item.data.columns.length > 0) {
item.data.columns = item.data.columns.map((colItem: any) => {
Expand Down Expand Up @@ -196,7 +192,7 @@ class Flex {
*/
if (currentComponent.actionType && currentComponent.actionType.length > 0) {
console.log(controlItems);
controlItems.find((item) => {
controlItems.find((item: any) => {
if (item.ControlType == "Action") {
item.data.formConfig = {
value: {},
Expand All @@ -212,7 +208,7 @@ class Flex {
}
});
} else {
controlItems = controlItems.filter((item) => {
controlItems = controlItems.filter((item: any) => {
if (item.ControlType !== "Action") {
return item;
}
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@element-plus/icons-vue": "^2.0.8",
"element-plus": "^2.2.12",
"starfish-editor": "^1.1.19",
"starfish-editor": "^1.1.21",
"starfish-form": "^1.2.9",
"vite": "^4.5.2",
"vue": "^3.2.37",
Expand Down

0 comments on commit 812a32a

Please sign in to comment.