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

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 (2) hide show
  1. package/dist/index.es.js +8 -4
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @gct-paas/word v0.1.73-patch.10 */
1
+ /*! @gct-paas/word v0.1.73-patch.11 */
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";
@@ -13651,7 +13651,8 @@ function toDictValue(field, value, row) {
13651
13651
  function getSelectOptions(payload) {
13652
13652
  const { value, multiple, options = [], key } = payload || {};
13653
13653
  const values = (Array.isArray(value) ? value : multiple ? (value === null || value === void 0 ? void 0 : value.split(",")) ?? [] : [value]).filter((i) => !isNil(i));
13654
- const selected = options.filter((item) => values.includes(item.value));
13654
+ const optionMap = new Map(options.map((item) => [item.value, item]));
13655
+ const selected = values.map((v) => optionMap.get(v)).filter((item) => item != null);
13655
13656
  const labels = selected.map((item) => item[key]);
13656
13657
  return {
13657
13658
  selectOptions: selected,
@@ -94839,8 +94840,11 @@ async function readApiLabel(strategy, value, fieldBinding, loadFieldByKey) {
94839
94840
  refModelKey: fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.bindInfo
94840
94841
  };
94841
94842
  try {
94842
- const result = strategy.fetcher === "rdo2ref" ? await fetcher.getOptionById(String(value), params) : await fetcher.getOptionByIds(getValue$1(value, true), params);
94843
- const labels = (Array.isArray(result) ? result : result ? [result] : []).map((item) => item === null || item === void 0 ? void 0 : item.label).filter(Boolean);
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)]));
94847
+ const labels = idList.map((id) => labelByValue.get(String(id))).filter(Boolean);
94844
94848
  if (labels.length) return labels.join(",");
94845
94849
  return strategy.fallback;
94846
94850
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.1.73-patch.10",
3
+ "version": "0.1.73-patch.11",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",