1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
| <template>
| <el-dialog
| title="选择参照配置"
| append-to-body
| :visible.sync="isShowReferConfigCrud"
| width="94%"
| id="refer-config-dialog"
| style="height: 115vh; margin-top: -14vh; overflow-y: hidden">
| <div style="width: 100%; overflow-y: auto; height: 70vh">
| <el-row style="width: 100%; height:70%">
| <el-col style="width: 70%; height: 100%;">
| <basic-container style="width: 100%; ">
| <avue-crud :option="referConfigCrudOption"
| class="refer-config-crud"
| :page.sync="referConfigParams.referConfigPage"
| :table-loading="referConfigParams.referConfigLoading"
| :data="referConfigParams.referConfigData"
| :ref= "referConfigParams.ref"
| @row-click="referConfigRowClick"
| @selection-change="referConfigDataChange"
| @search-change="referConfigSearchChange"
| @search-reset="referConfigSearchReset">
| <template #radio="{row}">
| <el-radio v-model="referConfigParams.referConfigSelectedRow"
| :label="row.$index">
|
| </el-radio>
| </template>
| </avue-crud>
| </basic-container>
| </el-col>
| <el-col v-show="true" style="width: 30%; height: 100%;">
| <basic-container style="width: 100%;">
| <avue-form ref="refereConfigForm"
| style="height: 65vh;"
| :option="formOption"
| class="refer-confg-form"
| ></avue-form>
| </basic-container>
| </el-col>
| </el-row>
| <el-row style="width: 100%; height:30%; margin-top: 130px">
| <basic-container style="width: 100%; height:100%;">
| <avue-crud :option="attrAndSrchCondOption"
| class="refer-attrorsrchcond-crud"
| :table-loading="attrAndSrchCondParams.attrAndSrchCondLoading"
| :data="attrAndSrchCondParams.attrAndSrchCondData"
| :ref= "attrAndSrchCondParams.ref"
| @row-click="attrAndSrchCondRowClick">
| </avue-crud>
| </basic-container>
| </el-row>
| </div>
| <div slot="footer" class="dialog-footer">
| <el-button type="primary" @click="selectedreferConfig('selectedSave')">选择并保存</el-button>
| <el-button @click="selectedreferConfig('selectedEdit')">选择并修改</el-button>
| </div>
| </el-dialog>
| </template>
|
| <script>
| //import func from "@/util/func";
| export default {
| name: "referConfigDialog",
| props: {
| },
| data() {
| return{
| isShowReferConfigCrud:false,
| referConfigCrudOption: {
| border: true,
| height: '56vh',
| tip: false,
| searchShow: true,
| searchMenuSpan: 6,
| index: true,
| selection: false,
| menu: false,
| addBtn: false,
| refreshBtn: false,
| searchShowBtn: false,
| columnBtn: false,
| dialogClickModal: false,
| highlightCurrentRow: true,
| align: 'center',
| menuAlign: 'center',
| column: [
| {
| label: '-',
| prop: 'radio',
| width: 60,
| hide: false
| },{
| label: '参照配置编号',
| width: 120,
| search: true,
| searchSpan: 9,
| searchLabelWidth: 100,
| prop: 'id'
| },{
| label: '参照配置名称',
| search: true,
| searchSpan: 9,
| searchLabelWidth: 100,
| prop: 'name'
| },{
| label: '参照的业务类型',
| search: false,
| prop: 'referType'
| },{
| label: '显示的属性',
| search: false,
| prop: 'textField'
| },{
| label: '存储值的属性',
| search: false,
| prop: 'valueField'
| },{
| label: '参照窗口类型',
| search: false,
| prop: 'typeText'
| }
| ],
| },
| referConfigParams: {
| ref: "referConfigCrud",
| referConfigLoading: false,
| referConfigData: [],
| referConfigPage: {
| pageSize: 10,
| currentPage: 1,
| total: 0
| },
| referConfigQuery: {},
| referConfigSelectedRowData: '',
| // 当前选中行
| referConfigSelectedRow: '',
| },
| formOption: {
| submitBtn: false,
| emptyBtn: false,
| labelWidth: '110', //默认标签宽度
| column: [{
| label: '每页显示条数',
| prop: 'limit',
| span: 24,
| disabled: true,
| row: true,
| placeholder: ' ',
| },{
| label: '排序字段',
| prop: 'sortField',
| span: 24,
| disabled: true,
| row: true,
| placeholder: ' ',
| },{
| label: '排序类型',
| prop: 'sortType',
| span: 24,
| dicData: [{
| label: '升序', value: 'asc'
| }, {
| label: '降序', value: 'desc'
| }],
| type: 'select',
| disabled: true,
| row: true,
| placeholder: ' ',
| }
| ]
| },
| // 排序类型的表单配置
| sortColumn:[{
| label: '每页显示条数',
| prop: 'limit',
| span: 24,
| disabled: true,
| row: true,
| placeholder: ' ',
| },{
| label: '排序字段',
| prop: 'sortField',
| span: 24,
| disabled: true,
| row: true,
| placeholder: ' ',
| },{
| label: '排序类型',
| prop: 'sortType',
| span: 24,
| dicData: [{
| label: '升序', value: 'asc'
| }, {
| label: '降序', value: 'desc'
| }],
| type: 'select',
| disabled: true,
| row: true,
| placeholder: ' ',
| }],
| // 树形类型的表单配置
| treeColumn:[{
| label: '树形的上级属性',
| prop: 'parentFieldName',
| span: 7,
| tip: '树形展示的时候,上下级关系查找的属性。',
| tipPlacement: 'right',
| rules: [{
| required: true,
| message: "(树形的上级属性)必填项不能为空",
| trigger: "blur",
| }],
| },{
| label: '上级属性值对应属性',
| prop: 'parentUsedField',
| span: 7,
| tip: '上级属性存储的值,是上级数据的什么属性。一般都是oid。',
| value: 'oid',
| tipPlacement: 'right',
| },{
| label: '根节点的值',
| prop: 'parentValue',
| span: 7,
| tip: '树形展示的时候,上级的值。',
| tipPlacement: 'right',
| },{
| label: '树加载方式',
| prop: 'loadType',
| span: 7,
| value: 'all',
| dicData: [{
| label: '全部', value: 'all'
| }, {
| label: '逐级加载', value: 'node'
| }],
| type: 'select',
| },{
| label: '是否只能选择叶子节点',
| prop: 'onlyLeaf',
| span: 7,
| value: false,
| type: 'switch',
| },{
| label: '排序字段',
| prop: 'sortField',
| span: 7,
| //type: 'table',
| tip: '查询数据时的排序字段',
| tipPlacement: 'right',
| },{
| label: '排序类型',
| prop: 'sortType',
| span: 7,
| type: 'select',
| value: 'asc',
| dicData: [{
| label: '升序', value: 'asc'
| }, {
| label: '降序', value: 'desc'
| }],
| },],
| // 平台类型的表单配置
| standColumn:[{
| label: '参考的UI上下文',
| prop: 'referContent',
| span: 7,
| tip: '只有参照窗口类型是stand时才必须设置,且在stand类型下才能生效',
| tipPlacement: 'right',
| },
| {
| label: '平台的表格编号',
| prop: 'displayTable',
| span: 7,
| tip: '与参照的UI上下文互斥,只有参照窗口类型是stand时才必须设置,且在stand类型下才能生效',
| tipPlacement: 'right',
| }],
|
| // 显示的属性和查询条件表格区域
| attrAndSrchCondOption: {
| border: true,
| height: '40vh',
| tip: false,
| searchShow: false,
| searchMenuSpan: 6,
| index: true,
| selection: false,
| menu: false,
| addBtn: false,
| refreshBtn: false,
| searchShowBtn: false,
| columnBtn: false,
| dialogClickModal: false,
| highlightCurrentRow: true,
| align: 'center',
| menuAlign: 'center',
| column: [
| {
| label: '查询条件',
| children: [
| {
| label: '筛选字段',
| prop: 'filterField',
| },{
| label: '筛选类型',
| prop: 'filterType',
| },{
| label: '筛选的值',
| prop: 'filterValue',
| }
| ],
| },{
| label: '显示的属性',
| children: [
| {
| label: '列字段',
| // width: 120,
| prop: 'field',
| //type: 'select',
| // props: {
| // label: 'name',
| // value: 'code'
| // },
| // dicUrl: 'https://cli.avuejs.com/api/area/getProvince'
| },{
| label: '列名',
| prop: 'title'
| },{
| label: '字段类型',
| prop: 'fieldType'
| },{
| label: '列表可排序',
| prop: 'sort'
| },{
| label: '排序字段',
| prop: 'sortField'
| },{
| label: '字段宽度',
| prop: 'width'
| },{
| label: '列固定位置',
| prop: 'fixedText'
| },{
| label: 'js显示代码',
| prop: 'templet'
| }
| ]
| },
| ],
| },
| attrAndSrchCondParams: {
| ref: "attrOrSrchCondCrud",
| attrAndSrchCondLoading: false,
| attrAndSrchCondData: [],
| },
|
| }
| },
| methods: {
| // 下一步要进行的操作选择并保存或选择并修改
| selectedreferConfig(condition) {
| // 当前选中的参照配置行
| let currentSeletedRow = this.referConfigParams.referConfigSelectedRowData;
| if(!currentSeletedRow){
| this.$message.warning("请选择一条数据!");
| return;
| }
| if(condition == "selectedSave"){
| console.log(currentSeletedRow);
| }else {
| console.log(currentSeletedRow);
| }
| },
| referConfigOnload(page, params = {}){
| this.referConfigParams.referConfigLoading = true;
| this.referConfigParams.referConfigData = [
| {
| id: 'test',
| name: '测试',
| referType: 'test',
| textField: 'test',
| valueField: 'test',
| typeText:'默认配置',
| },{
| id: 'test1',
| name: '测试1',
| referType: 'test1',
| textField: 'test1',
| valueField: 'test1',
| typeText:'平台配置',
| }
| ];
| this.$nextTick(() => {
| this.$refs[this.referConfigParams.ref].doLayout()
| })
| this.referConfigParams.referConfigLoading = false;
| },
| referBtmTypeSizeChange(pageSize){
| this.referConfigParams.referConfigPage.pageSize = pageSize;
| },
| referBtmTypeCurrentChange(currentPage){
| this.referConfigParams.referConfigPage.currentPage = currentPage;
| },
| referConfigRowClick(row){
| this.referConfigParams.referConfigSelectedRowData = row;
| this.referConfigParams.referConfigSelectedRow = row.$index
| this.attrAndSrchCondOnload(row);
| },
| referConfigDataChange(params, done){
| this.referConfigParams.referConfigQuery = params;
| this.referConfigParams.referConfigPage.currentPage = 1;
| this.referConfigOnload(this.referConfigParams.referConfigPage, params);
| done();
| },
| referConfigSearchReset(){
| this.referConfigParams.referConfigQuery = {};
| this.referConfigOnload(this.referConfigParams.referConfigPage);
| },
|
|
| // 显示的属性和查询条件相关方法
| attrAndSrchCondOnload(row){
| this.attrAndSrchCondParams.attrAndSrchCondLoading = true;
| this.attrAndSrchCondParams.attrAndSrchCondParams = row.attrAndSrchCondParams
| this.attrAndSrchCondParams.attrAndSrchCondLoading = false;
| },
|
| },
| }
| </script>
|
| <style>
|
| .refer-config-crud > .el-card > .el-card__body > .avue-crud__menu {
| display: none!important;
| }
| .refer-attrorsrchcond-crud > .el-card > .el-card__body > .avue-crud__menu {
| display: none!important;
| }
|
| </style>
|
|