hy-dispatch-ui-v3 0.2.65 → 0.2.66
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 +26 -12
- package/es/api/organization.mjs +43 -0
- package/es/bussiness/hyAcquisitionStationTree/acquisitionStationTree.vue.mjs +245 -0
- package/es/bussiness/hyAcquisitionStationTree/index.mjs +7 -0
- package/es/bussiness/hyAcquisitionStationTree/js/index.mjs +124 -0
- package/es/bussiness/hyAcquisitionStationTree/style/acquisitionStationTree.scss +0 -0
- package/es/bussiness/hyDeviceTree/deviceTree.vue.mjs +249 -0
- package/es/bussiness/hyDeviceTree/index.mjs +7 -0
- package/es/bussiness/hyDeviceTree/js/index.mjs +126 -0
- package/es/bussiness/hyDeviceTree/style/deviceTree.scss +0 -0
- package/es/bussiness/hyOrgGroupTree/index.mjs +7 -0
- package/es/bussiness/hyOrgGroupTree/js/index.mjs +124 -0
- package/es/bussiness/hyOrgGroupTree/orgGroupTree.vue.mjs +245 -0
- package/es/bussiness/hyOrgGroupTree/style/orgGroupTree.scss +0 -0
- package/es/bussiness/hyPlanGroupDeviceTree/index.mjs +7 -0
- package/es/bussiness/hyPlanGroupDeviceTree/js/index.mjs +124 -0
- package/es/bussiness/hyPlanGroupDeviceTree/planGroupDeviceTree.vue.mjs +245 -0
- package/es/bussiness/hyPlanGroupDeviceTree/style/planGroupDeviceTree.scss +0 -0
- package/es/bussiness/hyUserTree/index.mjs +7 -0
- package/es/bussiness/hyUserTree/js/index.mjs +126 -0
- package/es/bussiness/hyUserTree/style/userTree.scss +0 -0
- package/es/bussiness/hyUserTree/userTree.vue.mjs +239 -0
- package/es/bussiness/index.mjs +5 -0
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +18 -16
- package/es/components/hyButton/button.vue.mjs +3 -2
- package/es/components/hyButton/style/button.scss +70 -0
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +1 -2
- package/es/components/hyForm/cpns/formItem.vue.mjs +198 -26
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +8 -1
- package/es/components/hyForm/form.vue.mjs +74 -19
- package/es/components/hyForm/js/index.mjs +2 -1
- package/es/components/hyForm/js/useAppForm.mjs +2 -2
- package/es/components/hyIcon/style/icon.scss +1 -0
- package/es/components/hyNoPermissions/noPermissions.vue.mjs +1 -1
- package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +1 -1
- package/es/components/hyOrgCascader/orgCascader.vue.mjs +69 -14
- package/es/components/hyRadioGroup/radioGroup.vue.mjs +5 -4
- package/es/components/hySearch/cpns/searchItem.vue.mjs +167 -11
- package/es/components/hySearch/js/index.mjs +2 -1
- package/es/components/hySearch/search.vue.mjs +60 -9
- package/es/components/hyTable/cpns/columnSelect.vue.mjs +21 -22
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +10 -15
- package/es/components/hyTable/js/index.mjs +5 -12
- package/es/components/hyTable/js/search.mjs +3 -1
- package/es/components/hyTable/style/table.scss +13 -0
- package/es/components/hyTable/table.vue.mjs +21 -9
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +8 -10
- package/es/components/hyTableForm/batchTableForm.vue.mjs +13 -3
- package/es/components/hyTableForm/tableForm.vue.mjs +17 -11
- package/es/components/hyTour/index.mjs +7 -0
- package/es/components/hyTour/style/tour.scss +0 -0
- package/es/components/hyTour/tour.vue.mjs +23 -0
- package/es/components/hyTree/config/tree-config.mjs +5 -2
- package/es/components/hyTree/js/index.mjs +11 -7
- package/es/components/hyTree/tree.vue.mjs +18 -35
- package/es/components/index.mjs +1 -0
- package/es/index.mjs +6 -0
- package/es/static/hy-svg-icons/hy-icon-ops-linear-arrow.js +10 -0
- package/es/style/element/hy-element.scss +24 -3
- package/es/style/theme.scss +1 -0
- package/es/utils/map/hook/bigMap.mjs +9 -1
- package/es/utils/map/hook/gaode.mjs +9 -1
- package/es/utils/map/hook/leafletjs.mjs +10 -1
- package/es/version.mjs +1 -1
- package/lib/api/organization.js +47 -0
- package/lib/bussiness/hyAcquisitionStationTree/acquisitionStationTree.vue.js +249 -0
- package/lib/bussiness/hyAcquisitionStationTree/index.js +12 -0
- package/lib/bussiness/hyAcquisitionStationTree/js/index.js +126 -0
- package/lib/bussiness/hyAcquisitionStationTree/style/acquisitionStationTree.scss +0 -0
- package/lib/bussiness/hyDeviceTree/deviceTree.vue.js +253 -0
- package/lib/bussiness/hyDeviceTree/index.js +12 -0
- package/lib/bussiness/hyDeviceTree/js/index.js +128 -0
- package/lib/bussiness/hyDeviceTree/style/deviceTree.scss +0 -0
- package/lib/bussiness/hyOrgGroupTree/index.js +12 -0
- package/lib/bussiness/hyOrgGroupTree/js/index.js +126 -0
- package/lib/bussiness/hyOrgGroupTree/orgGroupTree.vue.js +249 -0
- package/lib/bussiness/hyOrgGroupTree/style/orgGroupTree.scss +0 -0
- package/lib/bussiness/hyPlanGroupDeviceTree/index.js +12 -0
- package/lib/bussiness/hyPlanGroupDeviceTree/js/index.js +126 -0
- package/lib/bussiness/hyPlanGroupDeviceTree/planGroupDeviceTree.vue.js +249 -0
- package/lib/bussiness/hyPlanGroupDeviceTree/style/planGroupDeviceTree.scss +0 -0
- package/lib/bussiness/hyUserTree/index.js +12 -0
- package/lib/bussiness/hyUserTree/js/index.js +128 -0
- package/lib/bussiness/hyUserTree/style/userTree.scss +0 -0
- package/lib/bussiness/hyUserTree/userTree.vue.js +243 -0
- package/lib/bussiness/index.js +14 -4
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +18 -16
- package/lib/components/hyButton/button.vue.js +3 -2
- package/lib/components/hyButton/style/button.scss +70 -0
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +0 -1
- package/lib/components/hyForm/cpns/formItem.vue.js +195 -23
- package/lib/components/hyForm/cpns/locationSelect.vue.js +8 -1
- package/lib/components/hyForm/form.vue.js +72 -17
- package/lib/components/hyForm/js/index.js +2 -0
- package/lib/components/hyForm/js/useAppForm.js +2 -2
- package/lib/components/hyIcon/style/icon.scss +1 -0
- package/lib/components/hyNoPermissions/noPermissions.vue.js +1 -1
- package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +1 -1
- package/lib/components/hyOrgCascader/orgCascader.vue.js +67 -12
- package/lib/components/hyRadioGroup/radioGroup.vue.js +5 -4
- package/lib/components/hySearch/cpns/searchItem.vue.js +164 -8
- package/lib/components/hySearch/js/index.js +2 -0
- package/lib/components/hySearch/search.vue.js +58 -7
- package/lib/components/hyTable/cpns/columnSelect.vue.js +20 -21
- package/lib/components/hyTable/cpns/virtualTable.vue.js +27 -32
- package/lib/components/hyTable/js/index.js +5 -12
- package/lib/components/hyTable/js/search.js +3 -1
- package/lib/components/hyTable/style/table.scss +13 -0
- package/lib/components/hyTable/table.vue.js +20 -8
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +7 -9
- package/lib/components/hyTableForm/batchTableForm.vue.js +13 -3
- package/lib/components/hyTableForm/tableForm.vue.js +18 -12
- package/lib/components/hyTour/index.js +12 -0
- package/lib/components/hyTour/style/tour.scss +0 -0
- package/lib/components/hyTour/tour.vue.js +27 -0
- package/lib/components/hyTree/config/tree-config.js +5 -2
- package/lib/components/hyTree/js/index.js +11 -7
- package/lib/components/hyTree/tree.vue.js +18 -35
- package/lib/components/index.js +8 -6
- package/lib/index.js +67 -55
- package/lib/static/hy-svg-icons/hy-icon-ops-linear-arrow.js +10 -0
- package/lib/style/element/hy-element.scss +24 -3
- package/lib/style/theme.scss +1 -0
- package/lib/utils/map/hook/bigMap.js +9 -1
- package/lib/utils/map/hook/gaode.js +9 -1
- package/lib/utils/map/hook/leafletjs.js +10 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var elementPlus = require('element-plus');
|
|
7
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
7
8
|
require('../../hooks/index.js');
|
|
8
9
|
var index = require('./js/index.js');
|
|
9
10
|
var useSubscribe = require('../../hooks/useSubscribe.js');
|
|
@@ -84,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
84
85
|
"modelModifiers": {}
|
|
85
86
|
}),
|
|
86
87
|
emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:modelValue"]),
|
|
87
|
-
setup(__props, { emit: __emit }) {
|
|
88
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
88
89
|
const props = __props;
|
|
89
90
|
const emits = __emit;
|
|
90
91
|
const { subOrgCascader, unsubOrgCascader } = useSubscribe.useSubscribe();
|
|
@@ -99,11 +100,20 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
99
100
|
const target = cascaderValueMap.value.get(modelValue.value);
|
|
100
101
|
return target?.companyName;
|
|
101
102
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
function getCascaderData() {
|
|
104
|
+
return new Promise(async (resolve, reject) => {
|
|
105
|
+
loading.value = true;
|
|
106
|
+
try {
|
|
107
|
+
cascaderOptions.value = [];
|
|
108
|
+
const data = await index.getOrgTreeSimple();
|
|
109
|
+
handlerData(data || []);
|
|
110
|
+
resolve();
|
|
111
|
+
} catch (err) {
|
|
112
|
+
console.error(err);
|
|
113
|
+
reject();
|
|
114
|
+
}
|
|
115
|
+
loading.value = false;
|
|
116
|
+
});
|
|
107
117
|
}
|
|
108
118
|
function handlerData(data) {
|
|
109
119
|
const { cascaderData, cascaderDataMap } = index.orgTreeDatahandler(data);
|
|
@@ -157,6 +167,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
157
167
|
vue.onUnmounted(() => {
|
|
158
168
|
unsubOrgCascader(getCascaderData);
|
|
159
169
|
});
|
|
170
|
+
__expose({
|
|
171
|
+
getData: getCascaderData
|
|
172
|
+
});
|
|
160
173
|
return (_ctx, _cache) => {
|
|
161
174
|
return vue.openBlock(), vue.createElementBlock("div", { class: "relative" }, [
|
|
162
175
|
__props.contentType ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -190,7 +203,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
190
203
|
"virtual-scroll": "",
|
|
191
204
|
onChange: onChangeHanlder,
|
|
192
205
|
onVisibleChange: ($event) => onVisibleChangeHandler($event)
|
|
193
|
-
},
|
|
206
|
+
}, vue.createSlots({
|
|
207
|
+
_: 2
|
|
208
|
+
/* DYNAMIC */
|
|
209
|
+
}, [
|
|
210
|
+
loading.value ? {
|
|
211
|
+
name: "empty",
|
|
212
|
+
fn: vue.withCtx(() => [
|
|
213
|
+
vue.createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
|
|
214
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
215
|
+
size: "16",
|
|
216
|
+
class: "is-loading text-theme"
|
|
217
|
+
}, {
|
|
218
|
+
default: vue.withCtx(() => [
|
|
219
|
+
vue.createVNode(vue.unref(iconsVue.Loading))
|
|
220
|
+
]),
|
|
221
|
+
_: 1
|
|
222
|
+
/* STABLE */
|
|
223
|
+
}),
|
|
224
|
+
vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
|
|
225
|
+
])
|
|
226
|
+
]),
|
|
227
|
+
key: "0"
|
|
228
|
+
} : void 0
|
|
229
|
+
]), 1032, ["modelValue", "onUpdate:modelValue", "size", "options", "disabled", "clearable", "placeholder", "onVisibleChange"])
|
|
194
230
|
],
|
|
195
231
|
4
|
|
196
232
|
/* STYLE */
|
|
@@ -229,11 +265,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
229
265
|
"show-all-levels": false,
|
|
230
266
|
"virtual-scroll": "",
|
|
231
267
|
onChange: onChangeHanlder
|
|
232
|
-
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
268
|
+
}, vue.createSlots({
|
|
269
|
+
_: 2
|
|
270
|
+
/* DYNAMIC */
|
|
271
|
+
}, [
|
|
272
|
+
loading.value ? {
|
|
273
|
+
name: "empty",
|
|
274
|
+
fn: vue.withCtx(() => [
|
|
275
|
+
vue.createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
|
|
276
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
277
|
+
size: "16",
|
|
278
|
+
class: "is-loading text-theme"
|
|
279
|
+
}, {
|
|
280
|
+
default: vue.withCtx(() => [
|
|
281
|
+
vue.createVNode(vue.unref(iconsVue.Loading))
|
|
282
|
+
]),
|
|
283
|
+
_: 1
|
|
284
|
+
/* STABLE */
|
|
285
|
+
}),
|
|
286
|
+
vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
|
|
287
|
+
])
|
|
288
|
+
]),
|
|
289
|
+
key: "0"
|
|
290
|
+
} : void 0
|
|
291
|
+
]), 1032, ["modelValue", "onUpdate:modelValue", "class", "size", "options", "clearable", "disabled", "placeholder"]))
|
|
237
292
|
]);
|
|
238
293
|
};
|
|
239
294
|
}
|
|
@@ -45,8 +45,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
47
|
function switchSelect(target) {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const value = target[radioProps.value.value];
|
|
49
|
+
if (modelValue.value === value) return;
|
|
50
|
+
modelValue.value = value;
|
|
51
|
+
emits("change", value);
|
|
50
52
|
}
|
|
51
53
|
async function sliderHandler() {
|
|
52
54
|
selectIndex.value = props.options.findIndex((item) => {
|
|
@@ -57,7 +59,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
57
59
|
if (slider) {
|
|
58
60
|
const proportion = 100 / props.options.length;
|
|
59
61
|
const left = selectIndex.value > 0 ? selectIndex.value * proportion : 0;
|
|
60
|
-
console.log("proportion", proportion, left, selectIndex.value);
|
|
61
62
|
slider.style.left = `${left}%`;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -85,7 +86,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
85
86
|
vue.renderList(__props.options, (item, index) => {
|
|
86
87
|
return vue.openBlock(), vue.createElementBlock("li", {
|
|
87
88
|
key: index,
|
|
88
|
-
class: "w-0 flex-1 flex items-center justify-center text-main clickBox",
|
|
89
|
+
class: "w-0 flex-1 flex items-center justify-center text-main user-select-none clickBox",
|
|
89
90
|
onClick: ($event) => switchSelect(item, index, $event)
|
|
90
91
|
}, [
|
|
91
92
|
vue.renderSlot(_ctx.$slots, "default", {
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var elementPlus = require('element-plus');
|
|
7
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
7
8
|
require('../../../utils/index.js');
|
|
8
9
|
require('../../index.js');
|
|
9
10
|
var index = require('../js/index.js');
|
|
@@ -38,10 +39,16 @@ const _sfc_main = {
|
|
|
38
39
|
setup(__props, { emit: __emit }) {
|
|
39
40
|
const props = __props;
|
|
40
41
|
const emits = __emit;
|
|
42
|
+
const formContext = vue.inject(index.formContextKey);
|
|
43
|
+
const orgCascaderRef = vue.useTemplateRef("orgCascaderRef");
|
|
41
44
|
const columnProp = vue.computed(() => {
|
|
42
45
|
let field = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
|
|
43
46
|
return field;
|
|
44
47
|
});
|
|
48
|
+
const propString = vue.computed(() => {
|
|
49
|
+
if (!columnProp.value) return "";
|
|
50
|
+
return is.isArray(columnProp.value) ? columnProp.value.join(".") : columnProp.value;
|
|
51
|
+
});
|
|
45
52
|
const bindValue = vue.computed({
|
|
46
53
|
get() {
|
|
47
54
|
const prop = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
|
|
@@ -62,6 +69,12 @@ const _sfc_main = {
|
|
|
62
69
|
form.setValueByProp(props.model, prop, val);
|
|
63
70
|
}
|
|
64
71
|
});
|
|
72
|
+
const columnConfig = vue.computed(() => {
|
|
73
|
+
return {
|
|
74
|
+
...props.column,
|
|
75
|
+
attrs: columnAttrs.value
|
|
76
|
+
};
|
|
77
|
+
});
|
|
65
78
|
const columnAttrs = vue.computed(() => {
|
|
66
79
|
return {
|
|
67
80
|
...props.column.attrs,
|
|
@@ -69,8 +82,42 @@ const _sfc_main = {
|
|
|
69
82
|
placeholder: form.columnPlaceholderHandler(props.column, props.model)
|
|
70
83
|
};
|
|
71
84
|
});
|
|
85
|
+
const optionsLoading = vue.ref(false);
|
|
86
|
+
const optionsError = vue.ref("");
|
|
87
|
+
async function obtainOptions() {
|
|
88
|
+
if (props.column.optionsFn) {
|
|
89
|
+
if (!props.column.optionsFn || optionsLoading.value) return;
|
|
90
|
+
optionsLoading.value = true;
|
|
91
|
+
optionsError.value = "";
|
|
92
|
+
props.column.attrs.options = [];
|
|
93
|
+
try {
|
|
94
|
+
props.column.attrs.options = await props.column.optionsFn(
|
|
95
|
+
props.column,
|
|
96
|
+
props.model
|
|
97
|
+
);
|
|
98
|
+
optionsError.value = "";
|
|
99
|
+
} catch (err) {
|
|
100
|
+
optionsError.value = "error";
|
|
101
|
+
console.error(err);
|
|
102
|
+
}
|
|
103
|
+
} else if (props.column.type === "org-cascader") {
|
|
104
|
+
if (orgCascaderRef.value) {
|
|
105
|
+
optionsLoading.value = true;
|
|
106
|
+
optionsError.value = "";
|
|
107
|
+
try {
|
|
108
|
+
await orgCascaderRef.value.getData();
|
|
109
|
+
} catch {
|
|
110
|
+
optionsError.value = "error";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
optionsLoading.value = false;
|
|
115
|
+
}
|
|
72
116
|
function onChangeHandler(value, column) {
|
|
117
|
+
const { onChange } = props.column;
|
|
73
118
|
emits("search");
|
|
119
|
+
if (!onChange) return;
|
|
120
|
+
onChange(props.column, props.model, props.index);
|
|
74
121
|
}
|
|
75
122
|
function onKeydownEnterHander(e) {
|
|
76
123
|
emits("search");
|
|
@@ -90,6 +137,27 @@ const _sfc_main = {
|
|
|
90
137
|
}
|
|
91
138
|
emits("search");
|
|
92
139
|
}
|
|
140
|
+
const context = vue.reactive({
|
|
141
|
+
...vue.toRefs(props),
|
|
142
|
+
columnProp,
|
|
143
|
+
propString,
|
|
144
|
+
columnConfig,
|
|
145
|
+
columnAttrs,
|
|
146
|
+
obtainOptions,
|
|
147
|
+
optionsLoading,
|
|
148
|
+
optionsError,
|
|
149
|
+
options: vue.computed(() => {
|
|
150
|
+
return index.optionsHandler(props, props.column);
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
vue.onMounted(() => {
|
|
154
|
+
if (propString.value) {
|
|
155
|
+
formContext?.addField(context);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
vue.onBeforeUnmount(() => {
|
|
159
|
+
formContext?.removeField(context);
|
|
160
|
+
});
|
|
93
161
|
return (_ctx, _cache) => {
|
|
94
162
|
return vue.unref(index.columnShowHandler)(props, __props.column) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElFormItem), {
|
|
95
163
|
key: 0,
|
|
@@ -113,7 +181,7 @@ const _sfc_main = {
|
|
|
113
181
|
}])
|
|
114
182
|
},
|
|
115
183
|
[
|
|
116
|
-
__props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? vue.renderSlot(_ctx.$slots, __props.column.labelSlot, { column:
|
|
184
|
+
__props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? vue.renderSlot(_ctx.$slots, __props.column.labelSlot, { column: columnConfig.value }, void 0, void 0, 0) : (vue.openBlock(), vue.createElementBlock(
|
|
117
185
|
"span",
|
|
118
186
|
{ key: 1 },
|
|
119
187
|
vue.toDisplayString(vue.unref(form.columnLabelHandler)(__props.column, props.model)),
|
|
@@ -133,7 +201,7 @@ const _sfc_main = {
|
|
|
133
201
|
},
|
|
134
202
|
[
|
|
135
203
|
vue.createCommentVNode(" \u81EA\u5B9A\u4E49\u5177\u540D\u63D2\u69FD "),
|
|
136
|
-
__props.column.slot ? vue.renderSlot(_ctx.$slots, __props.column.slot, { column:
|
|
204
|
+
__props.column.slot ? vue.renderSlot(_ctx.$slots, __props.column.slot, { column: columnConfig.value }, void 0, void 0, 0) : __props.column.type === "input" ? (vue.openBlock(), vue.createElementBlock(
|
|
137
205
|
vue.Fragment,
|
|
138
206
|
{ key: 1 },
|
|
139
207
|
[
|
|
@@ -161,13 +229,75 @@ const _sfc_main = {
|
|
|
161
229
|
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
162
230
|
options: vue.unref(index.optionsHandler)(props, __props.column),
|
|
163
231
|
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
164
|
-
}),
|
|
232
|
+
}), vue.createSlots({
|
|
233
|
+
_: 2
|
|
234
|
+
/* DYNAMIC */
|
|
235
|
+
}, [
|
|
236
|
+
optionsLoading.value ? {
|
|
237
|
+
name: "empty",
|
|
238
|
+
fn: vue.withCtx(() => [
|
|
239
|
+
vue.createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
|
|
240
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
241
|
+
size: "16",
|
|
242
|
+
class: "is-loading text-theme"
|
|
243
|
+
}, {
|
|
244
|
+
default: vue.withCtx(() => [
|
|
245
|
+
vue.createVNode(vue.unref(iconsVue.Loading))
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
/* STABLE */
|
|
249
|
+
}),
|
|
250
|
+
vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
|
|
251
|
+
])
|
|
252
|
+
]),
|
|
253
|
+
key: "0"
|
|
254
|
+
} : void 0
|
|
255
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options", "onChange"])
|
|
165
256
|
],
|
|
166
257
|
2112
|
|
167
258
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
168
|
-
)) : __props.column.type === "
|
|
259
|
+
)) : __props.column.type === "select-v2" ? (vue.openBlock(), vue.createElementBlock(
|
|
169
260
|
vue.Fragment,
|
|
170
261
|
{ key: 3 },
|
|
262
|
+
[
|
|
263
|
+
vue.createCommentVNode(" \u865A\u62DF\u5316\u9009\u62E9\u6846 "),
|
|
264
|
+
vue.createVNode(vue.unref(elementPlus.ElSelectV2), vue.mergeProps({
|
|
265
|
+
modelValue: bindValue.value,
|
|
266
|
+
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
267
|
+
}, columnAttrs.value, {
|
|
268
|
+
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
269
|
+
options: vue.unref(index.optionsHandler)(props, __props.column),
|
|
270
|
+
onChange: onChangeHandler
|
|
271
|
+
}), vue.createSlots({
|
|
272
|
+
_: 2
|
|
273
|
+
/* DYNAMIC */
|
|
274
|
+
}, [
|
|
275
|
+
optionsLoading.value ? {
|
|
276
|
+
name: "empty",
|
|
277
|
+
fn: vue.withCtx(() => [
|
|
278
|
+
vue.createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
|
|
279
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
280
|
+
size: "16",
|
|
281
|
+
class: "is-loading text-theme"
|
|
282
|
+
}, {
|
|
283
|
+
default: vue.withCtx(() => [
|
|
284
|
+
vue.createVNode(vue.unref(iconsVue.Loading))
|
|
285
|
+
]),
|
|
286
|
+
_: 1
|
|
287
|
+
/* STABLE */
|
|
288
|
+
}),
|
|
289
|
+
vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
|
|
290
|
+
])
|
|
291
|
+
]),
|
|
292
|
+
key: "0"
|
|
293
|
+
} : void 0
|
|
294
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
|
|
295
|
+
],
|
|
296
|
+
2112
|
|
297
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
298
|
+
)) : __props.column.type === "date-picker" ? (vue.openBlock(), vue.createElementBlock(
|
|
299
|
+
vue.Fragment,
|
|
300
|
+
{ key: 4 },
|
|
171
301
|
[
|
|
172
302
|
vue.createCommentVNode(" \u65E5\u671F\u9009\u62E9\u6846 "),
|
|
173
303
|
[
|
|
@@ -203,7 +333,7 @@ const _sfc_main = {
|
|
|
203
333
|
/* STABLE_FRAGMENT */
|
|
204
334
|
)) : __props.column.type === "time-picker" ? (vue.openBlock(), vue.createElementBlock(
|
|
205
335
|
vue.Fragment,
|
|
206
|
-
{ key:
|
|
336
|
+
{ key: 5 },
|
|
207
337
|
[
|
|
208
338
|
vue.createCommentVNode(" \u65F6\u95F4\u9009\u62E9\u6846 "),
|
|
209
339
|
columnAttrs.value.isRange ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.HyTimePicker), vue.mergeProps({
|
|
@@ -232,10 +362,12 @@ const _sfc_main = {
|
|
|
232
362
|
/* STABLE_FRAGMENT */
|
|
233
363
|
)) : __props.column.type === "org-cascader" ? (vue.openBlock(), vue.createElementBlock(
|
|
234
364
|
vue.Fragment,
|
|
235
|
-
{ key:
|
|
365
|
+
{ key: 6 },
|
|
236
366
|
[
|
|
237
367
|
vue.createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
238
368
|
vue.createVNode(vue.unref(index$4.HyOrgCascader), vue.mergeProps({
|
|
369
|
+
ref_key: "orgCascaderRef",
|
|
370
|
+
ref: orgCascaderRef,
|
|
239
371
|
modelValue: bindValue.value,
|
|
240
372
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
241
373
|
}, columnAttrs.value, {
|
|
@@ -247,17 +379,41 @@ const _sfc_main = {
|
|
|
247
379
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
248
380
|
)) : __props.column.type === "cascader" ? (vue.openBlock(), vue.createElementBlock(
|
|
249
381
|
vue.Fragment,
|
|
250
|
-
{ key:
|
|
382
|
+
{ key: 7 },
|
|
251
383
|
[
|
|
252
384
|
vue.createCommentVNode(" \u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
253
385
|
vue.createVNode(vue.unref(elementPlus.ElCascader), vue.mergeProps({
|
|
254
386
|
modelValue: bindValue.value,
|
|
255
387
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
256
388
|
}, columnAttrs.value, {
|
|
389
|
+
style: { "width": "100%" },
|
|
257
390
|
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
258
391
|
options: vue.unref(index.optionsHandler)(props, __props.column),
|
|
259
392
|
onChange: onChangeHandler
|
|
260
|
-
}),
|
|
393
|
+
}), vue.createSlots({
|
|
394
|
+
_: 2
|
|
395
|
+
/* DYNAMIC */
|
|
396
|
+
}, [
|
|
397
|
+
optionsLoading.value ? {
|
|
398
|
+
name: "empty",
|
|
399
|
+
fn: vue.withCtx(() => [
|
|
400
|
+
vue.createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
|
|
401
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
402
|
+
size: "16",
|
|
403
|
+
class: "is-loading text-theme"
|
|
404
|
+
}, {
|
|
405
|
+
default: vue.withCtx(() => [
|
|
406
|
+
vue.createVNode(vue.unref(iconsVue.Loading))
|
|
407
|
+
]),
|
|
408
|
+
_: 1
|
|
409
|
+
/* STABLE */
|
|
410
|
+
}),
|
|
411
|
+
vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u52A0\u8F7D\u4E2D")
|
|
412
|
+
])
|
|
413
|
+
]),
|
|
414
|
+
key: "0"
|
|
415
|
+
} : void 0
|
|
416
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
|
|
261
417
|
],
|
|
262
418
|
2112
|
|
263
419
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -7,6 +7,7 @@ require('../../../hooks/index.js');
|
|
|
7
7
|
var is = require('../../../utils/is.js');
|
|
8
8
|
var useResizeObserver = require('../../../hooks/useResizeObserver.js');
|
|
9
9
|
|
|
10
|
+
const formContextKey = /* @__PURE__ */ Symbol("formContextKey");
|
|
10
11
|
function columnItemStyle(props, column) {
|
|
11
12
|
const { width } = column;
|
|
12
13
|
const style = {};
|
|
@@ -143,6 +144,7 @@ function optionsHandler(props, column) {
|
|
|
143
144
|
exports.columnItemInputStyle = columnItemInputStyle;
|
|
144
145
|
exports.columnItemStyle = columnItemStyle;
|
|
145
146
|
exports.columnShowHandler = columnShowHandler;
|
|
147
|
+
exports.formContextKey = formContextKey;
|
|
146
148
|
exports.isDisabled = isDisabled;
|
|
147
149
|
exports.isEmptyValue = isEmptyValue;
|
|
148
150
|
exports.isSelectedTimeRange = isSelectedTimeRange;
|
|
@@ -84,9 +84,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
84
84
|
}
|
|
85
85
|
return style;
|
|
86
86
|
});
|
|
87
|
-
vue.onUnmounted(() => {
|
|
88
|
-
shrinkDestroy();
|
|
89
|
-
});
|
|
90
87
|
function getFilterCount(model, defaultValue, prop) {
|
|
91
88
|
let count = 0;
|
|
92
89
|
const keys = Object.keys(defaultValue);
|
|
@@ -114,10 +111,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
114
111
|
function onSearchHandler() {
|
|
115
112
|
emits("search");
|
|
116
113
|
}
|
|
117
|
-
function resetFields(
|
|
114
|
+
function resetFields(fields2) {
|
|
118
115
|
let columns = props.columns || [];
|
|
119
|
-
if (
|
|
120
|
-
columns =
|
|
116
|
+
if (fields2 && fields2?.length) {
|
|
117
|
+
columns = fields2.map((key) => formColumnMap.value.get(key)).filter(Boolean);
|
|
121
118
|
}
|
|
122
119
|
useAppSearch.resetAppSearchValue(columns, props.model);
|
|
123
120
|
}
|
|
@@ -125,8 +122,62 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
125
122
|
resetFields();
|
|
126
123
|
emits("search");
|
|
127
124
|
}
|
|
125
|
+
const fields = vue.reactive([]);
|
|
126
|
+
function addField(field) {
|
|
127
|
+
fields.push(field);
|
|
128
|
+
}
|
|
129
|
+
const removeField = (field) => {
|
|
130
|
+
if (vue.unref(field.columnAttrs)) {
|
|
131
|
+
fields.splice(fields.indexOf(field), 1);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
function filterFields(fields2 = [], keys = []) {
|
|
135
|
+
const filterKeys = keys.map((prop) => is.isArray(prop) ? prop.join(".") : prop);
|
|
136
|
+
return filterKeys.length ? fields2.filter(
|
|
137
|
+
(field) => field.propString && filterKeys.includes(field.propString)
|
|
138
|
+
) : fields2;
|
|
139
|
+
}
|
|
140
|
+
async function obtainOptionsFields(keys) {
|
|
141
|
+
const filteredFields = filterFields(fields, keys);
|
|
142
|
+
await Promise.allSettled(filteredFields.map((field) => field.obtainOptions()));
|
|
143
|
+
}
|
|
144
|
+
async function getOptions() {
|
|
145
|
+
await obtainOptionsFields();
|
|
146
|
+
}
|
|
147
|
+
async function getOptionsFields(keys) {
|
|
148
|
+
await obtainOptionsFields(keys);
|
|
149
|
+
}
|
|
150
|
+
async function getOptionsError() {
|
|
151
|
+
const filteredFields = fields.filter(
|
|
152
|
+
(field) => field.propString && field.optionsError
|
|
153
|
+
);
|
|
154
|
+
await Promise.allSettled(filteredFields.map((field) => field.obtainOptions()));
|
|
155
|
+
}
|
|
156
|
+
vue.provide(
|
|
157
|
+
index.formContextKey,
|
|
158
|
+
vue.reactive({
|
|
159
|
+
...vue.toRefs(props),
|
|
160
|
+
emits,
|
|
161
|
+
addField,
|
|
162
|
+
removeField
|
|
163
|
+
})
|
|
164
|
+
);
|
|
165
|
+
vue.onMounted(() => {
|
|
166
|
+
getOptions();
|
|
167
|
+
});
|
|
168
|
+
vue.onUnmounted(() => {
|
|
169
|
+
shrinkDestroy();
|
|
170
|
+
});
|
|
128
171
|
__expose({
|
|
129
|
-
resetFields
|
|
172
|
+
resetFields,
|
|
173
|
+
getOptions,
|
|
174
|
+
getOptionsFields,
|
|
175
|
+
getOptionsError,
|
|
176
|
+
getOptionsByField: (field) => {
|
|
177
|
+
const [target] = filterFields(fields, [field]);
|
|
178
|
+
if (!target) return null;
|
|
179
|
+
return target.options;
|
|
180
|
+
}
|
|
130
181
|
});
|
|
131
182
|
return (_ctx, _cache) => {
|
|
132
183
|
return vue.openBlock(), vue.createElementBlock(
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var Sortable = require('sortablejs');
|
|
7
7
|
var elementPlus = require('element-plus');
|
|
8
|
-
var iconsVue = require('@element-plus/icons-vue');
|
|
9
8
|
require('../../../hooks/index.js');
|
|
10
9
|
require('../../../utils/index.js');
|
|
11
10
|
require('../../index.js');
|
|
@@ -53,7 +52,7 @@ const _sfc_main = {
|
|
|
53
52
|
function showPopover() {
|
|
54
53
|
initColumnsInfo(props.columns, props.columnsEditable);
|
|
55
54
|
rowDrag();
|
|
56
|
-
|
|
55
|
+
showReset.value = true;
|
|
57
56
|
}
|
|
58
57
|
function closePopover() {
|
|
59
58
|
sortableInstance?.destroy?.();
|
|
@@ -77,7 +76,7 @@ const _sfc_main = {
|
|
|
77
76
|
tableEditableColumns.value = columnArr;
|
|
78
77
|
checkedList.value = checkedArr;
|
|
79
78
|
}
|
|
80
|
-
const
|
|
79
|
+
const showReset = vue.ref(true);
|
|
81
80
|
const checkedList = vue.ref([]);
|
|
82
81
|
const checkMap = vue.computed(() => {
|
|
83
82
|
return (vue.unref(checkedList) || []).reduce((map, item) => {
|
|
@@ -94,7 +93,7 @@ const _sfc_main = {
|
|
|
94
93
|
} else {
|
|
95
94
|
checkedList.value.push(target.prop);
|
|
96
95
|
}
|
|
97
|
-
|
|
96
|
+
showReset.value = true;
|
|
98
97
|
}
|
|
99
98
|
function onConfirmHandler() {
|
|
100
99
|
if (!checkedList.value.length && showColumnsLength.value === tableEditableColumns.value?.length) {
|
|
@@ -121,7 +120,7 @@ const _sfc_main = {
|
|
|
121
120
|
props.originColumns
|
|
122
121
|
);
|
|
123
122
|
initColumnsInfo(columnsList, columnsEditablele);
|
|
124
|
-
|
|
123
|
+
showReset.value = false;
|
|
125
124
|
}
|
|
126
125
|
let sortableInstance;
|
|
127
126
|
async function rowDrag() {
|
|
@@ -149,7 +148,7 @@ const _sfc_main = {
|
|
|
149
148
|
for (let i = minIndex; i <= maxIndex; i++) {
|
|
150
149
|
tableEditableColumns.value[i].sortIndex = sortList[i];
|
|
151
150
|
}
|
|
152
|
-
|
|
151
|
+
showReset.value = true;
|
|
153
152
|
}
|
|
154
153
|
});
|
|
155
154
|
}
|
|
@@ -172,7 +171,7 @@ const _sfc_main = {
|
|
|
172
171
|
ref: popoverRef,
|
|
173
172
|
trigger: "click",
|
|
174
173
|
placement: "left-start",
|
|
175
|
-
"popper-class": "!bg-background !p-0 border !border-theme",
|
|
174
|
+
"popper-class": "!bg-[rgba(var(--hy-background),0.7)] !p-0 border !border-theme",
|
|
176
175
|
effect: "dark",
|
|
177
176
|
width: "400",
|
|
178
177
|
"show-arrow": false,
|
|
@@ -181,8 +180,7 @@ const _sfc_main = {
|
|
|
181
180
|
},
|
|
182
181
|
{
|
|
183
182
|
reference: vue.withCtx(() => [
|
|
184
|
-
vue.createElementVNode("div", { class: "flex items-center gap-[10px] clickBox px-3 rounded hover:bg-background-2" }, [
|
|
185
|
-
vue.createCommentVNode(" <el-icon><Edit /></el-icon> "),
|
|
183
|
+
vue.createElementVNode("div", { class: "h-[32px] flex items-center gap-[10px] clickBox px-3 rounded hover:bg-background-2" }, [
|
|
186
184
|
vue.createVNode(vue.unref(index$1.HyIcon), {
|
|
187
185
|
"svg-name": "ops-button-edit-column",
|
|
188
186
|
"class-name": "!w-3 !h-3"
|
|
@@ -212,7 +210,14 @@ const _sfc_main = {
|
|
|
212
210
|
onClick: closePopover
|
|
213
211
|
})
|
|
214
212
|
]),
|
|
215
|
-
vue.createElementVNode("div", { class: "
|
|
213
|
+
vue.createElementVNode("div", { class: "flex items-center gap-1.5 px-4 py-2.5 text-xs text-theme" }, [
|
|
214
|
+
vue.createVNode(vue.unref(index$1.HyIcon), {
|
|
215
|
+
"svg-name": "dispatch-share1-prompt",
|
|
216
|
+
"class-name": "!w-3 !h-3"
|
|
217
|
+
}),
|
|
218
|
+
vue.createElementVNode("span", null, "\u5728\u53F3\u4FA7\u62D6\u52A8\u5217\u53EF\u8FDB\u884C\u8FDB\u884C\u6392\u5E8F")
|
|
219
|
+
]),
|
|
220
|
+
vue.createElementVNode("div", { class: "h-[364px] p-4 pt-0 pb-1 scroll-body overflow-y-auto" }, [
|
|
216
221
|
vue.createVNode(vue.unref(elementPlus.ElCheckboxGroup), {
|
|
217
222
|
modelValue: checkedList.value,
|
|
218
223
|
"onUpdate:modelValue": ($event) => checkedList.value = $event
|
|
@@ -292,14 +297,14 @@ const _sfc_main = {
|
|
|
292
297
|
1
|
|
293
298
|
/* TEXT */
|
|
294
299
|
),
|
|
295
|
-
|
|
300
|
+
showReset.value ? (vue.openBlock(), vue.createElementBlock(
|
|
296
301
|
"span",
|
|
297
302
|
{
|
|
298
303
|
key: 0,
|
|
299
304
|
class: "clickBox text-danger-2 ml-3",
|
|
300
305
|
onClick: onClearHandler
|
|
301
306
|
},
|
|
302
|
-
vue.toDisplayString(vue.unref(t)("
|
|
307
|
+
vue.toDisplayString(vue.unref(t)("hy.reset")),
|
|
303
308
|
1
|
|
304
309
|
/* TEXT */
|
|
305
310
|
)) : vue.createCommentVNode("v-if", true)
|
|
@@ -309,15 +314,9 @@ const _sfc_main = {
|
|
|
309
314
|
vue.Fragment,
|
|
310
315
|
{ key: 0 },
|
|
311
316
|
[
|
|
312
|
-
vue.createVNode(vue.unref(
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}, {
|
|
316
|
-
default: vue.withCtx(() => [
|
|
317
|
-
vue.createVNode(vue.unref(iconsVue.Warning))
|
|
318
|
-
]),
|
|
319
|
-
_: 1
|
|
320
|
-
/* STABLE */
|
|
317
|
+
vue.createVNode(vue.unref(index$1.HyIcon), {
|
|
318
|
+
"svg-name": "dispatch-share1-prompt",
|
|
319
|
+
class: "!w-3 !h-3 text-auxiliary mr-1.5"
|
|
321
320
|
}),
|
|
322
321
|
vue.createVNode(vue.unref(index$2.HyTooltip), {
|
|
323
322
|
"is-always": false,
|