Permalink
Browse files

fix: pro-IUAPDESIGN-41:云表单:grid提供在移动端的样式修改方案

  • Loading branch information...
1 parent 0a84f55 commit 8b08272faf60422a48909bbe60581e92cd792487 liuyk committed Oct 26, 2016
Showing with 81 additions and 26 deletions.
  1. +13 −13 CHANGELOG.md
  2. +32 −5 dist/js/u-grid.js
  3. +6 −5 dist/js/u-grid.min.js
  4. +24 −0 js/gridBrowser.js
  5. +5 −2 js/gridCompCreate.js
  6. +1 −1 js/gridCompInit.js
View
@@ -2,39 +2,39 @@
## [3.1.3](https://github.com/iuap-design/tinper-neoui-grid/compare/v3.1.1...v3.1.3) (2016-10-25)
-### Bug Fixes
+### Bug Fixes
* pro-IUAPDESIGN-101:友云采:grid中横向滚动时需要隐藏编辑控件 ([928fdf1](https://github.com/iuap-design/tinper-neoui-grid/commit/928fdf1))
-
+
* pro-IUAPDESIGN-46:友云采:gird不出现左右滚动条(方案:px改为百分比) ([6c83f92](https://github.com/iuap-design/tinper-neoui-grid/commit/6c83f92))
-
+
* pro-IUAPDESIGN-89:友云采:grid没有数据的话下面的边线没有显示 ([bfa688f](https://github.com/iuap-design/tinper-neoui-grid/commit/bfa688f))
-
+
* pro-IUAPDESIGN-92:友云采:关联计算的数据在合计行的显示 ([f67aad8](https://github.com/iuap-design/tinper-neoui-grid/commit/f67aad8))
-
+
* pro-IUAPDESIGN-95:友云采:内容区点击之后第一次选中,第二次取消选中 ([b42059a](https://github.com/iuap-design/tinper-neoui-grid/commit/b42059a))
-
+
* pro-IUAPDESIGN-96:友云采:grid中取消选中之后的全选显示不对 ([eafb2dc](https://github.com/iuap-design/tinper-neoui-grid/commit/eafb2dc))
-
+
* pro-IUAPDESIGN-98:友云采:grid中title显示为id,renderType存在时取消td的title。 ([fe1160a](https://github.com/iuap-design/tinper-neoui-grid/commit/fe1160a))
-
+
* 增加参数noScroll控制grid不显示滚动条 ([a20304f](https://github.com/iuap-design/tinper-neoui-grid/commit/a20304f))
-
+
<a name="3.1.1"></a>
## [3.1.1](https://github.com/iuap-design/tinper-neoui-grid/compare/3.0.6...v3.1.1) (2016-10-17)
-### Bug Fixes
+### Bug Fixes
* fix test ([4d7ecc7](https://github.com/iuap-design/tinper-neoui-grid/commit/4d7ecc7))
-
+
* gird默认id绑定随机值避免冲突 ([e478905](https://github.com/iuap-design/tinper-neoui-grid/commit/e478905))
-
+
* 数表删除上的时候会导致数据丢失 ([48281f1](https://github.com/iuap-design/tinper-neoui-grid/commit/48281f1))
-
+
### Features
* feat test ([9699a16](https://github.com/iuap-design/tinper-neoui-grid/commit/9699a16))
View
@@ -1,5 +1,5 @@
/**
- * tinper-neoui-grid v3.1.3
+ * tinper-neoui-grid v3.1.4
* grid
* author : yonyou FED
* homepage : https://github.com/iuap-design/tinper-neoui-grid#readme
@@ -1641,7 +1641,8 @@
var createDivs = function createDivs() {
var oThis = this,
styleStr = '',
- str = '';
+ str = '',
+ mobileClass = '';
this.ele.innerHTML = '';
if (this.options.width) {
str += 'width:' + this.options.width + ';';
@@ -1656,7 +1657,10 @@
if (str != '') {
styleStr = 'style="' + str + '"';
}
- var htmlStr = '<div id="' + this.options.id + '" data-role="grid" class="u-grid" ' + styleStr + '>';
+ if (_gridBrowser.gridBrowser.isMobile) {
+ mobileClass = 'u-grid-mobile';
+ }
+ var htmlStr = '<div id="' + this.options.id + '" data-role="grid" class="u-grid ' + mobileClass + '" ' + styleStr + '>';
htmlStr += '</div>';
this.ele.insertAdjacentHTML('afterBegin', htmlStr);
// 创建屏幕div,用于拖动等操作
@@ -2297,7 +2301,7 @@
/* 10 */
/***/ function(module, exports) {
- "use strict";
+ 'use strict';
exports.__esModule = true;
var gridBrowser = {},
@@ -2317,6 +2321,29 @@
}
}
}
+
+ if (ua.indexOf('Android') > -1 || ua.indexOf('android') > -1 || ua.indexOf('Adr') > -1 || ua.indexOf('adr') > -1) {
+ gridBrowser.isAndroid = true;
+ }
+
+ if (gridBrowser.isAndroid) {
+ if (window.screen.width >= 768 && window.screen.width < 1024) {
+ gridBrowser.isAndroidPAD = true;
+ }
+ if (window.screen.width <= 768) {
+ gridBrowser.isAndroidPhone = true;
+ }
+ }
+
+ if (ua.match(/iphone/i)) {
+ gridBrowser.isIOS = true;
+ gridBrowser.isIphone = true;
+ }
+
+ if (gridBrowser.isIphone || gridBrowser.isAndroidPhone) {
+ gridBrowser.isMobile = true;
+ }
+
exports.gridBrowser = gridBrowser;
/***/ },
@@ -2862,7 +2889,7 @@
};
var initGridCompColumnFun = function initGridCompColumnFun(columnOptions) {
var column = new _column.column(columnOptions, this);
- column.options.optionsWidth = column.options.width;
+ column.options.optionsWidth = column.options.width + '';
if (column.options.optionsWidth.indexOf("%") > 0) {
this.options.noScroll = 'true';
}
View
Oops, something went wrong.
View
@@ -14,4 +14,28 @@ if (gridBrowser.isIE) {
}
}
}
+
+if(ua.indexOf('Android') > -1 || ua.indexOf('android') > -1 || ua.indexOf('Adr') > -1 || ua.indexOf('adr') > -1) {
+ gridBrowser.isAndroid = true;
+}
+
+if(gridBrowser.isAndroid){
+ if(window.screen.width >= 768 && window.screen.width < 1024){
+ gridBrowser.isAndroidPAD=true;
+ }
+ if(window.screen.width <= 768) {
+ gridBrowser.isAndroidPhone = true;
+ }
+}
+
+
+if(ua.match(/iphone/i)) {
+ gridBrowser.isIOS = true;
+ gridBrowser.isIphone = true;
+}
+
+if(gridBrowser.isIphone || gridBrowser.isAndroidPhone){
+ gridBrowser.isMobile = true;
+}
+
export{gridBrowser}
@@ -4,7 +4,7 @@ import {gridBrowser} from './gridBrowser';
* 添加顶层div相关监听
*/
const createDivs = function() {
- var oThis = this,styleStr = '',str = '';
+ var oThis = this,styleStr = '',str = '', mobileClass = '';
this.ele.innerHTML = '';
if(this.options.width){
str += 'width:' + this.options.width + ';';
@@ -19,7 +19,10 @@ const createDivs = function() {
if(str != ''){
styleStr = 'style="' + str + '"';
}
- var htmlStr = '<div id="' + this.options.id + '" data-role="grid" class="u-grid" ' + styleStr + '>';
+ if(gridBrowser.isMobile){
+ mobileClass = 'u-grid-mobile';
+ }
+ var htmlStr = '<div id="' + this.options.id + '" data-role="grid" class="u-grid ' + mobileClass + '" ' + styleStr + '>';
htmlStr += '</div>';
this.ele.insertAdjacentHTML('afterBegin', htmlStr);
// 创建屏幕div,用于拖动等操作
View
@@ -235,7 +235,7 @@ const initGridCompColumnVar = function(){
};
const initGridCompColumnFun = function(columnOptions){
var column = new gridCompColumn(columnOptions, this);
- column.options.optionsWidth = column.options.width;
+ column.options.optionsWidth = column.options.width + '';
if(column.options.optionsWidth.indexOf("%") > 0){
this.options.noScroll = 'true';
}

0 comments on commit 8b08272

Please sign in to comment.