diff --git a/config.js b/config.js index f0caa8e..c9ec5a7 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,7 @@ // 应用全局配置 module.exports = { - baseUrl: 'http://localhost:8080', + baseUrl: 'https://vue.ruoyi.vip/prod-api', + // baseUrl: 'http://localhost:8080', // 应用信息 appInfo: { // 应用名称 diff --git a/uni_modules/uni-badge/changelog.md b/uni_modules/uni-badge/changelog.md index 544ecc1..56581c4 100644 --- a/uni_modules/uni-badge/changelog.md +++ b/uni_modules/uni-badge/changelog.md @@ -1,3 +1,5 @@ +## 1.2.1(2022-09-05) +- 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473) ## 1.2.0(2021-11-19) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-badge](https://uniapp.dcloud.io/component/uniui/uni-badge) diff --git a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue index 55bf2c5..664dc37 100644 --- a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue +++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue @@ -1,7 +1,7 @@ @@ -130,16 +130,13 @@ const match = whiteList[this.absolute] return match ? match : whiteList['rightTop'] }, - badgeWidth() { - return { - width: `${this.width}px` - } - }, dotStyle() { if (!this.isDot) return {} return { width: '10px', + minWidth: '0', height: '10px', + padding: '0', borderRadius: '10px' } }, @@ -199,6 +196,8 @@ justify-content: center; flex-direction: row; height: 20px; + min-width: 20px; + padding: 0 4px; line-height: 18px; color: #fff; border-radius: 100px; @@ -207,6 +206,7 @@ border: 1px solid #fff; text-align: center; font-family: 'Helvetica Neue', Helvetica, sans-serif; + font-feature-settings: "tnum"; font-size: $bage-size; /* #ifdef H5 */ z-index: 999; diff --git a/uni_modules/uni-badge/package.json b/uni_modules/uni-badge/package.json index 4e9e631..7a34d9c 100644 --- a/uni_modules/uni-badge/package.json +++ b/uni_modules/uni-badge/package.json @@ -1,7 +1,7 @@ { "id": "uni-badge", "displayName": "uni-badge 数字角标", - "version": "1.2.0", + "version": "1.2.1", "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", "keywords": [ "", @@ -18,11 +18,7 @@ "directories": { "example": "../../temps/example_temps" }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], +"dcloudext": { "sale": { "regular": { "price": "0.00" @@ -39,7 +35,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": ["uni-scss"], diff --git a/uni_modules/uni-calendar/changelog.md b/uni_modules/uni-calendar/changelog.md index 6df4493..0160b69 100644 --- a/uni_modules/uni-calendar/changelog.md +++ b/uni_modules/uni-calendar/changelog.md @@ -1,3 +1,7 @@ +## 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) 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 039d079..d29ead5 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 @@ -102,7 +102,7 @@ $uni-color-error: #e43d33; $uni-opacity-disabled: 0.3; $uni-text-color-disable:#c0c0c0; - $uni-color-primary: #2979ff; + $uni-primary: #2979ff !default; .uni-calendar-item__weeks-box { flex: 1; /* #ifndef APP-NVUE */ @@ -152,11 +152,11 @@ } .uni-calendar-item--isDay-text { - color: $uni-color-primary; + color: $uni-primary; } .uni-calendar-item--isDay { - background-color: $uni-color-primary; + background-color: $uni-primary; opacity: 0.8; color: #fff; } @@ -167,13 +167,13 @@ } .uni-calendar-item--checked { - background-color: $uni-color-primary; + background-color: $uni-primary; color: #fff; opacity: 0.8; } .uni-calendar-item--multiple { - background-color: $uni-color-primary; + background-color: $uni-primary; color: #fff; opacity: 0.8; } diff --git a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue index 1a7f3fb..1273d76 100644 --- a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue +++ b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue @@ -218,7 +218,7 @@ bindDateChange(e) { const value = e.detail.value + '-1' console.log(this.cale.getDate(value)); - this.init(value) + this.setDate(value) }, /** * 初始化日期显示 diff --git a/uni_modules/uni-calendar/package.json b/uni_modules/uni-calendar/package.json index 40455c8..c59180c 100644 --- a/uni_modules/uni-calendar/package.json +++ b/uni_modules/uni-calendar/package.json @@ -1,7 +1,7 @@ { "id": "uni-calendar", "displayName": "uni-calendar 日历", - "version": "1.4.5", + "version": "1.4.7", "description": "日历组件", "keywords": [ "uni-ui", @@ -18,11 +18,7 @@ "directories": { "example": "../../temps/example_temps" }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], +"dcloudext": { "sale": { "regular": { "price": "0.00" @@ -39,7 +35,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-data-checkbox/changelog.md b/uni_modules/uni-data-checkbox/changelog.md index dbc517a..c7a468a 100644 --- a/uni_modules/uni-data-checkbox/changelog.md +++ b/uni_modules/uni-data-checkbox/changelog.md @@ -1,3 +1,5 @@ +## 1.0.3(2022-09-16) +- 可以使用 uni-scss 控制主题色 ## 1.0.2(2022-06-30) - 优化 在 uni-forms 中的依赖注入方式 ## 1.0.1(2022-02-07) diff --git a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue index eb3ae3f..341a4af 100644 --- a/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue +++ b/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue @@ -383,12 +383,14 @@ */ setStyleBackgroud(item) { let styles = {} - let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' - if (this.mode !== 'list') { - styles['border-color'] = item.selected?selectedColor:'#DCDFE6' - } - if (this.mode === 'tag') { - styles['background-color'] = item.selected? selectedColor:'#f5f5f5' + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' + if (this.selectedColor) { + if (this.mode !== 'list') { + styles['border-color'] = item.selected?selectedColor:'#DCDFE6' + } + if (this.mode === 'tag') { + styles['background-color'] = item.selected? selectedColor:'#f5f5f5' + } } let classles = '' for (let i in styles) { @@ -398,16 +400,17 @@ }, setStyleIcon(item) { let styles = {} - let classles = '' - let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' - styles['background-color'] = item.selected?selectedColor:'#fff' - styles['border-color'] = item.selected?selectedColor:'#DCDFE6' - - if(!item.selected && item.disabled){ - styles['background-color'] = '#F2F6FC' - styles['border-color'] = item.selected?selectedColor:'#DCDFE6' + let classles = '' + if (this.selectedColor) { + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' + styles['background-color'] = item.selected?selectedColor:'#fff' + styles['border-color'] = item.selected?selectedColor:'#DCDFE6' + + if(!item.selected && item.disabled){ + styles['background-color'] = '#F2F6FC' + styles['border-color'] = item.selected?selectedColor:'#DCDFE6' + } } - for (let i in styles) { classles += `${i}:${styles[i]};` } @@ -415,17 +418,18 @@ }, setStyleIconText(item) { let styles = {} - let classles = '' - let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' - if (this.mode === 'tag') { - styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666' - } else { - styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666' + let classles = '' + if (this.selectedColor) { + let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' + if (this.mode === 'tag') { + styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666' + } else { + styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666' + } + if(!item.selected && item.disabled){ + styles.color = '#999' + } } - if(!item.selected && item.disabled){ - styles.color = '#999' - } - for (let i in styles) { classles += `${i}:${styles[i]};` } @@ -448,7 +452,7 @@ + /* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */ + /* #ifndef APP-NVUE */ + .uni-popper__arrow, + .uni-popper__arrow::after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 6px; + } + + .uni-popper__arrow { + filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); + top: -6px; + left: 10%; + margin-right: 3px; + border-top-width: 0; + border-bottom-color: #EBEEF5; + } + + .uni-popper__arrow::after { + content: " "; + top: 1px; + margin-left: -6px; + border-top-width: 0; + border-bottom-color: #fff; + } + + /* #endif */ + 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 c12fd54..cfae22a 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 @@ -42,7 +42,7 @@ export default { }, pageSize: { type: Number, - default: 20 + default: 500 }, getcount: { type: [Boolean, String], @@ -94,7 +94,7 @@ export default { }, map: { type: Object, - default() { + default () { return { text: "text", value: "value" @@ -122,19 +122,22 @@ export default { } }, computed: { - isLocaldata() { - return !this.collection.length + isLocalData() { + return !this.collection.length; }, - postField() { - let fields = [this.field]; - if (this.parentField) { - fields.push(`${this.parentField} as parent_value`); - } - return fields.join(','); + isCloudData() { + return this.collection.length > 0; + }, + isCloudDataList() { + return (this.isCloudData && (!this.parentField && !this.selfField)); + }, + isCloudDataTree() { + return (this.isCloudData && this.parentField && this.selfField); }, dataValue() { - let isModelValue = Array.isArray(this.modelValue) ? (this.modelValue.length > 0) : (this.modelValue !== null || this.modelValue !== undefined) - return isModelValue ? this.modelValue : this.value + 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') { @@ -183,8 +186,169 @@ export default { }, methods: { onPropsChange() { - this._treeData = [] + this._treeData = []; }, + + // 填充 pickview 数据 + async loadData() { + if (this.isLocalData) { + this.loadLocalData(); + } else if (this.isCloudDataList) { + this.loadCloudDataList(); + } else if (this.isCloudDataTree) { + this.loadCloudDataTree(); + } + }, + + // 加载本地数据 + async loadLocalData() { + this._treeData = []; + this._extractTree(this.localdata, this._treeData); + + let 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); + }, + + // 加载 Cloud 数据 (单列) + async loadCloudDataList() { + if (this.loading) { + return; + } + this.loading = true; + + try { + let response = await this.getCommand(); + let responseData = response.result.data; + + this._treeData = responseData; + + this._updateBindData(); + this._updateSelected(); + + this.onDataChange(); + } catch (e) { + this.errorMessage = e; + } finally { + this.loading = false; + } + }, + + // 加载 Cloud 数据 (树形) + async loadCloudDataTree() { + if (this.loading) { + return; + } + this.loading = true; + + try { + let commandOptions = { + field: this._cloudDataPostField(), + where: this._cloudDataTreeWhere() + }; + if (this.gettree) { + commandOptions.startwith = `${this.selfField}=='${this.dataValue}'`; + } + + let response = await this.getCommand(commandOptions); + let responseData = response.result.data; + + this._treeData = responseData; + this._updateBindData(); + this._updateSelected(); + + this.onDataChange(); + } catch (e) { + this.errorMessage = e; + } finally { + this.loading = false; + } + }, + + // 加载 Cloud 数据 (节点) + async loadCloudDataNode(callback) { + if (this.loading) { + return; + } + this.loading = true; + + try { + let commandOptions = { + field: this._cloudDataPostField(), + where: this._cloudDataNodeWhere() + }; + + let response = await this.getCommand(commandOptions); + let responseData = response.result.data; + + callback(responseData); + } catch (e) { + this.errorMessage = e; + } finally { + this.loading = false; + } + }, + + // 回显 Cloud 数据 + getCloudDataValue() { + if (this.isCloudDataList) { + return this.getCloudDataListValue(); + } + + if (this.isCloudDataTree) { + return this.getCloudDataTreeValue(); + } + }, + + // 回显 Cloud 数据 (单列) + getCloudDataListValue() { + // 根据 field's as value标识匹配 where 条件 + let where = []; + let whereField = this._getForeignKeyByField(); + if (whereField) { + where.push(`${whereField} == '${this.dataValue}'`) + } + + where = where.join(' || '); + + if (this.where) { + where = `(${this.where}) && (${where})` + } + + return this.getCommand({ + field: this._cloudDataPostField(), + where + }).then((res) => { + this.selected = res.result.data; + return res.result.data; + }); + }, + + // 回显 Cloud 数据 (树形) + getCloudDataTreeValue() { + return this.getCommand({ + field: this._cloudDataPostField(), + getTreePath: { + startWith: `${this.selfField}=='${this.dataValue}'` + } + }).then((res) => { + let treePath = []; + this._extractTreePath(res.result.data, treePath); + this.selected = treePath; + return treePath; + }); + }, + getCommand(options = {}) { /* eslint-disable no-undef */ let db = uniCloud.database(this.spaceInfo) @@ -229,125 +393,16 @@ 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 - } - 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 - }) + _cloudDataPostField() { + let fields = [this.field]; + if (this.parentField) { + fields.push(`${this.parentField} as parent_value`); + } + return fields.join(','); }, - 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() { + _cloudDataTreeWhere() { let result = [] let selected = this.selected let parentField = this.parentField @@ -364,17 +419,35 @@ export default { if (this.where) { where.push(`(${this.where})`) } + if (result.length) { where.push(`(${result.join(' || ')})`) } return where.join(' && ') }, - _nodeWhere() { - let result = [] - let selected = this.selected + + _cloudDataNodeWhere() { + let where = [] + let selected = this.selected; if (selected.length) { - result.push(`${this.parentField} == '${selected[selected.length - 1].value}'`) + where.push(`${this.parentField} == '${selected[selected.length - 1].value}'`); + } + + where = where.join(' || '); + + if (this.where) { + return `(${this.where}) && (${where})` + } + + return where + }, + + _getWhereByForeignKey() { + let result = [] + let whereField = this._getForeignKeyByField(); + if (whereField) { + result.push(`${whereField} == '${this.dataValue}'`) } if (this.where) { @@ -383,41 +456,23 @@ export default { return result.join(' || ') }, - _getParentNameByField() { - const fields = this.field.split(','); - let where_field = null; + + _getForeignKeyByField() { + let fields = this.field.split(','); + let whereField = 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(); + whereField = 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 - } - } - } + return whereField; }, + _updateBindData(node) { const { dataList, @@ -445,6 +500,25 @@ export default { hasNodes } }, + + _updateSelected() { + let dl = this.dataList + let sl = this.selected + let textField = this.map.text + let valueField = this.map.value + for (let i = 0; i < sl.length; i++) { + let value = sl[i].value + let dl2 = dl[i] + for (let j = 0; j < dl2.length; j++) { + let item2 = dl2[j] + if (item2[valueField] === value) { + sl[i].text = item2[textField] + break + } + } + } + }, + _filterData(data, paths) { let dataList = [] let hasNodes = true @@ -453,8 +527,8 @@ export default { 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) => { + let value = paths[i].value + let nodes = data.filter((item) => { return item.parent_value === value }) @@ -470,6 +544,7 @@ export default { hasNodes } }, + _extractTree(nodes, result, parent_value) { let list = result || [] let valueField = this.map.value @@ -493,6 +568,7 @@ export default { } } }, + _extractTreePath(nodes, result) { let list = result || [] for (let i = 0; i < nodes.length; i++) { @@ -512,6 +588,7 @@ export default { } } }, + _findNodePath(key, nodes, path = []) { let textField = this.map.text let valueField = this.map.value @@ -540,24 +617,6 @@ export default { 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 17d2de2..2d1344f 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 @@ -1,183 +1,172 @@ - + diff --git a/uni_modules/uni-data-picker/package.json b/uni_modules/uni-data-picker/package.json index 9900380..7b731fc 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": "uni-data-picker 数据驱动的picker选择器", - "version": "1.0.7", + "version": "1.0.8", "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景", "keywords": [ "uni-ui", @@ -18,11 +18,7 @@ "directories": { "example": "../../temps/example_temps" }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], +"dcloudext": { "sale": { "regular": { "price": "0.00" @@ -39,7 +35,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": [ @@ -56,7 +53,7 @@ "client": { "App": { "app-vue": "y", - "app-nvue": "y" + "app-nvue": "u" }, "H5-mobile": { "Safari": "y", diff --git a/uni_modules/uni-data-select/changelog.md b/uni_modules/uni-data-select/changelog.md index d5beaa3..9e48c69 100644 --- a/uni_modules/uni-data-select/changelog.md +++ b/uni_modules/uni-data-select/changelog.md @@ -1,3 +1,9 @@ +## 0.1.9(2022-09-05) +- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框 +## 0.1.8(2022-08-29) +- 修复 点击的位置不准确 +## 0.1.7(2022-08-12) +- 新增 支持 disabled 属性 ## 0.1.6(2022-07-06) - 修复 pc端宽度异常的bug ## 0.1.5 diff --git a/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue b/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue index 524a096..21e7922 100644 --- a/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue +++ b/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue @@ -2,7 +2,7 @@ {{label + ':'}} - + {{current}} {{typePlaceholder}} @@ -39,6 +39,7 @@ * @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效 * @property {String} label 左侧标题 * @property {String} placeholder 输入框的提示文字 + * @property {Boolean} disabled 是否禁用 * @event {Function} change 选中发生变化触发 */ @@ -88,6 +89,10 @@ defItem: { type: Number, default: 0 + }, + disabled: { + type: Boolean, + default: false } }, created() { @@ -204,6 +209,10 @@ }, toggleSelector() { + if(this.disabled){ + return + } + this.showSelector = !this.showSelector }, formatItemName(item) { @@ -248,15 +257,15 @@ width: 100%; flex: 1; box-sizing: border-box; - } - - .uni-stat-box { - width: 100%; - flex: 1; - } - - .uni-stat__actived { - width: 100%; + } + + .uni-stat-box { + width: 100%; + flex: 1; + } + + .uni-stat__actived { + width: 100%; flex: 1; // outline: 1px solid #2979ff; } @@ -287,6 +296,11 @@ width: 100%; flex: 1; height: 35px; + + &--disabled{ + background-color: #f5f7fa; + cursor: not-allowed; + } } .uni-select__label { @@ -298,7 +312,7 @@ } .uni-select__input-box { - // height: 35px; + height: 35px; position: relative; /* #ifndef APP-NVUE */ display: flex; @@ -332,7 +346,7 @@ border: 1px solid #EBEEF5; border-radius: 6px; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); - z-index: 2; + z-index: 3; padding: 4px 0; } @@ -423,4 +437,4 @@ right: 0; left: 0; } - + diff --git a/uni_modules/uni-data-select/package.json b/uni_modules/uni-data-select/package.json index 131c808..f156d50 100644 --- a/uni_modules/uni-data-select/package.json +++ b/uni_modules/uni-data-select/package.json @@ -1,7 +1,7 @@ { "id": "uni-data-select", "displayName": "uni-data-select 下拉框选择器", - "version": "0.1.6", + "version": "0.1.9", "description": "通过数据驱动的下拉框选择器", "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": ["uni-load-more"], diff --git a/uni_modules/uni-datetime-picker/changelog.md b/uni_modules/uni-datetime-picker/changelog.md index 5c9735a..9f09862 100644 --- a/uni_modules/uni-datetime-picker/changelog.md +++ b/uni_modules/uni-datetime-picker/changelog.md @@ -1,3 +1,13 @@ +## 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) 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 1c95c68..222030d 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 @@ -61,7 +61,9 @@ } - + diff --git a/uni_modules/uni-datetime-picker/package.json b/uni_modules/uni-datetime-picker/package.json index 60fa1d0..f7a2e6a 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.6", + "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 1e8c6f9..49b1a3b 100644 --- a/uni_modules/uni-easyinput/changelog.md +++ b/uni_modules/uni-easyinput/changelog.md @@ -1,47 +1,86 @@ ## 1.1.0(2022-06-30) + - 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容 - 新增 clear 事件,点击右侧叉号图标触发 - 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发 - 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等 - + ## 1.0.5(2022-06-07) + - 优化 clearable 显示策略 + ## 1.0.4(2022-06-07) + - 优化 clearable 显示策略 + ## 1.0.3(2022-05-20) -- 修复 关闭图标某些情况下无法取消的bug + +- 修复 关闭图标某些情况下无法取消的 bug + ## 1.0.2(2022-04-12) -- 修复 默认值不生效的bug + +- 修复 默认值不生效的 bug + ## 1.0.1(2022-04-02) -- 修复 value不能为0的bug + +- 修复 value 不能为 0 的 bug + ## 1.0.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) + +- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-easyinput](https://uniapp.dcloud.io/component/uniui/uni-easyinput) + ## 0.1.4(2021-08-20) + - 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug + ## 0.1.3(2021-08-11) + - 修复 在 uni-forms 中重置表单,错误信息无法清除的问题 + ## 0.1.2(2021-07-30) -- 优化 vue3下事件警告的问题 + +- 优化 vue3 下事件警告的问题 + ## 0.1.1 + - 优化 errorMessage 属性支持 Boolean 类型 + ## 0.1.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) + +- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) + ## 0.0.16(2021-06-29) + - 修复 confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug + ## 0.0.15(2021-06-21) + - 修复 passwordIcon 属性拼写错误的 bug + ## 0.0.14(2021-06-18) -- 新增 passwordIcon 属性,当type=password时是否显示小眼睛图标 + +- 新增 passwordIcon 属性,当 type=password 时是否显示小眼睛图标 - 修复 confirmType 属性不生效的问题 + ## 0.0.13(2021-06-04) + - 修复 disabled 状态可清出内容的 bug + ## 0.0.12(2021-05-12) + - 新增 组件示例地址 + ## 0.0.11(2021-05-07) + - 修复 input-border 属性不生效的问题 + ## 0.0.10(2021-04-30) + - 修复 ios 遮挡文字、显示一半的问题 + ## 0.0.9(2021-02-05) -- 调整为uni_modules目录规范 + +- 调整为 uni_modules 目录规范 - 优化 兼容 nvue 页面 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 d129ce1..110722d 100644 --- a/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue +++ b/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue @@ -1,34 +1,97 @@ @@ -50,6 +52,8 @@ const getVal = (val) => typeof val === 'number' ? val + 'px' : val; /** + * + * * NavBar 自定义导航栏 * @description 导航栏组件,主要用于头部导航 * @tutorial https://ext.dcloud.net.cn/plugin?id=52 @@ -196,6 +200,11 @@ + diff --git a/uni_modules/uni-pagination/package.json b/uni_modules/uni-pagination/package.json index adce670..862d5ab 100644 --- a/uni_modules/uni-pagination/package.json +++ b/uni_modules/uni-pagination/package.json @@ -1,7 +1,7 @@ { "id": "uni-pagination", "displayName": "uni-pagination 分页器", - "version": "1.2.1", + "version": "1.2.4", "description": "Pagination 分页器组件,用于展示页码、请求数据等。", "keywords": [ "uni-ui", @@ -16,11 +16,7 @@ "directories": { "example": "../../temps/example_temps" }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], +"dcloudext": { "sale": { "regular": { "price": "0.00" @@ -37,7 +33,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": ["uni-scss","uni-icons"], diff --git a/uni_modules/uni-pagination/readme.md b/uni_modules/uni-pagination/readme.md index eefa263..97ea1d6 100644 --- a/uni_modules/uni-pagination/readme.md +++ b/uni_modules/uni-pagination/readme.md @@ -9,5 +9,3 @@ ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination) #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - diff --git a/uni_modules/uni-popup/components/uni-popup/uni-popup.vue b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue index a3ced3d..8952545 100644 --- a/uni_modules/uni-popup/components/uni-popup/uni-popup.vue +++ b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue @@ -1,474 +1,479 @@ - - - - diff --git a/uni_modules/uni-table/components/uni-table/uni-table.vue b/uni_modules/uni-table/components/uni-table/uni-table.vue index d8d49db..1ddc567 100644 --- a/uni_modules/uni-table/components/uni-table/uni-table.vue +++ b/uni_modules/uni-table/components/uni-table/uni-table.vue @@ -125,7 +125,7 @@ export default { } else { startIndex = theadChildren.rowspan - 1 } - let isHaveData = this.data && this.data.length.length > 0 + let isHaveData = this.data && this.data.length > 0 theadChildren.checked = true theadChildren.indeterminate = false this.trChildren.forEach((item, index) => { diff --git a/uni_modules/uni-transition/components/uni-transition/uni-transition.vue b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue index be5e794..a2bf104 100644 --- a/uni_modules/uni-transition/components/uni-transition/uni-transition.vue +++ b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue @@ -1,277 +1,281 @@ - - - - + return this + }, + /** + * ref 触发 执行动画 + */ + run(fn) { + if (!this.animation) return + this.animation.run(fn) + }, + // 开始过度动画 + open() { + clearTimeout(this.timer) + this.transform = '' + this.isShow = true + let { opacity, transform } = this.styleInit(false) + if (typeof opacity !== 'undefined') { + this.opacity = opacity + } + this.transform = transform + // 确保动态样式已经生效后,执行动画,如果不加 nextTick ,会导致 wx 动画执行异常 + this.$nextTick(() => { + // TODO 定时器保证动画完全执行,目前有些问题,后面会取消定时器 + this.timer = setTimeout(() => { + this.animation = createAnimation(this.config, this) + this.tranfromInit(false).step() + this.animation.run() + this.$emit('change', { + detail: this.isShow + }) + }, 20) + }) + }, + // 关闭过度动画 + close(type) { + if (!this.animation) return + this.tranfromInit(true) + .step() + .run(() => { + this.isShow = false + this.animationData = null + this.animation = null + let { opacity, transform } = this.styleInit(false) + this.opacity = opacity || 1 + this.transform = transform + this.$emit('change', { + detail: this.isShow + }) + }) + }, + // 处理动画开始前的默认样式 + styleInit(type) { + let styles = { + transform: '' + } + let buildStyle = (type, mode) => { + if (mode === 'fade') { + styles.opacity = this.animationType(type)[mode] + } else { + styles.transform += this.animationType(type)[mode] + ' ' + } + } + if (typeof this.modeClass === 'string') { + buildStyle(type, this.modeClass) + } else { + this.modeClass.forEach(mode => { + buildStyle(type, mode) + }) + } + return styles + }, + // 处理内置组合动画 + tranfromInit(type) { + let buildTranfrom = (type, mode) => { + let aniNum = null + if (mode === 'fade') { + aniNum = type ? 0 : 1 + } else { + aniNum = type ? '-100%' : '0' + if (mode === 'zoom-in') { + aniNum = type ? 0.8 : 1 + } + if (mode === 'zoom-out') { + aniNum = type ? 1.2 : 1 + } + if (mode === 'slide-right') { + aniNum = type ? '100%' : '0' + } + if (mode === 'slide-bottom') { + aniNum = type ? '100%' : '0' + } + } + this.animation[this.animationMode()[mode]](aniNum) + } + if (typeof this.modeClass === 'string') { + buildTranfrom(type, this.modeClass) + } else { + this.modeClass.forEach(mode => { + buildTranfrom(type, mode) + }) + } + + return this.animation + }, + animationType(type) { + return { + fade: type ? 1 : 0, + 'slide-top': `translateY(${type ? '0' : '-100%'})`, + 'slide-right': `translateX(${type ? '0' : '100%'})`, + 'slide-bottom': `translateY(${type ? '0' : '100%'})`, + 'slide-left': `translateX(${type ? '0' : '-100%'})`, + 'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`, + 'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})` + } + }, + // 内置动画类型与实际动画对应字典 + animationMode() { + return { + fade: 'opacity', + 'slide-top': 'translateY', + 'slide-right': 'translateX', + 'slide-bottom': 'translateY', + 'slide-left': 'translateX', + 'zoom-in': 'scale', + 'zoom-out': 'scale' + } + }, + // 驼峰转中横线 + toLine(name) { + return name.replace(/([A-Z])/g, '-$1').toLowerCase() + } + } +} + +