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
8ddee006
Commit
8ddee006
authored
Feb 09, 2023
by
刘泽志
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档上传
parent
b63a9f74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
162 additions
and
13 deletions
+162
-13
Emport.js
src/api/emport/Emport.js
+70
-13
AutoUpload.vue
src/views/emport/emport/AutoUpload.vue
+92
-0
index.vue
src/views/emport/emport/index.vue
+0
-0
index.vue
src/views/emport/rule/index.vue
+0
-0
No files found.
src/api/emport/Emport.js
View file @
8ddee006
...
...
@@ -145,17 +145,6 @@ export function queryDbField(dataSourceId,tableName) {
})
}
/**
* 文件上传
* @param data
* @returns {*}
*/
export
async
function
uploadExcel
(
data
)
{
return
{
code
:
200
}
}
/**
* 字段查询
...
...
@@ -271,4 +260,73 @@ export function deleteRule(ruleId) {
method
:
'delete'
,
params
:{
ruleId
}
})
}
\ No newline at end of file
}
/**
* 规则测试
* @param data
* @returns {*}
*/
export
function
ruleTest
(
data
)
{
return
request
({
url
:
`
${
prefix
}
/rule/test`
,
method
:
'post'
,
data
})
}
/**
* 快速绑定
* @param templateId
* @param ruleId
* @returns {AxiosPromise}
*/
export
function
quickBind
(
templateId
,
ruleId
)
{
return
request
({
url
:
`
${
prefix
}
/bind/quick`
,
method
:
'get'
,
params
:{
templateId
,
ruleId
}
})
}
/**
* 查询绑定的规则
* @param fieldId
* @returns {AxiosPromise}
*/
export
function
queryBindRule
(
fieldId
)
{
return
request
({
url
:
`
${
prefix
}
/bind`
,
method
:
'get'
,
params
:{
fieldId
}
})
}
/**
* 配置字段规则绑定
* @param data
* @returns {AxiosPromise}
*/
export
function
bindRule
(
data
)
{
return
request
({
url
:
`
${
prefix
}
/bind`
,
method
:
'post'
,
data
})
}
/**
* 上传excel
* @param data
* @returns {*}
*/
export
function
uploadExcel
(
data
)
{
return
request
({
url
:
`
${
prefix
}
/upload`
,
method
:
'post'
,
data
,
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
src/views/emport/emport/AutoUpload.vue
0 → 100644
View file @
8ddee006
<
template
>
<el-dialog
:before-close=
"cancel"
:close-on-click-modal=
"false"
:title=
"title"
:visible=
"open"
:width=
"width"
append-to-body
@
close=
"clearFiles"
>
<div>
<el-upload
ref=
"upload"
:auto-upload=
"false"
:http-request=
"httpRequest"
:multiple=
"multiple"
:on-change=
"handleChange"
action=
"xxx"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
v-if=
"accept.length > 0"
slot=
"tip"
class=
"el-upload__tip"
>
只能上传
{{
accept
.
join
(
"/"
)
}}
文件
</div>
</el-upload>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"upload"
>
上传
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
export
default
{
name
:
"AutoUpload"
,
props
:
{
title
:
{
type
:
String
,
default
:
''
},
width
:
{
type
:
String
,
default
:
'400px'
},
open
:
{
type
:
Boolean
,
default
:
false
},
accept
:
{
type
:
Array
,
default
:
()
=>
[]
},
multiple
:
{
type
:
Boolean
,
default
:
true
}
},
methods
:
{
cancel
()
{
this
.
clearFiles
()
this
.
$emit
(
"update:open"
,
false
);
},
upload
()
{
this
.
$refs
.
upload
.
submit
();
},
handleChange
(
file
,
fileList
)
{
let
fileType
=
file
.
name
.
substring
(
file
.
name
.
lastIndexOf
(
'.'
)
+
1
)
if
(
this
.
accept
.
length
>
0
)
{
let
extension
=
this
.
accept
.
some
(
item
=>
{
return
item
===
fileType
.
toLowerCase
();
})
if
(
!
extension
)
{
this
.
$message
.
warning
(
`请选择类型为
${
this
.
accept
.
join
(
"/"
)}
的文件`
)
fileList
.
splice
(
-
1
,
1
);
//移除选中
}
}
},
httpRequest
({
file
,
onError
,
onProgress
,
onSuccess
}){
//let formData = new FormData()
//formData.append("file",file)
this
.
$emit
(
'upload'
,
{
file
,
onSuccess
})
},
clearFiles
(){
if
(
this
.
$refs
.
upload
){
this
.
$refs
.
upload
.
clearFiles
()
}
}
}
}
</
script
>
<
style
scoped
>
</
style
>
src/views/emport/emport/index.vue
View file @
8ddee006
This diff is collapsed.
Click to expand it.
src/views/emport/rule/index.vue
View file @
8ddee006
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