cloud-web-corejs 1.0.54-dev.640 → 1.0.54-dev.642
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/package.json
CHANGED
|
@@ -429,6 +429,7 @@
|
|
|
429
429
|
<el-option value="TextArea" :label="$t1('长文本')"></el-option>
|
|
430
430
|
<el-option value="DateTime" :label="$t1('日期时间')"></el-option>
|
|
431
431
|
<el-option value="Reference" :label="$t1('关联表')"></el-option>
|
|
432
|
+
<el-option value="ReferenceLong" :label="$t1('关联表(长整型)')"></el-option>
|
|
432
433
|
</el-select>
|
|
433
434
|
</fieldCompare>
|
|
434
435
|
</el-form-item>
|
|
@@ -462,15 +463,20 @@
|
|
|
462
463
|
class="search-input"
|
|
463
464
|
v-model="row.referenceZd"
|
|
464
465
|
v-el-readonly
|
|
465
|
-
v-if="row.zdType
|
|
466
|
+
v-if="isReferenceZdType(row.zdType)"
|
|
466
467
|
:disabled="!row.zdEn"
|
|
467
|
-
clearable
|
|
468
468
|
>
|
|
469
|
-
<
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
469
|
+
<span slot="suffix" class="el-input__suffix-inner">
|
|
470
|
+
<i
|
|
471
|
+
v-if="row.referenceZd"
|
|
472
|
+
class="el-input__icon el-icon-circle-close"
|
|
473
|
+
@click.stop="confirmClearReferenceZd(row)"
|
|
474
|
+
></i>
|
|
475
|
+
<i
|
|
476
|
+
class="el-input__icon el-icon-search"
|
|
477
|
+
@click="openReferenceZdDialog(row, rowIndex, $table)"
|
|
478
|
+
></i>
|
|
479
|
+
</span>
|
|
474
480
|
</el-input>
|
|
475
481
|
<template v-else>
|
|
476
482
|
{{ row.referenceZd }}
|
|
@@ -121,7 +121,8 @@ modules = {
|
|
|
121
121
|
Text: "文本",
|
|
122
122
|
TextArea: "长文本",
|
|
123
123
|
DateTime: "日期时间",
|
|
124
|
-
Reference: "关联表",
|
|
124
|
+
Reference: "关联表(文本)",
|
|
125
|
+
ReferenceLong: "关联表(长整型)",
|
|
125
126
|
},
|
|
126
127
|
|
|
127
128
|
treeFlagMap:{
|
|
@@ -680,6 +681,9 @@ modules = {
|
|
|
680
681
|
});
|
|
681
682
|
});
|
|
682
683
|
},
|
|
684
|
+
isReferenceZdType(zdType) {
|
|
685
|
+
return zdType === "Reference" || zdType === "ReferenceLong";
|
|
686
|
+
},
|
|
683
687
|
openReferenceZdDialog(row, rowIndex, $table) {
|
|
684
688
|
let referenceZd = row.referenceZd;
|
|
685
689
|
let referenceZd2 = row.referenceZd + "." + row.zdEn;
|
|
@@ -693,16 +697,13 @@ modules = {
|
|
|
693
697
|
referenceKey = referenceZd.substr(index + 1);
|
|
694
698
|
referenceShowFields = this.szTaMb.szTaZdMbDTOs
|
|
695
699
|
.filter((item) => {
|
|
696
|
-
// return referenceZd == item.relationZd;
|
|
697
700
|
let flag = false;
|
|
698
701
|
if (item.relationZd === referenceZd || item.relationZd === referenceZd2) {
|
|
699
702
|
flag = true
|
|
700
703
|
}
|
|
701
704
|
return flag;
|
|
702
|
-
// return referenceZd == item.relationZd ;
|
|
703
705
|
})
|
|
704
706
|
.map((item) => {
|
|
705
|
-
// return item.referenceZd.split(".")[1]
|
|
706
707
|
return item.referenceZd.substr(index + 1);
|
|
707
708
|
});
|
|
708
709
|
}
|
|
@@ -725,42 +726,66 @@ modules = {
|
|
|
725
726
|
let map = {
|
|
726
727
|
"Integer": "11",
|
|
727
728
|
"Long": "20",
|
|
729
|
+
"ReferenceLong": "20",
|
|
728
730
|
"Decimal": "21,6",
|
|
729
731
|
"Money": "21,2",
|
|
730
732
|
"Text": "255"
|
|
731
733
|
}
|
|
732
734
|
row.zdLength = map[row.zdType] || null;
|
|
733
|
-
this.
|
|
735
|
+
if (!this.isReferenceZdType(row.zdType)) {
|
|
736
|
+
this.clearReferenceZd(row);
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
getReferenceChildRows(row) {
|
|
740
|
+
let referenceZd = row.referenceZd;
|
|
741
|
+
if (!referenceZd && !row.zdEn) {
|
|
742
|
+
return [];
|
|
743
|
+
}
|
|
744
|
+
let referenceZd2 = referenceZd ? referenceZd + "." + row.zdEn : null;
|
|
745
|
+
let relationZdSuffix = row.zdEn ? "." + row.zdEn : null;
|
|
746
|
+
return this.szTaMb.szTaZdMbDTOs.filter((item) => {
|
|
747
|
+
if (referenceZd && (referenceZd === item.relationZd || referenceZd2 === item.relationZd)) {
|
|
748
|
+
return true;
|
|
749
|
+
}
|
|
750
|
+
if (relationZdSuffix && item.relationZd && item.relationZd.endsWith(relationZdSuffix)) {
|
|
751
|
+
return true;
|
|
752
|
+
}
|
|
753
|
+
return false;
|
|
754
|
+
});
|
|
755
|
+
},
|
|
756
|
+
confirmClearReferenceZd(row) {
|
|
757
|
+
if (!row.referenceZd) {
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
if (this.hasFieldCreated(row)) {
|
|
761
|
+
this.$baseAlert(this.$t1("该字段已在数据库中创建,不能清空关联配置"));
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
let childRows = this.getReferenceChildRows(row);
|
|
765
|
+
if (childRows.some((item) => this.hasFieldCreated(item))) {
|
|
766
|
+
this.$baseAlert(this.$t1("关联显示字段已在数据库中创建,不能清空关联配置"));
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
let text = this.$t1("清空关联配置将同时删除关联显示字段,您确定要继续吗?");
|
|
770
|
+
this.$baseConfirm(text).then(() => {
|
|
771
|
+
this.clearReferenceZd(row);
|
|
772
|
+
});
|
|
734
773
|
},
|
|
735
774
|
clearReferenceZd(row) {
|
|
736
775
|
let referenceZd = row.referenceZd;
|
|
737
776
|
if (referenceZd) {
|
|
738
|
-
let referenceZd2 =
|
|
777
|
+
let referenceZd2 = referenceZd + "." + row.zdEn;
|
|
739
778
|
this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter((item) => {
|
|
740
779
|
return referenceZd !== item.relationZd && referenceZd2 !== item.relationZd;
|
|
741
780
|
});
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
/*let oldReferenceZd = row.referenceZd;
|
|
747
|
-
if (oldReferenceZd) {
|
|
748
|
-
let oldReferenceZd2 = row.referenceZd + "." + row.zdEn;
|
|
749
|
-
let index0 = oldReferenceZd.indexOf(".");
|
|
750
|
-
let oldReferenceEntity = oldReferenceZd.substring(0, index0);
|
|
751
|
-
let delIndex = [];
|
|
752
|
-
this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
|
|
753
|
-
if (item.relationZd && (oldReferenceZd == item.relationZd || oldReferenceZd2 == item.relationZd)) {
|
|
754
|
-
delIndex.push(index);
|
|
755
|
-
}
|
|
781
|
+
} else if (row.zdEn) {
|
|
782
|
+
let relationZdSuffix = "." + row.zdEn;
|
|
783
|
+
this.szTaMb.szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs.filter((item) => {
|
|
784
|
+
return !(item.relationZd && item.relationZd.endsWith(relationZdSuffix));
|
|
756
785
|
});
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
row.referenceZd = null;
|
|
763
|
-
}*/
|
|
786
|
+
}
|
|
787
|
+
row.referenceZd = null;
|
|
788
|
+
row.refServiceName = null;
|
|
764
789
|
},
|
|
765
790
|
confirmReferenceZdDialog() {
|
|
766
791
|
let row = this.szTaMb.szTaZdMbDTOs[this.currentIndex];
|
|
@@ -781,15 +806,15 @@ modules = {
|
|
|
781
806
|
let index0 = oldReferenceZd.indexOf(".");
|
|
782
807
|
let oldReferenceEntity = oldReferenceZd.substring(0, index0);
|
|
783
808
|
let delIndex = [];
|
|
784
|
-
if (referenceEntity
|
|
809
|
+
if (referenceEntity !== oldReferenceEntity) {
|
|
785
810
|
this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
|
|
786
|
-
if (item.relationZd && (oldReferenceZd
|
|
811
|
+
if (item.relationZd && (oldReferenceZd === item.relationZd || oldReferenceZd2 === item.relationZd)) {
|
|
787
812
|
delIndex.push(index);
|
|
788
813
|
}
|
|
789
814
|
});
|
|
790
815
|
} else {
|
|
791
816
|
this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
|
|
792
|
-
if (oldReferenceZd
|
|
817
|
+
if (oldReferenceZd === item.relationZd || oldReferenceZd2 === item.relationZd) {
|
|
793
818
|
if (!keys.includes(item.referenceZd)) {
|
|
794
819
|
delIndex.push(index);
|
|
795
820
|
} else {
|
|
@@ -806,7 +831,7 @@ modules = {
|
|
|
806
831
|
}
|
|
807
832
|
|
|
808
833
|
let oldKeys = this.szTaMb.szTaZdMbDTOs
|
|
809
|
-
.filter((item) => (referenceZd
|
|
834
|
+
.filter((item) => (referenceZd === item.relationZd || (referenceZd + "." + item.zdEn) === item.relationZd))
|
|
810
835
|
.map((item) => item.referenceZd);
|
|
811
836
|
let addReferenceShowFields = referenceShowFields.filter((item, index) => {
|
|
812
837
|
return !oldKeys.includes(referenceEntity + "." + item);
|
|
@@ -814,7 +839,7 @@ modules = {
|
|
|
814
839
|
|
|
815
840
|
let addIndex = -1;
|
|
816
841
|
let lastIndex = this.szTaMb.szTaZdMbDTOs.findLastIndex((item) => {
|
|
817
|
-
return referenceZd
|
|
842
|
+
return referenceZd === item.relationZd || (referenceZd + "." + item.zdEn) === item.relationZd;
|
|
818
843
|
});
|
|
819
844
|
addIndex = lastIndex >= 0 ? lastIndex + 1 : this.currentIndex + 1;
|
|
820
845
|
|
|
@@ -898,7 +923,7 @@ modules = {
|
|
|
898
923
|
confirmEntityDialog(rows) {
|
|
899
924
|
if (rows.length) {
|
|
900
925
|
let row = rows[0];
|
|
901
|
-
if (this.referenceEntity
|
|
926
|
+
if (this.referenceEntity !== row.taBm) {
|
|
902
927
|
this.referenceKey = null;
|
|
903
928
|
this.referenceShowFields = [];
|
|
904
929
|
}
|
|
@@ -979,7 +1004,7 @@ modules = {
|
|
|
979
1004
|
changeTaRule(val) {
|
|
980
1005
|
let treeDefaultZds = this.$baseLodash.cloneDeep(this.treeDefaultZds);
|
|
981
1006
|
let szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
|
|
982
|
-
if (val
|
|
1007
|
+
if (val === 1) {
|
|
983
1008
|
let zdEns = szTaZdMbDTOs
|
|
984
1009
|
.filter((item) => !!item.zdEn)
|
|
985
1010
|
.map((item) => item.zdEn);
|
|
@@ -1020,7 +1045,7 @@ modules = {
|
|
|
1020
1045
|
let szTaZdMbDTOs = this.szTaMb.szTaZdMbDTOs;
|
|
1021
1046
|
let value = 0;
|
|
1022
1047
|
let allOrders = szTaZdMbDTOs
|
|
1023
|
-
.filter((item) => item.orders
|
|
1048
|
+
.filter((item) => item.orders !== null && item.orders !== undefined)
|
|
1024
1049
|
.map((item) => item.orders);
|
|
1025
1050
|
szTaZdMbDTOs.forEach((item) => {
|
|
1026
1051
|
let orders = item.orders;
|
|
@@ -1034,7 +1059,7 @@ modules = {
|
|
|
1034
1059
|
getBdEnv() {
|
|
1035
1060
|
getBdFlag({
|
|
1036
1061
|
success: (res) => {
|
|
1037
|
-
this.isDev = res.objx
|
|
1062
|
+
this.isDev = res.objx === 1;
|
|
1038
1063
|
},
|
|
1039
1064
|
});
|
|
1040
1065
|
},
|
|
@@ -1160,14 +1185,14 @@ modules = {
|
|
|
1160
1185
|
let toTaBmZdField = null;
|
|
1161
1186
|
if (toTaBmZd) {
|
|
1162
1187
|
toTaBmZd.split(".").forEach((item, index) => {
|
|
1163
|
-
if (index
|
|
1188
|
+
if (index === 0) {
|
|
1164
1189
|
toTaBmZdEntity = item;
|
|
1165
|
-
} else if (index
|
|
1190
|
+
} else if (index === 1) {
|
|
1166
1191
|
toTaBmZdField = item;
|
|
1167
1192
|
}
|
|
1168
1193
|
});
|
|
1169
1194
|
} else {
|
|
1170
|
-
if (this.szTaMb.taType
|
|
1195
|
+
if (this.szTaMb.taType === 1 && this.szTaMb.sszstBm) {
|
|
1171
1196
|
toTaBmZdEntity = this.szTaMb.sszstBm;
|
|
1172
1197
|
}
|
|
1173
1198
|
}
|
|
@@ -1197,7 +1222,7 @@ modules = {
|
|
|
1197
1222
|
confirmEntityDialog3(rows) {
|
|
1198
1223
|
if (rows.length) {
|
|
1199
1224
|
let row = rows[0];
|
|
1200
|
-
if (this.toTaBmZdEntity
|
|
1225
|
+
if (this.toTaBmZdEntity !== row.taBm) {
|
|
1201
1226
|
this.toTaBmZdEntity = row.taBm;
|
|
1202
1227
|
this.toTaBmZdField = null;
|
|
1203
1228
|
}
|
|
@@ -1225,13 +1250,13 @@ modules = {
|
|
|
1225
1250
|
if(!this.fkey)return
|
|
1226
1251
|
let oldVal = this.preValue;
|
|
1227
1252
|
let newVal = val
|
|
1228
|
-
if (row.zdType
|
|
1253
|
+
if (this.isReferenceZdType(row.zdType)) {
|
|
1229
1254
|
let referenceZd = row.referenceZd;
|
|
1230
1255
|
if (referenceZd) {
|
|
1231
1256
|
let referenceZd2 = row.referenceZd + "." + oldVal
|
|
1232
1257
|
let relationZd = row.referenceZd + "." + newVal
|
|
1233
1258
|
this.szTaMb.szTaZdMbDTOs.forEach((item, index) => {
|
|
1234
|
-
if (referenceZd
|
|
1259
|
+
if (referenceZd === item.relationZd || referenceZd2 === item.relationZd) {
|
|
1235
1260
|
item.relationZd = relationZd;
|
|
1236
1261
|
}
|
|
1237
1262
|
});
|
|
@@ -1267,9 +1292,9 @@ modules = {
|
|
|
1267
1292
|
getHValue(row, column) {
|
|
1268
1293
|
if (row.hData && row.hData.id) {
|
|
1269
1294
|
let result = row.hData[column.property];
|
|
1270
|
-
if(column.property
|
|
1295
|
+
if(column.property === 'zdType'){
|
|
1271
1296
|
result = this.zdTypeMap[result]
|
|
1272
|
-
}else if(column.property
|
|
1297
|
+
}else if(column.property === 'treeFlag'){
|
|
1273
1298
|
result = this.treeFlagMap[result]
|
|
1274
1299
|
}
|
|
1275
1300
|
return result
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {selectDialogMixins} from "@base/mixins/selectDialog";
|
|
1
|
+
import { selectDialogMixins } from "@base/mixins/selectDialog";
|
|
2
2
|
|
|
3
3
|
let modules = {};
|
|
4
4
|
modules = {
|
|
5
|
-
name:
|
|
6
|
-
props: [
|
|
5
|
+
name: "zdDialog",
|
|
6
|
+
props: ["visiable", "multi", "rows", "param", "taBm"],
|
|
7
7
|
mixins: [selectDialogMixins],
|
|
8
8
|
components: {},
|
|
9
9
|
created() {
|
|
@@ -20,7 +20,7 @@ modules = {
|
|
|
20
20
|
formData: {},
|
|
21
21
|
vxeOption: {},
|
|
22
22
|
showSaleOrgDialog: false,
|
|
23
|
-
fieldKey: "taZdMc"
|
|
23
|
+
fieldKey: "taZdMc",
|
|
24
24
|
};
|
|
25
25
|
},
|
|
26
26
|
methods: {
|
|
@@ -28,85 +28,89 @@ modules = {
|
|
|
28
28
|
let that = this;
|
|
29
29
|
|
|
30
30
|
let zdTypeMap = {
|
|
31
|
-
Boolean: this.$t1(
|
|
32
|
-
Integer: this.$t1(
|
|
33
|
-
Long: this.$t1(
|
|
34
|
-
Decimal: this.$t1(
|
|
35
|
-
Money: this.$t1(
|
|
36
|
-
Text: this.$t1(
|
|
37
|
-
TextArea: this.$t1(
|
|
38
|
-
DateTime: this.$t1(
|
|
39
|
-
Reference: this.$t1(
|
|
40
|
-
|
|
31
|
+
Boolean: this.$t1("布尔"),
|
|
32
|
+
Integer: this.$t1("整数"),
|
|
33
|
+
Long: this.$t1("长整数"),
|
|
34
|
+
Decimal: this.$t1("精度小数"),
|
|
35
|
+
Money: this.$t1("金额"),
|
|
36
|
+
Text: this.$t1("文本"),
|
|
37
|
+
TextArea: this.$t1("长文本"),
|
|
38
|
+
DateTime: this.$t1("日期时间"),
|
|
39
|
+
Reference: this.$t1("关联表(文本)"),
|
|
40
|
+
ReferenceLong: this.$t1("关联表(长整型)"),
|
|
41
|
+
};
|
|
41
42
|
|
|
42
43
|
let tableOption = {
|
|
43
44
|
vue: that,
|
|
44
|
-
tableRef:
|
|
45
|
-
tableName:
|
|
46
|
-
path: USER_PREFIX +
|
|
45
|
+
tableRef: "table-m1",
|
|
46
|
+
tableName: "bd_table_model_field_dialog-m1",
|
|
47
|
+
path: USER_PREFIX + "/szTaMb/getSzTaZdMbsByTaBm",
|
|
47
48
|
param: () => {
|
|
48
49
|
return {
|
|
49
50
|
taBm: this.taBm,
|
|
50
51
|
enabled: true,
|
|
51
52
|
searchDb: true,
|
|
52
53
|
...this.formData,
|
|
53
|
-
...this.param
|
|
54
|
+
...this.param,
|
|
54
55
|
};
|
|
55
56
|
},
|
|
56
57
|
columns: [
|
|
57
|
-
{type:
|
|
58
|
+
{ type: "checkbox", width: 48, resizable: false, fixed: "left" },
|
|
58
59
|
{
|
|
59
|
-
title: this.$t1(
|
|
60
|
-
field:
|
|
61
|
-
width: 150
|
|
60
|
+
title: this.$t1("实体字段名称"),
|
|
61
|
+
field: "zdEn",
|
|
62
|
+
width: 150,
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
|
-
title: this.$t1(
|
|
65
|
-
field:
|
|
66
|
-
width: 150
|
|
65
|
+
title: this.$t1("数据库表字段名"),
|
|
66
|
+
field: "taZdMc",
|
|
67
|
+
width: 150,
|
|
67
68
|
},
|
|
68
69
|
{
|
|
69
|
-
title: this.$t1(
|
|
70
|
-
field:
|
|
71
|
-
width: 150
|
|
70
|
+
title: this.$t1("字段描述"),
|
|
71
|
+
field: "zdCh",
|
|
72
|
+
width: 150,
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
|
-
title: this.$t1(
|
|
75
|
-
|
|
75
|
+
title: this.$t1("字段类型"),
|
|
76
|
+
field: "zdType",
|
|
77
|
+
width: 150,
|
|
78
|
+
slots: {
|
|
79
|
+
default: ({ row, rowIndex, $table }) => {
|
|
76
80
|
return zdTypeMap[row.zdType];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
81
|
+
},
|
|
82
|
+
},
|
|
79
83
|
},
|
|
80
84
|
{
|
|
81
|
-
title: this.$t1(
|
|
82
|
-
field:
|
|
83
|
-
width: 150
|
|
85
|
+
title: this.$t1("关联字段"),
|
|
86
|
+
field: "referenceZd",
|
|
87
|
+
width: 150,
|
|
84
88
|
},
|
|
85
89
|
{
|
|
86
90
|
width: 47,
|
|
87
|
-
fixed:
|
|
88
|
-
title:
|
|
89
|
-
sortable: false
|
|
90
|
-
}
|
|
91
|
+
fixed: "right",
|
|
92
|
+
title: "",
|
|
93
|
+
sortable: false,
|
|
94
|
+
},
|
|
91
95
|
],
|
|
92
96
|
config: {
|
|
93
97
|
checkboxConfig: {
|
|
94
98
|
checkStrictly: true,
|
|
95
99
|
showHeader: this.selectMulti,
|
|
96
|
-
trigger:
|
|
100
|
+
trigger: "row",
|
|
97
101
|
},
|
|
98
102
|
proxyConfig: {
|
|
99
103
|
props: {
|
|
100
104
|
result: "objx", // 配置响应结果列表字段
|
|
101
105
|
total: "objx.length", // 配置响应结果总页数字段
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
105
109
|
};
|
|
106
|
-
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
|
110
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
|
107
111
|
that.vxeOption = opts;
|
|
108
112
|
});
|
|
109
113
|
},
|
|
110
|
-
}
|
|
114
|
+
},
|
|
111
115
|
};
|
|
112
|
-
export default modules
|
|
116
|
+
export default modules;
|