diff --git a/build/ColumnManager.js b/build/ColumnManager.js
index 449410b..54fed61 100644
--- a/build/ColumnManager.js
+++ b/build/ColumnManager.js
@@ -42,7 +42,7 @@ var ColumnManager = function () {
title: "",
key: "dragHandle",
dataIndex: "dragHandle",
- fixed: "left",
+ // fixed:"left",
width: 49,
render: function render() {
return _react2["default"].createElement(_beeIcon2["default"], { type: 'uf-navmenu' });
diff --git a/build/Table.css b/build/Table.css
index ff15b43..afc4d36 100644
--- a/build/Table.css
+++ b/build/Table.css
@@ -209,6 +209,8 @@
color: #1565c0; }
.u-table td a:active {
color: #1565c0; }
+ .u-table td .u-switch-span {
+ display: inline-block; }
.u-table thead tr:last-child {
border-bottom: 1px solid #C1C7D0; }
.u-table thead tr > th:last-child {
diff --git a/build/Table.js b/build/Table.js
index 0ab602f..4a22efb 100644
--- a/build/Table.js
+++ b/build/Table.js
@@ -239,7 +239,7 @@ var Table = function (_Component) {
console.log('向上拖');
arr.splice(index2 + 1, 0, value1);
}
- // arr[index1] = arr.splice(index2, 1, arr[index1])[0];
+
return arr;
};
diff --git a/build/TableRow.js b/build/TableRow.js
index 4383309..e9342c6 100644
--- a/build/TableRow.js
+++ b/build/TableRow.js
@@ -160,21 +160,28 @@ var TableRow = function (_Component) {
};
_this.onTouchStart = function (e) {
+ e.stopPropagation();
var onDragRowStart = _this.props.onDragRowStart;
var event = _utils.Event.getEvent(e),
_target = _utils.Event.getTarget(event),
target = _target.parentNode;
- while (target.tagName != 'TR') {
- target = target.parentNode;
- }
- _this.currentIndex = target.getAttribute("data-row-key");
+ if (target.tagName === 'TR') {
- onDragRowStart && onDragRowStart(_this.currentIndex);
+ _this.currentIndex = target.getAttribute("data-row-key");
+
+ onDragRowStart && onDragRowStart(_this.currentIndex);
+ } else {
+
+ _this.canBeTouch = false;
+ }
};
_this.onTouchMove = function (e) {
+
+ if (!_this.canBeTouch) return;
+ e.stopPropagation();
var event = _utils.Event.getEvent(e);
event.preventDefault();
var touchTarget = _this.getTouchDom(event),
@@ -191,6 +198,13 @@ var TableRow = function (_Component) {
};
_this.onTouchEnd = function (e) {
+
+ if (!_this.canBeTouch) {
+ _this.canBeTouch = true;
+ return;
+ }
+
+ e.stopPropagation();
var onDragRow = _this.props.onDragRow;
var event = _utils.Event.getEvent(e),
@@ -321,6 +335,7 @@ var TableRow = function (_Component) {
_this.expandHeight = 0;
_this.event = false;
_this.cacheCurrentIndex = null;
+ _this.canBeTouch = true; //受否允许拖动该行
return _this;
}
diff --git a/demo/demolist/Demo1201.js b/demo/demolist/Demo1201.js
index 5c31298..f364bee 100644
--- a/demo/demolist/Demo1201.js
+++ b/demo/demolist/Demo1201.js
@@ -8,11 +8,12 @@
import React, { Component } from "react";
import Table from "../../src";
+import Switch from 'bee-switch';
const columns = [
{ title: "员工编号", dataIndex: "a", key: "a", width: 150 },
{ title: "员工姓名", dataIndex: "b", key: "b", width:200 },
- { title: "性别", dataIndex: "c", key: "c", width: 500 },
+ { title: "系统权限", dataIndex: "c", key: "c", width: 200,render:()=>{return(