mg-ocr-invoice 0.4.8 → 0.4.10
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/index.es.js +10618 -11509
- package/dist/index.umd.js +41 -41
- package/dist/style.css +9 -1
- package/dist/types/components/InoviceConfirmDialog/InoviceConfirmDialog.vue.d.ts +114 -0
- package/dist/types/components/Invoice/index.vue.d.ts +1 -0
- package/dist/types/components/InvoiceList/Skeleton.vue.d.ts +14 -0
- package/dist/types/components/InvoiceList/const.d.ts +1 -1
- package/dist/types/components/InvoiceList/index.vue.d.ts +1 -0
- package/dist/types/components/InvoicePopup/InvoicePopup.vue.d.ts +61 -0
- package/dist/types/components/Loading/index.vue.d.ts +11 -0
- package/dist/types/components/Message/index.vue.d.ts +32 -0
- package/dist/types/components/OCRInvoice/const.d.ts +0 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/main.d.ts +0 -1
- package/dist/types/utils/common.d.ts +3 -0
- package/dist/types/utils/components.d.ts +35 -0
- package/dist/types/utils/upload.d.ts +0 -1
- package/package.json +3 -4
- package/src/components/InoviceConfirmDialog/InoviceConfirmDialog.vue +273 -0
- package/src/components/Invoice/index.vue +327 -271
- package/src/components/InvoiceList/Skeleton.vue +121 -0
- package/src/components/InvoiceList/index.vue +451 -402
- package/src/components/InvoicePopup/InvoicePopup.vue +217 -0
- package/src/components/Loading/index.vue +60 -0
- package/src/components/Message/index.vue +108 -0
- package/src/components/OCRInvoice/const.ts +0 -4
- package/src/components/OCRInvoice/index.vue +5 -7
- package/src/components/PaymentMode/index.vue +25 -38
- package/dist/types/styles/vantimpCss.d.ts +0 -15
- package/dist/types/utils/getUrlParams.d.ts +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const data: {
|
|
2
2
|
angle: string;
|
|
3
|
-
attachmentLink: string;
|
|
4
3
|
description: string;
|
|
5
4
|
invoiceType: string;
|
|
6
5
|
invoiceRootType: string;
|
|
@@ -56,7 +55,6 @@ export declare const data: {
|
|
|
56
55
|
status: string;
|
|
57
56
|
invoiceStatus: string;
|
|
58
57
|
realStatus: string;
|
|
59
|
-
fileUrlKey: string;
|
|
60
58
|
invoiceCompanyType: string;
|
|
61
59
|
taxRate: string;
|
|
62
60
|
taskStatus: string;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/main.d.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare class CreateLoading {
|
|
2
|
+
constructor(options?: object);
|
|
3
|
+
id: string;
|
|
4
|
+
options: any;
|
|
5
|
+
dom: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}>;
|
|
8
|
+
hide: () => void;
|
|
9
|
+
show: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare class CreateMessage {
|
|
12
|
+
constructor(options?: object);
|
|
13
|
+
id: string;
|
|
14
|
+
dom: any;
|
|
15
|
+
options: any;
|
|
16
|
+
hide: () => void;
|
|
17
|
+
show: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const showMessage: (obj?: {}) => CreateMessage;
|
|
20
|
+
export declare const showLoading: (obj?: {}) => CreateLoading;
|
|
21
|
+
interface DialogOptionsType {
|
|
22
|
+
title?: string;
|
|
23
|
+
message: string | Function;
|
|
24
|
+
confirmText?: string;
|
|
25
|
+
cancelText?: string;
|
|
26
|
+
type?: string;
|
|
27
|
+
showCancelButton?: Boolean;
|
|
28
|
+
showconfirmButton?: Boolean;
|
|
29
|
+
closeOnClickOverlay?: Boolean;
|
|
30
|
+
lockScroll?: Boolean;
|
|
31
|
+
onConfirm?: Function;
|
|
32
|
+
onCancel?: Function;
|
|
33
|
+
}
|
|
34
|
+
export declare function showConfirmDialog(options: DialogOptionsType): Promise<unknown>;
|
|
35
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mg-ocr-invoice",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -18,13 +18,12 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@types/js-cookie": "^3.0.3",
|
|
20
20
|
"axios": "^1.4.0",
|
|
21
|
-
"compressorjs": "^1.2.1",
|
|
22
21
|
"decimal.js": "^10.4.3",
|
|
23
|
-
"element-plus": "^2.3.7",
|
|
24
22
|
"js-cookie": "^3.0.5",
|
|
25
23
|
"swiper": "^9.3.2",
|
|
26
|
-
"
|
|
24
|
+
"v-viewer": "^3.0.21",
|
|
27
25
|
"vconsole": "^3.15.1",
|
|
26
|
+
"viewerjs": "^1.11.7",
|
|
28
27
|
"vue": "^3.2.47"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<transition appear name="dialog-fade">
|
|
3
|
+
<div
|
|
4
|
+
v-if="isShow"
|
|
5
|
+
class="dialog-overlay"
|
|
6
|
+
:style="{ zIndex: OCR_getMaxZIndex() + 1 }">
|
|
7
|
+
<div class="dialog-container">
|
|
8
|
+
<div class="dialog-header">
|
|
9
|
+
<h2 v-if="title" class="dialog-title">{{ props.title }}</h2>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="dialog-content">
|
|
12
|
+
<div v-if="props.message">
|
|
13
|
+
<div
|
|
14
|
+
v-if="handleMessage.type === 'function'"
|
|
15
|
+
ref="RefMessage"></div>
|
|
16
|
+
<div v-else>{{ props.message }}</div>
|
|
17
|
+
</div>
|
|
18
|
+
<slot v-else></slot>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="dialog-footer">
|
|
22
|
+
<button
|
|
23
|
+
v-if="props.showCancelButton"
|
|
24
|
+
class="dialog-btn cancel-btn"
|
|
25
|
+
@click="handleCancel">
|
|
26
|
+
{{ cancelText }}
|
|
27
|
+
</button>
|
|
28
|
+
<button
|
|
29
|
+
v-if="props.showconfirmButton"
|
|
30
|
+
class="dialog-btn confirm-btn"
|
|
31
|
+
:class="confirmButtonClass"
|
|
32
|
+
@click="handleConfirm">
|
|
33
|
+
{{ props.confirmText }}
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</transition>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script setup lang="ts">
|
|
42
|
+
import { OCR_getMaxZIndex } from '@/utils/common'
|
|
43
|
+
import { ref, computed, watch, onMounted, render } from 'vue'
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
visible: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
title: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: '提示',
|
|
52
|
+
},
|
|
53
|
+
message: {
|
|
54
|
+
type: [String, Function],
|
|
55
|
+
default: '确定执行此操作吗?',
|
|
56
|
+
},
|
|
57
|
+
confirmText: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: '确定',
|
|
60
|
+
},
|
|
61
|
+
cancelText: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: '取消',
|
|
64
|
+
},
|
|
65
|
+
showCancelButton: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true,
|
|
68
|
+
},
|
|
69
|
+
showconfirmButton: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true,
|
|
72
|
+
},
|
|
73
|
+
type: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: 'default',
|
|
76
|
+
},
|
|
77
|
+
closeOnClickOverlay: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false,
|
|
80
|
+
},
|
|
81
|
+
lockScroll: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: true,
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
const emit = defineEmits(['update:visible', 'confirm', 'cancel', 'close'])
|
|
87
|
+
const isShow = ref(props.visible)
|
|
88
|
+
// 确认按钮类名
|
|
89
|
+
const confirmButtonClass = computed(() => {
|
|
90
|
+
return {
|
|
91
|
+
warning: props.type === 'warning',
|
|
92
|
+
danger: props.type === 'danger',
|
|
93
|
+
success: props.type === 'success',
|
|
94
|
+
info: props.type === 'info',
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
const RefMessage = ref()
|
|
98
|
+
const handleMessage: any = computed(() => {
|
|
99
|
+
if (typeof props.message === 'function') {
|
|
100
|
+
return {
|
|
101
|
+
type: 'function',
|
|
102
|
+
message: props.message,
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
return {
|
|
106
|
+
type: 'String',
|
|
107
|
+
message: props.message,
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
// 处理确认
|
|
112
|
+
const handleConfirm = () => {
|
|
113
|
+
emit('confirm')
|
|
114
|
+
closeDialog()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// 处理取消
|
|
118
|
+
const handleCancel = () => {
|
|
119
|
+
emit('cancel')
|
|
120
|
+
closeDialog()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 关闭对话框
|
|
124
|
+
const closeDialog = () => {
|
|
125
|
+
isShow.value = false
|
|
126
|
+
emit('update:visible', false)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// 锁定滚动条
|
|
130
|
+
const lockBodyScroll = (shouldLock: boolean) => {
|
|
131
|
+
if (!props.lockScroll) return
|
|
132
|
+
document.body.style.overflow = shouldLock ? 'hidden' : ''
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
watch(
|
|
136
|
+
() => props.visible,
|
|
137
|
+
(val) => {
|
|
138
|
+
console.log(123)
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
// 组件挂载时初始化
|
|
143
|
+
onMounted(() => {
|
|
144
|
+
if (props.visible) {
|
|
145
|
+
lockBodyScroll(true)
|
|
146
|
+
if (handleMessage.value.type === 'function') {
|
|
147
|
+
render(handleMessage.value.message(), RefMessage.value)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
})
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
<style scoped>
|
|
154
|
+
.dialog-overlay {
|
|
155
|
+
position: fixed;
|
|
156
|
+
top: 0;
|
|
157
|
+
left: 0;
|
|
158
|
+
right: 0;
|
|
159
|
+
bottom: 0;
|
|
160
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
161
|
+
display: flex;
|
|
162
|
+
justify-content: center;
|
|
163
|
+
align-items: center;
|
|
164
|
+
transition: opacity 0.3s ease;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.dialog-container {
|
|
168
|
+
background-color: white;
|
|
169
|
+
border-radius: 12px;
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
|
|
172
|
+
transition: all 0.3s ease;
|
|
173
|
+
max-width: 90%;
|
|
174
|
+
width: 90%;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.dialog-header {
|
|
178
|
+
padding: 24px 24px 16px;
|
|
179
|
+
text-align: center;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.dialog-title {
|
|
183
|
+
font-size: 18px;
|
|
184
|
+
font-weight: 600;
|
|
185
|
+
color: #333;
|
|
186
|
+
margin: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.dialog-content {
|
|
190
|
+
padding: 0 24px 24px;
|
|
191
|
+
text-align: center;
|
|
192
|
+
font-size: 14px;
|
|
193
|
+
color: #666;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.dialog-footer {
|
|
197
|
+
display: flex;
|
|
198
|
+
border-top: 1px solid #eee;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.dialog-btn {
|
|
202
|
+
flex: 1;
|
|
203
|
+
/* height: 50px; */
|
|
204
|
+
padding: 12px 0;
|
|
205
|
+
border: none;
|
|
206
|
+
background: none;
|
|
207
|
+
font-size: 16px;
|
|
208
|
+
font-weight: 500;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
transition: all 0.2s ease;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.dialog-btn:active {
|
|
214
|
+
opacity: 0.8;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.cancel-btn {
|
|
218
|
+
color: #666;
|
|
219
|
+
border-right: 1px solid #eee;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.confirm-btn {
|
|
223
|
+
color: #1890ff;
|
|
224
|
+
font-weight: 600;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.confirm-btn.warning {
|
|
228
|
+
color: #faad14;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.confirm-btn.danger {
|
|
232
|
+
color: #f5222d;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.confirm-btn.success {
|
|
236
|
+
color: #52c41a;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.confirm-btn.info {
|
|
240
|
+
color: #1890ff;
|
|
241
|
+
}
|
|
242
|
+
/* 动画优化 */
|
|
243
|
+
.dialog-fade-enter-active,
|
|
244
|
+
.dialog-fade-leave-active {
|
|
245
|
+
transition: opacity 0.3s ease;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.dialog-fade-enter-from,
|
|
249
|
+
.dialog-fade-leave-to {
|
|
250
|
+
opacity: 0;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.dialog-fade-enter-active .dialog-container,
|
|
254
|
+
.dialog-fade-leave-active .dialog-container {
|
|
255
|
+
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.dialog-fade-enter-from .dialog-container {
|
|
259
|
+
transform: scale(0.3) translateY(20px);
|
|
260
|
+
opacity: 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.dialog-fade-leave-to .dialog-container {
|
|
264
|
+
transform: scale(0.6);
|
|
265
|
+
opacity: 0;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.dialog-fade-enter-to .dialog-container,
|
|
269
|
+
.dialog-fade-leave-from .dialog-container {
|
|
270
|
+
transform: scale(1);
|
|
271
|
+
opacity: 1;
|
|
272
|
+
}
|
|
273
|
+
</style>
|