@fonixtree/magic-design 0.1.12 → 0.1.13

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.
@@ -1,13 +1,13 @@
1
- [magic_design] .ant-picker {
1
+ [magic_design] .cylon-picker {
2
2
  &:hover {
3
3
  border-color: #2F54EB !important;
4
4
  }
5
5
 
6
- &.ant-picker-focused {
6
+ &.cylon-picker-focused {
7
7
  border-color: #2F54EB !important;
8
8
  }
9
9
  }
10
10
 
11
- [magic_design] .ant-picker-time-panel-column>li.ant-picker-time-panel-cell-selected .ant-picker-time-panel-cell-inner {
11
+ [magic_design] .cylon-picker-time-panel-column>li.cylon-picker-time-panel-cell-selected .cylon-picker-time-panel-cell-inner {
12
12
  background-color: #E9F0FF !important;
13
13
  }
@@ -1,8 +1,8 @@
1
- [magic_design] .ant-form {
2
- .ant-form-item {
1
+ [magic_design] .cylon-form {
2
+ .cylon-form-item {
3
3
  margin-bottom: 10px !important;
4
4
 
5
- .ant-form-item-label {
5
+ .cylon-form-item-label {
6
6
  padding: 0 0 4px 0 !important;
7
7
  }
8
8
  }
@@ -1,16 +1,16 @@
1
1
  @import './variables.less';
2
- [magic_design] .ant-input {
2
+ [magic_design] .cylon-input {
3
3
  border-radius: @radius !important;
4
4
  height:@middle;
5
- &.ant-input-sm {
5
+ &.cylon-input-sm {
6
6
  height:@small;
7
7
  }
8
8
  }
9
9
 
10
- [magic_design] .ant-input-number {
10
+ [magic_design] .cylon-input-number {
11
11
  border-radius: @radius !important;
12
12
  height:@middle;
13
- &.ant-input-number-sm {
13
+ &.cylon-input-number-sm {
14
14
  height:@small;
15
15
  input {
16
16
  height: 30px;
@@ -1,9 +1,9 @@
1
- [magic_design] .ant-dropdown {
2
- .ant-dropdown-menu{
1
+ [magic_design] .cylon-dropdown {
2
+ .cylon-dropdown-menu{
3
3
  border-radius: 10px;
4
4
  width: 200px;
5
5
  padding: 8px 0;
6
- .ant-dropdown-menu-item {
6
+ .cylon-dropdown-menu-item {
7
7
  padding: 16px 24px;
8
8
  font-family: 'Open Sans';
9
9
  font-style: normal;
@@ -12,7 +12,7 @@
12
12
  line-height: 24px;
13
13
  color: #232F46;
14
14
  }
15
- .ant-dropdown-menu-item-active {
15
+ .cylon-dropdown-menu-item-active {
16
16
  background: #E9F0FF;
17
17
  color: #2F54EB;
18
18
  font-weight: 600;
@@ -1,21 +1,21 @@
1
- [magic_design] .ant-modal-wrap {
1
+ [magic_design] .cylon-modal-wrap {
2
2
  display: flex;
3
3
  align-items: center;
4
4
 
5
- .ant-modal {
5
+ .cylon-modal {
6
6
  width: 100%;
7
7
  top: 0 !important;
8
8
  padding-bottom: 0px !important;
9
9
 
10
- .ant-modal-content {
10
+ .cylon-modal-content {
11
11
  border-radius: 8px !important;
12
12
 
13
- .ant-modal-header {
13
+ .cylon-modal-header {
14
14
  border-top-left-radius: 8px !important;
15
15
  border-top-right-radius: 8px !important;
16
16
  }
17
17
 
18
- .ant-modal-body {
18
+ .cylon-modal-body {
19
19
  padding: 16px 16px 12px 16px !important;
20
20
  max-height: 800px !important;
21
21
  }
@@ -1,28 +1,28 @@
1
1
 
2
2
  @import './variables.less';
3
- [magic_design] .ant-select {
3
+ [magic_design] .cylon-select {
4
4
  border-radius: 4px;
5
5
  height: @middle;
6
6
  padding: 0 16px;
7
- .ant-select-selector {
7
+ .cylon-select-selector {
8
8
  height: @middle !important;
9
9
  border-radius: @radius !important;
10
10
  }
11
- &.ant-select-sm {
11
+ &.cylon-select-sm {
12
12
  height: @small;
13
- .ant-select-selector {
13
+ .cylon-select-selector {
14
14
  height: @small !important;
15
- .ant-select-selection-item {
15
+ .cylon-select-selection-item {
16
16
  line-height: 32px !important;
17
17
  }
18
- .ant-select-selection-placeholder {
18
+ .cylon-select-selection-placeholder {
19
19
  line-height: calc(@small - 2px) !important;
20
20
  }
21
21
  }
22
- &.ant-select-multiple {
23
- .ant-select-selector {
22
+ &.cylon-select-multiple {
23
+ .cylon-select-selector {
24
24
  height: @small !important;
25
- .ant-select-selection-item {
25
+ .cylon-select-selection-item {
26
26
  line-height: 20px !important;
27
27
  height: 22px !important;
28
28
  }
@@ -1,16 +1,16 @@
1
- [magic_design] .ant-slider {
2
- .ant-slider-rail {
1
+ [magic_design] .cylon-slider {
2
+ .cylon-slider-rail {
3
3
  background-color: #E9F0FF !important;
4
4
  height: 8px;
5
5
  }
6
- .ant-slider-track {
6
+ .cylon-slider-track {
7
7
  background-color: #2F54EB !important;
8
8
  height: 8px;
9
9
  }
10
- .ant-slider-step {
10
+ .cylon-slider-step {
11
11
  height: 8px;
12
12
  }
13
- .ant-slider-handle {
13
+ .cylon-slider-handle {
14
14
  height: 20px;
15
15
  width: 20px;
16
16
  margin-top: -6px !important;
@@ -1,17 +1,17 @@
1
1
  [magic_design] .designer-wrap {
2
- .ant-switch {
2
+ .cylon-switch {
3
3
  min-width:40px;
4
4
  height: 24px;
5
5
  &::after{
6
6
  content: none;
7
7
  }
8
- &.ant-switch-checked{
8
+ &.cylon-switch-checked{
9
9
  background: #2F54EB !important;
10
- .ant-switch-handle {
10
+ .cylon-switch-handle {
11
11
  left: calc(100% - 18px - 3px);
12
12
  }
13
13
  }
14
- .ant-switch-handle {
14
+ .cylon-switch-handle {
15
15
  top: 3px;
16
16
  left: 3px;
17
17
  }
@@ -1,6 +1,6 @@
1
- [magic_design] .ant-table {
2
- .ant-table-container {
3
- .ant-table-header {
1
+ [magic_design] .cylon-table {
2
+ .cylon-table-container {
3
+ .cylon-table-header {
4
4
  tr {
5
5
  th {
6
6
  padding: 6px 16px;
@@ -9,7 +9,7 @@
9
9
  }
10
10
  }
11
11
 
12
- .ant-table-body {
12
+ .cylon-table-body {
13
13
  tr {
14
14
  th {
15
15
  padding: 6px 16px;
@@ -18,19 +18,19 @@
18
18
  td {
19
19
  padding:6px 16px;
20
20
  line-height: 36px;
21
- .ant-table-row-expand-icon {
21
+ .cylon-table-row-expand-icon {
22
22
  margin-top: 10px;
23
23
  }
24
24
  }
25
- &.ant-table-row-selected {
25
+ &.cylon-table-row-selected {
26
26
  td {
27
27
  background: #E9F0FF;
28
28
  }
29
29
  }
30
30
  }
31
31
  }
32
- .ant-table-content {
33
- .ant-table-thead {
32
+ .cylon-table-content {
33
+ .cylon-table-thead {
34
34
  tr {
35
35
  th{
36
36
  padding: 6px 16px;
@@ -38,7 +38,7 @@
38
38
  }
39
39
  }
40
40
  }
41
- .ant-table-tbody {
41
+ .cylon-table-tbody {
42
42
  tr {
43
43
  td{
44
44
  padding: 6px 16px;
@@ -23,6 +23,8 @@ var _CommonSelPicCard = _interopRequireDefault(require("./CommonSelPicCard"));
23
23
 
24
24
  var _const2 = require("./const");
25
25
 
26
+ var _utils = require("./utils");
27
+
26
28
  var _Iconfont = _interopRequireDefault(require("../Iconfont"));
27
29
 
28
30
  var _commonUtil = require("../../utils/commonUtil");
@@ -267,25 +269,29 @@ function ImageModal(_a) {
267
269
  spinning = _m[0],
268
270
  setSpinning = _m[1];
269
271
 
270
- var _o = (0, _react.useState)(''),
271
- name = _o[0],
272
- setName = _o[1];
272
+ var _o = (0, _react.useState)(null),
273
+ process = _o[0],
274
+ setProcess = _o[1];
275
+
276
+ var _p = (0, _react.useState)(''),
277
+ name = _p[0],
278
+ setName = _p[1];
273
279
 
274
- var _p = (0, _react.useState)([]),
275
- contentcatgsList = _p[0],
276
- setContentcatgsList = _p[1];
280
+ var _q = (0, _react.useState)([]),
281
+ contentcatgsList = _q[0],
282
+ setContentcatgsList = _q[1];
277
283
 
278
- var _q = (0, _react.useState)(''),
279
- searchValue = _q[0],
280
- setSearchValue = _q[1];
284
+ var _r = (0, _react.useState)(''),
285
+ searchValue = _r[0],
286
+ setSearchValue = _r[1];
281
287
 
282
- var _r = (0, _react.useState)([]),
283
- expandedKeys = _r[0],
284
- setExpandedKeys = _r[1];
288
+ var _s = (0, _react.useState)([]),
289
+ expandedKeys = _s[0],
290
+ setExpandedKeys = _s[1];
285
291
 
286
- var _s = (0, _react.useState)(true),
287
- autoExpandParent = _s[0],
288
- setAutoExpandParent = _s[1]; // const currentUser = sessionUtil.getUser() || {};
292
+ var _t = (0, _react.useState)(true),
293
+ autoExpandParent = _t[0],
294
+ setAutoExpandParent = _t[1]; // const currentUser = sessionUtil.getUser() || {};
289
295
  // const { _csrf } = currentUser;
290
296
  // const headers = {};
291
297
  // if (_csrf && _csrf.headerName) {
@@ -485,7 +491,7 @@ function ImageModal(_a) {
485
491
 
486
492
  var handleUpload = function handleUpload(file) {
487
493
  return __awaiter(_this, void 0, void 0, function () {
488
- var form, result;
494
+ var result, form, result;
489
495
  return __generator(this, function (_a) {
490
496
  switch (_a.label) {
491
497
  case 0:
@@ -503,6 +509,31 @@ function ImageModal(_a) {
503
509
  }
504
510
  }
505
511
 
512
+ console.log('file: ', file);
513
+ if (!(file.size > 5 * 1024 * 1024)) return [3
514
+ /*break*/
515
+ , 2];
516
+ setSpinning(true);
517
+ setProcess(0);
518
+ return [4
519
+ /*yield*/
520
+ , (0, _utils.chunksUpload)({
521
+ file: file,
522
+ contentCatgId: selectedKeys[0]
523
+ }, function (process) {
524
+ // console.log('process', process);
525
+ setProcess(process);
526
+ })];
527
+
528
+ case 1:
529
+ result = _a.sent();
530
+ setProcess(null);
531
+ setSpinning(false);
532
+ return [2
533
+ /*return*/
534
+ , result];
535
+
536
+ case 2:
506
537
  form = new FormData();
507
538
  form.append('file', file); // 文件对象
508
539
 
@@ -516,7 +547,7 @@ function ImageModal(_a) {
516
547
  /*yield*/
517
548
  , onUpload(form)];
518
549
 
519
- case 1:
550
+ case 3:
520
551
  result = _a.sent();
521
552
  return [2
522
553
  /*return*/
@@ -717,6 +748,15 @@ function ImageModal(_a) {
717
748
  return handleSearch(value);
718
749
  },
719
750
  placeholder: (0, _locale.i18n)('PLEASE_SEARCH')
751
+ })), process !== null && /*#__PURE__*/_react["default"].createElement("div", {
752
+ className: "image-modal-process-wrap"
753
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Progress, {
754
+ format: function format(percent) {
755
+ return "upload " + percent + "%";
756
+ },
757
+ percent: Number(process).toFixed(2),
758
+ size: "small",
759
+ status: "active"
720
760
  }))), /*#__PURE__*/_react["default"].createElement(_antd.Row, null, /*#__PURE__*/_react["default"].createElement(_antd.Col, {
721
761
  span: 6
722
762
  }, /*#__PURE__*/_react["default"].createElement(_antd.Card, {
@@ -10,6 +10,8 @@
10
10
  white-space: nowrap;
11
11
  display: inline-block;
12
12
  }
13
+
14
+
13
15
  }
14
16
 
15
17
  .catg_img {
@@ -23,4 +25,10 @@
23
25
  object-fit: contain;
24
26
  }
25
27
  }
28
+ }
29
+
30
+ .image-modal-process-wrap {
31
+ margin-left: auto;
32
+ width: 300px;
33
+ padding-right: 60px;
26
34
  }