bm-admin-ui 1.0.89-alpha → 1.0.91-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.
@@ -163,50 +163,36 @@ var textarea = {
163
163
  },
164
164
  };
165
165
 
166
+ function generateRowRule(data) {
167
+ return {
168
+ type: 'inputNumber',
169
+ field: data.field,
170
+ title: data.title.title,
171
+ props: {
172
+ type: 'number',
173
+ placeholder: data.props.placeholder,
174
+ },
175
+ value: data.value,
176
+ effect: {
177
+ required: data.effect.required && '请输入',
178
+ },
179
+ wrap: {
180
+ wrapperCol: {
181
+ span: fieldRatioMap[data.config.fieldRatio],
182
+ },
183
+ },
184
+ style: {
185
+ width: '100%',
186
+ },
187
+ };
188
+ }
166
189
  var numInput = {
167
190
  name: 'numInput',
168
191
  rule(data) {
169
- return {
170
- type: 'inputNumber',
171
- field: data.field,
172
- title: data.title.title,
173
- props: {
174
- type: 'number',
175
- placeholder: data.props.placeholder,
176
- },
177
- value: data.value,
178
- effect: {
179
- required: data.effect.required && '请输入',
180
- },
181
- wrap: {
182
- wrapperCol: {
183
- span: fieldRatioMap[data.config.fieldRatio],
184
- },
185
- },
186
- style: {
187
- width: '100%',
188
- },
189
- };
192
+ return generateRowRule(data);
190
193
  },
191
194
  rowRule(data) {
192
- return {
193
- type: 'inputNumber',
194
- field: data.field,
195
- title: data.title.title,
196
- props: {
197
- placeholder: data.props.placeholder,
198
- },
199
- value: data.value,
200
- effect: {
201
- required: data.effect.required && '请输入',
202
- },
203
- col: {
204
- span: fieldRatioMap[data.config.fieldRatio],
205
- },
206
- style: {
207
- width: '100%',
208
- },
209
- };
195
+ return generateRowRule(data);
210
196
  },
211
197
  tableRule(data) {
212
198
  const field = data.field;
@@ -244,7 +230,7 @@ var _export_sfc = (sfc, props) => {
244
230
  return target;
245
231
  };
246
232
 
247
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
233
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
248
234
  __name: "radio-widget",
249
235
  props: ["formCreateInject"],
250
236
  emits: ["change"],
@@ -283,7 +269,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
283
269
  };
284
270
  }
285
271
  });
286
- var RadioWidget = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "radio-widget.vue"]]);
272
+ var RadioWidget = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "radio-widget.vue"]]);
287
273
 
288
274
  function handleRadioRule(rule) {
289
275
  if (rule.type === 'radio') {
@@ -843,7 +829,7 @@ var file = {
843
829
  },
844
830
  };
845
831
 
846
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
832
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
847
833
  __name: "staff-selector",
848
834
  props: [
849
835
  "title",
@@ -909,7 +895,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
909
895
  };
910
896
  }
911
897
  });
912
- var StaffSelector = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "staff-selector.vue"]]);
898
+ var StaffSelector = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "staff-selector.vue"]]);
913
899
 
914
900
  var people = {
915
901
  name: 'people',
@@ -1027,10 +1013,10 @@ var people = {
1027
1013
  },
1028
1014
  };
1029
1015
 
1030
- const _hoisted_1$6 = ["onClick"];
1016
+ const _hoisted_1$7 = ["onClick"];
1031
1017
  const _hoisted_2$6 = ["onClick"];
1032
1018
  const _hoisted_3$5 = { class: "box" };
1033
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
1019
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1034
1020
  __name: "temp-content",
1035
1021
  props: ["content", "preview"],
1036
1022
  setup(__props) {
@@ -1075,7 +1061,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1075
1061
  createVNode(unref(EyeOutlined)),
1076
1062
  createTextVNode("\xA0\u9884\u89C8")
1077
1063
  ])
1078
- ], 8, _hoisted_1$6)) : createCommentVNode("v-if", true),
1064
+ ], 8, _hoisted_1$7)) : createCommentVNode("v-if", true),
1079
1065
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(layers), (layer) => {
1080
1066
  return openBlock(), createElementBlock("div", {
1081
1067
  key: layer.uuid,
@@ -1109,9 +1095,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1109
1095
  };
1110
1096
  }
1111
1097
  });
1112
- var TempContent = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "temp-content.vue"]]);
1098
+ var TempContent = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "temp-content.vue"]]);
1113
1099
 
1114
- const _hoisted_1$5 = { class: "bm-fc-select-material-temp__content__item-info" };
1100
+ const _hoisted_1$6 = { class: "bm-fc-select-material-temp__content__item-info" };
1115
1101
  const _hoisted_2$5 = { class: "bm-fc-select-material-temp__content__item-info__cover" };
1116
1102
  const _hoisted_3$4 = ["src"];
1117
1103
  const _hoisted_4$4 = ["onClick"];
@@ -1121,7 +1107,7 @@ const _hoisted_5$4 = {
1121
1107
  };
1122
1108
  const _hoisted_6$3 = ["title"];
1123
1109
  const _hoisted_7$3 = { class: "bm-fc-select-material-temp__content__item-time" };
1124
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1110
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1125
1111
  __name: "select-material-temp",
1126
1112
  props: [
1127
1113
  "visible",
@@ -1312,7 +1298,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1312
1298
  span: 6
1313
1299
  }, {
1314
1300
  default: withCtx(() => [
1315
- createElementVNode("div", _hoisted_1$5, [
1301
+ createElementVNode("div", _hoisted_1$6, [
1316
1302
  createElementVNode("div", _hoisted_2$5, [
1317
1303
  item.coverPlanUrl ? (openBlock(), createElementBlock("img", {
1318
1304
  key: 0,
@@ -1367,7 +1353,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1367
1353
  };
1368
1354
  }
1369
1355
  });
1370
- var SelectMaterialTemp = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "select-material-temp.vue"]]);
1356
+ var SelectMaterialTemp = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "select-material-temp.vue"]]);
1371
1357
 
1372
1358
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1373
1359
 
@@ -18572,7 +18558,7 @@ var lodash = {exports: {}};
18572
18558
  }.call(commonjsGlobal));
18573
18559
  }(lodash, lodash.exports));
18574
18560
 
18575
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
18561
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
18576
18562
  __name: "product-input-in-table",
18577
18563
  props: ["value", "disabled", "shopValue"],
18578
18564
  emits: ["change"],
@@ -18609,9 +18595,127 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
18609
18595
  };
18610
18596
  }
18611
18597
  });
18612
- var ProductInput = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "product-input-in-table.vue"]]);
18598
+ var ProductInput = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "product-input-in-table.vue"]]);
18599
+
18600
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
18601
+ __name: "customer-input-in-table",
18602
+ props: ["value", "disabled", "shopValue"],
18603
+ emits: ["change"],
18604
+ setup(__props, { emit: emits }) {
18605
+ const props = __props;
18606
+ const debounceFn = lodash.exports.debounce(emitChange, 500);
18607
+ const inputValue = ref();
18608
+ function emitChange(val) {
18609
+ emits("change", val);
18610
+ }
18611
+ watch(
18612
+ () => props.value,
18613
+ (val) => {
18614
+ inputValue.value = val;
18615
+ },
18616
+ {
18617
+ immediate: true
18618
+ }
18619
+ );
18620
+ watch(
18621
+ () => props.shopValue,
18622
+ () => {
18623
+ emitChange("");
18624
+ }
18625
+ );
18626
+ return (_ctx, _cache) => {
18627
+ return openBlock(), createBlock(unref(Input), {
18628
+ value: inputValue.value,
18629
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
18630
+ placeholder: "\u8BF7\u8F93\u5165",
18631
+ disabled: __props.disabled,
18632
+ onChange: _cache[1] || (_cache[1] = ($event) => unref(debounceFn)($event.target.value))
18633
+ }, null, 8, ["value", "disabled"]);
18634
+ };
18635
+ }
18636
+ });
18637
+ var CustomerInput = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "customer-input-in-table.vue"]]);
18638
+
18639
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
18640
+ __name: "shop-input-in-table",
18641
+ props: ["value", "disabled", "fetch", "dataFiltering"],
18642
+ emits: ["change"],
18643
+ setup(__props, { emit: emits }) {
18644
+ const props = __props;
18645
+ const keyword = ref("");
18646
+ const debounceFetch = lodash.exports.debounce((value) => {
18647
+ props.fetch.fetch(
18648
+ {
18649
+ keyword: keyword.value,
18650
+ filterByUser: props.dataFiltering
18651
+ }
18652
+ ).then((data) => {
18653
+ if (value === keyword.value)
18654
+ options.value = data;
18655
+ });
18656
+ }, 300);
18657
+ const options = ref([]);
18658
+ const fieldNames = {
18659
+ label: "name",
18660
+ value: "code",
18661
+ channelName: "channelName",
18662
+ platformName: "platformName",
18663
+ channelTypeName: "channelTypeName"
18664
+ };
18665
+ const inputValue = ref();
18666
+ function handleSearch(value) {
18667
+ keyword.value = value;
18668
+ debounceFetch(value);
18669
+ }
18670
+ function handleChangeConfirm(val, option) {
18671
+ handleChange(val, option);
18672
+ }
18673
+ function handleChange(val, option) {
18674
+ console.log("emit\u6570\u636E", option);
18675
+ emits(
18676
+ "change",
18677
+ option ? {
18678
+ [fieldNames.value]: option.value,
18679
+ [fieldNames.label]: option.label,
18680
+ ...option
18681
+ } : void 0
18682
+ );
18683
+ }
18684
+ watch(
18685
+ () => props.value,
18686
+ (val) => {
18687
+ inputValue.value = val;
18688
+ },
18689
+ {
18690
+ immediate: true
18691
+ }
18692
+ );
18693
+ debounceFetch("");
18694
+ return (_ctx, _cache) => {
18695
+ return openBlock(), createElementBlock(Fragment, null, [
18696
+ createCommentVNode(' <Input\n v-model:value="inputValue"\n placeholder="\u8BF7\u8F93\u5165"\n :disabled="disabled"\n @change="debounceFn($event.target.value)"\n ></Input> '),
18697
+ createVNode(unref(Select), {
18698
+ value: __props.value,
18699
+ placeholder: "\u8BF7\u9009\u62E9",
18700
+ "show-search": "",
18701
+ "show-arrow": false,
18702
+ "default-active-first-option": false,
18703
+ "filter-option": false,
18704
+ "not-found-content": null,
18705
+ options: options.value,
18706
+ "get-popup-container": unref(getContainer),
18707
+ disabled: __props.disabled,
18708
+ "allow-clear": "",
18709
+ onChange: handleChangeConfirm,
18710
+ onSearch: handleSearch
18711
+ }, null, 8, ["value", "options", "get-popup-container", "disabled"])
18712
+ ], 2112);
18713
+ };
18714
+ }
18715
+ });
18716
+ var ShopInput = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "shop-input-in-table.vue"]]);
18613
18717
 
18614
- const _hoisted_1$4 = { class: "bm-dc-table-widget" };
18718
+ const _hoisted_1$5 = { class: "bm-dc-table-widget" };
18615
18719
  const _hoisted_2$4 = { class: "bm-dc-table-widget__title" };
18616
18720
  const _hoisted_3$3 = { class: "bm-dc-table-widget__title-samll" };
18617
18721
  const _hoisted_4$3 = { class: "bm-dc-table-widget__top-bar" };
@@ -18630,18 +18734,32 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18630
18734
  setup(__props, { emit: emits }) {
18631
18735
  const props = __props;
18632
18736
  dayjs.extend(customParseFormat);
18633
- const productInfoKeyMap = {
18737
+ const accosiationParseKeyMap = {
18634
18738
  \u5546\u54C1\u540D\u79F0: "productName",
18635
18739
  \u5546\u54C1\u7B80\u79F0: "productShortName",
18636
18740
  \u5546\u54C1\u56FE\u7247: "picUrl",
18637
18741
  \u5EFA\u8BAE\u96F6\u552E\u4EF7: "retailPrice",
18638
18742
  \u5546\u54C1\u7BB1\u89C4: "carton",
18639
- \u5546\u54C1\u5355\u4F4D: "unit"
18743
+ \u5546\u54C1\u5355\u4F4D: "unit",
18744
+ \u5E97\u94FA\u6240\u5C5E\u5E73\u53F0: "platformName",
18745
+ \u6E20\u9053: "channelName",
18746
+ \u6E20\u9053\u7C7B\u522B: "channelTypeName",
18747
+ \u5BA2\u6237\u7B80\u79F0: "",
18748
+ \u5BA2\u6237\u7C7B\u578B: "",
18749
+ \u5BA2\u6237\u7B49\u7EA7: "",
18750
+ \u6240\u5C5E\u5E97\u94FA: "",
18751
+ \u5E97\u94FA\u7F16\u53F7: "",
18752
+ SAP\u5BA2\u6237\u7F16\u53F7: ""
18753
+ };
18754
+ let indexMap = {
18755
+ product: 0,
18756
+ shop: 0,
18757
+ customer: 0
18640
18758
  };
18641
- let productIndex = 0;
18642
18759
  const oper = "oper";
18643
18760
  const bmFloatTableRef = ref();
18644
18761
  const importFeature = computed(() => isShow("import"));
18762
+ const exportFeature = computed(() => isShow("export"));
18645
18763
  const deleteFeature = computed(() => isShow("delete"));
18646
18764
  const copyFeature = computed(() => isShow("copy"));
18647
18765
  const columns = reactive([]);
@@ -18691,6 +18809,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18691
18809
  }, {}) || {}
18692
18810
  );
18693
18811
  const productInputSlots = reactive([]);
18812
+ const shopInputSlots = reactive([]);
18813
+ const customerInputSlots = reactive([]);
18694
18814
  const formData = computed(
18695
18815
  () => props.formData || props.formCreateInject.api.bind()
18696
18816
  );
@@ -18701,6 +18821,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18701
18821
  columns.splice(0, columns.length);
18702
18822
  data.splice(0, data.length);
18703
18823
  productInputSlots.splice(0, productInputSlots.length);
18824
+ shopInputSlots.splice(0, shopInputSlots.length);
18825
+ customerInputSlots.splice(0, customerInputSlots.length);
18704
18826
  const childRules = cloneDeep(props.rule.config.childRules);
18705
18827
  const value = props.rule.value;
18706
18828
  if (deleteFeature.value && !props.hidden) {
@@ -18715,8 +18837,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18715
18837
  return pre;
18716
18838
  }
18717
18839
  const name = cur.name;
18718
- if (name === "product") {
18719
- pre.push(...getProductColumn(cur));
18840
+ if (Object.keys(indexMap).includes(name)) {
18841
+ pre.push(...getExtraColumns(cur));
18720
18842
  } else {
18721
18843
  pre.push(ruleList[name].tableRule(cur, props.extraConfig));
18722
18844
  }
@@ -18748,15 +18870,26 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18748
18870
  function productPicName(value, field) {
18749
18871
  return `${value}-${field}`;
18750
18872
  }
18751
- function getProductColumn(rule) {
18752
- const productName = `\u5546\u54C1${String(++productIndex).padStart(2, "0")}`;
18873
+ function getExtraColumns(rule) {
18874
+ const configObj = {
18875
+ shop: {
18876
+ prefix: "\u5E97\u94FA",
18877
+ slots: shopInputSlots
18878
+ },
18879
+ product: { prefix: "\u5546\u54C1", slots: productInputSlots },
18880
+ customer: { prefix: "\u5BA2\u6237", slots: customerInputSlots }
18881
+ }[rule.name];
18882
+ const mainName = `${configObj.prefix}${String(++indexMap[rule.name]).padStart(
18883
+ 2,
18884
+ "0"
18885
+ )}`;
18753
18886
  const field = rule.field;
18754
18887
  const associatedFields = rule.config.associatedFields;
18755
- productInputSlots.push(rule);
18888
+ configObj.slots.push(rule);
18756
18889
  const columns2 = [
18757
18890
  {
18758
18891
  field,
18759
- title: `\u5546\u54C1\u7F16\u7801-${productName}`,
18892
+ title: rule.name === "product" ? `\u5546\u54C1\u7F16\u7801-${mainName}` : `${mainName}`,
18760
18893
  headerClassName: rule.effect.required ? "is-required" : "",
18761
18894
  minWidth: "138px",
18762
18895
  slots: {
@@ -18769,7 +18902,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18769
18902
  const childField = productPicName(item.value, field);
18770
18903
  columns2.push({
18771
18904
  field: childField,
18772
- title: `${item.label}-${productName}`,
18905
+ title: `${item.label}-${mainName}`,
18773
18906
  minWidth: "138px",
18774
18907
  slots: {
18775
18908
  default({ row }) {
@@ -18833,6 +18966,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18833
18966
  inputRef.value.click();
18834
18967
  }
18835
18968
  }
18969
+ function handleExport() {
18970
+ xGrid.value.exportData({
18971
+ mode: "all",
18972
+ columnFilterMethod({ column }) {
18973
+ return isValidColumn(column);
18974
+ }
18975
+ });
18976
+ }
18836
18977
  function emitChange() {
18837
18978
  emits("change", data);
18838
18979
  }
@@ -18861,7 +19002,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18861
19002
  function processAssociatedFields(field, associatedFields, row, result) {
18862
19003
  if (associatedFields.length)
18863
19004
  associatedFields.forEach((item) => {
18864
- row[productPicName(item.value, field)] = result ? result[productInfoKeyMap[item.value]] : void 0;
19005
+ row[productPicName(item.value, field)] = result ? result[accosiationParseKeyMap[item.value]] : void 0;
18865
19006
  });
18866
19007
  }
18867
19008
  function handleChange(e) {
@@ -18914,12 +19055,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18914
19055
  const validColumns = columns.filter((c) => isValidColumn(c));
18915
19056
  for (const row of rowData) {
18916
19057
  for (const { field } of validColumns) {
18917
- const rule = childRulesMap.value[field];
19058
+ const rule = childRulesMap.value[`${field}`];
18918
19059
  const title = rule?.title?.title;
18919
19060
  if (!rule)
18920
19061
  continue;
18921
19062
  const fieldNames = props.extraConfig[rule.name]?.fieldNames;
18922
- let value = row[field] || "";
19063
+ let value = row[`${field}`] || "";
18923
19064
  const txtFormatFn = rule.config?.txtFormatFn;
18924
19065
  if (!value) {
18925
19066
  if (rule.effect.required && rule.name !== "materialType") {
@@ -19072,7 +19213,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19072
19213
  break;
19073
19214
  }
19074
19215
  }
19075
- row[field] = value;
19216
+ row[`${field}`] = value;
19076
19217
  }
19077
19218
  if (error)
19078
19219
  break;
@@ -19095,6 +19236,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19095
19236
  row[rule.field] = value;
19096
19237
  queryProductInfo(rule, row);
19097
19238
  }
19239
+ function handleShopOption(value, rule, row) {
19240
+ row[rule?.field] = value;
19241
+ processAssociatedFields(
19242
+ rule?.field,
19243
+ rule?.config?.associatedFields,
19244
+ row,
19245
+ value
19246
+ );
19247
+ }
19098
19248
  function importDisabled() {
19099
19249
  return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]);
19100
19250
  }
@@ -19117,12 +19267,23 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19117
19267
  }
19118
19268
  );
19119
19269
  return (_ctx, _cache) => {
19120
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
19270
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
19121
19271
  createElementVNode("div", _hoisted_2$4, [
19122
19272
  createTextVNode(toDisplayString(__props.rule.title.title) + " ", 1),
19123
19273
  createElementVNode("span", _hoisted_3$3, toDisplayString(unref(countText)), 1),
19124
19274
  createElementVNode("div", _hoisted_4$3, [
19125
- unref(importFeature) && !__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
19275
+ unref(exportFeature) && !__props.hidden ? (openBlock(), createBlock(unref(Button), {
19276
+ key: 0,
19277
+ disabled: __props.disabled,
19278
+ onClick: handleExport
19279
+ }, {
19280
+ default: withCtx(() => [
19281
+ createTextVNode("\u5BFC\u51FA")
19282
+ ]),
19283
+ _: 1
19284
+ }, 8, ["disabled"])) : createCommentVNode("v-if", true),
19285
+ createTextVNode("\xA0 "),
19286
+ unref(importFeature) && !__props.hidden ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
19126
19287
  createElementVNode("input", {
19127
19288
  ref_key: "inputRef",
19128
19289
  ref: inputRef,
@@ -19152,7 +19313,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19152
19313
  }, 8, ["disabled"])
19153
19314
  ], 64)) : createCommentVNode("v-if", true),
19154
19315
  unref(deleteFeature) && !__props.hidden ? (openBlock(), createBlock(unref(Button), {
19155
- key: 1,
19316
+ key: 2,
19156
19317
  disabled: __props.disabled,
19157
19318
  onClick: handleBatchDelete
19158
19319
  }, {
@@ -19162,7 +19323,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19162
19323
  _: 1
19163
19324
  }, 8, ["disabled"])) : createCommentVNode("v-if", true),
19164
19325
  !__props.hidden ? (openBlock(), createBlock(unref(Button), {
19165
- key: 2,
19326
+ key: 3,
19166
19327
  type: "primary",
19167
19328
  disabled: __props.disabled,
19168
19329
  onClick: handleAdd
@@ -19224,6 +19385,33 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19224
19385
  }, null, 8, ["value", "disabled", "shop-value", "onChange"])
19225
19386
  ])
19226
19387
  };
19388
+ }),
19389
+ renderList(shopInputSlots, (item) => {
19390
+ return {
19391
+ name: item.field,
19392
+ fn: withCtx(({ row }) => [
19393
+ createCommentVNode(" {{ item }} "),
19394
+ createVNode(ShopInput, {
19395
+ value: row[item.field],
19396
+ fetch: __props.extraConfig?.shop,
19397
+ "data-filtering": item?.config?.dataFiltering,
19398
+ onChange: ($event) => handleShopOption($event, item, row)
19399
+ }, null, 8, ["value", "fetch", "data-filtering", "onChange"])
19400
+ ])
19401
+ };
19402
+ }),
19403
+ renderList(customerInputSlots, (item) => {
19404
+ return {
19405
+ name: item.field,
19406
+ fn: withCtx(({ row }) => [
19407
+ createVNode(CustomerInput, {
19408
+ value: row[item.field],
19409
+ disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
19410
+ "shop-value": unref(formData)[item.config.dataFiltering],
19411
+ onChange: ($event) => handlePressEnter($event, item, row)
19412
+ }, null, 8, ["value", "disabled", "shop-value", "onChange"])
19413
+ ])
19414
+ };
19227
19415
  })
19228
19416
  ]), 1032, ["config"])
19229
19417
  ]),
@@ -19236,7 +19424,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19236
19424
  });
19237
19425
  var TableWidget = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "table-widget.vue"]]);
19238
19426
 
19239
- const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("span", { class: "bm-fc-form-item-label is-required" }, "\u7D20\u6750\u6A21\u677F\uFF1A", -1);
19427
+ const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("span", { class: "bm-fc-form-item-label is-required" }, "\u7D20\u6750\u6A21\u677F\uFF1A", -1);
19240
19428
  const _hoisted_2$3 = { key: 0 };
19241
19429
  const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("span", { class: "bm-fc-form-item-label" }, "\u7D20\u6750\u7C7B\u578B\uFF1A", -1);
19242
19430
  const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("span", { class: "bm-fc-form-item-label" }, "\u5C3A\u5BF8\uFF1A", -1);
@@ -19572,7 +19760,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
19572
19760
  default: withCtx(() => [
19573
19761
  createVNode(unref(Col), null, {
19574
19762
  default: withCtx(() => [
19575
- _hoisted_1$3
19763
+ _hoisted_1$4
19576
19764
  ]),
19577
19765
  _: 1
19578
19766
  }),
@@ -19864,7 +20052,7 @@ var materialTemp = {
19864
20052
  },
19865
20053
  };
19866
20054
 
19867
- const _hoisted_1$2 = { class: "bm-fc-form-item-label" };
20055
+ const _hoisted_1$3 = { class: "bm-fc-form-item-label" };
19868
20056
  const _hoisted_2$2 = ["src"];
19869
20057
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
19870
20058
  __name: "product-info",
@@ -19996,7 +20184,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
19996
20184
  default: withCtx(() => [
19997
20185
  createVNode(unref(Col), null, {
19998
20186
  default: withCtx(() => [
19999
- createElementVNode("span", _hoisted_1$2, toDisplayString(field.label) + "\uFF1A", 1)
20187
+ createElementVNode("span", _hoisted_1$3, toDisplayString(field.label) + "\uFF1A", 1)
20000
20188
  ]),
20001
20189
  _: 2
20002
20190
  }, 1024),
@@ -20098,6 +20286,7 @@ var product = {
20098
20286
  },
20099
20287
  };
20100
20288
 
20289
+ const _hoisted_1$2 = { class: "bm-fc-form-item-label" };
20101
20290
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
20102
20291
  __name: "shop-widget",
20103
20292
  props: [
@@ -20106,14 +20295,20 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
20106
20295
  "dataFiltering",
20107
20296
  "disabled",
20108
20297
  "formCreateInject",
20109
- "fdRule"
20298
+ "fdRule",
20299
+ "required",
20300
+ "title",
20301
+ "associatedFields"
20110
20302
  ],
20111
20303
  emits: ["change"],
20112
20304
  setup(__props, { emit: emits }) {
20113
20305
  const props = __props;
20114
20306
  const fieldNames = props.extraConfig.fieldNames || {
20115
20307
  label: "name",
20116
- value: "code"
20308
+ value: "code",
20309
+ channelName: "channelName",
20310
+ platformName: "platformName",
20311
+ channelTypeName: "channelTypeName"
20117
20312
  };
20118
20313
  const options = ref([]);
20119
20314
  const keyword = ref("");
@@ -20179,23 +20374,99 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
20179
20374
  keyword.value = value;
20180
20375
  debounceFetch(value);
20181
20376
  }
20377
+ const shopInfoKeyMap = {
20378
+ \u5E97\u94FA\u6240\u5C5E\u5E73\u53F0: "platformName",
20379
+ \u6E20\u9053: "channelName",
20380
+ \u6E20\u9053\u7C7B\u522B: "channelTypeName"
20381
+ };
20382
+ function getValue(value) {
20383
+ const parse = shopInfoKeyMap[value];
20384
+ return props.formCreateInject?.rule?.value?.[parse];
20385
+ }
20182
20386
  initOptions();
20183
20387
  return (_ctx, _cache) => {
20184
- return openBlock(), createBlock(unref(Select), {
20185
- value: __props.formCreateInject?.rule?.value?.value || __props.value?.value,
20186
- placeholder: "\u8BF7\u9009\u62E9",
20187
- "show-search": "",
20188
- "show-arrow": false,
20189
- "default-active-first-option": false,
20190
- "filter-option": false,
20191
- "not-found-content": null,
20192
- options: options.value,
20193
- "get-popup-container": unref(getContainer),
20194
- disabled: __props.disabled,
20195
- "allow-clear": "",
20196
- onChange: handleChangeConfirm,
20197
- onSearch: handleSearch
20198
- }, null, 8, ["value", "options", "get-popup-container", "disabled"]);
20388
+ return openBlock(), createBlock(unref(Row), { gutter: [0, 24] }, {
20389
+ default: withCtx(() => [
20390
+ createVNode(unref(Col), {
20391
+ span: __props.associatedFields?.length ? 8 : 24
20392
+ }, {
20393
+ default: withCtx(() => [
20394
+ createVNode(unref(Row), null, {
20395
+ default: withCtx(() => [
20396
+ createVNode(unref(Col), null, {
20397
+ default: withCtx(() => [
20398
+ createElementVNode("span", {
20399
+ class: normalizeClass([
20400
+ "bm-fc-form-item-label",
20401
+ props.required ? "is-required" : ""
20402
+ ])
20403
+ }, toDisplayString(__props.title) + "\uFF1A", 3)
20404
+ ]),
20405
+ _: 1
20406
+ }),
20407
+ createVNode(unref(Col), { flex: 1 }, {
20408
+ default: withCtx(() => [
20409
+ createVNode(unref(Select), {
20410
+ value: __props.formCreateInject?.rule?.value?.value || __props.value?.value,
20411
+ placeholder: "\u8BF7\u9009\u62E9",
20412
+ "show-search": "",
20413
+ "show-arrow": false,
20414
+ "default-active-first-option": false,
20415
+ "filter-option": false,
20416
+ "not-found-content": null,
20417
+ options: options.value,
20418
+ "get-popup-container": unref(getContainer),
20419
+ disabled: __props.disabled,
20420
+ "allow-clear": "",
20421
+ onChange: handleChangeConfirm,
20422
+ onSearch: handleSearch
20423
+ }, null, 8, ["value", "options", "get-popup-container", "disabled"])
20424
+ ]),
20425
+ _: 1
20426
+ })
20427
+ ]),
20428
+ _: 1
20429
+ })
20430
+ ]),
20431
+ _: 1
20432
+ }, 8, ["span"]),
20433
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.associatedFields, (field2) => {
20434
+ return openBlock(), createBlock(unref(Col), {
20435
+ key: field2.value,
20436
+ span: 8
20437
+ }, {
20438
+ default: withCtx(() => [
20439
+ createVNode(unref(Row), null, {
20440
+ default: withCtx(() => [
20441
+ createVNode(unref(Col), null, {
20442
+ default: withCtx(() => [
20443
+ createElementVNode("span", _hoisted_1$2, toDisplayString(field2.label) + "\uFF1A", 1)
20444
+ ]),
20445
+ _: 2
20446
+ }, 1024),
20447
+ createVNode(unref(Col), {
20448
+ class: "bm-fc-form-item",
20449
+ flex: 1
20450
+ }, {
20451
+ default: withCtx(() => [
20452
+ getValue(field2.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
20453
+ createTextVNode(toDisplayString(getValue(field2.value)), 1)
20454
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
20455
+ createTextVNode("\u7CFB\u7EDF\u81EA\u52A8\u5E26\u51FA")
20456
+ ], 64))
20457
+ ]),
20458
+ _: 2
20459
+ }, 1024)
20460
+ ]),
20461
+ _: 2
20462
+ }, 1024)
20463
+ ]),
20464
+ _: 2
20465
+ }, 1024);
20466
+ }), 128))
20467
+ ]),
20468
+ _: 1
20469
+ });
20199
20470
  };
20200
20471
  }
20201
20472
  });
@@ -20209,14 +20480,16 @@ var shop = {
20209
20480
  return {
20210
20481
  type: 'ShopWidget',
20211
20482
  component: ShopWidget,
20212
- title: `${data.title.title}${data.config.isMain ? '(主控件)' : ''}`,
20213
20483
  field: data.field,
20214
20484
  effect: {
20215
20485
  required: data.effect.required && '请选择店铺',
20216
20486
  },
20217
20487
  props: {
20218
20488
  dataFiltering: (_a = data.config) === null || _a === void 0 ? void 0 : _a.dataFiltering,
20489
+ associatedFields: data.config.associatedFields,
20219
20490
  extraConfig: shopExtraConfig,
20491
+ required: data.effect.required,
20492
+ title: `${data.title.title}${data.config.isMain ? '(主控件)' : ''}`,
20220
20493
  },
20221
20494
  inject: true,
20222
20495
  on: {
@@ -20866,11 +21139,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20866
21139
  "extraConfig",
20867
21140
  "value",
20868
21141
  "info",
20869
- "formPermissions"
21142
+ "formPermissions",
21143
+ "resolveRulesConfig"
20870
21144
  ],
20871
21145
  emits: ["update:value"],
20872
21146
  setup(__props, { expose, emit: emits }) {
20873
21147
  const props = __props;
21148
+ const formRuleList = computed(() => {
21149
+ if (typeof props.resolveRulesConfig === "function") {
21150
+ const rules = props.resolveRulesConfig(ruleList);
21151
+ if (!rules) {
21152
+ throw new Error("resolveRulesConfig\u9700\u8FD4\u56DErules\u89E3\u6790\u5BF9\u8C61");
21153
+ }
21154
+ return props.resolveRulesConfig(ruleList) || {};
21155
+ }
21156
+ return ruleList;
21157
+ });
20874
21158
  const option = computed(() => ({
20875
21159
  wrap: {
20876
21160
  labelCol: {
@@ -20909,12 +21193,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20909
21193
  function makeRule(fdRule) {
20910
21194
  return fdRule.map((data) => {
20911
21195
  const childRules = data?.config?.childRules;
20912
- const rule2 = ruleList[data.name].rule(data, props.extraConfig);
21196
+ const rule2 = formRuleList.value[data.name]?.rule(data, props.extraConfig);
21197
+ if (!rule2) {
21198
+ console.error(`\u672A\u914D\u7F6Erule \u3010${data.name}\u3011\u89E3\u6790\u5BF9\u8C61`);
21199
+ return null;
21200
+ }
20913
21201
  if (data.name === "row" && childRules?.length) {
20914
21202
  const rowRule = rule2.children.find((item) => item.type === "row");
20915
21203
  childRules.forEach((ruleItem) => {
20916
21204
  rowRule.children.push(
20917
- ruleList[ruleItem.name].rowRule(ruleItem, props.extraConfig)
21205
+ formRuleList.value[ruleItem.name]?.rowRule(
21206
+ ruleItem,
21207
+ props.extraConfig
21208
+ )
20918
21209
  );
20919
21210
  });
20920
21211
  }
@@ -20978,7 +21269,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20978
21269
  }
20979
21270
  }
20980
21271
  function getFormFeildRule(rule2) {
20981
- if (rule2.native) {
21272
+ if (rule2?.native) {
20982
21273
  return rule2.children.find((item) => item.field);
20983
21274
  } else
20984
21275
  return rule2;