efront 3.9.4 → 3.9.8

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.
@@ -8,3 +8,4 @@
8
8
  edit: options :::type-:key?:value
9
9
  params: options ::params-:key
10
10
  invoke: options ::invoke-:key?:params
11
+ version: options ::version
@@ -15,4 +15,9 @@
15
15
  <padding>
16
16
  退出登录 <btn @click="logout()">退出</btn>
17
17
  </padding>
18
+ </block>
19
+ <block>
20
+ <padding>
21
+ 服务器版本&nbsp;&nbsp;<span -text="String(version)"></span>
22
+ </padding>
18
23
  </block>
@@ -3,6 +3,7 @@ function main() {
3
3
  page.innerHTML = template;
4
4
  renderWithDefaults(page, {
5
5
  status: [],
6
+ version: data.from("version"),
6
7
  async run(id, target) {
7
8
  target.setAttribute('pending', '')
8
9
  try {
@@ -22,6 +22,8 @@
22
22
  height: 100%;
23
23
  position: absolute;
24
24
  top: 0;
25
+ left: 0;
26
+ display: block;
25
27
  }
26
28
 
27
29
 
@@ -621,7 +621,7 @@ function responseCrash(e, data) {
621
621
  }
622
622
  error_report(data.error_message, e.status < 500 ? 'warn' : 'error');
623
623
  }
624
-
624
+ var getData = function () { return this.data };
625
625
  var data = {
626
626
  decodeStructure,
627
627
  encodeStructure,
@@ -898,12 +898,11 @@ var data = {
898
898
  getInstance(instanceId, onlyFromLocalStorage = false) {
899
899
  if (!instanceDataMap[instanceId]) {
900
900
  var data = getItem(instanceId, onlyFromLocalStorage);
901
- if (isObject(data) || isEmpty(data)) {
902
- data = extend(new LoadingArray, data);
903
- data.is_loading = false;
904
- data.is_loaded = true;
905
- }
906
- instanceDataMap[instanceId] = data;
901
+ var instance = new LoadingArray;
902
+ this.rebuildInstance(instance, data);
903
+ instance.is_loading = false;
904
+ instance.is_loaded = true;
905
+ instanceDataMap[instanceId] = instance;
907
906
  }
908
907
  return instanceDataMap[instanceId];
909
908
 
@@ -947,7 +946,7 @@ var data = {
947
946
  */
948
947
  setInstance(instanceId, data, rememberWithStorage = 0) {
949
948
  const instance = this.getInstance(instanceId);
950
- if (isObject(data) && isObject(instance)) {
949
+ if (isObject(instance)) {
951
950
  this.rebuildInstance(instance, data);
952
951
  } else {
953
952
  instanceDataMap[instanceId] = data;
@@ -1005,7 +1004,8 @@ var data = {
1005
1004
  },
1006
1005
  rebuildInstance(instance, data, old = instance) {
1007
1006
  if (instance === data) return;
1008
- if (!isObject(instance) || !isObject(data)) throw new Error("只支持object类型的数据!");
1007
+ if (!isObject(instance)) throw new Error("只支持object类型的数据!");
1008
+ if (!isObject(data)) data = { data }, data.toString = data.valueOf = getData;
1009
1009
  if (instance instanceof Array) instance.splice(0, instance.length);
1010
1010
  var sample = new LoadingArray;
1011
1011
  Object.keys(old).forEach(function (k) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.9.4",
3
+ "version": "3.9.8",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {