efront 3.16.1 → 3.18.0

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.
Files changed (71) hide show
  1. package/apps/pivot/api/edit.js +1 -0
  2. package/apps/pivot/api/list.js +20 -0
  3. package/apps/pivot/api.yml +8 -4
  4. package/apps/pivot/dict/edit.js +1 -0
  5. package/apps/pivot/dict/list.js +12 -0
  6. package/apps/pivot/link/chat.js +29 -0
  7. package/apps/pivot/link/chat.less +5 -0
  8. package/apps/pivot/link/list.html +8 -3
  9. package/apps/pivot/link/list.js +23 -2
  10. package/apps/pivot/link/list.less +3 -0
  11. package/apps/pivot/log/boot.js +13 -10
  12. package/apps/pivot/main.less +1 -0
  13. package/apps/pivot/menu.yml +4 -1
  14. package/apps/pivot/proxy/list.js +9 -8
  15. package/apps/pivot/task/list.js +1 -1
  16. package/apps/pivot/user/api.html +2 -0
  17. package/apps/pivot/user/api.js +14 -0
  18. package/apps/pivot/user/api.less +0 -0
  19. package/coms/basic/Speed.js +2 -3
  20. package/coms/basic/assert.js +5 -3
  21. package/coms/basic/lazy.js +21 -7
  22. package/coms/basic/lazy_test.js +62 -0
  23. package/coms/basic/parseURL.js +21 -2
  24. package/coms/basic/refilm_decode.js +4 -2
  25. package/coms/frame/chat.html +13 -0
  26. package/coms/frame/chat.js +39 -0
  27. package/coms/frame/chat.less +125 -0
  28. package/coms/frame/design.html +7 -0
  29. package/coms/frame/design.js +23 -0
  30. package/coms/frame/design.less +17 -0
  31. package/coms/frame/dict.js +21 -0
  32. package/coms/frame/edit.js +1 -1
  33. package/coms/frame/left.html +1 -1
  34. package/coms/frame/list.js +1 -1
  35. package/coms/frame/route.js +1 -0
  36. package/coms/kugou/song.html +1 -1
  37. package/coms/kugou/song.js +4 -3
  38. package/coms/pivot/pedit.js +3 -3
  39. package/coms/pivot/plist.js +2 -2
  40. package/coms/zimoli/Item.js +40 -25
  41. package/coms/zimoli/appendChild.js +6 -8
  42. package/coms/zimoli/cloneVisible.js +1 -0
  43. package/coms/zimoli/container.js +10 -0
  44. package/coms/zimoli/createItemTarget.js +7 -0
  45. package/coms/zimoli/data.js +26 -12
  46. package/coms/zimoli/design.html +5 -4
  47. package/coms/zimoli/design.less +8 -3
  48. package/coms/zimoli/drag.js +5 -3
  49. package/coms/zimoli/field.html +1 -1
  50. package/coms/zimoli/getGenerator.js +4 -4
  51. package/coms/zimoli/getTreeFromData.js +3 -0
  52. package/coms/zimoli/list.js +5 -5
  53. package/coms/zimoli/menu.js +16 -13
  54. package/coms/zimoli/menuItem.js +2 -2
  55. package/coms/zimoli/menuList.html +1 -1
  56. package/coms/zimoli/menuList.js +14 -14
  57. package/coms/zimoli/menuList.less +1 -1
  58. package/coms/zimoli/model.js +4 -3
  59. package/coms/zimoli/on.js +1 -1
  60. package/coms/zimoli/once.js +6 -5
  61. package/coms/zimoli/onmounted.js +1 -1
  62. package/coms/zimoli/render.js +61 -24
  63. package/coms/zimoli/renderDefaults.js +1 -0
  64. package/coms/zimoli/resize.js +18 -0
  65. package/coms/zimoli/scrollbar.js +20 -8
  66. package/coms/zimoli/scrollbar.less +22 -1
  67. package/coms/zimoli/tree.js +3 -3
  68. package/coms/zimoli/vbox.js +7 -3
  69. package/coms/zimoli/zimoli.js +1 -1
  70. package/package.json +1 -1
  71. package/public/efront.js +1 -1
@@ -0,0 +1,125 @@
1
+ @height: 320px;
2
+ @width: 360px;
3
+ @margin-top: -160px;
4
+ @margin-left: -180px;
5
+
6
+ & {
7
+ margin: @margin-top @margin-left;
8
+ top: 50%;
9
+ left: 50%;
10
+ width: @width;
11
+ height: @height;
12
+ position: absolute;
13
+ border: 1px solid #000;
14
+ box-shadow: 0 0 20px -6px #0003;
15
+ min-width: 200px;
16
+ min-height: 200px;
17
+ max-width: 100%;
18
+ max-height: 100%;
19
+ }
20
+
21
+
22
+ msg {
23
+ display: block;
24
+ }
25
+
26
+
27
+ >[head] {
28
+ padding: 9px 16px;
29
+ line-height: 24px;
30
+ }
31
+
32
+ >grid[body] {
33
+ padding-top: 0;
34
+ margin-bottom: 0;
35
+
36
+ >div {
37
+ height: 100%;
38
+ position: relative;
39
+ }
40
+ }
41
+
42
+
43
+ .editor-height(@height) {
44
+ >grid[body]:not(:last-child) {
45
+ padding-bottom: @height;
46
+ }
47
+
48
+ [textarea] {
49
+ margin-bottom: -@height;
50
+ height: @height;
51
+ }
52
+ }
53
+
54
+ chat {
55
+ height: 100%;
56
+ }
57
+
58
+ .editor-height(80px);
59
+
60
+ [textarea] {
61
+ display: block;
62
+ position: relative;
63
+ resize: none;
64
+ width: 100%;
65
+ line-height: 20px;
66
+ font-size: 16px;
67
+ border: none;
68
+ outline: none;
69
+ border-top: 1px solid #000;
70
+ ime-mode: active;
71
+
72
+ >div {
73
+ height: 100%;
74
+ width: 100%;
75
+ vertical-align: top;
76
+ padding: 6px 16px 30px;
77
+ overflow: auto;
78
+ outline: none;
79
+ }
80
+ }
81
+
82
+ >[foot] {
83
+ pointer-events: none;
84
+ background: transparent;
85
+ backdrop-filter: none;
86
+ box-shadow: none;
87
+ box-shadow: none;
88
+ border-top: none;
89
+
90
+ >btn {
91
+ pointer-events: all;
92
+ }
93
+ }
94
+
95
+
96
+ .max-size() {
97
+ margin-top: 0 !important;
98
+ top: 0 !important;
99
+ height: 100% !important;
100
+ margin-left: 0 !important;
101
+ left: 0 !important;
102
+ width: 100% !important;
103
+ border: none;
104
+ .editor-height(36px);
105
+
106
+ [textarea] {
107
+ border: none;
108
+ outline: none;
109
+ >div{
110
+ padding-right: 80px;
111
+ }
112
+ }
113
+ }
114
+
115
+ @media(max-height: @height) {
116
+ & {
117
+ .max-size();
118
+ }
119
+ }
120
+
121
+ @media(max-width: @width) {
122
+ & {
123
+ .max-size();
124
+ }
125
+ }
@@ -0,0 +1,7 @@
1
+ <div head>编辑字段</div>
2
+ <design body>
3
+ </design>
4
+ <div foot>
5
+ <btn type="white" @click="remove()">取消</btn>
6
+ <btn @click="save()">确定</btn>
7
+ </div>
@@ -0,0 +1,23 @@
1
+ function design(fields, types) {
2
+
3
+ var e = document.createElement("fields-designer");
4
+ e.innerHTML = template;
5
+ var e = view(e);
6
+ renderWithDefaults(e, {
7
+ fields: fields ? JSAM.parse(JSAM.stringify(fields)) : [],
8
+ design() {
9
+ return zimoli$design(this.fields, types);
10
+ },
11
+ remove() {
12
+ remove(e);
13
+ },
14
+ save() {
15
+ e.value = this.fields;
16
+ dispatch(e, 'changed');
17
+ remove(e);
18
+ }
19
+ });
20
+ drag.on(e.firstChild, e);
21
+ resize.on(e);
22
+ return e;
23
+ }
@@ -0,0 +1,17 @@
1
+ & {
2
+ width: 420px;
3
+
4
+ }
5
+
6
+ >[body] {
7
+ >.options>.button {
8
+ z-index: 2;
9
+ margin-top: -56px;
10
+ }
11
+ >.options{
12
+ height: 0;
13
+ line-height: 0;
14
+ }
15
+
16
+ overflow: visible;
17
+ }
@@ -0,0 +1,21 @@
1
+ function main(types, elem) {
2
+ var { field, data, readonly } = elem;
3
+ elem.innerHTML = `<span -text="text()"></span>` + (readonly ? "" : '<a @click="edit()">修改</a>');
4
+ renderWithDefaults(elem.children, {
5
+ text() {
6
+ if (data[field.key]) return data[field.key].map(k => `${k.name} ${isEmpty(k.key) ? "" : `(${k.key})`}`).join(", ");
7
+ return '';
8
+ },
9
+ edit() {
10
+ var editer = frame$design(data[field.key], types);
11
+ css(editer, { position: 'absolute' });
12
+ popup(editer);
13
+ move.bindPosition(editer, [.5, .5]);
14
+ on("changed")(editer, function () {
15
+ console.log(this.value, field)
16
+ data[field.key] = this.value;
17
+ });
18
+ }
19
+ })
20
+ return elem;
21
+ };
@@ -10,7 +10,7 @@ function main(title, { submit }, { data: origin, fields, }) {
10
10
  renderWithDefaults(page, {
11
11
  fields,
12
12
  title,
13
- origin: item,
13
+ origin,
14
14
  data: item,
15
15
  remove() {
16
16
  remove(page);
@@ -9,5 +9,5 @@
9
9
  <span ng-bind="user.roles"></span>
10
10
  </span>
11
11
  </header>
12
- <ylist mode=inline ng-src="menu in menus" class="sidebar-menu" ng-active="menus.open(event.value)">
12
+ <ylist mode=inline ng-src="menu in menus" class="sidebar-menu" ng-active="menus.open(menu)">
13
13
  </ylist>
@@ -49,7 +49,7 @@ function main(title, { fields, options: options0, load, remove }, edit_ref) {
49
49
  load() {
50
50
  this.data = load();
51
51
  },
52
- fields: fields.concat({
52
+ fields: fields.filter(f => !f.hidden && f.inlist !== false).concat({
53
53
  name: "操作",
54
54
  options
55
55
  }),
@@ -162,6 +162,7 @@
162
162
  }
163
163
  };
164
164
  result.load = function (menu) {
165
+ data.abortAll();
165
166
  zimoli.go(menu);
166
167
  return result;
167
168
  };
@@ -3,6 +3,6 @@
3
3
  <div class="song" ng-model=song.songMarked></div>
4
4
  <div class="singer" ng-model=song.singerMarked></div>
5
5
  <div class="filterTime(song.timeLength)"></div>
6
- <div class="play-state" ng-if="song.hash===musicList.active_hash" ng-class={error:playState.error}>
6
+ <div refresh class="play-state" ng-if="song.hash===musicList.active_hash" ng-class={error:playState.error}>
7
7
  <div ng-style="{width:playState.width}"></div>
8
8
  </div>
@@ -1,15 +1,15 @@
1
1
  function main(elem) {
2
2
  elem = elem || document.createElement("song");
3
- if (!elem.innerHTML) elem.innerHTML = song;
3
+ elem.renderid = 9;
4
4
  var $scope = {
5
5
  filterTime,
6
6
  png: img,
7
7
  playState: kugou$playState,
8
8
  song: {},
9
- musicList:kugou$musicList,
9
+ musicList: kugou$musicList,
10
10
  };
11
- render(elem, $scope);
12
11
  care(elem, function (item) {
12
+ if (!elem.innerHTML) elem.innerHTML = song;
13
13
  var songName = String(item.name || item.songName || item.songname_original || '');
14
14
  var singerName = String(item.singer || item.singerName || item.singername || '');
15
15
  if (~songName.indexOf(singerName)) {
@@ -24,6 +24,7 @@ function main(elem) {
24
24
  songMarked: mark(songName, elem.mark),
25
25
  singerMarked: mark(singerName, elem.mark)
26
26
  };
27
+ render(elem.children, $scope, 0);
27
28
  });
28
29
  return block(elem);
29
30
  }
@@ -1,10 +1,10 @@
1
- function main(title, type, params) {
1
+ function main(title, type, params, idkey = params.fields[0].key) {
2
2
  return frame$edit(title, {
3
3
  submit(a, fields) {
4
4
  a = submit(fields, a);
5
- return data.from("edit", {
5
+ return data.from(params.data ? "edit" : "add", {
6
6
  type,
7
- key: encode62.timeencode(a.key),
7
+ key: encode62.timeencode(a[idkey]),
8
8
  value: encode62.timeencode(JSON.stringify(a)),
9
9
  }).loading_promise;
10
10
  },
@@ -1,11 +1,11 @@
1
1
 
2
- function main(title, type, fields, edit_ref, options) {
2
+ function main(title, type, fields, edit_ref, options, idkey = fields[0].key) {
3
3
  return frame$list(title, {
4
4
  load() {
5
5
  return data.from("list", { type }, a => JSAM.parse(encode62.timedecode(a || '')));
6
6
  },
7
7
  remove(o) {
8
- return data.from("edit", { type, key: encode62.timeencode(o.key), value: encode62.timeencode("") }).loading_promise;
8
+ return data.from("edit", { type, key: encode62.timeencode(o[idkey]), value: encode62.timeencode("") }).loading_promise;
9
9
  },
10
10
  fields,
11
11
  options,
@@ -1,32 +1,39 @@
1
1
  var id = 0;
2
2
  function Item(value) {
3
- this.value = isObject(value) ? value : Object.create(value);
4
- this.valueOf = function () {
5
- return value;
6
- };
7
- this.toString = function () {
8
- return String(value);
9
- };
10
3
  this.children = this;
11
- if (value.children instanceof Array) {
12
- var children = value.children.map(item => new Item(item));
13
- children.forEach(item => item.parent = item);
14
- this.push.apply(this, children);
15
- }
16
- if (isObject(value)) {
17
- this.name = value.name;
18
- this.tab = value.tab;
19
- this.icon = value.icon;
20
- this.color = value.color;
21
- this.test = value.test;
22
- this.line = value.line;
23
- }
24
4
  this.count = 0;//子项中的叶子节点数
25
5
  this.total = 0;//子项中的节点数
26
6
  this.crack = 0;
27
7
  this.id = ++id;
8
+ this.extends(value);
28
9
  }
29
10
  Item.prototype = extend([], {
11
+ extends(value) {
12
+ this.value = value;
13
+ if (value.children instanceof Array) {
14
+ var children = value.children.map(item => new Item(item));
15
+ children.forEach(item => item.parent = item);
16
+ this.push.apply(this, children);
17
+ }
18
+ if (isObject(value)) {
19
+ this.name = value.name;
20
+ this.tab = value.tab;
21
+ this.icon = value.icon;
22
+ this.color = value.color;
23
+ this.test = value.test;
24
+ this.line = value.line;
25
+ }
26
+ else {
27
+ this.name = value;
28
+ }
29
+ },
30
+
31
+ valueOf() {
32
+ return this.value;
33
+ },
34
+ toString() {
35
+ return String(this.value);
36
+ },
30
37
  isClosed() {
31
38
  return !!this.value.closed;
32
39
  },
@@ -34,14 +41,21 @@ Item.prototype = extend([], {
34
41
  this.value.closed = value;
35
42
  },
36
43
  isActive() {
37
- return !!(this.value.active || this.value.actived);
44
+ if (isObject(this.value)) {
45
+ if ("active" in this.value) return this.value.active;
46
+ if ('actived' in this.value) return this.value.actived;
47
+ }
48
+ return !!this.actived;
38
49
  },
39
50
  setActive(value) {
40
- if ('active' in this.value) {
41
- this.value.active = value;
42
- } else {
43
- this.value.actived = value;
51
+ if (isObject(this.value)) {
52
+ if ('active' in this.value) {
53
+ this.value.active = value;
54
+ } else {
55
+ this.value.actived = value;
56
+ }
44
57
  }
58
+ this.actived = value;
45
59
  },
46
60
  isSelected() {
47
61
  return !!this.value.selected;
@@ -53,3 +67,4 @@ Item.prototype = extend([], {
53
67
  return !!this.value.class;
54
68
  }
55
69
  });
70
+ Item.prototype.isActived = Item.prototype.isActive;
@@ -11,26 +11,24 @@ function hasEnterStyle(e) {
11
11
  return e.initialStyle || e.enterStyle || e.leavingStyle || e.leaveStyle;
12
12
  }
13
13
 
14
- function _onappend(node, event) {
14
+ function _onappend(node, append = createEvent("append"), mount = createEvent("mounted")) {
15
15
  if (node.isMounted) return;
16
16
  if (node.nodeType === 1 || node.nodeType === 8) node.isMounted = true;
17
- if (!event) {
18
- event = createEvent("append");
19
- }
20
- dispatch(node, event);
17
+ dispatch(node, append);
21
18
  var onappend = node.onappend;
22
19
  if (isArray(onappend)) {
23
20
  onappend.map(function (append_handler) {
24
- append_handler.call(this, event);
21
+ append_handler.call(this, append);
25
22
  }, node);
26
23
  }
27
24
  if (isFunction(onappend)) {
28
- onappend.call(node, event);
25
+ onappend.call(node, append);
29
26
  }
30
27
  var children = [].concat.apply([], node.childNodes);
31
28
  if (children) for (var cx = 0, dx = children.length; cx < dx; cx++) {
32
- _onappend(children[cx], event);
29
+ _onappend(children[cx], append, mount);
33
30
  }
31
+ dispatch(node, mount);
34
32
  }
35
33
  function appendChild(parent, obj, transition) {
36
34
  if (transition === false) {
@@ -88,6 +88,7 @@ var isMaybeVisible = function (node) {
88
88
  }
89
89
  if (node.offsetParent) {
90
90
  var parent = node.offsetParent;
91
+ if (getComputedStyle(parent).overflow === 'visible') return true;
91
92
  return !(node.offsetLeft + node.offsetWidth - parent.scrollLeft <= parent.clientLeft ||
92
93
  node.offsetTop + node.offsetHeight - parent.scrollTop <= parent.clientTop ||
93
94
  node.offsetLeft - parent.scrollLeft >= (parent.clientWidth || parent.offsetWidth) ||
@@ -1,7 +1,17 @@
1
1
  var change = function (data) {
2
2
  zimoli.go(data, this.params, this);
3
3
  };
4
+ var gosrc = function () {
5
+ if (this.hasAttribute('src')) {
6
+ var src = this.getAttribute('src');
7
+ if (src !== this.src) {
8
+ this.src = src;
9
+ if (src) cast(this, this.getAttribute('src'));
10
+ }
11
+ }
12
+ };
4
13
  function container(element) {
5
14
  care(element, change);
15
+ element.renders = [gosrc];
6
16
  return element;
7
17
  }
@@ -0,0 +1,7 @@
1
+ function createItemTarget(item) {
2
+ var $scope = {};
3
+ var { itemName } = this.$src;
4
+ if (itemName) $scope[itemName] = item;
5
+ else $scope.$item = item;
6
+ return { $scope };
7
+ }
@@ -433,15 +433,11 @@ function LoadingArray_then(ok, oh) {
433
433
  else if (this.is_errored) oh(this.error_message);
434
434
  else ok();
435
435
  }
436
+ function LoadingArray_abort(ok, oh) {
437
+ if (this.loading) this.loading.abort();
438
+ }
436
439
 
437
440
  var privates = {
438
- loadAfterConfig(serviceId, params) {
439
- var promise = this.getApi(serviceId).then((api) => {
440
- params = this.pack(serviceId, params);
441
- return this.fromApi(api, params);
442
- });
443
- return promise;
444
- },
445
441
  pack(serviceId, params) {
446
442
  if (/\?/.test(serviceId)) {
447
443
  params = extend({}, getParamsFromUrl(serviceId), params);
@@ -565,12 +561,13 @@ var privates = {
565
561
  var promise = cachedLoadingPromise[id];
566
562
  var temp = JSON.stringify(params);
567
563
  var currentTime = +new Date;
564
+ var loading = null;
568
565
  if (!promise || currentTime - promise.time > 60 || temp !== promise.params || promise.search !== search) {
569
566
  var promise = new Promise(function (ok, oh) {
570
567
  if (headers) {
571
568
  headers = seekFromSource(headers, api.base);
572
569
  }
573
- cross(realmethod, uri, headers).send(params).done(e => {
570
+ loading = cross(realmethod, uri, headers).send(params).done(e => {
574
571
  ok(e.response || e.responseText);
575
572
  }).error(xhr => {
576
573
  try {
@@ -581,12 +578,13 @@ var privates = {
581
578
  }
582
579
  });
583
580
  });
581
+ promise.loading = loading;
584
582
  promise.search = search;
585
583
  promise.params = temp;
586
584
  promise.time = currentTime;
587
585
  cachedLoadingPromise[id] = promise;
588
586
  }
589
- return promise.then(function (response) {
587
+ var p = promise.then(function (response) {
590
588
  if (/\*$/.test(coinmethod)) return response;
591
589
  var data = parseData(response);
592
590
  var checked = error_check(data);
@@ -598,6 +596,8 @@ var privates = {
598
596
  }
599
597
  return data;
600
598
  });
599
+ p.loading = loading;
600
+ return p;
601
601
  },
602
602
 
603
603
  getConfigPromise() {
@@ -659,6 +659,7 @@ var data = {
659
659
  response.is_loaded = true;
660
660
  response.is_loading = false;
661
661
  if (response.then === LoadingArray_then) delete response.then;
662
+ if (response.abort === LoadingArray_abort) delete response.abort;
662
663
  }
663
664
  },
664
665
  responseCrash,
@@ -667,6 +668,7 @@ var data = {
667
668
  response.is_loaded = false;
668
669
  response.is_loading = true;
669
670
  response.then = LoadingArray_then;
671
+ response.abort = LoadingArray_abort;
670
672
  }
671
673
  },
672
674
  setReporter(report, checker) {
@@ -758,7 +760,10 @@ var data = {
758
760
  var response = this.getInstance(id || url);
759
761
  if (!isObject(response)) response = new LoadingArray;
760
762
  this.responseLoading(response);
761
- var p = response.loading_promise = privates.fromApi(api, params).then((data) => {
763
+ var p = privates.fromApi(api, params);
764
+ response.loading = p.loading;
765
+ p = response.loading_promise = p.then((data) => {
766
+ response.loading = null;
762
767
  if (id) {
763
768
  data = parse(data);
764
769
  this.setInstance(id, data, false);
@@ -781,7 +786,10 @@ var data = {
781
786
  var response = this.getInstance(id || url);
782
787
  if (!isObject(response)) response = new LoadingArray;
783
788
  this.responseLoading(response);
784
- var p = response.loading_promise = privates.loadIgnoreConfig('get', url).then((data) => {
789
+ var p = privates.loadIgnoreConfig('get', url);
790
+ response.loading = p.loading;
791
+ p = response.loading_promise = p.then((data) => {
792
+ response.loading = null;
785
793
  if (id) {
786
794
  data = parse(data);
787
795
  this.setInstance(id, data, false);
@@ -806,7 +814,13 @@ var data = {
806
814
  var response = this.getInstance(id || sid);
807
815
  if (!isObject(response)) response = new LoadingArray;
808
816
  this.responseLoading(response);
809
- var p = response.loading_promise = privates.loadAfterConfig(sid, params).then((data) => {
817
+ var p = response.loading_promise = privates.getApi(sid).then((api) => {
818
+ params = privates.pack(sid, params);
819
+ var p = privates.fromApi(api, params);
820
+ response.loading = p.loading;
821
+ return p;
822
+ }).then((data) => {
823
+ response.loading = null;
810
824
  if (id) {
811
825
  data = parse instanceof Function ? parse(data) : data;
812
826
  this.setInstance(id, data, false);
@@ -5,12 +5,13 @@
5
5
  <padding>
6
6
  <div class="field-item">
7
7
  <span class="index" ng-bind='field.id'></span>
8
- <input @focus="focus(this.parentNode)" @blur="blur(this.parentNode)" placeholder="请输入字段名称"
8
+ <input @focus="focus(this.parentNode)" @blur="blur(this.parentNode)" placeholder="显示名称"
9
9
  ng-model=field.name />
10
- <select @focus="focus(this.parentNode)" @blur="blur(this.parentNode)" aria-placeholder=""
11
- ng-model=field.type>
10
+ <input @focus="focus(this.parentNode)" @blur="blur(this.parentNode)" placeholder="键名" ng-model=field.key />
11
+ <select @focus="focus(this.parentNode)" -model="field.type" @blur="blur(this.parentNode)"
12
+ ng-model=field.type >
12
13
  <option value="">请选择字段类型</option>
13
- <option ng-repeat="type in types"></option>
14
+ <option _value="type.key" ng-repeat="type in types" -text="type.name"></option>
14
15
  </select>
15
16
  <btn ng-click=remove(field)>移除</btn>
16
17
  </div>
@@ -10,12 +10,12 @@
10
10
  >.options {
11
11
  text-align: right;
12
12
  padding: 0 16px;
13
- width: 392px;
13
+ width: 412px;
14
14
  }
15
15
 
16
16
  .padding {
17
17
  display: block;
18
- padding: 8px 10px 0;
18
+ padding: 8px 0 0;
19
19
  }
20
20
 
21
21
  .field-item {
@@ -37,7 +37,7 @@
37
37
  border-radius: 3px;
38
38
  text-align: right;
39
39
  display: block;
40
- width: 360px;
40
+ width: 390px;
41
41
  max-width: 100%;
42
42
  position: relative;
43
43
  border: 1px solid #0006;
@@ -70,6 +70,11 @@
70
70
  >input {
71
71
  border-radius: 3px 0 0 3px;
72
72
  padding-left: 6px;
73
+ width: 130px;
74
+ }
75
+
76
+ >select {
77
+ width: 80px;
73
78
  }
74
79
 
75
80
  >btn {
@@ -22,15 +22,18 @@ var setZIndex = function () {
22
22
  if (!isElement(target)) return;
23
23
  var computed = getComputedStyle(target);
24
24
  var z0 = zIndex(0);
25
- if (!z || computed.zIndex < z0) {
25
+ if (!z || +computed.zIndex < z0) {
26
26
  z = zIndex();
27
27
  if (/^(absolute|fixed)$/i.test(computed.position)) {
28
28
  css(target, { zIndex: z });
29
29
  }
30
30
  }
31
+ else if (z < +computed.zIndex) {
32
+ z = +computed.zIndex;
33
+ }
31
34
  };
32
35
  function drag(target, initialEvent, preventOverflow, isMovingSource) {
33
- if (/^(?:select|input|textarea)$/i.test(initialEvent.target.tagName)) return;
36
+ if (/^(?:select|input|textarea)$/i.test(initialEvent.target.tagName) || getTargetIn(a => a.nodrag || a.hasAttribute('nodrag') || a.dragable === false, initialEvent.target)) return;
34
37
  if (target.dragable === false) return;
35
38
  initialEvent.preventDefault();
36
39
  if (isArray(target)) {
@@ -39,7 +42,6 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
39
42
  } else {
40
43
  var extraTargets = target.with ? [].concat(target.with) : [];
41
44
  }
42
-
43
45
  var target_offset = getOffset(target);
44
46
  var saved_delta = { x: target_offset[0] - initialEvent.screenX, y: target_offset[1] - initialEvent.screenY };
45
47
  var clone;
@@ -1,4 +1,4 @@
1
- <template v-if='field?.key'>
1
+ <template v-if='field?.name'>
2
2
  <div class="head">
3
3
  <span ng-bind=field.name></span>
4
4
  <span class="required" ng-if="field.required">*</span>