ai.touchui-vue 1.39.0 → 1.40.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.
package/lib/input.js CHANGED
@@ -206,7 +206,7 @@ module.exports = require("ai.touchui-vue/lib/mixins/locale");
206
206
  // ESM COMPAT FLAG
207
207
  __webpack_require__.r(__webpack_exports__);
208
208
 
209
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=50eba84f
209
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=57e4aab5
210
210
  var render = function () {
211
211
  var _vm = this
212
212
  var _h = _vm.$createElement
@@ -613,7 +613,7 @@ var staticRenderFns = []
613
613
  render._withStripped = true
614
614
 
615
615
 
616
- // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=50eba84f
616
+ // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=57e4aab5
617
617
 
618
618
  // CONCATENATED MODULE: ./src/utils/string.js
619
619
  function filter(chars, from) {
@@ -1223,7 +1223,7 @@ var tip_default = /*#__PURE__*/__webpack_require__.n(tip_);
1223
1223
 
1224
1224
  // 最小值判断
1225
1225
  if (Number(this.data, 0) < Number(this.min)) {
1226
- this.data = 'NaN';
1226
+ this.data = Number(this.min) + '';
1227
1227
  }
1228
1228
 
1229
1229
  if (Number(this.conversionType) && this.data) {
package/lib/table.js CHANGED
@@ -245,7 +245,7 @@ module.exports = require("ai.touchui-vue/lib/locale");
245
245
  // ESM COMPAT FLAG
246
246
  __webpack_require__.r(__webpack_exports__);
247
247
 
248
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table.vue?vue&type=template&id=a7feb1e0
248
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table.vue?vue&type=template&id=2e5c7c80
249
249
  var render = function () {
250
250
  var _vm = this
251
251
  var _h = _vm.$createElement
@@ -1064,7 +1064,7 @@ var staticRenderFns = []
1064
1064
  render._withStripped = true
1065
1065
 
1066
1066
 
1067
- // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=template&id=a7feb1e0
1067
+ // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=template&id=2e5c7c80
1068
1068
 
1069
1069
  // EXTERNAL MODULE: external "vue"
1070
1070
  var external_vue_ = __webpack_require__(4);
@@ -3984,6 +3984,12 @@ function db(fn) {
3984
3984
 
3985
3985
  methods: {
3986
3986
  init: function init() {
3987
+ if (Number(this.fixTop) > 0 && this.$refs.leftTable) {
3988
+ this.$refs.leftTable.style.top = 0;
3989
+ }
3990
+ if (Number(this.fixTop) > 0 && this.$refs.rightTable) {
3991
+ this.$refs.rightTable.style.top = 0;
3992
+ }
3987
3993
  if (this.$refs && this.$refs.tbody) {
3988
3994
  // 监听 slot 中的 DOM 变化
3989
3995
  var tbody = this.$refs.tbody.$el || this.$refs.tbody;
@@ -4162,12 +4168,18 @@ function db(fn) {
4162
4168
  }
4163
4169
  },
4164
4170
  setFixDiv: function setFixDiv() {
4171
+ var _this8 = this;
4172
+
4165
4173
  if (Number(this.fixTop) > 0 && this.$refs.top && this.$refs.topTable) {
4166
4174
  if (this.hasVScroll()) {
4167
4175
  this.$refs.top.style.width = this.$refs.body.offsetWidth - this.getBarWidth() + 'px';
4168
4176
  }
4169
- this.$refs.topTable.style.width = this.$refs.table.offsetWidth + 'px';
4170
- this.$refs.table.style.width = this.$refs.table.offsetWidth + 'px';
4177
+ this.$refs.topTable.style.width = '';
4178
+ this.$refs.table.style.width = '';
4179
+ this.$nextTick(function () {
4180
+ _this8.$refs.topTable.style.width = _this8.$refs.table.offsetWidth + 'px';
4181
+ _this8.$refs.table.style.width = _this8.$refs.table.offsetWidth + 'px';
4182
+ });
4171
4183
  }
4172
4184
  if (Number(this.fixRight) > 0 && this.$refs.right && this.$el) {
4173
4185
  if (this.hasHScroll()) {
@@ -4203,7 +4215,7 @@ function db(fn) {
4203
4215
  }
4204
4216
  },
4205
4217
  formatData: function formatData() {
4206
- var _this8 = this;
4218
+ var _this9 = this;
4207
4219
 
4208
4220
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
4209
4221
 
@@ -4252,30 +4264,30 @@ function db(fn) {
4252
4264
  setData(dataTemp);
4253
4265
  this.iData = arr;
4254
4266
  setTimeout(function () {
4255
- _this8.changeIDataType = 'default';
4267
+ _this9.changeIDataType = 'default';
4256
4268
  }, 100);
4257
4269
  },
4258
4270
 
4259
4271
  // 设置全选或者不全选
4260
4272
  toggleAllSelection: function toggleAllSelection(checked) {
4261
- var _this9 = this;
4273
+ var _this10 = this;
4262
4274
 
4263
4275
  this.iData.map(function (item) {
4264
4276
  if (!item.disabled) {
4265
- _this9.$set(item, '_checked', checked);
4277
+ _this10.$set(item, '_checked', checked);
4266
4278
  }
4267
4279
  });
4268
4280
  },
4269
4281
 
4270
4282
  // 全选中事件
4271
4283
  handleSelectionAllChange: function handleSelectionAllChange(checked) {
4272
- var _this10 = this;
4284
+ var _this11 = this;
4273
4285
 
4274
4286
  this.isSelectAll = checked;
4275
4287
  this.toggleAllSelection(checked);
4276
4288
  this.iData.map(function (item) {
4277
4289
  if (!item._checked) {
4278
- _this10.removeFromCache(item);
4290
+ _this11.removeFromCache(item);
4279
4291
  }
4280
4292
  });
4281
4293
  this.$emit('change', this.checked, checked);
@@ -4296,14 +4308,18 @@ function db(fn) {
4296
4308
 
4297
4309
  // 行勾选事件
4298
4310
  handleTableRowChecked: function handleTableRowChecked(checked, dataIndex) {
4311
+ var _this12 = this;
4312
+
4299
4313
  var current = this.iData[dataIndex];
4300
4314
  if (!checked) {
4301
4315
  this.removeFromCache(this.iData[dataIndex]);
4302
4316
  }
4303
4317
  this.setSelectAll();
4304
- this.$emit('change', this.checked, checked, current);
4305
- this.$emit('selectionChange', this.selectionValueType === 'tree' ? this.buildHierarchyTree(this.checked) : this.checked, current);
4306
- this.$emit('selection-change', this.selectionValueType === 'tree' ? this.buildHierarchyTree(this.checked) : this.checked, current);
4318
+ this.$nextTick(function () {
4319
+ _this12.$emit('change', _this12.checked, checked, current);
4320
+ _this12.$emit('selectionChange', _this12.selectionValueType === 'tree' ? _this12.buildHierarchyTree(_this12.checked) : _this12.checked, current);
4321
+ _this12.$emit('selection-change', _this12.selectionValueType === 'tree' ? _this12.buildHierarchyTree(_this12.checked) : _this12.checked, current);
4322
+ });
4307
4323
  },
4308
4324
 
4309
4325
  // 从记录中移除
@@ -4339,7 +4355,7 @@ function db(fn) {
4339
4355
 
4340
4356
  // table 点击事件
4341
4357
  handleTableClick: function handleTableClick(event, eventPath) {
4342
- var _this11 = this;
4358
+ var _this13 = this;
4343
4359
 
4344
4360
  if (this.stopClick) {
4345
4361
  return;
@@ -4351,49 +4367,49 @@ function db(fn) {
4351
4367
  if (String(dom.tagName).toLowerCase() === 'tr') {
4352
4368
  (function () {
4353
4369
 
4354
- _this11.lastSelectedRow = dom;
4370
+ _this13.lastSelectedRow = dom;
4355
4371
  var rowIndex = Number(getDataSet(dom).index);
4356
4372
 
4357
- if (_this11.rowSelectable || _this11.selectable) {
4373
+ if (_this13.rowSelectable || _this13.selectable) {
4358
4374
 
4359
4375
  // 行点击事件
4360
- _this11.$emit('row-click', _this11.iData[rowIndex], rowIndex, event);
4361
- if (_this11.highlightCurrentRow) {
4362
- _this11.iData.map(function (item, index) {
4376
+ _this13.$emit('row-click', _this13.iData[rowIndex], rowIndex, event);
4377
+ if (_this13.highlightCurrentRow) {
4378
+ _this13.iData.map(function (item, index) {
4363
4379
  if (index === rowIndex) {
4364
- if (_this11.clearable) {
4380
+ if (_this13.clearable) {
4365
4381
  if (item._on) {
4366
4382
  item._on = false;
4367
4383
  } else {
4368
- _this11.$set(item, '_on', true);
4384
+ _this13.$set(item, '_on', true);
4369
4385
  }
4370
4386
  } else {
4371
- _this11.$set(item, '_on', true);
4387
+ _this13.$set(item, '_on', true);
4372
4388
  }
4373
4389
  } else {
4374
- _this11.$set(item, '_on', false);
4390
+ _this13.$set(item, '_on', false);
4375
4391
  }
4376
4392
  });
4377
4393
  }
4378
4394
 
4379
4395
  // 多选联动
4380
- if (_this11.hasSelection && !_this11.iData[rowIndex].disabled) {
4381
- _this11.iData[rowIndex]._checked = !_this11.iData[rowIndex]._checked;
4382
- _this11.handleTableRowChecked(_this11.iData[rowIndex]._checked, rowIndex);
4396
+ if (_this13.hasSelection && !_this13.iData[rowIndex].disabled) {
4397
+ _this13.iData[rowIndex]._checked = !_this13.iData[rowIndex]._checked;
4398
+ _this13.handleTableRowChecked(_this13.iData[rowIndex]._checked, rowIndex);
4383
4399
  }
4384
4400
 
4385
4401
  // 单选联动
4386
- if (_this11.hasRadio && !_this11.iData[rowIndex].disabled) {
4387
- if (_this11.clickRadio(_this11.iData[rowIndex], rowIndex)) {
4388
- _this11.selectRadio(rowIndex);
4402
+ if (_this13.hasRadio && !_this13.iData[rowIndex].disabled) {
4403
+ if (_this13.clickRadio(_this13.iData[rowIndex], rowIndex)) {
4404
+ _this13.selectRadio(rowIndex);
4389
4405
  }
4390
4406
  }
4391
4407
  }
4392
4408
 
4393
- if (_this11.autoShowDetail) {
4394
- _this11.current = _this11.iData[rowIndex];
4395
- _this11.currentIndex = rowIndex;
4396
- _this11.$refs.detail.open();
4409
+ if (_this13.autoShowDetail) {
4410
+ _this13.current = _this13.iData[rowIndex];
4411
+ _this13.currentIndex = rowIndex;
4412
+ _this13.$refs.detail.open();
4397
4413
  }
4398
4414
  })();
4399
4415
  } else if (String(dom.tagName).toLowerCase() === 'td' && (this.cellSelectable || this.selectable)) {
@@ -4430,7 +4446,7 @@ function db(fn) {
4430
4446
 
4431
4447
  // table鼠标悬移事件
4432
4448
  handleTableMouseover: function handleTableMouseover(event) {
4433
- var _this12 = this;
4449
+ var _this14 = this;
4434
4450
 
4435
4451
  if (!this.$pc) return;
4436
4452
  if (this.rowSelectable || this.selectable) {
@@ -4439,11 +4455,11 @@ function db(fn) {
4439
4455
  var dom = composedPath[i];
4440
4456
  if (String(dom.tagName).toLowerCase() === 'tr' && (this.rowSelectable || this.selectable)) {
4441
4457
  (function () {
4442
- _this12.lastSelectedRow = dom;
4458
+ _this14.lastSelectedRow = dom;
4443
4459
  var rowIndex = Number(getDataSet(dom).index);
4444
- _this12.iData.map(function (item, index) {
4460
+ _this14.iData.map(function (item, index) {
4445
4461
  if (index === rowIndex) {
4446
- _this12.$set(item, '_hover', true);
4462
+ _this14.$set(item, '_hover', true);
4447
4463
  }
4448
4464
  });
4449
4465
  })();
@@ -4454,7 +4470,7 @@ function db(fn) {
4454
4470
 
4455
4471
  // table鼠标悬移事件
4456
4472
  handleTableMouseout: function handleTableMouseout(event) {
4457
- var _this13 = this;
4473
+ var _this15 = this;
4458
4474
 
4459
4475
  if (!this.$pc) return;
4460
4476
  if (this.rowSelectable || this.selectable || this.autoShowDetail || this.longTapAction) {
@@ -4463,17 +4479,17 @@ function db(fn) {
4463
4479
  var dom = composedPath[i];
4464
4480
  if (String(dom.tagName).toLowerCase() === 'tr' && (this.rowSelectable || this.selectable || this.autoShowDetail || this.longTapAction)) {
4465
4481
  (function () {
4466
- _this13.lastSelectedRow = dom;
4482
+ _this15.lastSelectedRow = dom;
4467
4483
  var rowIndex = Number(getDataSet(dom).index);
4468
- _this13.changeIDataType = 'change';
4469
- _this13.iData.map(function (item, index) {
4484
+ _this15.changeIDataType = 'change';
4485
+ _this15.iData.map(function (item, index) {
4470
4486
  if (index === rowIndex) {
4471
- _this13.$set(item, '_hover', false);
4472
- _this13.$set(item, '_active', false);
4487
+ _this15.$set(item, '_hover', false);
4488
+ _this15.$set(item, '_active', false);
4473
4489
  }
4474
4490
  });
4475
- _this13.$nextTick(function () {
4476
- _this13.changeIDataType = 'default';
4491
+ _this15.$nextTick(function () {
4492
+ _this15.changeIDataType = 'default';
4477
4493
  });
4478
4494
  })();
4479
4495
  }
@@ -4483,7 +4499,7 @@ function db(fn) {
4483
4499
 
4484
4500
  // table鼠标按下事件
4485
4501
  handleTableMousedown: function handleTableMousedown(event) {
4486
- var _this14 = this;
4502
+ var _this16 = this;
4487
4503
 
4488
4504
  if ((this.$pad || this.$phone) && event.type === 'touchstart' || this.$pc && event.type === 'mousedown') {
4489
4505
  if (this.rowSelectable || this.selectable || this.autoShowDetail || this.longTapAction) {
@@ -4492,48 +4508,48 @@ function db(fn) {
4492
4508
  var dom = composedPath[i];
4493
4509
  if (String(dom.tagName).toLowerCase() === 'tr' && (this.rowSelectable || this.selectable || this.autoShowDetail || this.longTapAction)) {
4494
4510
  (function () {
4495
- _this14.lastSelectedRow = dom;
4511
+ _this16.lastSelectedRow = dom;
4496
4512
  var rowIndex = Number(getDataSet(dom).index);
4497
- if (_this14.$phone) {
4498
- _this14.isStartLongtap = true;
4499
- _this14.longtapTimer = setTimeout(function () {
4500
- if (_this14.isStartLongtap) {
4513
+ if (_this16.$phone) {
4514
+ _this16.isStartLongtap = true;
4515
+ _this16.longtapTimer = setTimeout(function () {
4516
+ if (_this16.isStartLongtap) {
4501
4517
  event.preventDefault();
4502
- _this14.$emit('contextmenu', _this14.iData[rowIndex], rowIndex, event);
4503
- _this14.stopClick = true;
4518
+ _this16.$emit('contextmenu', _this16.iData[rowIndex], rowIndex, event);
4519
+ _this16.stopClick = true;
4504
4520
 
4505
- _this14.changeIDataType = 'change';
4506
- _this14.iData.map(function (item, index) {
4521
+ _this16.changeIDataType = 'change';
4522
+ _this16.iData.map(function (item, index) {
4507
4523
  if (index === rowIndex) {
4508
- _this14.$set(item, '_active', false);
4524
+ _this16.$set(item, '_active', false);
4509
4525
  }
4510
4526
  });
4511
- _this14.$nextTick(function () {
4512
- _this14.changeIDataType = 'default';
4527
+ _this16.$nextTick(function () {
4528
+ _this16.changeIDataType = 'default';
4513
4529
  });
4514
4530
 
4515
4531
  // 弹出功能列表
4516
- if (_this14.type === 'v' && (_this14.columns.some(function (item) {
4532
+ if (_this16.type === 'v' && (_this16.columns.some(function (item) {
4517
4533
  return item.type === 'action';
4518
- }) && _this14.contextAction || _this14.contextSelection !== null)) {
4519
- _this14.current = _this14.iData[rowIndex];
4520
- _this14.currentIndex = rowIndex;
4521
- _this14.$refs.action.open();
4534
+ }) && _this16.contextAction || _this16.contextSelection !== null)) {
4535
+ _this16.current = _this16.iData[rowIndex];
4536
+ _this16.currentIndex = rowIndex;
4537
+ _this16.$refs.action.open();
4522
4538
  }
4523
4539
  }
4524
- _this14.isStartLongtap = false;
4540
+ _this16.isStartLongtap = false;
4525
4541
  }, 300);
4526
4542
  }
4527
- _this14.changeIDataType = 'change';
4528
- if (_this14.rowSelectable || _this14.selectable || _this14.autoShowDetail) {
4529
- _this14.iData.map(function (item, index) {
4543
+ _this16.changeIDataType = 'change';
4544
+ if (_this16.rowSelectable || _this16.selectable || _this16.autoShowDetail) {
4545
+ _this16.iData.map(function (item, index) {
4530
4546
  if (index === rowIndex) {
4531
- _this14.$set(item, '_active', true);
4547
+ _this16.$set(item, '_active', true);
4532
4548
  }
4533
4549
  });
4534
4550
  }
4535
- _this14.$nextTick(function () {
4536
- _this14.changeIDataType = 'default';
4551
+ _this16.$nextTick(function () {
4552
+ _this16.changeIDataType = 'default';
4537
4553
  });
4538
4554
  })();
4539
4555
  }
@@ -4544,7 +4560,7 @@ function db(fn) {
4544
4560
 
4545
4561
  // table鼠标松开事件
4546
4562
  handleTableMouseup: function handleTableMouseup(event) {
4547
- var _this15 = this;
4563
+ var _this17 = this;
4548
4564
 
4549
4565
  if ((this.$pad || this.$phone) && event.type === 'touchend' || this.$pc && event.type === 'mouseup') {
4550
4566
  if (this.rowSelectable || this.selectable || this.autoShowDetail || this.longTapAction) {
@@ -4553,20 +4569,20 @@ function db(fn) {
4553
4569
  var dom = composedPath[i];
4554
4570
  if (String(dom.tagName).toLowerCase() === 'tr' && (this.rowSelectable || this.selectable || this.autoShowDetail || this.longTapAction)) {
4555
4571
  (function () {
4556
- _this15.lastSelectedRow = dom;
4572
+ _this17.lastSelectedRow = dom;
4557
4573
  var rowIndex = Number(getDataSet(dom).index);
4558
- _this15.changeIDataType = 'change';
4559
- _this15.iData.map(function (item, index) {
4574
+ _this17.changeIDataType = 'change';
4575
+ _this17.iData.map(function (item, index) {
4560
4576
  if (index === rowIndex) {
4561
- _this15.$set(item, '_active', false);
4577
+ _this17.$set(item, '_active', false);
4562
4578
  }
4563
4579
  });
4564
- _this15.$nextTick(function () {
4565
- _this15.changeIDataType = 'default';
4580
+ _this17.$nextTick(function () {
4581
+ _this17.changeIDataType = 'default';
4566
4582
  });
4567
- if (_this15.$phone) {
4568
- _this15.isStartLongtap = false;
4569
- clearInterval(_this15.longtapTimer);
4583
+ if (_this17.$phone) {
4584
+ _this17.isStartLongtap = false;
4585
+ clearInterval(_this17.longtapTimer);
4570
4586
  }
4571
4587
  })();
4572
4588
  }
@@ -4577,7 +4593,7 @@ function db(fn) {
4577
4593
 
4578
4594
  // table鼠标移动事件
4579
4595
  handleTableMousemove: function handleTableMousemove(event) {
4580
- var _this16 = this;
4596
+ var _this18 = this;
4581
4597
 
4582
4598
  this.isStartLongtap = false;
4583
4599
  if (this.rowSelectable || this.selectable || this.autoShowDetail) {
@@ -4586,16 +4602,16 @@ function db(fn) {
4586
4602
  var dom = composedPath[i];
4587
4603
  if (String(dom.tagName).toLowerCase() === 'tr' && (this.rowSelectable || this.selectable || this.autoShowDetail)) {
4588
4604
  (function () {
4589
- _this16.lastSelectedRow = dom;
4605
+ _this18.lastSelectedRow = dom;
4590
4606
  var rowIndex = Number(getDataSet(dom).index);
4591
- _this16.changeIDataType = 'change';
4592
- _this16.iData.map(function (item, index) {
4607
+ _this18.changeIDataType = 'change';
4608
+ _this18.iData.map(function (item, index) {
4593
4609
  if (index === rowIndex) {
4594
- _this16.$set(item, '_active', false);
4610
+ _this18.$set(item, '_active', false);
4595
4611
  }
4596
4612
  });
4597
- _this16.$nextTick(function () {
4598
- _this16.changeIDataType = 'default';
4613
+ _this18.$nextTick(function () {
4614
+ _this18.changeIDataType = 'default';
4599
4615
  });
4600
4616
  })();
4601
4617
  }
@@ -4627,21 +4643,21 @@ function db(fn) {
4627
4643
  }
4628
4644
  },
4629
4645
  handleSortClick: function handleSortClick(item, index) {
4630
- var _this17 = this;
4646
+ var _this19 = this;
4631
4647
 
4632
4648
  var orderType = item.orderType;
4633
4649
  this.columns.map(function (column, columnIndex) {
4634
4650
  if (columnIndex === index) {
4635
4651
  if (!orderType) {
4636
- _this17.$set(column, 'orderType', 'asc');
4652
+ _this19.$set(column, 'orderType', 'asc');
4637
4653
  } else if (orderType === 'asc') {
4638
- _this17.$set(column, 'orderType', 'desc');
4654
+ _this19.$set(column, 'orderType', 'desc');
4639
4655
  } else if (orderType === 'desc') {
4640
- _this17.$set(column, 'orderType', '');
4656
+ _this19.$set(column, 'orderType', '');
4641
4657
  }
4642
4658
  } else {
4643
4659
  if (column.sortable) {
4644
- _this17.$set(column, 'orderType', '');
4660
+ _this19.$set(column, 'orderType', '');
4645
4661
  }
4646
4662
  }
4647
4663
  });
@@ -4802,12 +4818,12 @@ function db(fn) {
4802
4818
 
4803
4819
  // 展开所有
4804
4820
  expandAll: function expandAll() {
4805
- var _this18 = this;
4821
+ var _this20 = this;
4806
4822
 
4807
4823
  if (this.iData.length > 0) {
4808
4824
  this.iData.forEach(function (item, index) {
4809
4825
  if (item._hasChild && item._level === 1 && item._show === true) {
4810
- _this18.$refs.tbody.expandAll(item, index, false);
4826
+ _this20.$refs.tbody.expandAll(item, index, false);
4811
4827
  }
4812
4828
  });
4813
4829
  }
@@ -4815,12 +4831,12 @@ function db(fn) {
4815
4831
 
4816
4832
  // 折叠所有
4817
4833
  collapseAll: function collapseAll() {
4818
- var _this19 = this;
4834
+ var _this21 = this;
4819
4835
 
4820
4836
  if (this.iData.length > 0) {
4821
4837
  this.iData.forEach(function (item, index) {
4822
4838
  if (item._hasChild && item._level === 1 && item._show === true) {
4823
- _this19.$refs.tbody.collapseAll(item, index, false);
4839
+ _this21.$refs.tbody.collapseAll(item, index, false);
4824
4840
  }
4825
4841
  });
4826
4842
  }
@@ -8,10 +8,26 @@ exports.default = function (areaId, title) {
8
8
  pwin.document.write(replaceBodyContent(getBody(areaId).join('')));
9
9
  pwin.document.close();
10
10
  pwin.document.documentElement.classList.add('s_print');
11
+
12
+ // 绑定事件(事件委托)
13
+ pwin.document.addEventListener('click', function (e) {
14
+ var target = e.target.closest('[data-action]'); // 找到带 data-action 的按钮
15
+ if (!target) return;
16
+
17
+ var action = target.dataset.action;
18
+ switch (action) {
19
+ case 'close':
20
+ pwin.window.close(); // 关闭打印窗口
21
+ break;
22
+ case 'print':
23
+ pwin.window.print(); // 执行 print 逻辑
24
+ break;
25
+ }
26
+ });
27
+
11
28
  if (title && typeof title === 'string') {
12
29
  pwin.document.title = title;
13
30
  }
14
- pwin = null;
15
31
  };
16
32
 
17
33
  var _uuid = require('./uuid');
@@ -32,8 +48,8 @@ function getBody(areaId) {
32
48
  html.push(document.getElementById(areaId).outerHTML);
33
49
  html.push('</div></div>');
34
50
  html.push('<div id="printFn" class="fn">\r\n');
35
- html.push('<button type="button" onclick="javascript:window.close();" class="to-button to-box-link to-form-readonly to-box-color-default to-box-mode-fill to-input-fillet-normal"><span class="to-icon-close to-box-color-default"><span style="font-size: 100%;"></span></span><span class="to-buttonText to-hide-keep">关闭</span></button>');
36
- html.push('<button type="button" class="to-button to-box-link to-form-readonly to-box-color-primary to-box-mode-fill to-input-fillet-normal" onclick="javascript:window.print();"><span class="to-icon-print to-box-color-default"><span style="font-size: 100%;"></span></span><span class="to-buttonText to-hide-keep">打印</span></button>');
51
+ html.push('<button type="button" data-action="close" class="to-button to-box-link to-form-readonly to-box-color-default to-box-mode-fill to-input-fillet-normal"><span class="to-icon-close to-box-color-default"><span style="font-size: 100%;"></span></span><span class="to-buttonText to-hide-keep">关闭</span></button>');
52
+ html.push('<button type="button" data-action="print" class="to-button to-box-link to-form-readonly to-box-color-primary to-box-mode-fill to-input-fillet-normal"><span class="to-icon-print to-box-color-default"><span style="font-size: 100%;"></span></span><span class="to-buttonText to-hide-keep">打印2</span></button>');
37
53
  html.push('\r\n</div>');
38
54
  html.push('\r\n</div>');
39
55
  return html;
@@ -44,9 +60,7 @@ function replaceBodyContent(newContent) {
44
60
  var parser = new DOMParser();
45
61
  var doc = parser.parseFromString(htmlString, 'text/html');
46
62
 
47
- // 使用 DOMPurify 清理 HTML
63
+ // 使用 DOMPurify 清理 HTML(保留必要的安全规则)
48
64
  doc.body.innerHTML = _dompurify2.default.sanitize(newContent);
49
-
50
- var newHtmlString = doc.documentElement.outerHTML;
51
- return newHtmlString;
65
+ return doc.documentElement.outerHTML;
52
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai.touchui-vue",
3
- "version": "1.39.0",
3
+ "version": "1.40.0",
4
4
  "description": "TouchUI Component Library for Vue.js.",
5
5
  "main": "lib/ai.touchui-vue.common.js",
6
6
  "files": [
@@ -238,7 +238,7 @@ export default {
238
238
  },
239
239
  handleDisplayBlur() {
240
240
  setTimeout(() => {
241
- if (isNaN(new Date(this.datedisplay))) {
241
+ if (isNaN(new Date(this.datedisplay)) || this.datedisplay.length < 8) {
242
242
  if (this.datedisplay) {
243
243
  this.$emit('errTime')
244
244
  }
@@ -107,9 +107,11 @@ export default {
107
107
  type.children.find(item=>{
108
108
  return item.on
109
109
  }).on = false
110
- type.children.find(item=>{
110
+
111
+ const el = type.children.find(item=>{
111
112
  return item.value === val[key]
112
- }).on = true
113
+ })
114
+ this.$set(el, 'on', true)
113
115
  }
114
116
  })
115
117
  }
@@ -582,7 +582,7 @@ export default {
582
582
 
583
583
  // 最小值判断
584
584
  if (Number(this.data, 0) < Number(this.min)) {
585
- this.data = 'NaN';
585
+ this.data = Number(this.min) + '';
586
586
  }
587
587
 
588
588
  if (Number(this.conversionType) && this.data) {
@@ -727,6 +727,12 @@ export default {
727
727
  },
728
728
  methods: {
729
729
  init() {
730
+ if (Number(this.fixTop) > 0 && this.$refs.leftTable) {
731
+ this.$refs.leftTable.style.top = 0;
732
+ }
733
+ if (Number(this.fixTop) > 0 && this.$refs.rightTable) {
734
+ this.$refs.rightTable.style.top = 0;
735
+ }
730
736
  if (this.$refs && this.$refs.tbody) {
731
737
  // 监听 slot 中的 DOM 变化
732
738
  let tbody = this.$refs.tbody.$el || this.$refs.tbody
@@ -899,8 +905,12 @@ export default {
899
905
  if (this.hasVScroll()) {
900
906
  this.$refs.top.style.width = this.$refs.body.offsetWidth - this.getBarWidth() + 'px'
901
907
  }
902
- this.$refs.topTable.style.width = this.$refs.table.offsetWidth + 'px'
903
- this.$refs.table.style.width = this.$refs.table.offsetWidth + 'px'
908
+ this.$refs.topTable.style.width = ''
909
+ this.$refs.table.style.width = ''
910
+ this.$nextTick(()=>{
911
+ this.$refs.topTable.style.width = this.$refs.table.offsetWidth + 'px'
912
+ this.$refs.table.style.width = this.$refs.table.offsetWidth + 'px'
913
+ })
904
914
  }
905
915
  if (Number(this.fixRight) > 0 && this.$refs.right && this.$el) {
906
916
  if (this.hasHScroll()) {
@@ -1022,9 +1032,11 @@ export default {
1022
1032
  this.removeFromCache(this.iData[dataIndex])
1023
1033
  }
1024
1034
  this.setSelectAll()
1025
- this.$emit('change', this.checked, checked, current)
1026
- this.$emit('selectionChange', this.selectionValueType === 'tree' ? this.buildHierarchyTree(this.checked) : this.checked, current)
1027
- this.$emit('selection-change', this.selectionValueType === 'tree' ? this.buildHierarchyTree(this.checked) : this.checked, current)
1035
+ this.$nextTick(()=>{
1036
+ this.$emit('change', this.checked, checked, current)
1037
+ this.$emit('selectionChange', this.selectionValueType === 'tree' ? this.buildHierarchyTree(this.checked) : this.checked, current)
1038
+ this.$emit('selection-change', this.selectionValueType === 'tree' ? this.buildHierarchyTree(this.checked) : this.checked, current)
1039
+ })
1028
1040
  },
1029
1041
  // 从记录中移除
1030
1042
  removeFromCache(rowData) {
package/src/index.js CHANGED
@@ -455,7 +455,7 @@ if (typeof window !== 'undefined' && window.Vue) {
455
455
  }
456
456
 
457
457
  export default {
458
- version: '1.39.0',
458
+ version: '1.40.0',
459
459
  locale: locale.use,
460
460
  i18n: locale.i18n,
461
461
  install,