修改表头背景色、分割线颜色、文字颜色、行高

This commit is contained in:
yangchch6 2019-03-27 10:56:32 +08:00
parent 58153b98a2
commit 533e85a779
16 changed files with 1495 additions and 1551 deletions

View File

@ -1,168 +1,8 @@
@charset "UTF-8";
/* FormGroup */ /* FormGroup */
/* Navlayout */ /* Navlayout */
/* FormGroup */
/* Navlayout */
/**
* 加载背景
*/
/**
* 文字
*/
.u-loading-desc {
position: absolute;
bottom: 0;
left: 0;
right: 0;
font-size: 16px;
color: #000;
text-align: center; }
/**
* default样式 单个圆圈加载
*/
.u-loading.u-loading-rotate > div {
position: absolute;
border-radius: 100%;
margin: 2px;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
width: 40px;
height: 40px;
top: 50%;
left: 50%;
margin-left: -22px;
margin-top: -22px;
background: transparent !important;
display: inline-block;
-webkit-animation: rotate 1.5s 0s linear infinite;
animation: rotate 1.5s 0s linear infinite;
text-align: center;
line-height: 40px; }
.u-loading.u-loading-rotate > div > .uf {
color: #0084ff;
font-size: 40px;
padding: 0; }
.u-loading.u-loading-rotate.u-loading-rotate-lg > div {
margin-left: -35px;
margin-top: -35px;
width: 60px;
height: 60px;
line-height: 60px; }
.u-loading.u-loading-rotate.u-loading-rotate-lg > div > .uf {
font-size: 60px; }
.u-loading.u-loading-rotate.u-loading-rotate-sm > div {
margin-left: -15px;
margin-top: -15px;
width: 25px;
height: 25px;
line-height: 25px; }
.u-loading.u-loading-rotate.u-loading-rotate-sm > div > .uf {
font-size: 25px; }
.u-loading.u-loading-rotate.u-loading-rotate-primary > div > .uf {
color: #3f51b5; }
.u-loading.u-loading-rotate.u-loading-rotate-success > div > .uf {
color: #4caf50; }
.u-loading.u-loading-rotate.u-loading-rotate-warning > div > .uf {
color: #ff9800; }
.u-loading-backdrop {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1900;
opacity: .7;
filter: blur(0.5px);
background-color: #fff; }
.u-loading-backdrop.full-screen {
position: fixed; }
@keyframes rotate {
0% {
-webkit-transform: rotate(0deg) scale(1);
transform: rotate(0deg) scale(1); }
50% {
-webkit-transform: rotate(180deg) scale(1);
transform: rotate(180deg) scale(1); }
100% {
-webkit-transform: rotate(360deg) scale(1);
transform: rotate(360deg) scale(1); } }
.u-loading.u-loading-line {
position: absolute;
top: 50%;
left: 50%;
margin-top: -30px;
margin-left: -25px; }
.u-loading.u-loading-line > div {
background-color: #C2C3C5;
width: 6px;
height: 50px;
border-radius: 2px;
margin: 2px;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
display: inline-block; }
.u-loading.u-loading-line.u-loading-line-lg {
margin-top: -50px;
margin-left: -30px; }
.u-loading.u-loading-line.u-loading-line-lg > div {
width: 8px;
height: 90px; }
.u-loading.u-loading-line.u-loading-line-sm {
margin-top: -22px;
margin-left: -20px; }
.u-loading.u-loading-line.u-loading-line-sm > div {
width: 4px;
height: 35px; }
.u-loading.u-loading-line div:nth-child(1) {
-webkit-animation: line-scale 1s 0.1s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
animation: line-scale 1s 0.1s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #F44336; }
.u-loading.u-loading-line div:nth-child(2) {
-webkit-animation: line-scale 1s 0.2s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
animation: line-scale 1s 0.2s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #7ED321; }
.u-loading.u-loading-line div:nth-child(3) {
-webkit-animation: line-scale 1s 0.3s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
animation: line-scale 1s 0.3s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #0084FF; }
.u-loading.u-loading-line div:nth-child(4) {
-webkit-animation: line-scale 1s 0.4s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
animation: line-scale 1s 0.4s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #FF9800; }
.u-loading.u-loading-line div:nth-child(5) {
-webkit-animation: line-scale 1s 0.5s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
animation: line-scale 1s 0.5s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #D0021B; }
.u-loading.u-loading-line.u-loading-line-primary > div {
background-color: #3f51b5; }
.u-loading.u-loading-line.u-loading-line-success > div {
background-color: #4caf50; }
.u-loading.u-loading-line.u-loading-line-warning > div {
background-color: #ff9800; }
@keyframes line-scale {
0% {
-webkit-transform: scaley(1);
transform: scaley(1); }
50% {
-webkit-transform: scaley(0.4);
transform: scaley(0.4); }
100% {
-webkit-transform: scaley(1);
transform: scaley(1); } }
.u-table { .u-table {
font-size: 12px; font-size: 12px;
color: #666; color: #212121;
position: relative; position: relative;
line-height: 1.5; line-height: 1.5;
overflow: hidden; } overflow: hidden; }
@ -179,14 +19,14 @@
border-collapse: collapse; border-collapse: collapse;
text-align: left; } text-align: left; }
.u-table th { .u-table th {
font-weight: bold; font-weight: normal;
text-align: left; } text-align: left; }
.u-table th[colspan] { .u-table th[colspan] {
text-align: center; } text-align: center; }
.u-table th ::last-child { .u-table th ::last-child {
overflow: hidden; } overflow: hidden; }
.u-table td { .u-table td {
border-bottom: 1px solid rgb(233,233,233); } border-bottom: 1px solid rgb(193, 199, 208); }
.u-table td a { .u-table td a {
color: #2196F3; } color: #2196F3; }
.u-table td a:hover { .u-table td a:hover {
@ -217,22 +57,22 @@
.u-table-scroll { .u-table-scroll {
overflow: auto; } overflow: auto; }
.u-table-bordered table { .u-table-bordered table {
border: 1px solid rgb(233,233,233); border: 1px solid rgb(193, 199, 208);
box-sizing: border-box; box-sizing: border-box;
table-layout: fixed; } table-layout: fixed; }
.u-table-bordered th { .u-table-bordered th {
border-bottom: 1px solid rgb(233,233,233); border-bottom: 1px solid rgb(193, 199, 208);
box-sizing: border-box; } box-sizing: border-box; }
.u-table-bordered th, .u-table-bordered th,
.u-table-bordered td { .u-table-bordered td {
border-right: 1px solid rgb(233,233,233); border-right: 1px solid rgb(193, 199, 208);
box-sizing: border-box; } box-sizing: border-box; }
.u-table-drag-border tr th.th-can-not-drag { .u-table-drag-border tr th.th-can-not-drag {
overflow: hidden; } overflow: hidden; }
.u-table-header { .u-table-header {
overflow: hidden; overflow: hidden;
background: rgb(247,247,247); background: rgb(241, 242, 245);
color: rgb(102, 102, 102); } color: rgb(33, 33, 33); }
.u-table.fixed-height td { .u-table.fixed-height td {
padding: 0px 8px; } padding: 0px 8px; }
.u-table-fixed-header .u-table-body { .u-table-fixed-header .u-table-body {
@ -254,12 +94,12 @@
box-sizing: border-box; } box-sizing: border-box; }
.u-table-title { .u-table-title {
padding: 12px 8px; padding: 12px 8px;
border-top: 1px solid rgb(233,233,233); } border-top: 1px solid rgb(193, 199, 208); }
.u-table-content { .u-table-content {
position: relative; } position: relative; }
.u-table-footer { .u-table-footer {
padding: 12px 8px; padding: 12px 8px;
border-bottom: 1px solid rgb(233,233,233); } border-bottom: 1px solid rgb(193, 199, 208); }
.u-table-footer .u-table-scroll { .u-table-footer .u-table-scroll {
overflow-x: hidden; } overflow-x: hidden; }
.u-table-footer .u-table { .u-table-footer .u-table {
@ -267,7 +107,7 @@
.u-table-placeholder { .u-table-placeholder {
padding: 12px 8px; padding: 12px 8px;
background: #fff; background: #fff;
border-bottom: 1px solid rgb(233,233,233); border-bottom: 1px solid rgb(193, 199, 208);
text-align: center; text-align: center;
position: relative; } position: relative; }
.u-table-expand-icon-col { .u-table-expand-icon-col {
@ -280,7 +120,7 @@
height: 16px; height: 16px;
text-align: center; text-align: center;
line-height: 16px; line-height: 16px;
border: 1px solid rgb(233,233,233); border: 1px solid rgb(193, 199, 208);
user-select: none; user-select: none;
background: #fff; background: #fff;
margin-right: 10px; } margin-right: 10px; }
@ -356,14 +196,14 @@
.u-table-thead .filter-wrap .filter-btns { .u-table-thead .filter-wrap .filter-btns {
min-width: 58px; } min-width: 58px; }
.u-table-thead th { .u-table-thead th {
background: rgb(247,247,247); background: rgb(241, 242, 245);
color: rgb(102, 102, 102); color: rgb(33, 33, 33);
background-clip: padding-box; background-clip: padding-box;
-moz-user-select: -moz-none; -moz-user-select: -moz-none;
-khtml-user-select: none; -khtml-user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
/* /*
Introduced in IE 10. Introduced in IE 10.
*/ */
-ms-user-select: none; -ms-user-select: none;
user-select: none; } user-select: none; }
@ -453,7 +293,7 @@
height: 25px; height: 25px;
line-height: 25px; line-height: 25px;
z-index: 2; z-index: 2;
background: #f7f7f7; } background: rgb(241, 242, 245); }
.u-table-filter-column-filter-iconi.uf { .u-table-filter-column-filter-iconi.uf {
padding: 0px; } padding: 0px; }
.u-table-filter-column-pop-cont-item { .u-table-filter-column-pop-cont-item {
@ -489,7 +329,7 @@
.u-table.bordered th, .u-table.bordered th,
.u-table.bordered td { .u-table.bordered td {
border: 1px solid rgb(233,233,233); } border: 1px solid rgb(193, 199, 208); }
.move-enter, .move-enter,
.move-appear { .move-appear {

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
@ -36,137 +36,137 @@ var cloneDeep = require('lodash.clonedeep');
function dragColumn(Table) { function dragColumn(Table) {
return function (_Component) { return function (_Component) {
_inherits(DragColumn, _Component); _inherits(DragColumn, _Component);
function DragColumn(props) { function DragColumn(props) {
_classCallCheck(this, DragColumn); _classCallCheck(this, DragColumn);
var _this = _possibleConstructorReturn(this, _Component.call(this, props)); var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.setColumOrderByIndex = function (_column) { _this.setColumOrderByIndex = function (_column) {
_column.forEach(function (da, i) { _column.forEach(function (da, i) {
da.dragIndex = i; da.dragIndex = i;
da.drgHover = false; da.drgHover = false;
}); });
return _column; return _column;
}; };
_this.onDrop = function (event, data) { _this.onDrop = function (event, data) {
var dragSource = data.dragSource, var dragSource = data.dragSource,
dragTarg = data.dragTarg; dragTarg = data.dragTarg;
var columns = _this.state.columns; var columns = _this.state.columns;
var sourceIndex = -1, var sourceIndex = -1,
targetIndex = -1; targetIndex = -1;
sourceIndex = columns.findIndex(function (da, i) { sourceIndex = columns.findIndex(function (da, i) {
return da.key == dragSource.key; return da.key == dragSource.key;
}); });
targetIndex = columns.findIndex(function (da, i) { targetIndex = columns.findIndex(function (da, i) {
return da.key == dragTarg.key; return da.key == dragTarg.key;
}); });
// for (let index = 0; index < columns.length; index++) { // for (let index = 0; index < columns.length; index++) {
// const da = columns[index]; // const da = columns[index];
// if(da.key === dragSource.key){ // if(da.key === dragSource.key){
// columns[index] = dragTargColum; // columns[index] = dragTargColum;
// } // }
// if(da.key === dragTarg.key){ // if(da.key === dragTarg.key){
// columns[index] = dragSourceColum; // columns[index] = dragSourceColum;
// } // }
// } // }
// 向前移动 // 向前移动
if (targetIndex < sourceIndex) { if (targetIndex < sourceIndex) {
targetIndex = targetIndex + 1; targetIndex = targetIndex + 1;
}
columns.splice(targetIndex, 0, columns.splice(sourceIndex, 1)[0]);
_this.setState({
columns: cloneDeep(columns)
});
if (_this.props.onDrop) {
_this.props.onDrop(event, data, columns);
}
};
_this.getTarget = function (evt) {
return evt.target || evt.srcElement;
};
_this.state = {
columns: _this.setColumOrderByIndex(props.columns)
};
return _this;
} }
columns.splice(targetIndex, 0, columns.splice(sourceIndex, 1)[0]);
_this.setState({ DragColumn.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
columns: cloneDeep(columns) if (nextProps.columns != this.props.columns) {
this.setState({
columns: this.setColumOrderByIndex(nextProps.columns)
});
}
};
DragColumn.prototype.cloneDeep = function cloneDeep(obj) {
if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || Object.keys(obj).length === 0) {
return obj;
}
var resultData = {};
return this.recursion(obj, resultData);
};
DragColumn.prototype.recursion = function (_recursion) {
function recursion(_x) {
return _recursion.apply(this, arguments);
}
recursion.toString = function () {
return _recursion.toString();
};
return recursion;
}(function (obj) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
for (key in obj) {
if (_typeof(obj[key]) == 'object' && Object.keys(obj[key].length > 0)) {
data[key] = recursion(obj[key]);
} else {
data[key] = obj[key];
}
}
return data;
}); });
if (_this.props.onDrop) {
_this.props.onDrop(event, data, columns);
}
};
_this.getTarget = function (evt) { DragColumn.prototype.render = function render() {
return evt.target || evt.srcElement; var _props = this.props,
}; data = _props.data,
dragborder = _props.dragborder,
draggable = _props.draggable,
className = _props.className,
columns = _props.columns,
onDragStart = _props.onDragStart,
onDragEnter = _props.onDragEnter,
onDragOver = _props.onDragOver,
onDrop = _props.onDrop,
others = _objectWithoutProperties(_props, ['data', 'dragborder', 'draggable', 'className', 'columns', 'onDragStart', 'onDragEnter', 'onDragOver', 'onDrop']);
_this.state = { var key = new Date().getTime();
columns: _this.setColumOrderByIndex(props.columns) return _react2["default"].createElement(Table, _extends({}, others, {
}; columns: this.state.columns,
return _this; data: data,
} className: className + ' u-table-drag-border',
onDragStart: this.onDragStart,
onDragOver: this.onDragOver,
onDrop: this.onDrop,
onDragEnter: this.onDragEnter,
draggable: draggable,
dragborder: dragborder
// dragborder={false}
, dragborderKey: key
}));
};
DragColumn.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { return DragColumn;
if (nextProps.columns != this.props.columns) { }(_react.Component);
this.setState({
columns: this.setColumOrderByIndex(nextProps.columns)
});
}
};
DragColumn.prototype.cloneDeep = function cloneDeep(obj) {
if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || Object.keys(obj).length === 0) {
return obj;
}
var resultData = {};
return this.recursion(obj, resultData);
};
DragColumn.prototype.recursion = function (_recursion) {
function recursion(_x) {
return _recursion.apply(this, arguments);
}
recursion.toString = function () {
return _recursion.toString();
};
return recursion;
}(function (obj) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
for (key in obj) {
if (_typeof(obj[key]) == 'object' && Object.keys(obj[key].length > 0)) {
data[key] = recursion(obj[key]);
} else {
data[key] = obj[key];
}
}
return data;
});
DragColumn.prototype.render = function render() {
var _props = this.props,
data = _props.data,
dragborder = _props.dragborder,
draggable = _props.draggable,
className = _props.className,
columns = _props.columns,
onDragStart = _props.onDragStart,
onDragEnter = _props.onDragEnter,
onDragOver = _props.onDragOver,
onDrop = _props.onDrop,
others = _objectWithoutProperties(_props, ['data', 'dragborder', 'draggable', 'className', 'columns', 'onDragStart', 'onDragEnter', 'onDragOver', 'onDrop']);
var key = new Date().getTime();
return _react2["default"].createElement(Table, _extends({}, others, {
columns: this.state.columns,
data: data,
className: className + ' u-table-drag-border',
onDragStart: this.onDragStart,
onDragOver: this.onDragOver,
onDrop: this.onDrop,
onDragEnter: this.onDragEnter,
draggable: draggable,
dragborder: dragborder
// dragborder={false}
, dragborderKey: key
}));
};
return DragColumn;
}(_react.Component);
} }
module.exports = exports['default']; module.exports = exports['default'];

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
@ -20,29 +20,29 @@ exports.ObjectAssign = ObjectAssign;
*/ */
function sortBy(arr, prop, desc) { function sortBy(arr, prop, desc) {
var props = [], var props = [],
ret = [], ret = [],
i = 0, i = 0,
len = arr.length; len = arr.length;
if (typeof prop == 'string') { if (typeof prop == 'string') {
for (; i < len; i++) { for (; i < len; i++) {
var oI = arr[i]; var oI = arr[i];
(props[i] = new String(oI && oI[prop] || ''))._obj = oI; (props[i] = new String(oI && oI[prop] || ''))._obj = oI;
}
} else if (typeof prop == 'function') {
for (; i < len; i++) {
var _oI = arr[i];
(props[i] = new String(_oI && prop(_oI) || ''))._obj = _oI;
}
} else {
throw '参数类型错误';
} }
props.sort(); } else if (typeof prop == 'function') {
for (i = 0; i < len; i++) { for (; i < len; i++) {
ret[i] = props[i]._obj; var _oI = arr[i];
(props[i] = new String(_oI && prop(_oI) || ''))._obj = _oI;
} }
if (desc) ret.reverse(); } else {
return ret; throw '参数类型错误';
}
props.sort();
for (i = 0; i < len; i++) {
ret[i] = props[i]._obj;
}
if (desc) ret.reverse();
return ret;
}; };
/** /**
@ -51,11 +51,11 @@ function sortBy(arr, prop, desc) {
* @param {} property * @param {} property
*/ */
function compare(property) { function compare(property) {
return function (a, b) { return function (a, b) {
var value1 = a[property]; var value1 = a[property];
var value2 = b[property]; var value2 = b[property];
return value1 - value2; return value1 - value2;
}; };
} }
/** /**
@ -63,17 +63,17 @@ function compare(property) {
* @param {*} obj 要拷贝的对象 * @param {*} obj 要拷贝的对象
*/ */
function ObjectAssign(obj) { function ObjectAssign(obj) {
var b = obj instanceof Array; var b = obj instanceof Array;
var tagObj = b ? [] : {}; var tagObj = b ? [] : {};
if (b) { if (b) {
//数组 //数组
obj.forEach(function (da) { obj.forEach(function (da) {
var _da = {}; var _da = {};
_extends(_da, da); _extends(_da, da);
tagObj.push(_da); tagObj.push(_da);
}); });
} else { } else {
_extends(tagObj, obj); _extends(tagObj, obj);
} }
return tagObj; return tagObj;
} }

View File

@ -6,7 +6,7 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import {Button,Tooltip} from "tinper-bee"; import {Button,Tooltip,Popconfirm} from "tinper-bee";
import Table from "../../src"; import Table from "../../src";
const columns = [ const columns = [
@ -37,15 +37,11 @@ const columns = [
render(text, record, index) { render(text, record, index) {
return ( return (
<div style={{ position: 'relative' }} title={text} > <div style={{ position: 'relative' }} title={text} >
<a <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
href="javascript:;" <a href="javascript:;" tooltip={text}>
tooltip={text} 一些操作
onClick={() => { </a>
alert('这是第' + index + '列,内容为:' + text); </Popconfirm>
}}
>
一些操作
</a>
</div> </div>
); );
} }
@ -75,8 +71,8 @@ class Demo1 extends Component {
columns={columns} columns={columns}
data={data} data={data}
parentNodeId='parent' parentNodeId='parent'
height={43} height={40}
headerHeight={42} headerHeight={40}
onRowClick={(record, index, indent) => { onRowClick={(record, index, indent) => {
this.setState({ this.setState({
selectedRowIndex: index selectedRowIndex: index

View File

@ -7,7 +7,7 @@
import React, { Component } from "react"; import React, { Component } from "react";
import Table from "../../src"; import Table from "../../src";
import {Button} from "tinper-bee"; import {Button,Popconfirm} from "tinper-bee";
const columns17 = [ const columns17 = [
{ title: "用户名", dataIndex: "a", key: "a", width: 100 }, { title: "用户名", dataIndex: "a", key: "a", width: 100 },
@ -19,14 +19,11 @@ const columns17 = [
key: "d", key: "d",
render(text, record, index) { render(text, record, index) {
return ( return (
<a <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
href="#" <a href="javascript:;">
onClick={() => { 一些操作
alert('这是第'+index+'列,内容为:'+text); </a>
}} </Popconfirm>
>
一些操作
</a>
); );
} }
} }

View File

@ -6,6 +6,7 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import {Popconfirm} from 'tinper-bee';
import Table from "../../src"; import Table from "../../src";
import BigData from "../../src/lib/bigData"; import BigData from "../../src/lib/bigData";
const BigDataTable = BigData(Table); const BigDataTable = BigData(Table);
@ -17,14 +18,11 @@ const outColumns = [
width:200, width:200,
render(text, record, index) { render(text, record, index) {
return ( return (
<a <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
href="#" <a href="javascript:;">
onClick={() => { 一些操作
alert("这是第" + index + "列,内容为:" + text); </a>
}} </Popconfirm>
>
一些操作
</a>
); );
} }
}, },
@ -41,14 +39,11 @@ const innerColumns = [
width:200, width:200,
render(text, record, index) { render(text, record, index) {
return ( return (
<a <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
href="#" <a href="javascript:;">
onClick={() => { 一些操作
alert("这是第" + index + "列,内容为:" + text); </a>
}} </Popconfirm>
>
{'一些操作'+index}
</a>
); );
} }
}, },

View File

@ -7,7 +7,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Icon,Checkbox,Popover} from "tinper-bee"; import {Icon,Checkbox,Popover,Popconfirm} from "tinper-bee";
import Table from '../../src'; import Table from '../../src';
import filterColumn from '../../src/lib/filterColumn'; import filterColumn from '../../src/lib/filterColumn';
@ -63,19 +63,11 @@ class Demo21 extends Component {
render(text, record, index){ render(text, record, index){
return ( return (
<div title={text} > <div title={text} >
<a href="#" <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
tooltip={text} <a href="javascript:;" tooltip={text} >
onClick={() => { 一些操作
alert('这是第'+index+'列,内容为:'+text); </a>
}} </Popconfirm>
// style={{
// position: 'absolute',
// top: 5,
// left: 0
// }}
>
一些操作
</a>
</div> </div>
); );
} }

View File

@ -5,7 +5,7 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import {Tooltip,Button} from "tinper-bee"; import {Tooltip,Button,Popconfirm} from "tinper-bee";
import Table from "../../src"; import Table from "../../src";
const columns = [ const columns = [
@ -36,15 +36,11 @@ const columns = [
render(text, record, index) { render(text, record, index) {
return ( return (
<div style={{ position: 'relative' }} title={text} > <div style={{ position: 'relative' }} title={text} >
<a <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
href="javascript:;" <a href="javascript:;" tooltip={text} >
tooltip={text} 一些操作
onClick={() => { </a>
alert('这是第' + index + '列,内容为:' + text); </Popconfirm>
}}
>
一些操作
</a>
</div> </div>
); );
} }
@ -89,8 +85,8 @@ class Demo35 extends Component {
columns={columns} columns={columns}
data={data} data={data}
parentNodeId='parent' parentNodeId='parent'
height={43} height={40}
headerHeight={42} headerHeight={40}
hoverContent={this.getHoverContent} hoverContent={this.getHoverContent}
onRowHover={this.onRowHover} onRowHover={this.onRowHover}
onRowClick={(record, index, indent) => { onRowClick={(record, index, indent) => {

View File

@ -4,7 +4,7 @@
*/ */
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Icon,Checkbox,Popover} from "tinper-bee"; import {Icon,Checkbox,Popover,Popconfirm} from "tinper-bee";
import Table from '../../src'; import Table from '../../src';
import multiSelect from '../../src/lib/multiSelect'; import multiSelect from '../../src/lib/multiSelect';
@ -85,14 +85,11 @@ function getCloumns(){
render(text, record, index) { render(text, record, index) {
return ( return (
<div className='operation-btn'> <div className='operation-btn'>
<a href="#" <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
tooltip={text} <a href="javascript:;" tooltip={text} >
onClick={() => { 一些操作
alert('这是第'+index+'列,内容为:'+text); </a>
}} </Popconfirm>
>
一些操作
</a>
</div> </div>
) )
} }

View File

@ -6,6 +6,7 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { Popconfirm } from 'tinper-bee';
import Table from "../../src"; import Table from "../../src";
import dragColumn from '../../src/lib/dragColumn'; import dragColumn from '../../src/lib/dragColumn';
const DragColumnTable = dragColumn(Table); const DragColumnTable = dragColumn(Table);
@ -17,14 +18,11 @@ const columns16 = [
width:200, width:200,
render(text, record, index) { render(text, record, index) {
return ( return (
<a <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
href="#" <a href="javascript:;" tooltip={text} >
onClick={() => {
alert("这是第" + index + "列,内容为:" + text);
}}
>
一些操作 一些操作
</a> </a>
</Popconfirm>
); );
} }
}, },
@ -41,14 +39,11 @@ const columns17 = [
width:200, width:200,
render(text, record, index) { render(text, record, index) {
return ( return (
<a <Popconfirm trigger="click" placement="right" content={'这是第' + index + '行,内容为:' + text}>
href="#" <a href="javascript:;" tooltip={text} >
onClick={() => {
alert("这是第" + index + "列,内容为:" + text);
}}
>
一些操作 一些操作
</a> </a>
</Popconfirm>
); );
} }
}, },

File diff suppressed because one or more lines are too long

182
dist/demo.css vendored
View File

@ -1,154 +1,8 @@
@charset "UTF-8";
/* FormGroup */ /* FormGroup */
/* Navlayout */ /* Navlayout */
/* FormGroup */
/* Navlayout */
/**
* 加载背景
*/
/**
* 文字
*/
.u-loading-desc {
position: absolute;
bottom: 0;
left: 0;
right: 0;
font-size: 16px;
color: #000;
text-align: center; }
/**
* default样式 单个圆圈加载
*/
.u-loading.u-loading-rotate > div {
position: absolute;
border-radius: 100%;
margin: 2px;
animation-fill-mode: both;
width: 40px;
height: 40px;
top: 50%;
left: 50%;
margin-left: -22px;
margin-top: -22px;
background: transparent !important;
display: inline-block;
animation: rotate 1.5s 0s linear infinite;
text-align: center;
line-height: 40px; }
.u-loading.u-loading-rotate > div > .uf {
color: #0084ff;
font-size: 40px;
padding: 0; }
.u-loading.u-loading-rotate.u-loading-rotate-lg > div {
margin-left: -35px;
margin-top: -35px;
width: 60px;
height: 60px;
line-height: 60px; }
.u-loading.u-loading-rotate.u-loading-rotate-lg > div > .uf {
font-size: 60px; }
.u-loading.u-loading-rotate.u-loading-rotate-sm > div {
margin-left: -15px;
margin-top: -15px;
width: 25px;
height: 25px;
line-height: 25px; }
.u-loading.u-loading-rotate.u-loading-rotate-sm > div > .uf {
font-size: 25px; }
.u-loading.u-loading-rotate.u-loading-rotate-primary > div > .uf {
color: #3f51b5; }
.u-loading.u-loading-rotate.u-loading-rotate-success > div > .uf {
color: #4caf50; }
.u-loading.u-loading-rotate.u-loading-rotate-warning > div > .uf {
color: #ff9800; }
.u-loading-backdrop {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1900;
opacity: .7;
filter: blur(0.5px);
background-color: #fff; }
.u-loading-backdrop.full-screen {
position: fixed; }
@keyframes rotate {
0% {
transform: rotate(0deg) scale(1); }
50% {
transform: rotate(180deg) scale(1); }
100% {
transform: rotate(360deg) scale(1); } }
.u-loading.u-loading-line {
position: absolute;
top: 50%;
left: 50%;
margin-top: -30px;
margin-left: -25px; }
.u-loading.u-loading-line > div {
background-color: #C2C3C5;
width: 6px;
height: 50px;
border-radius: 2px;
margin: 2px;
animation-fill-mode: both;
display: inline-block; }
.u-loading.u-loading-line.u-loading-line-lg {
margin-top: -50px;
margin-left: -30px; }
.u-loading.u-loading-line.u-loading-line-lg > div {
width: 8px;
height: 90px; }
.u-loading.u-loading-line.u-loading-line-sm {
margin-top: -22px;
margin-left: -20px; }
.u-loading.u-loading-line.u-loading-line-sm > div {
width: 4px;
height: 35px; }
.u-loading.u-loading-line div:nth-child(1) {
animation: line-scale 1s 0.1s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #F44336; }
.u-loading.u-loading-line div:nth-child(2) {
animation: line-scale 1s 0.2s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #7ED321; }
.u-loading.u-loading-line div:nth-child(3) {
animation: line-scale 1s 0.3s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #0084FF; }
.u-loading.u-loading-line div:nth-child(4) {
animation: line-scale 1s 0.4s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #FF9800; }
.u-loading.u-loading-line div:nth-child(5) {
animation: line-scale 1s 0.5s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
background-color: #D0021B; }
.u-loading.u-loading-line.u-loading-line-primary > div {
background-color: #3f51b5; }
.u-loading.u-loading-line.u-loading-line-success > div {
background-color: #4caf50; }
.u-loading.u-loading-line.u-loading-line-warning > div {
background-color: #ff9800; }
@keyframes line-scale {
0% {
transform: scaley(1); }
50% {
transform: scaley(0.4); }
100% {
transform: scaley(1); } }
.u-table { .u-table {
font-size: 12px; font-size: 12px;
color: #666; color: #212121;
position: relative; position: relative;
line-height: 1.5; line-height: 1.5;
overflow: hidden; } overflow: hidden; }
@ -165,14 +19,14 @@
border-collapse: collapse; border-collapse: collapse;
text-align: left; } text-align: left; }
.u-table th { .u-table th {
font-weight: bold; font-weight: normal;
text-align: left; } text-align: left; }
.u-table th[colspan] { .u-table th[colspan] {
text-align: center; } text-align: center; }
.u-table th ::last-child { .u-table th ::last-child {
overflow: hidden; } overflow: hidden; }
.u-table td { .u-table td {
border-bottom: 1px solid rgb(233,233,233); } border-bottom: 1px solid rgb(193, 199, 208); }
.u-table td a { .u-table td a {
color: #2196F3; } color: #2196F3; }
.u-table td a:hover { .u-table td a:hover {
@ -203,22 +57,22 @@
.u-table-scroll { .u-table-scroll {
overflow: auto; } overflow: auto; }
.u-table-bordered table { .u-table-bordered table {
border: 1px solid rgb(233,233,233); border: 1px solid rgb(193, 199, 208);
box-sizing: border-box; box-sizing: border-box;
table-layout: fixed; } table-layout: fixed; }
.u-table-bordered th { .u-table-bordered th {
border-bottom: 1px solid rgb(233,233,233); border-bottom: 1px solid rgb(193, 199, 208);
box-sizing: border-box; } box-sizing: border-box; }
.u-table-bordered th, .u-table-bordered th,
.u-table-bordered td { .u-table-bordered td {
border-right: 1px solid rgb(233,233,233); border-right: 1px solid rgb(193, 199, 208);
box-sizing: border-box; } box-sizing: border-box; }
.u-table-drag-border tr th.th-can-not-drag { .u-table-drag-border tr th.th-can-not-drag {
overflow: hidden; } overflow: hidden; }
.u-table-header { .u-table-header {
overflow: hidden; overflow: hidden;
background: rgb(247,247,247); background: rgb(241, 242, 245);
color: rgb(102, 102, 102); } color: rgb(33, 33, 33); }
.u-table.fixed-height td { .u-table.fixed-height td {
padding: 0px 8px; } padding: 0px 8px; }
.u-table-fixed-header .u-table-body { .u-table-fixed-header .u-table-body {
@ -240,12 +94,12 @@
box-sizing: border-box; } box-sizing: border-box; }
.u-table-title { .u-table-title {
padding: 12px 8px; padding: 12px 8px;
border-top: 1px solid rgb(233,233,233); } border-top: 1px solid rgb(193, 199, 208); }
.u-table-content { .u-table-content {
position: relative; } position: relative; }
.u-table-footer { .u-table-footer {
padding: 12px 8px; padding: 12px 8px;
border-bottom: 1px solid rgb(233,233,233); } border-bottom: 1px solid rgb(193, 199, 208); }
.u-table-footer .u-table-scroll { .u-table-footer .u-table-scroll {
overflow-x: hidden; } overflow-x: hidden; }
.u-table-footer .u-table { .u-table-footer .u-table {
@ -253,7 +107,7 @@
.u-table-placeholder { .u-table-placeholder {
padding: 12px 8px; padding: 12px 8px;
background: #fff; background: #fff;
border-bottom: 1px solid rgb(233,233,233); border-bottom: 1px solid rgb(193, 199, 208);
text-align: center; text-align: center;
position: relative; } position: relative; }
.u-table-expand-icon-col { .u-table-expand-icon-col {
@ -266,7 +120,7 @@
height: 16px; height: 16px;
text-align: center; text-align: center;
line-height: 16px; line-height: 16px;
border: 1px solid rgb(233,233,233); border: 1px solid rgb(193, 199, 208);
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
@ -348,13 +202,13 @@
.u-table-thead .filter-wrap .filter-btns { .u-table-thead .filter-wrap .filter-btns {
min-width: 58px; } min-width: 58px; }
.u-table-thead th { .u-table-thead th {
background: rgb(247,247,247); background: rgb(241, 242, 245);
color: rgb(102, 102, 102); color: rgb(33, 33, 33);
background-clip: padding-box; background-clip: padding-box;
-moz-user-select: -moz-none; -moz-user-select: -moz-none;
-webkit-user-select: none; -webkit-user-select: none;
/* /*
Introduced in IE 10. Introduced in IE 10.
*/ */
-ms-user-select: none; -ms-user-select: none;
user-select: none; } user-select: none; }
@ -441,7 +295,7 @@
height: 25px; height: 25px;
line-height: 25px; line-height: 25px;
z-index: 2; z-index: 2;
background: #f7f7f7; } background: rgb(241, 242, 245); }
.u-table-filter-column-filter-iconi.uf { .u-table-filter-column-filter-iconi.uf {
padding: 0px; } padding: 0px; }
.u-table-filter-column-pop-cont-item { .u-table-filter-column-pop-cont-item {
@ -477,7 +331,7 @@
.u-table.bordered th, .u-table.bordered th,
.u-table.bordered td { .u-table.bordered td {
border: 1px solid rgb(233,233,233); } border: 1px solid rgb(193, 199, 208); }
.move-enter, .move-enter,
.move-appear { .move-appear {

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

2194
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
@import "../node_modules/tinper-bee-core/scss/minxin-mixins"; @import "../node_modules/tinper-bee-core/scss/minxin-mixins";
// @import "../node_modules/bee-loading/src/Loading"; // @import "../node_modules/bee-loading/src/Loading";
$text-color: #666; $text-color: $font-color-base;
$font-size-base: 12px; $font-size-base: 12px;
$line-height: 1.5; $line-height: 1.5;
// 主题定制border // 主题定制border
@ -44,7 +44,7 @@ $checkbox-height:16px;
th { th {
// background: $table-head-background-color; // background: $table-head-background-color;
font-weight: bold; font-weight: normal;
text-align: left; text-align: left;
// transition: background 0.3s ease; // transition: background 0.3s ease;
&[colspan] { &[colspan] {