123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- 'use strict';
- module.exports = app => {
- const DataTypes = app.Sequelize;
- const sequelize = app.model;
- const attributes = {
- accessId: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: true,
- autoIncrement: true,
- comment: "节点ID",
- field: "access_id"
- },
- accessName: {
- type: DataTypes.STRING(20),
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "节点名称",
- field: "access_name"
- },
- pid: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "上级ID",
- field: "pid"
- },
- routerPath: {
- type: DataTypes.STRING(255),
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "跳转地址",
- field: "router_path"
- },
- routerName: {
- type: DataTypes.STRING(100),
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "节点路由 对应vue路由",
- field: "router_name"
- },
- accessIcon: {
- type: DataTypes.STRING(30),
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "节点图标",
- field: "access_icon"
- },
- accessSort: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "节点排序",
- field: "access_sort"
- },
- level: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "节点等级",
- field: "level"
- },
- isNav: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "是否导航节点",
- field: "is_nav"
- },
- adminId: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "操作管理员",
- field: "admin_id"
- },
- accessStatus: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "节点状态",
- field: "access_status"
- },
- vuecomponent: {
- type: DataTypes.STRING(255),
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "加载页面",
- field: "vuecomponent"
- },
- mobileShow: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "移动端是否显示",
- field: "mobile_show"
- },
- updateTime: {
- type: DataTypes.DATE,
- allowNull: false,
- defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
- primaryKey: false,
- autoIncrement: false,
- comment: "变动时间",
- field: "update_time"
- },
- createTime: {
- type: DataTypes.DATE,
- allowNull: false,
- defaultValue: null,
- primaryKey: false,
- autoIncrement: false,
- comment: "创建时间",
- field: "create_time"
- }
- };
- const options = {
- tableName: "szj_accesss",
- comment: "",
- indexes: [{
- name: "is_nav",
- unique: false,
- type: "BTREE",
- fields: ["is_nav", "access_status"]
- }, {
- name: "mobile_show",
- unique: false,
- type: "BTREE",
- fields: ["mobile_show"]
- }]
- };
- const SzjAccesssModel = sequelize.define("szjAccesssModel", attributes, options);
- return SzjAccesssModel;
- };
|