bm-admin-ui 1.1.12-alpha → 1.1.14-alpha

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.
@@ -117,10 +117,14 @@ const _sfc_main$2 = defineComponent({
117
117
  const isEditLabel = ref(false);
118
118
  const tempLabel = ref("");
119
119
  tempLabel.value = "";
120
+ const inputRef = ref();
120
121
  const methods = {
121
122
  toEditLabel() {
122
123
  tempLabel.value = props["label"];
123
124
  isEditLabel.value = true;
125
+ nextTick(() => {
126
+ inputRef.value?.focus();
127
+ });
124
128
  },
125
129
  updateLabel(_) {
126
130
  nextTick(() => {
@@ -134,6 +138,7 @@ const _sfc_main$2 = defineComponent({
134
138
  }
135
139
  };
136
140
  return {
141
+ inputRef,
137
142
  isEditLabel,
138
143
  tempLabel,
139
144
  ...methods
@@ -158,8 +163,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
158
163
  onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.toEditLabel && _ctx.toEditLabel(...args), ["stop"]))
159
164
  }, toDisplayString(_ctx.label), 1)) : (openBlock(), createBlock(_component_AInput, {
160
165
  key: 1,
166
+ ref: "inputRef",
161
167
  value: _ctx.tempLabel,
162
168
  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => _ctx.tempLabel = $event),
169
+ maxlength: 10,
163
170
  size: "small",
164
171
  onBlur: _ctx.updateLabel,
165
172
  onKeydown: withKeys(_ctx.updateLabel, ["enter"])
@@ -3,6 +3,7 @@ declare const _default: import("vue").DefineComponent<Readonly<import("vue").Com
3
3
  }>>, {
4
4
  toEditLabel(): void;
5
5
  updateLabel(_: any): void;
6
+ inputRef: import("vue").Ref<any>;
6
7
  isEditLabel: import("vue").Ref<boolean>;
7
8
  tempLabel: any;
8
9
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:label"[], "update:label", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
@@ -18769,15 +18769,20 @@ const _sfc_main$7 = defineComponent({
18769
18769
  \u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
18770
18770
  \u5546\u54C1\u7BB1\u89C4: "carton",
18771
18771
  \u5546\u54C1\u5355\u4F4D: "unit",
18772
+ \u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
18773
+ \u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
18774
+ \u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
18775
+ \u5546\u54C1\u7C7B\u578B: "productType",
18776
+ \u5546\u54C1\u6807\u7B7E: "productTag",
18772
18777
  \u5E97\u94FA\u6240\u5C5E\u5E73\u53F0: "platformName",
18773
18778
  \u6E20\u9053: "channelName",
18774
18779
  \u6E20\u9053\u7C7B\u522B: "channelTypeName",
18775
- \u5BA2\u6237\u7B80\u79F0: "",
18776
- \u5BA2\u6237\u7C7B\u578B: "",
18777
- \u5BA2\u6237\u7B49\u7EA7: "",
18778
- \u6240\u5C5E\u5E97\u94FA: "",
18779
- \u5E97\u94FA\u7F16\u53F7: "",
18780
- SAP\u5BA2\u6237\u7F16\u53F7: ""
18780
+ \u5BA2\u6237\u7B80\u79F0: "clientShortName",
18781
+ \u5BA2\u6237\u7C7B\u578B: "b2bType",
18782
+ \u5BA2\u6237\u7B49\u7EA7: "b2bLevel",
18783
+ \u6240\u5C5E\u5E97\u94FA: "shopName",
18784
+ \u5E97\u94FA\u7F16\u53F7: "shopCode",
18785
+ SAP\u5BA2\u6237\u7F16\u53F7: "sapCode"
18781
18786
  };
18782
18787
  let indexMap = {
18783
18788
  product: 0,
@@ -18846,7 +18851,7 @@ const _sfc_main$7 = defineComponent({
18846
18851
  const tableConfig = computed(() => props.rule?.config?.tableConfig || {});
18847
18852
  const validColumns = computed(() => columns.filter((c) => isValidColumn(c)));
18848
18853
  const isProductCenter = computed(
18849
- () => tableConfig.value?.system === "productCenter"
18854
+ () => tableConfig.value.system === "productCenter"
18850
18855
  );
18851
18856
  const isProductCenterSuit = computed(
18852
18857
  () => isProductCenter.value && [
@@ -18891,7 +18896,40 @@ const _sfc_main$7 = defineComponent({
18891
18896
  if (Object.keys(indexMap).includes(name)) {
18892
18897
  pre.push(...getExtraColumns(cur));
18893
18898
  } else {
18894
- pre.push(ruleList[name].tableRule(cur, props.extraConfig));
18899
+ let childField = cur.field;
18900
+ let title = cur.title?.title;
18901
+ if (isProductCenter.value && cur.field === "picUrl") {
18902
+ pre.push({
18903
+ field: childField,
18904
+ title,
18905
+ minWidth: "138px",
18906
+ slots: {
18907
+ default({ row }) {
18908
+ if (row?.[childField]) {
18909
+ return h("img", {
18910
+ src: props.extraConfig.common.previewImg(row[childField]),
18911
+ style: {
18912
+ width: "86px",
18913
+ height: "86px",
18914
+ padding: "8px"
18915
+ }
18916
+ });
18917
+ }
18918
+ return h(
18919
+ "div",
18920
+ {
18921
+ style: {
18922
+ color: "#9393A3"
18923
+ }
18924
+ },
18925
+ ["\u7CFB\u7EDF\u81EA\u52A8\u5E26\u51FA"]
18926
+ );
18927
+ }
18928
+ }
18929
+ });
18930
+ } else {
18931
+ pre.push(ruleList[name].tableRule(cur, props.extraConfig));
18932
+ }
18895
18933
  }
18896
18934
  return pre;
18897
18935
  }, [])
@@ -18937,10 +18975,25 @@ const _sfc_main$7 = defineComponent({
18937
18975
  const field = rule.field;
18938
18976
  const associatedFields = rule.config.associatedFields;
18939
18977
  configObj.slots.push(rule);
18978
+ function getBaseTitle() {
18979
+ let baseTitle = mainName;
18980
+ if (rule.name === "product") {
18981
+ baseTitle = `\u5546\u54C1\u7F16\u7801-${mainName}`;
18982
+ if (isProductCenterSuit.value && rule.field === "productCode") {
18983
+ baseTitle = "\u5546\u54C1\u7F16\u53F7";
18984
+ }
18985
+ } else if (rule.name === "customer") {
18986
+ baseTitle = `\u5BA2\u6237\u7F16\u53F7-${mainName}`;
18987
+ if (isProductCenterSuit.value && rule.field === "clientCode") {
18988
+ baseTitle = "\u5BA2\u6237\u7F16\u53F7";
18989
+ }
18990
+ }
18991
+ return baseTitle;
18992
+ }
18940
18993
  const columns2 = [
18941
18994
  {
18942
18995
  field,
18943
- title: rule.name === "product" ? `\u5546\u54C1\u7F16\u7801-${mainName}` : `${mainName}`,
18996
+ title: getBaseTitle(),
18944
18997
  headerClassName: rule.effect.required ? "is-required" : "",
18945
18998
  minWidth: "138px",
18946
18999
  slots: {
@@ -18948,9 +19001,6 @@ const _sfc_main$7 = defineComponent({
18948
19001
  }
18949
19002
  }
18950
19003
  ];
18951
- if (isProductCenterSuit.value && rule.name === "product") {
18952
- columns2[0].title = "\u5546\u54C1\u7F16\u53F7";
18953
- }
18954
19004
  if (associatedFields.length) {
18955
19005
  associatedFields.forEach((item) => {
18956
19006
  const childField = productPicName(item.value, field);
@@ -19080,6 +19130,31 @@ const _sfc_main$7 = defineComponent({
19080
19130
  return Promise.resolve(result);
19081
19131
  }
19082
19132
  }
19133
+ async function queryCustomerInfo(rule, row) {
19134
+ const field = rule.field;
19135
+ const associatedFields = rule?.config?.associatedFields;
19136
+ const otherAssociatedFields = rule?.config?.otherAssociatedFields;
19137
+ let result = void 0;
19138
+ try {
19139
+ if (row[field]) {
19140
+ result = await props.extraConfig.customer?.fetch({
19141
+ clientCode: row[field],
19142
+ filterByShopcode: rule?.config?.dataFiltering
19143
+ });
19144
+ if (!result) {
19145
+ row[field] = "";
19146
+ }
19147
+ }
19148
+ processAssociatedFields(field, associatedFields, row, result);
19149
+ processOtherAssociatedFields(field, otherAssociatedFields, row, result);
19150
+ return result;
19151
+ } catch (e) {
19152
+ row[field] = "";
19153
+ processAssociatedFields(field, associatedFields, row, result);
19154
+ processOtherAssociatedFields(field, otherAssociatedFields, row, result);
19155
+ return Promise.resolve(result);
19156
+ }
19157
+ }
19083
19158
  function processAssociatedFields(field, associatedFields, row, result) {
19084
19159
  if (associatedFields.length)
19085
19160
  associatedFields.forEach((item) => {
@@ -19279,6 +19354,18 @@ const _sfc_main$7 = defineComponent({
19279
19354
  break;
19280
19355
  }
19281
19356
  }
19357
+ if (rule.name === "customer") {
19358
+ try {
19359
+ const productInfo = await queryCustomerInfo(rule, row);
19360
+ if (!productInfo) {
19361
+ error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
19362
+ break;
19363
+ }
19364
+ } catch (e) {
19365
+ error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
19366
+ break;
19367
+ }
19368
+ }
19282
19369
  if (rule.name === "shop") {
19283
19370
  try {
19284
19371
  const shopInfo = await props.extraConfig[rule.name].getShopInfo({
@@ -19331,6 +19418,10 @@ const _sfc_main$7 = defineComponent({
19331
19418
  }
19332
19419
  queryProductInfo(rule, row);
19333
19420
  }
19421
+ function handleCustomerPressEnter(value, rule, row) {
19422
+ row[rule.field] = value;
19423
+ queryCustomerInfo(rule, row);
19424
+ }
19334
19425
  function handleShopOption(value, rule, row) {
19335
19426
  row[rule?.field] = value;
19336
19427
  processAssociatedFields(
@@ -19392,6 +19483,7 @@ const _sfc_main$7 = defineComponent({
19392
19483
  buttonLoadingForProductCenter.value.download = true;
19393
19484
  await props.extraConfig.table?.downloadTemplateFetch?.({
19394
19485
  tableConfig: tableConfig.value,
19486
+ tableRules: props.rule.config.childRules,
19395
19487
  columns: validColumns.value
19396
19488
  });
19397
19489
  } catch (error) {
@@ -19406,8 +19498,18 @@ const _sfc_main$7 = defineComponent({
19406
19498
  }
19407
19499
  try {
19408
19500
  buttonLoadingForProductCenter.value.import = true;
19501
+ let tableRules = cloneDeep(props.rule.config?.childRules || []);
19502
+ tableRules.forEach((rule) => {
19503
+ const field = rule.field;
19504
+ let associatedFields = rule.config.associatedFields || [];
19505
+ associatedFields.forEach((associatedRule) => {
19506
+ associatedRule.field = productPicName(associatedRule.value, field);
19507
+ associatedRule.is = accosiationParseKeyMap[associatedRule.value];
19508
+ });
19509
+ });
19409
19510
  let res = await props.extraConfig.table?.importFetch?.({
19410
19511
  tableConfig: tableConfig.value,
19512
+ tableRules,
19411
19513
  columns: validColumns.value,
19412
19514
  filterByShopcode: props.rule?.config?.dataFiltering,
19413
19515
  dataFile: e.target.files?.[0]
@@ -19485,7 +19587,7 @@ const _sfc_main$7 = defineComponent({
19485
19587
  createTextVNode(toDisplayString(__props.rule.title.title) + " ", 1),
19486
19588
  createElementVNode("span", _hoisted_3$3, toDisplayString(unref(countText)), 1),
19487
19589
  createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
19488
- unref(tableConfig).system === "productCenter" ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
19590
+ unref(isProductCenter) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
19489
19591
  !__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
19490
19592
  unref(tableConfig).buttons?.includes("import") ? (openBlock(), createElementBlock("input", {
19491
19593
  key: 0,
@@ -19692,7 +19794,7 @@ const _sfc_main$7 = defineComponent({
19692
19794
  value: row[item.field],
19693
19795
  disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
19694
19796
  "shop-value": unref(formData)[item.config.dataFiltering],
19695
- onChange: ($event) => handlePressEnter($event, item, row)
19797
+ onChange: ($event) => handleCustomerPressEnter($event, item, row)
19696
19798
  }, null, 8, ["value", "disabled", "shop-value", "onChange"])
19697
19799
  ])
19698
19800
  };
@@ -20308,14 +20410,19 @@ var materialTemp = {
20308
20410
  validate: [
20309
20411
  {
20310
20412
  validator(rule, value) {
20413
+ var _a, _b, _c;
20311
20414
  if (isNull(value)) {
20312
20415
  return Promise.reject();
20313
20416
  }
20314
20417
  const panes = value.panes;
20418
+ const requiredPicture = (_b = (_a = data === null || data === void 0 ? void 0 : data.config) === null || _a === void 0 ? void 0 : _a.uploadPictureRule) === null || _b === void 0 ? void 0 : _b.required;
20315
20419
  for (const pane of panes) {
20316
20420
  if (!pane.tempIdSelected) {
20317
20421
  return Promise.reject();
20318
20422
  }
20423
+ if (requiredPicture && !((_c = pane.uploadList) === null || _c === void 0 ? void 0 : _c.length)) {
20424
+ return Promise.reject();
20425
+ }
20319
20426
  if (pane.tableRequiredFields) {
20320
20427
  for (const field of pane.tableRequiredFields) {
20321
20428
  if (pane.tableData.some((row) => isNull(row[field]))) {
@@ -20360,7 +20467,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
20360
20467
  \u5546\u54C1\u56FE\u7247: "picUrl",
20361
20468
  \u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
20362
20469
  \u5546\u54C1\u7BB1\u89C4: "carton",
20363
- \u5546\u54C1\u5355\u4F4D: "unit"
20470
+ \u5546\u54C1\u5355\u4F4D: "unit",
20471
+ \u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
20472
+ \u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
20473
+ \u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
20474
+ \u5546\u54C1\u7C7B\u578B: "productType",
20475
+ \u5546\u54C1\u6807\u7B7E: "productTag"
20364
20476
  };
20365
20477
  const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
20366
20478
  const formData = computed(() => props.formCreateInject.api.bind());
@@ -128,10 +128,14 @@ const _sfc_main$2 = vue.defineComponent({
128
128
  const isEditLabel = vue.ref(false);
129
129
  const tempLabel = vue.ref("");
130
130
  tempLabel.value = "";
131
+ const inputRef = vue.ref();
131
132
  const methods = {
132
133
  toEditLabel() {
133
134
  tempLabel.value = props["label"];
134
135
  isEditLabel.value = true;
136
+ vue.nextTick(() => {
137
+ inputRef.value?.focus();
138
+ });
135
139
  },
136
140
  updateLabel(_) {
137
141
  vue.nextTick(() => {
@@ -145,6 +149,7 @@ const _sfc_main$2 = vue.defineComponent({
145
149
  }
146
150
  };
147
151
  return {
152
+ inputRef,
148
153
  isEditLabel,
149
154
  tempLabel,
150
155
  ...methods
@@ -169,8 +174,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
169
174
  onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => _ctx.toEditLabel && _ctx.toEditLabel(...args), ["stop"]))
170
175
  }, vue.toDisplayString(_ctx.label), 1)) : (vue.openBlock(), vue.createBlock(_component_AInput, {
171
176
  key: 1,
177
+ ref: "inputRef",
172
178
  value: _ctx.tempLabel,
173
179
  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => _ctx.tempLabel = $event),
180
+ maxlength: 10,
174
181
  size: "small",
175
182
  onBlur: _ctx.updateLabel,
176
183
  onKeydown: vue.withKeys(_ctx.updateLabel, ["enter"])
@@ -3,6 +3,7 @@ declare const _default: import("vue").DefineComponent<Readonly<import("vue").Com
3
3
  }>>, {
4
4
  toEditLabel(): void;
5
5
  updateLabel(_: any): void;
6
+ inputRef: import("vue").Ref<any>;
6
7
  isEditLabel: import("vue").Ref<boolean>;
7
8
  tempLabel: any;
8
9
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:label"[], "update:label", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
@@ -18783,15 +18783,20 @@ const _sfc_main$7 = vue.defineComponent({
18783
18783
  \u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
18784
18784
  \u5546\u54C1\u7BB1\u89C4: "carton",
18785
18785
  \u5546\u54C1\u5355\u4F4D: "unit",
18786
+ \u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
18787
+ \u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
18788
+ \u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
18789
+ \u5546\u54C1\u7C7B\u578B: "productType",
18790
+ \u5546\u54C1\u6807\u7B7E: "productTag",
18786
18791
  \u5E97\u94FA\u6240\u5C5E\u5E73\u53F0: "platformName",
18787
18792
  \u6E20\u9053: "channelName",
18788
18793
  \u6E20\u9053\u7C7B\u522B: "channelTypeName",
18789
- \u5BA2\u6237\u7B80\u79F0: "",
18790
- \u5BA2\u6237\u7C7B\u578B: "",
18791
- \u5BA2\u6237\u7B49\u7EA7: "",
18792
- \u6240\u5C5E\u5E97\u94FA: "",
18793
- \u5E97\u94FA\u7F16\u53F7: "",
18794
- SAP\u5BA2\u6237\u7F16\u53F7: ""
18794
+ \u5BA2\u6237\u7B80\u79F0: "clientShortName",
18795
+ \u5BA2\u6237\u7C7B\u578B: "b2bType",
18796
+ \u5BA2\u6237\u7B49\u7EA7: "b2bLevel",
18797
+ \u6240\u5C5E\u5E97\u94FA: "shopName",
18798
+ \u5E97\u94FA\u7F16\u53F7: "shopCode",
18799
+ SAP\u5BA2\u6237\u7F16\u53F7: "sapCode"
18795
18800
  };
18796
18801
  let indexMap = {
18797
18802
  product: 0,
@@ -18860,7 +18865,7 @@ const _sfc_main$7 = vue.defineComponent({
18860
18865
  const tableConfig = vue.computed(() => props.rule?.config?.tableConfig || {});
18861
18866
  const validColumns = vue.computed(() => columns.filter((c) => isValidColumn(c)));
18862
18867
  const isProductCenter = vue.computed(
18863
- () => tableConfig.value?.system === "productCenter"
18868
+ () => tableConfig.value.system === "productCenter"
18864
18869
  );
18865
18870
  const isProductCenterSuit = vue.computed(
18866
18871
  () => isProductCenter.value && [
@@ -18905,7 +18910,40 @@ const _sfc_main$7 = vue.defineComponent({
18905
18910
  if (Object.keys(indexMap).includes(name)) {
18906
18911
  pre.push(...getExtraColumns(cur));
18907
18912
  } else {
18908
- pre.push(ruleList[name].tableRule(cur, props.extraConfig));
18913
+ let childField = cur.field;
18914
+ let title = cur.title?.title;
18915
+ if (isProductCenter.value && cur.field === "picUrl") {
18916
+ pre.push({
18917
+ field: childField,
18918
+ title,
18919
+ minWidth: "138px",
18920
+ slots: {
18921
+ default({ row }) {
18922
+ if (row?.[childField]) {
18923
+ return vue.h("img", {
18924
+ src: props.extraConfig.common.previewImg(row[childField]),
18925
+ style: {
18926
+ width: "86px",
18927
+ height: "86px",
18928
+ padding: "8px"
18929
+ }
18930
+ });
18931
+ }
18932
+ return vue.h(
18933
+ "div",
18934
+ {
18935
+ style: {
18936
+ color: "#9393A3"
18937
+ }
18938
+ },
18939
+ ["\u7CFB\u7EDF\u81EA\u52A8\u5E26\u51FA"]
18940
+ );
18941
+ }
18942
+ }
18943
+ });
18944
+ } else {
18945
+ pre.push(ruleList[name].tableRule(cur, props.extraConfig));
18946
+ }
18909
18947
  }
18910
18948
  return pre;
18911
18949
  }, [])
@@ -18951,10 +18989,25 @@ const _sfc_main$7 = vue.defineComponent({
18951
18989
  const field = rule.field;
18952
18990
  const associatedFields = rule.config.associatedFields;
18953
18991
  configObj.slots.push(rule);
18992
+ function getBaseTitle() {
18993
+ let baseTitle = mainName;
18994
+ if (rule.name === "product") {
18995
+ baseTitle = `\u5546\u54C1\u7F16\u7801-${mainName}`;
18996
+ if (isProductCenterSuit.value && rule.field === "productCode") {
18997
+ baseTitle = "\u5546\u54C1\u7F16\u53F7";
18998
+ }
18999
+ } else if (rule.name === "customer") {
19000
+ baseTitle = `\u5BA2\u6237\u7F16\u53F7-${mainName}`;
19001
+ if (isProductCenterSuit.value && rule.field === "clientCode") {
19002
+ baseTitle = "\u5BA2\u6237\u7F16\u53F7";
19003
+ }
19004
+ }
19005
+ return baseTitle;
19006
+ }
18954
19007
  const columns2 = [
18955
19008
  {
18956
19009
  field,
18957
- title: rule.name === "product" ? `\u5546\u54C1\u7F16\u7801-${mainName}` : `${mainName}`,
19010
+ title: getBaseTitle(),
18958
19011
  headerClassName: rule.effect.required ? "is-required" : "",
18959
19012
  minWidth: "138px",
18960
19013
  slots: {
@@ -18962,9 +19015,6 @@ const _sfc_main$7 = vue.defineComponent({
18962
19015
  }
18963
19016
  }
18964
19017
  ];
18965
- if (isProductCenterSuit.value && rule.name === "product") {
18966
- columns2[0].title = "\u5546\u54C1\u7F16\u53F7";
18967
- }
18968
19018
  if (associatedFields.length) {
18969
19019
  associatedFields.forEach((item) => {
18970
19020
  const childField = productPicName(item.value, field);
@@ -19094,6 +19144,31 @@ const _sfc_main$7 = vue.defineComponent({
19094
19144
  return Promise.resolve(result);
19095
19145
  }
19096
19146
  }
19147
+ async function queryCustomerInfo(rule, row) {
19148
+ const field = rule.field;
19149
+ const associatedFields = rule?.config?.associatedFields;
19150
+ const otherAssociatedFields = rule?.config?.otherAssociatedFields;
19151
+ let result = void 0;
19152
+ try {
19153
+ if (row[field]) {
19154
+ result = await props.extraConfig.customer?.fetch({
19155
+ clientCode: row[field],
19156
+ filterByShopcode: rule?.config?.dataFiltering
19157
+ });
19158
+ if (!result) {
19159
+ row[field] = "";
19160
+ }
19161
+ }
19162
+ processAssociatedFields(field, associatedFields, row, result);
19163
+ processOtherAssociatedFields(field, otherAssociatedFields, row, result);
19164
+ return result;
19165
+ } catch (e) {
19166
+ row[field] = "";
19167
+ processAssociatedFields(field, associatedFields, row, result);
19168
+ processOtherAssociatedFields(field, otherAssociatedFields, row, result);
19169
+ return Promise.resolve(result);
19170
+ }
19171
+ }
19097
19172
  function processAssociatedFields(field, associatedFields, row, result) {
19098
19173
  if (associatedFields.length)
19099
19174
  associatedFields.forEach((item) => {
@@ -19293,6 +19368,18 @@ const _sfc_main$7 = vue.defineComponent({
19293
19368
  break;
19294
19369
  }
19295
19370
  }
19371
+ if (rule.name === "customer") {
19372
+ try {
19373
+ const productInfo = await queryCustomerInfo(rule, row);
19374
+ if (!productInfo) {
19375
+ error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
19376
+ break;
19377
+ }
19378
+ } catch (e) {
19379
+ error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
19380
+ break;
19381
+ }
19382
+ }
19296
19383
  if (rule.name === "shop") {
19297
19384
  try {
19298
19385
  const shopInfo = await props.extraConfig[rule.name].getShopInfo({
@@ -19345,6 +19432,10 @@ const _sfc_main$7 = vue.defineComponent({
19345
19432
  }
19346
19433
  queryProductInfo(rule, row);
19347
19434
  }
19435
+ function handleCustomerPressEnter(value, rule, row) {
19436
+ row[rule.field] = value;
19437
+ queryCustomerInfo(rule, row);
19438
+ }
19348
19439
  function handleShopOption(value, rule, row) {
19349
19440
  row[rule?.field] = value;
19350
19441
  processAssociatedFields(
@@ -19406,6 +19497,7 @@ const _sfc_main$7 = vue.defineComponent({
19406
19497
  buttonLoadingForProductCenter.value.download = true;
19407
19498
  await props.extraConfig.table?.downloadTemplateFetch?.({
19408
19499
  tableConfig: tableConfig.value,
19500
+ tableRules: props.rule.config.childRules,
19409
19501
  columns: validColumns.value
19410
19502
  });
19411
19503
  } catch (error) {
@@ -19420,8 +19512,18 @@ const _sfc_main$7 = vue.defineComponent({
19420
19512
  }
19421
19513
  try {
19422
19514
  buttonLoadingForProductCenter.value.import = true;
19515
+ let tableRules = lodashEs.cloneDeep(props.rule.config?.childRules || []);
19516
+ tableRules.forEach((rule) => {
19517
+ const field = rule.field;
19518
+ let associatedFields = rule.config.associatedFields || [];
19519
+ associatedFields.forEach((associatedRule) => {
19520
+ associatedRule.field = productPicName(associatedRule.value, field);
19521
+ associatedRule.is = accosiationParseKeyMap[associatedRule.value];
19522
+ });
19523
+ });
19423
19524
  let res = await props.extraConfig.table?.importFetch?.({
19424
19525
  tableConfig: tableConfig.value,
19526
+ tableRules,
19425
19527
  columns: validColumns.value,
19426
19528
  filterByShopcode: props.rule?.config?.dataFiltering,
19427
19529
  dataFile: e.target.files?.[0]
@@ -19499,7 +19601,7 @@ const _sfc_main$7 = vue.defineComponent({
19499
19601
  vue.createTextVNode(vue.toDisplayString(__props.rule.title.title) + " ", 1),
19500
19602
  vue.createElementVNode("span", _hoisted_3$3, vue.toDisplayString(vue.unref(countText)), 1),
19501
19603
  vue.createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
19502
- vue.unref(tableConfig).system === "productCenter" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
19604
+ vue.unref(isProductCenter) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
19503
19605
  !__props.hidden ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
19504
19606
  vue.unref(tableConfig).buttons?.includes("import") ? (vue.openBlock(), vue.createElementBlock("input", {
19505
19607
  key: 0,
@@ -19706,7 +19808,7 @@ const _sfc_main$7 = vue.defineComponent({
19706
19808
  value: row[item.field],
19707
19809
  disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
19708
19810
  "shop-value": vue.unref(formData)[item.config.dataFiltering],
19709
- onChange: ($event) => handlePressEnter($event, item, row)
19811
+ onChange: ($event) => handleCustomerPressEnter($event, item, row)
19710
19812
  }, null, 8, ["value", "disabled", "shop-value", "onChange"])
19711
19813
  ])
19712
19814
  };
@@ -20322,14 +20424,19 @@ var materialTemp = {
20322
20424
  validate: [
20323
20425
  {
20324
20426
  validator(rule, value) {
20427
+ var _a, _b, _c;
20325
20428
  if (isNull.isNull(value)) {
20326
20429
  return Promise.reject();
20327
20430
  }
20328
20431
  const panes = value.panes;
20432
+ const requiredPicture = (_b = (_a = data === null || data === void 0 ? void 0 : data.config) === null || _a === void 0 ? void 0 : _a.uploadPictureRule) === null || _b === void 0 ? void 0 : _b.required;
20329
20433
  for (const pane of panes) {
20330
20434
  if (!pane.tempIdSelected) {
20331
20435
  return Promise.reject();
20332
20436
  }
20437
+ if (requiredPicture && !((_c = pane.uploadList) === null || _c === void 0 ? void 0 : _c.length)) {
20438
+ return Promise.reject();
20439
+ }
20333
20440
  if (pane.tableRequiredFields) {
20334
20441
  for (const field of pane.tableRequiredFields) {
20335
20442
  if (pane.tableData.some((row) => isNull.isNull(row[field]))) {
@@ -20374,7 +20481,12 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
20374
20481
  \u5546\u54C1\u56FE\u7247: "picUrl",
20375
20482
  \u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
20376
20483
  \u5546\u54C1\u7BB1\u89C4: "carton",
20377
- \u5546\u54C1\u5355\u4F4D: "unit"
20484
+ \u5546\u54C1\u5355\u4F4D: "unit",
20485
+ \u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
20486
+ \u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
20487
+ \u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
20488
+ \u5546\u54C1\u7C7B\u578B: "productType",
20489
+ \u5546\u54C1\u6807\u7B7E: "productTag"
20378
20490
  };
20379
20491
  const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
20380
20492
  const formData = vue.computed(() => props.formCreateInject.api.bind());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bm-admin-ui",
3
- "version": "1.1.12-alpha",
3
+ "version": "1.1.14-alpha",
4
4
  "private": false,
5
5
  "description": "An Admin Component Library for Bm",
6
6
  "license": "UNLICENSED",
@@ -3,6 +3,7 @@ declare const _default: import("vue").DefineComponent<Readonly<import("vue").Com
3
3
  }>>, {
4
4
  toEditLabel(): void;
5
5
  updateLabel(_: any): void;
6
+ inputRef: import("vue").Ref<any>;
6
7
  isEditLabel: import("vue").Ref<boolean>;
7
8
  tempLabel: any;
8
9
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:label"[], "update:label", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{