ap-dev 1.0.27 → 1.0.31

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.
Binary file
Binary file
@@ -16,15 +16,16 @@
16
16
 
17
17
  <api-tittle-2>二、使用方法:</api-tittle-2>
18
18
  <api-content>
19
- 1、打开接口地址:http://ip:端口/项目名/swagger-ui/index.html<br>
19
+ <b>1、打开接口地址:</b>http://ip:端口/项目名/swagger-ui/index.html<br>
20
20
  <api-code>
21
21
  示例:<br>
22
22
  http://172.22.0.252:8181/apm/swagger-ui/index.html
23
23
  </api-code>
24
24
  <br>
25
- 2、添加token<br>
25
+ <b>2、添加token:</b><br>
26
26
  <el-image style="height: 500px" :src="image1" :fit="true"></el-image>
27
- 3、调用接口<br>
27
+ <br>
28
+ <b>3、调用接口:</b><br>
28
29
  <el-image style="height: 500px" :src="image2" :fit="true"></el-image>
29
30
  </api-content>
30
31
  </div>
@@ -40,8 +41,8 @@ export default {
40
41
  },
41
42
  data() {
42
43
  return {
43
- image1: require("./../images/ApiSwagger1.png.png"),
44
- image2: require("./../images/ApiSwagger2.png.png"),
44
+ image1: require("./../images/ApiSwagger1.png"),
45
+ image2: require("./../images/ApiSwagger2.png"),
45
46
  }
46
47
  }
47
48
  }
@@ -2,26 +2,26 @@
2
2
  <ap-container>
3
3
  <ap-aside margin="1111" style="width: 450px">
4
4
  <div class="layout-aside-header">
5
- <div class="layout-aside-header-title">{{headerName}}</div>
5
+ <div class="layout-aside-header-title">{{ headerName }}</div>
6
6
  </div>
7
7
  <div>
8
8
  <el-input v-model="filterText" placeholder="关键字过滤"/>
9
9
  </div>
10
10
  <div v-loading="loadingTreeFlag" class="layout-aside-content">
11
11
  <el-tree
12
- ref="typeTree"
13
- class="filter-tree"
14
- node-key="fdId"
15
- :data="typeTreeList"
16
- :props="defaultProps"
17
- :highlight-current="true"
18
- :filter-node-method="filterNode"
19
- :indent="1"
20
- show-checkbox
21
- default-expand-all
22
- :check-on-click-node="true"
23
- :expand-on-click-node="false"
24
- @check-change="checkChangeEvent"
12
+ ref="typeTree"
13
+ class="filter-tree"
14
+ node-key="fdId"
15
+ :data="typeTreeList"
16
+ :props="defaultProps"
17
+ :highlight-current="true"
18
+ :filter-node-method="filterNode"
19
+ :indent="1"
20
+ show-checkbox
21
+ default-expand-all
22
+ :check-on-click-node="true"
23
+ :expand-on-click-node="false"
24
+ @check-change="checkChangeEvent"
25
25
  >
26
26
  <div slot-scope="{ node, data }" style="width: 100%">
27
27
  <div class="dev-tree-node-left ap-ellipse">
@@ -35,8 +35,17 @@
35
35
  <ap-main margin="1110">
36
36
  <div class="item-ctn">
37
37
  <div class="title-span">
38
- <i class="el-icon-title-flag"/>
39
- 当前项目:{{ projectName }}
38
+ <div>
39
+ <i class="el-icon-title-flag"/>
40
+ 后台请求路径:
41
+ <span class="api-code">{{ userConfig.fdJavaHref }}</span>
42
+ </div>
43
+ <div style="padding: 13px 0 0 20px;">
44
+ 文件生成位置:
45
+ <span class="api-code">
46
+ {{ userConfig.fdJavaPath }}
47
+ </span>
48
+ </div>
40
49
  </div>
41
50
  </div>
42
51
 
@@ -86,11 +95,11 @@
86
95
  </div>
87
96
  <div style="text-align: center;">
88
97
  <el-button
89
- type="primary"
90
- icon="el-icon-magic-stick"
91
- circle
92
- style="padding: 30px;font-size: 60px;"
93
- @click="generateCode"
98
+ type="primary"
99
+ icon="el-icon-magic-stick"
100
+ circle
101
+ style="padding: 30px;font-size: 60px;"
102
+ @click="generateCode"
94
103
  />
95
104
  </div>
96
105
  <div class="msg" v-html="msg"/>
@@ -100,207 +109,215 @@
100
109
  </template>
101
110
 
102
111
  <script>
103
- import {getLocalData, getSourceId} from './../dev/DevUtil'
104
- import { convertToTreeData} from 'ap-util/util/DataUtil'
105
- export default {
106
- name: 'BackgroundPanel',
107
- data() {
108
- return {
109
- // ----- 左侧树 -----
110
- headerName: '表',
111
- loadingTreeFlag: false,
112
- filterText: '',
113
- typeTreeList: [],
114
- defaultProps: {
115
- children: 'children',
116
- label: 'fdName'
117
- },
118
- // ----- dialog -----
119
- selectedTables: [],
120
- createEntity: 1,
121
- createEntityFD: 1,
122
- createController: 1,
123
- createService: 1,
124
- createDao: 1,
125
- createXml: 0,
126
- msg: '',
127
- // ----- 右侧内容 -----
128
- projectName: getLocalData('configForm').projectName
112
+ import {convertToTreeData} from 'ap-util/util/DataUtil'
113
+ import {getUserConfig} from './../dev/DevUtil'
114
+ export default {
115
+ name: 'BackgroundPanel',
116
+ data() {
117
+ return {
118
+ // ----- 左侧树 -----
119
+ headerName: '表',
120
+ loadingTreeFlag: false,
121
+ filterText: '',
122
+ typeTreeList: [],
123
+ defaultProps: {
124
+ children: 'children',
125
+ label: 'fdName'
126
+ },
127
+ // ----- dialog -----
128
+ selectedTables: [],
129
+ createEntity: 1,
130
+ createEntityFD: 1,
131
+ createController: 1,
132
+ createService: 1,
133
+ createDao: 1,
134
+ createXml: 0,
135
+ msg: '',
136
+ // ----- 右侧内容 -----
137
+ userConfig: getUserConfig()
138
+ }
139
+ },
140
+ watch: {
141
+ filterText(val) {
142
+ this.$refs.typeTree.filter(val)
143
+ }
144
+ },
145
+ created() {
146
+ this.loadTreeData();
147
+ },
148
+ methods: {
149
+ // 左侧树:列头
150
+ setHeaderName() {
151
+ if (this.typeTreeList.length > 1) {
152
+ this.headerName = "[" + this.typeTreeList[0].fdDatabase + "] - 表";
129
153
  }
130
154
  },
131
- watch: {
132
- filterText(val) {
133
- this.$refs.typeTree.filter(val)
134
- }
155
+ // 左侧树:加载数据
156
+ loadTreeData() {
157
+ this.loadingTreeFlag = true
158
+ this.$request({
159
+ url: '/apd/db/DevDbTable/getTableList',
160
+ method: 'post',
161
+ data: {
162
+ sourceId: this.userConfig.fdSourceId
163
+ }
164
+ }).then(response => {
165
+ this.typeTreeList = convertToTreeData(response.data, {
166
+ idKey: "fdId",
167
+ parentKey: "fdParentId",
168
+ childrenKey: "children",
169
+ });
170
+ this.setHeaderName();
171
+ }).finally(() => {
172
+ this.loadingTreeFlag = false
173
+ })
135
174
  },
136
- created() {
175
+ // 左侧树:初始化数据
176
+ initTreeData() {
177
+ // 重置当前选择节点
178
+ this.$refs.typeTree.setCurrentKey()
137
179
  this.loadTreeData()
138
180
  },
139
- methods: {
140
- // 左侧树:列头
141
- setHeaderName() {
142
- if (this.typeTreeList.length > 1) {
143
- this.headerName = "[" + this.typeTreeList[0].fdDatabase + "] - 表";
144
- }
145
- },
146
- // 左侧树:加载数据
147
- loadTreeData() {
148
- this.loadingTreeFlag = true
149
- this.$request({
150
- url: '/apd/db/DevDbTable/getTableList',
151
- method: 'post',
152
- data: {
153
- sourceId: getSourceId()
154
- }
155
- }).then(response => {
156
- this.typeTreeList = convertToTreeData(response.data, {
157
- idKey: "fdId",
158
- parentKey: "fdParentId",
159
- childrenKey: "children",
160
- });
161
- this.setHeaderName();
162
- }).finally(() => {
163
- this.loadingTreeFlag = false
164
- })
165
- },
166
- // 左侧树:初始化数据
167
- initTreeData() {
168
- // 重置当前选择节点
169
- this.$refs.typeTree.setCurrentKey()
170
- this.loadTreeData()
171
- },
172
- // 左侧树:过滤节点
173
- filterNode(value, data) {
174
- if (!value) return true
175
- if (data.fdName.indexOf(value) !== -1) {
176
- return true
177
- }
178
- if (data.comment != null && data.comment.indexOf(value) !== -1) {
179
- return true
180
- }
181
- return false
182
- },
183
- // 选择事件
184
- checkChangeEvent(data, node, comp) {
185
- const parentNodes = this.$refs.typeTree.getHalfCheckedNodes()
186
- const selectNodes = this.$refs.typeTree.getCheckedNodes(false)
187
- const tables = parentNodes.concat(selectNodes)
181
+ // 左侧树:过滤节点
182
+ filterNode(value, data) {
183
+ if (!value) return true
184
+ if (data.fdName.indexOf(value) !== -1) {
185
+ return true
186
+ }
187
+ if (data.comment != null && data.comment.indexOf(value) !== -1) {
188
+ return true
189
+ }
190
+ return false
191
+ },
192
+ // 选择事件
193
+ checkChangeEvent(data, node, comp) {
194
+ const parentNodes = this.$refs.typeTree.getHalfCheckedNodes()
195
+ const selectNodes = this.$refs.typeTree.getCheckedNodes(false)
196
+ const tables = parentNodes.concat(selectNodes)
188
197
 
189
- const newList = []
190
- for (let i = 0; i < tables.length; i++) {
191
- if (tables[i].fdType == 1) {
192
- newList.push(tables[i])
193
- }
198
+ const newList = []
199
+ for (let i = 0; i < tables.length; i++) {
200
+ if (tables[i].fdType == 1) {
201
+ newList.push(tables[i])
194
202
  }
195
- this.selectedTables = newList
196
- },
197
- // 左侧树:转换成tree要求的数据格式
198
- handelTreeData(data) {
199
- const newList = []
200
- for (let i = 0; i < data.length; i++) {
201
- const fdParentId = data[i].fdParentId
202
- // 根节点
203
- if (!fdParentId) {
204
- newList.push(data[i])
205
- } else {
206
- // 子节点
207
- for (let j = 0; j < data.length; j++) {
208
- // 查找父节点
209
- if (data[j].fdId == fdParentId) {
210
- if (!data[j].children) {
211
- data[j].children = []
212
- }
213
- data[j].children.push(data[i])
203
+ }
204
+ this.selectedTables = newList
205
+ },
206
+ // 左侧树:转换成tree要求的数据格式
207
+ handelTreeData(data) {
208
+ const newList = []
209
+ for (let i = 0; i < data.length; i++) {
210
+ const fdParentId = data[i].fdParentId
211
+ // 根节点
212
+ if (!fdParentId) {
213
+ newList.push(data[i])
214
+ } else {
215
+ // 子节点
216
+ for (let j = 0; j < data.length; j++) {
217
+ // 查找父节点
218
+ if (data[j].fdId == fdParentId) {
219
+ if (!data[j].children) {
220
+ data[j].children = []
214
221
  }
222
+ data[j].children.push(data[i])
215
223
  }
216
224
  }
217
225
  }
218
- return newList
219
- },
220
- createFile(projectName, list) {
221
- this.$request({
222
- url: '/apd/dev/DevGenerateCode/createFile',
223
- method: 'post',
224
- data: {
225
- list: JSON.stringify(list),
226
- projectName: projectName
227
- }
228
- }).then(response => {
229
- this.msg = response.data
230
- this.$message.success('操作成功!')
231
- })
232
- },
233
- generateCode() {
234
- if (this.selectedTables.length < 1) {
235
- this.$message.error('请选择表!')
236
- return
226
+ }
227
+ return newList
228
+ },
229
+ createFile(projectName, list) {
230
+ this.$request({
231
+ url: '/apd/dev/DevGenerateCode/createFile',
232
+ method: 'post',
233
+ data: {
234
+ list: JSON.stringify(list),
235
+ projectName: projectName
237
236
  }
237
+ }).then(response => {
238
+ this.msg = response.data
239
+ this.$message.success('操作成功!')
240
+ })
241
+ },
242
+ generateCode() {
243
+ if (this.selectedTables.length < 1) {
244
+ this.$message.error('请选择表!')
245
+ return
246
+ }
238
247
 
239
- const javaUrl = getLocalData('configForm').javaUrl
240
- if (javaUrl == null || javaUrl == '') {
241
- this.$message.error('请先配置共通参数。【顶栏】->【配置】')
242
- return
243
- }
248
+ const javaUrl =this.userConfig.fdJavaPath
249
+ if (javaUrl == null || javaUrl == '') {
250
+ this.$message.error('请先配置共通参数。【顶栏】->【配置】')
251
+ return
252
+ }
244
253
 
245
- const tableList = []
246
- for (let i = 0; i < this.selectedTables.length; i++) {
247
- const selectedTable = this.selectedTables[i]
248
- tableList.push({
249
- fdName: selectedTable.fdName,
250
- tableSchema: selectedTable.tableSchema
251
- })
252
- }
253
- this.$request({
254
- url: '/apd/dev/DevGenerateCode/getBackgroundCode',
255
- method: 'post',
256
- data: {
257
- tableList: JSON.stringify(tableList),
258
- createEntity: this.createEntity,
259
- createEntityFD: this.createEntityFD,
260
- createController: this.createController,
261
- createService: this.createService,
262
- createDao: this.createDao,
263
- createXml: this.createXml,
264
- javaUrl: javaUrl,
265
- sourceId: getSourceId()
266
- }
267
- }).then(response => {
268
- // 生成文件
269
- this.createFile(this.projectName, response.data)
254
+ this.$confirm(`确定在【${javaUrl}】下生成文件?`, '提示', {
255
+ confirmButtonText: '确定',
256
+ type: 'warning'
257
+ }).then(() => {
258
+ this.doGenerateCode()
259
+ });
260
+ },
261
+ doGenerateCode() {
262
+ const tableList = []
263
+ for (let i = 0; i < this.selectedTables.length; i++) {
264
+ const selectedTable = this.selectedTables[i]
265
+ tableList.push({
266
+ fdName: selectedTable.fdName,
267
+ tableSchema: selectedTable.tableSchema
270
268
  })
271
269
  }
270
+ this.$request({
271
+ url: '/apd/dev/DevGenerateCode/getBackgroundCode',
272
+ method: 'post',
273
+ data: {
274
+ tableList: JSON.stringify(tableList),
275
+ createEntity: this.createEntity,
276
+ createEntityFD: this.createEntityFD,
277
+ createController: this.createController,
278
+ createService: this.createService,
279
+ createDao: this.createDao,
280
+ createXml: this.createXml,
281
+ javaUrl: this.userConfig.fdJavaPath,
282
+ sourceId: this.userConfig.fdSourceId
283
+ }
284
+ }).then(response => {
285
+ // 生成文件
286
+ this.createFile(this.userConfig.fdJavaHref, response.data)
287
+ })
272
288
  }
273
289
  }
290
+ }
274
291
  </script>
275
292
 
276
293
  <style scoped>
277
- .item-ctn {
278
- border-bottom: 1px solid #e9ecf1;
279
- margin-bottom: 5px;
280
- padding-bottom: 10px;
281
- }
294
+ .item-ctn {
295
+ border-bottom: 1px solid #e9ecf1;
296
+ margin-bottom: 5px;
297
+ padding-bottom: 10px;
298
+ }
282
299
 
283
- .title-span {
284
- font-weight: bold;
285
- color: #4f4f4f;
286
- }
300
+ .title-span {
301
+ font-weight: bold;
302
+ color: #4f4f4f;
303
+ }
287
304
 
288
- .create-item {
289
- padding: 5px;
290
- }
305
+ .create-item {
306
+ padding: 5px;
307
+ }
291
308
 
292
- .create-item-span {
293
- width: 90px;
294
- float: left;
295
- }
309
+ .create-item-span {
310
+ width: 90px;
311
+ float: left;
312
+ }
296
313
 
297
- .msg {
298
- color: #1890ff;
299
- }
314
+ .msg {
315
+ color: #1890ff;
316
+ }
300
317
 
301
- .dev-tree-node-left {
302
- font-size: 15px;
303
- width: 60%;
304
- float: left;
305
- }
318
+ .dev-tree-node-left {
319
+ font-size: 15px;
320
+ width: 60%;
321
+ float: left;
322
+ }
306
323
  </style>