hy-dispatch-ui-v3 0.2.59 → 0.2.60
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.
- package/dist/tailwind.css +129 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/api/index.mjs +137 -0
- package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +365 -0
- package/es/bussiness/hyAddDepartmentType/index.mjs +6 -0
- package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +31 -0
- package/es/bussiness/index.mjs +1 -1
- package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +1 -1
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +45 -36
- package/es/components/hyDatePicker/datePicker.vue.mjs +2 -0
- package/es/components/hyForm/cpns/formItem.vue.mjs +106 -43
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +358 -0
- package/es/components/hyForm/form.vue.mjs +83 -31
- package/es/components/hyForm/js/index.mjs +9 -2
- package/es/components/hyForm/js/useAppForm.mjs +6 -36
- package/es/components/hyMap/map.vue.mjs +3 -3
- package/es/components/hyRadioGroup/index.mjs +6 -0
- package/es/components/hyRadioGroup/radioGroup.vue.mjs +123 -0
- package/es/components/hyRadioGroup/style/radioGroup.scss +0 -0
- package/es/components/hySearch/cpns/searchItem.vue.mjs +20 -13
- package/es/components/hySearch/js/useAppSearch.mjs +3 -33
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +9 -1
- package/es/components/hyTable/js/index.mjs +6 -3
- package/es/components/hyTable/js/search.mjs +1 -0
- package/es/components/hyTable/table.vue.mjs +11 -4
- package/es/components/hyTableForm/batchTableForm.vue.mjs +5 -2
- package/es/components/hyTableForm/tableForm.vue.mjs +6 -0
- package/es/components/hyTree/js/index.mjs +69 -53
- package/es/components/hyTree/tree.vue.mjs +36 -1
- package/es/components/index.mjs +1 -0
- package/es/index.mjs +3 -1
- package/es/locale/en.mjs +17 -1
- package/es/locale/zh_CN.mjs +17 -1
- package/es/static/hy-svg-icons/hy-icon-ops-linear-shouqi.js +8 -0
- package/es/static/hy-svg-icons/hy-icon-ops-linear-zhankai.js +8 -0
- package/es/style/index.scss +53 -0
- package/es/style/theme.scss +0 -53
- package/es/utils/form.mjs +56 -7
- package/es/utils/index.mjs +1 -1
- package/es/utils/map/hook/bigMap.mjs +4 -0
- package/es/utils/map/hook/gaode.mjs +3 -0
- package/es/utils/map/hook/leafletjs.mjs +10 -10
- package/es/utils/map/index.mjs +27 -7
- package/es/version.mjs +1 -1
- package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
- package/lib/api/index.js +147 -0
- package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +369 -0
- package/lib/bussiness/hyAddDepartmentType/index.js +11 -0
- package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +31 -0
- package/lib/bussiness/index.js +5 -0
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +44 -35
- package/lib/components/hyDatePicker/datePicker.vue.js +2 -0
- package/lib/components/hyForm/cpns/formItem.vue.js +111 -48
- package/lib/components/hyForm/cpns/locationSelect.vue.js +362 -0
- package/lib/components/hyForm/form.vue.js +79 -27
- package/lib/components/hyForm/js/index.js +9 -1
- package/lib/components/hyForm/js/useAppForm.js +5 -35
- package/lib/components/hyMap/map.vue.js +3 -3
- package/lib/components/hyRadioGroup/index.js +11 -0
- package/lib/components/hyRadioGroup/radioGroup.vue.js +127 -0
- package/lib/components/hyRadioGroup/style/radioGroup.scss +0 -0
- package/lib/components/hySearch/cpns/searchItem.vue.js +19 -12
- package/lib/components/hySearch/js/useAppSearch.js +2 -32
- package/lib/components/hyTable/cpns/virtualTable.vue.js +9 -1
- package/lib/components/hyTable/js/index.js +6 -3
- package/lib/components/hyTable/js/search.js +1 -0
- package/lib/components/hyTable/table.vue.js +43 -36
- package/lib/components/hyTableForm/batchTableForm.vue.js +5 -2
- package/lib/components/hyTableForm/tableForm.vue.js +6 -0
- package/lib/components/hyTree/js/index.js +69 -53
- package/lib/components/hyTree/tree.vue.js +36 -1
- package/lib/components/index.js +14 -12
- package/lib/index.js +56 -49
- package/lib/locale/en.js +17 -1
- package/lib/locale/zh_CN.js +17 -1
- package/lib/static/hy-svg-icons/hy-icon-ops-linear-shouqi.js +8 -0
- package/lib/static/hy-svg-icons/hy-icon-ops-linear-zhankai.js +8 -0
- package/lib/style/index.scss +53 -0
- package/lib/style/theme.scss +0 -53
- package/lib/utils/form.js +57 -5
- package/lib/utils/index.js +3 -0
- package/lib/utils/map/hook/bigMap.js +4 -0
- package/lib/utils/map/hook/gaode.js +3 -0
- package/lib/utils/map/hook/leafletjs.js +10 -10
- package/lib/utils/map/index.js +26 -6
- package/lib/version.js +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, computed, nextTick, unref, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeStyle, createCommentVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createVNode, createSlots, renderSlot } from 'vue';
|
|
1
|
+
import { defineComponent, useTemplateRef, computed, ref, nextTick, unref, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeStyle, createCommentVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createVNode, createSlots, renderSlot } from 'vue';
|
|
2
2
|
import { ElForm, ElDivider } from 'element-plus';
|
|
3
|
-
import _sfc_main$
|
|
3
|
+
import _sfc_main$4 from './cpns/formItem.vue.mjs';
|
|
4
4
|
import _sfc_main$1 from './cpns/extraItem.vue.mjs';
|
|
5
5
|
import _sfc_main$2 from './cpns/arrayItem.vue.mjs';
|
|
6
|
-
import
|
|
6
|
+
import _sfc_main$3 from './cpns/locationSelect.vue.mjs';
|
|
7
|
+
import { columnShowHandler, columnItemStyle } from './js/index.mjs';
|
|
7
8
|
import { resetAppFormValue } from './js/useAppForm.mjs';
|
|
8
9
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
9
10
|
import { isArray, isNumber } from '../../utils/is.mjs';
|
|
@@ -49,7 +50,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
49
50
|
// 'large' | 'default' | 'small'
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
|
-
|
|
53
|
+
emits: ["on-allMapSelect"],
|
|
54
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
55
|
+
const emit = __emit;
|
|
53
56
|
const props = __props;
|
|
54
57
|
const { t } = useLocale();
|
|
55
58
|
const formTemplateRef = useTemplateRef("formTemplateRef");
|
|
@@ -69,6 +72,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
69
72
|
gridTemplateColumns: `repeat(${columnNum}, minmax(0, 1fr))`
|
|
70
73
|
};
|
|
71
74
|
});
|
|
75
|
+
const locationSelectRef = useTemplateRef("locationSelectRef");
|
|
76
|
+
const allMapSelect = ref(false);
|
|
77
|
+
function setMapSize() {
|
|
78
|
+
allMapSelect.value = !allMapSelect.value;
|
|
79
|
+
emit("on-allMapSelect", allMapSelect.value);
|
|
80
|
+
}
|
|
72
81
|
__expose({
|
|
73
82
|
validate: async (callback) => {
|
|
74
83
|
await nextTick();
|
|
@@ -100,6 +109,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
100
109
|
getField: async (fields) => {
|
|
101
110
|
await nextTick();
|
|
102
111
|
return unref(formTemplateRef).getField(fields);
|
|
112
|
+
},
|
|
113
|
+
setMarker: (latlng) => {
|
|
114
|
+
if (locationSelectRef.value) {
|
|
115
|
+
isArray(locationSelectRef.value) ? locationSelectRef.value.map((item) => item.setMarker(latlng)) : locationSelectRef.value.setMarker(latlng);
|
|
116
|
+
}
|
|
103
117
|
}
|
|
104
118
|
// setInitialValue: async (value) => {
|
|
105
119
|
// await nextTick()
|
|
@@ -121,7 +135,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
121
135
|
createElementVNode(
|
|
122
136
|
"div",
|
|
123
137
|
{
|
|
124
|
-
class: "hy-form-container",
|
|
138
|
+
class: "hy-form-container h-full",
|
|
125
139
|
style: normalizeStyle(containerStyle.value)
|
|
126
140
|
},
|
|
127
141
|
[
|
|
@@ -138,29 +152,40 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
138
152
|
[
|
|
139
153
|
createCommentVNode(" \u6807\u9898 "),
|
|
140
154
|
column.type === "title" ? (openBlock(), createElementBlock(
|
|
141
|
-
|
|
142
|
-
{
|
|
143
|
-
key: 0,
|
|
144
|
-
class: normalizeClass(["w-full flex items-center text-theme whitespace-nowrap relative mb-3 mt-1", [__props.size === "small" ? "text-xs" : "text-sm"]]),
|
|
145
|
-
style: normalizeStyle(unref(columnItemStyle)(props, column))
|
|
146
|
-
},
|
|
155
|
+
Fragment,
|
|
156
|
+
{ key: 0 },
|
|
147
157
|
[
|
|
148
|
-
|
|
149
|
-
"
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
unref(columnShowHandler)(props, column) ? (openBlock(), createElementBlock(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
key: 0,
|
|
162
|
+
class: normalizeClass(["w-full flex items-center text-theme whitespace-nowrap relative mb-3 mt-1", [
|
|
163
|
+
__props.size === "small" ? "text-xs" : "text-sm",
|
|
164
|
+
allMapSelect.value ? "hidden" : ""
|
|
165
|
+
]]),
|
|
166
|
+
style: normalizeStyle(unref(columnItemStyle)(props, column))
|
|
167
|
+
},
|
|
168
|
+
[
|
|
169
|
+
createElementVNode(
|
|
170
|
+
"span",
|
|
171
|
+
{ class: "mr-2" },
|
|
172
|
+
toDisplayString(column.label),
|
|
173
|
+
1
|
|
174
|
+
/* TEXT */
|
|
175
|
+
),
|
|
176
|
+
createVNode(unref(ElDivider), {
|
|
177
|
+
"content-position": "left",
|
|
178
|
+
"border-style": "dashed",
|
|
179
|
+
class: "border-[rgba(var(--hy-theme),0.5)] my-0"
|
|
180
|
+
}),
|
|
181
|
+
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" })
|
|
182
|
+
],
|
|
183
|
+
6
|
|
184
|
+
/* CLASS, STYLE */
|
|
185
|
+
)) : createCommentVNode("v-if", true)
|
|
161
186
|
],
|
|
162
|
-
|
|
163
|
-
/*
|
|
187
|
+
64
|
|
188
|
+
/* STABLE_FRAGMENT */
|
|
164
189
|
)) : column.type === "extra" && !_ctx.$slots[column.slot] ? (openBlock(), createElementBlock(
|
|
165
190
|
Fragment,
|
|
166
191
|
{ key: 1 },
|
|
@@ -168,6 +193,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
168
193
|
createCommentVNode(" \u8865\u5145\u4FE1\u606F\u8868\u5355 "),
|
|
169
194
|
unref(columnShowHandler)(props, column) ? (openBlock(), createBlock(_sfc_main$1, {
|
|
170
195
|
key: 0,
|
|
196
|
+
class: normalizeClass([allMapSelect.value ? "hidden" : ""]),
|
|
171
197
|
model: __props.model,
|
|
172
198
|
column,
|
|
173
199
|
rules: __props.rules,
|
|
@@ -188,7 +214,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
188
214
|
])
|
|
189
215
|
};
|
|
190
216
|
})
|
|
191
|
-
]), 1032, ["model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "style"])) : createCommentVNode("v-if", true)
|
|
217
|
+
]), 1032, ["class", "model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "style"])) : createCommentVNode("v-if", true)
|
|
192
218
|
],
|
|
193
219
|
64
|
|
194
220
|
/* STABLE_FRAGMENT */
|
|
@@ -199,6 +225,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
199
225
|
createCommentVNode(" \u8868\u5355\u6570\u7EC4 "),
|
|
200
226
|
unref(columnShowHandler)(props, column) ? (openBlock(), createBlock(_sfc_main$2, {
|
|
201
227
|
key: 0,
|
|
228
|
+
class: normalizeClass([allMapSelect.value ? "hidden" : ""]),
|
|
202
229
|
model: __props.model,
|
|
203
230
|
column,
|
|
204
231
|
rules: __props.rules,
|
|
@@ -220,16 +247,41 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
220
247
|
])
|
|
221
248
|
};
|
|
222
249
|
})
|
|
223
|
-
]), 1032, ["model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style"])) : createCommentVNode("v-if", true)
|
|
250
|
+
]), 1032, ["class", "model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style"])) : createCommentVNode("v-if", true)
|
|
224
251
|
],
|
|
225
252
|
64
|
|
226
253
|
/* STABLE_FRAGMENT */
|
|
227
|
-
)) : (openBlock(), createElementBlock(
|
|
254
|
+
)) : column.type === "location-select" ? (openBlock(), createElementBlock(
|
|
228
255
|
Fragment,
|
|
229
256
|
{ key: 3 },
|
|
257
|
+
[
|
|
258
|
+
unref(columnShowHandler)(props, column) ? (openBlock(), createBlock(_sfc_main$3, {
|
|
259
|
+
key: 0,
|
|
260
|
+
ref_for: true,
|
|
261
|
+
ref_key: "locationSelectRef",
|
|
262
|
+
ref: locationSelectRef,
|
|
263
|
+
model: __props.model,
|
|
264
|
+
column,
|
|
265
|
+
rules: __props.rules,
|
|
266
|
+
columnNum: __props.columnNum,
|
|
267
|
+
loading: __props.loading,
|
|
268
|
+
disabled: __props.disabled,
|
|
269
|
+
readonly: __props.readonly,
|
|
270
|
+
size: __props.size,
|
|
271
|
+
style: normalizeStyle(unref(columnItemStyle)(props, column)),
|
|
272
|
+
allMapSelect: allMapSelect.value,
|
|
273
|
+
onSetMapSize: setMapSize
|
|
274
|
+
}, null, 8, ["model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style", "allMapSelect"])) : createCommentVNode("v-if", true)
|
|
275
|
+
],
|
|
276
|
+
64
|
|
277
|
+
/* STABLE_FRAGMENT */
|
|
278
|
+
)) : (openBlock(), createElementBlock(
|
|
279
|
+
Fragment,
|
|
280
|
+
{ key: 4 },
|
|
230
281
|
[
|
|
231
282
|
createCommentVNode(" \u8868\u5355 "),
|
|
232
|
-
createVNode(_sfc_main$
|
|
283
|
+
createVNode(_sfc_main$4, {
|
|
284
|
+
class: normalizeClass([allMapSelect.value ? "hidden" : ""]),
|
|
233
285
|
model: __props.model,
|
|
234
286
|
column,
|
|
235
287
|
rules: __props.rules,
|
|
@@ -248,7 +300,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
248
300
|
])
|
|
249
301
|
};
|
|
250
302
|
})
|
|
251
|
-
]), 1032, ["model", "column", "rules", "loading", "disabled", "readonly"])
|
|
303
|
+
]), 1032, ["class", "model", "column", "rules", "loading", "disabled", "readonly"])
|
|
252
304
|
],
|
|
253
305
|
64
|
|
254
306
|
/* STABLE_FRAGMENT */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unref } from 'vue';
|
|
2
|
+
import { isBoolean, isFunction, isNumber, isArray, isObject, isString } from '../../../utils/is.mjs';
|
|
2
3
|
import { funRunHandler } from '../../../utils/handler.mjs';
|
|
3
|
-
import { isNumber, isBoolean, isFunction, isArray, isObject, isString } from '../../../utils/is.mjs';
|
|
4
4
|
import { columnRuleHandler, getValueByProp } from '../../../utils/form.mjs';
|
|
5
5
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
6
6
|
|
|
@@ -15,6 +15,7 @@ function columnItemStyle(props, column) {
|
|
|
15
15
|
case "title":
|
|
16
16
|
case "extra":
|
|
17
17
|
case "array":
|
|
18
|
+
case "location-select":
|
|
18
19
|
style["grid-column"] = `span ${props.columnNum}`;
|
|
19
20
|
break;
|
|
20
21
|
}
|
|
@@ -27,6 +28,12 @@ function columnShowHandler(props, column) {
|
|
|
27
28
|
if (isFunction(show)) return show(column, props.model);
|
|
28
29
|
return true;
|
|
29
30
|
}
|
|
31
|
+
function columnVisibleHandler(props, column) {
|
|
32
|
+
const visible = unref(column.visible);
|
|
33
|
+
if (isBoolean(visible)) return visible;
|
|
34
|
+
if (isFunction(visible)) return visible(column, props.model);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
30
37
|
function columnHelpHandler(props, column) {
|
|
31
38
|
const help = unref(column.help);
|
|
32
39
|
if (isString(help)) return help;
|
|
@@ -110,4 +117,4 @@ function optionsHandler(props, column) {
|
|
|
110
117
|
return [];
|
|
111
118
|
}
|
|
112
119
|
|
|
113
|
-
export { columnHelpHandler, columnItemStyle, columnShowHandler, isDisabled, isReadonly, isRequired, optionsHandler, renderAddLabel, renderArrayItemLabel, renderText };
|
|
120
|
+
export { columnHelpHandler, columnItemStyle, columnShowHandler, columnVisibleHandler, isDisabled, isReadonly, isRequired, optionsHandler, renderAddLabel, renderArrayItemLabel, renderText };
|
|
@@ -1,41 +1,11 @@
|
|
|
1
1
|
import { unref, toRef } from 'vue';
|
|
2
2
|
import { funRunHandler, mergeDeep } from '../../../utils/handler.mjs';
|
|
3
3
|
import { isArray } from '../../../utils/is.mjs';
|
|
4
|
-
import { genValueByProp } from '../../../utils/form.mjs';
|
|
5
|
-
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
4
|
+
import { genValueByProp, genColumnDefaultLabel } from '../../../utils/form.mjs';
|
|
6
5
|
|
|
7
|
-
const genDefaultLabel = (config) => {
|
|
8
|
-
if (config.label) return config.label;
|
|
9
|
-
const { t } = useLocale();
|
|
10
|
-
switch (config.type) {
|
|
11
|
-
// 部门级联选择框
|
|
12
|
-
case "org-cascader":
|
|
13
|
-
return t("form.department");
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const genPlaceholderHandler = (config) => {
|
|
17
|
-
const { t } = useLocale();
|
|
18
|
-
const { type, label, attrs = {} } = config || {};
|
|
19
|
-
let placeholder = attrs.placeholder, startPlaceholder = attrs.startPlaceholder, endPlaceholder = attrs.endPlaceholder;
|
|
20
|
-
switch (type) {
|
|
21
|
-
case "input":
|
|
22
|
-
case "input-number":
|
|
23
|
-
placeholder = placeholder || t("hy.pleaseEnterPlaceholder", [label]);
|
|
24
|
-
break;
|
|
25
|
-
case "select":
|
|
26
|
-
case "date-picker":
|
|
27
|
-
case "time-picker":
|
|
28
|
-
placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
|
|
29
|
-
break;
|
|
30
|
-
default:
|
|
31
|
-
placeholder = placeholder || label;
|
|
32
|
-
}
|
|
33
|
-
return { placeholder, startPlaceholder, endPlaceholder };
|
|
34
|
-
};
|
|
35
6
|
function appFormItemHandler(column = {}) {
|
|
36
|
-
const label =
|
|
37
|
-
const
|
|
38
|
-
const attrs = { ...column.attrs || {}, placeholder };
|
|
7
|
+
const label = genColumnDefaultLabel(column);
|
|
8
|
+
const attrs = { ...column.attrs || {} };
|
|
39
9
|
column = mergeDeep(
|
|
40
10
|
{ ...column },
|
|
41
11
|
{
|
|
@@ -55,7 +25,7 @@ function appFormItemHandler(column = {}) {
|
|
|
55
25
|
...attrs
|
|
56
26
|
}
|
|
57
27
|
};
|
|
58
|
-
} else if (/^(radio|checkbox|select)$/.test(column.type)) {
|
|
28
|
+
} else if (/^(radio|radio-group|checkbox|select)$/.test(column.type)) {
|
|
59
29
|
return {
|
|
60
30
|
...column,
|
|
61
31
|
attrs: {
|
|
@@ -69,7 +39,7 @@ function appFormItemHandler(column = {}) {
|
|
|
69
39
|
}
|
|
70
40
|
}
|
|
71
41
|
};
|
|
72
|
-
} else if (/^(extra)$/.test(column.type)) {
|
|
42
|
+
} else if (/^(extra)$/.test(column.type) || /^(location-select)$/.test(column.type)) {
|
|
73
43
|
return {
|
|
74
44
|
...column,
|
|
75
45
|
children: (column.children || []).map((item) => appFormItemHandler(item))
|
|
@@ -105,7 +75,7 @@ const resetAppFormValue = (columns = [], obj = {}) => {
|
|
|
105
75
|
const childValue = resetAppFormValue(item.children);
|
|
106
76
|
obj[item.prop] = [childValue];
|
|
107
77
|
}
|
|
108
|
-
} else if (item.type === "extra") {
|
|
78
|
+
} else if (item.type === "extra" || item.type === "location-select") {
|
|
109
79
|
resetAppFormValue(item.children, obj);
|
|
110
80
|
} else if (Array.isArray(item.prop)) {
|
|
111
81
|
for (let i = 0; i < item.prop.length; i++) {
|
|
@@ -16,7 +16,7 @@ const _sfc_main = {
|
|
|
16
16
|
type: Object,
|
|
17
17
|
default: () => ({})
|
|
18
18
|
},
|
|
19
|
-
// 地图类型 gaode
|
|
19
|
+
// 地图类型 gaode leafletjs bugMap
|
|
20
20
|
mapType: {
|
|
21
21
|
type: String,
|
|
22
22
|
default: "gaode"
|
|
@@ -27,7 +27,7 @@ const _sfc_main = {
|
|
|
27
27
|
const props = __props;
|
|
28
28
|
const emits = __emit;
|
|
29
29
|
const mapRef = ref();
|
|
30
|
-
const { newMap } = useMixins(
|
|
30
|
+
const { newMap, map, hyMap } = useMixins(
|
|
31
31
|
{
|
|
32
32
|
props,
|
|
33
33
|
emits,
|
|
@@ -39,7 +39,7 @@ const _sfc_main = {
|
|
|
39
39
|
newMap(props.mapType);
|
|
40
40
|
});
|
|
41
41
|
return (_ctx, _cache) => {
|
|
42
|
-
return openBlock(), createElementBlock("div", { class: "w-full h-full
|
|
42
|
+
return openBlock(), createElementBlock("div", { class: "w-full h-full box-border border-border border relative" }, [
|
|
43
43
|
createElementVNode(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { useModel, useTemplateRef, ref, computed, watch, openBlock, createElementBlock, normalizeClass, Fragment, renderList, renderSlot, createTextVNode, toDisplayString, normalizeStyle, createCommentVNode, mergeModels, defineComponent, nextTick } from 'vue';
|
|
2
|
+
|
|
3
|
+
import "./style/radioGroup.scss";
|
|
4
|
+
|
|
5
|
+
const __default__ = defineComponent({
|
|
6
|
+
name: "HyRadioGroup"
|
|
7
|
+
});
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
9
|
+
props: /* @__PURE__ */ mergeModels({
|
|
10
|
+
options: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => ({})
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "default"
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
"modelValue": {
|
|
24
|
+
type: [String, Number, Boolean]
|
|
25
|
+
},
|
|
26
|
+
"modelModifiers": {}
|
|
27
|
+
}),
|
|
28
|
+
emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
|
|
29
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
const emits = __emit;
|
|
32
|
+
const modelValue = useModel(__props, "modelValue");
|
|
33
|
+
const sliderRef = useTemplateRef("sliderRef");
|
|
34
|
+
const selectIndex = ref(0);
|
|
35
|
+
const radioProps = computed(() => {
|
|
36
|
+
return {
|
|
37
|
+
value: "value",
|
|
38
|
+
label: "label",
|
|
39
|
+
disabled: "disabled",
|
|
40
|
+
...props.props || {}
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
function switchSelect(target) {
|
|
44
|
+
modelValue.value = target[radioProps.value.value];
|
|
45
|
+
emits("change", modelValue.value);
|
|
46
|
+
}
|
|
47
|
+
async function sliderHandler() {
|
|
48
|
+
selectIndex.value = props.options.findIndex((item) => {
|
|
49
|
+
return item[radioProps.value.value] === modelValue.value;
|
|
50
|
+
});
|
|
51
|
+
await nextTick();
|
|
52
|
+
const slider = sliderRef.value;
|
|
53
|
+
if (slider) {
|
|
54
|
+
const proportion = 100 / props.options.length;
|
|
55
|
+
const left = selectIndex.value > 0 ? selectIndex.value * proportion : 0;
|
|
56
|
+
console.log("proportion", proportion, left, selectIndex.value);
|
|
57
|
+
slider.style.left = `${left}%`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
watch(
|
|
61
|
+
() => [modelValue.value, props.options],
|
|
62
|
+
() => {
|
|
63
|
+
sliderHandler();
|
|
64
|
+
},
|
|
65
|
+
{ immediate: true }
|
|
66
|
+
);
|
|
67
|
+
__expose({});
|
|
68
|
+
return (_ctx, _cache) => {
|
|
69
|
+
return openBlock(), createElementBlock(
|
|
70
|
+
"ul",
|
|
71
|
+
{
|
|
72
|
+
class: normalizeClass(["w-full flex text-xs rounded border border-border box-border relative", [
|
|
73
|
+
__props.size === "large" ? "h-[40px]" : __props.size === "small" ? "h-[24px]" : "h-[32px]",
|
|
74
|
+
__props.size === "small" ? "text-xs" : "text-sm"
|
|
75
|
+
]])
|
|
76
|
+
},
|
|
77
|
+
[
|
|
78
|
+
(openBlock(true), createElementBlock(
|
|
79
|
+
Fragment,
|
|
80
|
+
null,
|
|
81
|
+
renderList(__props.options, (item, index) => {
|
|
82
|
+
return openBlock(), createElementBlock("li", {
|
|
83
|
+
key: index,
|
|
84
|
+
class: "w-0 flex-1 flex items-center justify-center text-main clickBox",
|
|
85
|
+
onClick: ($event) => switchSelect(item)
|
|
86
|
+
}, [
|
|
87
|
+
renderSlot(_ctx.$slots, "default", {
|
|
88
|
+
item,
|
|
89
|
+
index
|
|
90
|
+
}, () => [
|
|
91
|
+
createTextVNode(
|
|
92
|
+
toDisplayString(item[radioProps.value.label]),
|
|
93
|
+
1
|
|
94
|
+
/* TEXT */
|
|
95
|
+
)
|
|
96
|
+
])
|
|
97
|
+
], 8, ["onClick"]);
|
|
98
|
+
}),
|
|
99
|
+
128
|
|
100
|
+
/* KEYED_FRAGMENT */
|
|
101
|
+
)),
|
|
102
|
+
selectIndex.value >= 0 ? (openBlock(), createElementBlock(
|
|
103
|
+
"li",
|
|
104
|
+
{
|
|
105
|
+
key: 0,
|
|
106
|
+
ref_key: "sliderRef",
|
|
107
|
+
ref: sliderRef,
|
|
108
|
+
class: "slider rounded box-border absolute h-full top-0 left-0 z-0 duration-500 border border-theme shadow-[0_0_6px_0] shadow-theme",
|
|
109
|
+
style: normalizeStyle([{ width: `calc(100% / ${__props.options.length})` }, { "background": "linear-gradient(180deg, #2a4968 0%, #0ea0bb 100%)" }])
|
|
110
|
+
},
|
|
111
|
+
null,
|
|
112
|
+
4
|
|
113
|
+
/* STYLE */
|
|
114
|
+
)) : createCommentVNode("v-if", true)
|
|
115
|
+
],
|
|
116
|
+
2
|
|
117
|
+
/* CLASS */
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export { _sfc_main as default };
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import { computed, unref, openBlock, createBlock, withCtx, createElementVNode, n
|
|
|
2
2
|
import { ElFormItem, ElSelect } from 'element-plus';
|
|
3
3
|
import { columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, optionsHandler, isSelectedTimeRange, timeRangeHandler } from '../js/index.mjs';
|
|
4
4
|
import { isArray } from '../../../utils/is.mjs';
|
|
5
|
-
import { setValueByProp, getValueByProp } from '../../../utils/form.mjs';
|
|
5
|
+
import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnLabelHandler } from '../../../utils/form.mjs';
|
|
6
6
|
import { HyInput } from '../../hyInput/index.mjs';
|
|
7
7
|
import { HyDatePicker } from '../../hyDatePicker/index.mjs';
|
|
8
8
|
import { HyTimePicker } from '../../hyTimePicker/index.mjs';
|
|
@@ -56,6 +56,13 @@ const _sfc_main = {
|
|
|
56
56
|
setValueByProp(props.model, prop, val);
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
+
const columnAttrs = computed(() => {
|
|
60
|
+
return {
|
|
61
|
+
...props.column.attrs,
|
|
62
|
+
label: columnLabelHandler(props.column, props.model),
|
|
63
|
+
placeholder: columnPlaceholderHandler(props.column, props.model)
|
|
64
|
+
};
|
|
65
|
+
});
|
|
59
66
|
function onChangeHandler(value, column) {
|
|
60
67
|
emits("search");
|
|
61
68
|
}
|
|
@@ -96,14 +103,14 @@ const _sfc_main = {
|
|
|
96
103
|
"div",
|
|
97
104
|
{
|
|
98
105
|
class: normalizeClass(["flex items-center text-auxiliary text-xs whitespace-nowrap", {
|
|
99
|
-
"border-r border-border px-3": __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] || __props.column.
|
|
106
|
+
"border-r border-border px-3": __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] || unref(columnLabelHandler)(__props.column, props.model)
|
|
100
107
|
}])
|
|
101
108
|
},
|
|
102
109
|
[
|
|
103
110
|
__props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? renderSlot(_ctx.$slots, __props.column.labelSlot, { column: __props.column }, void 0, void 0, 0) : (openBlock(), createElementBlock(
|
|
104
111
|
"span",
|
|
105
112
|
{ key: 1 },
|
|
106
|
-
toDisplayString(__props.column.
|
|
113
|
+
toDisplayString(unref(columnLabelHandler)(__props.column, props.model)),
|
|
107
114
|
1
|
|
108
115
|
/* TEXT */
|
|
109
116
|
))
|
|
@@ -128,7 +135,7 @@ const _sfc_main = {
|
|
|
128
135
|
createVNode(unref(HyInput), mergeProps({
|
|
129
136
|
modelValue: bindValue.value,
|
|
130
137
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
131
|
-
},
|
|
138
|
+
}, columnAttrs.value, {
|
|
132
139
|
disabled: unref(isDisabled)(props, __props.column),
|
|
133
140
|
onKeydown: withKeys(($event) => onKeydownEnterHander($event, __props.column), ["enter"]),
|
|
134
141
|
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
@@ -144,7 +151,7 @@ const _sfc_main = {
|
|
|
144
151
|
createVNode(unref(ElSelect), mergeProps({
|
|
145
152
|
modelValue: bindValue.value,
|
|
146
153
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
147
|
-
},
|
|
154
|
+
}, columnAttrs.value, {
|
|
148
155
|
disabled: unref(isDisabled)(props, __props.column),
|
|
149
156
|
options: unref(optionsHandler)(props, __props.column),
|
|
150
157
|
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
@@ -162,7 +169,7 @@ const _sfc_main = {
|
|
|
162
169
|
"daterange",
|
|
163
170
|
"monthrange",
|
|
164
171
|
"yearrange"
|
|
165
|
-
].includes(
|
|
172
|
+
].includes(columnAttrs.value?.type) && unref(isArray)(__props.column.field) ? (openBlock(), createBlock(unref(HyDatePicker), mergeProps({
|
|
166
173
|
key: 0,
|
|
167
174
|
start: bindValue.value,
|
|
168
175
|
"onUpdate:start": ($event) => bindValue.value = $event,
|
|
@@ -171,7 +178,7 @@ const _sfc_main = {
|
|
|
171
178
|
"is-range": true,
|
|
172
179
|
style: { "width": "100%" },
|
|
173
180
|
timeRangeFill: __props.column.timeRangeFill
|
|
174
|
-
},
|
|
181
|
+
}, columnAttrs.value, {
|
|
175
182
|
disabled: unref(isDisabled)(props, __props.column),
|
|
176
183
|
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
177
184
|
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "timeRangeFill", "disabled", "onChange"])) : (openBlock(), createBlock(unref(HyDatePicker), mergeProps({
|
|
@@ -181,7 +188,7 @@ const _sfc_main = {
|
|
|
181
188
|
"is-range": false,
|
|
182
189
|
style: { "width": "100%" },
|
|
183
190
|
timeRangeFill: __props.column.timeRangeFill
|
|
184
|
-
},
|
|
191
|
+
}, columnAttrs.value, {
|
|
185
192
|
disabled: unref(isDisabled)(props, __props.column),
|
|
186
193
|
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
187
194
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "timeRangeFill", "disabled", "onChange"]))
|
|
@@ -193,7 +200,7 @@ const _sfc_main = {
|
|
|
193
200
|
{ key: 4 },
|
|
194
201
|
[
|
|
195
202
|
createCommentVNode(" \u65F6\u95F4\u9009\u62E9\u6846 "),
|
|
196
|
-
|
|
203
|
+
columnAttrs.value.isRange ? (openBlock(), createBlock(unref(HyTimePicker), mergeProps({
|
|
197
204
|
key: 0,
|
|
198
205
|
start: bindValue.value,
|
|
199
206
|
"onUpdate:start": ($event) => bindValue.value = $event,
|
|
@@ -201,7 +208,7 @@ const _sfc_main = {
|
|
|
201
208
|
"onUpdate:end": ($event) => bindValue2.value = $event,
|
|
202
209
|
"is-range": true,
|
|
203
210
|
style: { "width": "100%" }
|
|
204
|
-
},
|
|
211
|
+
}, columnAttrs.value, {
|
|
205
212
|
disabled: unref(isDisabled)(props, __props.column),
|
|
206
213
|
onChange: onChangeHandler
|
|
207
214
|
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (openBlock(), createBlock(unref(HyTimePicker), mergeProps({
|
|
@@ -210,7 +217,7 @@ const _sfc_main = {
|
|
|
210
217
|
"onUpdate:modelValue": ($event) => bindValue.value = $event,
|
|
211
218
|
"is-range": false,
|
|
212
219
|
style: { "width": "100%" }
|
|
213
|
-
},
|
|
220
|
+
}, columnAttrs.value, {
|
|
214
221
|
disabled: unref(isDisabled)(props, __props.column),
|
|
215
222
|
onChange: onChangeHandler
|
|
216
223
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"]))
|
|
@@ -225,7 +232,7 @@ const _sfc_main = {
|
|
|
225
232
|
createVNode(unref(HyOrgCascader), mergeProps({
|
|
226
233
|
modelValue: bindValue.value,
|
|
227
234
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
228
|
-
},
|
|
235
|
+
}, columnAttrs.value, {
|
|
229
236
|
disabled: unref(isDisabled)(props, __props.column),
|
|
230
237
|
onChange: onChangeHandler
|
|
231
238
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
@@ -241,7 +248,7 @@ const _sfc_main = {
|
|
|
241
248
|
4
|
|
242
249
|
/* STYLE */
|
|
243
250
|
),
|
|
244
|
-
__props.column.type === "date-picker" && ["daterange", "datetimerange"].includes(
|
|
251
|
+
__props.column.type === "date-picker" && ["daterange", "datetimerange"].includes(columnAttrs.value?.type) && __props.column.timeRangeOptions?.length ? (openBlock(), createElementBlock("div", {
|
|
245
252
|
key: 0,
|
|
246
253
|
class: "flex text-main select-none"
|
|
247
254
|
}, [
|
|
@@ -1,37 +1,9 @@
|
|
|
1
1
|
import { unref, toRef } from 'vue';
|
|
2
2
|
import { funRunHandler, mergeDeep } from '../../../utils/handler.mjs';
|
|
3
|
-
import { genValueByProp } from '../../../utils/form.mjs';
|
|
3
|
+
import { genValueByProp, genColumnDefaultLabel } from '../../../utils/form.mjs';
|
|
4
4
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
5
5
|
import { isNumber } from '../../../utils/is.mjs';
|
|
6
6
|
|
|
7
|
-
const genDefaultLabel = (config) => {
|
|
8
|
-
if (config.label) return config.label;
|
|
9
|
-
const { t } = useLocale();
|
|
10
|
-
switch (config.type) {
|
|
11
|
-
// 部门级联选择框
|
|
12
|
-
case "org-cascader":
|
|
13
|
-
return t("form.department");
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const genPlaceholderHandler = (config) => {
|
|
17
|
-
const { t } = useLocale();
|
|
18
|
-
const { type, label, attrs = {} } = config || {};
|
|
19
|
-
let placeholder = attrs.placeholder, startPlaceholder = attrs.startPlaceholder, endPlaceholder = attrs.endPlaceholder;
|
|
20
|
-
switch (type) {
|
|
21
|
-
case "input":
|
|
22
|
-
placeholder = placeholder || t("hy.pleaseEnterPlaceholder", [label]);
|
|
23
|
-
break;
|
|
24
|
-
case "select":
|
|
25
|
-
case "date-picker":
|
|
26
|
-
case "time-picker":
|
|
27
|
-
case "org-cascader":
|
|
28
|
-
placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
|
|
29
|
-
break;
|
|
30
|
-
default:
|
|
31
|
-
placeholder = placeholder || label;
|
|
32
|
-
}
|
|
33
|
-
return { placeholder, startPlaceholder, endPlaceholder };
|
|
34
|
-
};
|
|
35
7
|
const genColumnWidth = (config) => {
|
|
36
8
|
let { width, inputWidth, type, attrs } = config || {};
|
|
37
9
|
if (!width && !inputWidth) {
|
|
@@ -84,12 +56,10 @@ const timeRangeOptionsHandler = (config) => {
|
|
|
84
56
|
}, []);
|
|
85
57
|
};
|
|
86
58
|
function appSearchItemHandler(column = {}) {
|
|
87
|
-
const label =
|
|
88
|
-
const { placeholder} = genPlaceholderHandler({ ...column, label });
|
|
59
|
+
const label = genColumnDefaultLabel(column);
|
|
89
60
|
const attrs = {
|
|
90
61
|
clearable: true,
|
|
91
|
-
...column.attrs || {}
|
|
92
|
-
placeholder
|
|
62
|
+
...column.attrs || {}
|
|
93
63
|
};
|
|
94
64
|
const { width, inputWidth } = genColumnWidth(column);
|
|
95
65
|
column = mergeDeep(
|