ai.touchui-vue 1.38.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.
Files changed (58) hide show
  1. package/lib/ai.touchui-vue.common.js +488 -312
  2. package/lib/date-picker.js +23 -16
  3. package/lib/filter.js +6 -4
  4. package/lib/float.js +39 -9
  5. package/lib/import.js +19 -11
  6. package/lib/index.js +1 -1
  7. package/lib/input.js +5 -8
  8. package/lib/progress.js +8 -2
  9. package/lib/select.js +210 -96
  10. package/lib/table.js +112 -96
  11. package/lib/theme/css/theme/B-Design.css +1 -1
  12. package/lib/theme/css/theme/aiplan.css +1 -1
  13. package/lib/theme/css/theme/aiplangd.css +1 -1
  14. package/lib/theme/css/theme/chbn.css +1 -1
  15. package/lib/theme/css/theme/default.css +1 -1
  16. package/lib/theme/css/theme/dt.css +1 -1
  17. package/lib/theme/css/theme/ecloud.css +1 -1
  18. package/lib/theme/css/theme/hongkong.css +1 -1
  19. package/lib/theme/css/theme/logistics.css +1 -1
  20. package/lib/theme/css/theme/narrow.css +1 -1
  21. package/lib/theme/css/theme/sdpf.css +1 -1
  22. package/lib/theme/css/theme/upc.css +1 -1
  23. package/lib/theme/css/theme/website.css +1 -1
  24. package/lib/theme/css/theme/workbench-gz.css +1 -1
  25. package/lib/theme/css/theme/zj.css +1 -1
  26. package/lib/utils/print.js +21 -7
  27. package/lib/utils/validate.js +4 -22
  28. package/package.json +1 -1
  29. package/packages/date-picker/src/.DS_Store +0 -0
  30. package/packages/date-picker/src/date-picker.vue +16 -10
  31. package/packages/filter/src/filter.vue +4 -2
  32. package/packages/float/src/main.vue +37 -7
  33. package/packages/import/src/import.vue +1 -1
  34. package/packages/input/src/input.vue +3 -6
  35. package/packages/progress/src/progress.vue +5 -0
  36. package/packages/select/src/select.vue +95 -19
  37. package/packages/table/src/table.vue +17 -5
  38. package/packages/theme/lib/css/theme/B-Design.css +1 -1
  39. package/packages/theme/lib/css/theme/aiplan.css +1 -1
  40. package/packages/theme/lib/css/theme/aiplangd.css +1 -1
  41. package/packages/theme/lib/css/theme/chbn.css +1 -1
  42. package/packages/theme/lib/css/theme/default.css +1 -1
  43. package/packages/theme/lib/css/theme/dt.css +1 -1
  44. package/packages/theme/lib/css/theme/ecloud.css +1 -1
  45. package/packages/theme/lib/css/theme/hongkong.css +1 -1
  46. package/packages/theme/lib/css/theme/logistics.css +1 -1
  47. package/packages/theme/lib/css/theme/narrow.css +1 -1
  48. package/packages/theme/lib/css/theme/sdpf.css +1 -1
  49. package/packages/theme/lib/css/theme/upc.css +1 -1
  50. package/packages/theme/lib/css/theme/website.css +1 -1
  51. package/packages/theme/lib/css/theme/workbench-gz.css +1 -1
  52. package/packages/theme/lib/css/theme/zj.css +1 -1
  53. package/packages/theme/src/less/element/pic.less +1 -0
  54. package/packages/theme/src/less/element/progress.less +1 -1
  55. package/packages/theme/src/less/element/select.less +8 -0
  56. package/src/index.js +1 -1
  57. package/src/utils/print.js +21 -7
  58. package/src/utils/validate.js +4 -22
@@ -1,5 +1,6 @@
1
1
  .to-pic {
2
2
  overflow:hidden; display:inline-block;
3
+ img { width:100%;}
3
4
  }
4
5
  .to-picViewer {
5
6
  position:fixed; top:0; right:0; bottom:0; left:0;
@@ -44,7 +44,7 @@
44
44
  margin-left:0; white-space:nowrap; position:absolute; left:50%; top:50%; transform:translate(-50%, -50%); font-family:"Microsoft YaHei"; text-align:center;
45
45
  .to-progressTextContent { opacity:0.5; font-size:60%; margin-top:0.5*@gap;}
46
46
  }
47
- .to-progressBar { transition:stroke-dashoffset 2s ease;}
47
+ .to-progressBar.animation { transition:stroke-dashoffset 2s ease;}
48
48
  }
49
49
 
50
50
 
@@ -14,6 +14,14 @@
14
14
  display:flex; flex-wrap:wrap; padding:0 0 ((1+2*@gap)-(1+0.8*@gap))/2 0;
15
15
  .to-tag { vertical-align:top; margin-left:((1+2*@gap)-(1+0.8*@gap))/2; margin-top:((1+2*@gap)-(1+0.8*@gap))/2;}
16
16
  .to-input { margin-bottom:-((1+2*@gap)-(1+0.8*@gap))/2;}
17
+ .to-tag.show-count {
18
+ .to-tagValue {
19
+ width: 3em;
20
+ text-overflow: ellipsis;
21
+ overflow: hidden;
22
+ white-space: nowrap;
23
+ }
24
+ }
17
25
  }
18
26
  .to-selectInput { display:inline-block; vertical-align:top;}
19
27
  .to-input {
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.38.0',
458
+ version: '1.40.0',
459
459
  locale: locale.use,
460
460
  i18n: locale.i18n,
461
461
  install,
@@ -7,8 +7,8 @@ function getBody(areaId) {
7
7
  html.push(document.getElementById(areaId).outerHTML);
8
8
  html.push('</div></div>');
9
9
  html.push('<div id="printFn" class="fn">\r\n');
10
- 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>')
11
- 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>');
10
+ 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>')
11
+ 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>');
12
12
  html.push('\r\n</div>');
13
13
  html.push('\r\n</div>');
14
14
  return html;
@@ -19,11 +19,9 @@ function replaceBodyContent(newContent) {
19
19
  const parser = new DOMParser();
20
20
  const doc = parser.parseFromString(htmlString, 'text/html');
21
21
 
22
- // 使用 DOMPurify 清理 HTML
22
+ // 使用 DOMPurify 清理 HTML(保留必要的安全规则)
23
23
  doc.body.innerHTML = DOMPurify.sanitize(newContent);
24
-
25
- const newHtmlString = doc.documentElement.outerHTML;
26
- return newHtmlString;
24
+ return doc.documentElement.outerHTML;
27
25
  }
28
26
 
29
27
  export default function(areaId, title) {
@@ -32,8 +30,24 @@ export default function(areaId, title) {
32
30
  pwin.document.write(replaceBodyContent(getBody(areaId).join('')));
33
31
  pwin.document.close();
34
32
  pwin.document.documentElement.classList.add('s_print');
33
+
34
+ // 绑定事件(事件委托)
35
+ pwin.document.addEventListener('click', function(e) {
36
+ const target = e.target.closest('[data-action]'); // 找到带 data-action 的按钮
37
+ if (!target) return;
38
+
39
+ const action = target.dataset.action;
40
+ switch (action) {
41
+ case 'close':
42
+ pwin.window.close(); // 关闭打印窗口
43
+ break;
44
+ case 'print':
45
+ pwin.window.print(); // 执行 print 逻辑
46
+ break;
47
+ }
48
+ });
49
+
35
50
  if (title && typeof title === 'string') {
36
51
  pwin.document.title = title;
37
52
  }
38
- pwin = null;
39
53
  }
@@ -295,11 +295,7 @@ const validate = function(dom, isAll = false) {
295
295
  } else {
296
296
  reg = new RegExp(rule)
297
297
  if (!reg.test(value)) {
298
- if (desc.indexOf('-label') > -1) {
299
- formVue.errorTip = t('to.validate.tip.custom', desc, formVue.validateTip ? `,${formVue.validateTip}` : '')
300
- } else {
301
- formVue.errorTip = t('to.validate.tip.customRemark', desc, formVue.validateTip ? `,${formVue.validateTip}` : '')
302
- }
298
+ formVue.errorTip = t('to.validate.tip.custom', desc, formVue.validateTip ? `,${formVue.validateTip}` : '')
303
299
  allPass = false
304
300
  setHiddenErrorNodes(formEl)
305
301
  continue
@@ -312,12 +308,7 @@ const validate = function(dom, isAll = false) {
312
308
  }
313
309
  } else if (required) {
314
310
  formVue.errorType = 'required'
315
- if (desc.indexOf('-label') > -1) {
316
- const desc_label = desc.replace('-label', '')
317
- formVue.errorTip = t('to.validate.tip.required', desc_label)
318
- } else {
319
- formVue.errorTip = t('to.validate.tip.requiredRemark', desc)
320
- }
311
+ formVue.errorTip = t('to.validate.tip.required', desc)
321
312
  allPass = false
322
313
  setHiddenErrorNodes(formEl)
323
314
  continue
@@ -342,11 +333,7 @@ const validate = function(dom, isAll = false) {
342
333
  } else {
343
334
  reg = new RegExp(rule)
344
335
  if (!reg.test(value)) {
345
- if (desc.indexOf('-label') > -1) {
346
- showTip(formEl, t('to.validate.tip.custom', desc, formVue.validateTip ? `,${formVue.validateTip}` : ''))
347
- } else {
348
- showTip(formEl, t('to.validate.tip.customRemark', desc, formVue.validateTip ? `,${formVue.validateTip}` : ''))
349
- }
336
+ showTip(formEl, t('to.validate.tip.custom', desc, formVue.validateTip ? `,${formVue.validateTip}` : ''))
350
337
  return false
351
338
  } else {
352
339
  continue
@@ -356,12 +343,7 @@ const validate = function(dom, isAll = false) {
356
343
  continue
357
344
  }
358
345
  } else if (required) {
359
- if (desc.indexOf('-label') > -1) {
360
- const desc_label = desc.replace('-label', '')
361
- showTip(formEl, t('to.validate.tip.required', desc_label))
362
- } else {
363
- showTip(formEl, t('to.validate.tip.requiredRemark', desc))
364
- }
346
+ showTip(formEl, t('to.validate.tip.required', desc))
365
347
  return false
366
348
  } else {
367
349
  continue