cloud-web-corejs 1.0.54-dev.690 → 1.0.54-dev.693

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.690",
4
+ "version": "1.0.54-dev.693",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
package/src/api/user.js CHANGED
@@ -119,6 +119,14 @@ export function getLoginConfig(option) {
119
119
  });
120
120
  }
121
121
 
122
+ export function getLogicParamValue(option) {
123
+ return request({
124
+ url: USER_PREFIX + "/logic_param/getParamValue",
125
+ method: "post",
126
+ ...option,
127
+ });
128
+ }
129
+
122
130
  export function getIdmLoginUrl(option) {
123
131
  return request({
124
132
  url: USER_PREFIX + "/auth/idmLoginUrl",
@@ -1112,13 +1112,18 @@ export default {
1112
1112
  const next = Object.assign({}, row);
1113
1113
  const orig = widgetMap[next.columnId];
1114
1114
  if (orig) {
1115
- if (!next.widget && orig.widget) {
1115
+ // formatS 未变更时补回 widget,避免清空 formatS 后又被快照还原
1116
+ const formatUnchanged = next.formatS === orig.formatS;
1117
+ const editFormatUnchanged = next.editFormatS === orig.editFormatS;
1118
+ if (formatUnchanged && !next.widget && orig.widget) {
1116
1119
  next.widget = orig.widget;
1117
1120
  }
1118
- if (!next.editWidget && orig.editWidget) {
1121
+ if (editFormatUnchanged && !next.editWidget && orig.editWidget) {
1119
1122
  next.editWidget = orig.editWidget;
1120
1123
  }
1121
1124
  if (
1125
+ formatUnchanged &&
1126
+ next.formatS === "widgetRender" &&
1122
1127
  (!next.widgetList || !next.widgetList.length) &&
1123
1128
  orig.widgetList &&
1124
1129
  orig.widgetList.length
@@ -48,7 +48,7 @@ export const containers = [
48
48
  // anchor 模式:插入位置 replace=替换占位行 / before=占位行之前 / after=占位行之后
49
49
  dynamicSchemaAnchorPosition: "replace",
50
50
  // anchor 模式:是否继承占位行的列布局(单元格数量/宽度/跨列),否则按 dynamicSchemaColumns 平铺
51
- dynamicSchemaInheritLayout: true,
51
+ dynamicSchemaInheritLayout: false,
52
52
  ...defaultWfConfig,
53
53
  },
54
54
  },
@@ -3717,6 +3717,7 @@ export const advancedFields = [
3717
3717
 
3718
3718
  ...httpConfig,
3719
3719
  ...defaultWfConfig,
3720
+ formScriptEnabled: false,
3720
3721
  //-------------------
3721
3722
  onCreated: "",
3722
3723
  onMounted: "",
@@ -1,148 +1,148 @@
1
- import {
2
- isEmptyStr,
3
- isEmptyArrayFieldValue,
4
- isArrayValueWidgetType,
5
- isVabsearchWidgetType,
6
- isVabsearchMultiWidget,
7
- } from "./util";
8
- import { resolveColumnRequiredFlag } from "./tableColumnHelper";
9
-
10
- /** 数据表格行内字段候选 key(column.prop 为权威存储字段) */
11
- export function getCellFieldKeys(fieldWidget, columnConfig) {
12
- const keys = [];
13
- const addKey = (key) => {
14
- if (key && !keys.includes(key)) {
15
- keys.push(key);
16
- }
17
- };
18
-
19
- addKey(columnConfig?.prop);
20
-
21
- if (!fieldWidget) {
22
- return keys;
23
- }
24
-
25
- const options = fieldWidget.options || {};
26
- if (
27
- isVabsearchWidgetType(fieldWidget.type) &&
28
- !isVabsearchMultiWidget(fieldWidget)
29
- ) {
30
- addKey(options.vabSearchName);
31
- addKey(getWidgetFieldKey(fieldWidget));
32
- } else {
33
- addKey(getWidgetFieldKey(fieldWidget));
34
- }
35
-
36
- return keys;
37
- }
38
-
39
- export function getCellFieldKey(fieldWidget, columnConfig) {
40
- const keys = getCellFieldKeys(fieldWidget, columnConfig);
41
- return keys.length ? keys[0] : null;
42
- }
43
-
44
- export function getWidgetFieldKey(widget) {
45
- if (!widget?.options) {
46
- return null;
47
- }
48
- const o = widget.options.name;
49
- return (widget.options.keyNameEnabled && widget.options.keyName) || o;
50
- }
51
-
52
- export function isCellFieldRequired(columnConfig, fieldWidget) {
53
- if (!fieldWidget || fieldWidget.options?.hidden) {
54
- return false;
55
- }
56
- if (fieldWidget.options?.required) {
57
- return true;
58
- }
59
- return resolveColumnRequiredFlag(columnConfig);
60
- }
61
-
62
- export function shouldSkipCellValidation(fieldWidget) {
63
- if (!fieldWidget) {
64
- return true;
65
- }
66
- if (fieldWidget.options?.hidden) {
67
- return true;
68
- }
69
- if (fieldWidget.options?.disabled) {
70
- return true;
71
- }
72
- return false;
73
- }
74
-
75
- export function isEmptyCellValue(fieldWidget, value) {
76
- if (!fieldWidget) {
77
- return false;
78
- }
79
- const type = fieldWidget.type;
80
- const options = fieldWidget.options || {};
81
-
82
- if (type === "number") {
83
- return value === null || value === undefined || value === "";
84
- }
85
-
86
- if (isArrayValueWidgetType(type, options)) {
87
- return isEmptyArrayFieldValue(value, type, options);
88
- }
89
-
90
- if (type === "select" || type === "radio" || type === "status") {
91
- if (value === null || value === undefined || value === "") {
92
- return true;
93
- }
94
- if (typeof value === "string" && !/[^\s]/.test(value)) {
95
- return true;
96
- }
97
- return false;
98
- }
99
-
100
- return isEmptyStr(value);
101
- }
102
-
103
- /** 从行数据中读取单元格值(兼容 column.prop 与 widget 字段名不一致) */
104
- export function getCellValueFromRow(row, fieldWidget, columnConfig) {
105
- if (!row) {
106
- return undefined;
107
- }
108
- const keys = getCellFieldKeys(fieldWidget, columnConfig);
109
- if (!keys.length) {
110
- return undefined;
111
- }
112
- let fallbackValue;
113
- for (const key of keys) {
114
- const value = row[key];
115
- if (fallbackValue === undefined) {
116
- fallbackValue = value;
117
- }
118
- if (!isEmptyCellValue(fieldWidget, value)) {
119
- return value;
120
- }
121
- }
122
- return fallbackValue;
123
- }
124
-
125
- export function isEmptyCellValueInRow(row, fieldWidget, columnConfig) {
126
- return isEmptyCellValue(
127
- fieldWidget,
128
- getCellValueFromRow(row, fieldWidget, columnConfig)
129
- );
130
- }
131
-
132
- export function buildCellRequiredHint(fieldWidget, columnConfig, t1Fn) {
133
- const options = fieldWidget?.options || {};
134
- if (options.requiredHint) {
135
- return t1Fn(options.requiredHint);
136
- }
137
- const label = t1Fn(
138
- options.label || columnConfig?.label || columnConfig?.prop || ""
139
- );
140
- return t1Fn("[{label}]不能为空", { label });
141
- }
142
-
143
- export function buildTableCellFormProp(tableFieldKeyName, rowIndex, fieldKey) {
144
- if (!tableFieldKeyName || !fieldKey || rowIndex < 0) {
145
- return null;
146
- }
147
- return `${tableFieldKeyName}.${rowIndex}.${fieldKey}`;
148
- }
1
+ import {
2
+ isEmptyStr,
3
+ isEmptyArrayFieldValue,
4
+ isArrayValueWidgetType,
5
+ isVabsearchWidgetType,
6
+ isVabsearchMultiWidget,
7
+ } from "./util";
8
+ import { resolveColumnRequiredFlag } from "./tableColumnHelper";
9
+
10
+ /** 数据表格行内字段候选 key(column.prop 为权威存储字段) */
11
+ export function getCellFieldKeys(fieldWidget, columnConfig) {
12
+ const keys = [];
13
+ const addKey = (key) => {
14
+ if (key && !keys.includes(key)) {
15
+ keys.push(key);
16
+ }
17
+ };
18
+
19
+ addKey(columnConfig?.prop);
20
+
21
+ if (!fieldWidget) {
22
+ return keys;
23
+ }
24
+
25
+ const options = fieldWidget.options || {};
26
+ if (
27
+ isVabsearchWidgetType(fieldWidget.type) &&
28
+ !isVabsearchMultiWidget(fieldWidget)
29
+ ) {
30
+ addKey(options.vabSearchName);
31
+ addKey(getWidgetFieldKey(fieldWidget));
32
+ } else {
33
+ addKey(getWidgetFieldKey(fieldWidget));
34
+ }
35
+
36
+ return keys;
37
+ }
38
+
39
+ export function getCellFieldKey(fieldWidget, columnConfig) {
40
+ const keys = getCellFieldKeys(fieldWidget, columnConfig);
41
+ return keys.length ? keys[0] : null;
42
+ }
43
+
44
+ export function getWidgetFieldKey(widget) {
45
+ if (!widget?.options) {
46
+ return null;
47
+ }
48
+ const o = widget.options.name;
49
+ return (widget.options.keyNameEnabled && widget.options.keyName) || o;
50
+ }
51
+
52
+ export function isCellFieldRequired(columnConfig, fieldWidget) {
53
+ if (!fieldWidget || fieldWidget.options?.hidden) {
54
+ return false;
55
+ }
56
+ if (fieldWidget.options?.required) {
57
+ return true;
58
+ }
59
+ return resolveColumnRequiredFlag(columnConfig);
60
+ }
61
+
62
+ export function shouldSkipCellValidation(fieldWidget) {
63
+ if (!fieldWidget) {
64
+ return true;
65
+ }
66
+ if (fieldWidget.options?.hidden) {
67
+ return true;
68
+ }
69
+ if (fieldWidget.options?.disabled) {
70
+ return true;
71
+ }
72
+ return false;
73
+ }
74
+
75
+ export function isEmptyCellValue(fieldWidget, value) {
76
+ if (!fieldWidget) {
77
+ return false;
78
+ }
79
+ const type = fieldWidget.type;
80
+ const options = fieldWidget.options || {};
81
+
82
+ if (type === "number") {
83
+ return value === null || value === undefined || value === "";
84
+ }
85
+
86
+ if (isArrayValueWidgetType(type, options)) {
87
+ return isEmptyArrayFieldValue(value, type, options);
88
+ }
89
+
90
+ if (type === "select" || type === "radio" || type === "status") {
91
+ if (value === null || value === undefined || value === "") {
92
+ return true;
93
+ }
94
+ if (typeof value === "string" && !/[^\s]/.test(value)) {
95
+ return true;
96
+ }
97
+ return false;
98
+ }
99
+
100
+ return isEmptyStr(value);
101
+ }
102
+
103
+ /** 从行数据中读取单元格值(兼容 column.prop 与 widget 字段名不一致) */
104
+ export function getCellValueFromRow(row, fieldWidget, columnConfig) {
105
+ if (!row) {
106
+ return undefined;
107
+ }
108
+ const keys = getCellFieldKeys(fieldWidget, columnConfig);
109
+ if (!keys.length) {
110
+ return undefined;
111
+ }
112
+ let fallbackValue;
113
+ for (const key of keys) {
114
+ const value = row[key];
115
+ if (fallbackValue === undefined) {
116
+ fallbackValue = value;
117
+ }
118
+ if (!isEmptyCellValue(fieldWidget, value)) {
119
+ return value;
120
+ }
121
+ }
122
+ return fallbackValue;
123
+ }
124
+
125
+ export function isEmptyCellValueInRow(row, fieldWidget, columnConfig) {
126
+ return isEmptyCellValue(
127
+ fieldWidget,
128
+ getCellValueFromRow(row, fieldWidget, columnConfig)
129
+ );
130
+ }
131
+
132
+ export function buildCellRequiredHint(fieldWidget, columnConfig, t1Fn) {
133
+ const options = fieldWidget?.options || {};
134
+ if (options.requiredHint) {
135
+ return t1Fn(options.requiredHint);
136
+ }
137
+ const label = t1Fn(
138
+ options.label || columnConfig?.label || columnConfig?.prop || ""
139
+ );
140
+ return t1Fn("[{label}]不能为空", { label });
141
+ }
142
+
143
+ export function buildTableCellFormProp(tableFieldKeyName, rowIndex, fieldKey) {
144
+ if (!tableFieldKeyName || !fieldKey || rowIndex < 0) {
145
+ return null;
146
+ }
147
+ return `${tableFieldKeyName}.${rowIndex}.${fieldKey}`;
148
+ }
package/src/utils/vab.js CHANGED
@@ -42,6 +42,7 @@ const FILE_ICON_NAME_MAP = {
42
42
  txt: "ico-txt.svg",
43
43
  java: "ico-java.svg",
44
44
  vue: "ico-vue.svg",
45
+ ftl: "ico-ftl.svg",
45
46
  xml: "ico-xml.svg",
46
47
  flash: "ico-flash.svg",
47
48
  zip: "ico-yasuobao.svg",
@@ -76,6 +77,7 @@ const FILE_ICON_TYPE_MAP = {
76
77
  txt: "txt",
77
78
  java: "java",
78
79
  vue: "vue",
80
+ ftl: "ftl",
79
81
  xml: "xml",
80
82
  swf: "flash",
81
83
  zip: "zip",
@@ -85,6 +87,95 @@ const FILE_ICON_TYPE_MAP = {
85
87
  psd: "psd",
86
88
  };
87
89
 
90
+ let typeList = [
91
+ "doc",
92
+ "docx",
93
+ "xls",
94
+ "xlsx",
95
+ "ppt",
96
+ "pptx",
97
+ "csv",
98
+ "wps",
99
+ "dps",
100
+ "et",
101
+ "ett",
102
+ "wpt",
103
+ "vsd",
104
+ "vsdx",
105
+ "wmf",
106
+ "emf",
107
+ "psd",
108
+ "eps",
109
+ "pdf",
110
+ "xmind",
111
+ "obj",
112
+ "3ds",
113
+ "stl",
114
+ "ply",
115
+ "gltf",
116
+ "glb",
117
+ "off",
118
+ "3dm",
119
+ "fbx",
120
+ "dae",
121
+ "wrl",
122
+ "3mf",
123
+ "ifc",
124
+ "brep",
125
+ "step",
126
+ "iges",
127
+ "fcstd",
128
+ "bim",
129
+ "dwg",
130
+ "dxf",
131
+ "dwf",
132
+ "iges",
133
+ "igs",
134
+ "dwt",
135
+ "dng",
136
+ "ifc",
137
+ "dwfx",
138
+ "stl",
139
+ "cf2",
140
+ "plt",
141
+ "txt",
142
+ "xml",
143
+ "md",
144
+ "java",
145
+ "php",
146
+ "py",
147
+ "js",
148
+ "css",
149
+ "zip",
150
+ "rar",
151
+ "jar",
152
+ "tar",
153
+ "gzip",
154
+ "7z",
155
+ "mp3",
156
+ "wav",
157
+ "mp4",
158
+ "flv",
159
+ "avi",
160
+ "rm",
161
+ "mkv",
162
+ "mpeg",
163
+ "mpg",
164
+ "rmvb",
165
+ "wmv",
166
+ "3gp",
167
+ "swf",
168
+ "drawio",
169
+ "tif",
170
+ "tiff",
171
+ "jfif",
172
+ "webp",
173
+ "tga",
174
+ "svg",
175
+ "vue",
176
+ "ftl",
177
+ ];
178
+
88
179
  const accessToken = imFun.store.getters["user/token"];
89
180
 
90
181
  const loadingText = "";
@@ -117,9 +208,9 @@ install = (Vue, opts = {}) => {
117
208
  option.addCreateInfo = defaultOption.addCreateInfo;
118
209
  }
119
210
  if (
120
- opts.queryCreateInfo === null
121
- || opts.queryCreateInfo === undefined
122
- || opts.queryCreateInfo === true
211
+ opts.queryCreateInfo === null ||
212
+ opts.queryCreateInfo === undefined ||
213
+ opts.queryCreateInfo === true
123
214
  ) {
124
215
  option.queryCreateInfo = defaultOption.queryCreateInfo;
125
216
  }
@@ -300,93 +391,6 @@ install = (Vue, opts = {}) => {
300
391
  /* 全局事件总线 */
301
392
  Vue.prototype.$baseEventBus = new Vue();
302
393
 
303
- let typeList = [
304
- "doc",
305
- "docx",
306
- "xls",
307
- "xlsx",
308
- "ppt",
309
- "pptx",
310
- "csv",
311
- "wps",
312
- "dps",
313
- "et",
314
- "ett",
315
- "wpt",
316
- "vsd",
317
- "vsdx",
318
- "wmf",
319
- "emf",
320
- "psd",
321
- "eps",
322
- "pdf",
323
- "xmind",
324
- "obj",
325
- "3ds",
326
- "stl",
327
- "ply",
328
- "gltf",
329
- "glb",
330
- "off",
331
- "3dm",
332
- "fbx",
333
- "dae",
334
- "wrl",
335
- "3mf",
336
- "ifc",
337
- "brep",
338
- "step",
339
- "iges",
340
- "fcstd",
341
- "bim",
342
- "dwg",
343
- "dxf",
344
- "dwf",
345
- "iges",
346
- "igs",
347
- "dwt",
348
- "dng",
349
- "ifc",
350
- "dwfx",
351
- "stl",
352
- "cf2",
353
- "plt",
354
- "txt",
355
- "xml",
356
- "md",
357
- "java",
358
- "php",
359
- "py",
360
- "js",
361
- "css",
362
- "zip",
363
- "rar",
364
- "jar",
365
- "tar",
366
- "gzip",
367
- "7z",
368
- "mp3",
369
- "wav",
370
- "mp4",
371
- "flv",
372
- "avi",
373
- "rm",
374
- "mkv",
375
- "mpeg",
376
- "mpg",
377
- "rmvb",
378
- "wmv",
379
- "3gp",
380
- "swf",
381
- "drawio",
382
- "tif",
383
- "tiff",
384
- "jfif",
385
- "webp",
386
- "tga",
387
- "svg",
388
- "vue",
389
- ];
390
394
  Vue.prototype.$commonFileUtil = {
391
395
  // 文件类型获取与判断接口
392
396
  getFileSuffix: function (name) {
@@ -779,8 +783,8 @@ install = (Vue, opts = {}) => {
779
783
  if (Array.isArray(attachment)) {
780
784
  let currentFile = attachment[index];
781
785
  let typeStr = Object.prototype.toString.call(currentFile);
782
- let url
783
- = typeStr === "[object Object]"
786
+ let url =
787
+ typeStr === "[object Object]"
784
788
  ? currentFile.domain + currentFile.url
785
789
  : currentFile;
786
790
  if (that.$commonFileUtil.isPictureFile(url)) {
@@ -790,8 +794,8 @@ install = (Vue, opts = {}) => {
790
794
  }
791
795
  } else {
792
796
  let typeStr = Object.prototype.toString.call(attachment);
793
- let url
794
- = typeStr === "[object Object]"
797
+ let url =
798
+ typeStr === "[object Object]"
795
799
  ? attachment.domain + attachment.url
796
800
  : attachment;
797
801
  if (that.$commonFileUtil.isPictureFile(url)) {
@@ -819,11 +823,11 @@ install = (Vue, opts = {}) => {
819
823
  let visibleKey = target.$attrs["visible-key"] || "showEdit";
820
824
  let parentTarget = target.$attrs["parent-target"] || target.$parent;
821
825
  let originTarget = parentTarget.$refs._viewDialog ? parentTarget : target;
822
- let updateParam
823
- = param !== null
824
- && param !== undefined
825
- && param.updateParam !== null
826
- && param.updateParam !== undefined
826
+ let updateParam =
827
+ param !== null &&
828
+ param !== undefined &&
829
+ param.updateParam !== null &&
830
+ param.updateParam !== undefined
827
831
  ? param.updateParam
828
832
  : {};
829
833
  for (let key in updateParam) {
@@ -1048,8 +1052,8 @@ install = (Vue, opts = {}) => {
1048
1052
  let price;
1049
1053
  if (priceRoundType === "roundHalfUp") {
1050
1054
  price = (
1051
- Math.round(value * Math.pow(10, priceScale))
1052
- / Math.pow(10, priceScale)
1055
+ Math.round(value * Math.pow(10, priceScale)) /
1056
+ Math.pow(10, priceScale)
1053
1057
  ).toFixed(priceScale);
1054
1058
  } else if (priceRoundType === "roundUp") {
1055
1059
  price = (
@@ -1057,8 +1061,8 @@ install = (Vue, opts = {}) => {
1057
1061
  ).toFixed(priceScale);
1058
1062
  } else {
1059
1063
  price = (
1060
- Math.floor(value * Math.pow(10, priceScale))
1061
- / Math.pow(10, priceScale)
1064
+ Math.floor(value * Math.pow(10, priceScale)) /
1065
+ Math.pow(10, priceScale)
1062
1066
  ).toFixed(priceScale);
1063
1067
  }
1064
1068
  return price;
@@ -1087,8 +1091,8 @@ install = (Vue, opts = {}) => {
1087
1091
  /* dicts.forEach((item) => {
1088
1092
  dictMap[item.sn] = item.value;
1089
1093
  }); */
1090
- option.success
1091
- && option.success({
1094
+ option.success &&
1095
+ option.success({
1092
1096
  dicts,
1093
1097
  dictMap,
1094
1098
  });
@@ -1223,8 +1227,8 @@ install = (Vue, opts = {}) => {
1223
1227
  return i18n._t(path, lang, { zh: { [path]: path } }, null, values);
1224
1228
  } else {
1225
1229
  return (
1226
- i18n.t(path, values)
1227
- || i18n._t(path, lang, { zh: { [path]: path } }, null, values)
1230
+ i18n.t(path, values) ||
1231
+ i18n._t(path, lang, { zh: { [path]: path } }, null, values)
1228
1232
  );
1229
1233
  }
1230
1234
  }