cnhis-design-vue 3.3.3-beta.46 → 3.3.3-beta.52
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/components/callback/src/components/render/popupMaps.d.ts +5 -0
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +3 -1
- package/es/components/field-editor/index.d.ts +5 -0
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +5 -0
- package/es/components/form-config/index.d.ts +53 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +53 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +5 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +40 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +5 -0
- package/es/components/form-config/src/constants/index.d.ts +29 -1
- package/es/components/form-config/src/constants/index.js +148 -1
- package/es/components/form-config/src/hooks/useConfigurationField.d.ts +2 -2
- package/es/components/form-config/src/hooks/useConfigurationField.js +31 -4
- package/es/components/form-config/src/hooks/useLocale.d.ts +4 -0
- package/es/components/form-config/src/hooks/useLocale.js +32 -0
- package/es/components/form-config/src/types/index.d.ts +8 -1
- package/es/components/form-render/index.d.ts +5 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +5 -0
- package/es/components/form-render/src/FormRender.vue2.js +1 -0
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -0
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -0
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -0
- package/es/components/form-render/src/hooks/useFieldNormalize.js +15 -0
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +6 -2
- package/es/components/iho-chat/src/components/ImageLightbox.vue2.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +1 -0
- package/es/components/iho-chat/src/utils/index.js +7 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +1 -0
- package/es/components/info-header/index.d.ts +15 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +15 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +1 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +6 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +5 -0
- package/es/components/scale-view/index.d.ts +13 -0
- package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
- package/es/components/scale-view/src/hooks/scaleview-computed.js +2 -1
- package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
- package/es/components/scale-view/src/hooks/scaleview-props.js +4 -0
- package/es/components/shortcut-setter/index.d.ts +5 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +5 -0
- package/es/components/vertify/index.d.ts +1 -0
- package/es/components/vertify/index.js +1 -0
- package/es/components/vertify/src/components/IdentityVerification.vue.d.ts +89 -0
- package/es/components/vertify/src/components/IdentityVerification.vue.js +6 -0
- package/es/components/vertify/src/components/IdentityVerification.vue2.js +213 -0
- package/es/components/vertify/src/utils/dialog.d.ts +7 -0
- package/es/components/vertify/src/utils/dialog.js +73 -0
- package/es/components/vertify/src/utils/index.d.ts +11 -0
- package/es/components/vertify/src/utils/index.js +24 -0
- package/es/components/vertify/style/index.css +1 -0
- package/es/components/vod-chunk-upload/index.d.ts +13 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.d.ts +19 -2
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +104 -75
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.d.ts +1 -0
- package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +20 -3
- package/es/components/vod-chunk-upload/src/hooks/upload-data.d.ts +4 -0
- package/es/components/vod-chunk-upload/src/hooks/upload-data.js +6 -2
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.d.ts +13 -0
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +6 -1
- package/es/components/vod-chunk-upload/style/index.css +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -0,0 +1,213 @@
|
|
1
|
+
import { defineComponent, reactive, ref, watch, openBlock, createBlock, unref, normalizeStyle, withCtx, createElementVNode, createVNode, withKeys, createTextVNode } from 'vue';
|
2
|
+
import axios from 'axios';
|
3
|
+
import { createDiscreteApi, NModal, NForm, NFormItem, NInput, NSpace, NButton } from 'naive-ui';
|
4
|
+
|
5
|
+
const _hoisted_1 = {
|
6
|
+
class: "content"
|
7
|
+
};
|
8
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
9
|
+
__name: "IdentityVerification",
|
10
|
+
props: {
|
11
|
+
verifyUser: {
|
12
|
+
type: Function,
|
13
|
+
default: () => Promise.resolve()
|
14
|
+
},
|
15
|
+
identityVerificationTitle: {
|
16
|
+
default: "\u8DE8\u8D26\u53F7\u64CD\u4F5C"
|
17
|
+
},
|
18
|
+
token: {
|
19
|
+
default: ""
|
20
|
+
},
|
21
|
+
modelValue: {
|
22
|
+
type: Boolean
|
23
|
+
}
|
24
|
+
},
|
25
|
+
emits: ["update:modelValue", "success", "close", "afterLeaveComponent"],
|
26
|
+
setup(__props, {
|
27
|
+
emit
|
28
|
+
}) {
|
29
|
+
const props = __props;
|
30
|
+
const loginCheckUrl = "/user-center/user/manage/checkBusPasswordByAuthEmp";
|
31
|
+
const DEFAULT_FORM = {
|
32
|
+
account: "",
|
33
|
+
password: ""
|
34
|
+
};
|
35
|
+
const {
|
36
|
+
message
|
37
|
+
} = createDiscreteApi(["message"]);
|
38
|
+
let form = reactive({
|
39
|
+
...DEFAULT_FORM
|
40
|
+
});
|
41
|
+
const rules = {
|
42
|
+
account: {
|
43
|
+
required: true,
|
44
|
+
message: "\u8BF7\u8F93\u5165\u5DE5\u53F7"
|
45
|
+
},
|
46
|
+
password: {
|
47
|
+
required: true,
|
48
|
+
message: function() {
|
49
|
+
var _a, _b, _c;
|
50
|
+
try {
|
51
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.469")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.469")) || "\u8BF7\u8F93\u5165\u5BC6\u7801";
|
52
|
+
} catch (e) {
|
53
|
+
return "\u8BF7\u8F93\u5165\u5BC6\u7801";
|
54
|
+
}
|
55
|
+
}()
|
56
|
+
}
|
57
|
+
};
|
58
|
+
const style = {
|
59
|
+
width: "416px"
|
60
|
+
};
|
61
|
+
const formRef = ref(null);
|
62
|
+
const loading = ref(false);
|
63
|
+
const handleClickClose = () => {
|
64
|
+
emit("update:modelValue", false);
|
65
|
+
emit("close");
|
66
|
+
};
|
67
|
+
const handleAfterLeave = () => {
|
68
|
+
emit("afterLeaveComponent");
|
69
|
+
};
|
70
|
+
const submitLoginData = async () => {
|
71
|
+
try {
|
72
|
+
loading.value = true;
|
73
|
+
const {
|
74
|
+
data = {}
|
75
|
+
} = await axios({
|
76
|
+
method: "get",
|
77
|
+
url: loginCheckUrl,
|
78
|
+
headers: {
|
79
|
+
Authorization: "bearer " + props.token
|
80
|
+
},
|
81
|
+
params: {
|
82
|
+
empNo: form.account,
|
83
|
+
busPassword: form.password
|
84
|
+
}
|
85
|
+
}) || {};
|
86
|
+
if (data.result !== "SUCCESS") {
|
87
|
+
message.warning((data == null ? void 0 : data.msg) || (data == null ? void 0 : data.message));
|
88
|
+
return false;
|
89
|
+
}
|
90
|
+
emit("success", form);
|
91
|
+
} catch (error) {
|
92
|
+
message.warning((error == null ? void 0 : error.message) || "\u6821\u9A8C\u4E1A\u52A1\u5BC6\u7801\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25");
|
93
|
+
} finally {
|
94
|
+
loading.value = false;
|
95
|
+
}
|
96
|
+
};
|
97
|
+
const handleValidate = () => {
|
98
|
+
var _a;
|
99
|
+
(_a = formRef.value) == null ? void 0 : _a.validate((errors) => {
|
100
|
+
if (!errors) {
|
101
|
+
submitLoginData();
|
102
|
+
} else {
|
103
|
+
console.log(errors);
|
104
|
+
return false;
|
105
|
+
}
|
106
|
+
});
|
107
|
+
};
|
108
|
+
watch(() => props.modelValue, (val) => {
|
109
|
+
if (val)
|
110
|
+
return;
|
111
|
+
Object.assign(form, DEFAULT_FORM);
|
112
|
+
});
|
113
|
+
return (_ctx, _cache) => {
|
114
|
+
return openBlock(), createBlock(unref(NModal), {
|
115
|
+
class: "c-identity-verification-modal",
|
116
|
+
preset: "dialog",
|
117
|
+
title: __props.identityVerificationTitle,
|
118
|
+
show: __props.modelValue,
|
119
|
+
"close-on-esc": false,
|
120
|
+
"show-icon": false,
|
121
|
+
style: normalizeStyle({
|
122
|
+
width: style.width,
|
123
|
+
overflowY: "auto"
|
124
|
+
}),
|
125
|
+
onClose: handleClickClose,
|
126
|
+
onNegativeClick: handleClickClose,
|
127
|
+
onPositiveClick: handleValidate,
|
128
|
+
onAfterLeave: handleAfterLeave
|
129
|
+
}, {
|
130
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(unref(NForm), {
|
131
|
+
ref_key: "formRef",
|
132
|
+
ref: formRef,
|
133
|
+
model: unref(form),
|
134
|
+
rules,
|
135
|
+
"label-placement": "left",
|
136
|
+
"label-width": "auto",
|
137
|
+
"require-mark-placement": "right-hanging"
|
138
|
+
}, {
|
139
|
+
default: withCtx(() => [createVNode(unref(NFormItem), {
|
140
|
+
label: function() {
|
141
|
+
var _a, _b, _c;
|
142
|
+
try {
|
143
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.121")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.121")) || "\u5DE5\u53F7";
|
144
|
+
} catch (e) {
|
145
|
+
return "\u5DE5\u53F7";
|
146
|
+
}
|
147
|
+
}(),
|
148
|
+
path: "account"
|
149
|
+
}, {
|
150
|
+
default: withCtx(() => [createVNode(unref(NInput), {
|
151
|
+
value: unref(form).account,
|
152
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => unref(form).account = $event),
|
153
|
+
placeholder: "\u8BF7\u8F93\u5165\u5DE5\u53F7",
|
154
|
+
onKeyup: withKeys(handleValidate, ["enter"])
|
155
|
+
}, null, 8, ["value", "onKeyup"])]),
|
156
|
+
_: 1
|
157
|
+
}), createVNode(unref(NFormItem), {
|
158
|
+
label: "\u4E1A\u52A1\u5BC6\u7801",
|
159
|
+
path: "password"
|
160
|
+
}, {
|
161
|
+
default: withCtx(() => [createVNode(unref(NInput), {
|
162
|
+
type: "password",
|
163
|
+
"input-props": {
|
164
|
+
autocomplete: "on",
|
165
|
+
name: "password"
|
166
|
+
},
|
167
|
+
value: unref(form).password,
|
168
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(form).password = $event),
|
169
|
+
placeholder: function() {
|
170
|
+
var _a, _b, _c;
|
171
|
+
try {
|
172
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.469")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.469")) || "\u8BF7\u8F93\u5165\u5BC6\u7801";
|
173
|
+
} catch (e) {
|
174
|
+
return "\u8BF7\u8F93\u5165\u5BC6\u7801";
|
175
|
+
}
|
176
|
+
}(),
|
177
|
+
onKeyup: withKeys(handleValidate, ["enter"])
|
178
|
+
}, null, 8, ["value", "onKeyup"])]),
|
179
|
+
_: 1
|
180
|
+
})]),
|
181
|
+
_: 1
|
182
|
+
}, 8, ["model"]), createVNode(unref(NSpace), {
|
183
|
+
reverse: ""
|
184
|
+
}, {
|
185
|
+
default: withCtx(() => [createVNode(unref(NButton), {
|
186
|
+
loading: loading.value,
|
187
|
+
type: "info",
|
188
|
+
onClick: handleValidate
|
189
|
+
}, {
|
190
|
+
default: withCtx(() => [createTextVNode("\u9A8C\u8BC1")]),
|
191
|
+
_: 1
|
192
|
+
}, 8, ["loading"]), createVNode(unref(NButton), {
|
193
|
+
onClick: handleClickClose
|
194
|
+
}, {
|
195
|
+
default: withCtx(() => [createTextVNode(function() {
|
196
|
+
var _a, _b, _c;
|
197
|
+
try {
|
198
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.28")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.28")) || "\u53D6\u6D88";
|
199
|
+
} catch (e) {
|
200
|
+
return "\u53D6\u6D88";
|
201
|
+
}
|
202
|
+
}())]),
|
203
|
+
_: 1
|
204
|
+
})]),
|
205
|
+
_: 1
|
206
|
+
})])]),
|
207
|
+
_: 1
|
208
|
+
}, 8, ["title", "show", "style"]);
|
209
|
+
};
|
210
|
+
}
|
211
|
+
});
|
212
|
+
|
213
|
+
export { _sfc_main as default };
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { AnyObject } from '../../../../shared/types';
|
2
|
+
import { ComponentInternalInstance } from 'vue';
|
3
|
+
export declare class RoleDialog {
|
4
|
+
rendered: boolean;
|
5
|
+
static createMsg(message: string): string;
|
6
|
+
show(instance: ComponentInternalInstance, data: AnyObject): Promise<AnyObject>;
|
7
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { ref, render, createVNode, withCtx, nextTick } from 'vue';
|
2
|
+
import { createProviderWrapper } from '../../../../shared/utils/index.js';
|
3
|
+
import IdentityVerification from '../components/IdentityVerification.vue.js';
|
4
|
+
|
5
|
+
class RoleDialog {
|
6
|
+
constructor() {
|
7
|
+
this.rendered = false;
|
8
|
+
}
|
9
|
+
static createMsg(message) {
|
10
|
+
return `[RoleDialog] ${message}`;
|
11
|
+
}
|
12
|
+
show(instance, data) {
|
13
|
+
if (this.rendered)
|
14
|
+
return Promise.reject(RoleDialog.createMsg(function() {
|
15
|
+
var _a, _b, _c;
|
16
|
+
try {
|
17
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.491")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.491")) || "\u8BF7\u52FF\u91CD\u590D\u6253\u5F00\u5F39\u7A97";
|
18
|
+
} catch (e) {
|
19
|
+
return "\u8BF7\u52FF\u91CD\u590D\u6253\u5F00\u5F39\u7A97";
|
20
|
+
}
|
21
|
+
}()));
|
22
|
+
return new Promise((resolve, reject) => {
|
23
|
+
this.rendered = true;
|
24
|
+
const container = document.createElement("div");
|
25
|
+
const visible = ref(false);
|
26
|
+
const ProviderWrapper = createProviderWrapper(instance);
|
27
|
+
const {
|
28
|
+
title = "",
|
29
|
+
token = ""
|
30
|
+
} = data;
|
31
|
+
const that = this;
|
32
|
+
render(createVNode(ProviderWrapper, null, {
|
33
|
+
default: withCtx(() => createVNode(IdentityVerification, {
|
34
|
+
"to": container,
|
35
|
+
"modelValue": visible.value,
|
36
|
+
"onUpdate:modelValue": ($event) => visible.value = $event,
|
37
|
+
"identityVerificationTitle": title,
|
38
|
+
"token": token,
|
39
|
+
"onClose": onClose,
|
40
|
+
"onAfterLeaveComponent": () => unmount(container),
|
41
|
+
"onSuccess": onSuccess
|
42
|
+
}, null), instance)
|
43
|
+
}), container);
|
44
|
+
mount(container);
|
45
|
+
nextTick(() => visible.value = true);
|
46
|
+
function onClose() {
|
47
|
+
reject(RoleDialog.createMsg(function() {
|
48
|
+
var _a, _b, _c;
|
49
|
+
try {
|
50
|
+
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.492")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.492")) || "\u5F39\u7A97\u5173\u95ED";
|
51
|
+
} catch (e) {
|
52
|
+
return "\u5F39\u7A97\u5173\u95ED";
|
53
|
+
}
|
54
|
+
}()));
|
55
|
+
}
|
56
|
+
function onSuccess(result) {
|
57
|
+
resolve(result);
|
58
|
+
visible.value = false;
|
59
|
+
}
|
60
|
+
function mount(target) {
|
61
|
+
document.body.appendChild(target);
|
62
|
+
}
|
63
|
+
function unmount(target) {
|
64
|
+
if (!target.parentElement)
|
65
|
+
return;
|
66
|
+
that.rendered = false;
|
67
|
+
target.parentElement.removeChild(target);
|
68
|
+
}
|
69
|
+
});
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
export { RoleDialog };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { AnyObject } from '../../../../shared/types';
|
2
|
+
declare class Vertify {
|
3
|
+
private static instance;
|
4
|
+
private dialog;
|
5
|
+
private instance;
|
6
|
+
constructor();
|
7
|
+
static getInstance(): Vertify;
|
8
|
+
show(data: AnyObject): Promise<AnyObject>;
|
9
|
+
}
|
10
|
+
export declare const vertify: Vertify;
|
11
|
+
export {};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { getCurrentInstance } from 'vue';
|
2
|
+
import { RoleDialog } from './dialog.js';
|
3
|
+
|
4
|
+
class Vertify {
|
5
|
+
constructor() {
|
6
|
+
this.dialog = new RoleDialog();
|
7
|
+
this.instance = null;
|
8
|
+
this.instance = getCurrentInstance();
|
9
|
+
}
|
10
|
+
static getInstance() {
|
11
|
+
if (!Vertify.instance) {
|
12
|
+
Vertify.instance = new Vertify();
|
13
|
+
}
|
14
|
+
return Vertify.instance;
|
15
|
+
}
|
16
|
+
show(data) {
|
17
|
+
if (!this.instance)
|
18
|
+
this.instance = getCurrentInstance();
|
19
|
+
return this.dialog.show(this.instance, data);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
const vertify = Vertify.getInstance();
|
23
|
+
|
24
|
+
export { vertify };
|
@@ -0,0 +1 @@
|
|
1
|
+
.c-identity-verification-modal .n-dialog__close{display:none}.c-identity-verification-modal .n-dialog__content{margin-top:20px}
|
@@ -21,6 +21,10 @@ declare const VodChunkUpload: SFCWithInstall<import("vue").DefineComponent<{
|
|
21
21
|
type: FunctionConstructor;
|
22
22
|
default: () => Promise<{}>;
|
23
23
|
};
|
24
|
+
chunkUploadApiConfig: {
|
25
|
+
type: ObjectConstructor;
|
26
|
+
default: () => {};
|
27
|
+
};
|
24
28
|
}, {
|
25
29
|
VodState: {
|
26
30
|
videoVisible: boolean;
|
@@ -85,6 +89,10 @@ declare const VodChunkUpload: SFCWithInstall<import("vue").DefineComponent<{
|
|
85
89
|
type: FunctionConstructor;
|
86
90
|
default: () => Promise<{}>;
|
87
91
|
};
|
92
|
+
chunkUploadApiConfig: {
|
93
|
+
type: ObjectConstructor;
|
94
|
+
default: () => {};
|
95
|
+
};
|
88
96
|
}>> & {
|
89
97
|
onVodFileList?: ((...args: any[]) => any) | undefined;
|
90
98
|
}>>;
|
@@ -294,12 +302,17 @@ declare const VodChunkUpload: SFCWithInstall<import("vue").DefineComponent<{
|
|
294
302
|
type: FunctionConstructor;
|
295
303
|
default: () => Promise<{}>;
|
296
304
|
};
|
305
|
+
chunkUploadApiConfig: {
|
306
|
+
type: ObjectConstructor;
|
307
|
+
default: () => {};
|
308
|
+
};
|
297
309
|
}>> & {
|
298
310
|
onVodFileList?: ((...args: any[]) => any) | undefined;
|
299
311
|
}, {
|
300
312
|
isDetail: boolean;
|
301
313
|
isLock: boolean;
|
302
314
|
getChunkUploadConfig: Function;
|
315
|
+
chunkUploadApiConfig: Record<string, any>;
|
303
316
|
formData: Record<string, any>;
|
304
317
|
limitNum: number;
|
305
318
|
defFileList: string;
|
@@ -27,6 +27,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
27
27
|
type: StringConstructor;
|
28
28
|
default: string;
|
29
29
|
};
|
30
|
+
chunkUploadApiConfig: {
|
31
|
+
type: ObjectConstructor;
|
32
|
+
default: () => {};
|
33
|
+
};
|
30
34
|
}, {
|
31
35
|
UploadState: {
|
32
36
|
spinning: boolean;
|
@@ -91,6 +95,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
91
95
|
type: StringConstructor;
|
92
96
|
default: string;
|
93
97
|
};
|
98
|
+
chunkUploadApiConfig: {
|
99
|
+
type: ObjectConstructor;
|
100
|
+
default: () => {};
|
101
|
+
};
|
94
102
|
}>> & {
|
95
103
|
onGetSumbitList?: ((...args: any[]) => any) | undefined;
|
96
104
|
onCloseUpload?: ((...args: any[]) => any) | undefined;
|
@@ -98,6 +106,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
98
106
|
emit: (event: "getSumbitList" | "closeUpload", ...args: any[]) => void;
|
99
107
|
message: import("naive-ui").MessageApi;
|
100
108
|
initState: () => void;
|
109
|
+
isChunkNew: import("vue").ComputedRef<any>;
|
101
110
|
uploadArguments: import("vue").ComputedRef<{
|
102
111
|
type: any;
|
103
112
|
channel: any;
|
@@ -115,10 +124,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
115
124
|
checkMaxLength: () => boolean;
|
116
125
|
computeMD5: (file: any) => void;
|
117
126
|
onFileAdded: (file: any) => void;
|
118
|
-
|
127
|
+
checkFileMd5ExistOld: (obj: any, file: any) => Promise<any>;
|
128
|
+
verifyUpload: (fileName: any, fileHash: any, file: any) => Promise<any>;
|
119
129
|
computeMD5Success: (md5: any, file: any) => Promise<void>;
|
120
130
|
onFileProgress: () => void;
|
121
|
-
|
131
|
+
handleMergeFile: (data: any, file: any) => void;
|
132
|
+
partFileMergeOld: (obj: any) => Promise<any>;
|
133
|
+
mergeRequest: (data: any, file: any) => Promise<void>;
|
122
134
|
onFileSuccess: (rootFile: any, file: any, response: any) => void;
|
123
135
|
hanldeDraggerBtnClick: () => void;
|
124
136
|
getUploadShowStatus: (file: any, key?: string) => any;
|
@@ -167,12 +179,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
167
179
|
type: StringConstructor;
|
168
180
|
default: string;
|
169
181
|
};
|
182
|
+
chunkUploadApiConfig: {
|
183
|
+
type: ObjectConstructor;
|
184
|
+
default: () => {};
|
185
|
+
};
|
170
186
|
}>> & {
|
171
187
|
onGetSumbitList?: ((...args: any[]) => any) | undefined;
|
172
188
|
onCloseUpload?: ((...args: any[]) => any) | undefined;
|
173
189
|
}, {
|
174
190
|
defaultList: unknown[];
|
175
191
|
getChunkUploadConfig: Function;
|
192
|
+
chunkUploadApiConfig: Record<string, any>;
|
176
193
|
source: string;
|
177
194
|
max_size: string | number;
|
178
195
|
propsCategoryMap: string;
|
@@ -80,6 +80,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
80
80
|
const message = useMessage();
|
81
81
|
const {
|
82
82
|
initState,
|
83
|
+
isChunkNew,
|
83
84
|
uploadArguments,
|
84
85
|
autoStart,
|
85
86
|
btnAttrs
|
@@ -94,9 +95,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
94
95
|
};
|
95
96
|
const init = () => {
|
96
97
|
try {
|
97
|
-
|
98
|
+
if (isChunkNew.value)
|
99
|
+
return;
|
98
100
|
props.getChunkUploadConfig().then((res) => {
|
99
|
-
console.log(res);
|
100
101
|
state.uploadConfig = {
|
101
102
|
...res
|
102
103
|
};
|
@@ -268,41 +269,58 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
268
269
|
computeMD5(file);
|
269
270
|
}
|
270
271
|
};
|
271
|
-
const
|
272
|
+
const checkFileMd5ExistOld = (obj, file) => {
|
272
273
|
let url = state.uploadConfig.checkFileMd5Exist;
|
273
|
-
return
|
274
|
+
return instance.get(url, {
|
275
|
+
params: obj
|
276
|
+
}).then((res) => {
|
277
|
+
let verifyData = res.data || {};
|
278
|
+
if (verifyData.code == "00000")
|
279
|
+
return verifyData.data || {};
|
280
|
+
}).catch((err) => {
|
281
|
+
statusSet(file, "failed");
|
282
|
+
console.log("verifyUpload-old -> err", err);
|
283
|
+
});
|
284
|
+
};
|
285
|
+
const verifyUpload = async (fileName, fileHash, file) => {
|
286
|
+
var _a;
|
287
|
+
try {
|
274
288
|
const obj = {
|
275
289
|
md5: fileHash,
|
276
290
|
fileName,
|
277
291
|
...uploadArguments.value
|
278
292
|
};
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
}
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
}
|
293
|
+
if (isChunkNew.value) {
|
294
|
+
Object.assign(obj, {
|
295
|
+
up2saas: (_a = props.chunkUploadApiConfig) == null ? void 0 : _a.up2saas
|
296
|
+
});
|
297
|
+
}
|
298
|
+
return isChunkNew.value ? await props.chunkUploadApiConfig.checkFileMd5Exist(obj) : checkFileMd5ExistOld(obj, file);
|
299
|
+
} catch (err) {
|
300
|
+
console.log("verifyUpload -> err", err);
|
301
|
+
}
|
288
302
|
};
|
289
303
|
const computeMD5Success = async (md5, file) => {
|
290
304
|
try {
|
291
|
-
const
|
292
|
-
if (
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
file.
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
}
|
305
|
+
const data = await verifyUpload(file.name, md5, file);
|
306
|
+
if (data == null ? void 0 : data.path) {
|
307
|
+
statusSet(file, "complete");
|
308
|
+
file.crm_chkuns_complete_status = "complete";
|
309
|
+
file.crm_uploade_resInfo = {
|
310
|
+
url: data.path,
|
311
|
+
name: file.name,
|
312
|
+
size: file.size
|
313
|
+
};
|
314
|
+
return;
|
315
|
+
}
|
316
|
+
if (file.completed) {
|
317
|
+
const successObj = isChunkNew.value ? {
|
318
|
+
result: "SUCCESS"
|
319
|
+
} : {
|
320
|
+
success: true
|
321
|
+
};
|
322
|
+
onFileSuccess({}, file, JSON.stringify(successObj));
|
323
|
+
return;
|
306
324
|
}
|
307
325
|
file.uniqueIdentifier = md5;
|
308
326
|
statusSet(file, "uploading");
|
@@ -313,56 +331,69 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
313
331
|
};
|
314
332
|
const onFileProgress = () => {
|
315
333
|
};
|
316
|
-
const
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
if (uploaderDom.value) {
|
331
|
-
let resData = (data2 == null ? void 0 : data2.data) || {};
|
332
|
-
let fileList = uploaderDom.value.fileList;
|
333
|
-
fileList.forEach((v) => {
|
334
|
-
if (v.uniqueIdentifier == file.uniqueIdentifier) {
|
335
|
-
v.crm_chkuns_complete_status = "complete";
|
336
|
-
v.crm_uploade_resInfo = {
|
337
|
-
url: resData.path || resData.url,
|
338
|
-
name: file.name,
|
339
|
-
size: file.size,
|
340
|
-
...resData
|
341
|
-
};
|
342
|
-
}
|
343
|
-
});
|
344
|
-
}
|
345
|
-
resolve();
|
346
|
-
} else {
|
347
|
-
message.error(function() {
|
348
|
-
var _a, _b, _c;
|
349
|
-
try {
|
350
|
-
return ((_a = window.getLanguageByCode) == null ? void 0 : _a.call(window, "10010.1.641")) || ((_c = (_b = window.top) == null ? void 0 : _b.getLanguageByCode) == null ? void 0 : _c.call(_b, "10010.1.641")) || "\u4E0A\u4F20\u5931\u8D25";
|
351
|
-
} catch (e) {
|
352
|
-
return "\u4E0A\u4F20\u5931\u8D25";
|
353
|
-
}
|
354
|
-
}());
|
355
|
-
resolve();
|
334
|
+
const handleMergeFile = (data, file) => {
|
335
|
+
statusSet(file, "complete");
|
336
|
+
if (uploaderDom.value) {
|
337
|
+
let resData = (data == null ? void 0 : data.data) || (data == null ? void 0 : data.obj) || {};
|
338
|
+
let fileList = uploaderDom.value.fileList;
|
339
|
+
fileList.forEach((v) => {
|
340
|
+
if (v.uniqueIdentifier == file.uniqueIdentifier) {
|
341
|
+
v.crm_chkuns_complete_status = "complete";
|
342
|
+
v.crm_uploade_resInfo = {
|
343
|
+
url: resData.path || resData.url,
|
344
|
+
name: file.name,
|
345
|
+
size: file.size,
|
346
|
+
...resData
|
347
|
+
};
|
356
348
|
}
|
357
|
-
}).catch((err) => {
|
358
|
-
console.log("mergeRequest -> err", err);
|
359
|
-
reject();
|
360
349
|
});
|
361
|
-
}
|
350
|
+
}
|
351
|
+
};
|
352
|
+
const partFileMergeOld = (obj) => {
|
353
|
+
return instance.post(state.uploadConfig.partFileMerge, obj, {
|
354
|
+
timeout: 0
|
355
|
+
}).then(({
|
356
|
+
data
|
357
|
+
}) => data);
|
358
|
+
};
|
359
|
+
const mergeRequest = async (data, file) => {
|
360
|
+
var _a, _b;
|
361
|
+
const obj = {
|
362
|
+
...data,
|
363
|
+
...uploadArguments.value,
|
364
|
+
size: file.size
|
365
|
+
};
|
366
|
+
if (isChunkNew.value) {
|
367
|
+
Object.assign(obj, {
|
368
|
+
up2saas: (_b = (_a = props.chunkUploadApiConfig) == null ? void 0 : _a.up2saas) != null ? _b : false
|
369
|
+
});
|
370
|
+
}
|
371
|
+
try {
|
372
|
+
let resData = isChunkNew.value ? await props.chunkUploadApiConfig.partFileMerge(obj) : await partFileMergeOld(obj);
|
373
|
+
let isFailure = isChunkNew.value ? resData.result !== "SUCCESS" : resData.code !== "00000";
|
374
|
+
if (isFailure) {
|
375
|
+
message.error(function() {
|
376
|
+
var _a2, _b2, _c;
|
377
|
+
try {
|
378
|
+
return ((_a2 = window.getLanguageByCode) == null ? void 0 : _a2.call(window, "10010.1.641")) || ((_c = (_b2 = window.top) == null ? void 0 : _b2.getLanguageByCode) == null ? void 0 : _c.call(_b2, "10010.1.641")) || "\u4E0A\u4F20\u5931\u8D25";
|
379
|
+
} catch (e) {
|
380
|
+
return "\u4E0A\u4F20\u5931\u8D25";
|
381
|
+
}
|
382
|
+
}());
|
383
|
+
statusSet(file, "failed");
|
384
|
+
return;
|
385
|
+
}
|
386
|
+
handleMergeFile(resData, file);
|
387
|
+
} catch (err) {
|
388
|
+
console.log("mergeRequest -> err", err);
|
389
|
+
statusSet(file, "failed");
|
390
|
+
throw err;
|
391
|
+
}
|
362
392
|
};
|
363
393
|
const onFileSuccess = (rootFile, file, response) => {
|
364
394
|
let res = JSON.parse(response);
|
365
|
-
|
395
|
+
let isFailure = isChunkNew.value ? res.result !== "SUCCESS" : !res.success;
|
396
|
+
if (isFailure) {
|
366
397
|
statusSet(file, "failed");
|
367
398
|
return;
|
368
399
|
}
|
@@ -446,7 +477,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
446
477
|
emit("getSumbitList", list);
|
447
478
|
};
|
448
479
|
const confirm = () => {
|
449
|
-
console.log("ininini");
|
450
480
|
const {
|
451
481
|
configList
|
452
482
|
} = state;
|
@@ -478,7 +508,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
478
508
|
cancel();
|
479
509
|
};
|
480
510
|
const cancel = () => {
|
481
|
-
console.log("cancelcancelcancel");
|
482
511
|
close();
|
483
512
|
state.configList = [];
|
484
513
|
emit("closeUpload", false);
|