@gct-paas/word 0.1.74-beta.19 → 0.1.74-beta.20

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.
@@ -89,3 +89,18 @@ export declare const FieldSysVarDefaultValueConst: {
89
89
  /** 当前登录用户主部门 */
90
90
  CURRENT_ORG: string;
91
91
  };
92
+ /** 批次类型 */
93
+ export declare const ContainerRoleConst: {
94
+ /** 普通批次 */
95
+ NORMAL: string;
96
+ /** 关联批父节点 */
97
+ RELATED_PARENT: string;
98
+ /** 关联批子批次 */
99
+ RELATED_CHILD: string;
100
+ /** 合并批父节点 */
101
+ MERGE_PARENT: string;
102
+ /** 共线批父节点 */
103
+ COLLINEAR_PARENT: string;
104
+ /** 共线批子节点 */
105
+ COLLINEAR_CHILD: string;
106
+ };
@@ -8,6 +8,11 @@ export declare function setValue(value: any, valuePath: string, payload?: {
8
8
  [valuePath]: any;
9
9
  };
10
10
  export declare function toBoolean(value: any): boolean | null;
11
+ /** 布尔选项默认别名 */
12
+ export declare const BOOLEAN_TRUE_LABEL = "\u771F";
13
+ export declare const BOOLEAN_FALSE_LABEL = "\u5047";
14
+ /** 别名为空时回退到默认「真 / 假」 */
15
+ export declare function resolveBooleanOptionLabel(label: unknown, value: unknown): string;
11
16
  export declare function toFormatValue(fieldType: FIELD_TYPE, value: any): any;
12
17
  export declare function toDictValue(field: string, value: any, row: any): any;
13
18
  export declare function getSelectOptions(payload: any): {
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @gct-paas/word v0.1.74-beta.19 */
1
+ /*! @gct-paas/word v0.1.74-beta.20 */
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, vModelRadio, 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";
@@ -13591,7 +13591,7 @@ var init_calculate_formula = __esmMin((() => {
13591
13591
  }));
13592
13592
  //#endregion
13593
13593
  //#region src/domain/constants/enum/view.ts
13594
- var EmptySymbolTypeConst, ViewStateTypeConst, RenderCompTypeConst, BooleanShowModeTypeConst, LabelPositionTypeConst, DecimalDisplayModeTypeConst, RangeValidateModeTypeConst, RangeCompareOpTypeConst, FieldSysVarDefaultValueConst;
13594
+ var EmptySymbolTypeConst, ViewStateTypeConst, RenderCompTypeConst, BooleanShowModeTypeConst, LabelPositionTypeConst, DecimalDisplayModeTypeConst, RangeValidateModeTypeConst, RangeCompareOpTypeConst, FieldSysVarDefaultValueConst, ContainerRoleConst;
13595
13595
  var init_view = __esmMin((() => {
13596
13596
  EmptySymbolTypeConst = {
13597
13597
  "/": "/",
@@ -13667,6 +13667,20 @@ var init_view = __esmMin((() => {
13667
13667
  /** 当前登录用户主部门 */
13668
13668
  CURRENT_ORG: "CURRENT_ORG"
13669
13669
  };
13670
+ ContainerRoleConst = {
13671
+ /** 普通批次 */
13672
+ NORMAL: "normal",
13673
+ /** 关联批父节点 */
13674
+ RELATED_PARENT: "related_parent",
13675
+ /** 关联批子批次 */
13676
+ RELATED_CHILD: "related_child",
13677
+ /** 合并批父节点 */
13678
+ MERGE_PARENT: "merge_parent",
13679
+ /** 共线批父节点 */
13680
+ COLLINEAR_PARENT: "collinear_parent",
13681
+ /** 共线批子节点 */
13682
+ COLLINEAR_CHILD: "collinear_child"
13683
+ };
13670
13684
  }));
13671
13685
  //#endregion
13672
13686
  //#region src/domain/constants/enum/form.ts
@@ -13855,6 +13869,11 @@ function toBoolean(value) {
13855
13869
  if (isNaN(parseInt(value))) return Boolean(value);
13856
13870
  return Boolean(parseInt(value));
13857
13871
  }
13872
+ /** 别名为空时回退到默认「真 / 假」 */
13873
+ function resolveBooleanOptionLabel(label, value) {
13874
+ if (typeof label === "string" && label.trim() !== "") return label;
13875
+ return toBoolean(value) ? "真" : "假";
13876
+ }
13858
13877
  function toFormatValue(fieldType, value) {
13859
13878
  if ([
13860
13879
  FIELD_TYPE.INTEGER,
@@ -13878,7 +13897,8 @@ function toDictValue(field, value, row) {
13878
13897
  function getSelectOptions(payload) {
13879
13898
  const { value, multiple, options = [], key } = payload || {};
13880
13899
  const values = (Array.isArray(value) ? value : multiple ? (value === null || value === void 0 ? void 0 : value.split(",")) ?? [] : [value]).filter((i) => !isNil(i));
13881
- const selected = options.filter((item) => values.includes(item.value));
13900
+ const optionMap = new Map(options.map((item) => [item.value, item]));
13901
+ const selected = values.map((v) => optionMap.get(v)).filter((item) => item != null);
13882
13902
  const labels = selected.map((item) => item[key]);
13883
13903
  return {
13884
13904
  selectOptions: selected,
@@ -94990,7 +95010,10 @@ function resolveMap(rule, props) {
94990
95010
  }));
94991
95011
  if (!rule.filter) return JSON.stringify(options);
94992
95012
  switch (rule.filter) {
94993
- case "bool": return resolveBoolFilter(options, props);
95013
+ case "bool": return resolveBoolFilter(options.map((item) => ({
95014
+ ...item,
95015
+ label: resolveBooleanOptionLabel(item.label, item.value)
95016
+ })), props);
94994
95017
  case "enum": {
94995
95018
  const filtered = options.filter((item) => !has(item, "display") || item.display);
94996
95019
  return filtered.length ? JSON.stringify(filtered) : void 0;
@@ -95167,7 +95190,9 @@ var init_computed = __esmMin((() => {
95167
95190
  const valueKey = rule.valueKey ?? "value";
95168
95191
  const returnKey = rule.returnKey ?? "value";
95169
95192
  const match = source.find((o) => o[valueKey] === toBoolean(props[rule.valueField]));
95170
- return match === null || match === void 0 ? void 0 : match[returnKey];
95193
+ if (!match) return;
95194
+ if (returnKey === "label") return resolveBooleanOptionLabel(match.label, match[valueKey]);
95195
+ return match[returnKey];
95171
95196
  },
95172
95197
  enum(rule, props) {
95173
95198
  const source = safeParseJson(props[rule.from || ""]);
@@ -95374,7 +95399,8 @@ function readBoolOptionsLabel(value, widgetProps) {
95374
95399
  if (!Array.isArray(source)) return void 0;
95375
95400
  const valueKey = "value";
95376
95401
  const match = source.find((item) => item[valueKey] === toBoolean(value));
95377
- return (match === null || match === void 0 ? void 0 : match.label) ?? void 0;
95402
+ if (!match) return void 0;
95403
+ return resolveBooleanOptionLabel(match.label, match[valueKey]);
95378
95404
  }
95379
95405
  async function readApiLabel(strategy, value, fieldBinding, loadFieldByKey) {
95380
95406
  if (value == null || value === "") return void 0;
@@ -95389,8 +95415,11 @@ async function readApiLabel(strategy, value, fieldBinding, loadFieldByKey) {
95389
95415
  refModelKey: fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.bindInfo
95390
95416
  };
95391
95417
  try {
95392
- const result = strategy.fetcher === "rdo2ref" ? await fetcher.getOptionById(String(value), params) : await fetcher.getOptionByIds(getValue$1(value, true), params);
95393
- const labels = (Array.isArray(result) ? result : result ? [result] : []).map((item) => item === null || item === void 0 ? void 0 : item.label).filter(Boolean);
95418
+ const isSingle = strategy.fetcher === "rdo2ref";
95419
+ const idList = isSingle ? [String(value)] : getValue$1(value, true);
95420
+ const result = isSingle ? await fetcher.getOptionById(idList[0], params) : await fetcher.getOptionByIds(idList, params);
95421
+ 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)]));
95422
+ const labels = idList.map((id) => labelByValue.get(String(id))).filter(Boolean);
95394
95423
  if (labels.length) return labels.join(",");
95395
95424
  return strategy.fallback;
95396
95425
  } catch {
@@ -133116,7 +133145,8 @@ var init_assoc_filter = __esmMin((() => {
133116
133145
  init_fetchers();
133117
133146
  init_api$1();
133118
133147
  init_core$1();
133119
- PARENT_ROLES = /* @__PURE__ */ new Set(["related_parent", "collinear_parent"]);
133148
+ init_enum();
133149
+ PARENT_ROLES = /* @__PURE__ */ new Set([ContainerRoleConst.RELATED_PARENT, ContainerRoleConst.COLLINEAR_PARENT]);
133120
133150
  }));
133121
133151
  //#endregion
133122
133152
  //#region src/runtime/renderer/dropdowns/components/tables/composables/useTableDropdown.ts
@@ -148221,6 +148251,7 @@ var FieldProviderRuntime = class {
148221
148251
  var boolean_manifest_exports = /* @__PURE__ */ __exportAll({ manifest: () => manifest$74 });
148222
148252
  init_field_type();
148223
148253
  init_enum();
148254
+ init_form_value();
148224
148255
  init_basic();
148225
148256
  var optionsJson = JSON.stringify([{
148226
148257
  label: "真",
@@ -159960,6 +159991,7 @@ var FieldPanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
159960
159991
  return openBlock(), createElementBlock("div", _hoisted_1$57, [
159961
159992
  createVNode(unref(collapse_default), {
159962
159993
  title: "字段属性",
159994
+ visible: false,
159963
159995
  class: "panel-collapse is-first"
159964
159996
  }, {
159965
159997
  expandIcon: withCtx(({ open }) => [createVNode(field_panel_chevron_default, { expanded: open }, null, 8, ["expanded"])]),
@@ -160124,7 +160156,7 @@ var schema$3 = {
160124
160156
  value: (attachFieldTarget === null || attachFieldTarget === void 0 ? void 0 : attachFieldTarget.attachFieldLabel) ?? "引用字段"
160125
160157
  }];
160126
160158
  },
160127
- render: /* @__PURE__ */ _plugin_vue_export_helper_default(FieldPanel_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-334e23f7"]])
160159
+ render: /* @__PURE__ */ _plugin_vue_export_helper_default(FieldPanel_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a9a74705"]])
160128
160160
  };
160129
160161
  //#endregion
160130
160162
  //#region src/suites/edhr/panel-schema/paper-widget/PaperWidgetPanel.vue?vue&type=script&setup=true&lang.ts
@@ -161059,6 +161091,7 @@ var bool_opt_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(bo
161059
161091
  //#endregion
161060
161092
  //#region src/suites/edhr/panel-config/field/boolean/field-boolean-config.vue?vue&type=script&setup=true&lang.ts
161061
161093
  init_enum();
161094
+ init_form_value();
161062
161095
  var _hoisted_1$47 = { class: "panel-field-boolean-config" };
161063
161096
  var field_boolean_config_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
161064
161097
  __name: "field-boolean-config",
@@ -161207,7 +161240,7 @@ var field_boolean_config_vue_vue_type_script_setup_true_lang_default = /*@__PURE
161207
161240
  //#region src/suites/edhr/panel-config/field/boolean/field-boolean-config.vue
161208
161241
  var field_boolean_config_exports = /* @__PURE__ */ __exportAll({ default: () => field_boolean_config_default });
161209
161242
  init__plugin_vue_export_helper();
161210
- var field_boolean_config_default = /*#__PURE__*/ _plugin_vue_export_helper_default(field_boolean_config_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b0cd3e0d"]]);
161243
+ var field_boolean_config_default = /*#__PURE__*/ _plugin_vue_export_helper_default(field_boolean_config_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-059669fc"]]);
161211
161244
  //#endregion
161212
161245
  //#region src/suites/edhr/panel-config/field/boolean/field-boolean-style.vue?vue&type=script&setup=true&lang.ts
161213
161246
  init_enum();
package/dist/word.css CHANGED
@@ -12935,13 +12935,13 @@ svg.portrait-icon[data-v-8bdb451e] {
12935
12935
  display: block;
12936
12936
  flex: none;
12937
12937
  }
12938
- .panel-field[data-v-334e23f7] {
12938
+ .panel-field[data-v-a9a74705] {
12939
12939
  position: relative;
12940
12940
  }
12941
- .panel-field .container[data-v-334e23f7] {
12941
+ .panel-field .container[data-v-a9a74705] {
12942
12942
  padding: 15px 16px 16px;
12943
12943
  }
12944
- .panel-field[data-v-334e23f7] .container > .form-item {
12944
+ .panel-field[data-v-a9a74705] .container > .form-item {
12945
12945
  align-items: flex-start;
12946
12946
  min-height: 18px;
12947
12947
  margin-top: 10px !important;
@@ -12951,10 +12951,10 @@ svg.portrait-icon[data-v-8bdb451e] {
12951
12951
  font-weight: 400;
12952
12952
  line-height: 18px;
12953
12953
  }
12954
- .panel-field[data-v-334e23f7] .container > .form-item:first-child {
12954
+ .panel-field[data-v-a9a74705] .container > .form-item:first-child {
12955
12955
  margin-top: 0 !important;
12956
12956
  }
12957
- .panel-field[data-v-334e23f7] .container > .form-item > .form-item__label {
12957
+ .panel-field[data-v-a9a74705] .container > .form-item > .form-item__label {
12958
12958
  flex: 0 0 96px;
12959
12959
  width: 96px;
12960
12960
  overflow: hidden;
@@ -12966,7 +12966,7 @@ svg.portrait-icon[data-v-8bdb451e] {
12966
12966
  text-overflow: ellipsis;
12967
12967
  white-space: nowrap;
12968
12968
  }
12969
- .panel-field[data-v-334e23f7] .container > .form-item > .form-item__content {
12969
+ .panel-field[data-v-a9a74705] .container > .form-item > .form-item__content {
12970
12970
  min-width: 0;
12971
12971
  overflow: hidden;
12972
12972
  color: #1a1d23;
@@ -12975,7 +12975,7 @@ svg.portrait-icon[data-v-8bdb451e] {
12975
12975
  font-weight: 400;
12976
12976
  line-height: 18px;
12977
12977
  }
12978
- .panel-field[data-v-334e23f7] .collapse.panel-collapse > .collapse-header {
12978
+ .panel-field[data-v-a9a74705] .collapse.panel-collapse > .collapse-header {
12979
12979
  box-sizing: border-box;
12980
12980
  align-items: center;
12981
12981
  height: 36px;
@@ -12988,11 +12988,11 @@ svg.portrait-icon[data-v-8bdb451e] {
12988
12988
  line-height: 18px;
12989
12989
  background: #f9fafb;
12990
12990
  }
12991
- .panel-field[data-v-334e23f7] .collapse.panel-collapse.is-first > .collapse-header {
12991
+ .panel-field[data-v-a9a74705] .collapse.panel-collapse.is-first > .collapse-header {
12992
12992
  height: 35px;
12993
12993
  min-height: 35px;
12994
12994
  }
12995
- .panel-field[data-v-334e23f7] .collapse.panel-collapse .expand-icon {
12995
+ .panel-field[data-v-a9a74705] .collapse.panel-collapse .expand-icon {
12996
12996
  display: flex;
12997
12997
  align-items: center;
12998
12998
  height: 16px;
@@ -13222,7 +13222,7 @@ svg.portrait-icon[data-v-8bdb451e] {
13222
13222
  .option-container .option__attach-field[data-v-647b5798] {
13223
13223
  margin-top: 0;
13224
13224
  }
13225
- .panel-field-boolean-config[data-v-b0cd3e0d] {
13225
+ .panel-field-boolean-config[data-v-059669fc] {
13226
13226
  padding: 16px;
13227
13227
  }
13228
13228
  .panel-field-boolean-style[data-v-bc440683] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.74-beta.19",
3
+ "version": "0.1.74-beta.20",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",