@bchr/bchr-front-lib 0.3.82 → 0.3.86

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.
@@ -308,7 +308,18 @@ var FormForBrowse = /*#__PURE__*/function (_React$Component) {
308
308
  dangerouslySetInnerHTML: {
309
309
  __html: dataItem.field_label_prefix
310
310
  }
311
- }), /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
311
+ }), dataItem.field_label_badge && dataItem.field_label_badge.trim().length > 0 && /*#__PURE__*/_react["default"].createElement(_antd.Badge, {
312
+ count: /*#__PURE__*/_react["default"].createElement("span", {
313
+ style: {
314
+ zIndex: '1'
315
+ },
316
+ dangerouslySetInnerHTML: {
317
+ __html: dataItem.field_label_badge
318
+ }
319
+ })
320
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
321
+ title: dataItem.name
322
+ }, dataItem.name)), (!dataItem.field_label_badge || dataItem.field_label_badge.trim().length == 0) && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
312
323
  title: dataItem.name
313
324
  }, dataItem.name), dataItem.tip_message && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
314
325
  className: "ui-tpl-tool-tip",
@@ -503,7 +503,18 @@ var FormForModify = /*#__PURE__*/function (_React$Component) {
503
503
  dangerouslySetInnerHTML: {
504
504
  __html: dataItem.field_label_prefix
505
505
  }
506
- }), /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
506
+ }), dataItem.field_label_badge && dataItem.field_label_badge.trim().length > 0 && /*#__PURE__*/_react["default"].createElement(_antd.Badge, {
507
+ count: /*#__PURE__*/_react["default"].createElement("span", {
508
+ style: {
509
+ zIndex: '1'
510
+ },
511
+ dangerouslySetInnerHTML: {
512
+ __html: dataItem.field_label_badge
513
+ }
514
+ })
515
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
516
+ title: name
517
+ }, name)), (!dataItem.field_label_badge || dataItem.field_label_badge.trim().length == 0) && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
507
518
  title: name
508
519
  }, name), tip_message && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
509
520
  className: "ui-tpl-tool-tip",
@@ -186,7 +186,18 @@ var GridForBrowse = /*#__PURE__*/function (_React$Component) {
186
186
  dangerouslySetInnerHTML: {
187
187
  __html: dataItem.column_header_prefix
188
188
  }
189
- })), /*#__PURE__*/_react["default"].createElement("span", {
189
+ })), dataItem.field_label_badge && dataItem.field_label_badge.trim().length > 0 && /*#__PURE__*/_react["default"].createElement(_antd.Badge, {
190
+ count: /*#__PURE__*/_react["default"].createElement("span", {
191
+ style: {
192
+ zIndex: '1'
193
+ },
194
+ dangerouslySetInnerHTML: {
195
+ __html: dataItem.field_label_badge
196
+ }
197
+ })
198
+ }, /*#__PURE__*/_react["default"].createElement("span", {
199
+ className: b_required ? "k-grid-column-required" : ""
200
+ }, name)), (!dataItem.field_label_badge || dataItem.field_label_badge.trim().length == 0) && /*#__PURE__*/_react["default"].createElement("span", {
190
201
  className: b_required ? "k-grid-column-required" : ""
191
202
  }, name), tip_message && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
192
203
  className: "ui-tpl-tool-tip",
@@ -551,6 +562,7 @@ var GridForBrowse = /*#__PURE__*/function (_React$Component) {
551
562
  var column_value_prefix;
552
563
  var icon_class = '';
553
564
  var icon_color = '';
565
+ var messageDom;
554
566
 
555
567
  if (check_type >= 1) {
556
568
  var check_type_name;
@@ -565,12 +577,12 @@ var GridForBrowse = /*#__PURE__*/function (_React$Component) {
565
577
 
566
578
  if (grid_info_record_of_data_check && grid_info_record_of_data_check.get(dataItem.pk + "@" + code)) {
567
579
  icon_class = 'icon-bchr-suoding';
568
- var messageDom = "<div>\n <p>".concat(check_type_name, "\u4EBA\uFF1A").concat(grid_info_record_of_data_check.get(dataItem.pk + "@" + code).check_psn_ext_name, "</p>\n <p>").concat(check_type_name, "\u65F6\u95F4\uFF1A").concat((0, _moment["default"])(grid_info_record_of_data_check.get(dataItem.pk + "@" + code).checked_ts).format("YYYY-MM-DD HH:mm:ss"), "</p>\n </div>");
569
- column_value_prefix = "<Tooltip title={<span dangerouslySetInnerHTML={{__html: messageDom}}></span>}>\n <span class=\"iconfont ".concat(icon_class, "\" style=\"color: ").concat(icon_color, "; margin-right: 5px\"></span>\n </Tooltip>");
580
+ messageDom = /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, check_type_name, "\u4EBA\uFF1A", grid_info_record_of_data_check.get(dataItem.pk + "@" + code).check_psn_ext_name), /*#__PURE__*/_react["default"].createElement("p", null, check_type_name, "\u65F6\u95F4\uFF1A", (0, _moment["default"])(grid_info_record_of_data_check.get(dataItem.pk + "@" + code).checked_ts).format("YYYY-MM-DD HH:mm:ss")));
570
581
  } else {
571
582
  icon_class = 'icon-bchr-jiesuo';
572
- column_value_prefix = "<span class=\"iconfont ".concat(icon_class, "\" style=\"color: ").concat(icon_color, "; margin-right: 5px\"></span>");
573
583
  }
584
+
585
+ column_value_prefix = "<span class=\"iconfont ".concat(icon_class, "\" style=\"color: ").concat(icon_color, "; margin-right: 5px\"></span>");
574
586
  }
575
587
 
576
588
  if (config.custom_ui_b_grid_default_locked || config.ui_b_grid_default_locked || Array.isArray(default_locked_fields) && default_locked_fields.indexOf(code) > -1) {
@@ -649,7 +661,13 @@ var GridForBrowse = /*#__PURE__*/function (_React$Component) {
649
661
  left: column_locked_left + 'px',
650
662
  right: "0px"
651
663
  } : {}
652
- }, check_type >= 1 && /*#__PURE__*/_react["default"].createElement("span", {
664
+ }, check_type >= 1 && messageDom && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
665
+ title: messageDom
666
+ }, /*#__PURE__*/_react["default"].createElement("span", {
667
+ dangerouslySetInnerHTML: {
668
+ __html: column_value_prefix
669
+ }
670
+ })), check_type >= 1 && !messageDom && /*#__PURE__*/_react["default"].createElement("span", {
653
671
  dangerouslySetInnerHTML: {
654
672
  __html: column_value_prefix
655
673
  }
@@ -664,7 +682,13 @@ var GridForBrowse = /*#__PURE__*/function (_React$Component) {
664
682
  left: column_locked_left + 'px',
665
683
  right: "0px"
666
684
  } : {}
667
- }, check_type >= 1 && /*#__PURE__*/_react["default"].createElement("span", {
685
+ }, check_type >= 1 && messageDom && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
686
+ title: messageDom
687
+ }, /*#__PURE__*/_react["default"].createElement("span", {
688
+ dangerouslySetInnerHTML: {
689
+ __html: column_value_prefix
690
+ }
691
+ })), check_type >= 1 && !messageDom && /*#__PURE__*/_react["default"].createElement("span", {
668
692
  dangerouslySetInnerHTML: {
669
693
  __html: column_value_prefix
670
694
  }
@@ -679,7 +703,13 @@ var GridForBrowse = /*#__PURE__*/function (_React$Component) {
679
703
  left: column_locked_left + 'px',
680
704
  right: "0px"
681
705
  } : {}
682
- }, check_type >= 1 && /*#__PURE__*/_react["default"].createElement("span", {
706
+ }, check_type >= 1 && messageDom && /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
707
+ title: messageDom
708
+ }, /*#__PURE__*/_react["default"].createElement("span", {
709
+ dangerouslySetInnerHTML: {
710
+ __html: column_value_prefix
711
+ }
712
+ })), check_type >= 1 && !messageDom && /*#__PURE__*/_react["default"].createElement("span", {
683
713
  dangerouslySetInnerHTML: {
684
714
  __html: column_value_prefix
685
715
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bchr/bchr-front-lib",
3
- "version": "0.3.82",
3
+ "version": "0.3.86",
4
4
  "description": "bchr front lib",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  import React, {Fragment} from 'react';
2
2
  import zhCN from 'antd/es/locale/zh_CN';
3
- import {Col, ConfigProvider, Form, Row, Tooltip} from "antd";
3
+ import {Badge, Col, ConfigProvider, Form, Row, Tooltip} from "antd";
4
4
  import {DownloadOutlined, QuestionCircleOutlined} from '@ant-design/icons';
5
5
  import moment from "moment";
6
6
  import {UI_RENDER_TYPE} from "../consts";
@@ -276,7 +276,19 @@ class FormForBrowse extends React.Component{
276
276
  (!dataItem.title_of_field_label_prefix || dataItem.title_of_field_label_prefix.trim().length == 0) && dataItem.field_label_prefix && dataItem.field_label_prefix.trim().length > 0 &&
277
277
  <span style={{marginRight: '5px'}} dangerouslySetInnerHTML={{__html: dataItem.field_label_prefix}}></span>
278
278
  }
279
- <Tooltip title={dataItem.name}>{dataItem.name}</Tooltip>
279
+
280
+ {
281
+ dataItem.field_label_badge && dataItem.field_label_badge.trim().length > 0 &&
282
+ <Badge count={<span style={{zIndex: '1'}} dangerouslySetInnerHTML={{__html: dataItem.field_label_badge}}></span>}>
283
+ <Tooltip title={dataItem.name}>{dataItem.name}</Tooltip>
284
+ </Badge>
285
+ }
286
+
287
+ {
288
+ (!dataItem.field_label_badge || dataItem.field_label_badge.trim().length == 0) &&
289
+ <Tooltip title={dataItem.name}>{dataItem.name}</Tooltip>
290
+ }
291
+
280
292
  {
281
293
  dataItem.tip_message && <Tooltip className="ui-tpl-tool-tip" title={dataItem.tip_message}> <QuestionCircleOutlined /> </Tooltip>
282
294
  }
@@ -1,5 +1,6 @@
1
1
  import React, {Fragment} from 'react';
2
2
  import {
3
+ Badge,
3
4
  Button,
4
5
  Col,
5
6
  ConfigProvider,
@@ -550,7 +551,18 @@ class FormForModify extends React.Component{
550
551
  <span style={{marginRight: '5px'}} dangerouslySetInnerHTML={{__html: dataItem.field_label_prefix}}></span>
551
552
  }
552
553
 
553
- <Tooltip title={name}>{name}</Tooltip>
554
+ {
555
+ dataItem.field_label_badge && dataItem.field_label_badge.trim().length > 0 &&
556
+ <Badge count={<span style={{zIndex: '1'}} dangerouslySetInnerHTML={{__html: dataItem.field_label_badge}}></span>}>
557
+ <Tooltip title={name}>{name}</Tooltip>
558
+ </Badge>
559
+ }
560
+
561
+ {
562
+ (!dataItem.field_label_badge || dataItem.field_label_badge.trim().length == 0) &&
563
+ <Tooltip title={name}>{name}</Tooltip>
564
+ }
565
+
554
566
  {
555
567
  tip_message && <Tooltip className="ui-tpl-tool-tip" title={tip_message}> <QuestionCircleOutlined /> </Tooltip>
556
568
  }
@@ -1,7 +1,7 @@
1
1
  import React, {Fragment} from 'react';
2
2
  import {Grid, GridColumn} from "@progress/kendo-react-grid";
3
3
  import {ExcelExport, ExcelExportColumn} from "@progress/kendo-react-excel-export";
4
- import {ConfigProvider, Tooltip} from "antd";
4
+ import {Badge, ConfigProvider, Tooltip} from "antd";
5
5
  import {DownloadOutlined, QuestionCircleOutlined} from '@ant-design/icons';
6
6
  import moment from "moment";
7
7
  import {EXPORT_GRID_CELL_OPTIONS, EXPORT_GRID_HEADER_CELL_OPTIONS, UI_RENDER_TYPE} from "../consts";
@@ -180,9 +180,23 @@ class GridForBrowse extends React.Component{
180
180
  <span style={{marginRight: '5px'}} dangerouslySetInnerHTML={{__html: dataItem.column_header_prefix}}></span>
181
181
  </Tooltip>
182
182
  }
183
- <span className={b_required ? "k-grid-column-required" : ""}>
184
- {name}
185
- </span>
183
+
184
+ {
185
+ dataItem.field_label_badge && dataItem.field_label_badge.trim().length > 0 &&
186
+ <Badge count={<span style={{zIndex: '1'}} dangerouslySetInnerHTML={{__html: dataItem.field_label_badge}}></span>}>
187
+ <span className={b_required ? "k-grid-column-required" : ""}>
188
+ {name}
189
+ </span>
190
+ </Badge>
191
+ }
192
+
193
+ {
194
+ (!dataItem.field_label_badge || dataItem.field_label_badge.trim().length == 0) &&
195
+ <span className={b_required ? "k-grid-column-required" : ""}>
196
+ {name}
197
+ </span>
198
+ }
199
+
186
200
  {
187
201
  tip_message && <Tooltip className="ui-tpl-tool-tip" title={tip_message}> <QuestionCircleOutlined /> </Tooltip>
188
202
  }
@@ -290,6 +304,7 @@ class GridForBrowse extends React.Component{
290
304
  let column_value_prefix;
291
305
  let icon_class = '';
292
306
  let icon_color = '';
307
+ let messageDom;
293
308
 
294
309
  if (check_type >= 1) {
295
310
  let check_type_name;
@@ -305,18 +320,15 @@ class GridForBrowse extends React.Component{
305
320
  if (grid_info_record_of_data_check && grid_info_record_of_data_check.get(dataItem.pk + "@" + code)) {
306
321
  icon_class = 'icon-bchr-suoding';
307
322
 
308
- let messageDom = `<div>
309
- <p>${check_type_name}人:${grid_info_record_of_data_check.get(dataItem.pk + "@" + code).check_psn_ext_name}</p>
310
- <p>${check_type_name}时间:${moment(grid_info_record_of_data_check.get(dataItem.pk + "@" + code).checked_ts).format("YYYY-MM-DD HH:mm:ss")}</p>
311
- </div>`;
312
-
313
- column_value_prefix = `<Tooltip title={<span dangerouslySetInnerHTML={{__html: messageDom}}></span>}>
314
- <span class="iconfont ${icon_class}" style="color: ${icon_color}; margin-right: 5px"></span>
315
- </Tooltip>`;
323
+ messageDom = <div>
324
+ <p>{check_type_name}人:{grid_info_record_of_data_check.get(dataItem.pk + "@" + code).check_psn_ext_name}</p>
325
+ <p>{check_type_name}时间:{moment(grid_info_record_of_data_check.get(dataItem.pk + "@" + code).checked_ts).format("YYYY-MM-DD HH:mm:ss")}</p>
326
+ </div>;
316
327
  } else {
317
328
  icon_class = 'icon-bchr-jiesuo';
318
- column_value_prefix = `<span class="iconfont ${icon_class}" style="color: ${icon_color}; margin-right: 5px"></span>`;
319
329
  }
330
+
331
+ column_value_prefix = `<span class="iconfont ${icon_class}" style="color: ${icon_color}; margin-right: 5px"></span>`;
320
332
  }
321
333
 
322
334
  if (config.custom_ui_b_grid_default_locked || config.ui_b_grid_default_locked || (Array.isArray(default_locked_fields) && default_locked_fields.indexOf(code) > -1)) {
@@ -393,9 +405,17 @@ class GridForBrowse extends React.Component{
393
405
  <td className={props.className}
394
406
  style={grid_default_locked ? {left: column_locked_left + 'px', right: "0px"} : {}}>
395
407
  {
396
- check_type >= 1 &&
408
+ check_type >= 1 && messageDom &&
409
+ <Tooltip title={messageDom}>
410
+ <span dangerouslySetInnerHTML={{__html: column_value_prefix}}></span>
411
+ </Tooltip>
412
+ }
413
+
414
+ {
415
+ check_type >= 1 && !messageDom &&
397
416
  <span dangerouslySetInnerHTML={{__html: column_value_prefix}}></span>
398
417
  }
418
+
399
419
  {
400
420
  (dataItem[code] && dataItem[code] > 0) ? <DownloadOutlined className="form-item-control-input-ext-icon" onClick={this.downloadOnClick.bind(this, dataItem[code])}/> : null
401
421
  }
@@ -407,9 +427,17 @@ class GridForBrowse extends React.Component{
407
427
  <td className={props.className}
408
428
  style={grid_default_locked ? {left: column_locked_left + 'px', right: "0px"} : {}}>
409
429
  {
410
- check_type >= 1 &&
430
+ check_type >= 1 && messageDom &&
431
+ <Tooltip title={messageDom}>
432
+ <span dangerouslySetInnerHTML={{__html: column_value_prefix}}></span>
433
+ </Tooltip>
434
+ }
435
+
436
+ {
437
+ check_type >= 1 && !messageDom &&
411
438
  <span dangerouslySetInnerHTML={{__html: column_value_prefix}}></span>
412
439
  }
440
+
413
441
  {
414
442
  dataItem[code] ? <InputPassword ui_render_type={'browse'} initValue={dataItem[code]}/> : null
415
443
  }
@@ -420,7 +448,14 @@ class GridForBrowse extends React.Component{
420
448
  <td className={props.className}
421
449
  style={grid_default_locked ? {left: column_locked_left + 'px', right: "0px"} : {}}>
422
450
  {
423
- check_type >= 1 &&
451
+ check_type >= 1 && messageDom &&
452
+ <Tooltip title={messageDom}>
453
+ <span dangerouslySetInnerHTML={{__html: column_value_prefix}}></span>
454
+ </Tooltip>
455
+ }
456
+
457
+ {
458
+ check_type >= 1 && !messageDom &&
424
459
  <span dangerouslySetInnerHTML={{__html: column_value_prefix}}></span>
425
460
  }
426
461
  {value}