hy-dispatch-ui-v3 0.2.32 → 0.2.34

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 (114) hide show
  1. package/dist/tailwind.css +186 -454
  2. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +5 -5
  3. package/es/components/hyAudioPlayer/js/index.mjs +1 -1
  4. package/es/components/hyAudioPlayer/style/audioPlayer.scss +11 -12
  5. package/es/components/hyButton/button.vue.mjs +50 -35
  6. package/es/components/hyButton/style/button.scss +16 -3
  7. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +2 -2
  8. package/es/components/hyConfirmDialog/confirmMethod.mjs +1 -1
  9. package/es/components/hyConfirmDialog/index.mjs +1 -1
  10. package/es/components/hyCutter/cutter.vue.mjs +1 -1
  11. package/es/components/hyDatePicker/datePicker.vue.mjs +1 -1
  12. package/es/components/hyDialog/dialog.vue.mjs +178 -137
  13. package/es/components/hyDialog/style/dialog.scss +13 -0
  14. package/es/components/hyForm/cpns/formItem.vue.mjs +3 -4
  15. package/es/components/hyForm/form.vue.mjs +2 -1
  16. package/es/components/hyForm/js/useAppForm.mjs +1 -1
  17. package/es/components/hyForm/style/form.scss +56 -54
  18. package/es/components/hyIcon/style/icon.scss +1 -1
  19. package/es/components/hyIconBox/style/iconBox.scss +19 -18
  20. package/es/components/hyInput/input.vue.mjs +4 -1
  21. package/es/components/hyNoPermissions/noPermissions.vue.mjs +1 -1
  22. package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +1 -1
  23. package/es/components/hyOrgCascader/orgCascader.vue.mjs +1 -1
  24. package/es/components/hySearch/cpns/searchItem.vue.mjs +3 -9
  25. package/es/components/hySearch/js/index.mjs +4 -4
  26. package/es/components/hySearch/style/search.scss +51 -50
  27. package/es/components/hyTable/cpns/columnSelect.vue.mjs +39 -42
  28. package/es/components/hyTable/cpns/columnSelectItem.vue.mjs +5 -8
  29. package/es/components/hyTable/cpns/headerItem.vue.mjs +1 -1
  30. package/es/components/hyTable/cpns/virtualTable.vue.mjs +18 -11
  31. package/es/components/hyTable/js/index.mjs +12 -0
  32. package/es/components/hyTable/js/useAppTable.mjs +1 -1
  33. package/es/components/hyTable/style/table.scss +13 -0
  34. package/es/components/hyTable/table.vue.mjs +43 -23
  35. package/es/components/hyTableForm/batchTableForm.vue.mjs +478 -0
  36. package/es/components/hyTableForm/index.mjs +4 -1
  37. package/es/components/hyTableForm/js/index.mjs +123 -0
  38. package/es/components/hyTableForm/js/useAppTableForm.mjs +47 -0
  39. package/es/components/hyTableForm/style/batchTableForm.scss +127 -0
  40. package/es/components/hyTableForm/style/tableForm.scss +42 -0
  41. package/es/components/hyTableForm/tableForm.vue.mjs +452 -7
  42. package/es/components/hyTooltip/tooltip.vue.mjs +6 -6
  43. package/es/components/hyTree/style/index.css +1 -0
  44. package/es/components/hyTree/tree.vue.mjs +2 -0
  45. package/es/components/hyUserAvatar/userAvatar.vue.mjs +2 -2
  46. package/es/components/hyVideoPlayer/cpns/mediaLoading.vue.mjs +1 -1
  47. package/es/components/hyVideoPlayer/js/index.mjs +1 -1
  48. package/es/components/hyVideoPlayer/style/mediaLoading.scss +5 -5
  49. package/es/components/hyVideoPlayer/style/videoPlayer.scss +7 -6
  50. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +6 -6
  51. package/es/components/index.mjs +2 -1
  52. package/es/index.mjs +2 -1
  53. package/es/locale/en.mjs +1 -1
  54. package/es/locale/zh_CN.mjs +1 -1
  55. package/es/style/element/hy-element.scss +3 -2
  56. package/es/style/tailwind.scss +133 -1
  57. package/es/version.mjs +1 -1
  58. package/lib/components/hyAudioPlayer/audioPlayer.vue.js +4 -4
  59. package/lib/components/hyAudioPlayer/js/index.js +1 -1
  60. package/lib/components/hyAudioPlayer/style/audioPlayer.scss +11 -12
  61. package/lib/components/hyButton/button.vue.js +50 -35
  62. package/lib/components/hyButton/style/button.scss +16 -3
  63. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +2 -2
  64. package/lib/components/hyConfirmDialog/confirmMethod.js +1 -1
  65. package/lib/components/hyConfirmDialog/index.js +1 -1
  66. package/lib/components/hyCutter/cutter.vue.js +1 -1
  67. package/lib/components/hyDatePicker/datePicker.vue.js +1 -1
  68. package/lib/components/hyDialog/dialog.vue.js +177 -136
  69. package/lib/components/hyDialog/style/dialog.scss +13 -0
  70. package/lib/components/hyForm/cpns/formItem.vue.js +3 -4
  71. package/lib/components/hyForm/form.vue.js +2 -1
  72. package/lib/components/hyForm/js/useAppForm.js +1 -1
  73. package/lib/components/hyForm/style/form.scss +56 -54
  74. package/lib/components/hyIcon/style/icon.scss +1 -1
  75. package/lib/components/hyIconBox/style/iconBox.scss +19 -18
  76. package/lib/components/hyInput/input.vue.js +4 -1
  77. package/lib/components/hyNoPermissions/noPermissions.vue.js +1 -1
  78. package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +1 -1
  79. package/lib/components/hyOrgCascader/orgCascader.vue.js +1 -1
  80. package/lib/components/hySearch/cpns/searchItem.vue.js +3 -9
  81. package/lib/components/hySearch/js/index.js +4 -4
  82. package/lib/components/hySearch/style/search.scss +51 -50
  83. package/lib/components/hyTable/cpns/columnSelect.vue.js +43 -46
  84. package/lib/components/hyTable/cpns/columnSelectItem.vue.js +4 -7
  85. package/lib/components/hyTable/cpns/headerItem.vue.js +1 -1
  86. package/lib/components/hyTable/cpns/virtualTable.vue.js +18 -11
  87. package/lib/components/hyTable/js/index.js +12 -0
  88. package/lib/components/hyTable/js/useAppTable.js +1 -1
  89. package/lib/components/hyTable/style/table.scss +13 -0
  90. package/lib/components/hyTable/table.vue.js +42 -22
  91. package/lib/components/hyTableForm/batchTableForm.vue.js +482 -0
  92. package/lib/components/hyTableForm/index.js +5 -0
  93. package/lib/components/hyTableForm/js/index.js +127 -0
  94. package/lib/components/hyTableForm/js/useAppTableForm.js +49 -0
  95. package/lib/components/hyTableForm/style/batchTableForm.scss +127 -0
  96. package/lib/components/hyTableForm/style/tableForm.scss +42 -0
  97. package/lib/components/hyTableForm/tableForm.vue.js +451 -6
  98. package/lib/components/hyTooltip/tooltip.vue.js +6 -6
  99. package/lib/components/hyTree/style/index.css +1 -0
  100. package/lib/components/hyTree/tree.vue.js +2 -0
  101. package/lib/components/hyUserAvatar/userAvatar.vue.js +2 -2
  102. package/lib/components/hyVideoPlayer/cpns/mediaLoading.vue.js +1 -1
  103. package/lib/components/hyVideoPlayer/js/index.js +1 -1
  104. package/lib/components/hyVideoPlayer/style/mediaLoading.scss +5 -5
  105. package/lib/components/hyVideoPlayer/style/videoPlayer.scss +7 -6
  106. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +6 -6
  107. package/lib/components/index.js +33 -30
  108. package/lib/index.js +33 -30
  109. package/lib/locale/en.js +1 -1
  110. package/lib/locale/zh_CN.js +1 -1
  111. package/lib/style/element/hy-element.scss +3 -2
  112. package/lib/style/tailwind.scss +133 -1
  113. package/lib/version.js +1 -1
  114. package/package.json +5 -3
@@ -3,9 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tableForm = require('./tableForm.vue.js');
6
+ var batchTableForm = require('./batchTableForm.vue.js');
7
+ var useAppTableForm = require('./js/useAppTableForm.js');
6
8
  var handler = require('../../utils/handler.js');
7
9
 
8
10
  const HyTableForm = handler.withInstall(tableForm.default);
11
+ const HyBatchTableForm = handler.withInstall(batchTableForm.default);
9
12
 
13
+ exports.useAppTableForm = useAppTableForm.useAppTableForm;
14
+ exports.HyBatchTableForm = HyBatchTableForm;
10
15
  exports.HyTableForm = HyTableForm;
11
16
  exports.default = HyTableForm;
@@ -0,0 +1,127 @@
1
+ 'use strict';
2
+
3
+ var XLSX = require('xlsx');
4
+ var dayjs = require('dayjs');
5
+ var vue = require('vue');
6
+ var AsyncValidator = require('async-validator');
7
+ var elementPlus = require('element-plus');
8
+ var index = require('../../hyForm/js/index.js');
9
+ var useApi = require('../../../hooks/useApi.js');
10
+ var form = require('../../../utils/form.js');
11
+ var is = require('../../../utils/is.js');
12
+
13
+ const doValidate = async (target = {}, columns = [], ruleList = {}) => {
14
+ const data = {};
15
+ let rules = {};
16
+ const columnMap = (columns || []).reduce((columnMap2, column) => {
17
+ if (index.columnShowHandler({ model: data }, column)) {
18
+ columnMap2[column.prop] = column;
19
+ rules[column.prop] = column.rules || [];
20
+ form.setValueByProp(data, column.prop, form.getValueByProp(target, column.prop));
21
+ }
22
+ return columnMap2;
23
+ }, {});
24
+ Object.entries(ruleList || {}).forEach(([key, citem]) => {
25
+ if (columnMap[key]) {
26
+ rules[key] = [
27
+ ...is.isArray(citem) ? citem : [citem],
28
+ ...rules[key]
29
+ ].filter(Boolean);
30
+ }
31
+ });
32
+ const validator = new AsyncValidator(rules);
33
+ return validator.validate(data, { firstFields: true }).then((res) => {
34
+ return true;
35
+ }).catch((error) => {
36
+ const { errors, fields } = error;
37
+ if (!errors || !fields) {
38
+ console.error(error);
39
+ }
40
+ return Promise.reject(errors || []);
41
+ });
42
+ };
43
+ const doReadExcel = (files, props) => {
44
+ return new Promise((resolve2, reject) => {
45
+ const { formColumns, beforeDataHandle } = props;
46
+ const fileReader = new FileReader();
47
+ fileReader.onload = (ev) => {
48
+ try {
49
+ const data = ev.target.result;
50
+ const workbook = XLSX.read(data, {
51
+ type: "binary"
52
+ });
53
+ const wsname1 = workbook.SheetNames[0];
54
+ const ws1 = XLSX.utils.sheet_to_json(workbook.Sheets[wsname1]);
55
+ let content = formColumns.reduce((content2, column) => {
56
+ const title = column.import ? column.import.title : column.label;
57
+ return content2.replace(
58
+ new RegExp(`"${title}":`, "g"),
59
+ `"${column.prop}":`
60
+ );
61
+ }, JSON.stringify(ws1));
62
+ let dataSource = JSON.parse(content);
63
+ if (beforeDataHandle) {
64
+ dataSource = dataSource.map((item) => beforeDataHandle(item));
65
+ }
66
+ resolve2(dataSource);
67
+ } catch (err) {
68
+ reject(err);
69
+ }
70
+ };
71
+ fileReader.readAsBinaryString(files[0]);
72
+ });
73
+ };
74
+ const downloadTemplateHandler = async (props) => {
75
+ const { templateConfig } = props;
76
+ const { url, fileName } = templateConfig;
77
+ if (!url) {
78
+ elementPlus.ElMessage.warning("\u8BF7\u914D\u7F6E\u4E0B\u8F7D\u6A21\u677F\u5730\u5740");
79
+ return;
80
+ }
81
+ const { api } = useApi.useApi();
82
+ try {
83
+ const blob = await vue.unref(api).get(url, {
84
+ responseType: "blob"
85
+ });
86
+ blobDownloadFn(blob, fileName).then(() => {
87
+ resolve();
88
+ });
89
+ } catch (err) {
90
+ console.error(err);
91
+ }
92
+ };
93
+ function blobDownloadFn(blob, name) {
94
+ return new Promise((resolve2, reject) => {
95
+ elementPlus.ElMessage.warning("\u5F00\u59CB\u4E0B\u8F7D");
96
+ const today = dayjs().format("YYYY-MM-DD HH:mm:ss");
97
+ const reader = new FileReader();
98
+ reader.readAsDataURL(blob);
99
+ reader.onload = function(ev) {
100
+ let url = null;
101
+ try {
102
+ if (window.navigator.msSaveOrOpenBlob) {
103
+ const blobObject = new Blob([blob]);
104
+ window.navigator.msSaveOrOpenBlob(blobObject, `${name}_${today}.xls`);
105
+ } else {
106
+ url = URL.createObjectURL(new Blob([blob]));
107
+ const a = document.createElement("a");
108
+ document.body.appendChild(a);
109
+ a.href = url;
110
+ a.download = `${name}_${today}.xls`;
111
+ a.target = "_blank";
112
+ a.click();
113
+ a.remove();
114
+ }
115
+ resolve2();
116
+ } catch (error) {
117
+ reject(error);
118
+ } finally {
119
+ if (url) URL.revokeObjectURL(url);
120
+ }
121
+ };
122
+ });
123
+ }
124
+
125
+ exports.doReadExcel = doReadExcel;
126
+ exports.doValidate = doValidate;
127
+ exports.downloadTemplateHandler = downloadTemplateHandler;
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ var useAppTable = require('../../hyTable/js/useAppTable.js');
4
+ var useAppForm = require('../../hyForm/js/useAppForm.js');
5
+ var is = require('../../../utils/is.js');
6
+
7
+ const useAppTableForm = (config = {}) => {
8
+ let { columns } = config || {};
9
+ columns = [
10
+ {
11
+ type: "expand",
12
+ slot: "expand",
13
+ expandType: "expand",
14
+ width: 48
15
+ },
16
+ ...columns.filter(
17
+ (column) => !["expand", "operator"].includes(column.type)
18
+ ),
19
+ {
20
+ label: "\u5BFC\u5165\u72B6\u6001",
21
+ prop: "validateStatus",
22
+ slot: "validateStatus"
23
+ }
24
+ ];
25
+ const { tableColumns } = useAppTable.useAppTable({ columns });
26
+ const { formModel, formColumns } = useAppForm.useAppForm(
27
+ config.formColumns,
28
+ config.formModel
29
+ );
30
+ formColumns.value.forEach((item) => {
31
+ if (is.isString(item.import)) {
32
+ item.import = {
33
+ title: item.import
34
+ };
35
+ } else {
36
+ item.import = {
37
+ title: item.label,
38
+ ...is.isObject(item.import) ? item.import : {}
39
+ };
40
+ }
41
+ });
42
+ return {
43
+ tableColumns,
44
+ formModel,
45
+ formColumns
46
+ };
47
+ };
48
+
49
+ exports.useAppTableForm = useAppTableForm;
@@ -0,0 +1,127 @@
1
+ .hy-batch-table-form {
2
+ position: relative;
3
+ height: 100%;
4
+ max-height: 100vh;
5
+ overflow: hidden;
6
+ .hy-batch-table-form-upload-box {
7
+ height: 340px;
8
+ position: relative;
9
+ border-radius: 8px;
10
+ border: 1px dashed rgba(var(--hy-auxiliary));
11
+ box-sizing: border-box;
12
+ &:hover {
13
+ border-color: rgba(var(--hy-theme));
14
+ }
15
+ .upload-bg {
16
+ position: absolute;
17
+ width: 100%;
18
+ height: 100%;
19
+ perspective: 800px;
20
+ pointer-events: none;
21
+ overflow: hidden;
22
+ &::before {
23
+ display: block;
24
+ content: '';
25
+ position: absolute;
26
+ top: -50%;
27
+ left: -50%;
28
+ width: 200%;
29
+ height: 200%;
30
+ /* 绘制网格线:使用青色,透明度调低,让它融合在 #14273a 背景里 */
31
+ background-image:
32
+ /* 纵向线 */ linear-gradient(
33
+ 90deg,
34
+ rgba(0, 229, 255, 0.1) 1px,
35
+ transparent 1px
36
+ ),
37
+ /* 横向线 */
38
+ linear-gradient(rgba(0, 229, 255, 0.1) 1px, transparent 1px);
39
+
40
+ /* 网格尺寸 40px */
41
+ background-size: 40px 40px;
42
+
43
+ /* 3D 倒伏效果 */
44
+ transform: rotateX(60deg);
45
+
46
+ /* 动效:无限流动 */
47
+ animation: grid-flow 20s linear infinite;
48
+
49
+ /* 遮罩:四周渐隐,让网格不那么生硬 */
50
+ mask-image: radial-gradient(
51
+ circle at 50% 50%,
52
+ black 10%,
53
+ transparent 80%
54
+ );
55
+ -webkit-mask-image: radial-gradient(
56
+ circle at 50% 50%,
57
+ black 10%,
58
+ transparent 80%
59
+ );
60
+ }
61
+ &::after {
62
+ display: block;
63
+ content: '';
64
+ position: absolute;
65
+ top: 0;
66
+ left: 0;
67
+ width: 100%;
68
+ height: 100%;
69
+ background: radial-gradient(
70
+ circle at 50% 50%,
71
+ rgba(0, 229, 255, 0.05) 0%,
72
+ transparent 70%
73
+ );
74
+ }
75
+ }
76
+
77
+ .hy-el-upload {
78
+ width: 100%;
79
+ height: 100%;
80
+ .hy-el-upload-dragger {
81
+ width: 100%;
82
+ height: 100%;
83
+ display: flex;
84
+ flex-direction: column;
85
+ align-items: center;
86
+ justify-content: center;
87
+ border: none;
88
+ &:hover {
89
+ border-color: var(--theme);
90
+ .type-icon-box {
91
+ transform: translateY(-10px);
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+
98
+ .hy-batch-table-form-step-box {
99
+ width: 100%;
100
+ height: 260px;
101
+ font-size: 14px;
102
+ margin-top: 16px;
103
+ padding-top: 24px;
104
+ border-radius: 8px;
105
+ background-color: rgba(var(--hy-background-2), 0.5);
106
+ .hy-el-step {
107
+ .hy-el-step__description {
108
+ padding-left: 0px !important;
109
+ padding-right: 0px !important;
110
+ }
111
+ }
112
+ }
113
+
114
+ .hy-batch-table-form-template-box {
115
+ width: 100%;
116
+ height: 48px;
117
+ display: flex;
118
+ align-items: center;
119
+ justify-content: space-between;
120
+ font-size: 12px;
121
+ padding: 0 16px 0 18px;
122
+ border: 1px dashed rgba(var(--hy-auxiliary), 0.5);
123
+ border-radius: 4px;
124
+ background: rgba(var(--hy-background-2), 0.5);
125
+ }
126
+ }
127
+
@@ -0,0 +1,42 @@
1
+ .hy-table-form {
2
+ display: flex;
3
+ flex-direction: column;
4
+
5
+ .hy-el-table-v2__row.hy-el-table-v2__row-error,
6
+ .hy-el-table-v2__row.hy-el-table-v2__row-error:hover {
7
+ outline: 1px solid rgba(var(--hy-danger-2));
8
+ outline-offset: -1px;
9
+ box-shadow: inset 0px 0px 19px 0px rgba(var(--hy-danger-2), 0.5);
10
+ }
11
+
12
+ .hy-table-form-tabs {
13
+ height: 1.875rem;
14
+ display: flex;
15
+ gap: 2px;
16
+ font-size: 0.875rem;
17
+ color: rgba(var(--hy-auxiliary));
18
+ border: 1px solid rgba(var(--hy-border));
19
+ border-radius: 4px;
20
+ padding: 2px;
21
+ font-size: 0.75rem;
22
+ .hy-table-form-tab-button {
23
+ display: flex;
24
+ align-items: center;
25
+ font-weight: bold;
26
+ padding: 0 0.75rem;
27
+ border: 1px solid transparent;
28
+ border-radius: 2px;
29
+ cursor: pointer;
30
+ transition: all 0.3s linear;
31
+ &:hover {
32
+ color: rgba(var(--hy-main));
33
+ }
34
+ &.is-select {
35
+ color: rgba(var(--hy-main));
36
+ background: linear-gradient(180deg, rgba(var(--hy-theme)) 0%, #2A4968 100%);
37
+ border-image: linear-gradient(180deg, rgba(var(--hy-theme)) 80%, rgba(var(--hy-auxiliary))) 1 1;
38
+ }
39
+ }
40
+ }
41
+ }
42
+