Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-Mob-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-Mob-R7-Res
提交
49e14f50
提交
49e14f50
编写于
8月 31, 2020
作者:
KK
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
富文本调整
上级
6b3d802f
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
162 行增加
和
9 行删除
+162
-9
app-mob-rich-text-editor.vue
...nts/app-mob-rich-text-editor/app-mob-rich-text-editor.vue
+128
-3
app-rich-text.vue
src/components/app-rich-text/app-rich-text.vue
+34
-6
未找到文件。
src/components/app-mob-rich-text-editor/app-mob-rich-text-editor.vue
浏览文件 @
49e14f50
<
template
>
<div
class=
"app-mob-rich-text-editor"
@
click=
"open"
>
<div
v-html=
"reValue"
></div>
<ion-icon
class=
"app-mob-rich-text-editor-icon"
v-if=
"!reValue"
name=
"options-outline"
@
click=
"open"
></ion-icon>
<ion-icon
class=
"app-mob-rich-text-editor-icon"
v-if=
"!reValue"
name=
"options-outline"
@
click
.
stop
=
"open"
></ion-icon>
</div>
</
template
>
<
script
lang =
'ts'
>
import
{
Vue
,
Component
,
Prop
,
Model
,
Watch
}
from
'vue-property-decorator'
;
import
{
Vue
,
Component
,
Prop
,
Model
,
Watch
,
Provide
}
from
'vue-property-decorator'
;
import
{
Environment
}
from
'@/environments/environment'
;
import
qs
from
'qs'
;
@
Component
({})
export
default
class
AppRichTextEditor
extends
Vue
{
...
...
@@ -37,6 +39,92 @@ export default class AppRichTextEditor extends Vue {
this
.
$emit
(
"change"
,
value
);
}
/**
* 上传params
*
* @type {Array<any>}
* @memberof AppRichTextEditor
*/
public
upload_params
:
Array
<
any
>
=
[];
/**
* 导出params
*
* @type {Array<any>}
* @memberof AppRichTextEditor
*/
public
export_params
:
any
;
/**
* 上传参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
uploadparams
?:
any
;
/**
* 下载参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
exportparams
?:
any
;
/**
* 视图参数
*
* @type {*}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
viewparams
!
:
any
;
/**
* 视图上下文
*
* @type {*}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
context
!
:
any
;
/**
* 表单数据
*
* @type {string}
* @memberof AppRichTextEditor
*/
@
Prop
()
public
data
!
:
string
;
/**
* 上传文件路径
*
* @memberof AppMobFileUpload
*/
public
uploadUrl
=
Environment
.
BaseUrl
+
Environment
.
UploadFile
;
/**
* 下载文件路径
*
* @memberof AppMobFileUpload
*/
public
downloadUrl
=
Environment
.
BaseUrl
+
Environment
.
ExportFile
;
/**
* 文件列表
*
* @memberof AppMobFileUpload
*/
@
Provide
()
public
files
:
Array
<
any
>
=
[];
/**
* 开发模式文件数组
*
* @private
* @type {Array<any>}
* @memberof AppMobFileUpload
*/
private
devFiles
:
Array
<
any
>
=
[];
/**
* 打开富文本
*
...
...
@@ -44,7 +132,7 @@ export default class AppRichTextEditor extends Vue {
* @memberof AppRichTextEditor
*/
public
open
(){
this
.
openPopupModal
({
viewname
:
'app-rich-text'
,
title
:
'app-rich-text'
},{},{
value
:
this
.
value
});
this
.
openPopupModal
({
viewname
:
'app-rich-text'
,
title
:
'app-rich-text'
},{},{
value
:
this
.
value
,
uploadUrl
:
this
.
uploadUrl
,
export_params
:
this
.
export_params
});
}
/**
...
...
@@ -60,6 +148,43 @@ export default class AppRichTextEditor extends Vue {
}
}
/**
* 数据处理
*
* @private
* @memberof AppMobFileUpload
*/
private
dataProcess
():
void
{
const
{
context
:
uploadContext
,
param
:
uploadParam
}
=
this
.
$viewTool
.
formatNavigateParam
(
this
.
uploadparams
,
{},
this
.
context
,
this
.
viewparams
,
JSON
.
parse
(
this
.
data
));
const
{
context
:
exportContext
,
param
:
exportParam
}
=
this
.
$viewTool
.
formatNavigateParam
(
this
.
exportparams
,
{},
this
.
context
,
this
.
viewparams
,
JSON
.
parse
(
this
.
data
));
this
.
export_params
=
{
exportParamStr
:
qs
.
stringify
(
exportParam
,
{
delimiter
:
'&'
}),
exportContextStr
:
qs
.
stringify
(
exportContext
,
{
delimiter
:
'&'
})};
let
_uploadUrl
=
`
${
Environment
.
BaseUrl
}${
Environment
.
UploadFile
}
`
;
const
uploadContextStr
:
string
=
qs
.
stringify
(
uploadContext
,
{
delimiter
:
'&'
});
const
uploadParamStr
:
string
=
qs
.
stringify
(
uploadParam
,
{
delimiter
:
'&'
});
if
(
!
Object
.
is
(
uploadContextStr
,
''
)
)
{
_uploadUrl
=
`
${
_uploadUrl
}
?
${
uploadContextStr
}
`
;
}
if
(
!
Object
.
is
(
uploadParamStr
,
''
)){
_uploadUrl
+=
`&
${
uploadParamStr
}
`
;
}
this
.
uploadUrl
=
_uploadUrl
;
}
/**
* 生命周期
*
* @private
* @memberof AppMobFileUpload
*/
public
mounted
(){
this
.
dataProcess
();
}
}
</
script
>
<
style
lang=
"less"
>
...
...
src/components/app-rich-text/app-rich-text.vue
浏览文件 @
49e14f50
...
...
@@ -65,7 +65,7 @@ export default class AppRichTextEditor extends Vue {
* @type {string}
* @memberof AppRichTextEditor
*/
p
ublic
uploadUrl
=
Environment
.
UploadFile
;
p
rotected
uploadUrl
:
string
=
""
;
/**
* 下载路径
...
...
@@ -75,6 +75,14 @@ export default class AppRichTextEditor extends Vue {
*/
public
downloadUrl
=
Environment
.
BaseUrl
+
Environment
.
ExportFile
;
/**
* 下载参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
public
export_params
:
any
=
{};
/**
* 双向绑定值
*
...
...
@@ -90,7 +98,22 @@ export default class AppRichTextEditor extends Vue {
* @memberof AppRichTextEditor
*/
public
mounted
()
{
this
.
resloutValue
=
JSON
.
parse
(
this
.
_viewparams
).
value
?
JSON
.
parse
(
this
.
_viewparams
).
value
:
""
;
this
.
getParms
();
}
/**
* 获取模态参数
*
* @type {string}
* @memberof AppRichTextEditor
*/
public
getParms
(){
let
parm
:
any
=
JSON
.
parse
(
this
.
_viewparams
);
if
(
parm
){
this
.
resloutValue
=
parm
.
value
?
parm
.
value
:
""
;
this
.
uploadUrl
=
parm
.
uploadUrl
?
parm
.
uploadUrl
:
""
;
this
.
export_params
=
parm
.
export_params
?
parm
.
export_params
:{};
}
}
/**
...
...
@@ -143,6 +166,7 @@ export default class AppRichTextEditor extends Vue {
* @memberof AppRichTextEditor
*/
protected
afterRead
(
file
:
any
,
detail
:
any
):
void
{
alert
(
this
.
uploadUrl
)
const
params
=
new
FormData
();
params
.
append
(
"file"
,
file
.
file
,
file
.
file
.
name
);
const
config
=
{
...
...
@@ -171,12 +195,16 @@ export default class AppRichTextEditor extends Vue {
* @memberof AppRichTextEditor
*/
private
dataProcess
(
file
:
any
):
void
{
let
_uploadUrl
=
`
${
Environment
.
BaseUrl
}${
Environment
.
UploadFile
}
`
;
this
.
uploadUrl
=
_uploadUrl
;
console
.
log
(
file
);
let
_downloadUrl
=
`
${
this
.
downloadUrl
}
/
${
file
.
id
}
`
;
file
.
isImage
=
true
;
if
(
!
Object
.
is
(
this
.
export_params
.
exportContextStr
,
''
))
{
_downloadUrl
=
`
${
_downloadUrl
}
?
${
this
.
export_params
.
exportContextStr
}
`
;
}
if
(
!
Object
.
is
(
this
.
export_params
.
exportParamStr
,
''
)){
_downloadUrl
+=
`&
${
this
.
export_params
.
exportParamStr
}
`
;
}
file
.
url
=
_downloadUrl
;
this
.
resloutValue
=
this
.
resloutValue
+
'<img src="'
+
file
.
url
+
'" alt="">'
;
this
.
resloutValue
=
this
.
resloutValue
+
'<img src="'
+
file
.
url
+
'" alt="
'
+
file
.
filename
+
'
">'
;
}
}
</
script
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录