From db077220d4ceda61bb49a670484ae680267303f4 Mon Sep 17 00:00:00 2001 From: maplemei Date: Thu, 24 Oct 2019 22:26:59 +0800 Subject: [PATCH] v1.0.12 --- CHANGELOG.md | 19 +++++++ dist/static/2.js | 2 +- dist/static/3.js | 2 +- dist/static/docs.js | 2 +- dist/xm-select.js | 2 +- docs/mds/XM08.md | 66 +++++++++++++++++++++++ docs/mds/XM19.md | 45 ++++++++++++++++ docs/mds/ZTEST.md | 6 ++- package.json | 2 +- src/components/config/language/en.js | 6 +++ src/components/config/language/zn.js | 6 +++ src/components/config/options.js | 6 +++ src/components/element/model/general.js | 70 ++++++++++++++++++------- 13 files changed, 209 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5370203..3c7744c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ ## 更新日志 +### 1.0.12 + +*2019-10-24* + +#### 新增 + +- 新增配置`pageEmptyShow`, 调整分页+搜索模式下, 如果无数据是否展示分页 +- 新增`create`创建条目时的回调参数`data`, 当前下拉的数据 +- 工具条新增反选`REVERSE` + +#### Bug fixes + +- 修复`create`创建条目时, 工具条不能操作的创建条目的问题 +- 修复`create`创建条目时, 分页页码显示异常的问题 +- 修复`create`创建条目时, 搜索不存在的回调逻辑 +- 修复多语言下工具条一直显示中文的问题 +- 调整分页模式下无数据显示页码 0 -> 1 + + ### 1.0.11 *2019-10-23* diff --git a/dist/static/2.js b/dist/static/2.js index 5e35489..7cfcd3b 100644 --- a/dist/static/2.js +++ b/dist/static/2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{366:function(e,t,n){e.exports=n.p+"static/wx.f391ad4.jpg"},367:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA3gAAADLCAMAAAALBsE6AAAAAXNSR0IArs4c6QAAAFFQTFRF/////wAA/5WVmZOTVFRU/93d/3Fx//Hx//vl/9fX/8nJ8ePkta2t/7W1/1R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i1cmy9Sdsq12V4s3XiJC6oOnxxQt4vnbnBJvGZb6/k/FWyT1QsgV08y9C+IxrvlNxDu7doJ8v9YTl7abbU+dI++hB78Zd9WWXkg7WGtw+Pq9Y5EpZWeO7xA7/pujAgiXQvo1xfGIgPTx5CCLFPH8iPt+ZnhbJPGk4RbPTKunSC880ccz8Vq5Fn0pK0BUh9brKdKCm5XJJZnc0+KlK9V7i9TWktCmZlnmH0MYW1H0bzP40IgesYu3CW/LJN4f/2Li237t2/d5H8+b3PTxfsbgypm1E6QtN8S5+jl1/OU79aEWPYWC1SgUWr6Qdgg2QKCbbAdp02ZnnJ0aXt9g59GoAKIfXNmGYWgnD1LxgEKKeHqsdT/Ao2HExfMjsXoKP4Yzo5oy/lHODpVcvWLWda3XUyTxWvMwE8/Xi5gSLy0RoeL1NcD+O/Z63Nv1t9m3h/Wz88p//Q0z8eb2NuMOsrePevU1XNrEfPXiEf3qVDwta46dhPSxMqr5raYTLkfFz5hFKz4v4/kvf9Q9IqQlxkarIWWcu//6HX0Ord7O7/fhM4/3Q8TzQeufovPiaPb4WlHt2koSmcSb09KIGLViyHq/uMKXp55cPMLatJv13xxeeL5tgKKH95MiHgAgHsA3FO8PAHw5TwAAAAAAAAAAAAA/kWbFZwDw5fz3H+YBYB7Ao5jX8iEAIB7Ar2dHUxOALh7AQ8B0AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDT0/8B0p38SAf/3OIAAAAASUVORK5CYII="},369:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"content element-doc"},[e._m(0),e._m(1),n("demo-block",[n("div",[n("p",[e._v("目前仅支持"),n("code",[e._v("中文")]),e._v("和"),n("code",[e._v("英文")]),e._v(", 如需更多语言, 可以"),n("code",[e._v("clone")]),e._v("代码进行二次开发")])]),n("template",{slot:"source"},[n("element-demo0")],1),n("template",{slot:"highlight"},[n("pre",{pre:!0},[n("code",{pre:!0,attrs:{class:"html"}},[e._v("
\n
\n\n ``` ::: + + +### 搜索 + 分页 无数据 不展示分页 + +``` +xmSelect.render({ + //... + paging: true, + pageSize: 3, + filterable: true, + pageEmptyShow: false, +}) +``` + +:::demo +```html +
+ + +``` +::: diff --git a/docs/mds/XM19.md b/docs/mds/XM19.md index 460afcc..dcc5a85 100644 --- a/docs/mds/XM19.md +++ b/docs/mds/XM19.md @@ -109,3 +109,48 @@ var demo3 = xmSelect.render({ ``` ::: + + +### 全部工具条 + +``` +//全选, 清空, 反选 +xmSelect.render({ + toolbar: { + show: true, + list: [ 'ALL', 'CLEAR', 'REVERSE' ] + }, +}) +``` + +:::demo +```html +
+ + +``` +::: \ No newline at end of file diff --git a/docs/mds/ZTEST.md b/docs/mds/ZTEST.md index cba1722..7e1b0a5 100644 --- a/docs/mds/ZTEST.md +++ b/docs/mds/ZTEST.md @@ -12,8 +12,10 @@ var demo1 = xmSelect.render({ el: '#demo1', autoRow: true, filterable: true, - create: val => { - console.log(val) + toolbar: {show: true}, + paging: true, + create: (val, data) => { + console.log(val, data) return { name: val, value: val, diff --git a/package.json b/package.json index 6c003b0..0874027 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xm-select", - "version": "1.0.11", + "version": "1.0.12", "description": "始于Layui的select多选解决方案", "main": "index.js", "scripts": { diff --git a/src/components/config/language/en.js b/src/components/config/language/en.js index e55d285..3b53c39 100644 --- a/src/components/config/language/en.js +++ b/src/components/config/language/en.js @@ -2,4 +2,10 @@ export default { tips: 'please selected', empty: 'no data', searchTips: 'please search', + toolbar: { + ALL: 'select all', + CLEAR: 'clear', + REVERSE: 'invert select', + SEARCH: 'search', + } } \ No newline at end of file diff --git a/src/components/config/language/zn.js b/src/components/config/language/zn.js index a33a27b..45b6498 100644 --- a/src/components/config/language/zn.js +++ b/src/components/config/language/zn.js @@ -2,4 +2,10 @@ export default { tips: '请选择', empty: '暂无数据', searchTips: '请选择', + toolbar: { + ALL: '全选', + CLEAR: '清空', + REVERSE: '反选', + SEARCH: '搜索', + } } \ No newline at end of file diff --git a/src/components/config/options.js b/src/components/config/options.js index 77797c0..0f02323 100644 --- a/src/components/config/options.js +++ b/src/components/config/options.js @@ -7,6 +7,10 @@ export default function (lan = 'zn') { let setting = lanSetting[lan] || zn; return { + //配置语言 + language: lan, + //所有的语言配置 + languageProp: setting, //多选数据 data: [], //自定义数据 @@ -54,6 +58,8 @@ export default function (lan = 'zn') { paging: false, //分页每页的条数 pageSize: 10, + //分页无数据是否展示分页 + pageEmptyShow: true, //是否开启单选模式 radio: false, //是否开启重复选模式 diff --git a/src/components/element/model/general.js b/src/components/element/model/general.js index 4304d0c..f8c9b5e 100644 --- a/src/components/element/model/general.js +++ b/src/components/element/model/general.js @@ -20,6 +20,7 @@ class General extends Component{ this.searchCid = 0; this.inputOver = true; this.__value = ''; + this.dynamicInput = false; } optionClick(item, selected, disabled, e){ @@ -182,7 +183,7 @@ class General extends Component{ } arr = arr.filter(item => !item.__del); //创建条目 - creator = this.state.filterValue && isFunction(create) && create(this.state.filterValue); + creator = this.state.filterValue && isFunction(create); } } @@ -209,29 +210,32 @@ class General extends Component{ let paging = ''; if(config.paging){ - //计算当前分页的总页码 - const size = Math.floor((arr.length - 1) / config.pageSize) + 1; + //计算当前分页的总页码 + let size = Math.floor((arr.length - 1) / config.pageSize) + 1; + size <= 0 && (size = 1); + + let pageIndex = this.state.pageIndex; //如果当前页码大于总页码, 重置一下 - if(this.state.pageIndex > size){ - this.changePageIndex(size); + if(pageIndex > size){ + pageIndex = size; } //如有总页码>1, 但是因为搜索造成的页码=0的情况 - if(size > 0 && this.state.pageIndex <= 0){ - this.changePageIndex(1); + if(size > 0 && pageIndex <= 0){ + pageIndex = 1; } //实现简单的物理分页 - let start = (this.state.pageIndex - 1) * config.pageSize; + let start = (pageIndex - 1) * config.pageSize; let end = start + config.pageSize; arr = arr.slice(start, end); const disabledStyle = {cursor: 'no-drop', color: '#d2d2d2'}; let prevStyle = {}, nextStyle = {}; - this.state.pageIndex <= 1 && (prevStyle = disabledStyle); - this.state.pageIndex == size && (nextStyle = disabledStyle); + pageIndex <= 1 && (prevStyle = disabledStyle); + pageIndex == size && (nextStyle = disabledStyle); // const defaultCurrClass = { // position: 'relative', @@ -249,6 +253,9 @@ class General extends Component{ // }>{ i + 1 } // )) // } + + this.state.pageIndex !== pageIndex && this.changePageIndex(pageIndex); + paging = (
上一页 @@ -256,7 +263,6 @@ class General extends Component{ this.pageNextClick.bind(this, e, size)() }>下一页
) - }else{ //检查是否设置了显示数量上限 if(config.showCount > 0){ @@ -275,6 +281,12 @@ class General extends Component{ }); arr = newArr; + //查看是否创建了条目 + if(creator){ + creator = create(this.state.filterValue, deepMerge([], arr)); + creator && arr.splice(0, 0, creator); + } + let safetyArr = deepMerge([], arr); this.tempData = safetyArr; @@ -283,18 +295,40 @@ class General extends Component{
{ config.toolbar.list.map(tool => { const toolClass = 'toolbar-tag'; + const toolStyle = {}; - let info; + let info, name = config.languageProp.toolbar[tool]; if(tool === 'ALL'){ - info = { icon: 'xm-iconfont xm-icon-quanxuan', name: '全选', method: (pageData) => { + info = { icon: 'xm-iconfont xm-icon-quanxuan', name, method: (pageData) => { const { optgroup, disabled } = prop; const list = pageData.filter(item => !item[optgroup]).filter(item => !item[disabled]) this.props.onReset(mergeArr(list, sels, prop), 'sels'); } }; }else if(tool === 'CLEAR'){ - info = { icon: 'xm-iconfont xm-icon-qingkong', name: '清空', method: (pageData) => { + info = { icon: 'xm-iconfont xm-icon-qingkong', name, method: (pageData) => { this.props.onReset(sels.filter(item => item[prop.disabled]), 'sels'); } }; + }else if(tool === 'REVERSE'){ + info = { icon: 'xm-iconfont xm-icon-fanxuan', name, method: (pageData) => { + const { optgroup, disabled } = prop; + const list = pageData.filter(item => !item[optgroup]).filter(item => !item[disabled]) + + let selectedList = []; + sels.forEach(item => { + let index = list.findIndex(pageItem => pageItem[value] === item[value]); + if(index == -1){ + selectedList.push(item); + }else{ + list.splice(index, 1); + } + }) + this.props.onReset(mergeArr(list, selectedList, prop), 'sels'); + } }; + }else if(tool === 'SEARCH'){ + toolStyle.color = theme.color; + info = { icon: 'xm-iconfont xm-icon-sousuo', name, method: (pageData) => { + + } }; }else { info = tool } @@ -304,7 +338,7 @@ class General extends Component{ if(e.type === 'mouseleave') e.target.style.color = ''; } - return (
{ + return (
{ isFunction(info.method) && info.method(safetyArr) } } onMouseEnter={ hoverChange } onMouseLeave={ hoverChange }> { config.toolbar.showIcon && } @@ -354,9 +388,9 @@ class General extends Component{ arr = arr.map(renderGroup); if(!arr.length){ - arr.push( creator ? renderItem(creator) : ( -
{ empty }
- )) + //查看无数据情况下是否显示分页 + !config.pageEmptyShow && (paging = ''); + arr.push(
{ empty }
) } return (