@egova/egova-api 1.2.2 → 1.2.3
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 +202 -22
- package/dist/index.css +1 -1
- package/dist/index.umd.js +202 -22
- package/dist/index.umd.min.js +2 -2
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -344,7 +344,7 @@ module.exports = function (error, C, stack, dropEntries) {
|
|
|
344
344
|
/***/ "193e":
|
|
345
345
|
/***/ (function(module, exports) {
|
|
346
346
|
|
|
347
|
-
module.exports = "<article class=\"project-tree\">\
|
|
347
|
+
module.exports = "<article class=\"project-tree\">\n <header>\n <div class=\"tree-api\">\n <div class=\"title-g\">API列表</div>\n <div class=\"add\" @click=\"onAddGroup\">\n <i class=\"iconfont icon-xinjianwenjianjia\" title=\"新增分组\"></i>\n </div>\n </div>\n <div class=\"tree-search\">\n <i-select class=\"diy-select\" transfer v-model=\"type\" @on-change=\"onFilter\">\n <i-option v-for=\"item in typeList\" :key=\"item.value\" :value=\"item.value\">{{item.text}}</i-option>\n </i-select>\n <i-input class=\"diy-input\" v-model=\"keyword\" @on-change=\"onFilter\" placeholder=\"输入关键字查询\">\n <i class=\"iconfont icon-chaxun\" slot=\"prefix\"></i>\n </i-input>\n </div>\n </header>\n <i-tree :data=\"renderData\" :render=\"renderContent\"></i-tree>\n <i-modal\n draggable\n sticky\n reset-drag-position\n v-model=\"showGroupModal\"\n class=\"diy-modal\"\n :mask-closable=\"false\"\n transfer\n :title=\"group.id ? '修改分组': '新增分组'\"\n >\n <i-form :label-width=\"100\" class=\"diy-form\" label-colon>\n <i-form-item label=\"分组名称\" required>\n <i-input class=\"diy-input\" v-model=\"group.name\"></i-input>\n </i-form-item>\n <i-form-item v-if=\"group.id\" label=\"所属项目\" required>\n <i-select class=\"diy-select\" v-model=\"group.projectId\" transfer filterable @on-change=\"onChangeProject(true)\">\n <i-option v-for=\"item in projectList\" :value=\"item.id\" :key=\"item.id\">{{item.name}}</i-option>\n </i-select>\n </i-form-item>\n <i-form-item label=\"分组位置\">\n <u-group-select :data=\"groupTree\" :current=\"parent\" @on-select=\"onSelectParent\"></u-group-select>\n </i-form-item>\n </i-form>\n <footer slot=\"footer\">\n <i-button class=\"diy-btn-primary\" type=\"primary\" @click.stop=\"onSaveGroup\">确定</i-button>\n <i-button class=\"diy-btn-default\" @click.stop=\"onGourpCancel\">取消</i-button>\n </footer>\n </i-modal>\n <i-modal draggable sticky reset-drag-position v-model=\"showInterfaceModal\" class=\"diy-modal\" :mask-closable=\"false\" :title=\"interfaceModel.id ? '修改接口': '新增接口'\">\n <i-form :label-width=\"100\" class=\"diy-form\" label-colon>\n <i-form-item label=\"接口名称\" required>\n <i-input class=\"diy-input\" v-model=\"interfaceModel.name\"></i-input>\n </i-form-item>\n\n <i-form-item v-if=\"interfaceModel.id\" label=\"所属项目\" required>\n <i-select class=\"diy-select\" v-model=\"interfaceModel.projectId\" transfer filterable @on-change=\"onChangeProject(false)\">\n <i-option v-for=\"item in projectList\" :value=\"item.id\" :key=\"item.id\">{{item.name}}</i-option>\n </i-select>\n </i-form-item>\n\n <i-form-item label=\"接口位置\" required>\n <u-group-select :data=\"groupTree\" :current=\"parent\" @on-select=\"onSelectParent\"></u-group-select>\n </i-form-item>\n <i-form-item label=\"接口类型\" required>\n <i-select v-model=\"interfaceModel.method\" class=\"diy-select\" transfer>\n <i-option v-for=\"item in typeList\" v-if=\"item.value\" :key=\"item.value\" :value=\"item.value\">{{item.text}}</i-option>\n </i-select>\n </i-form-item>\n </i-form>\n <footer slot=\"footer\">\n <i-button class=\"diy-btn-primary\" type=\"primary\" @click=\"onSaveInterface\">确定</i-button>\n <i-button class=\"diy-btn-default\" @click=\"onInterfaceCancel\">取消</i-button>\n </footer>\n </i-modal>\n <i-modal draggable sticky reset-drag-position v-model=\"showCopyModal\" class=\"diy-modal\" :mask-closable=\"false\" title=\"复制接口\">\n <i-form :label-width=\"100\" class=\"diy-form\" label-colon>\n <i-form-item label=\"接口名称\" required>\n <i-input class=\"diy-input\" v-model=\"copyName\"></i-input>\n </i-form-item>\n <i-form-item label=\"选择分组\" required>\n <u-group-select :isSelector=\"true\" :data=\"groupTree\" :current=\"parent\" @on-select=\"onSelectParent\"></u-group-select>\n </i-form-item>\n </i-form>\n <footer slot=\"footer\">\n <i-button class=\"diy-btn-primary\" type=\"primary\" @click=\"onCopy\">确定</i-button>\n <i-button class=\"diy-btn-default\" @click=\"onCopyCancel\">取消</i-button>\n </footer>\n </i-modal>\n\n <i-modal width=\"730\" draggable sticky reset-drag-position v-model=\"showMoveModal\" class=\"diy-modal\" :mask-closable=\"false\" :title=\"moveType==='group' ? '分组移动提示': '接口移动提示'\">\n <div class=\"api-move-project-body\">\n <span class=\"warn-title\">\n <i-icon type=\"ios-help-circle\" />\n 检测到被移动{{moveType==='group'?\"分组\":\"接口\"}}中存在已关联的授权/环境变量,是否在新项目中新建?\n </span>\n <span class=\"second-title\">新建授权/环境变量:将在目标项目中新建{{moveType==='group'?\"分组\":\"接口\"}}绑定的授权/环境变量</span>\n <span class=\"second-title\">不新建:将原有的授权/环境变量置为空,仅移动接口</span>\n <span class=\"second-title\">取消:取消本次操作</span>\n </div>\n <footer slot=\"footer\">\n <i-button class=\"diy-btn-primary api-move-ok-btn\" type=\"primary\" @click=\"onMoveOk(true)\">新建授权/环境变量</i-button>\n <i-button class=\"diy-btn-default\" @click=\"onMoveOk(false)\">不新建</i-button>\n <i-button class=\"diy-btn-default api-move-cancel-btn\" @click=\"onMoveCancel\">取消</i-button>\n </footer>\n </i-modal>\n <u-batch-modal :visiable.sync=\"showBatchModal\" :data=\"categoryApiList\" :projectId=\"projectId\" @on-success=\"onBatchSuccess\"></u-batch-modal>\n</article>\n"
|
|
348
348
|
|
|
349
349
|
/***/ }),
|
|
350
350
|
|
|
@@ -9364,12 +9364,24 @@ var service_ApiService = /** @class */function (_super) {
|
|
|
9364
9364
|
return this._post("/unity/api/category", category);
|
|
9365
9365
|
}
|
|
9366
9366
|
};
|
|
9367
|
+
ApiService.prototype.checkCategory = function (category) {
|
|
9368
|
+
return this._post("/unity/api/category/update/check", category);
|
|
9369
|
+
};
|
|
9370
|
+
ApiService.prototype.updateMoveCategory = function (category, copyEnvFlag) {
|
|
9371
|
+
return this._post("/unity/api/category/updateWithEnv?copyEnvFlag=".concat(copyEnvFlag), category);
|
|
9372
|
+
};
|
|
9367
9373
|
ApiService.prototype.saveApi = function (api) {
|
|
9368
9374
|
if (api.id) {
|
|
9369
9375
|
return this._put("/unity/api/info", api);
|
|
9370
9376
|
}
|
|
9371
9377
|
return this._post("/unity/api/info", api);
|
|
9372
9378
|
};
|
|
9379
|
+
ApiService.prototype.checkApi = function (api) {
|
|
9380
|
+
return this._post("/unity/api/info/update/check", api);
|
|
9381
|
+
};
|
|
9382
|
+
ApiService.prototype.updateMoveApi = function (api, copyEnvFlag) {
|
|
9383
|
+
return this._post("/unity/api/info/updateWithEnv?copyEnvFlag=".concat(copyEnvFlag), api);
|
|
9384
|
+
};
|
|
9373
9385
|
ApiService.prototype.copyApi = function (id, name, projectId, categoryId) {
|
|
9374
9386
|
return this._post("/unity/api/info/copy?id=".concat(id, "&name=").concat(name, "&projectId=").concat(projectId, "&categoryId=").concat(categoryId));
|
|
9375
9387
|
};
|
|
@@ -9469,11 +9481,31 @@ var service_ApiService = /** @class */function (_super) {
|
|
|
9469
9481
|
showTip: true,
|
|
9470
9482
|
showErrorMsg: true
|
|
9471
9483
|
})], ApiService.prototype, "saveCategory", null);
|
|
9484
|
+
__decorate([serviceHandler("save", {
|
|
9485
|
+
title: "保存分组",
|
|
9486
|
+
showTip: false,
|
|
9487
|
+
showErrorMsg: true
|
|
9488
|
+
})], ApiService.prototype, "checkCategory", null);
|
|
9489
|
+
__decorate([serviceHandler("save", {
|
|
9490
|
+
title: "保存分组",
|
|
9491
|
+
showTip: true,
|
|
9492
|
+
showErrorMsg: true
|
|
9493
|
+
})], ApiService.prototype, "updateMoveCategory", null);
|
|
9472
9494
|
__decorate([serviceHandler("save", {
|
|
9473
9495
|
title: "保存接口",
|
|
9474
9496
|
showErrorMsg: true,
|
|
9475
9497
|
showTip: true
|
|
9476
9498
|
})], ApiService.prototype, "saveApi", null);
|
|
9499
|
+
__decorate([serviceHandler("save", {
|
|
9500
|
+
title: "保存接口",
|
|
9501
|
+
showErrorMsg: true,
|
|
9502
|
+
showTip: false
|
|
9503
|
+
})], ApiService.prototype, "checkApi", null);
|
|
9504
|
+
__decorate([serviceHandler("save", {
|
|
9505
|
+
title: "保存接口",
|
|
9506
|
+
showTip: true,
|
|
9507
|
+
showErrorMsg: true
|
|
9508
|
+
})], ApiService.prototype, "updateMoveApi", null);
|
|
9477
9509
|
__decorate([serviceHandler("save", {
|
|
9478
9510
|
title: "复制接口",
|
|
9479
9511
|
showErrorMsg: false,
|
|
@@ -12813,16 +12845,25 @@ var project_detail_tree = __webpack_require__("9355");
|
|
|
12813
12845
|
|
|
12814
12846
|
|
|
12815
12847
|
|
|
12848
|
+
|
|
12816
12849
|
var tree_ProjectTree = /** @class */function (_super) {
|
|
12817
12850
|
__extends(ProjectTree, _super);
|
|
12818
12851
|
function ProjectTree() {
|
|
12819
12852
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
12853
|
+
_this.projectList = [];
|
|
12820
12854
|
_this.data = [];
|
|
12821
12855
|
_this.groupTree = [];
|
|
12822
12856
|
_this.parent = {};
|
|
12823
12857
|
_this.renderData = [];
|
|
12824
12858
|
_this.keyword = "";
|
|
12825
12859
|
_this.type = "all";
|
|
12860
|
+
_this.moveType = "group";
|
|
12861
|
+
_this.MOVE_RESULT = {
|
|
12862
|
+
BIND_JOB: "更新失败,API已被任务绑定,不允许变更项目信息",
|
|
12863
|
+
BIND_ENV: "更新失败,API存在关联环境变量,请确认变更项目信息时是否复制环境变量",
|
|
12864
|
+
BIND_NONE: "API未被任务绑定,且API不存在关联环境变量,更新成功",
|
|
12865
|
+
NOT_UPDATED_PROJECT: "API项目信息未改变,更新成功"
|
|
12866
|
+
};
|
|
12826
12867
|
_this.typeList = [
|
|
12827
12868
|
// {
|
|
12828
12869
|
// value: "all",
|
|
@@ -12851,10 +12892,12 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
12851
12892
|
_this.showCopyModal = false;
|
|
12852
12893
|
_this.copyName = "";
|
|
12853
12894
|
_this.group = {};
|
|
12895
|
+
_this.showMoveModal = false;
|
|
12854
12896
|
return _this;
|
|
12855
12897
|
}
|
|
12856
12898
|
ProjectTree.prototype.mounted = function () {
|
|
12857
12899
|
var _this = this;
|
|
12900
|
+
this.loadProjectList();
|
|
12858
12901
|
this.$subscribe("api://project-detail-save", function () {
|
|
12859
12902
|
_this.init();
|
|
12860
12903
|
});
|
|
@@ -12889,7 +12932,9 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
12889
12932
|
name: data.parentName
|
|
12890
12933
|
};
|
|
12891
12934
|
this.interfaceModel = data.$clone();
|
|
12935
|
+
this.moveType = "interface";
|
|
12892
12936
|
this.showInterfaceModal = true;
|
|
12937
|
+
this.onChangeProject(false);
|
|
12893
12938
|
};
|
|
12894
12939
|
ProjectTree.prototype.getApis = function (data) {
|
|
12895
12940
|
var _this = this;
|
|
@@ -12994,21 +13039,30 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
12994
13039
|
this.parent = {};
|
|
12995
13040
|
this.showCopyModal = false;
|
|
12996
13041
|
};
|
|
13042
|
+
ProjectTree.prototype.onMoveCancel = function () {
|
|
13043
|
+
this.parent = {};
|
|
13044
|
+
this.interfaceModel = {};
|
|
13045
|
+
this.group = {};
|
|
13046
|
+
this.showMoveModal = false;
|
|
13047
|
+
};
|
|
12997
13048
|
ProjectTree.prototype.onAddInterface = function (group) {
|
|
12998
13049
|
this.interfaceModel = {
|
|
12999
|
-
method: "GET"
|
|
13050
|
+
method: "GET",
|
|
13051
|
+
categoryId: group.id,
|
|
13052
|
+
projectId: this.projectId
|
|
13000
13053
|
};
|
|
13001
13054
|
this.parent = group;
|
|
13002
13055
|
this.showInterfaceModal = true;
|
|
13056
|
+
this.onChangeProject(false);
|
|
13003
13057
|
};
|
|
13004
13058
|
ProjectTree.prototype.onSaveInterface = function () {
|
|
13005
13059
|
return __awaiter(this, void 0, void 0, function () {
|
|
13006
|
-
var result;
|
|
13060
|
+
var res, status, result;
|
|
13007
13061
|
return __generator(this, function (_a) {
|
|
13008
13062
|
switch (_a.label) {
|
|
13009
13063
|
case 0:
|
|
13010
13064
|
this.interfaceModel.categoryId = this.parent.id;
|
|
13011
|
-
this.interfaceModel.projectId = this.projectId;
|
|
13065
|
+
// this.interfaceModel.projectId = this.projectId;
|
|
13012
13066
|
if (!this.interfaceModel.name) {
|
|
13013
13067
|
this.$message.error("接口名称不能为空");
|
|
13014
13068
|
return [2 /*return*/];
|
|
@@ -13022,14 +13076,35 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13022
13076
|
this.showInterfaceModal = true;
|
|
13023
13077
|
return [2 /*return*/];
|
|
13024
13078
|
}
|
|
13025
|
-
return [
|
|
13079
|
+
if (!this.interfaceModel.id) return [3 /*break*/, 2];
|
|
13080
|
+
return [4 /*yield*/, this.service.checkApi(this.interfaceModel)];
|
|
13026
13081
|
case 1:
|
|
13082
|
+
res = _a.sent();
|
|
13083
|
+
if (res && !res.hasError) {
|
|
13084
|
+
status = res.result;
|
|
13085
|
+
this.showInterfaceModal = false;
|
|
13086
|
+
if (["BIND_NONE", "NOT_UPDATED_PROJECT"].includes(status)) {
|
|
13087
|
+
this.$message.success("保存接口成功");
|
|
13088
|
+
this.$emit("on-edit-interface-success", this.interfaceModel);
|
|
13089
|
+
this.init();
|
|
13090
|
+
} else if ("BIND_JOB" === status) {
|
|
13091
|
+
this.$message.error(this.MOVE_RESULT.BIND_JOB);
|
|
13092
|
+
} else if ("BIND_ENV" === status) {
|
|
13093
|
+
this.showMoveModal = true;
|
|
13094
|
+
}
|
|
13095
|
+
}
|
|
13096
|
+
return [3 /*break*/, 4];
|
|
13097
|
+
case 2:
|
|
13098
|
+
return [4 /*yield*/, this.service.saveApi(this.interfaceModel)];
|
|
13099
|
+
case 3:
|
|
13027
13100
|
result = _a.sent();
|
|
13028
13101
|
if (result && !result.hasError) {
|
|
13029
13102
|
this.showInterfaceModal = false;
|
|
13030
13103
|
this.$emit("on-edit-interface-success", this.interfaceModel);
|
|
13031
13104
|
this.init();
|
|
13032
13105
|
}
|
|
13106
|
+
_a.label = 4;
|
|
13107
|
+
case 4:
|
|
13033
13108
|
return [2 /*return*/];
|
|
13034
13109
|
}
|
|
13035
13110
|
});
|
|
@@ -13065,13 +13140,16 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13065
13140
|
name: group.parentName
|
|
13066
13141
|
};
|
|
13067
13142
|
this.group = group.$clone();
|
|
13143
|
+
this.moveType = "group";
|
|
13068
13144
|
this.showGroupModal = true;
|
|
13145
|
+
this.onChangeProject(true);
|
|
13069
13146
|
};
|
|
13070
13147
|
ProjectTree.prototype.onAddGroup = function () {
|
|
13071
13148
|
this.group = {
|
|
13072
13149
|
projectId: this.projectId
|
|
13073
13150
|
};
|
|
13074
13151
|
this.showGroupModal = true;
|
|
13152
|
+
this.onChangeProject(true);
|
|
13075
13153
|
};
|
|
13076
13154
|
/**
|
|
13077
13155
|
* 输入关键字对数据进行过滤
|
|
@@ -13083,21 +13161,6 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13083
13161
|
}
|
|
13084
13162
|
this.renderData = this.filterData(this.data.$clone());
|
|
13085
13163
|
};
|
|
13086
|
-
/**
|
|
13087
|
-
* 判断一个节点是否是与关键字匹配的叶子节点,或者是包含符合条件的叶子节点的祖先节点
|
|
13088
|
-
* @param node
|
|
13089
|
-
*/
|
|
13090
|
-
// public match(node: any) {
|
|
13091
|
-
// if (!node.children || node.children.length === 0) {
|
|
13092
|
-
// return (node.title || node.name).indexOf(this.keyword) !== -1 && (this.type === "all" || this.type === node.method);
|
|
13093
|
-
// } else {
|
|
13094
|
-
// let flag = false;
|
|
13095
|
-
// node.children.forEach((v: any) => {
|
|
13096
|
-
// flag = this.match(v) ? this.match(v) : flag;
|
|
13097
|
-
// });
|
|
13098
|
-
// return flag;
|
|
13099
|
-
// }
|
|
13100
|
-
// }
|
|
13101
13164
|
/**
|
|
13102
13165
|
* 判断一个节点是否是与关键字匹配的叶子节点或者目录节点,或者是包含符合条件的叶子节点的祖先节点
|
|
13103
13166
|
* 如果匹配的是目录节点,那么目录下的节点无需过滤
|
|
@@ -13144,7 +13207,7 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13144
13207
|
};
|
|
13145
13208
|
ProjectTree.prototype.onSaveGroup = function () {
|
|
13146
13209
|
return __awaiter(this, void 0, void 0, function () {
|
|
13147
|
-
var result;
|
|
13210
|
+
var isChildNode, res, status, result;
|
|
13148
13211
|
return __generator(this, function (_a) {
|
|
13149
13212
|
switch (_a.label) {
|
|
13150
13213
|
case 0:
|
|
@@ -13158,13 +13221,38 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13158
13221
|
this.$message.warning("所属分组不能选中自身");
|
|
13159
13222
|
return [2 /*return*/];
|
|
13160
13223
|
}
|
|
13161
|
-
|
|
13224
|
+
isChildNode = this.isChildNode(this.group, this.group.parentId);
|
|
13225
|
+
if (isChildNode) {
|
|
13226
|
+
this.$message.warning("所属分组不能选中自身的子节点");
|
|
13227
|
+
return [2 /*return*/];
|
|
13228
|
+
}
|
|
13229
|
+
if (!this.group.id) return [3 /*break*/, 2];
|
|
13230
|
+
return [4 /*yield*/, this.service.checkCategory(this.group)];
|
|
13162
13231
|
case 1:
|
|
13232
|
+
res = _a.sent();
|
|
13233
|
+
if (res && !res.hasError) {
|
|
13234
|
+
status = res.result;
|
|
13235
|
+
this.showGroupModal = false;
|
|
13236
|
+
if (["BIND_NONE", "NOT_UPDATED_PROJECT"].includes(status)) {
|
|
13237
|
+
this.$message.success("保存分组成功");
|
|
13238
|
+
this.init();
|
|
13239
|
+
} else if ("BIND_JOB" === status) {
|
|
13240
|
+
this.$message.error(this.MOVE_RESULT.BIND_JOB);
|
|
13241
|
+
} else if ("BIND_ENV" === status) {
|
|
13242
|
+
this.showMoveModal = true;
|
|
13243
|
+
}
|
|
13244
|
+
}
|
|
13245
|
+
return [3 /*break*/, 4];
|
|
13246
|
+
case 2:
|
|
13247
|
+
return [4 /*yield*/, this.service.saveCategory(this.group)];
|
|
13248
|
+
case 3:
|
|
13163
13249
|
result = _a.sent();
|
|
13164
13250
|
if (result && !result.hasError) {
|
|
13165
13251
|
this.showGroupModal = false;
|
|
13166
13252
|
this.init();
|
|
13167
13253
|
}
|
|
13254
|
+
_a.label = 4;
|
|
13255
|
+
case 4:
|
|
13168
13256
|
return [2 /*return*/];
|
|
13169
13257
|
}
|
|
13170
13258
|
});
|
|
@@ -13205,12 +13293,104 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13205
13293
|
ProjectTree.prototype.onBatchSuccess = function (data) {
|
|
13206
13294
|
this.$emit("on-success", data);
|
|
13207
13295
|
};
|
|
13296
|
+
// 是否当前节点的子节点
|
|
13297
|
+
ProjectTree.prototype.isChildNode = function (currentNode, targetId) {
|
|
13298
|
+
if (!currentNode.children || currentNode.children.length === 0) {
|
|
13299
|
+
return false;
|
|
13300
|
+
}
|
|
13301
|
+
for (var _i = 0, _a = currentNode.children; _i < _a.length; _i++) {
|
|
13302
|
+
var child = _a[_i];
|
|
13303
|
+
if (child.id === targetId) {
|
|
13304
|
+
return true;
|
|
13305
|
+
}
|
|
13306
|
+
if (this.isChildNode(child, targetId)) {
|
|
13307
|
+
return true;
|
|
13308
|
+
}
|
|
13309
|
+
}
|
|
13310
|
+
return false;
|
|
13311
|
+
};
|
|
13312
|
+
ProjectTree.prototype.loadProjectList = function () {
|
|
13313
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
13314
|
+
var res;
|
|
13315
|
+
return __generator(this, function (_a) {
|
|
13316
|
+
switch (_a.label) {
|
|
13317
|
+
case 0:
|
|
13318
|
+
return [4 /*yield*/, this.projectService.getProjectList({})];
|
|
13319
|
+
case 1:
|
|
13320
|
+
res = _a.sent();
|
|
13321
|
+
this.projectList = (res === null || res === void 0 ? void 0 : res.result) || [];
|
|
13322
|
+
return [2 /*return*/];
|
|
13323
|
+
}
|
|
13324
|
+
});
|
|
13325
|
+
});
|
|
13326
|
+
};
|
|
13327
|
+
// 改变所属项目
|
|
13328
|
+
ProjectTree.prototype.onChangeProject = function (isGroup) {
|
|
13329
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
13330
|
+
var result, data;
|
|
13331
|
+
return __generator(this, function (_a) {
|
|
13332
|
+
switch (_a.label) {
|
|
13333
|
+
case 0:
|
|
13334
|
+
this.parent = {
|
|
13335
|
+
id: null,
|
|
13336
|
+
name: null
|
|
13337
|
+
};
|
|
13338
|
+
if (!isGroup) return [3 /*break*/, 2];
|
|
13339
|
+
this.group.parentId = null;
|
|
13340
|
+
this.group.parentName = null;
|
|
13341
|
+
return [4 /*yield*/, this.service.getApiTree(this.group.projectId)];
|
|
13342
|
+
case 1:
|
|
13343
|
+
result = _a.sent();
|
|
13344
|
+
return [3 /*break*/, 4];
|
|
13345
|
+
case 2:
|
|
13346
|
+
this.interfaceModel.categoryId = null;
|
|
13347
|
+
return [4 /*yield*/, this.service.getApiTree(this.interfaceModel.projectId)];
|
|
13348
|
+
case 3:
|
|
13349
|
+
result = _a.sent();
|
|
13350
|
+
_a.label = 4;
|
|
13351
|
+
case 4:
|
|
13352
|
+
data = (result === null || result === void 0 ? void 0 : result.result) || [];
|
|
13353
|
+
TreeDataUtil.handlerTreeData(data, "name");
|
|
13354
|
+
this.groupTree = data;
|
|
13355
|
+
return [2 /*return*/];
|
|
13356
|
+
}
|
|
13357
|
+
});
|
|
13358
|
+
});
|
|
13359
|
+
};
|
|
13360
|
+
ProjectTree.prototype.onMoveOk = function (copyEnvFlag) {
|
|
13361
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
13362
|
+
var res;
|
|
13363
|
+
return __generator(this, function (_a) {
|
|
13364
|
+
switch (_a.label) {
|
|
13365
|
+
case 0:
|
|
13366
|
+
this.showMoveModal = false;
|
|
13367
|
+
if (!(this.moveType === "group")) return [3 /*break*/, 2];
|
|
13368
|
+
return [4 /*yield*/, this.service.updateMoveCategory(this.group, copyEnvFlag)];
|
|
13369
|
+
case 1:
|
|
13370
|
+
res = _a.sent();
|
|
13371
|
+
return [3 /*break*/, 4];
|
|
13372
|
+
case 2:
|
|
13373
|
+
if (!(this.moveType === "interface")) return [3 /*break*/, 4];
|
|
13374
|
+
return [4 /*yield*/, this.service.updateMoveApi(this.interfaceModel, copyEnvFlag)];
|
|
13375
|
+
case 3:
|
|
13376
|
+
res = _a.sent();
|
|
13377
|
+
_a.label = 4;
|
|
13378
|
+
case 4:
|
|
13379
|
+
if (res && !res.hasError) {
|
|
13380
|
+
this.init();
|
|
13381
|
+
}
|
|
13382
|
+
return [2 /*return*/];
|
|
13383
|
+
}
|
|
13384
|
+
});
|
|
13385
|
+
});
|
|
13386
|
+
};
|
|
13208
13387
|
__decorate([Object(flagwind_web_["config"])({
|
|
13209
13388
|
default: function () {
|
|
13210
13389
|
return [];
|
|
13211
13390
|
}
|
|
13212
13391
|
})], ProjectTree.prototype, "projectId", void 0);
|
|
13213
13392
|
__decorate([autowired(project_detail_service)], ProjectTree.prototype, "service", void 0);
|
|
13393
|
+
__decorate([autowired(project_list_service)], ProjectTree.prototype, "projectService", void 0);
|
|
13214
13394
|
__decorate([Object(flagwind_web_["watch"])("projectId", {
|
|
13215
13395
|
immediate: true
|
|
13216
13396
|
})], ProjectTree.prototype, "init", null);
|