cloud-web-corejs 1.0.54-dev.772 → 1.0.54-dev.774

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.772",
4
+ "version": "1.0.54-dev.774",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -1250,7 +1250,9 @@ modules = {
1250
1250
  }
1251
1251
  } else if (widgetType === "number") {
1252
1252
  if (e === undefined || e === null) {
1253
- e = undefined;
1253
+ // 清空存 null:undefined 会被 JSON.stringify 丢弃,字段不进请求体,
1254
+ // 后台按“未传即不更新”处理导致清空无法落库;null 可序列化并被后台置空。
1255
+ e = null;
1254
1256
  this.fieldModel = e;
1255
1257
  }
1256
1258
  }
@@ -92,7 +92,9 @@ export default {
92
92
  return fieldModel;
93
93
  },
94
94
  set(val) {
95
- const newValue = val === undefined || val === null ? undefined : val;
95
+ // 清空时存 null 而非 undefined:undefined 会被 JSON.stringify 丢弃,
96
+ // 导致该字段不进请求体,后台按“未传即不更新”处理,清空无法落库。
97
+ const newValue = val === undefined || val === null ? null : val;
96
98
  this.fieldModel = newValue;
97
99
  const currentData =
98
100
  this.tableParam && this.tableParam.row
package/src/index.js CHANGED
@@ -46,6 +46,19 @@ import Vab from "@base/utils/vab";
46
46
 
47
47
  Vue.use(Vab);
48
48
 
49
+ // appCode 兜底派生:子应用(拥有自己的子命名空间,即 WEB_PREFIX !== MAIN_WEB_PREFIX)
50
+ // 若未在自身 settings.js 里维护 appCode,则从 WEB_PREFIX 去前导斜杠派生(/mkweb → mkweb),
51
+ // 免得每个子应用再手填一处、也不会写错。主应用/独立主站两前缀相同 → 保持空。
52
+ // 优先级:mount 里的 props.appCode > settings 显式值 > 此派生。window.WEB_PREFIX /
53
+ // MAIN_WEB_PREFIX 已由上面 vab 的 Object.assign(window, prefixConfig) 设好。
54
+ if (!settings.appCode) {
55
+ const webPrefix = window.WEB_PREFIX || "";
56
+ const mainWebPrefix = window.MAIN_WEB_PREFIX || "";
57
+ if (webPrefix && webPrefix !== mainWebPrefix) {
58
+ settings.appCode = webPrefix.replace(/^\/+/, "");
59
+ }
60
+ }
61
+
49
62
  Vue.use(VXETable);
50
63
 
51
64
  /* import tablePluns from "@/mixins/table/index.js"