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
|
@@ -51,7 +51,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
51
51
|
type: [String, Array, Object]
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
-
emits: ["search"],
|
|
54
|
+
emits: ["search", "optionsStatus"],
|
|
55
55
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
56
56
|
const props = __props;
|
|
57
57
|
const emits = __emit;
|
|
@@ -137,21 +137,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
137
137
|
(field) => field.propString && filterKeys.includes(field.propString)
|
|
138
138
|
) : fields2;
|
|
139
139
|
}
|
|
140
|
-
async function obtainOptionsFields(keys) {
|
|
140
|
+
async function obtainOptionsFields(keys, isMountedLoad = false) {
|
|
141
141
|
const filteredFields = filterFields(fields, keys);
|
|
142
|
-
await Promise.allSettled(
|
|
142
|
+
await Promise.allSettled(
|
|
143
|
+
filteredFields.map((field) => field.obtainOptions(isMountedLoad))
|
|
144
|
+
);
|
|
143
145
|
}
|
|
144
|
-
async function getOptions() {
|
|
145
|
-
await obtainOptionsFields();
|
|
146
|
+
async function getOptions(isMountedLoad = false) {
|
|
147
|
+
await obtainOptionsFields([], isMountedLoad);
|
|
148
|
+
emitOptionsStatus();
|
|
146
149
|
}
|
|
147
150
|
async function getOptionsFields(keys) {
|
|
148
151
|
await obtainOptionsFields(keys);
|
|
152
|
+
emitOptionsStatus();
|
|
149
153
|
}
|
|
150
154
|
async function getOptionsError() {
|
|
151
155
|
const filteredFields = fields.filter(
|
|
152
156
|
(field) => field.propString && field.optionsError
|
|
153
157
|
);
|
|
154
158
|
await Promise.allSettled(filteredFields.map((field) => field.obtainOptions()));
|
|
159
|
+
emitOptionsStatus();
|
|
160
|
+
}
|
|
161
|
+
function emitOptionsStatus() {
|
|
162
|
+
const hasError = fields.some((item) => item.optionsError === "error");
|
|
163
|
+
emits("optionsStatus", { result: !hasError });
|
|
155
164
|
}
|
|
156
165
|
vue.provide(
|
|
157
166
|
index.formContextKey,
|
|
@@ -159,11 +168,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
159
168
|
...vue.toRefs(props),
|
|
160
169
|
emits,
|
|
161
170
|
addField,
|
|
162
|
-
removeField
|
|
171
|
+
removeField,
|
|
172
|
+
emitOptionsStatus
|
|
163
173
|
})
|
|
164
174
|
);
|
|
165
175
|
vue.onMounted(() => {
|
|
166
|
-
getOptions();
|
|
176
|
+
getOptions(true);
|
|
167
177
|
});
|
|
168
178
|
vue.onUnmounted(() => {
|
|
169
179
|
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 {
|
|
@@ -287,6 +287,7 @@ const _sfc_main = {
|
|
|
287
287
|
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTableV2), {
|
|
288
288
|
"expanded-row-keys": expandedRowKeys.value,
|
|
289
289
|
"onUpdate:expandedRowKeys": ($event) => expandedRowKeys.value = $event,
|
|
290
|
+
cache: 0,
|
|
290
291
|
"row-key": __props.rowKey,
|
|
291
292
|
data: dataSource.value,
|
|
292
293
|
columns: tableColumns.value,
|
|
@@ -438,7 +439,7 @@ const _sfc_main = {
|
|
|
438
439
|
}, {
|
|
439
440
|
default: vue.withCtx(() => [
|
|
440
441
|
vue.createElementVNode("div", {
|
|
441
|
-
class: vue.normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent rounded box-border", [
|
|
442
|
+
class: vue.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", [
|
|
442
443
|
citem.className,
|
|
443
444
|
vue.unref(index$1.operatorDisabledHandler)(citem, {
|
|
444
445
|
column,
|
|
@@ -470,7 +471,16 @@ const _sfc_main = {
|
|
|
470
471
|
)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
471
472
|
key: 1,
|
|
472
473
|
class: "mt-1 whitespace-nowrap"
|
|
473
|
-
}, "\xA0"))
|
|
474
|
+
}, "\xA0")),
|
|
475
|
+
vue.unref(index$1.operatorIsDotHandler)(citem, {
|
|
476
|
+
column,
|
|
477
|
+
row,
|
|
478
|
+
$index,
|
|
479
|
+
cellIndex
|
|
480
|
+
}) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
481
|
+
key: 2,
|
|
482
|
+
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]"
|
|
483
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
474
484
|
], 10, ["onClick"])
|
|
475
485
|
]),
|
|
476
486
|
_: 2
|
|
@@ -523,10 +533,10 @@ const _sfc_main = {
|
|
|
523
533
|
})
|
|
524
534
|
}, {
|
|
525
535
|
default: vue.withCtx(() => [
|
|
526
|
-
vue.createElementVNode("span",
|
|
536
|
+
vue.createElementVNode("span", { class: "relative" }, [
|
|
527
537
|
vue.createElementVNode(
|
|
528
538
|
"span",
|
|
529
|
-
|
|
539
|
+
{ class: "pr-1" },
|
|
530
540
|
vue.toDisplayString(citem.label),
|
|
531
541
|
1
|
|
532
542
|
/* TEXT */
|
|
@@ -550,7 +560,16 @@ const _sfc_main = {
|
|
|
550
560
|
})) + "\uFF09",
|
|
551
561
|
1
|
|
552
562
|
/* TEXT */
|
|
553
|
-
)) : vue.createCommentVNode("v-if", true)
|
|
563
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
564
|
+
vue.unref(index$1.operatorIsDotHandler)(citem, {
|
|
565
|
+
column,
|
|
566
|
+
row,
|
|
567
|
+
$index,
|
|
568
|
+
cellIndex
|
|
569
|
+
}) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
570
|
+
key: 1,
|
|
571
|
+
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]"
|
|
572
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
554
573
|
])
|
|
555
574
|
]),
|
|
556
575
|
_: 2
|
|
@@ -88,15 +88,15 @@ function operatorShowHandler(operator, scope) {
|
|
|
88
88
|
if (is.isFunction(show)) return show(scope);
|
|
89
89
|
return true;
|
|
90
90
|
}
|
|
91
|
-
function operatorDisabledHandler(
|
|
92
|
-
const { disabled } =
|
|
91
|
+
function operatorDisabledHandler(operator, scope) {
|
|
92
|
+
const { disabled } = operator;
|
|
93
93
|
if (is.isBoolean(disabled)) return disabled;
|
|
94
94
|
if (is.isFunction(disabled)) return disabled(scope);
|
|
95
95
|
return false;
|
|
96
96
|
}
|
|
97
|
-
function operatorDisableTextdHandler(
|
|
97
|
+
function operatorDisableTextdHandler(operator, scope) {
|
|
98
98
|
const { t } = useLocale.useLocale();
|
|
99
|
-
const { disabledText } =
|
|
99
|
+
const { disabledText } = operator;
|
|
100
100
|
if (is.isString(disabledText)) return disabledText;
|
|
101
101
|
if (is.isFunction(disabledText)) return disabledText(scope);
|
|
102
102
|
return t("table.nonsupport");
|
|
@@ -130,6 +130,12 @@ function operatorClickHandler(command, column, scope, type = "all") {
|
|
|
130
130
|
if (operatorDisabledHandler(target, scope)) return;
|
|
131
131
|
target?.handler && target.handler(scope);
|
|
132
132
|
}
|
|
133
|
+
function operatorIsDotHandler(operator, scope) {
|
|
134
|
+
const { isDot } = operator;
|
|
135
|
+
if (is.isFunction(isDot)) return isDot(scope);
|
|
136
|
+
if (is.isBoolean(isDot)) return isDot;
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
133
139
|
function renderHeaderHandler(column, scope) {
|
|
134
140
|
if (!column) return;
|
|
135
141
|
if (is.isFunction(column.renderHeader)) {
|
|
@@ -452,6 +458,7 @@ exports.operatorClickHandler = operatorClickHandler;
|
|
|
452
458
|
exports.operatorDisableTextdHandler = operatorDisableTextdHandler;
|
|
453
459
|
exports.operatorDisabledHandler = operatorDisabledHandler;
|
|
454
460
|
exports.operatorFilterHandler = operatorFilterHandler;
|
|
461
|
+
exports.operatorIsDotHandler = operatorIsDotHandler;
|
|
455
462
|
exports.renderContentHandler = renderContentHandler;
|
|
456
463
|
exports.renderHeaderHandler = renderHeaderHandler;
|
|
457
464
|
exports.tableColumnHandler = tableColumnHandler;
|
|
@@ -103,6 +103,26 @@ function useAppTableSearch(hy) {
|
|
|
103
103
|
const isReset = !(is.isEmpty(oldQueryValue) && is.isEmpty(props.filterModel.query) || oldQueryValue === props.filterModel.query);
|
|
104
104
|
getData(isReset ? 1 : null);
|
|
105
105
|
}
|
|
106
|
+
async function getOptions() {
|
|
107
|
+
if (appSearchRef.value) {
|
|
108
|
+
await appSearchRef.value.getOptions();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async function getOptionsFields(keys) {
|
|
112
|
+
if (appSearchRef.value) {
|
|
113
|
+
await appSearchRef.value.getOptionsFields(keys);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async function getOptionsError() {
|
|
117
|
+
if (appSearchRef.value) {
|
|
118
|
+
await appSearchRef.value.getOptionsError();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function getOptionsByField() {
|
|
122
|
+
if (appSearchRef.value) {
|
|
123
|
+
return appSearchRef.value.getOptionsByField();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
106
126
|
return {
|
|
107
127
|
totalElements,
|
|
108
128
|
showFilter,
|
|
@@ -115,7 +135,11 @@ function useAppTableSearch(hy) {
|
|
|
115
135
|
getTableDataSource,
|
|
116
136
|
onSizeChangeHandler,
|
|
117
137
|
onCurrentChangeHandler,
|
|
118
|
-
onSearchQueryHandler
|
|
138
|
+
onSearchQueryHandler,
|
|
139
|
+
getOptions,
|
|
140
|
+
getOptionsFields,
|
|
141
|
+
getOptionsError,
|
|
142
|
+
getOptionsByField
|
|
119
143
|
};
|
|
120
144
|
}
|
|
121
145
|
|
|
@@ -255,7 +255,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
255
255
|
onCurrentChangeHandler,
|
|
256
256
|
onSearchQueryHandler,
|
|
257
257
|
showAppTableLoading,
|
|
258
|
-
closeAppTableLoading
|
|
258
|
+
closeAppTableLoading,
|
|
259
|
+
getOptions,
|
|
260
|
+
getOptionsFields,
|
|
261
|
+
getOptionsError,
|
|
262
|
+
getOptionsByField
|
|
259
263
|
} = useMixins.useMixins(
|
|
260
264
|
{
|
|
261
265
|
props,
|
|
@@ -285,7 +289,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
285
289
|
setRowExpansion,
|
|
286
290
|
toggleRowExpansion,
|
|
287
291
|
showAppTableLoading,
|
|
288
|
-
closeAppTableLoading
|
|
292
|
+
closeAppTableLoading,
|
|
293
|
+
getOptions,
|
|
294
|
+
getOptionsFields,
|
|
295
|
+
getOptionsError,
|
|
296
|
+
getOptionsByField
|
|
289
297
|
});
|
|
290
298
|
return (_ctx, _cache) => {
|
|
291
299
|
return vue.openBlock(), vue.createElementBlock(
|
|
@@ -379,7 +387,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
379
387
|
columns: __props.filterColumns,
|
|
380
388
|
hidden: !vue.unref(showFilter),
|
|
381
389
|
class: vue.normalizeClass({ "mb-4": vue.unref(showFilter) }),
|
|
382
|
-
onSearch: ($event) => vue.unref(getData)(1)
|
|
390
|
+
onSearch: ($event) => vue.unref(getData)(1),
|
|
391
|
+
onOptionsStatus: _ctx.$attrs.onOptionsStatus
|
|
383
392
|
}, vue.createSlots({
|
|
384
393
|
_: 2
|
|
385
394
|
/* DYNAMIC */
|
|
@@ -392,7 +401,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
392
401
|
])
|
|
393
402
|
};
|
|
394
403
|
})
|
|
395
|
-
]), 1032, ["model", "columns", "hidden", "class", "onSearch"])) : vue.createCommentVNode("v-if", true),
|
|
404
|
+
]), 1032, ["model", "columns", "hidden", "class", "onSearch", "onOptionsStatus"])) : vue.createCommentVNode("v-if", true),
|
|
396
405
|
vue.createCommentVNode(" \u4E3B\u5185\u5BB9 "),
|
|
397
406
|
vue.createElementVNode("div", { class: "h-0 flex-1 flex flex-col border border-border rounded overflow-hidden" }, [
|
|
398
407
|
vue.createCommentVNode(" \u8868\u683C "),
|
|
@@ -489,7 +498,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
489
498
|
}, {
|
|
490
499
|
default: vue.withCtx(() => [
|
|
491
500
|
vue.createElementVNode("div", {
|
|
492
|
-
class: vue.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", [
|
|
501
|
+
class: vue.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", [
|
|
493
502
|
citem.className,
|
|
494
503
|
vue.unref(index.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)]"
|
|
495
504
|
]]),
|
|
@@ -513,7 +522,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
513
522
|
)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
514
523
|
key: 1,
|
|
515
524
|
class: "mt-1 whitespace-nowrap"
|
|
516
|
-
}, "\xA0"))
|
|
525
|
+
}, "\xA0")),
|
|
526
|
+
vue.unref(index.operatorIsDotHandler)(citem, scope) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
527
|
+
key: 2,
|
|
528
|
+
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]"
|
|
529
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
517
530
|
], 42, ["onClick", "onContextmenu"])
|
|
518
531
|
]),
|
|
519
532
|
_: 2
|
|
@@ -553,10 +566,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
553
566
|
disabled: vue.unref(index.operatorDisabledHandler)(citem, scope)
|
|
554
567
|
}, {
|
|
555
568
|
default: vue.withCtx(() => [
|
|
556
|
-
vue.createElementVNode("span",
|
|
569
|
+
vue.createElementVNode("span", { class: "relative" }, [
|
|
557
570
|
vue.createElementVNode(
|
|
558
571
|
"span",
|
|
559
|
-
|
|
572
|
+
{ class: "pr-1" },
|
|
560
573
|
vue.toDisplayString(citem.label),
|
|
561
574
|
1
|
|
562
575
|
/* TEXT */
|
|
@@ -570,7 +583,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
570
583
|
"\uFF08" + vue.toDisplayString(vue.unref(index.operatorDisableTextdHandler)(citem, scope)) + "\uFF09",
|
|
571
584
|
1
|
|
572
585
|
/* TEXT */
|
|
573
|
-
)) : vue.createCommentVNode("v-if", true)
|
|
586
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
587
|
+
vue.unref(index.operatorIsDotHandler)(citem, scope) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
588
|
+
key: 1,
|
|
589
|
+
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]"
|
|
590
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
574
591
|
])
|
|
575
592
|
]),
|
|
576
593
|
_: 2
|
|
@@ -810,10 +827,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
810
827
|
disabled: vue.unref(index.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope)
|
|
811
828
|
}, {
|
|
812
829
|
default: vue.withCtx(() => [
|
|
813
|
-
vue.createElementVNode("span",
|
|
830
|
+
vue.createElementVNode("span", { class: "relative" }, [
|
|
814
831
|
vue.createElementVNode(
|
|
815
832
|
"span",
|
|
816
|
-
|
|
833
|
+
{ class: "pr-1" },
|
|
817
834
|
vue.toDisplayString(citem.label),
|
|
818
835
|
1
|
|
819
836
|
/* TEXT */
|
|
@@ -827,7 +844,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
827
844
|
"\uFF08" + vue.toDisplayString(vue.unref(index.operatorDisableTextdHandler)(citem, vue.unref(tableTriggerRef).scope)) + "\uFF09",
|
|
828
845
|
1
|
|
829
846
|
/* TEXT */
|
|
830
|
-
)) : vue.createCommentVNode("v-if", true)
|
|
847
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
848
|
+
vue.unref(index.operatorIsDotHandler)(citem, vue.unref(tableTriggerRef).scope) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
849
|
+
key: 1,
|
|
850
|
+
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]"
|
|
851
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
831
852
|
])
|
|
832
853
|
]),
|
|
833
854
|
_: 2
|
|
@@ -63,6 +63,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
63
63
|
default: () => {
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
|
+
},
|
|
67
|
+
isDot: {
|
|
68
|
+
// 是否显示小红点
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
73
|
emits: ["change"],
|
|
@@ -148,6 +153,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
148
153
|
disabled: __props.disabled,
|
|
149
154
|
class: vue.normalizeClass(selectedData.value.buttonClass || __props.buttonClass),
|
|
150
155
|
svgName: selectedData.value.svgName || __props.svgName,
|
|
156
|
+
isDot: __props.isDot,
|
|
151
157
|
onClick: ($event) => buttonChange(selectedData.value)
|
|
152
158
|
}, {
|
|
153
159
|
default: vue.withCtx(() => [
|
|
@@ -159,7 +165,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
159
165
|
]),
|
|
160
166
|
_: 1
|
|
161
167
|
/* STABLE */
|
|
162
|
-
}, 8, ["type", "size", "disabled", "class", "svgName", "onClick"])
|
|
168
|
+
}, 8, ["type", "size", "disabled", "class", "svgName", "isDot", "onClick"])
|
|
163
169
|
]),
|
|
164
170
|
_: 1
|
|
165
171
|
/* STABLE */
|
|
@@ -178,6 +184,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
178
184
|
size: __props.size,
|
|
179
185
|
disabled: __props.disabled,
|
|
180
186
|
class: vue.normalizeClass(__props.buttonClass),
|
|
187
|
+
isDot: __props.isDot,
|
|
181
188
|
onClick: ($event) => buttonChange(selectedData.value)
|
|
182
189
|
}, {
|
|
183
190
|
content: vue.withCtx(() => [
|
|
@@ -223,7 +230,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
223
230
|
]),
|
|
224
231
|
_: 1
|
|
225
232
|
/* STABLE */
|
|
226
|
-
}, 8, ["type", "size", "disabled", "class", "onClick"])
|
|
233
|
+
}, 8, ["type", "size", "disabled", "class", "isDot", "onClick"])
|
|
227
234
|
]),
|
|
228
235
|
default: vue.withCtx(() => [
|
|
229
236
|
vue.createElementVNode("ul", { class: "max-h-[500px] overflow-x-auto box-border" }, [
|
|
@@ -334,6 +334,26 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
334
334
|
active.value++;
|
|
335
335
|
}
|
|
336
336
|
return active.value;
|
|
337
|
+
},
|
|
338
|
+
async getOptions() {
|
|
339
|
+
if (tableRef.value) {
|
|
340
|
+
await tableRef.value.getOptions();
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
async getOptionsFields(keys) {
|
|
344
|
+
if (tableRef.value) {
|
|
345
|
+
await tableRef.value.getOptionsFields(keys);
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
async getOptionsError() {
|
|
349
|
+
if (tableRef.value) {
|
|
350
|
+
await tableRef.value.getOptionsError();
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
getOptionsByField(key) {
|
|
354
|
+
if (tableRef.value) {
|
|
355
|
+
return tableRef.value.getOptionsByField(key);
|
|
356
|
+
}
|
|
337
357
|
}
|
|
338
358
|
});
|
|
339
359
|
return (_ctx, _cache) => {
|
|
@@ -523,8 +543,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
523
543
|
columnNum: __props.columnNum,
|
|
524
544
|
size: __props.size,
|
|
525
545
|
showAddBtn: __props.showAddBtn,
|
|
546
|
+
class: "h-0 flex-1",
|
|
526
547
|
onTableDataChange: tableDataChange,
|
|
527
|
-
|
|
548
|
+
onOptionsStatus: _ctx.$attrs.onOptionsStatus
|
|
528
549
|
}), vue.createSlots({
|
|
529
550
|
_: 2
|
|
530
551
|
/* DYNAMIC */
|
|
@@ -537,7 +558,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
537
558
|
])
|
|
538
559
|
};
|
|
539
560
|
})
|
|
540
|
-
]), 1040, ["tableColumns", "formColumns", "onExpandRowChange", "rules", "rowClickExpand", "columnNum", "size", "showAddBtn"])
|
|
561
|
+
]), 1040, ["tableColumns", "formColumns", "onExpandRowChange", "rules", "rowClickExpand", "columnNum", "size", "showAddBtn", "onOptionsStatus"])
|
|
541
562
|
])) : vue.createCommentVNode("v-if", true),
|
|
542
563
|
submitting.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
543
564
|
key: 1,
|
|
@@ -75,15 +75,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
75
75
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
76
76
|
const props = __props;
|
|
77
77
|
const emits = __emit;
|
|
78
|
-
vue.onMounted(() => {
|
|
79
|
-
vue.watch(
|
|
80
|
-
() => dataSource.value,
|
|
81
|
-
() => {
|
|
82
|
-
emits("tableDataChange", dataSource.value);
|
|
83
|
-
},
|
|
84
|
-
{ deep: true, immediate: true }
|
|
85
|
-
);
|
|
86
|
-
});
|
|
87
78
|
const tableRef = vue.useTemplateRef("tableRef");
|
|
88
79
|
const formRef = vue.useTemplateRef("formRef");
|
|
89
80
|
const dataSource = vue.ref([]);
|
|
@@ -111,6 +102,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
111
102
|
]
|
|
112
103
|
});
|
|
113
104
|
const isExpandValidate = vue.ref(false);
|
|
105
|
+
const statistics = vue.ref({
|
|
106
|
+
success: 0,
|
|
107
|
+
failed: 0,
|
|
108
|
+
total: dataSource.value.length
|
|
109
|
+
});
|
|
114
110
|
const tableFormColumns = vue.computed(() => {
|
|
115
111
|
if (!props.tableColumns) return [];
|
|
116
112
|
return [...props.tableColumns, ...operatorColumn.value];
|
|
@@ -118,19 +114,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
118
114
|
const expandColumn = vue.computed(() => {
|
|
119
115
|
return props.tableColumns.find((item) => item.type === "expand");
|
|
120
116
|
});
|
|
121
|
-
const statistics = vue.computed(() => {
|
|
122
|
-
return dataSource.value.reduce(
|
|
123
|
-
({ success, failed, total }, data) => {
|
|
124
|
-
if (!data.errorMsg) {
|
|
125
|
-
success++;
|
|
126
|
-
} else {
|
|
127
|
-
failed++;
|
|
128
|
-
}
|
|
129
|
-
return { success, failed, total };
|
|
130
|
-
},
|
|
131
|
-
{ success: 0, failed: 0, total: dataSource.value.length }
|
|
132
|
-
);
|
|
133
|
-
});
|
|
134
117
|
function setData(dataSource2) {
|
|
135
118
|
if (!tableRef.value) return;
|
|
136
119
|
tableRef.value.setData(dataSource2);
|
|
@@ -192,7 +175,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
192
175
|
new Promise(async (resolve, reject) => {
|
|
193
176
|
try {
|
|
194
177
|
await index.doValidate(data, props.formColumns, props.rules);
|
|
195
|
-
|
|
178
|
+
if (!data.errorMsg) {
|
|
179
|
+
data.errorMsg = { prop: "", message: "" };
|
|
180
|
+
} else if (!data.errorMsg.prop) {
|
|
181
|
+
data.errorMsg.prop = data.errorMsg.prop;
|
|
182
|
+
data.errorMsg.message = data.errorMsg.message;
|
|
183
|
+
}
|
|
196
184
|
data.errorMap = /* @__PURE__ */ new Map();
|
|
197
185
|
resolve();
|
|
198
186
|
} catch (error) {
|
|
@@ -204,6 +192,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
204
192
|
};
|
|
205
193
|
if (!data.errorMsg) {
|
|
206
194
|
data.errorMsg = errData;
|
|
195
|
+
} else if (!data.errorMsg.prop && !data.errorMsg.message) {
|
|
196
|
+
data.errorMsg.prop = errData.errorMsg.prop;
|
|
197
|
+
data.errorMsg.message = errData.errorMsg.message;
|
|
207
198
|
}
|
|
208
199
|
errorMap.set(errData.prop, errData.message);
|
|
209
200
|
});
|
|
@@ -223,7 +214,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
223
214
|
}
|
|
224
215
|
try {
|
|
225
216
|
await index.doValidate(row, props.formColumns, props.rules);
|
|
226
|
-
row.errorMsg
|
|
217
|
+
if (!row.errorMsg) {
|
|
218
|
+
row.errorMsg = { prop: "", message: "" };
|
|
219
|
+
} else {
|
|
220
|
+
row.errorMsg.prop = "";
|
|
221
|
+
row.errorMsg.message = "";
|
|
222
|
+
}
|
|
227
223
|
row.errorMap = /* @__PURE__ */ new Map();
|
|
228
224
|
} catch (error) {
|
|
229
225
|
let errMsg = null;
|
|
@@ -239,7 +235,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
239
235
|
errorMap2.set(errData.prop, errData.message);
|
|
240
236
|
});
|
|
241
237
|
row.errorMap = errorMap2;
|
|
242
|
-
row.errorMsg
|
|
238
|
+
if (!row.errorMsg) {
|
|
239
|
+
row.errorMsg = { prop: "", message: "" };
|
|
240
|
+
} else {
|
|
241
|
+
row.errorMsg.prop = errMsg.prop;
|
|
242
|
+
row.errorMsg.message = errMsg.message;
|
|
243
|
+
}
|
|
243
244
|
}
|
|
244
245
|
const { onlyId, errorMsg, errorMap, children, ...data } = row;
|
|
245
246
|
emits("validate", {
|
|
@@ -250,6 +251,29 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
250
251
|
...statistics.value
|
|
251
252
|
});
|
|
252
253
|
}
|
|
254
|
+
vue.onMounted(() => {
|
|
255
|
+
vue.watch(
|
|
256
|
+
() => dataSource.value,
|
|
257
|
+
() => {
|
|
258
|
+
emits("tableDataChange", dataSource.value);
|
|
259
|
+
const { success, failed } = dataSource.value.reduce(
|
|
260
|
+
({ success: success2, failed: failed2 }, data) => {
|
|
261
|
+
if (!data.errorMsg) {
|
|
262
|
+
success2++;
|
|
263
|
+
} else {
|
|
264
|
+
failed2++;
|
|
265
|
+
}
|
|
266
|
+
return { success: success2, failed: failed2 };
|
|
267
|
+
},
|
|
268
|
+
{ success: 0, failed: 0 }
|
|
269
|
+
);
|
|
270
|
+
statistics.value.success = success;
|
|
271
|
+
statistics.value.failed = failed;
|
|
272
|
+
statistics.value.total = dataSource.value.length;
|
|
273
|
+
},
|
|
274
|
+
{ deep: true, immediate: true }
|
|
275
|
+
);
|
|
276
|
+
});
|
|
253
277
|
__expose({
|
|
254
278
|
setData(data) {
|
|
255
279
|
dataSource.value = handler.cloneDeep(data, true);
|
|
@@ -297,6 +321,26 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
297
321
|
...statistics.value,
|
|
298
322
|
dataSource: dataSource.value
|
|
299
323
|
};
|
|
324
|
+
},
|
|
325
|
+
async getOptions() {
|
|
326
|
+
if (formRef.value) {
|
|
327
|
+
await formRef.value.getOptions();
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
async getOptionsFields(keys) {
|
|
331
|
+
if (formRef.value) {
|
|
332
|
+
await formRef.value.getOptionsFields(keys);
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
async getOptionsError() {
|
|
336
|
+
if (formRef.value) {
|
|
337
|
+
await formRef.value.getOptionsError();
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
getOptionsByField(key) {
|
|
341
|
+
if (formRef.value) {
|
|
342
|
+
return formRef.value.getOptionsByField(key);
|
|
343
|
+
}
|
|
300
344
|
}
|
|
301
345
|
});
|
|
302
346
|
return (_ctx, _cache) => {
|
|
@@ -441,17 +485,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
441
485
|
fn: vue.withCtx(({ row }) => [
|
|
442
486
|
vue.createElementVNode("div", { class: "w-full pl-[52px] pr-[62px] pb-2" }, [
|
|
443
487
|
vue.createElementVNode("div", { class: "h-[32px]" }, [
|
|
444
|
-
vue.createElementVNode(
|
|
488
|
+
vue.withDirectives(vue.createElementVNode(
|
|
445
489
|
"div",
|
|
446
490
|
{
|
|
447
491
|
class: vue.normalizeClass(["flex items-center gap-1.5 text-danger-2 transition-all duration-300 overflow-hidden", [row.errorMsg ? "h-full" : "h-0"]])
|
|
448
492
|
},
|
|
449
493
|
[
|
|
450
|
-
|
|
451
|
-
key: 0,
|
|
494
|
+
vue.createVNode(vue.unref(index$3.HyIcon), {
|
|
452
495
|
"svg-name": "dispatch-share1-prompt",
|
|
453
496
|
class: "!w-3 !h-3"
|
|
454
|
-
})
|
|
497
|
+
}),
|
|
455
498
|
vue.createElementVNode(
|
|
456
499
|
"span",
|
|
457
500
|
null,
|
|
@@ -462,7 +505,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
462
505
|
],
|
|
463
506
|
2
|
|
464
507
|
/* CLASS */
|
|
465
|
-
)
|
|
508
|
+
), [
|
|
509
|
+
[vue.vShow, row.errorMsg.message]
|
|
510
|
+
])
|
|
466
511
|
]),
|
|
467
512
|
vue.createVNode(vue.unref(index$4.HyForm), {
|
|
468
513
|
ref_key: "formRef",
|
|
@@ -474,7 +519,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
474
519
|
class: "px-0",
|
|
475
520
|
columnNum: __props.columnNum,
|
|
476
521
|
size: __props.size,
|
|
477
|
-
onValidate: (prop, isValid, message) => onValidateHandler(row, { prop, isValid, message })
|
|
522
|
+
onValidate: (prop, isValid, message) => onValidateHandler(row, { prop, isValid, message }),
|
|
523
|
+
onOptionsStatus: _ctx.$attrs.onOptionsStatus
|
|
478
524
|
}, vue.createSlots({
|
|
479
525
|
_: 2
|
|
480
526
|
/* DYNAMIC */
|
|
@@ -487,7 +533,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
487
533
|
])
|
|
488
534
|
};
|
|
489
535
|
})
|
|
490
|
-
]), 1032, ["model", "columns", "rules", "columnNum", "size", "onValidate"])
|
|
536
|
+
]), 1032, ["model", "columns", "rules", "columnNum", "size", "onValidate", "onOptionsStatus"])
|
|
491
537
|
])
|
|
492
538
|
]),
|
|
493
539
|
key: "0"
|