Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
b59390a4
提交
b59390a4
编写于
6月 16, 2020
作者:
lijinyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
上传图片本地文件更新
上级
a733f056
变更
1
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
59 行增加
和
31 行删除
+59
-31
app-image-upload.vue
src/components/app-image-upload/app-image-upload.vue
+59
-31
未找到文件。
src/components/app-image-upload/app-image-upload.vue
浏览文件 @
b59390a4
...
...
@@ -98,6 +98,22 @@ export default class AppImageUpload extends Vue {
*/
@
Prop
()
public
data
!
:
string
;
/**
* 视图参数
*
* @type {*}
* @memberof AppFormDRUIPart
*/
@
Prop
()
public
viewparams
!
:
any
;
/**
* 视图上下文
*
* @type {*}
* @memberof AppAutocomplete
*/
@
Prop
()
public
context
!
:
any
;
/**
* 初始化值
*
...
...
@@ -185,20 +201,20 @@ export default class AppImageUpload extends Vue {
@
Provide
()
public
files
=
[];
/**
* 上传
key
s
* 上传
param
s
*
* @type {Array<any>}
* @memberof AppImageUpload
*/
public
upload_
key
s
:
Array
<
any
>
=
[];
public
upload_
param
s
:
Array
<
any
>
=
[];
/**
* 导出
key
s
* 导出
param
s
*
* @type {Array<any>}
* @memberof AppImageUpload
*/
public
export_
key
s
:
Array
<
any
>
=
[];
public
export_
param
s
:
Array
<
any
>
=
[];
/**
* 自定义数组
...
...
@@ -238,26 +254,31 @@ export default class AppImageUpload extends Vue {
* @memberof AppImageUpload
*/
private
dataProcess
():
void
{
let
upload_arr
:
Array
<
string
>
=
[];
let
export_arr
:
Array
<
string
>
=
[];
const
_data
:
any
=
JSON
.
parse
(
this
.
data
);
this
.
upload_keys
.
forEach
((
key
:
string
)
=>
{
upload_arr
.
push
(
`
${
key
}
=
${
_data
[
key
]}
`
);
});
this
.
export_keys
.
forEach
((
key
:
string
)
=>
{
export_arr
.
push
(
`
${
key
}
=
${
_data
[
key
]}
`
);
});
let
_url
=
`
${
Environment
.
BaseUrl
}${
Environment
.
UploadFile
}
`
;
if
(
upload_arr
.
length
>
0
||
this
.
custom_arr
.
length
>
0
)
{
_url
=
`
${
_url
}
?
${
upload_arr
.
join
(
'&'
)}${
upload_arr
.
length
>
0
?
'&'
:
''
}${
this
.
custom_arr
.
join
(
'&'
)}
`
;
if
(
this
.
upload_params
.
length
>
0
)
{
_url
+=
'?'
;
this
.
upload_params
.
forEach
((
item
:
any
,
i
:
any
)
=>
{
_url
+=
`
${
Object
.
keys
(
item
)[
0
]}
=
${
Object
.
values
(
item
)[
0
]}
`
;
if
(
i
<
this
.
upload_params
.
length
-
1
){
_url
+=
'&'
;
}
})
}
this
.
uploadUrl
=
_url
;
this
.
files
.
forEach
((
file
:
any
)
=>
{
let
url
=
`
${
this
.
downloadUrl
}
/
${
file
.
id
}
`
;
if
(
upload_arr
.
length
>
0
||
this
.
custom_arr
.
length
>
0
)
{
url
=
`
${
url
}
?
${
upload_arr
.
join
(
'&'
)}${
upload_arr
.
length
>
0
?
'&'
:
''
}${
this
.
custom_arr
.
join
(
'&'
)}
`
;
if
(
this
.
export_params
.
length
>
0
)
{
url
+=
'?'
;
this
.
export_params
.
forEach
((
item
:
any
,
i
:
any
)
=>
{
url
+=
`
${
Object
.
keys
(
item
)[
0
]}
=
${
Object
.
values
(
item
)[
0
]}
`
;
if
(
i
<
this
.
export_params
.
length
-
1
){
url
+=
'&'
;
}
})
}
file
.
url
=
url
;
});
...
...
@@ -288,28 +309,35 @@ export default class AppImageUpload extends Vue {
public
mounted
()
{
this
.
appData
=
this
.
$store
.
getters
.
getAppData
();
let
uploadparams
:
string
=
''
;
let
exportparams
:
string
=
''
;
let
uploadparams
:
any
=
{}
;
let
exportparams
:
any
=
{}
;
let
upload_
key
s
:
Array
<
string
>
=
[];
let
export_
key
s
:
Array
<
string
>
=
[];
let
upload_
param
s
:
Array
<
string
>
=
[];
let
export_
param
s
:
Array
<
string
>
=
[];
let
custom_arr
:
Array
<
string
>
=
[];
let
param
:
any
=
this
.
viewparams
;
let
context
:
any
=
this
.
context
;
if
(
this
.
uploadparams
&&
!
Object
.
is
(
this
.
uploadparams
,
''
))
{
uploadparams
=
this
.
uploadparams
;
upload_
keys
=
uploadparams
.
split
(
';'
);
upload_
params
=
this
.
$util
.
computedNavData
(
this
.
data
,
param
,
context
,
uploadparams
);
}
if
(
this
.
exportparams
&&
!
Object
.
is
(
this
.
exportparams
,
''
))
{
exportparams
=
this
.
exportparams
;
export_
keys
=
exportparams
.
split
(
';'
);
export_
params
=
this
.
$util
.
computedNavData
(
this
.
data
,
param
,
context
,
exportparams
);
}
if
(
this
.
customparams
&&
!
Object
.
is
(
this
.
customparams
,
''
))
{
Object
.
keys
(
this
.
customparams
).
forEach
((
name
:
string
)
=>
{
custom_arr
.
push
(
`
${
name
}
=
${
this
.
customparams
[
name
]}
`
);
});
for
(
const
item
in
upload_params
)
{
this
.
upload_params
.
push
({
[
item
]:
upload_params
[
item
]
})
}
for
(
const
item
in
export_params
)
{
this
.
export_params
.
push
({
[
item
]:
export_params
[
item
]
})
}
this
.
upload_keys
=
upload_keys
;
this
.
export_keys
=
export_keys
;
this
.
custom_arr
=
custom_arr
;
this
.
setFiles
(
this
.
value
);
this
.
dataProcess
();
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录