@gct-paas/word 0.1.73-patch.11 → 0.1.73-patch.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @gct-paas/word v0.1.73-patch.11 */
1
+ /*! @gct-paas/word v0.1.73-patch.13 */
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";
@@ -94840,10 +94840,13 @@ async function readApiLabel(strategy, value, fieldBinding, loadFieldByKey) {
94840
94840
  refModelKey: fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.bindInfo
94841
94841
  };
94842
94842
  try {
94843
- const isSingle = strategy.fetcher === "rdo2ref";
94844
- const idList = isSingle ? [String(value)] : getValue$1(value, true);
94845
- const result = isSingle ? await fetcher.getOptionById(idList[0], params) : await fetcher.getOptionByIds(idList, params);
94846
- const labelByValue = new Map((Array.isArray(result) ? result : result ? [result] : []).filter((item) => (item === null || item === void 0 ? void 0 : item.value) != null && (item === null || item === void 0 ? void 0 : item.label) != null).map((item) => [String(item.value), String(item.label)]));
94843
+ if (strategy.fetcher === "rdo2ref") {
94844
+ const result = await fetcher.getOptionById(String(value), params);
94845
+ return (result === null || result === void 0 ? void 0 : result.label) || strategy.fallback;
94846
+ }
94847
+ const idList = getValue$1(value, true);
94848
+ const list = await fetcher.getOptionByIds(idList, params);
94849
+ const labelByValue = new Map(list.filter((item) => (item === null || item === void 0 ? void 0 : item.value) != null && (item === null || item === void 0 ? void 0 : item.label) != null).map((item) => [String(item.value), String(item.label)]));
94847
94850
  const labels = idList.map((id) => labelByValue.get(String(id))).filter(Boolean);
94848
94851
  if (labels.length) return labels.join(",");
94849
94852
  return strategy.fallback;
@@ -104111,6 +104114,251 @@ var init_TextUtil = __esmMin((() => {
104111
104114
  _defineProperty(TextUtil, "layoutSizeCache", /* @__PURE__ */ new Map());
104112
104115
  }));
104113
104116
  //#endregion
104117
+ //#region src/runtime/designer/ribbon/constant/font.ts
104118
+ var FontFamilyEnum, FontFamilyOptions, FontSizeOptions;
104119
+ var init_font = __esmMin((() => {
104120
+ FontFamilyEnum = /* @__PURE__ */ function(FontFamilyEnum) {
104121
+ FontFamilyEnum["Serif"] = "Roboto,RobotoDraft,Helvetica,Arial,sans-serif";
104122
+ /** 宋体 */
104123
+ FontFamilyEnum["SimSun"] = "\"SimSun\", \"宋体\", \"华文宋体\", STSong, STSongti-SC-Light, sans-serif";
104124
+ /** 黑体 */
104125
+ FontFamilyEnum["SimHei"] = "\"SimHei\", \"黑体\", \"华文黑体\", STHeiti, sans-serif";
104126
+ /** 楷体 */
104127
+ FontFamilyEnum["KaiTi"] = "\"Kai\", \"STKai\", \"楷体\", \"KaiTi\", \"华文楷体\", sans-serif";
104128
+ return FontFamilyEnum;
104129
+ }({});
104130
+ FontFamilyOptions = [
104131
+ {
104132
+ label: "默认",
104133
+ value: "Roboto,RobotoDraft,Helvetica,Arial,sans-serif"
104134
+ },
104135
+ {
104136
+ label: "宋体",
104137
+ value: "\"SimSun\", \"宋体\", \"华文宋体\", STSong, STSongti-SC-Light, sans-serif"
104138
+ },
104139
+ {
104140
+ label: "黑体",
104141
+ value: "\"SimHei\", \"黑体\", \"华文黑体\", STHeiti, sans-serif"
104142
+ },
104143
+ {
104144
+ label: "楷体",
104145
+ value: "\"Kai\", \"STKai\", \"楷体\", \"KaiTi\", \"华文楷体\", sans-serif"
104146
+ }
104147
+ ];
104148
+ FontSizeOptions = [
104149
+ {
104150
+ label: "初号",
104151
+ value: "42"
104152
+ },
104153
+ {
104154
+ label: "小初",
104155
+ value: "36"
104156
+ },
104157
+ {
104158
+ label: "一号",
104159
+ value: "26"
104160
+ },
104161
+ {
104162
+ label: "小一",
104163
+ value: "24"
104164
+ },
104165
+ {
104166
+ label: "二号",
104167
+ value: "22"
104168
+ },
104169
+ {
104170
+ label: "小二",
104171
+ value: "18"
104172
+ },
104173
+ {
104174
+ label: "三号",
104175
+ value: "16"
104176
+ },
104177
+ {
104178
+ label: "小三",
104179
+ value: "15"
104180
+ },
104181
+ {
104182
+ label: "四号",
104183
+ value: "14"
104184
+ },
104185
+ {
104186
+ label: "小四",
104187
+ value: "12"
104188
+ },
104189
+ {
104190
+ label: "五号",
104191
+ value: "10.5"
104192
+ },
104193
+ {
104194
+ label: "小五",
104195
+ value: "9"
104196
+ },
104197
+ {
104198
+ label: "六号",
104199
+ value: "7.5"
104200
+ },
104201
+ {
104202
+ label: "小六",
104203
+ value: "6.5"
104204
+ },
104205
+ {
104206
+ label: "七号",
104207
+ value: "5.5"
104208
+ },
104209
+ {
104210
+ label: "八号",
104211
+ value: "5"
104212
+ },
104213
+ {
104214
+ label: "5",
104215
+ value: 5
104216
+ },
104217
+ {
104218
+ label: "5.5",
104219
+ value: 5.5
104220
+ },
104221
+ {
104222
+ label: "6.5",
104223
+ value: 6.5
104224
+ },
104225
+ {
104226
+ label: "7.5",
104227
+ value: 7.5
104228
+ },
104229
+ {
104230
+ label: "8",
104231
+ value: 8
104232
+ },
104233
+ {
104234
+ label: "9",
104235
+ value: 9
104236
+ },
104237
+ {
104238
+ label: "10",
104239
+ value: 10
104240
+ },
104241
+ {
104242
+ label: "10.5",
104243
+ value: 10.5
104244
+ },
104245
+ {
104246
+ label: "11",
104247
+ value: 11
104248
+ },
104249
+ {
104250
+ label: "12",
104251
+ value: 12
104252
+ },
104253
+ {
104254
+ label: "14",
104255
+ value: 14
104256
+ },
104257
+ {
104258
+ label: "16",
104259
+ value: 16
104260
+ },
104261
+ {
104262
+ label: "18",
104263
+ value: 18
104264
+ },
104265
+ {
104266
+ label: "20",
104267
+ value: 20
104268
+ },
104269
+ {
104270
+ label: "22",
104271
+ value: 22
104272
+ },
104273
+ {
104274
+ label: "24",
104275
+ value: 24
104276
+ },
104277
+ {
104278
+ label: "26",
104279
+ value: 26
104280
+ },
104281
+ {
104282
+ label: "28",
104283
+ value: 28
104284
+ },
104285
+ {
104286
+ label: "30",
104287
+ value: 30
104288
+ },
104289
+ {
104290
+ label: "36",
104291
+ value: 36
104292
+ },
104293
+ {
104294
+ label: "48",
104295
+ value: 48
104296
+ },
104297
+ {
104298
+ label: "56",
104299
+ value: 56
104300
+ },
104301
+ {
104302
+ label: "72",
104303
+ value: 72
104304
+ },
104305
+ {
104306
+ label: "96",
104307
+ value: 96
104308
+ }
104309
+ ];
104310
+ }));
104311
+ //#endregion
104312
+ //#region src/utils/fonts/normalize-document-font.ts
104313
+ /**
104314
+ * 从 OOXML rFonts 取展示用字体名。
104315
+ * 中文 Word 常把字体写在 eastAsia,优先于 ascii。
104316
+ */
104317
+ function pickDocumentFontName(rFonts) {
104318
+ if (!rFonts) return void 0;
104319
+ return rFonts.eastAsia || rFonts.ascii || rFonts.hAnsi || rFonts.cs || void 0;
104320
+ }
104321
+ /**
104322
+ * 识别是否为产品支持的黑 / 宋 / 楷(含常见别名)。
104323
+ * 无法识别时返回 null(应回落默认字体)。
104324
+ * 注意:不能用裸 includes('serif'),否则会误伤 "sans-serif"。
104325
+ */
104326
+ function detectSupportedCjkKind(fontFamily) {
104327
+ if (!fontFamily) return null;
104328
+ const name = fontFamily.toLowerCase();
104329
+ const isKai = /lxgw|wenkai|kaiti|楷/.test(name) || /(^|[,\"\s])kai([,\"\s]|$)/.test(name) || name.includes("stkai");
104330
+ const isSong = /noto\s*serif|notoserif|simsun|华文宋|stsong|songti|宋体/.test(name) || /(^|[,\"\s])song([,\"\s]|$)/.test(name);
104331
+ const isHei = /noto\s*sans|notosans|simhei|华文黑|stheiti|黑体/.test(name) || name.includes("heiti");
104332
+ if (isKai) return "kai";
104333
+ if (isSong && !isHei) return "song";
104334
+ if (isHei) return "hei";
104335
+ return null;
104336
+ }
104337
+ /**
104338
+ * 将任意字体名归一到产品支持的黑 / 宋 / 楷。
104339
+ * 无法识别(如 Arial、微软雅黑)时回落默认字体。
104340
+ */
104341
+ function normalizeSupportedFontFamily(fontFamily) {
104342
+ if (!fontFamily) return DEFAULT_FONT_FAMILY;
104343
+ if (fontFamily === "Roboto,RobotoDraft,Helvetica,Arial,sans-serif" || fontFamily === FontFamilyEnum.Serif) return fontFamily;
104344
+ for (const stack of SUPPORTED_DOCUMENT_FONT_FAMILIES) if (fontFamily === stack) return fontFamily;
104345
+ const kind = detectSupportedCjkKind(fontFamily);
104346
+ if (kind === "kai") return FontFamilyEnum.KaiTi;
104347
+ if (kind === "song") return FontFamilyEnum.SimSun;
104348
+ if (kind === "hei") return FontFamilyEnum.SimHei;
104349
+ return DEFAULT_FONT_FAMILY;
104350
+ }
104351
+ var SUPPORTED_DOCUMENT_FONT_FAMILIES;
104352
+ var init_normalize_document_font = __esmMin((() => {
104353
+ init_constants$1();
104354
+ init_font();
104355
+ SUPPORTED_DOCUMENT_FONT_FAMILIES = [
104356
+ FontFamilyEnum.SimHei,
104357
+ FontFamilyEnum.SimSun,
104358
+ FontFamilyEnum.KaiTi
104359
+ ];
104360
+ }));
104361
+ //#endregion
104114
104362
  //#region src/core/view/runs/TextRun.ts
104115
104363
  var TextRun;
104116
104364
  var init_TextRun = __esmMin((() => {
@@ -104118,6 +104366,7 @@ var init_TextRun = __esmMin((() => {
104118
104366
  init_constants$1();
104119
104367
  init_helpers();
104120
104368
  init_TextUtil();
104369
+ init_normalize_document_font();
104121
104370
  init_defineProperty();
104122
104371
  TextRun = class TextRun extends LayoutNode {
104123
104372
  constructor(options) {
@@ -104284,11 +104533,11 @@ var init_TextRun = __esmMin((() => {
104284
104533
  * @returns TextRun 的样式属性
104285
104534
  */
104286
104535
  static textStyle2LayoutStyle(textStyle) {
104287
- var _textStyle$rFonts;
104288
104536
  if (!textStyle) return {};
104289
104537
  const layoutStyle = {};
104290
104538
  if (textStyle.sz !== void 0) layoutStyle.fontSize = textStyle.sz / 2 * 96 / 72;
104291
- if ((_textStyle$rFonts = textStyle.rFonts) === null || _textStyle$rFonts === void 0 ? void 0 : _textStyle$rFonts.ascii) layoutStyle.fontFamily = textStyle.rFonts.ascii;
104539
+ const rawFontFamily = pickDocumentFontName(textStyle.rFonts);
104540
+ if (rawFontFamily) layoutStyle.fontFamily = normalizeSupportedFontFamily(rawFontFamily);
104292
104541
  if (textStyle.highlight) layoutStyle.highlight = normalizeColor(textStyle.highlight, "none");
104293
104542
  if (textStyle.color) layoutStyle.color = normalizeColor(textStyle.color, DEFAULT_TEXT_COLOR);
104294
104543
  if (textStyle.b !== void 0) layoutStyle.bold = textStyle.b;
@@ -123980,6 +124229,17 @@ var init_uom_convert_runtime = __esmMin((() => {
123980
124229
  DEFAULT_INPUT_FIELD = "qty_";
123981
124230
  }));
123982
124231
  //#endregion
124232
+ //#region src/runtime/canvas/table/render/material-consume/derived-qty.ts
124233
+ /**
124234
+ * 未选择物料时,已消耗数量与当前行消耗数量保持一致。
124235
+ * 空值统一写为 null,避免数值字段向提交接口传递空字符串。
124236
+ */
124237
+ function resolveConsumedQtyWithoutProduct(value) {
124238
+ if (value === void 0 || value === null || value === "") return null;
124239
+ return Number(value);
124240
+ }
124241
+ var init_derived_qty = __esmMin((() => {}));
124242
+ //#endregion
123983
124243
  //#region src/runtime/canvas/table/render/material-consume/material-consume-table-controller.ts
123984
124244
  /**
123985
124245
  * 解析规则配置字符串解析成对象
@@ -124007,6 +124267,7 @@ var init_material_consume_table_controller = __esmMin((() => {
124007
124267
  init_TriggerUtil();
124008
124268
  init_data();
124009
124269
  init_uom_convert_runtime();
124270
+ init_derived_qty();
124010
124271
  init_defineProperty();
124011
124272
  MCDataUtil = class MCDataUtil {
124012
124273
  /**
@@ -124507,7 +124768,7 @@ var init_material_consume_table_controller = __esmMin((() => {
124507
124768
  const modifySingleRow = (row, rowIndex) => {
124508
124769
  const fieldKey = `${this.subTableInfo.valuePath}[${rowIndex}].qty_consumed_`;
124509
124770
  if (!row.product_id_) {
124510
- doc.dataManager.set(fieldKey, row.qty_ ? Number(row.qty_) : "", "user");
124771
+ doc.dataManager.set(fieldKey, resolveConsumedQtyWithoutProduct(row.qty_), "user");
124511
124772
  return;
124512
124773
  }
124513
124774
  let total = 0;
@@ -138254,204 +138515,12 @@ var table_ribbon_group_vue_vue_type_script_setup_true_name_table_ribbon_group_la
138254
138515
  init__plugin_vue_export_helper();
138255
138516
  var table_ribbon_group_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_ribbon_group_vue_vue_type_script_setup_true_name_table_ribbon_group_lang_default, [["__scopeId", "data-v-a6ebfeaa"]]);
138256
138517
  //#endregion
138257
- //#region src/runtime/designer/ribbon/constant/font.ts
138258
- /** 字重 */
138259
- var FontFamilyEnum = /* @__PURE__ */ function(FontFamilyEnum) {
138260
- FontFamilyEnum["Serif"] = "Roboto,RobotoDraft,Helvetica,Arial,sans-serif";
138261
- /** 宋体 */
138262
- FontFamilyEnum["SimSun"] = "\"SimSun\", \"宋体\", \"华文宋体\", STSong, STSongti-SC-Light, sans-serif";
138263
- /** 黑体 */
138264
- FontFamilyEnum["SimHei"] = "\"SimHei\", \"黑体\", \"华文黑体\", STHeiti, sans-serif";
138265
- /** 楷体 */
138266
- FontFamilyEnum["KaiTi"] = "\"Kai\", \"STKai\", \"楷体\", \"KaiTi\", \"华文楷体\", sans-serif";
138267
- return FontFamilyEnum;
138268
- }({});
138269
- var FontFamilyOptions = [
138270
- {
138271
- label: "默认",
138272
- value: "Roboto,RobotoDraft,Helvetica,Arial,sans-serif"
138273
- },
138274
- {
138275
- label: "宋体",
138276
- value: "\"SimSun\", \"宋体\", \"华文宋体\", STSong, STSongti-SC-Light, sans-serif"
138277
- },
138278
- {
138279
- label: "黑体",
138280
- value: "\"SimHei\", \"黑体\", \"华文黑体\", STHeiti, sans-serif"
138281
- },
138282
- {
138283
- label: "楷体",
138284
- value: "\"Kai\", \"STKai\", \"楷体\", \"KaiTi\", \"华文楷体\", sans-serif"
138285
- }
138286
- ];
138287
- var FontSizeOptions = [
138288
- {
138289
- label: "初号",
138290
- value: "42"
138291
- },
138292
- {
138293
- label: "小初",
138294
- value: "36"
138295
- },
138296
- {
138297
- label: "一号",
138298
- value: "26"
138299
- },
138300
- {
138301
- label: "小一",
138302
- value: "24"
138303
- },
138304
- {
138305
- label: "二号",
138306
- value: "22"
138307
- },
138308
- {
138309
- label: "小二",
138310
- value: "18"
138311
- },
138312
- {
138313
- label: "三号",
138314
- value: "16"
138315
- },
138316
- {
138317
- label: "小三",
138318
- value: "15"
138319
- },
138320
- {
138321
- label: "四号",
138322
- value: "14"
138323
- },
138324
- {
138325
- label: "小四",
138326
- value: "12"
138327
- },
138328
- {
138329
- label: "五号",
138330
- value: "10.5"
138331
- },
138332
- {
138333
- label: "小五",
138334
- value: "9"
138335
- },
138336
- {
138337
- label: "六号",
138338
- value: "7.5"
138339
- },
138340
- {
138341
- label: "小六",
138342
- value: "6.5"
138343
- },
138344
- {
138345
- label: "七号",
138346
- value: "5.5"
138347
- },
138348
- {
138349
- label: "八号",
138350
- value: "5"
138351
- },
138352
- {
138353
- label: "5",
138354
- value: 5
138355
- },
138356
- {
138357
- label: "5.5",
138358
- value: 5.5
138359
- },
138360
- {
138361
- label: "6.5",
138362
- value: 6.5
138363
- },
138364
- {
138365
- label: "7.5",
138366
- value: 7.5
138367
- },
138368
- {
138369
- label: "8",
138370
- value: 8
138371
- },
138372
- {
138373
- label: "9",
138374
- value: 9
138375
- },
138376
- {
138377
- label: "10",
138378
- value: 10
138379
- },
138380
- {
138381
- label: "10.5",
138382
- value: 10.5
138383
- },
138384
- {
138385
- label: "11",
138386
- value: 11
138387
- },
138388
- {
138389
- label: "12",
138390
- value: 12
138391
- },
138392
- {
138393
- label: "14",
138394
- value: 14
138395
- },
138396
- {
138397
- label: "16",
138398
- value: 16
138399
- },
138400
- {
138401
- label: "18",
138402
- value: 18
138403
- },
138404
- {
138405
- label: "20",
138406
- value: 20
138407
- },
138408
- {
138409
- label: "22",
138410
- value: 22
138411
- },
138412
- {
138413
- label: "24",
138414
- value: 24
138415
- },
138416
- {
138417
- label: "26",
138418
- value: 26
138419
- },
138420
- {
138421
- label: "28",
138422
- value: 28
138423
- },
138424
- {
138425
- label: "30",
138426
- value: 30
138427
- },
138428
- {
138429
- label: "36",
138430
- value: 36
138431
- },
138432
- {
138433
- label: "48",
138434
- value: 48
138435
- },
138436
- {
138437
- label: "56",
138438
- value: 56
138439
- },
138440
- {
138441
- label: "72",
138442
- value: 72
138443
- },
138444
- {
138445
- label: "96",
138446
- value: 96
138447
- }
138448
- ];
138449
- //#endregion
138450
138518
  //#region src/runtime/designer/ribbon/tabs/word-tab.vue?vue&type=script&setup=true&name=home-tab&lang.ts
138451
138519
  init_dist();
138452
138520
  init_base$2();
138453
138521
  init_core();
138454
138522
  init_asset_helper_util();
138523
+ init_font();
138455
138524
  init_logic$1();
138456
138525
  init_constants$1();
138457
138526
  var _hoisted_1$104 = { class: "items-container" };
@@ -143674,6 +143743,7 @@ var manifest$7 = {
143674
143743
  //#endregion
143675
143744
  //#region src/suites/edhr/manifest/paper-widget/_common_/basic.ts
143676
143745
  init_constants$1();
143746
+ init_font();
143677
143747
  var DEFAULT_WIDGET_TEXT_STYLE = {
143678
143748
  fontFamily: FontFamilyEnum.Serif,
143679
143749
  fontSize: 13,
@@ -158403,6 +158473,7 @@ var widget_barcode_config_default = /*#__PURE__*/ _plugin_vue_export_helper_defa
158403
158473
  //#endregion
158404
158474
  //#region src/suites/shared/panel/config/editor/font-editor/font-editor.vue?vue&type=script&setup=true&lang.ts
158405
158475
  init_base$2();
158476
+ init_font();
158406
158477
  var _hoisted_1$8 = { class: "content" };
158407
158478
  var _hoisted_2$4 = { class: "value" };
158408
158479
  var font_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 未选择物料时,已消耗数量与当前行消耗数量保持一致。
3
+ * 空值统一写为 null,避免数值字段向提交接口传递空字符串。
4
+ */
5
+ export declare function resolveConsumedQtyWithoutProduct(value: unknown): number | null;
@@ -0,0 +1,16 @@
1
+ export type DocRFonts = {
2
+ ascii?: string;
3
+ hAnsi?: string;
4
+ eastAsia?: string;
5
+ cs?: string;
6
+ };
7
+ /**
8
+ * 从 OOXML rFonts 取展示用字体名。
9
+ * 中文 Word 常把字体写在 eastAsia,优先于 ascii。
10
+ */
11
+ export declare function pickDocumentFontName(rFonts?: DocRFonts | null): string | undefined;
12
+ /**
13
+ * 将任意字体名归一到产品支持的黑 / 宋 / 楷。
14
+ * 无法识别(如 Arial、微软雅黑)时回落默认字体。
15
+ */
16
+ export declare function normalizeSupportedFontFamily(fontFamily?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.73-patch.11",
3
+ "version": "0.1.73-patch.13",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",