hrsass-components 1.7.32 → 1.7.34
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 +139 -56
- package/lib/hrsass-components.min.js +1 -1
- package/package.json +1 -1
- package/rollup.build.css +53172 -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 = "1.7.
|
|
68
|
+
var version = "1.7.34";
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* 版本号
|
|
@@ -1564,6 +1564,7 @@ var HrSetId = {
|
|
|
1564
1564
|
};
|
|
1565
1565
|
|
|
1566
1566
|
var defaultLocale = {
|
|
1567
|
+
//
|
|
1567
1568
|
locale: 'zh-cn',
|
|
1568
1569
|
HrAppendix: {
|
|
1569
1570
|
uploadBtnText: '上传文件'
|
|
@@ -3224,10 +3225,6 @@ var HrAppendix = {
|
|
|
3224
3225
|
"default": "default",
|
|
3225
3226
|
validator: function validator(val) {
|
|
3226
3227
|
return ["default", "inch-1", "inch-2"].includes(val);
|
|
3227
|
-
},
|
|
3228
|
-
isLanguage: {
|
|
3229
|
-
type: Boolean,
|
|
3230
|
-
"default": false
|
|
3231
3228
|
}
|
|
3232
3229
|
}
|
|
3233
3230
|
},
|
|
@@ -3458,13 +3455,11 @@ var HrAppendix = {
|
|
|
3458
3455
|
fileList = _ref4$fileList === void 0 ? [] : _ref4$fileList;
|
|
3459
3456
|
var _file$response = file.response,
|
|
3460
3457
|
response = _file$response === void 0 ? {} : _file$response;
|
|
3461
|
-
var successText = this.isLanguage ? 'file uploaded successfully' : '文件上传成功';
|
|
3462
|
-
var errorText = this.isLanguage ? 'file upload failed' : '文件上传失败';
|
|
3463
3458
|
if (file.status === "done") {
|
|
3464
3459
|
if (response.fileId) {
|
|
3465
3460
|
var value = this.multiple ? [].concat(_toConsumableArray(this.val), [response.fileId]) : response.fileId;
|
|
3466
3461
|
this.emitChange(value);
|
|
3467
|
-
this.$message.success("".concat(file.name).concat(successText));
|
|
3462
|
+
this.$message.success("".concat(file.name).concat(locale.successText));
|
|
3468
3463
|
} else if (response.errorMessage) {
|
|
3469
3464
|
this.$message.error("".concat(response.errorMessage));
|
|
3470
3465
|
if (!this.multiple && this.listType === "picture-card") {
|
|
@@ -3472,7 +3467,7 @@ var HrAppendix = {
|
|
|
3472
3467
|
}
|
|
3473
3468
|
}
|
|
3474
3469
|
} else if (file.status === "error") {
|
|
3475
|
-
this.$message.error(response.errorMessage || "".concat(file.name).concat(errorText));
|
|
3470
|
+
this.$message.error(response.errorMessage || "".concat(file.name).concat(locale.errorText));
|
|
3476
3471
|
if (!this.multiple && this.listType === "picture-card") {
|
|
3477
3472
|
fileList = [];
|
|
3478
3473
|
}
|
|
@@ -3528,9 +3523,8 @@ var HrAppendix = {
|
|
|
3528
3523
|
fileRemove: function fileRemove(file, locale) {
|
|
3529
3524
|
var _this6 = this;
|
|
3530
3525
|
// 禁用或只读情况下阻止删除
|
|
3531
|
-
var noRemoveText = this.isLanguage ? 'can not remove file in the status of disabled/readOnly' : '禁用或只读情况下不能删除文件';
|
|
3532
3526
|
if (this.disabled || this.readOnly) {
|
|
3533
|
-
this.$message.info("".concat(
|
|
3527
|
+
this.$message.info("".concat(locale.uploadBtnText));
|
|
3534
3528
|
return false;
|
|
3535
3529
|
}
|
|
3536
3530
|
return new Promise(function (resolve, reject) {
|
|
@@ -10942,13 +10936,19 @@ var OrganizationCard = {
|
|
|
10942
10936
|
//链接线高度
|
|
10943
10937
|
width: VuePropTypes.number,
|
|
10944
10938
|
//宽度
|
|
10945
|
-
height: VuePropTypes.number
|
|
10939
|
+
height: VuePropTypes.number,
|
|
10940
|
+
//高度
|
|
10941
|
+
topBorderHeight: VuePropTypes.number,
|
|
10942
|
+
//上边框高度
|
|
10943
|
+
isDownload: VuePropTypes.bool
|
|
10946
10944
|
}, {
|
|
10947
10945
|
prefixCls: 'hr-org-chart-organization-card',
|
|
10948
10946
|
data: {},
|
|
10949
10947
|
width: 260,
|
|
10950
10948
|
height: 160,
|
|
10951
|
-
lineHeight: 30
|
|
10949
|
+
lineHeight: 30,
|
|
10950
|
+
topBorderHeight: 4,
|
|
10951
|
+
isDownload: false
|
|
10952
10952
|
}),
|
|
10953
10953
|
data: function data() {
|
|
10954
10954
|
return {};
|
|
@@ -10977,13 +10977,19 @@ var OrganizationCard = {
|
|
|
10977
10977
|
data = _getOptionProps2.data,
|
|
10978
10978
|
width = _getOptionProps2.width,
|
|
10979
10979
|
height = _getOptionProps2.height,
|
|
10980
|
-
lineHeight = _getOptionProps2.lineHeight
|
|
10980
|
+
lineHeight = _getOptionProps2.lineHeight,
|
|
10981
|
+
topBorderHeight = _getOptionProps2.topBorderHeight,
|
|
10982
|
+
isDownload = _getOptionProps2.isDownload;
|
|
10981
10983
|
var kind = data.data.kind,
|
|
10982
10984
|
chargePersonType = data.data.chargePersonType;
|
|
10983
10985
|
var empMapList = [],
|
|
10984
10986
|
positionName = data.property.positionName;
|
|
10985
10987
|
//chargePersonType 2=为职位 1=人员
|
|
10986
10988
|
//职位时,不显示职位名称(?)
|
|
10989
|
+
var davidColor = {
|
|
10990
|
+
2: '#3FCF8E',
|
|
10991
|
+
3: '#F6A4EB'
|
|
10992
|
+
};
|
|
10987
10993
|
if (chargePersonType === '2') {
|
|
10988
10994
|
empMapList = data.property.empMapList || [];
|
|
10989
10995
|
//人员最多显示3个
|
|
@@ -11009,14 +11015,19 @@ var OrganizationCard = {
|
|
|
11009
11015
|
width: width,
|
|
11010
11016
|
height: height
|
|
11011
11017
|
},
|
|
11012
|
-
"class": "".concat(prefixCls, "-container")
|
|
11018
|
+
"class": "".concat(prefixCls, "-container"),
|
|
11019
|
+
style: "fill: #ffffff;stroke: rgba(0, 0, 0, 0.15);stroke-width: 1px"
|
|
11013
11020
|
}), h("rect", {
|
|
11014
11021
|
attrs: {
|
|
11015
11022
|
x: "0",
|
|
11016
11023
|
y: "0",
|
|
11017
|
-
width: width
|
|
11024
|
+
width: width,
|
|
11025
|
+
height: topBorderHeight
|
|
11018
11026
|
},
|
|
11019
|
-
"class": classNames("".concat(prefixCls, "-divider"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-divider-department"), kind == 2), _defineProperty(_classNames, "".concat(prefixCls, "-divider-virtual"), kind == 3), _classNames))
|
|
11027
|
+
"class": classNames("".concat(prefixCls, "-divider"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-divider-department"), kind == 2), _defineProperty(_classNames, "".concat(prefixCls, "-divider-virtual"), kind == 3), _classNames)),
|
|
11028
|
+
style: {
|
|
11029
|
+
fill: kind != 2 && kind != 3 ? '#4285F4' : davidColor[kind]
|
|
11030
|
+
}
|
|
11020
11031
|
}), h(IconBase, {
|
|
11021
11032
|
attrs: {
|
|
11022
11033
|
iconName: "dptIcon",
|
|
@@ -11079,6 +11090,9 @@ var OrganizationCard = {
|
|
|
11079
11090
|
width: "30",
|
|
11080
11091
|
height: "30",
|
|
11081
11092
|
fill: "".concat(emp.photo ? 'url(#circleImage' + emp.photo + ')' : '#d6d6d6')
|
|
11093
|
+
},
|
|
11094
|
+
style: {
|
|
11095
|
+
fill: isDownload ? '#d6d6d6' : ''
|
|
11082
11096
|
}
|
|
11083
11097
|
}), h("text", {
|
|
11084
11098
|
attrs: {
|
|
@@ -11127,22 +11141,42 @@ var OrganizationCard = {
|
|
|
11127
11141
|
y: height * 0.875
|
|
11128
11142
|
},
|
|
11129
11143
|
"class": "".concat(prefixCls, "-text")
|
|
11130
|
-
}, [h("tspan", [data.property.count])])]), data.level > 0 &&
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11144
|
+
}, [h("tspan", [data.property.count])])]), data.level > 0 &&
|
|
11145
|
+
// <line
|
|
11146
|
+
// class={`${prefixCls}-line`}
|
|
11147
|
+
// style="stroke: rgba(0, 0, 0, 0.7;stroke-width: 1px;"
|
|
11148
|
+
// x1={width / 2}
|
|
11149
|
+
// x2={width / 2}
|
|
11150
|
+
// y1="0"
|
|
11151
|
+
// y2={-lineHeight}
|
|
11152
|
+
// />
|
|
11153
|
+
//导出时,线条渲染不出来,所以改成rect
|
|
11154
|
+
h("rect", {
|
|
11155
|
+
attrs: {
|
|
11156
|
+
x: width / 2,
|
|
11157
|
+
y: -lineHeight,
|
|
11158
|
+
width: 1,
|
|
11159
|
+
height: lineHeight
|
|
11160
|
+
},
|
|
11161
|
+
style: "fill:#fff;stroke: rgba(0, 0, 0, 0.1);stroke-width: 1px"
|
|
11162
|
+
}), data.children && data.children.length > 0 && data.property.open &&
|
|
11163
|
+
// <line
|
|
11164
|
+
// class={`${prefixCls}-line`}
|
|
11165
|
+
// style="stroke: rgba(0, 0, 0, 0.7);stroke-width: 1px;"
|
|
11166
|
+
// x1={width / 2}
|
|
11167
|
+
// x2={width / 2}
|
|
11168
|
+
// y1={height}
|
|
11169
|
+
// y2={height + lineHeight}
|
|
11170
|
+
// />
|
|
11171
|
+
//导出时,线条渲染不出来,所以改成rect
|
|
11172
|
+
h("rect", {
|
|
11173
|
+
attrs: {
|
|
11174
|
+
x: width / 2,
|
|
11175
|
+
y: height,
|
|
11176
|
+
width: 1,
|
|
11177
|
+
height: lineHeight
|
|
11178
|
+
},
|
|
11179
|
+
style: "fill:#fff;stroke: rgba(0, 0, 0, 0.1);stroke-width: 1px"
|
|
11146
11180
|
}), data.property.count && data.property.count > 0 && h(IconBase, {
|
|
11147
11181
|
"class": "".concat(prefixCls, "-action"),
|
|
11148
11182
|
attrs: {
|
|
@@ -11206,7 +11240,8 @@ var index$6 = {
|
|
|
11206
11240
|
loading: false,
|
|
11207
11241
|
dataList: [],
|
|
11208
11242
|
svgPanZoom: null,
|
|
11209
|
-
standardZoom: 1
|
|
11243
|
+
standardZoom: 1,
|
|
11244
|
+
isDownload: false
|
|
11210
11245
|
};
|
|
11211
11246
|
},
|
|
11212
11247
|
watch: {
|
|
@@ -11357,14 +11392,23 @@ var index$6 = {
|
|
|
11357
11392
|
var lineXStart = children[0].x + width / 2;
|
|
11358
11393
|
var lineXEnd = children[children.length - 1].x + width / 2;
|
|
11359
11394
|
var lineY = level * height + lineHeight * (level * 2 - 1);
|
|
11360
|
-
return
|
|
11361
|
-
|
|
11395
|
+
// return <line
|
|
11396
|
+
// class="hr-org-chart-line"
|
|
11397
|
+
// x1={lineXStart}
|
|
11398
|
+
// x2={lineXEnd}
|
|
11399
|
+
// y1={lineY}
|
|
11400
|
+
// y2={lineY}
|
|
11401
|
+
// style="stroke: rgba(0, 0, 0, 0.15);stroke-width: 1px">
|
|
11402
|
+
// </line>
|
|
11403
|
+
//导出时,线条渲染不出来,所以改成rect
|
|
11404
|
+
return h("rect", {
|
|
11362
11405
|
attrs: {
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
}
|
|
11406
|
+
x: lineXStart,
|
|
11407
|
+
y: lineY,
|
|
11408
|
+
height: 1,
|
|
11409
|
+
width: lineXEnd - lineXStart
|
|
11410
|
+
},
|
|
11411
|
+
style: "fill:#fff;stroke: rgba(0, 0, 0, 0.1);stroke-width: 1px"
|
|
11368
11412
|
});
|
|
11369
11413
|
},
|
|
11370
11414
|
_renderOrgChart: function _renderOrgChart(data) {
|
|
@@ -11385,7 +11429,8 @@ var index$6 = {
|
|
|
11385
11429
|
data: item,
|
|
11386
11430
|
width: width,
|
|
11387
11431
|
height: height,
|
|
11388
|
-
lineHeight: lineHeight
|
|
11432
|
+
lineHeight: lineHeight,
|
|
11433
|
+
isDownload: _this4.isDownload
|
|
11389
11434
|
},
|
|
11390
11435
|
on: {
|
|
11391
11436
|
"click": function click(data) {
|
|
@@ -11418,7 +11463,7 @@ var index$6 = {
|
|
|
11418
11463
|
* @param {Boolean} isOpen 是否展开
|
|
11419
11464
|
* @param {Object} item 当前节点
|
|
11420
11465
|
* @param {Object} prevData 上一节点
|
|
11421
|
-
* @param {Array} children
|
|
11466
|
+
* @param {Array} children 子集.
|
|
11422
11467
|
*/
|
|
11423
11468
|
_handleExpand: function _handleExpand(isOpen, item, prevData, children) {
|
|
11424
11469
|
var _this5 = this;
|
|
@@ -11455,14 +11500,39 @@ var index$6 = {
|
|
|
11455
11500
|
});
|
|
11456
11501
|
},
|
|
11457
11502
|
exportSvg: function exportSvg(fileName) {
|
|
11458
|
-
var
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11503
|
+
var _this6 = this;
|
|
11504
|
+
var bBox = this.$refs.hrOrgChartSvg.getBBox(),
|
|
11505
|
+
options = {
|
|
11506
|
+
scale: 1,
|
|
11507
|
+
width: bBox.width,
|
|
11508
|
+
height: bBox.height,
|
|
11509
|
+
top: bBox.y,
|
|
11510
|
+
left: bBox.x
|
|
11511
|
+
};
|
|
11512
|
+
this.setState({
|
|
11513
|
+
loading: true,
|
|
11514
|
+
isDownload: true
|
|
11515
|
+
});
|
|
11516
|
+
saveSvgAsPng.svgAsDataUri(this.$refs.hrOrgChartSvg, options).then(function (url) {
|
|
11517
|
+
var dataUrL = url.split('base64,')[1];
|
|
11518
|
+
_this6.$axios.post('/business/org/Company/getOrgDiagram.data', {
|
|
11519
|
+
'base64Str': dataUrL,
|
|
11520
|
+
name: fileName || 'org.png'
|
|
11521
|
+
}).then(function (res) {
|
|
11522
|
+
window.open("".concat(process.env.VUE_APP_API_BASE_URL, "/file.nolog?method=download&fileId=").concat(res));
|
|
11523
|
+
_this6.setState({
|
|
11524
|
+
loading: false,
|
|
11525
|
+
isDownload: false
|
|
11526
|
+
});
|
|
11527
|
+
});
|
|
11465
11528
|
});
|
|
11529
|
+
// saveSvgAsPng(this.$refs.hrOrgChartSvg, fileName || 'org.png', {
|
|
11530
|
+
// scale: 1,
|
|
11531
|
+
// width: bBox.width,
|
|
11532
|
+
// height: bBox.height,
|
|
11533
|
+
// top: bBox.y,
|
|
11534
|
+
// left: bBox.x,
|
|
11535
|
+
// });
|
|
11466
11536
|
},
|
|
11467
11537
|
/**
|
|
11468
11538
|
* 获取当前缩放比例
|
|
@@ -11543,13 +11613,16 @@ var ReportCard = {
|
|
|
11543
11613
|
//链接线高度
|
|
11544
11614
|
width: VuePropTypes.number,
|
|
11545
11615
|
//宽度
|
|
11546
|
-
height: VuePropTypes.number
|
|
11616
|
+
height: VuePropTypes.number,
|
|
11617
|
+
//高度
|
|
11618
|
+
topBorderHeight: VuePropTypes.number //上边框高度
|
|
11547
11619
|
}, {
|
|
11548
11620
|
prefixCls: 'hr-report-chart-card',
|
|
11549
11621
|
data: {},
|
|
11550
11622
|
width: 260,
|
|
11551
11623
|
height: 160,
|
|
11552
|
-
lineHeight: 30
|
|
11624
|
+
lineHeight: 30,
|
|
11625
|
+
topBorderHeight: 4
|
|
11553
11626
|
}),
|
|
11554
11627
|
data: function data() {
|
|
11555
11628
|
return {
|
|
@@ -11589,7 +11662,8 @@ var ReportCard = {
|
|
|
11589
11662
|
data = _getOptionProps3.data,
|
|
11590
11663
|
width = _getOptionProps3.width,
|
|
11591
11664
|
height = _getOptionProps3.height,
|
|
11592
|
-
lineHeight = _getOptionProps3.lineHeight
|
|
11665
|
+
lineHeight = _getOptionProps3.lineHeight,
|
|
11666
|
+
topBorderHeight = _getOptionProps3.topBorderHeight;
|
|
11593
11667
|
return h("g", {
|
|
11594
11668
|
"class": prefixCls,
|
|
11595
11669
|
attrs: {
|
|
@@ -11621,7 +11695,8 @@ var ReportCard = {
|
|
|
11621
11695
|
attrs: {
|
|
11622
11696
|
x: "0",
|
|
11623
11697
|
y: "0",
|
|
11624
|
-
width: width
|
|
11698
|
+
width: width,
|
|
11699
|
+
height: topBorderHeight
|
|
11625
11700
|
},
|
|
11626
11701
|
"class": classNames("".concat(prefixCls, "-divider"), "".concat(prefixCls, "-divider-virtual"))
|
|
11627
11702
|
}), h("g", [h("defs", [h("pattern", {
|
|
@@ -11710,6 +11785,8 @@ var ReportCard = {
|
|
|
11710
11785
|
}
|
|
11711
11786
|
};
|
|
11712
11787
|
|
|
11788
|
+
//109%
|
|
11789
|
+
//<canvas width="87737" height="905" style="width: 87737px; height: 905px;"></canvas>
|
|
11713
11790
|
var HrReportChart = {
|
|
11714
11791
|
name: 'HrReportChart',
|
|
11715
11792
|
mixins: [BaseMixin],
|
|
@@ -12001,7 +12078,10 @@ var zh_CN = {
|
|
|
12001
12078
|
appendixName: '资料名称',
|
|
12002
12079
|
uploadError: '此附件有问题,请重新上传',
|
|
12003
12080
|
fileTypeError: '不支持的文件类型',
|
|
12004
|
-
fileSizeError: '文件大小限制'
|
|
12081
|
+
fileSizeError: '文件大小限制',
|
|
12082
|
+
noRemoveText: '禁用或只读情况下不能删除文件',
|
|
12083
|
+
successText: '文件上传成功',
|
|
12084
|
+
errorText: '文件上传失败'
|
|
12005
12085
|
},
|
|
12006
12086
|
HrAddrBookCard: {
|
|
12007
12087
|
viewReportRelate: '查看汇报关系',
|
|
@@ -12138,7 +12218,10 @@ var en_US = {
|
|
|
12138
12218
|
appendixName: 'Document Name',
|
|
12139
12219
|
uploadError: 'There is a problem with this attachment. Please upload it again',
|
|
12140
12220
|
fileTypeError: 'Unsupported file type',
|
|
12141
|
-
fileSizeError: 'File size limit'
|
|
12221
|
+
fileSizeError: 'File size limit',
|
|
12222
|
+
noRemoveText: 'can not remove file in the status of disabled/readOnly',
|
|
12223
|
+
successText: 'file uploaded successfully',
|
|
12224
|
+
errorText: 'file upload failed'
|
|
12142
12225
|
},
|
|
12143
12226
|
HrAddrBookCard: {
|
|
12144
12227
|
viewReportRelate: 'view report relation',
|