路由配置中,点击Mock数据可以直接修改文件内容
This commit is contained in:
+10
-1
@@ -84,7 +84,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="Mock 文件路径" min-width="240" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.filePath }}</span>
|
||||
<a href="javascript:void(0)" style="color:#409EFF;cursor:pointer;" @click="openMockFileFromRoute(scope.row)">{{ scope.row.filePath }}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="返回状态码" width="120" align="center">
|
||||
@@ -842,6 +842,15 @@
|
||||
};
|
||||
this.mockFileDialog.visible = true;
|
||||
},
|
||||
openMockFileFromRoute: function (routeRow) {
|
||||
var filePath = routeRow.filePath || "";
|
||||
var mockFile = this.mockFiles.find(function (f) { return f.filePath === filePath; });
|
||||
if (!mockFile) {
|
||||
this.$message.warning("未找到对应的 Mock 文件:" + filePath);
|
||||
return;
|
||||
}
|
||||
this.openMockFileDialogForEdit(mockFile);
|
||||
},
|
||||
openMockFileDialogForCopy: function (item) {
|
||||
this.mockFileDialog.mode = "copy";
|
||||
this.mockFileDialog.form = {
|
||||
|
||||
Reference in New Issue
Block a user