efront 3.5.13 → 3.7.3

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 (40) hide show
  1. package/apps/pivot/api.yml +8 -6
  2. package/apps/pivot/auth/login.js +20 -4
  3. package/apps/pivot/home/welcome.html +5 -1
  4. package/apps/pivot/main.js +3 -0
  5. package/apps/pivot/menu.yml +1 -0
  6. package/apps/pivot/token/edit.js +9 -0
  7. package/apps/pivot/token/list.js +13 -0
  8. package/coms/basic/encodeUTF8.js +1 -1
  9. package/coms/basic/loader.js +43 -18
  10. package/coms/basic/refilm_decode.js +2 -2
  11. package/coms/crypt/encode62.js +20 -1
  12. package/coms/frame/edit.html +10 -0
  13. package/coms/frame/edit.js +29 -0
  14. package/coms/frame/edit.less +0 -0
  15. package/coms/frame/list.html +4 -0
  16. package/coms/frame/list.js +64 -0
  17. package/coms/frame/list.less +3 -0
  18. package/coms/frame/main.less +1 -0
  19. package/coms/zimoli/LoadingArray.ts +3 -0
  20. package/coms/zimoli/data.js +11 -9
  21. package/coms/zimoli/dispatch.js +13 -6
  22. package/coms/zimoli/encode62.js +3 -2
  23. package/coms/zimoli/input.js +0 -6
  24. package/coms/zimoli/input.less +6 -6
  25. package/coms/zimoli/model.js +20 -3
  26. package/coms/zimoli/popup.js +15 -10
  27. package/coms/zimoli/prompt.js +40 -0
  28. package/coms/zimoli/rootElements.js +1 -0
  29. package/coms/zimoli/search.js +15 -0
  30. package/coms/zimoli/select.js +26 -12
  31. package/coms/zimoli/selectList.js +68 -8
  32. package/coms/zimoli/selectList.less +15 -2
  33. package/coms/zimoli/selectListEdit.html +15 -0
  34. package/coms/zimoli/selectListEdit.js +68 -0
  35. package/coms/zimoli/selectListEdit.less +21 -0
  36. package/coms/zimoli/table.html +2 -1
  37. package/coms/zimoli/table.js +1 -1
  38. package/coms/zimoli/zimoli.js +24 -2
  39. package/package.json +1 -1
  40. package/public/efront.js +1 -1
@@ -1,6 +1,8 @@
1
- ./aapi/ authorization:
2
- login: options /::login-:a
3
- run: options /:::run
4
- share: options /::share-:opt?:path
5
- folder: options /::file-:opt:::path?:to
6
- cluster: options /::cluster-:opt?:id
1
+ / authorization:
2
+ login: options ::login-:a
3
+ run: options :::run
4
+ share: options ::share-:opt?:path
5
+ folder: options ::file-:opt:::path?:to
6
+ cluster: options ::cluster-:opt?:id
7
+ private-list: options ::private
8
+ private-edit: options ::private-:key?:value
@@ -1,7 +1,10 @@
1
+ var hosts = data.getItem("hosts");
2
+ if (!hosts.length) hosts.push({ key: location.host, name: location.host });
1
3
  var fields = refilm`
4
+ 服务器地址/host* select?a ${hosts}
2
5
  密码/password* password
3
6
  `;
4
-
7
+ console.log(fields)
5
8
  function main() {
6
9
  var page = view();
7
10
  page.innerHTML = login;
@@ -9,20 +12,33 @@ function main() {
9
12
  on("append")(page, function () {
10
13
  move.bindPosition(page, [.5, .5]);
11
14
  });
12
- renderWithDefaults(page, { fields, data: {}, pending: false });
15
+ renderWithDefaults(page, {
16
+ fields, data: {
17
+ host: location.host,
18
+ }, pending: false
19
+ });
13
20
  on("submit")(page, async function () {
21
+ data.setInstance("hosts", hosts, true);
14
22
  var { password } = submit(fields, this.$scope.data);
15
23
  this.$scope.pending = true;
16
24
  page.disabled = true;
17
25
  try {
18
- var info = await data.from("login", {
26
+ var login = await data.getApi("login");
27
+ login.base = location.protocol + "//" + parseURL(this.$scope.data.host).host + "/";
28
+ cross.addDirect(login.base);
29
+ var info = await data.from(login, {
19
30
  a: encode62.timeencode(encode62.geta(password))
20
31
  }).loading_promise;
32
+ var apimap = await data.getConfig();
33
+ for (var k in apimap) {
34
+ apimap[k].base = login.base;
35
+ }
21
36
  info = encode62.timeupdate(info);
22
37
  data.setSource({ authorization: info });
23
38
  user.login({})
24
39
  go('/main')
25
- } catch {
40
+ } catch (e) {
41
+ console.log(e);
26
42
  }
27
43
  this.$scope.pending = false;
28
44
  })
@@ -1,4 +1,3 @@
1
-
2
1
  <div>
3
2
  已登录到服务器,您可以进行如下操作
4
3
  </div>
@@ -7,6 +6,11 @@
7
6
  清理服务器缓存 <btn @click="run('clear-cache',this)">清理</btn>
8
7
  </padding>
9
8
  </block>
9
+ <block>
10
+ <padding>
11
+ 重启服务器 <btn @click="run('rehost',this)" type="danger">重启</btn>
12
+ </padding>
13
+ </block>
10
14
  <block>
11
15
  <padding>
12
16
  退出登录 <btn @click="logout()">退出</btn>
@@ -16,6 +16,9 @@ var layer = layer$glance({
16
16
  left: frame$left,
17
17
  top: frame$top
18
18
  });
19
+ on("append")(layer, function () {
20
+ frame$route.open();
21
+ });
19
22
  function main() {
20
23
  return layer;
21
24
  }
@@ -3,4 +3,5 @@
3
3
  短链接: /home/short
4
4
  WEB文件管理: /wow/root
5
5
  长连接管理: /link/list
6
+ 密钥管理: /token/list
6
7
  # 用户列表: /user/list
@@ -0,0 +1,9 @@
1
+ frame$edit.bind(null, "密钥", {
2
+ submit(a) {
3
+ return data.from("private-edit", {
4
+ key: encode62.timeencode(a.key),
5
+ value: encode62.timeencode(JSON.stringify(a)),
6
+ }).loading_promise;
7
+ },
8
+
9
+ });
@@ -0,0 +1,13 @@
1
+ frame$list.bind(null, "密钥管理", {
2
+ load() {
3
+ return data.from("private-list", a => JSAM.parse(encode62.timedecode(a)));
4
+ },
5
+ remove(o) {
6
+ return data.from("private-edit", { key: encode62.timeencode(o.key), value: encode62.timeencode("") }).loading_promise;
7
+ },
8
+ fields: refilm`
9
+ 显示名/name input
10
+ *键名/key
11
+ 密钥/value
12
+ 备注/comment
13
+ `}, "/token/edit");
@@ -1,6 +1,6 @@
1
1
  var d = 0b10000000, s = 0b00111111;
2
2
  function numberUTF8(t, dist = []) {
3
- if (t < 127) {//0b0xxxxxxx - 0b10xxxxxx
3
+ if (t < 128) {//0b0xxxxxxx - 0b10xxxxxx
4
4
  dist.push(0b00000000 | t)
5
5
  }
6
6
  else if (t < 2048) {// 0b110xxxxx 10xxxxxx
@@ -521,39 +521,63 @@ var createModule = function (exec, originNames, compiledNames, prebuilds = {}) {
521
521
  return exec.apply(_this, args);
522
522
  });
523
523
  };
524
- var bindthen = function (callback) {
525
- return function (data) {
526
- if (Promise && data instanceof Promise) {
527
- data.then(callback);
528
- } else {
529
- callback(data);
530
- }
531
- };
532
- };
533
-
534
524
 
535
525
  var init = function (name, then, prebuilds) {
536
- then = bindthen(then);
526
+ // then = bindthen(then);
537
527
  var key = keyprefix + name;
538
528
  if (prebuilds) {
539
529
  if (name in prebuilds) {
540
- return then(prebuilds[name]);
530
+ if (then) then(prebuilds[name]);
531
+ return prebuilds[name];
541
532
  }
542
533
  }
543
534
  if (hasOwnProperty.call(modules, name)) {
544
- then(modules[name]);
545
- return;
535
+ if (then) then(modules[name]);
536
+ return modules[name];
546
537
  }
547
538
  if (window[name] !== null && window[name] !== void 0 && !hasOwnProperty.call(forceRequest, name)) {
548
- then(modules[name] = window[name]);
549
- return;
539
+ modules[name] = window[name]
540
+ if (then) then(modules[name]);
541
+ return modules[name];
550
542
  }
543
+ var oks = [];
544
+ if (then) oks.push(then);
545
+ var ohs = [];
546
+ var res = {
547
+ oks,
548
+ ohs,
549
+ resolved: null,
550
+ errored: null,
551
+ then(ok, oh) {
552
+ if (ok) this.oks.push(ok);
553
+ if (oh) this.ohs.push(oh);
554
+ this.fire();
555
+ },
556
+ fire() {
557
+ if (this.resolved || this.errored) {
558
+ var oks = this.oks.splice(0, this.oks.length);
559
+ var ohs = this.ohs.splice(0, this.ohs.length);
560
+ if (this.resolved) for (var o of oks) o(this.resolved);
561
+ if (this.errored) for (var o of ohs) o(this.errored);
562
+ }
563
+ },
564
+ };
565
+ then = function (created) {
566
+ if (Promise && created instanceof Promise) return created.then(then, crack);
567
+ res.resolved = created;
568
+ res.fire();
569
+ };
570
+ var crack = function (error) {
571
+ res.errored = error;
572
+ res.fire();
573
+ };
551
574
  loadModule(name, function (error) {
552
575
  if (hasOwnProperty.call(modules, name)) {
553
576
  then(modules[name]);
554
577
  return;
555
578
  }
556
- if (error) return;
579
+ if (error) return crack(error);
580
+
557
581
  var module = loadedModules[key];
558
582
  var args = module.args || [];
559
583
 
@@ -593,6 +617,7 @@ var init = function (name, then, prebuilds) {
593
617
 
594
618
  then(created);
595
619
  }, prebuilds);
620
+ return res;
596
621
  };
597
622
  var forceRequest = {};
598
623
  var removeGlobalProperty = function (property) {
@@ -809,7 +834,7 @@ modules.modules = modules;
809
834
  var requires_count = 3;
810
835
  var hook = function (requires_count) {
811
836
  if (requires_count !== 0) return;
812
- "alert confirm innerWidth innerHeight close".split(/\s+/).map(removeGlobalProperty);
837
+ "alert confirm innerWidth innerHeight close prompt".split(/\s+/).map(removeGlobalProperty);
813
838
  initPixelDecoder();
814
839
  modules.Promise = Promise;
815
840
  modules.hook_time = +new Date;
@@ -268,7 +268,7 @@ function parse(piece) {
268
268
  delete_onempty, delete_onsubmit,
269
269
  } = name;
270
270
  } else {
271
- var test = (reg,a) => {
271
+ var test = (reg, a) => {
272
272
  if (reg.test(a)) {
273
273
  return true;
274
274
  }
@@ -388,7 +388,7 @@ function parse(piece) {
388
388
  options = is(options);
389
389
  var needUnfold = /^\[|\]$/.test(options);
390
390
  options = options.replace(/^\[|\]$/g, '');
391
- if (/,/.test(options)) options = scanSlant(options, ',');
391
+ if (needUnfold || /,/.test(options)) options = scanSlant(options, ',');
392
392
  else options = scanSlant(options, "");
393
393
  if (needUnfold) unfoldOptions(size, options);
394
394
  }
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  module.exports = encode62;
3
+ var encodeUTF8 = require("../basic/encodeUTF8");
4
+ var decodeUTF8 = require("../basic/decodeUTF8");
3
5
  var src = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
4
6
  var map = {};
5
7
  src.split("").forEach((s, i) => map[s] = i);
@@ -31,7 +33,8 @@ Object.assign(encode62, {
31
33
  var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
32
34
  var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
33
35
  var time_stamp = time_start + parseInt(time_rest, 36);
34
- return this.decode62(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36));
36
+ string = this.decode62(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36)).replace(/\.\.?/g, a => a === '.' ? "%" : ".");
37
+ return decodeURIComponent(string);
35
38
  },
36
39
  timeencode(string) {
37
40
  var { time_delta } = this;
@@ -40,6 +43,7 @@ Object.assign(encode62, {
40
43
  var time_rest = time_stamp % time_delta;
41
44
  var time_rest_str = time_rest.toString(36);
42
45
  var time_delta_str = time_delta.toString(36);
46
+ string = encodeURIComponent(string).replace(/\./g, '..').replace(/%/g, '.');
43
47
  return this.encode62(string, time_stamp.toString(36)) + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
44
48
  },
45
49
  timeupdate(string) {
@@ -67,6 +71,20 @@ Object.assign(encode62, {
67
71
  });
68
72
  return result;
69
73
  },
74
+ encodestr(data, sign) {
75
+ if (!sign) return data;
76
+ var result = encodeUTF8(data);
77
+ sign = Buffer.from(sign);
78
+ var delta = 0, c = 0;
79
+ for (var cx = 0, dx = data.length; cx < dx; cx++) {
80
+ if (result[cx] < 128) result[cx] = result[cx] ^ sign[cx % sign.length];
81
+ else if (result[cx] < 192) {
82
+ var c = c << 8 | sign[(delta += 6) / 8 | 0];
83
+ result[cx] = result[cx] ^ (c >> 8 - delta % 8 & 0x3f);
84
+ }
85
+ }
86
+ return decodeUTF8(result);
87
+ },
70
88
  decode(data, sign) {
71
89
  if (!sign) return data;
72
90
  var result = Buffer.from(data);
@@ -99,5 +117,6 @@ Object.assign(encode62, {
99
117
  encode62.ab2c = encode62.ba2d = encode62.huan;
100
118
  encode62.db2a = encode62.ca2b = encode62.yuan;
101
119
  encode62.da2b = encode62.cb2a = encode62.suan;
120
+ encode62.decodestr = encode62.encodestr;
102
121
  encode62.encode = encode62.decode;
103
122
  encode62.decode62 = encode62.encode62;
@@ -0,0 +1,10 @@
1
+ <div head>
2
+ <span v-text="origin?'修改':'添加'"></span><span -text="title"></span>
3
+ </div>
4
+ <div body>
5
+ <field v-if="!f.readonly||!!data[f.key]" -repeat="f in fields" ng-src="[f,data]"></field>
6
+ </div>
7
+ <div foot>
8
+ <btn @click="remove()" class="white">取消</btn>
9
+ <button type="submit">保存</button>
10
+ </div>
@@ -0,0 +1,29 @@
1
+ function main(title, { submit }, { data: origin, fields, }) {
2
+ var page = view();
3
+ var item = Object.assign({}, origin);
4
+ page.innerHTML = edit;
5
+ drag.on(page.firstChild, page);
6
+ resize.on(page);
7
+ page.onback = function () {
8
+ return false;
9
+ };
10
+ renderWithDefaults(page, {
11
+ fields,
12
+ title,
13
+ origin: item,
14
+ data: item,
15
+ remove() {
16
+ remove(page);
17
+ },
18
+ });
19
+ on('submit')(page, async function (e) {
20
+ e.preventDefault();
21
+ await submit(item);
22
+ dispatch(this, 'submited');
23
+ remove(this);
24
+ });
25
+ on("append")(page, lazy(function () {
26
+ page.querySelector("input").focus();
27
+ }));
28
+ return page;
29
+ }
File without changes
@@ -0,0 +1,4 @@
1
+ <div>
2
+ <btn @click="add()">添加</btn>
3
+ </div>
4
+ <table -src="[fields,data]"></table>
@@ -0,0 +1,64 @@
1
+ function main(title, { fields, load, remove }, edit_ref) {
2
+ prepare(edit_ref);
3
+ var page = document.createElement("div");
4
+ var edit = function (o) {
5
+ zimoli.prepare(edit_ref, function () {
6
+ var p = popup(edit_ref, { fields, data: o })
7
+ on("submited")(p, function () {
8
+ console.log("submited")
9
+ page.$scope.load();
10
+ })
11
+ })
12
+ };
13
+ page.innerHTML = template;
14
+ renderWithDefaults(page, {
15
+ title,
16
+ load() {
17
+ this.data = load();
18
+ },
19
+ fields: fields.concat({
20
+ name: "操作",
21
+ options: [
22
+ {
23
+ name: "修改",
24
+ do(o) {
25
+ edit(o);
26
+ },
27
+ },
28
+ {
29
+ type: "danger",
30
+ name(o) {
31
+ return this.confirm === o ? "确认删除" : "删除";
32
+ },
33
+ type(o) {
34
+ return this.confirm === o ? "dark" : "danger";
35
+ },
36
+ confirm: false,
37
+ timer: 0,
38
+ async do(o) {
39
+ if (this.confirm !== o) {
40
+ this.confirm = o;
41
+ clearTimeout(this.timer);
42
+ var that = this;
43
+ this.timer = setTimeout(function () {
44
+ that.confirm = null;
45
+ render.refresh();
46
+ }, 2000);
47
+ return;
48
+ }
49
+ await remove(o);
50
+ page.$scope.load();
51
+ }
52
+ }
53
+ ]
54
+ }),
55
+ data: [],
56
+ add() {
57
+ edit();
58
+ },
59
+ });
60
+ on("append")(page, function () {
61
+ page.$scope.load();
62
+ });
63
+ return page;
64
+ }
@@ -0,0 +1,3 @@
1
+ btn{
2
+ padding: 0 16px;
3
+ }
@@ -1,4 +1,5 @@
1
1
  & {
2
2
  border-top-width: 0;
3
3
  width: 100%;
4
+ overflow: auto;
4
5
  }
@@ -8,4 +8,7 @@ class LoadingArray extends Array {
8
8
  is_readonly = null;
9
9
  loading = null;
10
10
  loading_promise = null;
11
+ then(ok, oh) {
12
+ if (this.loading_promise) this.loading_promise.then(ok, oh);
13
+ }
11
14
  }
@@ -333,25 +333,23 @@ function fixApi(api, href) {
333
333
  }
334
334
  api.base = href;
335
335
  api.path = api.url;
336
- if (/^\.([\?\#][\s\S]*)?$/.test(api.url)) {
337
- api.url = href + api.url.replace(/^\./, "");
338
- } else {
339
- api.url = href + api.url;
336
+ if (/^\.([\?\#][\s\S]*)?$/.test(api.path)) {
337
+ api.path = api.path.replace(/^\./, "");
340
338
  }
341
339
  if (extraSearch || extraHash) {
342
340
  if (/[\?#]/.test(api.url)) {
343
341
  var [, search, hash] = paramReg.exec(api.url);
344
342
  }
345
- var url = api.url.replace(paramReg, '');
343
+ var path = api.path.replace(paramReg, '');
346
344
  if (extraSearch) {
347
345
  search = search ? extraSearch + '&' + search : extraSearch;
348
346
  }
349
347
  if (extraHash) {
350
348
  hash = hash ? extraHash + '&' + hash : extraHash;
351
349
  }
352
- if (search) url += '?' + search;
353
- if (hash) url += "#" + hash;
354
- api.url = url;
350
+ if (search) path += '?' + search;
351
+ if (hash) path += "#" + hash;
352
+ api.path = path;
355
353
  }
356
354
  }
357
355
  }
@@ -434,7 +432,8 @@ var privates = {
434
432
  },
435
433
  fromApi(api, params) {
436
434
  let url = api.url;
437
-
435
+ var base = api.base;
436
+ if (base) url = base + api.path;
438
437
  if (this.validApi(api, params)) {
439
438
  params = this.repare(api, params);
440
439
  return this.loadIgnoreConfig(api.method, url, params, api);
@@ -657,6 +656,9 @@ var data = {
657
656
  data = this.parseConfig(data);
658
657
  configPormise = Promise.resolve(data);
659
658
  },
659
+ getConfig() {
660
+ return privates.getConfigPromise();
661
+ },
660
662
  parseConfig(o) {
661
663
  if (o instanceof Promise) {
662
664
  return o.then(createApiMap);
@@ -9,15 +9,22 @@ var dispatch = "dispatchEvent" in document ? function dispatchEvent(target, even
9
9
  }
10
10
  };
11
11
  function main() {
12
- var target, event;
12
+ var target, event, value;
13
13
  for (var cx = 0, dx = arguments.length; cx < dx; cx++) {
14
14
  var arg = arguments[cx];
15
- if (isString(arg)) {
16
- event = createEvent(arg);
17
- } else if (isNode(arg) || arg === window || arg === document) {
15
+ if (isNode(arg) || arg === window || arg === document) {
18
16
  target = arg;
19
- } else {
20
- event = arg;
17
+ }
18
+ else if (!event) {
19
+ if (isString(arg)) {
20
+ event = createEvent(arg);
21
+ }
22
+ else {
23
+ event = arg;
24
+ }
25
+ }
26
+ else {
27
+ event.value = arg;
21
28
  }
22
29
  }
23
30
  if (dispatch(target || window, event)) {
@@ -23,8 +23,8 @@ var encode62 = {
23
23
  var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
24
24
  var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
25
25
  var time_stamp = time_start + parseInt(time_rest, 36);
26
-
27
- return this.encode(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36));
26
+ string = this.encode(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36)).replace(/\.\.?/g, a => a === '.' ? "%" : ".");
27
+ return decodeURIComponent(string);
28
28
  },
29
29
  timeencode(string) {
30
30
  var { time_delta } = this;
@@ -33,6 +33,7 @@ var encode62 = {
33
33
  var time_rest = time_stamp % time_delta;
34
34
  var time_rest_str = time_rest.toString(36);
35
35
  var time_delta_str = time_delta.toString(36);
36
+ string = encodeURIComponent(string).replace(/\./g, '..').replace(/%/g, '.');
36
37
  return this.encode(string, time_stamp.toString(36)) + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
37
38
  },
38
39
  timeupdate(string) {
@@ -66,12 +66,6 @@ function input(element) {
66
66
  on("keydown")(element, number);
67
67
  break;
68
68
  }
69
- if (format) {
70
- var picker = selectDate(format, input.value);
71
- on("change")(element, picker.update);
72
- select(element, picker);
73
- element.readonly = "readonly";
74
- }
75
69
  }
76
70
  return element;
77
71
  }
@@ -30,13 +30,13 @@
30
30
  display: none;
31
31
  }
32
32
 
33
- &::-webkit-calendar-picker-indicator {
34
- display: none;
35
- }
33
+ // &::-webkit-calendar-picker-indicator {
34
+ // display: none;
35
+ // }
36
36
 
37
- &::-webkit-calendar-picker-indicator:hover {
38
- display: none;
39
- }
37
+ // &::-webkit-calendar-picker-indicator:hover {
38
+ // display: none;
39
+ // }
40
40
 
41
41
  &::-webkit-clear-button {
42
42
  display: none;
@@ -72,9 +72,26 @@ var constructors = {
72
72
  cast(elem, field);
73
73
  return elem;
74
74
  },
75
- select() {
76
- var elem = select();
77
- elem.innerHTML = `<option ng-repeat="(o,i) in field.options" ng-bind="o.name||o" _value="o.key!==undefined?o.key:o"></option>`;
75
+ select(_, t) {
76
+ if (!t) {
77
+ var elem = select();
78
+ elem.innerHTML = `<option ng-repeat="(o,i) in field.options" ng-bind="o.name||o" _value="o.key!==undefined?o.key:o"></option>`;
79
+ }
80
+ else if (t === 'a') {
81
+ var { field, data } = _;
82
+ var pad = selectList(field.options, field.multi, true);
83
+ var e = document.createElement('select');
84
+ var opt = null;
85
+ for (var o of field.options) {
86
+ if (o.key === data[field.key]) {
87
+ opt = o;
88
+ break;
89
+ }
90
+ }
91
+ e.innerHTML = `<option selected value="${opt ? opt.key : ''}">${opt ? opt.name : '请选择'}</option>`;
92
+ e.value = opt ? opt.key : '';
93
+ elem = select(e, pad);
94
+ }
78
95
  return elem;
79
96
  },
80
97
  "repeat"(_, field_type) {