Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
6818126e
提交
6818126e
authored
4月 07, 2023
作者:
陈志磊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
fd51d195
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
126 行增加
和
33 行删除
+126
-33
.eslintrc-auto-import.json
.eslintrc-auto-import.json
+0
-1
auto-imports.d.ts
auto-imports.d.ts
+2
-6
AppUpload.vue
src/components/base/AppUpload.vue
+3
-1
Index.vue
src/modules/label/views/Index.vue
+2
-1
api.ts
src/modules/user/api.ts
+15
-8
UploadEventsDialog.vue
src/modules/user/components/UploadEventsDialog.vue
+29
-7
UploadUserDialog.vue
src/modules/user/components/UploadUserDialog.vue
+23
-9
ViewProgressDialog.vue
src/modules/user/components/ViewProgressDialog.vue
+45
-0
Index.vue
src/modules/user/views/Index.vue
+7
-0
没有找到文件。
.eslintrc-auto-import.json
浏览文件 @
6818126e
...
...
@@ -115,7 +115,6 @@
"useArrayFilter"
:
true
,
"useArrayFind"
:
true
,
"useArrayFindIndex"
:
true
,
"useArrayFindLast"
:
true
,
"useArrayJoin"
:
true
,
"useArrayMap"
:
true
,
"useArrayReduce"
:
true
,
...
...
auto-imports.d.ts
浏览文件 @
6818126e
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-auto-import
// Generated by 'unplugin-auto-import'
export
{}
declare
global
{
const
$$
:
typeof
import
(
'vue/macros'
)[
'$$'
]
...
...
@@ -112,7 +109,6 @@ declare global {
const
useArrayFilter
:
typeof
import
(
'@vueuse/core'
)[
'useArrayFilter'
]
const
useArrayFind
:
typeof
import
(
'@vueuse/core'
)[
'useArrayFind'
]
const
useArrayFindIndex
:
typeof
import
(
'@vueuse/core'
)[
'useArrayFindIndex'
]
const
useArrayFindLast
:
typeof
import
(
'@vueuse/core'
)[
'useArrayFindLast'
]
const
useArrayJoin
:
typeof
import
(
'@vueuse/core'
)[
'useArrayJoin'
]
const
useArrayMap
:
typeof
import
(
'@vueuse/core'
)[
'useArrayMap'
]
const
useArrayReduce
:
typeof
import
(
'@vueuse/core'
)[
'useArrayReduce'
]
...
...
@@ -280,5 +276,5 @@ declare global {
// for type re-export
declare
global
{
// @ts-ignore
export
type
{
Component
,
ComponentPublicInstance
,
ComputedRef
,
InjectionKey
,
PropType
,
Ref
,
VNode
}
from
'vue'
export
type
{
Component
,
ComponentPublicInstance
,
ComputedRef
,
InjectionKey
,
PropType
,
Ref
,
VNode
}
from
'vue'
}
src/components/base/AppUpload.vue
浏览文件 @
6818126e
...
...
@@ -127,7 +127,9 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => {
:on-preview=
"handlePreview"
:on-success=
"handleSuccess"
:file-list=
"fileList"
class=
"uploader"
>
:limit=
"limit"
class=
"uploader"
>
<slot>
<template
v-if=
"showFileList"
>
<template
v-if=
"$attrs['list-type'] === 'picture-card'"
>
...
...
src/modules/label/views/Index.vue
浏览文件 @
6818126e
...
...
@@ -139,7 +139,8 @@ function handleRule(row: Label) {
v-model=
"formVisible"
:data=
"currentRow"
@
update=
"handleRefresh"
v-if=
"formVisible"
></LabelFormDialog>
v-if=
"formVisible"
></LabelFormDialog>
<!-- 查看标签 -->
<LabelViewDialog
v-model=
"viewVisible"
:data=
"currentRow"
v-if=
"viewVisible && currentRow"
></LabelViewDialog>
<!-- 规则 -->
...
...
src/modules/user/api.ts
浏览文件 @
6818126e
...
...
@@ -61,20 +61,26 @@ export function getMemberImage(params: { id: string }) {
}
// 导入事件
export
function
importEvent
(
data
:
{
event_id
:
string
;
file
:
any
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/member/event-upload'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
export
function
importEvent
(
data
:
{
event_id
:
string
;
url
:
string
,
name
:
string
,
size
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/member/event-upload'
,
data
)
}
// 导入用户
export
function
importMember
(
data
:
{
groups_id
?:
string
;
connection_id
:
string
;
file
:
any
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/member/member-upload'
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
// export function importMember(data: { groups_id?: string; connection_id: string; file: any }) {
// return httpRequest.post('/api/lab/v1/experiment/member/member-upload', data, {
// headers: { 'Content-Type': 'multipart/form-data' }
// })
// }
export
function
importMember
(
data
:
{
groups_id
?:
string
;
connection_id
:
string
;
url
:
string
,
name
:
string
,
size
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/member/member-upload'
,
data
)
}
// 用户画像
export
function
getMemberGroups
()
{
return
httpRequest
.
get
(
'/api/lab/v1/experiment/member/groups'
)
}
// 导入进度
export
function
getProgress
()
{
return
httpRequest
.
get
(
'/api/lab/v1/experiment/member/tasks'
)
}
\ No newline at end of file
src/modules/user/components/UploadEventsDialog.vue
浏览文件 @
6818126e
...
...
@@ -3,6 +3,7 @@ import type { FormInstance, FormRules } from 'element-plus'
import
{
ElMessage
}
from
'element-plus'
import
{
getEventList
,
importEvent
}
from
'../api'
import
type
{
EventProp
}
from
'../types'
import
AppUpload
from
'@/components/base/AppUpload.vue'
const
route
=
useRoute
()
...
...
@@ -41,15 +42,25 @@ const downloadTemplate = function () {
}
// 上传
const
fetchFileUpload
=
(
option
:
any
)
=>
{
return
new
Promise
(()
=>
{
importEvent
({
event_id
:
form
.
event_id
,
file
:
option
.
file
}).
then
(()
=>
{
const
fetchFileUpload
=
()
=>
{
if
(
fileData
[
0
])
{
const
params
=
Object
.
assign
(
form
,
fileData
[
0
])
importEvent
(
params
).
then
(()
=>
{
ElMessage
.
success
(
'导入数据成功'
)
emit
(
'update'
)
emit
(
'update:modelValue'
,
false
)
})
})
}
// return new Promise(() => {
// importEvent({ event_id: form.event_id, file: option.file }).then(() => {
// ElMessage.success('导入数据成功')
// emit('update')
// emit('update:modelValue', false)
// })
// })
}
const
fileData
=
$ref
([])
</
script
>
<
template
>
...
...
@@ -70,7 +81,10 @@ const fetchFileUpload = (option: any) => {
</el-form>
<div
class=
"btn-box"
>
<el-button
style=
"margin-right: 20px"
type=
"primary"
@
click=
"downloadTemplate"
>
下载事件数据模板
</el-button>
<el-upload
<AppUpload
v-model=
"fileData"
:limit=
"1"
>
<el-button
type=
"primary"
>
上传事件数据
</el-button>
</AppUpload>
<!--
<el-upload
class=
"upload-demo"
action=
"#"
multiple
...
...
@@ -80,10 +94,10 @@ const fetchFileUpload = (option: any) => {
:http-request=
"fetchFileUpload"
>
<el-button
type=
"primary"
>
上传事件数据
</el-button>
</el-upload>
</el-upload>
-->
</div>
<div
class=
"btn-box"
>
<el-button
type=
"primary"
@
click=
"$emit('update:modelValue', false)"
>
关闭
</el-button>
<el-button
type=
"primary"
style=
"margin-top: 30px"
@
click=
"fetchFileUpload"
>
导入
</el-button>
</div>
</el-dialog>
</
template
>
...
...
@@ -93,5 +107,13 @@ const fetchFileUpload = (option: any) => {
text-align
:
center
;
margin-bottom
:
20px
;
justify-content
:
center
;
.uploader
{
flex
:
none
!
important
;
}
.el-upload-list
{
width
:
90%
;
position
:
absolute
;
left
:
0
;
}
}
</
style
>
src/modules/user/components/UploadUserDialog.vue
浏览文件 @
6818126e
...
...
@@ -3,6 +3,7 @@ import type { FormInstance, FormRules } from 'element-plus'
import
{
ElMessage
}
from
'element-plus'
import
{
getMemberConnectionsList
,
getMemberGroups
,
importMember
}
from
'../api'
import
type
{
ConnectionsProp
}
from
'../types'
import
AppUpload
from
'@/components/base/AppUpload.vue'
const
route
=
useRoute
()
...
...
@@ -10,7 +11,6 @@ const emit = defineEmits<{
(
e
:
'update'
):
void
(
e
:
'update:modelValue'
,
visible
:
boolean
):
void
}
>
()
const
formRef
=
$ref
<
FormInstance
>
()
const
form
=
reactive
({
connection_id
:
''
,
...
...
@@ -40,16 +40,18 @@ const downloadTemplate = function () {
}
// 上传
const
fetchFileUpload
=
(
option
:
any
)
=>
{
return
new
Promise
(()
=>
{
const
params
=
Object
.
assign
(
form
,
{
file
:
option
.
file
}
)
const
fetchFileUpload
=
()
=>
{
if
(
fileData
[
0
])
{
const
params
=
Object
.
assign
(
form
,
fileData
[
0
]
)
importMember
(
params
).
then
(()
=>
{
ElMessage
.
success
(
'导入数据成功'
)
emit
(
'update'
)
emit
(
'update:modelValue'
,
false
)
})
}
)
}
}
const
fileData
=
$ref
([])
</
script
>
<
template
>
...
...
@@ -73,8 +75,11 @@ const fetchFileUpload = (option: any) => {
</el-form-item>
</el-form>
<div
class=
"btn-box"
>
<el-button
style=
"margin-right: 20px"
type=
"primary"
@
click=
"downloadTemplate"
>
下载用户数据模板
</el-button>
<el-upload
<el-button
type=
"primary"
style=
"margin-right: 20px"
@
click=
"downloadTemplate"
>
下载用户数据模板
</el-button>
<AppUpload
v-model=
"fileData"
:limit=
"1"
>
<el-button
type=
"primary"
>
上传用户数据
</el-button>
</AppUpload>
<!--
<el-upload
class=
"upload-demo"
action=
"#"
multiple
...
...
@@ -84,18 +89,27 @@ const fetchFileUpload = (option: any) => {
:http-request=
"fetchFileUpload"
>
<el-button
type=
"primary"
>
上传用户数据
</el-button>
</el-upload>
</el-upload>
-->
</div>
<div
class=
"btn-box"
>
<el-button
type=
"primary"
>
关闭
</el-button>
<el-button
type=
"primary"
style=
"margin-top: 30px"
@
click=
"fetchFileUpload"
>
导入
</el-button>
</div>
</el-dialog>
</
template
>
<
style
lang=
"scss"
>
.btn-box
{
position
:
relative
;
text-align
:
center
;
margin-bottom
:
20px
;
display
:
flex
;
justify-content
:
center
;
.uploader
{
flex
:
none
!
important
;
}
.el-upload-list
{
width
:
90%
;
position
:
absolute
;
left
:
0
;
}
}
</
style
>
src/modules/user/components/ViewProgressDialog.vue
0 → 100644
浏览文件 @
6818126e
<
script
setup
lang=
"ts"
>
import
{
getProgress
}
from
'../api'
const
route
=
useRoute
()
const
emit
=
defineEmits
<
{
(
e
:
'update'
):
void
(
e
:
'update:modelValue'
,
visible
:
boolean
):
void
}
>
()
// 列表配置
const
listOptions
=
computed
(()
=>
{
return
{
remote
:
{
httpRequest
:
getProgress
},
columns
:
[
{
label
:
'文件名'
,
prop
:
'name'
},
{
label
:
'大小'
,
prop
:
'size'
},
{
label
:
'状态'
,
prop
:
'status_name'
// computed: (row: any) => {
// return row.row.status === '0'
// ? `
<
span
style
=
"color: rgb(170, 2, 49)"
>
$
{
row
.
row
.
status_name
}
<
/span>
`
// : `
<
span
style
=
"color: #00ac27"
>
$
{
row
.
row
.
status_name
}
<
/span>
`
// }
},
{
label
:
'导入时间'
,
prop
:
'created_time'
}
]
}
})
</
script
>
<
template
>
<el-dialog
class=
"connect-form"
title=
"导入用户数据"
:close-on-click-modal=
"false"
width=
"700px"
@
update:modelValue=
"$emit('update:modelValue')"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
></AppList>
</el-dialog>
</
template
>
<
style
lang=
"scss"
></
style
>
src/modules/user/views/Index.vue
浏览文件 @
6818126e
...
...
@@ -8,6 +8,7 @@ import type { MemberProp, ConnectionsProp } from '../types'
const
UpdateDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/UpdateDialog.vue'
))
const
UploadEventsDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/UploadEventsDialog.vue'
))
const
UploadUserDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/UploadUserDialog.vue'
))
const
ViewProgressDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ViewProgressDialog.vue'
))
const
router
=
useRouter
()
...
...
@@ -90,6 +91,9 @@ const userVisible = $ref(false)
// 新建、更新、查看
let
updateVisible
=
$ref
(
false
)
// 新建、更新、查看
let
progressVisible
=
$ref
(
false
)
let
multipleSelection
=
$ref
<
MemberProp
[]
>
([])
function
handleSelectionChange
(
selection
:
MemberProp
[])
{
multipleSelection
=
selection
...
...
@@ -205,6 +209,7 @@ const downloadMember = function (isAll?: boolean) {
</el-dropdown-menu>
</
template
>
</el-dropdown>
<el-button
type=
"primary"
@
click=
"progressVisible = true"
>
导入数据进度
</el-button>
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
...
...
@@ -225,4 +230,6 @@ const downloadMember = function (isAll?: boolean) {
<UploadUserDialog
@
update=
"handleRefresh"
v-if=
"userVisible"
v-model=
"userVisible"
></UploadUserDialog>
<!-- 新建、更新、查看 -->
<UpdateDialog
v-if=
"updateVisible"
:data=
"currentRow"
v-model=
"updateVisible"
@
update=
"handleRefresh"
></UpdateDialog>
<!-- 查看上传 -->
<ViewProgressDialog
v-if=
"progressVisible"
v-model=
"progressVisible"
></ViewProgressDialog>
</template>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论