Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
T
TrainSys
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
苏州培训方案
TrainSys
提交
b609ba4c
提交
b609ba4c
编写于
3月 06, 2025
作者:
jlj05024111@163.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 更新文件上传-单项编辑器&更新dsf-web插件包
上级
0dc5c0a9
变更
8
展开全部
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
600 行增加
和
355 行删除
+600
-355
ibiz-template-plugin.es.js
...e-plugin/sy-dsf-web@0.0.2/dist/ibiz-template-plugin.es.js
+475
-351
index.legacy.js
...biz-template-plugin/sy-dsf-web@0.0.2/dist/index.legacy.js
+1
-1
style.css
...ins/@ibiz-template-plugin/sy-dsf-web@0.0.2/dist/style.css
+1
-1
app-register.ts
app_Web/src/app-register.ts
+2
-0
ibiz-file-upload-one.tsx
...s/editor/upload/ibiz-file-upload/ibiz-file-upload-one.tsx
+107
-0
index.ts
app_Web/src/components/editor/upload/index.ts
+1
-0
use-iview-upload.ts
app_Web/src/components/editor/upload/use/use-iview-upload.ts
+11
-2
file-uploader-provider.ts
app_Web/src/provider/editor/file-uploader-provider.ts
+2
-0
未找到文件。
app_Web/public/plugins/@ibiz-template-plugin/sy-dsf-web@0.0.2/dist/ibiz-template-plugin.es.js
浏览文件 @
b609ba4c
此差异已折叠。
点击以展开。
app_Web/public/plugins/@ibiz-template-plugin/sy-dsf-web@0.0.2/dist/index.legacy.js
浏览文件 @
b609ba4c
此差异已折叠。
点击以展开。
app_Web/public/plugins/@ibiz-template-plugin/sy-dsf-web@0.0.2/dist/style.css
浏览文件 @
b609ba4c
此差异已折叠。
点击以展开。
app_Web/src/app-register.ts
浏览文件 @
b609ba4c
...
...
@@ -120,6 +120,7 @@ import {
IBizGridPicker
,
GridEditor
,
IBizSwitch
,
IBizFileUploadOne
,
}
from
'./components/editor'
;
export
const
AppRegister
=
{
...
...
@@ -231,6 +232,7 @@ export const AppRegister = {
v
.
component
(
'QuickSearch'
,
QuickSearch
);
v
.
component
(
'NotSupportedEditor'
,
NotSupportedEditor
);
v
.
component
(
'IBizSwitch'
,
IBizSwitch
);
v
.
component
(
'IBizFileUploadOne'
,
IBizFileUploadOne
);
// 注册表格编辑器
v
.
component
(
'IBizGridInput'
,
IBizGridInput
);
v
.
component
(
'IBizGridSpan'
,
IBizGridSpan
);
...
...
app_Web/src/components/editor/upload/ibiz-file-upload/ibiz-file-upload-one.tsx
0 → 100644
浏览文件 @
b609ba4c
import
{
defineComponent
,
ref
}
from
'vue'
;
import
{
getEditorEmits
,
getUploadProps
,
useNamespace
,
}
from
'@ibiz-template/vue-util'
;
import
'@ibiz-template/theme/style/components/editor/ibiz-file-upload/ibiz-file-upload.scss'
;
import
{
useIViewUpload
}
from
'../use/use-iview-upload'
;
export
const
IBizFileUploadOne
=
defineComponent
({
name
:
'IBizFileUploadOne'
,
props
:
getUploadProps
(),
emits
:
getEditorEmits
(),
setup
(
props
,
{
emit
})
{
const
ns
=
useNamespace
(
'file-upload'
);
const
c
=
props
.
controller
;
const
fileUpload
=
ref
();
const
{
uploadUrl
,
headers
,
files
,
onDownload
,
onError
,
onRemove
,
onSuccess
,
beforeUpload
,
}
=
useIViewUpload
(
props
,
value
=>
{
emit
(
'change'
,
value
);
},
c
,
);
const
handleBeforeUpload
=
(
_files
:
IData
)
=>
{
// 先清除之前的文件 todo
fileUpload
.
value
.
clearFiles
();
return
beforeUpload
();
};
return
{
ns
,
c
,
uploadUrl
,
headers
,
files
,
fileUpload
,
onDownload
,
onError
,
onRemove
,
onSuccess
,
beforeUpload
,
handleBeforeUpload
,
};
},
render
(
h
)
{
return
(
<
div
class=
{
[
this
.
ns
.
b
(),
this
.
disabled
?
this
.
ns
.
m
(
'disabled'
)
:
''
,
this
.
readonly
?
this
.
ns
.
m
(
'readonly'
)
:
''
,
]
}
>
{
h
(
'IUpload'
,
{
ref
:
'fileUpload'
,
props
:
{
action
:
this
.
uploadUrl
,
headers
:
this
.
headers
,
disabled
:
this
.
disabled
,
'default-file-list'
:
this
.
files
,
multiple
:
false
,
type
:
this
.
c
.
model
.
isDrag
?
'drag'
:
'select'
,
accept
:
this
.
c
.
model
.
accept
,
'before-upload'
:
this
.
handleBeforeUpload
,
'on-success'
:
this
.
onSuccess
,
'on-error'
:
this
.
onError
,
'on-remove'
:
this
.
onRemove
,
'on-preview'
:
this
.
onDownload
,
},
},
[
this
.
c
.
model
.
isDrag
?
(
<
div
class=
{
this
.
ns
.
b
(
'drag-box'
)
}
>
<
i
-
icon
type=
'md-cloud-upload'
/>
<
div
class=
{
this
.
ns
.
be
(
'drag-box'
,
'text'
)
}
>
<
span
>
将文件拖到此处,或
</
span
>
<
span
>
点击上传
</
span
>
</
div
>
</
div
>
)
:
(
<
i
-
button
icon=
'ios-cloud-upload-outline'
class=
{
this
.
ns
.
b
(
'button'
)
}
>
上传文件
</
i
-
button
>
),
],
)
}
</
div
>
);
},
});
app_Web/src/components/editor/upload/index.ts
浏览文件 @
b609ba4c
export
{
IBizFileUpload
}
from
'./ibiz-file-upload/ibiz-file-upload'
;
export
{
IBizGridFileUpload
}
from
'./ibiz-grid-file-upload/ibiz-grid-file-upload'
;
export
{
IBizImageUpload
}
from
'./ibiz-image-upload/ibiz-image-upload'
;
export
{
IBizFileUploadOne
}
from
'./ibiz-file-upload/ibiz-file-upload-one'
;
app_Web/src/components/editor/upload/use/use-iview-upload.ts
浏览文件 @
b609ba4c
...
...
@@ -100,10 +100,19 @@ export function useIViewUpload(
* @date 2022-11-17 14:11:54
*/
const
emitValue
=
()
=>
{
const
_files
=
[...
files
.
value
,
...
uploadCache
.
cacheFiles
];
// 多选是合并,单选是替换
let
_files
=
[];
if
(
c
.
model
.
editorType
===
'FILEUPLOADER_ONE'
)
{
files
.
value
=
[];
_files
=
[
uploadCache
.
cacheFiles
[
uploadCache
.
cacheFiles
.
length
-
1
]];
}
else
{
_files
=
[...
files
.
value
,
...
uploadCache
.
cacheFiles
];
}
const
value
:
string
|
null
=
_files
.
length
>
0
?
JSON
.
stringify
(
_files
.
map
(
file
=>
({
name
:
file
.
name
,
id
:
file
.
id
})))
?
JSON
.
stringify
(
_files
.
map
((
file
:
IData
)
=>
({
name
:
file
.
name
,
id
:
file
.
id
})),
)
:
null
;
uploadCache
.
cacheFiles
=
[];
valueChange
(
value
);
...
...
app_Web/src/provider/editor/file-uploader-provider.ts
浏览文件 @
b609ba4c
...
...
@@ -22,6 +22,8 @@ export class FileUploaderEditorProvider implements IEditorProvider {
constructor
(
editorType
:
string
)
{
if
(
editorType
.
includes
(
'PICTURE'
))
{
this
.
formEditor
=
'IBizImageUpload'
;
}
else
if
(
editorType
===
'FILEUPLOADER_ONE'
)
{
this
.
formEditor
=
'IBizFileUploadOne'
;
}
else
if
(
editorType
.
includes
(
'FILEUPLOADER'
))
{
this
.
formEditor
=
'IBizFileUpload'
;
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录