ztxkui 4.2.23-605 → 4.2.23-607

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.
Files changed (30) hide show
  1. package/dist/UI/Detail/index.js +4 -1
  2. package/dist/UI/Table/EditTable.js +1 -3
  3. package/dist/components/Table/table-menu.js +1 -1
  4. package/dist/components/electron-signatures/content.js +1 -1
  5. package/dist/components/electron-signatures/demoComponents/making.js +3 -1
  6. package/dist/components/electron-signatures/demoComponents/makingData.d.ts +8 -1
  7. package/dist/components/electron-signatures/demoComponents/makingData.js +11 -3
  8. package/dist/components/electron-signatures/dgComponents/useContractColumns.js +40 -2
  9. package/dist/components/electron-signatures/electronComponents/electron-seal-detail.js +33 -5
  10. package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +155 -25
  11. package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +13 -0
  12. package/dist/components/electron-signatures/fileComponents/useFileColumns.js +11 -2
  13. package/dist/components/electron-signatures/fileComponents/useFileTypeColumns.js +9 -0
  14. package/dist/components/electron-signatures/index.d.ts +4 -0
  15. package/dist/components/electron-signatures/index.js +17 -4
  16. package/dist/components/electron-signatures/interface.d.ts +10 -0
  17. package/dist/components/electron-signatures/qunjComponents/qunj-detail.d.ts +4 -0
  18. package/dist/components/electron-signatures/qunjComponents/qunj-detail.js +29 -9
  19. package/dist/components/electron-signatures/qunjComponents/qunj-list.js +186 -3
  20. package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +142 -89
  21. package/dist/components/electron-signatures/translateComponents/useTranslateCom.js +25 -10
  22. package/dist/components/utils/ZtxkContext.d.ts +16 -0
  23. package/dist/components/utils/ZtxkContext.js +4 -0
  24. package/dist/components/utils/useBaseContext.d.ts +4 -0
  25. package/dist/constants.d.ts +1 -1
  26. package/dist/constants.js +1 -1
  27. package/dist/index.css +351 -3
  28. package/dist/index.css.map +1 -1
  29. package/dist/main.js +8 -0
  30. package/package.json +1 -1
@@ -2,6 +2,7 @@ import i18next from 'ztxkutils/dist/i18next';
2
2
  import React, { useMemo, useRef } from 'react';
3
3
  import { DetailHeader, OperationBtnGroup, Container, Button, InputNumber, Input, Tabs, Dropdown, DatePicker, Collapse, Modal, Tooltip, } from '../../index.build';
4
4
  import dayjs from 'dayjs';
5
+ import EditTable from '../Table/EditTable';
5
6
  var Detail = function () {
6
7
  var rangeDatesRef = useRef(null);
7
8
  var items = useMemo(function () {
@@ -224,7 +225,9 @@ var Detail = function () {
224
225
  React.createElement(Collapse.Panel, { key: "1", header: "\u9762\u677F1" }, "\u9762\u677F1"),
225
226
  React.createElement(Collapse.Panel, { key: "2", header: "\u9762\u677F2" }, "\u9762\u677F2")),
226
227
  React.createElement(Button, { onClick: function () { return setVisible(true); } }, "\u6253\u5F00\u5F39\u6846"),
227
- React.createElement(Modal, { title: "\u5F39\u6846\u6807\u9898", loading: false, visible: visible, onCancel: function () { return setVisible(false); } }, "\u6211\u662F\u5F39\u6846\u5185\u5BB9"),
228
+ React.createElement(Modal, { title: "\u5F39\u6846\u6807\u9898", loading: false, visible: visible, onCancel: function () { return setVisible(false); } },
229
+ "\u6211\u662F\u5F39\u6846\u5185\u5BB9",
230
+ React.createElement(EditTable, null)),
228
231
  React.createElement(Tooltip, { title: "\u6211\u662F\u63D0\u793A" },
229
232
  React.createElement(Button, null, "\u6211\u662F\u6309\u94AE"))));
230
233
  };
@@ -626,9 +626,7 @@ export default function EditTable() {
626
626
  // defaultInnerPageSize={10}
627
627
  virtualTableKey: "single-110011",
628
628
  // 是否选择
629
- isChoice: true, choiceMode: "radio", selectedRowKeys: selectedRowKeys, onSelectedRowChange: onSelectedRowChange, onChange: onChange, summaryFixed: true,
630
- // hideIndexColumnEditBtn
631
- summaryConfig: [
629
+ isChoice: true, choiceMode: "radio", selectedRowKeys: selectedRowKeys, onSelectedRowChange: onSelectedRowChange, onChange: onChange, summaryFixed: true, hideIndexColumnEditBtn: false, summaryConfig: [
632
630
  {
633
631
  type: 'subtotal',
634
632
  fields: [
@@ -296,7 +296,7 @@ var TableMenu = forwardRef(function (_a, ref) {
296
296
  onEditableSave || !isContextMenuFullscreen ? null : (React.createElement(Item, { data: "fullscreen", onClick: onMenuItemClick }, isFull ? i18next.t('退出全屏') : i18next.t('全屏')))),
297
297
  React.createElement(Modal, { width: "80%", title: i18next.t('详情'), visible: visible, onCancel: onCancel,
298
298
  // stick
299
- mask: false, loading: false, className: className, footer: React.createElement(Button, { type: "primary", onClick: onCancel }, i18next.t('确定')), getContainer: false },
299
+ mask: false, loading: false, className: className, footer: React.createElement(Button, { type: "primary", onClick: onCancel }, i18next.t('确定')) },
300
300
  React.createElement("div", { style: { maxHeight: '70vh', minWidth: '800px', overflow: 'auto' } },
301
301
  React.createElement("div", { className: "zt-table-detail-grid" }, record && renderItem(items))))));
302
302
  });
@@ -111,7 +111,7 @@ var ElectronSignatures = function (props) {
111
111
  // fmsIsElectronicSealPushLabel = '推送银行',
112
112
  _j = props.fmsIsElectronicSealPushLabel,
113
113
  // fmsIsElectronicSealPushLabel = '推送银行',
114
- fmsIsElectronicSealPushLabel = _j === void 0 ? i18next.t('加盖银行签章') : _j, _k = props.openingContractSealLabel, openingContractSealLabel = _k === void 0 ? i18next.t('盖光盈电子章') : _k, isSingleQj = props.isSingleQj, _l = props.isQjUseModal, isQjUseModal = _l === void 0 ? true : _l, defaultJustNeedQj = props.defaultJustNeedQj, isDeleteAllFileWhenJustUseQj = props.isDeleteAllFileWhenJustUseQj, _m = props.isShowQysWhenNeedNotQys, isShowQysWhenNeedNotQys = _m === void 0 ? true : _m, _o = props.isControlNeedQys, isControlNeedQys = _o === void 0 ? true : _o, isDeletePlaceholderFileData = props.isDeletePlaceholderFileData, isSupportNoAttachQj = props.isSupportNoAttachQj, caseId = props.caseId, _p = props.isChoiseChangeTemplateValid, isChoiseChangeTemplateValid = _p === void 0 ? true : _p, _q = props.isToggleQys, isToggleQys = _q === void 0 ? false : _q, _r = props.isQjVerifyCode, isQjVerifyCode = _r === void 0 ? false : _r, _s = props.isNewQys, isNewQys = _s === void 0 ? false : _s, _t = props.isShowBatchUseElectronicSealBtn, isShowBatchUseElectronicSealBtn = _t === void 0 ? true : _t, isShowBatchUseOpeningContractSealBtn = props.isShowBatchUseOpeningContractSealBtn, isShowOpeningContractSeal = props.isShowOpeningContractSeal, customButtons = props.customButtons, goWorkflowSeal = props.goWorkflowSeal, isShowSealApply = props.isShowSealApply, otherColumns = props.otherColumns, isShowOpeningContractSealNotRelyQys = props.isShowOpeningContractSealNotRelyQys, isNoWatermarkProcess = props.isNoWatermarkProcess, qunjListRenderFilter = props.qunjListRenderFilter, sealDownloadFlowStatus = props.sealDownloadFlowStatus, resetProps = __rest(props, ["request", "isTranslation", "previewUrl", "isUnControlled", "contractNumFlowIds", "fileUploadProps", "isShowFileUpload", "isShowFileUploadIndependence", "otherOptions", "fileBaseUrl", "apiBaseUrl", "electronHandleRef", "onValueChange", "isValidateSuccess", "refreshCode", "onCheckedComparison", "onFileTypeChangeGetItem", "tableScroll", "getCreateTimeHand", "isShowElectronBatchBtn", "isShowDownloadBatchBtn", "isShowBatchDeleteBtn", "isShowBatchDeleteBtnIndependence", "beforeBatchDelete", "isShowBatchPreviewBtn", "isShowFileComparisonBtn", "batchDownloadZipName", "isShowDoubleSignedBatchBtn", "isShowFileType", "isShowFileTypeMerge", "fmsIsElectronicSealLabel", "fmsIsElectronicSealPushLabel", "openingContractSealLabel", "isSingleQj", "isQjUseModal", "defaultJustNeedQj", "isDeleteAllFileWhenJustUseQj", "isShowQysWhenNeedNotQys", "isControlNeedQys", "isDeletePlaceholderFileData", "isSupportNoAttachQj", "caseId", "isChoiseChangeTemplateValid", "isToggleQys", "isQjVerifyCode", "isNewQys", "isShowBatchUseElectronicSealBtn", "isShowBatchUseOpeningContractSealBtn", "isShowOpeningContractSeal", "customButtons", "goWorkflowSeal", "isShowSealApply", "otherColumns", "isShowOpeningContractSealNotRelyQys", "isNoWatermarkProcess", "qunjListRenderFilter", "sealDownloadFlowStatus"]);
114
+ fmsIsElectronicSealPushLabel = _j === void 0 ? i18next.t('加盖银行签章') : _j, _k = props.openingContractSealLabel, openingContractSealLabel = _k === void 0 ? i18next.t('盖光盈电子章') : _k, isSingleQj = props.isSingleQj, _l = props.isQjUseModal, isQjUseModal = _l === void 0 ? true : _l, defaultJustNeedQj = props.defaultJustNeedQj, isDeleteAllFileWhenJustUseQj = props.isDeleteAllFileWhenJustUseQj, _m = props.isShowQysWhenNeedNotQys, isShowQysWhenNeedNotQys = _m === void 0 ? true : _m, _o = props.isControlNeedQys, isControlNeedQys = _o === void 0 ? true : _o, isDeletePlaceholderFileData = props.isDeletePlaceholderFileData, isSupportNoAttachQj = props.isSupportNoAttachQj, caseId = props.caseId, _p = props.isChoiseChangeTemplateValid, isChoiseChangeTemplateValid = _p === void 0 ? true : _p, _q = props.isToggleQys, isToggleQys = _q === void 0 ? false : _q, _r = props.isQjVerifyCode, isQjVerifyCode = _r === void 0 ? false : _r, _s = props.isNewQys, isNewQys = _s === void 0 ? false : _s, isNewElectronSealStyle = props.isNewElectronSealStyle, isNewQunjSealStyle = props.isNewQunjSealStyle, _t = props.isShowBatchUseElectronicSealBtn, isShowBatchUseElectronicSealBtn = _t === void 0 ? true : _t, isShowBatchUseOpeningContractSealBtn = props.isShowBatchUseOpeningContractSealBtn, isShowOpeningContractSeal = props.isShowOpeningContractSeal, customButtons = props.customButtons, goWorkflowSeal = props.goWorkflowSeal, isShowSealApply = props.isShowSealApply, otherColumns = props.otherColumns, isShowOpeningContractSealNotRelyQys = props.isShowOpeningContractSealNotRelyQys, isNoWatermarkProcess = props.isNoWatermarkProcess, qunjListRenderFilter = props.qunjListRenderFilter, sealDownloadFlowStatus = props.sealDownloadFlowStatus, resetProps = __rest(props, ["request", "isTranslation", "previewUrl", "isUnControlled", "contractNumFlowIds", "fileUploadProps", "isShowFileUpload", "isShowFileUploadIndependence", "otherOptions", "fileBaseUrl", "apiBaseUrl", "electronHandleRef", "onValueChange", "isValidateSuccess", "refreshCode", "onCheckedComparison", "onFileTypeChangeGetItem", "tableScroll", "getCreateTimeHand", "isShowElectronBatchBtn", "isShowDownloadBatchBtn", "isShowBatchDeleteBtn", "isShowBatchDeleteBtnIndependence", "beforeBatchDelete", "isShowBatchPreviewBtn", "isShowFileComparisonBtn", "batchDownloadZipName", "isShowDoubleSignedBatchBtn", "isShowFileType", "isShowFileTypeMerge", "fmsIsElectronicSealLabel", "fmsIsElectronicSealPushLabel", "openingContractSealLabel", "isSingleQj", "isQjUseModal", "defaultJustNeedQj", "isDeleteAllFileWhenJustUseQj", "isShowQysWhenNeedNotQys", "isControlNeedQys", "isDeletePlaceholderFileData", "isSupportNoAttachQj", "caseId", "isChoiseChangeTemplateValid", "isToggleQys", "isQjVerifyCode", "isNewQys", "isNewElectronSealStyle", "isNewQunjSealStyle", "isShowBatchUseElectronicSealBtn", "isShowBatchUseOpeningContractSealBtn", "isShowOpeningContractSeal", "customButtons", "goWorkflowSeal", "isShowSealApply", "otherColumns", "isShowOpeningContractSealNotRelyQys", "isNoWatermarkProcess", "qunjListRenderFilter", "sealDownloadFlowStatus"]);
115
115
  var selectRows = useRef(null);
116
116
  // 批量更新时用于合并 onValueChange 调用,避免多次触发外部回调
117
117
  var batchUpdateRef = useRef({
@@ -163,7 +163,9 @@ var Making = function () {
163
163
  electronHandleRef: electronHandleRef, isValidateSuccess: function () {
164
164
  // 最后会调用一个接口 验证下是否所选的电子印章都已经盖了章 如果没有盖章 就会弹出一个选择框 让用户重新选择 重新选择后 如果用户把所有未盖章的电子印章都取消勾选的话 那么就会调用这个方法 说明校验通过 可以进行下一步
165
165
  console.log(i18next.t('最终校验通过了!!!'));
166
- } })),
166
+ },
167
+ // 是否显示合同分数
168
+ isContranctNum: true })),
167
169
  React.createElement("button", { onClick: function () {
168
170
  setParams(function (preParams) {
169
171
  return __assign(__assign({}, preParams), { deptId: preParams.deptId === '1514842376723976194'
@@ -270,10 +270,17 @@ declare const historyData1: {
270
270
  }[];
271
271
  qunjSeal: {
272
272
  vertifyCode: number;
273
- contranctNum: any;
273
+ contranctNum: number;
274
274
  isTakeOut: number;
275
275
  details: {
276
+ companyType: string;
277
+ companyTypeName: string;
278
+ sealName: string;
276
279
  sealNo: string;
280
+ areaType: number;
281
+ areaTypeName: string;
282
+ useType: number;
283
+ useTypeName: string;
277
284
  sealCount: number;
278
285
  }[];
279
286
  };
@@ -575,7 +575,8 @@ var historyData1 = [
575
575
  needQj: 1,
576
576
  deptId: '1514842459376930817',
577
577
  memberId: null,
578
- flowId: 'scm_order_contract_ccwlht',
578
+ // flowId: 'scm_order_contract_ccwlht',
579
+ flowId: 'scm_order_contract_cght',
579
580
  contractId: null,
580
581
  caseId: 'ab0f7dff-0294-4187-bffe-bf489101546b',
581
582
  docAttachMap: null,
@@ -610,11 +611,18 @@ var historyData1 = [
610
611
  ],
611
612
  qunjSeal: {
612
613
  vertifyCode: 281109,
613
- contranctNum: null,
614
+ contranctNum: 3,
614
615
  isTakeOut: 0,
615
616
  details: [
616
617
  {
617
- sealNo: 'YZ-2025-022',
618
+ companyType: 'K000',
619
+ companyTypeName: '浙商中拓集团股份有限公司',
620
+ sealName: '浙商中拓集团股份有限公司公章(杭州)',
621
+ sealNo: 'YZ-2023-008',
622
+ areaType: 1,
623
+ areaTypeName: '杭州',
624
+ useType: 3,
625
+ useTypeName: '公章',
618
626
  sealCount: 1,
619
627
  },
620
628
  ],
@@ -10,17 +10,55 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import i18next from 'ztxkutils/dist/i18next';
13
- import React, { useContext } from 'react';
13
+ import React, { useContext, useMemo } from 'react';
14
14
  import { DATA_TYPE_KEY, getColumnMergeProp } from '../hooks/useParseRecords';
15
15
  import ContractComparison from './contract-comparison';
16
16
  import NewContractComparison from './new-contract-comparison';
17
17
  import { currentRecordIsOnlyQunj } from '../utils';
18
18
  import { ElectronSignaturesContext } from '..';
19
19
  import TranslationButton from '../translateComponents/TranslateButton';
20
+ /**
21
+ * 根据各行实际显示的按钮/复选框组合计算列宽(表格为 table-layout: fixed,列宽无法内容自适应,需按内容条件动态计算)
22
+ * - 比对双按钮行(选择比对模板 + 查看比对结果/开始比对)或三复选框齐全(存样板+加水印+标为重要):240
23
+ * - 两个复选框:180
24
+ * - 其他:160
25
+ */
26
+ function calcContractColumnWidth(records, allData) {
27
+ var _a;
28
+ var width = 160;
29
+ (_a = records === null || records === void 0 ? void 0 : records.forEach) === null || _a === void 0 ? void 0 : _a.call(records, function (record) {
30
+ var _a;
31
+ var currentDataType = record === null || record === void 0 ? void 0 : record[DATA_TYPE_KEY];
32
+ var _b = allData[currentDataType] || {}, isShowChioseTemplate = _b.isShowChioseTemplate, isShowSaveTemplate = _b.isShowSaveTemplate, isShowContractComparsionHandle = _b.isShowContractComparsionHandle;
33
+ var isNeedComparison = isShowContractComparsionHandle === null || isShowContractComparsionHandle === void 0 ? void 0 : isShowContractComparsionHandle(record, records);
34
+ // 比对双按钮同行:选择比对模板 +(查看比对结果 或 无任务ID开始比对)
35
+ if (isNeedComparison &&
36
+ !record.isHideChoiseChangeTemplate &&
37
+ isShowChioseTemplate &&
38
+ (record.taskId || (record.templateAttachId && record.attachId))) {
39
+ width = Math.max(width, 240);
40
+ }
41
+ // 复选框数量:存样板 / 加水印(showAddWater 未传时默认显示)/ 标为重要
42
+ var checkboxCount = [
43
+ !record.isHideSaveCustomerReference && isShowSaveTemplate,
44
+ ((_a = record.showAddWater) !== null && _a !== void 0 ? _a : true) && record.attachId,
45
+ record.showImportant && record.attachId,
46
+ ].filter(Boolean).length;
47
+ if (checkboxCount >= 3) {
48
+ width = Math.max(width, 240);
49
+ }
50
+ else if (checkboxCount === 2) {
51
+ width = Math.max(width, 180);
52
+ }
53
+ });
54
+ return width;
55
+ }
20
56
  // 合同比对的clomuns
21
57
  export default function useContractColumns(options) {
22
58
  var records = options.records, dataTypeSort = options.dataTypeSort, allData = options.allData, lookCompareHandle = options.lookCompareHandle, dgInfoRef = options.dgInfoRef, myCompareHandle = options.myCompareHandle, onCheckedComparison = options.onCheckedComparison, request = options.request, previewUrl = options.previewUrl, isTranslation = options.isTranslation;
23
59
  var isNewQys = useContext(ElectronSignaturesContext).isNewQys;
60
+ // 列宽随各行按钮/复选框组合自适应(table-layout: fixed 下 width 即列宽)
61
+ var contractColumnWidth = useMemo(function () { return calcContractColumnWidth(records, allData); }, [records, allData]);
24
62
  var contractColumns = isNewQys
25
63
  ? [
26
64
  {
@@ -28,7 +66,7 @@ export default function useContractColumns(options) {
28
66
  title: i18next.t('附件扩展功能'),
29
67
  dataIndex: 'contractComparison',
30
68
  key: 'contractComparison',
31
- width: 220,
69
+ width: contractColumnWidth,
32
70
  align: 'center',
33
71
  render: function (text, record, index) {
34
72
  var currentOnlyQunj = currentRecordIsOnlyQunj(record);
@@ -1,5 +1,14 @@
1
1
  import i18next from 'ztxkutils/dist/i18next';
2
- import React, { memo } from 'react';
2
+ import React, { memo, useContext } from 'react';
3
+ import { ElectronSignaturesContext } from '..';
4
+ /** 公司简称 fallback 到全称 */
5
+ function getOwnerShortName(item) {
6
+ return (item === null || item === void 0 ? void 0 : item.ownerShortName) || (item === null || item === void 0 ? void 0 : item.ownerName) || '';
7
+ }
8
+ /** 印章简称 fallback 到全称 */
9
+ function getSealShortName(item) {
10
+ return (item === null || item === void 0 ? void 0 : item.sealShortName) || (item === null || item === void 0 ? void 0 : item.sealName) || '';
11
+ }
3
12
  export var NoUseElectronSeal = function () {
4
13
  return (React.createElement("div", { style: {
5
14
  height: '100%',
@@ -13,6 +22,7 @@ export var NoUseElectronSeal = function () {
13
22
  */
14
23
  var ElectronSealDetail = function (_a) {
15
24
  var sealList = _a.sealList, value = _a.value;
25
+ var isNewElectronSealStyle = useContext(ElectronSignaturesContext).isNewElectronSealStyle;
16
26
  // 电子印章数据没有加载完成或者加载出错
17
27
  if (!Array.isArray(sealList)) {
18
28
  return null;
@@ -21,11 +31,29 @@ var ElectronSealDetail = function (_a) {
21
31
  if (sealList.length === 0) {
22
32
  return React.createElement(NoUseElectronSeal, null);
23
33
  }
24
- // 整理数据 以ownerName维度,拆分数据
25
- return Array.isArray(value) && value.length > 0 ? (React.createElement("div", { className: "electron-seal-detail--wrap" }, value === null || value === void 0 ? void 0 : value.map(function (id) {
34
+ // 非编辑模式下,没有选中任何印章
35
+ if (!Array.isArray(value) || value.length === 0) {
36
+ return React.createElement(NoUseElectronSeal, null);
37
+ }
38
+ // 新版展示样式:按照"公司简称 印章简称"模式展示,带"已选印章"标题
39
+ if (isNewElectronSealStyle) {
40
+ return (React.createElement("div", { className: "electron-seal-detail-new--wrap" },
41
+ React.createElement("div", { className: "seal-selected-title" }, "\u5DF2\u9009\u5370\u7AE0"),
42
+ value.map(function (id) {
43
+ var _a;
44
+ var completeItem = (_a = sealList === null || sealList === void 0 ? void 0 : sealList.find) === null || _a === void 0 ? void 0 : _a.call(sealList, function (sealItem) { return sealItem.sealId === id; });
45
+ return (React.createElement("div", { key: id, className: "seal-selected-item", title: (((completeItem === null || completeItem === void 0 ? void 0 : completeItem.ownerName) || '') + " " + ((completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealName) || '')).trim() },
46
+ getOwnerShortName(completeItem),
47
+ " ",
48
+ getSealShortName(completeItem)));
49
+ })));
50
+ }
51
+ // 旧版展示样式:只显示印章简称
52
+ return (React.createElement("div", { className: "electron-seal-detail--wrap" }, value === null || value === void 0 ? void 0 : value.map(function (id) {
26
53
  var _a;
27
54
  var completeItem = (_a = sealList === null || sealList === void 0 ? void 0 : sealList.find) === null || _a === void 0 ? void 0 : _a.call(sealList, function (sealItem) { return sealItem.sealId === id; });
28
- return (React.createElement("div", { key: id, className: "electron-seal-detail--wrap__item" }, completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealName));
29
- }))) : (React.createElement(NoUseElectronSeal, null));
55
+ var displayName = (completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealShortName) || (completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealName);
56
+ return (React.createElement("div", { key: id, className: "electron-seal-detail--wrap__item", title: completeItem === null || completeItem === void 0 ? void 0 : completeItem.sealName }, displayName));
57
+ })));
30
58
  };
31
59
  export default memo(ElectronSealDetail);
@@ -20,42 +20,172 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import React, { memo, useMemo } from 'react';
23
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
24
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
25
+ to[j] = from[i];
26
+ return to;
27
+ };
28
+ import React, { memo, useMemo, useState, useContext, useEffect, useRef, } from 'react';
24
29
  import { Checkbox, Collapse } from '../../../index.build';
30
+ import { ElectronSignaturesContext } from '..';
31
+ import useBaseContext from '../../utils/useBaseContext';
32
+ /** 公司简称优先排序关键词(按指定顺序排前) */
33
+ var PRIORITY_OWNERS = ['浙商中拓', '浙江中拓', '湖南中拓', '海南中拓'];
34
+ /** 按优先级排序公司简称列表 */
35
+ function sortOwners(owners) {
36
+ var prioritized = PRIORITY_OWNERS.filter(function (o) { return owners.includes(o); });
37
+ var rest = owners.filter(function (o) { return !PRIORITY_OWNERS.includes(o); });
38
+ return __spreadArray(__spreadArray([], prioritized), rest);
39
+ }
40
+ /** 公司简称 fallback 到全称 */
41
+ function getOwnerShortName(item) {
42
+ return (item === null || item === void 0 ? void 0 : item.ownerShortName) || (item === null || item === void 0 ? void 0 : item.ownerName) || '';
43
+ }
44
+ /** 印章简称 fallback 到全称 */
45
+ function getSealShortName(item) {
46
+ return (item === null || item === void 0 ? void 0 : item.sealShortName) || (item === null || item === void 0 ? void 0 : item.sealName) || '';
47
+ }
25
48
  /**
26
49
  * 电子签章选择列表
27
50
  */
28
51
  var ElectronSealList = function (_a) {
29
- var sealList = _a.sealList, onChange = _a.onChange, isEdit = _a.isEdit, resetProp = __rest(_a, ["sealList", "onChange", "isEdit"]);
30
- // 整理数据 以ownerName维度,拆分数据
31
- var sealListMemo = useMemo(function () {
52
+ var sealList = _a.sealList, onChange = _a.onChange, isEdit = _a.isEdit, value = _a.value, resetProp = __rest(_a, ["sealList", "onChange", "isEdit", "value"]);
53
+ var isNewElectronSealStyle = useContext(ElectronSignaturesContext).isNewElectronSealStyle;
54
+ var _b = useBaseContext().electronSealTabTrigger, electronSealTabTrigger = _b === void 0 ? 'hover' : _b;
55
+ // 新版:以公司简称维度拆分数据
56
+ var _c = useMemo(function () {
32
57
  if (!Array.isArray(sealList)) {
33
58
  return {
34
- ownerNameList: [],
35
- result: {},
59
+ ownerList: [],
60
+ ownerMap: {},
36
61
  };
37
62
  }
38
- var ownerNameList = Array.from(new Set(sealList.map(function (item) { return item.ownerName; })));
39
- var result = {};
40
- ownerNameList.forEach(function (ownerName) {
41
- result[ownerName] = sealList.filter(function (item) { return item.ownerName === ownerName; });
63
+ var map = {};
64
+ sealList.forEach(function (item) {
65
+ var name = getOwnerShortName(item);
66
+ if (!map[name])
67
+ map[name] = [];
68
+ map[name].push(item);
42
69
  });
43
70
  return {
44
- ownerNameList: ownerNameList,
45
- result: result,
71
+ ownerList: sortOwners(Object.keys(map)),
72
+ ownerMap: map,
46
73
  };
47
- }, [sealList]);
48
- var ownerNameList = sealListMemo.ownerNameList, result = sealListMemo.result;
49
- return ownerNameList.length === 0 ? null : (React.createElement(Checkbox.Group, __assign({ onChange: function (e) {
50
- onChange && onChange(e);
51
- }, disabled: !isEdit, className: "electron-seal-list--wrap" }, resetProp),
52
- React.createElement(Collapse, { defaultActiveKey: ownerNameList.map(function (item, index) { return index; }), style: { width: '100%' } }, ownerNameList.map(function (ownerName, index) {
53
- var _a;
54
- return (React.createElement(Collapse.Panel, { key: index,
55
- // header={ownerName}
56
- header: React.createElement("div", { className: "electron-seal-list--owner-name" }, ownerName) }, (_a = result[ownerName]) === null || _a === void 0 ? void 0 : _a.map(function (item) {
57
- return (React.createElement(Checkbox, { key: item.sealId, value: item.sealId }, item.sealName));
58
- })));
59
- }))));
74
+ }, [sealList]), ownerList = _c.ownerList, ownerMap = _c.ownerMap;
75
+ // 旧版:以 ownerName 维度拆分数据
76
+ var _d = useMemo(function () {
77
+ if (!Array.isArray(sealList)) {
78
+ return { ownerNameList: [], ownerNameResult: {} };
79
+ }
80
+ var list = Array.from(new Set(sealList.map(function (item) { return item.ownerName; })));
81
+ var result = {};
82
+ list.forEach(function (ownerName) {
83
+ result[ownerName] = sealList.filter(function (item) { return item.ownerName === ownerName; });
84
+ });
85
+ return { ownerNameList: list, ownerNameResult: result };
86
+ }, [sealList]), ownerNameList = _d.ownerNameList, ownerNameResult = _d.ownerNameResult;
87
+ // 新版:当前选中的公司(默认第一个)
88
+ var _e = useState(ownerList[0]), selectedOwner = _e[0], setSelectedOwner = _e[1];
89
+ useEffect(function () {
90
+ // 公司列表变化时,重置选中公司为第一个
91
+ if (ownerList.length > 0 && !ownerList.includes(selectedOwner)) {
92
+ setSelectedOwner(ownerList[0]);
93
+ }
94
+ }, [ownerList, selectedOwner]);
95
+ // 悬浮延迟切换:停留 300ms 才切换,快速划过(如跨行移动)不触发
96
+ var hoverTimerRef = useRef(null);
97
+ useEffect(function () {
98
+ return function () { return clearTimeout(hoverTimerRef.current); };
99
+ }, []);
100
+ var handleOwnerHover = function (owner) {
101
+ if (selectedOwner === owner)
102
+ return;
103
+ clearTimeout(hoverTimerRef.current);
104
+ hoverTimerRef.current = setTimeout(function () {
105
+ setSelectedOwner(owner);
106
+ }, 300);
107
+ };
108
+ var clearHoverTimer = function () {
109
+ clearTimeout(hoverTimerRef.current);
110
+ };
111
+ // 新版:当前选中公司下的印章列表
112
+ var currentSeals = ownerMap[selectedOwner] || [];
113
+ // 新版:sealId → 公司简称 映射,用于统计每个公司选中了几个印章
114
+ var sealIdToOwner = useMemo(function () {
115
+ var map = {};
116
+ Object.keys(ownerMap).forEach(function (owner) {
117
+ ownerMap[owner].forEach(function (item) {
118
+ map[item.sealId] = owner;
119
+ });
120
+ });
121
+ return map;
122
+ }, [ownerMap]);
123
+ // 新版:每个公司下选中的印章数量
124
+ var ownerSelectedCount = useMemo(function () {
125
+ var countMap = {};
126
+ if (Array.isArray(value)) {
127
+ value.forEach(function (sealId) {
128
+ var owner = sealIdToOwner[sealId];
129
+ if (owner) {
130
+ countMap[owner] = (countMap[owner] || 0) + 1;
131
+ }
132
+ });
133
+ }
134
+ return countMap;
135
+ }, [value, sealIdToOwner]);
136
+ // 新版:已选印章完整信息列表
137
+ var selectedSealList = useMemo(function () {
138
+ if (!Array.isArray(value) || !Array.isArray(sealList)) {
139
+ return [];
140
+ }
141
+ return value
142
+ .map(function (id) { return sealList.find(function (item) { return item.sealId === id; }); })
143
+ .filter(Boolean);
144
+ }, [value, sealList]);
145
+ // ========= 旧版渲染(手风琴模式) =========
146
+ if (!isNewElectronSealStyle) {
147
+ return ownerNameList.length === 0 ? null : (React.createElement(Checkbox.Group, __assign({ value: value, onChange: function (e) {
148
+ onChange && onChange(e);
149
+ }, disabled: !isEdit, className: "electron-seal-list--wrap" }, resetProp),
150
+ React.createElement(Collapse, { defaultActiveKey: ownerNameList.map(function (item, index) { return index; }), style: { width: '100%' } }, ownerNameList.map(function (ownerName, index) {
151
+ var _a;
152
+ return (React.createElement(Collapse.Panel, { key: index, header: React.createElement("div", { className: "electron-seal-list--owner-name" }, ownerName) }, (_a = ownerNameResult[ownerName]) === null || _a === void 0 ? void 0 : _a.map(function (item) {
153
+ return (React.createElement(Checkbox, { key: item.sealId, value: item.sealId }, item.sealName));
154
+ })));
155
+ }))));
156
+ }
157
+ // ========= 新版渲染(三段式布局) =========
158
+ if (ownerList.length === 0) {
159
+ return null;
160
+ }
161
+ return (React.createElement("div", __assign({ className: "electron-seal-list-new--wrap" }, resetProp),
162
+ React.createElement("div", { className: "seal-owner-tabs" }, ownerList.map(function (owner) {
163
+ var _a, _b;
164
+ var count = ownerSelectedCount[owner] || 0;
165
+ return (React.createElement("div", __assign({ key: owner, className: "seal-owner-tab " + (selectedOwner === owner ? 'seal-owner-tab--active' : ''), title: ((_b = (_a = ownerMap[owner]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.ownerName) || owner }, (electronSealTabTrigger === 'hover'
166
+ ? {
167
+ onMouseEnter: function () { return handleOwnerHover(owner); },
168
+ onMouseLeave: clearHoverTimer,
169
+ }
170
+ : { onClick: function () { return setSelectedOwner(owner); } })),
171
+ React.createElement("span", { className: "seal-owner-tab--name" }, owner),
172
+ count > 0 && (React.createElement("span", { className: "seal-owner-tab--count" }, count))));
173
+ })),
174
+ React.createElement("div", { className: "seal-list-current" }, currentSeals.map(function (item) {
175
+ var checked = Array.isArray(value) && value.includes(item.sealId);
176
+ return (React.createElement(Checkbox, { key: item.sealId, checked: checked, disabled: !isEdit, onChange: function () {
177
+ var newValue = checked
178
+ ? (value || []).filter(function (id) { return id !== item.sealId; })
179
+ : __spreadArray(__spreadArray([], (value || [])), [item.sealId]);
180
+ onChange && onChange(newValue);
181
+ } },
182
+ React.createElement("span", { title: item.sealName }, getSealShortName(item))));
183
+ })),
184
+ React.createElement("div", { className: "seal-selected-summary" },
185
+ React.createElement("div", { className: "seal-selected-title" }, "\u5DF2\u9009\u5370\u7AE0"),
186
+ selectedSealList.length > 0 ? (selectedSealList.map(function (item) { return (React.createElement("div", { key: item.sealId, className: "seal-selected-item", title: ((item.ownerName || '') + " " + (item.sealName || '')).trim() },
187
+ getOwnerShortName(item),
188
+ " ",
189
+ getSealShortName(item))); })) : (React.createElement("div", { className: "seal-selected-empty" }, "\u6682\u672A\u9009\u62E9\u5370\u7AE0")))));
60
190
  };
61
191
  export default memo(ElectronSealList);
@@ -198,6 +198,19 @@ export default function useElectronColumns(options) {
198
198
  width: 320,
199
199
  align: 'center',
200
200
  render: selectElectronRender,
201
+ // 新版三段式布局下固定列宽(scroll.x=max-content 时 width 会被内容撑开)
202
+ onHeaderCell: function () { return ({
203
+ style: { width: 320, minWidth: 320, maxWidth: 320 },
204
+ }); },
205
+ onCell: function () { return ({
206
+ // 内容从顶部往下排,避免切换公司时因印章数量不同导致内容垂直居中抖动
207
+ style: {
208
+ width: 320,
209
+ minWidth: 320,
210
+ maxWidth: 320,
211
+ verticalAlign: 'top',
212
+ },
213
+ }); },
201
214
  },
202
215
  ]
203
216
  : // 下面是最初设计的模式
@@ -78,8 +78,17 @@ export default function useFileColumns(options) {
78
78
  title: i18next.t('类型'),
79
79
  dataIndex: 'attachType',
80
80
  key: 'attachType',
81
- width: 80,
81
+ width: 108,
82
82
  align: 'center',
83
+ // 固定列宽(scroll.x=max-content 时 width 会被内容撑开)
84
+ onHeaderCell: function () { return ({
85
+ className: 'file-type-col',
86
+ style: { width: 108, minWidth: 108, maxWidth: 108 },
87
+ }); },
88
+ onCell: function () { return ({
89
+ className: 'file-type-col',
90
+ style: { width: 108, minWidth: 108, maxWidth: 108 },
91
+ }); },
83
92
  render: function (text, record, index) {
84
93
  var currentOnlyQunj = currentRecordIsOnlyQunj(record);
85
94
  if (currentOnlyQunj) {
@@ -112,7 +121,7 @@ export default function useFileColumns(options) {
112
121
  title: i18next.t('附件名称'),
113
122
  dataIndex: 'attachName',
114
123
  key: 'attachName',
115
- width: 260,
124
+ width: 220,
116
125
  align: 'center',
117
126
  render: function (text, record, index) {
118
127
  var currentOnlyQunj = currentRecordIsOnlyQunj(record);
@@ -11,6 +11,15 @@ export default function useFileTypeColumns(options) {
11
11
  key: 'attachBelongTo',
12
12
  width: 70,
13
13
  align: 'center',
14
+ // 固定列宽(scroll.x=max-content 时 width 会被内容撑开)
15
+ onHeaderCell: function () { return ({
16
+ className: 'file-belong-col',
17
+ style: { width: 70, minWidth: 70, maxWidth: 70 },
18
+ }); },
19
+ onCell: function () { return ({
20
+ className: 'file-belong-col',
21
+ style: { width: 70, minWidth: 70, maxWidth: 70 },
22
+ }); },
14
23
  render: function (text, record, index) {
15
24
  var _a = getColumnMergeProp({
16
25
  record: record,
@@ -3,6 +3,10 @@ import { IElectronSignaturesProps } from './interface';
3
3
  interface IElectronSignaturesContext {
4
4
  isQjVerifyCode?: boolean;
5
5
  isNewQys?: boolean;
6
+ /** 电子印章是否使用新版展示样式 */
7
+ isNewElectronSealStyle?: boolean;
8
+ /** 群杰印章是否使用新版展示样式 */
9
+ isNewQunjSealStyle?: boolean;
6
10
  }
7
11
  export declare const ElectronSignaturesContext: React.Context<IElectronSignaturesContext>;
8
12
  declare const _default: React.NamedExoticComponent<IElectronSignaturesProps>;
@@ -22,20 +22,33 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import React, { memo, useMemo, createContext } from 'react';
24
24
  import ElectronSignatures from './content';
25
+ import useBaseContext from '../utils/useBaseContext';
25
26
  export var ElectronSignaturesContext = createContext({
26
27
  isNewQys: true,
27
28
  isQjVerifyCode: true,
29
+ isNewElectronSealStyle: false,
30
+ isNewQunjSealStyle: false,
28
31
  });
29
32
  /**
30
33
  * 容器组件,为了将context传递给组件,方便组件能快速访问到一些信息
31
34
  */
32
35
  var ElectronSignaturesWrap = function (props) {
36
+ var _a, _b, _c, _d;
33
37
  // 这里未上线之前,都使用默认为false。不采用最新版本的修改
34
- var _a = props.isQjVerifyCode, isQjVerifyCode = _a === void 0 ? false : _a, _b = props.isNewQys, isNewQys = _b === void 0 ? false : _b, resetProps = __rest(props, ["isQjVerifyCode", "isNewQys"]);
38
+ var _e = props.isQjVerifyCode, isQjVerifyCode = _e === void 0 ? false : _e, _f = props.isNewQys, isNewQys = _f === void 0 ? false : _f, resetProps = __rest(props, ["isQjVerifyCode", "isNewQys"]);
39
+ // 全局配置:组件 props 优先,未传时取全局 ZtxkContext 配置
40
+ var _g = useBaseContext(), globalElectronSealStyle = _g.isNewElectronSealStyle, globalQunjSealStyle = _g.isNewQunjSealStyle;
41
+ var isNewElectronSealStyle = (_b = (_a = props.isNewElectronSealStyle) !== null && _a !== void 0 ? _a : globalElectronSealStyle) !== null && _b !== void 0 ? _b : false;
42
+ var isNewQunjSealStyle = (_d = (_c = props.isNewQunjSealStyle) !== null && _c !== void 0 ? _c : globalQunjSealStyle) !== null && _d !== void 0 ? _d : false;
35
43
  var defaultContext = useMemo(function () {
36
- return { isNewQys: isNewQys, isQjVerifyCode: isQjVerifyCode };
37
- }, [isNewQys, isQjVerifyCode]);
44
+ return {
45
+ isNewQys: isNewQys,
46
+ isQjVerifyCode: isQjVerifyCode,
47
+ isNewElectronSealStyle: isNewElectronSealStyle,
48
+ isNewQunjSealStyle: isNewQunjSealStyle,
49
+ };
50
+ }, [isNewQys, isQjVerifyCode, isNewElectronSealStyle, isNewQunjSealStyle]);
38
51
  return (React.createElement(ElectronSignaturesContext.Provider, { value: defaultContext },
39
- React.createElement(ElectronSignatures, __assign({ isQjVerifyCode: isQjVerifyCode, isNewQys: isNewQys }, resetProps))));
52
+ React.createElement(ElectronSignatures, __assign({ isQjVerifyCode: isQjVerifyCode, isNewQys: isNewQys, isNewElectronSealStyle: isNewElectronSealStyle, isNewQunjSealStyle: isNewQunjSealStyle }, resetProps))));
40
53
  };
41
54
  export default memo(ElectronSignaturesWrap);
@@ -445,6 +445,16 @@ export interface IElectronSignaturesItemPublic {
445
445
  * 是否应用 最新的契约锁组件样式
446
446
  */
447
447
  isNewQys?: boolean;
448
+ /**
449
+ * 是否使用新版电子印章展示样式(公司简称分组 + 三段式布局)
450
+ * 未传时取全局 ZtxkContext 中的 isNewElectronSealStyle
451
+ */
452
+ isNewElectronSealStyle?: boolean;
453
+ /**
454
+ * 是否使用新版群杰印章展示样式(公司分组 + 三段式布局)
455
+ * 未传时取全局 ZtxkContext 中的 isNewQunjSealStyle
456
+ */
457
+ isNewQunjSealStyle?: boolean;
448
458
  /**
449
459
  * 户用合同章显示的逻辑的控制
450
460
  */
@@ -25,6 +25,10 @@ interface IProps {
25
25
  qjVerifyCodeData?: IQjVerifyCode[];
26
26
  getQjVerifyCodeHandle?: (params: any) => Promise<any>;
27
27
  flowStatus?: ITrackItem['flowStatus'];
28
+ /** 是否显示用印增加申请 */
29
+ isShowSealApply?: boolean;
30
+ /** 前往流程中心用印申请 */
31
+ goWorkflowSeal?: (wfProcessInstId: string) => void;
28
32
  }
29
33
  declare const _default: React.NamedExoticComponent<IProps>;
30
34
  export default _default;