@cniot/mdd-editor 0.2.0-beta.6 → 0.2.0-beta.7
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/README.MD +3 -0
- package/build/index.cjs.js +22 -16
- package/build/index.es.js +180 -149
- package/build/style.css +1 -1
- package/package.json +1 -1
- package/src/template/detail/components/DetailColumns.jsx +1 -1
package/build/index.es.js
CHANGED
|
@@ -1558,103 +1558,132 @@ class HeaderToolbar$1 extends JSONWatch {
|
|
|
1558
1558
|
return this.data || [];
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
var
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
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
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
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
|
-
|
|
1594
|
+
return result;
|
|
1608
1595
|
}
|
|
1609
|
-
|
|
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
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
"
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
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
|
-
|
|
1653
|
-
|
|
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
|
-
|
|
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
|
|
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 = (
|
|
1975
|
-
if (!
|
|
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[
|
|
1980
|
-
throw Error(`mdd-tool columns complier error: api meta has not api: ${
|
|
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[
|
|
2013
|
+
if (Object.prototype.hasOwnProperty.call(paths[api], "post")) {
|
|
1985
2014
|
method = "post";
|
|
1986
|
-
apiInfo = paths[
|
|
1987
|
-
} else if (Object.prototype.hasOwnProperty.call(paths[
|
|
2015
|
+
apiInfo = paths[api]["post"];
|
|
2016
|
+
} else if (Object.prototype.hasOwnProperty.call(paths[api], "get")) {
|
|
1988
2017
|
method = "get";
|
|
1989
|
-
apiInfo = paths[
|
|
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
|
|
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(
|
|
2464
|
+
function getApiInfo(api, swaggerInfo) {
|
|
2436
2465
|
const realSwaggerInfo = jsonSchemaRefParser(transferOpenAPI3ToSwagger2$1(swaggerInfo));
|
|
2437
|
-
return buildSwaggerApiJson(
|
|
2466
|
+
return buildSwaggerApiJson(api, realSwaggerInfo);
|
|
2438
2467
|
}
|
|
2439
|
-
function api2SchemaFromSwaggerApiInfo(
|
|
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:
|
|
2463
|
-
url:
|
|
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:
|
|
2509
|
-
url:
|
|
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:
|
|
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:
|
|
2582
|
-
url:
|
|
2610
|
+
value: api,
|
|
2611
|
+
url: api
|
|
2583
2612
|
},
|
|
2584
2613
|
submitApi: {
|
|
2585
2614
|
type: "ajax",
|
|
@@ -2611,9 +2640,9 @@ function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {
|
|
|
2611
2640
|
}
|
|
2612
2641
|
return merge_1(result, extraSchema);
|
|
2613
2642
|
}
|
|
2614
|
-
function api2SchemaFromSwagger(
|
|
2615
|
-
const apiInfo = getApiInfo(
|
|
2616
|
-
return api2SchemaFromSwaggerApiInfo(
|
|
2643
|
+
function api2SchemaFromSwagger(api, schemaType, swaggerInfo, extraSchema = {}) {
|
|
2644
|
+
const apiInfo = getApiInfo(api, swaggerInfo);
|
|
2645
|
+
return api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema);
|
|
2617
2646
|
}
|
|
2618
2647
|
function transferOpenAPI3ToSwagger2$1(data) {
|
|
2619
2648
|
if (data && data.components && data.components.schemas) {
|
|
@@ -2749,10 +2778,10 @@ class MiddleItem extends JSONWatch {
|
|
|
2749
2778
|
}
|
|
2750
2779
|
class FtpSchema$1 extends Schema {
|
|
2751
2780
|
constructor(props, isCompleteSchema = false) {
|
|
2752
|
-
const { api
|
|
2781
|
+
const { api, filter, headerToolbar, table, tabs, middleModules, ...more2 } = isCompleteSchema ? props.body : props;
|
|
2753
2782
|
super(more2);
|
|
2754
2783
|
this.type = "ftp";
|
|
2755
|
-
this.api = new AjaxSchema(
|
|
2784
|
+
this.api = new AjaxSchema(api);
|
|
2756
2785
|
this.filter = new Filter(filter);
|
|
2757
2786
|
this.headerToolbar = new HeaderToolbar$1(headerToolbar);
|
|
2758
2787
|
this.table = new TableSchema$1(table);
|
|
@@ -2826,12 +2855,12 @@ class FtpSchema$1 extends Schema {
|
|
|
2826
2855
|
}
|
|
2827
2856
|
initFromCache(schema) {
|
|
2828
2857
|
const { body, ...more2 } = schema;
|
|
2829
|
-
const { api
|
|
2858
|
+
const { api, filter, headerToolbar, table, tabs, middleModules } = body;
|
|
2830
2859
|
if (this.willDetach) {
|
|
2831
2860
|
this.willDetach();
|
|
2832
2861
|
}
|
|
2833
2862
|
this.init(more2);
|
|
2834
|
-
this.api.updateAll(
|
|
2863
|
+
this.api.updateAll(api);
|
|
2835
2864
|
this.filter.updateAll(filter);
|
|
2836
2865
|
this.headerToolbar.updateAll(headerToolbar);
|
|
2837
2866
|
this.table.updateAll(this.compatTableHandle(table));
|
|
@@ -3084,11 +3113,11 @@ function getWatchByRequest(params) {
|
|
|
3084
3113
|
}
|
|
3085
3114
|
class FormilyFormV2Schema extends Schema {
|
|
3086
3115
|
constructor(props, isCompleteSchema = false) {
|
|
3087
|
-
const { api
|
|
3116
|
+
const { api, initApi, effectApi, baseInfo, fields: fields2, ...more2 } = isCompleteSchema ? props.body : props;
|
|
3088
3117
|
super(more2);
|
|
3089
3118
|
this.type = "formily-form-v2";
|
|
3090
3119
|
this.baseInfo = new FormInfo(baseInfo);
|
|
3091
|
-
this.api = new AjaxSchema(
|
|
3120
|
+
this.api = new AjaxSchema(api);
|
|
3092
3121
|
if (!initApi) {
|
|
3093
3122
|
this.initApi = new AjaxSchemaQueue([]);
|
|
3094
3123
|
} else {
|
|
@@ -3130,12 +3159,12 @@ class FormilyFormV2Schema extends Schema {
|
|
|
3130
3159
|
}
|
|
3131
3160
|
initFromCache(schema) {
|
|
3132
3161
|
const { body, ...more2 } = schema;
|
|
3133
|
-
const { api
|
|
3162
|
+
const { api, initApi = [], effectApi = [], baseInfo, fields: fields2 } = body;
|
|
3134
3163
|
if (this.willDetach) {
|
|
3135
3164
|
this.willDetach();
|
|
3136
3165
|
}
|
|
3137
3166
|
this.init(more2);
|
|
3138
|
-
this.api.updateAll(
|
|
3167
|
+
this.api.updateAll(api);
|
|
3139
3168
|
if (!initApi) {
|
|
3140
3169
|
this.initApi.updateAll([]);
|
|
3141
3170
|
} else {
|
|
@@ -13065,23 +13094,23 @@ function useSwagger() {
|
|
|
13065
13094
|
}
|
|
13066
13095
|
};
|
|
13067
13096
|
}
|
|
13068
|
-
function createApiSelectItem(summary,
|
|
13097
|
+
function createApiSelectItem(summary, api, method, request = []) {
|
|
13069
13098
|
return {
|
|
13070
13099
|
summary,
|
|
13071
|
-
label: `${summary} - ${method} ${
|
|
13072
|
-
value:
|
|
13073
|
-
url:
|
|
13100
|
+
label: `${summary} - ${method} ${api}`,
|
|
13101
|
+
value: api,
|
|
13102
|
+
url: api,
|
|
13074
13103
|
method,
|
|
13075
13104
|
request,
|
|
13076
|
-
parameters:
|
|
13105
|
+
parameters: api.parameters
|
|
13077
13106
|
};
|
|
13078
13107
|
}
|
|
13079
13108
|
const getDataSourceArray$1 = (paths = {}) => {
|
|
13080
13109
|
try {
|
|
13081
13110
|
return Object.keys(paths).map((key) => {
|
|
13082
|
-
const
|
|
13083
|
-
const apiPost =
|
|
13084
|
-
const apiGet =
|
|
13111
|
+
const api = paths[key];
|
|
13112
|
+
const apiPost = api.post || api.POST;
|
|
13113
|
+
const apiGet = api.get || api.GET;
|
|
13085
13114
|
if (apiPost) {
|
|
13086
13115
|
return createApiSelectItem(apiPost.summary, key, "POST");
|
|
13087
13116
|
} else if (apiGet) {
|
|
@@ -13154,8 +13183,8 @@ class PersistentStorage {
|
|
|
13154
13183
|
}
|
|
13155
13184
|
var storage = new PersistentStorage();
|
|
13156
13185
|
class DataSourceSchema extends JSONWatch {
|
|
13157
|
-
constructor(
|
|
13158
|
-
const { url, method = "get", ...more2 } =
|
|
13186
|
+
constructor(api) {
|
|
13187
|
+
const { url, method = "get", ...more2 } = api || {};
|
|
13159
13188
|
super({
|
|
13160
13189
|
url,
|
|
13161
13190
|
method,
|
|
@@ -13867,10 +13896,10 @@ function emitterVSCodeMessage(action, content2) {
|
|
|
13867
13896
|
function emitSave(fileMapContent) {
|
|
13868
13897
|
emitterVSCodeMessage(EMIT_EVENT_ACTION_SAVE, fileMapContent);
|
|
13869
13898
|
}
|
|
13870
|
-
const buildSchema = (schemaType,
|
|
13899
|
+
const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
13871
13900
|
let schemaObj = null;
|
|
13872
13901
|
if (schemaType === "ftp") {
|
|
13873
|
-
schemaObj = new FtpSchema$1({ host:
|
|
13902
|
+
schemaObj = new FtpSchema$1({ host: api, title: "" });
|
|
13874
13903
|
const realDataSource = {
|
|
13875
13904
|
...mainDataSource,
|
|
13876
13905
|
type: "ajax",
|
|
@@ -13883,14 +13912,14 @@ const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
|
|
|
13883
13912
|
};
|
|
13884
13913
|
schemaObj.getDataSourcePanel().update(realDataSource);
|
|
13885
13914
|
} else if (schemaType === "formily-form") {
|
|
13886
|
-
schemaObj = new FormilyFormSchema({ host:
|
|
13915
|
+
schemaObj = new FormilyFormSchema({ host: api, title: "" });
|
|
13887
13916
|
const realDataSource = {
|
|
13888
13917
|
...mainDataSource,
|
|
13889
13918
|
type: "ajax"
|
|
13890
13919
|
};
|
|
13891
13920
|
schemaObj.getDataSourcePanel().update(realDataSource);
|
|
13892
13921
|
} else if (schemaType === "formily-form-v2") {
|
|
13893
|
-
schemaObj = new FormilyFormV2Schema({ host:
|
|
13922
|
+
schemaObj = new FormilyFormV2Schema({ host: api, title: "" });
|
|
13894
13923
|
const realDataSource = {
|
|
13895
13924
|
...mainDataSource,
|
|
13896
13925
|
type: "ajax"
|
|
@@ -13898,7 +13927,7 @@ const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
|
|
|
13898
13927
|
schemaObj.getApiPanel().update(realDataSource);
|
|
13899
13928
|
} else if (schemaType === "detail") {
|
|
13900
13929
|
if (moreProps == null ? void 0 : moreProps.children) {
|
|
13901
|
-
schemaObj = new DetailSchema({ host:
|
|
13930
|
+
schemaObj = new DetailSchema({ host: api, title: "", ...moreProps });
|
|
13902
13931
|
} else {
|
|
13903
13932
|
const realDataSource = {
|
|
13904
13933
|
...mainDataSource,
|
|
@@ -13907,10 +13936,10 @@ const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
|
|
|
13907
13936
|
detailData: "$RET.data"
|
|
13908
13937
|
}
|
|
13909
13938
|
};
|
|
13910
|
-
schemaObj = new DetailSchema({ host:
|
|
13939
|
+
schemaObj = new DetailSchema({ host: api, title: "", initDataSource: realDataSource });
|
|
13911
13940
|
}
|
|
13912
13941
|
} else if (schemaType === "edit-table") {
|
|
13913
|
-
schemaObj = new FtpSchema({ host:
|
|
13942
|
+
schemaObj = new FtpSchema({ host: api, title: "", ...moreProps });
|
|
13914
13943
|
const realDataSource = {
|
|
13915
13944
|
...mainDataSource,
|
|
13916
13945
|
type: "ajax",
|
|
@@ -13937,8 +13966,8 @@ const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
|
|
|
13937
13966
|
}
|
|
13938
13967
|
}, 500)
|
|
13939
13968
|
);
|
|
13940
|
-
if (
|
|
13941
|
-
axios.defaults.baseURL =
|
|
13969
|
+
if (api.indexOf("?") === -1 && api.indexOf("mocks") === -1) {
|
|
13970
|
+
axios.defaults.baseURL = api;
|
|
13942
13971
|
}
|
|
13943
13972
|
return schemaObj;
|
|
13944
13973
|
};
|
|
@@ -13947,11 +13976,11 @@ const buildSchemaObjFromSchema = (schema) => {
|
|
|
13947
13976
|
return null;
|
|
13948
13977
|
}
|
|
13949
13978
|
const { host, body } = schema;
|
|
13950
|
-
const { type, api
|
|
13979
|
+
const { type, api, ...more2 } = body || {};
|
|
13951
13980
|
if (!host || !type) {
|
|
13952
13981
|
return null;
|
|
13953
13982
|
}
|
|
13954
|
-
return buildSchema(type, host,
|
|
13983
|
+
return buildSchema(type, host, api, more2);
|
|
13955
13984
|
};
|
|
13956
13985
|
function useSchema() {
|
|
13957
13986
|
const { fetchSwaggerInfo } = useSwagger$1();
|
|
@@ -16474,9 +16503,9 @@ function AjaxFormDialog({ title: title2 = "\u6570\u636E\u6E90\u914D\u7F6E", sche
|
|
|
16474
16503
|
dataSource: swagger.apiList,
|
|
16475
16504
|
defaultValue: schema.get("url"),
|
|
16476
16505
|
onChange: (value) => {
|
|
16477
|
-
const
|
|
16478
|
-
if (
|
|
16479
|
-
schema.setAjaxRequest(value,
|
|
16506
|
+
const api = swagger.getApi(value);
|
|
16507
|
+
if (api) {
|
|
16508
|
+
schema.setAjaxRequest(value, api.method);
|
|
16480
16509
|
} else {
|
|
16481
16510
|
schema.set("url", value);
|
|
16482
16511
|
}
|
|
@@ -24903,7 +24932,7 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
|
|
|
24903
24932
|
function type(obj) {
|
|
24904
24933
|
return toString2.call(obj).slice(8, -1);
|
|
24905
24934
|
}
|
|
24906
|
-
var
|
|
24935
|
+
var assign = Object.assign || function(target, source) {
|
|
24907
24936
|
getAllKeys2(source).forEach(function(key) {
|
|
24908
24937
|
if (hasOwnProperty2.call(source, key)) {
|
|
24909
24938
|
target[key] = source[key];
|
|
@@ -24917,11 +24946,11 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
|
|
|
24917
24946
|
return Object.keys(obj);
|
|
24918
24947
|
};
|
|
24919
24948
|
function copy(object) {
|
|
24920
|
-
return Array.isArray(object) ?
|
|
24949
|
+
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
24950
|
}
|
|
24922
24951
|
var Context = function() {
|
|
24923
24952
|
function Context2() {
|
|
24924
|
-
this.commands =
|
|
24953
|
+
this.commands = assign({}, defaultCommands);
|
|
24925
24954
|
this.update = this.update.bind(this);
|
|
24926
24955
|
this.update.extend = this.extend = this.extend.bind(this);
|
|
24927
24956
|
this.update.isEquals = function(x, y) {
|
|
@@ -25080,7 +25109,7 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
|
|
|
25080
25109
|
exports.isEquals = defaultContext.update.isEquals;
|
|
25081
25110
|
exports.extend = defaultContext.extend;
|
|
25082
25111
|
exports.default = defaultContext.update;
|
|
25083
|
-
exports.default.default = module.exports =
|
|
25112
|
+
exports.default.default = module.exports = assign(exports.default, exports);
|
|
25084
25113
|
function invariantPushAndUnshift(value, spec, command) {
|
|
25085
25114
|
invariant2(Array.isArray(value), function() {
|
|
25086
25115
|
return "update(): expected target of " + stringifiable(command) + " to be an array; got " + stringifiable(value) + ".";
|
|
@@ -26156,7 +26185,9 @@ function DetailColumns(props) {
|
|
|
26156
26185
|
defaultValue: data.get("columnsDirection")
|
|
26157
26186
|
}, /* @__PURE__ */ React$1.createElement(CnRadio, {
|
|
26158
26187
|
value: "row"
|
|
26159
|
-
}, "\u5DE6\u53F3\u5E03\u5C40")
|
|
26188
|
+
}, "\u5DE6\u53F3\u5E03\u5C40"), /* @__PURE__ */ React$1.createElement(CnRadio, {
|
|
26189
|
+
value: "column"
|
|
26190
|
+
}, "\u4E0A\u4E0B\u5E03\u5C40"))), /* @__PURE__ */ React$1.createElement(Form.Item, {
|
|
26160
26191
|
labelAlign: "left",
|
|
26161
26192
|
label: "\u9690\u85CF\u5361\u7247\u5934\u90E8",
|
|
26162
26193
|
name: "hideCardTitle"
|