- 模块分组表:_ModuleGroup
- 模块表:_Module
- 菜单分组表:_MenuGroup
- 模块的菜单定义表:_MenuModule
一、数据库中建表
CREATE TABLE [dbo].[_ModuleGroup]( [tf_moduleGroupId] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_title] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_description] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_iconURL] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_remark] [nvarchar](max) COLLATE Chinese_PRC_CI_AS NULL, CONSTRAINT [PK___ModuleGroup__08EA5793] PRIMARY KEY CLUSTERED ( [tf_moduleGroupId] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY], CONSTRAINT [_ModuleGroup_ix1] UNIQUE NONCLUSTERED ( [tf_title] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY]
CREATE TABLE [dbo].[_Module]( [tf_moduleId] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_moduleGroupId] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_moduleName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_title] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_description] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_requestMapping] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_iconURL] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_shortname] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL, [tf_englishname] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL, [tf_tableName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_primaryKey] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_nameFields] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_titleTpl] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL, [tf_codeField] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_orderField] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_dateField] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_yearField] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_monthField] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_seasonField] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_fileField] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_homepageTag] [int] NULL, [tf_isEnable] [bit] NOT NULL, [tf_hasBrowse] [bit] NOT NULL, [tf_hasInsert] [bit] NOT NULL, [tf_hasEdit] [bit] NOT NULL, [tf_hasDelete] [bit] NOT NULL, [tf_hasExec] [bit] NOT NULL, [tf_hasAuditing] [bit] NOT NULL, [tf_hasApprove] [bit] NOT NULL, [tf_hasPayment] [bit] NOT NULL, [tf_hasAddition] [bit] NOT NULL, [tf_isInlineOper] [bit] NULL CONSTRAINT [DF___Module__tf_isIn__1ED998B2] DEFAULT ((0)), [tf_allowInsertExcel] [bit] NOT NULL, [tf_allowEditExcel] [bit] NOT NULL, [tf_defaultOrderField] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_codeLevel] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_linkedModule] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL, [tf_hasChart] [bit] NOT NULL, [tf_canLimit] [bit] NOT NULL, [tf_isSystem] [bit] NOT NULL, [tf_searchCondOrder] [int] NULL, [tf_remark] [nvarchar](max) COLLATE Chinese_PRC_CI_AS NULL, CONSTRAINT [PK___Module__1BFD2C07] PRIMARY KEY CLUSTERED ( [tf_moduleId] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY], CONSTRAINT [_Module_ix1] UNIQUE NONCLUSTERED ( [tf_moduleName] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY], CONSTRAINT [_Module_ix2] UNIQUE NONCLUSTERED ( [tf_title] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO USE [extjs5] GO ALTER TABLE [dbo].[_Module] WITH CHECK ADD CONSTRAINT [_Module_fk1] FOREIGN KEY([tf_moduleGroupId]) REFERENCES [dbo].[_ModuleGroup] ([tf_moduleGroupId]) ON UPDATE CASCADE
CREATE TABLE [dbo].[_MenuGroup]( [tf_menuGroupId] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_title] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_description] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_glyph] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NULL, [tf_iconURL] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_remark] [nvarchar](max) COLLATE Chinese_PRC_CI_AS NULL, [tf_expand] [bit] NULL, CONSTRAINT [PK___MenuGroup__1920BF5C] PRIMARY KEY CLUSTERED ( [tf_menuGroupId] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY], CONSTRAINT [_MenuGroup_ix1] UNIQUE NONCLUSTERED ( [tf_title] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY]
CREATE TABLE [dbo].[_MenuModule]( [tf_menuModuleId] [int] NOT NULL, [tf_menuGroupId] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_moduleId] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL, [tf_orderId] [int] NULL, [tf_addSeparator] [bit] NULL, [tf_parentMenu] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL, [tf_title] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL, [tf_parentFilter] [nvarchar](max) COLLATE Chinese_PRC_CI_AS NULL, CONSTRAINT [PK___MenuModule__2C3393D0] PRIMARY KEY CLUSTERED ( [tf_menuModuleId] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO USE [extjs5] GO ALTER TABLE [dbo].[_MenuModule] WITH CHECK ADD CONSTRAINT [_MenuModule_fk1] FOREIGN KEY([tf_menuGroupId]) REFERENCES [dbo].[_MenuGroup] ([tf_menuGroupId]) ON UPDATE CASCADE GO ALTER TABLE [dbo].[_MenuModule] WITH CHECK ADD CONSTRAINT [_MenuModule_fk2] FOREIGN KEY([tf_moduleId]) REFERENCES [dbo].[_Module] ([tf_moduleId]) ON UPDATE CASCADE
跟我一起学extjs5(28--加入模块和菜单定义[1建立数据库和表])
原文地址:http://blog.csdn.net/jfok/article/details/39610389