From 207dee8de25711b61cd33f5ff6225e80e4d1eaf3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E7=91=9E=E8=88=AA?=
<15552473+cutecatQwQ@user.noreply.gitee.com>
Date: Tue, 1 Jul 2025 11:58:24 +0800
Subject: [PATCH 1/4] =?UTF-8?q?feature:=20=E9=85=8D=E7=BD=AE=E7=A7=BB?=
=?UTF-8?q?=E5=8A=A8=E7=AB=AF=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=94=BB=E5=B8=83?=
=?UTF-8?q?=E4=BD=BF=E7=94=A8=EF=BC=8C=E5=B7=A6=E5=8F=B3=E7=95=99=E7=99=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../public/designer-canvas/empty1.json | 1740 ++++++++++++-----
packages/designer/src/app-providers.ts | 3 +
.../form-designer/form-designer.component.tsx | 5 +
.../designer-context/use-designer-context.ts | 2 +-
4 files changed, 1234 insertions(+), 516 deletions(-)
diff --git a/packages/designer/public/designer-canvas/empty1.json b/packages/designer/public/designer-canvas/empty1.json
index c257280239..b740c59a3b 100644
--- a/packages/designer/public/designer-canvas/empty1.json
+++ b/packages/designer/public/designer-canvas/empty1.json
@@ -1,59 +1,65 @@
{
- "header" : {
- "Code" : "CommonDictionary",
- "Type" : "Form",
- "NameSpace" : "Inspur.GS.SagiDemo.SagiDemeModule.CommonDictionaries.CommonDictionaries.Front",
+ "Header" : {
+ "Code" : "MobileVueTest",
+ "Type" : "MobileForm",
+ "NameSpace" : "Inspur.GS.MyDev.FarrisVueTest.VueFormTest.VueFormTest.Front",
"CertId" : null,
- "Name" : "通用字典",
- "FileName" : "CommonDictionary.frm",
- "BizobjectID" : "d8b09de6-5e7c-bfdf-d308-468827ba0d6b",
+ "Name" : "移动Vue测试",
+ "FileName" : "MobileVueTest.mfrm",
+ "BizobjectID" : "e34f063d-9c31-1e20-4ad7-c6b4f57ddfc9",
"Language" : null,
"Extendable" : false,
"NameLanguage" : {
- "zh-CHS" : "通用字典",
- "en" : "Common Dictionary",
+ "zh-CHS" : "移动Vue测试",
+ "en" : "",
"zh-CHT" : ""
},
- "ID" : "35dd45be-60c7-4ae8-a827-533424031b76",
+ "ID" : "af47af33-345b-471e-9a00-49db59c222a1",
"IsTranslating" : false
},
- "refs" : [ {
+ "Refs" : [ {
"DependentMetadata" : {
- "ID" : "4fdfc52d-8ac3-4f56-b431-d371c1fcf3ec",
+ "ID" : "1cfb0d2a-7300-4fc7-8d01-cd09a5df9198",
"CertId" : null,
- "NameSpace" : "Inspur.GS.SagiDemo.SagiDemeModule.CommonDictionaries.CommonDictionaries.Front",
- "Code" : "CommonDictionary.frm",
- "Name" : "CommonDictionary.frm",
+ "NameSpace" : "Inspur.GS.MyDev.FarrisVueTest.VueFormTest.VueFormTest.Front",
+ "Code" : "MobileVueTest.mfrm",
+ "Name" : "MobileVueTest.mfrm",
"Type" : "ResourceMetadata",
- "BizobjectID" : "d8b09de6-5e7c-bfdf-d308-468827ba0d6b"
+ "BizobjectID" : "e34f063d-9c31-1e20-4ad7-c6b4f57ddfc9"
}
} ],
"Content" : {
"code" : null,
"name" : null,
+ "Id" : "af47af33-345b-471e-9a00-49db59c222a1",
"Contents" : {
"module" : {
- "id" : "35dd45be-60c7-4ae8-a827-533424031b76",
- "code" : "CommonDictionary",
- "name" : "通用字典",
+ "id" : "af47af33-345b-471e-9a00-49db59c222a1",
+ "code" : "MobileVueTest",
+ "name" : "移动Vue测试",
"type" : "Module",
- "creator" : "Sagi",
- "creationDate" : "2025-02-07T07:43:41.186Z",
+ "creator" : "lijiangkun",
+ "creationDate" : "2025-04-17T03:50:32.907Z",
"templateId" : "list-card-template",
"templateRule" : "list-card-template",
"entity" : [ {
- "eapiId" : "626b3ac9-e713-4cf2-95bd-9d01e401b51e",
- "eapiCode" : "CommonDictionary_frm",
- "eapiName" : "通用字典_frm",
- "eapiNameSpace" : "Inspur.GS.SagiDemo.SagiDemeModule.CommonDictionaries.CommonDictionaries.Front",
- "voPath" : "SagiDemo/SagiDemeModule/CommonDictionaries/bo-commondictionaries-front/metadata/components",
- "voNameSpace" : "Inspur.GS.SagiDemo.SagiDemeModule.CommonDictionaries.CommonDictionaries.Front",
- "name" : "通用字典_frm",
- "id" : "52c7e73a-4797-4547-a772-fd50edf39f63",
+ "eapiId" : "29245968-6379-4c6c-a812-72e3411917c0",
+ "eapiCode" : null,
+ "eapiName" : null,
+ "eapiNameSpace" : null,
+ "voPath" : null,
+ "voNameSpace" : null,
+ "name" : "移动Vue测试_mfrm",
+ "id" : "0d20adf7-9ed1-44cf-a8f5-e9714353c174",
+ "extendProperties" : {
+ "enableStdTimeFormat" : true
+ },
+ "sourceType" : "vo",
+ "variables" : [ ],
+ "code" : "MobileVueTest_mfrm",
"entities" : [ {
- "label" : "commonDictionarys",
- "name" : "通用字典",
- "id" : "57a6ad1b-0dc2-4617-b820-a973da18887c",
+ "name" : "Vue测试",
+ "id" : "fa4b4e84-11b2-40ce-b071-7b2cd5b93eed",
"type" : {
"$type" : "EntityType",
"fields" : [ {
@@ -62,21 +68,21 @@
"editor" : {
"$type" : "TextBox"
},
- "require" : true,
- "multiLanguage" : false,
"readonly" : false,
- "label" : "id",
+ "multiLanguage" : false,
+ "require" : true,
"name" : "主键",
- "id" : "740c1cff-164d-4f47-96d9-cf7c8075cddb",
+ "id" : "389ab039-9b60-4dd0-8cdc-a23c0feccf31",
"type" : {
"$type" : "StringType",
- "displayName" : "字符串",
"length" : 36,
- "name" : "String"
+ "name" : "String",
+ "displayName" : "字符串"
},
"path" : "ID",
+ "originalId" : "389ab039-9b60-4dd0-8cdc-a23c0feccf31",
"code" : "ID",
- "originalId" : "740c1cff-164d-4f47-96d9-cf7c8075cddb",
+ "label" : "id",
"bindingField" : "id",
"bindingPath" : "id"
}, {
@@ -86,43 +92,143 @@
"$type" : "DateBox",
"format" : "'yyyy-MM-dd'"
},
- "require" : false,
- "multiLanguage" : false,
"readonly" : false,
- "label" : "version",
+ "multiLanguage" : false,
+ "require" : false,
"name" : "版本",
- "id" : "43a7c79e-56e0-442e-b39d-8f9f45e8b0c8",
+ "id" : "e3ca9955-1155-4a4b-a164-e48c31928c24",
"type" : {
"$type" : "DateTimeType",
- "displayName" : "日期时间",
- "name" : "DateTime"
+ "name" : "DateTime",
+ "displayName" : "日期时间"
},
"path" : "Version",
+ "originalId" : "e3ca9955-1155-4a4b-a164-e48c31928c24",
"code" : "Version",
- "originalId" : "43a7c79e-56e0-442e-b39d-8f9f45e8b0c8",
+ "label" : "version",
"bindingField" : "version",
"bindingPath" : "version"
+ }, {
+ "$type" : "ComplexField",
+ "name" : "状态",
+ "id" : "9fefd0ed-7594-43f7-a6f2-10828a4d00ae",
+ "type" : {
+ "$type" : "ObjectType",
+ "name" : "BillState9fef",
+ "fields" : [ {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "EnumField"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : false,
+ "name" : "状态",
+ "id" : "9fefd0ed-0101-468f-ae3f-40c76c0f06b0",
+ "type" : {
+ "$type" : "EnumType",
+ "name" : "Enum",
+ "displayName" : "枚举",
+ "enumValues" : [ {
+ "disabled" : false,
+ "name" : "制单",
+ "value" : "Billing"
+ }, {
+ "disabled" : false,
+ "name" : "提交审批",
+ "value" : "SubmitApproval"
+ }, {
+ "disabled" : false,
+ "name" : "审批通过",
+ "value" : "Approved"
+ }, {
+ "disabled" : false,
+ "name" : "审批不通过",
+ "value" : "ApprovalNotPassed"
+ } ],
+ "valueType" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ }
+ },
+ "path" : "BillStatus.BillState",
+ "originalId" : "a0b19650-0101-468f-ae3f-40c76c0f06b0",
+ "code" : "BillState",
+ "label" : "billState",
+ "bindingField" : "billStatus_BillState",
+ "bindingPath" : "billStatus.billState"
+ } ],
+ "displayName" : "状态"
+ },
+ "path" : "BillStatus",
+ "originalId" : "9fefd0ed-7594-43f7-a6f2-10828a4d00ae",
+ "code" : "BillStatus",
+ "label" : "billStatus",
+ "bindingField" : "billStatus",
+ "bindingPath" : "billStatus"
+ }, {
+ "$type" : "ComplexField",
+ "name" : "流程实例",
+ "id" : "12ef9c5c-4ba3-4df4-bd0f-5672c3e0ecff",
+ "type" : {
+ "$type" : "ObjectType",
+ "name" : "ProcessInstance12ef",
+ "fields" : [ {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : false,
+ "name" : "流程实例",
+ "id" : "12ef9c5c-ad8f-4da3-a430-c8a7f2162135",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "ProcessInstance.ProcessInstance",
+ "originalId" : "2e1beb7d-ad8f-4da3-a430-c8a7f2162135",
+ "code" : "ProcessInstance",
+ "label" : "processInstance",
+ "bindingField" : "processInstance_ProcessInstance",
+ "bindingPath" : "processInstance.processInstance"
+ } ],
+ "displayName" : "流程实例"
+ },
+ "path" : "ProcessInstance",
+ "originalId" : "12ef9c5c-4ba3-4df4-bd0f-5672c3e0ecff",
+ "code" : "ProcessInstance",
+ "label" : "processInstance",
+ "bindingField" : "processInstance",
+ "bindingPath" : "processInstance"
}, {
"$type" : "SimpleField",
"defaultValue" : "",
"editor" : {
"$type" : "TextBox"
},
- "require" : false,
- "multiLanguage" : false,
"readonly" : false,
- "label" : "code",
+ "multiLanguage" : false,
+ "require" : false,
"name" : "编号",
- "id" : "ddfc72d4-0c9b-49bf-8f41-8047264f6edc",
+ "id" : "8537ca17-502f-4b90-ac87-ae1dde9a7f03",
"type" : {
"$type" : "StringType",
- "displayName" : "字符串",
"length" : 36,
- "name" : "String"
+ "name" : "String",
+ "displayName" : "字符串"
},
- "path" : "Code",
- "code" : "Code",
- "originalId" : "ddfc72d4-0c9b-49bf-8f41-8047264f6edc",
+ "path" : "code",
+ "originalId" : "8537ca17-502f-4b90-ac87-ae1dde9a7f03",
+ "code" : "code",
+ "label" : "code",
"bindingField" : "code",
"bindingPath" : "code"
}, {
@@ -131,602 +237,1206 @@
"editor" : {
"$type" : "TextBox"
},
- "require" : false,
- "multiLanguage" : false,
"readonly" : false,
- "label" : "name",
+ "multiLanguage" : false,
+ "require" : false,
"name" : "名称",
- "id" : "1ecd5759-6df4-41c8-9526-0108a5e2d9b6",
+ "id" : "6a051d6e-f870-4a9f-84df-043cfbc26cf2",
"type" : {
"$type" : "StringType",
- "displayName" : "字符串",
"length" : 36,
- "name" : "String"
+ "name" : "String",
+ "displayName" : "字符串"
},
- "path" : "Name",
- "code" : "Name",
- "originalId" : "1ecd5759-6df4-41c8-9526-0108a5e2d9b6",
+ "path" : "name",
+ "originalId" : "6a051d6e-f870-4a9f-84df-043cfbc26cf2",
+ "code" : "name",
+ "label" : "name",
"bindingField" : "name",
"bindingPath" : "name"
}, {
"$type" : "SimpleField",
"defaultValue" : "",
"editor" : {
- "$type" : "TextBox"
+ "$type" : "SwitchField"
},
- "require" : false,
- "multiLanguage" : false,
"readonly" : false,
- "label" : "category",
- "name" : "分类",
- "id" : "8e00ef40-17ba-4cbb-8a3c-709cf40b7939",
+ "multiLanguage" : false,
+ "require" : false,
+ "name" : "布尔字段",
+ "id" : "f51c1e5d-fe58-4591-8cd1-25a119c9f4c1",
"type" : {
- "$type" : "StringType",
- "displayName" : "字符串",
- "length" : 36,
- "name" : "String"
+ "$type" : "BooleanType",
+ "name" : "Boolean",
+ "displayName" : "布尔"
},
- "path" : "Category",
- "code" : "Category",
- "originalId" : "8e00ef40-17ba-4cbb-8a3c-709cf40b7939",
- "bindingField" : "category",
- "bindingPath" : "category"
+ "path" : "booleanField",
+ "originalId" : "f51c1e5d-fe58-4591-8cd1-25a119c9f4c1",
+ "code" : "booleanField",
+ "label" : "booleanField",
+ "bindingField" : "booleanField",
+ "bindingPath" : "booleanField"
}, {
"$type" : "SimpleField",
"defaultValue" : "",
"editor" : {
- "$type" : "EnumField"
+ "$type" : "NumericBox"
},
- "require" : false,
+ "readonly" : false,
"multiLanguage" : false,
+ "require" : false,
+ "name" : "数值字段",
+ "id" : "1f816b38-2a72-4252-8eb6-760b8f97fcea",
+ "type" : {
+ "$type" : "NumericType",
+ "length" : 0,
+ "name" : "Number",
+ "displayName" : "数字",
+ "precision" : 0
+ },
+ "path" : "numberField",
+ "originalId" : "1f816b38-2a72-4252-8eb6-760b8f97fcea",
+ "code" : "numberField",
+ "label" : "numberField",
+ "bindingField" : "numberField",
+ "bindingPath" : "numberField"
+ }, {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "DateBox",
+ "format" : "'yyyy-MM-dd'"
+ },
"readonly" : false,
- "label" : "enableStatus",
- "name" : "启用状态",
- "id" : "df3b84c2-dc6b-419c-85e3-0006b0535e61",
+ "multiLanguage" : false,
+ "require" : false,
+ "name" : "日期字段",
+ "id" : "4911913b-1868-4b34-b4e0-84939b14ab6e",
"type" : {
- "$type" : "EnumType",
- "displayName" : "枚举",
- "name" : "Enum",
- "enumValues" : [ {
- "disabled" : false,
- "name" : "未启用",
- "value" : "0"
+ "$type" : "DateType",
+ "name" : "Date",
+ "displayName" : "日期"
+ },
+ "path" : "dateField",
+ "originalId" : "4911913b-1868-4b34-b4e0-84939b14ab6e",
+ "code" : "dateField",
+ "label" : "dateField",
+ "bindingField" : "dateField",
+ "bindingPath" : "dateField"
+ } ],
+ "primary" : "id",
+ "entities" : [ {
+ "name" : "子表1",
+ "id" : "97347b0b-1c54-432f-891a-4d7b139d6dbc",
+ "type" : {
+ "$type" : "EntityType",
+ "fields" : [ {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : true,
+ "name" : "主键",
+ "id" : "7d1363dc-bbb0-41ac-b52d-5cc12832bf58",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "ID",
+ "originalId" : "7d1363dc-bbb0-41ac-b52d-5cc12832bf58",
+ "code" : "ID",
+ "label" : "id",
+ "bindingField" : "id",
+ "bindingPath" : "id"
}, {
- "disabled" : false,
- "name" : "已启用",
- "value" : "1"
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : true,
+ "name" : "上级对象主键",
+ "id" : "750cc77b-6562-4c83-9e5b-80ad5abb7bb8",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "ParentID",
+ "originalId" : "750cc77b-6562-4c83-9e5b-80ad5abb7bb8",
+ "code" : "ParentID",
+ "label" : "parentID",
+ "bindingField" : "parentID",
+ "bindingPath" : "parentID"
+ }, {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : false,
+ "name" : "编号",
+ "id" : "3c2b560e-5b8d-4781-b31f-719f83443df1",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "code",
+ "originalId" : "3c2b560e-5b8d-4781-b31f-719f83443df1",
+ "code" : "code",
+ "label" : "code",
+ "bindingField" : "code",
+ "bindingPath" : "code"
+ }, {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : false,
+ "name" : "名称",
+ "id" : "f89eb4ab-8d41-4fb5-a99d-013bd9242150",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "name",
+ "originalId" : "f89eb4ab-8d41-4fb5-a99d-013bd9242150",
+ "code" : "name",
+ "label" : "name",
+ "bindingField" : "name",
+ "bindingPath" : "name"
+ } ],
+ "primary" : "id",
+ "entities" : [ ],
+ "name" : "Child1",
+ "displayName" : "子表1"
+ },
+ "code" : "Child1",
+ "label" : "child1s"
+ }, {
+ "name" : "子表2",
+ "id" : "e1c8145b-15d6-4a54-9d79-9149af8d6dc4",
+ "type" : {
+ "$type" : "EntityType",
+ "fields" : [ {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : true,
+ "name" : "主键",
+ "id" : "3a1e8cf0-9ad2-4eeb-b16b-e898a8b24be4",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "ID",
+ "originalId" : "3a1e8cf0-9ad2-4eeb-b16b-e898a8b24be4",
+ "code" : "ID",
+ "label" : "id",
+ "bindingField" : "id",
+ "bindingPath" : "id"
+ }, {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : true,
+ "name" : "上级对象主键",
+ "id" : "22649c9f-2483-4907-8a67-9fd70ce9b5e7",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "ParentID",
+ "originalId" : "22649c9f-2483-4907-8a67-9fd70ce9b5e7",
+ "code" : "ParentID",
+ "label" : "parentID",
+ "bindingField" : "parentID",
+ "bindingPath" : "parentID"
+ }, {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : false,
+ "name" : "编号",
+ "id" : "bdc235f6-eded-443a-b95d-cf07fb4a741a",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "code",
+ "originalId" : "bdc235f6-eded-443a-b95d-cf07fb4a741a",
+ "code" : "code",
+ "label" : "code",
+ "bindingField" : "code",
+ "bindingPath" : "code"
+ }, {
+ "$type" : "SimpleField",
+ "defaultValue" : "",
+ "editor" : {
+ "$type" : "TextBox"
+ },
+ "readonly" : false,
+ "multiLanguage" : false,
+ "require" : false,
+ "name" : "名称",
+ "id" : "b5c97bc2-94e3-483c-8002-1352e103e9f6",
+ "type" : {
+ "$type" : "StringType",
+ "length" : 36,
+ "name" : "String",
+ "displayName" : "字符串"
+ },
+ "path" : "name",
+ "originalId" : "b5c97bc2-94e3-483c-8002-1352e103e9f6",
+ "code" : "name",
+ "label" : "name",
+ "bindingField" : "name",
+ "bindingPath" : "name"
} ],
- "valueType" : {
- "$type" : "StringType",
- "displayName" : "字符串",
- "length" : 36,
- "name" : "String"
- }
+ "primary" : "id",
+ "entities" : [ ],
+ "name" : "Child2",
+ "displayName" : "子表2"
},
- "path" : "EnableStatus",
- "code" : "EnableStatus",
- "originalId" : "df3b84c2-dc6b-419c-85e3-0006b0535e61",
- "bindingField" : "enableStatus",
- "bindingPath" : "enableStatus"
+ "code" : "Child2",
+ "label" : "child2s"
} ],
- "entities" : [ ],
- "primary" : "id",
- "displayName" : "通用字典",
- "name" : "CommonDictionary"
+ "name" : "VueTest",
+ "displayName" : "Vue测试"
},
- "code" : "CommonDictionary"
+ "code" : "VueTest",
+ "label" : "vueTests"
} ],
- "sourceUri" : "api/sagidemo/sagidememodule/v1.0/CommonDictionary_frm",
- "code" : "CommonDictionary_frm",
- "variables" : [ ],
- "sourceType" : "vo",
- "extendProperties" : {
- "enableStdTimeFormat" : true
- }
+ "sourceUri" : "api/mydev/farrisvuetest/v1.0/MobileVueTest_mfrm"
} ],
"states" : [ ],
"stateMachines" : [ {
- "id" : "CommonDictionary_state_machine",
- "name" : "通用字典",
- "uri" : "cde50e74-98bb-484d-8c21-247c84e615e0",
- "code" : "CommonDictionary_frm",
- "nameSpace" : "Inspur.GS.SagiDemo.SagiDemeModule.CommonDictionaries.CommonDictionaries.Front"
+ "id" : "MobileVueTest_list-page-component_state_machine",
+ "name" : "移动Vue测试_list-page-component状态机",
+ "uri" : "74843186-76b9-4ab3-8fad-c8ba64390c3c"
+ }, {
+ "id" : "MobileVueTest_card-page-component_state_machine",
+ "name" : "移动Vue测试_card-page-component状态机",
+ "uri" : "a39bf6b2-330a-4000-9d5e-82aa1c457edf"
} ],
"viewmodels" : [ {
- "id" : "root-viewmodel",
- "code" : "root-viewmodel",
- "name" : "通用字典",
+ "id" : "list-page-viewmodel",
+ "code" : "list-page-viewmodel",
+ "name" : "Vue测试",
"fields" : [ ],
- "stateMachine" : "CommonDictionary_state_machine",
- "serviceRefs" : [ ],
- "commands" : [ ],
- "states" : [ ],
- "bindTo" : "/",
- "enableValidation" : false,
- "enableUnifiedSession" : false
- }, {
- "id" : "data-grid-component-viewmodel",
- "code" : "data-grid-component-viewmodel",
- "name" : "通用字典",
- "fields" : [ {
- "type" : "Form",
- "id" : "ddfc72d4-0c9b-49bf-8f41-8047264f6edc",
- "fieldName" : "code",
- "groupId" : null,
- "groupName" : null,
- "updateOn" : "blur"
- }, {
- "type" : "Form",
- "id" : "1ecd5759-6df4-41c8-9526-0108a5e2d9b6",
- "fieldName" : "name",
- "groupId" : null,
- "groupName" : null,
- "updateOn" : "blur"
- }, {
- "type" : "Form",
- "id" : "df3b84c2-dc6b-419c-85e3-0006b0535e61",
- "fieldName" : "enableStatus",
- "groupId" : null,
- "groupName" : null,
- "updateOn" : "change"
- } ],
+ "stateMachine" : "MobileVueTest_list-page-component_state_machine",
"commands" : [ {
- "id" : "fda876c8-7230-46e7-af3d-d38233642275",
- "code" : "loadList1",
- "name" : "加载列表数据",
- "params" : [ ],
- "handlerName" : "loadList",
- "cmpId" : "7c48ef46-339c-42d4-8365-a21236c63044",
+ "id" : "LoadPageForList",
+ "code" : "LoadPageForList",
+ "name" : "页面加载命令",
+ "params" : [ {
+ "name" : "commandName",
+ "shownName" : "命令名称",
+ "value" : "LoadDataForList"
+ }, {
+ "name" : "viewModelId",
+ "shownName" : "视图模型id",
+ "value" : ""
+ } ],
+ "handlerName" : "LoadPageForList",
+ "cmpId" : "cf5e568a-5243-4539-94ea-e195eb4d6736",
"extensions" : [ ],
"isInvalid" : false
}, {
- "id" : "22576fc1-08fb-49a9-b132-295c7392b481",
- "code" : "remove1",
- "name" : "删除当前数据",
+ "id" : "LoadDataForList",
+ "code" : "LoadDataForList",
+ "name" : "列表取数命令",
"params" : [ {
- "name" : "id",
- "shownName" : "待删除数据的标识",
- "value" : "{DATA~/id}"
+ "name" : "filters",
+ "shownName" : "过滤条件",
+ "value" : "[]"
+ }, {
+ "name" : "sorts",
+ "shownName" : "排序条件",
+ "value" : "[]"
+ }, {
+ "name" : "autoMerge",
+ "shownName" : "是否合并过滤条件",
+ "value" : true
} ],
- "handlerName" : "remove",
- "cmpId" : "7c48ef46-339c-42d4-8365-a21236c63044",
+ "handlerName" : "LoadForList",
+ "cmpId" : "0a68799b-48c6-4c9f-b0d7-140683c62b58",
"extensions" : [ ],
"isInvalid" : false
}, {
- "id" : "8788c27e-722a-4b98-9d57-98eafb526fe5",
- "code" : "loadCard1",
- "name" : "加载卡片数据",
- "params" : [ ],
- "handlerName" : "loadCard",
- "cmpId" : "7c48ef46-339c-42d4-8365-a21236c63044",
+ "id" : "OpenCardAndAdd",
+ "code" : "OpenCardAndAdd",
+ "name" : "打开卡片并新增命令",
+ "params" : [ {
+ "name" : "path",
+ "shownName" : "路由地址",
+ "value" : "/MobileVueTest/card-page-component"
+ }, {
+ "name" : "queryParams",
+ "shownName" : "携带参数",
+ "value" : "{ \"action\": \"LoadAndAddForCard\" }"
+ } ],
+ "handlerName" : "Navigate",
+ "cmpId" : "910661bd-963a-4287-aa32-441c95b8720f",
"extensions" : [ ],
"isInvalid" : false
}, {
- "id" : "ef281c13-4480-4256-901e-4bef5f92bd9e",
- "code" : "add1",
- "name" : "新增一条数据",
- "params" : [ ],
- "handlerName" : "add",
- "cmpId" : "7c48ef46-339c-42d4-8365-a21236c63044",
+ "id" : "OpenCardAndEdit",
+ "code" : "OpenCardAndEdit",
+ "name" : "打开卡片并编辑命令",
+ "params" : [ {
+ "name" : "path",
+ "shownName" : "路由地址",
+ "value" : "/MobileVueTest/card-page-component"
+ }, {
+ "name" : "queryParams",
+ "shownName" : "携带参数",
+ "value" : "{ \"action\": \"LoadAndEditForCard\", \"id\":\"{DATA~/id}\"}"
+ } ],
+ "handlerName" : "Navigate",
+ "cmpId" : "910661bd-963a-4287-aa32-441c95b8720f",
"extensions" : [ ],
"isInvalid" : false
}, {
- "id" : "e7cf83c2-e52d-4dce-aded-047a819c8068",
- "code" : "changePage1",
- "name" : "切换页码",
+ "id" : "OpenCardAndView",
+ "code" : "OpenCardAndView",
+ "name" : "打开卡片并查看命令",
"params" : [ {
- "name" : "loadCommandName",
- "shownName" : "切换页面后回调方法",
- "value" : "loadList1"
+ "name" : "path",
+ "shownName" : "路由地址",
+ "value" : "/MobileVueTest/card-page-component"
}, {
- "name" : "loadCommandFrameId",
- "shownName" : "目标组件",
- "value" : "data-grid-component"
+ "name" : "queryParams",
+ "shownName" : "携带参数",
+ "value" : "{ \"action\": \"LoadAndViewForCard\", \"id\":\"{DATA~/id}\"}"
+ } ],
+ "handlerName" : "Navigate",
+ "cmpId" : "910661bd-963a-4287-aa32-441c95b8720f",
+ "extensions" : [ ],
+ "isInvalid" : false
+ }, {
+ "id" : "RemoveById",
+ "code" : "RemoveById",
+ "name" : "删除命令",
+ "params" : [ {
+ "name" : "id",
+ "shownName" : "数据id",
+ "value" : "{DATA~/id}"
+ } ],
+ "handlerName" : "RemoveById",
+ "cmpId" : "dab6b7f1-f56f-490a-879c-3d74232cd3ba",
+ "extensions" : [ ],
+ "isInvalid" : false
+ }, {
+ "id" : "RemoveByIds",
+ "code" : "RemoveByIds",
+ "name" : "批量删除命令",
+ "params" : [ {
+ "name" : "ids",
+ "shownName" : "数据id的数组",
+ "value" : ""
+ } ],
+ "handlerName" : "RemoveByIds",
+ "cmpId" : "dab6b7f1-f56f-490a-879c-3d74232cd3ba",
+ "extensions" : [ ],
+ "isInvalid" : false
+ }, {
+ "id" : "GoBack",
+ "code" : "GoBack",
+ "name" : "返回命令",
+ "params" : [ {
+ "name" : "params",
+ "shownName" : "携带参数",
+ "value" : "{}"
} ],
- "handlerName" : "changePage",
- "cmpId" : "7c48ef46-339c-42d4-8365-a21236c63044",
+ "handlerName" : "GoBack",
+ "cmpId" : "910661bd-963a-4287-aa32-441c95b8720f",
+ "extensions" : [ ],
+ "isInvalid" : false
+ }, {
+ "id" : "77a277bf-6db3-4f7c-9418-1c12212ccab0",
+ "code" : "componentOnBeforeInit",
+ "name" : "列表页面初始化前事件",
+ "params" : [ ],
+ "handlerName" : "componentOnBeforeInit",
+ "cmpId" : "791cc5d9-65f9-40d0-b40c-444c7bc1afa3",
+ "shortcut" : { },
"extensions" : [ ],
"isInvalid" : false
} ],
- "serviceRefs" : [ ],
"states" : [ ],
"bindTo" : "/",
- "parent" : "root-viewmodel",
+ "parent" : null,
"enableValidation" : false
}, {
- "id" : "detail-form-component-viewmodel",
- "code" : "detail-form-component-viewmodel",
- "name" : "通用字典",
+ "id" : "card-page-viewmodel",
+ "code" : "card-page-viewmodel",
+ "name" : "卡片页面视图模型",
"fields" : [ {
"type" : "Form",
- "id" : "ddfc72d4-0c9b-49bf-8f41-8047264f6edc",
+ "id" : "389ab039-9b60-4dd0-8cdc-a23c0feccf31",
+ "fieldName" : "id",
+ "groupId" : null,
+ "groupName" : null,
+ "updateOn" : "blur"
+ }, {
+ "type" : "Form",
+ "id" : "e3ca9955-1155-4a4b-a164-e48c31928c24",
+ "fieldName" : "version",
+ "groupId" : null,
+ "groupName" : null,
+ "updateOn" : "blur"
+ }, {
+ "type" : "Form",
+ "id" : "9fefd0ed-0101-468f-ae3f-40c76c0f06b0",
+ "fieldName" : "billStatus_BillState",
+ "groupId" : null,
+ "groupName" : null,
+ "updateOn" : "change"
+ }, {
+ "type" : "Form",
+ "id" : "12ef9c5c-ad8f-4da3-a430-c8a7f2162135",
+ "fieldName" : "processInstance_ProcessInstance",
+ "groupId" : null,
+ "groupName" : null,
+ "updateOn" : "blur"
+ }, {
+ "type" : "Form",
+ "id" : "8537ca17-502f-4b90-ac87-ae1dde9a7f03",
"fieldName" : "code",
"groupId" : null,
"groupName" : null,
"updateOn" : "blur"
}, {
"type" : "Form",
- "id" : "1ecd5759-6df4-41c8-9526-0108a5e2d9b6",
+ "id" : "6a051d6e-f870-4a9f-84df-043cfbc26cf2",
"fieldName" : "name",
"groupId" : null,
"groupName" : null,
"updateOn" : "blur"
}, {
"type" : "Form",
- "id" : "8e00ef40-17ba-4cbb-8a3c-709cf40b7939",
- "fieldName" : "category",
+ "id" : "f51c1e5d-fe58-4591-8cd1-25a119c9f4c1",
+ "fieldName" : "booleanField",
+ "groupId" : null,
+ "groupName" : null,
+ "updateOn" : "blur"
+ }, {
+ "type" : "Form",
+ "id" : "1f816b38-2a72-4252-8eb6-760b8f97fcea",
+ "fieldName" : "numberField",
+ "groupId" : null,
+ "groupName" : null,
+ "updateOn" : "blur"
+ }, {
+ "type" : "Form",
+ "id" : "4911913b-1868-4b34-b4e0-84939b14ab6e",
+ "fieldName" : "dateField",
"groupId" : null,
"groupName" : null,
"updateOn" : "blur"
} ],
+ "stateMachine" : "MobileVueTest_card-page-component_state_machine",
"commands" : [ {
- "id" : "d12acc4e-6274-44dc-95e6-cedeb5e66707",
- "code" : "edit1",
- "name" : "编辑数据",
+ "id" : "LoadPageForCard",
+ "code" : "LoadPageForCard",
+ "name" : "卡片页面加载命令",
+ "params" : [ {
+ "name" : "commandName",
+ "shownName" : "命令名称",
+ "value" : "{UISTATE~/#{card-page-component}/routerState/queryParams/action}"
+ }, {
+ "name" : "viewModelId",
+ "shownName" : "视图模型id",
+ "value" : ""
+ } ],
+ "handlerName" : "LoadPageForCard",
+ "cmpId" : "cf5e568a-5243-4539-94ea-e195eb4d6736",
+ "extensions" : [ ],
+ "isInvalid" : false
+ }, {
+ "id" : "LoadAndAddForCard",
+ "code" : "LoadAndAddForCard",
+ "name" : "卡片加载并新增命令",
+ "params" : [ {
+ "name" : "action",
+ "shownName" : "状态迁移动作",
+ "value" : "editAction"
+ } ],
+ "handlerName" : "LoadAndAddForCard",
+ "cmpId" : "0a68799b-48c6-4c9f-b0d7-140683c62b58",
+ "extensions" : [ ],
+ "isInvalid" : false
+ }, {
+ "id" : "LoadAndEditForCard",
+ "code" : "LoadAndEditForCard",
+ "name" : "卡片加载并编辑命令",
"params" : [ {
"name" : "id",
- "shownName" : "待编辑数据的标识",
- "value" : "{DATA~/id}"
+ "shownName" : "数据id",
+ "value" : "{UISTATE~/#{card-page-component}/routerState/queryParams/id}"
}, {
- "name" : "transitionAction",
- "shownName" : "状态机动作",
- "value" : "Edit"
+ "name" : "action",
+ "shownName" : "状态迁移动作",
+ "value" : "editAction"
} ],
- "handlerName" : "edit",
- "cmpId" : "7c48ef46-339c-42d4-8365-a21236c63044",
+ "handlerName" : "LoadAndEditForCard",
+ "cmpId" : "0a68799b-48c6-4c9f-b0d7-140683c62b58",
"extensions" : [ ],
"isInvalid" : false
}, {
- "id" : "5707d460-c441-45c4-8fe1-f77abd9f75b1",
- "code" : "save1",
- "name" : "保存变更",
- "params" : [ ],
- "handlerName" : "save",
- "cmpId" : "7c48ef46-339c-42d4-8365-a21236c63044",
+ "id" : "LoadAndViewForCard",
+ "code" : "LoadAndViewForCard",
+ "name" : "卡片加载并查看命令",
+ "params" : [ {
+ "name" : "id",
+ "shownName" : "数据id",
+ "value" : "{UISTATE~/#{card-page-component}/routerState/queryParams/id}"
+ }, {
+ "name" : "action",
+ "shownName" : "状态迁移动作",
+ "value" : "viewAction"
+ } ],
+ "handlerName" : "LoadAndViewForCard",
+ "cmpId" : "0a68799b-48c6-4c9f-b0d7-140683c62b58",
"extensions" : [ ],
"isInvalid" : false
}, {
- "id" : "b3897b4b-a37f-48e3-afb3-8489cec02806",
- "code" : "cancel1",
- "name" : "取消变更",
- "params" : [ ],
- "handlerName" : "cancel",
- "cmpId" : "7c48ef46-339c-42d4-8365-a21236c63044",
+ "id" : "Save",
+ "code" : "Save",
+ "name" : "保存命令",
+ "params" : [ {
+ "name" : "action",
+ "shownName" : "状态迁移动作",
+ "value" : null
+ } ],
+ "handlerName" : "Save",
+ "cmpId" : "f863c66a-bf93-4d1f-9f99-bcd76009609d",
+ "extensions" : [ ],
+ "isInvalid" : false
+ }, {
+ "id" : "Cancel",
+ "code" : "Cancel",
+ "name" : "取消命令",
+ "params" : [ {
+ "name" : "id",
+ "shownName" : "数据id",
+ "value" : "{DATA~/id}"
+ }, {
+ "name" : "action",
+ "shownName" : "迁移动作",
+ "value" : null
+ } ],
+ "handlerName" : "Cancel",
+ "cmpId" : "05592163-fd45-474e-b0ab-61d7dc02e5c0",
+ "extensions" : [ ],
+ "isInvalid" : false
+ }, {
+ "id" : "GoBackAndCheck",
+ "code" : "GoBackAndCheck",
+ "name" : "返回并检查",
+ "params" : [ {
+ "name" : "params",
+ "shownName" : "返回携带参数",
+ "value" : "{}"
+ } ],
+ "handlerName" : "GoBackAndCheck",
+ "cmpId" : "910661bd-963a-4287-aa32-441c95b8720f",
"extensions" : [ ],
"isInvalid" : false
} ],
- "serviceRefs" : [ ],
"states" : [ ],
"bindTo" : "/",
- "parent" : "root-viewmodel",
- "enableValidation" : true
+ "parent" : null,
+ "enableValidation" : false
} ],
"components" : [ {
- "id" : "root-component",
+ "id" : "list-page-component",
"type" : "component",
- "componentType" : "frame",
- "viewModel" : "root-viewmodel",
+ "title" : "列表页面",
+ "componentType" : "page",
+ "pageType" : "List",
+ "viewModel" : "list-page-viewmodel",
+ "appearance" : null,
+ "visible" : true,
+ "onBeforeInit" : "componentOnBeforeInit",
+ "onInit" : "LoadPageForList",
+ "onLoadData" : "LoadDataForList",
+ "goBack" : "GoBack",
"contents" : [ {
- "id" : "root-layout",
- "type" : "content-container",
- "appearance" : {
- "class" : "f-page f-page-navigate f-page-is-grid-card"
- },
+ "id" : "list-page-container",
+ "type" : "page-container",
+ "title" : "页面根容器",
+ "appearance" : null,
+ "visible" : true,
"contents" : [ {
- "id" : "page-header",
- "type" : "page-header",
- "appearance" : {
- "class" : "f-page-header"
- },
- "iconClass" : "f-title-icon f-text-orna-dict",
- "icon" : "f-icon f-icon-page-title-dictionary",
- "title" : "通用字典",
- "toolbar" : {
- "type" : "response-toolbar",
- "buttons" : [ {
- "id" : "button-add",
- "type" : "response-toolbar-item",
- "appearance" : {
- "class" : "btn-primary"
- },
- "disabled" : "!viewModel.stateMachine['canAdd']",
- "onClick" : "root-viewmodel.data-grid-component-viewmodel.add1",
- "text" : "新增"
- }, {
- "id" : "button-edit",
- "type" : "response-toolbar-item",
- "text" : "编辑",
- "disabled" : "!viewModel.stateMachine['canEdit']",
- "onClick" : "root-viewmodel.detail-form-component-viewmodel.edit1"
- }, {
- "id" : "button-save",
- "type" : "response-toolbar-item",
- "text" : "保存",
- "disabled" : "!viewModel.stateMachine['canSave']",
- "onClick" : "root-viewmodel.detail-form-component-viewmodel.save1"
- }, {
- "id" : "button-cancel",
- "type" : "response-toolbar-item",
- "text" : "取消",
- "disabled" : "!viewModel.stateMachine['canCancel']",
- "onClick" : "root-viewmodel.detail-form-component-viewmodel.cancel1"
- }, {
- "id" : "button-delete",
- "type" : "response-toolbar-item",
- "text" : "删除",
- "disabled" : "!viewModel.stateMachine['canRemove']",
- "onClick" : "root-viewmodel.data-grid-component-viewmodel.remove1"
- } ]
- }
+ "id" : "list-page-header-container",
+ "type" : "page-header-container",
+ "title" : "页头容器",
+ "appearance" : null,
+ "visible" : true,
+ "contents" : [ {
+ "id" : "list-page-navigation-bar",
+ "type" : "navbar",
+ "appearance" : null,
+ "title" : "列表页面",
+ "text" : "导航栏",
+ "visible" : true,
+ "onLeftClick" : "GoBack",
+ "rightToolbar" : {
+ "items" : [ ]
+ }
+ } ]
+ }, {
+ "id" : "list-page-body-container",
+ "type" : "page-body-container",
+ "title" : "主内容容器",
+ "appearance" : null,
+ "visible" : true,
+ "contents" : [ {
+ "id" : "listView",
+ "type" : "list-view",
+ "title" : "列表",
+ "onItemClick" : "OpenCardAndEdit",
+ "appearance" : null,
+ "dataSource" : "vueTests",
+ "fill" : true,
+ "enablePullUpLoad" : true,
+ "enablePullDownRefresh" : true,
+ "itemTemplate" : "
\r\n\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t主键:{{item.id}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t版本:{{item.version}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t状态:{{$formatUtils.enum(item.billStatus.billState,{enumData:[{\"disabled\":false,\"name\":\"制单\",\"value\":\"Billing\"},{\"disabled\":false,\"name\":\"提交审批\",\"value\":\"SubmitApproval\"},{\"disabled\":false,\"name\":\"审批通过\",\"value\":\"Approved\"},{\"disabled\":false,\"name\":\"审批不通过\",\"value\":\"ApprovalNotPassed\"}]})}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t流程实例:{{item.processInstance.processInstance}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t编号:{{item.code}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t名称:{{item.name}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t布尔字段:{{$formatUtils.bool(item.booleanField)}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t数值字段:{{item.numberField}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t日期字段:{{$formatUtils.date(item.dateField,'yyyy-MM-dd')}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
",
+ "visible" : true,
+ "swipeToolbar" : {
+ "id" : "listView-swipe-toolbar",
+ "title" : "列表滑动工具栏",
+ "type" : "tool-bar",
+ "items" : [ {
+ "id" : "listView-del-toobaritem",
+ "type" : "tool-bar-item",
+ "visible" : true,
+ "text" : "删除",
+ "onClick" : "RemoveById"
+ } ]
+ },
+ "toolbar" : {
+ "items" : [ ]
+ }
+ } ]
}, {
- "id" : "main-container",
- "type" : "content-container",
- "appearance" : {
- "class" : "f-page-main"
+ "id" : "list-page-float-container",
+ "type" : "float-container",
+ "title" : "浮动容器",
+ "appearance" : null,
+ "position" : {
+ "right" : 30,
+ "bottom" : 60
},
+ "visible" : true,
"contents" : [ {
- "id" : "content-splitter",
- "type" : "splitter",
- "appearance" : {
- "class" : "f-page-content"
+ "id" : "list-page-add-button",
+ "appearance" : { },
+ "type" : "button",
+ "title" : "新增",
+ "displayType" : "primary",
+ "onClick" : "OpenCardAndAdd",
+ "disabled" : false,
+ "round" : true,
+ "block" : true,
+ "buttonSize" : "normal",
+ "icon" : "s-plus",
+ "text" : "",
+ "size" : {
+ "width" : 44,
+ "height" : 44
},
- "contents" : [ {
- "id" : "content-list",
- "type" : "splitter-pane",
- "appearance" : {
- "class" : "f-col-w6 f-page-content-nav"
- },
- "resizable" : true,
- "contents" : [ {
- "id" : "data-grid-component-ref",
- "type" : "component-ref",
- "component" : "data-grid-component"
- } ]
- }, {
- "id" : "content-main",
- "type" : "splitter-pane",
- "appearance" : {
- "class" : "f-page-content-main"
- },
- "contents" : [ {
- "id" : "detail-component-ref",
- "type" : "component-ref",
- "component" : "detail-form-component"
- } ]
- } ]
+ "visible" : true
} ]
} ]
- } ]
+ } ],
+ "route" : {
+ "id" : "list-page-component",
+ "uri" : "list-page-component",
+ "name" : "list-page-component",
+ "params" : [ ]
+ }
}, {
- "id" : "data-grid-component",
+ "id" : "card-page-component",
"type" : "component",
- "componentType" : "data-grid",
- "viewModel" : "data-grid-component-viewmodel",
- "appearance" : {
- "class" : "f-struct-wrapper f-utils-fill-flex-column"
- },
- "onInit" : "loadList1",
+ "title" : "卡片页面",
+ "componentType" : "page",
+ "pageType" : "Card",
+ "viewModel" : "card-page-viewmodel",
+ "appearance" : null,
+ "visible" : true,
+ "onBeforeInit" : null,
+ "onInit" : "LoadPageForCard",
+ "onLoadData" : null,
+ "goBack" : "GoBackAndCheck",
"contents" : [ {
- "id" : "data-grid-section",
- "type" : "section",
- "appearance" : {
- "class" : "f-section-grid f-section-in-nav"
- },
- "fill" : true,
- "showHeader" : false,
+ "id" : "card-page-container",
+ "type" : "page-container",
+ "title" : "页面根容器",
+ "appearance" : null,
+ "visible" : true,
"contents" : [ {
- "id" : "dataGrid",
- "type" : "data-grid",
- "appearance" : {
- "class" : "f-component-grid"
- },
- "dataSource" : "commonDictionarys",
- "columns" : [ {
- "id" : "code_ddfc72d4_hxcr",
- "type" : "data-grid-column",
- "title" : "编号",
- "field" : "code",
- "dataType" : "string",
- "binding" : {
- "type" : "Form",
- "path" : "code",
- "field" : "ddfc72d4-0c9b-49bf-8f41-8047264f6edc",
- "fullPath" : "Code"
- },
- "width" : 120,
- "visible" : true,
- "filter" : "",
- "showSetting" : false,
- "actualWidth" : 120
- }, {
- "id" : "name_1ecd5759_yj0s",
- "type" : "data-grid-column",
- "title" : "名称",
- "field" : "name",
- "dataType" : "string",
- "binding" : {
- "type" : "Form",
- "path" : "name",
- "field" : "1ecd5759-6df4-41c8-9526-0108a5e2d9b6",
- "fullPath" : "Name"
- },
- "width" : 120,
+ "id" : "card-page-header-container",
+ "type" : "page-header-container",
+ "title" : "页头容器",
+ "appearance" : null,
+ "visible" : true,
+ "contents" : [ {
+ "id" : "card-page-navigation-bar",
+ "type" : "navbar",
+ "appearance" : null,
+ "title" : "卡片页面",
+ "text" : "导航栏",
"visible" : true,
- "filter" : "",
- "showSetting" : false,
- "actualWidth" : 120
- }, {
- "id" : "enableStatus_df3b84c2_jhvi",
- "type" : "data-grid-column",
- "title" : "启用状态",
- "field" : "enableStatus",
- "dataType" : "enum",
- "binding" : {
- "type" : "Form",
- "path" : "enableStatus",
- "field" : "df3b84c2-dc6b-419c-85e3-0006b0535e61",
- "fullPath" : "EnableStatus"
- },
- "width" : 120,
- "formatter" : {
- "type" : "enum",
- "data" : [ {
+ "onLeftClick" : "GoBackAndCheck",
+ "rightToolbar" : {
+ "items" : [ {
+ "id" : "add-btn",
+ "type" : "tool-bar-item",
+ "appearance" : null,
+ "iconType" : "",
"disabled" : false,
- "name" : "未启用",
- "value" : "0"
+ "text" : "新增",
+ "visible" : true,
+ "onClick" : "LoadAndAddForCard"
}, {
+ "id" : "cancel-btn",
+ "type" : "tool-bar-item",
+ "appearance" : null,
+ "iconType" : "",
"disabled" : false,
- "name" : "已启用",
- "value" : "1"
+ "text" : "取消",
+ "visible" : true,
+ "onClick" : "Cancel"
} ]
- },
- "visible" : true,
- "filter" : "",
- "showSetting" : true,
- "actualWidth" : 120
- } ],
- "fieldEditable" : false,
- "onClickRow" : "loadCard1",
- "onPageIndexChanged" : "changePage1",
- "onPageSizeChanged" : "changePage1",
- "pagination" : {
- "enable" : true,
- "mode" : "server"
- },
- "disabled" : "viewModel.stateMachine['editable']"
- } ]
- } ]
- }, {
- "id" : "detail-form-component",
- "type" : "component",
- "componentType" : "form",
- "formColumns" : 1,
- "viewModel" : "detail-form-component-viewmodel",
- "appearance" : {
- "class" : "f-struct-wrapper"
- },
- "contents" : [ {
- "id" : "detail-form-section",
- "type" : "section",
- "appearance" : {
- "class" : "f-section-form f-section-in-main"
- },
- "mainTitle" : "基本信息",
- "contents" : [ {
- "id" : "detail-form-layout",
- "type" : "response-form",
- "appearance" : {
- "class" : "f-form-layout farris-form farris-form-controls-inline"
- },
+ }
+ } ]
+ }, {
+ "id" : "card-page-body-container",
+ "type" : "page-body-container",
+ "title" : "主内容容器",
+ "appearance" : null,
+ "visible" : true,
"contents" : [ {
- "id" : "code_ddfc72d4_njzh",
- "type" : "form-group",
- "appearance" : {
- "class" : "col-12"
- },
- "label" : "编号",
- "binding" : {
- "type" : "Form",
- "path" : "code",
- "field" : "ddfc72d4-0c9b-49bf-8f41-8047264f6edc",
- "fullPath" : "Code"
- },
- "editor" : {
- "type" : "input-group",
- "readonly" : "!viewModel.stateMachine['editable']",
- "maxLength" : 36
- },
- "path" : "code"
- }, {
- "id" : "name_1ecd5759_onbj",
- "type" : "form-group",
- "appearance" : {
- "class" : "col-12"
- },
- "label" : "名称",
- "binding" : {
- "type" : "Form",
- "path" : "name",
- "field" : "1ecd5759-6df4-41c8-9526-0108a5e2d9b6",
- "fullPath" : "Name"
- },
- "editor" : {
- "type" : "input-group",
- "readonly" : "!viewModel.stateMachine['editable']",
- "maxLength" : 36
- },
- "path" : "name"
- }, {
- "id" : "category_8e00ef40_wdtg",
- "type" : "form-group",
- "appearance" : {
- "class" : "col-12"
- },
- "label" : "分类",
- "binding" : {
- "type" : "Form",
- "path" : "category",
- "field" : "8e00ef40-17ba-4cbb-8a3c-709cf40b7939",
- "fullPath" : "Category"
+ "id" : "card-page-form-container",
+ "type" : "form",
+ "title" : "Form组件容器",
+ "appearance" : null,
+ "contents" : [ {
+ "id" : "form_id",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "主键",
+ "binding" : {
+ "type" : "Form",
+ "path" : "id",
+ "field" : "389ab039-9b60-4dd0-8cdc-a23c0feccf31",
+ "fullPath" : "ID"
+ },
+ "editor" : {
+ "type" : "input-group",
+ "required" : true,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ },
+ "maxLength" : 36
+ },
+ "path" : "id"
+ }, {
+ "id" : "form_version",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "版本",
+ "binding" : {
+ "type" : "Form",
+ "path" : "version",
+ "field" : "e3ca9955-1155-4a4b-a164-e48c31928c24",
+ "fullPath" : "Version"
+ },
+ "editor" : {
+ "type" : "datetime-picker",
+ "required" : false,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ },
+ "displayFormat" : "yyyy-MM-dd HH:mm:ss"
+ },
+ "path" : "version"
+ }, {
+ "id" : "form_billStatus_BillState",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "状态",
+ "binding" : {
+ "type" : "Form",
+ "path" : "billStatus_BillState",
+ "field" : "9fefd0ed-0101-468f-ae3f-40c76c0f06b0",
+ "fullPath" : "BillStatus.BillState"
+ },
+ "editor" : {
+ "type" : "picker",
+ "data" : [ {
+ "disabled" : false,
+ "name" : "制单",
+ "value" : "Billing"
+ }, {
+ "disabled" : false,
+ "name" : "提交审批",
+ "value" : "SubmitApproval"
+ }, {
+ "disabled" : false,
+ "name" : "审批通过",
+ "value" : "Approved"
+ }, {
+ "disabled" : false,
+ "name" : "审批不通过",
+ "value" : "ApprovalNotPassed"
+ } ],
+ "textField" : "name",
+ "valueField" : "value",
+ "required" : false,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ }
+ },
+ "path" : "billStatus.billState"
+ }, {
+ "id" : "form_processInstance_ProcessInstance",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "流程实例",
+ "binding" : {
+ "type" : "Form",
+ "path" : "processInstance_ProcessInstance",
+ "field" : "12ef9c5c-ad8f-4da3-a430-c8a7f2162135",
+ "fullPath" : "ProcessInstance.ProcessInstance"
+ },
+ "editor" : {
+ "type" : "input-group",
+ "required" : false,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ },
+ "maxLength" : 36
+ },
+ "path" : "processInstance.processInstance"
+ }, {
+ "id" : "form_code",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "编号",
+ "binding" : {
+ "type" : "Form",
+ "path" : "code",
+ "field" : "8537ca17-502f-4b90-ac87-ae1dde9a7f03",
+ "fullPath" : "code"
+ },
+ "editor" : {
+ "type" : "input-group",
+ "required" : false,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ },
+ "maxLength" : 36
+ },
+ "path" : "code"
+ }, {
+ "id" : "form_name",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "名称",
+ "binding" : {
+ "type" : "Form",
+ "path" : "name",
+ "field" : "6a051d6e-f870-4a9f-84df-043cfbc26cf2",
+ "fullPath" : "name"
+ },
+ "editor" : {
+ "type" : "input-group",
+ "required" : false,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ },
+ "maxLength" : 36
+ },
+ "path" : "name"
+ }, {
+ "id" : "form_booleanField",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "布尔字段",
+ "binding" : {
+ "type" : "Form",
+ "path" : "booleanField",
+ "field" : "f51c1e5d-fe58-4591-8cd1-25a119c9f4c1",
+ "fullPath" : "booleanField"
+ },
+ "editor" : {
+ "type" : "switch",
+ "required" : false,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ }
+ },
+ "path" : "booleanField"
+ }, {
+ "id" : "form_numberField",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "数值字段",
+ "binding" : {
+ "type" : "Form",
+ "path" : "numberField",
+ "field" : "1f816b38-2a72-4252-8eb6-760b8f97fcea",
+ "fullPath" : "numberField"
+ },
+ "editor" : {
+ "type" : "number-input",
+ "precision" : 0,
+ "required" : false,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ },
+ "maxLength" : 0
+ },
+ "path" : "numberField"
+ }, {
+ "id" : "form_dateField",
+ "type" : "form-group",
+ "appearance" : null,
+ "label" : "日期字段",
+ "binding" : {
+ "type" : "Form",
+ "path" : "dateField",
+ "field" : "4911913b-1868-4b34-b4e0-84939b14ab6e",
+ "fullPath" : "dateField"
+ },
+ "editor" : {
+ "type" : "date-picker",
+ "required" : false,
+ "readonly" : {
+ "type" : "StateMachine",
+ "field" : "canEdit",
+ "status" : false
+ },
+ "displayFormat" : "yyyy-MM-dd"
+ },
+ "path" : "dateField"
+ } ]
+ } ]
+ }, {
+ "id" : "card-page-footer-container",
+ "type" : "page-footer-container",
+ "title" : "页尾容器",
+ "appearance" : null,
+ "size" : null,
+ "position" : null,
+ "visible" : true,
+ "contents" : [ {
+ "id" : "card-page-buttongroup-container",
+ "type" : "content-container",
+ "appearance" : null,
+ "size" : null,
+ "padding" : {
+ "left" : 16,
+ "right" : 16,
+ "top" : 8,
+ "bottom" : 8
},
- "editor" : {
- "type" : "input-group",
- "readonly" : "!viewModel.stateMachine['editable']",
- "maxLength" : 36
+ "display" : "flex",
+ "flexBox" : {
+ "direction" : "row"
},
- "path" : "category"
- } ],
- "controlsInline" : true,
- "formAutoIntl" : true
+ "visible" : true,
+ "title" : "按钮组容器",
+ "contents" : [ {
+ "id" : "card-page-save-button",
+ "type" : "button",
+ "title" : "保存按钮",
+ "visible" : true,
+ "round" : true,
+ "disabled" : false,
+ "text" : "按钮",
+ "icon" : "图标",
+ "block" : true,
+ "displayType" : "primary",
+ "onClick" : "Save"
+ } ]
+ } ]
} ]
- } ]
+ } ],
+ "route" : {
+ "id" : "card-page-component",
+ "uri" : "card-page-component",
+ "name" : "card-page-component",
+ "params" : [ ]
+ }
} ],
"webcmds" : [ {
- "id" : "7c48ef46-339c-42d4-8365-a21236c63044",
- "path" : "/projects/packages/Inspur.GS.Gsp.Web.WebCmp/webcmd",
- "name" : "ListCardController.webcmd",
+ "id" : "cf5e568a-5243-4539-94ea-e195eb4d6736",
+ "path" : "Gsp/Mobile/MobileCmp/bo-mobilecmp/metadata/webcmd",
+ "name" : "LoadPageCommands.webcmd",
"refedHandlers" : [ {
- "host" : "fda876c8-7230-46e7-af3d-d38233642275",
- "handler" : "loadList"
+ "host" : "LoadPageForList",
+ "handler" : "LoadPageForList"
}, {
- "host" : "8788c27e-722a-4b98-9d57-98eafb526fe5",
- "handler" : "loadCard"
+ "host" : "LoadPageForCard",
+ "handler" : "LoadPageForCard"
+ } ],
+ "code" : "LoadPageCommands",
+ "nameSpace" : "Inspur.GS.Gsp.Mobile.MobileCmp"
+ }, {
+ "id" : "0a68799b-48c6-4c9f-b0d7-140683c62b58",
+ "path" : "Gsp/Mobile/MobileCmp/bo-mobilecmp/metadata/webcmd",
+ "name" : "LoadCommands.webcmd",
+ "refedHandlers" : [ {
+ "host" : "LoadDataForList",
+ "handler" : "LoadForList"
+ }, {
+ "host" : "LoadAndAddForCard",
+ "handler" : "LoadAndAddForCard"
+ }, {
+ "host" : "LoadAndEditForCard",
+ "handler" : "LoadAndEditForCard"
}, {
- "host" : "ef281c13-4480-4256-901e-4bef5f92bd9e",
- "handler" : "add"
+ "host" : "LoadAndViewForCard",
+ "handler" : "LoadAndViewForCard"
+ } ],
+ "code" : "LoadCommands",
+ "nameSpace" : "Inspur.GS.Gsp.Mobile.MobileCmp"
+ }, {
+ "id" : "910661bd-963a-4287-aa32-441c95b8720f",
+ "path" : "Gsp/Mobile/MobileCmp/bo-mobilecmp/metadata/webcmd",
+ "name" : "NavigateCommands.webcmd",
+ "refedHandlers" : [ {
+ "host" : "OpenCardAndAdd",
+ "handler" : "Navigate"
}, {
- "host" : "d12acc4e-6274-44dc-95e6-cedeb5e66707",
- "handler" : "edit"
+ "host" : "OpenCardAndEdit",
+ "handler" : "Navigate"
}, {
- "host" : "5707d460-c441-45c4-8fe1-f77abd9f75b1",
- "handler" : "save"
+ "host" : "OpenCardAndView",
+ "handler" : "Navigate"
}, {
- "host" : "b3897b4b-a37f-48e3-afb3-8489cec02806",
- "handler" : "cancel"
+ "host" : "GoBack",
+ "handler" : "GoBack"
}, {
- "host" : "22576fc1-08fb-49a9-b132-295c7392b481",
- "handler" : "remove"
+ "host" : "GoBackAndCheck",
+ "handler" : "GoBackAndCheck"
+ } ],
+ "code" : "NavigateCommands",
+ "nameSpace" : "Inspur.GS.Gsp.Mobile.MobileCmp"
+ }, {
+ "id" : "dab6b7f1-f56f-490a-879c-3d74232cd3ba",
+ "path" : "Gsp/Mobile/MobileCmp/bo-mobilecmp/metadata/webcmd",
+ "name" : "RemoveCommands.webcmd",
+ "refedHandlers" : [ {
+ "host" : "RemoveById",
+ "handler" : "RemoveById"
}, {
- "host" : "e7cf83c2-e52d-4dce-aded-047a819c8068",
- "handler" : "changePage"
+ "host" : "RemoveByIds",
+ "handler" : "RemoveByIds"
+ } ],
+ "code" : "RemoveCommands",
+ "nameSpace" : "Inspur.GS.Gsp.Mobile.MobileCmp"
+ }, {
+ "id" : "f863c66a-bf93-4d1f-9f99-bcd76009609d",
+ "path" : "Gsp/Mobile/MobileCmp/bo-mobilecmp/metadata/webcmd",
+ "name" : "SaveCommands.webcmd",
+ "refedHandlers" : [ {
+ "host" : "Save",
+ "handler" : "Save"
+ } ],
+ "code" : "SaveCommands",
+ "nameSpace" : "Inspur.GS.Gsp.Mobile.MobileCmp"
+ }, {
+ "id" : "05592163-fd45-474e-b0ab-61d7dc02e5c0",
+ "path" : "Gsp/Mobile/MobileCmp/bo-mobilecmp/metadata/webcmd",
+ "name" : "CancelCommands.webcmd",
+ "refedHandlers" : [ {
+ "host" : "Cancel",
+ "handler" : "Cancel"
+ } ],
+ "code" : "CancelCommands",
+ "nameSpace" : "Inspur.GS.Gsp.Mobile.MobileCmp"
+ }, {
+ "id" : "791cc5d9-65f9-40d0-b40c-444c7bc1afa3",
+ "path" : "MyDev/FarrisVueTest/VueFormTest/bo-vueformtest-front/metadata/components",
+ "name" : "MobileVueTest_frm_Controller.webcmd",
+ "refedHandlers" : [ {
+ "host" : "77a277bf-6db3-4f7c-9418-1c12212ccab0",
+ "handler" : "componentOnBeforeInit"
} ],
- "code" : "ListCardController",
- "nameSpace" : "Inspur.GS.Gsp.Web.WebCmp"
+ "code" : "MobileVueTest_frm_Controller",
+ "nameSpace" : "Inspur.GS.MyDev.FarrisVueTest.VueFormTest.VueFormTest.Front"
} ],
- "projectName" : "bo-commondictionaries-front",
+ "projectName" : "bo-vueformtest-front",
+ "customClass" : { },
"actions" : [ ]
}
},
- "Id" : "35dd45be-60c7-4ae8-a827-533424031b76",
"CreationDate" : null
},
- "extendRule" : null,
- "relativePath" : "SagiDemo/SagiDemeModule/CommonDictionaries/bo-commondictionaries-front/metadata/components",
- "extendProperty" : "",
- "extended" : false,
- "previousVersion" : null,
- "version" : null,
- "properties" : {
+ "ExtendRule" : null,
+ "RelativePath" : "MyDev/FarrisVueTest/VueFormTest/bo-vueformtest-front/metadata/components",
+ "ExtendProperty" : "",
+ "Extended" : false,
+ "PreviousVersion" : null,
+ "Version" : null,
+ "Properties" : {
"SchemaVersion" : null,
"CacheVersion" : null,
"Framework" : "Vue"
diff --git a/packages/designer/src/app-providers.ts b/packages/designer/src/app-providers.ts
index c621b690c5..1a68ac58d5 100644
--- a/packages/designer/src/app-providers.ts
+++ b/packages/designer/src/app-providers.ts
@@ -1,11 +1,14 @@
import { FLoadingService, FTooltipDirective, FMessageBoxService, F_MODAL_SERVICE_TOKEN, FModalService, LookupSchemaRepositoryToken, FieldSelectorRepositoryToken, F_NOTIFY_SERVICE_TOKEN, FNotifyService, ControllerSchemaRepositorySymbol, FormSchemaRepositorySymbol } from "@farris/ui-vue/components";
import { App } from "vue";
+import { useDesignerContext } from "./components/composition/designer-context/use-designer-context";
+const designerContext =useDesignerContext();
export default {
install(app: App): void {
app.provide(F_MODAL_SERVICE_TOKEN, new FModalService(app));
app.provide('FLoadingService', FLoadingService);
+ app.provide('designerContext', designerContext);
// const metadataPath = metadataService.getMetadataPath();
// app.provide(MetadataPathToken, metadataPath);
diff --git a/packages/designer/src/components/components/form-designer/form-designer.component.tsx b/packages/designer/src/components/components/form-designer/form-designer.component.tsx
index ba93c31696..dc6d4660d2 100644
--- a/packages/designer/src/components/components/form-designer/form-designer.component.tsx
+++ b/packages/designer/src/components/components/form-designer/form-designer.component.tsx
@@ -7,6 +7,7 @@ import MonacoEditor from '../monaco-editor/monaco-editor.component';
import FEntityTreeView from '../entity-tree-view/components/entity-tree-view.component';
import FCustomClassEditor from './components/custom-class-editor/custom-class-editor.component';
import modulePropertyConfig from '../../types/form-property-config.json';
+import { UseDesignerContext } from "./../../../components/types/designer-context";
export default defineComponent({
name: 'FFormDesigner',
@@ -25,6 +26,8 @@ export default defineComponent({
const customClassEditorRef = ref();
const designerHostService = inject('designer-host-service') as DesignerHost;
+ const designerContext = inject('designerContext') as UseDesignerContext;
+ const { toolboxItems, componentsToRegister, designerMode }= designerContext;
function onCanvasInitialized(dragula: any) {
dragulaCompostion.value = dragula;
@@ -209,6 +212,8 @@ export default defineComponent({
onCanvasChanged={onCanvasChanged}
componentId={componentId.value}
onDragEnd={onCanvasDragEnd}
+ components={componentsToRegister}
+ canvasMode={designerMode}
>
Date: Wed, 2 Jul 2025 14:29:29 +0800
Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B9=8B?=
=?UTF-8?q?=E5=89=8D=E4=BD=BF=E7=94=A8PC=E7=94=BB=E5=B8=83=E6=97=B6?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9A=84=E4=B8=8D=E6=AD=A3=E7=A1=AE=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=EF=BC=8C=E5=8F=AF=E4=BB=A5=E4=BB=8Eempty1=E4=B8=AD?=
=?UTF-8?q?=E8=AF=BB=E5=8F=96=E8=BF=9B=E8=80=8C=E5=88=A4=E6=96=AD=E6=98=AF?=
=?UTF-8?q?=E5=90=A6=E6=98=AF=E7=A7=BB=E5=8A=A8=E7=AB=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/designer/src/app-providers.ts | 4 ++--
.../form-designer/form-designer.component.tsx | 7 ++++---
.../designer-context/use-designer-context.ts | 14 ++++++++++----
.../composition/use-page-metadata.ts | 19 ++++++++++++++++++-
.../src/components/designer.component.tsx | 10 ++++++++--
.../designer/src/components/types/metadata.ts | 2 ++
6 files changed, 44 insertions(+), 12 deletions(-)
diff --git a/packages/designer/src/app-providers.ts b/packages/designer/src/app-providers.ts
index 1a68ac58d5..e92694e806 100644
--- a/packages/designer/src/app-providers.ts
+++ b/packages/designer/src/app-providers.ts
@@ -2,13 +2,13 @@
import { FLoadingService, FTooltipDirective, FMessageBoxService, F_MODAL_SERVICE_TOKEN, FModalService, LookupSchemaRepositoryToken, FieldSelectorRepositoryToken, F_NOTIFY_SERVICE_TOKEN, FNotifyService, ControllerSchemaRepositorySymbol, FormSchemaRepositorySymbol } from "@farris/ui-vue/components";
import { App } from "vue";
import { useDesignerContext } from "./components/composition/designer-context/use-designer-context";
-const designerContext =useDesignerContext();
+// const designerContext =useDesignerContext();
export default {
install(app: App): void {
app.provide(F_MODAL_SERVICE_TOKEN, new FModalService(app));
app.provide('FLoadingService', FLoadingService);
- app.provide('designerContext', designerContext);
+ // app.provide('designerContext', designerContext);
// const metadataPath = metadataService.getMetadataPath();
// app.provide(MetadataPathToken, metadataPath);
diff --git a/packages/designer/src/components/components/form-designer/form-designer.component.tsx b/packages/designer/src/components/components/form-designer/form-designer.component.tsx
index dc6d4660d2..e147f2cbcf 100644
--- a/packages/designer/src/components/components/form-designer/form-designer.component.tsx
+++ b/packages/designer/src/components/components/form-designer/form-designer.component.tsx
@@ -7,7 +7,8 @@ import MonacoEditor from '../monaco-editor/monaco-editor.component';
import FEntityTreeView from '../entity-tree-view/components/entity-tree-view.component';
import FCustomClassEditor from './components/custom-class-editor/custom-class-editor.component';
import modulePropertyConfig from '../../types/form-property-config.json';
-import { UseDesignerContext } from "./../../../components/types/designer-context";
+import { UseDesignerContext } from "src/components/types/designer-context";
+import { useDesignerContext } from "./../../../components/composition/designer-context/use-designer-context";
export default defineComponent({
name: 'FFormDesigner',
@@ -26,8 +27,8 @@ export default defineComponent({
const customClassEditorRef = ref();
const designerHostService = inject('designer-host-service') as DesignerHost;
- const designerContext = inject('designerContext') as UseDesignerContext;
- const { toolboxItems, componentsToRegister, designerMode }= designerContext;
+ const designerContext = useDesignerContext();
+ const { toolboxItems, componentsToRegister, designerMode } = designerContext;
function onCanvasInitialized(dragula: any) {
dragulaCompostion.value = dragula;
diff --git a/packages/designer/src/components/composition/designer-context/use-designer-context.ts b/packages/designer/src/components/composition/designer-context/use-designer-context.ts
index c951fed7a9..37e1d787fa 100644
--- a/packages/designer/src/components/composition/designer-context/use-designer-context.ts
+++ b/packages/designer/src/components/composition/designer-context/use-designer-context.ts
@@ -1,3 +1,4 @@
+import { inject, Ref } from "vue";
import { DesignerMode, UseDesignerContext } from "../../types/designer-context";
import { MetadataService } from "../metadata.service";
import { useMobileDesignerContext } from "./use-mobile-designer-context";
@@ -9,12 +10,17 @@ import { usePCDesignerContext } from "./use-pc-designer-context";
*/
export function useDesignerContext(): UseDesignerContext {
function getDesignerMode(): DesignerMode {
- const metadataService = new MetadataService();
- const metadataPath = metadataService.getMetadataPath();
- if (metadataPath && metadataPath.includes('.mfrm')) {
+ // const metadataService = new MetadataService();
+ // const metadataPath = metadataService.getMetadataPath();
+ // if (metadataPath && metadataPath.includes('.mfrm')) {
+ // return DesignerMode.Mobile;
+ // }
+ // return DesignerMode.PC;
+ const formSchemType = inject("formSchemType") as Ref;
+ if(formSchemType.value === "MobileForm"){
return DesignerMode.Mobile;
}
- return DesignerMode.Mobile; // 之后需要改
+ return DesignerMode.PC;
}
const designerMode = getDesignerMode();
diff --git a/packages/designer/src/components/composition/use-page-metadata.ts b/packages/designer/src/components/composition/use-page-metadata.ts
index 14fee36c0b..bdf58418d0 100644
--- a/packages/designer/src/components/composition/use-page-metadata.ts
+++ b/packages/designer/src/components/composition/use-page-metadata.ts
@@ -67,6 +67,23 @@ export function usePageMetadata(
});
}
+ /** 查询表数据 */
+ function getType(): Promise {
+ return new Promise((resolve, reject) => {
+ const pathInHash = window.location.hash;
+ // const loacalSchemaUrl = pathInHash ? `/${pathInHash.slice(1)}.json` : `/designer-canvas/empty1.json`;
+ const loacalSchemaUrl = pathInHash ? `/${pathInHash.slice(1)}.json` : localMetadataUri;
+ if (props.schema) {
+ resolve(props.schema);
+ } else {
+ axios.get(loacalSchemaUrl).then((response) => {
+ const formSchemType = response.data.Header.Type as string;
+ resolve(formSchemType);
+ });
+ }
+ });
+ }
+
function save() {
const formMetadataBasicInfo = usePageSchemaComposition.getMetadata();
const formSchema = usePageSchemaComposition.getPageSchema();
@@ -205,6 +222,6 @@ export function usePageMetadata(
};
return axios.post(api, sendData, { headers: requestHeader });
}
- return { query, save, getTemplateRule, publish, deploy };
+ return { query, save, getTemplateRule, publish, deploy, getType };
}
diff --git a/packages/designer/src/components/designer.component.tsx b/packages/designer/src/components/designer.component.tsx
index 60241424a3..29e5a6537d 100644
--- a/packages/designer/src/components/designer.component.tsx
+++ b/packages/designer/src/components/designer.component.tsx
@@ -2,7 +2,7 @@ import { defineComponent, inject, ref, computed, provide, watch, onBeforeMount }
import { DesignerProps, designerProps } from "./designer.props";
import { usePageSchema } from "./composition/use-page-schema";
import { usePageMetadata } from "./composition/use-page-metadata";
-import { MetadataPathToken, PageMetadataContent } from "./types";
+import { MetadataDto, MetadataPathToken, PageMetadataContent } from "./types";
import { FModalService, ModalOptions, FNotifyService, FLoadingService, FResponseToolbar, FCapsule, CapsuleItem, DesignerHost } from '@farris/ui-vue/components';
import { ConfigOptions } from "./composition/types";
import { useCommand } from "./composition/command.service";
@@ -24,6 +24,7 @@ import FViewModelDesigner from '../components/components/view-model-designer/vie
import FPreview from './preview.component';
import './designer.scss';
import { DesignerMode } from "./types/designer-context";
+import { useDesignerContext } from "./composition/designer-context/use-designer-context";
export default defineComponent({
@@ -91,7 +92,9 @@ export default defineComponent({
designerHostService.usePageMetadataComposition = usePageMetadataComposition;
}
-
+ const formSchemType = ref();
+ provide('formSchemType', formSchemType);
+
configInitialized.then((options: ConfigOptions) => {
attachDesignerHostService(options, designerHostService);
@@ -108,6 +111,9 @@ export default defineComponent({
designerHostService.stateMachine.queryStateMachineMetadata();
});
});
+ designerHostService.usePageMetadataComposition.getType().then((formMetadataBasicInfo)=>{
+ formSchemType.value = formMetadataBasicInfo;
+ })
});
const metadataPath: string = inject(MetadataPathToken, '');
diff --git a/packages/designer/src/components/types/metadata.ts b/packages/designer/src/components/types/metadata.ts
index 036f17d111..5fa9b362e4 100644
--- a/packages/designer/src/components/types/metadata.ts
+++ b/packages/designer/src/components/types/metadata.ts
@@ -130,6 +130,8 @@ export interface MetadataDto {
export interface UsePageMetadata {
/** 查询表单元数据 */
query: () => Promise;
+ /** 查询表数据 */
+ getType: () => Promise;
/** 保存表单元数据 */
save: () => Promise;
/** 查询表单模板的拖拽控制规则 */
--
Gitee
From 5218bd3017fb901098bcfded47bec905305a808f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E7=91=9E=E8=88=AA?=
<15552473+cutecatQwQ@user.noreply.gitee.com>
Date: Fri, 4 Jul 2025 14:41:20 +0800
Subject: [PATCH 3/4] =?UTF-8?q?feature:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?=
=?UTF-8?q?=E6=96=B0=E5=A2=9EHtml=E6=A8=A1=E6=9D=BF=E7=BB=84=E5=BB=BA?=
=?UTF-8?q?=EF=BC=8C=E5=8F=AF=E4=BB=A5=E8=BF=9B=E8=A1=8C=E6=8B=96=E6=8B=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../public/designer-canvas/empty1.json | 108 ------------------
.../use-mobile-designer-context.ts | 3 +-
.../types/toolbox/mobile-toolbox.json | 6 +
.../components/html-template/index.ts | 15 +++
.../html-template.design.component.tsx | 35 ++++++
.../src/designer/use-designer-rules.ts | 35 ++++++
.../src/html-template.component.tsx | 13 +++
.../html-template/src/html-template.props.ts | 37 ++++++
.../html-template/src/html-template.scss | 28 +++++
.../html-template.property-config.ts | 36 ++++++
.../src/schema/html-template.schema.json | 33 ++++++
.../html-template/src/schema/schema-mapper.ts | 4 +
.../src/schema/schema-resolver.ts | 5 +
13 files changed, 249 insertions(+), 109 deletions(-)
create mode 100644 packages/mobile-ui-vue/components/html-template/index.ts
create mode 100644 packages/mobile-ui-vue/components/html-template/src/designer/html-template.design.component.tsx
create mode 100644 packages/mobile-ui-vue/components/html-template/src/designer/use-designer-rules.ts
create mode 100644 packages/mobile-ui-vue/components/html-template/src/html-template.component.tsx
create mode 100644 packages/mobile-ui-vue/components/html-template/src/html-template.props.ts
create mode 100644 packages/mobile-ui-vue/components/html-template/src/html-template.scss
create mode 100644 packages/mobile-ui-vue/components/html-template/src/property-config/html-template.property-config.ts
create mode 100644 packages/mobile-ui-vue/components/html-template/src/schema/html-template.schema.json
create mode 100644 packages/mobile-ui-vue/components/html-template/src/schema/schema-mapper.ts
create mode 100644 packages/mobile-ui-vue/components/html-template/src/schema/schema-resolver.ts
diff --git a/packages/designer/public/designer-canvas/empty1.json b/packages/designer/public/designer-canvas/empty1.json
index b740c59a3b..2a504418e8 100644
--- a/packages/designer/public/designer-canvas/empty1.json
+++ b/packages/designer/public/designer-canvas/empty1.json
@@ -886,114 +886,6 @@
"enableValidation" : false
} ],
"components" : [ {
- "id" : "list-page-component",
- "type" : "component",
- "title" : "列表页面",
- "componentType" : "page",
- "pageType" : "List",
- "viewModel" : "list-page-viewmodel",
- "appearance" : null,
- "visible" : true,
- "onBeforeInit" : "componentOnBeforeInit",
- "onInit" : "LoadPageForList",
- "onLoadData" : "LoadDataForList",
- "goBack" : "GoBack",
- "contents" : [ {
- "id" : "list-page-container",
- "type" : "page-container",
- "title" : "页面根容器",
- "appearance" : null,
- "visible" : true,
- "contents" : [ {
- "id" : "list-page-header-container",
- "type" : "page-header-container",
- "title" : "页头容器",
- "appearance" : null,
- "visible" : true,
- "contents" : [ {
- "id" : "list-page-navigation-bar",
- "type" : "navbar",
- "appearance" : null,
- "title" : "列表页面",
- "text" : "导航栏",
- "visible" : true,
- "onLeftClick" : "GoBack",
- "rightToolbar" : {
- "items" : [ ]
- }
- } ]
- }, {
- "id" : "list-page-body-container",
- "type" : "page-body-container",
- "title" : "主内容容器",
- "appearance" : null,
- "visible" : true,
- "contents" : [ {
- "id" : "listView",
- "type" : "list-view",
- "title" : "列表",
- "onItemClick" : "OpenCardAndEdit",
- "appearance" : null,
- "dataSource" : "vueTests",
- "fill" : true,
- "enablePullUpLoad" : true,
- "enablePullDownRefresh" : true,
- "itemTemplate" : "\r\n\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t主键:{{item.id}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t版本:{{item.version}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t状态:{{$formatUtils.enum(item.billStatus.billState,{enumData:[{\"disabled\":false,\"name\":\"制单\",\"value\":\"Billing\"},{\"disabled\":false,\"name\":\"提交审批\",\"value\":\"SubmitApproval\"},{\"disabled\":false,\"name\":\"审批通过\",\"value\":\"Approved\"},{\"disabled\":false,\"name\":\"审批不通过\",\"value\":\"ApprovalNotPassed\"}]})}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t流程实例:{{item.processInstance.processInstance}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t编号:{{item.code}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t名称:{{item.name}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t布尔字段:{{$formatUtils.bool(item.booleanField)}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t数值字段:{{item.numberField}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t日期字段:{{$formatUtils.date(item.dateField,'yyyy-MM-dd')}}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
",
- "visible" : true,
- "swipeToolbar" : {
- "id" : "listView-swipe-toolbar",
- "title" : "列表滑动工具栏",
- "type" : "tool-bar",
- "items" : [ {
- "id" : "listView-del-toobaritem",
- "type" : "tool-bar-item",
- "visible" : true,
- "text" : "删除",
- "onClick" : "RemoveById"
- } ]
- },
- "toolbar" : {
- "items" : [ ]
- }
- } ]
- }, {
- "id" : "list-page-float-container",
- "type" : "float-container",
- "title" : "浮动容器",
- "appearance" : null,
- "position" : {
- "right" : 30,
- "bottom" : 60
- },
- "visible" : true,
- "contents" : [ {
- "id" : "list-page-add-button",
- "appearance" : { },
- "type" : "button",
- "title" : "新增",
- "displayType" : "primary",
- "onClick" : "OpenCardAndAdd",
- "disabled" : false,
- "round" : true,
- "block" : true,
- "buttonSize" : "normal",
- "icon" : "s-plus",
- "text" : "",
- "size" : {
- "width" : 44,
- "height" : 44
- },
- "visible" : true
- } ]
- } ]
- } ],
- "route" : {
- "id" : "list-page-component",
- "uri" : "list-page-component",
- "name" : "list-page-component",
- "params" : [ ]
- }
- }, {
"id" : "card-page-component",
"type" : "component",
"title" : "卡片页面",
diff --git a/packages/designer/src/components/composition/designer-context/use-mobile-designer-context.ts b/packages/designer/src/components/composition/designer-context/use-mobile-designer-context.ts
index ca3121935c..1d18f2d01b 100644
--- a/packages/designer/src/components/composition/designer-context/use-mobile-designer-context.ts
+++ b/packages/designer/src/components/composition/designer-context/use-mobile-designer-context.ts
@@ -7,6 +7,7 @@ import {
ContentContainer, Card, FloatContainer, Navbar, ListView, Form, FormItem, InputGroup, Button, Switch, CheckboxGroup, RadioGroup,
ButtonGroup,registerDesignerComponents
} from '@farris/mobile-ui-vue';
+import { HtmlTemplate } from "../../../../../mobile-ui-vue/components/html-template"
import { useMobileControlCreator } from "../control-creator/use-mobile-control-creator";
import { PageComponent, UsePageSchema } from "../../../components/types";
import ControllCategories from '../schema-repository/controller/mobile-categories';
@@ -25,7 +26,7 @@ export function useMobileDesignerContext(): UseDesignerContext {
ContentContainer, Card, FloatContainer, Textarea, DatePicker, DateTimePicker, Lookup,
Navbar, ListView, Picker, NumberInput, Switch, CheckboxGroup, RadioGroup,
Form, FormItem, InputGroup,
- Button, ButtonGroup,
+ Button, ButtonGroup,HtmlTemplate
];
registerDesignerComponents(componentsToRegister);
diff --git a/packages/designer/src/components/types/toolbox/mobile-toolbox.json b/packages/designer/src/components/types/toolbox/mobile-toolbox.json
index fdc942bfbc..84d0bbb21b 100644
--- a/packages/designer/src/components/types/toolbox/mobile-toolbox.json
+++ b/packages/designer/src/components/types/toolbox/mobile-toolbox.json
@@ -139,6 +139,12 @@
"name": "卡片",
"category": "container",
"icon": "section"
+ },{
+ "id": "HtmlTemplate",
+ "type": "html-template",
+ "name": "Html模板",
+ "category": "container",
+ "icon": "html-template"
}
]
},
diff --git a/packages/mobile-ui-vue/components/html-template/index.ts b/packages/mobile-ui-vue/components/html-template/index.ts
new file mode 100644
index 0000000000..83b0e85368
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/index.ts
@@ -0,0 +1,15 @@
+import { withInstall, withRegister, withRegisterDesigner } from '@farris/mobile-ui-vue/common';
+import HtmlTemplateInstallless from './src/html-template.component';
+import { propsResolverGenerator } from './src/html-template.props';
+import HtmlTemplateDesign from './src/designer/html-template.design.component';
+
+const HTML_TEMPLATE_REGISTERED_NAME = 'html-template';
+
+const HtmlTemplate = withInstall(HtmlTemplateInstallless);
+
+withRegister(HtmlTemplate, { name: HTML_TEMPLATE_REGISTERED_NAME, propsResolverGenerator });
+withRegisterDesigner(HtmlTemplate, { name: HTML_TEMPLATE_REGISTERED_NAME, propsResolverGenerator, designerComponent: HtmlTemplateDesign });
+
+export * from './src/html-template.props';
+export { HtmlTemplate };
+export default HtmlTemplate;
diff --git a/packages/mobile-ui-vue/components/html-template/src/designer/html-template.design.component.tsx b/packages/mobile-ui-vue/components/html-template/src/designer/html-template.design.component.tsx
new file mode 100644
index 0000000000..95650c188b
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/designer/html-template.design.component.tsx
@@ -0,0 +1,35 @@
+import { computed, defineComponent, inject, onMounted, ref, SetupContext } from 'vue';
+import { htmlTemplateDesignProps, HtmlTemplateDesignProps } from '../html-template.props';
+import { useDesignerRules } from './use-designer-rules';
+import { DesignerItemContext, useDesignerComponent } from '@farris/mobile-ui-vue/common';
+
+export default defineComponent({
+ name: 'FHtmlTemplateDesign',
+ props: htmlTemplateDesignProps,
+ emits: [] as (string[] & ThisType) | undefined,
+ setup(props: HtmlTemplateDesignProps, context: SetupContext) {
+ const elementRef = ref();
+ const designerHostService = inject('designer-host-service');
+ const designItemContext = inject('design-item-context');
+ const designerRulesComposition = useDesignerRules(designItemContext!.schema, designerHostService);
+ const componentInstance = useDesignerComponent(elementRef, designItemContext, designerRulesComposition);
+
+ onMounted(() => {
+ elementRef.value.componentInstance = componentInstance;
+ });
+
+ context.expose(componentInstance.value);
+
+ const placeholderText = '请在属性面板中配置模板';
+ const placeholderHtml = `${placeholderText}
`;
+ const htmlTemplateInnerHTML = computed(() => {
+ return props.html ? props.html : placeholderHtml;
+ });
+
+ return () => {
+ return (
+
+ );
+ };
+ }
+});
\ No newline at end of file
diff --git a/packages/mobile-ui-vue/components/html-template/src/designer/use-designer-rules.ts b/packages/mobile-ui-vue/components/html-template/src/designer/use-designer-rules.ts
new file mode 100644
index 0000000000..69f8cb69e7
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/designer/use-designer-rules.ts
@@ -0,0 +1,35 @@
+import { ComponentSchema } from "@farris/mobile-ui-vue/common";
+import { HtmlTemplateProperty } from "../property-config/html-template.property-config";
+import { UseDesignerRules } from "@farris/mobile-ui-vue/common";
+
+export function useDesignerRules(schema: ComponentSchema, designerHostService: any): UseDesignerRules {
+
+ function canAccepts(): boolean {
+ return false;
+ }
+
+ function checkCanDeleteComponent() {
+ return true;
+ }
+
+ function checkCanMoveComponent() {
+ return true;
+ }
+
+ function hideNestedPaddingInDesginerView() {
+ return true;
+ }
+
+ function getPropsConfig(componentId: string) {
+ const htmlTemplateProperty = new HtmlTemplateProperty(componentId, designerHostService);
+ return htmlTemplateProperty.getPropertyConfig(schema);
+ }
+
+ return {
+ canAccepts,
+ hideNestedPaddingInDesginerView,
+ getPropsConfig,
+ checkCanDeleteComponent,
+ checkCanMoveComponent
+ };
+}
diff --git a/packages/mobile-ui-vue/components/html-template/src/html-template.component.tsx b/packages/mobile-ui-vue/components/html-template/src/html-template.component.tsx
new file mode 100644
index 0000000000..c4ea43b9fd
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/html-template.component.tsx
@@ -0,0 +1,13 @@
+import { defineComponent, ref, computed } from 'vue';
+import { HTML_TEMPLATE_NAME, htmlTemplateProps, HtmlTemplateProps } from './html-template.props';
+
+export default defineComponent({
+ name: HTML_TEMPLATE_NAME,
+ props: htmlTemplateProps,
+ emits: [],
+ setup(props: HtmlTemplateProps, context) {
+ return () => {
+ return props.renderFunction?.();
+ };
+ }
+});
diff --git a/packages/mobile-ui-vue/components/html-template/src/html-template.props.ts b/packages/mobile-ui-vue/components/html-template/src/html-template.props.ts
new file mode 100644
index 0000000000..f172fc6d25
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/html-template.props.ts
@@ -0,0 +1,37 @@
+import { ExtractPropTypes, PropType, RenderFunction } from 'vue';
+import { getPropsResolverGenerator } from '@farris/mobile-ui-vue/dynamic-resolver';
+import htmlTemplateSchema from './schema/html-template.schema.json';
+import { schemaMapper } from './schema/schema-mapper';
+import { schemaResolver } from './schema/schema-resolver';
+
+export const HTML_TEMPLATE_NAME = 'fm-html-template';
+
+export const htmlTemplateProps = {
+
+ /** 渲染函数 */
+ renderFunction: { type: Function as PropType },
+};
+
+export type HtmlTemplateProps = ExtractPropTypes;
+
+export const propsResolverGenerator = getPropsResolverGenerator(
+ htmlTemplateProps,
+ htmlTemplateSchema,
+ schemaMapper,
+ schemaResolver,
+);
+
+export const htmlTemplateDesignProps = {
+
+ /** html模板 */
+ html: { type: String, default: '' },
+};
+
+export type HtmlTemplateDesignProps = ExtractPropTypes;
+
+export const designPropsResolverGenerator = getPropsResolverGenerator(
+ htmlTemplateDesignProps,
+ htmlTemplateSchema,
+ schemaMapper,
+ schemaResolver,
+);
\ No newline at end of file
diff --git a/packages/mobile-ui-vue/components/html-template/src/html-template.scss b/packages/mobile-ui-vue/components/html-template/src/html-template.scss
new file mode 100644
index 0000000000..5a6064b719
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/html-template.scss
@@ -0,0 +1,28 @@
+.fv-html-template-design {
+ display: inherit;
+ flex: 1;
+ flex-direction: inherit;
+ flex-wrap: inherit;
+ justify-content: inherit;
+ align-items: inherit;
+ width: 100%;
+ padding: 0;
+ border: 0;
+
+ &-placeholder {
+ position: relative;
+ height: 50px;
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ overflow: hidden;
+ color: #315585;
+ background-color: #dfedff;
+ border-color: #d2e6ff;
+ padding: .75rem 1.25rem;
+ margin-bottom: 1rem;
+ border: 1px solid transparent;
+ border-radius: 3px;
+ }
+}
\ No newline at end of file
diff --git a/packages/mobile-ui-vue/components/html-template/src/property-config/html-template.property-config.ts b/packages/mobile-ui-vue/components/html-template/src/property-config/html-template.property-config.ts
new file mode 100644
index 0000000000..04e54e333f
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/property-config/html-template.property-config.ts
@@ -0,0 +1,36 @@
+import { BaseControlProperty, ToolbarItemProperty } from "@farris/mobile-ui-vue/common";
+
+export class HtmlTemplateProperty extends BaseControlProperty {
+
+ constructor(componentId: string, designerHostService: any) {
+ super(componentId, designerHostService);
+ }
+
+ public getPropertyConfig(propertyData: any) {
+ // 基本信息
+ this.propertyConfig.categories['basic'] = this.getBasicPropConfig(propertyData);
+ // 模板
+ this.propertyConfig.categories['template'] = this.getTemplateProperties(propertyData);
+ return this.propertyConfig;
+ }
+
+ private getTemplateProperties(propertyData: any) {
+ return {
+ title: '模板',
+ description: '',
+ properties: {
+ html: {
+ title: 'html',
+ type: 'string',
+ description: 'HTML模板',
+ refreshPanelAfterChanged: true,
+ editor: {
+ type: "code-editor",
+ language: "html",
+ },
+ },
+ }
+ };
+ }
+
+}
diff --git a/packages/mobile-ui-vue/components/html-template/src/schema/html-template.schema.json b/packages/mobile-ui-vue/components/html-template/src/schema/html-template.schema.json
new file mode 100644
index 0000000000..e0c13127cd
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/schema/html-template.schema.json
@@ -0,0 +1,33 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "https://farris-design.gitee.io/html-template.schema.json",
+ "title": "html-template",
+ "description": "A Farris Component",
+ "type": "object",
+ "properties": {
+ "id": {
+ "description": "The unique identifier for a html-template",
+ "type": "string"
+ },
+ "type": {
+ "description": "The type string of html-template",
+ "type": "string",
+ "default": "html-template"
+ },
+ "html": {
+ "description": "",
+ "type": "string",
+ "default": ""
+ },
+ "renderFunction": {
+ "description": "",
+ "type": "function",
+ "default": null
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "ignore": []
+}
\ No newline at end of file
diff --git a/packages/mobile-ui-vue/components/html-template/src/schema/schema-mapper.ts b/packages/mobile-ui-vue/components/html-template/src/schema/schema-mapper.ts
new file mode 100644
index 0000000000..5ad252311a
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/schema/schema-mapper.ts
@@ -0,0 +1,4 @@
+import { resolveAppearance, resolvePadding, resolveMargin, resolveToolbar, MapperFunction } from '../../../dynamic-resolver';
+
+export const schemaMapper = new Map([]);
+
diff --git a/packages/mobile-ui-vue/components/html-template/src/schema/schema-resolver.ts b/packages/mobile-ui-vue/components/html-template/src/schema/schema-resolver.ts
new file mode 100644
index 0000000000..c1bf8da88a
--- /dev/null
+++ b/packages/mobile-ui-vue/components/html-template/src/schema/schema-resolver.ts
@@ -0,0 +1,5 @@
+import { DynamicResolver } from "../../../dynamic-resolver";
+
+export function schemaResolver(resolver: DynamicResolver, schema: Record, context: Record): Record {
+ return schema;
+}
--
Gitee
From 7acb8682adb959466784a9beb38ae90ad4f5573a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E7=91=9E=E8=88=AA?=
<15552473+cutecatQwQ@user.noreply.gitee.com>
Date: Fri, 4 Jul 2025 16:52:40 +0800
Subject: [PATCH 4/4] =?UTF-8?q?feature:=20=E5=AE=8C=E5=96=84=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=EF=BC=8C=E5=AE=9E=E7=8E=B0html=E6=A8=A1=E6=9D=BF?=
=?UTF-8?q?=E7=9A=84=E7=BC=96=E8=BE=91=EF=BC=8C=E5=B1=95=E7=8E=B0html?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/common/src/properties/dg-control.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/packages/mobile-ui-vue/components/common/src/properties/dg-control.ts b/packages/mobile-ui-vue/components/common/src/properties/dg-control.ts
index 7686b23283..175de19256 100644
--- a/packages/mobile-ui-vue/components/common/src/properties/dg-control.ts
+++ b/packages/mobile-ui-vue/components/common/src/properties/dg-control.ts
@@ -51,4 +51,6 @@ export const DgControl = {
'navbar': { type: 'navbar', name: '导航栏', icon: 'NavBar' },
'picker': { type: 'picker', name: '选择器', icon: 'EnumField' },
+
+ 'html-template': { type: 'html-template', name: '模板容器', icon: '' },
};
--
Gitee