cloud-web-corejs 1.0.54-dev.696 → 1.0.54-dev.697

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.696",
4
+ "version": "1.0.54-dev.697",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -35,6 +35,126 @@ function parseExportContent(content) {
35
35
  }
36
36
  }
37
37
 
38
+ function uniqueFileName(fileName, usedNames) {
39
+ if (!usedNames[fileName]) {
40
+ usedNames[fileName] = 1;
41
+ return fileName;
42
+ }
43
+ usedNames[fileName] += 1;
44
+ return `${fileName}_${usedNames[fileName]}`;
45
+ }
46
+
47
+ export const EXPORT_ARCHIVE_TYPES = {
48
+ FORM_SCRIPT: "formScript",
49
+ FORM_TEMPLATE: "formTemplate",
50
+ TABLE: "table",
51
+ };
52
+
53
+ export function getExportArchiveType(url) {
54
+ if (!url) return null;
55
+ if (url.includes("/form_develop/exportFormScript")) {
56
+ return EXPORT_ARCHIVE_TYPES.FORM_SCRIPT;
57
+ }
58
+ if (url.includes("/form_develop/exportFormTemplate")) {
59
+ return EXPORT_ARCHIVE_TYPES.FORM_TEMPLATE;
60
+ }
61
+ if (url.includes("/form_develop/exportSzTaMb")) {
62
+ return EXPORT_ARCHIVE_TYPES.TABLE;
63
+ }
64
+ return null;
65
+ }
66
+
67
+ function getFormScriptArchivePrefix(item) {
68
+ const scriptCode = item.scriptCode || "script";
69
+ const formCode = item.formCode;
70
+ return formCode ? `S-${scriptCode}-${formCode}` : `S-${scriptCode}`;
71
+ }
72
+
73
+ function processFormScriptArchiveItem(item) {
74
+ const prefix = getFormScriptArchivePrefix(item);
75
+ const extraFiles = [];
76
+
77
+ if (!isNull(item.script)) {
78
+ const formatted = formatJsonContent(item.script);
79
+ item.script = formatted;
80
+ extraFiles.push({
81
+ fileName: `${prefix}-Item`,
82
+ content: formatted,
83
+ });
84
+ }
85
+
86
+ return {
87
+ mainContent: JSON.stringify(item, null, 2),
88
+ mainFileName: `${prefix}-Source`,
89
+ extraFiles,
90
+ };
91
+ }
92
+
93
+ function processFormTemplateArchiveItem(item) {
94
+ const formCode = item.formCode || "form";
95
+ const extraFiles = [];
96
+ const usedNames = {};
97
+
98
+ if (!isNull(item.formViewContent)) {
99
+ const formatted = formatJsonContent(item.formViewContent);
100
+ item.formViewContent = formatted;
101
+ extraFiles.push({
102
+ fileName: uniqueFileName(`F-${formCode}-Item`, usedNames),
103
+ content: formatted,
104
+ });
105
+ }
106
+
107
+ const formScriptDTOs = item.formScriptDTOs || [];
108
+ formScriptDTOs.forEach((scriptItem) => {
109
+ if (!scriptItem || isNull(scriptItem.script)) return;
110
+ const scriptCode = scriptItem.scriptCode || "script";
111
+ const scriptFormCode = scriptItem.formCode || formCode;
112
+ const formatted = formatJsonContent(scriptItem.script);
113
+ scriptItem.script = formatted;
114
+ extraFiles.push({
115
+ fileName: uniqueFileName(
116
+ `FS-${scriptCode}-${scriptFormCode}-Item`,
117
+ usedNames
118
+ ),
119
+ content: formatted,
120
+ });
121
+ });
122
+
123
+ return {
124
+ mainContent: JSON.stringify(item, null, 2),
125
+ mainFileName: `F-${formCode}-Source`,
126
+ extraFiles,
127
+ };
128
+ }
129
+
130
+ function processTableArchiveItem(item) {
131
+ const taBm = item.taBm || "table";
132
+ return {
133
+ mainContent: JSON.stringify(item, null, 2),
134
+ mainFileName: `T-${taBm}`,
135
+ extraFiles: [],
136
+ };
137
+ }
138
+
139
+ export function processArchiveExport(content, archiveType) {
140
+ const { list, invalid } = parseExportContent(content);
141
+ if (invalid || !list.length) {
142
+ return { mainContent: content, mainFileName: null, extraFiles: [] };
143
+ }
144
+
145
+ const item = list[0];
146
+ switch (archiveType) {
147
+ case EXPORT_ARCHIVE_TYPES.FORM_SCRIPT:
148
+ return processFormScriptArchiveItem(item);
149
+ case EXPORT_ARCHIVE_TYPES.FORM_TEMPLATE:
150
+ return processFormTemplateArchiveItem(item);
151
+ case EXPORT_ARCHIVE_TYPES.TABLE:
152
+ return processTableArchiveItem(item);
153
+ default:
154
+ return { mainContent: content, mainFileName: null, extraFiles: [] };
155
+ }
156
+ }
157
+
38
158
  export function getExportExtraConfig(url, options = {}) {
39
159
  if (options.extraExport) {
40
160
  return options.extraExport;
@@ -44,11 +164,8 @@ export function getExportExtraConfig(url, options = {}) {
44
164
  return {
45
165
  field: "script",
46
166
  getExtraFileName(item) {
47
- const scriptCode = item.scriptCode || "script";
48
- const formCode = item.formCode;
49
- return formCode
50
- ? `${scriptCode} - ${formCode} - item(script)`
51
- : `${scriptCode} - item(script)`;
167
+ const prefix = getFormScriptArchivePrefix(item);
168
+ return `${prefix}-Item`;
52
169
  },
53
170
  };
54
171
  }
@@ -56,7 +173,7 @@ export function getExportExtraConfig(url, options = {}) {
56
173
  return {
57
174
  field: "formViewContent",
58
175
  getExtraFileName(item) {
59
- return `${item.formCode || "form"} - item(form)`;
176
+ return `F-${item.formCode || "form"}-Item`;
60
177
  },
61
178
  };
62
179
  }
@@ -87,14 +204,25 @@ export function processExportContent(content, extraConfig) {
87
204
  let fileName = getExtraFileName(item, index);
88
205
  if (!fileName) return;
89
206
 
90
- if (usedNames[fileName]) {
91
- usedNames[fileName] += 1;
92
- fileName = `${fileName}_${usedNames[fileName]}`;
93
- } else {
94
- usedNames[fileName] = 1;
95
- }
96
-
207
+ fileName = uniqueFileName(fileName, usedNames);
97
208
  extraFiles.push({ fileName, content: formatted });
209
+
210
+ if (field === "formViewContent" && Array.isArray(item.formScriptDTOs)) {
211
+ item.formScriptDTOs.forEach((scriptItem) => {
212
+ if (!scriptItem || isNull(scriptItem.script)) return;
213
+ const scriptCode = scriptItem.scriptCode || "script";
214
+ const formCode = scriptItem.formCode || item.formCode || "form";
215
+ const scriptFormatted = formatJsonContent(scriptItem.script);
216
+ scriptItem.script = scriptFormatted;
217
+ extraFiles.push({
218
+ fileName: uniqueFileName(
219
+ `FS-${scriptCode}-${formCode}-Item`,
220
+ usedNames
221
+ ),
222
+ content: scriptFormatted,
223
+ });
224
+ });
225
+ }
98
226
  });
99
227
 
100
228
  const mainContent = JSON.stringify(isArray ? list : list[0], null, 2);
@@ -5,7 +5,9 @@ import exportDialog from "./exportDialog.vue";
5
5
  import { getBdEnv } from "@base/api/user";
6
6
  import { encrypt, decrypt } from "@base/utils/aes";
7
7
  import {
8
+ getExportArchiveType,
8
9
  getExportExtraConfig,
10
+ processArchiveExport,
9
11
  processExportContent,
10
12
  } from "./exportUtil";
11
13
 
@@ -102,27 +104,34 @@ moudule.install = function (Vue) {
102
104
  let content = res.objx;
103
105
  if (content && content !== "[]") {
104
106
  let fileName;
105
- if (options.fileName) {
106
- fileName = options.fileName;
107
- } else {
108
- let timeStr = res.time
109
- .replaceAll(":", "")
110
- .replaceAll("-", "")
111
- .replaceAll(" ", "");
112
- fileName = options.title + "(" + timeStr + ")";
113
- }
114
- const extraConfig = getExportExtraConfig(options.url, options);
115
- if (extraConfig) {
116
- const processed = processExportContent(content, extraConfig);
107
+ const archiveType = options.plaintext
108
+ && getExportArchiveType(options.url);
109
+
110
+ if (archiveType) {
111
+ const processed = processArchiveExport(content, archiveType);
117
112
  content = processed.mainContent;
118
- const extraFiles = resolveExtraFileNames(
119
- processed.extraFiles,
120
- options.fileName
121
- );
113
+ fileName = processed.mainFileName || options.fileName;
122
114
  downloadTxt(fileName, content);
123
- downloadExtraFiles(extraFiles);
115
+ downloadExtraFiles(processed.extraFiles);
124
116
  } else {
125
- downloadTxt(fileName, content);
117
+ if (options.fileName) {
118
+ fileName = options.fileName;
119
+ } else {
120
+ let timeStr = res.time
121
+ .replaceAll(":", "")
122
+ .replaceAll("-", "")
123
+ .replaceAll(" ", "");
124
+ fileName = options.title + "(" + timeStr + ")";
125
+ }
126
+ const extraConfig = getExportExtraConfig(options.url, options);
127
+ if (extraConfig) {
128
+ const processed = processExportContent(content, extraConfig);
129
+ content = processed.mainContent;
130
+ downloadTxt(fileName, content);
131
+ downloadExtraFiles(processed.extraFiles);
132
+ } else {
133
+ downloadTxt(fileName, content);
134
+ }
126
135
  }
127
136
  } else {
128
137
  this.$baseAlert(this.$t1("不存在需要导出的数据"));
@@ -161,19 +170,6 @@ moudule.install = function (Vue) {
161
170
  };
162
171
  };
163
172
 
164
- function resolveExtraFileNames(extraFiles, mainFileName) {
165
- if (!extraFiles || !extraFiles.length) return [];
166
- return extraFiles.map((file) => {
167
- if (mainFileName && file.fileName === mainFileName) {
168
- return {
169
- ...file,
170
- fileName: `${file.fileName}-content`,
171
- };
172
- }
173
- return file;
174
- });
175
- }
176
-
177
173
  function downloadExtraFiles(extraFiles) {
178
174
  if (!extraFiles || !extraFiles.length) return;
179
175
  extraFiles.forEach((file, index) => {
@@ -142,9 +142,15 @@
142
142
  :key="'menuModule' + menuModule.id"
143
143
  @click.native="rourteTo(menuModule)"
144
144
  >
145
- <i :class="getMenuClass(menuModule, 1)" v-if="menuModule.children.length <= 0"></i>
145
+ <i
146
+ :class="getMenuClass(menuModule, 1)"
147
+ v-if="menuModule.children.length <= 0"
148
+ ></i>
146
149
  <template slot="title">
147
- <i :class="getMenuClass(menuModule, 1)" v-if="menuModule.children.length > 0"></i>
150
+ <i
151
+ :class="getMenuClass(menuModule, 1)"
152
+ v-if="menuModule.children.length > 0"
153
+ ></i>
148
154
  <span>{{ getMenuName(menuModule) }}</span>
149
155
  </template>
150
156
  <component
@@ -173,7 +179,7 @@
173
179
  </el-menu-item>
174
180
  </component>
175
181
  </component>
176
- <el-menu-item
182
+ <!-- <el-menu-item
177
183
  @click.native="openCreateCompanyDialog"
178
184
  index="xx"
179
185
  v-if="isFormDev"
@@ -182,7 +188,7 @@
182
188
  <i :class="getMenuClass({}, 1)"></i>
183
189
  <span>新建企业</span>
184
190
  </template>
185
- </el-menu-item>
191
+ </el-menu-item> -->
186
192
  </el-scrollbar>
187
193
  </el-menu>
188
194
  <div class="menu-btn">
@@ -797,7 +803,7 @@ export default {
797
803
  if (sh >= 0) {
798
804
  $snav.style["margin-top"] = sh1 + "px";
799
805
  } else if (sh < 0) {
800
- let bd = sh1 + sh ;
806
+ let bd = sh1 + sh;
801
807
 
802
808
  $snav.style["margin-top"] = bd + "px";
803
809
  $snav.querySelector(".ico-arrow").style["margin-top"] =
@@ -1057,30 +1063,49 @@ export default {
1057
1063
  position: relative;
1058
1064
  background-color: rgba(0, 0, 0, 0.2);
1059
1065
  word-break: break-word;
1060
- .el-scrollbar__view >{
1061
- .el-menu-item{padding:0 11px !important;
1062
- span{font-size:14px;}
1066
+ .el-scrollbar__view > {
1067
+ .el-menu-item {
1068
+ padding: 0 11px !important;
1069
+ span {
1070
+ font-size: 14px;
1071
+ }
1063
1072
  }
1064
- .el-submenu > .el-submenu__title{padding:0 11px !important;
1065
- span{font-size:14px;}
1066
- ~ .el-menu{
1067
- padding:5px 0;display: grid;
1068
- > .el-menu-item{
1069
- span{line-height:1.4;height: 26px;}
1073
+ .el-submenu > .el-submenu__title {
1074
+ padding: 0 11px !important;
1075
+ span {
1076
+ font-size: 14px;
1077
+ }
1078
+ ~ .el-menu {
1079
+ padding: 5px 0;
1080
+ display: grid;
1081
+ > .el-menu-item {
1082
+ span {
1083
+ line-height: 1.4;
1084
+ height: 26px;
1085
+ }
1070
1086
  }
1071
- .el-submenu.is-opened .el-submenu__title{background-color:#FFF;opacity:1;
1072
- span{color:$baseColor;}
1073
- i.iconfont{color:$baseColor}
1087
+ .el-submenu.is-opened .el-submenu__title {
1088
+ background-color: #fff;
1089
+ opacity: 1;
1090
+ span {
1091
+ color: $baseColor;
1092
+ }
1093
+ i.iconfont {
1094
+ color: $baseColor;
1095
+ }
1074
1096
  }
1075
1097
  }
1076
-
1077
1098
  }
1078
1099
  }
1079
- .el-submenu__title,.el-menu-item {
1100
+ .el-submenu__title,
1101
+ .el-menu-item {
1080
1102
  padding: 0 11px;
1081
1103
  height: 48px;
1082
1104
  line-height: 48px;
1083
- &:hover,&.is-active{background-color:rgba(0, 0, 0, 0.29)}
1105
+ &:hover,
1106
+ &.is-active {
1107
+ background-color: rgba(0, 0, 0, 0.29);
1108
+ }
1084
1109
  i {
1085
1110
  color: #fff;
1086
1111
  font-size: 13px;
@@ -1119,18 +1144,22 @@ export default {
1119
1144
  &.is-opened .el-submenu__title {
1120
1145
  //background-color: rgba(27, 66, 97) !important;
1121
1146
  }
1122
- .el-submenu .el-menu{display:none}
1147
+ .el-submenu .el-menu {
1148
+ display: none;
1149
+ }
1123
1150
  }
1124
1151
 
1125
1152
  .el-submenu {
1126
- &.is-opened{
1127
- > .el-submenu__title{background-color:rgba(0, 0, 0, 0.29)}
1153
+ &.is-opened {
1154
+ > .el-submenu__title {
1155
+ background-color: rgba(0, 0, 0, 0.29);
1156
+ }
1128
1157
  }
1129
1158
  .el-menu {
1130
1159
  background: rgba(0, 0, 0, 0.35);
1131
1160
  box-shadow: 0px -5px 8px #00000014 inset;
1132
1161
  //padding:4px 0;
1133
- .el-submenu__title{
1162
+ .el-submenu__title {
1134
1163
  height: auto;
1135
1164
  line-height: 1.4;
1136
1165
  font-size: 12px;
@@ -1164,13 +1193,18 @@ export default {
1164
1193
  zoom: 0.8;
1165
1194
  display: none;
1166
1195
  }
1167
- span{height:auto;text-align: left !important;}
1196
+ span {
1197
+ height: auto;
1198
+ text-align: left !important;
1199
+ }
1168
1200
  &:hover,
1169
1201
  &.on {
1170
1202
  opacity: 1;
1171
1203
  background-color: #fbfdfe !important;
1172
1204
  color: $baseColor !important;
1173
- i.iconfont{color:$baseColor}
1205
+ i.iconfont {
1206
+ color: $baseColor;
1207
+ }
1174
1208
  .el-icon-arrow-right {
1175
1209
  color: $baseColor;
1176
1210
  }
@@ -1178,7 +1212,7 @@ export default {
1178
1212
  }
1179
1213
  }
1180
1214
 
1181
- .el-menu-item{
1215
+ .el-menu-item {
1182
1216
  height: auto;
1183
1217
  line-height: 1.4;
1184
1218
  padding-left: 33px !important;
@@ -1201,7 +1235,7 @@ export default {
1201
1235
  line-height: 20px;
1202
1236
  left: 7px;
1203
1237
  font-size: 18px;
1204
- color:#D0D6DB;
1238
+ color: #d0d6db;
1205
1239
  }
1206
1240
 
1207
1241
  [class^="el-icon-"] {
@@ -1214,7 +1248,6 @@ export default {
1214
1248
  width: 14px;
1215
1249
  zoom: 0.8;
1216
1250
  display: none;
1217
-
1218
1251
  }
1219
1252
 
1220
1253
  &:hover,
@@ -1223,7 +1256,8 @@ export default {
1223
1256
  background-color: #fbfdfe !important;
1224
1257
  color: $baseColor !important;
1225
1258
 
1226
- .el-icon-arrow-right,i.iconfont {
1259
+ .el-icon-arrow-right,
1260
+ i.iconfont {
1227
1261
  color: $baseColor;
1228
1262
  }
1229
1263
  }
@@ -1546,46 +1580,61 @@ export default {
1546
1580
  // .el-submenu .el-menu {
1547
1581
  // height: auto !important;
1548
1582
  // }
1549
- .el-menu--vertical{
1550
- > .el-menu--popup{overflow: auto;//不用atuo 超出不出滚动条
1551
- .el-submenu__title, .el-menu-item{
1552
- height: auto !important;
1553
- line-height: 1.4 !important;
1554
- padding: 8px 0;
1555
- text-align: left;
1556
- white-space: normal;
1557
- word-break: break-word;
1558
- background:none;
1559
- i.iconfont{color:#FFF;margin-right:8px;}
1583
+ .el-menu--vertical {
1584
+ > .el-menu--popup {
1585
+ overflow: auto; //不用atuo 超出不出滚动条
1586
+ .el-submenu__title,
1587
+ .el-menu-item {
1588
+ height: auto !important;
1589
+ line-height: 1.4 !important;
1590
+ padding: 8px 0;
1591
+ text-align: left;
1592
+ white-space: normal;
1593
+ word-break: break-word;
1594
+ background: none;
1595
+ i.iconfont {
1596
+ color: #fff;
1597
+ margin-right: 8px;
1560
1598
  }
1561
- }
1562
- .el-submenu{
1563
- .el-submenu__title{
1564
- .el-submenu__icon-arrow{display:none}
1565
1599
  }
1566
- &:hover{
1567
- .el-submenu__title{
1600
+ }
1601
+ .el-submenu {
1602
+ .el-submenu__title {
1603
+ .el-submenu__icon-arrow {
1604
+ display: none;
1605
+ }
1606
+ }
1607
+ &:hover {
1608
+ .el-submenu__title {
1568
1609
  background-color: rgba(0, 0, 0, 0.29) !important;
1569
- i.iconfont{color:$baseColor}
1610
+ i.iconfont {
1611
+ color: $baseColor;
1612
+ }
1570
1613
  }
1571
1614
  }
1572
1615
 
1573
- &.is-opened{
1574
- .el-submenu__title{
1616
+ &.is-opened {
1617
+ .el-submenu__title {
1575
1618
  background-color: rgba(0, 0, 0, 0.29) !important;
1576
- i.iconfont{color:$baseColor}
1619
+ i.iconfont {
1620
+ color: $baseColor;
1621
+ }
1577
1622
  }
1578
1623
  }
1579
1624
  }
1580
- .el-menu-item{
1581
- &:hover{
1582
- background-color: rgba(0, 0, 0, 0.29) !important;
1583
- i.iconfont{color:$baseColor}
1625
+ .el-menu-item {
1626
+ &:hover {
1627
+ background-color: rgba(0, 0, 0, 0.29) !important;
1628
+ i.iconfont {
1629
+ color: $baseColor;
1630
+ }
1584
1631
  }
1585
1632
 
1586
- &.is-opened{
1587
- background-color: rgba(0, 0, 0, 0.29) !important;
1588
- i.iconfont{color:$baseColor}
1633
+ &.is-opened {
1634
+ background-color: rgba(0, 0, 0, 0.29) !important;
1635
+ i.iconfont {
1636
+ color: $baseColor;
1637
+ }
1589
1638
  }
1590
1639
  }
1591
1640
  // .el-menu-item{
@@ -286,9 +286,6 @@ modules = {
286
286
  data: [row.id],
287
287
  url: USER_PREFIX + "/form_develop/exportFormScript",
288
288
  plaintext: 1,
289
- fileName: row.formCode
290
- ? `${row.scriptCode} - ${row.formCode}(script)`
291
- : `${row.scriptCode}(script)`,
292
289
  abcEnabled: true,
293
290
  });
294
291
  },
@@ -487,7 +487,6 @@ modules = {
487
487
  data: [row.id],
488
488
  url: USER_PREFIX + "/form_develop/exportFormScript",
489
489
  plaintext: 1,
490
- fileName: `${row.scriptCode} - ${row.formCode}(script)`,
491
490
  abcEnabled: true,
492
491
  editAuth: this.currentFormType.editAuth,
493
492
  selectTypeAuth: this.currentFormType.selectTypeAuth,
@@ -696,7 +696,6 @@ modules = {
696
696
  data: [row.id],
697
697
  url: USER_PREFIX + "/form_develop/exportFormTemplate",
698
698
  plaintext: 1,
699
- fileName: row.formCode + "(form)",
700
699
  abcEnabled: true,
701
700
  editAuth: this.currentFormType.editAuth,
702
701
  selectTypeAuth: this.currentFormType.selectTypeAuth,
@@ -450,7 +450,6 @@ modules = {
450
450
  data: [row.id],
451
451
  url: USER_PREFIX + "/form_develop/exportSzTaMb",
452
452
  plaintext: 1,
453
- fileName: row.taBm + "(table)",
454
453
  abcEnabled: true,
455
454
  editAuth: this.currentFormType.editAuth,
456
455
  selectTypeAuth: this.currentFormType.selectTypeAuth,