twmodule 0.0.39 → 0.0.40

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/lib/twComp.umd.js CHANGED
@@ -4093,21 +4093,6 @@ var es_string_split = __webpack_require__("0d7a");
4093
4093
  // EXTERNAL MODULE: ./node_modules/_core-js@3.6.5@core-js/modules/web.dom-collections.iterator.js
4094
4094
  var web_dom_collections_iterator = __webpack_require__("af86");
4095
4095
 
4096
- // CONCATENATED MODULE: ./node_modules/_@babel_runtime@7.11.2@@babel/runtime/helpers/esm/defineProperty.js
4097
- function _defineProperty(obj, key, value) {
4098
- if (key in obj) {
4099
- Object.defineProperty(obj, key, {
4100
- value: value,
4101
- enumerable: true,
4102
- configurable: true,
4103
- writable: true
4104
- });
4105
- } else {
4106
- obj[key] = value;
4107
- }
4108
-
4109
- return obj;
4110
- }
4111
4096
  // EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.11.2@@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
4112
4097
  var slicedToArray = __webpack_require__("1998");
4113
4098
 
@@ -4126,10 +4111,6 @@ var slicedToArray = __webpack_require__("1998");
4126
4111
 
4127
4112
 
4128
4113
 
4129
-
4130
-
4131
- var _methods;
4132
-
4133
4114
  /* harmony default export */ var formItemvue_type_script_lang_js_ = ({
4134
4115
  name: 'formItem',
4135
4116
  props: ['formData'],
@@ -4153,7 +4134,7 @@ var _methods;
4153
4134
  };
4154
4135
  },
4155
4136
  mounted: function mounted() {},
4156
- methods: (_methods = {
4137
+ methods: {
4157
4138
  numberChange: function numberChange(data) {
4158
4139
  //数字类型时,字数限制
4159
4140
  if (data.type == 'tel' && data.value) {
@@ -4210,10 +4191,12 @@ var _methods;
4210
4191
  }
4211
4192
 
4212
4193
  data.clicked = true;
4194
+ this.gotoPage(data);
4213
4195
  this.$forceUpdate();
4214
4196
  },
4215
4197
  radioCheckClick: function radioCheckClick(item) {
4216
4198
  item.clicked = true;
4199
+ this.gotoPage(item);
4217
4200
  },
4218
4201
 
4219
4202
  /******************单选复选******start*****************/
@@ -4226,6 +4209,8 @@ var _methods;
4226
4209
 
4227
4210
  _this.currTarget = item;
4228
4211
  _this.radioCheckBoxShow = true;
4212
+
4213
+ _this.gotoPage(item);
4229
4214
  },
4230
4215
  checkAll: function checkAll() {
4231
4216
  //全选
@@ -4275,248 +4260,278 @@ var _methods;
4275
4260
 
4276
4261
  _this.currTarget.valueCopy = _this.currTarget.value;
4277
4262
  _this.radioCheckBoxShow = false;
4278
- }
4279
- }, _defineProperty(_methods, "radioCheckClick", function radioCheckClick(item) {
4280
- item.clicked = true;
4281
- }), _defineProperty(_methods, "gotoPage", function gotoPage(item) {
4282
- setTimeout(function () {
4283
- item.clicked = true;
4284
- }, 300);
4285
- this.$emit('gotoPage', item);
4286
- }), _defineProperty(_methods, "rangeOpenFun", function rangeOpenFun(item) {
4287
- setTimeout(function () {
4288
- item.clicked = true;
4289
- }, 300);
4263
+ },
4290
4264
 
4291
- var _this = this;
4265
+ /******************单选复选******end*****************/
4266
+ gotoPage: function gotoPage(item) {
4267
+ setTimeout(function () {
4268
+ item.clicked = true;
4269
+ }, 300);
4270
+ this.$emit('gotoPage', item);
4271
+ },
4292
4272
 
4293
- _this.currTime = item;
4294
- _this.rangeType = item.rangeType ? item.rangeType : 'range';
4295
- _this.rangeColor = item.rangeColor ? item.rangeColor : '#3399ff';
4296
- _this.startDate = item.startDate ? new Date(item.startDate) : new Date(new Date().setFullYear(new Date().getFullYear() - 10));
4297
- _this.endDate = item.endDate ? new Date(item.endDate) : new Date(new Date().setFullYear(new Date().getFullYear() + 10));
4273
+ /******** 时间段选择触发 ***** start *****/
4274
+ rangeOpenFun: function rangeOpenFun(item) {
4275
+ setTimeout(function () {
4276
+ item.clicked = true;
4277
+ }, 300);
4298
4278
 
4299
- if ((item.startText || item.endText) && item.rangeType == 'range') {
4300
- this.rangeRowHeight = 64;
4301
- }
4279
+ var _this = this;
4302
4280
 
4303
- _this.rangeOpen = true;
4304
- }), _defineProperty(_methods, "rangeConfirm", function rangeConfirm(date) {
4305
- if (this.rangeType == 'range') {
4306
- var _date = Object(slicedToArray["a" /* default */])(date, 2),
4307
- start = _date[0],
4308
- end = _date[1];
4281
+ _this.currTime = item;
4282
+ _this.rangeType = item.rangeType ? item.rangeType : 'range';
4283
+ _this.rangeColor = item.rangeColor ? item.rangeColor : '#3399ff';
4284
+ _this.startDate = item.startDate ? new Date(item.startDate) : new Date(new Date().setFullYear(new Date().getFullYear() - 10));
4285
+ _this.endDate = item.endDate ? new Date(item.endDate) : new Date(new Date().setFullYear(new Date().getFullYear() + 10));
4309
4286
 
4310
- this.currTime.value = "".concat(this.changeDate(start), " - ").concat(this.changeDate(end));
4311
- } else {
4312
- this.currTime.value = this.changeDate(date);
4313
- }
4287
+ if ((item.startText || item.endText) && item.rangeType == 'range') {
4288
+ this.rangeRowHeight = 64;
4289
+ }
4314
4290
 
4315
- this.rangeOpen = false;
4316
- }), _defineProperty(_methods, "formatterRange", function formatterRange(day) {
4317
- if (this.changeDate(day.date) == this.changeDate(new Date())) {
4318
- day.topInfo = '今天';
4319
- }
4291
+ _this.rangeOpen = true;
4292
+ },
4293
+ rangeConfirm: function rangeConfirm(date) {
4294
+ if (this.rangeType == 'range') {
4295
+ var _date = Object(slicedToArray["a" /* default */])(date, 2),
4296
+ start = _date[0],
4297
+ end = _date[1];
4320
4298
 
4321
- if (day.type === 'start') {
4322
- day.bottomInfo = this.currTime.startText ? this.currTime.startText : '';
4323
- } else if (day.type === 'end') {
4324
- day.bottomInfo = this.currTime.endText ? this.currTime.endText : '';
4325
- }
4299
+ this.currTime.value = "".concat(this.changeDate(start), " - ").concat(this.changeDate(end));
4300
+ } else {
4301
+ this.currTime.value = this.changeDate(date);
4302
+ }
4326
4303
 
4327
- return day;
4328
- }), _defineProperty(_methods, "jumpToday", function jumpToday() {
4329
- this.$refs.rangeChoose.reset();
4330
- }), _defineProperty(_methods, "timeOpenFun", function timeOpenFun(item) {
4331
- setTimeout(function () {
4332
- item.clicked = true;
4333
- }, 300);
4304
+ this.rangeOpen = false;
4305
+ this.gotoPage(this.currTime);
4306
+ },
4307
+ formatterRange: function formatterRange(day) {
4308
+ if (this.changeDate(day.date) == this.changeDate(new Date())) {
4309
+ day.topInfo = '今天';
4310
+ }
4334
4311
 
4335
- var _this = this;
4312
+ if (day.type === 'start') {
4313
+ day.bottomInfo = this.currTime.startText ? this.currTime.startText : '';
4314
+ } else if (day.type === 'end') {
4315
+ day.bottomInfo = this.currTime.endText ? this.currTime.endText : '';
4316
+ }
4336
4317
 
4337
- _this.currTime = item;
4338
- _this.timeType = item.timeType ? item.timeType : 'datetime';
4318
+ return day;
4319
+ },
4320
+ jumpToday: function jumpToday() {
4321
+ this.$refs.rangeChoose.reset();
4322
+ },
4339
4323
 
4340
- if (_this.timeType == 'time') {
4341
- _this.pickerValueDate = '';
4342
- }
4324
+ /******** 时间段选择触发 ***** end *****/
4343
4325
 
4344
- _this.startDate = item.startDate ? new Date(item.startDate) : new Date(new Date().setFullYear(new Date().getFullYear() - 10));
4345
- _this.endDate = item.endDate ? new Date(item.endDate) : new Date(new Date().setFullYear(new Date().getFullYear() + 10));
4346
- _this.timeOpen = true;
4347
- }), _defineProperty(_methods, "timeChange", function timeChange(picker) {}), _defineProperty(_methods, "timeConfirm", function timeConfirm(time) {
4348
- this.pickerValueDate = time;
4349
- this.currTime.value = this.timeType == 'time' ? time : this.changeDate(time, this.timeType);
4350
- this.timeOpen = false;
4351
- }), _defineProperty(_methods, "filter", function filter(type, options) {
4352
- if (type === 'minute') {
4353
- return options.filter(function (option) {
4354
- return option % 10 === 0;
4355
- });
4356
- }
4326
+ /******** 时间点选择触发 ***** start *****/
4327
+ timeOpenFun: function timeOpenFun(item) {
4328
+ setTimeout(function () {
4329
+ item.clicked = true;
4330
+ }, 300);
4357
4331
 
4358
- return options;
4359
- }), _defineProperty(_methods, "formatterTime", function formatterTime(type, val) {
4360
- if (type === 'year') {
4361
- return "".concat(val, "\u5E74");
4362
- } else if (type === 'month') {
4363
- return "".concat(val, "\u6708");
4364
- } else if (type === 'day') {
4365
- return "".concat(val, "\u65E5");
4366
- } else if (type === 'hour') {
4367
- return "".concat(val, "\u65F6");
4368
- } else if (type === 'minute') {
4369
- return "".concat(val, "\u5206");
4370
- }
4332
+ var _this = this;
4371
4333
 
4372
- return val;
4373
- }), _defineProperty(_methods, "selectChange", function selectChange(picker, values, index) {
4374
- console.log(index);
4375
- }), _defineProperty(_methods, "rebuildData", function rebuildData(data, num) {
4376
- var _this = this;
4334
+ _this.currTime = item;
4335
+ _this.timeType = item.timeType ? item.timeType : 'datetime';
4377
4336
 
4378
- if (data.length > 0) {
4379
- data.map(function (i) {
4380
- if (i.children && i.children.length > 0) {
4381
- _this.rebuildData(i.children);
4382
- }
4383
- });
4337
+ if (_this.timeType == 'time') {
4338
+ _this.pickerValueDate = '';
4339
+ }
4384
4340
 
4385
- if (num == 2) {
4386
- data.unshift({
4387
- text: '全部',
4388
- value: '',
4389
- children: [{
4390
- text: '',
4391
- value: '',
4392
- children: ''
4393
- }]
4341
+ _this.startDate = item.startDate ? new Date(item.startDate) : new Date(new Date().setFullYear(new Date().getFullYear() - 10));
4342
+ _this.endDate = item.endDate ? new Date(item.endDate) : new Date(new Date().setFullYear(new Date().getFullYear() + 10));
4343
+ _this.timeOpen = true;
4344
+ },
4345
+ timeChange: function timeChange(picker) {},
4346
+ timeConfirm: function timeConfirm(time) {
4347
+ this.pickerValueDate = time;
4348
+ this.currTime.value = this.timeType == 'time' ? time : this.changeDate(time, this.timeType);
4349
+ this.timeOpen = false;
4350
+ this.gotoPage(this.currTime);
4351
+ },
4352
+ filter: function filter(type, options) {
4353
+ if (type === 'minute') {
4354
+ return options.filter(function (option) {
4355
+ return option % 10 === 0;
4394
4356
  });
4395
- } else if (num == 3) {
4396
- data.unshift({
4397
- text: '全部',
4398
- value: '',
4399
- children: [{
4400
- text: '',
4357
+ }
4358
+
4359
+ return options;
4360
+ },
4361
+ formatterTime: function formatterTime(type, val) {
4362
+ if (type === 'year') {
4363
+ return "".concat(val, "\u5E74");
4364
+ } else if (type === 'month') {
4365
+ return "".concat(val, "\u6708");
4366
+ } else if (type === 'day') {
4367
+ return "".concat(val, "\u65E5");
4368
+ } else if (type === 'hour') {
4369
+ return "".concat(val, "\u65F6");
4370
+ } else if (type === 'minute') {
4371
+ return "".concat(val, "\u5206");
4372
+ }
4373
+
4374
+ return val;
4375
+ },
4376
+
4377
+ /******** 时间点选择触发 ***** end *****/
4378
+
4379
+ /**************上拉选择******start*********/
4380
+ selectChange: function selectChange(picker, values, index) {
4381
+ console.log(index);
4382
+ },
4383
+ rebuildData: function rebuildData(data, num) {
4384
+ var _this = this;
4385
+
4386
+ if (data.length > 0) {
4387
+ data.map(function (i) {
4388
+ if (i.children && i.children.length > 0) {
4389
+ _this.rebuildData(i.children);
4390
+ }
4391
+ });
4392
+
4393
+ if (num == 2) {
4394
+ data.unshift({
4395
+ text: '全部',
4401
4396
  value: '',
4402
4397
  children: [{
4403
4398
  text: '',
4404
4399
  value: '',
4405
4400
  children: ''
4406
4401
  }]
4407
- }]
4408
- });
4409
- } else {
4410
- data.unshift({
4411
- text: '全部',
4412
- value: '',
4413
- children: [{
4414
- text: '',
4402
+ });
4403
+ } else if (num == 3) {
4404
+ data.unshift({
4405
+ text: '全部',
4415
4406
  value: '',
4416
- children: ''
4417
- }]
4418
- });
4407
+ children: [{
4408
+ text: '',
4409
+ value: '',
4410
+ children: [{
4411
+ text: '',
4412
+ value: '',
4413
+ children: ''
4414
+ }]
4415
+ }]
4416
+ });
4417
+ } else {
4418
+ data.unshift({
4419
+ text: '全部',
4420
+ value: '',
4421
+ children: [{
4422
+ text: '',
4423
+ value: '',
4424
+ children: ''
4425
+ }]
4426
+ });
4427
+ }
4419
4428
  }
4420
- }
4421
4429
 
4422
- return [{
4423
- text: '',
4424
- value: 0,
4425
- children: data
4426
- }];
4427
- }), _defineProperty(_methods, "selectOneBoxOpen", function selectOneBoxOpen(item) {
4428
- setTimeout(function () {
4429
- item.clicked = true;
4430
- }, 300);
4430
+ return [{
4431
+ text: '',
4432
+ value: 0,
4433
+ children: data
4434
+ }];
4435
+ },
4436
+ selectOneBoxOpen: function selectOneBoxOpen(item) {
4437
+ setTimeout(function () {
4438
+ item.clicked = true;
4439
+ }, 300);
4431
4440
 
4432
- var _this = this;
4441
+ var _this = this;
4433
4442
 
4434
- this.currTarget = item;
4435
- this.selectOneList = [];
4436
- this.selectOneList = JSON.parse(JSON.stringify(item.list));
4443
+ this.currTarget = item;
4444
+ this.selectOneList = [];
4445
+ this.selectOneList = JSON.parse(JSON.stringify(item.list));
4437
4446
 
4438
- if (item.type == 'selectOneContact') {
4439
- var currList = this.rebuildData(this.selectOneList, item.levelNum);
4447
+ if (item.type == 'selectOneContact') {
4448
+ var currList = this.rebuildData(this.selectOneList, item.levelNum);
4440
4449
 
4441
- if (item.valueIndex && item.valueIndex.length > 0) {
4442
- var currIndex = item.valueIndex;
4443
- currList[0].defaultIndex = currIndex[1];
4444
- currList[0].children[currIndex[1]].defaultIndex = currIndex[2];
4445
- currList[0].children[currIndex[1]].children[currIndex[2]].defaultIndex = currIndex[3];
4446
- }
4450
+ if (item.valueIndex && item.valueIndex.length > 0) {
4451
+ var currIndex = item.valueIndex;
4452
+ currList[0].defaultIndex = currIndex[1];
4453
+ currList[0].children[currIndex[1]].defaultIndex = currIndex[2];
4454
+ currList[0].children[currIndex[1]].children[currIndex[2]].defaultIndex = currIndex[3];
4455
+ }
4447
4456
 
4448
- this.selectOneList = currList;
4449
- setTimeout(function () {
4450
- document.getElementsByClassName('van-picker-column')[0].style.display = 'none';
4457
+ this.selectOneList = currList;
4458
+ setTimeout(function () {
4459
+ document.getElementsByClassName('van-picker-column')[0].style.display = 'none';
4451
4460
 
4452
- if (item.valueIndex && item.valueIndex[item.levelNum] == '0') {
4453
- document.getElementsByClassName('van-picker-column')[item.levelNum + 1] ? document.getElementsByClassName('van-picker-column')[item.levelNum + 1].style.display = 'none' : '';
4454
- }
4455
- }, 100);
4456
- } else {
4457
- if (item.value) {
4458
- item.value.split(',').map(function (j) {
4459
- _this.selectOneList.map(function (k) {
4460
- k.values.map(function (l, p) {
4461
- if (j == l.value) {
4462
- k.defaultIndex = p + 1;
4463
- }
4461
+ if (item.valueIndex && item.valueIndex[item.levelNum] == '0') {
4462
+ document.getElementsByClassName('van-picker-column')[item.levelNum + 1] ? document.getElementsByClassName('van-picker-column')[item.levelNum + 1].style.display = 'none' : '';
4463
+ }
4464
+ }, 100);
4465
+ } else {
4466
+ if (item.value) {
4467
+ item.value.split(',').map(function (j) {
4468
+ _this.selectOneList.map(function (k) {
4469
+ k.values.map(function (l, p) {
4470
+ if (j == l.value) {
4471
+ k.defaultIndex = p + 1;
4472
+ }
4473
+ });
4464
4474
  });
4465
4475
  });
4476
+ }
4477
+
4478
+ this.selectOneList.map(function (i) {
4479
+ i.values.unshift({
4480
+ text: '请选择',
4481
+ value: ''
4482
+ });
4466
4483
  });
4484
+ setTimeout(function () {
4485
+ document.getElementsByClassName('van-picker-column')[0].style.display = 'inline-block';
4486
+ }, 100);
4467
4487
  }
4468
4488
 
4469
- this.selectOneList.map(function (i) {
4470
- i.values.unshift({
4471
- text: '请选择',
4472
- value: ''
4473
- });
4474
- });
4475
- setTimeout(function () {
4476
- document.getElementsByClassName('van-picker-column')[0].style.display = 'inline-block';
4477
- }, 100);
4478
- }
4489
+ this.selectOneOpen = true;
4490
+ },
4491
+ selectOneConfirm: function selectOneConfirm(val, index) {
4492
+ var _this = this;
4479
4493
 
4480
- this.selectOneOpen = true;
4481
- }), _defineProperty(_methods, "selectOneConfirm", function selectOneConfirm(val, index) {
4482
- var _this = this;
4494
+ _this.currTarget.showName = '';
4495
+ _this.currTarget.value = '';
4483
4496
 
4484
- _this.currTarget.showName = '';
4485
- _this.currTarget.value = '';
4497
+ if (_this.currTarget.type == 'selectOneContact') {
4498
+ val.map(function (i, j) {
4499
+ if (i) {
4500
+ _this.currTarget.showName += i + '-';
4501
+ }
4502
+ });
4503
+ _this.currTarget.valueIndex = index;
4504
+ var data = _this.selectOneList;
4486
4505
 
4487
- if (_this.currTarget.type == 'selectOneContact') {
4488
- val.map(function (i, j) {
4489
- if (i) {
4490
- _this.currTarget.showName += i + '-';
4506
+ if ((index[1] || index[1] == 0) && data[index[0]].children[index[1]].value) {
4507
+ _this.currTarget.value += data[index[0]].children[index[1]].value + ',';
4491
4508
  }
4492
- });
4493
- _this.currTarget.valueIndex = index;
4494
- var data = _this.selectOneList;
4495
4509
 
4496
- if ((index[1] || index[1] == 0) && data[index[0]].children[index[1]].value) {
4497
- _this.currTarget.value += data[index[0]].children[index[1]].value + ',';
4498
- }
4510
+ if ((index[2] || index[2] == 0) && data[index[0]].children[index[1]].children[index[2]].value) {
4511
+ _this.currTarget.value += data[index[0]].children[index[1]].children[index[2]].value + ',';
4512
+ }
4499
4513
 
4500
- if ((index[2] || index[2] == 0) && data[index[0]].children[index[1]].children[index[2]].value) {
4501
- _this.currTarget.value += data[index[0]].children[index[1]].children[index[2]].value + ',';
4514
+ if ((index[3] || index[3] == 0) && _this.currTarget.levelNum == 3 && data[index[0]].children[index[1]].children[index[2]].children[index[3]].value) {
4515
+ _this.currTarget.value += data[index[0]].children[index[1]].children[index[2]].children[index[3]].value + ',';
4516
+ }
4517
+ } else {
4518
+ val.map(function (i) {
4519
+ if (i.value) {
4520
+ _this.currTarget.showName += i.text + ',';
4521
+ _this.currTarget.value += i.value + ',';
4522
+ }
4523
+ });
4502
4524
  }
4503
4525
 
4504
- if ((index[3] || index[3] == 0) && _this.currTarget.levelNum == 3 && data[index[0]].children[index[1]].children[index[2]].children[index[3]].value) {
4505
- _this.currTarget.value += data[index[0]].children[index[1]].children[index[2]].children[index[3]].value + ',';
4506
- }
4507
- } else {
4508
- val.map(function (i) {
4509
- if (i.value) {
4510
- _this.currTarget.showName += i.text + ',';
4511
- _this.currTarget.value += i.value + ',';
4512
- }
4513
- });
4526
+ _this.currTarget.showName = _this.currTarget.showName.substring(0, _this.currTarget.showName.length - 1);
4527
+ _this.currTarget.value = _this.currTarget.value.substring(0, _this.currTarget.value.length - 1);
4528
+ _this.selectOneOpen = false;
4529
+
4530
+ _this.gotoPage(_this.currTarget);
4514
4531
  }
4532
+ /**************上拉选择******end***************/
4515
4533
 
4516
- _this.currTarget.showName = _this.currTarget.showName.substring(0, _this.currTarget.showName.length - 1);
4517
- _this.currTarget.value = _this.currTarget.value.substring(0, _this.currTarget.value.length - 1);
4518
- _this.selectOneOpen = false;
4519
- }), _methods)
4534
+ }
4520
4535
  });
4521
4536
  var formData1 = {
4522
4537
  //input:text tel正整数 number数字 digit整数 password密码
@@ -8801,7 +8816,7 @@ var mainvue_type_template_id_7c575200_staticRenderFns = []
8801
8816
 
8802
8817
  // CONCATENATED MODULE: ./packages/twFormItem/src/main.vue?vue&type=template&id=7c575200&
8803
8818
 
8804
- // EXTERNAL MODULE: ./examples/components/comPage/formItem/formItem.vue + 5 modules
8819
+ // EXTERNAL MODULE: ./examples/components/comPage/formItem/formItem.vue + 4 modules
8805
8820
  var formItem = __webpack_require__("a303");
8806
8821
 
8807
8822
  // CONCATENATED MODULE: ./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.1.0@babel-loader/lib!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.9.3@vue-loader/lib??vue-loader-options!./packages/twFormItem/src/main.vue?vue&type=script&lang=js&