hy-dispatch-ui-v3 0.2.68 → 0.2.70
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/es/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.mjs +12 -3
- package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.mjs +6 -8
- package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.mjs +1 -5
- package/es/bussiness/hyElectronicFence/index.mjs +4 -4
- package/es/bussiness/hyElectronicFence/style/electronicFenceAssociatedUsersDialog.scss +25 -0
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +11 -2
- package/es/components/hyForm/cpns/formItem.vue.mjs +11 -3
- package/es/components/hyForm/form.vue.mjs +7 -5
- package/es/components/hyForm/js/useAppForm.mjs +2 -1
- package/es/components/hySearch/js/useAppSearch.mjs +1 -0
- package/es/components/hyTableForm/batchTableForm.vue.mjs +10 -2
- package/es/components/hyTableForm/js/index.mjs +1 -3
- package/es/components/hyTableForm/tableForm.vue.mjs +1 -1
- package/es/locale/en_US.mjs +2 -1
- package/es/locale/zh_CN.mjs +2 -1
- package/es/utils/form.mjs +12 -2
- package/es/version.mjs +1 -1
- package/lib/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.js +11 -2
- package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.js +4 -6
- package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.js +1 -5
- package/lib/bussiness/hyElectronicFence/style/electronicFenceAssociatedUsersDialog.scss +25 -0
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +11 -2
- package/lib/components/hyForm/cpns/formItem.vue.js +10 -2
- package/lib/components/hyForm/form.vue.js +7 -5
- package/lib/components/hyForm/js/useAppForm.js +2 -1
- package/lib/components/hySearch/js/useAppSearch.js +1 -0
- package/lib/components/hyTableForm/batchTableForm.vue.js +10 -2
- package/lib/components/hyTableForm/js/index.js +1 -3
- package/lib/components/hyTableForm/tableForm.vue.js +1 -1
- package/lib/locale/en_US.js +2 -1
- package/lib/locale/zh_CN.js +2 -1
- package/lib/utils/form.js +11 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { useCurrentBus } from '../../../../hooks/useCurrentBus.mjs';
|
|
|
6
6
|
import { useAppTableForm } from '../../../../components/hyTableForm/js/useAppTableForm.mjs';
|
|
7
7
|
import { $t } from '../../../../hooks/useLocale.mjs';
|
|
8
8
|
import { useMixins } from '../../../../hooks/useMixins.mjs';
|
|
9
|
-
import { useDialog, useDialogIsEdit } from '../../../../hooks/useDialog.mjs';
|
|
9
|
+
import { useDialog, useDialogIsEdit, useBatchDialog } from '../../../../hooks/useDialog.mjs';
|
|
10
10
|
import { HyBatchUploadDialog } from '../../../../components/hyBatchUploadDialog/index.mjs';
|
|
11
11
|
|
|
12
12
|
const _sfc_main = {
|
|
@@ -90,6 +90,7 @@ const _sfc_main = {
|
|
|
90
90
|
});
|
|
91
91
|
const rules2 = ref({});
|
|
92
92
|
async function show2() {
|
|
93
|
+
await hy.watchPause();
|
|
93
94
|
hy.setDragLevelIndex("HyBatchUploadDialogRef");
|
|
94
95
|
HyBatchUploadDialogRef2.value.show();
|
|
95
96
|
}
|
|
@@ -99,6 +100,7 @@ const _sfc_main = {
|
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
function onSubmit2(params) {
|
|
103
|
+
hy.uploadProgress(params);
|
|
102
104
|
const { total, success, failed, result } = params;
|
|
103
105
|
if (success) {
|
|
104
106
|
hy.currentBus.value.emit("batchSetElectronicFenceUserDialog", {
|
|
@@ -120,8 +122,10 @@ const _sfc_main = {
|
|
|
120
122
|
};
|
|
121
123
|
}
|
|
122
124
|
const {
|
|
125
|
+
setIsEdit,
|
|
123
126
|
setDragLevelIndex,
|
|
124
127
|
minimizedShow,
|
|
128
|
+
onClose,
|
|
125
129
|
onMinimized,
|
|
126
130
|
HyBatchUploadDialogRef,
|
|
127
131
|
tableColumns,
|
|
@@ -130,9 +134,10 @@ const _sfc_main = {
|
|
|
130
134
|
show,
|
|
131
135
|
submitHandler,
|
|
132
136
|
onSubmit
|
|
133
|
-
} = useMixins({ currentBus }, [useDialog, useDialogIsEdit, useBatchSetElectronicFenceUserDialog]);
|
|
137
|
+
} = useMixins({ currentBus }, [useDialog, useDialogIsEdit, useBatchDialog, useBatchSetElectronicFenceUserDialog]);
|
|
134
138
|
__expose({
|
|
135
139
|
show,
|
|
140
|
+
setIsEdit,
|
|
136
141
|
minimizedShow,
|
|
137
142
|
setDragLevelIndex
|
|
138
143
|
});
|
|
@@ -151,7 +156,11 @@ const _sfc_main = {
|
|
|
151
156
|
"show-operate": true,
|
|
152
157
|
"if-draggable": __props.ifDraggable,
|
|
153
158
|
"if-shrink": __props.ifShrink,
|
|
159
|
+
"on-cancel": unref(onClose),
|
|
160
|
+
"on-close": unref(onClose),
|
|
154
161
|
onSubmit: unref(onSubmit),
|
|
162
|
+
onSubmitProgress: _ctx.onSubmitProgress,
|
|
163
|
+
onTableDataChange: _ctx.onTableDataChange,
|
|
155
164
|
onOnMinimized: unref(onMinimized),
|
|
156
165
|
onOnDialogMousedown: ($event) => unref(setDragLevelIndex)("HyBatchUploadDialogRef")
|
|
157
166
|
}, {
|
|
@@ -161,7 +170,7 @@ const _sfc_main = {
|
|
|
161
170
|
]),
|
|
162
171
|
_: 1
|
|
163
172
|
/* STABLE */
|
|
164
|
-
}, 8, ["title", "table-columns", "form-columns", "rules", "submit-handler", "if-draggable", "if-shrink", "onSubmit", "onOnMinimized", "onOnDialogMousedown"]);
|
|
173
|
+
}, 8, ["title", "table-columns", "form-columns", "rules", "submit-handler", "if-draggable", "if-shrink", "on-cancel", "on-close", "onSubmit", "onSubmitProgress", "onTableDataChange", "onOnMinimized", "onOnDialogMousedown"]);
|
|
165
174
|
};
|
|
166
175
|
}
|
|
167
176
|
};
|
|
@@ -5,8 +5,7 @@ import { saveFnApi, findAllApi } from '../../../../api/index.mjs';
|
|
|
5
5
|
import { orgTreeApi } from '../../../../api/organization.mjs';
|
|
6
6
|
import '../../../../hooks/index.mjs';
|
|
7
7
|
import '../../../../components/index.mjs';
|
|
8
|
-
import
|
|
9
|
-
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
8
|
+
import _sfc_main$1 from './electronicFenceAssociatedUsersItem.vue.mjs';
|
|
10
9
|
import { $t } from '../../../../hooks/useLocale.mjs';
|
|
11
10
|
import { useMixins } from '../../../../hooks/useMixins.mjs';
|
|
12
11
|
import { useDialog } from '../../../../hooks/useDialog.mjs';
|
|
@@ -16,6 +15,8 @@ import { HyButton } from '../../../../components/hyButton/index.mjs';
|
|
|
16
15
|
import { HyInputSearch } from '../../../../components/hyInput/index.mjs';
|
|
17
16
|
import { HyIcon } from '../../../../components/hyIcon/index.mjs';
|
|
18
17
|
|
|
18
|
+
import "../../style/electronicFenceAssociatedUsersDialog.scss";
|
|
19
|
+
|
|
19
20
|
const __default__ = defineComponent({
|
|
20
21
|
name: "HyElectronicFenceAssociatedUsersDialog"
|
|
21
22
|
});
|
|
@@ -202,7 +203,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
202
203
|
onOnDialogMousedown: ($event) => unref(setDragLevelIndex)("HyDialogRef")
|
|
203
204
|
}, {
|
|
204
205
|
default: withCtx(() => [
|
|
205
|
-
createElementVNode("div", { class: "flex w-full h-full" }, [
|
|
206
|
+
createElementVNode("div", { class: "hy-electronic-fence-associated-users-dialog flex w-full h-full" }, [
|
|
206
207
|
createElementVNode("div", { class: "w-1/2 h-full flex flex-col mr-5 text-xs" }, [
|
|
207
208
|
createElementVNode("div", { class: "tree-box h-0 flex-1 flex flex-col box-border pb-2" }, [
|
|
208
209
|
createVNode(unref(ElAutoResizer), null, {
|
|
@@ -279,7 +280,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
279
280
|
class: "w-full h-0 flex-1 border-t border-border overflow-auto box-border",
|
|
280
281
|
"data-key": "id",
|
|
281
282
|
"data-sources": unref(filterSelectedList),
|
|
282
|
-
"data-component":
|
|
283
|
+
"data-component": _sfc_main$1,
|
|
283
284
|
keeps: 30,
|
|
284
285
|
"estimate-size": 34,
|
|
285
286
|
"extra-props": {
|
|
@@ -311,8 +312,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
311
312
|
};
|
|
312
313
|
}
|
|
313
314
|
});
|
|
314
|
-
import "/data/jenkins-work/workspace/WEB-V3-PROJECT-Web-hy-dispatch-ui@2/tmp/packages/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue?vue&type=style&index=0&scoped=bc2c260d&lang.scss";
|
|
315
|
-
|
|
316
|
-
var electronicFenceAssociatedUsersDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bc2c260d"]]);
|
|
317
315
|
|
|
318
|
-
export {
|
|
316
|
+
export { _sfc_main as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, createElementBlock, createCommentVNode } from 'vue';
|
|
2
2
|
import '../../../../hooks/index.mjs';
|
|
3
3
|
import '../../../../components/index.mjs';
|
|
4
|
-
import _export_sfc from '../../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
5
4
|
import { HyTooltip } from '../../../../components/hyTooltip/index.mjs';
|
|
6
5
|
import { HyIcon } from '../../../../components/hyIcon/index.mjs';
|
|
7
6
|
import { $t } from '../../../../hooks/useLocale.mjs';
|
|
@@ -116,8 +115,5 @@ const _sfc_main = {
|
|
|
116
115
|
};
|
|
117
116
|
}
|
|
118
117
|
};
|
|
119
|
-
import "/data/jenkins-work/workspace/WEB-V3-PROJECT-Web-hy-dispatch-ui@2/tmp/packages/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue?vue&type=style&index=0&scoped=788f720f&lang.scss";
|
|
120
118
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
export { ElectronicFenceAssociatedUsersItem as default };
|
|
119
|
+
export { _sfc_main as default };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
2
|
import _sfc_main from './electronicFence.vue.mjs';
|
|
3
3
|
import _sfc_main$1 from './cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.mjs';
|
|
4
|
-
import
|
|
5
|
-
import _sfc_main$
|
|
4
|
+
import _sfc_main$2 from './cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.mjs';
|
|
5
|
+
import _sfc_main$3 from './cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.mjs';
|
|
6
6
|
import { withInstall } from '../../utils/handler.mjs';
|
|
7
7
|
|
|
8
8
|
const HyElectronicFence = withInstall(_sfc_main);
|
|
9
9
|
const HyAddElectronicFenceDialog = withInstall(_sfc_main$1);
|
|
10
|
-
const HyElectronicFenceAssociatedUsersDialog = withInstall(
|
|
11
|
-
const HyBatchSetElectronicFenceUserDialog = withInstall(_sfc_main$
|
|
10
|
+
const HyElectronicFenceAssociatedUsersDialog = withInstall(_sfc_main$2);
|
|
11
|
+
const HyBatchSetElectronicFenceUserDialog = withInstall(_sfc_main$3);
|
|
12
12
|
|
|
13
13
|
export { HyAddElectronicFenceDialog, HyBatchSetElectronicFenceUserDialog, HyElectronicFence, HyElectronicFenceAssociatedUsersDialog, HyElectronicFence as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.hy-electronic-fence-associated-users-dialog {
|
|
2
|
+
.tree-box {
|
|
3
|
+
border: 1px solid rgba(var(--hy-border));
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
box-shadow:
|
|
6
|
+
0px 2px 4px 0px rgba(0, 0, 0, 0.5),
|
|
7
|
+
inset 0px 0px 10px 0px #1f4b77;
|
|
8
|
+
backdrop-filter: blur(5px);
|
|
9
|
+
}
|
|
10
|
+
li {
|
|
11
|
+
&:hover {
|
|
12
|
+
box-shadow:
|
|
13
|
+
inset 0px 0px 50px 0px rgba(var(--hy-theme), 0.2),
|
|
14
|
+
inset 0px 0px 0px 1px rgba(var(--hy-theme), 0.5);
|
|
15
|
+
.delete {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.delete {
|
|
20
|
+
transition: 1s;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
color: rgba(var(--hy-danger-2));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -92,6 +92,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
92
92
|
showAddBtn: {
|
|
93
93
|
type: Boolean,
|
|
94
94
|
default: true
|
|
95
|
+
},
|
|
96
|
+
// 提交数据之前处理
|
|
97
|
+
beforeSubmitHandler: {
|
|
98
|
+
type: Function
|
|
95
99
|
}
|
|
96
100
|
}, {
|
|
97
101
|
"modelValue": { type: Boolean, default: false },
|
|
@@ -186,8 +190,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
186
190
|
batchTableFormRef.value.nextStep();
|
|
187
191
|
}
|
|
188
192
|
async function onSubmitHandler() {
|
|
189
|
-
|
|
193
|
+
let res = batchTableFormRef.value.validate();
|
|
190
194
|
if (props.uploadType === "custom") {
|
|
195
|
+
if (res.total === res.success && props.beforeSubmitHandler) {
|
|
196
|
+
await props.beforeSubmitHandler(res.dataSource);
|
|
197
|
+
res = batchTableFormRef.value.validate();
|
|
198
|
+
}
|
|
191
199
|
const dataSource = batchTableFormRef.value.getTableDataSource();
|
|
192
200
|
onTableSubmitHandler({
|
|
193
201
|
...res,
|
|
@@ -361,6 +369,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
361
369
|
onExpandRowChange: __props.onExpandRowChange,
|
|
362
370
|
"submit-handler": __props.submitHandler,
|
|
363
371
|
showAddBtn: __props.showAddBtn,
|
|
372
|
+
beforeSubmitHandler: __props.beforeSubmitHandler,
|
|
364
373
|
onTableDataChange: tableDataChange,
|
|
365
374
|
onUploading: onTableUploadingHandler,
|
|
366
375
|
onUploaded: onTableUploadedHandler,
|
|
@@ -382,7 +391,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
382
391
|
])
|
|
383
392
|
};
|
|
384
393
|
})
|
|
385
|
-
]), 1032, ["step", "onUpdate:step", "tableColumns", "formColumns", "rules", "emptyText", "fontSize", "rowClickExpand", "columnNum", "size", "beforeDataHandle", "beforeDataListHandle", "onExpandRowChange", "submit-handler", "showAddBtn", "onOptionsStatus"])) : createCommentVNode("v-if", true)
|
|
394
|
+
]), 1032, ["step", "onUpdate:step", "tableColumns", "formColumns", "rules", "emptyText", "fontSize", "rowClickExpand", "columnNum", "size", "beforeDataHandle", "beforeDataListHandle", "onExpandRowChange", "submit-handler", "showAddBtn", "beforeSubmitHandler", "onOptionsStatus"])) : createCommentVNode("v-if", true)
|
|
386
395
|
])
|
|
387
396
|
])
|
|
388
397
|
]),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, useTemplateRef, computed, reactive, toRefs, onMounted, watch, onBeforeUnmount,
|
|
1
|
+
import { inject, useTemplateRef, computed, unref, reactive, toRefs, onMounted, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createSlots, withCtx, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, Fragment, mergeProps } from 'vue';
|
|
2
2
|
import { ElFormItem, ElSelect, ElIcon, ElSelectV2, ElRadioGroup, ElCheckboxGroup, ElSwitch, ElInputNumber, ElCascader } from 'element-plus';
|
|
3
3
|
import { Loading } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../../utils/index.mjs';
|
|
@@ -111,8 +111,16 @@ const _sfc_main = {
|
|
|
111
111
|
};
|
|
112
112
|
});
|
|
113
113
|
const columnAttrs = computed(() => {
|
|
114
|
+
const attrs = props.column.attrs || {};
|
|
115
|
+
const config = {};
|
|
116
|
+
if (props.column.type === "input") {
|
|
117
|
+
if (attrs.type === "text" && unref(formContext.business) !== "tableForm") {
|
|
118
|
+
config.maxlength = 255;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
114
121
|
return {
|
|
115
|
-
...
|
|
122
|
+
...config,
|
|
123
|
+
...attrs,
|
|
116
124
|
label: columnLabelHandler(props.column, props.model),
|
|
117
125
|
placeholder: columnPlaceholderHandler(props.column, props.model)
|
|
118
126
|
};
|
|
@@ -181,7 +189,7 @@ const _sfc_main = {
|
|
|
181
189
|
if (!isRequired(props, column) && formItemRef.value) {
|
|
182
190
|
formItemRef.value.clearValidate();
|
|
183
191
|
}
|
|
184
|
-
return columnRuleHandler(column, model);
|
|
192
|
+
return columnRuleHandler(column, model, { business: unref(formContext.business) });
|
|
185
193
|
}
|
|
186
194
|
function onChangeHandler() {
|
|
187
195
|
const { onChange } = props.column;
|
|
@@ -55,9 +55,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
55
55
|
type: Boolean,
|
|
56
56
|
default: true
|
|
57
57
|
},
|
|
58
|
-
|
|
59
|
-
type:
|
|
60
|
-
default:
|
|
58
|
+
business: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "default"
|
|
61
|
+
// default-默认 tableForm-表格表单
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
64
|
emits: ["on-allMapSelect", "complete", "optionsStatus"],
|
|
@@ -82,6 +83,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
82
83
|
gridTemplateColumns: `repeat(${columnNum}, minmax(0, 1fr))`
|
|
83
84
|
};
|
|
84
85
|
});
|
|
86
|
+
const isTableForm = computed(() => props.business === "tableForm");
|
|
85
87
|
const locationSelectRef = useTemplateRef("locationSelectRef");
|
|
86
88
|
const allMapSelect = ref(false);
|
|
87
89
|
function setMapSize() {
|
|
@@ -305,7 +307,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
305
307
|
{ key: 2 },
|
|
306
308
|
[
|
|
307
309
|
createCommentVNode(" \u8868\u5355\u6570\u7EC4 "),
|
|
308
|
-
!
|
|
310
|
+
!isTableForm.value && unref(columnShowHandler)(props, column) ? (openBlock(), createBlock(_sfc_main$2, {
|
|
309
311
|
key: 0,
|
|
310
312
|
class: normalizeClass([allMapSelect.value ? "hidden" : ""]),
|
|
311
313
|
model: __props.model,
|
|
@@ -329,7 +331,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
329
331
|
])
|
|
330
332
|
};
|
|
331
333
|
})
|
|
332
|
-
]), 1032, ["class", "model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style"])) :
|
|
334
|
+
]), 1032, ["class", "model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style"])) : isTableForm.value && unref(columnShowHandler)(props, column) ? (openBlock(), createBlock(_sfc_main$3, {
|
|
333
335
|
key: 1,
|
|
334
336
|
class: normalizeClass([allMapSelect.value ? "hidden" : ""]),
|
|
335
337
|
model: __props.model,
|
|
@@ -77,6 +77,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
77
77
|
// 外部整体数据处理
|
|
78
78
|
beforeDataListHandle: {
|
|
79
79
|
type: Function
|
|
80
|
+
},
|
|
81
|
+
// 提交数据之前处理
|
|
82
|
+
beforeSubmitHandler: {
|
|
83
|
+
type: Function
|
|
80
84
|
}
|
|
81
85
|
}, {
|
|
82
86
|
"step": { type: Number, default: 1 },
|
|
@@ -252,9 +256,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
252
256
|
emits("submitting");
|
|
253
257
|
for (let i = 0; i <= dataSource.length - 1; i++) {
|
|
254
258
|
const target = dataSource[i];
|
|
255
|
-
|
|
259
|
+
let { onlyId, errorMsg, errorMap, children, ...data } = target;
|
|
256
260
|
setSubmitProgress(Math.floor((i + 1) / total * 100));
|
|
257
|
-
if (errorMsg) {
|
|
261
|
+
if (!errorMsg && props.beforeSubmitHandler) {
|
|
262
|
+
await props.beforeSubmitHandler([data]);
|
|
263
|
+
errorMsg = data.errorMsg;
|
|
264
|
+
}
|
|
265
|
+
if (errorMsg && errorMsg.message) {
|
|
258
266
|
continue;
|
|
259
267
|
}
|
|
260
268
|
try {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import XLSX from 'xlsx';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import 'vue';
|
|
4
3
|
import AsyncValidator from 'async-validator';
|
|
5
4
|
import { ElMessage } from 'element-plus';
|
|
6
5
|
import { columnShowHandler } from '../../hyForm/js/index.mjs';
|
|
7
6
|
import '../../../utils/index.mjs';
|
|
8
|
-
import '../../../hooks/index.mjs';
|
|
9
7
|
import { columnRuleHandler, setValueByProp, getValueByProp } from '../../../utils/form.mjs';
|
|
10
8
|
import { isArray } from '../../../utils/is.mjs';
|
|
11
9
|
|
|
@@ -15,7 +13,7 @@ const doValidate = async (target = {}, columns = [], ruleList = {}) => {
|
|
|
15
13
|
const columnMap = (columns || []).reduce((columnMap2, column) => {
|
|
16
14
|
if (columnShowHandler({ model: data }, column)) {
|
|
17
15
|
columnMap2[column.prop] = column;
|
|
18
|
-
rules[column.prop] = columnRuleHandler(column, target);
|
|
16
|
+
rules[column.prop] = columnRuleHandler(column, target, { business: "tableForm" });
|
|
19
17
|
setValueByProp(data, column.prop, getValueByProp(target, column.prop));
|
|
20
18
|
}
|
|
21
19
|
return columnMap2;
|
|
@@ -554,7 +554,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
554
554
|
class: "px-0",
|
|
555
555
|
columnNum: __props.columnNum,
|
|
556
556
|
size: __props.size,
|
|
557
|
-
|
|
557
|
+
business: "tableForm",
|
|
558
558
|
onValidate: (prop, isValid, message) => onValidateHandler(row, { prop, isValid, message }),
|
|
559
559
|
onOptionsStatus: _ctx.$attrs.onOptionsStatus
|
|
560
560
|
}, createSlots({
|
package/es/locale/en_US.mjs
CHANGED
|
@@ -34,7 +34,8 @@ var en_US = {
|
|
|
34
34
|
additionalInformationTip: "Editor's Supplementary Information (Optional)",
|
|
35
35
|
additionalInformationHoverTip: "Click To Expand And View More Detailed Information. (This Is An Optional Field)",
|
|
36
36
|
dynamicFormItem: "Dynamic Form Item",
|
|
37
|
-
addFormItem: "Add Form Item"
|
|
37
|
+
addFormItem: "Add Form Item",
|
|
38
|
+
characterLimit: "{0} should be limited to {1} characters or fewer"
|
|
38
39
|
},
|
|
39
40
|
table: {
|
|
40
41
|
hideFilter: "Hide filter",
|
package/es/locale/zh_CN.mjs
CHANGED
|
@@ -35,7 +35,8 @@ var zh_CN = {
|
|
|
35
35
|
additionalInformationTip: "\u7F16\u8F91\u8865\u5145\u4FE1\u606F (\u9009\u586B)",
|
|
36
36
|
additionalInformationHoverTip: "\u70B9\u51FB\u53EF\u5C55\u5F00\u8865\u5145\u66F4\u591A\u4FE1\u606F\uFF0C\u975E\u5FC5\u586B\u9879",
|
|
37
37
|
dynamicFormItem: "\u52A8\u6001\u8868\u5355\u9879",
|
|
38
|
-
addFormItem: "\u6DFB\u52A0\u8868\u5355\u9879"
|
|
38
|
+
addFormItem: "\u6DFB\u52A0\u8868\u5355\u9879",
|
|
39
|
+
characterLimit: "{0}\u9650\u5236\u5728{1}\u4F4D\u5B57\u7B26\u4EE5\u5185"
|
|
39
40
|
},
|
|
40
41
|
table: {
|
|
41
42
|
hideFilter: "\u9690\u85CF\u7B5B\u9009\u5668",
|
package/es/utils/form.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unref } from 'vue';
|
|
2
2
|
import '../hooks/index.mjs';
|
|
3
|
-
import { isString, isArray, isBoolean, isFunction, isObject, isEmpty } from './is.mjs';
|
|
3
|
+
import { isString, isArray, isBoolean, isFunction, isObject, isNumber, isEmpty } from './is.mjs';
|
|
4
4
|
import { $t } from '../hooks/useLocale.mjs';
|
|
5
5
|
|
|
6
6
|
function getValueByProp(model, prop) {
|
|
@@ -83,7 +83,7 @@ const ruleHandler = (column, model) => {
|
|
|
83
83
|
}
|
|
84
84
|
return [];
|
|
85
85
|
};
|
|
86
|
-
const columnRuleHandler = (column, model) => {
|
|
86
|
+
const columnRuleHandler = (column, model, config) => {
|
|
87
87
|
const rules = ruleHandler(column, model);
|
|
88
88
|
if (column.required) {
|
|
89
89
|
rules.unshift({
|
|
@@ -91,6 +91,16 @@ const columnRuleHandler = (column, model) => {
|
|
|
91
91
|
message: genRuleRequiredMsgHandler(column, model)
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
+
if (config && config.business === "tableForm") {
|
|
95
|
+
if (column.type === "input" && column.attrs.type === "text") {
|
|
96
|
+
if (!rules.some((item) => isNumber(item.max))) {
|
|
97
|
+
rules.push({
|
|
98
|
+
max: 255,
|
|
99
|
+
message: $t("form.characterLimit", [columnLabelHandler(column, model), 255])
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
94
104
|
return rules;
|
|
95
105
|
};
|
|
96
106
|
const genColumnDefaultLabel = (column) => {
|
package/es/version.mjs
CHANGED
|
@@ -94,6 +94,7 @@ const _sfc_main = {
|
|
|
94
94
|
});
|
|
95
95
|
const rules2 = vue.ref({});
|
|
96
96
|
async function show2() {
|
|
97
|
+
await hy.watchPause();
|
|
97
98
|
hy.setDragLevelIndex("HyBatchUploadDialogRef");
|
|
98
99
|
HyBatchUploadDialogRef2.value.show();
|
|
99
100
|
}
|
|
@@ -103,6 +104,7 @@ const _sfc_main = {
|
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
function onSubmit2(params) {
|
|
107
|
+
hy.uploadProgress(params);
|
|
106
108
|
const { total, success, failed, result } = params;
|
|
107
109
|
if (success) {
|
|
108
110
|
hy.currentBus.value.emit("batchSetElectronicFenceUserDialog", {
|
|
@@ -124,8 +126,10 @@ const _sfc_main = {
|
|
|
124
126
|
};
|
|
125
127
|
}
|
|
126
128
|
const {
|
|
129
|
+
setIsEdit,
|
|
127
130
|
setDragLevelIndex,
|
|
128
131
|
minimizedShow,
|
|
132
|
+
onClose,
|
|
129
133
|
onMinimized,
|
|
130
134
|
HyBatchUploadDialogRef,
|
|
131
135
|
tableColumns,
|
|
@@ -134,9 +138,10 @@ const _sfc_main = {
|
|
|
134
138
|
show,
|
|
135
139
|
submitHandler,
|
|
136
140
|
onSubmit
|
|
137
|
-
} = useMixins.useMixins({ currentBus }, [useDialog.useDialog, useDialog.useDialogIsEdit, useBatchSetElectronicFenceUserDialog]);
|
|
141
|
+
} = useMixins.useMixins({ currentBus }, [useDialog.useDialog, useDialog.useDialogIsEdit, useDialog.useBatchDialog, useBatchSetElectronicFenceUserDialog]);
|
|
138
142
|
__expose({
|
|
139
143
|
show,
|
|
144
|
+
setIsEdit,
|
|
140
145
|
minimizedShow,
|
|
141
146
|
setDragLevelIndex
|
|
142
147
|
});
|
|
@@ -155,7 +160,11 @@ const _sfc_main = {
|
|
|
155
160
|
"show-operate": true,
|
|
156
161
|
"if-draggable": __props.ifDraggable,
|
|
157
162
|
"if-shrink": __props.ifShrink,
|
|
163
|
+
"on-cancel": vue.unref(onClose),
|
|
164
|
+
"on-close": vue.unref(onClose),
|
|
158
165
|
onSubmit: vue.unref(onSubmit),
|
|
166
|
+
onSubmitProgress: _ctx.onSubmitProgress,
|
|
167
|
+
onTableDataChange: _ctx.onTableDataChange,
|
|
159
168
|
onOnMinimized: vue.unref(onMinimized),
|
|
160
169
|
onOnDialogMousedown: ($event) => vue.unref(setDragLevelIndex)("HyBatchUploadDialogRef")
|
|
161
170
|
}, {
|
|
@@ -165,7 +174,7 @@ const _sfc_main = {
|
|
|
165
174
|
]),
|
|
166
175
|
_: 1
|
|
167
176
|
/* STABLE */
|
|
168
|
-
}, 8, ["title", "table-columns", "form-columns", "rules", "submit-handler", "if-draggable", "if-shrink", "onSubmit", "onOnMinimized", "onOnDialogMousedown"]);
|
|
177
|
+
}, 8, ["title", "table-columns", "form-columns", "rules", "submit-handler", "if-draggable", "if-shrink", "on-cancel", "on-close", "onSubmit", "onSubmitProgress", "onTableDataChange", "onOnMinimized", "onOnDialogMousedown"]);
|
|
169
178
|
};
|
|
170
179
|
}
|
|
171
180
|
};
|
|
@@ -10,7 +10,6 @@ var organization = require('../../../../api/organization.js');
|
|
|
10
10
|
require('../../../../hooks/index.js');
|
|
11
11
|
require('../../../../components/index.js');
|
|
12
12
|
var electronicFenceAssociatedUsersItem = require('./electronicFenceAssociatedUsersItem.vue.js');
|
|
13
|
-
var _pluginVue_exportHelper = require('../../../../_virtual/_plugin-vue_export-helper.js');
|
|
14
13
|
var useLocale = require('../../../../hooks/useLocale.js');
|
|
15
14
|
var useMixins = require('../../../../hooks/useMixins.js');
|
|
16
15
|
var useDialog = require('../../../../hooks/useDialog.js');
|
|
@@ -20,6 +19,8 @@ var index$3 = require('../../../../components/hyButton/index.js');
|
|
|
20
19
|
var index$4 = require('../../../../components/hyInput/index.js');
|
|
21
20
|
var index$5 = require('../../../../components/hyIcon/index.js');
|
|
22
21
|
|
|
22
|
+
import "../../style/electronicFenceAssociatedUsersDialog.scss";
|
|
23
|
+
|
|
23
24
|
const __default__ = vue.defineComponent({
|
|
24
25
|
name: "HyElectronicFenceAssociatedUsersDialog"
|
|
25
26
|
});
|
|
@@ -206,7 +207,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
206
207
|
onOnDialogMousedown: ($event) => vue.unref(setDragLevelIndex)("HyDialogRef")
|
|
207
208
|
}, {
|
|
208
209
|
default: vue.withCtx(() => [
|
|
209
|
-
vue.createElementVNode("div", { class: "flex w-full h-full" }, [
|
|
210
|
+
vue.createElementVNode("div", { class: "hy-electronic-fence-associated-users-dialog flex w-full h-full" }, [
|
|
210
211
|
vue.createElementVNode("div", { class: "w-1/2 h-full flex flex-col mr-5 text-xs" }, [
|
|
211
212
|
vue.createElementVNode("div", { class: "tree-box h-0 flex-1 flex flex-col box-border pb-2" }, [
|
|
212
213
|
vue.createVNode(vue.unref(elementPlus.ElAutoResizer), null, {
|
|
@@ -315,8 +316,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
315
316
|
};
|
|
316
317
|
}
|
|
317
318
|
});
|
|
318
|
-
import "/data/jenkins-work/workspace/WEB-V3-PROJECT-Web-hy-dispatch-ui@2/tmp/packages/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue?vue&type=style&index=0&scoped=bc2c260d&lang.scss";
|
|
319
|
-
|
|
320
|
-
var electronicFenceAssociatedUsersDialog = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-bc2c260d"]]);
|
|
321
319
|
|
|
322
|
-
exports.default =
|
|
320
|
+
exports.default = _sfc_main;
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
require('../../../../hooks/index.js');
|
|
7
7
|
require('../../../../components/index.js');
|
|
8
|
-
var _pluginVue_exportHelper = require('../../../../_virtual/_plugin-vue_export-helper.js');
|
|
9
8
|
var index = require('../../../../components/hyTooltip/index.js');
|
|
10
9
|
var index$1 = require('../../../../components/hyIcon/index.js');
|
|
11
10
|
var useLocale = require('../../../../hooks/useLocale.js');
|
|
@@ -120,8 +119,5 @@ const _sfc_main = {
|
|
|
120
119
|
};
|
|
121
120
|
}
|
|
122
121
|
};
|
|
123
|
-
import "/data/jenkins-work/workspace/WEB-V3-PROJECT-Web-hy-dispatch-ui@2/tmp/packages/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue?vue&type=style&index=0&scoped=788f720f&lang.scss";
|
|
124
122
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
exports.default = ElectronicFenceAssociatedUsersItem;
|
|
123
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.hy-electronic-fence-associated-users-dialog {
|
|
2
|
+
.tree-box {
|
|
3
|
+
border: 1px solid rgba(var(--hy-border));
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
box-shadow:
|
|
6
|
+
0px 2px 4px 0px rgba(0, 0, 0, 0.5),
|
|
7
|
+
inset 0px 0px 10px 0px #1f4b77;
|
|
8
|
+
backdrop-filter: blur(5px);
|
|
9
|
+
}
|
|
10
|
+
li {
|
|
11
|
+
&:hover {
|
|
12
|
+
box-shadow:
|
|
13
|
+
inset 0px 0px 50px 0px rgba(var(--hy-theme), 0.2),
|
|
14
|
+
inset 0px 0px 0px 1px rgba(var(--hy-theme), 0.5);
|
|
15
|
+
.delete {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.delete {
|
|
20
|
+
transition: 1s;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
color: rgba(var(--hy-danger-2));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -96,6 +96,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
96
96
|
showAddBtn: {
|
|
97
97
|
type: Boolean,
|
|
98
98
|
default: true
|
|
99
|
+
},
|
|
100
|
+
// 提交数据之前处理
|
|
101
|
+
beforeSubmitHandler: {
|
|
102
|
+
type: Function
|
|
99
103
|
}
|
|
100
104
|
}, {
|
|
101
105
|
"modelValue": { type: Boolean, default: false },
|
|
@@ -190,8 +194,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
190
194
|
batchTableFormRef.value.nextStep();
|
|
191
195
|
}
|
|
192
196
|
async function onSubmitHandler() {
|
|
193
|
-
|
|
197
|
+
let res = batchTableFormRef.value.validate();
|
|
194
198
|
if (props.uploadType === "custom") {
|
|
199
|
+
if (res.total === res.success && props.beforeSubmitHandler) {
|
|
200
|
+
await props.beforeSubmitHandler(res.dataSource);
|
|
201
|
+
res = batchTableFormRef.value.validate();
|
|
202
|
+
}
|
|
195
203
|
const dataSource = batchTableFormRef.value.getTableDataSource();
|
|
196
204
|
onTableSubmitHandler({
|
|
197
205
|
...res,
|
|
@@ -365,6 +373,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
365
373
|
onExpandRowChange: __props.onExpandRowChange,
|
|
366
374
|
"submit-handler": __props.submitHandler,
|
|
367
375
|
showAddBtn: __props.showAddBtn,
|
|
376
|
+
beforeSubmitHandler: __props.beforeSubmitHandler,
|
|
368
377
|
onTableDataChange: tableDataChange,
|
|
369
378
|
onUploading: onTableUploadingHandler,
|
|
370
379
|
onUploaded: onTableUploadedHandler,
|
|
@@ -386,7 +395,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
386
395
|
])
|
|
387
396
|
};
|
|
388
397
|
})
|
|
389
|
-
]), 1032, ["step", "onUpdate:step", "tableColumns", "formColumns", "rules", "emptyText", "fontSize", "rowClickExpand", "columnNum", "size", "beforeDataHandle", "beforeDataListHandle", "onExpandRowChange", "submit-handler", "showAddBtn", "onOptionsStatus"])) : vue.createCommentVNode("v-if", true)
|
|
398
|
+
]), 1032, ["step", "onUpdate:step", "tableColumns", "formColumns", "rules", "emptyText", "fontSize", "rowClickExpand", "columnNum", "size", "beforeDataHandle", "beforeDataListHandle", "onExpandRowChange", "submit-handler", "showAddBtn", "beforeSubmitHandler", "onOptionsStatus"])) : vue.createCommentVNode("v-if", true)
|
|
390
399
|
])
|
|
391
400
|
])
|
|
392
401
|
]),
|
|
@@ -115,8 +115,16 @@ const _sfc_main = {
|
|
|
115
115
|
};
|
|
116
116
|
});
|
|
117
117
|
const columnAttrs = vue.computed(() => {
|
|
118
|
+
const attrs = props.column.attrs || {};
|
|
119
|
+
const config = {};
|
|
120
|
+
if (props.column.type === "input") {
|
|
121
|
+
if (attrs.type === "text" && vue.unref(formContext.business) !== "tableForm") {
|
|
122
|
+
config.maxlength = 255;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
118
125
|
return {
|
|
119
|
-
...
|
|
126
|
+
...config,
|
|
127
|
+
...attrs,
|
|
120
128
|
label: form.columnLabelHandler(props.column, props.model),
|
|
121
129
|
placeholder: form.columnPlaceholderHandler(props.column, props.model)
|
|
122
130
|
};
|
|
@@ -185,7 +193,7 @@ const _sfc_main = {
|
|
|
185
193
|
if (!index.isRequired(props, column) && formItemRef.value) {
|
|
186
194
|
formItemRef.value.clearValidate();
|
|
187
195
|
}
|
|
188
|
-
return form.columnRuleHandler(column, model);
|
|
196
|
+
return form.columnRuleHandler(column, model, { business: vue.unref(formContext.business) });
|
|
189
197
|
}
|
|
190
198
|
function onChangeHandler() {
|
|
191
199
|
const { onChange } = props.column;
|
|
@@ -59,9 +59,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
59
59
|
type: Boolean,
|
|
60
60
|
default: true
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
type:
|
|
64
|
-
default:
|
|
62
|
+
business: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: "default"
|
|
65
|
+
// default-默认 tableForm-表格表单
|
|
65
66
|
}
|
|
66
67
|
},
|
|
67
68
|
emits: ["on-allMapSelect", "complete", "optionsStatus"],
|
|
@@ -86,6 +87,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
86
87
|
gridTemplateColumns: `repeat(${columnNum}, minmax(0, 1fr))`
|
|
87
88
|
};
|
|
88
89
|
});
|
|
90
|
+
const isTableForm = vue.computed(() => props.business === "tableForm");
|
|
89
91
|
const locationSelectRef = vue.useTemplateRef("locationSelectRef");
|
|
90
92
|
const allMapSelect = vue.ref(false);
|
|
91
93
|
function setMapSize() {
|
|
@@ -309,7 +311,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
309
311
|
{ key: 2 },
|
|
310
312
|
[
|
|
311
313
|
vue.createCommentVNode(" \u8868\u5355\u6570\u7EC4 "),
|
|
312
|
-
!
|
|
314
|
+
!isTableForm.value && vue.unref(index.columnShowHandler)(props, column) ? (vue.openBlock(), vue.createBlock(arrayItem.default, {
|
|
313
315
|
key: 0,
|
|
314
316
|
class: vue.normalizeClass([allMapSelect.value ? "hidden" : ""]),
|
|
315
317
|
model: __props.model,
|
|
@@ -333,7 +335,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
333
335
|
])
|
|
334
336
|
};
|
|
335
337
|
})
|
|
336
|
-
]), 1032, ["class", "model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style"])) :
|
|
338
|
+
]), 1032, ["class", "model", "column", "rules", "columnNum", "loading", "disabled", "readonly", "size", "style"])) : isTableForm.value && vue.unref(index.columnShowHandler)(props, column) ? (vue.openBlock(), vue.createBlock(arrayItem2.default, {
|
|
337
339
|
key: 1,
|
|
338
340
|
class: vue.normalizeClass([allMapSelect.value ? "hidden" : ""]),
|
|
339
341
|
model: __props.model,
|
|
@@ -81,6 +81,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
81
81
|
// 外部整体数据处理
|
|
82
82
|
beforeDataListHandle: {
|
|
83
83
|
type: Function
|
|
84
|
+
},
|
|
85
|
+
// 提交数据之前处理
|
|
86
|
+
beforeSubmitHandler: {
|
|
87
|
+
type: Function
|
|
84
88
|
}
|
|
85
89
|
}, {
|
|
86
90
|
"step": { type: Number, default: 1 },
|
|
@@ -256,9 +260,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
256
260
|
emits("submitting");
|
|
257
261
|
for (let i = 0; i <= dataSource.length - 1; i++) {
|
|
258
262
|
const target = dataSource[i];
|
|
259
|
-
|
|
263
|
+
let { onlyId, errorMsg, errorMap, children, ...data } = target;
|
|
260
264
|
setSubmitProgress(Math.floor((i + 1) / total * 100));
|
|
261
|
-
if (errorMsg) {
|
|
265
|
+
if (!errorMsg && props.beforeSubmitHandler) {
|
|
266
|
+
await props.beforeSubmitHandler([data]);
|
|
267
|
+
errorMsg = data.errorMsg;
|
|
268
|
+
}
|
|
269
|
+
if (errorMsg && errorMsg.message) {
|
|
262
270
|
continue;
|
|
263
271
|
}
|
|
264
272
|
try {
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var XLSX = require('xlsx');
|
|
4
4
|
var dayjs = require('dayjs');
|
|
5
|
-
require('vue');
|
|
6
5
|
var AsyncValidator = require('async-validator');
|
|
7
6
|
var elementPlus = require('element-plus');
|
|
8
7
|
var index = require('../../hyForm/js/index.js');
|
|
9
8
|
require('../../../utils/index.js');
|
|
10
|
-
require('../../../hooks/index.js');
|
|
11
9
|
var form = require('../../../utils/form.js');
|
|
12
10
|
var is = require('../../../utils/is.js');
|
|
13
11
|
|
|
@@ -17,7 +15,7 @@ const doValidate = async (target = {}, columns = [], ruleList = {}) => {
|
|
|
17
15
|
const columnMap = (columns || []).reduce((columnMap2, column) => {
|
|
18
16
|
if (index.columnShowHandler({ model: data }, column)) {
|
|
19
17
|
columnMap2[column.prop] = column;
|
|
20
|
-
rules[column.prop] = form.columnRuleHandler(column, target);
|
|
18
|
+
rules[column.prop] = form.columnRuleHandler(column, target, { business: "tableForm" });
|
|
21
19
|
form.setValueByProp(data, column.prop, form.getValueByProp(target, column.prop));
|
|
22
20
|
}
|
|
23
21
|
return columnMap2;
|
|
@@ -558,7 +558,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
558
558
|
class: "px-0",
|
|
559
559
|
columnNum: __props.columnNum,
|
|
560
560
|
size: __props.size,
|
|
561
|
-
|
|
561
|
+
business: "tableForm",
|
|
562
562
|
onValidate: (prop, isValid, message) => onValidateHandler(row, { prop, isValid, message }),
|
|
563
563
|
onOptionsStatus: _ctx.$attrs.onOptionsStatus
|
|
564
564
|
}, vue.createSlots({
|
package/lib/locale/en_US.js
CHANGED
|
@@ -38,7 +38,8 @@ var en_US = {
|
|
|
38
38
|
additionalInformationTip: "Editor's Supplementary Information (Optional)",
|
|
39
39
|
additionalInformationHoverTip: "Click To Expand And View More Detailed Information. (This Is An Optional Field)",
|
|
40
40
|
dynamicFormItem: "Dynamic Form Item",
|
|
41
|
-
addFormItem: "Add Form Item"
|
|
41
|
+
addFormItem: "Add Form Item",
|
|
42
|
+
characterLimit: "{0} should be limited to {1} characters or fewer"
|
|
42
43
|
},
|
|
43
44
|
table: {
|
|
44
45
|
hideFilter: "Hide filter",
|
package/lib/locale/zh_CN.js
CHANGED
|
@@ -39,7 +39,8 @@ var zh_CN = {
|
|
|
39
39
|
additionalInformationTip: "\u7F16\u8F91\u8865\u5145\u4FE1\u606F (\u9009\u586B)",
|
|
40
40
|
additionalInformationHoverTip: "\u70B9\u51FB\u53EF\u5C55\u5F00\u8865\u5145\u66F4\u591A\u4FE1\u606F\uFF0C\u975E\u5FC5\u586B\u9879",
|
|
41
41
|
dynamicFormItem: "\u52A8\u6001\u8868\u5355\u9879",
|
|
42
|
-
addFormItem: "\u6DFB\u52A0\u8868\u5355\u9879"
|
|
42
|
+
addFormItem: "\u6DFB\u52A0\u8868\u5355\u9879",
|
|
43
|
+
characterLimit: "{0}\u9650\u5236\u5728{1}\u4F4D\u5B57\u7B26\u4EE5\u5185"
|
|
43
44
|
},
|
|
44
45
|
table: {
|
|
45
46
|
hideFilter: "\u9690\u85CF\u7B5B\u9009\u5668",
|
package/lib/utils/form.js
CHANGED
|
@@ -85,7 +85,7 @@ const ruleHandler = (column, model) => {
|
|
|
85
85
|
}
|
|
86
86
|
return [];
|
|
87
87
|
};
|
|
88
|
-
const columnRuleHandler = (column, model) => {
|
|
88
|
+
const columnRuleHandler = (column, model, config) => {
|
|
89
89
|
const rules = ruleHandler(column, model);
|
|
90
90
|
if (column.required) {
|
|
91
91
|
rules.unshift({
|
|
@@ -93,6 +93,16 @@ const columnRuleHandler = (column, model) => {
|
|
|
93
93
|
message: genRuleRequiredMsgHandler(column, model)
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
+
if (config && config.business === "tableForm") {
|
|
97
|
+
if (column.type === "input" && column.attrs.type === "text") {
|
|
98
|
+
if (!rules.some((item) => is.isNumber(item.max))) {
|
|
99
|
+
rules.push({
|
|
100
|
+
max: 255,
|
|
101
|
+
message: useLocale.$t("form.characterLimit", [columnLabelHandler(column, model), 255])
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
96
106
|
return rules;
|
|
97
107
|
};
|
|
98
108
|
const genColumnDefaultLabel = (column) => {
|
package/lib/version.js
CHANGED