@egova/egova-api 1.0.223 → 1.0.226
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/dist/index.common.js +232 -66
- package/dist/index.css +1 -1
- package/dist/index.umd.js +232 -66
- package/dist/index.umd.min.js +4 -4
- package/dist/types/src/views/project-combine/data-model/data-model-list/index.d.ts +7 -3
- package/dist/types/src/views/project-detail/interface-settings/index.d.ts +14 -0
- package/dist/types/src/views/project-detail/service.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.common.js
CHANGED
|
@@ -48843,7 +48843,7 @@ module.exports = uncurryThis([].slice);
|
|
|
48843
48843
|
/***/ "f40e":
|
|
48844
48844
|
/***/ (function(module, exports) {
|
|
48845
48845
|
|
|
48846
|
-
module.exports = "<article class=\"interface-settings\" :class=\"{'script-max': scriptView}\">\r\n <header v-show=\"!scriptView\">\r\n<!-- <i-input class=\"diy-input\" v-model=\"interfaceModel.info.url\">-->\r\n<!-- <i-select transfer slot=\"prepend\" class=\"diy-select\" v-model=\"interfaceModel.info.method\">-->\r\n<!-- <i-option v-for=\"item in typeList\" :key=\"item.value\" :value=\"item.value\">{{item.text}}</i-option>-->\r\n<!-- </i-select>-->\r\n<!-- </i-input>-->\r\n <i-select class=\"diy-select method-select\" v-model=\"interfaceModel.info.method\">\r\n <i-option v-for=\"item in typeList\" :key=\"item.value\" :value=\"item.value\">{{item.text}}</i-option>\r\n </i-select>\r\n <i-select ref=\"addEnvParamSelect\" class=\"diy-select env-select\" v-model=\"interfaceModel.info.envId\" placeholder=\"请选择环境变量\" clearable>\r\n <i-option v-for=\"item in paramList\" :key=\"item.id\" :value=\"item.id\">{{item.name + \":\" + item.value}}</i-option>\r\n <i-option class=\"add-security-item\" value=\"''\">\r\n <div class=\"add-security-item-content\" @click.stop=\"onAddEnvParam\">\r\n <i class=\"api-icon icon-add\"></i>\r\n <span>新增环境变量</span>\r\n </div>\r\n </i-option>\r\n </i-select>\r\n <i-input class=\"diy-input url-input\" v-model=\"interfaceModel.info.url\"></i-input>\r\n\r\n <i-button type=\"primary\" class=\"diy-btn-primary submit-btn\" @click=\"onRun\">发送</i-button>\r\n <i-button type=\"primary\" class=\"diy-btn-primary\" @click=\"onSave\" ghost>保存</i-button>\r\n <i-button type=\"primary\" class=\"diy-btn-primary his-btn\" @click=\"onVersion\" ghost>查看历史版本</i-button>\r\n <i class=\"export iconfont icon-xiazai\" title=\"导出\" type=\"md-download\" @click=\"onExport\"></i>\r\n <i-upload action=\"\" :before-upload=\"onImport\" :show-upload-list=\"false\">\r\n <i class=\"import iconfont icon-shangchuan\" title=\"导入\" type=\"md-cloud-upload\"></i>\r\n </i-upload>\r\n\r\n </header>\r\n <main :class=\"{'transverse': !lengthwise}\">\r\n <section class=\"request\">\r\n <div v-show=\"!scriptView\" class=\"request-bar\">\r\n <div\r\n class=\"tag\"\r\n :class=\"{'active': currentRequestSettingType.name.indexOf(item.name) === 0}\"\r\n v-for=\"(item,index) in requertSettingTypeList\"\r\n :key=\"item.name\"\r\n @click=\"onClickRequertSettingTpye(item)\"\r\n >\r\n <span>{{item.title}}</span>\r\n </div>\r\n </div>\r\n <div class=\"request-content\">\r\n <component\r\n :is=\"currentRequestSettingType.name\"\r\n :lengthwise=\"lengthwise\"\r\n :interface-model=\"interfaceModel\"\r\n :response=\"response\"\r\n :key=\"interfaceModel.info.id + currentRequestSettingType.name\"\r\n :projectID=\"projectId\"\r\n :currentSecurityID=\"currentId\"\r\n :errorLine=\"!originId || originId === interfaceModel.info.id ? errorLine : []\"\r\n @on-current-id=\"onCurrentId\"\r\n @on-script-run=\"onScriptRun\"\r\n @on-script-save=\"onSave\"\r\n @on-script-max=\"onScriptMax\"\r\n ></component>\r\n </div>\r\n </section>\r\n <response :key=\"interfaceModel.info.id + 'response'\" :lengthwise=\"lengthwise\" :response=\"response\"></response>\r\n </main>\r\n <i-spin fix v-show=\"loading\">\r\n <i class=\"spin-icon-load ivu-icon\"></i>\r\n </i-spin>\r\n <u-environment-modal :visiable.sync=\"showEnvironmentModal\" :projectId=\"projectId\" @on-refresh=\"getEnvironmentParamList\" :isAdd=\"true\"></u-environment-modal>\r\n</article>\r\n"
|
|
48846
|
+
module.exports = "<article class=\"interface-settings\" :class=\"{'script-max': scriptView}\">\r\n <header v-show=\"!scriptView\">\r\n<!-- <i-input class=\"diy-input\" v-model=\"interfaceModel.info.url\">-->\r\n<!-- <i-select transfer slot=\"prepend\" class=\"diy-select\" v-model=\"interfaceModel.info.method\">-->\r\n<!-- <i-option v-for=\"item in typeList\" :key=\"item.value\" :value=\"item.value\">{{item.text}}</i-option>-->\r\n<!-- </i-select>-->\r\n<!-- </i-input>-->\r\n <i-select class=\"diy-select method-select\" v-model=\"interfaceModel.info.method\">\r\n <i-option v-for=\"item in typeList\" :key=\"item.value\" :value=\"item.value\">{{item.text}}</i-option>\r\n </i-select>\r\n <i-select ref=\"addEnvParamSelect\" class=\"diy-select env-select\" v-model=\"interfaceModel.info.envId\" placeholder=\"请选择环境变量\" clearable>\r\n <i-option v-for=\"item in paramList\" :key=\"item.id\" :value=\"item.id\">{{item.name + \":\" + item.value}}</i-option>\r\n <i-option class=\"add-security-item\" value=\"''\">\r\n <div class=\"add-security-item-content\" @click.stop=\"onAddEnvParam\">\r\n <i class=\"api-icon icon-add\"></i>\r\n <span>新增环境变量</span>\r\n </div>\r\n </i-option>\r\n </i-select>\r\n <i-input class=\"diy-input url-input\" v-model=\"interfaceModel.info.url\"></i-input>\r\n\r\n <i-button type=\"primary\" class=\"diy-btn-primary submit-btn\" @click=\"onRun\">发送</i-button>\r\n <i-button type=\"primary\" class=\"diy-btn-primary\" @click=\"onSave\" ghost>保存</i-button>\r\n <i-button type=\"primary\" class=\"diy-btn-primary his-btn\" @click=\"onVersion\" ghost>查看历史版本</i-button>\r\n <i class=\"export iconfont icon-xiazai\" title=\"导出\" type=\"md-download\" @click=\"onExport\"></i>\r\n <i-upload action=\"\" :before-upload=\"onImport\" :show-upload-list=\"false\">\r\n <i class=\"import iconfont icon-shangchuan\" title=\"导入\" type=\"md-cloud-upload\"></i>\r\n </i-upload>\r\n\r\n </header>\r\n <main :class=\"{'transverse': !lengthwise}\">\r\n <section class=\"request\">\r\n <div v-show=\"!scriptView\" class=\"request-bar\">\r\n <div\r\n class=\"tag\"\r\n :class=\"{'active': currentRequestSettingType.name.indexOf(item.name) === 0}\"\r\n v-for=\"(item,index) in requertSettingTypeList\"\r\n :key=\"item.name\"\r\n @click=\"onClickRequertSettingTpye(item)\"\r\n >\r\n <span>{{item.title}}</span>\r\n </div>\r\n </div>\r\n <div class=\"request-content\">\r\n <component\r\n :is=\"currentRequestSettingType.name\"\r\n :lengthwise=\"lengthwise\"\r\n :interface-model=\"interfaceModel\"\r\n :response=\"response\"\r\n :key=\"interfaceModel.info.id + currentRequestSettingType.name\"\r\n :projectID=\"projectId\"\r\n :currentSecurityID=\"currentId\"\r\n :errorLine=\"!originId || originId === interfaceModel.info.id ? errorLine : []\"\r\n @on-current-id=\"onCurrentId\"\r\n @on-script-run=\"onScriptRun\"\r\n @on-script-save=\"onSave\"\r\n @on-script-max=\"onScriptMax\"\r\n ></component>\r\n </div>\r\n </section>\r\n <response :key=\"interfaceModel.info.id + 'response'\" :lengthwise=\"lengthwise\" :response=\"response\"></response>\r\n </main>\r\n <i-spin fix v-show=\"loading\">\r\n <i class=\"spin-icon-load ivu-icon\"></i>\r\n </i-spin>\r\n <u-environment-modal :visiable.sync=\"showEnvironmentModal\" :projectId=\"projectId\" @on-refresh=\"getEnvironmentParamList\" :isAdd=\"true\"></u-environment-modal>\r\n <i-modal class=\"diy-modal edit-import-name\" v-model=\"showImportModal\" :mask-closable=\"false\">\r\n <p slot=\"header\">编辑名称</p>\r\n <i-form ref=\"import\" :model=\"apiForm\" :rules=\"rules\">\r\n <i-form-item label=\"环境变量:\" prop=\"envName\">\r\n <i-input v-model=\"apiForm.envName\"></i-input>\r\n </i-form-item>\r\n\r\n <i-form-item label=\"授权:\" prop=\"authName\">\r\n <i-input v-model=\"apiForm.authName\"></i-input>\r\n </i-form-item>\r\n </i-form>\r\n <div class=\"handle-btn\" slot=\"footer\">\r\n <i-button class=\"diy-btn-primary\" type=\"primary\" @click.stop=\"saveImportData(importObj)\">确定</i-button>\r\n <i-button class=\"diy-btn-text\" @click.stop=\"cancleModify\">取消</i-button>\r\n </div>\r\n </i-modal>\r\n</article>\r\n"
|
|
48847
48847
|
|
|
48848
48848
|
/***/ }),
|
|
48849
48849
|
|
|
@@ -53026,7 +53026,7 @@ function (_super) {
|
|
|
53026
53026
|
title: "接口文档",
|
|
53027
53027
|
align: "left",
|
|
53028
53028
|
slot: "doc",
|
|
53029
|
-
width:
|
|
53029
|
+
width: 110
|
|
53030
53030
|
}, {
|
|
53031
53031
|
title: "操作",
|
|
53032
53032
|
align: "left",
|
|
@@ -54035,32 +54035,38 @@ function (_super) {
|
|
|
54035
54035
|
}, {
|
|
54036
54036
|
title: "名称",
|
|
54037
54037
|
align: "left",
|
|
54038
|
-
key: "name"
|
|
54038
|
+
key: "name",
|
|
54039
|
+
tooltip: true
|
|
54039
54040
|
}, {
|
|
54040
54041
|
title: "编码",
|
|
54041
54042
|
align: "left",
|
|
54042
|
-
key: "code"
|
|
54043
|
+
key: "code",
|
|
54044
|
+
tooltip: true
|
|
54043
54045
|
}, {
|
|
54044
54046
|
title: "数据源",
|
|
54045
54047
|
align: "left",
|
|
54046
|
-
key: "sourceName"
|
|
54048
|
+
key: "sourceName",
|
|
54049
|
+
tooltip: true
|
|
54047
54050
|
}, {
|
|
54048
54051
|
title: "是否开启缓存",
|
|
54049
54052
|
align: "left",
|
|
54050
|
-
slot: "enableCache"
|
|
54053
|
+
slot: "enableCache",
|
|
54054
|
+
width: 135
|
|
54051
54055
|
}, {
|
|
54052
54056
|
title: "过期时间(s)",
|
|
54053
54057
|
align: "left",
|
|
54054
|
-
key: "expireSeconds"
|
|
54058
|
+
key: "expireSeconds",
|
|
54059
|
+
width: 135
|
|
54055
54060
|
}, {
|
|
54056
54061
|
title: "描述",
|
|
54057
54062
|
align: "left",
|
|
54058
|
-
key: "description"
|
|
54063
|
+
key: "description",
|
|
54064
|
+
tooltip: true
|
|
54059
54065
|
}, {
|
|
54060
54066
|
title: "接口文档",
|
|
54061
54067
|
align: "left",
|
|
54062
54068
|
slot: "doc",
|
|
54063
|
-
width:
|
|
54069
|
+
width: 110
|
|
54064
54070
|
}]; // 查看文档
|
|
54065
54071
|
|
|
54066
54072
|
_this.doc = "";
|
|
@@ -58982,7 +58988,11 @@ function (_super) {
|
|
|
58982
58988
|
};
|
|
58983
58989
|
|
|
58984
58990
|
ApiService.prototype.onImportAvr = function (data) {
|
|
58985
|
-
return this._post("/unity/api/info/import-
|
|
58991
|
+
return this._post("/unity/api/info/import-model", data);
|
|
58992
|
+
};
|
|
58993
|
+
|
|
58994
|
+
ApiService.prototype.onValidateImport = function (data) {
|
|
58995
|
+
return this._post("/unity/api/info/check-name", data);
|
|
58986
58996
|
};
|
|
58987
58997
|
|
|
58988
58998
|
var _a, _b;
|
|
@@ -59103,6 +59113,11 @@ function (_super) {
|
|
|
59103
59113
|
showErrorMsg: true
|
|
59104
59114
|
}), project_detail_service_metadata("design:type", Function), project_detail_service_metadata("design:paramtypes", [Object]), project_detail_service_metadata("design:returntype", void 0)], ApiService.prototype, "onImportAvr", null);
|
|
59105
59115
|
|
|
59116
|
+
project_detail_service_decorate([serviceHandler("query", {
|
|
59117
|
+
title: "单接口详情导入",
|
|
59118
|
+
showErrorMsg: true
|
|
59119
|
+
}), project_detail_service_metadata("design:type", Function), project_detail_service_metadata("design:paramtypes", [Object]), project_detail_service_metadata("design:returntype", void 0)], ApiService.prototype, "onValidateImport", null);
|
|
59120
|
+
|
|
59106
59121
|
return ApiService;
|
|
59107
59122
|
}(common_service);
|
|
59108
59123
|
|
|
@@ -64237,6 +64252,14 @@ function (_super) {
|
|
|
64237
64252
|
_this.errorLine = null;
|
|
64238
64253
|
_this.originId = "";
|
|
64239
64254
|
_this.scriptView = false;
|
|
64255
|
+
_this.apiForm = {
|
|
64256
|
+
envName: null,
|
|
64257
|
+
authName: null
|
|
64258
|
+
};
|
|
64259
|
+
_this.showImportModal = false; // 导入校验名称弹窗
|
|
64260
|
+
|
|
64261
|
+
_this.importObj = {}; // 解析的导入文件数据
|
|
64262
|
+
|
|
64240
64263
|
_this.typeList = [{
|
|
64241
64264
|
value: "GET",
|
|
64242
64265
|
text: "GET"
|
|
@@ -64273,6 +64296,18 @@ function (_super) {
|
|
|
64273
64296
|
title: "后置脚本",
|
|
64274
64297
|
name: "after-execution-script"
|
|
64275
64298
|
}];
|
|
64299
|
+
_this.rules = {
|
|
64300
|
+
envName: [{
|
|
64301
|
+
required: false,
|
|
64302
|
+
validator: _this.validateEnvName,
|
|
64303
|
+
trigger: "blur"
|
|
64304
|
+
}],
|
|
64305
|
+
authName: [{
|
|
64306
|
+
required: false,
|
|
64307
|
+
validator: _this.validateAuthName,
|
|
64308
|
+
trigger: "blur"
|
|
64309
|
+
}]
|
|
64310
|
+
};
|
|
64276
64311
|
_this.currentRequestSettingType = _this.requertSettingTypeList[0];
|
|
64277
64312
|
return _this;
|
|
64278
64313
|
}
|
|
@@ -64387,6 +64422,12 @@ function (_super) {
|
|
|
64387
64422
|
this.response = this.responseCache.get(this.interfaceModel.info.id) || new Response();
|
|
64388
64423
|
};
|
|
64389
64424
|
|
|
64425
|
+
InterfaceSettings.prototype.showImportModalChange = function (value) {
|
|
64426
|
+
if (!value) {
|
|
64427
|
+
this.$refs.import.resetFields();
|
|
64428
|
+
}
|
|
64429
|
+
};
|
|
64430
|
+
|
|
64390
64431
|
InterfaceSettings.prototype.onImport = function (file) {
|
|
64391
64432
|
return interface_settings_awaiter(this, void 0, void 0, function () {
|
|
64392
64433
|
var reader;
|
|
@@ -64399,69 +64440,37 @@ function (_super) {
|
|
|
64399
64440
|
|
|
64400
64441
|
reader.onload = function (evt) {
|
|
64401
64442
|
return interface_settings_awaiter(_this, void 0, void 0, function () {
|
|
64402
|
-
var fileString, obj
|
|
64443
|
+
var fileString, obj;
|
|
64403
64444
|
|
|
64404
64445
|
var _a, _b, _c, _d, _e, _f;
|
|
64405
64446
|
|
|
64406
64447
|
return interface_settings_generator(this, function (_g) {
|
|
64407
|
-
|
|
64408
|
-
|
|
64409
|
-
fileString = evt.target.result;
|
|
64410
|
-
obj = null;
|
|
64411
|
-
|
|
64412
|
-
try {
|
|
64413
|
-
obj = JSON.parse(fileString);
|
|
64414
|
-
} catch (error) {
|
|
64415
|
-
this.$message.error("JSON格式有误");
|
|
64416
|
-
return [2
|
|
64417
|
-
/*return*/
|
|
64418
|
-
, false];
|
|
64419
|
-
}
|
|
64448
|
+
fileString = evt.target.result;
|
|
64449
|
+
obj = null;
|
|
64420
64450
|
|
|
64421
|
-
|
|
64422
|
-
|
|
64423
|
-
|
|
64424
|
-
|
|
64425
|
-
|
|
64426
|
-
|
|
64427
|
-
|
|
64428
|
-
|
|
64429
|
-
|
|
64430
|
-
case 1:
|
|
64431
|
-
res = _g.sent();
|
|
64432
|
-
|
|
64433
|
-
if (!(res === null || res === void 0 ? void 0 : res.hasError)) {
|
|
64434
|
-
this.getEnvironmentParamList();
|
|
64435
|
-
obj.environmentParam = ((_a = res === null || res === void 0 ? void 0 : res.result) === null || _a === void 0 ? void 0 : _a.environmentParam) || null;
|
|
64436
|
-
obj.authentication = ((_b = res === null || res === void 0 ? void 0 : res.result) === null || _b === void 0 ? void 0 : _b.authentication) || null;
|
|
64437
|
-
obj.info.envId = ((_d = (_c = res === null || res === void 0 ? void 0 : res.result) === null || _c === void 0 ? void 0 : _c.environmentParam) === null || _d === void 0 ? void 0 : _d.id) || null;
|
|
64438
|
-
obj.info.authId = ((_f = (_e = res === null || res === void 0 ? void 0 : res.result) === null || _e === void 0 ? void 0 : _e.authentication) === null || _f === void 0 ? void 0 : _f.id) || null;
|
|
64439
|
-
} else {
|
|
64440
|
-
return [2
|
|
64441
|
-
/*return*/
|
|
64442
|
-
];
|
|
64443
|
-
}
|
|
64451
|
+
try {
|
|
64452
|
+
obj = JSON.parse(fileString);
|
|
64453
|
+
this.importObj = obj;
|
|
64454
|
+
} catch (error) {
|
|
64455
|
+
this.$message.error("JSON格式有误");
|
|
64456
|
+
return [2
|
|
64457
|
+
/*return*/
|
|
64458
|
+
, false];
|
|
64459
|
+
} // 当授权或环境变量都不存在时则直接执行保存事件
|
|
64444
64460
|
|
|
64445
|
-
|
|
64446
|
-
|
|
64447
|
-
|
|
64448
|
-
|
|
64449
|
-
|
|
64450
|
-
|
|
64451
|
-
|
|
64452
|
-
|
|
64453
|
-
obj === null || obj === void 0 ? void 0 : obj[key].forEach(function (f) {
|
|
64454
|
-
f.apiId = apiId;
|
|
64455
|
-
});
|
|
64456
|
-
});
|
|
64457
|
-
obj === null || obj === void 0 ? void 0 : obj.requestHeaders.forEach(function (f) {
|
|
64458
|
-
f.belongId = apiId;
|
|
64459
|
-
});
|
|
64460
|
-
this.$emit("update:interfaceModel", obj);
|
|
64461
|
-
return [2
|
|
64462
|
-
/*return*/
|
|
64463
|
-
];
|
|
64461
|
+
|
|
64462
|
+
if (!((_a = obj === null || obj === void 0 ? void 0 : obj.authentication) === null || _a === void 0 ? void 0 : _a.name) && !((_b = obj === null || obj === void 0 ? void 0 : obj.environmentParam) === null || _b === void 0 ? void 0 : _b.name)) {
|
|
64463
|
+
this.saveImportData(obj);
|
|
64464
|
+
} else {
|
|
64465
|
+
// 当授权或环境变量只要一个不为空则回显值且打开名称修改弹窗
|
|
64466
|
+
this.apiForm.envName = ((_c = obj === null || obj === void 0 ? void 0 : obj.environmentParam) === null || _c === void 0 ? void 0 : _c.name) ? (_d = obj === null || obj === void 0 ? void 0 : obj.environmentParam) === null || _d === void 0 ? void 0 : _d.name : null;
|
|
64467
|
+
this.apiForm.authName = ((_e = obj === null || obj === void 0 ? void 0 : obj.authentication) === null || _e === void 0 ? void 0 : _e.name) ? (_f = obj === null || obj === void 0 ? void 0 : obj.authentication) === null || _f === void 0 ? void 0 : _f.name : null;
|
|
64468
|
+
this.showImportModal = true;
|
|
64464
64469
|
}
|
|
64470
|
+
|
|
64471
|
+
return [2
|
|
64472
|
+
/*return*/
|
|
64473
|
+
];
|
|
64465
64474
|
});
|
|
64466
64475
|
});
|
|
64467
64476
|
};
|
|
@@ -64472,6 +64481,84 @@ function (_super) {
|
|
|
64472
64481
|
});
|
|
64473
64482
|
});
|
|
64474
64483
|
};
|
|
64484
|
+
/**
|
|
64485
|
+
* 选择导入文件且名称校验弹窗通过之后的保存事件
|
|
64486
|
+
* @param obj 导入文件解析之后的数据
|
|
64487
|
+
* @returns
|
|
64488
|
+
*/
|
|
64489
|
+
|
|
64490
|
+
|
|
64491
|
+
InterfaceSettings.prototype.saveImportData = function (obj) {
|
|
64492
|
+
var _a, _b;
|
|
64493
|
+
|
|
64494
|
+
return interface_settings_awaiter(this, void 0, void 0, function () {
|
|
64495
|
+
var valid, apiId, res;
|
|
64496
|
+
return interface_settings_generator(this, function (_c) {
|
|
64497
|
+
switch (_c.label) {
|
|
64498
|
+
case 0:
|
|
64499
|
+
if (!(((_a = obj === null || obj === void 0 ? void 0 : obj.authentication) === null || _a === void 0 ? void 0 : _a.name) || ((_b = obj === null || obj === void 0 ? void 0 : obj.environmentParam) === null || _b === void 0 ? void 0 : _b.name))) return [3
|
|
64500
|
+
/*break*/
|
|
64501
|
+
, 2];
|
|
64502
|
+
return [4
|
|
64503
|
+
/*yield*/
|
|
64504
|
+
, this.$refs.import.validate()];
|
|
64505
|
+
|
|
64506
|
+
case 1:
|
|
64507
|
+
valid = _c.sent();
|
|
64508
|
+
|
|
64509
|
+
if (!valid) {
|
|
64510
|
+
this.$message.warning("验证不通过");
|
|
64511
|
+
return [2
|
|
64512
|
+
/*return*/
|
|
64513
|
+
];
|
|
64514
|
+
}
|
|
64515
|
+
|
|
64516
|
+
_c.label = 2;
|
|
64517
|
+
|
|
64518
|
+
case 2:
|
|
64519
|
+
apiId = this.interfaceModel.info.id;
|
|
64520
|
+
obj.id = apiId;
|
|
64521
|
+
obj.info.id = apiId;
|
|
64522
|
+
obj.info.name = this.interfaceModel.info.name;
|
|
64523
|
+
obj.info.projectId = this.projectId;
|
|
64524
|
+
obj.info.categoryId = this.interfaceModel.info.categoryId;
|
|
64525
|
+
obj.authentication && (obj.authentication.projectId = this.projectId);
|
|
64526
|
+
obj.authentication && (obj.authentication.name = this.apiForm.authName);
|
|
64527
|
+
obj.environmentParam && (obj.environmentParam.projectId = this.projectId);
|
|
64528
|
+
obj.environmentParam && (obj.environmentParam.name = this.apiForm.envName);
|
|
64529
|
+
obj.convertConfig && (obj.convertConfig.apiId = apiId);
|
|
64530
|
+
["fieldMappings", "postScripts", "preScripts", "queryParams", "formParams"].forEach(function (key) {
|
|
64531
|
+
obj === null || obj === void 0 ? void 0 : obj[key].forEach(function (f) {
|
|
64532
|
+
f.apiId = apiId;
|
|
64533
|
+
});
|
|
64534
|
+
});
|
|
64535
|
+
obj === null || obj === void 0 ? void 0 : obj.requestHeaders.forEach(function (f) {
|
|
64536
|
+
f.belongId = apiId;
|
|
64537
|
+
});
|
|
64538
|
+
return [4
|
|
64539
|
+
/*yield*/
|
|
64540
|
+
, this.service.onImportAvr(obj)];
|
|
64541
|
+
|
|
64542
|
+
case 3:
|
|
64543
|
+
res = _c.sent();
|
|
64544
|
+
|
|
64545
|
+
if (!(res === null || res === void 0 ? void 0 : res.hasError)) {
|
|
64546
|
+
this.showImportModal = false;
|
|
64547
|
+
this.getEnvironmentParamList();
|
|
64548
|
+
this.$publish("api://project-detail-save");
|
|
64549
|
+
} else {
|
|
64550
|
+
return [2
|
|
64551
|
+
/*return*/
|
|
64552
|
+
];
|
|
64553
|
+
}
|
|
64554
|
+
|
|
64555
|
+
return [2
|
|
64556
|
+
/*return*/
|
|
64557
|
+
];
|
|
64558
|
+
}
|
|
64559
|
+
});
|
|
64560
|
+
});
|
|
64561
|
+
};
|
|
64475
64562
|
|
|
64476
64563
|
InterfaceSettings.prototype.onExport = function () {
|
|
64477
64564
|
var str = JSON.stringify(this.interfaceModel, null, 4);
|
|
@@ -64483,6 +64570,77 @@ function (_super) {
|
|
|
64483
64570
|
link.click();
|
|
64484
64571
|
};
|
|
64485
64572
|
|
|
64573
|
+
InterfaceSettings.prototype.validateEnvName = function (rule, value, callback) {
|
|
64574
|
+
var _a, _b, _c, _d, _e;
|
|
64575
|
+
|
|
64576
|
+
return interface_settings_awaiter(this, void 0, void 0, function () {
|
|
64577
|
+
var res;
|
|
64578
|
+
return interface_settings_generator(this, function (_f) {
|
|
64579
|
+
switch (_f.label) {
|
|
64580
|
+
case 0:
|
|
64581
|
+
return [4
|
|
64582
|
+
/*yield*/
|
|
64583
|
+
, this.service.onValidateImport({
|
|
64584
|
+
projectId: this.projectId,
|
|
64585
|
+
envName: ((_a = this.apiForm) === null || _a === void 0 ? void 0 : _a.envName) ? (_b = this.apiForm) === null || _b === void 0 ? void 0 : _b.envName : null,
|
|
64586
|
+
authName: ((_c = this.apiForm) === null || _c === void 0 ? void 0 : _c.authName) ? (_d = this.apiForm) === null || _d === void 0 ? void 0 : _d.authName : null
|
|
64587
|
+
})];
|
|
64588
|
+
|
|
64589
|
+
case 1:
|
|
64590
|
+
res = _f.sent();
|
|
64591
|
+
|
|
64592
|
+
if (!(res === null || res === void 0 ? void 0 : res.hasError) && !((_e = res === null || res === void 0 ? void 0 : res.result) === null || _e === void 0 ? void 0 : _e.envNameRepeat)) {
|
|
64593
|
+
callback();
|
|
64594
|
+
} else {
|
|
64595
|
+
callback(new Error("环境变量名重复"));
|
|
64596
|
+
}
|
|
64597
|
+
|
|
64598
|
+
return [2
|
|
64599
|
+
/*return*/
|
|
64600
|
+
];
|
|
64601
|
+
}
|
|
64602
|
+
});
|
|
64603
|
+
});
|
|
64604
|
+
};
|
|
64605
|
+
|
|
64606
|
+
InterfaceSettings.prototype.validateAuthName = function (rule, value, callback) {
|
|
64607
|
+
var _a, _b, _c, _d, _e;
|
|
64608
|
+
|
|
64609
|
+
return interface_settings_awaiter(this, void 0, void 0, function () {
|
|
64610
|
+
var res;
|
|
64611
|
+
return interface_settings_generator(this, function (_f) {
|
|
64612
|
+
switch (_f.label) {
|
|
64613
|
+
case 0:
|
|
64614
|
+
return [4
|
|
64615
|
+
/*yield*/
|
|
64616
|
+
, this.service.onValidateImport({
|
|
64617
|
+
projectId: this.projectId,
|
|
64618
|
+
envName: ((_a = this.apiForm) === null || _a === void 0 ? void 0 : _a.envName) ? (_b = this.apiForm) === null || _b === void 0 ? void 0 : _b.envName : null,
|
|
64619
|
+
authName: ((_c = this.apiForm) === null || _c === void 0 ? void 0 : _c.authName) ? (_d = this.apiForm) === null || _d === void 0 ? void 0 : _d.authName : null
|
|
64620
|
+
})];
|
|
64621
|
+
|
|
64622
|
+
case 1:
|
|
64623
|
+
res = _f.sent();
|
|
64624
|
+
|
|
64625
|
+
if (!(res === null || res === void 0 ? void 0 : res.hasError) && !((_e = res === null || res === void 0 ? void 0 : res.result) === null || _e === void 0 ? void 0 : _e.authNameRepeat)) {
|
|
64626
|
+
callback();
|
|
64627
|
+
} else {
|
|
64628
|
+
callback(new Error("授权名重复"));
|
|
64629
|
+
}
|
|
64630
|
+
|
|
64631
|
+
return [2
|
|
64632
|
+
/*return*/
|
|
64633
|
+
];
|
|
64634
|
+
}
|
|
64635
|
+
});
|
|
64636
|
+
});
|
|
64637
|
+
};
|
|
64638
|
+
|
|
64639
|
+
InterfaceSettings.prototype.cancleModify = function () {
|
|
64640
|
+
this.$refs.import.resetFields();
|
|
64641
|
+
this.showImportModal = false;
|
|
64642
|
+
};
|
|
64643
|
+
|
|
64486
64644
|
InterfaceSettings.prototype.onVersion = function () {
|
|
64487
64645
|
var id = (this.interfaceModel.info || {}).id;
|
|
64488
64646
|
|
|
@@ -64581,6 +64739,8 @@ function (_super) {
|
|
|
64581
64739
|
immediate: true
|
|
64582
64740
|
}), interface_settings_metadata("design:type", Function), interface_settings_metadata("design:paramtypes", []), interface_settings_metadata("design:returntype", void 0)], InterfaceSettings.prototype, "interfaceModelChange", null);
|
|
64583
64741
|
|
|
64742
|
+
interface_settings_decorate([Object(flagwind_web_["watch"])("showImportModal"), interface_settings_metadata("design:type", Function), interface_settings_metadata("design:paramtypes", [Boolean]), interface_settings_metadata("design:returntype", void 0)], InterfaceSettings.prototype, "showImportModalChange", null);
|
|
64743
|
+
|
|
64584
64744
|
InterfaceSettings = interface_settings_decorate([Object(flagwind_web_["component"])({
|
|
64585
64745
|
template: __webpack_require__("f40e"),
|
|
64586
64746
|
components: {
|
|
@@ -66582,6 +66742,9 @@ function (_super) {
|
|
|
66582
66742
|
this.$subscribe("api://project-detail-save", function () {
|
|
66583
66743
|
return project_detail_awaiter(_this, void 0, void 0, function () {
|
|
66584
66744
|
var res, result;
|
|
66745
|
+
|
|
66746
|
+
var _this = this;
|
|
66747
|
+
|
|
66585
66748
|
return project_detail_generator(this, function (_a) {
|
|
66586
66749
|
switch (_a.label) {
|
|
66587
66750
|
case 0:
|
|
@@ -66596,6 +66759,9 @@ function (_super) {
|
|
|
66596
66759
|
id: this.current.id
|
|
66597
66760
|
});
|
|
66598
66761
|
this.active = result;
|
|
66762
|
+
this.openInterfaceList[this.openInterfaceList.findIndex(function (i) {
|
|
66763
|
+
return i.id === _this.current.id;
|
|
66764
|
+
})] = result;
|
|
66599
66765
|
return [2
|
|
66600
66766
|
/*return*/
|
|
66601
66767
|
];
|