Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
emport-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘泽志
emport-web
Commits
12f2ed43
Commit
12f2ed43
authored
Feb 10, 2023
by
刘泽志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档上传
parent
bb8f553e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
0 deletions
+129
-0
Emport.js
src/api/emport/Emport.js
+64
-0
AutoLoading.vue
src/views/emport/emport/AutoLoading.vue
+65
-0
index.vue
src/views/emport/emport/index.vue
+0
-0
No files found.
src/api/emport/Emport.js
View file @
12f2ed43
...
...
@@ -332,6 +332,44 @@ export function uploadExcel(data) {
}
/**
* 下载模板
* @param excelId
* @returns {*}
*/
export
function
downloadTemplate
(
excelId
)
{
return
request
({
url
:
`
${
prefix
}
/template/download`
,
method
:
'get'
,
params
:{
excelId
},
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
},
responseType
:
"blob"
,
})
}
/**
* 下载模板
* @param excelId
* @returns {*}
*/
export
function
getTemplateFileName
(
excelId
)
{
return
request
({
url
:
`
${
prefix
}
/template/download/filename`
,
method
:
'get'
,
params
:{
excelId
}
})
}
export
async
function
blobValidate
(
data
)
{
try
{
const
text
=
await
data
.
text
();
JSON
.
parse
(
text
);
return
false
;
}
catch
(
error
)
{
return
true
;
}
}
/**
* 根据基础模板重置字段
* @param excelId
* @returns {*}
...
...
@@ -344,3 +382,29 @@ export function resetField(excelId){
})
}
/**
* 创建物理表
* @param tableName
* @param templateId
* @returns {*}
*/
export
function
createTable
(
tableName
,
templateId
){
return
request
({
url
:
`
${
prefix
}
/table/create`
,
method
:
'get'
,
params
:{
tableName
,
templateId
}
})
}
/**
* 数据分析并导出
* @param templateId
* @returns {*}
*/
export
function
analyzeExport
(
templateId
){
return
request
({
url
:
`
${
prefix
}
/analyze/export`
,
method
:
'get'
,
params
:{
templateId
}
})
}
src/views/emport/emport/AutoLoading.vue
0 → 100644
View file @
12f2ed43
<
template
>
<el-dialog
:close-on-click-modal=
"false"
:show-close=
"false"
:visible=
"loading"
:width=
"width"
append-to-body
center
class=
"dialog-loading"
custom-class=
"dialog-loading-custom"
>
<div
v-loading=
"loading"
:element-loading-text=
"content"
:style=
"
{height: height}"
element-loading-spinner="el-icon-loading"
>
</div>
</el-dialog>
</
template
>
<
script
>
export
default
{
name
:
'AutoLoading'
,
props
:
{
loading
:
{
type
:
Boolean
,
default
:
false
},
content
:
{
type
:
String
,
default
:
''
},
width
:
{
type
:
String
,
default
:
'300px'
},
height
:
{
type
:
String
,
default
:
'200px'
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.dialog-loading
{
::v-deep
{
.el-dialog__header
{
display
:
none
;
}
.el-loading-mask
{
border-radius
:
16px
;
background-color
:
transparent
;
}
.dialog-loading-custom
{
border-radius
:
16px
;
background-color
:
rgba
(
255
,
255
,
255
,
0.5
);
}
.el-dialog__body
{
padding
:
0
;
}
}
}
</
style
>
src/views/emport/emport/index.vue
View file @
12f2ed43
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment