@cniot/mdd-editor 0.2.0-beta.8 → 0.2.0-beta.9
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 +16 -22
- package/build/index.es.js +152 -177
- package/package.json +1 -1
- package/src/template/const.js +4 -1
package/build/index.es.js
CHANGED
|
@@ -1558,132 +1558,103 @@ class HeaderToolbar$1 extends JSONWatch {
|
|
|
1558
1558
|
return this.data || [];
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
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
|
-
};
|
|
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];
|
|
1583
1567
|
}
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
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);
|
|
1595
1593
|
}
|
|
1596
|
-
|
|
1597
|
-
|
|
1594
|
+
if (attributes.expires) {
|
|
1595
|
+
attributes.expires = attributes.expires.toUTCString();
|
|
1598
1596
|
}
|
|
1599
|
-
|
|
1600
|
-
|
|
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;
|
|
1601
1602
|
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
}
|
|
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;
|
|
1603
|
+
stringifiedAttributes += "; " + attributeName;
|
|
1604
|
+
if (attributes[attributeName] === true) {
|
|
1605
|
+
continue;
|
|
1634
1606
|
}
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
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
|
-
}
|
|
1607
|
+
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
1608
|
+
}
|
|
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;
|
|
1614
|
+
}
|
|
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;
|
|
1663
1625
|
}
|
|
1664
|
-
|
|
1626
|
+
} catch (e) {
|
|
1665
1627
|
}
|
|
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;
|
|
1681
1628
|
}
|
|
1682
|
-
return
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
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);
|
|
1649
|
+
}
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
attributes: { value: Object.freeze(defaultAttributes) },
|
|
1653
|
+
converter: { value: Object.freeze(converter) }
|
|
1654
|
+
}
|
|
1655
|
+
);
|
|
1656
|
+
}
|
|
1657
|
+
var api = init$1(defaultConverter, { path: "/" });
|
|
1687
1658
|
const calcWordWidth = (str) => {
|
|
1688
1659
|
const Min_Width = 50;
|
|
1689
1660
|
if (!str || typeof str !== "string")
|
|
@@ -1703,7 +1674,7 @@ const upperFirst$1 = (str) => {
|
|
|
1703
1674
|
return str.slice(0, 1).toUpperCase() + temp;
|
|
1704
1675
|
};
|
|
1705
1676
|
const getGlobalSizeFromCookie = () => {
|
|
1706
|
-
return
|
|
1677
|
+
return api == null ? void 0 : api.get("CNUICOOKIESIZE");
|
|
1707
1678
|
};
|
|
1708
1679
|
const getDefaultFomrLabelAlign = () => {
|
|
1709
1680
|
const globalSize = getGlobalSizeFromCookie();
|
|
@@ -2000,29 +1971,29 @@ const openApi3Support = (apiInfo) => {
|
|
|
2000
1971
|
responses: res
|
|
2001
1972
|
};
|
|
2002
1973
|
};
|
|
2003
|
-
var buildSwaggerApiJson = (
|
|
2004
|
-
if (!
|
|
1974
|
+
var buildSwaggerApiJson = (api2, apiMeta) => {
|
|
1975
|
+
if (!api2 || !apiMeta) {
|
|
2005
1976
|
throw Error("mdd-tool columns complier error: api or api meta is null");
|
|
2006
1977
|
}
|
|
2007
1978
|
const { paths, definitions } = apiMeta || {};
|
|
2008
|
-
if (!paths[
|
|
2009
|
-
throw Error(`mdd-tool columns complier error: api meta has not api: ${
|
|
1979
|
+
if (!paths[api2]) {
|
|
1980
|
+
throw Error(`mdd-tool columns complier error: api meta has not api: ${api2}`);
|
|
2010
1981
|
}
|
|
2011
1982
|
let method = "";
|
|
2012
1983
|
let apiInfo = null;
|
|
2013
|
-
if (Object.prototype.hasOwnProperty.call(paths[
|
|
1984
|
+
if (Object.prototype.hasOwnProperty.call(paths[api2], "post")) {
|
|
2014
1985
|
method = "post";
|
|
2015
|
-
apiInfo = paths[
|
|
2016
|
-
} else if (Object.prototype.hasOwnProperty.call(paths[
|
|
1986
|
+
apiInfo = paths[api2]["post"];
|
|
1987
|
+
} else if (Object.prototype.hasOwnProperty.call(paths[api2], "get")) {
|
|
2017
1988
|
method = "get";
|
|
2018
|
-
apiInfo = paths[
|
|
1989
|
+
apiInfo = paths[api2]["get"];
|
|
2019
1990
|
} else {
|
|
2020
1991
|
throw Error("mdd-tool columns complier error: api method not support");
|
|
2021
1992
|
}
|
|
2022
1993
|
const { summary } = apiInfo;
|
|
2023
1994
|
const { parameters = [], responses } = openApi3Support(apiInfo);
|
|
2024
1995
|
return {
|
|
2025
|
-
api,
|
|
1996
|
+
api: api2,
|
|
2026
1997
|
method,
|
|
2027
1998
|
summary,
|
|
2028
1999
|
parameters: transfer$refToJson("parameters", parameters, definitions),
|
|
@@ -2461,11 +2432,11 @@ function handleDefinitions(obj, map, depth) {
|
|
|
2461
2432
|
function getSwaggerInfoFromJson(swaggerJson) {
|
|
2462
2433
|
return jsonSchemaRefParser(transferOpenAPI3ToSwagger2$1(swaggerJson));
|
|
2463
2434
|
}
|
|
2464
|
-
function getApiInfo(
|
|
2435
|
+
function getApiInfo(api2, swaggerInfo) {
|
|
2465
2436
|
const realSwaggerInfo = jsonSchemaRefParser(transferOpenAPI3ToSwagger2$1(swaggerInfo));
|
|
2466
|
-
return buildSwaggerApiJson(
|
|
2437
|
+
return buildSwaggerApiJson(api2, realSwaggerInfo);
|
|
2467
2438
|
}
|
|
2468
|
-
function api2SchemaFromSwaggerApiInfo(
|
|
2439
|
+
function api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema = {}) {
|
|
2469
2440
|
const { parameters = [], responses = [], method = "" } = apiInfo || {};
|
|
2470
2441
|
const methodUpperCase = method.toUpperCase();
|
|
2471
2442
|
const result = {
|
|
@@ -2488,8 +2459,8 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2488
2459
|
tableColumns: "$RET.data.tableColumns",
|
|
2489
2460
|
totalCount: "$RET.data.paging.totalCount"
|
|
2490
2461
|
},
|
|
2491
|
-
value:
|
|
2492
|
-
url:
|
|
2462
|
+
value: api2,
|
|
2463
|
+
url: api2
|
|
2493
2464
|
},
|
|
2494
2465
|
filter: {
|
|
2495
2466
|
maxVisibleRow: 2,
|
|
@@ -2534,8 +2505,8 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2534
2505
|
watch: [],
|
|
2535
2506
|
params: {},
|
|
2536
2507
|
formatResponseData: {},
|
|
2537
|
-
value:
|
|
2538
|
-
url:
|
|
2508
|
+
value: api2,
|
|
2509
|
+
url: api2
|
|
2539
2510
|
},
|
|
2540
2511
|
initApi: [],
|
|
2541
2512
|
effectApi: [],
|
|
@@ -2574,7 +2545,7 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2574
2545
|
label: "\u57FA\u7840\u4FE1\u606F",
|
|
2575
2546
|
source: [
|
|
2576
2547
|
{
|
|
2577
|
-
url:
|
|
2548
|
+
url: api2,
|
|
2578
2549
|
method: methodUpperCase,
|
|
2579
2550
|
type: "ajax",
|
|
2580
2551
|
formatResponseData: {
|
|
@@ -2607,8 +2578,8 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2607
2578
|
formatResponseData: {
|
|
2608
2579
|
tableData: "$RET.data.tableData"
|
|
2609
2580
|
},
|
|
2610
|
-
value:
|
|
2611
|
-
url:
|
|
2581
|
+
value: api2,
|
|
2582
|
+
url: api2
|
|
2612
2583
|
},
|
|
2613
2584
|
submitApi: {
|
|
2614
2585
|
type: "ajax",
|
|
@@ -2646,9 +2617,9 @@ function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSchema = {}
|
|
|
2646
2617
|
}
|
|
2647
2618
|
return merge_1(result, extraSchema);
|
|
2648
2619
|
}
|
|
2649
|
-
function api2SchemaFromSwagger(
|
|
2650
|
-
const apiInfo = getApiInfo(
|
|
2651
|
-
return api2SchemaFromSwaggerApiInfo(
|
|
2620
|
+
function api2SchemaFromSwagger(api2, schemaType, swaggerInfo, extraSchema = {}) {
|
|
2621
|
+
const apiInfo = getApiInfo(api2, swaggerInfo);
|
|
2622
|
+
return api2SchemaFromSwaggerApiInfo(api2, schemaType, apiInfo, extraSchema);
|
|
2652
2623
|
}
|
|
2653
2624
|
function transferOpenAPI3ToSwagger2$1(data) {
|
|
2654
2625
|
if (data && data.components && data.components.schemas) {
|
|
@@ -2784,10 +2755,10 @@ class MiddleItem extends JSONWatch {
|
|
|
2784
2755
|
}
|
|
2785
2756
|
class FtpSchema$1 extends Schema {
|
|
2786
2757
|
constructor(props, isCompleteSchema = false) {
|
|
2787
|
-
const { api, filter, headerToolbar, table, tabs, middleModules, ...more2 } = isCompleteSchema ? props.body : props;
|
|
2758
|
+
const { api: api2, filter, headerToolbar, table, tabs, middleModules, ...more2 } = isCompleteSchema ? props.body : props;
|
|
2788
2759
|
super(more2);
|
|
2789
2760
|
this.type = "ftp";
|
|
2790
|
-
this.api = new AjaxSchema(
|
|
2761
|
+
this.api = new AjaxSchema(api2);
|
|
2791
2762
|
this.filter = new Filter(filter);
|
|
2792
2763
|
this.headerToolbar = new HeaderToolbar$1(headerToolbar);
|
|
2793
2764
|
this.table = new TableSchema$2(table);
|
|
@@ -2861,12 +2832,12 @@ class FtpSchema$1 extends Schema {
|
|
|
2861
2832
|
}
|
|
2862
2833
|
initFromCache(schema) {
|
|
2863
2834
|
const { body, ...more2 } = schema;
|
|
2864
|
-
const { api, filter, headerToolbar, table, tabs, middleModules } = body;
|
|
2835
|
+
const { api: api2, filter, headerToolbar, table, tabs, middleModules } = body;
|
|
2865
2836
|
if (this.willDetach) {
|
|
2866
2837
|
this.willDetach();
|
|
2867
2838
|
}
|
|
2868
2839
|
this.init(more2);
|
|
2869
|
-
this.api.updateAll(
|
|
2840
|
+
this.api.updateAll(api2);
|
|
2870
2841
|
this.filter.updateAll(filter);
|
|
2871
2842
|
this.headerToolbar.updateAll(headerToolbar);
|
|
2872
2843
|
this.table.updateAll(this.compatTableHandle(table));
|
|
@@ -3205,11 +3176,11 @@ function getWatchByRequest(params) {
|
|
|
3205
3176
|
}
|
|
3206
3177
|
class FormilyFormV2Schema extends Schema {
|
|
3207
3178
|
constructor(props, isCompleteSchema = false) {
|
|
3208
|
-
const { api, initApi, effectApi, baseInfo, fields: fields2, ...more2 } = isCompleteSchema ? props.body : props;
|
|
3179
|
+
const { api: api2, initApi, effectApi, baseInfo, fields: fields2, ...more2 } = isCompleteSchema ? props.body : props;
|
|
3209
3180
|
super(more2);
|
|
3210
3181
|
this.type = "formily-form-v2";
|
|
3211
3182
|
this.baseInfo = new FormInfo(baseInfo);
|
|
3212
|
-
this.api = new AjaxSchema(
|
|
3183
|
+
this.api = new AjaxSchema(api2);
|
|
3213
3184
|
if (!initApi) {
|
|
3214
3185
|
this.initApi = new AjaxSchemaQueue([]);
|
|
3215
3186
|
} else {
|
|
@@ -3251,12 +3222,12 @@ class FormilyFormV2Schema extends Schema {
|
|
|
3251
3222
|
}
|
|
3252
3223
|
initFromCache(schema) {
|
|
3253
3224
|
const { body, ...more2 } = schema;
|
|
3254
|
-
const { api, initApi = [], effectApi = [], baseInfo, fields: fields2 } = body;
|
|
3225
|
+
const { api: api2, initApi = [], effectApi = [], baseInfo, fields: fields2 } = body;
|
|
3255
3226
|
if (this.willDetach) {
|
|
3256
3227
|
this.willDetach();
|
|
3257
3228
|
}
|
|
3258
3229
|
this.init(more2);
|
|
3259
|
-
this.api.updateAll(
|
|
3230
|
+
this.api.updateAll(api2);
|
|
3260
3231
|
if (!initApi) {
|
|
3261
3232
|
this.initApi.updateAll([]);
|
|
3262
3233
|
} else {
|
|
@@ -13186,23 +13157,23 @@ function useSwagger() {
|
|
|
13186
13157
|
}
|
|
13187
13158
|
};
|
|
13188
13159
|
}
|
|
13189
|
-
function createApiSelectItem(summary,
|
|
13160
|
+
function createApiSelectItem(summary, api2, method, request = []) {
|
|
13190
13161
|
return {
|
|
13191
13162
|
summary,
|
|
13192
|
-
label: `${summary} - ${method} ${
|
|
13193
|
-
value:
|
|
13194
|
-
url:
|
|
13163
|
+
label: `${summary} - ${method} ${api2}`,
|
|
13164
|
+
value: api2,
|
|
13165
|
+
url: api2,
|
|
13195
13166
|
method,
|
|
13196
13167
|
request,
|
|
13197
|
-
parameters:
|
|
13168
|
+
parameters: api2.parameters
|
|
13198
13169
|
};
|
|
13199
13170
|
}
|
|
13200
13171
|
const getDataSourceArray$1 = (paths = {}) => {
|
|
13201
13172
|
try {
|
|
13202
13173
|
return Object.keys(paths).map((key) => {
|
|
13203
|
-
const
|
|
13204
|
-
const apiPost =
|
|
13205
|
-
const apiGet =
|
|
13174
|
+
const api2 = paths[key];
|
|
13175
|
+
const apiPost = api2.post || api2.POST;
|
|
13176
|
+
const apiGet = api2.get || api2.GET;
|
|
13206
13177
|
if (apiPost) {
|
|
13207
13178
|
return createApiSelectItem(apiPost.summary, key, "POST");
|
|
13208
13179
|
} else if (apiGet) {
|
|
@@ -13275,8 +13246,8 @@ class PersistentStorage {
|
|
|
13275
13246
|
}
|
|
13276
13247
|
var storage = new PersistentStorage();
|
|
13277
13248
|
class DataSourceSchema extends JSONWatch {
|
|
13278
|
-
constructor(
|
|
13279
|
-
const { url, method = "get", ...more2 } =
|
|
13249
|
+
constructor(api2) {
|
|
13250
|
+
const { url, method = "get", ...more2 } = api2 || {};
|
|
13280
13251
|
super({
|
|
13281
13252
|
url,
|
|
13282
13253
|
method,
|
|
@@ -13988,10 +13959,10 @@ function emitterVSCodeMessage(action, content2) {
|
|
|
13988
13959
|
function emitSave(fileMapContent) {
|
|
13989
13960
|
emitterVSCodeMessage(EMIT_EVENT_ACTION_SAVE, fileMapContent);
|
|
13990
13961
|
}
|
|
13991
|
-
const buildSchema = (schemaType,
|
|
13962
|
+
const buildSchema = (schemaType, api2, mainDataSource, moreProps) => {
|
|
13992
13963
|
let schemaObj = null;
|
|
13993
13964
|
if (schemaType === "ftp") {
|
|
13994
|
-
schemaObj = new FtpSchema$1({ host:
|
|
13965
|
+
schemaObj = new FtpSchema$1({ host: api2, title: "" });
|
|
13995
13966
|
const realDataSource = {
|
|
13996
13967
|
...mainDataSource,
|
|
13997
13968
|
type: "ajax",
|
|
@@ -14004,14 +13975,14 @@ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
|
14004
13975
|
};
|
|
14005
13976
|
schemaObj.getDataSourcePanel().update(realDataSource);
|
|
14006
13977
|
} else if (schemaType === "formily-form") {
|
|
14007
|
-
schemaObj = new FormilyFormSchema({ host:
|
|
13978
|
+
schemaObj = new FormilyFormSchema({ host: api2, title: "" });
|
|
14008
13979
|
const realDataSource = {
|
|
14009
13980
|
...mainDataSource,
|
|
14010
13981
|
type: "ajax"
|
|
14011
13982
|
};
|
|
14012
13983
|
schemaObj.getDataSourcePanel().update(realDataSource);
|
|
14013
13984
|
} else if (schemaType === "formily-form-v2") {
|
|
14014
|
-
schemaObj = new FormilyFormV2Schema({ host:
|
|
13985
|
+
schemaObj = new FormilyFormV2Schema({ host: api2, title: "" });
|
|
14015
13986
|
const realDataSource = {
|
|
14016
13987
|
...mainDataSource,
|
|
14017
13988
|
type: "ajax"
|
|
@@ -14019,7 +13990,7 @@ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
|
14019
13990
|
schemaObj.getApiPanel().update(realDataSource);
|
|
14020
13991
|
} else if (schemaType === "detail") {
|
|
14021
13992
|
if (moreProps == null ? void 0 : moreProps.children) {
|
|
14022
|
-
schemaObj = new DetailSchema({ host:
|
|
13993
|
+
schemaObj = new DetailSchema({ host: api2, title: "", ...moreProps });
|
|
14023
13994
|
} else {
|
|
14024
13995
|
const realDataSource = {
|
|
14025
13996
|
...mainDataSource,
|
|
@@ -14028,10 +13999,10 @@ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
|
14028
13999
|
detailData: "$RET.data"
|
|
14029
14000
|
}
|
|
14030
14001
|
};
|
|
14031
|
-
schemaObj = new DetailSchema({ host:
|
|
14002
|
+
schemaObj = new DetailSchema({ host: api2, title: "", initDataSource: realDataSource });
|
|
14032
14003
|
}
|
|
14033
14004
|
} else if (schemaType === "edit-table") {
|
|
14034
|
-
schemaObj = new FtpSchema({ host:
|
|
14005
|
+
schemaObj = new FtpSchema({ host: api2, title: "", ...moreProps });
|
|
14035
14006
|
const realDataSource = {
|
|
14036
14007
|
...mainDataSource,
|
|
14037
14008
|
type: "ajax",
|
|
@@ -14058,8 +14029,8 @@ const buildSchema = (schemaType, api, mainDataSource, moreProps) => {
|
|
|
14058
14029
|
}
|
|
14059
14030
|
}, 500)
|
|
14060
14031
|
);
|
|
14061
|
-
if (
|
|
14062
|
-
axios.defaults.baseURL =
|
|
14032
|
+
if (api2.indexOf("?") === -1 && api2.indexOf("mocks") === -1) {
|
|
14033
|
+
axios.defaults.baseURL = api2;
|
|
14063
14034
|
}
|
|
14064
14035
|
return schemaObj;
|
|
14065
14036
|
};
|
|
@@ -14068,11 +14039,11 @@ const buildSchemaObjFromSchema = (schema) => {
|
|
|
14068
14039
|
return null;
|
|
14069
14040
|
}
|
|
14070
14041
|
const { host, body } = schema;
|
|
14071
|
-
const { type, api, ...more2 } = body || {};
|
|
14042
|
+
const { type, api: api2, ...more2 } = body || {};
|
|
14072
14043
|
if (!host || !type) {
|
|
14073
14044
|
return null;
|
|
14074
14045
|
}
|
|
14075
|
-
return buildSchema(type, host,
|
|
14046
|
+
return buildSchema(type, host, api2, more2);
|
|
14076
14047
|
};
|
|
14077
14048
|
function useSchema() {
|
|
14078
14049
|
const { fetchSwaggerInfo } = useSwagger$1();
|
|
@@ -16595,9 +16566,9 @@ function AjaxFormDialog({ title: title2 = "\u6570\u636E\u6E90\u914D\u7F6E", sche
|
|
|
16595
16566
|
dataSource: swagger.apiList,
|
|
16596
16567
|
defaultValue: schema.get("url"),
|
|
16597
16568
|
onChange: (value) => {
|
|
16598
|
-
const
|
|
16599
|
-
if (
|
|
16600
|
-
schema.setAjaxRequest(value,
|
|
16569
|
+
const api2 = swagger.getApi(value);
|
|
16570
|
+
if (api2) {
|
|
16571
|
+
schema.setAjaxRequest(value, api2.method);
|
|
16601
16572
|
} else {
|
|
16602
16573
|
schema.set("url", value);
|
|
16603
16574
|
}
|
|
@@ -24534,6 +24505,10 @@ const columnsTypeOptionsWithEditCnTable = [
|
|
|
24534
24505
|
value: "edit-cascader-select",
|
|
24535
24506
|
label: "\u7EA7\u8054\u9009\u62E9\u5668"
|
|
24536
24507
|
},
|
|
24508
|
+
{
|
|
24509
|
+
value: "blocks-table",
|
|
24510
|
+
label: "\u5217\u8868\u533A\u5757"
|
|
24511
|
+
},
|
|
24537
24512
|
{
|
|
24538
24513
|
value: "edit-custom",
|
|
24539
24514
|
label: "\u81EA\u5B9A\u4E49"
|
|
@@ -25077,7 +25052,7 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
|
|
|
25077
25052
|
function type(obj) {
|
|
25078
25053
|
return toString2.call(obj).slice(8, -1);
|
|
25079
25054
|
}
|
|
25080
|
-
var
|
|
25055
|
+
var assign2 = Object.assign || function(target, source) {
|
|
25081
25056
|
getAllKeys2(source).forEach(function(key) {
|
|
25082
25057
|
if (hasOwnProperty2.call(source, key)) {
|
|
25083
25058
|
target[key] = source[key];
|
|
@@ -25091,11 +25066,11 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
|
|
|
25091
25066
|
return Object.keys(obj);
|
|
25092
25067
|
};
|
|
25093
25068
|
function copy(object) {
|
|
25094
|
-
return Array.isArray(object) ?
|
|
25069
|
+
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;
|
|
25095
25070
|
}
|
|
25096
25071
|
var Context = function() {
|
|
25097
25072
|
function Context2() {
|
|
25098
|
-
this.commands =
|
|
25073
|
+
this.commands = assign2({}, defaultCommands);
|
|
25099
25074
|
this.update = this.update.bind(this);
|
|
25100
25075
|
this.update.extend = this.extend = this.extend.bind(this);
|
|
25101
25076
|
this.update.isEquals = function(x, y) {
|
|
@@ -25254,7 +25229,7 @@ var _immutabilityHelper_3_1_1_immutabilityHelper = { exports: {} };
|
|
|
25254
25229
|
exports.isEquals = defaultContext.update.isEquals;
|
|
25255
25230
|
exports.extend = defaultContext.extend;
|
|
25256
25231
|
exports.default = defaultContext.update;
|
|
25257
|
-
exports.default.default = module.exports =
|
|
25232
|
+
exports.default.default = module.exports = assign2(exports.default, exports);
|
|
25258
25233
|
function invariantPushAndUnshift(value, spec, command) {
|
|
25259
25234
|
invariant2(Array.isArray(value), function() {
|
|
25260
25235
|
return "update(): expected target of " + stringifiable(command) + " to be an array; got " + stringifiable(value) + ".";
|
package/package.json
CHANGED
package/src/template/const.js
CHANGED