diff --git a/pages.json b/pages.json
index ddcc79b4e034c9ba7131dad7675c33efba6560e6..0deebc0a38c6ee906e296bd0970f8e46c642be91 100644
--- a/pages.json
+++ b/pages.json
@@ -127,7 +127,8 @@
}
}, {
- "path": "pages/ucenter/edit/edit",
+ "path": "uni_modules/uni-id-users/pages/uni-id-users/edit",
+ // "path": "pages/ucenter/edit/edit",
"style": {
"navigationBarTitleText": "编辑资料"
}
diff --git a/pages/ucenter/edit/edit.vue b/pages/ucenter/edit/edit.vue
deleted file mode 100644
index e54d416f66ae31f06b2191f362a332b6e842884a..0000000000000000000000000000000000000000
--- a/pages/ucenter/edit/edit.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/ucenter/edit/uploadCutImageToUnicloud.vue b/pages/ucenter/edit/uploadCutImageToUnicloud.vue
index 839b03d6058cff09e94400ba80a4d2b579e101ce..4b6b61ce106208be14e38066eabc974e1c1214e3 100644
--- a/pages/ucenter/edit/uploadCutImageToUnicloud.vue
+++ b/pages/ucenter/edit/uploadCutImageToUnicloud.vue
@@ -17,15 +17,15 @@ export default {
},
methods:{
successFn(e){
- uni.getImageInfo({
- src:e.url,
- complete: (e) => {
- console.log(e);
- }
- })
+ // uni.getImageInfo({
+ // src:e.url,
+ // complete: (e) => {
+ // console.log(e);
+ // }
+ // })
this.uploadImgToUnicloud(e.url,(url)=>{
//console.log(url);
- uni.$emit('uploadAvatarAfter', {url});
+ this.getOpenerEventChannel().emit('uploadAvatarAfter', {url})
uni.navigateBack()
})
},
diff --git a/pages/ucenter/settings/settings.nvue b/pages/ucenter/settings/settings.nvue
index 6992458731c6b076544a3709f4a843e6e1454d57..0832405bc53daa325405094051448f8773be5f23 100644
--- a/pages/ucenter/settings/settings.nvue
+++ b/pages/ucenter/settings/settings.nvue
@@ -66,7 +66,7 @@
}),
toEdit(){
uni.navigateTo({
- url: '/pages/ucenter/edit/edit'
+ url: '/uni_modules/uni-id-users/pages/uni-id-users/edit'
});
},
changePwd(){
@@ -142,8 +142,9 @@
});
},
fail:(err)=> {
+ console.log(`认证失败:${err.errCode}`);
uni.showToast({
- title: `认证失败:${err.errCode}`,
+ title: `认证失败`,
icon: 'none'
});
}
diff --git a/uniCloud-aliyun/database/opendb-department.schema.json b/uniCloud-aliyun/database/opendb-department.schema.json
new file mode 100644
index 0000000000000000000000000000000000000000..3996e9abd0ef8d866d2aac743f5ce0e30f9df1a3
--- /dev/null
+++ b/uniCloud-aliyun/database/opendb-department.schema.json
@@ -0,0 +1,47 @@
+{
+ "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"
+ }
+ }
+ }
+}
diff --git a/uniCloud-aliyun/database/uni-id-roles.schema.json b/uniCloud-aliyun/database/uni-id-roles.schema.json
new file mode 100644
index 0000000000000000000000000000000000000000..c07ebf76671009b3489c51e2e2d92f044a2bba4b
--- /dev/null
+++ b/uniCloud-aliyun/database/uni-id-roles.schema.json
@@ -0,0 +1,46 @@
+{
+ "bsonType": "object",
+ "required": ["role_id"],
+ "permission": {
+ "read": false,
+ "create": false,
+ "update": false,
+ "delete": false
+ },
+ "properties": {
+ "_id": {
+ "description": "存储文档 ID,系统自动生成"
+ },
+ "role_id": {
+ "title": "唯一ID",
+ "bsonType": "string",
+ "description": "角色唯一标识,不可修改,不允许重复",
+ "trim": "both"
+ },
+ "role_name": {
+ "title": "名称",
+ "bsonType": "string",
+ "description": "角色名称",
+ "trim": "both"
+ },
+ "permission": {
+ "title": "权限",
+ "bsonType": "array",
+ "foreignKey": "uni-id-permissions.permission_id",
+ "description": "角色拥有的权限列表"
+ },
+ "comment": {
+ "title": "备注",
+ "bsonType": "string",
+ "description": "备注",
+ "trim": "both"
+ },
+ "create_date": {
+ "bsonType": "timestamp",
+ "description": "创建时间",
+ "forceDefaultValue": {
+ "$env": "now"
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-data-picker/changelog.md b/uni_modules/uni-data-picker/changelog.md
index 8ad6f35bc8c56e84b4b04af637302e6ef8040d2b..78243da877fb9cf8032380c9e1b82926a92da8c7 100644
--- a/uni_modules/uni-data-picker/changelog.md
+++ b/uni_modules/uni-data-picker/changelog.md
@@ -1,3 +1,8 @@
+## 0.3.1(2021-04-15)
+- 修复 本地数据概率无法回显时问题
+## 0.3.0(2021-04-07)
+- 新增 支持云端非树形表结构数据
+- 修复 根节点 parent_field 字段等于null时选择界面错乱问题
## 0.2.0(2021-03-15)
- 修复 nodeclick、popupopened、popupclosed事件无法触发的问题
## 0.1.9(2021-03-09)
diff --git a/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue b/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
index a3bd82182d39cda5a5c61efa5d29e29afcef7015..b6f730f2d0d0cb5fdf28d73d65cf755d53f9b5cc 100644
--- a/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
+++ b/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
@@ -1,462 +1,466 @@
-
-
-
-
-
- {{errorMessage}}
-
-
-
-
-
-
- {{item.text}}{{split}}
-
-
-
- {{placeholder}}
-
-
-
-
-
-
-
-
-
-
- {{popupTitle}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
index af69e741ae0172cac3e179096178ee9d1e93bd8b..84b51f3344366987d6b9bca6792477161b2ce894 100644
--- a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
+++ b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js
@@ -105,7 +105,11 @@ export default {
return this.localdata.length > 0
},
postField() {
- return `${this.field}, ${this.parentField} as parent_value`
+ let fields = [this.field];
+ if (this.parentField) {
+ fields.push(`${this.parentField} as parent_value`);
+ }
+ return fields.join(',');
}
},
created() {
@@ -192,6 +196,23 @@ export default {
return db
},
+ getNodeData(callback) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+ this.getCommand({
+ field: this.postField,
+ where: this._pathWhere()
+ }).then((res) => {
+ this.loading = false
+ this.selected = res.result.data
+ callback && callback()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
getTreePath(callback) {
if (this.loading) {
return
@@ -280,13 +301,29 @@ export default {
this.errorMessage = err
})
},
+ _pathWhere() {
+ let result = []
+ let where_field = this._getParentNameByField();
+ if (where_field) {
+ result.push(`${where_field} == '${this.value}'`)
+ }
+
+ if (this.where) {
+ return `(${this.where}) && (${result.join(' || ')})`
+ }
+
+ return result.join(' || ')
+ },
_postWhere() {
let result = []
let selected = this.selected
- result.push(`${this.parentField} == null`)
+ let parentField = this.parentField
+ if (parentField) {
+ result.push(`${parentField} == null || ${parentField} == ""`)
+ }
if (selected.length) {
for (var i = 0; i < selected.length - 1; i++) {
- result.push(`${this.parentField} == '${selected[i].value}'`)
+ result.push(`${parentField} == '${selected[i].value}'`)
}
}
@@ -309,6 +346,24 @@ export default {
return result.join(' || ')
},
+ _getParentNameByField() {
+ const fields = this.field.split(',');
+ let where_field = null;
+ for (let i = 0; i < fields.length; i++) {
+ const items = fields[i].split('as');
+ if (items.length < 2) {
+ continue;
+ }
+ if (items[1].trim() === 'value') {
+ where_field = items[0].trim();
+ break;
+ }
+ }
+ return where_field
+ },
+ _isTreeView() {
+ return (this.parentField && this.selfField)
+ },
_updateSelected() {
var dl = this.dataList
var sl = this.selected
@@ -388,7 +443,7 @@ export default {
child[key] = node[key]
}
}
- if (parent_value !== null) {
+ if (parent_value !== undefined) {
child.parent_value = parent_value
}
result.push(child)
diff --git a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
index 80075ac59bfcd0beac42bd3da19cde171e6d4314..ad0c275ae36c4475e00c6d4f3bc9de06d222a817 100644
--- a/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
+++ b/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
@@ -110,6 +110,11 @@
hasNodes
} = this._updateBindData()
+ if (!this._isTreeView()) {
+ this.onSelectedChange(node, true)
+ return
+ }
+
if (this.isLocaldata && (!hasNodes || isleaf)) {
this.onSelectedChange(node, true)
return
diff --git a/uni_modules/uni-data-picker/package.json b/uni_modules/uni-data-picker/package.json
index 72cd4ce06afc80f196e6e098dda0589c9e380afb..ece35f4c959d95001608eb60daf20792d715111d 100644
--- a/uni_modules/uni-data-picker/package.json
+++ b/uni_modules/uni-data-picker/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-data-picker",
"displayName": "DataPicker 数据驱动的picker选择器",
- "version": "0.2.0",
+ "version": "0.3.1",
"description": "Picker选择器",
"keywords": [
"",
diff --git a/uni_modules/uni-data-picker/readme.md b/uni_modules/uni-data-picker/readme.md
index 350f5a53214ccff9a4b4f4868d7dd1e1f250aac1..9c64fe9680b5a80c4edd46c3821e2d59fff29a0b 100644
--- a/uni_modules/uni-data-picker/readme.md
+++ b/uni_modules/uni-data-picker/readme.md
@@ -1,4 +1,5 @@
## DataPicker 级联选择
+> **组件名:uni-data-picker**
> 代码块: `uDataPicker`
> 关联组件:`uni-data-pickerview`、`uni-load-more`。
@@ -18,6 +19,7 @@
在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。
+> **注意事项**
> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
> - 组件需要依赖 `sass` 插件 ,请自行手动安装
> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
@@ -50,11 +52,12 @@
|parent-field |String | | |分步查询时父字段名称|
|collection |String | | |表名。支持输入多个表名,用 `,` 分割|
|field |String | | |查询字段,多个字段用 `,` 分割|
-|where |String | | |查询条件,内容较多,另见jql文档:[详情](https://uniapp.dcloud.net.cn/uniCloud/unicloud-db?id=jsquery)|
+|where |String | | |查询条件,内容较多,另见jql文档:[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-clientDB?id=jsquery)|
|orderby |String | | |排序字段及正序倒叙设置|
|popup-title |String | | |弹出层标题|
+> ****
> `collection/where/orderby` 和 `` 的用法一致,[详情](https://uniapp.dcloud.net.cn/uniCloud/unicloud-db)
@@ -75,6 +78,7 @@
#### 云端数据
+> **注意事项**
> - 云端数据需要关联服务空间
> - 下面示例中使用的表 `opendb-city-china`(中国城市省市区数据,含港澳台), 在[uniCloud控制台](https://unicloud.dcloud.net.cn/)使用opendb创建,[详情](https://gitee.com/dcloud/opendb)
@@ -82,12 +86,14 @@
```html
-
+```
+```js
+
+
diff --git a/uni_modules/uni-id-roles/pages/uni-id-roles/detail.vue b/uni_modules/uni-id-roles/pages/uni-id-roles/detail.vue
new file mode 100644
index 0000000000000000000000000000000000000000..1252ff120ef61747397c906c7f4b025103464021
--- /dev/null
+++ b/uni_modules/uni-id-roles/pages/uni-id-roles/detail.vue
@@ -0,0 +1,135 @@
+
+
+
+ {{error.message}}
+
+
+
+
+
+
+ 唯一ID:
+
+
+ {{data.role_id}}
+
+
+
+
+
+ 名称:
+
+
+ {{data.role_name}}
+
+
+
+
+
+ 权限:
+
+
+ {{data.permission}}
+
+
+
+
+
+ 备注:
+
+
+ {{data.comment}}
+
+
+
+
+
+ create_date:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-id-roles/pages/uni-id-roles/edit.vue b/uni_modules/uni-id-roles/pages/uni-id-roles/edit.vue
new file mode 100644
index 0000000000000000000000000000000000000000..d3cc314f799814766bac025eee33713762ddc005
--- /dev/null
+++ b/uni_modules/uni-id-roles/pages/uni-id-roles/edit.vue
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-id-roles/pages/uni-id-roles/list.vue b/uni_modules/uni-id-roles/pages/uni-id-roles/list.vue
new file mode 100644
index 0000000000000000000000000000000000000000..bd6a36579e659fa6fe189f991e24bf47eb987806
--- /dev/null
+++ b/uni_modules/uni-id-roles/pages/uni-id-roles/list.vue
@@ -0,0 +1,67 @@
+
+
+
+ {{error.message}}
+
+
+
+
+
+ {{item._id}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-id-users/js_sdk/validator/uni-id-users.js b/uni_modules/uni-id-users/js_sdk/validator/uni-id-users.js
new file mode 100644
index 0000000000000000000000000000000000000000..ae8b1e3ba56cf59630fadefa4af63410ee1b1a6c
--- /dev/null
+++ b/uni_modules/uni-id-users/js_sdk/validator/uni-id-users.js
@@ -0,0 +1,73 @@
+// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema
+
+
+
+const validator = {
+ "avatar": {
+ "rules": [{
+ "format": "string"
+ }],
+ "label": "头像地址"
+ },
+ "gender": {
+ "rules": [{
+ "format": "int"
+ },
+ {
+ "range": [{
+ "text": "未知",
+ "value": 0
+ },
+ {
+ "text": "男",
+ "value": 1
+ },
+ {
+ "text": "女",
+ "value": 2
+ }
+ ]
+ }
+ ],
+ "defaultValue": 0,
+ "label": "性别"
+ },
+ "mobile": {
+ "rules": [{
+ "format": "string"
+ },
+ {
+ "pattern": "^\\+?[0-9-]{3,20}$"
+ }
+ ],
+ "label": "手机号码"
+ },
+ "nickname": {
+ "rules": [{
+
+ required: true,
+ errorMessage: '请输入昵称',
+
+ },
+ {
+ minLength: 3,
+ maxLength: 10,
+ errorMessage: '昵称长度在 {minLength} 到 {maxLength} 个字符',
+ }
+ ],
+ "label": "昵称"
+ }
+}
+
+const enumConverter = {
+ "gender_valuetotext": {
+ "0": "未知",
+ "1": "男",
+ "2": "女"
+ }
+}
+
+export {
+ validator,
+ enumConverter
+}
diff --git a/uni_modules/uni-id-users/package.json b/uni_modules/uni-id-users/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..11a384f51029595a28cacc946eac043442eb69f9
--- /dev/null
+++ b/uni_modules/uni-id-users/package.json
@@ -0,0 +1,91 @@
+{
+ "id": "uni-id-users",
+ "displayName": "uni-id-users",
+ "version": "1.0.0",
+ "description": "",
+ "keywords": [
+ "uni-id-users"
+ ],
+ "repository": "",
+ "engines": {
+ "HBuilderX": "^3.1.0"
+ },
+ "dcloudext": {
+ "category": [
+ "uniCloud",
+ "Admin插件"
+ ],
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": ""
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-dateformat",
+ "uni-badge",
+ "uni-icons",
+ "uni-load-more",
+ "uni-link",
+ "uni-forms",
+ "uni-group",
+ "uni-list",
+ "uni-fab",
+ "uni-datetime-picker",
+ "uni-data-picker",
+ "uni-file-picker",
+ "uni-easyinput",
+ "uni-data-checkbox"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "u"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "u",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "y",
+ "百度": "y",
+ "字节跳动": "y",
+ "QQ": "y"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/uni-id-users/pages/uni-id-users/add.vue b/uni_modules/uni-id-users/pages/uni-id-users/add.vue
new file mode 100644
index 0000000000000000000000000000000000000000..1f4fa2171c7e63657dfc7a4dad874b8fc45b14c5
--- /dev/null
+++ b/uni_modules/uni-id-users/pages/uni-id-users/add.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-id-users/pages/uni-id-users/detail.vue b/uni_modules/uni-id-users/pages/uni-id-users/detail.vue
new file mode 100644
index 0000000000000000000000000000000000000000..9b73b37987cbd2b092a657a421a538ade7c04d5e
--- /dev/null
+++ b/uni_modules/uni-id-users/pages/uni-id-users/detail.vue
@@ -0,0 +1,131 @@
+
+
+
+ {{error.message}}
+
+
+
+
+
+
+ 头像地址:
+
+
+ {{data.avatar}}
+
+
+
+
+
+ 性别:
+
+
+
+ {{options.gender_valuetotext[data.gender]}}
+
+
+
+
+
+
+ 手机号码:
+
+
+ {{data.mobile}}
+
+
+
+
+
+ 昵称:
+
+
+ {{data.nickname}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-id-users/pages/uni-id-users/edit.vue b/uni_modules/uni-id-users/pages/uni-id-users/edit.vue
new file mode 100644
index 0000000000000000000000000000000000000000..11fe6bc1191e04541834f31f71d39d2207bc6a9c
--- /dev/null
+++ b/uni_modules/uni-id-users/pages/uni-id-users/edit.vue
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-id-users/pages/uni-id-users/list.vue b/uni_modules/uni-id-users/pages/uni-id-users/list.vue
new file mode 100644
index 0000000000000000000000000000000000000000..c856f2266d139b9617744b63b1077bf1d5b05067
--- /dev/null
+++ b/uni_modules/uni-id-users/pages/uni-id-users/list.vue
@@ -0,0 +1,67 @@
+
+
+
+ {{error.message}}
+
+
+
+
+
+ {{item._id}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
index f5d744a79f4f21aae60c1bd9a9345191b7d23d8a..7f1eced06f74880838557eaf162f6cc295d9a3ac 100644
--- a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
+++ b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue
@@ -370,7 +370,7 @@ $list-item-pd: $uni-spacing-col-lg $uni-spacing-row-lg;
/* #endif */
height: $uni-img-size-base;
width: $uni-img-size-base;
- margin-right: 10px;
+ marin-right: 10px;
}
.uni-icon-wrapper {