ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* eslint-disable no-var */
// @ts-nocheck all
export default (function () {
  function t() {
    this.name = 'tableTextType';
  }
 
  return (
    (t.prototype.createTarget = function () {
      this.target = $(
        `<div class="hiprint-option-item">\n        <div class="hiprint-option-item-label">\n        字段类型\n        </div>\n        <div class="hiprint-option-item-field">\n        <select class="auto-submit">\n        <option value="" >默认(文本)</option>\n        <option value="text" >文本</option>\n <option value="sequence" >序号</option>\n       <option value="barcode" >条形码</option>\n        <option value="qrcode" >二维码</option>\n    <option value="image" >图片</option>\n        </select>\n        </div>\n    </div>`,
      );
      this.target.on('change', '.auto-submit', function () {
        const val = $(this).val();
        if (val === 'barcode') {
          $('.qrcode-config').addClass('hidden');
          $('.barcode-config').removeClass('hidden');
        } else {
          $('.barcode-config').addClass('hidden');
        }
        if (val === 'qrcode') {
          $('.qrcode-config').addClass('hidden');
          $('.qrcode-config').removeClass('hidden');
        } else {
          $('.qrcode-config').addClass('hidden');
        }
        if (['barcode', 'image', 'qrcode'].includes(val)) {
          $('.image-config').removeClass('hidden');
        } else {
          $('.image-config').addClass('hidden');
        }
      });
      return this.target;
    }),
    (t.prototype.getValue = function () {
      var t = this.target.find('select').val();
      if (t) return t;
    }),
    (t.prototype.setValue = function (t) {
      this.target.find('select').val(t);
    }),
    (t.prototype.destroy = function () {
      this.target.remove();
    }),
    t
  );
})();