cloud-web-corejs 1.0.54-dev.134 → 1.0.54-dev.135
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.
@@ -4,16 +4,16 @@ import projectTagView from "@base/components/projectTag/view.vue";
|
|
4
4
|
import szTaMbDialog from "@base/views/bd/setting/table_model/dialog.vue";
|
5
5
|
import MenuKindDialog from "@base/views/bd/setting/menu_kind/dialog.vue";
|
6
6
|
import zdDialog from "@base/views/bd/setting/table_model/zdDialog.vue";
|
7
|
-
import {getBdFlag} from "@base/api/user";
|
8
|
-
import {getJsxBtn} from "@base/views/bd/setting/utils/index";
|
7
|
+
import { getBdFlag } from "@base/api/user";
|
8
|
+
import { getJsxBtn } from "@base/views/bd/setting/utils/index";
|
9
9
|
|
10
10
|
let modules = {};
|
11
11
|
modules = {
|
12
|
-
name:
|
12
|
+
name: "szTaMbEdit",
|
13
13
|
props: {
|
14
14
|
_dataId: [String, Number],
|
15
15
|
currentFormType: Object,
|
16
|
-
readonly: Boolean
|
16
|
+
readonly: Boolean,
|
17
17
|
},
|
18
18
|
components: {
|
19
19
|
formOplogTable,
|
@@ -21,13 +21,13 @@ modules = {
|
|
21
21
|
projectTagView,
|
22
22
|
szTaMbDialog,
|
23
23
|
MenuKindDialog,
|
24
|
-
zdDialog
|
24
|
+
zdDialog,
|
25
25
|
},
|
26
26
|
data() {
|
27
27
|
return {
|
28
28
|
tabIndex: 0,
|
29
29
|
isEdit: false,
|
30
|
-
dataId:
|
30
|
+
dataId: "",
|
31
31
|
szTaMb: {
|
32
32
|
enabled: true,
|
33
33
|
taType: 0,
|
@@ -42,7 +42,7 @@ modules = {
|
|
42
42
|
taCh: null,
|
43
43
|
sszstEn: null,
|
44
44
|
taEn: null,
|
45
|
-
taBm: null
|
45
|
+
taBm: null,
|
46
46
|
},
|
47
47
|
treeDefaultZds: [],
|
48
48
|
productOption: {},
|
@@ -50,7 +50,7 @@ modules = {
|
|
50
50
|
showItemSzTaMbDialog: false,
|
51
51
|
showMenuKindDialog: false,
|
52
52
|
productCategoryCodes: [],
|
53
|
-
zdEnIndex:
|
53
|
+
zdEnIndex: "",
|
54
54
|
|
55
55
|
referenceEntity: null,
|
56
56
|
referenceKey: null,
|
@@ -68,12 +68,12 @@ modules = {
|
|
68
68
|
isDev: true,
|
69
69
|
showPreformDialog: false,
|
70
70
|
menuKindAuth: {
|
71
|
-
editAuth: 0
|
71
|
+
editAuth: 0,
|
72
72
|
},
|
73
73
|
|
74
74
|
dbTable: null,
|
75
75
|
showDtDialog: false,
|
76
|
-
showTmDialog: false
|
76
|
+
showTmDialog: false,
|
77
77
|
};
|
78
78
|
},
|
79
79
|
created() {
|
@@ -100,11 +100,11 @@ modules = {
|
|
100
100
|
url: USER_PREFIX + `/szTaMb/get`,
|
101
101
|
method: `post`,
|
102
102
|
data: {
|
103
|
-
id: this.dataId
|
103
|
+
id: this.dataId,
|
104
104
|
},
|
105
105
|
isLoading: true,
|
106
106
|
modalStrictly: true,
|
107
|
-
success: res => {
|
107
|
+
success: (res) => {
|
108
108
|
if (!callback) {
|
109
109
|
let szTaMb = res.objx || {};
|
110
110
|
szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
|
@@ -115,19 +115,18 @@ modules = {
|
|
115
115
|
this.getCreatedTableColumns();
|
116
116
|
this.getMenuKindAuth(this.szTaMb.menuKindCode);
|
117
117
|
} else {
|
118
|
-
callback(res)
|
118
|
+
callback(res);
|
119
119
|
}
|
120
120
|
//获取操作日志数据
|
121
|
-
this.$refs[
|
121
|
+
this.$refs["oplogTable"].initData({
|
122
122
|
param: () => {
|
123
123
|
return {
|
124
124
|
logType: "SzTaMb",
|
125
|
-
logObjCode: this.szTaMb.taCode
|
125
|
+
logObjCode: this.szTaMb.taCode,
|
126
126
|
};
|
127
|
-
}
|
127
|
+
},
|
128
128
|
});
|
129
|
-
|
130
|
-
}
|
129
|
+
},
|
131
130
|
});
|
132
131
|
} else {
|
133
132
|
this.getMenuKindAuth(this.szTaMb.menuKindCode);
|
@@ -136,7 +135,7 @@ modules = {
|
|
136
135
|
updateStatus(status) {
|
137
136
|
let text;
|
138
137
|
if (status === 3) {
|
139
|
-
text = this.$t1(
|
138
|
+
text = this.$t1("您确定要作废吗?");
|
140
139
|
}
|
141
140
|
this.$baseConfirm(text).then(() => {
|
142
141
|
this.$http({
|
@@ -145,40 +144,40 @@ modules = {
|
|
145
144
|
method: `post`,
|
146
145
|
data: {
|
147
146
|
id: this.dataId,
|
148
|
-
status: status
|
147
|
+
status: status,
|
149
148
|
},
|
150
149
|
isLoading: true,
|
151
|
-
success: res => {
|
150
|
+
success: (res) => {
|
152
151
|
this.$message({
|
153
152
|
message: res.content,
|
154
|
-
type:
|
153
|
+
type: "success",
|
155
154
|
duration: 500,
|
156
|
-
onClose: t => {
|
155
|
+
onClose: (t) => {
|
157
156
|
this.$baseReload();
|
158
|
-
}
|
157
|
+
},
|
159
158
|
});
|
160
|
-
}
|
159
|
+
},
|
161
160
|
});
|
162
161
|
});
|
163
162
|
},
|
164
163
|
saveData() {
|
165
|
-
this.$refs.editForm.$baseValidate(valid => {
|
164
|
+
this.$refs.editForm.$baseValidate((valid) => {
|
166
165
|
if (valid) {
|
167
|
-
const szTaZdMbDTOs =
|
166
|
+
const szTaZdMbDTOs =
|
167
|
+
this.$refs["table-szTaZdMb"].getTableData().fullData;
|
168
168
|
if (szTaZdMbDTOs.length === 0) {
|
169
|
-
this.$baseAlert(this.$t1(
|
169
|
+
this.$baseAlert(this.$t1("明细不能为空!"));
|
170
170
|
return false;
|
171
171
|
}
|
172
172
|
this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
|
173
173
|
this.openPreformDialog();
|
174
|
-
|
175
174
|
}
|
176
175
|
});
|
177
176
|
},
|
178
177
|
saveDataHandle(preformData) {
|
179
178
|
let formData = {
|
180
179
|
...this.szTaMb,
|
181
|
-
logContent: preformData.logContent
|
180
|
+
logContent: preformData.logContent,
|
182
181
|
};
|
183
182
|
// const formData = this.szTaMb;
|
184
183
|
// formData.szTaZdMbDTOs = szTaZdMbDTOs;
|
@@ -190,24 +189,24 @@ modules = {
|
|
190
189
|
method: `post`,
|
191
190
|
data: formData,
|
192
191
|
isLoading: true,
|
193
|
-
success: res => {
|
192
|
+
success: (res) => {
|
194
193
|
this.$message({
|
195
194
|
message: res.content,
|
196
|
-
type:
|
195
|
+
type: "success",
|
197
196
|
duration: 500,
|
198
|
-
onClose: t => {
|
197
|
+
onClose: (t) => {
|
199
198
|
if (this.isEdit) {
|
200
199
|
this.$baseReload();
|
201
200
|
} else {
|
202
201
|
this.$baseReload({
|
203
202
|
updateParam: {
|
204
|
-
_dataId: res.objx
|
205
|
-
}
|
203
|
+
_dataId: res.objx,
|
204
|
+
},
|
206
205
|
});
|
207
206
|
}
|
208
|
-
}
|
207
|
+
},
|
209
208
|
});
|
210
|
-
}
|
209
|
+
},
|
211
210
|
});
|
212
211
|
},
|
213
212
|
openPreformDialog() {
|
@@ -219,20 +218,20 @@ modules = {
|
|
219
218
|
initTableProduct() {
|
220
219
|
const tableOption = {
|
221
220
|
vue: this,
|
222
|
-
tableRef:
|
223
|
-
tableName:
|
221
|
+
tableRef: "table-szTaZdMb",
|
222
|
+
tableName: "edit-szTaMb-szTaZdMb",
|
224
223
|
config: {
|
225
|
-
maxHeight: "600px"
|
224
|
+
maxHeight: "600px",
|
226
225
|
},
|
227
226
|
columns: [
|
228
|
-
{type:
|
227
|
+
{ type: "checkbox", fixed: "left", width: 48, resizable: false },
|
229
228
|
{
|
230
|
-
title: this.$t1(
|
231
|
-
field:
|
229
|
+
title: this.$t1("实体字段名称"),
|
230
|
+
field: "zdEn",
|
232
231
|
width: 150,
|
233
|
-
fixed:
|
232
|
+
fixed: "left",
|
234
233
|
slots: {
|
235
|
-
default: "zdEn"
|
234
|
+
default: "zdEn",
|
236
235
|
/*default: ({row, rowIndex, $table}) => {
|
237
236
|
let disabled = !!row.systems || !!row.relationZd;
|
238
237
|
if (!disabled) {
|
@@ -249,27 +248,34 @@ modules = {
|
|
249
248
|
]
|
250
249
|
}
|
251
250
|
}*/
|
252
|
-
}
|
251
|
+
},
|
253
252
|
},
|
254
|
-
{title: this.$t1('数据库表字段名'), field: 'taZdMc', width: 150, fixed: 'left',},
|
255
253
|
{
|
256
|
-
title: this.$t1(
|
257
|
-
field:
|
254
|
+
title: this.$t1("数据库表字段名"),
|
255
|
+
field: "taZdMc",
|
256
|
+
width: 150,
|
257
|
+
fixed: "left",
|
258
|
+
},
|
259
|
+
{
|
260
|
+
title: this.$t1("数据库表字段是否已创建"),
|
261
|
+
field: "isFieldCreated",
|
258
262
|
width: 200,
|
259
263
|
slots: {
|
260
|
-
default: ({row, rowIndex, $table}) => {
|
264
|
+
default: ({ row, rowIndex, $table }) => {
|
261
265
|
let taZdMc = row.taZdMc;
|
262
266
|
let createdTableColumnArray = this.createdTableColumnArray;
|
263
|
-
return taZdMc && createdTableColumnArray.includes(taZdMc)
|
264
|
-
|
265
|
-
|
267
|
+
return taZdMc && createdTableColumnArray.includes(taZdMc)
|
268
|
+
? "是"
|
269
|
+
: "_";
|
270
|
+
},
|
271
|
+
},
|
266
272
|
},
|
267
273
|
{
|
268
|
-
title: this.$t1(
|
269
|
-
field:
|
274
|
+
title: this.$t1("字段描述"),
|
275
|
+
field: "zdCh",
|
270
276
|
width: 150,
|
271
277
|
slots: {
|
272
|
-
default:
|
278
|
+
default: "zdCh",
|
273
279
|
/*default: ({row, rowIndex, $table}) => {
|
274
280
|
return [
|
275
281
|
<el-form-item prop={'szTaZdMbDTOs.' + rowIndex + '.zdCh'}
|
@@ -278,29 +284,35 @@ modules = {
|
|
278
284
|
</el-form-item>
|
279
285
|
];
|
280
286
|
}*/
|
281
|
-
}
|
287
|
+
},
|
282
288
|
},
|
283
289
|
{
|
284
|
-
title: this.$t1(
|
290
|
+
title: this.$t1("字段类型"),
|
291
|
+
field: "zdType",
|
292
|
+
width: 150,
|
285
293
|
slots: {
|
286
|
-
default:
|
287
|
-
}
|
294
|
+
default: "zdType",
|
295
|
+
},
|
288
296
|
},
|
289
297
|
{
|
290
|
-
title: this.$t1(
|
298
|
+
title: this.$t1("关联字段"),
|
299
|
+
field: "referenceZd",
|
300
|
+
width: 250,
|
291
301
|
slots: {
|
292
|
-
default:
|
293
|
-
}
|
302
|
+
default: "referenceZd",
|
303
|
+
},
|
294
304
|
},
|
295
305
|
{
|
296
|
-
title: this.$t1(
|
306
|
+
title: this.$t1("关联表对应服务名"),
|
307
|
+
field: "refServiceName",
|
308
|
+
width: 200,
|
297
309
|
},
|
298
310
|
{
|
299
|
-
title: this.$t1(
|
300
|
-
field:
|
311
|
+
title: this.$t1("字段类型对应的默认值"),
|
312
|
+
field: "zdTypeValues",
|
301
313
|
width: 150,
|
302
314
|
slots: {
|
303
|
-
default:
|
315
|
+
default: "zdTypeValues",
|
304
316
|
/*default: ({row, rowIndex, $table}) => {
|
305
317
|
let disabled = !!row.systems || !!row.relationZd;
|
306
318
|
return [
|
@@ -310,50 +322,50 @@ modules = {
|
|
310
322
|
</el-form-item>
|
311
323
|
];
|
312
324
|
}*/
|
313
|
-
}
|
325
|
+
},
|
314
326
|
},
|
315
327
|
{
|
316
|
-
title: this.$t1(
|
317
|
-
field:
|
328
|
+
title: this.$t1("是否必填项"),
|
329
|
+
field: "required",
|
318
330
|
width: 140,
|
319
331
|
slots: {
|
320
|
-
default: "required"
|
332
|
+
default: "required",
|
321
333
|
/*default: ({row, $table, rowIndex}) => {
|
322
334
|
let disabled = !!row.systems || !!row.relationZd;
|
323
335
|
return [
|
324
336
|
<el-checkbox v-model={row.required} disabled={disabled}/>
|
325
337
|
];
|
326
338
|
}*/
|
327
|
-
}
|
339
|
+
},
|
328
340
|
},
|
329
341
|
{
|
330
|
-
title: this.$t1(
|
331
|
-
field:
|
342
|
+
title: this.$t1("是否启用"),
|
343
|
+
field: "enabled",
|
332
344
|
width: 120,
|
333
345
|
slots: {
|
334
|
-
default: "enabled"
|
346
|
+
default: "enabled",
|
335
347
|
/*default: ({row, $table, rowIndex}) => {
|
336
348
|
let disabled = !!row.systems || !!row.relationZd;
|
337
349
|
return [
|
338
350
|
<el-checkbox v-model={row.enabled} disabled={disabled}/>
|
339
351
|
];
|
340
352
|
}*/
|
341
|
-
}
|
353
|
+
},
|
342
354
|
},
|
343
355
|
|
344
356
|
{
|
345
|
-
title: this.$t1(
|
346
|
-
field:
|
357
|
+
title: this.$t1("是否自动生成编码"),
|
358
|
+
field: "generateCode",
|
347
359
|
width: 180,
|
348
360
|
slots: {
|
349
|
-
default: "generateCode"
|
361
|
+
default: "generateCode",
|
350
362
|
/*default: ({row, $table, rowIndex}) => {
|
351
363
|
let disabled = !!row.systems || !!row.relationZd;
|
352
364
|
return [
|
353
365
|
<el-checkbox v-model={row.generateCode} disabled={disabled}/>
|
354
366
|
];
|
355
367
|
}*/
|
356
|
-
}
|
368
|
+
},
|
357
369
|
},
|
358
370
|
/* {
|
359
371
|
title: this.$t1('数据库字段加密'),
|
@@ -364,11 +376,11 @@ modules = {
|
|
364
376
|
}
|
365
377
|
}, */
|
366
378
|
{
|
367
|
-
title: this.$t1(
|
368
|
-
field:
|
379
|
+
title: this.$t1("编码类型"),
|
380
|
+
field: "codeType",
|
369
381
|
width: 150,
|
370
382
|
slots: {
|
371
|
-
default: "codeType"
|
383
|
+
default: "codeType",
|
372
384
|
/*default: ({row, rowIndex, $table}) => {
|
373
385
|
let disabled = !!row.systems || !!row.relationZd;
|
374
386
|
return [
|
@@ -378,14 +390,14 @@ modules = {
|
|
378
390
|
</el-form-item>
|
379
391
|
];
|
380
392
|
}*/
|
381
|
-
}
|
393
|
+
},
|
382
394
|
},
|
383
395
|
{
|
384
|
-
title: this.$t1(
|
385
|
-
field:
|
396
|
+
title: this.$t1("序号"),
|
397
|
+
field: "orders",
|
386
398
|
width: 150,
|
387
399
|
slots: {
|
388
|
-
default: "orders"
|
400
|
+
default: "orders",
|
389
401
|
/*default: ({row, rowIndex, $table}) => {
|
390
402
|
return [
|
391
403
|
<el-form-item prop={'szTaZdMbDTOs.' + rowIndex + '.orders'}
|
@@ -396,35 +408,37 @@ modules = {
|
|
396
408
|
</el-form-item>
|
397
409
|
];
|
398
410
|
}*/
|
399
|
-
}
|
411
|
+
},
|
400
412
|
},
|
401
413
|
{
|
402
414
|
width: 47,
|
403
|
-
fixed:
|
404
|
-
title:
|
415
|
+
fixed: "right",
|
416
|
+
title: "",
|
405
417
|
sortable: false,
|
406
418
|
slots: {
|
407
|
-
default: ({row, rowIndex, $table}) => {
|
419
|
+
default: ({ row, rowIndex, $table }) => {
|
408
420
|
let taZdMc = row.taZdMc;
|
409
|
-
let createdTableColumnArray =
|
410
|
-
|
421
|
+
let createdTableColumnArray =
|
422
|
+
this.createdTableColumnArray || [];
|
423
|
+
let hasCreated =
|
424
|
+
!!taZdMc && createdTableColumnArray.includes(taZdMc);
|
411
425
|
// let style = !row.relationZd ? "margin-left:20px" : "";
|
412
426
|
if (!row.systems && !hasCreated && !row.relationZd) {
|
413
427
|
//非内置,未创建字段,非关联表带出来的字段
|
414
428
|
return getJsxBtn({
|
415
429
|
iconName: "el-icon-delete",
|
416
|
-
content: this.$t1(
|
430
|
+
content: this.$t1("删除"),
|
417
431
|
onclick: () => {
|
418
432
|
this.deleteItem(row, rowIndex);
|
419
|
-
}
|
433
|
+
},
|
420
434
|
});
|
421
435
|
}
|
422
|
-
}
|
423
|
-
}
|
424
|
-
}
|
425
|
-
]
|
436
|
+
},
|
437
|
+
},
|
438
|
+
},
|
439
|
+
],
|
426
440
|
};
|
427
|
-
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
441
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
428
442
|
this.productOption = opts;
|
429
443
|
});
|
430
444
|
if (this.dataId) {
|
@@ -433,13 +447,13 @@ modules = {
|
|
433
447
|
url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
|
434
448
|
method: `post`,
|
435
449
|
data: {
|
436
|
-
id: this.dataId
|
450
|
+
id: this.dataId,
|
437
451
|
},
|
438
452
|
isLoading: true,
|
439
453
|
modalStrictly: true,
|
440
|
-
success: res => {
|
454
|
+
success: (res) => {
|
441
455
|
this.szTaMb.szTaZdMbDTOs = res.objx || [];
|
442
|
-
}
|
456
|
+
},
|
443
457
|
});
|
444
458
|
}
|
445
459
|
},
|
@@ -450,43 +464,50 @@ modules = {
|
|
450
464
|
// }
|
451
465
|
// this.customer.szTaZdMbDTOs.push({tacitly: tacitly});
|
452
466
|
let newIndex = this.getNewIndex();
|
453
|
-
|
454
|
-
|
467
|
+
let item = {
|
468
|
+
zdEn: null,
|
469
|
+
zdCh: null,
|
470
|
+
zdTypeValues: null,
|
471
|
+
required: false,
|
472
|
+
codeType: null,
|
473
|
+
referenceZd: null,
|
474
|
+
zdType: "Text",
|
455
475
|
enabled: true,
|
456
476
|
orders: newIndex,
|
457
477
|
generateCode: false,
|
458
|
-
fromTable: false
|
459
|
-
}
|
478
|
+
fromTable: false,
|
479
|
+
}
|
480
|
+
this.szTaMb.szTaZdMbDTOs.splice(0, 0, item);
|
460
481
|
},
|
461
482
|
deleteItem(row, rowIndex) {
|
462
483
|
let referenceZd = row.referenceZd;
|
463
484
|
this.szTaMb.szTaZdMbDTOs.splice(rowIndex, 1);
|
464
485
|
if (referenceZd) {
|
465
|
-
this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter(item => {
|
466
|
-
return referenceZd !== item.relationZd
|
467
|
-
})
|
486
|
+
this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter((item) => {
|
487
|
+
return referenceZd !== item.relationZd;
|
488
|
+
});
|
468
489
|
}
|
469
490
|
},
|
470
491
|
confirmInsertSzTaMb(rows) {
|
471
492
|
if (rows.length > 0) {
|
472
493
|
let row = rows[0];
|
473
|
-
this.$set(this.szTaMb,
|
474
|
-
this.$set(this.szTaMb,
|
494
|
+
this.$set(this.szTaMb, "sszst", row.taCode);
|
495
|
+
this.$set(this.szTaMb, "sszstEn", row.taEn);
|
475
496
|
}
|
476
497
|
},
|
477
498
|
confirmInsertItemSzTaMb(rows) {
|
478
499
|
if (rows.length > 0) {
|
479
500
|
let row = rows[0];
|
480
501
|
let szTaZdMbDTO = this.szTaMb.szTaZdMbDTOs[this.zdEnIndex];
|
481
|
-
this.$set(szTaZdMbDTO,
|
482
|
-
this.$set(szTaZdMbDTO,
|
502
|
+
this.$set(szTaZdMbDTO, "zdEn", row.taBm + "." + szTaZdMbDTO.zdEn);
|
503
|
+
this.$set(szTaZdMbDTO, "dybm", row.taEn);
|
483
504
|
}
|
484
505
|
},
|
485
506
|
confirmInsertMenuKind(rows) {
|
486
507
|
if (rows.length > 0) {
|
487
508
|
let row = rows[0];
|
488
|
-
this.$set(this.szTaMb,
|
489
|
-
this.$set(this.szTaMb,
|
509
|
+
this.$set(this.szTaMb, "menuKindCode", row.menuKindCode);
|
510
|
+
this.$set(this.szTaMb, "menuKindName", row.name);
|
490
511
|
}
|
491
512
|
},
|
492
513
|
getNewData(callback) {
|
@@ -497,19 +518,19 @@ modules = {
|
|
497
518
|
url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
|
498
519
|
method: `post`,
|
499
520
|
data: {
|
500
|
-
id: this.dataId
|
521
|
+
id: this.dataId,
|
501
522
|
},
|
502
523
|
isLoading: true,
|
503
524
|
modalStrictly: true,
|
504
|
-
success: res1 => {
|
525
|
+
success: (res1) => {
|
505
526
|
szTaMb.szTaZdMbDTOs = res1.objx || [];
|
506
|
-
callback(szTaMb)
|
507
|
-
}
|
527
|
+
callback(szTaMb);
|
528
|
+
},
|
508
529
|
});
|
509
530
|
});
|
510
531
|
},
|
511
532
|
createModifyTable() {
|
512
|
-
let text = this.$t1(
|
533
|
+
let text = this.$t1("您确定要创建/更新数据表吗?");
|
513
534
|
this.$baseConfirm(text).then(() => {
|
514
535
|
this.getNewData((data) => {
|
515
536
|
this.$http({
|
@@ -518,18 +539,17 @@ modules = {
|
|
518
539
|
method: `post`,
|
519
540
|
data: data,
|
520
541
|
isLoading: true,
|
521
|
-
success: res => {
|
542
|
+
success: (res) => {
|
522
543
|
this.$message({
|
523
544
|
message: res.content,
|
524
|
-
type:
|
545
|
+
type: "success",
|
525
546
|
duration: 500,
|
526
|
-
onClose: t => {
|
547
|
+
onClose: (t) => {
|
527
548
|
this.$baseReload();
|
528
|
-
}
|
549
|
+
},
|
529
550
|
});
|
530
|
-
}
|
551
|
+
},
|
531
552
|
});
|
532
|
-
|
533
553
|
});
|
534
554
|
});
|
535
555
|
},
|
@@ -540,14 +560,16 @@ modules = {
|
|
540
560
|
let referenceShowFields = [];
|
541
561
|
|
542
562
|
if (referenceZd) {
|
543
|
-
let index = referenceZd.indexOf(".")
|
563
|
+
let index = referenceZd.indexOf(".");
|
544
564
|
referenceEntity = referenceZd.substring(0, index);
|
545
565
|
referenceKey = referenceZd.substr(index + 1);
|
546
|
-
referenceShowFields = this.szTaMb.szTaZdMbDTOs
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
566
|
+
referenceShowFields = this.szTaMb.szTaZdMbDTOs
|
567
|
+
.filter((item) => {
|
568
|
+
return referenceZd == item.relationZd;
|
569
|
+
})
|
570
|
+
.map((item) => {
|
571
|
+
return item.referenceZd.substr(index + 1);
|
572
|
+
});
|
551
573
|
}
|
552
574
|
|
553
575
|
this.referenceEntity = referenceEntity;
|
@@ -555,10 +577,10 @@ modules = {
|
|
555
577
|
this.referenceShowFields = referenceShowFields;
|
556
578
|
this.refServiceName = row.refServiceName ?? null;
|
557
579
|
|
558
|
-
this.referenceShowRows = referenceShowFields.map(item => {
|
580
|
+
this.referenceShowRows = referenceShowFields.map((item) => {
|
559
581
|
return {
|
560
|
-
taZdMc: item
|
561
|
-
}
|
582
|
+
taZdMc: item,
|
583
|
+
};
|
562
584
|
});
|
563
585
|
|
564
586
|
this.currentIndex = rowIndex;
|
@@ -573,11 +595,11 @@ modules = {
|
|
573
595
|
|
574
596
|
let referenceZd = referenceEntity + "." + this.referenceKey;
|
575
597
|
let referenceShowFields = this.referenceShowFields;
|
576
|
-
let keys = referenceShowFields.map(item => {
|
598
|
+
let keys = referenceShowFields.map((item) => {
|
577
599
|
return referenceEntity + "." + item;
|
578
|
-
})
|
600
|
+
});
|
579
601
|
if (oldReferenceZd) {
|
580
|
-
let index0 = oldReferenceZd.indexOf(".")
|
602
|
+
let index0 = oldReferenceZd.indexOf(".");
|
581
603
|
let oldReferenceEntity = oldReferenceZd.substring(0, index0);
|
582
604
|
let delIndex = [];
|
583
605
|
if (referenceEntity != oldReferenceEntity) {
|
@@ -585,8 +607,8 @@ modules = {
|
|
585
607
|
if (item.relationZd && oldReferenceZd == item.relationZd) {
|
586
608
|
delIndex.push(index);
|
587
609
|
}
|
588
|
-
})
|
589
|
-
}/*else if (oldReferenceZd != referenceZd) {
|
610
|
+
});
|
611
|
+
} /*else if (oldReferenceZd != referenceZd) {
|
590
612
|
this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
|
591
613
|
if (oldReferenceZd == item.relationZd) {
|
592
614
|
delIndex.push(index)
|
@@ -596,43 +618,44 @@ modules = {
|
|
596
618
|
this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
|
597
619
|
if (oldReferenceZd == item.relationZd) {
|
598
620
|
if (!keys.includes(item.referenceZd)) {
|
599
|
-
delIndex.push(index)
|
621
|
+
delIndex.push(index);
|
600
622
|
} else {
|
601
623
|
item.refServiceName = refServiceName;
|
602
624
|
}
|
603
|
-
|
604
625
|
}
|
605
|
-
})
|
626
|
+
});
|
606
627
|
}
|
607
628
|
if (delIndex.length) {
|
608
629
|
/*this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter((item, index) => {
|
609
630
|
return !delIndex.includes(index);
|
610
631
|
})*/
|
611
|
-
delIndex.reverse().forEach(i => {
|
612
|
-
this.szTaMb.szTaZdMbDTOs.splice(i, 1)
|
613
|
-
})
|
632
|
+
delIndex.reverse().forEach((i) => {
|
633
|
+
this.szTaMb.szTaZdMbDTOs.splice(i, 1);
|
634
|
+
});
|
614
635
|
}
|
615
636
|
}
|
616
637
|
|
617
638
|
/*let addReferenceShowFields = referenceShowFields.filter((item, index) => {
|
618
639
|
return !keys.includes(item)
|
619
640
|
})*/
|
620
|
-
let oldKeys = this.szTaMb.szTaZdMbDTOs
|
641
|
+
let oldKeys = this.szTaMb.szTaZdMbDTOs
|
642
|
+
.filter((item) => referenceZd == item.relationZd)
|
643
|
+
.map((item) => item.referenceZd);
|
621
644
|
let addReferenceShowFields = referenceShowFields.filter((item, index) => {
|
622
|
-
return !oldKeys.includes(referenceEntity + "." + item)
|
623
|
-
})
|
645
|
+
return !oldKeys.includes(referenceEntity + "." + item);
|
646
|
+
});
|
624
647
|
|
625
648
|
let addIndex = -1;
|
626
|
-
let lastIndex = this.szTaMb.szTaZdMbDTOs.findLastIndex(item => {
|
627
|
-
return referenceZd == item.relationZd
|
649
|
+
let lastIndex = this.szTaMb.szTaZdMbDTOs.findLastIndex((item) => {
|
650
|
+
return referenceZd == item.relationZd;
|
628
651
|
});
|
629
|
-
addIndex = lastIndex >= 0 ?
|
652
|
+
addIndex = lastIndex >= 0 ? lastIndex + 1 : this.currentIndex + 1;
|
630
653
|
|
631
654
|
let referenceShowRows = this.referenceShowRows;
|
632
655
|
|
633
656
|
let addReferenceShowRows = referenceShowRows.filter((item, index) => {
|
634
|
-
return addReferenceShowFields.includes(item.taZdMc)
|
635
|
-
})
|
657
|
+
return addReferenceShowFields.includes(item.taZdMc);
|
658
|
+
});
|
636
659
|
addReferenceShowRows.forEach((item, index) => {
|
637
660
|
let rIndex = addIndex + index;
|
638
661
|
let orders = (row.orders || 0) + index + 1;
|
@@ -650,12 +673,12 @@ modules = {
|
|
650
673
|
requiredMsg: null,
|
651
674
|
regexp: null,
|
652
675
|
regexpMsg: null,
|
653
|
-
orders
|
676
|
+
orders,
|
654
677
|
};
|
655
678
|
this.szTaMb.szTaZdMbDTOs.splice(rIndex, 0, newItem);
|
656
679
|
});
|
657
|
-
row.referenceZd = referenceZd
|
658
|
-
row.refServiceName = refServiceName
|
680
|
+
row.referenceZd = referenceZd;
|
681
|
+
row.refServiceName = refServiceName;
|
659
682
|
this.handleReferenceOrders(row);
|
660
683
|
this.showReferenceZdDialog = false;
|
661
684
|
},
|
@@ -666,11 +689,13 @@ modules = {
|
|
666
689
|
let referenceZd = row.referenceZd;
|
667
690
|
let orders = row.orders || 0;
|
668
691
|
if (referenceZd) {
|
669
|
-
this.szTaMb.szTaZdMbDTOs
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
692
|
+
this.szTaMb.szTaZdMbDTOs
|
693
|
+
.filter((item) => referenceZd === item.relationZd)
|
694
|
+
.forEach((item, index) => {
|
695
|
+
if (referenceZd === item.relationZd) {
|
696
|
+
item.orders = orders + index + 1;
|
697
|
+
}
|
698
|
+
});
|
674
699
|
}
|
675
700
|
},
|
676
701
|
confirmEntityDialog(rows) {
|
@@ -693,7 +718,7 @@ modules = {
|
|
693
718
|
confirmEntityFieldDialog2(rows) {
|
694
719
|
if (rows.length) {
|
695
720
|
this.referenceShowRows = rows;
|
696
|
-
this.referenceShowFields = rows.map(row => {
|
721
|
+
this.referenceShowFields = rows.map((row) => {
|
697
722
|
return row.taZdMc;
|
698
723
|
});
|
699
724
|
}
|
@@ -705,17 +730,19 @@ modules = {
|
|
705
730
|
url: "/" + this.szTaMb.serviceName + "/dbTable/getTableColumns",
|
706
731
|
method: `post`,
|
707
732
|
data: {
|
708
|
-
stringOne: this.szTaMb.taBm
|
733
|
+
stringOne: this.szTaMb.taBm,
|
709
734
|
},
|
710
735
|
isLoading: true,
|
711
736
|
modalStrictly: true,
|
712
|
-
success: res => {
|
737
|
+
success: (res) => {
|
713
738
|
if (res.objx) {
|
714
739
|
this.createdTableColumnStr = res.objx;
|
715
|
-
let createdTableColumnArray = res.objx
|
740
|
+
let createdTableColumnArray = res.objx
|
741
|
+
.split(",")
|
742
|
+
.filter((item) => !!item);
|
716
743
|
this.createdTableColumnArray = createdTableColumnArray;
|
717
744
|
}
|
718
|
-
}
|
745
|
+
},
|
719
746
|
});
|
720
747
|
},
|
721
748
|
getTreeDefaultZds() {
|
@@ -726,80 +753,91 @@ modules = {
|
|
726
753
|
data: {},
|
727
754
|
isLoading: true,
|
728
755
|
modalStrictly: true,
|
729
|
-
success: res => {
|
730
|
-
let rows = res.objx || []
|
731
|
-
this.treeDefaultZds = rows
|
732
|
-
}
|
756
|
+
success: (res) => {
|
757
|
+
let rows = res.objx || [];
|
758
|
+
this.treeDefaultZds = rows;
|
759
|
+
},
|
733
760
|
});
|
734
761
|
},
|
735
762
|
hasFieldCreated(row) {
|
736
763
|
let taZdMc = row.taZdMc;
|
737
764
|
let createdTableColumnArray = this.createdTableColumnArray || [];
|
738
|
-
let hasCreated = !!taZdMc && createdTableColumnArray.includes(taZdMc)
|
765
|
+
let hasCreated = !!taZdMc && createdTableColumnArray.includes(taZdMc);
|
739
766
|
return hasCreated;
|
740
767
|
},
|
741
768
|
changeTaRule(val) {
|
742
769
|
let treeDefaultZds = this.$baseLodash.cloneDeep(this.treeDefaultZds);
|
743
770
|
let szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
|
744
771
|
if (val == 1) {
|
745
|
-
let zdEns = szTaZdMbDTOs
|
772
|
+
let zdEns = szTaZdMbDTOs
|
773
|
+
.filter((item) => !!item.zdEn)
|
774
|
+
.map((item) => item.zdEn);
|
746
775
|
if (zdEns.length) {
|
747
|
-
treeDefaultZds = treeDefaultZds.filter(item => {
|
776
|
+
treeDefaultZds = treeDefaultZds.filter((item) => {
|
748
777
|
return !zdEns.includes(item.zdEn);
|
749
|
-
})
|
778
|
+
});
|
750
779
|
}
|
751
780
|
let newIndex = this.getNewIndex();
|
752
781
|
treeDefaultZds.forEach((item, index) => {
|
753
782
|
item.orders = newIndex + index;
|
754
|
-
})
|
783
|
+
});
|
755
784
|
szTaZdMbDTOs.push(...treeDefaultZds);
|
756
785
|
} else {
|
757
|
-
let zdEns = szTaZdMbDTOs
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
return !createdFields.includes(item.zdEn) && zdEns.includes(item.zdEn);
|
786
|
+
let zdEns = szTaZdMbDTOs
|
787
|
+
.filter((item) => !!item.zdEn)
|
788
|
+
.map((item) => item.zdEn);
|
789
|
+
let createdFields = szTaZdMbDTOs
|
790
|
+
.filter((item) => {
|
791
|
+
return !!item.zdEn && this.hasFieldCreated(item);
|
764
792
|
})
|
793
|
+
.map((item) => item.zdEn);
|
794
|
+
if (zdEns.length) {
|
795
|
+
treeDefaultZds = treeDefaultZds.filter((item) => {
|
796
|
+
return (
|
797
|
+
!createdFields.includes(item.zdEn) && zdEns.includes(item.zdEn)
|
798
|
+
);
|
799
|
+
});
|
765
800
|
}
|
766
|
-
let delFields = treeDefaultZds.map(item => item.zdEn);
|
767
|
-
this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter(
|
801
|
+
let delFields = treeDefaultZds.map((item) => item.zdEn);
|
802
|
+
this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter(
|
803
|
+
(item) => !delFields.includes(item.zdEn)
|
804
|
+
);
|
768
805
|
}
|
769
|
-
|
770
806
|
},
|
771
807
|
getNewIndex() {
|
772
|
-
let min = 100
|
808
|
+
let min = 100;
|
773
809
|
let szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
|
774
810
|
let value = 0;
|
775
|
-
let allOrders = szTaZdMbDTOs
|
776
|
-
|
811
|
+
let allOrders = szTaZdMbDTOs
|
812
|
+
.filter((item) => item.orders != null && item.orders != undefined)
|
813
|
+
.map((item) => item.orders);
|
814
|
+
szTaZdMbDTOs.forEach((item) => {
|
777
815
|
let orders = item.orders;
|
778
816
|
if (orders !== null && orders !== undefined && orders < 9000) {
|
779
817
|
value = Math.max(value, orders);
|
780
818
|
}
|
781
|
-
})
|
782
|
-
let newIndex = Math.max(min,
|
819
|
+
});
|
820
|
+
let newIndex = Math.max(min, value + 10);
|
783
821
|
return newIndex;
|
784
822
|
},
|
785
823
|
getBdEnv() {
|
786
824
|
getBdFlag({
|
787
|
-
success: res => {
|
788
|
-
this.isDev = res.objx == 1
|
789
|
-
}
|
825
|
+
success: (res) => {
|
826
|
+
this.isDev = res.objx == 1;
|
827
|
+
},
|
790
828
|
});
|
791
829
|
},
|
792
830
|
getMenuKindAuth(menuKindCode) {
|
793
831
|
if (menuKindCode) {
|
794
832
|
this.$http({
|
795
833
|
aes: true,
|
796
|
-
url: USER_PREFIX +
|
834
|
+
url: USER_PREFIX + "/menu_kind_auth/getAuth",
|
797
835
|
method: `post`,
|
798
|
-
data: {stringOne: menuKindCode},
|
836
|
+
data: { stringOne: menuKindCode },
|
799
837
|
isLoading: true,
|
800
|
-
success: res => {
|
801
|
-
this.menuKindAuth = res.objx || {}
|
802
|
-
}
|
838
|
+
success: (res) => {
|
839
|
+
this.menuKindAuth = res.objx || {};
|
840
|
+
},
|
803
841
|
});
|
804
842
|
}
|
805
843
|
},
|
@@ -812,7 +850,7 @@ modules = {
|
|
812
850
|
let dbTable = this.dbTable;
|
813
851
|
if (!dbTable) {
|
814
852
|
this.$baseAlert(this.$t1("数据表不能为空"));
|
815
|
-
return
|
853
|
+
return;
|
816
854
|
}
|
817
855
|
this.showDtDialog = false;
|
818
856
|
this.$http({
|
@@ -820,30 +858,32 @@ modules = {
|
|
820
858
|
url: "/" + this.szTaMb.serviceName + `/dbTable/getSzTaZdMbs`,
|
821
859
|
method: `post`,
|
822
860
|
data: {
|
823
|
-
stringOne: dbTable
|
861
|
+
stringOne: dbTable,
|
824
862
|
},
|
825
863
|
isLoading: true,
|
826
|
-
success: res => {
|
864
|
+
success: (res) => {
|
827
865
|
let items = res.objx || [];
|
828
866
|
if (!items.length) {
|
829
|
-
this.$baseAlert(this.$t1("数据表[{dbTable}]不存在", {dbTable}));
|
830
|
-
return
|
867
|
+
this.$baseAlert(this.$t1("数据表[{dbTable}]不存在", { dbTable }));
|
868
|
+
return;
|
831
869
|
}
|
832
|
-
let szTaZdMbDTOs = items
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
870
|
+
let szTaZdMbDTOs = items
|
871
|
+
.filter((item) => !item.systems)
|
872
|
+
.map((item) => {
|
873
|
+
return {
|
874
|
+
...item,
|
875
|
+
createBy: null,
|
876
|
+
createDate: null,
|
877
|
+
fromTable: true,
|
878
|
+
id: null,
|
879
|
+
modifyBy: null,
|
880
|
+
modifyDate: null,
|
881
|
+
};
|
882
|
+
});
|
843
883
|
this.szTaMb.taEn = dbTable;
|
844
884
|
this.szTaMb.taBm = dbTable;
|
845
885
|
this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
|
846
|
-
}
|
886
|
+
},
|
847
887
|
});
|
848
888
|
},
|
849
889
|
openTmDialog() {
|
@@ -858,23 +898,25 @@ modules = {
|
|
858
898
|
url: USER_PREFIX + `/szTaMb/getSzTaZdMbs`,
|
859
899
|
method: `post`,
|
860
900
|
data: {
|
861
|
-
id: row.id
|
901
|
+
id: row.id,
|
862
902
|
},
|
863
903
|
isLoading: true,
|
864
904
|
modalStrictly: true,
|
865
|
-
success: res => {
|
905
|
+
success: (res) => {
|
866
906
|
let items = res.objx || [];
|
867
|
-
let szTaZdMbDTOs = items
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
907
|
+
let szTaZdMbDTOs = items
|
908
|
+
.filter((item) => !item.systems)
|
909
|
+
.map((item) => {
|
910
|
+
return {
|
911
|
+
...item,
|
912
|
+
createBy: null,
|
913
|
+
createDate: null,
|
914
|
+
fromTable: true,
|
915
|
+
id: null,
|
916
|
+
modifyBy: null,
|
917
|
+
modifyDate: null,
|
918
|
+
};
|
919
|
+
});
|
878
920
|
let newRow = {
|
879
921
|
...row,
|
880
922
|
createBy: null,
|
@@ -885,19 +927,19 @@ modules = {
|
|
885
927
|
modifyDate: null,
|
886
928
|
sid: null,
|
887
929
|
// taBm: null,
|
888
|
-
taCode: null
|
889
|
-
}
|
890
|
-
Object.keys(newRow).forEach(key => {
|
891
|
-
if (key.endsWith(
|
892
|
-
delete newRow[key]
|
930
|
+
taCode: null,
|
931
|
+
};
|
932
|
+
Object.keys(newRow).forEach((key) => {
|
933
|
+
if (key.endsWith("DTOs")) {
|
934
|
+
delete newRow[key];
|
893
935
|
}
|
894
|
-
})
|
936
|
+
});
|
895
937
|
Object.assign(this.szTaMb, newRow);
|
896
938
|
this.szTaMb.szTaZdMbDTOs = szTaZdMbDTOs;
|
897
|
-
}
|
939
|
+
},
|
898
940
|
});
|
899
941
|
}
|
900
|
-
}
|
901
|
-
}
|
942
|
+
},
|
943
|
+
},
|
902
944
|
};
|
903
|
-
export default modules
|
945
|
+
export default modules;
|