hrsass-components 2.3.8 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hrsass-components.js +73 -24
- package/lib/hrsass-components.min.js +1 -1
- package/package.json +2 -2
- package/rollup.build.css +15738 -0
package/lib/hrsass-components.js
CHANGED
|
@@ -65,7 +65,7 @@ var contentStyle = _interopDefault(require('!!raw-loader!tinymce/skins/content/d
|
|
|
65
65
|
var SvgPanZoom = _interopDefault(require('svg-pan-zoom'));
|
|
66
66
|
var saveSvgAsPng = require('save-svg-as-png');
|
|
67
67
|
|
|
68
|
-
var version = "2.
|
|
68
|
+
var version = "2.4.0";
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* 版本号
|
|
@@ -3666,7 +3666,7 @@ var HrAppendix = {
|
|
|
3666
3666
|
this.$emit("save", dataSource);
|
|
3667
3667
|
$appendix = h("div", {
|
|
3668
3668
|
"class": "hr-appendix hr-appendix-table hr-appendix-".concat(this.imageSize)
|
|
3669
|
-
}, [(!disabled || btn) && h("header", [h("a-upload", _objectSpread$6(_objectSpread$6({}, options), {}, {
|
|
3669
|
+
}, [(!disabled || btn) && (this.readOnly || h("header", [h("a-upload", _objectSpread$6(_objectSpread$6({}, options), {}, {
|
|
3670
3670
|
props: _objectSpread$6(_objectSpread$6({}, options.props), {}, {
|
|
3671
3671
|
showUploadList: false
|
|
3672
3672
|
})
|
|
@@ -3683,7 +3683,7 @@ var HrAppendix = {
|
|
|
3683
3683
|
return _this7.capture(dataUrl, prefix);
|
|
3684
3684
|
}
|
|
3685
3685
|
}
|
|
3686
|
-
})])]), h("a-table", {
|
|
3686
|
+
})])])), h("a-table", {
|
|
3687
3687
|
attrs: {
|
|
3688
3688
|
size: "small",
|
|
3689
3689
|
bordered: true,
|
|
@@ -4898,7 +4898,8 @@ var TableProps = {
|
|
|
4898
4898
|
normalizeConfig: VuePropTypes.func,
|
|
4899
4899
|
normalizeData: VuePropTypes.func,
|
|
4900
4900
|
selectedRowsList: VuePropTypes.array,
|
|
4901
|
-
keepSelected: VuePropTypes.bool
|
|
4901
|
+
keepSelected: VuePropTypes.bool,
|
|
4902
|
+
showFile: VuePropTypes.bool
|
|
4902
4903
|
// dataSource: PropTypes.array,
|
|
4903
4904
|
};
|
|
4904
4905
|
var FilterProps = {
|
|
@@ -7080,8 +7081,6 @@ var Filter = {
|
|
|
7080
7081
|
var _excluded$2 = ["rules"];
|
|
7081
7082
|
function ownKeys$c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7082
7083
|
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7083
|
-
// import './style/index'
|
|
7084
|
-
|
|
7085
7084
|
var TABLE_COLUMN_GROUP_NAME = "hr-table-column-group";
|
|
7086
7085
|
var TABLE_COLUMN_NAME = "hr-table-column";
|
|
7087
7086
|
var HR_BUTTON = "hr-button";
|
|
@@ -7118,7 +7117,8 @@ var HrTableBase = {
|
|
|
7118
7117
|
schemeList: VuePropTypes.array,
|
|
7119
7118
|
defaultShowCount: VuePropTypes.number,
|
|
7120
7119
|
selectedSchemeId: VuePropTypes.any,
|
|
7121
|
-
selectedUpdateRows: VuePropTypes.array
|
|
7120
|
+
selectedUpdateRows: VuePropTypes.array,
|
|
7121
|
+
showFile: VuePropTypes.bool
|
|
7122
7122
|
}, {
|
|
7123
7123
|
prefixCls: "hr-table-base",
|
|
7124
7124
|
multiple: true,
|
|
@@ -7155,7 +7155,9 @@ var HrTableBase = {
|
|
|
7155
7155
|
//搜索条件默认显示数
|
|
7156
7156
|
selectedSchemeId: null,
|
|
7157
7157
|
//选择的方案Id
|
|
7158
|
-
selectedUpdateRows: []
|
|
7158
|
+
selectedUpdateRows: [],
|
|
7159
|
+
//选中行列表
|
|
7160
|
+
showFile: false //是否显示文件列
|
|
7159
7161
|
}),
|
|
7160
7162
|
data: function data() {
|
|
7161
7163
|
return {
|
|
@@ -7575,12 +7577,23 @@ var HrTableBase = {
|
|
|
7575
7577
|
}
|
|
7576
7578
|
});
|
|
7577
7579
|
},
|
|
7580
|
+
_renderCellFile: function _renderCellFile(item, v, record) {
|
|
7581
|
+
var h = this.$createElement;
|
|
7582
|
+
return h(HrAppendix, {
|
|
7583
|
+
attrs: {
|
|
7584
|
+
"read-only": true,
|
|
7585
|
+
multiple: ['MUTIFILE', 'MUTIIMG'].indexOf(item.controlType) !== -1,
|
|
7586
|
+
value: v
|
|
7587
|
+
}
|
|
7588
|
+
});
|
|
7589
|
+
},
|
|
7578
7590
|
_renderColumns: function _renderColumns(columnList) {
|
|
7579
7591
|
var _this8 = this;
|
|
7580
7592
|
var h = this.$createElement;
|
|
7581
7593
|
var _getOptionProps6 = getOptionProps(this),
|
|
7582
7594
|
editable = _getOptionProps6.editable,
|
|
7583
|
-
maxWidth = _getOptionProps6.maxWidth
|
|
7595
|
+
maxWidth = _getOptionProps6.maxWidth,
|
|
7596
|
+
showFile = _getOptionProps6.showFile;
|
|
7584
7597
|
return columnList.map(function (item) {
|
|
7585
7598
|
if (item.children && item.children.length > 0) {
|
|
7586
7599
|
var checkedLen = item.children.filter(function (o) {
|
|
@@ -7601,6 +7614,8 @@ var HrTableBase = {
|
|
|
7601
7614
|
r = function r(v, record) {
|
|
7602
7615
|
if (editable && item.isEdit) {
|
|
7603
7616
|
return _this8._renderCellComp(item, v, record);
|
|
7617
|
+
} else if (['IMG', 'SINGLEFILE', 'MUTIFILE', 'MUTIIMG'].indexOf(item.controlType) >= 0 && showFile) {
|
|
7618
|
+
return _this8._renderCellFile(item, v, record);
|
|
7604
7619
|
} else {
|
|
7605
7620
|
return _this8._renderCellText(item, v, record);
|
|
7606
7621
|
}
|
|
@@ -8135,7 +8150,9 @@ var index = {
|
|
|
8135
8150
|
normalizeData: function normalizeData(data) {
|
|
8136
8151
|
return data;
|
|
8137
8152
|
},
|
|
8138
|
-
keepSelected: false
|
|
8153
|
+
keepSelected: false,
|
|
8154
|
+
//是否保持跨页选中
|
|
8155
|
+
showFile: false //是否显示文件列
|
|
8139
8156
|
}),
|
|
8140
8157
|
data: function data() {
|
|
8141
8158
|
return {
|
|
@@ -8724,7 +8741,8 @@ var index = {
|
|
|
8724
8741
|
rowKey = _getOptionProps6.rowKey,
|
|
8725
8742
|
showDownload = _getOptionProps6.showDownload,
|
|
8726
8743
|
showFilter = _getOptionProps6.showFilter,
|
|
8727
|
-
code = _getOptionProps6.code
|
|
8744
|
+
code = _getOptionProps6.code,
|
|
8745
|
+
showFile = _getOptionProps6.showFile;
|
|
8728
8746
|
return h("div", {
|
|
8729
8747
|
"class": classNames(prefixCls, cls)
|
|
8730
8748
|
}, [h(HrTableBase, {
|
|
@@ -8737,6 +8755,7 @@ var index = {
|
|
|
8737
8755
|
columns: columnList,
|
|
8738
8756
|
code: code,
|
|
8739
8757
|
multiple: multiple,
|
|
8758
|
+
showFile: showFile,
|
|
8740
8759
|
rowKey: rowKey,
|
|
8741
8760
|
selection: selection,
|
|
8742
8761
|
dataSource: dataSource,
|
|
@@ -11465,6 +11484,7 @@ var OrganizationCard = {
|
|
|
11465
11484
|
fill: color || '#4285f4',
|
|
11466
11485
|
height: "4px"
|
|
11467
11486
|
};
|
|
11487
|
+
var levelGap = data.parent && data.parent.property.departmentLevel == data.parent.level && data.property.departmentLevel - data.level > 0 ? data.property.departmentLevel - data.level : 0;
|
|
11468
11488
|
return h("g", {
|
|
11469
11489
|
"class": prefixCls,
|
|
11470
11490
|
attrs: {
|
|
@@ -11643,9 +11663,9 @@ var OrganizationCard = {
|
|
|
11643
11663
|
h("rect", {
|
|
11644
11664
|
attrs: {
|
|
11645
11665
|
x: width / 2,
|
|
11646
|
-
y: -lineHeight,
|
|
11666
|
+
y: -(lineHeight + (height + lineHeight * 2) * levelGap),
|
|
11647
11667
|
width: 1,
|
|
11648
|
-
height: lineHeight
|
|
11668
|
+
height: lineHeight + (height + lineHeight * 2) * levelGap
|
|
11649
11669
|
},
|
|
11650
11670
|
style: "fill:#fff;stroke: rgb(217, 217, 217);stroke-width: 1px"
|
|
11651
11671
|
}), data.children && data.children.length > 0 && data.property.open &&
|
|
@@ -11730,7 +11750,8 @@ var index$6 = {
|
|
|
11730
11750
|
dataList: [],
|
|
11731
11751
|
svgPanZoom: null,
|
|
11732
11752
|
standardZoom: 1,
|
|
11733
|
-
isDownload: false
|
|
11753
|
+
isDownload: false,
|
|
11754
|
+
globalMap: new Map()
|
|
11734
11755
|
};
|
|
11735
11756
|
},
|
|
11736
11757
|
watch: {
|
|
@@ -11795,14 +11816,16 @@ var index$6 = {
|
|
|
11795
11816
|
return result;
|
|
11796
11817
|
},
|
|
11797
11818
|
_reSetX: function _reSetX(data, map) {
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
if (
|
|
11801
|
-
map.
|
|
11819
|
+
if (data.children && data.children.length > 0) {
|
|
11820
|
+
data.x = (data.children[0].x + data.children[data.children.length - 1].x) / 2;
|
|
11821
|
+
if (map.has(data.level)) {
|
|
11822
|
+
if (data.x > map.get(data.level)) {
|
|
11823
|
+
map.set(data.level, data.x);
|
|
11824
|
+
}
|
|
11825
|
+
}
|
|
11826
|
+
if (data.parent) {
|
|
11827
|
+
this._reSetX(data.parent, map);
|
|
11802
11828
|
}
|
|
11803
|
-
}
|
|
11804
|
-
if (data.parent) {
|
|
11805
|
-
this._reSetX(data.parent, map);
|
|
11806
11829
|
}
|
|
11807
11830
|
},
|
|
11808
11831
|
_getHalfDistance: function _getHalfDistance(length) {
|
|
@@ -11820,12 +11843,15 @@ var index$6 = {
|
|
|
11820
11843
|
},
|
|
11821
11844
|
_treeLayout: function _treeLayout(list, parent, level, map) {
|
|
11822
11845
|
var _this3 = this;
|
|
11846
|
+
if (!map) {
|
|
11847
|
+
map = this.globalMap;
|
|
11848
|
+
}
|
|
11823
11849
|
var _getOptionProps4 = getOptionProps(this),
|
|
11824
11850
|
width = _getOptionProps4.width,
|
|
11825
11851
|
height = _getOptionProps4.height,
|
|
11826
11852
|
gutter = _getOptionProps4.gutter,
|
|
11827
11853
|
lineHeight = _getOptionProps4.lineHeight;
|
|
11828
|
-
|
|
11854
|
+
var result = list.map(function (item, index) {
|
|
11829
11855
|
var children = item.children || [];
|
|
11830
11856
|
if (index === 0) {
|
|
11831
11857
|
//第一个节点
|
|
@@ -11864,13 +11890,36 @@ var index$6 = {
|
|
|
11864
11890
|
}
|
|
11865
11891
|
item.level = level;
|
|
11866
11892
|
item.property.open = item.property.open !== undefined ? item.property.open : true;
|
|
11867
|
-
item.parent = parent;
|
|
11868
11893
|
item.y = (height + lineHeight * 2) * level;
|
|
11894
|
+
//对比层级和level,进行高度计算和map维护
|
|
11895
|
+
if (item.property.departmentLevel > level) {
|
|
11896
|
+
item.y = (height + lineHeight * 2) * item.property.departmentLevel;
|
|
11897
|
+
var max = item.x;
|
|
11898
|
+
for (var i = level; i < item.property.departmentLevel; i++) {
|
|
11899
|
+
if (map.has(i + 1)) {
|
|
11900
|
+
if (item.x > map.get(i + 1)) {
|
|
11901
|
+
map.set(i + 1, item.x);
|
|
11902
|
+
} else {
|
|
11903
|
+
max = map.get(i + 1);
|
|
11904
|
+
}
|
|
11905
|
+
} else {
|
|
11906
|
+
map.set(i + 1, item.x);
|
|
11907
|
+
}
|
|
11908
|
+
}
|
|
11909
|
+
if (max !== item.x) {
|
|
11910
|
+
item.x = max + width + gutter;
|
|
11911
|
+
item.pointX = max + width + gutter;
|
|
11912
|
+
_this3._reSetX(parent, map);
|
|
11913
|
+
}
|
|
11914
|
+
}
|
|
11915
|
+
item.parent = parent;
|
|
11869
11916
|
if (_this3._isOpen(item) && children.length > 0) {
|
|
11870
11917
|
item.children = _this3._treeLayout(children, item, level + 1, map);
|
|
11871
11918
|
}
|
|
11872
11919
|
return item;
|
|
11873
11920
|
});
|
|
11921
|
+
this.globalMap = map;
|
|
11922
|
+
return result;
|
|
11874
11923
|
},
|
|
11875
11924
|
_renderOrgChartLine: function _renderOrgChartLine(level, children) {
|
|
11876
11925
|
var h = this.$createElement;
|
|
@@ -11913,7 +11962,7 @@ var index$6 = {
|
|
|
11913
11962
|
return h("g", [data.map(function (item) {
|
|
11914
11963
|
var children = item.children || [];
|
|
11915
11964
|
var Comp = _this4._getComponent(type);
|
|
11916
|
-
return h("g", [item.property.open && children.length > 0 && _this4._renderOrgChartLine(item.level + 1, children), h(Comp, {
|
|
11965
|
+
return h("g", [item.property.open && children.length > 0 && _this4._renderOrgChartLine(parseInt(item.property.departmentLevel || item.level) + 1, children), h(Comp, {
|
|
11917
11966
|
attrs: {
|
|
11918
11967
|
data: item,
|
|
11919
11968
|
width: width,
|