diff --git a/uni_modules/uni-calendar/changelog.md b/uni_modules/uni-calendar/changelog.md
index 454f13d38cbb666310b799fa6aeec20748706b92..0160b692f4e0aaffad8a52ddb4f3b84120d189f4 100644
--- a/uni_modules/uni-calendar/changelog.md
+++ b/uni_modules/uni-calendar/changelog.md
@@ -1,3 +1,11 @@
+## 1.4.7(2022-09-16)
+- 可以使用 uni-scss 控制主题色
+## 1.4.6(2022-09-08)
+- fix: 表头年月切换,导致改变当前日期为选择月1号,且未触发change事件
+## 1.4.5(2022-02-25)
+- 修复 条件编译 nvue 不支持的 css 样式
+## 1.4.4(2022-02-25)
+- 修复 条件编译 nvue 不支持的 css 样式
## 1.4.3(2021-09-22)
- 修复 startDate、 endDate 属性失效的 bug
## 1.4.2(2021-08-24)
diff --git a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
index cd5863d5c92f5b447ed38e1abbbf983d711bb39f..d29ead547191049076a0afe510538c42a8de2cf2 100644
--- a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
+++ b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
@@ -96,6 +96,13 @@
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 555d2c5ce3619278c62831f5cbe51b82451b7555..c12fd54b3a76a218c743f16eea3be583d7a64994 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
@@ -1,563 +1,563 @@
-export default {
- props: {
- localdata: {
- type: [Array, Object],
- default () {
- return []
- }
- },
- spaceInfo: {
- type: Object,
- default () {
- return {}
- }
- },
- collection: {
- type: String,
- default: ''
- },
- action: {
- type: String,
- default: ''
- },
- field: {
- type: String,
- default: ''
- },
- orderby: {
- type: String,
- default: ''
- },
- where: {
- type: [String, Object],
- default: ''
- },
- pageData: {
- type: String,
- default: 'add'
- },
- pageCurrent: {
- type: Number,
- default: 1
- },
- pageSize: {
- type: Number,
- default: 20
- },
- getcount: {
- type: [Boolean, String],
- default: false
- },
- getone: {
- type: [Boolean, String],
- default: false
- },
- gettree: {
- type: [Boolean, String],
- default: false
- },
- manual: {
- type: Boolean,
- default: false
- },
- value: {
- type: [Array, String, Number],
- default () {
- return []
- }
- },
- modelValue: {
- type: [Array, String, Number],
- default () {
- return []
- }
- },
- preload: {
- type: Boolean,
- default: false
- },
- stepSearh: {
- type: Boolean,
- default: true
- },
- selfField: {
- type: String,
- default: ''
- },
- parentField: {
- type: String,
- default: ''
- },
- multiple: {
- type: Boolean,
- default: false
- },
- map: {
- type: Object,
- default() {
- return {
- text: "text",
- value: "value"
- }
- }
- }
- },
- data() {
- return {
- loading: false,
- errorMessage: '',
- loadMore: {
- contentdown: '',
- contentrefresh: '',
- contentnomore: ''
- },
- dataList: [],
- selected: [],
- selectedIndex: 0,
- page: {
- current: this.pageCurrent,
- size: this.pageSize,
- count: 0
- }
- }
- },
- computed: {
- isLocaldata() {
- return !this.collection.length
- },
- postField() {
- let fields = [this.field];
- if (this.parentField) {
- fields.push(`${this.parentField} as parent_value`);
- }
- return fields.join(',');
- },
- dataValue() {
- let isModelValue = Array.isArray(this.modelValue) ? (this.modelValue.length > 0) : (this.modelValue !== null || this.modelValue !== undefined)
- return isModelValue ? this.modelValue : this.value
- },
- hasValue() {
- if (typeof this.dataValue === 'number') {
- return true
- }
- return (this.dataValue != null) && (this.dataValue.length > 0)
- }
- },
- created() {
- this.$watch(() => {
- var al = [];
- ['pageCurrent',
- 'pageSize',
- 'spaceInfo',
- 'value',
- 'modelValue',
- 'localdata',
- 'collection',
- 'action',
- 'field',
- 'orderby',
- 'where',
- 'getont',
- 'getcount',
- 'gettree'
- ].forEach(key => {
- al.push(this[key])
- });
- return al
- }, (newValue, oldValue) => {
- let needReset = false
- for (let i = 2; i < newValue.length; i++) {
- if (newValue[i] != oldValue[i]) {
- needReset = true
- break
- }
- }
- if (newValue[0] != oldValue[0]) {
- this.page.current = this.pageCurrent
- }
- this.page.size = this.pageSize
-
- this.onPropsChange()
- })
- this._treeData = []
- },
- methods: {
- onPropsChange() {
- this._treeData = []
- },
- getCommand(options = {}) {
- /* eslint-disable no-undef */
- let db = uniCloud.database(this.spaceInfo)
-
- const action = options.action || this.action
- if (action) {
- db = db.action(action)
- }
-
- const collection = options.collection || this.collection
- db = db.collection(collection)
-
- const where = options.where || this.where
- if (!(!where || !Object.keys(where).length)) {
- db = db.where(where)
- }
-
- const field = options.field || this.field
- if (field) {
- db = db.field(field)
- }
-
- const orderby = options.orderby || this.orderby
- if (orderby) {
- db = db.orderBy(orderby)
- }
-
- const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current
- const size = options.pageSize !== undefined ? options.pageSize : this.page.size
- const getCount = options.getcount !== undefined ? options.getcount : this.getcount
- const getTree = options.gettree !== undefined ? options.gettree : this.gettree
-
- const getOptions = {
- getCount,
- getTree
- }
- if (options.getTreePath) {
- getOptions.getTreePath = options.getTreePath
- }
-
- db = db.skip(size * (current - 1)).limit(size).get(getOptions)
-
- 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
- }
- this.loading = true
-
- this.getCommand({
- field: this.postField,
- getTreePath: {
- startWith: `${this.selfField}=='${this.dataValue}'`
- }
- }).then((res) => {
- this.loading = false
- let treePath = []
- this._extractTreePath(res.result.data, treePath)
- this.selected = treePath
- callback && callback()
- }).catch((err) => {
- this.loading = false
- this.errorMessage = err
- })
- },
- loadData() {
- if (this.isLocaldata) {
- this._processLocalData()
- return
- }
-
- if (this.dataValue != null) {
- this._loadNodeData((data) => {
- this._treeData = data
- this._updateBindData()
- this._updateSelected()
- })
- return
- }
-
- if (this.stepSearh) {
- this._loadNodeData((data) => {
- this._treeData = data
- this._updateBindData()
- })
- } else {
- this._loadAllData((data) => {
- this._treeData = []
- this._extractTree(data, this._treeData, null)
- this._updateBindData()
- })
- }
- },
- _loadAllData(callback) {
- if (this.loading) {
- return
- }
- this.loading = true
-
- this.getCommand({
- field: this.postField,
- gettree: true,
- startwith: `${this.selfField}=='${this.dataValue}'`
- }).then((res) => {
- this.loading = false
- callback(res.result.data)
- this.onDataChange()
- }).catch((err) => {
- this.loading = false
- this.errorMessage = err
- })
- },
- _loadNodeData(callback, pw) {
- if (this.loading) {
- return
- }
- this.loading = true
-
- this.getCommand({
- field: this.postField,
- where: pw || this._postWhere(),
- pageSize: 500
- }).then((res) => {
- this.loading = false
- callback(res.result.data)
- this.onDataChange()
- }).catch((err) => {
- this.loading = false
- this.errorMessage = err
- })
- },
- _pathWhere() {
- let result = []
- let where_field = this._getParentNameByField();
- if (where_field) {
- result.push(`${where_field} == '${this.dataValue}'`)
- }
-
- if (this.where) {
- return `(${this.where}) && (${result.join(' || ')})`
- }
-
- return result.join(' || ')
- },
- _postWhere() {
- let result = []
- let selected = this.selected
- 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(`${parentField} == '${selected[i].value}'`)
- }
- }
-
- let where = []
- if (this.where) {
- where.push(`(${this.where})`)
- }
- if (result.length) {
- where.push(`(${result.join(' || ')})`)
- }
-
- return where.join(' && ')
- },
- _nodeWhere() {
- let result = []
- let selected = this.selected
- if (selected.length) {
- result.push(`${this.parentField} == '${selected[selected.length - 1].value}'`)
- }
-
- if (this.where) {
- return `(${this.where}) && (${result.join(' || ')})`
- }
-
- 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
- let textField = this.map.text
- let valueField = this.map.value
- for (var i = 0; i < sl.length; i++) {
- var value = sl[i].value
- var dl2 = dl[i]
- for (var j = 0; j < dl2.length; j++) {
- var item2 = dl2[j]
- if (item2[valueField] === value) {
- sl[i].text = item2[textField]
- break
- }
- }
- }
- },
- _updateBindData(node) {
- const {
- dataList,
- hasNodes
- } = this._filterData(this._treeData, this.selected)
-
- let isleaf = this._stepSearh === false && !hasNodes
-
- if (node) {
- node.isleaf = isleaf
- }
-
- this.dataList = dataList
- this.selectedIndex = dataList.length - 1
-
- if (!isleaf && this.selected.length < dataList.length) {
- this.selected.push({
- value: null,
- text: "请选择"
- })
- }
-
- return {
- isleaf,
- hasNodes
- }
- },
- _filterData(data, paths) {
- let dataList = []
- let hasNodes = true
-
- dataList.push(data.filter((item) => {
- return (item.parent_value === null || item.parent_value === undefined || item.parent_value === '')
- }))
- for (let i = 0; i < paths.length; i++) {
- var value = paths[i].value
- var nodes = data.filter((item) => {
- return item.parent_value === value
- })
-
- if (nodes.length) {
- dataList.push(nodes)
- } else {
- hasNodes = false
- }
- }
-
- return {
- dataList,
- hasNodes
- }
- },
- _extractTree(nodes, result, parent_value) {
- let list = result || []
- let valueField = this.map.value
- for (let i = 0; i < nodes.length; i++) {
- let node = nodes[i]
-
- let child = {}
- for (let key in node) {
- if (key !== 'children') {
- child[key] = node[key]
- }
- }
- if (parent_value !== null && parent_value !== undefined && parent_value !== '') {
- child.parent_value = parent_value
- }
- result.push(child)
-
- let children = node.children
- if (children) {
- this._extractTree(children, result, node[valueField])
- }
- }
- },
- _extractTreePath(nodes, result) {
- let list = result || []
- for (let i = 0; i < nodes.length; i++) {
- let node = nodes[i]
-
- let child = {}
- for (let key in node) {
- if (key !== 'children') {
- child[key] = node[key]
- }
- }
- result.push(child)
-
- let children = node.children
- if (children) {
- this._extractTreePath(children, result)
- }
- }
- },
- _findNodePath(key, nodes, path = []) {
- let textField = this.map.text
- let valueField = this.map.value
- for (let i = 0; i < nodes.length; i++) {
- let node = nodes[i]
- let children = node.children
- let text = node[textField]
- let value = node[valueField]
-
- path.push({
- value,
- text
- })
-
- if (value === key) {
- return path
- }
-
- if (children) {
- const p = this._findNodePath(key, children, path)
- if (p.length) {
- return p
- }
- }
-
- path.pop()
- }
- return []
- },
- _processLocalData() {
- this._treeData = []
- this._extractTree(this.localdata, this._treeData)
-
- var inputValue = this.dataValue
- if (inputValue === undefined) {
- return
- }
-
- if (Array.isArray(inputValue)) {
- inputValue = inputValue[inputValue.length - 1]
- if (typeof inputValue === 'object' && inputValue[this.map.value]) {
- inputValue = inputValue[this.map.value]
- }
- }
-
- this.selected = this._findNodePath(inputValue, this.localdata)
- }
- }
-}
+export default {
+ props: {
+ localdata: {
+ type: [Array, Object],
+ default () {
+ return []
+ }
+ },
+ spaceInfo: {
+ type: Object,
+ default () {
+ return {}
+ }
+ },
+ collection: {
+ type: String,
+ default: ''
+ },
+ action: {
+ type: String,
+ default: ''
+ },
+ field: {
+ type: String,
+ default: ''
+ },
+ orderby: {
+ type: String,
+ default: ''
+ },
+ where: {
+ type: [String, Object],
+ default: ''
+ },
+ pageData: {
+ type: String,
+ default: 'add'
+ },
+ pageCurrent: {
+ type: Number,
+ default: 1
+ },
+ pageSize: {
+ type: Number,
+ default: 20
+ },
+ getcount: {
+ type: [Boolean, String],
+ default: false
+ },
+ getone: {
+ type: [Boolean, String],
+ default: false
+ },
+ gettree: {
+ type: [Boolean, String],
+ default: false
+ },
+ manual: {
+ type: Boolean,
+ default: false
+ },
+ value: {
+ type: [Array, String, Number],
+ default () {
+ return []
+ }
+ },
+ modelValue: {
+ type: [Array, String, Number],
+ default () {
+ return []
+ }
+ },
+ preload: {
+ type: Boolean,
+ default: false
+ },
+ stepSearh: {
+ type: Boolean,
+ default: true
+ },
+ selfField: {
+ type: String,
+ default: ''
+ },
+ parentField: {
+ type: String,
+ default: ''
+ },
+ multiple: {
+ type: Boolean,
+ default: false
+ },
+ map: {
+ type: Object,
+ default() {
+ return {
+ text: "text",
+ value: "value"
+ }
+ }
+ }
+ },
+ data() {
+ return {
+ loading: false,
+ errorMessage: '',
+ loadMore: {
+ contentdown: '',
+ contentrefresh: '',
+ contentnomore: ''
+ },
+ dataList: [],
+ selected: [],
+ selectedIndex: 0,
+ page: {
+ current: this.pageCurrent,
+ size: this.pageSize,
+ count: 0
+ }
+ }
+ },
+ computed: {
+ isLocaldata() {
+ return !this.collection.length
+ },
+ postField() {
+ let fields = [this.field];
+ if (this.parentField) {
+ fields.push(`${this.parentField} as parent_value`);
+ }
+ return fields.join(',');
+ },
+ dataValue() {
+ let isModelValue = Array.isArray(this.modelValue) ? (this.modelValue.length > 0) : (this.modelValue !== null || this.modelValue !== undefined)
+ return isModelValue ? this.modelValue : this.value
+ },
+ hasValue() {
+ if (typeof this.dataValue === 'number') {
+ return true
+ }
+ return (this.dataValue != null) && (this.dataValue.length > 0)
+ }
+ },
+ created() {
+ this.$watch(() => {
+ var al = [];
+ ['pageCurrent',
+ 'pageSize',
+ 'spaceInfo',
+ 'value',
+ 'modelValue',
+ 'localdata',
+ 'collection',
+ 'action',
+ 'field',
+ 'orderby',
+ 'where',
+ 'getont',
+ 'getcount',
+ 'gettree'
+ ].forEach(key => {
+ al.push(this[key])
+ });
+ return al
+ }, (newValue, oldValue) => {
+ let needReset = false
+ for (let i = 2; i < newValue.length; i++) {
+ if (newValue[i] != oldValue[i]) {
+ needReset = true
+ break
+ }
+ }
+ if (newValue[0] != oldValue[0]) {
+ this.page.current = this.pageCurrent
+ }
+ this.page.size = this.pageSize
+
+ this.onPropsChange()
+ })
+ this._treeData = []
+ },
+ methods: {
+ onPropsChange() {
+ this._treeData = []
+ },
+ getCommand(options = {}) {
+ /* eslint-disable no-undef */
+ let db = uniCloud.database(this.spaceInfo)
+
+ const action = options.action || this.action
+ if (action) {
+ db = db.action(action)
+ }
+
+ const collection = options.collection || this.collection
+ db = db.collection(collection)
+
+ const where = options.where || this.where
+ if (!(!where || !Object.keys(where).length)) {
+ db = db.where(where)
+ }
+
+ const field = options.field || this.field
+ if (field) {
+ db = db.field(field)
+ }
+
+ const orderby = options.orderby || this.orderby
+ if (orderby) {
+ db = db.orderBy(orderby)
+ }
+
+ const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current
+ const size = options.pageSize !== undefined ? options.pageSize : this.page.size
+ const getCount = options.getcount !== undefined ? options.getcount : this.getcount
+ const getTree = options.gettree !== undefined ? options.gettree : this.gettree
+
+ const getOptions = {
+ getCount,
+ getTree
+ }
+ if (options.getTreePath) {
+ getOptions.getTreePath = options.getTreePath
+ }
+
+ db = db.skip(size * (current - 1)).limit(size).get(getOptions)
+
+ 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
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ getTreePath: {
+ startWith: `${this.selfField}=='${this.dataValue}'`
+ }
+ }).then((res) => {
+ this.loading = false
+ let treePath = []
+ this._extractTreePath(res.result.data, treePath)
+ this.selected = treePath
+ callback && callback()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ loadData() {
+ if (this.isLocaldata) {
+ this._processLocalData()
+ return
+ }
+
+ if (this.dataValue != null) {
+ this._loadNodeData((data) => {
+ this._treeData = data
+ this._updateBindData()
+ this._updateSelected()
+ })
+ return
+ }
+
+ if (this.stepSearh) {
+ this._loadNodeData((data) => {
+ this._treeData = data
+ this._updateBindData()
+ })
+ } else {
+ this._loadAllData((data) => {
+ this._treeData = []
+ this._extractTree(data, this._treeData, null)
+ this._updateBindData()
+ })
+ }
+ },
+ _loadAllData(callback) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ gettree: true,
+ startwith: `${this.selfField}=='${this.dataValue}'`
+ }).then((res) => {
+ this.loading = false
+ callback(res.result.data)
+ this.onDataChange()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ _loadNodeData(callback, pw) {
+ if (this.loading) {
+ return
+ }
+ this.loading = true
+
+ this.getCommand({
+ field: this.postField,
+ where: pw || this._postWhere(),
+ pageSize: 500
+ }).then((res) => {
+ this.loading = false
+ callback(res.result.data)
+ this.onDataChange()
+ }).catch((err) => {
+ this.loading = false
+ this.errorMessage = err
+ })
+ },
+ _pathWhere() {
+ let result = []
+ let where_field = this._getParentNameByField();
+ if (where_field) {
+ result.push(`${where_field} == '${this.dataValue}'`)
+ }
+
+ if (this.where) {
+ return `(${this.where}) && (${result.join(' || ')})`
+ }
+
+ return result.join(' || ')
+ },
+ _postWhere() {
+ let result = []
+ let selected = this.selected
+ 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(`${parentField} == '${selected[i].value}'`)
+ }
+ }
+
+ let where = []
+ if (this.where) {
+ where.push(`(${this.where})`)
+ }
+ if (result.length) {
+ where.push(`(${result.join(' || ')})`)
+ }
+
+ return where.join(' && ')
+ },
+ _nodeWhere() {
+ let result = []
+ let selected = this.selected
+ if (selected.length) {
+ result.push(`${this.parentField} == '${selected[selected.length - 1].value}'`)
+ }
+
+ if (this.where) {
+ return `(${this.where}) && (${result.join(' || ')})`
+ }
+
+ 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
+ let textField = this.map.text
+ let valueField = this.map.value
+ for (var i = 0; i < sl.length; i++) {
+ var value = sl[i].value
+ var dl2 = dl[i]
+ for (var j = 0; j < dl2.length; j++) {
+ var item2 = dl2[j]
+ if (item2[valueField] === value) {
+ sl[i].text = item2[textField]
+ break
+ }
+ }
+ }
+ },
+ _updateBindData(node) {
+ const {
+ dataList,
+ hasNodes
+ } = this._filterData(this._treeData, this.selected)
+
+ let isleaf = this._stepSearh === false && !hasNodes
+
+ if (node) {
+ node.isleaf = isleaf
+ }
+
+ this.dataList = dataList
+ this.selectedIndex = dataList.length - 1
+
+ if (!isleaf && this.selected.length < dataList.length) {
+ this.selected.push({
+ value: null,
+ text: "请选择"
+ })
+ }
+
+ return {
+ isleaf,
+ hasNodes
+ }
+ },
+ _filterData(data, paths) {
+ let dataList = []
+ let hasNodes = true
+
+ dataList.push(data.filter((item) => {
+ return (item.parent_value === null || item.parent_value === undefined || item.parent_value === '')
+ }))
+ for (let i = 0; i < paths.length; i++) {
+ var value = paths[i].value
+ var nodes = data.filter((item) => {
+ return item.parent_value === value
+ })
+
+ if (nodes.length) {
+ dataList.push(nodes)
+ } else {
+ hasNodes = false
+ }
+ }
+
+ return {
+ dataList,
+ hasNodes
+ }
+ },
+ _extractTree(nodes, result, parent_value) {
+ let list = result || []
+ let valueField = this.map.value
+ for (let i = 0; i < nodes.length; i++) {
+ let node = nodes[i]
+
+ let child = {}
+ for (let key in node) {
+ if (key !== 'children') {
+ child[key] = node[key]
+ }
+ }
+ if (parent_value !== null && parent_value !== undefined && parent_value !== '') {
+ child.parent_value = parent_value
+ }
+ result.push(child)
+
+ let children = node.children
+ if (children) {
+ this._extractTree(children, result, node[valueField])
+ }
+ }
+ },
+ _extractTreePath(nodes, result) {
+ let list = result || []
+ for (let i = 0; i < nodes.length; i++) {
+ let node = nodes[i]
+
+ let child = {}
+ for (let key in node) {
+ if (key !== 'children') {
+ child[key] = node[key]
+ }
+ }
+ result.push(child)
+
+ let children = node.children
+ if (children) {
+ this._extractTreePath(children, result)
+ }
+ }
+ },
+ _findNodePath(key, nodes, path = []) {
+ let textField = this.map.text
+ let valueField = this.map.value
+ for (let i = 0; i < nodes.length; i++) {
+ let node = nodes[i]
+ let children = node.children
+ let text = node[textField]
+ let value = node[valueField]
+
+ path.push({
+ value,
+ text
+ })
+
+ if (value === key) {
+ return path
+ }
+
+ if (children) {
+ const p = this._findNodePath(key, children, path)
+ if (p.length) {
+ return p
+ }
+ }
+
+ path.pop()
+ }
+ return []
+ },
+ _processLocalData() {
+ this._treeData = []
+ this._extractTree(this.localdata, this._treeData)
+
+ var inputValue = this.dataValue
+ if (inputValue === undefined) {
+ return
+ }
+
+ if (Array.isArray(inputValue)) {
+ inputValue = inputValue[inputValue.length - 1]
+ if (typeof inputValue === 'object' && inputValue[this.map.value]) {
+ inputValue = inputValue[this.map.value]
+ }
+ }
+
+ this.selected = this._findNodePath(inputValue, this.localdata)
+ }
+ }
+}
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 e1803010e673e1b6338bffd60de977af6f39923d..b2691e508660a8a27657530545d85fc30d194605 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
@@ -5,16 +5,16 @@
+ v-if="item.text" @click="handleSelect(index)">
{{item.text}}
-
+
-
{{item[map.text]}}
@@ -177,7 +177,9 @@
}
}
-
diff --git a/uni_modules/uni-data-select/package.json b/uni_modules/uni-data-select/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..f156d5007866f27033f66eab523878853234a6d8
--- /dev/null
+++ b/uni_modules/uni-data-select/package.json
@@ -0,0 +1,85 @@
+{
+ "id": "uni-data-select",
+ "displayName": "uni-data-select 下拉框选择器",
+ "version": "0.1.9",
+ "description": "通过数据驱动的下拉框选择器",
+ "keywords": [
+ "uni-ui",
+ "select",
+ "uni-data-select",
+ "下拉框",
+ "下拉选"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": "^3.1.1"
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+"dcloudext": {
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "无",
+ "data": "无",
+ "permissions": "无"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+ "type": "component-vue"
+ },
+ "uni_modules": {
+ "dependencies": ["uni-load-more"],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y"
+ },
+ "client": {
+ "App": {
+ "app-vue": "u",
+ "app-nvue": "n"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "u",
+ "百度": "u",
+ "字节跳动": "u",
+ "QQ": "u",
+ "京东": "u"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "y"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-data-select/readme.md b/uni_modules/uni-data-select/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..eb58de300fdd78e33341356bdbc437da7f15b566
--- /dev/null
+++ b/uni_modules/uni-data-select/readme.md
@@ -0,0 +1,8 @@
+## DataSelect 下拉框选择器
+> **组件名:uni-data-select**
+> 代码块: `uDataSelect`
+
+当选项过多时,使用下拉菜单展示并选择内容
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
diff --git a/uni_modules/uni-datetime-picker/changelog.md b/uni_modules/uni-datetime-picker/changelog.md
index 381c9a887a8f11aed435f4d21c8513c4bef71428..9f09862943608f919c4937cc85f818d9f2e4003d 100644
--- a/uni_modules/uni-datetime-picker/changelog.md
+++ b/uni_modules/uni-datetime-picker/changelog.md
@@ -1,3 +1,21 @@
+## 2.2.11(2022-09-19)
+- 修复,支付宝小程序样式错乱,[详情](https://github.com/dcloudio/uni-app/issues/3861)
+## 2.2.10(2022-09-19)
+- 修复,反向选择日期范围,日期显示异常,[详情](https://ask.dcloud.net.cn/question/153401?item_id=212892&rf=false)
+## 2.2.9(2022-09-16)
+- 可以使用 uni-scss 控制主题色
+## 2.2.8(2022-09-08)
+- 修复 close事件无效的 bug
+## 2.2.7(2022-09-05)
+- 修复 移动端 maskClick 无效的 bug,详见:[https://ask.dcloud.net.cn/question/140824?item_id=209458&rf=false](https://ask.dcloud.net.cn/question/140824?item_id=209458&rf=false)
+## 2.2.6(2022-06-30)
+- 优化 组件样式,调整了组件图标大小、高度、颜色等,与uni-ui风格保持一致
+## 2.2.5(2022-06-24)
+- 修复 日历顶部年月及底部确认未国际化 bug
+## 2.2.4(2022-03-31)
+- 修复 Vue3 下动态赋值,单选类型未响应的 bug
+## 2.2.3(2022-03-28)
+- 修复 Vue3 下动态赋值未响应的 bug
## 2.2.2(2021-12-10)
- 修复 clear-icon 属性在小程序平台不生效的 bug
## 2.2.1(2021-12-10)
diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue
index 1c95c68decb8f8deead93caf8f750f0c87721e43..898237dafd9c53d9c77eb8ffc1aed51443d0873b 100644
--- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue
+++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue
@@ -62,6 +62,8 @@
+
diff --git a/uni_modules/uni-datetime-picker/package.json b/uni_modules/uni-datetime-picker/package.json
index 5e0ff11e9ae573adca99828f0a617170f49f2668..f7a2e6aae5b0573a2fe94c7c69a468ca1e89bce2 100644
--- a/uni_modules/uni-datetime-picker/package.json
+++ b/uni_modules/uni-datetime-picker/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-datetime-picker",
"displayName": "uni-datetime-picker 日期选择器",
- "version": "2.2.2",
+ "version": "2.2.11",
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
"keywords": [
"uni-datetime-picker",
@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
+"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+ "type": "component-vue"
},
"uni_modules": {
"dependencies": [
diff --git a/uni_modules/uni-easyinput/changelog.md b/uni_modules/uni-easyinput/changelog.md
index 1e8c6f91be4e19a739cd4935c8615387bd746db6..74b726905f322327c6177022afd5c893e7192f48 100644
--- a/uni_modules/uni-easyinput/changelog.md
+++ b/uni_modules/uni-easyinput/changelog.md
@@ -1,3 +1,5 @@
+## 1.1.1(2022-09-19)
+- 修复,输入后回车,change 事件触发两次,[详情](https://ask.dcloud.net.cn/question/152149)
## 1.1.0(2022-06-30)
- 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容
- 新增 clear 事件,点击右侧叉号图标触发
diff --git a/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue b/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
index d129ce15b9d366ee17004cbab51964cb5437c752..a1250dd6f523b80f1528817a8c6221a40b67697a 100644
--- a/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
+++ b/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
@@ -202,7 +202,8 @@
showClearIcon: false,
showPassword: false,
focusShow: false,
- localMsg: ''
+ localMsg: '',
+ isEnter: false // 用于判断当前是否是使用回车操作
};
},
computed: {
@@ -371,8 +372,10 @@
let value = event.detail.value;
this.focusShow = false
this.$emit('blur', event);
- // 根据类型返回值,在event中获取的值理论上讲都是string
- this.$emit('change', this.val)
+ // 根据类型返回值,在event中获取的值理论上讲都是string
+ if (this.isEnter === false) {
+ this.$emit('change', this.val)
+ }
// 失去焦点时参与表单校验
if (this.form && this.formItem) {
const {
@@ -389,8 +392,12 @@
* @param {Object} e
*/
onConfirm(e) {
- this.$emit('confirm', this.val);
- this.$emit('change', this.val)
+ this.$emit('confirm', this.val);
+ this.isEnter = true;
+ this.$emit('change', this.val)
+ this.$nextTick(() => {
+ this.isEnter = false
+ })
},
/**
diff --git a/uni_modules/uni-easyinput/package.json b/uni_modules/uni-easyinput/package.json
index 3cc793e6132002e2fd4aceb5567e2ca34d54c58d..a11be70ca9ead15fb7b792a2d632026fe419271c 100644
--- a/uni_modules/uni-easyinput/package.json
+++ b/uni_modules/uni-easyinput/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框",
- "version": "1.1.0",
+ "version": "1.1.1",
"description": "Easyinput 组件是对原生input组件的增强",
"keywords": [
"uni-ui",
@@ -17,11 +17,7 @@
"directories": {
"example": "../../temps/example_temps"
},
- "dcloudext": {
- "category": [
- "前端组件",
- "通用组件"
- ],
+"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
@@ -38,7 +34,8 @@
"data": "无",
"permissions": "无"
},
- "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+ "type": "component-vue"
},
"uni_modules": {
"dependencies": [
diff --git a/uni_modules/uni-fab/changelog.md b/uni_modules/uni-fab/changelog.md
index 24e26b1671be9fdec8bff65c3a7895f31719aace..0048ff9279f93d6e5354c8d3b2a593413251cea1 100644
--- a/uni_modules/uni-fab/changelog.md
+++ b/uni_modules/uni-fab/changelog.md
@@ -1,3 +1,7 @@
+## 1.2.4(2022-09-07)
+小程序端由于 style 使用了对象导致报错,[详情](https://ask.dcloud.net.cn/question/152790?item_id=211778&rf=false)
+## 1.2.3(2022-09-05)
+- 修复 nvue 环境下,具有 tabBar 时,fab 组件下部位置无法正常获取 --window-bottom 的bug,详见:[https://ask.dcloud.net.cn/question/110638?notification_id=826310](https://ask.dcloud.net.cn/question/110638?notification_id=826310)
## 1.2.2(2021-12-29)
- 更新 组件依赖
## 1.2.1(2021-11-19)
diff --git a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
index 6143a0552a6eedb00697954dde93bf595ab6426c..037385e23076e5ed8f13d12c868f3c7b50a5ba62 100644
--- a/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
+++ b/uni_modules/uni-fab/components/uni-fab/uni-fab.vue
@@ -5,7 +5,9 @@
'uni-fab--rightBottom': rightBottom,
'uni-fab--leftTop': leftTop,
'uni-fab--rightTop': rightTop
- }" class="uni-fab">
+ }" class="uni-fab"
+ :style="nvueBottom"
+ >
+ }" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor, 'bottom': nvueBottom }" @click="_onClick">
+
+
+
+
@@ -16,8 +26,7 @@
@@ -62,9 +62,10 @@