hy-dispatch-ui-v3 0.2.53 → 0.2.54

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/lib/utils/form.js CHANGED
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ var vue = require('vue');
3
4
  var is = require('./is.js');
5
+ var useLocale = require('../hooks/useLocale.js');
4
6
 
5
7
  function getValueByProp(model, prop) {
6
8
  if (is.isString(prop)) {
@@ -50,8 +52,44 @@ function clearSpace(value, type = "between") {
50
52
  }
51
53
  return value;
52
54
  }
55
+ const genRuleRequiredMsgHandler = (config) => {
56
+ const { t } = useLocale.useLocale();
57
+ const { type, prop, label } = config || {};
58
+ if (!prop || !prop?.length) return "";
59
+ switch (type) {
60
+ case "input":
61
+ case "input-number":
62
+ return t("hy.pleaseEnterPlaceholder", [label]);
63
+ case "select":
64
+ case "radio":
65
+ case "checkbox":
66
+ case "date-picker":
67
+ return t("hy.pleaseSelectPlaceholder", [label]);
68
+ default:
69
+ return t("hy.cannotBeEmpty", [label]);
70
+ }
71
+ };
72
+ const requiredHandler = (column, model) => {
73
+ const required = vue.unref(column.required);
74
+ if (is.isBoolean(required)) return required;
75
+ if (is.isFunction(required)) return required(column, model);
76
+ return false;
77
+ };
78
+ const columnRuleHandler = (column, model) => {
79
+ let { rules } = column;
80
+ rules = is.isArray(rules) ? [...rules] : is.isObject(rules) ? [rules] : [];
81
+ if (column.required) {
82
+ rules.unshift({
83
+ required: requiredHandler(column, model),
84
+ message: genRuleRequiredMsgHandler(column)
85
+ });
86
+ }
87
+ return rules;
88
+ };
53
89
 
54
90
  exports.clearSpace = clearSpace;
91
+ exports.columnRuleHandler = columnRuleHandler;
92
+ exports.genRuleRequiredMsgHandler = genRuleRequiredMsgHandler;
55
93
  exports.genValueByProp = genValueByProp;
56
94
  exports.getValueByProp = getValueByProp;
57
95
  exports.setValueByProp = setValueByProp;
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var adaptive = require('./adaptive.js');
4
- var bus = require('./bus.js');
5
4
  var crypto = require('./crypto.js');
6
5
  var is = require('./is.js');
7
6
  var handler = require('./handler.js');
@@ -16,7 +15,6 @@ exports.parseRem = adaptive.parseRem;
16
15
  exports.pxTorem = adaptive.pxTorem;
17
16
  exports.remToPx = adaptive.remToPx;
18
17
  exports.vwToPx = adaptive.vwToPx;
19
- exports.bus = bus.bus;
20
18
  exports.base64Decrypt = crypto.base64Decrypt;
21
19
  exports.encryptToBase64 = crypto.encryptToBase64;
22
20
  exports.generateRandomCode = crypto.generateRandomCode;
@@ -50,6 +48,8 @@ exports.fileUpload = file.fileUpload;
50
48
  exports.presignedUrl = file.presignedUrl;
51
49
  exports.sizeToTextHandler = file.sizeToTextHandler;
52
50
  exports.clearSpace = form.clearSpace;
51
+ exports.columnRuleHandler = form.columnRuleHandler;
52
+ exports.genRuleRequiredMsgHandler = form.genRuleRequiredMsgHandler;
53
53
  exports.genValueByProp = form.genValueByProp;
54
54
  exports.getValueByProp = form.getValueByProp;
55
55
  exports.setValueByProp = form.setValueByProp;