@egova/egova-api 1.3.1 → 1.3.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 +67 -10
- package/dist/index.umd.js +67 -10
- package/dist/index.umd.min.js +2 -2
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -335,7 +335,7 @@ module.exports = function (error, C, stack, dropEntries) {
|
|
|
335
335
|
/***/ "193e":
|
|
336
336
|
/***/ (function(module, exports) {
|
|
337
337
|
|
|
338
|
-
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-item label=\"需要认证\" required>\n <i-select v-model=\"interfaceModel.authFlag\" class=\"diy-select\" transfer>\n <i-option :key=\"0\" :value=\"0\">否</i-option>\n <i-option :key=\"1\" :value=\"1\">是</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"
|
|
338
|
+
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,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,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\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-item label=\"需要认证\" required>\n <i-select v-model=\"interfaceModel.authFlag\" class=\"diy-select\" transfer>\n <i-option :key=\"0\" :value=\"0\">否</i-option>\n <i-option :key=\"1\" :value=\"1\">是</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"
|
|
339
339
|
|
|
340
340
|
/***/ }),
|
|
341
341
|
|
|
@@ -5173,6 +5173,55 @@ var TreeDataUtil = /** @class */function () {
|
|
|
5173
5173
|
});
|
|
5174
5174
|
return arr;
|
|
5175
5175
|
};
|
|
5176
|
+
// 处理公共树结构
|
|
5177
|
+
TreeDataUtil.handlerTreeData2 = function (list, titleName, detailName, detailTitleName, filterEmpty, parentId, parentName) {
|
|
5178
|
+
if (list === void 0) {
|
|
5179
|
+
list = [];
|
|
5180
|
+
}
|
|
5181
|
+
if (detailName === void 0) {
|
|
5182
|
+
detailName = "";
|
|
5183
|
+
}
|
|
5184
|
+
if (detailTitleName === void 0) {
|
|
5185
|
+
detailTitleName = titleName;
|
|
5186
|
+
}
|
|
5187
|
+
if (filterEmpty === void 0) {
|
|
5188
|
+
filterEmpty = false;
|
|
5189
|
+
}
|
|
5190
|
+
if (parentId === void 0) {
|
|
5191
|
+
parentId = "";
|
|
5192
|
+
}
|
|
5193
|
+
if (parentName === void 0) {
|
|
5194
|
+
parentName = "";
|
|
5195
|
+
}
|
|
5196
|
+
var arr = [];
|
|
5197
|
+
list && list.forEach(function (v) {
|
|
5198
|
+
v.title = v[titleName];
|
|
5199
|
+
v.checked = false;
|
|
5200
|
+
v.selected = false;
|
|
5201
|
+
v.indeterminate = false;
|
|
5202
|
+
v.expand = false;
|
|
5203
|
+
v.parentId = v.parentId || parentId;
|
|
5204
|
+
v.parentName = v.parentName || parentName;
|
|
5205
|
+
v.children = TreeDataUtil.handlerTreeData2(v.children, titleName, detailName, detailTitleName, false, v.id, v.title);
|
|
5206
|
+
if (detailName) {
|
|
5207
|
+
var tmp = v[detailName];
|
|
5208
|
+
if (tmp) {
|
|
5209
|
+
tmp = tmp.map(function (item) {
|
|
5210
|
+
item.title = item[detailTitleName];
|
|
5211
|
+
item.checked = false;
|
|
5212
|
+
item.selected = false;
|
|
5213
|
+
item.indeterminate = false;
|
|
5214
|
+
item.parentId = v.id;
|
|
5215
|
+
item.parentName = v.title;
|
|
5216
|
+
return item;
|
|
5217
|
+
});
|
|
5218
|
+
v.children = (v.children || []).concat(tmp);
|
|
5219
|
+
}
|
|
5220
|
+
}
|
|
5221
|
+
if (!filterEmpty || v.children.length) arr.push(v);
|
|
5222
|
+
});
|
|
5223
|
+
return arr;
|
|
5224
|
+
};
|
|
5176
5225
|
// 查找当前目录节点的完整路径
|
|
5177
5226
|
TreeDataUtil.treeNodeDirectory = function (treeList, id) {
|
|
5178
5227
|
if (treeList === void 0) {
|
|
@@ -6577,6 +6626,9 @@ var project_combine_ProjectCombineManage = /** @class */function (_super) {
|
|
|
6577
6626
|
return [4 /*yield*/, this.service.page(queryModel)];
|
|
6578
6627
|
case 2:
|
|
6579
6628
|
res = _e.sent();
|
|
6629
|
+
((res === null || res === void 0 ? void 0 : res.result) || []).forEach(function (item) {
|
|
6630
|
+
item._disabled = item.status === "PUBLISHED";
|
|
6631
|
+
});
|
|
6580
6632
|
this.list = (_c = res && res.result) !== null && _c !== void 0 ? _c : [];
|
|
6581
6633
|
this.paging.totalCount = (_d = res && res.totalCount) !== null && _d !== void 0 ? _d : 0;
|
|
6582
6634
|
return [3 /*break*/, 4];
|
|
@@ -13116,7 +13168,6 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13116
13168
|
return __generator(this, function (_a) {
|
|
13117
13169
|
switch (_a.label) {
|
|
13118
13170
|
case 0:
|
|
13119
|
-
console.log("delete-group", group);
|
|
13120
13171
|
return [4 /*yield*/, this.service.deleteCategory(group.id)];
|
|
13121
13172
|
case 1:
|
|
13122
13173
|
result = _a.sent();
|
|
@@ -13206,6 +13257,7 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13206
13257
|
switch (_a.label) {
|
|
13207
13258
|
case 0:
|
|
13208
13259
|
this.group.parentId = this.parent.id;
|
|
13260
|
+
this.group.parentName = this.parent.name;
|
|
13209
13261
|
this.group.type = "api";
|
|
13210
13262
|
if (!this.group.name) {
|
|
13211
13263
|
this.$message.warning("请填写分组名称");
|
|
@@ -13267,11 +13319,11 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13267
13319
|
result = _a.sent();
|
|
13268
13320
|
this.data = (result === null || result === void 0 ? void 0 : result.result) || [];
|
|
13269
13321
|
data = this.data.$clone();
|
|
13270
|
-
TreeDataUtil.
|
|
13322
|
+
TreeDataUtil.handlerTreeData2(data, "name");
|
|
13271
13323
|
this.groupTree = data;
|
|
13272
13324
|
data = this.data.$clone();
|
|
13273
13325
|
lastRenderData = this.renderData;
|
|
13274
|
-
TreeDataUtil.
|
|
13326
|
+
TreeDataUtil.handlerTreeData2(this.data, "name", "apis");
|
|
13275
13327
|
if (lastRenderData && lastRenderData.length > 0) {
|
|
13276
13328
|
this.data.forEach(function (dataItem) {
|
|
13277
13329
|
lastRenderData.forEach(function (lastDataItem) {
|
|
@@ -13322,16 +13374,21 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13322
13374
|
});
|
|
13323
13375
|
};
|
|
13324
13376
|
// 改变所属项目
|
|
13325
|
-
ProjectTree.prototype.onChangeProject = function (isGroup) {
|
|
13377
|
+
ProjectTree.prototype.onChangeProject = function (isGroup, reset) {
|
|
13378
|
+
if (reset === void 0) {
|
|
13379
|
+
reset = false;
|
|
13380
|
+
}
|
|
13326
13381
|
return __awaiter(this, void 0, void 0, function () {
|
|
13327
13382
|
var result, data;
|
|
13328
13383
|
return __generator(this, function (_a) {
|
|
13329
13384
|
switch (_a.label) {
|
|
13330
13385
|
case 0:
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
|
|
13334
|
-
|
|
13386
|
+
if (reset) {
|
|
13387
|
+
this.parent = {
|
|
13388
|
+
id: null,
|
|
13389
|
+
name: null
|
|
13390
|
+
};
|
|
13391
|
+
}
|
|
13335
13392
|
if (!isGroup) return [3 /*break*/, 2];
|
|
13336
13393
|
this.group.parentId = null;
|
|
13337
13394
|
this.group.parentName = null;
|
|
@@ -13347,7 +13404,7 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13347
13404
|
_a.label = 4;
|
|
13348
13405
|
case 4:
|
|
13349
13406
|
data = (result === null || result === void 0 ? void 0 : result.result) || [];
|
|
13350
|
-
TreeDataUtil.
|
|
13407
|
+
TreeDataUtil.handlerTreeData2(data, "name");
|
|
13351
13408
|
this.groupTree = data;
|
|
13352
13409
|
return [2 /*return*/];
|
|
13353
13410
|
}
|
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\">\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-item label=\"需要认证\" required>\n <i-select v-model=\"interfaceModel.authFlag\" class=\"diy-select\" transfer>\n <i-option :key=\"0\" :value=\"0\">否</i-option>\n <i-option :key=\"1\" :value=\"1\">是</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"
|
|
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,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,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\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-item label=\"需要认证\" required>\n <i-select v-model=\"interfaceModel.authFlag\" class=\"diy-select\" transfer>\n <i-option :key=\"0\" :value=\"0\">否</i-option>\n <i-option :key=\"1\" :value=\"1\">是</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
|
|
|
@@ -5182,6 +5182,55 @@ var TreeDataUtil = /** @class */function () {
|
|
|
5182
5182
|
});
|
|
5183
5183
|
return arr;
|
|
5184
5184
|
};
|
|
5185
|
+
// 处理公共树结构
|
|
5186
|
+
TreeDataUtil.handlerTreeData2 = function (list, titleName, detailName, detailTitleName, filterEmpty, parentId, parentName) {
|
|
5187
|
+
if (list === void 0) {
|
|
5188
|
+
list = [];
|
|
5189
|
+
}
|
|
5190
|
+
if (detailName === void 0) {
|
|
5191
|
+
detailName = "";
|
|
5192
|
+
}
|
|
5193
|
+
if (detailTitleName === void 0) {
|
|
5194
|
+
detailTitleName = titleName;
|
|
5195
|
+
}
|
|
5196
|
+
if (filterEmpty === void 0) {
|
|
5197
|
+
filterEmpty = false;
|
|
5198
|
+
}
|
|
5199
|
+
if (parentId === void 0) {
|
|
5200
|
+
parentId = "";
|
|
5201
|
+
}
|
|
5202
|
+
if (parentName === void 0) {
|
|
5203
|
+
parentName = "";
|
|
5204
|
+
}
|
|
5205
|
+
var arr = [];
|
|
5206
|
+
list && list.forEach(function (v) {
|
|
5207
|
+
v.title = v[titleName];
|
|
5208
|
+
v.checked = false;
|
|
5209
|
+
v.selected = false;
|
|
5210
|
+
v.indeterminate = false;
|
|
5211
|
+
v.expand = false;
|
|
5212
|
+
v.parentId = v.parentId || parentId;
|
|
5213
|
+
v.parentName = v.parentName || parentName;
|
|
5214
|
+
v.children = TreeDataUtil.handlerTreeData2(v.children, titleName, detailName, detailTitleName, false, v.id, v.title);
|
|
5215
|
+
if (detailName) {
|
|
5216
|
+
var tmp = v[detailName];
|
|
5217
|
+
if (tmp) {
|
|
5218
|
+
tmp = tmp.map(function (item) {
|
|
5219
|
+
item.title = item[detailTitleName];
|
|
5220
|
+
item.checked = false;
|
|
5221
|
+
item.selected = false;
|
|
5222
|
+
item.indeterminate = false;
|
|
5223
|
+
item.parentId = v.id;
|
|
5224
|
+
item.parentName = v.title;
|
|
5225
|
+
return item;
|
|
5226
|
+
});
|
|
5227
|
+
v.children = (v.children || []).concat(tmp);
|
|
5228
|
+
}
|
|
5229
|
+
}
|
|
5230
|
+
if (!filterEmpty || v.children.length) arr.push(v);
|
|
5231
|
+
});
|
|
5232
|
+
return arr;
|
|
5233
|
+
};
|
|
5185
5234
|
// 查找当前目录节点的完整路径
|
|
5186
5235
|
TreeDataUtil.treeNodeDirectory = function (treeList, id) {
|
|
5187
5236
|
if (treeList === void 0) {
|
|
@@ -6586,6 +6635,9 @@ var project_combine_ProjectCombineManage = /** @class */function (_super) {
|
|
|
6586
6635
|
return [4 /*yield*/, this.service.page(queryModel)];
|
|
6587
6636
|
case 2:
|
|
6588
6637
|
res = _e.sent();
|
|
6638
|
+
((res === null || res === void 0 ? void 0 : res.result) || []).forEach(function (item) {
|
|
6639
|
+
item._disabled = item.status === "PUBLISHED";
|
|
6640
|
+
});
|
|
6589
6641
|
this.list = (_c = res && res.result) !== null && _c !== void 0 ? _c : [];
|
|
6590
6642
|
this.paging.totalCount = (_d = res && res.totalCount) !== null && _d !== void 0 ? _d : 0;
|
|
6591
6643
|
return [3 /*break*/, 4];
|
|
@@ -13125,7 +13177,6 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13125
13177
|
return __generator(this, function (_a) {
|
|
13126
13178
|
switch (_a.label) {
|
|
13127
13179
|
case 0:
|
|
13128
|
-
console.log("delete-group", group);
|
|
13129
13180
|
return [4 /*yield*/, this.service.deleteCategory(group.id)];
|
|
13130
13181
|
case 1:
|
|
13131
13182
|
result = _a.sent();
|
|
@@ -13215,6 +13266,7 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13215
13266
|
switch (_a.label) {
|
|
13216
13267
|
case 0:
|
|
13217
13268
|
this.group.parentId = this.parent.id;
|
|
13269
|
+
this.group.parentName = this.parent.name;
|
|
13218
13270
|
this.group.type = "api";
|
|
13219
13271
|
if (!this.group.name) {
|
|
13220
13272
|
this.$message.warning("请填写分组名称");
|
|
@@ -13276,11 +13328,11 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13276
13328
|
result = _a.sent();
|
|
13277
13329
|
this.data = (result === null || result === void 0 ? void 0 : result.result) || [];
|
|
13278
13330
|
data = this.data.$clone();
|
|
13279
|
-
TreeDataUtil.
|
|
13331
|
+
TreeDataUtil.handlerTreeData2(data, "name");
|
|
13280
13332
|
this.groupTree = data;
|
|
13281
13333
|
data = this.data.$clone();
|
|
13282
13334
|
lastRenderData = this.renderData;
|
|
13283
|
-
TreeDataUtil.
|
|
13335
|
+
TreeDataUtil.handlerTreeData2(this.data, "name", "apis");
|
|
13284
13336
|
if (lastRenderData && lastRenderData.length > 0) {
|
|
13285
13337
|
this.data.forEach(function (dataItem) {
|
|
13286
13338
|
lastRenderData.forEach(function (lastDataItem) {
|
|
@@ -13331,16 +13383,21 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13331
13383
|
});
|
|
13332
13384
|
};
|
|
13333
13385
|
// 改变所属项目
|
|
13334
|
-
ProjectTree.prototype.onChangeProject = function (isGroup) {
|
|
13386
|
+
ProjectTree.prototype.onChangeProject = function (isGroup, reset) {
|
|
13387
|
+
if (reset === void 0) {
|
|
13388
|
+
reset = false;
|
|
13389
|
+
}
|
|
13335
13390
|
return __awaiter(this, void 0, void 0, function () {
|
|
13336
13391
|
var result, data;
|
|
13337
13392
|
return __generator(this, function (_a) {
|
|
13338
13393
|
switch (_a.label) {
|
|
13339
13394
|
case 0:
|
|
13340
|
-
|
|
13341
|
-
|
|
13342
|
-
|
|
13343
|
-
|
|
13395
|
+
if (reset) {
|
|
13396
|
+
this.parent = {
|
|
13397
|
+
id: null,
|
|
13398
|
+
name: null
|
|
13399
|
+
};
|
|
13400
|
+
}
|
|
13344
13401
|
if (!isGroup) return [3 /*break*/, 2];
|
|
13345
13402
|
this.group.parentId = null;
|
|
13346
13403
|
this.group.parentName = null;
|
|
@@ -13356,7 +13413,7 @@ var tree_ProjectTree = /** @class */function (_super) {
|
|
|
13356
13413
|
_a.label = 4;
|
|
13357
13414
|
case 4:
|
|
13358
13415
|
data = (result === null || result === void 0 ? void 0 : result.result) || [];
|
|
13359
|
-
TreeDataUtil.
|
|
13416
|
+
TreeDataUtil.handlerTreeData2(data, "name");
|
|
13360
13417
|
this.groupTree = data;
|
|
13361
13418
|
return [2 /*return*/];
|
|
13362
13419
|
}
|