Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-IM
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-admin-IM
提交
ab119d8f
提交
ab119d8f
编写于
1月 21, 2021
作者:
huangwensu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
导入人员列表
上级
3e82498e
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
82 行增加
和
40 行删除
+82
-40
index.vue
src/views/IM/chain-message/index.vue
+82
-40
未找到文件。
src/views/IM/chain-message/index.vue
浏览文件 @
ab119d8f
...
...
@@ -9,7 +9,7 @@
<el-input
clearable
v-model=
"searchParam.title"
size=
"mini"
maxlength=
"20"
placeholder=
"请输入群发标题"
style=
"width: 300px;"
></el-input>
</el-form-item>
<el-form-item
label=
"目标用户"
>
<el-input
clearable
v-model=
"fileName"
size=
"mini"
placeholder=
"请上传目标用户"
style=
"width: 300px;"
></el-input>
<el-input
clearable
v-model=
"
excel
fileName"
size=
"mini"
placeholder=
"请上传目标用户"
style=
"width: 300px;"
></el-input>
<el-upload
class=
"upload-demo"
accept=
".xlsx"
...
...
@@ -40,7 +40,7 @@
placeholder="请输入文本信息"
style="width: 300px;">
</el-input>
</div>
<div
class=
"file-content"
v-if=
"item.type == 1"
>
<div
class=
"file-content"
v-if=
"item.type == 1
|| item.type == 2
"
>
<p>
文件信息
<i
class=
"el-icon-error"
@
click=
"deleteFile(item,index)"
></i></p>
<el-input
v-model=
"item.info"
size=
"mini"
placeholder=
"请上传文件信息"
style=
"width: 300px;"
></el-input>
<el-upload
...
...
@@ -58,10 +58,10 @@
<p>
链接
<i
class=
"el-icon-error"
@
click=
"deleteLink(item,index)"
></i></p>
<el-select
clearable
v-model=
"item.info"
size=
"mini"
placeholder=
"请选择链接"
style=
"width: 300px;"
>
<el-option
v-for=
"item in
options
"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
valu
e"
>
v-for=
"item in
linkList
"
:key=
"item.
id
"
:label=
"item.
title
"
:value=
"item.
titl
e"
>
</el-option>
</el-select>
</div>
...
...
@@ -96,14 +96,15 @@ export default {
},
data
()
{
return
{
fileName
:
''
,
excelfileName
:
''
,
fileName
:
''
,
contentList
:
[],
searchParam
:
{
title
:
''
,
fileModel
:
{},
contentModelList
:
[]
},
options
:
[],
linkList
:
[],
templateFileUrl
:
''
,
fileIndex
:
0
};
...
...
@@ -114,33 +115,35 @@ export default {
// 挂载到Dom完成时
mounted
()
{
commonUtil
.
resizeHeight
();
this
.
getFiveContentList
();
},
methods
:
{
// 上传列表
uploadUserFile
(
file
)
{
let
_this
=
this
;
let
base64
=
{};
let
FileExt
=
file
.
name
.
replace
(
/.+
\.
/
,
""
);
if
([
"xls"
,
"xlsx"
].
indexOf
(
FileExt
.
toLowerCase
())
===
-
1
)
{
_this
.
$message
({
type
:
"warning"
,
message
:
"请上传后缀名为xls,xlsx的原文件!"
,
});
return
false
;
}
let
arr
=
file
.
type
.
split
(
"/"
);
let
ext
=
"."
+
arr
[
1
];
let
name
=
file
.
name
;
let
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
function
()
{
base64
.
ext
=
file
.
name
.
split
(
"."
)[
1
];
base64
.
file
=
reader
.
result
;
base64
.
fileName
=
file
.
name
;
_this
.
fileName
=
file
.
name
;
reader
.
onload
=
function
(
e
)
{
let
fileJson
=
{
fileName
:
file
.
name
,
file
:
e
.
target
.
result
.
substr
(
e
.
target
.
result
.
indexOf
(
"base64,"
)
+
7
),
ext
:
ext
};
let
fileArray
=
{
type
:
""
,
base64
:
fileJson
};
_this
.
excelfileName
=
file
.
name
;
_this
.
searchParam
.
fileModel
=
fileArray
;
}
this
.
searchParam
.
fileModel
=
base64
;
reader
.
readAsDataURL
(
file
)
;
},
// 下载用户模板
downTemplate
()
{
let
a
=
document
.
createElement
(
'a'
);
this
.
templateFileUrl
=
'https://file.yunqueyi.com/im/group/%E7%94%A8%E6%88%B7%E5%88%97%E8%A1%A8%E6%A8%A1%E6%9D%BF.xlsx'
;
a
.
setAttribute
(
'href'
,
this
.
templateFileUrl
);
a
.
click
();
},
...
...
@@ -165,10 +168,13 @@ export default {
// 添加文件
addFile
()
{
if
(
this
.
searchParam
.
contentModelList
.
length
<
6
)
{
this
.
searchParam
.
contentModelList
.
push
({
type
:
1
,
info
:
''
,
url
:
''
url
:
''
,
width
:
0
,
height
:
0
})
}
else
{
this
.
$message
({
...
...
@@ -182,32 +188,35 @@ export default {
this
.
fileIndex
=
index
;
},
uploadImportFile
(
file
)
{
console
.
log
(
"================"
,
file
)
let
_this
=
this
;
let
FileExt
=
file
.
name
.
replace
(
/.+
\.
/
,
""
);
const
isLt5M
=
file
.
size
/
1024
/
1024
<
6
;
if
(
!
isLt5M
)
{
this
.
$message
.
error
(
'上传文件不能超过 5MB!'
);
return
isLt5M
}
if
(
FileExt
==
'png'
||
FileExt
==
'jpg'
||
FileExt
==
"jpeg"
)
{
_this
.
searchParam
.
contentModelList
[
this
.
fileIndex
].
info
=
file
.
name
;
if
(
file
.
type
==
'image/png'
||
file
.
type
==
'image/jpg'
||
file
.
type
==
"image/jpeg"
)
{
_this
.
searchParam
.
contentModelList
[
this
.
fileIndex
].
type
=
1
;
// 图片
let
imgFile
=
new
FileReader
();
imgFile
.
readAsDataURL
(
file
);
imgFile
.
onload
=
function
(
theFil
e
)
{
imgFile
.
onload
=
function
(
e
)
{
let
image
=
new
Image
();
image
.
src
=
theFil
e
.
target
.
result
;
image
.
src
=
e
.
target
.
result
;
image
.
onload
=
function
()
{
_this
.
searchParam
.
contentModelList
[
this
.
fileIndex
].
width
=
this
.
width
;
_this
.
searchParam
.
contentModelList
[
this
.
fileIndex
].
height
=
this
.
height
;
}
}
}
else
if
(
FileExt
==
'
pdf'
)
{
}
else
if
(
file
.
type
==
'application/
pdf'
)
{
_this
.
searchParam
.
contentModelList
[
this
.
fileIndex
].
type
=
2
;
// pdf
}
_this
.
searchParam
.
contentModelList
[
this
.
fileIndex
].
fileSize
=
file
.
size
;
doUpload
(
_this
,
file
,
getFilePath
(
file
,
null
),
'preview4'
,
'progress1'
,
1
).
then
(
path
=>
{
_this
.
fileName
=
file
.
name
;
_this
.
searchParam
.
contentModelList
[
this
.
fileIndex
].
url
=
path
.
fullPath
;
});
},
// 删除文件
...
...
@@ -229,6 +238,21 @@ export default {
});
}
},
// 获取积木列表
getFiveContentList
()
{
this
.
GET
(
"/contents/admin/template/queryTemplate?publishFlag=5&pageNo=1&pageSize=99999"
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
this
.
linkList
=
res
.
data
.
templateList
||
[];
}
else
{
this
.
$message
({
message
:
res
.
message
,
type
:
"error"
});
}
});
},
// 删除链接
deleteLink
(
item
,
index
)
{
this
.
searchParam
.
contentModelList
.
splice
(
index
,
1
)
...
...
@@ -236,31 +260,38 @@ export default {
// 确认群发
confirmSubmit
()
{
this
.
loading
=
true
;
let
req
=
{
groupMessageSendReq
:
this
.
searchParam
};
if
(
!
req
.
groupMessageSendReq
.
title
)
{
let
req
=
this
.
searchParam
;
for
(
let
i
=
0
;
i
<
req
.
contentModelList
.
length
;
i
++
)
{
if
(
req
.
contentModelList
[
i
].
type
==
3
)
{
this
.
linkList
.
forEach
((
element
,
index
)
=>
{
if
(
element
.
title
==
req
.
contentModelList
[
i
].
info
)
{
req
.
contentModelList
[
i
].
url
=
element
.
linkUrl
;
}
});
}
}
if
(
!
req
.
title
)
{
this
.
$message
({
message
:
'请输入标题'
,
type
:
'warning'
});
return
}
if
(
isEmptyUtils
(
req
.
groupMessageSendReq
.
fileModel
))
{
if
(
isEmptyUtils
(
req
.
fileModel
))
{
this
.
$message
({
message
:
'请上传人员名单'
,
type
:
'warning'
});
return
}
if
(
req
.
groupMessageSendReq
.
contentModelList
.
length
<
1
)
{
if
(
req
.
contentModelList
.
length
<
1
)
{
this
.
$message
({
message
:
'请输入群发内容'
,
type
:
'warning'
});
return
}
else
{
let
list
=
req
.
groupMessageSendReq
.
contentModelList
;
let
list
=
req
.
contentModelList
;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
!
list
[
i
].
info
)
{
this
.
$message
({
...
...
@@ -271,11 +302,22 @@ export default {
}
}
}
this
.
POST
(
"/im/group/message"
,
req
).
then
(
res
=>
{
this
.
POST
(
"/im/group/message
s
"
,
req
).
then
(
res
=>
{
this
.
loading
=
false
;
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
'000000'
)
{
if
(
res
.
data
.
status
==
1
)
{
this
.
searchParam
.
title
=
""
;
this
.
searchParam
.
fileModel
=
{};
this
.
searchParam
.
contentModelList
=
[];
this
.
excelfileName
=
''
;
}
else
{
this
.
$message
({
message
:
res
.
data
.
message
,
type
:
'error'
});
}
}
});
}
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录