SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [FormElement](
	[FormID] [int] IDENTITY(1,1) NOT NULL,
	[TemplateID] [int] NULL,
	[HtmlID] [int] NULL,
	[Property] [varchar](50) NULL,
	[PropertyName] [nvarchar](50) NULL,
	[Sequence] [int] NULL CONSTRAINT [DF_Form_Order]  DEFAULT ((0)),
	[Status] [int] NULL CONSTRAINT [DF_Form_Status]  DEFAULT ((11)),
	[IsNull] [int] NULL CONSTRAINT [DF_Form_IsNull]  DEFAULT ((0)),
	[VerificationID] [int] NULL CONSTRAINT [DF_Form_VerificationID]  DEFAULT ((0)),
	[ControlOptionGroupID] [int] NULL CONSTRAINT [DF_FormElement_ControlOptionGroupID]  DEFAULT ((0)),
	[DataType] [varchar](50) NULL,
	[MaxLength] [int] NULL CONSTRAINT [DF_FormElement_MaxLength]  DEFAULT ((0)),
	[Description] [nvarchar](200) NULL,
	[Placeholder] [nvarchar](100) NULL,
	[PropertyLabel] [nvarchar](100) NULL,
	[FocusTips] [nvarchar](100) NULL,
	[ErrorTips] [nvarchar](100) NULL,
 CONSTRAINT [PK_Form] PRIMARY KEY CLUSTERED 
(
	[FormID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET IDENTITY_INSERT [FormElement] ON 

INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (55, 18, 1, N'Title', N'标题', 0, 1, 0, 3, 8, N'nvarchar', 200, N'', N'必填项', N'', NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (56, 18, 1, N'Price', N'价格', 1, 1, 1, 1, 8, N'decimal', 50, N'', N'数字', N'元', NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (57, 18, 8, N'TransactionMethod', N'交易方式', 3, 1, 1, 3, 6, N'nvarchar', 10, N'根据各自的情况选择', NULL, NULL, NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (58, 18, 5, N'InfoPic', N'展示图片', 4, 1, 1, 3, 8, N'nvarchar', 500, N'', NULL, NULL, NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (59, 18, 9, N'Detail', N'详细信息', 5, 1, 1, 3, 8, N'text', 0, N'', N'详细说明,可以上传图片展示', N'', NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (60, 18, 1, N'Contact', N'联系人', 6, 1, 1, 3, 8, N'nvarchar', 50, N'', NULL, NULL, NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (61, 18, 1, N'Tel', N'联系电话', 7, 1, 0, 3, 8, N'nvarchar', 50, N'可以填写多个座机或手机,格式不限', N'如:座机010-12345678', N'', NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (62, 18, 1, N'Address', N'联系地址', 8, 1, 1, 3, 8, N'nvarchar', 100, N'', NULL, NULL, NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (63, 18, 1, N'Quantity', N'数量', 4, 1, 1, 1, 8, N'int', 10, N'最大可交易的数量', N'数量', N'', NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (64, 18, 10, N'VerificationCode', N'验证码', 10, 1, 0, 3, 8, N'nvarchar', 10, N'', N'必填', N'', NULL, NULL)
INSERT [FormElement] ([FormID], [TemplateID], [HtmlID], [Property], [PropertyName], [Sequence], [Status], [IsNull], [VerificationID], [ControlOptionGroupID], [DataType], [MaxLength], [Description], [Placeholder], [PropertyLabel], [FocusTips], [ErrorTips]) VALUES (65, 18, 1, N'CompanyName', N'公司名称', 9, 1, 1, 3, 8, N'nvarchar', 50, N'可选,有则填写', N'', N'', NULL, NULL)
SET IDENTITY_INSERT [FormElement] OFF
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表单表自增长编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'FormID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表单元素所属指定的标单模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'TemplateID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Html表单元素编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'HtmlID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属性或字段英文名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'Property'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属性中文名称,如房产频道:面积,价格等' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'PropertyName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'某个类别范围内对字段进行排序,默认为0' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'Sequence'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属性或字段状态,1可用(默认),0隐藏或禁用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'Status'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否允许为空或必填项:0允许为空(默认值),1 必填项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'IsNull'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'验证规则表id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'VerificationID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'控件选项(数据)分组编号(只有多选,单选,下拉框有效),默认为0(不存在)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'ControlOptionGroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据类型,以数据库类型为准' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'DataType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'限制输入最大长度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'MaxLength'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,字段描述,单独一列' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'Description'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,表单占位符文本' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'Placeholder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,属性标签或描述,紧跟控件后面' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'PropertyLabel'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,获取焦点时提示信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'FocusTips'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可选,输入错误时提示信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FormElement', @level2type=N'COLUMN',@level2name=N'ErrorTips'
GO
