Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
8776bf95
提交
8776bf95
编写于
5月 28, 2019
作者:
chengxiang.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
7b9f1037
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
65 行增加
和
42 行删除
+65
-42
new-patient-wrap.less
src/style/patient-manager/new-patient/new-patient-wrap.less
+17
-0
batch-import.vue
src/views/patients/new-manage/components/batch-import.vue
+48
-42
未找到文件。
src/style/patient-manager/new-patient/new-patient-wrap.less
浏览文件 @
8776bf95
...
@@ -25,4 +25,21 @@
...
@@ -25,4 +25,21 @@
text-align: right;
text-align: right;
}
}
}
}
.batch-import-wrap{
.el-upload-list{
display: none;
}
.upload-success-modal{
.el-dialog__body{
padding: 5px 25px 20px;
}
.tips{
text-align: center;
line-height: 25px;
i{
color: #449284;
}
}
}
}
}
}
\ No newline at end of file
src/views/patients/new-manage/components/batch-import.vue
浏览文件 @
8776bf95
<
template
>
<
template
>
<div>
<div
class=
"batch-import-wrap"
>
<div
class=
"step-guide"
>
<div
class=
"step-guide"
>
<ul
class=
"guide-list"
>
<ul
class=
"guide-list"
>
<li
class=
"first"
>
<li
class=
"first"
>
...
@@ -59,18 +59,10 @@
...
@@ -59,18 +59,10 @@
class=
"upload-file"
class=
"upload-file"
drag
drag
action=
"#"
action=
"#"
accept=
".xlsx"
:headers=
"uploadHeaders"
:file-list=
"files"
:before-upload=
"getPostData"
:before-upload=
"getPostData"
:on-change=
"changeFile"
:http-request=
"notUseDefaultUpload"
>
:on-error=
"uploadError"
:on-success=
"uploadSuccess"
:show-file-list=
"false"
:multiple=
"false"
>
<i
class=
"el-icon-upload"
></i>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<!--
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传jpg/png文件,且不超过500kb
</div>
-->
</el-upload>
</el-upload>
</div>
</div>
</li>
</li>
...
@@ -127,6 +119,20 @@
...
@@ -127,6 +119,20 @@
layout=
"total, sizes, prev, pager, next, jumper"
>
layout=
"total, sizes, prev, pager, next, jumper"
>
</el-pagination>
</el-pagination>
</div>
</div>
<!-- 上传成功弹窗 -->
<el-dialog
class=
"upload-success-modal"
title=
"上传成功"
:visible
.
sync=
"showUploadSuccess"
width=
"400px"
:show-close=
"false"
:close-on-click-modal=
"false"
center
>
<p
class=
"tips"
>
我们会在
<i>
3-5个工作日
</i>
内进行处理,届时您可以在上传历史记录列表查看处理结果
</p>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"handleCloseUploadSuccess"
>
我知道了
</el-button>
</span>
</el-dialog>
</div>
</div>
</
template
>
</
template
>
...
@@ -151,17 +157,30 @@
...
@@ -151,17 +157,30 @@
token
:
localStorage
.
getItem
(
'token'
)
token
:
localStorage
.
getItem
(
'token'
)
},
},
files
:
[],
files
:
[],
postData
:
{
axx
:
1
},
postData
:
{},
showUploadSuccess
:
false
,
}
}
},
},
created
()
{
created
()
{
this
.
goToGetUploadHistory
();
this
.
goToGetUploadHistory
();
},
},
methods
:
{
methods
:
{
notUseDefaultUpload
(){
// console.log('just console>>>>>>>>')
},
getPostData
(
file
)
{
getPostData
(
file
)
{
let
self
=
this
;
let
self
=
this
;
let
arr
=
file
.
type
.
split
(
'/'
);
let
arr
=
file
.
type
.
split
(
'/'
);
let
ext
=
"."
+
arr
[
1
];
let
ext
=
"."
+
arr
[
1
];
let
name
=
file
.
name
;
let
type
=
name
.
substring
(
name
.
lastIndexOf
(
'.'
)
+
1
);
if
(
type
!==
'xls'
&&
type
!==
'xlsx'
)
{
self
.
$message
({
message
:
'上传文件只能是 xls、xlsx格式!'
,
type
:
'warning'
});
return
;
}
let
reader
=
new
FileReader
();
let
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
reader
.
onload
=
function
(
e
)
{
self
.
$message
(
'开始导入'
);
self
.
$message
(
'开始导入'
);
...
@@ -176,46 +195,28 @@
...
@@ -176,46 +195,28 @@
base64
:
fileJson
base64
:
fileJson
}];
}];
// openLoading(self);
let
req
=
{
let
req
=
{
// token: localStorage.getItem("token"),
// token: localStorage.getItem("token"),
token
:
'F868A5F84DD9433E93E00E3952A16364'
,
token
:
'F868A5F84DD9433E93E00E3952A16364'
,
fileArray
:
fileArray
,
fileArray
:
fileArray
,
import_type
:
2
,
import_type
:
2
,
};
};
//
// console.log('req ', req);
console
.
log
(
'string req '
,
JSON
.
stringify
(
req
))
// self.postData = req;
self
.
postData
=
JSON
.
stringify
(
req
);
self
.
postData
=
JSON
.
stringify
(
req
);
uploadExcel
(
self
.
postData
).
then
(
res
=>
{
uploadExcel
(
self
.
postData
).
then
(
res
=>
{
console
.
log
(
'%c res >> '
,
'color: red;'
,
res
)
console
.
log
(
'%c res >> '
,
'color: red;'
,
res
)
if
(
typeof
res
.
import_type
!=
'undefined'
&&
res
.
importFlag
==
true
){
self
.
$message
({
message
:
'上传成功!'
,
type
:
'success'
});
}
else
{
self
.
$message
({
message
:
'上传失败,请重新上传!'
,
type
:
'success'
});
}
})
})
// self.$axios.post(localStorage.getItem("Url") + 'importServiceImpl/importToQuestionPool'
// , JSON.stringify(req)
// ).then(function (res) {
// closeLoading(self);
// let data = JSON.parse(JSON.stringify(res.data));//通过这个实现深拷贝
// if (data.flag) {
// self.$message('导入成功' + data.successNum + '条(重复的题目不会导入!)');
// self.getLabelList();
// self.search();
// } else {
// self.$message.error('导入题目失败');
// let errorList = data.errorList;
// let message = "";
// if (isNotEmptyUtils(errorList)) {
// for (let i = 0; i
<
errorList
.
length
;
i
++
)
{
// message += "第" + errorList[i].index + "行:" + errorList[i].name + '
<
br
>
';
// }
// }
// htmlMessageBox(self, "警告", message, "确定", function () {
// }, "", null, "warning");
// }
// }).catch(function (error) {
// self.$message.error('
导入题目失败
');
// errorResponseCheck(error, self);
// });
};
};
reader
.
readAsDataURL
(
file
);
reader
.
readAsDataURL
(
file
);
},
},
...
@@ -294,9 +295,14 @@
...
@@ -294,9 +295,14 @@
this
.
searchData
.
pageSize
=
val
;
this
.
searchData
.
pageSize
=
val
;
this
.
goToGetUploadHistory
();
this
.
goToGetUploadHistory
();
},
},
handleCloseUploadSuccess
()
{
this
.
showUploadSuccess
=
false
;
},
},
},
}
}
</
script
>
</
script
>
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录