hy-dispatch-ui-v3 0.2.53 → 0.2.55

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 (116) hide show
  1. package/dist/tailwind.css +53 -0
  2. package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +39 -10
  3. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +12 -22
  4. package/es/components/hyDialog/dialog.vue.mjs +9 -7
  5. package/es/components/hyForm/cpns/arrayItem.vue.mjs +5 -5
  6. package/es/components/hyForm/cpns/extraItem.vue.mjs +6 -1
  7. package/es/components/hyForm/cpns/formItem.vue.mjs +29 -14
  8. package/es/components/hyForm/js/index.mjs +29 -25
  9. package/es/components/hyForm/js/useAppForm.mjs +15 -30
  10. package/es/components/hyIconBox/iconBox.vue.mjs +1 -1
  11. package/es/components/hyIconBox/style/iconBox.scss +1 -1
  12. package/es/components/hyMap/index.mjs +6 -0
  13. package/es/components/hyMap/js/index.mjs +59 -0
  14. package/es/components/hyMap/map.vue.mjs +59 -0
  15. package/es/components/hyOrgCascader/js/index.mjs +53 -0
  16. package/es/components/hyOrgCascader/orgCascader.vue.mjs +22 -25
  17. package/es/components/hySearch/search.vue.mjs +6 -8
  18. package/es/components/hyTable/cpns/columnSelect.vue.mjs +10 -18
  19. package/es/components/hyTable/table.vue.mjs +8 -11
  20. package/es/components/hyTableActionButton/tableActionButton.vue.mjs +6 -3
  21. package/es/components/hyTableForm/batchTableForm.vue.mjs +182 -135
  22. package/es/components/hyTableForm/js/index.mjs +2 -2
  23. package/es/components/hyTableForm/tableForm.vue.mjs +29 -20
  24. package/es/components/hyTooltip/tooltip.vue.mjs +1 -1
  25. package/es/components/hyTree/js/index.mjs +5 -4
  26. package/es/components/hyTree/tree.vue.mjs +5 -0
  27. package/es/components/index.mjs +1 -0
  28. package/es/hooks/index.mjs +1 -0
  29. package/es/hooks/useApi.mjs +11 -5
  30. package/es/hooks/useAudioPlayerConfig.mjs +13 -5
  31. package/es/hooks/useEnsureHyIcon.mjs +11 -5
  32. package/es/hooks/useLocale.mjs +6 -5
  33. package/es/hooks/usePermissionMap.mjs +13 -5
  34. package/es/hooks/useSubscribe.mjs +28 -0
  35. package/es/hooks/useTooltipConfig.mjs +11 -5
  36. package/es/hooks/useUserAvatarMap.mjs +13 -5
  37. package/es/hooks/useVideoPlayerConfig.mjs +13 -5
  38. package/es/index.mjs +3 -2
  39. package/es/static/map/CFCASIPInput.min.js +258 -0
  40. package/es/static/map/MarkerCluster.css +75 -0
  41. package/es/static/map/bigemap.css +838 -0
  42. package/es/static/map/bigemap.js +5 -0
  43. package/es/static/map/bm.geometryutil.js +754 -0
  44. package/es/static/map/bmDraw.css +329 -0
  45. package/es/static/map/bmDraw.js +181 -0
  46. package/es/static/map/car.png +0 -0
  47. package/es/static/map/markercluster.js +2679 -0
  48. package/es/static/map/moveMarker.js +74 -0
  49. package/es/utils/form.mjs +38 -2
  50. package/es/utils/index.mjs +1 -2
  51. package/es/utils/map/hook/bigMap.mjs +1136 -0
  52. package/es/utils/map/hook/gaode.mjs +683 -0
  53. package/es/utils/map/hook/leafletjs.mjs +1336 -0
  54. package/es/utils/map/index.mjs +291 -0
  55. package/es/utils/map/js/mapProxy.mjs +38 -0
  56. package/es/utils/map/js/webgis.mjs +153 -0
  57. package/es/version.mjs +1 -1
  58. package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +40 -11
  59. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +13 -23
  60. package/lib/components/hyDialog/dialog.vue.js +9 -7
  61. package/lib/components/hyForm/cpns/arrayItem.vue.js +4 -4
  62. package/lib/components/hyForm/cpns/extraItem.vue.js +6 -1
  63. package/lib/components/hyForm/cpns/formItem.vue.js +26 -11
  64. package/lib/components/hyForm/js/index.js +29 -23
  65. package/lib/components/hyForm/js/useAppForm.js +14 -29
  66. package/lib/components/hyIconBox/iconBox.vue.js +1 -1
  67. package/lib/components/hyIconBox/style/iconBox.scss +1 -1
  68. package/lib/components/hyMap/index.js +11 -0
  69. package/lib/components/hyMap/js/index.js +61 -0
  70. package/lib/components/hyMap/map.vue.js +63 -0
  71. package/lib/components/hyOrgCascader/js/index.js +56 -0
  72. package/lib/components/hyOrgCascader/orgCascader.vue.js +21 -24
  73. package/lib/components/hySearch/search.vue.js +4 -6
  74. package/lib/components/hyTable/cpns/columnSelect.vue.js +12 -20
  75. package/lib/components/hyTable/table.vue.js +17 -20
  76. package/lib/components/hyTableActionButton/tableActionButton.vue.js +5 -2
  77. package/lib/components/hyTableForm/batchTableForm.vue.js +181 -134
  78. package/lib/components/hyTableForm/js/index.js +1 -1
  79. package/lib/components/hyTableForm/tableForm.vue.js +29 -20
  80. package/lib/components/hyTooltip/tooltip.vue.js +1 -1
  81. package/lib/components/hyTree/js/index.js +5 -4
  82. package/lib/components/hyTree/tree.vue.js +5 -0
  83. package/lib/components/index.js +22 -20
  84. package/lib/hooks/index.js +3 -0
  85. package/lib/hooks/useApi.js +10 -4
  86. package/lib/hooks/useAudioPlayerConfig.js +12 -4
  87. package/lib/hooks/useEnsureHyIcon.js +10 -4
  88. package/lib/hooks/useLocale.js +5 -4
  89. package/lib/hooks/usePermissionMap.js +12 -4
  90. package/lib/hooks/useSubscribe.js +31 -0
  91. package/lib/hooks/useTooltipConfig.js +10 -4
  92. package/lib/hooks/useUserAvatarMap.js +12 -4
  93. package/lib/hooks/useVideoPlayerConfig.js +12 -4
  94. package/lib/index.js +27 -22
  95. package/lib/static/map/CFCASIPInput.min.js +258 -0
  96. package/lib/static/map/MarkerCluster.css +75 -0
  97. package/lib/static/map/bigemap.css +838 -0
  98. package/lib/static/map/bigemap.js +5 -0
  99. package/lib/static/map/bm.geometryutil.js +754 -0
  100. package/lib/static/map/bmDraw.css +329 -0
  101. package/lib/static/map/bmDraw.js +181 -0
  102. package/lib/static/map/car.png +0 -0
  103. package/lib/static/map/markercluster.js +2679 -0
  104. package/lib/static/map/moveMarker.js +74 -0
  105. package/lib/utils/form.js +38 -0
  106. package/lib/utils/index.js +2 -2
  107. package/lib/utils/map/hook/bigMap.js +1140 -0
  108. package/lib/utils/map/hook/gaode.js +687 -0
  109. package/lib/utils/map/hook/leafletjs.js +1360 -0
  110. package/lib/utils/map/index.js +298 -0
  111. package/lib/utils/map/js/mapProxy.js +44 -0
  112. package/lib/utils/map/js/webgis.js +162 -0
  113. package/lib/version.js +1 -1
  114. package/package.json +16 -1
  115. package/es/utils/bus.mjs +0 -5
  116. package/lib/utils/bus.js +0 -7
@@ -0,0 +1,74 @@
1
+ BM.Marker.addInitHook(function () {
2
+ this.moveOptions = {
3
+ origin: null,
4
+ timer: null,
5
+ done: 0,
6
+ path: null,
7
+ length: 0,
8
+ replay: true
9
+ };
10
+ this.setSpeed = function (speed) {
11
+ this.moveOptions.speed = isNaN(parseFloat(speed)) || parseFloat(speed) <= 0 ? 200 : parseFloat(speed);
12
+ };
13
+ this.getSpeed = function () {
14
+ return this.moveOptions.speed;
15
+ };
16
+ this.moveAlong = function (path, speed, param) {
17
+ path = path instanceof BM.Polyline ? path : new BM.Polyline(path);
18
+ this.moveOptions.path = path;
19
+ this.moveOptions.replay = typeof param.replay === 'boolean'? param.replay : true;
20
+ this.moveOptions.length = BM.GeometryUtil.length(path);
21
+ this.moveOptions.speed = isNaN(parseFloat(speed)) || parseFloat(speed <= 0) ? 200 : parseFloat(speed);
22
+ this._move();
23
+ setTimeout(()=>{
24
+ console.log(this);
25
+ },5000)
26
+ };
27
+ this.pauseMove = function () {
28
+ clearInterval(this.moveOptions.timer);
29
+ this.moveOptions.timer = null;
30
+ };
31
+ this.resumeMove = function () {
32
+ if(!this.moveOptions.path){
33
+ throw('鏈鍏ヨ矾寰�');
34
+ }
35
+ this._move();
36
+ };
37
+ this.stopMove = function () {
38
+ this.pauseMove();
39
+ this.moveOptions.done = 0;
40
+ };
41
+ this._move = function () {
42
+ if (this.moveOptions.timer) return;
43
+ let _t = this;
44
+ this.moveOptions.timer = setInterval(function () {
45
+ let done = _t.moveOptions.done;
46
+ done += _t.moveOptions.speed / 1000 * 20;
47
+ let radio = done / _t.moveOptions.length;
48
+ if (_t.moveOptions.replay) {
49
+ radio >= 1 ? (radio = 0, done = 0) : true;
50
+ } else {
51
+ if (radio >= 1) {
52
+ let p = BM.GeometryUtil.interpolateOnLine(_t._map, _t.moveOptions.path, true);
53
+ p.predecessor+=1;
54
+ let passed = _t.moveOptions.path.getLatLngs().slice(0, p.predecessor+1);
55
+ _t.fire('update_position', { path: passed, index: p.predecessor });
56
+ _t.stopMove();
57
+ return
58
+ }
59
+ }
60
+ _t.moveOptions.done = done;
61
+ let p = BM.GeometryUtil.interpolateOnLine(_t._map, _t.moveOptions.path, radio);
62
+ _t.setLatLng(p.latLng);
63
+ let pre_p = _t.moveOptions.path.getLatLngs()[p.predecessor];
64
+ if (pre_p) {
65
+ let passed = _t.moveOptions.path.getLatLngs().slice(0, p.predecessor + 1);
66
+ passed.push(p.latLng);
67
+ _t.fire('update_position', { path: passed, index: p.predecessor });
68
+ let deg = BM.GeometryUtil.computeAngle(_t._map.project(pre_p), _t._map.project(p.latLng))
69
+ _t._icon.style.transformOrigin = '50% 50%';
70
+ _t._icon.style.transform += ' rotateZ(' + deg + 'deg)';
71
+ }
72
+ }, 20);
73
+ }
74
+ });
package/es/utils/form.mjs CHANGED
@@ -1,4 +1,6 @@
1
- import { isString, isArray } from './is.mjs';
1
+ import { unref } from 'vue';
2
+ import { isString, isArray, isObject, isBoolean, isFunction } from './is.mjs';
3
+ import { useLocale } from '../hooks/useLocale.mjs';
2
4
 
3
5
  function getValueByProp(model, prop) {
4
6
  if (isString(prop)) {
@@ -48,5 +50,39 @@ function clearSpace(value, type = "between") {
48
50
  }
49
51
  return value;
50
52
  }
53
+ const genRuleRequiredMsgHandler = (config) => {
54
+ const { t } = useLocale();
55
+ const { type, prop, label } = config || {};
56
+ if (!prop || !prop?.length) return "";
57
+ switch (type) {
58
+ case "input":
59
+ case "input-number":
60
+ return t("hy.pleaseEnterPlaceholder", [label]);
61
+ case "select":
62
+ case "radio":
63
+ case "checkbox":
64
+ case "date-picker":
65
+ return t("hy.pleaseSelectPlaceholder", [label]);
66
+ default:
67
+ return t("hy.cannotBeEmpty", [label]);
68
+ }
69
+ };
70
+ const requiredHandler = (column, model) => {
71
+ const required = unref(column.required);
72
+ if (isBoolean(required)) return required;
73
+ if (isFunction(required)) return required(column, model);
74
+ return false;
75
+ };
76
+ const columnRuleHandler = (column, model) => {
77
+ let { rules } = column;
78
+ rules = isArray(rules) ? [...rules] : isObject(rules) ? [rules] : [];
79
+ if (column.required) {
80
+ rules.unshift({
81
+ required: requiredHandler(column, model),
82
+ message: genRuleRequiredMsgHandler(column)
83
+ });
84
+ }
85
+ return rules;
86
+ };
51
87
 
52
- export { clearSpace, genValueByProp, getValueByProp, setValueByProp };
88
+ export { clearSpace, columnRuleHandler, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp };
@@ -1,9 +1,8 @@
1
1
  export { parseRem, pxTorem, remToPx, vwToPx } from './adaptive.mjs';
2
- export { bus } from './bus.mjs';
3
2
  export { base64Decrypt, encryptToBase64, generateRandomCode } from './crypto.mjs';
4
3
  export { isArray, isBoolean, isEmpty, isFile, isFunction, isNull, isNumber, isObject, isOverflowing, isPermission, isString, isSupportH265, isSymbol, isUndefined, isVueProxy } from './is.mjs';
5
4
  export { cloneDeep, copyText, createUniqueId, funRunHandler, mergeDeep, withInstall } from './handler.mjs';
6
5
  export { formatDuration, getDefaultValueFormatByType } from './date.mjs';
7
6
  export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './file.mjs';
8
- export { clearSpace, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
7
+ export { clearSpace, columnRuleHandler, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
9
8
  export { PERMISSION } from './permission.mjs';