This commit is contained in:
张成
2026-03-24 16:07:02 +08:00
commit aa8eaa6ccd
121 changed files with 34042 additions and 0 deletions

96
api/model/sys_menu.js Normal file
View File

@@ -0,0 +1,96 @@
const Sequelize = require("sequelize");
// 菜单表
module.exports = (db) => {
return db.define("sys_menu", {
// 菜单名称
name: {
type: Sequelize.STRING(100),
allowNull: false,
defaultValue: "",
comment: "菜单名称",
},
// 父id
parent_id: {
type: Sequelize.INTEGER(11).UNSIGNED,
allowNull: true,
defaultValue: 0,
comment: "父id",
},
// 图标
icon: {
type: Sequelize.STRING(100),
allowNull: false,
defaultValue: "",
comment: "图标",
},
path: {
type: Sequelize.STRING(255),
allowNull: false,
defaultValue: "",
comment: "路径",
},
// 菜单类型 "菜单", "页面", "外链", "功能"
type: {
type: Sequelize.STRING(255),
allowNull: false,
defaultValue: "页面",
comment: "菜单类型",
},
//模型id
model_id: {
type: Sequelize.INTEGER(11).UNSIGNED,
allowNull: true,
defaultValue: 0,
comment: "模型id",
},
//表单id
form_id: {
type: Sequelize.INTEGER(11).UNSIGNED,
allowNull: true,
defaultValue: 0,
comment: "表单id",
},
// 组件地址
component: {
type: Sequelize.STRING(100),
allowNull: false,
defaultValue: "",
comment: "组件地址",
},
// api地址
api_path: {
type: Sequelize.STRING(100),
allowNull: false,
defaultValue: "",
comment: "api地址",
},
// 是否显示在菜单中
is_show_menu: {
type: Sequelize.INTEGER(1),
allowNull: false,
defaultValue: true,
comment: "是否显示在菜单中",
},
is_show: {
type: Sequelize.INTEGER(1),
allowNull: false,
defaultValue: true,
comment: "是否展示",
},
// 菜单类型
sort: {
type: Sequelize.INTEGER(11),
allowNull: false,
defaultValue: "0",
comment: "菜单类型",
},
});
};