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.common.js +231 -216
- package/lib/twComp.umd.js +231 -216
- package/lib/twComp.umd.min.js +1 -1
- package/package.json +1 -1
package/lib/twComp.common.js
CHANGED
@@ -4084,21 +4084,6 @@ var es_string_split = __webpack_require__("0d7a");
|
|
4084
4084
|
// EXTERNAL MODULE: ./node_modules/_core-js@3.6.5@core-js/modules/web.dom-collections.iterator.js
|
4085
4085
|
var web_dom_collections_iterator = __webpack_require__("af86");
|
4086
4086
|
|
4087
|
-
// CONCATENATED MODULE: ./node_modules/_@babel_runtime@7.11.2@@babel/runtime/helpers/esm/defineProperty.js
|
4088
|
-
function _defineProperty(obj, key, value) {
|
4089
|
-
if (key in obj) {
|
4090
|
-
Object.defineProperty(obj, key, {
|
4091
|
-
value: value,
|
4092
|
-
enumerable: true,
|
4093
|
-
configurable: true,
|
4094
|
-
writable: true
|
4095
|
-
});
|
4096
|
-
} else {
|
4097
|
-
obj[key] = value;
|
4098
|
-
}
|
4099
|
-
|
4100
|
-
return obj;
|
4101
|
-
}
|
4102
4087
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.11.2@@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
4103
4088
|
var slicedToArray = __webpack_require__("1998");
|
4104
4089
|
|
@@ -4117,10 +4102,6 @@ var slicedToArray = __webpack_require__("1998");
|
|
4117
4102
|
|
4118
4103
|
|
4119
4104
|
|
4120
|
-
|
4121
|
-
|
4122
|
-
var _methods;
|
4123
|
-
|
4124
4105
|
/* harmony default export */ var formItemvue_type_script_lang_js_ = ({
|
4125
4106
|
name: 'formItem',
|
4126
4107
|
props: ['formData'],
|
@@ -4144,7 +4125,7 @@ var _methods;
|
|
4144
4125
|
};
|
4145
4126
|
},
|
4146
4127
|
mounted: function mounted() {},
|
4147
|
-
methods:
|
4128
|
+
methods: {
|
4148
4129
|
numberChange: function numberChange(data) {
|
4149
4130
|
//数字类型时,字数限制
|
4150
4131
|
if (data.type == 'tel' && data.value) {
|
@@ -4201,10 +4182,12 @@ var _methods;
|
|
4201
4182
|
}
|
4202
4183
|
|
4203
4184
|
data.clicked = true;
|
4185
|
+
this.gotoPage(data);
|
4204
4186
|
this.$forceUpdate();
|
4205
4187
|
},
|
4206
4188
|
radioCheckClick: function radioCheckClick(item) {
|
4207
4189
|
item.clicked = true;
|
4190
|
+
this.gotoPage(item);
|
4208
4191
|
},
|
4209
4192
|
|
4210
4193
|
/******************单选复选******start*****************/
|
@@ -4217,6 +4200,8 @@ var _methods;
|
|
4217
4200
|
|
4218
4201
|
_this.currTarget = item;
|
4219
4202
|
_this.radioCheckBoxShow = true;
|
4203
|
+
|
4204
|
+
_this.gotoPage(item);
|
4220
4205
|
},
|
4221
4206
|
checkAll: function checkAll() {
|
4222
4207
|
//全选
|
@@ -4266,248 +4251,278 @@ var _methods;
|
|
4266
4251
|
|
4267
4252
|
_this.currTarget.valueCopy = _this.currTarget.value;
|
4268
4253
|
_this.radioCheckBoxShow = false;
|
4269
|
-
}
|
4270
|
-
}, _defineProperty(_methods, "radioCheckClick", function radioCheckClick(item) {
|
4271
|
-
item.clicked = true;
|
4272
|
-
}), _defineProperty(_methods, "gotoPage", function gotoPage(item) {
|
4273
|
-
setTimeout(function () {
|
4274
|
-
item.clicked = true;
|
4275
|
-
}, 300);
|
4276
|
-
this.$emit('gotoPage', item);
|
4277
|
-
}), _defineProperty(_methods, "rangeOpenFun", function rangeOpenFun(item) {
|
4278
|
-
setTimeout(function () {
|
4279
|
-
item.clicked = true;
|
4280
|
-
}, 300);
|
4254
|
+
},
|
4281
4255
|
|
4282
|
-
|
4256
|
+
/******************单选复选******end*****************/
|
4257
|
+
gotoPage: function gotoPage(item) {
|
4258
|
+
setTimeout(function () {
|
4259
|
+
item.clicked = true;
|
4260
|
+
}, 300);
|
4261
|
+
this.$emit('gotoPage', item);
|
4262
|
+
},
|
4283
4263
|
|
4284
|
-
|
4285
|
-
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4264
|
+
/******** 时间段选择触发 ***** start *****/
|
4265
|
+
rangeOpenFun: function rangeOpenFun(item) {
|
4266
|
+
setTimeout(function () {
|
4267
|
+
item.clicked = true;
|
4268
|
+
}, 300);
|
4289
4269
|
|
4290
|
-
|
4291
|
-
this.rangeRowHeight = 64;
|
4292
|
-
}
|
4270
|
+
var _this = this;
|
4293
4271
|
|
4294
|
-
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
|
4299
|
-
end = _date[1];
|
4272
|
+
_this.currTime = item;
|
4273
|
+
_this.rangeType = item.rangeType ? item.rangeType : 'range';
|
4274
|
+
_this.rangeColor = item.rangeColor ? item.rangeColor : '#3399ff';
|
4275
|
+
_this.startDate = item.startDate ? new Date(item.startDate) : new Date(new Date().setFullYear(new Date().getFullYear() - 10));
|
4276
|
+
_this.endDate = item.endDate ? new Date(item.endDate) : new Date(new Date().setFullYear(new Date().getFullYear() + 10));
|
4300
4277
|
|
4301
|
-
|
4302
|
-
|
4303
|
-
|
4304
|
-
}
|
4278
|
+
if ((item.startText || item.endText) && item.rangeType == 'range') {
|
4279
|
+
this.rangeRowHeight = 64;
|
4280
|
+
}
|
4305
4281
|
|
4306
|
-
|
4307
|
-
|
4308
|
-
|
4309
|
-
|
4310
|
-
|
4282
|
+
_this.rangeOpen = true;
|
4283
|
+
},
|
4284
|
+
rangeConfirm: function rangeConfirm(date) {
|
4285
|
+
if (this.rangeType == 'range') {
|
4286
|
+
var _date = Object(slicedToArray["a" /* default */])(date, 2),
|
4287
|
+
start = _date[0],
|
4288
|
+
end = _date[1];
|
4311
4289
|
|
4312
|
-
|
4313
|
-
|
4314
|
-
|
4315
|
-
|
4316
|
-
}
|
4290
|
+
this.currTime.value = "".concat(this.changeDate(start), " - ").concat(this.changeDate(end));
|
4291
|
+
} else {
|
4292
|
+
this.currTime.value = this.changeDate(date);
|
4293
|
+
}
|
4317
4294
|
|
4318
|
-
|
4319
|
-
|
4320
|
-
|
4321
|
-
|
4322
|
-
|
4323
|
-
|
4324
|
-
|
4295
|
+
this.rangeOpen = false;
|
4296
|
+
this.gotoPage(this.currTime);
|
4297
|
+
},
|
4298
|
+
formatterRange: function formatterRange(day) {
|
4299
|
+
if (this.changeDate(day.date) == this.changeDate(new Date())) {
|
4300
|
+
day.topInfo = '今天';
|
4301
|
+
}
|
4325
4302
|
|
4326
|
-
|
4303
|
+
if (day.type === 'start') {
|
4304
|
+
day.bottomInfo = this.currTime.startText ? this.currTime.startText : '';
|
4305
|
+
} else if (day.type === 'end') {
|
4306
|
+
day.bottomInfo = this.currTime.endText ? this.currTime.endText : '';
|
4307
|
+
}
|
4327
4308
|
|
4328
|
-
|
4329
|
-
|
4309
|
+
return day;
|
4310
|
+
},
|
4311
|
+
jumpToday: function jumpToday() {
|
4312
|
+
this.$refs.rangeChoose.reset();
|
4313
|
+
},
|
4330
4314
|
|
4331
|
-
|
4332
|
-
_this.pickerValueDate = '';
|
4333
|
-
}
|
4315
|
+
/******** 时间段选择触发 ***** end *****/
|
4334
4316
|
|
4335
|
-
|
4336
|
-
|
4337
|
-
|
4338
|
-
|
4339
|
-
|
4340
|
-
this.currTime.value = this.timeType == 'time' ? time : this.changeDate(time, this.timeType);
|
4341
|
-
this.timeOpen = false;
|
4342
|
-
}), _defineProperty(_methods, "filter", function filter(type, options) {
|
4343
|
-
if (type === 'minute') {
|
4344
|
-
return options.filter(function (option) {
|
4345
|
-
return option % 10 === 0;
|
4346
|
-
});
|
4347
|
-
}
|
4317
|
+
/******** 时间点选择触发 ***** start *****/
|
4318
|
+
timeOpenFun: function timeOpenFun(item) {
|
4319
|
+
setTimeout(function () {
|
4320
|
+
item.clicked = true;
|
4321
|
+
}, 300);
|
4348
4322
|
|
4349
|
-
|
4350
|
-
}), _defineProperty(_methods, "formatterTime", function formatterTime(type, val) {
|
4351
|
-
if (type === 'year') {
|
4352
|
-
return "".concat(val, "\u5E74");
|
4353
|
-
} else if (type === 'month') {
|
4354
|
-
return "".concat(val, "\u6708");
|
4355
|
-
} else if (type === 'day') {
|
4356
|
-
return "".concat(val, "\u65E5");
|
4357
|
-
} else if (type === 'hour') {
|
4358
|
-
return "".concat(val, "\u65F6");
|
4359
|
-
} else if (type === 'minute') {
|
4360
|
-
return "".concat(val, "\u5206");
|
4361
|
-
}
|
4323
|
+
var _this = this;
|
4362
4324
|
|
4363
|
-
|
4364
|
-
|
4365
|
-
console.log(index);
|
4366
|
-
}), _defineProperty(_methods, "rebuildData", function rebuildData(data, num) {
|
4367
|
-
var _this = this;
|
4325
|
+
_this.currTime = item;
|
4326
|
+
_this.timeType = item.timeType ? item.timeType : 'datetime';
|
4368
4327
|
|
4369
|
-
|
4370
|
-
|
4371
|
-
|
4372
|
-
_this.rebuildData(i.children);
|
4373
|
-
}
|
4374
|
-
});
|
4328
|
+
if (_this.timeType == 'time') {
|
4329
|
+
_this.pickerValueDate = '';
|
4330
|
+
}
|
4375
4331
|
|
4376
|
-
|
4377
|
-
|
4378
|
-
|
4379
|
-
|
4380
|
-
|
4381
|
-
|
4382
|
-
|
4383
|
-
|
4384
|
-
|
4332
|
+
_this.startDate = item.startDate ? new Date(item.startDate) : new Date(new Date().setFullYear(new Date().getFullYear() - 10));
|
4333
|
+
_this.endDate = item.endDate ? new Date(item.endDate) : new Date(new Date().setFullYear(new Date().getFullYear() + 10));
|
4334
|
+
_this.timeOpen = true;
|
4335
|
+
},
|
4336
|
+
timeChange: function timeChange(picker) {},
|
4337
|
+
timeConfirm: function timeConfirm(time) {
|
4338
|
+
this.pickerValueDate = time;
|
4339
|
+
this.currTime.value = this.timeType == 'time' ? time : this.changeDate(time, this.timeType);
|
4340
|
+
this.timeOpen = false;
|
4341
|
+
this.gotoPage(this.currTime);
|
4342
|
+
},
|
4343
|
+
filter: function filter(type, options) {
|
4344
|
+
if (type === 'minute') {
|
4345
|
+
return options.filter(function (option) {
|
4346
|
+
return option % 10 === 0;
|
4385
4347
|
});
|
4386
|
-
}
|
4387
|
-
|
4388
|
-
|
4389
|
-
|
4390
|
-
|
4391
|
-
|
4348
|
+
}
|
4349
|
+
|
4350
|
+
return options;
|
4351
|
+
},
|
4352
|
+
formatterTime: function formatterTime(type, val) {
|
4353
|
+
if (type === 'year') {
|
4354
|
+
return "".concat(val, "\u5E74");
|
4355
|
+
} else if (type === 'month') {
|
4356
|
+
return "".concat(val, "\u6708");
|
4357
|
+
} else if (type === 'day') {
|
4358
|
+
return "".concat(val, "\u65E5");
|
4359
|
+
} else if (type === 'hour') {
|
4360
|
+
return "".concat(val, "\u65F6");
|
4361
|
+
} else if (type === 'minute') {
|
4362
|
+
return "".concat(val, "\u5206");
|
4363
|
+
}
|
4364
|
+
|
4365
|
+
return val;
|
4366
|
+
},
|
4367
|
+
|
4368
|
+
/******** 时间点选择触发 ***** end *****/
|
4369
|
+
|
4370
|
+
/**************上拉选择******start*********/
|
4371
|
+
selectChange: function selectChange(picker, values, index) {
|
4372
|
+
console.log(index);
|
4373
|
+
},
|
4374
|
+
rebuildData: function rebuildData(data, num) {
|
4375
|
+
var _this = this;
|
4376
|
+
|
4377
|
+
if (data.length > 0) {
|
4378
|
+
data.map(function (i) {
|
4379
|
+
if (i.children && i.children.length > 0) {
|
4380
|
+
_this.rebuildData(i.children);
|
4381
|
+
}
|
4382
|
+
});
|
4383
|
+
|
4384
|
+
if (num == 2) {
|
4385
|
+
data.unshift({
|
4386
|
+
text: '全部',
|
4392
4387
|
value: '',
|
4393
4388
|
children: [{
|
4394
4389
|
text: '',
|
4395
4390
|
value: '',
|
4396
4391
|
children: ''
|
4397
4392
|
}]
|
4398
|
-
}
|
4399
|
-
})
|
4400
|
-
|
4401
|
-
|
4402
|
-
text: '全部',
|
4403
|
-
value: '',
|
4404
|
-
children: [{
|
4405
|
-
text: '',
|
4393
|
+
});
|
4394
|
+
} else if (num == 3) {
|
4395
|
+
data.unshift({
|
4396
|
+
text: '全部',
|
4406
4397
|
value: '',
|
4407
|
-
children:
|
4408
|
-
|
4409
|
-
|
4398
|
+
children: [{
|
4399
|
+
text: '',
|
4400
|
+
value: '',
|
4401
|
+
children: [{
|
4402
|
+
text: '',
|
4403
|
+
value: '',
|
4404
|
+
children: ''
|
4405
|
+
}]
|
4406
|
+
}]
|
4407
|
+
});
|
4408
|
+
} else {
|
4409
|
+
data.unshift({
|
4410
|
+
text: '全部',
|
4411
|
+
value: '',
|
4412
|
+
children: [{
|
4413
|
+
text: '',
|
4414
|
+
value: '',
|
4415
|
+
children: ''
|
4416
|
+
}]
|
4417
|
+
});
|
4418
|
+
}
|
4410
4419
|
}
|
4411
|
-
}
|
4412
4420
|
|
4413
|
-
|
4414
|
-
|
4415
|
-
|
4416
|
-
|
4417
|
-
|
4418
|
-
|
4419
|
-
|
4420
|
-
|
4421
|
-
|
4421
|
+
return [{
|
4422
|
+
text: '',
|
4423
|
+
value: 0,
|
4424
|
+
children: data
|
4425
|
+
}];
|
4426
|
+
},
|
4427
|
+
selectOneBoxOpen: function selectOneBoxOpen(item) {
|
4428
|
+
setTimeout(function () {
|
4429
|
+
item.clicked = true;
|
4430
|
+
}, 300);
|
4422
4431
|
|
4423
|
-
|
4432
|
+
var _this = this;
|
4424
4433
|
|
4425
|
-
|
4426
|
-
|
4427
|
-
|
4434
|
+
this.currTarget = item;
|
4435
|
+
this.selectOneList = [];
|
4436
|
+
this.selectOneList = JSON.parse(JSON.stringify(item.list));
|
4428
4437
|
|
4429
|
-
|
4430
|
-
|
4438
|
+
if (item.type == 'selectOneContact') {
|
4439
|
+
var currList = this.rebuildData(this.selectOneList, item.levelNum);
|
4431
4440
|
|
4432
|
-
|
4433
|
-
|
4434
|
-
|
4435
|
-
|
4436
|
-
|
4437
|
-
|
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
|
+
}
|
4438
4447
|
|
4439
|
-
|
4440
|
-
|
4441
|
-
|
4448
|
+
this.selectOneList = currList;
|
4449
|
+
setTimeout(function () {
|
4450
|
+
document.getElementsByClassName('van-picker-column')[0].style.display = 'none';
|
4442
4451
|
|
4443
|
-
|
4444
|
-
|
4445
|
-
|
4446
|
-
|
4447
|
-
|
4448
|
-
|
4449
|
-
|
4450
|
-
|
4451
|
-
|
4452
|
-
|
4453
|
-
|
4454
|
-
|
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
|
+
}
|
4464
|
+
});
|
4455
4465
|
});
|
4456
4466
|
});
|
4467
|
+
}
|
4468
|
+
|
4469
|
+
this.selectOneList.map(function (i) {
|
4470
|
+
i.values.unshift({
|
4471
|
+
text: '请选择',
|
4472
|
+
value: ''
|
4473
|
+
});
|
4457
4474
|
});
|
4475
|
+
setTimeout(function () {
|
4476
|
+
document.getElementsByClassName('van-picker-column')[0].style.display = 'inline-block';
|
4477
|
+
}, 100);
|
4458
4478
|
}
|
4459
4479
|
|
4460
|
-
this.
|
4461
|
-
|
4462
|
-
|
4463
|
-
|
4464
|
-
});
|
4465
|
-
});
|
4466
|
-
setTimeout(function () {
|
4467
|
-
document.getElementsByClassName('van-picker-column')[0].style.display = 'inline-block';
|
4468
|
-
}, 100);
|
4469
|
-
}
|
4480
|
+
this.selectOneOpen = true;
|
4481
|
+
},
|
4482
|
+
selectOneConfirm: function selectOneConfirm(val, index) {
|
4483
|
+
var _this = this;
|
4470
4484
|
|
4471
|
-
|
4472
|
-
|
4473
|
-
var _this = this;
|
4485
|
+
_this.currTarget.showName = '';
|
4486
|
+
_this.currTarget.value = '';
|
4474
4487
|
|
4475
|
-
|
4476
|
-
|
4488
|
+
if (_this.currTarget.type == 'selectOneContact') {
|
4489
|
+
val.map(function (i, j) {
|
4490
|
+
if (i) {
|
4491
|
+
_this.currTarget.showName += i + '-';
|
4492
|
+
}
|
4493
|
+
});
|
4494
|
+
_this.currTarget.valueIndex = index;
|
4495
|
+
var data = _this.selectOneList;
|
4477
4496
|
|
4478
|
-
|
4479
|
-
|
4480
|
-
if (i) {
|
4481
|
-
_this.currTarget.showName += i + '-';
|
4497
|
+
if ((index[1] || index[1] == 0) && data[index[0]].children[index[1]].value) {
|
4498
|
+
_this.currTarget.value += data[index[0]].children[index[1]].value + ',';
|
4482
4499
|
}
|
4483
|
-
});
|
4484
|
-
_this.currTarget.valueIndex = index;
|
4485
|
-
var data = _this.selectOneList;
|
4486
4500
|
|
4487
|
-
|
4488
|
-
|
4489
|
-
|
4501
|
+
if ((index[2] || index[2] == 0) && data[index[0]].children[index[1]].children[index[2]].value) {
|
4502
|
+
_this.currTarget.value += data[index[0]].children[index[1]].children[index[2]].value + ',';
|
4503
|
+
}
|
4490
4504
|
|
4491
|
-
|
4492
|
-
|
4505
|
+
if ((index[3] || index[3] == 0) && _this.currTarget.levelNum == 3 && data[index[0]].children[index[1]].children[index[2]].children[index[3]].value) {
|
4506
|
+
_this.currTarget.value += data[index[0]].children[index[1]].children[index[2]].children[index[3]].value + ',';
|
4507
|
+
}
|
4508
|
+
} else {
|
4509
|
+
val.map(function (i) {
|
4510
|
+
if (i.value) {
|
4511
|
+
_this.currTarget.showName += i.text + ',';
|
4512
|
+
_this.currTarget.value += i.value + ',';
|
4513
|
+
}
|
4514
|
+
});
|
4493
4515
|
}
|
4494
4516
|
|
4495
|
-
|
4496
|
-
|
4497
|
-
|
4498
|
-
|
4499
|
-
|
4500
|
-
if (i.value) {
|
4501
|
-
_this.currTarget.showName += i.text + ',';
|
4502
|
-
_this.currTarget.value += i.value + ',';
|
4503
|
-
}
|
4504
|
-
});
|
4517
|
+
_this.currTarget.showName = _this.currTarget.showName.substring(0, _this.currTarget.showName.length - 1);
|
4518
|
+
_this.currTarget.value = _this.currTarget.value.substring(0, _this.currTarget.value.length - 1);
|
4519
|
+
_this.selectOneOpen = false;
|
4520
|
+
|
4521
|
+
_this.gotoPage(_this.currTarget);
|
4505
4522
|
}
|
4523
|
+
/**************上拉选择******end***************/
|
4506
4524
|
|
4507
|
-
|
4508
|
-
_this.currTarget.value = _this.currTarget.value.substring(0, _this.currTarget.value.length - 1);
|
4509
|
-
_this.selectOneOpen = false;
|
4510
|
-
}), _methods)
|
4525
|
+
}
|
4511
4526
|
});
|
4512
4527
|
var formData1 = {
|
4513
4528
|
//input:text tel正整数 number数字 digit整数 password密码
|
@@ -8792,7 +8807,7 @@ var mainvue_type_template_id_7c575200_staticRenderFns = []
|
|
8792
8807
|
|
8793
8808
|
// CONCATENATED MODULE: ./packages/twFormItem/src/main.vue?vue&type=template&id=7c575200&
|
8794
8809
|
|
8795
|
-
// EXTERNAL MODULE: ./examples/components/comPage/formItem/formItem.vue +
|
8810
|
+
// EXTERNAL MODULE: ./examples/components/comPage/formItem/formItem.vue + 4 modules
|
8796
8811
|
var formItem = __webpack_require__("a303");
|
8797
8812
|
|
8798
8813
|
// 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&
|