提交 0658cba9 编写于 作者: DCloud_JSON's avatar DCloud_JSON

department 表改用 opendb-department

上级 f5f035fe
......@@ -348,7 +348,7 @@
uni.showLoading({
mask: true
});
db.collection("department").get({
db.collection("opendb-department").get({
getTree: {
limitLevel: 10, // 最大查询层级(不包含当前层级),可以省略默认10级,最大15,最小1
// startWith: "parent_code==''" // 第一层级条件,此初始条件可以省略,不传startWith时默认从最顶级开始查询
......
......@@ -3,7 +3,7 @@
// 编写完毕后对本文件点右键,可按配置规则创建表和添加数据
{
"department": {
"opendb-department": {
"data": [{
"_id": "5fe77207974b6900018c6c9c",
"name": "总部",
......
{
"bsonType": "object",
"required": ["name"],
"permission":{
"read":true
},
"properties": {
"_id": {
"description": "ID,系统自动生成"
},
"name": {
"bsonType": "string",
"description": "名称"
},
"parent_id": {
"bsonType": "string",
"description": "父id",
"parentKey": "_id" // 指定父子关系为:如果数据库记录A的_id和数据库记录B的parent_id相等,则A是B的父级。
},
"status": {
"bsonType": "int",
"description": "部门状态,0-正常、1-禁用"
}
}
}
{
"bsonType": "object",
"required": ["name"],
"permission": {
"read": true,
"create": false,
"update": false,
"delete": false
},
"properties": {
"_id": {
"description": "ID,系统自动生成"
},
"parent_id": {
"bsonType": "string",
"description": "父级部门ID",
"parentKey": "_id"
},
"name": {
"bsonType": "string",
"description": "部门名称",
"title": "部门名称",
"trim": "both"
},
"level": {
"bsonType": "int",
"description": "部门层级,为提升检索效率而作的冗余设计"
},
"sort": {
"bsonType": "int",
"description": "部门在当前层级下的顺序,由小到大",
"title": "显示顺序"
},
"manager_uid": {
"bsonType": "string",
"description": "部门主管的userid, 参考`uni-id-users` 表",
"foreignKey": "uni-id-users._id"
},
"create_date": {
"bsonType": "timestamp",
"description": "部门创建时间",
"forceDefaultValue": {
"$env": "now"
}
},
"status": {
"bsonType": "int",
"description": "部门状态,0-正常、1-禁用"
}
},
"version": "0.1.0"
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册