Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
0a918a66
提交
0a918a66
编写于
12月 27, 2021
作者:
RedPig97
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 更新
上级
7cde0413
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
39 行增加
和
8 行删除
+39
-8
upload.hbs
...core/src/main/resources/templ/r7/@macro/editor/upload.hbs
+2
-0
IbizUpload.vue
...mpl/r7/app_{{apps}}/src/components/editors/IbizUpload.vue
+37
-8
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/upload.hbs
浏览文件 @
0a918a66
...
@@ -24,8 +24,10 @@
...
@@ -24,8 +24,10 @@
{{/if}}
{{/if}}
{{#
eq
item
.
psEditor
.
editorType
"PICTURE"
}}
{{#
eq
item
.
psEditor
.
editorType
"PICTURE"
}}
accept=
'image/*'
accept=
'image/*'
listType=
"picture-card"
{{/
eq
}}
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"PICTURE_ONE"
}}
{{#
eq
item
.
psEditor
.
editorType
"PICTURE_ONE"
}}
accept=
'image/*'
accept=
'image/*'
listType=
"picture-card"
{{/
eq
}}
{{/
eq
}}
@
editorEvent=
"handleEditorEvent"
/>
@
editorEvent=
"handleEditorEvent"
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizUpload.vue
浏览文件 @
0a918a66
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
getDownloadUrl
,
getRequestingHeader
,
getUploadUrl
,
IActionParam
,
IParam
}
from
"@ibiz-core"
;
import
{
getDownloadUrl
,
getRequestingHeader
,
getUploadUrl
,
IActionParam
,
IParam
}
from
"@ibiz-core"
;
import
{
UploadOutlined
,
PlusOutlined
}
from
'@ant-design/icons-vue'
;
import
{
ref
,
Ref
}
from
"vue"
;
import
{
ref
,
Ref
}
from
"vue"
;
interface
UploadProps
{
interface
UploadProps
{
/**
/**
...
@@ -52,6 +53,13 @@ interface UploadProps {
...
@@ -52,6 +53,13 @@ interface UploadProps {
*/
*/
limit
:
number
;
limit
:
number
;
/**
* 文件列表样式
*
* @type {boolean}
*/
listType
:
string
;
/**
/**
* 按钮提示信息
* 按钮提示信息
*
*
...
@@ -82,11 +90,12 @@ const props = withDefaults(defineProps<UploadProps>(), {
...
@@ -82,11 +90,12 @@ const props = withDefaults(defineProps<UploadProps>(), {
disabled
:
false
,
disabled
:
false
,
readonly
:
false
,
readonly
:
false
,
method
:
'post'
,
method
:
'post'
,
multiple
:
tru
e
,
multiple
:
fals
e
,
showUploadList
:
true
,
showUploadList
:
true
,
tooltip
:
'点击上传'
,
tooltip
:
'点击上传'
,
accept
:
"*"
,
accept
:
"*"
,
limit
:
999
,
limit
:
999
,
listType
:
'text'
,
});
});
const
emit
=
defineEmits
<
EditorEmit
>
();
const
emit
=
defineEmits
<
EditorEmit
>
();
const
uploadUrl
=
getUploadUrl
();
const
uploadUrl
=
getUploadUrl
();
...
@@ -95,12 +104,18 @@ const headers = getRequestingHeader();
...
@@ -95,12 +104,18 @@ const headers = getRequestingHeader();
const
fileList
:
Ref
<
IParam
[]
>
=
ref
([])
const
fileList
:
Ref
<
IParam
[]
>
=
ref
([])
const
previewFile
=
(
file
:
IParam
)
=>
{
const
previewFile
=
(
file
:
IParam
)
=>
{
//todo
//todo
}
}
const
onChange
=
(
value
:
number
)
=>
{
const
onChange
=
(
$event
:
any
)
=>
{
if
(
$event
.
fileList
.
length
>
props
.
limit
)
{
console
.
log
(
`当前限制选择
${
props
.
limit
}
个文件, 共选择了
${
$event
.
fileList
.
length
}
个文件`
);
return
;
}
fileList
.
value
=
$event
.
fileList
;
emit
(
"editorEvent"
,
{
emit
(
"editorEvent"
,
{
tag
:
props
.
name
,
tag
:
props
.
name
,
action
:
"valueChange"
,
action
:
"valueChange"
,
data
:
value
,
data
:
$event
,
});
});
};
};
</
script
>
</
script
>
...
@@ -108,20 +123,26 @@ const onChange = (value: number) => {
...
@@ -108,20 +123,26 @@ const onChange = (value: number) => {
<
template
>
<
template
>
<div
:class=
"['app-editor-container', `app-upload-$
{name}`]">
<div
:class=
"['app-editor-container', `app-upload-$
{name}`]">
<a-upload
<a-upload
v-model:fileList=
"fileList"
:class=
"
{'ant-upload--limit': fileList.length == limit}"
:action="uploadUrl"
:action="uploadUrl"
:method="method"
:method="method"
:accept="accept"
:accept="accept"
v-model:fileList=
"fileList"
:headers="headers"
:headers="headers"
:multiple="multiple"
:multiple="multiple"
:previewFile="previewFile"
:previewFile="previewFile"
:showUploadList="showUploadList"
:showUploadList="showUploadList"
:list-type="listType"
:disabled="disabled || readonly"
:disabled="disabled || readonly"
@change="onChange">
@change="onChange">
<a-button
>
<a-button
v-if=
"Object.is(listType,'text')"
>
<upload-outlined></upload-outlined>
<upload-outlined></upload-outlined>
{{
tooltip
}}
\
{{
tooltip
}}
</a-button>
</a-button>
<div
v-else
>
<plus-outlined
/>
<div
class=
"ant-upload-text"
>
\
{{
tooltip
}}
</div>
</div>
</a-upload>
</a-upload>
</div>
</div>
</
template
>
</
template
>
...
@@ -130,5 +151,13 @@ const onChange = (value: number) => {
...
@@ -130,5 +151,13 @@ const onChange = (value: number) => {
.app-editor-container
{
.app-editor-container
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
text-align
:
left
;
}
.app-editor-container
.ant-upload--limit
.ant-upload-select-picture-card
{
display
:
none
;
}
.ant-upload-select-picture-card
.ant-upload-text
{
margin-top
:
8px
;
color
:
#666
;
}
}
</
style
>
</
style
>
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录