hy-dispatch-ui-v3 0.2.66 → 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 +25 -1
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +174 -142
- package/es/components/hyButton/button.vue.mjs +16 -3
- package/es/components/hyButton/style/button.scss +2 -0
- package/es/components/hyForm/cpns/formItem.vue.mjs +96 -46
- package/es/components/hyForm/form.vue.mjs +22 -8
- package/es/components/hyForm/js/useAppForm.mjs +1 -1
- package/es/components/hyMap/js/index.mjs +6 -6
- package/es/components/hyMap/map.vue.mjs +14 -4
- package/es/components/hyOrgCascader/orgCascader.vue.mjs +7 -2
- package/es/components/hySearch/cpns/searchItem.vue.mjs +396 -324
- package/es/components/hySearch/search.vue.mjs +17 -7
- package/es/components/hySearch/style/search.scss +7 -0
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +25 -6
- package/es/components/hyTable/js/index.mjs +11 -5
- package/es/components/hyTable/js/search.mjs +25 -1
- package/es/components/hyTable/table.vue.mjs +34 -13
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +9 -2
- package/es/components/hyTableForm/batchTableForm.vue.mjs +23 -2
- package/es/components/hyTableForm/js/useAppTableForm.mjs +1 -1
- package/es/components/hyTableForm/tableForm.vue.mjs +79 -33
- package/es/components/hyTree/js/index.mjs +118 -50
- package/es/components/hyTree/tree.vue.mjs +4 -2
- package/es/style/index.scss +0 -1
- package/es/style/tailwind.scss +0 -1
- package/es/utils/is.mjs +3 -1
- package/es/utils/map/hook/bigMap.mjs +2 -0
- package/es/utils/map/hook/gaode.mjs +51 -16
- package/es/utils/map/hook/leafletjs.mjs +15 -3
- package/es/utils/map/index.mjs +1 -1
- package/es/version.mjs +1 -1
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +173 -141
- package/lib/components/hyButton/button.vue.js +15 -2
- package/lib/components/hyButton/style/button.scss +2 -0
- package/lib/components/hyForm/cpns/formItem.vue.js +93 -43
- package/lib/components/hyForm/form.vue.js +21 -7
- package/lib/components/hyForm/js/useAppForm.js +1 -1
- package/lib/components/hyMap/js/index.js +5 -5
- package/lib/components/hyMap/map.vue.js +13 -3
- package/lib/components/hyOrgCascader/orgCascader.vue.js +7 -2
- package/lib/components/hySearch/cpns/searchItem.vue.js +394 -322
- package/lib/components/hySearch/search.vue.js +17 -7
- package/lib/components/hySearch/style/search.scss +7 -0
- package/lib/components/hyTable/cpns/virtualTable.vue.js +24 -5
- package/lib/components/hyTable/js/index.js +11 -4
- package/lib/components/hyTable/js/search.js +25 -1
- package/lib/components/hyTable/table.vue.js +33 -12
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +9 -2
- package/lib/components/hyTableForm/batchTableForm.vue.js +23 -2
- package/lib/components/hyTableForm/js/useAppTableForm.js +1 -1
- package/lib/components/hyTableForm/tableForm.vue.js +78 -32
- package/lib/components/hyTree/js/index.js +118 -50
- package/lib/components/hyTree/tree.vue.js +4 -2
- package/lib/style/index.scss +0 -1
- package/lib/style/tailwind.scss +0 -1
- package/lib/utils/is.js +5 -3
- package/lib/utils/map/hook/bigMap.js +2 -0
- package/lib/utils/map/hook/gaode.js +51 -16
- package/lib/utils/map/hook/leafletjs.js +15 -3
- package/lib/utils/map/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -133,21 +133,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
133
133
|
(field) => field.propString && filterKeys.includes(field.propString)
|
|
134
134
|
) : fields2;
|
|
135
135
|
}
|
|
136
|
-
async function obtainOptionsFields(keys) {
|
|
136
|
+
async function obtainOptionsFields(keys, isMountedLoad = false) {
|
|
137
137
|
const filteredFields = filterFields(fields, keys);
|
|
138
|
-
await Promise.allSettled(
|
|
138
|
+
await Promise.allSettled(
|
|
139
|
+
filteredFields.map((field) => field.obtainOptions(isMountedLoad))
|
|
140
|
+
);
|
|
139
141
|
}
|
|
140
|
-
async function getOptions() {
|
|
141
|
-
await obtainOptionsFields();
|
|
142
|
+
async function getOptions(isMountedLoad = false) {
|
|
143
|
+
await obtainOptionsFields([], isMountedLoad);
|
|
144
|
+
emitOptionsStatus();
|
|
142
145
|
}
|
|
143
146
|
async function getOptionsFields(keys) {
|
|
144
147
|
await obtainOptionsFields(keys);
|
|
148
|
+
emitOptionsStatus();
|
|
145
149
|
}
|
|
146
150
|
async function getOptionsError() {
|
|
147
151
|
const filteredFields = fields.filter(
|
|
148
152
|
(field) => field.propString && field.optionsError
|
|
149
153
|
);
|
|
150
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 });
|
|
151
160
|
}
|
|
152
161
|
provide(
|
|
153
162
|
formContextKey,
|
|
@@ -155,11 +164,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
155
164
|
...toRefs(props),
|
|
156
165
|
emits,
|
|
157
166
|
addField,
|
|
158
|
-
removeField
|
|
167
|
+
removeField,
|
|
168
|
+
emitOptionsStatus
|
|
159
169
|
})
|
|
160
170
|
);
|
|
161
171
|
onMounted(() => {
|
|
162
|
-
getOptions();
|
|
172
|
+
getOptions(true);
|
|
163
173
|
});
|
|
164
174
|
onUnmounted(() => {
|
|
165
175
|
shrinkDestroy();
|
|
@@ -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 {
|
|
@@ -4,7 +4,7 @@ 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';
|
|
@@ -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,
|
|
@@ -434,7 +435,7 @@ const _sfc_main = {
|
|
|
434
435
|
}, {
|
|
435
436
|
default: withCtx(() => [
|
|
436
437
|
createElementVNode("div", {
|
|
437
|
-
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", [
|
|
438
439
|
citem.className,
|
|
439
440
|
unref(operatorDisabledHandler)(citem, {
|
|
440
441
|
column,
|
|
@@ -466,7 +467,16 @@ const _sfc_main = {
|
|
|
466
467
|
)) : (openBlock(), createElementBlock("div", {
|
|
467
468
|
key: 1,
|
|
468
469
|
class: "mt-1 whitespace-nowrap"
|
|
469
|
-
}, "\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)
|
|
470
480
|
], 10, ["onClick"])
|
|
471
481
|
]),
|
|
472
482
|
_: 2
|
|
@@ -519,10 +529,10 @@ const _sfc_main = {
|
|
|
519
529
|
})
|
|
520
530
|
}, {
|
|
521
531
|
default: withCtx(() => [
|
|
522
|
-
createElementVNode("span",
|
|
532
|
+
createElementVNode("span", { class: "relative" }, [
|
|
523
533
|
createElementVNode(
|
|
524
534
|
"span",
|
|
525
|
-
|
|
535
|
+
{ class: "pr-1" },
|
|
526
536
|
toDisplayString(citem.label),
|
|
527
537
|
1
|
|
528
538
|
/* TEXT */
|
|
@@ -546,7 +556,16 @@ const _sfc_main = {
|
|
|
546
556
|
})) + "\uFF09",
|
|
547
557
|
1
|
|
548
558
|
/* TEXT */
|
|
549
|
-
)) : 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)
|
|
550
569
|
])
|
|
551
570
|
]),
|
|
552
571
|
_: 2
|
|
@@ -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)) {
|
|
@@ -446,4 +452,4 @@ const useAppTableWrapper = (hy) => {
|
|
|
446
452
|
};
|
|
447
453
|
};
|
|
448
454
|
|
|
449
|
-
export { operatorClickHandler, operatorDisableTextdHandler, operatorDisabledHandler, operatorFilterHandler, renderContentHandler, renderHeaderHandler, tableColumnHandler, tableColumnShowHandler, useAppTableWrapper };
|
|
455
|
+
export { operatorClickHandler, operatorDisableTextdHandler, operatorDisabledHandler, operatorFilterHandler, operatorIsDotHandler, renderContentHandler, renderHeaderHandler, tableColumnHandler, tableColumnShowHandler, useAppTableWrapper };
|
|
@@ -101,6 +101,26 @@ function useAppTableSearch(hy) {
|
|
|
101
101
|
const isReset = !(isEmpty(oldQueryValue) && isEmpty(props.filterModel.query) || oldQueryValue === props.filterModel.query);
|
|
102
102
|
getData(isReset ? 1 : null);
|
|
103
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
|
+
}
|
|
104
124
|
return {
|
|
105
125
|
totalElements,
|
|
106
126
|
showFilter,
|
|
@@ -113,7 +133,11 @@ function useAppTableSearch(hy) {
|
|
|
113
133
|
getTableDataSource,
|
|
114
134
|
onSizeChangeHandler,
|
|
115
135
|
onCurrentChangeHandler,
|
|
116
|
-
onSearchQueryHandler
|
|
136
|
+
onSearchQueryHandler,
|
|
137
|
+
getOptions,
|
|
138
|
+
getOptionsFields,
|
|
139
|
+
getOptionsError,
|
|
140
|
+
getOptionsByField
|
|
117
141
|
};
|
|
118
142
|
}
|
|
119
143
|
|
|
@@ -4,7 +4,7 @@ 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 { useAppTableWrapper, operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, operatorDisableTextdHandler, renderContentHandler, renderHeaderHandler } from './js/index.mjs';
|
|
7
|
+
import { useAppTableWrapper, operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, operatorIsDotHandler, operatorDisableTextdHandler, renderContentHandler, renderHeaderHandler } from './js/index.mjs';
|
|
8
8
|
import { useAppTableSearch } from './js/search.mjs';
|
|
9
9
|
import _sfc_main$2 from './cpns/headerItem.vue.mjs';
|
|
10
10
|
import _sfc_main$1 from './cpns/columnSelect.vue.mjs';
|
|
@@ -251,7 +251,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
251
251
|
onCurrentChangeHandler,
|
|
252
252
|
onSearchQueryHandler,
|
|
253
253
|
showAppTableLoading,
|
|
254
|
-
closeAppTableLoading
|
|
254
|
+
closeAppTableLoading,
|
|
255
|
+
getOptions,
|
|
256
|
+
getOptionsFields,
|
|
257
|
+
getOptionsError,
|
|
258
|
+
getOptionsByField
|
|
255
259
|
} = useMixins(
|
|
256
260
|
{
|
|
257
261
|
props,
|
|
@@ -281,7 +285,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
281
285
|
setRowExpansion,
|
|
282
286
|
toggleRowExpansion,
|
|
283
287
|
showAppTableLoading,
|
|
284
|
-
closeAppTableLoading
|
|
288
|
+
closeAppTableLoading,
|
|
289
|
+
getOptions,
|
|
290
|
+
getOptionsFields,
|
|
291
|
+
getOptionsError,
|
|
292
|
+
getOptionsByField
|
|
285
293
|
});
|
|
286
294
|
return (_ctx, _cache) => {
|
|
287
295
|
return openBlock(), createElementBlock(
|
|
@@ -375,7 +383,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
375
383
|
columns: __props.filterColumns,
|
|
376
384
|
hidden: !unref(showFilter),
|
|
377
385
|
class: normalizeClass({ "mb-4": unref(showFilter) }),
|
|
378
|
-
onSearch: ($event) => unref(getData)(1)
|
|
386
|
+
onSearch: ($event) => unref(getData)(1),
|
|
387
|
+
onOptionsStatus: _ctx.$attrs.onOptionsStatus
|
|
379
388
|
}, createSlots({
|
|
380
389
|
_: 2
|
|
381
390
|
/* DYNAMIC */
|
|
@@ -388,7 +397,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
388
397
|
])
|
|
389
398
|
};
|
|
390
399
|
})
|
|
391
|
-
]), 1032, ["model", "columns", "hidden", "class", "onSearch"])) : createCommentVNode("v-if", true),
|
|
400
|
+
]), 1032, ["model", "columns", "hidden", "class", "onSearch", "onOptionsStatus"])) : createCommentVNode("v-if", true),
|
|
392
401
|
createCommentVNode(" \u4E3B\u5185\u5BB9 "),
|
|
393
402
|
createElementVNode("div", { class: "h-0 flex-1 flex flex-col border border-border rounded overflow-hidden" }, [
|
|
394
403
|
createCommentVNode(" \u8868\u683C "),
|
|
@@ -485,7 +494,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
485
494
|
}, {
|
|
486
495
|
default: withCtx(() => [
|
|
487
496
|
createElementVNode("div", {
|
|
488
|
-
class: normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)] rounded box-border", [
|
|
497
|
+
class: normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)] rounded relative box-border", [
|
|
489
498
|
citem.className,
|
|
490
499
|
unref(operatorDisabledHandler)(citem, scope) ? "cursor-not-allowed text-[var(--hy-el-text-color-disabled)] hover:border-[rgba(var(--hy-auxiliary),1)] hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-auxiliary),0.5)]" : "cursor-pointer hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)]"
|
|
491
500
|
]]),
|
|
@@ -509,7 +518,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
509
518
|
)) : (openBlock(), createElementBlock("div", {
|
|
510
519
|
key: 1,
|
|
511
520
|
class: "mt-1 whitespace-nowrap"
|
|
512
|
-
}, "\xA0"))
|
|
521
|
+
}, "\xA0")),
|
|
522
|
+
unref(operatorIsDotHandler)(citem, scope) ? (openBlock(), createElementBlock("div", {
|
|
523
|
+
key: 2,
|
|
524
|
+
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]"
|
|
525
|
+
})) : createCommentVNode("v-if", true)
|
|
513
526
|
], 42, ["onClick", "onContextmenu"])
|
|
514
527
|
]),
|
|
515
528
|
_: 2
|
|
@@ -549,10 +562,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
549
562
|
disabled: unref(operatorDisabledHandler)(citem, scope)
|
|
550
563
|
}, {
|
|
551
564
|
default: withCtx(() => [
|
|
552
|
-
createElementVNode("span",
|
|
565
|
+
createElementVNode("span", { class: "relative" }, [
|
|
553
566
|
createElementVNode(
|
|
554
567
|
"span",
|
|
555
|
-
|
|
568
|
+
{ class: "pr-1" },
|
|
556
569
|
toDisplayString(citem.label),
|
|
557
570
|
1
|
|
558
571
|
/* TEXT */
|
|
@@ -566,7 +579,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
566
579
|
"\uFF08" + toDisplayString(unref(operatorDisableTextdHandler)(citem, scope)) + "\uFF09",
|
|
567
580
|
1
|
|
568
581
|
/* TEXT */
|
|
569
|
-
)) : createCommentVNode("v-if", true)
|
|
582
|
+
)) : createCommentVNode("v-if", true),
|
|
583
|
+
unref(operatorIsDotHandler)(citem, scope) ? (openBlock(), createElementBlock("div", {
|
|
584
|
+
key: 1,
|
|
585
|
+
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]"
|
|
586
|
+
})) : createCommentVNode("v-if", true)
|
|
570
587
|
])
|
|
571
588
|
]),
|
|
572
589
|
_: 2
|
|
@@ -806,10 +823,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
806
823
|
disabled: unref(operatorDisabledHandler)(citem, unref(tableTriggerRef).scope)
|
|
807
824
|
}, {
|
|
808
825
|
default: withCtx(() => [
|
|
809
|
-
createElementVNode("span",
|
|
826
|
+
createElementVNode("span", { class: "relative" }, [
|
|
810
827
|
createElementVNode(
|
|
811
828
|
"span",
|
|
812
|
-
|
|
829
|
+
{ class: "pr-1" },
|
|
813
830
|
toDisplayString(citem.label),
|
|
814
831
|
1
|
|
815
832
|
/* TEXT */
|
|
@@ -823,7 +840,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
823
840
|
"\uFF08" + toDisplayString(unref(operatorDisableTextdHandler)(citem, unref(tableTriggerRef).scope)) + "\uFF09",
|
|
824
841
|
1
|
|
825
842
|
/* TEXT */
|
|
826
|
-
)) : createCommentVNode("v-if", true)
|
|
843
|
+
)) : createCommentVNode("v-if", true),
|
|
844
|
+
unref(operatorIsDotHandler)(citem, unref(tableTriggerRef).scope) ? (openBlock(), createElementBlock("div", {
|
|
845
|
+
key: 1,
|
|
846
|
+
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]"
|
|
847
|
+
})) : createCommentVNode("v-if", true)
|
|
827
848
|
])
|
|
828
849
|
]),
|
|
829
850
|
_: 2
|
|
@@ -59,6 +59,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
59
59
|
default: () => {
|
|
60
60
|
return [];
|
|
61
61
|
}
|
|
62
|
+
},
|
|
63
|
+
isDot: {
|
|
64
|
+
// 是否显示小红点
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
62
67
|
}
|
|
63
68
|
},
|
|
64
69
|
emits: ["change"],
|
|
@@ -144,6 +149,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
144
149
|
disabled: __props.disabled,
|
|
145
150
|
class: normalizeClass(selectedData.value.buttonClass || __props.buttonClass),
|
|
146
151
|
svgName: selectedData.value.svgName || __props.svgName,
|
|
152
|
+
isDot: __props.isDot,
|
|
147
153
|
onClick: ($event) => buttonChange(selectedData.value)
|
|
148
154
|
}, {
|
|
149
155
|
default: withCtx(() => [
|
|
@@ -155,7 +161,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
155
161
|
]),
|
|
156
162
|
_: 1
|
|
157
163
|
/* STABLE */
|
|
158
|
-
}, 8, ["type", "size", "disabled", "class", "svgName", "onClick"])
|
|
164
|
+
}, 8, ["type", "size", "disabled", "class", "svgName", "isDot", "onClick"])
|
|
159
165
|
]),
|
|
160
166
|
_: 1
|
|
161
167
|
/* STABLE */
|
|
@@ -174,6 +180,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
174
180
|
size: __props.size,
|
|
175
181
|
disabled: __props.disabled,
|
|
176
182
|
class: normalizeClass(__props.buttonClass),
|
|
183
|
+
isDot: __props.isDot,
|
|
177
184
|
onClick: ($event) => buttonChange(selectedData.value)
|
|
178
185
|
}, {
|
|
179
186
|
content: withCtx(() => [
|
|
@@ -219,7 +226,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
219
226
|
]),
|
|
220
227
|
_: 1
|
|
221
228
|
/* STABLE */
|
|
222
|
-
}, 8, ["type", "size", "disabled", "class", "onClick"])
|
|
229
|
+
}, 8, ["type", "size", "disabled", "class", "isDot", "onClick"])
|
|
223
230
|
]),
|
|
224
231
|
default: withCtx(() => [
|
|
225
232
|
createElementVNode("ul", { class: "max-h-[500px] overflow-x-auto box-border" }, [
|
|
@@ -330,6 +330,26 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
330
330
|
active.value++;
|
|
331
331
|
}
|
|
332
332
|
return active.value;
|
|
333
|
+
},
|
|
334
|
+
async getOptions() {
|
|
335
|
+
if (tableRef.value) {
|
|
336
|
+
await tableRef.value.getOptions();
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
async getOptionsFields(keys) {
|
|
340
|
+
if (tableRef.value) {
|
|
341
|
+
await tableRef.value.getOptionsFields(keys);
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
async getOptionsError() {
|
|
345
|
+
if (tableRef.value) {
|
|
346
|
+
await tableRef.value.getOptionsError();
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
getOptionsByField(key) {
|
|
350
|
+
if (tableRef.value) {
|
|
351
|
+
return tableRef.value.getOptionsByField(key);
|
|
352
|
+
}
|
|
333
353
|
}
|
|
334
354
|
});
|
|
335
355
|
return (_ctx, _cache) => {
|
|
@@ -519,8 +539,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
519
539
|
columnNum: __props.columnNum,
|
|
520
540
|
size: __props.size,
|
|
521
541
|
showAddBtn: __props.showAddBtn,
|
|
542
|
+
class: "h-0 flex-1",
|
|
522
543
|
onTableDataChange: tableDataChange,
|
|
523
|
-
|
|
544
|
+
onOptionsStatus: _ctx.$attrs.onOptionsStatus
|
|
524
545
|
}), createSlots({
|
|
525
546
|
_: 2
|
|
526
547
|
/* DYNAMIC */
|
|
@@ -533,7 +554,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
533
554
|
])
|
|
534
555
|
};
|
|
535
556
|
})
|
|
536
|
-
]), 1040, ["tableColumns", "formColumns", "onExpandRowChange", "rules", "rowClickExpand", "columnNum", "size", "showAddBtn"])
|
|
557
|
+
]), 1040, ["tableColumns", "formColumns", "onExpandRowChange", "rules", "rowClickExpand", "columnNum", "size", "showAddBtn", "onOptionsStatus"])
|
|
537
558
|
])) : createCommentVNode("v-if", true),
|
|
538
559
|
submitting.value ? (openBlock(), createElementBlock("div", {
|
|
539
560
|
key: 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useTemplateRef, ref, computed, nextTick, onMounted, watch, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, createBlock, unref, withCtx, createTextVNode, Fragment, renderList, normalizeClass, createVNode, mergeProps, createSlots, renderSlot, normalizeProps, guardReactiveProps, withDirectives, vShow } from 'vue';
|
|
2
2
|
import '../index.mjs';
|
|
3
3
|
import '../../utils/index.mjs';
|
|
4
4
|
import { doValidate } from './js/index.mjs';
|
|
@@ -71,15 +71,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
71
71
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
72
72
|
const props = __props;
|
|
73
73
|
const emits = __emit;
|
|
74
|
-
onMounted(() => {
|
|
75
|
-
watch(
|
|
76
|
-
() => dataSource.value,
|
|
77
|
-
() => {
|
|
78
|
-
emits("tableDataChange", dataSource.value);
|
|
79
|
-
},
|
|
80
|
-
{ deep: true, immediate: true }
|
|
81
|
-
);
|
|
82
|
-
});
|
|
83
74
|
const tableRef = useTemplateRef("tableRef");
|
|
84
75
|
const formRef = useTemplateRef("formRef");
|
|
85
76
|
const dataSource = ref([]);
|
|
@@ -107,6 +98,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
107
98
|
]
|
|
108
99
|
});
|
|
109
100
|
const isExpandValidate = ref(false);
|
|
101
|
+
const statistics = ref({
|
|
102
|
+
success: 0,
|
|
103
|
+
failed: 0,
|
|
104
|
+
total: dataSource.value.length
|
|
105
|
+
});
|
|
110
106
|
const tableFormColumns = computed(() => {
|
|
111
107
|
if (!props.tableColumns) return [];
|
|
112
108
|
return [...props.tableColumns, ...operatorColumn.value];
|
|
@@ -114,19 +110,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
114
110
|
const expandColumn = computed(() => {
|
|
115
111
|
return props.tableColumns.find((item) => item.type === "expand");
|
|
116
112
|
});
|
|
117
|
-
const statistics = computed(() => {
|
|
118
|
-
return dataSource.value.reduce(
|
|
119
|
-
({ success, failed, total }, data) => {
|
|
120
|
-
if (!data.errorMsg) {
|
|
121
|
-
success++;
|
|
122
|
-
} else {
|
|
123
|
-
failed++;
|
|
124
|
-
}
|
|
125
|
-
return { success, failed, total };
|
|
126
|
-
},
|
|
127
|
-
{ success: 0, failed: 0, total: dataSource.value.length }
|
|
128
|
-
);
|
|
129
|
-
});
|
|
130
113
|
function setData(dataSource2) {
|
|
131
114
|
if (!tableRef.value) return;
|
|
132
115
|
tableRef.value.setData(dataSource2);
|
|
@@ -188,7 +171,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
188
171
|
new Promise(async (resolve, reject) => {
|
|
189
172
|
try {
|
|
190
173
|
await doValidate(data, props.formColumns, props.rules);
|
|
191
|
-
|
|
174
|
+
if (!data.errorMsg) {
|
|
175
|
+
data.errorMsg = { prop: "", message: "" };
|
|
176
|
+
} else if (!data.errorMsg.prop) {
|
|
177
|
+
data.errorMsg.prop = data.errorMsg.prop;
|
|
178
|
+
data.errorMsg.message = data.errorMsg.message;
|
|
179
|
+
}
|
|
192
180
|
data.errorMap = /* @__PURE__ */ new Map();
|
|
193
181
|
resolve();
|
|
194
182
|
} catch (error) {
|
|
@@ -200,6 +188,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
200
188
|
};
|
|
201
189
|
if (!data.errorMsg) {
|
|
202
190
|
data.errorMsg = errData;
|
|
191
|
+
} else if (!data.errorMsg.prop && !data.errorMsg.message) {
|
|
192
|
+
data.errorMsg.prop = errData.errorMsg.prop;
|
|
193
|
+
data.errorMsg.message = errData.errorMsg.message;
|
|
203
194
|
}
|
|
204
195
|
errorMap.set(errData.prop, errData.message);
|
|
205
196
|
});
|
|
@@ -219,7 +210,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
219
210
|
}
|
|
220
211
|
try {
|
|
221
212
|
await doValidate(row, props.formColumns, props.rules);
|
|
222
|
-
row.errorMsg
|
|
213
|
+
if (!row.errorMsg) {
|
|
214
|
+
row.errorMsg = { prop: "", message: "" };
|
|
215
|
+
} else {
|
|
216
|
+
row.errorMsg.prop = "";
|
|
217
|
+
row.errorMsg.message = "";
|
|
218
|
+
}
|
|
223
219
|
row.errorMap = /* @__PURE__ */ new Map();
|
|
224
220
|
} catch (error) {
|
|
225
221
|
let errMsg = null;
|
|
@@ -235,7 +231,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
235
231
|
errorMap2.set(errData.prop, errData.message);
|
|
236
232
|
});
|
|
237
233
|
row.errorMap = errorMap2;
|
|
238
|
-
row.errorMsg
|
|
234
|
+
if (!row.errorMsg) {
|
|
235
|
+
row.errorMsg = { prop: "", message: "" };
|
|
236
|
+
} else {
|
|
237
|
+
row.errorMsg.prop = errMsg.prop;
|
|
238
|
+
row.errorMsg.message = errMsg.message;
|
|
239
|
+
}
|
|
239
240
|
}
|
|
240
241
|
const { onlyId, errorMsg, errorMap, children, ...data } = row;
|
|
241
242
|
emits("validate", {
|
|
@@ -246,6 +247,29 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
246
247
|
...statistics.value
|
|
247
248
|
});
|
|
248
249
|
}
|
|
250
|
+
onMounted(() => {
|
|
251
|
+
watch(
|
|
252
|
+
() => dataSource.value,
|
|
253
|
+
() => {
|
|
254
|
+
emits("tableDataChange", dataSource.value);
|
|
255
|
+
const { success, failed } = dataSource.value.reduce(
|
|
256
|
+
({ success: success2, failed: failed2 }, data) => {
|
|
257
|
+
if (!data.errorMsg) {
|
|
258
|
+
success2++;
|
|
259
|
+
} else {
|
|
260
|
+
failed2++;
|
|
261
|
+
}
|
|
262
|
+
return { success: success2, failed: failed2 };
|
|
263
|
+
},
|
|
264
|
+
{ success: 0, failed: 0 }
|
|
265
|
+
);
|
|
266
|
+
statistics.value.success = success;
|
|
267
|
+
statistics.value.failed = failed;
|
|
268
|
+
statistics.value.total = dataSource.value.length;
|
|
269
|
+
},
|
|
270
|
+
{ deep: true, immediate: true }
|
|
271
|
+
);
|
|
272
|
+
});
|
|
249
273
|
__expose({
|
|
250
274
|
setData(data) {
|
|
251
275
|
dataSource.value = cloneDeep(data, true);
|
|
@@ -293,6 +317,26 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
293
317
|
...statistics.value,
|
|
294
318
|
dataSource: dataSource.value
|
|
295
319
|
};
|
|
320
|
+
},
|
|
321
|
+
async getOptions() {
|
|
322
|
+
if (formRef.value) {
|
|
323
|
+
await formRef.value.getOptions();
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
async getOptionsFields(keys) {
|
|
327
|
+
if (formRef.value) {
|
|
328
|
+
await formRef.value.getOptionsFields(keys);
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
async getOptionsError() {
|
|
332
|
+
if (formRef.value) {
|
|
333
|
+
await formRef.value.getOptionsError();
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
getOptionsByField(key) {
|
|
337
|
+
if (formRef.value) {
|
|
338
|
+
return formRef.value.getOptionsByField(key);
|
|
339
|
+
}
|
|
296
340
|
}
|
|
297
341
|
});
|
|
298
342
|
return (_ctx, _cache) => {
|
|
@@ -437,17 +481,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
437
481
|
fn: withCtx(({ row }) => [
|
|
438
482
|
createElementVNode("div", { class: "w-full pl-[52px] pr-[62px] pb-2" }, [
|
|
439
483
|
createElementVNode("div", { class: "h-[32px]" }, [
|
|
440
|
-
createElementVNode(
|
|
484
|
+
withDirectives(createElementVNode(
|
|
441
485
|
"div",
|
|
442
486
|
{
|
|
443
487
|
class: normalizeClass(["flex items-center gap-1.5 text-danger-2 transition-all duration-300 overflow-hidden", [row.errorMsg ? "h-full" : "h-0"]])
|
|
444
488
|
},
|
|
445
489
|
[
|
|
446
|
-
|
|
447
|
-
key: 0,
|
|
490
|
+
createVNode(unref(HyIcon), {
|
|
448
491
|
"svg-name": "dispatch-share1-prompt",
|
|
449
492
|
class: "!w-3 !h-3"
|
|
450
|
-
})
|
|
493
|
+
}),
|
|
451
494
|
createElementVNode(
|
|
452
495
|
"span",
|
|
453
496
|
null,
|
|
@@ -458,7 +501,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
458
501
|
],
|
|
459
502
|
2
|
|
460
503
|
/* CLASS */
|
|
461
|
-
)
|
|
504
|
+
), [
|
|
505
|
+
[vShow, row.errorMsg.message]
|
|
506
|
+
])
|
|
462
507
|
]),
|
|
463
508
|
createVNode(unref(HyForm), {
|
|
464
509
|
ref_key: "formRef",
|
|
@@ -470,7 +515,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
470
515
|
class: "px-0",
|
|
471
516
|
columnNum: __props.columnNum,
|
|
472
517
|
size: __props.size,
|
|
473
|
-
onValidate: (prop, isValid, message) => onValidateHandler(row, { prop, isValid, message })
|
|
518
|
+
onValidate: (prop, isValid, message) => onValidateHandler(row, { prop, isValid, message }),
|
|
519
|
+
onOptionsStatus: _ctx.$attrs.onOptionsStatus
|
|
474
520
|
}, createSlots({
|
|
475
521
|
_: 2
|
|
476
522
|
/* DYNAMIC */
|
|
@@ -483,7 +529,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
483
529
|
])
|
|
484
530
|
};
|
|
485
531
|
})
|
|
486
|
-
]), 1032, ["model", "columns", "rules", "columnNum", "size", "onValidate"])
|
|
532
|
+
]), 1032, ["model", "columns", "rules", "columnNum", "size", "onValidate", "onOptionsStatus"])
|
|
487
533
|
])
|
|
488
534
|
]),
|
|
489
535
|
key: "0"
|