hy-dispatch-ui-v3 0.2.59 → 0.2.61

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 (102) hide show
  1. package/dist/tailwind.css +131 -6
  2. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  3. package/es/api/index.mjs +137 -0
  4. package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +365 -0
  5. package/es/bussiness/hyAddDepartmentType/index.mjs +6 -0
  6. package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +31 -0
  7. package/es/bussiness/index.mjs +1 -1
  8. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +1 -1
  9. package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +45 -36
  10. package/es/components/hyDatePicker/datePicker.vue.mjs +2 -0
  11. package/es/components/hyForm/cpns/formItem.vue.mjs +106 -43
  12. package/es/components/hyForm/cpns/locationSelect.vue.mjs +358 -0
  13. package/es/components/hyForm/form.vue.mjs +83 -31
  14. package/es/components/hyForm/js/index.mjs +9 -2
  15. package/es/components/hyForm/js/useAppForm.mjs +6 -36
  16. package/es/components/hyMap/map.vue.mjs +3 -3
  17. package/es/components/hyMenu/menu.vue.mjs +38 -23
  18. package/es/components/hyMenu/style/menu.scss +3 -1
  19. package/es/components/hyOrgCascader/js/index.mjs +2 -2
  20. package/es/components/hyRadioGroup/index.mjs +6 -0
  21. package/es/components/hyRadioGroup/radioGroup.vue.mjs +123 -0
  22. package/es/components/hyRadioGroup/style/radioGroup.scss +0 -0
  23. package/es/components/hySearch/cpns/searchItem.vue.mjs +20 -13
  24. package/es/components/hySearch/js/useAppSearch.mjs +3 -33
  25. package/es/components/hyTable/cpns/virtualTable.vue.mjs +9 -1
  26. package/es/components/hyTable/js/index.mjs +6 -3
  27. package/es/components/hyTable/js/search.mjs +1 -0
  28. package/es/components/hyTable/table.vue.mjs +11 -4
  29. package/es/components/hyTableForm/batchTableForm.vue.mjs +5 -2
  30. package/es/components/hyTableForm/tableForm.vue.mjs +6 -0
  31. package/es/components/hyTree/js/index.mjs +69 -53
  32. package/es/components/hyTree/tree.vue.mjs +36 -1
  33. package/es/components/hyVideoPlayer/js/index.mjs +0 -1
  34. package/es/components/index.mjs +1 -0
  35. package/es/hooks/useApi.mjs +2 -2
  36. package/es/hooks/useGlobalConfig.mjs +1 -1
  37. package/es/index.mjs +4 -1
  38. package/es/locale/en.mjs +17 -1
  39. package/es/locale/zh_CN.mjs +17 -1
  40. package/es/static/hy-svg-icons/hy-icon-ops-linear-shouqi.js +8 -0
  41. package/es/static/hy-svg-icons/hy-icon-ops-linear-zhankai.js +8 -0
  42. package/es/style/index.scss +53 -0
  43. package/es/style/theme.scss +0 -53
  44. package/es/utils/form.mjs +56 -7
  45. package/es/utils/handler.mjs +5 -0
  46. package/es/utils/index.mjs +2 -1
  47. package/es/utils/map/hook/bigMap.mjs +4 -0
  48. package/es/utils/map/hook/gaode.mjs +3 -0
  49. package/es/utils/map/hook/leafletjs.mjs +10 -10
  50. package/es/utils/map/index.mjs +27 -7
  51. package/es/utils/tree.mjs +1 -0
  52. package/es/version.mjs +1 -1
  53. package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
  54. package/lib/api/index.js +147 -0
  55. package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +369 -0
  56. package/lib/bussiness/hyAddDepartmentType/index.js +11 -0
  57. package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +31 -0
  58. package/lib/bussiness/index.js +5 -0
  59. package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +44 -35
  60. package/lib/components/hyDatePicker/datePicker.vue.js +2 -0
  61. package/lib/components/hyForm/cpns/formItem.vue.js +111 -48
  62. package/lib/components/hyForm/cpns/locationSelect.vue.js +362 -0
  63. package/lib/components/hyForm/form.vue.js +79 -27
  64. package/lib/components/hyForm/js/index.js +9 -1
  65. package/lib/components/hyForm/js/useAppForm.js +5 -35
  66. package/lib/components/hyMap/map.vue.js +3 -3
  67. package/lib/components/hyMenu/menu.vue.js +37 -22
  68. package/lib/components/hyMenu/style/menu.scss +3 -1
  69. package/lib/components/hyOrgCascader/js/index.js +2 -2
  70. package/lib/components/hyRadioGroup/index.js +11 -0
  71. package/lib/components/hyRadioGroup/radioGroup.vue.js +127 -0
  72. package/lib/components/hyRadioGroup/style/radioGroup.scss +0 -0
  73. package/lib/components/hySearch/cpns/searchItem.vue.js +19 -12
  74. package/lib/components/hySearch/js/useAppSearch.js +2 -32
  75. package/lib/components/hyTable/cpns/virtualTable.vue.js +9 -1
  76. package/lib/components/hyTable/js/index.js +6 -3
  77. package/lib/components/hyTable/js/search.js +1 -0
  78. package/lib/components/hyTable/table.vue.js +43 -36
  79. package/lib/components/hyTableForm/batchTableForm.vue.js +5 -2
  80. package/lib/components/hyTableForm/tableForm.vue.js +6 -0
  81. package/lib/components/hyTree/js/index.js +69 -53
  82. package/lib/components/hyTree/tree.vue.js +36 -1
  83. package/lib/components/hyVideoPlayer/js/index.js +0 -1
  84. package/lib/components/index.js +14 -12
  85. package/lib/hooks/useApi.js +2 -2
  86. package/lib/index.js +61 -49
  87. package/lib/locale/en.js +17 -1
  88. package/lib/locale/zh_CN.js +17 -1
  89. package/lib/static/hy-svg-icons/hy-icon-ops-linear-shouqi.js +8 -0
  90. package/lib/static/hy-svg-icons/hy-icon-ops-linear-zhankai.js +8 -0
  91. package/lib/style/index.scss +53 -0
  92. package/lib/style/theme.scss +0 -53
  93. package/lib/utils/form.js +57 -5
  94. package/lib/utils/handler.js +5 -0
  95. package/lib/utils/index.js +8 -0
  96. package/lib/utils/map/hook/bigMap.js +4 -0
  97. package/lib/utils/map/hook/gaode.js +3 -0
  98. package/lib/utils/map/hook/leafletjs.js +10 -10
  99. package/lib/utils/map/index.js +26 -6
  100. package/lib/utils/tree.js +10 -0
  101. package/lib/version.js +1 -1
  102. package/package.json +2 -2
@@ -0,0 +1,362 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var elementPlus = require('element-plus');
7
+ var formItem = require('./formItem.vue.js');
8
+ var useLocale = require('../../../hooks/useLocale.js');
9
+ var is = require('../../../utils/is.js');
10
+ var form = require('../../../utils/form.js');
11
+ var index = require('../../../utils/map/index.js');
12
+ var index$1 = require('../../hyInput/index.js');
13
+ var index$2 = require('../../hyIcon/index.js');
14
+ var index$3 = require('../../hyMap/index.js');
15
+
16
+ const _sfc_main = {
17
+ __name: "locationSelect",
18
+ props: {
19
+ model: {
20
+ type: Object,
21
+ default: () => ({})
22
+ },
23
+ column: {
24
+ type: Object,
25
+ default: () => ({})
26
+ },
27
+ rules: {
28
+ type: Object,
29
+ default: () => ({})
30
+ },
31
+ columnNum: {
32
+ type: Number,
33
+ default: 1
34
+ },
35
+ loading: {
36
+ type: Boolean,
37
+ default: false
38
+ },
39
+ disabled: {
40
+ type: Boolean,
41
+ default: false
42
+ },
43
+ readonly: {
44
+ type: Boolean,
45
+ default: false
46
+ },
47
+ size: {
48
+ type: String,
49
+ default: "default"
50
+ },
51
+ allMapSelect: {
52
+ type: Boolean,
53
+ default: false
54
+ }
55
+ },
56
+ emits: ["setMapSize"],
57
+ setup(__props, { expose: __expose, emit: __emit }) {
58
+ const props = __props;
59
+ const emits = __emit;
60
+ const { t } = useLocale.useLocale();
61
+ const containerRef = vue.useTemplateRef("containerRef");
62
+ const addressValue = vue.computed({
63
+ get() {
64
+ const item = props.column.children.find((v) => v.type === "address");
65
+ if (item) {
66
+ const prop = is.isArray(item.field) ? item.field[0] : item.field;
67
+ return form.getValueByProp(props.model, prop);
68
+ }
69
+ return "";
70
+ },
71
+ set(val) {
72
+ const item = props.column.children.find((v) => v.type === "address");
73
+ if (item) {
74
+ const prop = is.isArray(item.field) ? item.field[0] : item.field;
75
+ form.setValueByProp(props.model, prop, val);
76
+ }
77
+ }
78
+ });
79
+ const lngValue = vue.computed({
80
+ get() {
81
+ const item = props.column.children.find((v) => v.type === "lng");
82
+ if (item) {
83
+ const prop = is.isArray(item.field) ? item.field[0] : item.field;
84
+ return form.getValueByProp(props.model, prop);
85
+ }
86
+ return "";
87
+ },
88
+ set(val) {
89
+ const item = props.column.children.find((v) => v.type === "lng");
90
+ if (item) {
91
+ const prop = is.isArray(item.field) ? item.field[0] : item.field;
92
+ form.setValueByProp(props.model, prop, val);
93
+ }
94
+ }
95
+ });
96
+ const latValue = vue.computed({
97
+ get() {
98
+ const item = props.column.children.find((v) => v.type === "lat");
99
+ if (item) {
100
+ const prop = is.isArray(item.field) ? item.field[0] : item.field;
101
+ return form.getValueByProp(props.model, prop);
102
+ }
103
+ return "";
104
+ },
105
+ set(val) {
106
+ const item = props.column.children.find((v) => v.type === "lat");
107
+ if (item) {
108
+ const prop = is.isArray(item.field) ? item.field[0] : item.field;
109
+ form.setValueByProp(props.model, prop, val);
110
+ }
111
+ }
112
+ });
113
+ const containerStyle = vue.computed(() => {
114
+ const columnNum = is.isNumber(props.column.columnNum) && props.column.columnNum > 0 ? props.column.columnNum : is.isNumber(props.columnNum) && props.columnNum > 0 ? props.columnNum || 1 : 1;
115
+ return {
116
+ gridTemplateColumns: `repeat(${columnNum}, minmax(0, 1fr))`
117
+ };
118
+ });
119
+ const children = vue.computed(
120
+ () => props.column.children.map((item) => {
121
+ if (item.type === "address") {
122
+ return {
123
+ rightSlot: "addressRight",
124
+ ...item,
125
+ type: "input",
126
+ slot: "address",
127
+ attrs: {
128
+ placeholder: "\u8F93\u5165\u5730\u5740\u53EF\u641C\u7D22",
129
+ ...item.attrs
130
+ }
131
+ };
132
+ }
133
+ return {
134
+ ...item,
135
+ type: "input",
136
+ attrs: {
137
+ // placeholder: item.type === 'lng' ? '经度' : '维度',
138
+ ...item.attrs
139
+ }
140
+ };
141
+ })
142
+ );
143
+ const mapConfig = JSON.parse(window.sessionStorage.getItem("mapConfig") || "{}");
144
+ let hyMap = null;
145
+ let map = null;
146
+ const poiServer = index.setPoiServer(mapConfig);
147
+ let marker = null;
148
+ function placeSearchFn(address) {
149
+ poiServer.placeSearch({
150
+ pageSize: 1,
151
+ // 单页显示结果条数
152
+ pageIndex: 1,
153
+ convertIngAndLat: false,
154
+ query: address
155
+ }).then(({ results }) => {
156
+ console.log(results);
157
+ if (results && results.length) {
158
+ const geographicalPosition = results[0];
159
+ throughCoordinatePosition(
160
+ geographicalPosition.lng,
161
+ geographicalPosition.lat
162
+ );
163
+ } else {
164
+ elementPlus.ElMessage.error("\u6CA1\u6709\u627E\u5230\u641C\u7D22\u5730\u7406\u4F4D\u7F6E");
165
+ }
166
+ }).catch((error) => {
167
+ console.log("\u672A\u627E\u5230\u5730\u5740", error);
168
+ elementPlus.ElMessage.error("\u6CA1\u6709\u627E\u5230\u641C\u7D22\u5730\u7406\u4F4D\u7F6E");
169
+ });
170
+ }
171
+ function throughCoordinatePosition(lng, lat) {
172
+ poiServer.geocoderFormat({
173
+ lat,
174
+ lng
175
+ }).then(({ results }) => {
176
+ geographicalPositionFn({
177
+ lng,
178
+ lat,
179
+ address: results.address,
180
+ name: results.address
181
+ });
182
+ }).catch(() => {
183
+ geographicalPositionFn({
184
+ lng,
185
+ lat,
186
+ address: `${Number(lat).toFixed(6)}\u3001${Number(lng).toFixed(6)}`,
187
+ name: `${Number(lat).toFixed(6)}\u3001${Number(lng).toFixed(6)}`
188
+ });
189
+ });
190
+ }
191
+ function geographicalPositionFn(obj) {
192
+ console.log("\u7ED3\u679C", obj);
193
+ addressValue.value = obj.address;
194
+ lngValue.value = obj.lng;
195
+ latValue.value = obj.lat;
196
+ }
197
+ function addressEnter() {
198
+ console.log("\u6848\u4EF6enter");
199
+ if (addressValue.value) {
200
+ placeSearchFn(addressValue.value);
201
+ }
202
+ }
203
+ function complete(initHyMap, initMap) {
204
+ hyMap = initHyMap;
205
+ map = initMap;
206
+ map.on("click", (res) => {
207
+ console.log(res);
208
+ const latlng = res.latlng;
209
+ setMarker(res.latlng);
210
+ throughCoordinatePosition(latlng.lng, latlng.lat);
211
+ });
212
+ }
213
+ function setMarker({ lat, lng }) {
214
+ if (marker) {
215
+ marker.setLatLng({ lat, lng });
216
+ map.setView({ lat, lng }, mapConfig.maxZoom || 18);
217
+ } else {
218
+ const divIcon = hyMap.DivIcon({
219
+ html: '<svg class="hy-icon !w-9 !h-14 mr-1 text-auxiliary" svgName="map-marker-trajectory-personnel"><use xlink:href="#hy-icon-map-marker-trajectory-personnel"></use></svg>',
220
+ iconSize: [36, 56],
221
+ iconAnchor: [20, 56]
222
+ });
223
+ marker = hyMap.Marker({
224
+ icon: divIcon,
225
+ zIndexOffset: 1,
226
+ position: {
227
+ lat,
228
+ lng
229
+ }
230
+ });
231
+ marker.addTo(map);
232
+ map.setView({ lat, lng }, mapConfig.maxZoom || 18);
233
+ }
234
+ }
235
+ function setMapSize() {
236
+ emits("setMapSize");
237
+ setTimeout(() => {
238
+ map.invalidateSize();
239
+ });
240
+ }
241
+ vue.onBeforeUnmount(() => {
242
+ if (marker) {
243
+ marker.remove();
244
+ }
245
+ map.removeMap();
246
+ map = null;
247
+ hyMap = null;
248
+ });
249
+ __expose({
250
+ setMarker
251
+ });
252
+ return (_ctx, _cache) => {
253
+ return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full flex flex-col" }, [
254
+ vue.createElementVNode(
255
+ "div",
256
+ {
257
+ ref_key: "containerRef",
258
+ ref: containerRef,
259
+ class: "grid gap-x-6",
260
+ style: vue.normalizeStyle(containerStyle.value)
261
+ },
262
+ [
263
+ (vue.openBlock(true), vue.createElementBlock(
264
+ vue.Fragment,
265
+ null,
266
+ vue.renderList(children.value, (item, index) => {
267
+ return vue.openBlock(), vue.createBlock(formItem.default, {
268
+ key: index,
269
+ model: __props.model,
270
+ column: item,
271
+ rules: __props.rules,
272
+ size: __props.size,
273
+ loading: __props.loading,
274
+ disabled: __props.disabled,
275
+ readonly: __props.readonly
276
+ }, vue.createSlots({
277
+ addressRight: vue.withCtx(() => [
278
+ vue.createElementVNode("div", { class: "h-full flex items-center text-auxiliary" }, [
279
+ vue.createElementVNode("span", { class: "text-xs" }, [
280
+ vue.createVNode(vue.unref(index$2.HyIcon), {
281
+ "svg-name": "dispatch-share-tips",
282
+ class: "!w-3 !h-3 mr-1 text-auxiliary"
283
+ }),
284
+ vue.createElementVNode("span", null, "\u53EF\u901A\u8FC7\u5730\u56FE\u70B9\u9009\u4EE5\u83B7\u53D6\u7CBE\u786E\u5750\u6807")
285
+ ])
286
+ ])
287
+ ]),
288
+ address: vue.withCtx(({ column }) => [
289
+ vue.createVNode(vue.unref(index$1.HyInput), vue.mergeProps({
290
+ modelValue: addressValue.value,
291
+ "onUpdate:modelValue": ($event) => addressValue.value = $event
292
+ }, { ref_for: true }, column.attrs, {
293
+ onKeyup: vue.withKeys(addressEnter, ["enter"])
294
+ }), null, 16, ["modelValue", "onUpdate:modelValue"])
295
+ ]),
296
+ _: 2
297
+ /* DYNAMIC */
298
+ }, [
299
+ vue.renderList(_ctx.$slots, (_, slotName) => {
300
+ return {
301
+ name: slotName,
302
+ fn: vue.withCtx((scope) => [
303
+ vue.renderSlot(_ctx.$slots, slotName, vue.mergeProps({ ref_for: true }, scope))
304
+ ])
305
+ };
306
+ })
307
+ ]), 1032, ["model", "column", "rules", "size", "loading", "disabled", "readonly"]);
308
+ }),
309
+ 128
310
+ /* KEYED_FRAGMENT */
311
+ ))
312
+ ],
313
+ 4
314
+ /* STYLE */
315
+ ),
316
+ vue.createElementVNode(
317
+ "div",
318
+ {
319
+ class: vue.normalizeClass([[__props.allMapSelect ? "h-0 flex-grow" : "h-[280px]"], "w-full border border-border rounded relative box-border"])
320
+ },
321
+ [
322
+ vue.createElementVNode("div", { class: "w-full h-full relative z-10" }, [
323
+ vue.createVNode(vue.unref(index$3.HyMap), {
324
+ mapType: vue.unref(mapConfig).mapType,
325
+ mapConfig: vue.unref(mapConfig),
326
+ onComplete: complete
327
+ }, null, 8, ["mapType", "mapConfig"])
328
+ ]),
329
+ vue.createElementVNode(
330
+ "div",
331
+ {
332
+ class: vue.normalizeClass(["z-20 cursor-pointer absolute rounded top-2 right-2 w-[110px] h-8 border bg-background/70 text-xs flex items-center justify-center gap-1", [
333
+ __props.allMapSelect ? "border-theme text-theme" : "border-border/50 text-main"
334
+ ]]),
335
+ onClick: vue.withModifiers(setMapSize, ["stop"])
336
+ },
337
+ [
338
+ vue.createVNode(vue.unref(index$2.HyIcon), {
339
+ svgName: __props.allMapSelect ? "ops-button-reduce" : "ops-button-amplify",
340
+ class: vue.normalizeClass(["!w-3 !h-3 text-main", [__props.allMapSelect ? "text-theme" : "text-main"]])
341
+ }, null, 8, ["svgName", "class"]),
342
+ vue.createElementVNode(
343
+ "span",
344
+ null,
345
+ vue.toDisplayString(__props.allMapSelect ? "\u9000\u51FA\u5730\u56FE\u653E\u5927" : "\u653E\u5927\u5730\u56FE\u70B9\u9009"),
346
+ 1
347
+ /* TEXT */
348
+ )
349
+ ],
350
+ 2
351
+ /* CLASS */
352
+ )
353
+ ],
354
+ 2
355
+ /* CLASS */
356
+ )
357
+ ]);
358
+ };
359
+ }
360
+ };
361
+
362
+ exports.default = _sfc_main;
@@ -7,6 +7,7 @@ var elementPlus = require('element-plus');
7
7
  var formItem = require('./cpns/formItem.vue.js');
8
8
  var extraItem = require('./cpns/extraItem.vue.js');
9
9
  var arrayItem = require('./cpns/arrayItem.vue.js');
10
+ var locationSelect = require('./cpns/locationSelect.vue.js');
10
11
  var index = require('./js/index.js');
11
12
  var useAppForm = require('./js/useAppForm.js');
12
13
  var useLocale = require('../../hooks/useLocale.js');
@@ -53,7 +54,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
53
54
  // 'large' | 'default' | 'small'
54
55
  }
55
56
  },
56
- setup(__props, { expose: __expose }) {
57
+ emits: ["on-allMapSelect"],
58
+ setup(__props, { expose: __expose, emit: __emit }) {
59
+ const emit = __emit;
57
60
  const props = __props;
58
61
  const { t } = useLocale.useLocale();
59
62
  const formTemplateRef = vue.useTemplateRef("formTemplateRef");
@@ -73,6 +76,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
73
76
  gridTemplateColumns: `repeat(${columnNum}, minmax(0, 1fr))`
74
77
  };
75
78
  });
79
+ const locationSelectRef = vue.useTemplateRef("locationSelectRef");
80
+ const allMapSelect = vue.ref(false);
81
+ function setMapSize() {
82
+ allMapSelect.value = !allMapSelect.value;
83
+ emit("on-allMapSelect", allMapSelect.value);
84
+ }
76
85
  __expose({
77
86
  validate: async (callback) => {
78
87
  await vue.nextTick();
@@ -104,6 +113,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
104
113
  getField: async (fields) => {
105
114
  await vue.nextTick();
106
115
  return vue.unref(formTemplateRef).getField(fields);
116
+ },
117
+ setMarker: (latlng) => {
118
+ if (locationSelectRef.value) {
119
+ is.isArray(locationSelectRef.value) ? locationSelectRef.value.map((item) => item.setMarker(latlng)) : locationSelectRef.value.setMarker(latlng);
120
+ }
107
121
  }
108
122
  // setInitialValue: async (value) => {
109
123
  // await nextTick()
@@ -125,7 +139,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
125
139
  vue.createElementVNode(
126
140
  "div",
127
141
  {
128
- class: "hy-form-container",
142
+ class: "hy-form-container h-full",
129
143
  style: vue.normalizeStyle(containerStyle.value)
130
144
  },
131
145
  [
@@ -142,29 +156,40 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
142
156
  [
143
157
  vue.createCommentVNode(" \u6807\u9898 "),
144
158
  column.type === "title" ? (vue.openBlock(), vue.createElementBlock(
145
- "div",
146
- {
147
- key: 0,
148
- class: vue.normalizeClass(["w-full flex items-center text-theme whitespace-nowrap relative mb-3 mt-1", [__props.size === "small" ? "text-xs" : "text-sm"]]),
149
- style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, column))
150
- },
159
+ vue.Fragment,
160
+ { key: 0 },
151
161
  [
152
- vue.createElementVNode(
153
- "span",
154
- { class: "mr-2" },
155
- vue.toDisplayString(column.label),
156
- 1
157
- /* TEXT */
158
- ),
159
- vue.createVNode(vue.unref(elementPlus.ElDivider), {
160
- "content-position": "left",
161
- "border-style": "dashed",
162
- class: "border-[rgba(var(--hy-theme),0.5)] my-0"
163
- }),
164
- vue.createElementVNode("div", { class: "absolute top-1/2 -left-1.5 transform -translate-x-full -translate-y-1/2 w-0.5 h-3 bg-theme" })
162
+ vue.unref(index.columnShowHandler)(props, column) ? (vue.openBlock(), vue.createElementBlock(
163
+ "div",
164
+ {
165
+ key: 0,
166
+ class: vue.normalizeClass(["w-full flex items-center text-theme whitespace-nowrap relative mb-3 mt-1", [
167
+ __props.size === "small" ? "text-xs" : "text-sm",
168
+ allMapSelect.value ? "hidden" : ""
169
+ ]]),
170
+ style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, column))
171
+ },
172
+ [
173
+ vue.createElementVNode(
174
+ "span",
175
+ { class: "mr-2" },
176
+ vue.toDisplayString(column.label),
177
+ 1
178
+ /* TEXT */
179
+ ),
180
+ vue.createVNode(vue.unref(elementPlus.ElDivider), {
181
+ "content-position": "left",
182
+ "border-style": "dashed",
183
+ class: "border-[rgba(var(--hy-theme),0.5)] my-0"
184
+ }),
185
+ vue.createElementVNode("div", { class: "absolute top-1/2 -left-1.5 transform -translate-x-full -translate-y-1/2 w-0.5 h-3 bg-theme" })
186
+ ],
187
+ 6
188
+ /* CLASS, STYLE */
189
+ )) : vue.createCommentVNode("v-if", true)
165
190
  ],
166
- 6
167
- /* CLASS, STYLE */
191
+ 64
192
+ /* STABLE_FRAGMENT */
168
193
  )) : column.type === "extra" && !_ctx.$slots[column.slot] ? (vue.openBlock(), vue.createElementBlock(
169
194
  vue.Fragment,
170
195
  { key: 1 },
@@ -172,6 +197,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
172
197
  vue.createCommentVNode(" \u8865\u5145\u4FE1\u606F\u8868\u5355 "),
173
198
  vue.unref(index.columnShowHandler)(props, column) ? (vue.openBlock(), vue.createBlock(extraItem.default, {
174
199
  key: 0,
200
+ class: vue.normalizeClass([allMapSelect.value ? "hidden" : ""]),
175
201
  model: __props.model,
176
202
  column,
177
203
  rules: __props.rules,
@@ -192,7 +218,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
192
218
  ])
193
219
  };
194
220
  })
195
- ]), 1032, ["model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "style"])) : vue.createCommentVNode("v-if", true)
221
+ ]), 1032, ["class", "model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "style"])) : vue.createCommentVNode("v-if", true)
196
222
  ],
197
223
  64
198
224
  /* STABLE_FRAGMENT */
@@ -203,6 +229,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
203
229
  vue.createCommentVNode(" \u8868\u5355\u6570\u7EC4 "),
204
230
  vue.unref(index.columnShowHandler)(props, column) ? (vue.openBlock(), vue.createBlock(arrayItem.default, {
205
231
  key: 0,
232
+ class: vue.normalizeClass([allMapSelect.value ? "hidden" : ""]),
206
233
  model: __props.model,
207
234
  column,
208
235
  rules: __props.rules,
@@ -224,16 +251,41 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
224
251
  ])
225
252
  };
226
253
  })
227
- ]), 1032, ["model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style"])) : vue.createCommentVNode("v-if", true)
254
+ ]), 1032, ["class", "model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style"])) : vue.createCommentVNode("v-if", true)
228
255
  ],
229
256
  64
230
257
  /* STABLE_FRAGMENT */
231
- )) : (vue.openBlock(), vue.createElementBlock(
258
+ )) : column.type === "location-select" ? (vue.openBlock(), vue.createElementBlock(
232
259
  vue.Fragment,
233
260
  { key: 3 },
261
+ [
262
+ vue.unref(index.columnShowHandler)(props, column) ? (vue.openBlock(), vue.createBlock(locationSelect.default, {
263
+ key: 0,
264
+ ref_for: true,
265
+ ref_key: "locationSelectRef",
266
+ ref: locationSelectRef,
267
+ model: __props.model,
268
+ column,
269
+ rules: __props.rules,
270
+ columnNum: __props.columnNum,
271
+ loading: __props.loading,
272
+ disabled: __props.disabled,
273
+ readonly: __props.readonly,
274
+ size: __props.size,
275
+ style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, column)),
276
+ allMapSelect: allMapSelect.value,
277
+ onSetMapSize: setMapSize
278
+ }, null, 8, ["model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style", "allMapSelect"])) : vue.createCommentVNode("v-if", true)
279
+ ],
280
+ 64
281
+ /* STABLE_FRAGMENT */
282
+ )) : (vue.openBlock(), vue.createElementBlock(
283
+ vue.Fragment,
284
+ { key: 4 },
234
285
  [
235
286
  vue.createCommentVNode(" \u8868\u5355 "),
236
287
  vue.createVNode(formItem.default, {
288
+ class: vue.normalizeClass([allMapSelect.value ? "hidden" : ""]),
237
289
  model: __props.model,
238
290
  column,
239
291
  rules: __props.rules,
@@ -252,7 +304,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
252
304
  ])
253
305
  };
254
306
  })
255
- ]), 1032, ["model", "column", "rules", "loading", "disabled", "readonly"])
307
+ ]), 1032, ["class", "model", "column", "rules", "loading", "disabled", "readonly"])
256
308
  ],
257
309
  64
258
310
  /* STABLE_FRAGMENT */
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var vue = require('vue');
4
- var handler = require('../../../utils/handler.js');
5
4
  var is = require('../../../utils/is.js');
5
+ var handler = require('../../../utils/handler.js');
6
6
  var form = require('../../../utils/form.js');
7
7
  var useLocale = require('../../../hooks/useLocale.js');
8
8
 
@@ -17,6 +17,7 @@ function columnItemStyle(props, column) {
17
17
  case "title":
18
18
  case "extra":
19
19
  case "array":
20
+ case "location-select":
20
21
  style["grid-column"] = `span ${props.columnNum}`;
21
22
  break;
22
23
  }
@@ -29,6 +30,12 @@ function columnShowHandler(props, column) {
29
30
  if (is.isFunction(show)) return show(column, props.model);
30
31
  return true;
31
32
  }
33
+ function columnVisibleHandler(props, column) {
34
+ const visible = vue.unref(column.visible);
35
+ if (is.isBoolean(visible)) return visible;
36
+ if (is.isFunction(visible)) return visible(column, props.model);
37
+ return true;
38
+ }
32
39
  function columnHelpHandler(props, column) {
33
40
  const help = vue.unref(column.help);
34
41
  if (is.isString(help)) return help;
@@ -115,6 +122,7 @@ function optionsHandler(props, column) {
115
122
  exports.columnHelpHandler = columnHelpHandler;
116
123
  exports.columnItemStyle = columnItemStyle;
117
124
  exports.columnShowHandler = columnShowHandler;
125
+ exports.columnVisibleHandler = columnVisibleHandler;
118
126
  exports.isDisabled = isDisabled;
119
127
  exports.isReadonly = isReadonly;
120
128
  exports.isRequired = isRequired;
@@ -4,40 +4,10 @@ var vue = require('vue');
4
4
  var handler = require('../../../utils/handler.js');
5
5
  var is = require('../../../utils/is.js');
6
6
  var form = require('../../../utils/form.js');
7
- var useLocale = require('../../../hooks/useLocale.js');
8
7
 
9
- const genDefaultLabel = (config) => {
10
- if (config.label) return config.label;
11
- const { t } = useLocale.useLocale();
12
- switch (config.type) {
13
- // 部门级联选择框
14
- case "org-cascader":
15
- return t("form.department");
16
- }
17
- };
18
- const genPlaceholderHandler = (config) => {
19
- const { t } = useLocale.useLocale();
20
- const { type, label, attrs = {} } = config || {};
21
- let placeholder = attrs.placeholder, startPlaceholder = attrs.startPlaceholder, endPlaceholder = attrs.endPlaceholder;
22
- switch (type) {
23
- case "input":
24
- case "input-number":
25
- placeholder = placeholder || t("hy.pleaseEnterPlaceholder", [label]);
26
- break;
27
- case "select":
28
- case "date-picker":
29
- case "time-picker":
30
- placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
31
- break;
32
- default:
33
- placeholder = placeholder || label;
34
- }
35
- return { placeholder, startPlaceholder, endPlaceholder };
36
- };
37
8
  function appFormItemHandler(column = {}) {
38
- const label = genDefaultLabel(column);
39
- const { placeholder} = genPlaceholderHandler({ ...column, label });
40
- const attrs = { ...column.attrs || {}, placeholder };
9
+ const label = form.genColumnDefaultLabel(column);
10
+ const attrs = { ...column.attrs || {} };
41
11
  column = handler.mergeDeep(
42
12
  { ...column },
43
13
  {
@@ -57,7 +27,7 @@ function appFormItemHandler(column = {}) {
57
27
  ...attrs
58
28
  }
59
29
  };
60
- } else if (/^(radio|checkbox|select)$/.test(column.type)) {
30
+ } else if (/^(radio|radio-group|checkbox|select)$/.test(column.type)) {
61
31
  return {
62
32
  ...column,
63
33
  attrs: {
@@ -71,7 +41,7 @@ function appFormItemHandler(column = {}) {
71
41
  }
72
42
  }
73
43
  };
74
- } else if (/^(extra)$/.test(column.type)) {
44
+ } else if (/^(extra)$/.test(column.type) || /^(location-select)$/.test(column.type)) {
75
45
  return {
76
46
  ...column,
77
47
  children: (column.children || []).map((item) => appFormItemHandler(item))
@@ -107,7 +77,7 @@ const resetAppFormValue = (columns = [], obj = {}) => {
107
77
  const childValue = resetAppFormValue(item.children);
108
78
  obj[item.prop] = [childValue];
109
79
  }
110
- } else if (item.type === "extra") {
80
+ } else if (item.type === "extra" || item.type === "location-select") {
111
81
  resetAppFormValue(item.children, obj);
112
82
  } else if (Array.isArray(item.prop)) {
113
83
  for (let i = 0; i < item.prop.length; i++) {
@@ -20,7 +20,7 @@ const _sfc_main = {
20
20
  type: Object,
21
21
  default: () => ({})
22
22
  },
23
- // 地图类型 gaode leaflet bugMap
23
+ // 地图类型 gaode leafletjs bugMap
24
24
  mapType: {
25
25
  type: String,
26
26
  default: "gaode"
@@ -31,7 +31,7 @@ const _sfc_main = {
31
31
  const props = __props;
32
32
  const emits = __emit;
33
33
  const mapRef = vue.ref();
34
- const { newMap } = useMixins.useMixins(
34
+ const { newMap, map, hyMap } = useMixins.useMixins(
35
35
  {
36
36
  props,
37
37
  emits,
@@ -43,7 +43,7 @@ const _sfc_main = {
43
43
  newMap(props.mapType);
44
44
  });
45
45
  return (_ctx, _cache) => {
46
- return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full p-5 box-border border-border border relative" }, [
46
+ return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full box-border border-border border relative" }, [
47
47
  vue.createElementVNode(
48
48
  "div",
49
49
  {