t20-common-lib 0.14.6 → 0.14.8
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/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
style="margin-bottom: 0; margin-top: 30px"
|
|
5
5
|
:width="width"
|
|
6
6
|
:visible.sync="progressV"
|
|
7
|
-
:title="
|
|
7
|
+
:title="dialogTitle"
|
|
8
8
|
append-to-body
|
|
9
9
|
:close-on-click-modal="false"
|
|
10
10
|
:close-on-press-escape="false"
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
<slot name="top" :validateResult="validateResult"></slot>
|
|
14
14
|
<div style="min-height: 28px">
|
|
15
15
|
<template v-if="!hidePercent">
|
|
16
|
-
<p v-if="!percentType"
|
|
16
|
+
<p v-if="!percentType">{{ $lc('系统处理中,请稍等......') }}</p>
|
|
17
17
|
<div v-else>
|
|
18
18
|
<div v-if="validateResult" class="m-b">
|
|
19
|
-
<span class="m-r-m"
|
|
19
|
+
<span class="m-r-m">{{ $lc('导入文件') }}</span>
|
|
20
20
|
{{ validateResult.name }}
|
|
21
21
|
</div>
|
|
22
22
|
<div class="flex-box">
|
|
23
|
-
<div class="m-r-m"
|
|
23
|
+
<div class="m-r-m">{{ $lc('导入进度') }}</div>
|
|
24
24
|
<div class="flex-item">
|
|
25
25
|
<el-progress
|
|
26
26
|
class="m-b"
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
<template v-if="validateResult">
|
|
35
35
|
<div class="m-b">
|
|
36
|
-
<span class="m-r"
|
|
37
|
-
<span
|
|
36
|
+
<span class="m-r">{{ $lc('导入统计') }}</span>
|
|
37
|
+
<span>{{ $lc('共计导入') }}{{ validateResult.totalNum }}{{ $lc('条') }},</span>
|
|
38
38
|
<span class="m-r-s">
|
|
39
|
-
其中有效数据
|
|
39
|
+
{{ $lc('其中有效数据') }}
|
|
40
40
|
<span class="color-success">{{ validateResult.successNum }}</span>
|
|
41
|
-
|
|
41
|
+
{{ $lc('条') }},
|
|
42
42
|
</span>
|
|
43
43
|
<span>
|
|
44
|
-
无效数据
|
|
44
|
+
{{ $lc('无效数据') }}
|
|
45
45
|
<span class="color-danger">{{ validateResult.errorList?.length }}</span>
|
|
46
|
-
条。
|
|
46
|
+
{{ $lc('条。') }}
|
|
47
47
|
</span>
|
|
48
48
|
</div>
|
|
49
49
|
<template v-if="validateResult.errorList?.length">
|
|
50
50
|
<div class="bd-a">
|
|
51
51
|
<div class="flex-box flex-lr flex-v m-t m-b p-l p-r">
|
|
52
|
-
<span
|
|
53
|
-
<el-button v-if="showErrorExport" type="text" @click="importError"
|
|
52
|
+
<span>{{ $lc('无效数据详情') }}</span>
|
|
53
|
+
<el-button v-if="showErrorExport" type="text" @click="importError">{{ $lc('导出错误数据') }}</el-button>
|
|
54
54
|
</div>
|
|
55
55
|
<N20-table-pro
|
|
56
56
|
ref="vTable"
|
|
@@ -72,9 +72,7 @@
|
|
|
72
72
|
/>
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
75
|
-
<
|
|
76
|
-
<div class="color-warning m-t-s">上述数据输入有误,请修改导入文件中相关信息!</div>
|
|
77
|
-
</slot>
|
|
75
|
+
<div class="color-warning m-t-s">{{ '上述数据输入有误,请修改导入文件中相关信息!' | $lc }}</div>
|
|
78
76
|
</template>
|
|
79
77
|
</template>
|
|
80
78
|
</div>
|
|
@@ -104,9 +102,7 @@
|
|
|
104
102
|
{{ footerBtn.cancel.text | $lc }}
|
|
105
103
|
</el-button>
|
|
106
104
|
</template>
|
|
107
|
-
<el-button v-else-if="validateResult || percentType === 'success'" type="primary" @click="confirmFn">
|
|
108
|
-
确认
|
|
109
|
-
</el-button>
|
|
105
|
+
<el-button v-else-if="validateResult || percentType === 'success'" type="primary" @click="confirmFn">{{ $lc('确认') }}</el-button>
|
|
110
106
|
</div>
|
|
111
107
|
</el-dialog>
|
|
112
108
|
</template>
|
|
@@ -156,6 +152,9 @@ export default {
|
|
|
156
152
|
}
|
|
157
153
|
},
|
|
158
154
|
computed: {
|
|
155
|
+
dialogTitle() {
|
|
156
|
+
return this.title || this.$lc('提示')
|
|
157
|
+
},
|
|
159
158
|
progressV: {
|
|
160
159
|
get() {
|
|
161
160
|
return this.visible
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<el-button size="mini" type="primary">{{ $t('gbebit_w_c_0103') }}</el-button>
|
|
5
5
|
</slot>
|
|
6
6
|
<el-dropdown-menu slot="dropdown">
|
|
7
|
-
<el-dropdown-item command="import"
|
|
8
|
-
<el-dropdown-item command="down"
|
|
7
|
+
<el-dropdown-item command="import">{{ $lc('模版导入') }}</el-dropdown-item>
|
|
8
|
+
<el-dropdown-item command="down">{{ $lc('模版下载') }}</el-dropdown-item>
|
|
9
9
|
</el-dropdown-menu>
|
|
10
10
|
<div style="display: none">
|
|
11
11
|
<uploadMsg
|
|
12
12
|
:pagination="pagination"
|
|
13
|
-
:title="$
|
|
13
|
+
:title="$lc('导入文件')"
|
|
14
14
|
:visible.sync="errorV"
|
|
15
15
|
:width="width"
|
|
16
16
|
:show-error-export="showErrorExport"
|
|
@@ -81,10 +81,10 @@ export default {
|
|
|
81
81
|
},
|
|
82
82
|
methods: {
|
|
83
83
|
getDefaultErrorExportFileName() {
|
|
84
|
-
const baseName = String(this.fileName || '导入文件')
|
|
84
|
+
const baseName = String(this.fileName || this.$lc('导入文件'))
|
|
85
85
|
const pureName = baseName.replace(/\.(xlsx|xls|csv)$/i, '')
|
|
86
|
-
const date = parseDate(new Date(),
|
|
87
|
-
return `${pureName}
|
|
86
|
+
const date = parseDate(new Date(), 'yyyyMMdd')
|
|
87
|
+
return `${pureName}-${this.$lc('错误数据')}-${date}.xlsx`
|
|
88
88
|
},
|
|
89
89
|
getErrorExportParams() {
|
|
90
90
|
return {
|
|
@@ -198,8 +198,9 @@ export default {
|
|
|
198
198
|
},
|
|
199
199
|
expectedHeaderForColumn(col) {
|
|
200
200
|
const label = String(col.label == null ? '' : col.label).trim()
|
|
201
|
-
const required = col.required === true
|
|
202
|
-
return required ? `* ${label}` : label
|
|
201
|
+
// const required = col.required === true
|
|
202
|
+
// return required ? `* ${label}` : label
|
|
203
|
+
return label
|
|
203
204
|
},
|
|
204
205
|
buildSheetPayload(headers, rows, columnTree) {
|
|
205
206
|
const leafCols = this.flattenLeafColumns(columnTree)
|
|
@@ -247,7 +248,7 @@ export default {
|
|
|
247
248
|
}
|
|
248
249
|
writeImportErrorExcel(this.getErrorExportParams()).catch(error => {
|
|
249
250
|
console.error('writeImportErrorExcel failed:', error)
|
|
250
|
-
this.$message.error(this.$
|
|
251
|
+
this.$message.error(this.$lc('导入模板解析失败,请检查模板内容后重试'))
|
|
251
252
|
})
|
|
252
253
|
},
|
|
253
254
|
commandFn(val) {
|
package/src/i18n.json
CHANGED
|
@@ -37,5 +37,53 @@
|
|
|
37
37
|
},
|
|
38
38
|
"请输入": {
|
|
39
39
|
"en": "Please enter"
|
|
40
|
+
},
|
|
41
|
+
"模版导入": {
|
|
42
|
+
"en": "Import Template"
|
|
43
|
+
},
|
|
44
|
+
"模版下载": {
|
|
45
|
+
"en": "Download Template"
|
|
46
|
+
},
|
|
47
|
+
"导入文件": {
|
|
48
|
+
"en": "Import File"
|
|
49
|
+
},
|
|
50
|
+
"错误数据": {
|
|
51
|
+
"en": "Error Data"
|
|
52
|
+
},
|
|
53
|
+
"导入模板解析失败,请检查模板内容后重试": {
|
|
54
|
+
"en": "Failed to parse import template. Please check the template content and try again."
|
|
55
|
+
},
|
|
56
|
+
"提示": {
|
|
57
|
+
"en": "Prompt"
|
|
58
|
+
},
|
|
59
|
+
"系统处理中,请稍等......": {
|
|
60
|
+
"en": "Processing, please wait..."
|
|
61
|
+
},
|
|
62
|
+
"导入进度": {
|
|
63
|
+
"en": "Import Progress"
|
|
64
|
+
},
|
|
65
|
+
"导入统计": {
|
|
66
|
+
"en": "Import Statistics"
|
|
67
|
+
},
|
|
68
|
+
"共计导入": {
|
|
69
|
+
"en": "Total Imported"
|
|
70
|
+
},
|
|
71
|
+
"其中有效数据": {
|
|
72
|
+
"en": "Valid Data"
|
|
73
|
+
},
|
|
74
|
+
"无效数据": {
|
|
75
|
+
"en": "Invalid Data"
|
|
76
|
+
},
|
|
77
|
+
"无效数据详情": {
|
|
78
|
+
"en": "Invalid Data Details"
|
|
79
|
+
},
|
|
80
|
+
"导出错误数据": {
|
|
81
|
+
"en": "Export Error Data"
|
|
82
|
+
},
|
|
83
|
+
"条": {
|
|
84
|
+
"en": " items"
|
|
85
|
+
},
|
|
86
|
+
"条。": {
|
|
87
|
+
"en": " items."
|
|
40
88
|
}
|
|
41
89
|
}
|