bm-admin-ui 1.1.13-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.
@@ -18975,10 +18975,25 @@ const _sfc_main$7 = defineComponent({
18975
18975
  const field = rule.field;
18976
18976
  const associatedFields = rule.config.associatedFields;
18977
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
+ }
18978
18993
  const columns2 = [
18979
18994
  {
18980
18995
  field,
18981
- title: rule.name === "product" ? `\u5546\u54C1\u7F16\u7801-${mainName}` : `${mainName}`,
18996
+ title: getBaseTitle(),
18982
18997
  headerClassName: rule.effect.required ? "is-required" : "",
18983
18998
  minWidth: "138px",
18984
18999
  slots: {
@@ -18986,9 +19001,6 @@ const _sfc_main$7 = defineComponent({
18986
19001
  }
18987
19002
  }
18988
19003
  ];
18989
- if (isProductCenterSuit.value && rule.name === "product") {
18990
- columns2[0].title = "\u5546\u54C1\u7F16\u53F7";
18991
- }
18992
19004
  if (associatedFields.length) {
18993
19005
  associatedFields.forEach((item) => {
18994
19006
  const childField = productPicName(item.value, field);
@@ -19471,6 +19483,7 @@ const _sfc_main$7 = defineComponent({
19471
19483
  buttonLoadingForProductCenter.value.download = true;
19472
19484
  await props.extraConfig.table?.downloadTemplateFetch?.({
19473
19485
  tableConfig: tableConfig.value,
19486
+ tableRules: props.rule.config.childRules,
19474
19487
  columns: validColumns.value
19475
19488
  });
19476
19489
  } catch (error) {
@@ -19485,8 +19498,18 @@ const _sfc_main$7 = defineComponent({
19485
19498
  }
19486
19499
  try {
19487
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
+ });
19488
19510
  let res = await props.extraConfig.table?.importFetch?.({
19489
19511
  tableConfig: tableConfig.value,
19512
+ tableRules,
19490
19513
  columns: validColumns.value,
19491
19514
  filterByShopcode: props.rule?.config?.dataFiltering,
19492
19515
  dataFile: e.target.files?.[0]
@@ -20387,14 +20410,19 @@ var materialTemp = {
20387
20410
  validate: [
20388
20411
  {
20389
20412
  validator(rule, value) {
20413
+ var _a, _b, _c;
20390
20414
  if (isNull(value)) {
20391
20415
  return Promise.reject();
20392
20416
  }
20393
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;
20394
20419
  for (const pane of panes) {
20395
20420
  if (!pane.tempIdSelected) {
20396
20421
  return Promise.reject();
20397
20422
  }
20423
+ if (requiredPicture && !((_c = pane.uploadList) === null || _c === void 0 ? void 0 : _c.length)) {
20424
+ return Promise.reject();
20425
+ }
20398
20426
  if (pane.tableRequiredFields) {
20399
20427
  for (const field of pane.tableRequiredFields) {
20400
20428
  if (pane.tableData.some((row) => isNull(row[field]))) {
@@ -18989,10 +18989,25 @@ const _sfc_main$7 = vue.defineComponent({
18989
18989
  const field = rule.field;
18990
18990
  const associatedFields = rule.config.associatedFields;
18991
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
+ }
18992
19007
  const columns2 = [
18993
19008
  {
18994
19009
  field,
18995
- title: rule.name === "product" ? `\u5546\u54C1\u7F16\u7801-${mainName}` : `${mainName}`,
19010
+ title: getBaseTitle(),
18996
19011
  headerClassName: rule.effect.required ? "is-required" : "",
18997
19012
  minWidth: "138px",
18998
19013
  slots: {
@@ -19000,9 +19015,6 @@ const _sfc_main$7 = vue.defineComponent({
19000
19015
  }
19001
19016
  }
19002
19017
  ];
19003
- if (isProductCenterSuit.value && rule.name === "product") {
19004
- columns2[0].title = "\u5546\u54C1\u7F16\u53F7";
19005
- }
19006
19018
  if (associatedFields.length) {
19007
19019
  associatedFields.forEach((item) => {
19008
19020
  const childField = productPicName(item.value, field);
@@ -19485,6 +19497,7 @@ const _sfc_main$7 = vue.defineComponent({
19485
19497
  buttonLoadingForProductCenter.value.download = true;
19486
19498
  await props.extraConfig.table?.downloadTemplateFetch?.({
19487
19499
  tableConfig: tableConfig.value,
19500
+ tableRules: props.rule.config.childRules,
19488
19501
  columns: validColumns.value
19489
19502
  });
19490
19503
  } catch (error) {
@@ -19499,8 +19512,18 @@ const _sfc_main$7 = vue.defineComponent({
19499
19512
  }
19500
19513
  try {
19501
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
+ });
19502
19524
  let res = await props.extraConfig.table?.importFetch?.({
19503
19525
  tableConfig: tableConfig.value,
19526
+ tableRules,
19504
19527
  columns: validColumns.value,
19505
19528
  filterByShopcode: props.rule?.config?.dataFiltering,
19506
19529
  dataFile: e.target.files?.[0]
@@ -20401,14 +20424,19 @@ var materialTemp = {
20401
20424
  validate: [
20402
20425
  {
20403
20426
  validator(rule, value) {
20427
+ var _a, _b, _c;
20404
20428
  if (isNull.isNull(value)) {
20405
20429
  return Promise.reject();
20406
20430
  }
20407
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;
20408
20433
  for (const pane of panes) {
20409
20434
  if (!pane.tempIdSelected) {
20410
20435
  return Promise.reject();
20411
20436
  }
20437
+ if (requiredPicture && !((_c = pane.uploadList) === null || _c === void 0 ? void 0 : _c.length)) {
20438
+ return Promise.reject();
20439
+ }
20412
20440
  if (pane.tableRequiredFields) {
20413
20441
  for (const field of pane.tableRequiredFields) {
20414
20442
  if (pane.tableData.some((row) => isNull.isNull(row[field]))) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bm-admin-ui",
3
- "version": "1.1.13-alpha",
3
+ "version": "1.1.14-alpha",
4
4
  "private": false,
5
5
  "description": "An Admin Component Library for Bm",
6
6
  "license": "UNLICENSED",