Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
9ceb942e
提交
9ceb942e
编写于
8月 29, 2020
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加app-data-upload上传服务器数据切片
上级
2d7b470a
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
4 行删除
+44
-4
app-data-upload.less
src/components/app-data-upload/app-data-upload.less
+3
-0
app-data-upload.vue
src/components/app-data-upload/app-data-upload.vue
+41
-4
未找到文件。
src/components/app-data-upload/app-data-upload.less
浏览文件 @
9ceb942e
...
...
@@ -18,4 +18,7 @@
font-family: '微软雅黑','黑体','宋体';
font-size: 16px;
}
.progress {
margin-top: -15px;
}
}
\ No newline at end of file
src/components/app-data-upload/app-data-upload.vue
浏览文件 @
9ceb942e
<
template
>
<div
class=
"app-data-upload-view"
>
<div
class=
"app-data-upload-view"
v-loading
.
fullscreen=
"isUploading"
element-loading-background=
"rgba(57, 57, 57, 0.2)"
>
<el-row
style=
"margin-top:24px"
:gutter=
"20"
>
<el-col
:span=
"4"
>
<el-button
type=
"primary"
@
click=
"handleUpLoad"
>
{{
$t
(
'components.appDataUploadView.selectfile'
)
}}
</el-button>
...
...
@@ -13,6 +13,7 @@
</el-col>
</el-row>
<el-divider></el-divider>
<el-progress
class=
"progress"
v-show=
"isUploading"
:text-inside=
"true"
:stroke-width=
"14"
:percentage=
"uploadProgress"
></el-progress>
<el-row
style=
"height:480px;padding: 0px 12px;"
>
<div
class=
"data-info-content"
>
<template
v-if=
"importDataArray.length >0 && isUploading === false"
>
...
...
@@ -50,6 +51,7 @@ import XLSX from 'xlsx';
import
CodeListService
from
"@service/app/codelist-service"
;
import
EntityService
from
'@/service/entity-service'
;
import
{
Vue
,
Component
,
Prop
,
Provide
,
Emit
,
Watch
}
from
'vue-property-decorator'
;
import
{
Environment
}
from
'@/environments/environment'
;
@
Component
({
})
...
...
@@ -192,6 +194,22 @@ export default class AppDataUploadView extends Vue {
*/
public
allFieldMap
:
Map
<
string
,
any
>
=
new
Map
();
/**
* 上传服务器数据切片数
*
* @type {number}
* @memberof AppDataUploadView
*/
public
sliceUploadCnt
:
number
=
Environment
.
sliceUploadCnt
;
/**
* 上传服务器进度条百分比
*
* @type {number}
* @memberof AppDataUploadView
*/
public
uploadProgress
:
number
=
0
;
/**
* 视图参数变化
*
...
...
@@ -282,10 +300,29 @@ export default class AppDataUploadView extends Vue {
this
.
transformData
(
this
.
importDataArray
,
tempDataArray
);
this
.
hasImported
=
true
;
this
.
isUploading
=
true
;
this
.
uploadProgress
=
0
;
this
.
importDataArray
=
[];
this
.
sliceUploadService
(
tempDataArray
,
0
);
}
/**
* 数据切片上传
*
* @memberof AppDataUploadView
*/
public
sliceUploadService
(
dataArray
:
Array
<
any
>
,
cnt
:
number
)
{
if
(
cnt
>
dataArray
.
length
)
{
this
.
isUploading
=
false
;
this
.
uploadProgress
=
100
;
return
;
}
let
sliceArray
:
Array
<
any
>
=
[];
if
(
dataArray
)
{
sliceArray
=
dataArray
.
slice
(
cnt
,
cnt
+
this
.
sliceUploadCnt
);
}
try
{
this
.
entityService
.
getService
(
this
.
viewparams
.
serviceName
).
then
((
service
:
any
)
=>
{
service
.
ImportData
(
this
.
viewdata
,{
name
:
this
.
importId
,
importData
:
tempData
Array
}).
then
((
res
:
any
)
=>
{
service
.
ImportData
(
this
.
viewdata
,{
name
:
this
.
importId
,
importData
:
slice
Array
}).
then
((
res
:
any
)
=>
{
const
result
:
any
=
res
.
data
;
if
(
result
&&
result
.
rst
!==
0
){
this
.
promptInfo
=
(
this
.
$t
(
'components.appDataUploadView.importfailed'
)
as
string
);
...
...
@@ -294,7 +331,8 @@ export default class AppDataUploadView extends Vue {
}
this
.
importSuccessData
=
result
.
data
;
this
.
promptInfo
=
(
this
.
$t
(
'components.appDataUploadView.completed'
)
as
string
);
this
.
isUploading
=
false
;
this
.
uploadProgress
=
Number
((
cnt
/
dataArray
.
length
*
100
).
toFixed
(
2
));
this
.
sliceUploadService
(
dataArray
,
cnt
+
this
.
sliceUploadCnt
);
}).
catch
((
error
:
any
)
=>
{
this
.
isUploading
=
false
;
this
.
promptInfo
=
(
this
.
$t
(
'components.appDataUploadView.importfailed'
)
as
string
);
...
...
@@ -311,7 +349,6 @@ export default class AppDataUploadView extends Vue {
console
.
error
(
error
);
};
}
/**
* 导出excel
*
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录