@truenewx/tnxvue3 2.6.2 → 2.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truenewx/tnxvue3",
3
- "version": "2.6.2",
3
+ "version": "2.6.3",
4
4
  "description": "互联网技术解决方案:Vue3扩展支持",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * 基于ElementPlus的扩展支持
4
4
  */
5
- import ElementPlus, {ElLoading, ElMessage, ElMessageBox} from 'element-plus';
5
+ import ElementPlus, { ElLoading, ElMessage, ElMessageBox } from 'element-plus';
6
6
  import ElementPlus_zh_CN from 'element-plus/es/locale/lang/zh-cn';
7
7
  import tnxbs from '@truenewx/tnxcore/src/tnxbs'; // 二次封装组件中使用了Bootstrap的基础样式
8
8
  import tnxvue from '../tnxvue.js';
@@ -87,7 +87,6 @@ const dialogContainerClass = 'tnxel-dialog-container';
87
87
  const drawerContainerClass = 'tnxel-drawer-container';
88
88
 
89
89
  const tnxel = Object.assign({}, tnxbs, tnxvue, {
90
- libs: Object.assign({}, tnxbs.libs, tnxvue.libs, {ElementPlus}),
91
90
  components,
92
91
  _dialogs: [], // 对话框堆栈
93
92
  dialog(content, title, buttons, options, contentProps) {
@@ -119,7 +118,7 @@ const tnxel = Object.assign({}, tnxbs, tnxvue, {
119
118
  theme: options.theme,
120
119
  }).mount(containerSelector);
121
120
  dialogVm.options = Object.assign(dialogVm.options || {}, options);
122
- dialogVm.options.onClosed = this.util.function.around(dialogVm.options.onClosed, function (onClosed) {
121
+ dialogVm.options.onClosed = this.util.function.around(dialogVm.options.onClosed, function(onClosed) {
123
122
  let $container = $(containerSelector);
124
123
  $container.next('.el-overlay').remove();
125
124
  $container.remove();
@@ -176,7 +175,7 @@ const tnxel = Object.assign({}, tnxbs, tnxvue, {
176
175
  }).mount(containerSelector);
177
176
  drawerVm.id = drawerId;
178
177
  drawerVm.options = Object.assign(drawerVm.options || {}, options);
179
- drawerVm.options.onClosed = this.util.function.around(drawerVm.options.onClosed, function (onClosed) {
178
+ drawerVm.options.onClosed = this.util.function.around(drawerVm.options.onClosed, function(onClosed) {
180
179
  let $container = $(containerSelector);
181
180
  $container.next('.el-overlay').remove();
182
181
  $container.remove();
@@ -210,7 +209,7 @@ const tnxel = Object.assign({}, tnxbs, tnxvue, {
210
209
  },
211
210
  _handleZIndex(selector) {
212
211
  const util = this.util;
213
- setTimeout(function () {
212
+ setTimeout(function() {
214
213
  const topZIndex = util.dom.minTopZIndex(2);
215
214
  const element = $(selector);
216
215
  const zIndex = Number(element.css('zIndex'));
@@ -282,7 +281,7 @@ const tnxel = Object.assign({}, tnxbs, tnxvue, {
282
281
  options.cancelButtonText = buttonText;
283
282
  }
284
283
  if (typeof callback === 'function') {
285
- options.callback = function (action) {
284
+ options.callback = function(action) {
286
285
  let yes = undefined;
287
286
  if (action === 'confirm') {
288
287
  yes = options.reverse ? false : true;
@@ -374,14 +373,15 @@ const tnxel = Object.assign({}, tnxbs, tnxvue, {
374
373
  }
375
374
  });
376
375
 
377
- tnxel.install = tnxel.util.function.around(tnxel.install, function (install, vm) {
376
+ tnxel.install = tnxel.util.function.around(tnxel.install, function(install, vm) {
377
+ install.call(window.tnx, vm);
378
378
  vm.use(ElementPlus, {
379
379
  locale: ElementPlus_zh_CN,
380
380
  });
381
- install.call(window.tnx, vm);
381
+ this.libs.ElementPlus = ElementPlus;
382
382
  });
383
383
 
384
- tnxel.router.beforeLeave = tnxel.util.function.around(tnxel.router.beforeLeave, function (beforeLeave, router, from) {
384
+ tnxel.router.beforeLeave = tnxel.util.function.around(tnxel.router.beforeLeave, function(beforeLeave, router, from) {
385
385
  // 页面跳转前关闭当前页面中可能存在的所有消息框和对话框
386
386
  window.tnx._closeMessage();
387
387
  window.tnx.closeDialog(true);
@@ -389,19 +389,19 @@ tnxel.router.beforeLeave = tnxel.util.function.around(tnxel.router.beforeLeave,
389
389
  });
390
390
 
391
391
  tnxel.date = {
392
- formatDateTime: function (row, column, cellValue) {
392
+ formatDateTime: function(row, column, cellValue) {
393
393
  if (cellValue) {
394
394
  return new Date(cellValue).formatDateTime();
395
395
  }
396
396
  return undefined;
397
397
  },
398
- formatDate: function (row, column, cellValue) {
398
+ formatDate: function(row, column, cellValue) {
399
399
  if (cellValue) {
400
400
  return new Date(cellValue).formatDate();
401
401
  }
402
402
  return undefined;
403
403
  },
404
- formatTime: function (row, column, cellValue) {
404
+ formatTime: function(row, column, cellValue) {
405
405
  if (typeof cellValue === 'number') {
406
406
  cellValue = new Date(cellValue);
407
407
  }
@@ -413,7 +413,7 @@ tnxel.date = {
413
413
  }
414
414
  return undefined;
415
415
  },
416
- formatTimeMinute: function (row, column, cellValue) {
416
+ formatTimeMinute: function(row, column, cellValue) {
417
417
  if (typeof cellValue === 'number') {
418
418
  cellValue = new Date(cellValue);
419
419
  }
@@ -428,19 +428,19 @@ tnxel.date = {
428
428
  }
429
429
  return undefined;
430
430
  },
431
- formatDateMinute: function (row, column, cellValue) {
431
+ formatDateMinute: function(row, column, cellValue) {
432
432
  if (cellValue) {
433
433
  return new Date(cellValue).formatDateMinute();
434
434
  }
435
435
  return undefined;
436
436
  },
437
- formatDateMonth: function (row, column, cellValue) {
437
+ formatDateMonth: function(row, column, cellValue) {
438
438
  if (cellValue) {
439
439
  return new Date(cellValue).formatDateMonth();
440
440
  }
441
441
  return undefined;
442
442
  },
443
- formatPermanentableDate: function (row, column, cellValue) {
443
+ formatPermanentableDate: function(row, column, cellValue) {
444
444
  if (Array.isArray(cellValue)) {
445
445
  cellValue = cellValue[column];
446
446
  }
@@ -457,7 +457,7 @@ tnxel.date = {
457
457
  };
458
458
 
459
459
  tnxel.number = {
460
- formatPercent: function (row, column, cellValue) {
460
+ formatPercent: function(row, column, cellValue) {
461
461
  if (typeof cellValue !== 'number') {
462
462
  cellValue = parseFloat(cellValue);
463
463
  }
@@ -489,13 +489,13 @@ tnxel.boolean = {
489
489
  text: '无',
490
490
  }]
491
491
  },
492
- format: function (row, column, cellValue) {
492
+ format: function(row, column, cellValue) {
493
493
  if (typeof cellValue === 'boolean') {
494
494
  cellValue = cellValue.toText();
495
495
  }
496
496
  return cellValue;
497
497
  },
498
- formatHas: function (row, column, cellValue) {
498
+ formatHas: function(row, column, cellValue) {
499
499
  if (typeof cellValue === 'boolean') {
500
500
  cellValue = tnxel.boolean.items.getText('has', cellValue);
501
501
  }
@@ -506,7 +506,7 @@ tnxel.boolean = {
506
506
  tnxel.table = {}
507
507
 
508
508
  const rpc = tnxel.app.rpc;
509
- rpc.handleErrors = tnxel.util.function.around(rpc.handleErrors, function (handleErrors, errors, options) {
509
+ rpc.handleErrors = tnxel.util.function.around(rpc.handleErrors, function(handleErrors, errors, options) {
510
510
  if (options && options.form) {
511
511
  let forms;
512
512
  if (Array.isArray(options.form)) {
package/src/tnxvue.js CHANGED
@@ -27,9 +27,6 @@ const components = {
27
27
  };
28
28
 
29
29
  const tnxvue = Object.assign({}, tnxcore, {
30
- libs: Object.assign({}, tnxcore.libs, {
31
- Vue: Vue
32
- }),
33
30
  components,
34
31
  router: {
35
32
  instance: null,
@@ -62,6 +59,7 @@ const tnxvue = Object.assign({}, tnxcore, {
62
59
  const component = this.components[key];
63
60
  vm.component(component.name, component);
64
61
  }
62
+ this.libs.Vue = Vue;
65
63
  },
66
64
  dialog(content, title, buttons, options, contentProps) {
67
65
  // 默认不实现,由UI框架扩展层实现