bm-admin-ui 1.1.11-alpha → 1.1.13-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,
@@ -18845,6 +18850,18 @@ const _sfc_main$7 = defineComponent({
18845
18850
  );
18846
18851
  const tableConfig = computed(() => props.rule?.config?.tableConfig || {});
18847
18852
  const validColumns = computed(() => columns.filter((c) => isValidColumn(c)));
18853
+ const isProductCenter = computed(
18854
+ () => tableConfig.value.system === "productCenter"
18855
+ );
18856
+ const isProductCenterSuit = computed(
18857
+ () => isProductCenter.value && [
18858
+ "F2CTemplate",
18859
+ "B2CTemplate",
18860
+ "DistributeTemp",
18861
+ "FreshTemplate",
18862
+ "activityApply"
18863
+ ].includes(tableConfig.value.template)
18864
+ );
18848
18865
  function isShow(key) {
18849
18866
  return props.rule.config.tableAdvancedFeatures.includes(key);
18850
18867
  }
@@ -18862,6 +18879,14 @@ const _sfc_main$7 = defineComponent({
18862
18879
  width: "54px"
18863
18880
  });
18864
18881
  }
18882
+ if (isProductCenterSuit.value) {
18883
+ columns.push({
18884
+ type: "seq",
18885
+ title: "\u5E8F\u53F7",
18886
+ width: "62px",
18887
+ align: "center"
18888
+ });
18889
+ }
18865
18890
  childRules?.length && columns.push(
18866
18891
  ...childRules.reduce((pre, cur) => {
18867
18892
  if (cur.hidden) {
@@ -18871,7 +18896,40 @@ const _sfc_main$7 = defineComponent({
18871
18896
  if (Object.keys(indexMap).includes(name)) {
18872
18897
  pre.push(...getExtraColumns(cur));
18873
18898
  } else {
18874
- 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
+ }
18875
18933
  }
18876
18934
  return pre;
18877
18935
  }, [])
@@ -18928,13 +18986,7 @@ const _sfc_main$7 = defineComponent({
18928
18986
  }
18929
18987
  }
18930
18988
  ];
18931
- if (tableConfig.value?.system === "productCenter" && [
18932
- "F2CTemplate",
18933
- "B2CTemplate",
18934
- "DistributeTemp",
18935
- "FreshTemplate",
18936
- "activityApply"
18937
- ].includes(tableConfig.value.template) && rule.name === "product") {
18989
+ if (isProductCenterSuit.value && rule.name === "product") {
18938
18990
  columns2[0].title = "\u5546\u54C1\u7F16\u53F7";
18939
18991
  }
18940
18992
  if (associatedFields.length) {
@@ -18980,15 +19032,30 @@ const _sfc_main$7 = defineComponent({
18980
19032
  delete newData._X_ROW_KEY;
18981
19033
  data.push(newData);
18982
19034
  }
18983
- function handleDelete(index) {
18984
- data.splice(index, 1);
19035
+ async function handleDelete(index, needConfirm = true) {
19036
+ if (isProductCenter.value && needConfirm) {
19037
+ if (await utils.confirmModal("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\uFF1F")) {
19038
+ data.splice(index, 1);
19039
+ }
19040
+ } else {
19041
+ data.splice(index, 1);
19042
+ }
18985
19043
  }
18986
- function handleBatchDelete() {
19044
+ async function handleBatchDelete() {
18987
19045
  const selected = xGrid.value.getCheckboxRecords();
18988
- selected.forEach((item) => {
18989
- const index = data.indexOf(item);
18990
- handleDelete(index);
18991
- });
19046
+ if (isProductCenter.value) {
19047
+ if (await utils.confirmModal(`\u786E\u5B9A\u8981\u5220\u9664\u6240\u9009\u7684${selected?.length}\u6761\u6570\u636E\u4E48\uFF1F`)) {
19048
+ selected.forEach((item) => {
19049
+ const index = data.indexOf(item);
19050
+ handleDelete(index, false);
19051
+ });
19052
+ }
19053
+ } else {
19054
+ selected.forEach((item) => {
19055
+ const index = data.indexOf(item);
19056
+ handleDelete(index, false);
19057
+ });
19058
+ }
18992
19059
  }
18993
19060
  function handleDownload() {
18994
19061
  xGrid.value.exportData({
@@ -19002,13 +19069,7 @@ const _sfc_main$7 = defineComponent({
19002
19069
  async function handleImport() {
19003
19070
  if (importDisabled()) {
19004
19071
  message.error("\u8BF7\u5148\u9009\u62E9\u5E97\u94FA\uFF01");
19005
- } else if (tableConfig.value?.system === "productCenter" && [
19006
- "F2CTemplate",
19007
- "B2CTemplate",
19008
- "DistributeTemp",
19009
- "FreshTemplate",
19010
- "activityApply"
19011
- ].includes(tableConfig.value?.template)) {
19072
+ } else if (isProductCenterSuit.value) {
19012
19073
  if (data.length > 0) {
19013
19074
  if (await utils.confirmModal("\u518D\u6B21\u6279\u5BFC\u4F1A\u8986\u76D6\u5DF2\u6709\u6570\u636E")) {
19014
19075
  data.splice(0, data.length);
@@ -19057,6 +19118,31 @@ const _sfc_main$7 = defineComponent({
19057
19118
  return Promise.resolve(result);
19058
19119
  }
19059
19120
  }
19121
+ async function queryCustomerInfo(rule, row) {
19122
+ const field = rule.field;
19123
+ const associatedFields = rule?.config?.associatedFields;
19124
+ const otherAssociatedFields = rule?.config?.otherAssociatedFields;
19125
+ let result = void 0;
19126
+ try {
19127
+ if (row[field]) {
19128
+ result = await props.extraConfig.customer?.fetch({
19129
+ clientCode: row[field],
19130
+ filterByShopcode: rule?.config?.dataFiltering
19131
+ });
19132
+ if (!result) {
19133
+ row[field] = "";
19134
+ }
19135
+ }
19136
+ processAssociatedFields(field, associatedFields, row, result);
19137
+ processOtherAssociatedFields(field, otherAssociatedFields, row, result);
19138
+ return result;
19139
+ } catch (e) {
19140
+ row[field] = "";
19141
+ processAssociatedFields(field, associatedFields, row, result);
19142
+ processOtherAssociatedFields(field, otherAssociatedFields, row, result);
19143
+ return Promise.resolve(result);
19144
+ }
19145
+ }
19060
19146
  function processAssociatedFields(field, associatedFields, row, result) {
19061
19147
  if (associatedFields.length)
19062
19148
  associatedFields.forEach((item) => {
@@ -19064,13 +19150,7 @@ const _sfc_main$7 = defineComponent({
19064
19150
  });
19065
19151
  }
19066
19152
  function processOtherAssociatedFields(field, fields, row, result) {
19067
- if (tableConfig.value?.system === "productCenter" && [
19068
- "F2CTemplate",
19069
- "B2CTemplate",
19070
- "DistributeTemp",
19071
- "FreshTemplate",
19072
- "activityApply"
19073
- ].includes(tableConfig.value.template)) {
19153
+ if (isProductCenterSuit.value) {
19074
19154
  fields?.forEach?.((item) => {
19075
19155
  row[item] = result ? result[item] : void 0;
19076
19156
  });
@@ -19103,7 +19183,7 @@ const _sfc_main$7 = defineComponent({
19103
19183
  file && reader.readAsText(file, "GB2312");
19104
19184
  }
19105
19185
  function isValidColumn(c) {
19106
- return c.type !== "checkbox" && c.field !== oper;
19186
+ return c.type !== "checkbox" && c.type !== "seq" && c.field !== oper;
19107
19187
  }
19108
19188
  function parseCsv(result) {
19109
19189
  let data2 = [];
@@ -19262,6 +19342,18 @@ const _sfc_main$7 = defineComponent({
19262
19342
  break;
19263
19343
  }
19264
19344
  }
19345
+ if (rule.name === "customer") {
19346
+ try {
19347
+ const productInfo = await queryCustomerInfo(rule, row);
19348
+ if (!productInfo) {
19349
+ error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
19350
+ break;
19351
+ }
19352
+ } catch (e) {
19353
+ error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
19354
+ break;
19355
+ }
19356
+ }
19265
19357
  if (rule.name === "shop") {
19266
19358
  try {
19267
19359
  const shopInfo = await props.extraConfig[rule.name].getShopInfo({
@@ -19305,7 +19397,7 @@ const _sfc_main$7 = defineComponent({
19305
19397
  }
19306
19398
  function handlePressEnter(value, rule, row) {
19307
19399
  row[rule.field] = value;
19308
- if (tableConfig.value?.system === "productCenter" && rule.field === "productCode") {
19400
+ if (isProductCenterSuit.value && rule.field === "productCode") {
19309
19401
  Object.keys(row).forEach((key) => {
19310
19402
  if (!["productCode", "_X_ROW_KEY"].includes(key)) {
19311
19403
  row[key] = void 0;
@@ -19314,6 +19406,10 @@ const _sfc_main$7 = defineComponent({
19314
19406
  }
19315
19407
  queryProductInfo(rule, row);
19316
19408
  }
19409
+ function handleCustomerPressEnter(value, rule, row) {
19410
+ row[rule.field] = value;
19411
+ queryCustomerInfo(rule, row);
19412
+ }
19317
19413
  function handleShopOption(value, rule, row) {
19318
19414
  row[rule?.field] = value;
19319
19415
  processAssociatedFields(
@@ -19468,7 +19564,7 @@ const _sfc_main$7 = defineComponent({
19468
19564
  createTextVNode(toDisplayString(__props.rule.title.title) + " ", 1),
19469
19565
  createElementVNode("span", _hoisted_3$3, toDisplayString(unref(countText)), 1),
19470
19566
  createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
19471
- unref(tableConfig).system === "productCenter" ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
19567
+ unref(isProductCenter) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
19472
19568
  !__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
19473
19569
  unref(tableConfig).buttons?.includes("import") ? (openBlock(), createElementBlock("input", {
19474
19570
  key: 0,
@@ -19675,7 +19771,7 @@ const _sfc_main$7 = defineComponent({
19675
19771
  value: row[item.field],
19676
19772
  disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
19677
19773
  "shop-value": unref(formData)[item.config.dataFiltering],
19678
- onChange: ($event) => handlePressEnter($event, item, row)
19774
+ onChange: ($event) => handleCustomerPressEnter($event, item, row)
19679
19775
  }, null, 8, ["value", "disabled", "shop-value", "onChange"])
19680
19776
  ])
19681
19777
  };
@@ -20343,7 +20439,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
20343
20439
  \u5546\u54C1\u56FE\u7247: "picUrl",
20344
20440
  \u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
20345
20441
  \u5546\u54C1\u7BB1\u89C4: "carton",
20346
- \u5546\u54C1\u5355\u4F4D: "unit"
20442
+ \u5546\u54C1\u5355\u4F4D: "unit",
20443
+ \u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
20444
+ \u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
20445
+ \u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
20446
+ \u5546\u54C1\u7C7B\u578B: "productType",
20447
+ \u5546\u54C1\u6807\u7B7E: "productTag"
20347
20448
  };
20348
20449
  const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
20349
20450
  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,
@@ -18859,6 +18864,18 @@ const _sfc_main$7 = vue.defineComponent({
18859
18864
  );
18860
18865
  const tableConfig = vue.computed(() => props.rule?.config?.tableConfig || {});
18861
18866
  const validColumns = vue.computed(() => columns.filter((c) => isValidColumn(c)));
18867
+ const isProductCenter = vue.computed(
18868
+ () => tableConfig.value.system === "productCenter"
18869
+ );
18870
+ const isProductCenterSuit = vue.computed(
18871
+ () => isProductCenter.value && [
18872
+ "F2CTemplate",
18873
+ "B2CTemplate",
18874
+ "DistributeTemp",
18875
+ "FreshTemplate",
18876
+ "activityApply"
18877
+ ].includes(tableConfig.value.template)
18878
+ );
18862
18879
  function isShow(key) {
18863
18880
  return props.rule.config.tableAdvancedFeatures.includes(key);
18864
18881
  }
@@ -18876,6 +18893,14 @@ const _sfc_main$7 = vue.defineComponent({
18876
18893
  width: "54px"
18877
18894
  });
18878
18895
  }
18896
+ if (isProductCenterSuit.value) {
18897
+ columns.push({
18898
+ type: "seq",
18899
+ title: "\u5E8F\u53F7",
18900
+ width: "62px",
18901
+ align: "center"
18902
+ });
18903
+ }
18879
18904
  childRules?.length && columns.push(
18880
18905
  ...childRules.reduce((pre, cur) => {
18881
18906
  if (cur.hidden) {
@@ -18885,7 +18910,40 @@ const _sfc_main$7 = vue.defineComponent({
18885
18910
  if (Object.keys(indexMap).includes(name)) {
18886
18911
  pre.push(...getExtraColumns(cur));
18887
18912
  } else {
18888
- 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
+ }
18889
18947
  }
18890
18948
  return pre;
18891
18949
  }, [])
@@ -18942,13 +19000,7 @@ const _sfc_main$7 = vue.defineComponent({
18942
19000
  }
18943
19001
  }
18944
19002
  ];
18945
- if (tableConfig.value?.system === "productCenter" && [
18946
- "F2CTemplate",
18947
- "B2CTemplate",
18948
- "DistributeTemp",
18949
- "FreshTemplate",
18950
- "activityApply"
18951
- ].includes(tableConfig.value.template) && rule.name === "product") {
19003
+ if (isProductCenterSuit.value && rule.name === "product") {
18952
19004
  columns2[0].title = "\u5546\u54C1\u7F16\u53F7";
18953
19005
  }
18954
19006
  if (associatedFields.length) {
@@ -18994,15 +19046,30 @@ const _sfc_main$7 = vue.defineComponent({
18994
19046
  delete newData._X_ROW_KEY;
18995
19047
  data.push(newData);
18996
19048
  }
18997
- function handleDelete(index) {
18998
- data.splice(index, 1);
19049
+ async function handleDelete(index, needConfirm = true) {
19050
+ if (isProductCenter.value && needConfirm) {
19051
+ if (await utils__default["default"].confirmModal("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u9879\uFF1F")) {
19052
+ data.splice(index, 1);
19053
+ }
19054
+ } else {
19055
+ data.splice(index, 1);
19056
+ }
18999
19057
  }
19000
- function handleBatchDelete() {
19058
+ async function handleBatchDelete() {
19001
19059
  const selected = xGrid.value.getCheckboxRecords();
19002
- selected.forEach((item) => {
19003
- const index = data.indexOf(item);
19004
- handleDelete(index);
19005
- });
19060
+ if (isProductCenter.value) {
19061
+ if (await utils__default["default"].confirmModal(`\u786E\u5B9A\u8981\u5220\u9664\u6240\u9009\u7684${selected?.length}\u6761\u6570\u636E\u4E48\uFF1F`)) {
19062
+ selected.forEach((item) => {
19063
+ const index = data.indexOf(item);
19064
+ handleDelete(index, false);
19065
+ });
19066
+ }
19067
+ } else {
19068
+ selected.forEach((item) => {
19069
+ const index = data.indexOf(item);
19070
+ handleDelete(index, false);
19071
+ });
19072
+ }
19006
19073
  }
19007
19074
  function handleDownload() {
19008
19075
  xGrid.value.exportData({
@@ -19016,13 +19083,7 @@ const _sfc_main$7 = vue.defineComponent({
19016
19083
  async function handleImport() {
19017
19084
  if (importDisabled()) {
19018
19085
  antDesignVue.message.error("\u8BF7\u5148\u9009\u62E9\u5E97\u94FA\uFF01");
19019
- } else if (tableConfig.value?.system === "productCenter" && [
19020
- "F2CTemplate",
19021
- "B2CTemplate",
19022
- "DistributeTemp",
19023
- "FreshTemplate",
19024
- "activityApply"
19025
- ].includes(tableConfig.value?.template)) {
19086
+ } else if (isProductCenterSuit.value) {
19026
19087
  if (data.length > 0) {
19027
19088
  if (await utils__default["default"].confirmModal("\u518D\u6B21\u6279\u5BFC\u4F1A\u8986\u76D6\u5DF2\u6709\u6570\u636E")) {
19028
19089
  data.splice(0, data.length);
@@ -19071,6 +19132,31 @@ const _sfc_main$7 = vue.defineComponent({
19071
19132
  return Promise.resolve(result);
19072
19133
  }
19073
19134
  }
19135
+ async function queryCustomerInfo(rule, row) {
19136
+ const field = rule.field;
19137
+ const associatedFields = rule?.config?.associatedFields;
19138
+ const otherAssociatedFields = rule?.config?.otherAssociatedFields;
19139
+ let result = void 0;
19140
+ try {
19141
+ if (row[field]) {
19142
+ result = await props.extraConfig.customer?.fetch({
19143
+ clientCode: row[field],
19144
+ filterByShopcode: rule?.config?.dataFiltering
19145
+ });
19146
+ if (!result) {
19147
+ row[field] = "";
19148
+ }
19149
+ }
19150
+ processAssociatedFields(field, associatedFields, row, result);
19151
+ processOtherAssociatedFields(field, otherAssociatedFields, row, result);
19152
+ return result;
19153
+ } catch (e) {
19154
+ row[field] = "";
19155
+ processAssociatedFields(field, associatedFields, row, result);
19156
+ processOtherAssociatedFields(field, otherAssociatedFields, row, result);
19157
+ return Promise.resolve(result);
19158
+ }
19159
+ }
19074
19160
  function processAssociatedFields(field, associatedFields, row, result) {
19075
19161
  if (associatedFields.length)
19076
19162
  associatedFields.forEach((item) => {
@@ -19078,13 +19164,7 @@ const _sfc_main$7 = vue.defineComponent({
19078
19164
  });
19079
19165
  }
19080
19166
  function processOtherAssociatedFields(field, fields, row, result) {
19081
- if (tableConfig.value?.system === "productCenter" && [
19082
- "F2CTemplate",
19083
- "B2CTemplate",
19084
- "DistributeTemp",
19085
- "FreshTemplate",
19086
- "activityApply"
19087
- ].includes(tableConfig.value.template)) {
19167
+ if (isProductCenterSuit.value) {
19088
19168
  fields?.forEach?.((item) => {
19089
19169
  row[item] = result ? result[item] : void 0;
19090
19170
  });
@@ -19117,7 +19197,7 @@ const _sfc_main$7 = vue.defineComponent({
19117
19197
  file && reader.readAsText(file, "GB2312");
19118
19198
  }
19119
19199
  function isValidColumn(c) {
19120
- return c.type !== "checkbox" && c.field !== oper;
19200
+ return c.type !== "checkbox" && c.type !== "seq" && c.field !== oper;
19121
19201
  }
19122
19202
  function parseCsv(result) {
19123
19203
  let data2 = [];
@@ -19276,6 +19356,18 @@ const _sfc_main$7 = vue.defineComponent({
19276
19356
  break;
19277
19357
  }
19278
19358
  }
19359
+ if (rule.name === "customer") {
19360
+ try {
19361
+ const productInfo = await queryCustomerInfo(rule, row);
19362
+ if (!productInfo) {
19363
+ error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
19364
+ break;
19365
+ }
19366
+ } catch (e) {
19367
+ error = `${title}\u67E5\u8BE2\u7684\u5BA2\u6237\u4E0D\u5B58\u5728`;
19368
+ break;
19369
+ }
19370
+ }
19279
19371
  if (rule.name === "shop") {
19280
19372
  try {
19281
19373
  const shopInfo = await props.extraConfig[rule.name].getShopInfo({
@@ -19319,7 +19411,7 @@ const _sfc_main$7 = vue.defineComponent({
19319
19411
  }
19320
19412
  function handlePressEnter(value, rule, row) {
19321
19413
  row[rule.field] = value;
19322
- if (tableConfig.value?.system === "productCenter" && rule.field === "productCode") {
19414
+ if (isProductCenterSuit.value && rule.field === "productCode") {
19323
19415
  Object.keys(row).forEach((key) => {
19324
19416
  if (!["productCode", "_X_ROW_KEY"].includes(key)) {
19325
19417
  row[key] = void 0;
@@ -19328,6 +19420,10 @@ const _sfc_main$7 = vue.defineComponent({
19328
19420
  }
19329
19421
  queryProductInfo(rule, row);
19330
19422
  }
19423
+ function handleCustomerPressEnter(value, rule, row) {
19424
+ row[rule.field] = value;
19425
+ queryCustomerInfo(rule, row);
19426
+ }
19331
19427
  function handleShopOption(value, rule, row) {
19332
19428
  row[rule?.field] = value;
19333
19429
  processAssociatedFields(
@@ -19482,7 +19578,7 @@ const _sfc_main$7 = vue.defineComponent({
19482
19578
  vue.createTextVNode(vue.toDisplayString(__props.rule.title.title) + " ", 1),
19483
19579
  vue.createElementVNode("span", _hoisted_3$3, vue.toDisplayString(vue.unref(countText)), 1),
19484
19580
  vue.createCommentVNode(" \u5546\u54C1\u4E2D\u5FC3\u5B9A\u5236 \u6309\u94AE "),
19485
- vue.unref(tableConfig).system === "productCenter" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
19581
+ vue.unref(isProductCenter) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
19486
19582
  !__props.hidden ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
19487
19583
  vue.unref(tableConfig).buttons?.includes("import") ? (vue.openBlock(), vue.createElementBlock("input", {
19488
19584
  key: 0,
@@ -19689,7 +19785,7 @@ const _sfc_main$7 = vue.defineComponent({
19689
19785
  value: row[item.field],
19690
19786
  disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
19691
19787
  "shop-value": vue.unref(formData)[item.config.dataFiltering],
19692
- onChange: ($event) => handlePressEnter($event, item, row)
19788
+ onChange: ($event) => handleCustomerPressEnter($event, item, row)
19693
19789
  }, null, 8, ["value", "disabled", "shop-value", "onChange"])
19694
19790
  ])
19695
19791
  };
@@ -20357,7 +20453,12 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
20357
20453
  \u5546\u54C1\u56FE\u7247: "picUrl",
20358
20454
  \u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
20359
20455
  \u5546\u54C1\u7BB1\u89C4: "carton",
20360
- \u5546\u54C1\u5355\u4F4D: "unit"
20456
+ \u5546\u54C1\u5355\u4F4D: "unit",
20457
+ \u4E00\u7EA7\u5206\u7C7B: "categoryFirst",
20458
+ \u4E8C\u7EA7\u5206\u7C7B: "categorySecond",
20459
+ \u4E09\u7EA7\u5206\u7C7B: "categoryThrid",
20460
+ \u5546\u54C1\u7C7B\u578B: "productType",
20461
+ \u5546\u54C1\u6807\u7B7E: "productTag"
20361
20462
  };
20362
20463
  const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
20363
20464
  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.11-alpha",
3
+ "version": "1.1.13-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<{