ap-dev 1.2.11 → 1.2.13
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/dev/ApiPanel/modules/ApiGrid.vue +1423 -1423
- package/dev/ComponentsPanel/index.vue +646 -61
- package/dev/ComponentsPanel/indexback0704.vue +775 -0
- package/dev/ComponentsPanel/old.vue +191 -0
- package/dev/ConfigPanel/DevCpt.vue +736 -0
- package/dev/ConfigPanel/DevCptBase.vue +210 -0
- package/dev/ConfigPanel/index.vue +41 -12
- package/dev/base/VueRender.vue +13 -6
- package/dev/dev/index.vue +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ap-container>
|
|
3
|
+
<ap-aside margin="1111" width="220px">
|
|
4
|
+
<ap-aside-tree ref="cptTree" :options.sync="treeOptions">
|
|
5
|
+
<el-form slot="form" ref="tDevCpt" :inline="true" label-width="80px"
|
|
6
|
+
:model="tDevCptForm" :rules="tDevCptRules" class="ap-form">
|
|
7
|
+
<div class="ap-form-row">
|
|
8
|
+
<el-form-item label="父节点" prop='fdParentId'>
|
|
9
|
+
<el-select v-model="tDevCptForm.fdParentId" filterable placeholder="请选择父节点">
|
|
10
|
+
<el-option label="无" value=""/>
|
|
11
|
+
<el-option
|
|
12
|
+
v-for="item in parentList"
|
|
13
|
+
:key="item.fdId"
|
|
14
|
+
:label="item.fdName"
|
|
15
|
+
:value="item.fdId"
|
|
16
|
+
/>
|
|
17
|
+
</el-select>
|
|
18
|
+
</el-form-item>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="ap-form-row">
|
|
21
|
+
<el-form-item label='节点类型' prop='fdType'>
|
|
22
|
+
<el-select v-model="tDevCptForm.fdType" filterable placeholder="请选择类型">
|
|
23
|
+
<el-option key="1" label="Tab" :value=1></el-option>
|
|
24
|
+
<el-option key="2" label="组件分组" :value=2></el-option>
|
|
25
|
+
<el-option key="3" label="组件" :value=3></el-option>
|
|
26
|
+
</el-select>
|
|
27
|
+
</el-form-item>
|
|
28
|
+
<el-form-item label='语言' prop='fdLanguage'>
|
|
29
|
+
<el-select v-model="tDevCptForm.fdLanguage" filterable placeholder="请选择语言">
|
|
30
|
+
<el-option key="vue" label="vue" value="vue"></el-option>
|
|
31
|
+
<el-option key="java" label="java" value="java"></el-option>
|
|
32
|
+
<el-option key="abap" label="abap" value="abap"></el-option>
|
|
33
|
+
</el-select>
|
|
34
|
+
</el-form-item>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="ap-form-row">
|
|
37
|
+
<el-form-item label='名称' prop='fdName'>
|
|
38
|
+
<el-input v-model='tDevCptForm.fdName'></el-input>
|
|
39
|
+
</el-form-item>
|
|
40
|
+
<el-form-item label='备注' prop='fdRemark'>
|
|
41
|
+
<el-input v-model='tDevCptForm.fdRemark'></el-input>
|
|
42
|
+
</el-form-item>
|
|
43
|
+
</div>
|
|
44
|
+
<el-form-item label='编码' prop='fdCode' v-if="tDevCptForm.fdType == 3">
|
|
45
|
+
<el-input v-model='tDevCptForm.fdCode'></el-input>
|
|
46
|
+
</el-form-item>
|
|
47
|
+
<el-form-item label='基础模板' prop='fdBaseId' v-if="tDevCptForm.fdType == 3">
|
|
48
|
+
<el-select v-model="tDevCptForm.fdBaseId" filterable placeholder="请选择基础模板">
|
|
49
|
+
<el-option label="无" value=""/>
|
|
50
|
+
<el-option
|
|
51
|
+
v-for="item in cptBaseList"
|
|
52
|
+
:key="item.fdId"
|
|
53
|
+
:label="item.fdName"
|
|
54
|
+
:value="item.fdId"
|
|
55
|
+
/>
|
|
56
|
+
</el-select>
|
|
57
|
+
</el-form-item>
|
|
58
|
+
<el-form-item label='图标' prop='fdIcon' v-if="tDevCptForm.fdType == 3">
|
|
59
|
+
<el-input v-model='tDevCptForm.fdIcon'></el-input>
|
|
60
|
+
</el-form-item>
|
|
61
|
+
<el-form-item label='排序' prop='fdSort'>
|
|
62
|
+
<el-input v-model='tDevCptForm.fdSort'></el-input>
|
|
63
|
+
</el-form-item>
|
|
64
|
+
</el-form>
|
|
65
|
+
<span slot="tree" slot-scope="scope"
|
|
66
|
+
:style="scope.data.fdType == 3 ? 'color: #1682e6;font-size: 14px;':''">
|
|
67
|
+
<i :class="scope.data.fdIcon"/>
|
|
68
|
+
{{ scope.data.fdName }}
|
|
69
|
+
</span>
|
|
70
|
+
</ap-aside-tree>
|
|
71
|
+
</ap-aside>
|
|
72
|
+
<ap-split-panel></ap-split-panel>
|
|
73
|
+
<ap-container>
|
|
74
|
+
<ap-header margin="1110" height="30%">
|
|
75
|
+
<ap-table ref="tDevCptTemplateTableRef" :options.sync="tDevCptTemplateTable">
|
|
76
|
+
<template #slotTemplate="searchProps">
|
|
77
|
+
<el-input v-model="searchProps.rowData.fdTemplate" type="textarea" :rows=10></el-input>
|
|
78
|
+
</template>
|
|
79
|
+
<template #slotDefault="searchProps">
|
|
80
|
+
<el-input v-model="searchProps.rowData.fdDefault" type="textarea" :rows=10></el-input>
|
|
81
|
+
</template>
|
|
82
|
+
</ap-table>
|
|
83
|
+
</ap-header>
|
|
84
|
+
<ap-container>
|
|
85
|
+
<ap-header margin="0110" height="50%">
|
|
86
|
+
<ap-table ref="tDevCptParamTableRef" :options.sync="tDevCptParamTable">
|
|
87
|
+
<template #slotOption="searchProps">
|
|
88
|
+
<el-input v-model="searchProps.rowData.fdOption" type="textarea" :rows=5></el-input>
|
|
89
|
+
<span
|
|
90
|
+
style="color: #909399;">注1: 数组格式 [{label:"名字1", value:"值1"},{label:"名字2", value:"值2"}]</span><br>
|
|
91
|
+
<span style="color: #909399;">注2: 对象格式 {attr1:"属性1", attr2:"属性2"}</span><br>
|
|
92
|
+
</template>
|
|
93
|
+
</ap-table>
|
|
94
|
+
</ap-header>
|
|
95
|
+
<ap-main margin="0110">
|
|
96
|
+
<ap-table ref="tDevCptParamTemplateTableRef" :options.sync="tDevCptParamTemplateTable">
|
|
97
|
+
<template #slotTemplate="searchProps">
|
|
98
|
+
<el-input v-model="searchProps.rowData.fdTemplate" type="textarea" :rows=10></el-input>
|
|
99
|
+
</template>
|
|
100
|
+
<template #slotDefault="searchProps">
|
|
101
|
+
<el-input v-model="searchProps.rowData.fdDefault" type="textarea" :rows=10></el-input>
|
|
102
|
+
</template>
|
|
103
|
+
</ap-table>
|
|
104
|
+
</ap-main>
|
|
105
|
+
</ap-container>
|
|
106
|
+
</ap-container>
|
|
107
|
+
<el-dialog
|
|
108
|
+
title="提示"
|
|
109
|
+
:visible.sync="showCopyDialog"
|
|
110
|
+
width="30%">
|
|
111
|
+
<span>复制参数、复制参数模板</span>
|
|
112
|
+
<span slot="footer" class="dialog-footer">
|
|
113
|
+
<el-button type="primary" @click="doCopyParam()">仅复制参数</el-button>
|
|
114
|
+
<el-button type="primary" @click="doCopyParam('1')">复制参数和参数模板</el-button>
|
|
115
|
+
</span>
|
|
116
|
+
</el-dialog>
|
|
117
|
+
<el-dialog
|
|
118
|
+
title="参数编码/参数名称 批量更新"
|
|
119
|
+
:visible.sync="showHandleCptCodeDialog"
|
|
120
|
+
width="700px">
|
|
121
|
+
<el-form :model="replaceForm" label-width="100px" :inline="true" class="ap-form">
|
|
122
|
+
<div class="ap-form-row">
|
|
123
|
+
<el-form-item label='旧参数名称' prop='oldName'>
|
|
124
|
+
<el-input v-model='replaceForm.oldName'></el-input>
|
|
125
|
+
</el-form-item>
|
|
126
|
+
<el-form-item label='新参数名称' prop='newName'>
|
|
127
|
+
<el-input v-model='replaceForm.newName'></el-input>
|
|
128
|
+
</el-form-item>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="ap-form-row">
|
|
131
|
+
<el-form-item label='旧参数编码' prop='oldCode'>
|
|
132
|
+
<el-input v-model='replaceForm.oldCode'></el-input>
|
|
133
|
+
</el-form-item>
|
|
134
|
+
<el-form-item label='新参数编码' prop='newCode'>
|
|
135
|
+
<el-input v-model='replaceForm.newCode'></el-input>
|
|
136
|
+
</el-form-item>
|
|
137
|
+
</div>
|
|
138
|
+
</el-form>
|
|
139
|
+
<span slot="footer" class="dialog-footer">
|
|
140
|
+
<el-button @click="showHandleCptCodeDialog = false">取 消</el-button>
|
|
141
|
+
<el-button type="primary" @click="replaceCptNameAndCode">确认替换</el-button>
|
|
142
|
+
</span>
|
|
143
|
+
</el-dialog>
|
|
144
|
+
</ap-container>
|
|
145
|
+
</template>
|
|
146
|
+
|
|
147
|
+
<script>
|
|
148
|
+
|
|
149
|
+
export default {
|
|
150
|
+
name: 'DevCpt',
|
|
151
|
+
data() {
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
// ----- 左侧树 -----
|
|
155
|
+
treeOptions: this.getTreeOption(),
|
|
156
|
+
parentList: [],
|
|
157
|
+
cptBaseList: [],
|
|
158
|
+
tDevCptForm: {},
|
|
159
|
+
tDevCptRules: {},
|
|
160
|
+
selectedCptId: "",
|
|
161
|
+
selectedCpt: {},
|
|
162
|
+
// ----- 右侧 -----
|
|
163
|
+
tDevCptTemplateTable: this.getCptTemplateTableOption(),
|
|
164
|
+
tDevCptParamTable: this.getCptParamTableOption(),
|
|
165
|
+
tDevCptParamTemplateTable: this.getCptParamTemplateTableOption(),
|
|
166
|
+
selectedParam: "",
|
|
167
|
+
template: "",
|
|
168
|
+
optionType: "",
|
|
169
|
+
showCopyDialog: false,
|
|
170
|
+
showHandleCptCodeDialog: false,
|
|
171
|
+
replaceForm: {
|
|
172
|
+
oldName: "",
|
|
173
|
+
newName: "",
|
|
174
|
+
oldCode: "",
|
|
175
|
+
newCode: "",
|
|
176
|
+
},
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
mounted() {
|
|
180
|
+
this.getCptList();
|
|
181
|
+
this.getCptBaseList();
|
|
182
|
+
},
|
|
183
|
+
methods: {
|
|
184
|
+
// 左侧树:配置
|
|
185
|
+
getTreeOption() {
|
|
186
|
+
let treeOptions = {
|
|
187
|
+
title: "组件列表",
|
|
188
|
+
dialogWidth: "700px",
|
|
189
|
+
toolbarBtn: [{
|
|
190
|
+
icon: "el-icon-copy", onClick: () => {
|
|
191
|
+
this.copyCpt();
|
|
192
|
+
}
|
|
193
|
+
}, "add", "edit", "del"],
|
|
194
|
+
dialogTitle: "组件信息",
|
|
195
|
+
sortByDrag: true,
|
|
196
|
+
onClick: (data, node, comp) => {
|
|
197
|
+
this.selectedCptId = data.fdId;
|
|
198
|
+
this.selectedCpt = data;
|
|
199
|
+
this.selectedParam = "";
|
|
200
|
+
this.$refs.tDevCptParamTableRef.refresh();
|
|
201
|
+
this.$refs.tDevCptTemplateTableRef.refresh();
|
|
202
|
+
this.$refs.tDevCptParamTemplateTableRef.refresh();
|
|
203
|
+
},
|
|
204
|
+
loadOptions: {
|
|
205
|
+
url: "/apd/TDevCpt/getCptList",
|
|
206
|
+
treeKey: {
|
|
207
|
+
idKey: "fdId",
|
|
208
|
+
parentKey: "fdParentId",
|
|
209
|
+
childrenKey: "children",
|
|
210
|
+
label: "fdName"
|
|
211
|
+
},
|
|
212
|
+
success: (response) => {
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
editOptions: {
|
|
216
|
+
url: "/apd/TDevCpt/getTDevCptByFdId",
|
|
217
|
+
data: (node) => {
|
|
218
|
+
return {
|
|
219
|
+
fdId: node.fdId
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
success: (response) => {
|
|
223
|
+
this.tDevCptForm = response.data;
|
|
224
|
+
},
|
|
225
|
+
error() {
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
insertUrl: "/apd/TDevCpt/insertTDevCpt",
|
|
229
|
+
insertData: () => {
|
|
230
|
+
return this.tDevCptForm
|
|
231
|
+
},
|
|
232
|
+
updateUrl: "/apd/TDevCpt/updateTDevCpt",
|
|
233
|
+
updateData: () => {
|
|
234
|
+
return this.tDevCptForm
|
|
235
|
+
},
|
|
236
|
+
deleteUrl: "/apd/TDevCpt/deleteTDevCptByFdId",
|
|
237
|
+
deleteData: (node) => {
|
|
238
|
+
return {
|
|
239
|
+
fdId: node.fdId
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
updateSortUrl: '/apd/TDevCpt/updateTDevCptSort',
|
|
243
|
+
updateSortListUrl: '/apd/TDevCpt/updateTDevCptSortList',
|
|
244
|
+
resetForm: () => {
|
|
245
|
+
this.tDevCptForm = {
|
|
246
|
+
fdName: '',
|
|
247
|
+
fdType: '',
|
|
248
|
+
fdCode: '',
|
|
249
|
+
fdParentId: '',
|
|
250
|
+
fdBaseId: '',
|
|
251
|
+
fdLanguage: '',
|
|
252
|
+
fdIcon: '',
|
|
253
|
+
fdRemark: '',
|
|
254
|
+
fdSort: '',
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
afterOpenAddDialog: (node) => {
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
return treeOptions;
|
|
262
|
+
},
|
|
263
|
+
getCptList() {
|
|
264
|
+
this.$request({
|
|
265
|
+
url: '/apd/TDevCpt/getCptList',
|
|
266
|
+
method: 'post',
|
|
267
|
+
data: {}
|
|
268
|
+
}).then(response => {
|
|
269
|
+
this.parentList = response.data
|
|
270
|
+
})
|
|
271
|
+
},
|
|
272
|
+
getCptBaseList() {
|
|
273
|
+
this.$request({
|
|
274
|
+
url: '/apd/TDevCptBase/getTDevCptBaseList',
|
|
275
|
+
method: 'post',
|
|
276
|
+
data: {}
|
|
277
|
+
}).then(response => {
|
|
278
|
+
this.cptBaseList = response.data
|
|
279
|
+
})
|
|
280
|
+
},
|
|
281
|
+
// 右侧:组件模板表格
|
|
282
|
+
getCptTemplateTableOption() {
|
|
283
|
+
let tDevCptTemplateCols = [
|
|
284
|
+
{
|
|
285
|
+
prop: 'fdCptId',
|
|
286
|
+
label: '所属组件',
|
|
287
|
+
type: "select",
|
|
288
|
+
selectOptionsRemote: "cptList",
|
|
289
|
+
selectOptionsKey: {label: "fdName", value: "fdId"},
|
|
290
|
+
width: '80',
|
|
291
|
+
addDefaultValue: () => {
|
|
292
|
+
return this.selectedCptId;
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
prop: 'fdParamName',
|
|
296
|
+
label: '参数名',
|
|
297
|
+
type: 'input',
|
|
298
|
+
width: '80',
|
|
299
|
+
}, {
|
|
300
|
+
prop: 'fdTemplate',
|
|
301
|
+
label: '组件模板',
|
|
302
|
+
minWidth: '130',
|
|
303
|
+
type: "search",
|
|
304
|
+
searchTitle: "模板编辑",
|
|
305
|
+
searchSlot: 'slotTemplate',
|
|
306
|
+
searchConfirm: (row) => {
|
|
307
|
+
return true
|
|
308
|
+
},
|
|
309
|
+
searchClear: (row) => {
|
|
310
|
+
row.fdTemplate = '';
|
|
311
|
+
return true;
|
|
312
|
+
},
|
|
313
|
+
html: (value, row) => {
|
|
314
|
+
return this.handleTemplateHtml(value);
|
|
315
|
+
},
|
|
316
|
+
help: `1、参数格式:\${xxxx}<br> xxx只能是字母,默认空格连接<br>
|
|
317
|
+
2、数组参数格式:\${xxxx#abc}<br>使用#连接,abc为自定义连接符。使用\\n表示换行<br>`
|
|
318
|
+
}, {
|
|
319
|
+
prop: 'fdAddCondition',
|
|
320
|
+
label: '模板添加条件',
|
|
321
|
+
type: 'input',
|
|
322
|
+
minWidth: '150',
|
|
323
|
+
}, {
|
|
324
|
+
prop: 'fdDefault',
|
|
325
|
+
label: '默认模板',
|
|
326
|
+
minWidth: '70',
|
|
327
|
+
type: "search",
|
|
328
|
+
searchTitle: "模板编辑",
|
|
329
|
+
searchSlot: 'slotDefault',
|
|
330
|
+
searchConfirm: (row) => {
|
|
331
|
+
return true
|
|
332
|
+
},
|
|
333
|
+
searchClear: (row) => {
|
|
334
|
+
row.fdDefault = '';
|
|
335
|
+
return true;
|
|
336
|
+
},
|
|
337
|
+
}, {
|
|
338
|
+
prop: 'fdDefaultCondition',
|
|
339
|
+
label: '默认模板使用条件',
|
|
340
|
+
type: 'input',
|
|
341
|
+
minWidth: '70',
|
|
342
|
+
}, {
|
|
343
|
+
prop: 'fdLeftSpace',
|
|
344
|
+
label: '左侧空格',
|
|
345
|
+
type: 'input',
|
|
346
|
+
width: '60',
|
|
347
|
+
}, {
|
|
348
|
+
prop: 'fdSort',
|
|
349
|
+
label: '排序',
|
|
350
|
+
type: 'input',
|
|
351
|
+
width: '60',
|
|
352
|
+
},
|
|
353
|
+
];
|
|
354
|
+
let tDevCptTemplateTable = {
|
|
355
|
+
title: "组件模板",
|
|
356
|
+
columns: tDevCptTemplateCols,
|
|
357
|
+
dataUrl: "/apd/TDevCptTemplate/getTDevCptTemplateGridList",
|
|
358
|
+
saveUrl: "/apd/TDevCptTemplate/saveTDevCptTemplateGridData",
|
|
359
|
+
editPk: "fdId", //默认fdId
|
|
360
|
+
deletePk: "fdId", // 默认fdId
|
|
361
|
+
deleteUrl: "/apd/TDevCptTemplate/deleteTDevCptTemplateGridData",
|
|
362
|
+
toolbarBtn: [{
|
|
363
|
+
btnType: "primary", text: "编码替换", icon: "el-icon-transfer", onClick: () => {
|
|
364
|
+
this.showHandleCptCodeDialog = true;
|
|
365
|
+
}
|
|
366
|
+
}, "separator", "add", "edit", "del", "refresh", "save"],
|
|
367
|
+
showPagination: false,
|
|
368
|
+
params: () => {
|
|
369
|
+
return {
|
|
370
|
+
cptId: this.selectedCptId
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
rowDblClickEvent: (row, column, event) => {
|
|
374
|
+
this.$refs.tDevCptTemplateTableRef.toggleEditRow(row);
|
|
375
|
+
},
|
|
376
|
+
};
|
|
377
|
+
return tDevCptTemplateTable;
|
|
378
|
+
},
|
|
379
|
+
// 右侧:组件参数表格
|
|
380
|
+
getCptParamTableOption() {
|
|
381
|
+
let tDevCptParamCols = [
|
|
382
|
+
{
|
|
383
|
+
prop: 'fdCptId',
|
|
384
|
+
label: '所属组件',
|
|
385
|
+
type: "select",
|
|
386
|
+
selectOptionsRemote: "cptList",
|
|
387
|
+
selectOptionsKey: {label: "fdName", value: "fdId"},
|
|
388
|
+
width: '80',
|
|
389
|
+
addDefaultValue: () => {
|
|
390
|
+
return this.selectedCptId;
|
|
391
|
+
}
|
|
392
|
+
}, {
|
|
393
|
+
prop: 'fdParentId',
|
|
394
|
+
label: '父参数',
|
|
395
|
+
type: "select",
|
|
396
|
+
selectOptionsRemote: "cptParamList",
|
|
397
|
+
selectOptionsKey: {label: "fdName", value: "fdId"},
|
|
398
|
+
width: '80',
|
|
399
|
+
}, {
|
|
400
|
+
prop: 'fdName',
|
|
401
|
+
label: '参数名称',
|
|
402
|
+
type: 'input',
|
|
403
|
+
width: '100',
|
|
404
|
+
}, {
|
|
405
|
+
prop: 'fdCode',
|
|
406
|
+
label: '参数编码',
|
|
407
|
+
type: 'input',
|
|
408
|
+
minWidth: '120',
|
|
409
|
+
help: `参数编码。<br>.value: 表示参数值<br>示例:"\${InputType.value}"`
|
|
410
|
+
}, {
|
|
411
|
+
prop: 'fdValue',
|
|
412
|
+
label: '默认值',
|
|
413
|
+
type: 'input',
|
|
414
|
+
width: '80',
|
|
415
|
+
showOverflowTooltip: true,
|
|
416
|
+
help: `默认值格式:<br>1、非数组参数:字符串<br>2、数组参数: 可执行js,格式:[{参数编码A:"参数值1"},{参数编码B:"参数值2"}]<br>示例:[{InputA:"add"},{InputB:"自定义",InputC:"按钮"}]`
|
|
417
|
+
}, {
|
|
418
|
+
prop: 'fdShowCondition',
|
|
419
|
+
label: '显示条件',
|
|
420
|
+
type: 'input',
|
|
421
|
+
minWidth: '120',
|
|
422
|
+
help: `判断页面是否显示组件。为空,默认显示。<br>示例:"\${InputType.value}" == "textarea"`
|
|
423
|
+
}, {
|
|
424
|
+
prop: 'fdShowType',
|
|
425
|
+
label: '显示类型',
|
|
426
|
+
type: 'select',
|
|
427
|
+
width: '80',
|
|
428
|
+
selectOptions: [{label: "input", value: 1}, {label: "下拉单选", value: 3}, {label: "数组参数", value: 4},
|
|
429
|
+
{label: "text", value: 6}, {label: "计数文本", value: 7}, {label: "开关", value: 2}, {
|
|
430
|
+
label: "单选框",
|
|
431
|
+
value: 5
|
|
432
|
+
}],
|
|
433
|
+
}, {
|
|
434
|
+
prop: 'fdOption',
|
|
435
|
+
label: '值选项',
|
|
436
|
+
width: '100',
|
|
437
|
+
showOverflowTooltip: true,
|
|
438
|
+
type: "search",
|
|
439
|
+
searchTitle: "选项值",
|
|
440
|
+
searchSlot: 'slotOption',
|
|
441
|
+
searchConfirm: (row) => {
|
|
442
|
+
return true
|
|
443
|
+
},
|
|
444
|
+
searchClear: (row) => {
|
|
445
|
+
row.fdOption = '';
|
|
446
|
+
return true;
|
|
447
|
+
},
|
|
448
|
+
}, {
|
|
449
|
+
prop: 'fdChangeMethod',
|
|
450
|
+
label: '参数值变化执行方法',
|
|
451
|
+
type: 'input',
|
|
452
|
+
minWidth: '120',
|
|
453
|
+
help: `参数值修改时,调用方法,用于直接设定其他参数值。<br>示例:"\${InputType.value}" = "123"`
|
|
454
|
+
}, {
|
|
455
|
+
prop: 'fdPlaceholder',
|
|
456
|
+
label: '占位文本',
|
|
457
|
+
type: 'input',
|
|
458
|
+
width: '60',
|
|
459
|
+
showOverflowTooltip: true
|
|
460
|
+
}, {
|
|
461
|
+
prop: 'fdTab',
|
|
462
|
+
label: 'tab页',
|
|
463
|
+
type: 'input',
|
|
464
|
+
width: '60',
|
|
465
|
+
}, {
|
|
466
|
+
prop: 'fdTip',
|
|
467
|
+
label: '提示',
|
|
468
|
+
type: 'input',
|
|
469
|
+
width: '60',
|
|
470
|
+
showOverflowTooltip: true
|
|
471
|
+
}, {
|
|
472
|
+
prop: 'fdRemark',
|
|
473
|
+
label: '备注',
|
|
474
|
+
type: 'input',
|
|
475
|
+
width: '60',
|
|
476
|
+
}, {
|
|
477
|
+
prop: 'fdShowLine',
|
|
478
|
+
label: '分割线',
|
|
479
|
+
type: 'select',
|
|
480
|
+
width: '60',
|
|
481
|
+
help: '参数tab页分块,参数底部显示分割线',
|
|
482
|
+
selectOptions: [{label: "隐藏", value: 0}, {label: "显示", value: 1}]
|
|
483
|
+
|
|
484
|
+
}, {
|
|
485
|
+
prop: 'fdSort',
|
|
486
|
+
label: '排序',
|
|
487
|
+
type: 'input',
|
|
488
|
+
width: '50',
|
|
489
|
+
},
|
|
490
|
+
];
|
|
491
|
+
let tDevCptParamTable = {
|
|
492
|
+
title: "参数",
|
|
493
|
+
columns: tDevCptParamCols,
|
|
494
|
+
dataUrl: "/apd/TDevCptParam/getTDevCptParamGridList",
|
|
495
|
+
saveUrl: "/apd/TDevCptParam/saveTDevCptParamGridData",
|
|
496
|
+
editPk: "fdId", //默认fdId
|
|
497
|
+
deletePk: "fdId", // 默认fdId
|
|
498
|
+
deleteUrl: "/apd/TDevCptParam/deleteTDevCptParamGridData",
|
|
499
|
+
sortUrl: "/apd/TDevCptParam/updateTDevCptParamSortList",
|
|
500
|
+
toolbarBtn: [{
|
|
501
|
+
btnType: "primary", text: "复制", icon: "el-icon-copy", onClick: () => {
|
|
502
|
+
this.copyParam()
|
|
503
|
+
}
|
|
504
|
+
}, "separator",
|
|
505
|
+
"sortAuto", "sortDown", "sortUp", "separator",
|
|
506
|
+
"add", "edit", "del", "refresh", "save"],
|
|
507
|
+
showPagination: false,
|
|
508
|
+
params: () => {
|
|
509
|
+
return {
|
|
510
|
+
cptId: this.selectedCptId
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
rowClickEvent: (row) => {
|
|
514
|
+
this.selectedParam = row.fdId;
|
|
515
|
+
this.$refs.tDevCptParamTemplateTableRef.refresh();
|
|
516
|
+
},
|
|
517
|
+
rowDblClickEvent: (row, column, event) => {
|
|
518
|
+
this.$refs.tDevCptParamTableRef.toggleEditRow(row);
|
|
519
|
+
},
|
|
520
|
+
};
|
|
521
|
+
return tDevCptParamTable;
|
|
522
|
+
},
|
|
523
|
+
// 右侧:参数模板表格
|
|
524
|
+
getCptParamTemplateTableOption() {
|
|
525
|
+
let tDevCptParamTemplateCols = [
|
|
526
|
+
{
|
|
527
|
+
prop: 'fdParamId',
|
|
528
|
+
label: '所属参数',
|
|
529
|
+
type: "select",
|
|
530
|
+
selectOptionsRemote: "paramList",
|
|
531
|
+
selectOptionsKey: {label: "fdName", value: "fdId"},
|
|
532
|
+
width: '100',
|
|
533
|
+
addDefaultValue: () => {
|
|
534
|
+
return this.selectedParam;
|
|
535
|
+
}
|
|
536
|
+
}, {
|
|
537
|
+
prop: 'fdParamName',
|
|
538
|
+
label: '参数名',
|
|
539
|
+
type: 'input',
|
|
540
|
+
width: '80',
|
|
541
|
+
}, {
|
|
542
|
+
prop: 'fdTemplate',
|
|
543
|
+
label: '参数模板',
|
|
544
|
+
minWidth: '130',
|
|
545
|
+
showOverflowTooltip: true,
|
|
546
|
+
type: "search",
|
|
547
|
+
searchTitle: "模板编辑",
|
|
548
|
+
searchSlot: 'slotTemplate',
|
|
549
|
+
searchConfirm: (row) => {
|
|
550
|
+
return true
|
|
551
|
+
},
|
|
552
|
+
searchClear: (row) => {
|
|
553
|
+
row.fdTemplate = '';
|
|
554
|
+
return true;
|
|
555
|
+
},
|
|
556
|
+
html: (value, row) => {
|
|
557
|
+
return this.handleTemplateHtml(value);
|
|
558
|
+
},
|
|
559
|
+
help: `格式:参数格式必须为\${xxxx.xxx} 不能有空格`
|
|
560
|
+
}, {
|
|
561
|
+
prop: 'fdAddCondition',
|
|
562
|
+
label: '模板添加条件',
|
|
563
|
+
type: 'input',
|
|
564
|
+
minWidth: '150',
|
|
565
|
+
showOverflowTooltip: true,
|
|
566
|
+
help: `判断是否添加模板。为空,表示默认添加。<br>示例:"\${InputSize.value}" != ""`
|
|
567
|
+
}, {
|
|
568
|
+
prop: 'fdDefault',
|
|
569
|
+
label: '默认模板',
|
|
570
|
+
minWidth: '70',
|
|
571
|
+
showOverflowTooltip: true,
|
|
572
|
+
type: "search",
|
|
573
|
+
searchTitle: "模板编辑",
|
|
574
|
+
searchSlot: 'slotDefault',
|
|
575
|
+
searchConfirm: (row) => {
|
|
576
|
+
return true
|
|
577
|
+
},
|
|
578
|
+
searchClear: (row) => {
|
|
579
|
+
row.fdDefault = '';
|
|
580
|
+
return true;
|
|
581
|
+
},
|
|
582
|
+
}, {
|
|
583
|
+
prop: 'fdDefaultCondition',
|
|
584
|
+
label: '默认模板使用条件',
|
|
585
|
+
type: 'input',
|
|
586
|
+
minWidth: '70',
|
|
587
|
+
showOverflowTooltip: true,
|
|
588
|
+
help: `判断是否使用默认模板。为空,不使用默认模板。<br>示例:"\${InputSize.value}" != ""`
|
|
589
|
+
}, {
|
|
590
|
+
prop: 'fdLeftSpace',
|
|
591
|
+
label: '左侧空格',
|
|
592
|
+
type: 'input',
|
|
593
|
+
width: '60',
|
|
594
|
+
}, {
|
|
595
|
+
prop: 'fdSort',
|
|
596
|
+
label: '排序',
|
|
597
|
+
type: 'input',
|
|
598
|
+
width: '60',
|
|
599
|
+
}
|
|
600
|
+
];
|
|
601
|
+
let tDevCptParamTemplateTable = {
|
|
602
|
+
title: "参数模板",
|
|
603
|
+
columns: tDevCptParamTemplateCols,
|
|
604
|
+
dataUrl: "/apd/TDevCptParamTemplate/getTDevCptParamTemplateGridList",
|
|
605
|
+
saveUrl: "/apd/TDevCptParamTemplate/saveTDevCptParamTemplateGridData",
|
|
606
|
+
editPk: "fdId", //默认fdId
|
|
607
|
+
deletePk: "fdId", // 默认fdId
|
|
608
|
+
deleteUrl: "/apd/TDevCptParamTemplate/deleteTDevCptParamTemplateGridData",
|
|
609
|
+
sortUrl: "/apd/TDevCptParamTemplate/updateTDevCptParamTemplateSortList",
|
|
610
|
+
toolbarBtn: [{
|
|
611
|
+
btnType: "primary", text: "复制", icon: "el-icon-copy", onClick: () => {
|
|
612
|
+
this.doCopyParamTemplate()
|
|
613
|
+
}
|
|
614
|
+
}, "separator",
|
|
615
|
+
"sortAuto", "sortDown", "sortUp", "separator",
|
|
616
|
+
"add", "edit", "del", "refresh", "save"],
|
|
617
|
+
showPagination: false,
|
|
618
|
+
params: () => {
|
|
619
|
+
return {
|
|
620
|
+
cptId: this.selectedCptId,
|
|
621
|
+
paramId: this.selectedParam
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
rowDblClickEvent: (row, column, event) => {
|
|
625
|
+
this.$refs.tDevCptParamTemplateTableRef.toggleEditRow(row);
|
|
626
|
+
},
|
|
627
|
+
};
|
|
628
|
+
return tDevCptParamTemplateTable;
|
|
629
|
+
},
|
|
630
|
+
replaceCptNameAndCode() {
|
|
631
|
+
let form = this.replaceForm;
|
|
632
|
+
form.cptId = this.selectedCptId
|
|
633
|
+
this.$request({
|
|
634
|
+
url: '/apd/TDevCpt/replaceCptNameAndCode',
|
|
635
|
+
method: 'post',
|
|
636
|
+
data: form
|
|
637
|
+
}).then(response => {
|
|
638
|
+
this.$message.success("替换成功");
|
|
639
|
+
this.$refs.tDevCptParamTableRef.refresh();
|
|
640
|
+
this.$refs.tDevCptTemplateTableRef.refresh();
|
|
641
|
+
this.$refs.tDevCptParamTemplateTableRef.refresh();
|
|
642
|
+
this.showHandleCptCodeDialog = false;
|
|
643
|
+
})
|
|
644
|
+
},
|
|
645
|
+
handleTemplateHtml(str) {
|
|
646
|
+
if (str == null) {
|
|
647
|
+
return "";
|
|
648
|
+
}
|
|
649
|
+
str = str.replaceAll("<", "<")
|
|
650
|
+
let html = `<div class="api-code" style="line-height: 14px;">${str}</div>`;
|
|
651
|
+
return html;
|
|
652
|
+
},
|
|
653
|
+
copyCpt() {
|
|
654
|
+
if (this.selectedCptId == "" || this.selectedCptId == null) {
|
|
655
|
+
this.$message.error("请选择需要复制的行");
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
this.$confirm(`确认复制【${this.selectedCpt.fdName}】组件?`, '提示', {
|
|
659
|
+
confirmButtonText: '复制',
|
|
660
|
+
cancelButtonText: '取消',
|
|
661
|
+
type: 'warning'
|
|
662
|
+
}).then(() => {
|
|
663
|
+
this.$request({
|
|
664
|
+
url: '/apd/TDevCpt/copyCpt',
|
|
665
|
+
method: 'post',
|
|
666
|
+
data: {
|
|
667
|
+
cptId: this.selectedCptId,
|
|
668
|
+
}
|
|
669
|
+
}).then(response => {
|
|
670
|
+
this.$message.success("复制成功");
|
|
671
|
+
this.$refs.cptTree.reLoadTreeData();
|
|
672
|
+
})
|
|
673
|
+
})
|
|
674
|
+
},
|
|
675
|
+
copyParam(type) {
|
|
676
|
+
this.showCopyDialog = true;
|
|
677
|
+
},
|
|
678
|
+
// 复制参数
|
|
679
|
+
doCopyParam(type) {
|
|
680
|
+
let selectedRows = this.$refs.tDevCptParamTableRef.getSelection();
|
|
681
|
+
if (selectedRows.length < 1) {
|
|
682
|
+
this.$message.error("请选择需要复制的行!");
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
if (selectedRows.length > 1) {
|
|
686
|
+
this.$message.error("只能选择单行数据进行复制!");
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
this.$request({
|
|
691
|
+
url: '/apd/TDevCptParam/copyParam',
|
|
692
|
+
method: 'post',
|
|
693
|
+
data: {
|
|
694
|
+
paramId: selectedRows[0].fdId,
|
|
695
|
+
copyTemplate: type
|
|
696
|
+
}
|
|
697
|
+
}).then(response => {
|
|
698
|
+
this.$message.success("复制成功");
|
|
699
|
+
this.$refs.tDevCptParamTableRef.refresh();
|
|
700
|
+
if (type == "1") {
|
|
701
|
+
this.$refs.tDevCptParamTemplateTableRef.refresh();
|
|
702
|
+
}
|
|
703
|
+
this.showCopyDialog = false;
|
|
704
|
+
})
|
|
705
|
+
|
|
706
|
+
},
|
|
707
|
+
// 复制参数模板
|
|
708
|
+
doCopyParamTemplate() {
|
|
709
|
+
let selectedRows = this.$refs.tDevCptParamTemplateTableRef.getSelection();
|
|
710
|
+
if (selectedRows.length < 1) {
|
|
711
|
+
this.$message.error("请选择需要复制的行!");
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
if (selectedRows.length > 1) {
|
|
715
|
+
this.$message.error("只能选择单行数据进行复制!");
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
this.$request({
|
|
720
|
+
url: '/apd/TDevCptParam/copyParamTemplate',
|
|
721
|
+
method: 'post',
|
|
722
|
+
data: {
|
|
723
|
+
templateId: selectedRows[0].fdId,
|
|
724
|
+
}
|
|
725
|
+
}).then(response => {
|
|
726
|
+
this.$message.success("复制成功");
|
|
727
|
+
this.$refs.tDevCptParamTemplateTableRef.refresh();
|
|
728
|
+
})
|
|
729
|
+
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
</script>
|
|
734
|
+
|
|
735
|
+
<style scoped>
|
|
736
|
+
</style>
|