@cniot/mdd-editor 0.2.0-beta.6 → 0.2.0-beta.8

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.
package/build/index.es.js CHANGED
@@ -1430,7 +1430,7 @@ function object2Array(obj, pre = "") {
1430
1430
  };
1431
1431
  }).flat(Infinity);
1432
1432
  }
1433
- class TableSchema$1 extends JSONWatch {
1433
+ class TableSchema$2 extends JSONWatch {
1434
1434
  constructor(props) {
1435
1435
  const {
1436
1436
  columns = [],
@@ -1558,103 +1558,132 @@ class HeaderToolbar$1 extends JSONWatch {
1558
1558
  return this.data || [];
1559
1559
  }
1560
1560
  }
1561
- /*! js-cookie v3.0.5 | MIT */
1562
- function assign(target) {
1563
- for (var i = 1; i < arguments.length; i++) {
1564
- var source = arguments[i];
1565
- for (var key in source) {
1566
- target[key] = source[key];
1567
- }
1568
- }
1569
- return target;
1570
- }
1571
- var defaultConverter = {
1572
- read: function(value) {
1573
- if (value[0] === '"') {
1574
- value = value.slice(1, -1);
1575
- }
1576
- return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
1577
- },
1578
- write: function(value) {
1579
- return encodeURIComponent(value).replace(
1580
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
1581
- decodeURIComponent
1582
- );
1583
- }
1584
- };
1585
- function init$1(converter, defaultAttributes) {
1586
- function set(name, value, attributes) {
1587
- if (typeof document === "undefined") {
1588
- return;
1589
- }
1590
- attributes = assign({}, defaultAttributes, attributes);
1591
- if (typeof attributes.expires === "number") {
1592
- attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
1593
- }
1594
- if (attributes.expires) {
1595
- attributes.expires = attributes.expires.toUTCString();
1561
+ var js_cookie = { exports: {} };
1562
+ /*!
1563
+ * JavaScript Cookie v2.2.1
1564
+ * https://github.com/js-cookie/js-cookie
1565
+ *
1566
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
1567
+ * Released under the MIT license
1568
+ */
1569
+ (function(module, exports) {
1570
+ (function(factory) {
1571
+ var registeredInModuleLoader;
1572
+ {
1573
+ module.exports = factory();
1574
+ registeredInModuleLoader = true;
1575
+ }
1576
+ if (!registeredInModuleLoader) {
1577
+ var OldCookies = window.Cookies;
1578
+ var api = window.Cookies = factory();
1579
+ api.noConflict = function() {
1580
+ window.Cookies = OldCookies;
1581
+ return api;
1582
+ };
1596
1583
  }
1597
- name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
1598
- var stringifiedAttributes = "";
1599
- for (var attributeName in attributes) {
1600
- if (!attributes[attributeName]) {
1601
- continue;
1602
- }
1603
- stringifiedAttributes += "; " + attributeName;
1604
- if (attributes[attributeName] === true) {
1605
- continue;
1584
+ })(function() {
1585
+ function extend() {
1586
+ var i = 0;
1587
+ var result = {};
1588
+ for (; i < arguments.length; i++) {
1589
+ var attributes = arguments[i];
1590
+ for (var key in attributes) {
1591
+ result[key] = attributes[key];
1592
+ }
1606
1593
  }
1607
- stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
1594
+ return result;
1608
1595
  }
1609
- return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
1610
- }
1611
- function get2(name) {
1612
- if (typeof document === "undefined" || arguments.length && !name) {
1613
- return;
1596
+ function decode(s) {
1597
+ return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
1614
1598
  }
1615
- var cookies = document.cookie ? document.cookie.split("; ") : [];
1616
- var jar = {};
1617
- for (var i = 0; i < cookies.length; i++) {
1618
- var parts = cookies[i].split("=");
1619
- var value = parts.slice(1).join("=");
1620
- try {
1621
- var found = decodeURIComponent(parts[0]);
1622
- jar[found] = converter.read(value, found);
1623
- if (name === found) {
1624
- break;
1599
+ function init2(converter) {
1600
+ function api() {
1601
+ }
1602
+ function set(key, value, attributes) {
1603
+ if (typeof document === "undefined") {
1604
+ return;
1625
1605
  }
1626
- } catch (e) {
1606
+ attributes = extend({
1607
+ path: "/"
1608
+ }, api.defaults, attributes);
1609
+ if (typeof attributes.expires === "number") {
1610
+ attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e5);
1611
+ }
1612
+ attributes.expires = attributes.expires ? attributes.expires.toUTCString() : "";
1613
+ try {
1614
+ var result = JSON.stringify(value);
1615
+ if (/^[\{\[]/.test(result)) {
1616
+ value = result;
1617
+ }
1618
+ } catch (e) {
1619
+ }
1620
+ value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
1621
+ key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
1622
+ var stringifiedAttributes = "";
1623
+ for (var attributeName in attributes) {
1624
+ if (!attributes[attributeName]) {
1625
+ continue;
1626
+ }
1627
+ stringifiedAttributes += "; " + attributeName;
1628
+ if (attributes[attributeName] === true) {
1629
+ continue;
1630
+ }
1631
+ stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
1632
+ }
1633
+ return document.cookie = key + "=" + value + stringifiedAttributes;
1627
1634
  }
1628
- }
1629
- return name ? jar[name] : jar;
1630
- }
1631
- return Object.create(
1632
- {
1633
- set,
1634
- get: get2,
1635
- remove: function(name, attributes) {
1636
- set(
1637
- name,
1638
- "",
1639
- assign({}, attributes, {
1640
- expires: -1
1641
- })
1642
- );
1643
- },
1644
- withAttributes: function(attributes) {
1645
- return init$1(this.converter, assign({}, this.attributes, attributes));
1646
- },
1647
- withConverter: function(converter2) {
1648
- return init$1(assign({}, this.converter, converter2), this.attributes);
1635
+ function get2(key, json) {
1636
+ if (typeof document === "undefined") {
1637
+ return;
1638
+ }
1639
+ var jar = {};
1640
+ var cookies = document.cookie ? document.cookie.split("; ") : [];
1641
+ var i = 0;
1642
+ for (; i < cookies.length; i++) {
1643
+ var parts = cookies[i].split("=");
1644
+ var cookie = parts.slice(1).join("=");
1645
+ if (!json && cookie.charAt(0) === '"') {
1646
+ cookie = cookie.slice(1, -1);
1647
+ }
1648
+ try {
1649
+ var name = decode(parts[0]);
1650
+ cookie = (converter.read || converter)(cookie, name) || decode(cookie);
1651
+ if (json) {
1652
+ try {
1653
+ cookie = JSON.parse(cookie);
1654
+ } catch (e) {
1655
+ }
1656
+ }
1657
+ jar[name] = cookie;
1658
+ if (key === name) {
1659
+ break;
1660
+ }
1661
+ } catch (e) {
1662
+ }
1663
+ }
1664
+ return key ? jar[key] : jar;
1649
1665
  }
1650
- },
1651
- {
1652
- attributes: { value: Object.freeze(defaultAttributes) },
1653
- converter: { value: Object.freeze(converter) }
1666
+ api.set = set;
1667
+ api.get = function(key) {
1668
+ return get2(key, false);
1669
+ };
1670
+ api.getJSON = function(key) {
1671
+ return get2(key, true);
1672
+ };
1673
+ api.remove = function(key, attributes) {
1674
+ set(key, "", extend(attributes, {
1675
+ expires: -1
1676
+ }));
1677
+ };
1678
+ api.defaults = {};
1679
+ api.withConverter = init2;
1680
+ return api;
1654
1681
  }
1655
- );
1656
- }
1657
- var api = init$1(defaultConverter, { path: "/" });
1682
+ return init2(function() {
1683
+ });
1684
+ });
1685
+ })(js_cookie);
1686
+ var Cookies = js_cookie.exports;
1658
1687
  const calcWordWidth = (str) => {
1659
1688
  const Min_Width = 50;
1660
1689
  if (!str || typeof str !== "string")
@@ -1674,7 +1703,7 @@ const upperFirst$1 = (str) => {
1674
1703
  return str.slice(0, 1).toUpperCase() + temp;
1675
1704
  };
1676
1705
  const getGlobalSizeFromCookie = () => {
1677
- return api == null ? void 0 : api.get("CNUICOOKIESIZE");
1706
+ return Cookies == null ? void 0 : Cookies.get("CNUICOOKIESIZE");
1678
1707
  };
1679
1708
  const getDefaultFomrLabelAlign = () => {
1680
1709
  const globalSize = getGlobalSizeFromCookie();
@@ -1971,29 +2000,29 @@ const openApi3Support = (apiInfo) => {
1971
2000
  responses: res
1972
2001
  };
1973
2002
  };
1974
- var buildSwaggerApiJson = (api2, apiMeta) => {
1975
- if (!api2 || !apiMeta) {
2003
+ var buildSwaggerApiJson = (api, apiMeta) => {
2004
+ if (!api || !apiMeta) {
1976
2005
  throw Error("mdd-tool columns complier error: api or api meta is null");
1977
2006
  }
1978
2007
  const { paths, definitions } = apiMeta || {};
1979
- if (!paths[api2]) {
1980
- throw Error(`mdd-tool columns complier error: api meta has not api: ${api2}`);
2008
+ if (!paths[api]) {
2009
+ throw Error(`mdd-tool columns complier error: api meta has not api: ${api}`);
1981
2010
  }
1982
2011
  let method = "";
1983
2012
  let apiInfo = null;
1984
- if (Object.prototype.hasOwnProperty.call(paths[api2], "post")) {
2013
+ if (Object.prototype.hasOwnProperty.call(paths[api], "post")) {
1985
2014
  method = "post";
1986
- apiInfo = paths[api2]["post"];
1987
- } else if (Object.prototype.hasOwnProperty.call(paths[api2], "get")) {
2015
+ apiInfo = paths[api]["post"];
2016
+ } else if (Object.prototype.hasOwnProperty.call(paths[api], "get")) {
1988
2017
  method = "get";
1989
- apiInfo = paths[api2]["get"];
2018
+ apiInfo = paths[api]["get"];
1990
2019
  } else {
1991
2020
  throw Error("mdd-tool columns complier error: api method not support");
1992
2021
  }
1993
2022
  const { summary } = apiInfo;
1994
2023
  const { parameters = [], responses } = openApi3Support(apiInfo);
1995
2024
  return {
1996
- api: api2,
2025
+ api,
1997
2026
  method,
1998
2027
  summary,
1999
2028
  parameters: transfer$refToJson("parameters", parameters, definitions),
@@ -2432,11 +2461,11 @@ function handleDefinitions(obj, map, depth) {
2432
2461
  function getSwaggerInfoFromJson(swaggerJson) {
2433
2462
  return jsonSchemaRefParser(transferOpenAPI3ToSwagger2$1(swaggerJson));
2434
2463
  }
2435
- function getApiInfo(api2, swaggerInfo) {
2464
+ function getApiInfo(api, swaggerInfo) {
2436
2465
  const realSwaggerInfo = jsonSchemaRefParser(transferOpenAPI3ToSwagger2$1(swaggerInfo));
2437
- return buildSwaggerApiJson(api2, realSwaggerInfo);
2466
+ return buildSwaggerApiJson(api, realSwaggerInfo);
2438
2467
  }
2439
- function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {}) {
2468
+ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}) {
2440
2469
  const { parameters = [], responses = [], method = "" } = apiInfo || {};
2441
2470
  const methodUpperCase = method.toUpperCase();
2442
2471
  const result = {
@@ -2459,8 +2488,8 @@ function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {
2459
2488
  tableColumns: "$RET.data.tableColumns",
2460
2489
  totalCount: "$RET.data.paging.totalCount"
2461
2490
  },
2462
- value: api2,
2463
- url: api2
2491
+ value: api,
2492
+ url: api
2464
2493
  },
2465
2494
  filter: {
2466
2495
  maxVisibleRow: 2,
@@ -2505,8 +2534,8 @@ function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {
2505
2534
  watch: [],
2506
2535
  params: {},
2507
2536
  formatResponseData: {},
2508
- value: api2,
2509
- url: api2
2537
+ value: api,
2538
+ url: api
2510
2539
  },
2511
2540
  initApi: [],
2512
2541
  effectApi: [],
@@ -2545,7 +2574,7 @@ function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {
2545
2574
  label: "\u57FA\u7840\u4FE1\u606F",
2546
2575
  source: [
2547
2576
  {
2548
- url: api2,
2577
+ url: api,
2549
2578
  method: methodUpperCase,
2550
2579
  type: "ajax",
2551
2580
  formatResponseData: {
@@ -2578,8 +2607,8 @@ function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {
2578
2607
  formatResponseData: {
2579
2608
  tableData: "$RET.data.tableData"
2580
2609
  },
2581
- value: api2,
2582
- url: api2
2610
+ value: api,
2611
+ url: api
2583
2612
  },
2584
2613
  submitApi: {
2585
2614
  type: "ajax",
@@ -2608,12 +2637,18 @@ function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {
2608
2637
  },
2609
2638
  headerToolbar: []
2610
2639
  };
2640
+ } else if (schemaType === "blocks-table") {
2641
+ result.type = "blocks";
2642
+ result.body = {
2643
+ type: "blocks-table",
2644
+ blocks: []
2645
+ };
2611
2646
  }
2612
2647
  return merge_1(result, extraSchema);
2613
2648
  }
2614
- function api2SchemaFromSwagger(api2, schemaType, swaggerInfo, extraSchema = {}) {
2615
- const apiInfo = getApiInfo(api2, swaggerInfo);
2616
- return api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema);
2649
+ function api2SchemaFromSwagger(api, schemaType, swaggerInfo, extraSchema = {}) {
2650
+ const apiInfo = getApiInfo(api, swaggerInfo);
2651
+ return api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema);
2617
2652
  }
2618
2653
  function transferOpenAPI3ToSwagger2$1(data) {
2619
2654
  if (data && data.components && data.components.schemas) {
@@ -2749,13 +2784,13 @@ class MiddleItem extends JSONWatch {
2749
2784
  }
2750
2785
  class FtpSchema$1 extends Schema {
2751
2786
  constructor(props, isCompleteSchema = false) {
2752
- const { api: api2, filter, headerToolbar, table, tabs, middleModules, ...more2 } = isCompleteSchema ? props.body : props;
2787
+ const { api, filter, headerToolbar, table, tabs, middleModules, ...more2 } = isCompleteSchema ? props.body : props;
2753
2788
  super(more2);
2754
2789
  this.type = "ftp";
2755
- this.api = new AjaxSchema(api2);
2790
+ this.api = new AjaxSchema(api);
2756
2791
  this.filter = new Filter(filter);
2757
2792
  this.headerToolbar = new HeaderToolbar$1(headerToolbar);
2758
- this.table = new TableSchema$1(table);
2793
+ this.table = new TableSchema$2(table);
2759
2794
  this.initChildren(middleModules, tabs);
2760
2795
  this.willDetach = this.initChangeListener();
2761
2796
  }
@@ -2826,12 +2861,12 @@ class FtpSchema$1 extends Schema {
2826
2861
  }
2827
2862
  initFromCache(schema) {
2828
2863
  const { body, ...more2 } = schema;
2829
- const { api: api2, filter, headerToolbar, table, tabs, middleModules } = body;
2864
+ const { api, filter, headerToolbar, table, tabs, middleModules } = body;
2830
2865
  if (this.willDetach) {
2831
2866
  this.willDetach();
2832
2867
  }
2833
2868
  this.init(more2);
2834
- this.api.updateAll(api2);
2869
+ this.api.updateAll(api);
2835
2870
  this.filter.updateAll(filter);
2836
2871
  this.headerToolbar.updateAll(headerToolbar);
2837
2872
  this.table.updateAll(this.compatTableHandle(table));
@@ -2922,7 +2957,93 @@ class FtpSchema$1 extends Schema {
2922
2957
  }
2923
2958
  __publicField(FtpSchema$1, "Filter", Filter);
2924
2959
  __publicField(FtpSchema$1, "HeaderToolbar", HeaderToolbar$1);
2925
- __publicField(FtpSchema$1, "Table", TableSchema$1);
2960
+ __publicField(FtpSchema$1, "Table", TableSchema$2);
2961
+ class TableSchema$1 extends JSONWatch {
2962
+ constructor(props) {
2963
+ super({
2964
+ columns: props
2965
+ });
2966
+ }
2967
+ setFieldsAll(columns, ignoreUpdate = false) {
2968
+ this.set("columns", columns, ignoreUpdate);
2969
+ }
2970
+ setItemAll(value, type = "columns", ignoreUpdate = false) {
2971
+ this.set(type, value, ignoreUpdate);
2972
+ }
2973
+ add(field, key = "columns", ignoreUpdate = false) {
2974
+ this.data[key].push(field);
2975
+ this.emit("$updated", null, ignoreUpdate);
2976
+ }
2977
+ remove(index2, key = "columns", ignoreUpdate = false) {
2978
+ this.data[key].splice(index2, 1);
2979
+ this.emit("$updated", null, ignoreUpdate);
2980
+ }
2981
+ update(index2, data, key = "columns", ignoreUpdate = false) {
2982
+ if (["columns", "actionColumns", "bulkActions"].includes(key)) {
2983
+ this.data[key].splice(index2, 1, data);
2984
+ } else {
2985
+ this.data[key] = data;
2986
+ }
2987
+ this.emit("$updated", null, ignoreUpdate);
2988
+ }
2989
+ updateAll(data) {
2990
+ this.data = data;
2991
+ this.emit("$updated");
2992
+ }
2993
+ delete() {
2994
+ }
2995
+ getJSON() {
2996
+ return super.getJSON();
2997
+ }
2998
+ }
2999
+ class BlocksSchema extends Schema {
3000
+ constructor(props, isCompleteSchema = false) {
3001
+ const { type, blocks, ...more2 } = isCompleteSchema ? props.body : props;
3002
+ super(more2);
3003
+ this.type = type;
3004
+ this.blocks = new TableSchema$1(blocks);
3005
+ this.willDetach = this.initChangeListener();
3006
+ }
3007
+ initChangeListener() {
3008
+ const fun = () => {
3009
+ super.emit(EVENT_KEY.SCHEMA_UPDATE, { schemaJson: this.getAllJSON(), schema: this });
3010
+ };
3011
+ this.blocks.on("$updated", fun);
3012
+ return () => {
3013
+ this.blocks.off("$updated", fun);
3014
+ };
3015
+ }
3016
+ initFromCache(schema) {
3017
+ const { body, ...more2 } = schema;
3018
+ const { blocks } = body;
3019
+ if (this.willDetach) {
3020
+ this.willDetach();
3021
+ }
3022
+ this.init(more2);
3023
+ this.blocks.updateAll(blocks);
3024
+ this.willDetach = this.initChangeListener();
3025
+ }
3026
+ getSchemaType() {
3027
+ return this.type;
3028
+ }
3029
+ getTablePanel() {
3030
+ return this.blocks;
3031
+ }
3032
+ getAllJSON() {
3033
+ const res = super.getAllJSON();
3034
+ return { ...res, type: "blocks" };
3035
+ }
3036
+ toJSON() {
3037
+ return {
3038
+ type: this.type,
3039
+ blocks: this.blocks.getJSON().columns
3040
+ };
3041
+ }
3042
+ setBlocks(blocks) {
3043
+ this.blocks = blocks;
3044
+ }
3045
+ }
3046
+ __publicField(BlocksSchema, "Table", TableSchema$1);
2926
3047
  class FormInfo extends JSONWatch {
2927
3048
  constructor(props) {
2928
3049
  const {
@@ -3084,11 +3205,11 @@ function getWatchByRequest(params) {
3084
3205
  }
3085
3206
  class FormilyFormV2Schema extends Schema {
3086
3207
  constructor(props, isCompleteSchema = false) {
3087
- const { api: api2, initApi, effectApi, baseInfo, fields: fields2, ...more2 } = isCompleteSchema ? props.body : props;
3208
+ const { api, initApi, effectApi, baseInfo, fields: fields2, ...more2 } = isCompleteSchema ? props.body : props;
3088
3209
  super(more2);
3089
3210
  this.type = "formily-form-v2";
3090
3211
  this.baseInfo = new FormInfo(baseInfo);
3091
- this.api = new AjaxSchema(api2);
3212
+ this.api = new AjaxSchema(api);
3092
3213
  if (!initApi) {
3093
3214
  this.initApi = new AjaxSchemaQueue([]);
3094
3215
  } else {
@@ -3130,12 +3251,12 @@ class FormilyFormV2Schema extends Schema {
3130
3251
  }
3131
3252
  initFromCache(schema) {
3132
3253
  const { body, ...more2 } = schema;
3133
- const { api: api2, initApi = [], effectApi = [], baseInfo, fields: fields2 } = body;
3254
+ const { api, initApi = [], effectApi = [], baseInfo, fields: fields2 } = body;
3134
3255
  if (this.willDetach) {
3135
3256
  this.willDetach();
3136
3257
  }
3137
3258
  this.init(more2);
3138
- this.api.updateAll(api2);
3259
+ this.api.updateAll(api);
3139
3260
  if (!initApi) {
3140
3261
  this.initApi.updateAll([]);
3141
3262
  } else {
@@ -7694,7 +7815,7 @@ const dsTitleWatch$1 = "_dsTitleWatch_mxilv_32";
7694
7815
  const staticValueOkBtn$1 = "_staticValueOkBtn_mxilv_37";
7695
7816
  const tableDeleteBtn$1 = "_tableDeleteBtn_mxilv_41";
7696
7817
  const secondConfirm$1 = "_secondConfirm_mxilv_45";
7697
- var styles$d = {
7818
+ var styles$e = {
7698
7819
  dsType: dsType$1,
7699
7820
  dsJSONContent: dsJSONContent$1,
7700
7821
  dsJSONContentTip: dsJSONContentTip$1,
@@ -13065,23 +13186,23 @@ function useSwagger() {
13065
13186
  }
13066
13187
  };
13067
13188
  }
13068
- function createApiSelectItem(summary, api2, method, request = []) {
13189
+ function createApiSelectItem(summary, api, method, request = []) {
13069
13190
  return {
13070
13191
  summary,
13071
- label: `${summary} - ${method} ${api2}`,
13072
- value: api2,
13073
- url: api2,
13192
+ label: `${summary} - ${method} ${api}`,
13193
+ value: api,
13194
+ url: api,
13074
13195
  method,
13075
13196
  request,
13076
- parameters: api2.parameters
13197
+ parameters: api.parameters
13077
13198
  };
13078
13199
  }
13079
13200
  const getDataSourceArray$1 = (paths = {}) => {
13080
13201
  try {
13081
13202
  return Object.keys(paths).map((key) => {
13082
- const api2 = paths[key];
13083
- const apiPost = api2.post || api2.POST;
13084
- const apiGet = api2.get || api2.GET;
13203
+ const api = paths[key];
13204
+ const apiPost = api.post || api.POST;
13205
+ const apiGet = api.get || api.GET;
13085
13206
  if (apiPost) {
13086
13207
  return createApiSelectItem(apiPost.summary, key, "POST");
13087
13208
  } else if (apiGet) {
@@ -13154,8 +13275,8 @@ class PersistentStorage {
13154
13275
  }
13155
13276
  var storage = new PersistentStorage();
13156
13277
  class DataSourceSchema extends JSONWatch {
13157
- constructor(api2) {
13158
- const { url, method = "get", ...more2 } = api2 || {};
13278
+ constructor(api) {
13279
+ const { url, method = "get", ...more2 } = api || {};
13159
13280
  super({
13160
13281
  url,
13161
13282
  method,
@@ -13867,10 +13988,10 @@ function emitterVSCodeMessage(action, content2) {
13867
13988
  function emitSave(fileMapContent) {
13868
13989
  emitterVSCodeMessage(EMIT_EVENT_ACTION_SAVE, fileMapContent);
13869
13990
  }
13870
- const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
13991
+ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
13871
13992
  let schemaObj = null;
13872
13993
  if (schemaType === "ftp") {
13873
- schemaObj = new FtpSchema$1({ host: api2, title: "" });
13994
+ schemaObj = new FtpSchema$1({ host: api, title: "" });
13874
13995
  const realDataSource = {
13875
13996
  ...mainDataSource,
13876
13997
  type: "ajax",
@@ -13883,14 +14004,14 @@ const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
13883
14004
  };
13884
14005
  schemaObj.getDataSourcePanel().update(realDataSource);
13885
14006
  } else if (schemaType === "formily-form") {
13886
- schemaObj = new FormilyFormSchema({ host: api2, title: "" });
14007
+ schemaObj = new FormilyFormSchema({ host: api, title: "" });
13887
14008
  const realDataSource = {
13888
14009
  ...mainDataSource,
13889
14010
  type: "ajax"
13890
14011
  };
13891
14012
  schemaObj.getDataSourcePanel().update(realDataSource);
13892
14013
  } else if (schemaType === "formily-form-v2") {
13893
- schemaObj = new FormilyFormV2Schema({ host: api2, title: "" });
14014
+ schemaObj = new FormilyFormV2Schema({ host: api, title: "" });
13894
14015
  const realDataSource = {
13895
14016
  ...mainDataSource,
13896
14017
  type: "ajax"
@@ -13898,7 +14019,7 @@ const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
13898
14019
  schemaObj.getApiPanel().update(realDataSource);
13899
14020
  } else if (schemaType === "detail") {
13900
14021
  if (moreProps == null ? void 0 : moreProps.children) {
13901
- schemaObj = new DetailSchema({ host: api2, title: "", ...moreProps });
14022
+ schemaObj = new DetailSchema({ host: api, title: "", ...moreProps });
13902
14023
  } else {
13903
14024
  const realDataSource = {
13904
14025
  ...mainDataSource,
@@ -13907,10 +14028,10 @@ const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
13907
14028
  detailData: "$RET.data"
13908
14029
  }
13909
14030
  };
13910
- schemaObj = new DetailSchema({ host: api2, title: "", initDataSource: realDataSource });
14031
+ schemaObj = new DetailSchema({ host: api, title: "", initDataSource: realDataSource });
13911
14032
  }
13912
14033
  } else if (schemaType === "edit-table") {
13913
- schemaObj = new FtpSchema({ host: api2, title: "", ...moreProps });
14034
+ schemaObj = new FtpSchema({ host: api, title: "", ...moreProps });
13914
14035
  const realDataSource = {
13915
14036
  ...mainDataSource,
13916
14037
  type: "ajax",
@@ -13937,8 +14058,8 @@ const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
13937
14058
  }
13938
14059
  }, 500)
13939
14060
  );
13940
- if (api2.indexOf("?") === -1 && api2.indexOf("mocks") === -1) {
13941
- axios.defaults.baseURL = api2;
14061
+ if (api.indexOf("?") === -1 && api.indexOf("mocks") === -1) {
14062
+ axios.defaults.baseURL = api;
13942
14063
  }
13943
14064
  return schemaObj;
13944
14065
  };
@@ -13947,11 +14068,11 @@ const buildSchemaObjFromSchema = (schema) => {
13947
14068
  return null;
13948
14069
  }
13949
14070
  const { host, body } = schema;
13950
- const { type, api: api2, ...more2 } = body || {};
14071
+ const { type, api, ...more2 } = body || {};
13951
14072
  if (!host || !type) {
13952
14073
  return null;
13953
14074
  }
13954
- return buildSchema(type, host, api2, more2);
14075
+ return buildSchema(type, host, api, more2);
13955
14076
  };
13956
14077
  function useSchema() {
13957
14078
  const { fetchSwaggerInfo } = useSwagger$1();
@@ -14594,7 +14715,7 @@ function DataSourceSelect(props) {
14594
14715
  size: "small",
14595
14716
  placeholder: "\u8BF7\u8F93\u5165\u503C"
14596
14717
  }), /* @__PURE__ */ React$1.createElement(Button, {
14597
- className: styles$d.staticValueOkBtn,
14718
+ className: styles$e.staticValueOkBtn,
14598
14719
  size: "small",
14599
14720
  onClick: onOkQuery
14600
14721
  }, "\u786E\u5B9A")) : null, panelSelectValue === "$TABLE.RECORD_DATA" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -14605,7 +14726,7 @@ function DataSourceSelect(props) {
14605
14726
  size: "small",
14606
14727
  placeholder: "\u8BF7\u8F93\u5165\u503C"
14607
14728
  }), /* @__PURE__ */ React$1.createElement(Button, {
14608
- className: styles$d.staticValueOkBtn,
14729
+ className: styles$e.staticValueOkBtn,
14609
14730
  size: "small",
14610
14731
  onClick: onOkRecordData
14611
14732
  }, "\u786E\u5B9A")) : null, panelSelectValue === "$PARAMS" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -14616,7 +14737,7 @@ function DataSourceSelect(props) {
14616
14737
  size: "small",
14617
14738
  placeholder: "\u8BF7\u8F93\u5165\u503C"
14618
14739
  }), /* @__PURE__ */ React$1.createElement(Button, {
14619
- className: styles$d.staticValueOkBtn,
14740
+ className: styles$e.staticValueOkBtn,
14620
14741
  size: "small",
14621
14742
  onClick: onOkParams
14622
14743
  }, "\u786E\u5B9A")) : null, panelSelectValue === "staticValue" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -14627,7 +14748,7 @@ function DataSourceSelect(props) {
14627
14748
  placeholder: "\u8BF7\u8F93\u5165\u503C",
14628
14749
  size: "small"
14629
14750
  }), /* @__PURE__ */ React$1.createElement(Button, {
14630
- className: styles$d.staticValueOkBtn,
14751
+ className: styles$e.staticValueOkBtn,
14631
14752
  size: "small",
14632
14753
  onClick: onOkStatic
14633
14754
  }, "\u786E\u5B9A")) : null) : null);
@@ -14656,12 +14777,12 @@ function DataSourceSelect(props) {
14656
14777
  type: "primary",
14657
14778
  text: true,
14658
14779
  size: "small",
14659
- className: styles$d.tableDeleteBtn,
14780
+ className: styles$e.tableDeleteBtn,
14660
14781
  onClick: () => commonTableDelete(value2, index2, record, "params")
14661
14782
  }, "\u5220\u9664"));
14662
14783
  };
14663
14784
  return /* @__PURE__ */ React$1.createElement("div", null, /* @__PURE__ */ React$1.createElement("div", {
14664
- className: styles$d.dsTitle
14785
+ className: styles$e.dsTitle
14665
14786
  }, "\u5165\u53C2:"), /* @__PURE__ */ React$1.createElement("div", {
14666
14787
  style: { marginBottom: 8 }
14667
14788
  }, /* @__PURE__ */ React$1.createElement(Button, {
@@ -14695,9 +14816,9 @@ function DataSourceSelect(props) {
14695
14816
  };
14696
14817
  const renderWatch = () => {
14697
14818
  return /* @__PURE__ */ React$1.createElement("div", {
14698
- className: styles$d.watchContainer
14819
+ className: styles$e.watchContainer
14699
14820
  }, /* @__PURE__ */ React$1.createElement("div", {
14700
- className: styles$d.dsTitleWatch
14821
+ className: styles$e.dsTitleWatch
14701
14822
  }, "\u89E6\u53D1\u65F6\u673A:"), /* @__PURE__ */ React$1.createElement(Select$2, {
14702
14823
  mode: "multiple",
14703
14824
  showSearch: true,
@@ -14975,7 +15096,7 @@ function DataSourceSelect(props) {
14975
15096
  placeholder: "\u8BF7\u8F93\u5165\u503C",
14976
15097
  size: "small"
14977
15098
  }), /* @__PURE__ */ React$1.createElement(Button, {
14978
- className: styles$d.staticValueOkBtn,
15099
+ className: styles$e.staticValueOkBtn,
14979
15100
  size: "small",
14980
15101
  onClick: onOkQuery
14981
15102
  }, "\u786E\u5B9A")) : null, panelSelectValue === "staticValue" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -14986,7 +15107,7 @@ function DataSourceSelect(props) {
14986
15107
  placeholder: "\u8BF7\u8F93\u5165\u503C",
14987
15108
  size: "small"
14988
15109
  }), /* @__PURE__ */ React$1.createElement(Button, {
14989
- className: styles$d.staticValueOkBtn,
15110
+ className: styles$e.staticValueOkBtn,
14990
15111
  size: "small",
14991
15112
  onClick: onOkStatic
14992
15113
  }, "\u786E\u5B9A")) : null, panelSelectValue === "$RET" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -14997,7 +15118,7 @@ function DataSourceSelect(props) {
14997
15118
  placeholder: "\u8BF7\u8F93\u5165\u503C",
14998
15119
  size: "small"
14999
15120
  }), /* @__PURE__ */ React$1.createElement(Button, {
15000
- className: styles$d.staticValueOkBtn,
15121
+ className: styles$e.staticValueOkBtn,
15001
15122
  size: "small",
15002
15123
  onClick: onOkRet
15003
15124
  }, "\u786E\u5B9A")) : null, panelSelectValue === "$PARAMS" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -15008,7 +15129,7 @@ function DataSourceSelect(props) {
15008
15129
  size: "small",
15009
15130
  placeholder: "\u8BF7\u8F93\u5165\u503C"
15010
15131
  }), /* @__PURE__ */ React$1.createElement(Button, {
15011
- className: styles$d.staticValueOkBtn,
15132
+ className: styles$e.staticValueOkBtn,
15012
15133
  size: "small",
15013
15134
  onClick: onOkParams
15014
15135
  }, "\u786E\u5B9A")) : null, panelSelectValue === "$TABLE.RECORD_DATA" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -15019,7 +15140,7 @@ function DataSourceSelect(props) {
15019
15140
  size: "small",
15020
15141
  placeholder: "\u8BF7\u8F93\u5165\u503C"
15021
15142
  }), /* @__PURE__ */ React$1.createElement(Button, {
15022
- className: styles$d.staticValueOkBtn,
15143
+ className: styles$e.staticValueOkBtn,
15023
15144
  size: "small",
15024
15145
  onClick: onOkRecordData
15025
15146
  }, "\u786E\u5B9A")) : null) : null);
@@ -15057,9 +15178,9 @@ function DataSourceSelect(props) {
15057
15178
  }, "\u5220\u9664");
15058
15179
  };
15059
15180
  return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement("div", {
15060
- className: styles$d.dsTitle
15181
+ className: styles$e.dsTitle
15061
15182
  }, "\u683C\u5F0F\u5316\u51FA\u53C2:"), /* @__PURE__ */ React$1.createElement("div", {
15062
- className: styles$d.actionButton
15183
+ className: styles$e.actionButton
15063
15184
  }, /* @__PURE__ */ React$1.createElement(Button, {
15064
15185
  onClick: onResponseAdd,
15065
15186
  size: "small"
@@ -15089,9 +15210,9 @@ function DataSourceSelect(props) {
15089
15210
  })));
15090
15211
  };
15091
15212
  return /* @__PURE__ */ React$1.createElement("div", {
15092
- className: styles$d.dsContainer
15213
+ className: styles$e.dsContainer
15093
15214
  }, hasExtra && !defaultAjax ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement("div", {
15094
- className: styles$d.dsType
15215
+ className: styles$e.dsType
15095
15216
  }, /* @__PURE__ */ React$1.createElement(RadioGroup$1, {
15096
15217
  value: typeValue,
15097
15218
  onChange: onTypeChange,
@@ -15121,9 +15242,9 @@ function DataSourceSelect(props) {
15121
15242
  filter: mainDataSourceFilter,
15122
15243
  ...selectProps
15123
15244
  }) : null, hasExtra && typeValue === "json" ? /* @__PURE__ */ React$1.createElement("div", {
15124
- className: styles$d.dsJSONContent
15245
+ className: styles$e.dsJSONContent
15125
15246
  }, /* @__PURE__ */ React$1.createElement("div", {
15126
- className: styles$d.dsJSONContentTip
15247
+ className: styles$e.dsJSONContentTip
15127
15248
  }, "\u8BF7\u8F93\u5165json(\u63D0\u793A\uFF1Ajson\u7684key\u9700\u8981\u52A0\u4E0A\u53CC\u5F15\u53F7)"), /* @__PURE__ */ React$1.createElement(MonacoEditor, {
15128
15249
  value: codeMirrorJsonObj,
15129
15250
  onChange: (v2, viewUpdate) => {
@@ -15136,9 +15257,9 @@ function DataSourceSelect(props) {
15136
15257
  }
15137
15258
  }
15138
15259
  })) : null, hasExtra && typeValue === "ajax" ? /* @__PURE__ */ React$1.createElement("div", {
15139
- className: styles$d.dsAjaxContent
15260
+ className: styles$e.dsAjaxContent
15140
15261
  }, showWatch && !defaultAjax && renderWatch(), renderParamsTable(), renderFormatResponse()) : null, hasExtra && showSecondConfirm && typeValue === "ajax" ? /* @__PURE__ */ React$1.createElement("div", {
15141
- className: styles$d.secondConfirm
15262
+ className: styles$e.secondConfirm
15142
15263
  }, /* @__PURE__ */ React$1.createElement(Checkbox, {
15143
15264
  checked: secondConfirmValue,
15144
15265
  onChange: secondConfirmChange
@@ -15169,7 +15290,7 @@ const dsTitleWatch = "_dsTitleWatch_1islj_28";
15169
15290
  const staticValueOkBtn = "_staticValueOkBtn_1islj_33";
15170
15291
  const tableDeleteBtn = "_tableDeleteBtn_1islj_37";
15171
15292
  const secondConfirm = "_secondConfirm_1islj_41";
15172
- var styles$c = {
15293
+ var styles$d = {
15173
15294
  dsType,
15174
15295
  dsJSONContent,
15175
15296
  dsJSONContentTip,
@@ -15532,7 +15653,7 @@ function ParamsSelect(props) {
15532
15653
  size: "small",
15533
15654
  placeholder: "\u8BF7\u8F93\u5165\u503C"
15534
15655
  }), /* @__PURE__ */ React$1.createElement(Button, {
15535
- className: styles$c.staticValueOkBtn,
15656
+ className: styles$d.staticValueOkBtn,
15536
15657
  size: "small",
15537
15658
  onClick: onOkQuery
15538
15659
  }, "\u786E\u5B9A")) : null, panelSelectValue === "$PARAMS" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -15543,7 +15664,7 @@ function ParamsSelect(props) {
15543
15664
  size: "small",
15544
15665
  placeholder: "\u8BF7\u8F93\u5165\u503C"
15545
15666
  }), /* @__PURE__ */ React$1.createElement(Button, {
15546
- className: styles$c.staticValueOkBtn,
15667
+ className: styles$d.staticValueOkBtn,
15547
15668
  size: "small",
15548
15669
  onClick: onOkParams
15549
15670
  }, "\u786E\u5B9A")) : null, panelSelectValue === "$TABLE.RECORD_DATA" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -15554,7 +15675,7 @@ function ParamsSelect(props) {
15554
15675
  size: "small",
15555
15676
  placeholder: "\u8BF7\u8F93\u5165\u503C"
15556
15677
  }), /* @__PURE__ */ React$1.createElement(Button, {
15557
- className: styles$c.staticValueOkBtn,
15678
+ className: styles$d.staticValueOkBtn,
15558
15679
  size: "small",
15559
15680
  onClick: onOkRecordData
15560
15681
  }, "\u786E\u5B9A")) : null, panelSelectValue === "$FORM" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -15565,7 +15686,7 @@ function ParamsSelect(props) {
15565
15686
  size: "small",
15566
15687
  placeholder: "\u8BF7\u8F93\u5165\u503C"
15567
15688
  }), /* @__PURE__ */ React$1.createElement(Button, {
15568
- className: styles$c.staticValueOkBtn,
15689
+ className: styles$d.staticValueOkBtn,
15569
15690
  size: "small",
15570
15691
  onClick: onOkForm
15571
15692
  }, "\u786E\u5B9A")) : null, panelSelectValue === "staticValue" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Input$1, {
@@ -15576,7 +15697,7 @@ function ParamsSelect(props) {
15576
15697
  placeholder: "\u8BF7\u8F93\u5165\u503C",
15577
15698
  size: "small"
15578
15699
  }), /* @__PURE__ */ React$1.createElement(Button, {
15579
- className: styles$c.staticValueOkBtn,
15700
+ className: styles$d.staticValueOkBtn,
15580
15701
  size: "small",
15581
15702
  onClick: onOkStatic
15582
15703
  }, "\u786E\u5B9A")) : null) : null);
@@ -15605,7 +15726,7 @@ function ParamsSelect(props) {
15605
15726
  type: "primary",
15606
15727
  text: true,
15607
15728
  size: "small",
15608
- className: styles$c.tableDeleteBtn,
15729
+ className: styles$d.tableDeleteBtn,
15609
15730
  onClick: () => commonTableDelete(value2, index2, record, "params")
15610
15731
  }, "\u5220\u9664"));
15611
15732
  };
@@ -15633,9 +15754,9 @@ function ParamsSelect(props) {
15633
15754
  })));
15634
15755
  };
15635
15756
  return /* @__PURE__ */ React$1.createElement("div", {
15636
- className: styles$c.dsContainer
15757
+ className: styles$d.dsContainer
15637
15758
  }, /* @__PURE__ */ React$1.createElement("div", {
15638
- className: styles$c.dsAjaxContent
15759
+ className: styles$d.dsAjaxContent
15639
15760
  }, renderParamsTable()));
15640
15761
  }
15641
15762
  const { connect: connect$7, mapReadPretty: mapReadPretty$6, mapProps: mapProps$7 } = formilyReact;
@@ -15809,7 +15930,7 @@ Select$1.AutoComplete = connect$4(
15809
15930
  );
15810
15931
  const container = "_container_t9q14_1";
15811
15932
  const footer = "_footer_t9q14_8";
15812
- var styles$b = {
15933
+ var styles$c = {
15813
15934
  container,
15814
15935
  footer
15815
15936
  };
@@ -15909,14 +16030,14 @@ const FormilyForm = (props) => {
15909
16030
  fixedSpan: 8
15910
16031
  },
15911
16032
  size: "small",
15912
- className: styles$b.container
16033
+ className: styles$c.container
15913
16034
  },
15914
16035
  ...restProps
15915
16036
  }, /* @__PURE__ */ React$1.createElement(SchemaField, {
15916
16037
  components,
15917
16038
  schema: schema == null ? void 0 : schema.schema
15918
16039
  }), children, !hiddenSubmit && /* @__PURE__ */ React$1.createElement("div", {
15919
- className: styles$b.footer
16040
+ className: styles$c.footer
15920
16041
  }, /* @__PURE__ */ React$1.createElement(Submit, {
15921
16042
  ...SubmitProps
15922
16043
  }, "\u63D0\u4EA4")));
@@ -16474,9 +16595,9 @@ function AjaxFormDialog({ title: title2 = "\u6570\u636E\u6E90\u914D\u7F6E", sche
16474
16595
  dataSource: swagger.apiList,
16475
16596
  defaultValue: schema.get("url"),
16476
16597
  onChange: (value) => {
16477
- const api2 = swagger.getApi(value);
16478
- if (api2) {
16479
- schema.setAjaxRequest(value, api2.method);
16598
+ const api = swagger.getApi(value);
16599
+ if (api) {
16600
+ schema.setAjaxRequest(value, api.method);
16480
16601
  } else {
16481
16602
  schema.set("url", value);
16482
16603
  }
@@ -19229,6 +19350,53 @@ var cnGraphicsPercent = (params) => {
19229
19350
  }
19230
19351
  };
19231
19352
  };
19353
+ var BlocksTable = (params) => {
19354
+ const { blocksDataSource = [] } = params || {};
19355
+ return {
19356
+ form: {
19357
+ labelCol: 6,
19358
+ wrapperCol: 16
19359
+ },
19360
+ schema: {
19361
+ type: "object",
19362
+ properties: {
19363
+ blockPath: {
19364
+ title: "\u533A\u5757\u5730\u5740",
19365
+ "x-decorator": "CnFormItem",
19366
+ "x-component": "FormilySelect.AutoComplete",
19367
+ "x-validator": [],
19368
+ "x-component-props": {
19369
+ placeholder: "\u8BF7\u9009\u62E9\u6216\u8005\u8F93\u5165\u533A\u5757\u5730\u5740",
19370
+ hasClear: true,
19371
+ size: "small",
19372
+ style: {
19373
+ width: "100%"
19374
+ }
19375
+ },
19376
+ "x-decorator-props": {},
19377
+ name: "blockPath",
19378
+ enum: blocksDataSource || [],
19379
+ default: "",
19380
+ "x-designable-id": "9efgulzttsh"
19381
+ },
19382
+ parentDataIndex: {
19383
+ type: "string",
19384
+ title: "\u7236\u7EA7 dataIndex",
19385
+ "x-decorator": "CnFormItem",
19386
+ "x-component": "Input",
19387
+ "x-validator": [],
19388
+ "x-component-props": {},
19389
+ "x-decorator-props": {
19390
+ tip: "\u6E32\u67D3\u533A\u5757\u7684\u6BCF\u4E2A\u5217\u65F6\uFF0C\u6307\u5B9A\u7236\u7EA7\u53D6\u503C\u7684key\u3002\u4F18\u5148\u7EA7 \u5927\u4E8E \u5F53\u524D\u5217\u914D\u7F6E\u7684dataIndex\u3002\u82E5\u5747\u4E3A\u914D\u7F6E \u5219\u9ED8\u8BA4\u5E73\u94FA\u3002\u4F8B\u5982\uFF1A\u533A\u5757\u5217\u4E2D\u7B2C\u4E00\u5217 \u7684 dataIndex \u4E3A name\uFF0CparentDataIndex \u4E3A ownerDto\uFF0C\u5219\u8BE5\u5217\u6E32\u67D3\u65F6\u7684\u5B9E\u9645 dataIndex \u4E3A ownerDto.name"
19391
+ },
19392
+ name: "parentDataIndex",
19393
+ "x-designable-id": "sxbti2p222233122mzk"
19394
+ },
19395
+ "x-designable-id": "loa5555d8t3"
19396
+ }
19397
+ }
19398
+ };
19399
+ };
19232
19400
  var Columns = {
19233
19401
  text: TextSchema,
19234
19402
  tpl: TplSchema,
@@ -19246,7 +19414,8 @@ var Columns = {
19246
19414
  "cn-bank": CnBank,
19247
19415
  "cn-image-text": CnImageText,
19248
19416
  "cn-progress": CnProgress,
19249
- "cn-graphics-percent": cnGraphicsPercent
19417
+ "cn-graphics-percent": cnGraphicsPercent,
19418
+ "blocks-table": BlocksTable
19250
19419
  };
19251
19420
  var TablePagination = {
19252
19421
  form: {
@@ -23763,7 +23932,7 @@ const itemComponent$1 = "_itemComponent_tl8oe_70";
23763
23932
  const itemLabel$1 = "_itemLabel_tl8oe_76";
23764
23933
  const collapseContent$2 = "_collapseContent_tl8oe_81";
23765
23934
  const itemClose$2 = "_itemClose_tl8oe_85";
23766
- var styles$a = {
23935
+ var styles$b = {
23767
23936
  mddTableForm,
23768
23937
  tableFormTitle,
23769
23938
  tableFormContent,
@@ -23841,7 +24010,7 @@ const TitleRender$2 = (props) => {
23841
24010
  setValue({ ...value });
23842
24011
  onChange(value, key);
23843
24012
  };
23844
- const cls = classnames.bind(styles$a)({
24013
+ const cls = classnames.bind(styles$b)({
23845
24014
  itemTitle: "itemTitle",
23846
24015
  "drop-over-upward": isOver && index2 < sourceItem.index,
23847
24016
  "drop-over-downward": isOver && index2 > sourceItem.index
@@ -23857,9 +24026,9 @@ const TitleRender$2 = (props) => {
23857
24026
  onChange: (v2) => titleChange("label", v2),
23858
24027
  placeholder: "\u8F93\u5165\u4E2D\u6587\u540D"
23859
24028
  }), titleType.includes("type") && /* @__PURE__ */ React$1.createElement("div", {
23860
- className: styles$a.itemComponent
24029
+ className: styles$b.itemComponent
23861
24030
  }, /* @__PURE__ */ React$1.createElement("label", {
23862
- className: styles$a.itemLabel
24031
+ className: styles$b.itemLabel
23863
24032
  }, "\u7EC4\u4EF6: "), /* @__PURE__ */ React$1.createElement(Select$2, {
23864
24033
  size: "small",
23865
24034
  autoWidth: false,
@@ -23878,9 +24047,9 @@ const TitleRender$2 = (props) => {
23878
24047
  onChange: (v2) => titleChange("name", v2),
23879
24048
  placeholder: "\u8BF7\u9009\u62E9\u6216\u8005\u8F93\u5165\u53D8\u91CF\u540D"
23880
24049
  }), titleType.includes("groupKey") && /* @__PURE__ */ React$1.createElement("div", {
23881
- className: styles$a.itemComponent
24050
+ className: styles$b.itemComponent
23882
24051
  }, /* @__PURE__ */ React$1.createElement("label", {
23883
- className: styles$a.itemLabel
24052
+ className: styles$b.itemLabel
23884
24053
  }, "\u5206\u7EC4: "), /* @__PURE__ */ React$1.createElement(Input$1, {
23885
24054
  size: "small",
23886
24055
  value: groupKey,
@@ -23889,7 +24058,7 @@ const TitleRender$2 = (props) => {
23889
24058
  })), /* @__PURE__ */ React$1.createElement(Icon, {
23890
24059
  type: "close",
23891
24060
  size: "small",
23892
- className: styles$a.itemClose,
24061
+ className: styles$b.itemClose,
23893
24062
  onClick: onRemove
23894
24063
  }));
23895
24064
  };
@@ -23906,6 +24075,7 @@ const ContentRender$2 = (props) => {
23906
24075
  const [uuid, setUuid] = useState(uuidv4());
23907
24076
  const { dataMap, getModule } = useModule$1();
23908
24077
  const moduleDataSource = getModule("$ModuleDataSource");
24078
+ const blocksDataSource = getModule("$BlocksDataSource");
23909
24079
  React$1.useEffect(
23910
24080
  debounce_1(() => {
23911
24081
  setUuid(uuidv4());
@@ -23913,7 +24083,7 @@ const ContentRender$2 = (props) => {
23913
24083
  [watchFields(listSchema)]
23914
24084
  );
23915
24085
  const realSchema = useMemo(() => {
23916
- const srcSchema = getRealSchema(formilySchema2 || schema, { moduleDataSource, listSchema });
24086
+ const srcSchema = getRealSchema(formilySchema2 || schema, { moduleDataSource, listSchema, blocksDataSource });
23917
24087
  return getRealCompSchema(srcSchema, extraFieldSchema2);
23918
24088
  }, [formilySchema2, schema, extraFieldSchema2, moduleDataSource, uuid, listSchema]);
23919
24089
  const formilyForm = useMemo(() => {
@@ -23941,7 +24111,7 @@ const ContentRender$2 = (props) => {
23941
24111
  };
23942
24112
  }, [type, updateForceFLag, realSchema]);
23943
24113
  return /* @__PURE__ */ React$1.createElement("div", {
23944
- className: styles$a.collapseContent
24114
+ className: styles$b.collapseContent
23945
24115
  }, /* @__PURE__ */ React$1.createElement(FormilyForm$1, {
23946
24116
  ...formilyForm,
23947
24117
  hiddenSubmit: true
@@ -24016,9 +24186,9 @@ function MddTableForm(props, ref) {
24016
24186
  forceUpdate();
24017
24187
  };
24018
24188
  return /* @__PURE__ */ React$1.createElement("div", {
24019
- className: styles$a.mddTableForm
24189
+ className: styles$b.mddTableForm
24020
24190
  }, /* @__PURE__ */ React$1.createElement("div", {
24021
- className: styles$a.tableFormTitle
24191
+ className: styles$b.tableFormTitle
24022
24192
  }, /* @__PURE__ */ React$1.createElement("div", null, title2, tip && /* @__PURE__ */ React$1.createElement(Tooltip, {
24023
24193
  trigger: /* @__PURE__ */ React$1.createElement(Icon, {
24024
24194
  type: "help",
@@ -24026,9 +24196,9 @@ function MddTableForm(props, ref) {
24026
24196
  }),
24027
24197
  align: "t"
24028
24198
  }, tip)), actionContent && /* @__PURE__ */ React$1.createElement("div", {
24029
- className: styles$a.tableFormAction
24199
+ className: styles$b.tableFormAction
24030
24200
  }, actionContent)), /* @__PURE__ */ React$1.createElement("div", {
24031
- className: styles$a.tableFormContent
24201
+ className: styles$b.tableFormContent
24032
24202
  }, /* @__PURE__ */ React$1.createElement(DndProvider, {
24033
24203
  backend: HTML5Backend
24034
24204
  }, /* @__PURE__ */ React$1.createElement(Collapse, {
@@ -24070,7 +24240,7 @@ function MddTableForm(props, ref) {
24070
24240
  }
24071
24241
  }));
24072
24242
  })))), /* @__PURE__ */ React$1.createElement("div", {
24073
- className: styles$a.tableFormBottom
24243
+ className: styles$b.tableFormBottom
24074
24244
  }, /* @__PURE__ */ React$1.createElement(Button, {
24075
24245
  onClick: onAddHandle,
24076
24246
  style: { padding: "0 48px" }
@@ -24110,7 +24280,7 @@ const FormTitle = "_FormTitle_1e2nn_20";
24110
24280
  const FormTitleHelp = "_FormTitleHelp_1e2nn_24";
24111
24281
  const FormContent = "_FormContent_1e2nn_30";
24112
24282
  const content = "_content_1e2nn_35";
24113
- var styles$9 = {
24283
+ var styles$a = {
24114
24284
  mddForm,
24115
24285
  FormTitle,
24116
24286
  FormTitleHelp,
@@ -24140,7 +24310,7 @@ const ContentRender$1 = (props) => {
24140
24310
  };
24141
24311
  }, [schema]);
24142
24312
  return /* @__PURE__ */ React$1.createElement("div", {
24143
- className: styles$9.content
24313
+ className: styles$a.content
24144
24314
  }, /* @__PURE__ */ React$1.createElement(FormilyForm$1, {
24145
24315
  ...formilyForm,
24146
24316
  hiddenSubmit: true
@@ -24160,14 +24330,14 @@ function MddForm(props) {
24160
24330
  contentStyle
24161
24331
  } = props;
24162
24332
  return /* @__PURE__ */ React$1.createElement("div", {
24163
- className: styles$9.mddForm,
24333
+ className: styles$a.mddForm,
24164
24334
  style: style2
24165
24335
  }, /* @__PURE__ */ React$1.createElement("div", {
24166
- className: styles$9.FormTitle
24336
+ className: styles$a.FormTitle
24167
24337
  }, title2), help && /* @__PURE__ */ React$1.createElement("div", {
24168
- className: styles$9.FormTitleHelp
24338
+ className: styles$a.FormTitleHelp
24169
24339
  }, help), /* @__PURE__ */ React$1.createElement("div", {
24170
- className: styles$9.FormContent,
24340
+ className: styles$a.FormContent,
24171
24341
  style: contentStyle
24172
24342
  }, children || /* @__PURE__ */ React$1.createElement(ContentRender$1, {
24173
24343
  values: data,
@@ -24295,6 +24465,10 @@ const columnsTypeOptions = [
24295
24465
  value: "images",
24296
24466
  label: "\u9644\u4EF6/\u56FE\u7247"
24297
24467
  },
24468
+ {
24469
+ value: "blocks-table",
24470
+ label: "\u5217\u8868\u533A\u5757"
24471
+ },
24298
24472
  {
24299
24473
  value: "custom",
24300
24474
  label: "\u81EA\u5B9A\u4E49"
@@ -24580,7 +24754,7 @@ function HeaderToolbarPanel$1({ schema, moduleMap }) {
24580
24754
  }
24581
24755
  }));
24582
24756
  }
24583
- function TablePanel$2({ schema, swaggerFields = [] }) {
24757
+ function TablePanel$3({ schema, swaggerFields = [] }) {
24584
24758
  var _a2;
24585
24759
  const columnMddFormRef = React$1.useRef();
24586
24760
  const bulkMddFormRef = React$1.useRef();
@@ -24591,7 +24765,7 @@ function TablePanel$2({ schema, swaggerFields = [] }) {
24591
24765
  schema.on("$updated", (changeData, ignoreUpdate) => {
24592
24766
  !ignoreUpdate && forceUpdate({});
24593
24767
  });
24594
- hackRowDetail(schema);
24768
+ hackRowDetail$1(schema);
24595
24769
  }, []);
24596
24770
  const primaryKey = schema.get("primaryKey");
24597
24771
  const bulkActions = schema.get("bulkActions");
@@ -24875,7 +25049,7 @@ function TablePanel$2({ schema, swaggerFields = [] }) {
24875
25049
  type: "prompt"
24876
25050
  }), " \u5982\u679C\u6709\u6027\u80FD\u95EE\u9898\u53EF\u4EE5\u5173\u95ED\u8BE5\u5C5E\u6027\uFF0C\u540C\u65F6\u624B\u52A8\u8BBE\u7F6E\u5217\u5BBD")));
24877
25051
  }
24878
- function hackRowDetail(schema) {
25052
+ function hackRowDetail$1(schema) {
24879
25053
  const rowDetail = schema.get("rowDetail");
24880
25054
  if (rowDetail) {
24881
25055
  schema.set("rowDetail", void 0);
@@ -24903,7 +25077,7 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
24903
25077
  function type(obj) {
24904
25078
  return toString2.call(obj).slice(8, -1);
24905
25079
  }
24906
- var assign2 = Object.assign || function(target, source) {
25080
+ var assign = Object.assign || function(target, source) {
24907
25081
  getAllKeys2(source).forEach(function(key) {
24908
25082
  if (hasOwnProperty2.call(source, key)) {
24909
25083
  target[key] = source[key];
@@ -24917,11 +25091,11 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
24917
25091
  return Object.keys(obj);
24918
25092
  };
24919
25093
  function copy(object) {
24920
- return Array.isArray(object) ? assign2(object.constructor(object.length), object) : type(object) === "Map" ? new Map(object) : type(object) === "Set" ? new Set(object) : object && typeof object === "object" ? assign2(Object.create(Object.getPrototypeOf(object)), object) : object;
25094
+ return Array.isArray(object) ? assign(object.constructor(object.length), object) : type(object) === "Map" ? new Map(object) : type(object) === "Set" ? new Set(object) : object && typeof object === "object" ? assign(Object.create(Object.getPrototypeOf(object)), object) : object;
24921
25095
  }
24922
25096
  var Context = function() {
24923
25097
  function Context2() {
24924
- this.commands = assign2({}, defaultCommands);
25098
+ this.commands = assign({}, defaultCommands);
24925
25099
  this.update = this.update.bind(this);
24926
25100
  this.update.extend = this.extend = this.extend.bind(this);
24927
25101
  this.update.isEquals = function(x, y) {
@@ -25080,7 +25254,7 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
25080
25254
  exports.isEquals = defaultContext.update.isEquals;
25081
25255
  exports.extend = defaultContext.extend;
25082
25256
  exports.default = defaultContext.update;
25083
- exports.default.default = module.exports = assign2(exports.default, exports);
25257
+ exports.default.default = module.exports = assign(exports.default, exports);
25084
25258
  function invariantPushAndUnshift(value, spec, command) {
25085
25259
  invariant2(Array.isArray(value), function() {
25086
25260
  return "update(): expected target of " + stringifiable(command) + " to be an array; got " + stringifiable(value) + ".";
@@ -25136,7 +25310,7 @@ const tableArrayBottom$1 = "_tableArrayBottom_16ght_32";
25136
25310
  const itemTitle$1 = "_itemTitle_16ght_39";
25137
25311
  const collapseContent$1 = "_collapseContent_16ght_69";
25138
25312
  const itemClose$1 = "_itemClose_16ght_73";
25139
- var styles$8 = {
25313
+ var styles$9 = {
25140
25314
  mddTableArray: mddTableArray$1,
25141
25315
  tableArrayTitle: tableArrayTitle$1,
25142
25316
  tableArrayContent: tableArrayContent$1,
@@ -25181,7 +25355,7 @@ const TitleRender$1 = (props) => {
25181
25355
  });
25182
25356
  const opacity = isDragging ? 0 : 1;
25183
25357
  draggable && drag(drop(ref));
25184
- const cls = classnames.bind(styles$8)({
25358
+ const cls = classnames.bind(styles$9)({
25185
25359
  itemTitle: "itemTitle",
25186
25360
  "drop-over-upward": isOver && index2 < sourceItem.index,
25187
25361
  "drop-over-downward": isOver && index2 > sourceItem.index
@@ -25194,7 +25368,7 @@ const TitleRender$1 = (props) => {
25194
25368
  }, customRender && customRender({ data, index: index2, onChange, moduleDataSource }), /* @__PURE__ */ React$1.createElement(Icon, {
25195
25369
  type: "close",
25196
25370
  size: "small",
25197
- className: styles$8.itemClose,
25371
+ className: styles$9.itemClose,
25198
25372
  onClick: onRemove
25199
25373
  }));
25200
25374
  };
@@ -25231,9 +25405,9 @@ function MddTableSimpleArray(props) {
25231
25405
  onChange({ record, index: index2, data });
25232
25406
  };
25233
25407
  return /* @__PURE__ */ React$1.createElement("div", {
25234
- className: styles$8.mddTableArray
25408
+ className: styles$9.mddTableArray
25235
25409
  }, /* @__PURE__ */ React$1.createElement("div", {
25236
- className: styles$8.tableArrayTitle
25410
+ className: styles$9.tableArrayTitle
25237
25411
  }, title2, tip && /* @__PURE__ */ React$1.createElement(Balloon, {
25238
25412
  trigger: /* @__PURE__ */ React$1.createElement(Icon, {
25239
25413
  type: "help",
@@ -25241,7 +25415,7 @@ function MddTableSimpleArray(props) {
25241
25415
  }),
25242
25416
  align: "t"
25243
25417
  }, tip)), /* @__PURE__ */ React$1.createElement("div", {
25244
- className: styles$8.tableArrayContent
25418
+ className: styles$9.tableArrayContent
25245
25419
  }, /* @__PURE__ */ React$1.createElement(DndProvider, {
25246
25420
  backend: HTML5Backend
25247
25421
  }, /* @__PURE__ */ React$1.createElement(Collapse, {
@@ -25260,28 +25434,28 @@ function MddTableSimpleArray(props) {
25260
25434
  customRender: titleRender
25261
25435
  })
25262
25436
  }, /* @__PURE__ */ React$1.createElement("div", {
25263
- className: styles$8.collapseContent
25437
+ className: styles$9.collapseContent
25264
25438
  }, contentRender2({ data: item, index: idx, onChange: onTableArrayChange })));
25265
25439
  })))), /* @__PURE__ */ React$1.createElement("div", {
25266
- className: styles$8.tableArrayBottom
25440
+ className: styles$9.tableArrayBottom
25267
25441
  }, /* @__PURE__ */ React$1.createElement(Button, {
25268
25442
  onClick: onAdd,
25269
25443
  style: { padding: "0 48px" }
25270
25444
  }, "\u6DFB\u52A0\u9879")));
25271
25445
  }
25272
- const customTabItem$4 = "_customTabItem_119xt_1";
25273
- const tabTitle$4 = "_tabTitle_119xt_5";
25274
- const tabLabel$4 = "_tabLabel_119xt_9";
25275
- const middleBox = "_middleBox_119xt_20";
25276
- const middleBoxLeft = "_middleBoxLeft_119xt_26";
25277
- const middleBoxRight = "_middleBoxRight_119xt_31";
25278
- var styles$7 = {
25279
- customTabItem: customTabItem$4,
25280
- tabTitle: tabTitle$4,
25281
- tabLabel: tabLabel$4,
25282
- middleBox,
25283
- middleBoxLeft,
25284
- middleBoxRight
25446
+ const customTabItem$5 = "_customTabItem_119xt_1";
25447
+ const tabTitle$5 = "_tabTitle_119xt_5";
25448
+ const tabLabel$5 = "_tabLabel_119xt_9";
25449
+ const middleBox$1 = "_middleBox_119xt_20";
25450
+ const middleBoxLeft$1 = "_middleBoxLeft_119xt_26";
25451
+ const middleBoxRight$1 = "_middleBoxRight_119xt_31";
25452
+ var styles$8 = {
25453
+ customTabItem: customTabItem$5,
25454
+ tabTitle: tabTitle$5,
25455
+ tabLabel: tabLabel$5,
25456
+ middleBox: middleBox$1,
25457
+ middleBoxLeft: middleBoxLeft$1,
25458
+ middleBoxRight: middleBoxRight$1
25285
25459
  };
25286
25460
  const Middle_Module_Opts = [
25287
25461
  {
@@ -25336,47 +25510,47 @@ function contentRender$1(props) {
25336
25510
  };
25337
25511
  const moduleValue = schema.get("value");
25338
25512
  return /* @__PURE__ */ React$1.createElement("div", null, /* @__PURE__ */ React$1.createElement("div", {
25339
- className: styles$7.middleBox
25513
+ className: styles$8.middleBox
25340
25514
  }, /* @__PURE__ */ React$1.createElement("label", {
25341
- className: styles$7.middleBoxLeft
25515
+ className: styles$8.middleBoxLeft
25342
25516
  }, "\u6E32\u67D3\u6A21\u5757\uFF1A"), /* @__PURE__ */ React$1.createElement(Select$2.AutoComplete, {
25343
25517
  dataSource: Middle_Module_Opts,
25344
25518
  size: "small",
25345
- className: styles$7.middleBoxRight,
25519
+ className: styles$8.middleBoxRight,
25346
25520
  value: moduleValue,
25347
25521
  onChange: (val) => onBaseInfoChange("value", val)
25348
25522
  })), /* @__PURE__ */ React$1.createElement("div", {
25349
- className: styles$7.middleBox
25523
+ className: styles$8.middleBox
25350
25524
  }, /* @__PURE__ */ React$1.createElement("label", {
25351
- className: styles$7.middleBoxLeft
25525
+ className: styles$8.middleBoxLeft
25352
25526
  }, "\u6A21\u5757\u53C2\u6570\uFF1A"), /* @__PURE__ */ React$1.createElement(TableFormProxy, {
25353
- className: styles$7.middleBoxRight,
25527
+ className: styles$8.middleBoxRight,
25354
25528
  value: schema.get("params"),
25355
25529
  onChange: (v2) => onBaseInfoChange("params", v2)
25356
25530
  })), moduleValue === "ftp-tabs" && /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement("div", {
25357
- className: styles$7.middleBox
25531
+ className: styles$8.middleBox
25358
25532
  }, /* @__PURE__ */ React$1.createElement("label", {
25359
- className: styles$7.middleBoxLeft
25533
+ className: styles$8.middleBoxLeft
25360
25534
  }, "\u63A5\u53E3\u8BF7\u6C42KEY\uFF1A"), /* @__PURE__ */ React$1.createElement(Input$1, {
25361
- className: styles$7.middleBoxRight,
25535
+ className: styles$8.middleBoxRight,
25362
25536
  value: schema.get("dataIndex"),
25363
25537
  size: "small",
25364
25538
  onChange: (v2) => onBaseInfoChange("dataIndex", v2)
25365
25539
  })), /* @__PURE__ */ React$1.createElement("div", {
25366
- className: styles$7.middleBox
25540
+ className: styles$8.middleBox
25367
25541
  }, /* @__PURE__ */ React$1.createElement("label", {
25368
- className: styles$7.middleBoxLeft
25542
+ className: styles$8.middleBoxLeft
25369
25543
  }, "\u9ED8\u8BA4\u503C\uFF1A"), /* @__PURE__ */ React$1.createElement(DynamicValueBase, {
25370
- className: styles$7.middleBoxRight,
25544
+ className: styles$8.middleBoxRight,
25371
25545
  value: schema.get("defaultTabValue"),
25372
25546
  size: "small",
25373
25547
  onChange: (v2) => onBaseInfoChange("defaultTabValue", v2)
25374
25548
  })), /* @__PURE__ */ React$1.createElement("div", {
25375
- className: styles$7.middleBox
25549
+ className: styles$8.middleBox
25376
25550
  }, /* @__PURE__ */ React$1.createElement("label", {
25377
- className: styles$7.middleBoxLeft
25551
+ className: styles$8.middleBoxLeft
25378
25552
  }, "\u591A\u6807\u7B7E\u6570\u636E\u6E90\uFF1A"), /* @__PURE__ */ React$1.createElement("div", {
25379
- className: styles$7.middleBoxRight
25553
+ className: styles$8.middleBoxRight
25380
25554
  }, /* @__PURE__ */ React$1.createElement(AjaxSchemaForm, {
25381
25555
  schema: schema.getSourcePanel(),
25382
25556
  isSelectType: false
@@ -25389,16 +25563,16 @@ function contentRender$1(props) {
25389
25563
  href: "https://alidocs.dingtalk.com/i/nodes/dpYLaezmVNRMGX56C1ZxqyYdVrMqPxX6"
25390
25564
  }, "\u6587\u6863"))))));
25391
25565
  }
25392
- const CustomTabItem$4 = ({ title: title2, icon }) => {
25566
+ const CustomTabItem$5 = ({ title: title2, icon }) => {
25393
25567
  return /* @__PURE__ */ React$1.createElement("div", {
25394
- className: styles$7.customTabItem
25568
+ className: styles$8.customTabItem
25395
25569
  }, /* @__PURE__ */ React$1.createElement("div", {
25396
- className: styles$7.tabTitle
25570
+ className: styles$8.tabTitle
25397
25571
  }, /* @__PURE__ */ React$1.createElement(Icon, {
25398
25572
  type: icon,
25399
25573
  size: "small"
25400
25574
  }), /* @__PURE__ */ React$1.createElement("span", {
25401
- className: styles$7.tabLabel
25575
+ className: styles$8.tabLabel
25402
25576
  }, title2)));
25403
25577
  };
25404
25578
  function FtpBuild$1({ schema, moduleMap }) {
@@ -25413,7 +25587,7 @@ function FtpBuild$1({ schema, moduleMap }) {
25413
25587
  shape: "wrapped",
25414
25588
  tabPosition: "left",
25415
25589
  className: "build-page-tab",
25416
- tabRender: (key, props) => /* @__PURE__ */ React$1.createElement(CustomTabItem$4, {
25590
+ tabRender: (key, props) => /* @__PURE__ */ React$1.createElement(CustomTabItem$5, {
25417
25591
  key,
25418
25592
  ...props
25419
25593
  })
@@ -25438,7 +25612,7 @@ function FtpBuild$1({ schema, moduleMap }) {
25438
25612
  })), /* @__PURE__ */ React$1.createElement(Tab.Item, {
25439
25613
  title: "\u5185\u5BB9\u533A",
25440
25614
  icon: "detail"
25441
- }, /* @__PURE__ */ React$1.createElement(TablePanel$2, {
25615
+ }, /* @__PURE__ */ React$1.createElement(TablePanel$3, {
25442
25616
  schema: schema.getTablePanel(),
25443
25617
  swaggerFields: responseFields,
25444
25618
  moduleMap
@@ -25455,6 +25629,106 @@ function FtpBuild$1({ schema, moduleMap }) {
25455
25629
  isSelectType: false
25456
25630
  }))));
25457
25631
  }
25632
+ function TablePanel$2({ schema, swaggerFields = [] }) {
25633
+ const columnMddFormRef = React$1.useRef();
25634
+ const [_2, forceUpdate] = useState({});
25635
+ useEffect(() => {
25636
+ schema.on("$updated", (changeData, ignoreUpdate) => {
25637
+ !ignoreUpdate && forceUpdate({});
25638
+ });
25639
+ hackRowDetail(schema);
25640
+ }, []);
25641
+ const columns = schema.get("columns");
25642
+ const onAddHandle = (key) => {
25643
+ var _a2;
25644
+ switch (key) {
25645
+ case "columns":
25646
+ schema.add(
25647
+ {
25648
+ type: "text",
25649
+ label: "\u5C55\u793A\u9879",
25650
+ name: ""
25651
+ },
25652
+ "columns",
25653
+ true
25654
+ );
25655
+ (_a2 = columnMddFormRef.current) == null ? void 0 : _a2.updateData(schema.get("columns"));
25656
+ break;
25657
+ }
25658
+ };
25659
+ const onRemoveHandle = (index2, key) => {
25660
+ var _a2;
25661
+ schema.remove(index2, key, true);
25662
+ if (key === "columns") {
25663
+ (_a2 = columnMddFormRef.current) == null ? void 0 : _a2.updateData(schema.get("columns"));
25664
+ }
25665
+ };
25666
+ const onChangeHandle = ({ index: index2, record }, key) => {
25667
+ schema.update(index2, record, key, true);
25668
+ };
25669
+ return /* @__PURE__ */ React$1.createElement("div", null, /* @__PURE__ */ React$1.createElement(MddTableForm$1, {
25670
+ ref: columnMddFormRef,
25671
+ data: columns,
25672
+ title: "\u914D\u7F6E\u8868\u683C\u5217",
25673
+ componentOptions: columnsTypeOptionsWithCnTable.filter((col) => col.value !== "blocks-table"),
25674
+ onAdd: () => onAddHandle("columns"),
25675
+ onRemove: (index2) => onRemoveHandle(index2, "columns"),
25676
+ onChange: ({ index: index2, record }) => onChangeHandle({ index: index2, record }, "columns"),
25677
+ onSort: (newList) => {
25678
+ schema.setItemAll(newList, "columns", true);
25679
+ }
25680
+ }));
25681
+ }
25682
+ function hackRowDetail(schema) {
25683
+ const rowDetail = schema.get("rowDetail");
25684
+ if (rowDetail) {
25685
+ schema.set("rowDetail", void 0);
25686
+ }
25687
+ }
25688
+ const customTabItem$4 = "_customTabItem_119xt_1";
25689
+ const tabTitle$4 = "_tabTitle_119xt_5";
25690
+ const tabLabel$4 = "_tabLabel_119xt_9";
25691
+ const middleBox = "_middleBox_119xt_20";
25692
+ const middleBoxLeft = "_middleBoxLeft_119xt_26";
25693
+ const middleBoxRight = "_middleBoxRight_119xt_31";
25694
+ var styles$7 = {
25695
+ customTabItem: customTabItem$4,
25696
+ tabTitle: tabTitle$4,
25697
+ tabLabel: tabLabel$4,
25698
+ middleBox,
25699
+ middleBoxLeft,
25700
+ middleBoxRight
25701
+ };
25702
+ const CustomTabItem$4 = ({ title: title2, icon }) => {
25703
+ return /* @__PURE__ */ React$1.createElement("div", {
25704
+ className: styles$7.customTabItem
25705
+ }, /* @__PURE__ */ React$1.createElement("div", {
25706
+ className: styles$7.tabTitle
25707
+ }, /* @__PURE__ */ React$1.createElement(Icon, {
25708
+ type: icon,
25709
+ size: "small"
25710
+ }), /* @__PURE__ */ React$1.createElement("span", {
25711
+ className: styles$7.tabLabel
25712
+ }, title2)));
25713
+ };
25714
+ function BlocksBuild({ schema, moduleMap }) {
25715
+ return /* @__PURE__ */ React$1.createElement(Tab, {
25716
+ animation: false,
25717
+ lazyLoad: false,
25718
+ shape: "wrapped",
25719
+ tabPosition: "left",
25720
+ className: "build-page-tab",
25721
+ tabRender: (key, props) => /* @__PURE__ */ React$1.createElement(CustomTabItem$4, {
25722
+ key,
25723
+ ...props
25724
+ })
25725
+ }, /* @__PURE__ */ React$1.createElement(Tab.Item, {
25726
+ title: "\u5185\u5BB9\u533A",
25727
+ icon: "detail"
25728
+ }, /* @__PURE__ */ React$1.createElement(TablePanel$2, {
25729
+ schema: schema.getTablePanel()
25730
+ })));
25731
+ }
25458
25732
  const mddTableArray = "_mddTableArray_16ght_1";
25459
25733
  const tableArrayTitle = "_tableArrayTitle_16ght_14";
25460
25734
  const tableArrayContent = "_tableArrayContent_16ght_18";
@@ -26156,7 +26430,9 @@ function DetailColumns(props) {
26156
26430
  defaultValue: data.get("columnsDirection")
26157
26431
  }, /* @__PURE__ */ React$1.createElement(CnRadio, {
26158
26432
  value: "row"
26159
- }, "\u5DE6\u53F3\u5E03\u5C40"))), /* @__PURE__ */ React$1.createElement(Form.Item, {
26433
+ }, "\u5DE6\u53F3\u5E03\u5C40"), /* @__PURE__ */ React$1.createElement(CnRadio, {
26434
+ value: "column"
26435
+ }, "\u4E0A\u4E0B\u5E03\u5C40"))), /* @__PURE__ */ React$1.createElement(Form.Item, {
26160
26436
  labelAlign: "left",
26161
26437
  label: "\u9690\u85CF\u5361\u7247\u5934\u90E8",
26162
26438
  name: "hideCardTitle"
@@ -27266,6 +27542,7 @@ function MDDEditor(props) {
27266
27542
  customSchema,
27267
27543
  moduleDataSource,
27268
27544
  refreshModuleDataSource,
27545
+ blocksDataSource,
27269
27546
  moduleMap = /* @__PURE__ */ new Map(),
27270
27547
  scriptTopButtons = []
27271
27548
  } = props;
@@ -27276,7 +27553,8 @@ function MDDEditor(props) {
27276
27553
  React$1.useEffect(() => {
27277
27554
  setModules({
27278
27555
  $ModuleDataSource: moduleDataSource,
27279
- $RefreshModuleDataSource: refreshModuleDataSource
27556
+ $RefreshModuleDataSource: refreshModuleDataSource,
27557
+ $BlocksDataSource: blocksDataSource
27280
27558
  });
27281
27559
  console.log("moduleDataSource: ", moduleDataSource);
27282
27560
  window.__MDD_ModuleDataSource = moduleDataSource;
@@ -27387,6 +27665,9 @@ function getCompAndSchemaFromSchemaJson(schemaJson, customComponent, customSchem
27387
27665
  case "edit-table": {
27388
27666
  return [customComponent || FtpBuild, customSchema || FtpSchema];
27389
27667
  }
27668
+ case "blocks-table": {
27669
+ return [customComponent || BlocksBuild, customSchema || BlocksSchema];
27670
+ }
27390
27671
  default:
27391
27672
  return null;
27392
27673
  }