Comparing version 1.4.3 to 1.4.4
@@ -21,2 +21,3 @@ /// <reference types="react" /> | ||
selectedRowKeys: any[]; | ||
selectObjects: any[]; | ||
current: number; | ||
@@ -30,4 +31,4 @@ pageSize: number; | ||
search(pagination: any, filters: any, sorter: any): void; | ||
onSelect(selectedRowKeys: any): void; | ||
onSelect(selectedRowKeys: any, selectObjects: any): void; | ||
render(): JSX.Element; | ||
} |
@@ -47,2 +47,3 @@ "use strict"; | ||
selectedRowKeys: [], | ||
selectObjects: [], | ||
current: 1, | ||
@@ -118,5 +119,5 @@ pageSize: DefaultPageSize, | ||
// } | ||
TableLayout.prototype.onSelect = function (selectedRowKeys) { | ||
TableLayout.prototype.onSelect = function (selectedRowKeys, selectObjects) { | ||
this.setState({ | ||
selectedRowKeys: selectedRowKeys | ||
selectedRowKeys: selectedRowKeys, selectObjects: selectObjects | ||
}); | ||
@@ -146,2 +147,3 @@ }; | ||
var selectedRowKeys = []; | ||
var selectObjects = []; | ||
if (this.props.select) { | ||
@@ -153,2 +155,3 @@ // console.log(this.props.i) | ||
selectedRowKeys.push(item[_this.rowKey]); | ||
selectObjects.push(item); | ||
} | ||
@@ -158,3 +161,3 @@ }); | ||
selectedRowKeys: selectedRowKeys, | ||
onChange: function (selectedRowKeys) { return _this.onSelect(selectedRowKeys); }, | ||
onChange: function (selectedRowKeys, selectObjects) { return _this.onSelect(selectedRowKeys, selectObjects); }, | ||
getCheckboxProps: function (record) { return ({ | ||
@@ -166,3 +169,3 @@ disabled: !_.has(record, _this.rowKey) | ||
return (React.createElement(antd_1.Layout, null, | ||
React.createElement(TableHeader_1.default, __assign({ className: "table-header" }, this.props, { onQuery: function (param) { return _this.onQuery(param); }, selected: selectedRowKeys })), | ||
React.createElement(TableHeader_1.default, __assign({ className: "table-header" }, this.props, { onQuery: function (param) { return _this.onQuery(param); }, selected: selectedRowKeys, selectObjects: selectObjects })), | ||
React.createElement(antd_1.Layout.Content, null, | ||
@@ -169,0 +172,0 @@ React.createElement(antd_1.Table, __assign({}, this.props, params, { rowClassName: function (record, index) { |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
selected?: any[]; | ||
selectObjects?: any; | ||
} | ||
@@ -9,0 +10,0 @@ export default class TableHeader<T> extends React.Component<TableHeaderProps<T>, { |
@@ -200,3 +200,4 @@ "use strict"; | ||
if (action.action) { | ||
param.onClick = function () { return action.action(_this.props.selected); }; | ||
// console.log(this.props.selected) | ||
param.onClick = function () { return action.action(_this.props.selected, _this.props.selectObjects); }; | ||
} | ||
@@ -203,0 +204,0 @@ var name = action.name; |
@@ -16,2 +16,3 @@ /// <reference types="react" /> | ||
resize(): void; | ||
init(): void; | ||
sort(): void; | ||
@@ -18,0 +19,0 @@ componentWillMount(): void; |
@@ -46,2 +46,4 @@ "use strict"; | ||
}; | ||
default_1.prototype.init = function () { | ||
}; | ||
default_1.prototype.sort = function () { | ||
@@ -57,2 +59,3 @@ this.DATA = this.props.data; | ||
_a = [root.offsetWidth, root.offsetHeight], this.WIDTH = _a[0], this.HEIGHT = _a[1]; | ||
this.init(); | ||
this.SVG = d3.select(root).append('svg') | ||
@@ -59,0 +62,0 @@ .attr('width', this.WIDTH) |
@@ -1,4 +0,32 @@ | ||
declare const _default: {}; | ||
export default _default; | ||
/** | ||
* 基于d3,threejs的图形 | ||
* 为保证不重复引入,请保证请入前自行引入了相关的依赖,如 echarts,d3,threejs,g2 等。具体需要引入哪个参考图形说明 | ||
* | ||
* 计划中: | ||
* 1. 线条图 | ||
* 时间序列 | ||
* 堆叠 | ||
* | ||
* 2. 饼图 | ||
* 圆饼图 | ||
* 圆环图 | ||
* 玫瑰图 | ||
* | ||
* 3. 条形图 | ||
* 横向条形图 | ||
* 纵向条形图 | ||
* | ||
* 4. 地图 | ||
* 3D地图 | ||
* 伪3D地图 | ||
* 2D地图 | ||
* | ||
* 5. 雷达图 | ||
* | ||
* 6. 虚拟地图 | ||
* | ||
* 7. 3D地球 | ||
*/ | ||
export { default as BarChart } from './BarChart'; | ||
export { default as MapChart } from './MapChart'; | ||
export { default as LabelChart } from './LabelChart'; |
@@ -32,3 +32,4 @@ "use strict"; | ||
*/ | ||
exports.default = {}; | ||
var BarChart_1 = require("./BarChart"); | ||
exports.BarChart = BarChart_1.default; | ||
var MapChart_1 = require("./MapChart"); | ||
@@ -35,0 +36,0 @@ exports.MapChart = MapChart_1.default; |
import D3Chart from '../D3Chart'; | ||
import { ChartOpts, Item } from '../interface'; | ||
export interface Value extends Item { | ||
label: string; | ||
value: number; | ||
} | ||
import { ChartOpts } from '../interface'; | ||
export interface LabelOpts extends ChartOpts { | ||
data: Value[]; | ||
format?: 'number' | 'usd' | 'percent' | 'chinese' | 'decimal'; | ||
autoRun?: boolean; | ||
onClick?: Function; | ||
@@ -11,0 +7,0 @@ labelField: string; |
@@ -25,3 +25,3 @@ "use strict"; | ||
}; | ||
// 懒得写算法,最多支持8个label,写死,第三个参数以宽度为准, | ||
// 懒得写算法,目前最多支持6个label,写死,第三个参数以宽度为准,说明:LabelChart 请尽量保证窗口是一个正方形,宽度和高度都差不多为最好 | ||
var POS = { | ||
@@ -101,9 +101,9 @@ '1': [ | ||
.attr('class', '_joint') | ||
.attr('id', 'line-joint'); | ||
.attr('id', 'line-joint' + this.id); | ||
this.SVG.append('use') | ||
.attr('xlink:href', '#line-joint') | ||
.attr('xlink:href', '#line-joint' + this.id) | ||
.attr('transform-origin', this.WIDTH / 2 + " " + this.HEIGHT / 2) | ||
.attr('transform', 'scale(0.94,0.94)'); | ||
this.SVG.append('use') | ||
.attr('xlink:href', '#line-joint') | ||
.attr('xlink:href', '#line-joint' + this.id) | ||
.attr('transform-origin', this.WIDTH / 2 + " " + this.HEIGHT / 2) | ||
@@ -127,14 +127,41 @@ .attr('transform', 'scale(1.06,1.06)'); | ||
.attr('class', '_text'); | ||
var format = this.format; | ||
// console.log(format); | ||
var valueLabel = this.group.append('text') | ||
.text(function (d, i) { console.log(i); return 0; }) | ||
.attr('x', function (d, i) { return coord[i][0] * _this.WIDTH; }) | ||
.attr('y', function (d, i) { return coord[i][1] * _this.HEIGHT + 20; }) | ||
.attr('class', '_count'); | ||
// 自动运行,从0到数据 | ||
if (this.props.autoRun) { | ||
valueLabel.text(0) | ||
.on('start', function (d) { | ||
var from = 0; | ||
var to = parseFloat(d[valueField]); | ||
d3.select(this).attr('last', function (d) { return d[valueField]; }); | ||
d3.active(this).tween('text', function () { | ||
var that = d3.select(this); | ||
return function (p) { | ||
that.text(format(from, to, p)); | ||
}; | ||
}); | ||
}); | ||
} | ||
else { | ||
valueLabel.text(function (d, i) { return format(d[valueField], d[valueField], 1); }) | ||
.attr('last', function (d) { return d[valueField]; }); | ||
} | ||
}; | ||
// 更新数据 | ||
default_1.prototype.update = function () { | ||
var labelField = this.props.labelField; | ||
var valueField = this.props.valueField; | ||
var format = this.format; | ||
// @ts-ignore | ||
valueLabel.transition() | ||
this.group.data(this.DATA); | ||
this.group.select('text._count') | ||
.transition() | ||
.duration(2000) | ||
.on('start', function (d) { | ||
var from = 0; | ||
var to = d[valueField]; | ||
var from = parseFloat(d3.select(this).attr('last')); | ||
var to = parseFloat(d[valueField]); | ||
d3.select(this).attr('last', function (d) { return d[valueField]; }); | ||
d3.active(this).tween('text', function () { | ||
@@ -148,30 +175,4 @@ var that = d3.select(this); | ||
}; | ||
default_1.prototype.update = function () { | ||
console.log('先不支持update'); | ||
return; | ||
// const labelField = this.props.labelField; | ||
// const valueField = this.props.valueField; | ||
// const format = this.format; | ||
// this.group.data(this.DATA,d=>d[labelField]).selectAll('text._count') | ||
// .text( (d,i,n,p) => { | ||
// console.log(d,i,n,p); | ||
// console.log(this.DATA[i]); | ||
// return this.DATA[i][valueField] | ||
// }) | ||
// group.enter().append('text').text('new'); | ||
// window['group'] = group; | ||
// console.log(group.enter()); | ||
// group.selectAll('text._count').data((d, i) => { console.log(d, i, this.DATA[i]); return this.DATA[i] }) | ||
// .text(d => { | ||
// console.log(d); | ||
// return d[valueField] | ||
// }) | ||
// this.SVG.datum(this.DATA).selectAll('text._count').data() | ||
// var g = svg.datum(data).selectAll(".arc") | ||
// .data(pie) | ||
// .enter().append("g") | ||
// .attr("class", "arc") | ||
}; | ||
return default_1; | ||
}(D3Chart_1.default)); | ||
exports.default = default_1; |
@@ -127,2 +127,4 @@ "use strict"; | ||
className.push("vap-panel-header"); | ||
if (_.has(this.props, 'tabList')) { | ||
} | ||
} | ||
@@ -129,0 +131,0 @@ return React.createElement("div", { className: className.join(" "), style: { height: this.props.height } }, |
{ | ||
"name": "vap", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"description": "vap", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
282251
113
7538