hy-dispatch-ui-v3 0.2.65 → 0.2.67
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 +51 -13
- 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 +183 -149
- package/es/components/hyButton/button.vue.mjs +19 -5
- package/es/components/hyButton/style/button.scss +72 -0
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +1 -2
- package/es/components/hyForm/cpns/formItem.vue.mjs +254 -32
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +8 -1
- package/es/components/hyForm/form.vue.mjs +88 -19
- package/es/components/hyForm/js/index.mjs +2 -1
- package/es/components/hyForm/js/useAppForm.mjs +3 -3
- package/es/components/hyIcon/style/icon.scss +1 -0
- package/es/components/hyMap/js/index.mjs +6 -6
- package/es/components/hyMap/map.vue.mjs +14 -4
- 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 +75 -15
- package/es/components/hyRadioGroup/radioGroup.vue.mjs +5 -4
- package/es/components/hySearch/cpns/searchItem.vue.mjs +434 -206
- package/es/components/hySearch/js/index.mjs +2 -1
- package/es/components/hySearch/search.vue.mjs +71 -10
- package/es/components/hySearch/style/search.scss +7 -0
- package/es/components/hyTable/cpns/columnSelect.vue.mjs +21 -22
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +35 -21
- package/es/components/hyTable/js/index.mjs +16 -17
- package/es/components/hyTable/js/search.mjs +28 -2
- package/es/components/hyTable/style/table.scss +13 -0
- package/es/components/hyTable/table.vue.mjs +55 -22
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +17 -12
- package/es/components/hyTableForm/batchTableForm.vue.mjs +36 -5
- package/es/components/hyTableForm/js/useAppTableForm.mjs +1 -1
- package/es/components/hyTableForm/tableForm.vue.mjs +84 -32
- 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 +128 -56
- package/es/components/hyTree/tree.vue.mjs +22 -37
- 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/index.scss +0 -1
- package/es/style/tailwind.scss +0 -1
- package/es/style/theme.scss +1 -0
- package/es/utils/is.mjs +3 -1
- package/es/utils/map/hook/bigMap.mjs +11 -1
- package/es/utils/map/hook/gaode.mjs +60 -17
- package/es/utils/map/hook/leafletjs.mjs +25 -4
- package/es/utils/map/index.mjs +1 -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 +182 -148
- package/lib/components/hyButton/button.vue.js +18 -4
- package/lib/components/hyButton/style/button.scss +72 -0
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +0 -1
- package/lib/components/hyForm/cpns/formItem.vue.js +250 -28
- package/lib/components/hyForm/cpns/locationSelect.vue.js +8 -1
- package/lib/components/hyForm/form.vue.js +86 -17
- package/lib/components/hyForm/js/index.js +2 -0
- package/lib/components/hyForm/js/useAppForm.js +3 -3
- package/lib/components/hyIcon/style/icon.scss +1 -0
- package/lib/components/hyMap/js/index.js +5 -5
- package/lib/components/hyMap/map.vue.js +13 -3
- 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 +73 -13
- package/lib/components/hyRadioGroup/radioGroup.vue.js +5 -4
- package/lib/components/hySearch/cpns/searchItem.vue.js +431 -203
- package/lib/components/hySearch/js/index.js +2 -0
- package/lib/components/hySearch/search.vue.js +69 -8
- package/lib/components/hySearch/style/search.scss +7 -0
- package/lib/components/hyTable/cpns/columnSelect.vue.js +20 -21
- package/lib/components/hyTable/cpns/virtualTable.vue.js +51 -37
- package/lib/components/hyTable/js/index.js +16 -16
- package/lib/components/hyTable/js/search.js +28 -2
- package/lib/components/hyTable/style/table.scss +13 -0
- package/lib/components/hyTable/table.vue.js +53 -20
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +16 -11
- package/lib/components/hyTableForm/batchTableForm.vue.js +36 -5
- package/lib/components/hyTableForm/js/useAppTableForm.js +1 -1
- package/lib/components/hyTableForm/tableForm.vue.js +85 -33
- 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 +128 -56
- package/lib/components/hyTree/tree.vue.js +22 -37
- 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/index.scss +0 -1
- package/lib/style/tailwind.scss +0 -1
- package/lib/style/theme.scss +1 -0
- package/lib/utils/is.js +5 -3
- package/lib/utils/map/hook/bigMap.js +11 -1
- package/lib/utils/map/hook/gaode.js +60 -17
- package/lib/utils/map/hook/leafletjs.js +25 -4
- package/lib/utils/map/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@ import '../../../hooks/index.mjs';
|
|
|
5
5
|
import { isNumber, isString, isBoolean, isFunction, isEmpty, isArray } from '../../../utils/is.mjs';
|
|
6
6
|
import { useResizeObserver } from '../../../hooks/useResizeObserver.mjs';
|
|
7
7
|
|
|
8
|
+
const formContextKey = /* @__PURE__ */ Symbol("formContextKey");
|
|
8
9
|
function columnItemStyle(props, column) {
|
|
9
10
|
const { width } = column;
|
|
10
11
|
const style = {};
|
|
@@ -138,4 +139,4 @@ function optionsHandler(props, column) {
|
|
|
138
139
|
return [];
|
|
139
140
|
}
|
|
140
141
|
|
|
141
|
-
export { columnItemInputStyle, columnItemStyle, columnShowHandler, isDisabled, isEmptyValue, isSelectedTimeRange, optionsHandler, timeRangeHandler, useShrink };
|
|
142
|
+
export { columnItemInputStyle, columnItemStyle, columnShowHandler, formContextKey, isDisabled, isEmptyValue, isSelectedTimeRange, optionsHandler, timeRangeHandler, useShrink };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, computed, unref, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, toDisplayString, Fragment, createCommentVNode, withDirectives, normalizeStyle, withCtx, vShow, mergeProps, renderList, createBlock, createSlots, renderSlot } from 'vue';
|
|
1
|
+
import { defineComponent, useTemplateRef, computed, unref, reactive, provide, toRefs, onMounted, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, toDisplayString, Fragment, createCommentVNode, withDirectives, normalizeStyle, withCtx, vShow, mergeProps, renderList, createBlock, createSlots, renderSlot } from 'vue';
|
|
2
2
|
import { ElIcon, ElForm } from 'element-plus';
|
|
3
3
|
import { ArrowDown } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../hooks/index.mjs';
|
|
5
5
|
import '../../utils/index.mjs';
|
|
6
6
|
import '../index.mjs';
|
|
7
7
|
import _sfc_main$1 from './cpns/searchItem.vue.mjs';
|
|
8
|
-
import { useShrink, isEmptyValue } from './js/index.mjs';
|
|
8
|
+
import { useShrink, isEmptyValue, formContextKey } from './js/index.mjs';
|
|
9
9
|
import { resetAppSearchValue } from './js/useAppSearch.mjs';
|
|
10
10
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
11
11
|
import { isArray, isObject } from '../../utils/is.mjs';
|
|
@@ -47,7 +47,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
47
47
|
type: [String, Array, Object]
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
emits: ["search"],
|
|
50
|
+
emits: ["search", "optionsStatus"],
|
|
51
51
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
52
52
|
const props = __props;
|
|
53
53
|
const emits = __emit;
|
|
@@ -80,9 +80,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
80
80
|
}
|
|
81
81
|
return style;
|
|
82
82
|
});
|
|
83
|
-
onUnmounted(() => {
|
|
84
|
-
shrinkDestroy();
|
|
85
|
-
});
|
|
86
83
|
function getFilterCount(model, defaultValue, prop) {
|
|
87
84
|
let count = 0;
|
|
88
85
|
const keys = Object.keys(defaultValue);
|
|
@@ -110,10 +107,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
110
107
|
function onSearchHandler() {
|
|
111
108
|
emits("search");
|
|
112
109
|
}
|
|
113
|
-
function resetFields(
|
|
110
|
+
function resetFields(fields2) {
|
|
114
111
|
let columns = props.columns || [];
|
|
115
|
-
if (
|
|
116
|
-
columns =
|
|
112
|
+
if (fields2 && fields2?.length) {
|
|
113
|
+
columns = fields2.map((key) => formColumnMap.value.get(key)).filter(Boolean);
|
|
117
114
|
}
|
|
118
115
|
resetAppSearchValue(columns, props.model);
|
|
119
116
|
}
|
|
@@ -121,8 +118,72 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
121
118
|
resetFields();
|
|
122
119
|
emits("search");
|
|
123
120
|
}
|
|
121
|
+
const fields = reactive([]);
|
|
122
|
+
function addField(field) {
|
|
123
|
+
fields.push(field);
|
|
124
|
+
}
|
|
125
|
+
const removeField = (field) => {
|
|
126
|
+
if (unref(field.columnAttrs)) {
|
|
127
|
+
fields.splice(fields.indexOf(field), 1);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
function filterFields(fields2 = [], keys = []) {
|
|
131
|
+
const filterKeys = keys.map((prop) => isArray(prop) ? prop.join(".") : prop);
|
|
132
|
+
return filterKeys.length ? fields2.filter(
|
|
133
|
+
(field) => field.propString && filterKeys.includes(field.propString)
|
|
134
|
+
) : fields2;
|
|
135
|
+
}
|
|
136
|
+
async function obtainOptionsFields(keys, isMountedLoad = false) {
|
|
137
|
+
const filteredFields = filterFields(fields, keys);
|
|
138
|
+
await Promise.allSettled(
|
|
139
|
+
filteredFields.map((field) => field.obtainOptions(isMountedLoad))
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
async function getOptions(isMountedLoad = false) {
|
|
143
|
+
await obtainOptionsFields([], isMountedLoad);
|
|
144
|
+
emitOptionsStatus();
|
|
145
|
+
}
|
|
146
|
+
async function getOptionsFields(keys) {
|
|
147
|
+
await obtainOptionsFields(keys);
|
|
148
|
+
emitOptionsStatus();
|
|
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
|
+
emitOptionsStatus();
|
|
156
|
+
}
|
|
157
|
+
function emitOptionsStatus() {
|
|
158
|
+
const hasError = fields.some((item) => item.optionsError === "error");
|
|
159
|
+
emits("optionsStatus", { result: !hasError });
|
|
160
|
+
}
|
|
161
|
+
provide(
|
|
162
|
+
formContextKey,
|
|
163
|
+
reactive({
|
|
164
|
+
...toRefs(props),
|
|
165
|
+
emits,
|
|
166
|
+
addField,
|
|
167
|
+
removeField,
|
|
168
|
+
emitOptionsStatus
|
|
169
|
+
})
|
|
170
|
+
);
|
|
171
|
+
onMounted(() => {
|
|
172
|
+
getOptions(true);
|
|
173
|
+
});
|
|
174
|
+
onUnmounted(() => {
|
|
175
|
+
shrinkDestroy();
|
|
176
|
+
});
|
|
124
177
|
__expose({
|
|
125
|
-
resetFields
|
|
178
|
+
resetFields,
|
|
179
|
+
getOptions,
|
|
180
|
+
getOptionsFields,
|
|
181
|
+
getOptionsError,
|
|
182
|
+
getOptionsByField: (field) => {
|
|
183
|
+
const [target] = filterFields(fields, [field]);
|
|
184
|
+
if (!target) return null;
|
|
185
|
+
return target.options;
|
|
186
|
+
}
|
|
126
187
|
});
|
|
127
188
|
return (_ctx, _cache) => {
|
|
128
189
|
return openBlock(), createElementBlock(
|
|
@@ -39,6 +39,13 @@
|
|
|
39
39
|
&.hidden {
|
|
40
40
|
display: none;
|
|
41
41
|
}
|
|
42
|
+
.hy-el-search-item-error {
|
|
43
|
+
.hy-el-input .hy-el-input__inner::placeholder,
|
|
44
|
+
.hy-el-select__placeholder.is-transparent {
|
|
45
|
+
color: rgba(var(--hy-danger-2));
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
42
49
|
}
|
|
43
50
|
.hy-el-input,
|
|
44
51
|
.hy-el-date-editor {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useTemplateRef, ref, computed, unref, nextTick, watch, openBlock, createBlock, withCtx, createElementVNode, toDisplayString, createVNode, normalizeClass, createCommentVNode, createElementBlock, Fragment, renderList, createTextVNode } from 'vue';
|
|
2
2
|
import Sortable from 'sortablejs';
|
|
3
|
-
import { ElMessage, ElPopover, ElCheckboxGroup
|
|
4
|
-
import { Warning } from '@element-plus/icons-vue';
|
|
3
|
+
import { ElMessage, ElPopover, ElCheckboxGroup } from 'element-plus';
|
|
5
4
|
import '../../../hooks/index.mjs';
|
|
6
5
|
import '../../../utils/index.mjs';
|
|
7
6
|
import '../../index.mjs';
|
|
@@ -49,7 +48,7 @@ const _sfc_main = {
|
|
|
49
48
|
function showPopover() {
|
|
50
49
|
initColumnsInfo(props.columns, props.columnsEditable);
|
|
51
50
|
rowDrag();
|
|
52
|
-
|
|
51
|
+
showReset.value = true;
|
|
53
52
|
}
|
|
54
53
|
function closePopover() {
|
|
55
54
|
sortableInstance?.destroy?.();
|
|
@@ -73,7 +72,7 @@ const _sfc_main = {
|
|
|
73
72
|
tableEditableColumns.value = columnArr;
|
|
74
73
|
checkedList.value = checkedArr;
|
|
75
74
|
}
|
|
76
|
-
const
|
|
75
|
+
const showReset = ref(true);
|
|
77
76
|
const checkedList = ref([]);
|
|
78
77
|
const checkMap = computed(() => {
|
|
79
78
|
return (unref(checkedList) || []).reduce((map, item) => {
|
|
@@ -90,7 +89,7 @@ const _sfc_main = {
|
|
|
90
89
|
} else {
|
|
91
90
|
checkedList.value.push(target.prop);
|
|
92
91
|
}
|
|
93
|
-
|
|
92
|
+
showReset.value = true;
|
|
94
93
|
}
|
|
95
94
|
function onConfirmHandler() {
|
|
96
95
|
if (!checkedList.value.length && showColumnsLength.value === tableEditableColumns.value?.length) {
|
|
@@ -117,7 +116,7 @@ const _sfc_main = {
|
|
|
117
116
|
props.originColumns
|
|
118
117
|
);
|
|
119
118
|
initColumnsInfo(columnsList, columnsEditablele);
|
|
120
|
-
|
|
119
|
+
showReset.value = false;
|
|
121
120
|
}
|
|
122
121
|
let sortableInstance;
|
|
123
122
|
async function rowDrag() {
|
|
@@ -145,7 +144,7 @@ const _sfc_main = {
|
|
|
145
144
|
for (let i = minIndex; i <= maxIndex; i++) {
|
|
146
145
|
tableEditableColumns.value[i].sortIndex = sortList[i];
|
|
147
146
|
}
|
|
148
|
-
|
|
147
|
+
showReset.value = true;
|
|
149
148
|
}
|
|
150
149
|
});
|
|
151
150
|
}
|
|
@@ -168,7 +167,7 @@ const _sfc_main = {
|
|
|
168
167
|
ref: popoverRef,
|
|
169
168
|
trigger: "click",
|
|
170
169
|
placement: "left-start",
|
|
171
|
-
"popper-class": "!bg-background !p-0 border !border-theme",
|
|
170
|
+
"popper-class": "!bg-[rgba(var(--hy-background),0.7)] !p-0 border !border-theme",
|
|
172
171
|
effect: "dark",
|
|
173
172
|
width: "400",
|
|
174
173
|
"show-arrow": false,
|
|
@@ -177,8 +176,7 @@ const _sfc_main = {
|
|
|
177
176
|
},
|
|
178
177
|
{
|
|
179
178
|
reference: withCtx(() => [
|
|
180
|
-
createElementVNode("div", { class: "flex items-center gap-[10px] clickBox px-3 rounded hover:bg-background-2" }, [
|
|
181
|
-
createCommentVNode(" <el-icon><Edit /></el-icon> "),
|
|
179
|
+
createElementVNode("div", { class: "h-[32px] flex items-center gap-[10px] clickBox px-3 rounded hover:bg-background-2" }, [
|
|
182
180
|
createVNode(unref(HyIcon), {
|
|
183
181
|
"svg-name": "ops-button-edit-column",
|
|
184
182
|
"class-name": "!w-3 !h-3"
|
|
@@ -208,7 +206,14 @@ const _sfc_main = {
|
|
|
208
206
|
onClick: closePopover
|
|
209
207
|
})
|
|
210
208
|
]),
|
|
211
|
-
createElementVNode("div", { class: "
|
|
209
|
+
createElementVNode("div", { class: "flex items-center gap-1.5 px-4 py-2.5 text-xs text-theme" }, [
|
|
210
|
+
createVNode(unref(HyIcon), {
|
|
211
|
+
"svg-name": "dispatch-share1-prompt",
|
|
212
|
+
"class-name": "!w-3 !h-3"
|
|
213
|
+
}),
|
|
214
|
+
createElementVNode("span", null, "\u5728\u53F3\u4FA7\u62D6\u52A8\u5217\u53EF\u8FDB\u884C\u8FDB\u884C\u6392\u5E8F")
|
|
215
|
+
]),
|
|
216
|
+
createElementVNode("div", { class: "h-[364px] p-4 pt-0 pb-1 scroll-body overflow-y-auto" }, [
|
|
212
217
|
createVNode(unref(ElCheckboxGroup), {
|
|
213
218
|
modelValue: checkedList.value,
|
|
214
219
|
"onUpdate:modelValue": ($event) => checkedList.value = $event
|
|
@@ -288,14 +293,14 @@ const _sfc_main = {
|
|
|
288
293
|
1
|
|
289
294
|
/* TEXT */
|
|
290
295
|
),
|
|
291
|
-
|
|
296
|
+
showReset.value ? (openBlock(), createElementBlock(
|
|
292
297
|
"span",
|
|
293
298
|
{
|
|
294
299
|
key: 0,
|
|
295
300
|
class: "clickBox text-danger-2 ml-3",
|
|
296
301
|
onClick: onClearHandler
|
|
297
302
|
},
|
|
298
|
-
toDisplayString(unref(t)("
|
|
303
|
+
toDisplayString(unref(t)("hy.reset")),
|
|
299
304
|
1
|
|
300
305
|
/* TEXT */
|
|
301
306
|
)) : createCommentVNode("v-if", true)
|
|
@@ -305,15 +310,9 @@ const _sfc_main = {
|
|
|
305
310
|
Fragment,
|
|
306
311
|
{ key: 0 },
|
|
307
312
|
[
|
|
308
|
-
createVNode(unref(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}, {
|
|
312
|
-
default: withCtx(() => [
|
|
313
|
-
createVNode(unref(Warning))
|
|
314
|
-
]),
|
|
315
|
-
_: 1
|
|
316
|
-
/* STABLE */
|
|
313
|
+
createVNode(unref(HyIcon), {
|
|
314
|
+
"svg-name": "dispatch-share1-prompt",
|
|
315
|
+
class: "!w-3 !h-3 text-auxiliary mr-1.5"
|
|
317
316
|
}),
|
|
318
317
|
createVNode(unref(HyTooltip), {
|
|
319
318
|
"is-always": false,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useModel, computed, ref, openBlock, createBlock, unref, withCtx, renderSlot, createCommentVNode, createElementBlock, Fragment, renderList, normalizeStyle, withModifiers, normalizeClass, createVNode, mergeProps, createTextVNode, toDisplayString, createElementVNode, normalizeProps, guardReactiveProps, mergeModels } from 'vue';
|
|
2
|
-
import { ElTableV2,
|
|
3
|
-
import {
|
|
2
|
+
import { ElTableV2, ElCheckbox, ElDropdown, ElIcon, ElDropdownMenu, ElDropdownItem } from 'element-plus';
|
|
3
|
+
import { MoreFilled } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../index.mjs';
|
|
5
5
|
import '../../../hooks/index.mjs';
|
|
6
6
|
import '../../../utils/index.mjs';
|
|
7
|
-
import { operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, operatorDisableTextdHandler, renderContentHandler, renderHeaderHandler } from '../js/index.mjs';
|
|
7
|
+
import { operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, operatorIsDotHandler, operatorDisableTextdHandler, renderContentHandler, renderHeaderHandler } from '../js/index.mjs';
|
|
8
8
|
import _sfc_main$1 from './headerItem.vue.mjs';
|
|
9
9
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
10
10
|
import { isNumber, isString, isFunction, isArray, isBoolean, isEmpty } from '../../../utils/is.mjs';
|
|
11
|
-
import { HyTooltip } from '../../hyTooltip/index.mjs';
|
|
12
11
|
import { HyIcon } from '../../hyIcon/index.mjs';
|
|
12
|
+
import { HyTooltip } from '../../hyTooltip/index.mjs';
|
|
13
13
|
|
|
14
14
|
const _sfc_main = {
|
|
15
15
|
__name: "virtualTable",
|
|
@@ -283,6 +283,7 @@ const _sfc_main = {
|
|
|
283
283
|
return openBlock(), createBlock(unref(ElTableV2), {
|
|
284
284
|
"expanded-row-keys": expandedRowKeys.value,
|
|
285
285
|
"onUpdate:expandedRowKeys": ($event) => expandedRowKeys.value = $event,
|
|
286
|
+
cache: 0,
|
|
286
287
|
"row-key": __props.rowKey,
|
|
287
288
|
data: dataSource.value,
|
|
288
289
|
columns: tableColumns.value,
|
|
@@ -372,16 +373,11 @@ const _sfc_main = {
|
|
|
372
373
|
rowKey: getRowKey(row)
|
|
373
374
|
}), ["stop"])
|
|
374
375
|
}, [
|
|
375
|
-
createVNode(unref(
|
|
376
|
-
|
|
376
|
+
createVNode(unref(HyIcon), {
|
|
377
|
+
"svg-name": "dispatch-linear-arrow-down-bold",
|
|
378
|
+
"class-name": "!w-3 !h-3 text-main",
|
|
377
379
|
style: normalizeStyle({ "margin-inline-start": `${depth * 12}px` })
|
|
378
|
-
},
|
|
379
|
-
default: withCtx(() => [
|
|
380
|
-
createVNode(unref(ArrowRight))
|
|
381
|
-
]),
|
|
382
|
-
_: 1
|
|
383
|
-
/* STABLE */
|
|
384
|
-
}, 8, ["style"])
|
|
380
|
+
}, null, 8, ["style"])
|
|
385
381
|
], 10, ["onClick"])) : (openBlock(), createElementBlock(
|
|
386
382
|
"div",
|
|
387
383
|
{
|
|
@@ -439,7 +435,7 @@ const _sfc_main = {
|
|
|
439
435
|
}, {
|
|
440
436
|
default: withCtx(() => [
|
|
441
437
|
createElementVNode("div", {
|
|
442
|
-
class: normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent rounded box-border", [
|
|
438
|
+
class: normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent rounded box-border relative", [
|
|
443
439
|
citem.className,
|
|
444
440
|
unref(operatorDisabledHandler)(citem, {
|
|
445
441
|
column,
|
|
@@ -471,7 +467,16 @@ const _sfc_main = {
|
|
|
471
467
|
)) : (openBlock(), createElementBlock("div", {
|
|
472
468
|
key: 1,
|
|
473
469
|
class: "mt-1 whitespace-nowrap"
|
|
474
|
-
}, "\xA0"))
|
|
470
|
+
}, "\xA0")),
|
|
471
|
+
unref(operatorIsDotHandler)(citem, {
|
|
472
|
+
column,
|
|
473
|
+
row,
|
|
474
|
+
$index,
|
|
475
|
+
cellIndex
|
|
476
|
+
}) ? (openBlock(), createElementBlock("div", {
|
|
477
|
+
key: 2,
|
|
478
|
+
class: "w-2 h-2 absolute right-0 top-0 transform translate-x-1/2 -translate-y-1/2 rounded-full bg-danger-2 z-[2]"
|
|
479
|
+
})) : createCommentVNode("v-if", true)
|
|
475
480
|
], 10, ["onClick"])
|
|
476
481
|
]),
|
|
477
482
|
_: 2
|
|
@@ -502,7 +507,7 @@ const _sfc_main = {
|
|
|
502
507
|
dropdown: withCtx(() => [
|
|
503
508
|
createVNode(
|
|
504
509
|
unref(ElDropdownMenu),
|
|
505
|
-
|
|
510
|
+
{ class: "hy-table-dropdown-menu" },
|
|
506
511
|
{
|
|
507
512
|
default: withCtx(() => [
|
|
508
513
|
(openBlock(true), createElementBlock(
|
|
@@ -524,10 +529,10 @@ const _sfc_main = {
|
|
|
524
529
|
})
|
|
525
530
|
}, {
|
|
526
531
|
default: withCtx(() => [
|
|
527
|
-
createElementVNode("span",
|
|
532
|
+
createElementVNode("span", { class: "relative" }, [
|
|
528
533
|
createElementVNode(
|
|
529
534
|
"span",
|
|
530
|
-
|
|
535
|
+
{ class: "pr-1" },
|
|
531
536
|
toDisplayString(citem.label),
|
|
532
537
|
1
|
|
533
538
|
/* TEXT */
|
|
@@ -551,7 +556,16 @@ const _sfc_main = {
|
|
|
551
556
|
})) + "\uFF09",
|
|
552
557
|
1
|
|
553
558
|
/* TEXT */
|
|
554
|
-
)) : createCommentVNode("v-if", true)
|
|
559
|
+
)) : createCommentVNode("v-if", true),
|
|
560
|
+
unref(operatorIsDotHandler)(citem, {
|
|
561
|
+
column,
|
|
562
|
+
row,
|
|
563
|
+
$index,
|
|
564
|
+
cellIndex
|
|
565
|
+
}) ? (openBlock(), createElementBlock("div", {
|
|
566
|
+
key: 1,
|
|
567
|
+
class: "w-2 h-2 absolute right-0 top-0 transform translate-x-1/2 -translate-y-1/2 rounded-full bg-danger-2 z-[2]"
|
|
568
|
+
})) : createCommentVNode("v-if", true)
|
|
555
569
|
])
|
|
556
570
|
]),
|
|
557
571
|
_: 2
|
|
@@ -623,10 +637,10 @@ const _sfc_main = {
|
|
|
623
637
|
"is-always": false,
|
|
624
638
|
"over-line": 2,
|
|
625
639
|
content: unref(renderContentHandler)(column, { column, row, $index, cellIndex })
|
|
626
|
-
}, null, 8, ["content"])) : (openBlock(), createElementBlock("span", {
|
|
640
|
+
}, null, 8, ["content"])) : column.type !== "expand" ? (openBlock(), createElementBlock("span", {
|
|
627
641
|
key: 1,
|
|
628
642
|
class: "text-auxiliary"
|
|
629
|
-
}, "- -"))
|
|
643
|
+
}, "- -")) : createCommentVNode("v-if", true)
|
|
630
644
|
],
|
|
631
645
|
64
|
|
632
646
|
/* STABLE_FRAGMENT */
|
|
@@ -86,15 +86,15 @@ function operatorShowHandler(operator, scope) {
|
|
|
86
86
|
if (isFunction(show)) return show(scope);
|
|
87
87
|
return true;
|
|
88
88
|
}
|
|
89
|
-
function operatorDisabledHandler(
|
|
90
|
-
const { disabled } =
|
|
89
|
+
function operatorDisabledHandler(operator, scope) {
|
|
90
|
+
const { disabled } = operator;
|
|
91
91
|
if (isBoolean(disabled)) return disabled;
|
|
92
92
|
if (isFunction(disabled)) return disabled(scope);
|
|
93
93
|
return false;
|
|
94
94
|
}
|
|
95
|
-
function operatorDisableTextdHandler(
|
|
95
|
+
function operatorDisableTextdHandler(operator, scope) {
|
|
96
96
|
const { t } = useLocale();
|
|
97
|
-
const { disabledText } =
|
|
97
|
+
const { disabledText } = operator;
|
|
98
98
|
if (isString(disabledText)) return disabledText;
|
|
99
99
|
if (isFunction(disabledText)) return disabledText(scope);
|
|
100
100
|
return t("table.nonsupport");
|
|
@@ -128,6 +128,12 @@ function operatorClickHandler(command, column, scope, type = "all") {
|
|
|
128
128
|
if (operatorDisabledHandler(target, scope)) return;
|
|
129
129
|
target?.handler && target.handler(scope);
|
|
130
130
|
}
|
|
131
|
+
function operatorIsDotHandler(operator, scope) {
|
|
132
|
+
const { isDot } = operator;
|
|
133
|
+
if (isFunction(isDot)) return isDot(scope);
|
|
134
|
+
if (isBoolean(isDot)) return isDot;
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
131
137
|
function renderHeaderHandler(column, scope) {
|
|
132
138
|
if (!column) return;
|
|
133
139
|
if (isFunction(column.renderHeader)) {
|
|
@@ -349,6 +355,7 @@ const useAppTableWrapper = (hy) => {
|
|
|
349
355
|
}
|
|
350
356
|
function clearSelection() {
|
|
351
357
|
tableRef.value?.clearSelection();
|
|
358
|
+
selectedList.value = [];
|
|
352
359
|
}
|
|
353
360
|
function getSelectedList() {
|
|
354
361
|
return selectedList.value;
|
|
@@ -372,12 +379,15 @@ const useAppTableWrapper = (hy) => {
|
|
|
372
379
|
}
|
|
373
380
|
}
|
|
374
381
|
}
|
|
375
|
-
function onTableSelectHandler(selectList = [], row) {
|
|
382
|
+
function onTableSelectHandler(selectList = [], row, isAll = false) {
|
|
376
383
|
if (selectList.length === 0 && tableDataSource.value.length === 0) {
|
|
377
384
|
clearSelection();
|
|
378
385
|
}
|
|
379
386
|
selectedList.value = [...selectList];
|
|
380
387
|
emits("on-select-checkbox", [...selectList], row);
|
|
388
|
+
if (isAll) {
|
|
389
|
+
emits("select-all", selectList);
|
|
390
|
+
}
|
|
381
391
|
}
|
|
382
392
|
function clearSelectedList(list = []) {
|
|
383
393
|
selectedList.value = list || [];
|
|
@@ -404,13 +414,6 @@ const useAppTableWrapper = (hy) => {
|
|
|
404
414
|
}
|
|
405
415
|
return className.filter(Boolean).join(" ");
|
|
406
416
|
}
|
|
407
|
-
const isSearchFocus = ref(false);
|
|
408
|
-
function onSearchInputHandler() {
|
|
409
|
-
isSearchFocus.value = true;
|
|
410
|
-
}
|
|
411
|
-
function onSearchBlurHandler() {
|
|
412
|
-
isSearchFocus.value = false;
|
|
413
|
-
}
|
|
414
417
|
watchEffect(() => {
|
|
415
418
|
const { columnsList, columnsEditablele, searchText } = tableColumnHandler(
|
|
416
419
|
props.tableColumns,
|
|
@@ -444,13 +447,9 @@ const useAppTableWrapper = (hy) => {
|
|
|
444
447
|
onTableRowContextmenuHandler,
|
|
445
448
|
onTableRowClickHandler,
|
|
446
449
|
onTableColumnsSelectHandler,
|
|
447
|
-
// 搜索选中
|
|
448
|
-
isSearchFocus,
|
|
449
|
-
onSearchInputHandler,
|
|
450
|
-
onSearchBlurHandler,
|
|
451
450
|
showAppTableLoading,
|
|
452
451
|
closeAppTableLoading
|
|
453
452
|
};
|
|
454
453
|
};
|
|
455
454
|
|
|
456
|
-
export { operatorClickHandler, operatorDisableTextdHandler, operatorDisabledHandler, operatorFilterHandler, renderContentHandler, renderHeaderHandler, tableColumnHandler, tableColumnShowHandler, useAppTableWrapper };
|
|
455
|
+
export { operatorClickHandler, operatorDisableTextdHandler, operatorDisabledHandler, operatorFilterHandler, operatorIsDotHandler, renderContentHandler, renderHeaderHandler, tableColumnHandler, tableColumnShowHandler, useAppTableWrapper };
|
|
@@ -51,6 +51,7 @@ function useAppTableSearch(hy) {
|
|
|
51
51
|
tableDataSource.value = data;
|
|
52
52
|
}
|
|
53
53
|
totalElements.value = res.data.totalElements;
|
|
54
|
+
hy.expandRowKeys.value = [];
|
|
54
55
|
emits("reqSuccess", tableDataSource.value);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -64,7 +65,7 @@ function useAppTableSearch(hy) {
|
|
|
64
65
|
async function resetFn() {
|
|
65
66
|
await resetFields();
|
|
66
67
|
props.filterModel.query = null;
|
|
67
|
-
getData(1);
|
|
68
|
+
await getData(1);
|
|
68
69
|
}
|
|
69
70
|
function getParametersFn() {
|
|
70
71
|
return Object.assign(
|
|
@@ -84,6 +85,7 @@ function useAppTableSearch(hy) {
|
|
|
84
85
|
function setData(dataSource) {
|
|
85
86
|
tableDataSource.value = dataSource || [];
|
|
86
87
|
hy.loading.value = false;
|
|
88
|
+
emits("reqSuccess", tableDataSource.value);
|
|
87
89
|
}
|
|
88
90
|
function onSizeChangeHandler(val) {
|
|
89
91
|
props.filterModel.page = 1;
|
|
@@ -99,6 +101,26 @@ function useAppTableSearch(hy) {
|
|
|
99
101
|
const isReset = !(isEmpty(oldQueryValue) && isEmpty(props.filterModel.query) || oldQueryValue === props.filterModel.query);
|
|
100
102
|
getData(isReset ? 1 : null);
|
|
101
103
|
}
|
|
104
|
+
async function getOptions() {
|
|
105
|
+
if (appSearchRef.value) {
|
|
106
|
+
await appSearchRef.value.getOptions();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async function getOptionsFields(keys) {
|
|
110
|
+
if (appSearchRef.value) {
|
|
111
|
+
await appSearchRef.value.getOptionsFields(keys);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function getOptionsError() {
|
|
115
|
+
if (appSearchRef.value) {
|
|
116
|
+
await appSearchRef.value.getOptionsError();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function getOptionsByField() {
|
|
120
|
+
if (appSearchRef.value) {
|
|
121
|
+
return appSearchRef.value.getOptionsByField();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
102
124
|
return {
|
|
103
125
|
totalElements,
|
|
104
126
|
showFilter,
|
|
@@ -111,7 +133,11 @@ function useAppTableSearch(hy) {
|
|
|
111
133
|
getTableDataSource,
|
|
112
134
|
onSizeChangeHandler,
|
|
113
135
|
onCurrentChangeHandler,
|
|
114
|
-
onSearchQueryHandler
|
|
136
|
+
onSearchQueryHandler,
|
|
137
|
+
getOptions,
|
|
138
|
+
getOptionsFields,
|
|
139
|
+
getOptionsError,
|
|
140
|
+
getOptionsByField
|
|
115
141
|
};
|
|
116
142
|
}
|
|
117
143
|
|
|
@@ -25,6 +25,14 @@
|
|
|
25
25
|
.hy-el-table-v2__row-cell {
|
|
26
26
|
padding: 8px 12px;
|
|
27
27
|
}
|
|
28
|
+
.hy-el-table-v2__expand-icon {
|
|
29
|
+
&:not(.is-expanded) svg {
|
|
30
|
+
transform: rotate(-90deg) !important;
|
|
31
|
+
}
|
|
32
|
+
&.is-expanded svg {
|
|
33
|
+
transform: rotate(0deg) !important;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
28
36
|
}
|
|
29
37
|
.hy-table-search {
|
|
30
38
|
width: 160px;
|
|
@@ -46,6 +54,7 @@
|
|
|
46
54
|
|
|
47
55
|
.hy-table-dropdown-menu.hy-el-dropdown-menu {
|
|
48
56
|
--hy-el-text-color-regular: rgba(var(--hy-main));
|
|
57
|
+
--hy-el-dropdown-menuItem-hover-color: rgba(var(--hy-main));
|
|
49
58
|
border: 1px solid rgba(var(--hy-main));
|
|
50
59
|
padding: 0px;
|
|
51
60
|
.hy-el-dropdown-menu__item {
|
|
@@ -54,5 +63,9 @@
|
|
|
54
63
|
&:last-child {
|
|
55
64
|
border-bottom: none;
|
|
56
65
|
}
|
|
66
|
+
&:not(.is-disabled):focus,
|
|
67
|
+
&:not(.is-disabled):hover {
|
|
68
|
+
font-weight: bold;
|
|
69
|
+
}
|
|
57
70
|
}
|
|
58
71
|
}
|