@gct-paas/word 0.1.74-beta.13 → 0.1.74-beta.14
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/dist/base/utils/image-size-util.d.ts +2 -0
- package/dist/core/model/document/Wtbl/Calculation.d.ts +8 -2
- package/dist/core/model/document/Wtbl/RowColumnOps.d.ts +15 -3
- package/dist/domain/table/business/check/check-table/actions/fetch-check-items.d.ts +1 -0
- package/dist/index.es.js +308 -174
- package/dist/runtime/canvas/table/render/table-structure-overlay/sub-table-action/quick-fill.util.d.ts +5 -1
- package/package.json +1 -1
|
@@ -34,6 +34,8 @@ export declare function computeContainLayout(natural: ImageSize, box: ImageSize)
|
|
|
34
34
|
* 在目标框内等比缩放(contain),不压缩、不拉伸
|
|
35
35
|
*/
|
|
36
36
|
export declare function computeContainDisplaySize(natural: ImageSize, box: ImageSize): ImageSize;
|
|
37
|
+
/** 同步取无图签名缓存(布局重建时可避免先闪占位再异步补图) */
|
|
38
|
+
export declare function getCachedSignatureImage(name: string, width?: number, height?: number, time?: number | string): HTMLImageElement | null;
|
|
37
39
|
/**
|
|
38
40
|
* 创建无图签名兜底图(用户名 + 电子签名 + 验证日期)
|
|
39
41
|
* 按字段宽高绘制,显示框设多大,字就按多大排
|
|
@@ -25,7 +25,13 @@ export declare class WtblCalculation {
|
|
|
25
25
|
*/
|
|
26
26
|
private static processBounded;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* 按 itemRegion.id 查找嵌套的数据分组 / 动态关联区域
|
|
29
|
+
* (itemRegion 不在 table.regions 顶层,不能用 findRegionById)
|
|
30
|
+
*/
|
|
31
|
+
private static findItemRegionById;
|
|
32
|
+
private static applyBoundsToItemRegion;
|
|
33
|
+
/**
|
|
34
|
+
* 处理 boundedItem 数据(更新父级 bounded 的 itemRegion 边界)
|
|
29
35
|
*/
|
|
30
36
|
private static processBoundedItem;
|
|
31
37
|
/**
|
|
@@ -33,7 +39,7 @@ export declare class WtblCalculation {
|
|
|
33
39
|
*/
|
|
34
40
|
private static processCheckTable;
|
|
35
41
|
/**
|
|
36
|
-
* 处理 dataGroup2D
|
|
42
|
+
* 处理 dataGroup2D 数据(更新检验表 / 二维表上的 itemRegion 边界)
|
|
37
43
|
*/
|
|
38
44
|
private static processDataGroup2D;
|
|
39
45
|
}
|
|
@@ -9,11 +9,23 @@ export declare class WtblRowColumnOps {
|
|
|
9
9
|
/** 仅外表需要做「删除行/列/表时联动删除嵌套表」 */
|
|
10
10
|
private static detachNestedTablesFromOuterTable;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* 新单元格同步引用信息(mergeId / subTable / subTableItem / header)
|
|
13
|
+
*
|
|
14
|
+
* 必须两侧参考单元格都存在,且对应字段一致,才写入新格。
|
|
15
|
+
* 单侧缺失(表边界、子表外侧空行)不同步,避免检验表等 region
|
|
16
|
+
* 在「上一行/下一行插入」时被错误扩大,进而触发重叠校验误报。
|
|
15
17
|
*/
|
|
16
18
|
private static syncRefInfo;
|
|
19
|
+
/**
|
|
20
|
+
* 在 insertIndex 处插入一行后,将落在该行及以下的 region / itemRegion 行号整体 +1。
|
|
21
|
+
* 否则仅靠单元格标记回写时,动态关联 itemRegion 若未能匹配 id,边界会留在原行,
|
|
22
|
+
* 设计端字段与背景框就不会随检验表下移。
|
|
23
|
+
*/
|
|
24
|
+
private static shiftRegionsForRowInsert;
|
|
25
|
+
/**
|
|
26
|
+
* 在 insertIndex 处插入一列后,将落在该列及右侧的 region / itemRegion 列号整体 +1。
|
|
27
|
+
*/
|
|
28
|
+
private static shiftRegionsForColInsert;
|
|
17
29
|
/**
|
|
18
30
|
* 在指定行位置插入新行
|
|
19
31
|
*/
|
|
@@ -2,6 +2,7 @@ import { CheckTableItemInfosPayload, CheckTableRegionRef } from '../types';
|
|
|
2
2
|
import { ICheckTableConfig } from '../front-config';
|
|
3
3
|
/**
|
|
4
4
|
* 按已扫描的检验表 region 并行解析检验项(有快照用快照,否则请求)。
|
|
5
|
+
* @param instanceId 真实填报实例 id;设计态 / 模拟填报应传空字符串(默认数据源将跳过请求)
|
|
5
6
|
* @returns infosMap / countMap(count 至少为 1,用于占位行)/ 待落库 byTable 快照
|
|
6
7
|
*/
|
|
7
8
|
export declare function fetchCheckItemsForRegions(instanceId: string, regions: CheckTableRegionRef[], checkTableConfig?: ICheckTableConfig): Promise<{
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @gct-paas/word v0.1.74-beta.
|
|
1
|
+
/*! @gct-paas/word v0.1.74-beta.14 */
|
|
2
2
|
import { Fragment, Suspense, Teleport, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, toRef, toValue, unref, useCssVars, useModel, useSlots, vModelText, vShow, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
3
3
|
import FloatingVue, { PopperWrapper } from "floating-vue";
|
|
4
4
|
import VueKonva from "vue-konva";
|
|
@@ -92884,11 +92884,10 @@ async function fetchCustomCheckDsData(customCheckDsItems) {
|
|
|
92884
92884
|
return toPayload(await callBizService(CUSTOM_API, { ids: customCheckDsItems.join(",") }));
|
|
92885
92885
|
}
|
|
92886
92886
|
async function fetchOneRegionInfo(instanceId, region) {
|
|
92887
|
-
if (!instanceId) return EMPTY_INFO;
|
|
92888
92887
|
const props = region.props ?? {};
|
|
92889
92888
|
const checkDsType = props.checkDsType;
|
|
92890
92889
|
const customCheckDsItems = Array.isArray(props.customCheckDsItems) ? props.customCheckDsItems : [];
|
|
92891
|
-
const info = checkDsType === CheckDsTypeEnum.CUSTOM ? await fetchCustomCheckDsData(customCheckDsItems) : await fetchCheckDsDataForTable(instanceId);
|
|
92890
|
+
const info = checkDsType === CheckDsTypeEnum.CUSTOM ? await fetchCustomCheckDsData(customCheckDsItems) : instanceId ? await fetchCheckDsDataForTable(instanceId) : EMPTY_INFO;
|
|
92892
92891
|
return {
|
|
92893
92892
|
...info,
|
|
92894
92893
|
data: stripInspectionItemIds(info.data)
|
|
@@ -92896,6 +92895,7 @@ async function fetchOneRegionInfo(instanceId, region) {
|
|
|
92896
92895
|
}
|
|
92897
92896
|
/**
|
|
92898
92897
|
* 按已扫描的检验表 region 并行解析检验项(有快照用快照,否则请求)。
|
|
92898
|
+
* @param instanceId 真实填报实例 id;设计态 / 模拟填报应传空字符串(默认数据源将跳过请求)
|
|
92899
92899
|
* @returns infosMap / countMap(count 至少为 1,用于占位行)/ 待落库 byTable 快照
|
|
92900
92900
|
*/
|
|
92901
92901
|
async function fetchCheckItemsForRegions(instanceId, regions, checkTableConfig) {
|
|
@@ -96953,7 +96953,7 @@ var init_DataManager = __esmMin((() => {
|
|
|
96953
96953
|
*/
|
|
96954
96954
|
getRawData() {
|
|
96955
96955
|
const data = this.deepClone(this.rawData);
|
|
96956
|
-
for (
|
|
96956
|
+
for (const path of this.defaults.keys()) {
|
|
96957
96957
|
if (this.defaults.get(path) === void 0) continue;
|
|
96958
96958
|
if (path.includes("[n")) continue;
|
|
96959
96959
|
if (this.getByPath(data, path) !== void 0) continue;
|
|
@@ -97429,12 +97429,12 @@ var init_DataManager = __esmMin((() => {
|
|
|
97429
97429
|
*/
|
|
97430
97430
|
getDefault(path) {
|
|
97431
97431
|
if (this.defaults.has(path)) {
|
|
97432
|
-
|
|
97432
|
+
const value = this.defaults.get(path);
|
|
97433
97433
|
return this.formatRuntimeValue(value);
|
|
97434
97434
|
}
|
|
97435
97435
|
const pathWithWildcard = this.convertPathToWildcard(path);
|
|
97436
97436
|
if (pathWithWildcard !== path && this.defaults.has(pathWithWildcard)) {
|
|
97437
|
-
|
|
97437
|
+
const value = this.defaults.get(pathWithWildcard);
|
|
97438
97438
|
return this.formatRuntimeValue(value);
|
|
97439
97439
|
}
|
|
97440
97440
|
}
|
|
@@ -102742,11 +102742,12 @@ var init_BoundedRegion = __esmMin((() => {
|
|
|
102742
102742
|
widgetMeta: json.widgetMeta
|
|
102743
102743
|
});
|
|
102744
102744
|
if (json.itemRegion) {
|
|
102745
|
-
var _json$itemRegion, _json$itemRegion2;
|
|
102745
|
+
var _json$itemRegion, _json$itemRegion2, _json$itemRegion3;
|
|
102746
102746
|
region.itemRegion = new BoundedItemRegion({
|
|
102747
102747
|
table,
|
|
102748
|
-
|
|
102749
|
-
|
|
102748
|
+
id: (_json$itemRegion = json.itemRegion) === null || _json$itemRegion === void 0 ? void 0 : _json$itemRegion.id,
|
|
102749
|
+
start: (_json$itemRegion2 = json.itemRegion) === null || _json$itemRegion2 === void 0 ? void 0 : _json$itemRegion2.start,
|
|
102750
|
+
end: (_json$itemRegion3 = json.itemRegion) === null || _json$itemRegion3 === void 0 ? void 0 : _json$itemRegion3.end,
|
|
102750
102751
|
parent: region
|
|
102751
102752
|
});
|
|
102752
102753
|
}
|
|
@@ -102850,11 +102851,12 @@ var init_LinkSubTableRegion = __esmMin((() => {
|
|
|
102850
102851
|
}
|
|
102851
102852
|
static restoreItemRegion(region, json, table) {
|
|
102852
102853
|
if (json.itemRegion) {
|
|
102853
|
-
var _json$itemRegion, _json$itemRegion2;
|
|
102854
|
+
var _json$itemRegion, _json$itemRegion2, _json$itemRegion3;
|
|
102854
102855
|
region.itemRegion = new DataGroup2DRegion({
|
|
102855
102856
|
table,
|
|
102856
|
-
|
|
102857
|
-
|
|
102857
|
+
id: (_json$itemRegion = json.itemRegion) === null || _json$itemRegion === void 0 ? void 0 : _json$itemRegion.id,
|
|
102858
|
+
start: (_json$itemRegion2 = json.itemRegion) === null || _json$itemRegion2 === void 0 ? void 0 : _json$itemRegion2.start,
|
|
102859
|
+
end: (_json$itemRegion3 = json.itemRegion) === null || _json$itemRegion3 === void 0 ? void 0 : _json$itemRegion3.end,
|
|
102858
102860
|
parent: region
|
|
102859
102861
|
});
|
|
102860
102862
|
}
|
|
@@ -103091,19 +103093,50 @@ var init_RowColumnOps = __esmMin((() => {
|
|
|
103091
103093
|
table.collectNestedTables().forEach((nested) => nested.remove());
|
|
103092
103094
|
}
|
|
103093
103095
|
/**
|
|
103094
|
-
*
|
|
103095
|
-
*
|
|
103096
|
-
*
|
|
103096
|
+
* 新单元格同步引用信息(mergeId / subTable / subTableItem / header)
|
|
103097
|
+
*
|
|
103098
|
+
* 必须两侧参考单元格都存在,且对应字段一致,才写入新格。
|
|
103099
|
+
* 单侧缺失(表边界、子表外侧空行)不同步,避免检验表等 region
|
|
103100
|
+
* 在「上一行/下一行插入」时被错误扩大,进而触发重叠校验误报。
|
|
103097
103101
|
*/
|
|
103098
|
-
static syncRefInfo(newCell,
|
|
103102
|
+
static syncRefInfo(newCell, sideA, sideB) {
|
|
103103
|
+
if (!sideA || !sideB) return;
|
|
103099
103104
|
WTC_REF_KEYS.forEach((key) => {
|
|
103100
|
-
const refValue =
|
|
103105
|
+
const refValue = sideA[key];
|
|
103101
103106
|
if (!refValue) return;
|
|
103102
|
-
if (
|
|
103107
|
+
if (JSON.stringify(sideB[key]) !== JSON.stringify(refValue)) return;
|
|
103103
103108
|
newCell[key] = refValue;
|
|
103104
103109
|
});
|
|
103105
103110
|
}
|
|
103106
103111
|
/**
|
|
103112
|
+
* 在 insertIndex 处插入一行后,将落在该行及以下的 region / itemRegion 行号整体 +1。
|
|
103113
|
+
* 否则仅靠单元格标记回写时,动态关联 itemRegion 若未能匹配 id,边界会留在原行,
|
|
103114
|
+
* 设计端字段与背景框就不会随检验表下移。
|
|
103115
|
+
*/
|
|
103116
|
+
static shiftRegionsForRowInsert(table, insertIndex) {
|
|
103117
|
+
for (const region of table.regions) {
|
|
103118
|
+
if (region.start.row >= insertIndex) region.start.row += 1;
|
|
103119
|
+
if (region.end.row >= insertIndex) region.end.row += 1;
|
|
103120
|
+
const itemRegion = region.itemRegion;
|
|
103121
|
+
if (!itemRegion) continue;
|
|
103122
|
+
if (itemRegion.start.row >= insertIndex) itemRegion.start.row += 1;
|
|
103123
|
+
if (itemRegion.end.row >= insertIndex) itemRegion.end.row += 1;
|
|
103124
|
+
}
|
|
103125
|
+
}
|
|
103126
|
+
/**
|
|
103127
|
+
* 在 insertIndex 处插入一列后,将落在该列及右侧的 region / itemRegion 列号整体 +1。
|
|
103128
|
+
*/
|
|
103129
|
+
static shiftRegionsForColInsert(table, insertIndex) {
|
|
103130
|
+
for (const region of table.regions) {
|
|
103131
|
+
if (region.start.col >= insertIndex) region.start.col += 1;
|
|
103132
|
+
if (region.end.col >= insertIndex) region.end.col += 1;
|
|
103133
|
+
const itemRegion = region.itemRegion;
|
|
103134
|
+
if (!itemRegion) continue;
|
|
103135
|
+
if (itemRegion.start.col >= insertIndex) itemRegion.start.col += 1;
|
|
103136
|
+
if (itemRegion.end.col >= insertIndex) itemRegion.end.col += 1;
|
|
103137
|
+
}
|
|
103138
|
+
}
|
|
103139
|
+
/**
|
|
103107
103140
|
* 在指定行位置插入新行
|
|
103108
103141
|
*/
|
|
103109
103142
|
static insertRowAt(table, index) {
|
|
@@ -103117,6 +103150,7 @@ var init_RowColumnOps = __esmMin((() => {
|
|
|
103117
103150
|
this.syncRefInfo(cell, above, below);
|
|
103118
103151
|
});
|
|
103119
103152
|
table.insertChildAt(index, newRow);
|
|
103153
|
+
this.shiftRegionsForRowInsert(table, index);
|
|
103120
103154
|
} });
|
|
103121
103155
|
}
|
|
103122
103156
|
/**
|
|
@@ -103126,11 +103160,13 @@ var init_RowColumnOps = __esmMin((() => {
|
|
|
103126
103160
|
const refRow = table.getChildAt(index);
|
|
103127
103161
|
if (!refRow) return;
|
|
103128
103162
|
table.runConsistencyMutation({ mutate: () => {
|
|
103163
|
+
const above = table.rows[index - 1];
|
|
103129
103164
|
const newRow = Wtr.fromTemplate(table.colWidths || []);
|
|
103130
103165
|
newRow.children.forEach((cell, cellIndex) => {
|
|
103131
|
-
this.syncRefInfo(cell, refRow.cells[cellIndex]);
|
|
103166
|
+
this.syncRefInfo(cell, above === null || above === void 0 ? void 0 : above.cells[cellIndex], refRow.cells[cellIndex]);
|
|
103132
103167
|
});
|
|
103133
103168
|
table.insertBefore(refRow, newRow);
|
|
103169
|
+
this.shiftRegionsForRowInsert(table, index);
|
|
103134
103170
|
} });
|
|
103135
103171
|
}
|
|
103136
103172
|
/**
|
|
@@ -103140,11 +103176,13 @@ var init_RowColumnOps = __esmMin((() => {
|
|
|
103140
103176
|
const refRow = table.getChildAt(index);
|
|
103141
103177
|
if (!refRow) return;
|
|
103142
103178
|
table.runConsistencyMutation({ mutate: () => {
|
|
103179
|
+
const below = table.rows[index + 1];
|
|
103143
103180
|
const newRow = Wtr.fromTemplate(table.colWidths || []);
|
|
103144
103181
|
newRow.children.forEach((cell, cellIndex) => {
|
|
103145
|
-
this.syncRefInfo(cell, refRow.cells[cellIndex]);
|
|
103182
|
+
this.syncRefInfo(cell, refRow.cells[cellIndex], below === null || below === void 0 ? void 0 : below.cells[cellIndex]);
|
|
103146
103183
|
});
|
|
103147
103184
|
table.insertAfter(refRow, newRow);
|
|
103185
|
+
this.shiftRegionsForRowInsert(table, index + 1);
|
|
103148
103186
|
} });
|
|
103149
103187
|
}
|
|
103150
103188
|
/**
|
|
@@ -103161,6 +103199,7 @@ var init_RowColumnOps = __esmMin((() => {
|
|
|
103161
103199
|
this.syncRefInfo(newCell, left, right);
|
|
103162
103200
|
}
|
|
103163
103201
|
if (table.colWidths) table.colWidths.splice(index, 0, colWidth);
|
|
103202
|
+
this.shiftRegionsForColInsert(table, index);
|
|
103164
103203
|
} });
|
|
103165
103204
|
}
|
|
103166
103205
|
/**
|
|
@@ -103170,13 +103209,15 @@ var init_RowColumnOps = __esmMin((() => {
|
|
|
103170
103209
|
table.runConsistencyMutation({ mutate: () => {
|
|
103171
103210
|
const colWidth = DEFAULT_WIDTH;
|
|
103172
103211
|
for (const row of table.rows) {
|
|
103173
|
-
const
|
|
103174
|
-
if (!
|
|
103212
|
+
const right = row.cells[index];
|
|
103213
|
+
if (!right) continue;
|
|
103214
|
+
const left = row.cells[index - 1];
|
|
103175
103215
|
const newCell = Wtc.fromTemplate(colWidth);
|
|
103176
|
-
this.syncRefInfo(newCell,
|
|
103216
|
+
this.syncRefInfo(newCell, left, right);
|
|
103177
103217
|
row.insertChildAt(index, newCell);
|
|
103178
103218
|
}
|
|
103179
103219
|
if (table.colWidths) table.colWidths.splice(index, 0, colWidth);
|
|
103220
|
+
this.shiftRegionsForColInsert(table, index);
|
|
103180
103221
|
} });
|
|
103181
103222
|
}
|
|
103182
103223
|
/**
|
|
@@ -103186,13 +103227,15 @@ var init_RowColumnOps = __esmMin((() => {
|
|
|
103186
103227
|
table.runConsistencyMutation({ mutate: () => {
|
|
103187
103228
|
const colWidth = DEFAULT_WIDTH;
|
|
103188
103229
|
for (const row of table.rows) {
|
|
103189
|
-
const
|
|
103190
|
-
if (!
|
|
103230
|
+
const left = row.cells[index];
|
|
103231
|
+
if (!left) continue;
|
|
103232
|
+
const right = row.cells[index + 1];
|
|
103191
103233
|
const newCell = Wtc.fromTemplate(colWidth);
|
|
103192
|
-
this.syncRefInfo(newCell,
|
|
103234
|
+
this.syncRefInfo(newCell, left, right);
|
|
103193
103235
|
row.insertChildAt(index + 1, newCell);
|
|
103194
103236
|
}
|
|
103195
103237
|
if (table.colWidths) table.colWidths.splice(index + 1, 0, colWidth);
|
|
103238
|
+
this.shiftRegionsForColInsert(table, index + 1);
|
|
103196
103239
|
} });
|
|
103197
103240
|
}
|
|
103198
103241
|
/**
|
|
@@ -103763,19 +103806,36 @@ var init_Calculation = __esmMin((() => {
|
|
|
103763
103806
|
}
|
|
103764
103807
|
}
|
|
103765
103808
|
/**
|
|
103766
|
-
*
|
|
103809
|
+
* 按 itemRegion.id 查找嵌套的数据分组 / 动态关联区域
|
|
103810
|
+
* (itemRegion 不在 table.regions 顶层,不能用 findRegionById)
|
|
103811
|
+
*/
|
|
103812
|
+
static findItemRegionById(table, itemId) {
|
|
103813
|
+
for (const region of table.regions) {
|
|
103814
|
+
if (region.type === "bounded") {
|
|
103815
|
+
const item = region.itemRegion;
|
|
103816
|
+
if ((item === null || item === void 0 ? void 0 : item.id) === itemId) return item;
|
|
103817
|
+
}
|
|
103818
|
+
if (isLinkSubTableType(region.type)) {
|
|
103819
|
+
const item = region.itemRegion;
|
|
103820
|
+
if ((item === null || item === void 0 ? void 0 : item.id) === itemId) return item;
|
|
103821
|
+
}
|
|
103822
|
+
}
|
|
103823
|
+
}
|
|
103824
|
+
static applyBoundsToItemRegion(itemRegion, bounds) {
|
|
103825
|
+
itemRegion.start.row = bounds.minRow;
|
|
103826
|
+
itemRegion.end.row = bounds.maxRow;
|
|
103827
|
+
itemRegion.start.col = bounds.minCol;
|
|
103828
|
+
itemRegion.end.col = bounds.maxCol;
|
|
103829
|
+
}
|
|
103830
|
+
/**
|
|
103831
|
+
* 处理 boundedItem 数据(更新父级 bounded 的 itemRegion 边界)
|
|
103767
103832
|
*/
|
|
103768
103833
|
static processBoundedItem(table, boundedItemGroups) {
|
|
103769
103834
|
for (const [groupId, positions] of boundedItemGroups.entries()) {
|
|
103770
103835
|
if (positions.length === 0) continue;
|
|
103771
|
-
const
|
|
103772
|
-
|
|
103773
|
-
|
|
103774
|
-
region.start.row = minRow;
|
|
103775
|
-
region.end.row = maxRow;
|
|
103776
|
-
region.start.col = minCol;
|
|
103777
|
-
region.end.col = maxCol;
|
|
103778
|
-
}
|
|
103836
|
+
const itemRegion = this.findItemRegionById(table, groupId);
|
|
103837
|
+
if (!itemRegion) continue;
|
|
103838
|
+
this.applyBoundsToItemRegion(itemRegion, calculateGroupBounds(positions));
|
|
103779
103839
|
}
|
|
103780
103840
|
}
|
|
103781
103841
|
/**
|
|
@@ -103795,19 +103855,14 @@ var init_Calculation = __esmMin((() => {
|
|
|
103795
103855
|
}
|
|
103796
103856
|
}
|
|
103797
103857
|
/**
|
|
103798
|
-
* 处理 dataGroup2D
|
|
103858
|
+
* 处理 dataGroup2D 数据(更新检验表 / 二维表上的 itemRegion 边界)
|
|
103799
103859
|
*/
|
|
103800
103860
|
static processDataGroup2D(table, dataGroup2DGroups) {
|
|
103801
103861
|
for (const [groupId, positions] of dataGroup2DGroups.entries()) {
|
|
103802
103862
|
if (positions.length === 0) continue;
|
|
103803
|
-
const
|
|
103804
|
-
|
|
103805
|
-
|
|
103806
|
-
region.start.row = minRow;
|
|
103807
|
-
region.end.row = maxRow;
|
|
103808
|
-
region.start.col = minCol;
|
|
103809
|
-
region.end.col = maxCol;
|
|
103810
|
-
}
|
|
103863
|
+
const itemRegion = this.findItemRegionById(table, groupId);
|
|
103864
|
+
if (!itemRegion) continue;
|
|
103865
|
+
this.applyBoundsToItemRegion(itemRegion, calculateGroupBounds(positions));
|
|
103811
103866
|
}
|
|
103812
103867
|
}
|
|
103813
103868
|
};
|
|
@@ -107687,6 +107742,50 @@ function isTableNested(doc, tableId) {
|
|
|
107687
107742
|
return (meta === null || meta === void 0 ? void 0 : meta.component) === BuiltinComponentTypeConst.TableCell;
|
|
107688
107743
|
});
|
|
107689
107744
|
}
|
|
107745
|
+
/**
|
|
107746
|
+
* 按合并单元格把选区列范围扩成完整矩形。
|
|
107747
|
+
*
|
|
107748
|
+
* 横向合并只能点到主格(tableCellIndex 为起点列),从上往下拖进合并区时
|
|
107749
|
+
* anchor/focus 往往同为起点列,右侧从格进不了选区。
|
|
107750
|
+
* 需把选中格所属合并区的完整 colspan 扩进 [colFrom, colTo]。
|
|
107751
|
+
*/
|
|
107752
|
+
function expandColRangeForMergedCells(doc, tableLines, colFrom, colTo) {
|
|
107753
|
+
let from = colFrom;
|
|
107754
|
+
let to = colTo;
|
|
107755
|
+
for (let guard = 0; guard < 32; guard++) {
|
|
107756
|
+
let expanded = false;
|
|
107757
|
+
for (const line of tableLines) {
|
|
107758
|
+
const colCount = line.nextIds.length;
|
|
107759
|
+
for (let ci = from; ci <= to && ci < colCount; ci++) {
|
|
107760
|
+
const cellId = line.nextIds[ci];
|
|
107761
|
+
if (!cellId) continue;
|
|
107762
|
+
const cell = doc.layoutMapper.getLayoutNodeById(cellId);
|
|
107763
|
+
if (!cell) continue;
|
|
107764
|
+
let spanStart = ci;
|
|
107765
|
+
let spanEnd = ci;
|
|
107766
|
+
if (cell.mergeFromId) {
|
|
107767
|
+
const master = doc.layoutMapper.getLayoutNodeById(cell.mergeFromId);
|
|
107768
|
+
if (!master) continue;
|
|
107769
|
+
spanStart = ci - (cell.mergeRefColOffset ?? 0);
|
|
107770
|
+
spanEnd = spanStart + (master.colspan || 1) - 1;
|
|
107771
|
+
} else if ((cell.colspan || 1) > 1) spanEnd = ci + (cell.colspan || 1) - 1;
|
|
107772
|
+
else continue;
|
|
107773
|
+
const nextFrom = Math.min(from, Math.max(0, spanStart));
|
|
107774
|
+
const nextTo = Math.max(to, Math.min(colCount - 1, spanEnd));
|
|
107775
|
+
if (nextFrom !== from || nextTo !== to) {
|
|
107776
|
+
from = nextFrom;
|
|
107777
|
+
to = nextTo;
|
|
107778
|
+
expanded = true;
|
|
107779
|
+
}
|
|
107780
|
+
}
|
|
107781
|
+
}
|
|
107782
|
+
if (!expanded) break;
|
|
107783
|
+
}
|
|
107784
|
+
return {
|
|
107785
|
+
colFrom: from,
|
|
107786
|
+
colTo: to
|
|
107787
|
+
};
|
|
107788
|
+
}
|
|
107690
107789
|
function findEnclosingTable(node) {
|
|
107691
107790
|
let current = node;
|
|
107692
107791
|
while (current) {
|
|
@@ -107889,43 +107988,46 @@ function getSelectLinesInfo(doc, selection, upgrade) {
|
|
|
107889
107988
|
}
|
|
107890
107989
|
}
|
|
107891
107990
|
const rangeWidgetIds = [];
|
|
107892
|
-
|
|
107893
|
-
|
|
107894
|
-
if (
|
|
107991
|
+
if (tableMode === "cell-range") {
|
|
107992
|
+
const tableLines = scopedSelectedLines.filter((line) => line.type === "tablerow");
|
|
107993
|
+
if (tableLines.length > 0) {
|
|
107994
|
+
const firstLine = tableLines[0];
|
|
107895
107995
|
const startCI = typeof scopedStartCellIndex === "number" ? scopedStartCellIndex : 0;
|
|
107896
|
-
const endCI = typeof scopedEndCellIndex === "number" ? scopedEndCellIndex : typeof focusClampToLast === "boolean" ? focusClampToLast ? (
|
|
107897
|
-
|
|
107898
|
-
|
|
107899
|
-
|
|
107996
|
+
const endCI = typeof scopedEndCellIndex === "number" ? scopedEndCellIndex : typeof focusClampToLast === "boolean" ? focusClampToLast ? (firstLine.nextIds.length ?? 1) - 1 : 0 : typeof scopedStartCellIndex === "number" ? scopedStartCellIndex : (firstLine.nextIds.length ?? 1) - 1;
|
|
107997
|
+
let colFrom = Math.min(startCI, endCI);
|
|
107998
|
+
let colTo = Math.max(startCI, endCI);
|
|
107999
|
+
({colFrom, colTo} = expandColRangeForMergedCells(doc, tableLines, colFrom, colTo));
|
|
108000
|
+
for (const line of tableLines) for (let ci = colFrom; ci <= colTo; ci++) {
|
|
107900
108001
|
const cellId = line.nextIds[ci];
|
|
107901
108002
|
if (cellId) rangeWidgetIds.push(cellId);
|
|
107902
108003
|
}
|
|
107903
|
-
}
|
|
107904
|
-
|
|
107905
|
-
|
|
107906
|
-
|
|
107907
|
-
|
|
107908
|
-
|
|
107909
|
-
|
|
107910
|
-
|
|
107911
|
-
|
|
107912
|
-
|
|
107913
|
-
|
|
107914
|
-
|
|
107915
|
-
|
|
107916
|
-
|
|
107917
|
-
|
|
107918
|
-
|
|
107919
|
-
|
|
107920
|
-
|
|
107921
|
-
|
|
107922
|
-
|
|
107923
|
-
|
|
107924
|
-
}
|
|
108004
|
+
}
|
|
108005
|
+
} else if (tableMode === "cell-full") {
|
|
108006
|
+
var _start$line4, _end$line3;
|
|
108007
|
+
const startCellId = (_start$line4 = start.line) === null || _start$line4 === void 0 ? void 0 : _start$line4.tableCellId;
|
|
108008
|
+
const endCellId = (_end$line3 = end.line) === null || _end$line3 === void 0 ? void 0 : _end$line3.tableCellId;
|
|
108009
|
+
if (startCellId && startCellId === endCellId) {
|
|
108010
|
+
var _start$line5;
|
|
108011
|
+
const cell = doc.layoutMapper.getLayoutNodeById(startCellId);
|
|
108012
|
+
const table = doc.layoutMapper.getLayoutNodeById((_start$line5 = start.line) === null || _start$line5 === void 0 ? void 0 : _start$line5.tableId);
|
|
108013
|
+
if (cell && table) {
|
|
108014
|
+
var _start$line6, _start$line7;
|
|
108015
|
+
const startRowIdx = (_start$line6 = start.line) === null || _start$line6 === void 0 ? void 0 : _start$line6.tableRowIndex;
|
|
108016
|
+
const startColIdx = (_start$line7 = start.line) === null || _start$line7 === void 0 ? void 0 : _start$line7.tableCellIndex;
|
|
108017
|
+
const rowspan = cell.rowspan || 1;
|
|
108018
|
+
const colspan = cell.colspan || 1;
|
|
108019
|
+
table.forEachCell({
|
|
108020
|
+
startRowIdx,
|
|
108021
|
+
startColIdx,
|
|
108022
|
+
endRowIdx: startRowIdx + rowspan - 1,
|
|
108023
|
+
endColIdx: startColIdx + colspan - 1,
|
|
108024
|
+
callback: (c) => rangeWidgetIds.push(c.id)
|
|
108025
|
+
});
|
|
107925
108026
|
}
|
|
107926
|
-
} else if (tableMode === "mixed") {
|
|
107927
|
-
for (const cellId of line.nextIds) if (cellId) rangeWidgetIds.push(cellId);
|
|
107928
108027
|
}
|
|
108028
|
+
} else if (tableMode === "mixed") scopedSelectedLines.forEach((line) => {
|
|
108029
|
+
if (line.type !== "tablerow") return;
|
|
108030
|
+
for (const cellId of line.nextIds) if (cellId) rangeWidgetIds.push(cellId);
|
|
107929
108031
|
});
|
|
107930
108032
|
return {
|
|
107931
108033
|
normalized,
|
|
@@ -111791,6 +111893,34 @@ var init_InsertText = __esmMin((() => {
|
|
|
111791
111893
|
//#endregion
|
|
111792
111894
|
//#region src/core/command/commands/MergeCells.ts
|
|
111793
111895
|
var MergeCells_exports = /* @__PURE__ */ __exportAll({ MergeCells: () => MergeCells });
|
|
111896
|
+
/**
|
|
111897
|
+
* 选区只包含「可视主格」时,补齐其 merge 区域内的从格。
|
|
111898
|
+
*
|
|
111899
|
+
* 横向合并后从格不渲染、不可点选,跨行再合并时选区往往只有各行主格(同一列)。
|
|
111900
|
+
* 若不展开,会把已有 colspan/rowspan 误判成部分重叠。
|
|
111901
|
+
*/
|
|
111902
|
+
function expandSelectionToMergeRegions(table, selectedCells) {
|
|
111903
|
+
var _table$rows$;
|
|
111904
|
+
const selectedIds = new Set(selectedCells.map((cell) => cell.id));
|
|
111905
|
+
const mergeIds = new Set(selectedCells.map((cell) => cell.mergeId).filter((id) => !!id));
|
|
111906
|
+
const expanded = [];
|
|
111907
|
+
const colCount = ((_table$rows$ = table.rows[0]) === null || _table$rows$ === void 0 ? void 0 : _table$rows$.cells.length) ?? 0;
|
|
111908
|
+
if (colCount === 0 || table.rows.length === 0) return expanded;
|
|
111909
|
+
table.forEachCell({
|
|
111910
|
+
startRowIdx: 0,
|
|
111911
|
+
endRowIdx: table.rows.length - 1,
|
|
111912
|
+
startColIdx: 0,
|
|
111913
|
+
endColIdx: colCount - 1,
|
|
111914
|
+
callback: (cell, row, col) => {
|
|
111915
|
+
if (selectedIds.has(cell.id) || cell.mergeId && mergeIds.has(cell.mergeId)) expanded.push({
|
|
111916
|
+
cell,
|
|
111917
|
+
row,
|
|
111918
|
+
col
|
|
111919
|
+
});
|
|
111920
|
+
}
|
|
111921
|
+
});
|
|
111922
|
+
return expanded;
|
|
111923
|
+
}
|
|
111794
111924
|
var MergeCells;
|
|
111795
111925
|
var init_MergeCells = __esmMin((() => {
|
|
111796
111926
|
init_CommandBase();
|
|
@@ -111808,66 +111938,41 @@ var init_MergeCells = __esmMin((() => {
|
|
|
111808
111938
|
const selectedCells = models.map(({ model }) => model);
|
|
111809
111939
|
const table = (_selectedCells$ = selectedCells[0]) === null || _selectedCells$ === void 0 ? void 0 : _selectedCells$.table;
|
|
111810
111940
|
if (!table) return null;
|
|
111811
|
-
|
|
111941
|
+
if (selectedCells.map((cell) => {
|
|
111812
111942
|
var _cell$parent;
|
|
111813
111943
|
return {
|
|
111814
111944
|
cell,
|
|
111815
111945
|
row: ((_cell$parent = cell.parent) === null || _cell$parent === void 0 ? void 0 : _cell$parent.getCurrentIndex()) ?? -1,
|
|
111816
111946
|
col: cell.getCurrentIndex() ?? -1
|
|
111817
111947
|
};
|
|
111818
|
-
});
|
|
111819
|
-
|
|
111820
|
-
|
|
111821
|
-
|
|
111822
|
-
|
|
111823
|
-
const maxCol = Math.max(...positions.map((p) => p.col));
|
|
111824
|
-
const rowSpan = maxRow - minRow + 1;
|
|
111825
|
-
const colSpan = maxCol - minCol + 1;
|
|
111826
|
-
const expectedCount = rowSpan * colSpan;
|
|
111827
|
-
const selectedIds = new Set(selectedCells.map((cell) => cell.id));
|
|
111948
|
+
}).some(({ row, col }) => row < 0 || col < 0)) throw new Error("Invalid table selection");
|
|
111949
|
+
let minRow = 0;
|
|
111950
|
+
let maxRow = 0;
|
|
111951
|
+
let minCol = 0;
|
|
111952
|
+
let maxCol = 0;
|
|
111828
111953
|
let topLeftCell;
|
|
111829
111954
|
table.runConsistencyMutation({
|
|
111830
111955
|
validate: () => {
|
|
111831
|
-
|
|
111832
|
-
|
|
111956
|
+
const expanded = expandSelectionToMergeRegions(table, selectedCells);
|
|
111957
|
+
if (expanded.length === 0) throw new Error("Invalid table selection");
|
|
111958
|
+
minRow = Math.min(...expanded.map((p) => p.row));
|
|
111959
|
+
maxRow = Math.max(...expanded.map((p) => p.row));
|
|
111960
|
+
minCol = Math.min(...expanded.map((p) => p.col));
|
|
111961
|
+
maxCol = Math.max(...expanded.map((p) => p.col));
|
|
111962
|
+
const expectedCount = (maxRow - minRow + 1) * (maxCol - minCol + 1);
|
|
111963
|
+
const expandedIds = new Set(expanded.map((p) => p.cell.id));
|
|
111964
|
+
if (expandedIds.size !== expectedCount) throw new Error("必须是完整矩形");
|
|
111833
111965
|
for (let row = minRow; row <= maxRow; row++) for (let col = minCol; col <= maxCol; col++) {
|
|
111834
111966
|
var _table$rows$row;
|
|
111835
111967
|
const cell = (_table$rows$row = table.rows[row]) === null || _table$rows$row === void 0 ? void 0 : _table$rows$row.cells[col];
|
|
111836
|
-
if (!cell || !
|
|
111837
|
-
if (!cell.mergeId) continue;
|
|
111838
|
-
if (mergeRoots.has(cell.mergeId)) continue;
|
|
111839
|
-
if (cell.isMergeStart) {
|
|
111840
|
-
mergeRoots.set(cell.mergeId, cell);
|
|
111841
|
-
continue;
|
|
111842
|
-
}
|
|
111843
|
-
let root;
|
|
111844
|
-
table.forEachCell({
|
|
111845
|
-
startRowIdx: 0,
|
|
111846
|
-
endRowIdx: table.children.length - 1,
|
|
111847
|
-
startColIdx: 0,
|
|
111848
|
-
endColIdx: table.rows[0].cells.length - 1,
|
|
111849
|
-
filter: (c) => c.id === cell.mergeId,
|
|
111850
|
-
callback: (c) => {
|
|
111851
|
-
root = c;
|
|
111852
|
-
}
|
|
111853
|
-
});
|
|
111854
|
-
if (root) mergeRoots.set(root.mergeId, root);
|
|
111855
|
-
}
|
|
111856
|
-
for (const root of mergeRoots.values()) {
|
|
111857
|
-
const rRoot = root.parent.getCurrentIndex();
|
|
111858
|
-
const cRoot = root.getCurrentIndex();
|
|
111859
|
-
const rs = root.rowspan || 1;
|
|
111860
|
-
const cs = root.colspan || 1;
|
|
111861
|
-
const endRow = rRoot + rs - 1;
|
|
111862
|
-
const endCol = cRoot + cs - 1;
|
|
111863
|
-
if (rRoot < minRow || endRow > maxRow || cRoot < minCol || endCol > maxCol) throw new Error("Cannot merge: selection partially overlaps an existing merged region");
|
|
111968
|
+
if (!cell || !expandedIds.has(cell.id)) throw new Error("Merge requires a complete rectangle selection");
|
|
111864
111969
|
}
|
|
111865
111970
|
},
|
|
111866
111971
|
mutate: () => {
|
|
111867
111972
|
var _table$rows$minRow;
|
|
111868
111973
|
topLeftCell = (_table$rows$minRow = table.rows[minRow]) === null || _table$rows$minRow === void 0 ? void 0 : _table$rows$minRow.cells[minCol];
|
|
111869
111974
|
if (!topLeftCell) throw new Error("Cannot locate top-left cell for merge");
|
|
111870
|
-
topLeftCell.merge(
|
|
111975
|
+
topLeftCell.merge(maxRow - minRow + 1, maxCol - minCol + 1, { skipConsistency: true });
|
|
111871
111976
|
}
|
|
111872
111977
|
});
|
|
111873
111978
|
const mapper = this.doc.layoutMapper;
|
|
@@ -129116,7 +129221,7 @@ async function initializeDocumentEngine(props, payload, result) {
|
|
|
129116
129221
|
loadSubModels: true
|
|
129117
129222
|
});
|
|
129118
129223
|
const cloneRuntimeJson = cloneDeep(JSON.parse(requestInfo.runtimeJson || "{}"));
|
|
129119
|
-
const { runtimeJson: runtimeJsonForModel, infosMap, regions: checkTableRegions, pendingCheckTableConfig } = await prepareCheckTableRuntimeJson(fillModeType
|
|
129224
|
+
const { runtimeJson: runtimeJsonForModel, infosMap, regions: checkTableRegions, pendingCheckTableConfig } = await prepareCheckTableRuntimeJson(fillModeType !== DocModeTypeConst.Edit && payload.factoryType === "instance" ? id : "", cloneRuntimeJson, { frontConfig: requestInfo.frontConfig });
|
|
129120
129225
|
const docModel = ModelConverter.toModel(runtimeJsonForModel);
|
|
129121
129226
|
const templateId = result.tid.split(":")[1];
|
|
129122
129227
|
await syncMaterialConsumeTableBomInfo(templateId, docModel);
|
|
@@ -134348,22 +134453,48 @@ function loadDataUrlAsImage(dataUrl) {
|
|
|
134348
134453
|
img.onload = () => resolve(img);
|
|
134349
134454
|
});
|
|
134350
134455
|
}
|
|
134456
|
+
function buildSignatureCacheKey(name, width, height, time) {
|
|
134457
|
+
return `${name}\0${width}x${height}\0${time ?? ""}`;
|
|
134458
|
+
}
|
|
134459
|
+
/** 同步取无图签名缓存(布局重建时可避免先闪占位再异步补图) */
|
|
134460
|
+
function getCachedSignatureImage(name, width = 180, height = 102, time) {
|
|
134461
|
+
const w = Math.max(1, Math.round(width));
|
|
134462
|
+
const h = Math.max(1, Math.round(height));
|
|
134463
|
+
return signatureImageCache.get(buildSignatureCacheKey(name, w, h, time)) ?? null;
|
|
134464
|
+
}
|
|
134351
134465
|
/**
|
|
134352
134466
|
* 创建无图签名兜底图(用户名 + 电子签名 + 验证日期)
|
|
134353
134467
|
* 按字段宽高绘制,显示框设多大,字就按多大排
|
|
134354
134468
|
*/
|
|
134355
134469
|
function createSignatureImageDataUrl(name, width = 180, height = 102, time) {
|
|
134356
|
-
|
|
134470
|
+
const w = Math.max(1, Math.round(width));
|
|
134471
|
+
const h = Math.max(1, Math.round(height));
|
|
134472
|
+
const key = buildSignatureCacheKey(name, w, h, time);
|
|
134473
|
+
const cached = signatureDataUrlCache.get(key);
|
|
134474
|
+
if (cached) return cached;
|
|
134475
|
+
const dataUrl = createFormSignFallbackImage(name, w, h, time);
|
|
134476
|
+
signatureDataUrlCache.set(key, dataUrl);
|
|
134477
|
+
return dataUrl;
|
|
134357
134478
|
}
|
|
134358
134479
|
function createSignatureImage(name, width = 180, height = 102, time) {
|
|
134359
|
-
|
|
134480
|
+
const w = Math.max(1, Math.round(width));
|
|
134481
|
+
const h = Math.max(1, Math.round(height));
|
|
134482
|
+
const key = buildSignatureCacheKey(name, w, h, time);
|
|
134483
|
+
const cached = signatureImageCache.get(key);
|
|
134484
|
+
if (cached) return Promise.resolve(cached);
|
|
134485
|
+
return loadDataUrlAsImage(createSignatureImageDataUrl(name, w, h, time)).then((img) => {
|
|
134486
|
+
signatureImageCache.set(key, img);
|
|
134487
|
+
return img;
|
|
134488
|
+
});
|
|
134360
134489
|
}
|
|
134361
|
-
var SIGN_CANVAS_BASE_WIDTH, FALLBACK_SIGN_DPR, ELECTRONIC_SIGNATURE_LABEL, DATE_LABEL;
|
|
134490
|
+
var SIGN_CANVAS_BASE_WIDTH, FALLBACK_SIGN_DPR, ELECTRONIC_SIGNATURE_LABEL, DATE_LABEL, signatureImageCache, signatureDataUrlCache;
|
|
134362
134491
|
var init_image_size_util = __esmMin((() => {
|
|
134363
134492
|
SIGN_CANVAS_BASE_WIDTH = 240;
|
|
134364
134493
|
FALLBACK_SIGN_DPR = 2;
|
|
134365
134494
|
ELECTRONIC_SIGNATURE_LABEL = "电子签名";
|
|
134366
134495
|
DATE_LABEL = "日期";
|
|
134496
|
+
signatureImageCache = /* @__PURE__ */ new Map();
|
|
134497
|
+
signatureDataUrlCache = /* @__PURE__ */ new Map();
|
|
134367
134498
|
}));
|
|
134368
134499
|
//#endregion
|
|
134369
134500
|
//#region src/runtime/renderer/dialogs/signature/logic.ts
|
|
@@ -138904,7 +139035,7 @@ var init_table_form_change_overlay = __esmMin((() => {
|
|
|
138904
139035
|
}));
|
|
138905
139036
|
//#endregion
|
|
138906
139037
|
//#region src/runtime/canvas/table/render/table-structure-overlay/sub-table-action/quick-fill.util.ts
|
|
138907
|
-
var QUICK_FILL_ALLOWED_FIELDS, getTableColumns, handleOpenDynamicQuickFillModal, getIsGroupEmpty, handleOpenFixedQuickFillModal;
|
|
139038
|
+
var QUICK_FILL_ALLOWED_FIELDS, getTableColumns, handleOpenDynamicQuickFillModal, getIsGroupEmpty, hasFixedTableEmptyGroup, handleOpenFixedQuickFillModal;
|
|
138908
139039
|
var init_quick_fill_util = __esmMin((() => {
|
|
138909
139040
|
init_data();
|
|
138910
139041
|
init_field_type();
|
|
@@ -138978,6 +139109,14 @@ var init_quick_fill_util = __esmMin((() => {
|
|
|
138978
139109
|
void 0
|
|
138979
139110
|
].includes(v));
|
|
138980
139111
|
};
|
|
139112
|
+
hasFixedTableEmptyGroup = (doc, subFieldKey) => {
|
|
139113
|
+
var _doc$dataManager$getR;
|
|
139114
|
+
if (!subFieldKey) return false;
|
|
139115
|
+
const rows = (_doc$dataManager$getR = doc.dataManager.getRawData()) === null || _doc$dataManager$getR === void 0 ? void 0 : _doc$dataManager$getR[subFieldKey];
|
|
139116
|
+
if (!Array.isArray(rows) || !rows.length) return false;
|
|
139117
|
+
const colKeys = getTableColumns(doc, subFieldKey, false).map((c) => c.prop);
|
|
139118
|
+
return rows.some((group) => getIsGroupEmpty(group, colKeys));
|
|
139119
|
+
};
|
|
138981
139120
|
handleOpenFixedQuickFillModal = ({ doc, table, cell }) => {
|
|
138982
139121
|
const { rowCount, colCount, itemRegion, widgetMeta } = table;
|
|
138983
139122
|
const { rowCount: dgRowCount, colCount: dgColCount } = itemRegion;
|
|
@@ -139406,7 +139545,6 @@ var init_bounded_table_action_vue_vue_type_script_setup_true_name_sub_table_acti
|
|
|
139406
139545
|
init_core();
|
|
139407
139546
|
init_quick_fill_util();
|
|
139408
139547
|
init_core$1();
|
|
139409
|
-
init__register_();
|
|
139410
139548
|
_hoisted_1$130 = { class: "sub-table-action-bar" };
|
|
139411
139549
|
_hoisted_2$79 = { class: "sub-table-action-popper" };
|
|
139412
139550
|
_hoisted_3$53 = { class: "action-menu" };
|
|
@@ -139421,65 +139559,47 @@ var init_bounded_table_action_vue_vue_type_script_setup_true_name_sub_table_acti
|
|
|
139421
139559
|
cell: {}
|
|
139422
139560
|
},
|
|
139423
139561
|
setup(__props) {
|
|
139424
|
-
const designCtx = useDesignSuiteContext();
|
|
139425
139562
|
const props = __props;
|
|
139426
139563
|
const HOVER_DELAY = {
|
|
139427
139564
|
show: 200,
|
|
139428
139565
|
hide: 150
|
|
139429
139566
|
};
|
|
139430
|
-
|
|
139431
|
-
const
|
|
139432
|
-
const
|
|
139433
|
-
|
|
139434
|
-
const
|
|
139435
|
-
|
|
139436
|
-
const parsed = parseValuePath(valuePath);
|
|
139437
|
-
/** 二维表/检验表行操作始终写入纵向轴(主体)数组,避免误用交叉区 $.sub:link 路径 */
|
|
139438
|
-
const path = parsed.isLink ? parsed.parentFieldPath ?? "" : parsed.fieldPath;
|
|
139439
|
-
const subFieldKey = parsed.isLink ? parsed.parentFieldKey ?? "" : parsed.fieldKey;
|
|
139440
|
-
return {
|
|
139441
|
-
subRenderer,
|
|
139442
|
-
tableName,
|
|
139443
|
-
path,
|
|
139444
|
-
valuePath,
|
|
139445
|
-
subFieldKey,
|
|
139446
|
-
subModelKey: (_mainFields$find = mainFields.find((f) => f.key === subFieldKey)) === null || _mainFields$find === void 0 ? void 0 : _mainFields$find.bindInfo,
|
|
139447
|
-
index: yDataIndex ?? dataIndex ?? 0
|
|
139448
|
-
};
|
|
139567
|
+
/** 是否仍有空分组可快速填报 */
|
|
139568
|
+
const hasEmptyGroup = ref(false);
|
|
139569
|
+
const getSubFieldKey = () => {
|
|
139570
|
+
const { valuePath } = props.cell.subRenderer || {};
|
|
139571
|
+
const parsed = parseValuePath(valuePath || "");
|
|
139572
|
+
return parsed.isLink ? parsed.parentFieldKey ?? "" : parsed.fieldKey;
|
|
139449
139573
|
};
|
|
139450
139574
|
const readonly = computed(() => {
|
|
139451
139575
|
const state = resolveWidgetState({
|
|
139452
139576
|
doc: props.doc,
|
|
139453
|
-
fieldLink:
|
|
139577
|
+
fieldLink: getSubFieldKey(),
|
|
139454
139578
|
modelLink: props.doc.mainModelKey
|
|
139455
139579
|
});
|
|
139456
139580
|
return state.displayStatus === "readonly-component" || state.displayStatus === "readonly-text";
|
|
139457
139581
|
});
|
|
139458
|
-
const subTableType = computed(() => {
|
|
139459
|
-
const { type } = props.cell.subRenderer || {};
|
|
139460
|
-
return {
|
|
139461
|
-
isFixedTable: type === "fixed-table",
|
|
139462
|
-
isCheckTable: type === "check-table"
|
|
139463
|
-
};
|
|
139464
|
-
});
|
|
139465
139582
|
const actionInfo = computed(() => {
|
|
139466
|
-
var
|
|
139467
|
-
const {
|
|
139468
|
-
const quickFill =
|
|
139469
|
-
return { canQuickFill:
|
|
139583
|
+
var _widgetMeta$props;
|
|
139584
|
+
const { type, widgetMeta } = props.cell.subRenderer || {};
|
|
139585
|
+
const quickFill = widgetMeta === null || widgetMeta === void 0 || (_widgetMeta$props = widgetMeta.props) === null || _widgetMeta$props === void 0 ? void 0 : _widgetMeta$props.quickFill;
|
|
139586
|
+
return { canQuickFill: type === "fixed-table" && (quickFill === void 0 ? true : quickFill) };
|
|
139470
139587
|
});
|
|
139471
|
-
const
|
|
139472
|
-
|
|
139588
|
+
const refreshEmptyGroupState = () => {
|
|
139589
|
+
hasEmptyGroup.value = hasFixedTableEmptyGroup(props.doc, getSubFieldKey());
|
|
139590
|
+
};
|
|
139591
|
+
let unsubscribeData;
|
|
139592
|
+
onMounted(() => {
|
|
139593
|
+
refreshEmptyGroupState();
|
|
139594
|
+
unsubscribeData = props.doc.dataManager.subscribe("$", () => {
|
|
139595
|
+
refreshEmptyGroupState();
|
|
139596
|
+
});
|
|
139473
139597
|
});
|
|
139474
|
-
|
|
139475
|
-
|
|
139476
|
-
isAllGroupsFilled.value = rows.every((g) => !getIsGroupEmpty(g, colKeys.value));
|
|
139477
|
-
}, {
|
|
139478
|
-
deep: true,
|
|
139479
|
-
immediate: true
|
|
139598
|
+
onBeforeUnmount(() => {
|
|
139599
|
+
unsubscribeData === null || unsubscribeData === void 0 || unsubscribeData();
|
|
139480
139600
|
});
|
|
139481
139601
|
const fixedTableActionVisible = computed(() => {
|
|
139482
|
-
return !readonly.value && actionInfo.value.canQuickFill &&
|
|
139602
|
+
return !readonly.value && actionInfo.value.canQuickFill && hasEmptyGroup.value;
|
|
139483
139603
|
});
|
|
139484
139604
|
return (_ctx, _cache) => {
|
|
139485
139605
|
return openBlock(), createBlock(Teleport, { to: `#doc-konva-wrap-${__props.doc.id}` }, [fixedTableActionVisible.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -150467,9 +150587,24 @@ var gct_signature_render_vue_vue_type_script_setup_true_name_gct_signature_rende
|
|
|
150467
150587
|
height: imageHeight.value ?? 102,
|
|
150468
150588
|
fill: "#f3f3f3"
|
|
150469
150589
|
}));
|
|
150590
|
+
function applyImage(img) {
|
|
150591
|
+
natural.value = {
|
|
150592
|
+
width: img.naturalWidth,
|
|
150593
|
+
height: img.naturalHeight
|
|
150594
|
+
};
|
|
150595
|
+
display.value = computeContainDisplaySize(natural.value, {
|
|
150596
|
+
width: imageWidth.value,
|
|
150597
|
+
height: imageHeight.value
|
|
150598
|
+
});
|
|
150599
|
+
imgRef.value = img;
|
|
150600
|
+
}
|
|
150470
150601
|
async function loadImage() {
|
|
150471
150602
|
const { src, signature, signTime } = props.widget;
|
|
150472
|
-
if (signature)
|
|
150603
|
+
if (signature) {
|
|
150604
|
+
const cached = getCachedSignatureImage(signature, imageWidth.value, imageHeight.value, signTime);
|
|
150605
|
+
if (cached) return cached;
|
|
150606
|
+
return await createSignatureImage(signature, imageWidth.value, imageHeight.value, signTime);
|
|
150607
|
+
}
|
|
150473
150608
|
if (src) return await AssetHelper.loadImage(src);
|
|
150474
150609
|
return null;
|
|
150475
150610
|
}
|
|
@@ -150480,17 +150615,16 @@ var gct_signature_render_vue_vue_type_script_setup_true_name_gct_signature_rende
|
|
|
150480
150615
|
imageWidth.value,
|
|
150481
150616
|
imageHeight.value
|
|
150482
150617
|
], async () => {
|
|
150618
|
+
if (props.widget.signature) {
|
|
150619
|
+
const cached = getCachedSignatureImage(props.widget.signature, imageWidth.value, imageHeight.value, props.widget.signTime);
|
|
150620
|
+
if (cached) {
|
|
150621
|
+
applyImage(cached);
|
|
150622
|
+
return;
|
|
150623
|
+
}
|
|
150624
|
+
}
|
|
150483
150625
|
const img = await loadImage();
|
|
150484
150626
|
if (!img) return;
|
|
150485
|
-
|
|
150486
|
-
width: img.naturalWidth,
|
|
150487
|
-
height: img.naturalHeight
|
|
150488
|
-
};
|
|
150489
|
-
display.value = computeContainDisplaySize(natural.value, {
|
|
150490
|
-
width: imageWidth.value,
|
|
150491
|
-
height: imageHeight.value
|
|
150492
|
-
});
|
|
150493
|
-
imgRef.value = img;
|
|
150627
|
+
applyImage(img);
|
|
150494
150628
|
}, { immediate: true });
|
|
150495
150629
|
const imageConfig = computed(() => ({
|
|
150496
150630
|
x: (imageWidth.value - display.value.width) / 2,
|
|
@@ -17,10 +17,14 @@ export declare const handleOpenDynamicQuickFillModal: ({ doc, cell }: {
|
|
|
17
17
|
* 判断[固定表]单个分组 是否所有字段都为空
|
|
18
18
|
*/
|
|
19
19
|
export declare const getIsGroupEmpty: (group: any, colKeys: string[]) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* [固定表]是否仍有空分组
|
|
22
|
+
*/
|
|
23
|
+
export declare const hasFixedTableEmptyGroup: (doc: Doc, subFieldKey: string) => boolean;
|
|
20
24
|
/**
|
|
21
25
|
* [固定表]快速填报
|
|
22
26
|
*/
|
|
23
|
-
export declare const handleOpenFixedQuickFillModal: ({ doc, table, cell }: {
|
|
27
|
+
export declare const handleOpenFixedQuickFillModal: ({ doc, table, cell, }: {
|
|
24
28
|
doc: Doc;
|
|
25
29
|
table: any;
|
|
26
30
|
cell: any;
|