|
5 | 5 | <div v-else> |
6 | 6 | <el-container> |
7 | 7 | <el-aside> |
8 | | - <el-button |
9 | | - icon="el-icon-download" |
10 | | - type="text" |
11 | | - @click="downloadAll" |
12 | | - >下载全部</el-button> |
13 | | - <el-input |
14 | | - v-show="treeData.length > 0" |
15 | | - v-model="filterText" |
16 | | - prefix-icon="el-icon-search" |
17 | | - placeholder="搜索" |
18 | | - size="mini" |
19 | | - clearable |
20 | | - style="margin-bottom: 10px;" |
21 | | - /> |
22 | | - <el-tree |
23 | | - ref="tree" |
24 | | - :data="treeData" |
25 | | - :props="defaultProps" |
26 | | - :filter-node-method="filterNode" |
27 | | - node-key="id" |
28 | | - default-expand-all |
29 | | - highlight-current |
30 | | - @current-change="onTreeSelect" |
31 | | - /> |
| 8 | + <el-button icon="el-icon-download" type="text" @click="downloadAll">下载全部</el-button> |
| 9 | + <el-button v-if="!loading" icon="el-icon-refresh" type="text" @click="reGenerate" style="float: right;">再次构建</el-button> |
| 10 | + <el-input v-show="treeData.length > 0" v-model="filterText" prefix-icon="el-icon-search" placeholder="搜索" size="mini" clearable style="margin-bottom: 10px;"/> |
| 11 | + <el-tree ref="tree" :data="treeData" :props="defaultProps" :filter-node-method="filterNode" node-key="id" default-expand-all highlight-current @current-change="onTreeSelect"/> |
32 | 12 | </el-aside> |
33 | 13 | <el-main v-show="fileInfo.content.length > 0"> |
34 | | - <el-button |
35 | | - type="text" |
36 | | - icon="el-icon-document-copy" |
37 | | - :data-clipboard-text="fileInfo.content" |
38 | | - class="copyBtn">复制代码</el-button> |
39 | | - <el-button |
40 | | - icon="el-icon-download" |
41 | | - type="text" |
42 | | - @click="downloadText(fileInfo.fileName, fileInfo.content)" |
43 | | - >下载当前文件</el-button> |
44 | | - <codemirror |
45 | | - v-model="fileInfo.content" |
46 | | - :options="cmOptions" |
47 | | - /> |
| 14 | + <el-button type="text" icon="el-icon-document-copy" :data-clipboard-text="fileInfo.content" class="copyBtn">复制代码</el-button> |
| 15 | + <el-button icon="el-icon-download" type="text" @click="downloadText(fileInfo.fileName, fileInfo.content)">下载当前文件</el-button> |
| 16 | + <codemirror v-model="fileInfo.content" :options="cmOptions"/> |
48 | 17 | </el-main> |
49 | 18 | </el-container> |
50 | 19 | </div> |
@@ -133,6 +102,15 @@ export default { |
133 | 102 | this.treeData = this.buildTreeData(rows) |
134 | 103 | }) |
135 | 104 | }, |
| 105 | + reGenerate(){ |
| 106 | + this.onGenerate() |
| 107 | + this.tip('构建成功') |
| 108 | + this.fileInfo = { |
| 109 | + content: '', |
| 110 | + fileName: '' |
| 111 | + } |
| 112 | + this.cmOptions.mode = 'text/x-java' |
| 113 | + }, |
136 | 114 | // 树搜索 |
137 | 115 | filterNode(value, data) { |
138 | 116 | if (!value) return true |
|
0 commit comments