明树Git Lab

Commit 5d6ffe40 authored by zengfanpei's avatar zengfanpei

update

parent ac2363f0
...@@ -321,7 +321,7 @@ async function updateRole(req, res, next) { ...@@ -321,7 +321,7 @@ async function updateRole(req, res, next) {
let objButtons = dbMenus.map(o => { return o && o._id }); let objButtons = dbMenus.map(o => { return o && o._id });
obj.menus = menus; obj.menus = menus;
obj.buttons = objButtons; obj.buttons = objButtons;
let ret = await roleModule.findOneAndUpdate({ _id: req.body._id }, obj); let ret = await DB.Role.findOneAndUpdate({ _id: req.body._id }, obj);
res.sendData(ret); res.sendData(ret);
} catch (error) { } catch (error) {
next(error); next(error);
......
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const moment = require('moment');
/**
* 地块 --- 园区 ---- 乡镇(这个等级暂时不做)
*/
const AgrTaskSchema = new Schema({
name: {
type: "任务名称",
},
agrType: {
type: Number,
comment: "农事类型",
},
startTime: {
type: Date,
omment: "任务开始日期",
},
endTime: {
type: Date,
omment: "任务结束日期",
},
leader: {
type: mongoose.Types.ObjectId,
ref: 'User',
comment: "负责人--从分配负责人开始,任务就开启"
},
createdAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
updatedAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
del: {
type: Number,
default: 0,
comment: '默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
}, {
toJSON: {
getters: true
}
});
const AgrTask = mongoose.model('AgrTask', AgrTaskSchema, 'letianAgrTask');
module.exports = AgrTask;
\ No newline at end of file
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const moment = require('moment');
/**
* 种植周期
*/
const PlantCycleSchema = new Schema({
name: {
type: String,
comment: "种植周期名称",
},
startTime: {
type: Date,
},
endTime: {
type: Date,
},
createdAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
updatedAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
del: {
type: Number,
default: 0,
comment: '默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
}, {
toJSON: {
getters: true
}
});
const PlantCycle = mongoose.model('PlantCycle', PlantCycleSchema, 'letianPlantCycle');
module.exports = PlantCycle;
\ No newline at end of file
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const moment = require('moment');
/**
* 种植计划
*/
const PlantPlanSchema = new Schema({
plantVariety: {
type: mongoose.Types.ObjectId,
ref: 'PlantVariety',
comment: "作物种类"
},
planNum: {
type: String,
unique: true,
comment: "种植计划编号"
},
// zone: {
// type: mongoose.Types.ObjectId,
// ref: 'Zone',
// comment: "所属基地"
// },
land: {
type: mongoose.Types.ObjectId,
ref: 'Land',
comment: "地块"
},
plantArea: {
type: Number,
comment: "种植面积"
},
plantStatus: {
type: String,
comment: "种植状态 采收、结束种植",
},
plantiCycle: {
type: mongoose.Types.ObjectId,
ref: "PlantCycle",
comment: "种植周期",
},
createdAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
updatedAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
del: {
type: Number,
default: 0,
comment: '默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
}, {
toJSON: {
getters: true
}
});
const PlantPlan = mongoose.model('PlantPlan', PlantPlanSchema, 'letianPlantPlan');
module.exports = PlantPlan;
\ No newline at end of file
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const moment = require('moment');
/**
* 作物种类
*/
const PlantVarietySchema = new Schema({
name: {
type: String,
comment: "作物品种名称"
},
description: {
type: String,
comment: "作物介绍信息"
},
img: {
type: String,
comment: "作物图片"
},
createdAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
updatedAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
del: {
type: Number,
default: 0,
comment: '默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
}, {
toJSON: {
getters: true
}
});
const PlantVariety = mongoose.model('PlantVariety', PlantVarietySchema, 'letianPlantVariety');
module.exports = PlantVariety;
\ No newline at end of file
...@@ -13,11 +13,13 @@ const menuSchema = new Schema({ ...@@ -13,11 +13,13 @@ const menuSchema = new Schema({
// level: Number, // level: Number,
url: { url: {
type: String, type: String,
unique: true,
comment: "菜单唯一标识" comment: "菜单唯一标识"
}, },
key: { key: {
type: String, type: String,
comment: "按钮唯一标识" comment: "按钮唯一标识",
unique: true,
}, },
order: { order: {
type: Number, type: Number,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment