Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
7b0c59e1
提交
7b0c59e1
编写于
6月 21, 2020
作者:
alex.zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
成员权限
上级
57291adc
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
766 行增加
和
746 行删除
+766
-746
create-live.vue
src/views/yqrange/create-live.vue
+726
-687
live-manage.vue
src/views/yqrange/live-manage.vue
+7
-4
role-manage.vue
src/views/yqrange/role-manage.vue
+33
-55
未找到文件。
src/views/yqrange/create-live.vue
浏览文件 @
7b0c59e1
<
template
>
<
template
>
<div
class=
"yqrange-index-wrapper"
>
<div
class=
"yqrange-index-wrapper"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
:curmbThird=
"curmbThird"
></bread-crumb>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
:curmbThird=
"curmbThird"
></bread-crumb>
<div
class=
"yqrange-index-content screenSet"
id=
"screenSet"
>
<div
class=
"yqrange-index-content screenSet"
id=
"screenSet"
>
<el-row
class=
"step-content"
>
<el-row
class=
"step-content"
>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<div
style=
"color:#666666;font-size:14px;"
>
{{
curmbThird
}}
</div>
<div
style=
"color:#666666;font-size:14px;"
>
{{
curmbThird
}}
</div>
<!--
<el-steps
:active=
"active"
simple
class
>
-->
<!--
<el-steps
:active=
"active"
simple
class
>
-->
<!--
<span
class=
"step-num"
:class=
"
{ 'on-step': stepData[0] }">1
</span>
-->
<!--
<span
class=
"step-num"
:class=
"
{ 'on-step': stepData[0] }">1
</span>
-->
<!--
<el-step
title=
"基础信息"
></el-step>
-->
<!--
<el-step
title=
"基础信息"
></el-step>
-->
<!--
<span
class=
"step-num"
:class=
"
{ 'on-step': stepData[1] }">2
</span>
-->
<!--
<span
class=
"step-num"
:class=
"
{ 'on-step': stepData[1] }">2
</span>
-->
<!--
<el-step
title=
"选择范围"
>
2
</el-step>
-->
<!--
<el-step
title=
"选择范围"
>
2
</el-step>
-->
<!--
</el-steps>
-->
<!--
</el-steps>
-->
</el-col>
</el-col>
<el-col
:span=
"6"
:offset=
"5"
>
<el-col
:span=
"6"
:offset=
"5"
>
...
@@ -17,21 +17,22 @@
...
@@ -17,21 +17,22 @@
</el-col>
</el-col>
</el-row>
</el-row>
<div
class=
"first-step"
>
<div
class=
"first-step"
>
<!--
<p
class=
"p-title"
>
基础信息
</p>
-->
<!--
<p
class=
"p-title"
>
基础信息
</p>
-->
<el-form
ref=
"formData"
<el-form
:model=
"formData"
ref=
"formData"
:rules=
"rules"
:model=
"formData"
label-width=
"150px"
:rules=
"rules"
label-suffix=
":"
label-width=
"150px"
class=
"basic-form"
>
label-suffix=
":"
class=
"basic-form"
>
<el-form-item
label=
"直播标题"
prop=
"name"
>
<el-form-item
label=
"直播标题"
prop=
"name"
>
<el-col
:span=
"13"
>
<el-col
:span=
"13"
>
<el-input
<el-input
size=
"small"
size=
"small"
v-model=
"formData.name"
v-model=
"formData.name"
placeholder=
"请输入直播标题"
placeholder=
"请输入直播标题"
style=
"width:70%;"
style=
"width:70%;"
></el-input>
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
name
).
replace
(
/
\s
+/g
,
""
).
length
}}
/20
</span>
<span
class=
"word-num"
>
{{
(
formData
.
name
).
replace
(
/
\s
+/g
,
""
).
length
}}
/20
</span>
</el-col>
</el-col>
...
@@ -52,25 +53,32 @@
...
@@ -52,25 +53,32 @@
<el-form-item
label=
"直播开始时间"
prop=
"openTime"
>
<el-form-item
label=
"直播开始时间"
prop=
"openTime"
>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<el-date-picker
<el-date-picker
v-model=
"formData.openTime"
v-model=
"formData.openTime"
size=
"small"
size=
"small"
type=
"datetime"
type=
"datetime"
placeholder=
"请选择直播开始时间"
placeholder=
"请选择直播开始时间"
value-format=
"yyyy-MM-dd HH:mm:ss"
value-format=
"yyyy-MM-dd HH:mm:ss"
:picker-options=
"pickerOptions0"
:picker-options=
"pickerOptions0"
style=
"width: 100%;"
style=
"width: 100%;"
></el-date-picker>
></el-date-picker>
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item
label=
"直播简介:"
class=
"required-label"
>
<el-form-item
label=
"直播简介:"
class=
"required-label"
>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<div
style=
"color:#666666;font-size:10px;"
>
直播图片可选择仅文字版,仅图片版或文字版+图片版
</div>
<div
style=
"color:#666666;font-size:10px;"
>
直播图片可选择仅文字版,仅图片版或文字版+图片版
</div>
<el-input
type=
"textarea"
v-model=
"formData.textContent"
placeholder=
"请输入直播简介"
maxlength=
"30"
rows=
"3"
style=
"width:80%;"
></el-input>
<el-input
<span
class=
"word-num"
>
{{
(
formData
.
textContent
).
replace
(
/
\s
+/g
,
""
).
length
}}
/300
</span>
type=
"textarea"
<div
style=
"color:#666666;font-size:12px;"
>
文字版
</div>
v-model=
"formData.textContent"
</el-col>
placeholder=
"请输入直播简介"
<el-col
:span=
"12"
>
maxlength=
"30"
rows=
"3"
style=
"width:80%;"
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
textContent
).
replace
(
/
\s
+/g
,
""
).
length
}}
/300
</span>
<div
style=
"color:#666666;font-size:12px;"
>
文字版
</div>
</el-col>
<el-col
:span=
"12"
>
<el-upload
<el-upload
v-model=
"formData.imageContent"
v-model=
"formData.imageContent"
class=
"bg-uploader"
class=
"bg-uploader"
...
@@ -103,34 +111,30 @@
...
@@ -103,34 +111,30 @@
<p>
支持.jpg,.png格式
</p>
<p>
支持.jpg,.png格式
</p>
</div>
</div>
</el-upload>
</el-upload>
<div
style=
"color:#666666;font-size:12px;"
>
图片版
</div>
<div
style=
"color:#666666;font-size:12px;"
>
图片版
</div>
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<div
class=
"basic-item-icon"
>
<div
class=
"basic-item-icon"
>
<el-form-item
label=
"直播封面"
class=
"required-label"
>
<el-form-item
label=
"直播封面"
class=
"required-label"
>
<el-upload
<el-upload
v-model=
"formData.cover"
v-model=
"formData.cover"
class=
"bg-uploader"
class=
"bg-uploader"
action=
"#"
action=
"#"
:show-file-list=
"false"
:show-file-list=
"false"
:before-upload=
"beforeUploadPic2"
:before-upload=
"beforeUploadPic2"
>
>
<img
<img
v-if=
"formData.cover"
v-if=
"formData.cover"
:src=
"formData.cover"
:src=
"formData.cover"
@
mouseover
.
stop=
"imgMouseOver2=true"
@
mouseover
.
stop=
"imgMouseOver2=true"
class=
"bg-img"
class=
"bg-img"
/>
<img
v-if=
"!formData.cover"
class=
"bg-img"
src=
"../../assets/image/small.png"
/>
/>
<img
v-if=
"!formData.cover"
class=
"bg-img"
src=
"../../assets/image/small.png"
/>
<div
<div
class=
"img-delete"
class=
"img-delete"
v-show=
"imgMouseOver2"
v-show=
"imgMouseOver2"
@
click
.
stop=
"deleteImg(2)"
@
click
.
stop=
"deleteImg(2)"
@
mouseout
.
stop=
"imgMouseOver2=false"
@
mouseout
.
stop=
"imgMouseOver2=false"
>
>
<i
class=
"el-icon-delete"
></i>
<i
class=
"el-icon-delete"
></i>
</div>
</div>
...
@@ -146,28 +150,24 @@
...
@@ -146,28 +150,24 @@
<div
class=
"basic-item-icon"
>
<div
class=
"basic-item-icon"
>
<el-form-item
label=
"直播预告图"
class=
"required-label"
>
<el-form-item
label=
"直播预告图"
class=
"required-label"
>
<el-upload
<el-upload
v-model=
"formData.preImage"
v-model=
"formData.preImage"
class=
"bg-uploader"
class=
"bg-uploader"
action=
"#"
action=
"#"
:show-file-list=
"false"
:show-file-list=
"false"
:before-upload=
"beforeUploadPic3"
:before-upload=
"beforeUploadPic3"
>
>
<img
<img
v-if=
"formData.preImage"
v-if=
"formData.preImage"
:src=
"formData.preImage"
:src=
"formData.preImage"
@
mouseover
.
stop=
"imgMouseOver3=true"
@
mouseover
.
stop=
"imgMouseOver3=true"
class=
"bg-img"
class=
"bg-img"
/>
<img
v-if=
"!formData.preImage"
class=
"bg-img"
src=
"../../assets/image/small.png"
/>
/>
<img
v-if=
"!formData.preImage"
class=
"bg-img"
src=
"../../assets/image/small.png"
/>
<div
<div
class=
"img-delete"
class=
"img-delete"
v-show=
"imgMouseOver3"
v-show=
"imgMouseOver3"
@
click
.
stop=
"deleteImg(3)"
@
click
.
stop=
"deleteImg(3)"
@
mouseout
.
stop=
"imgMouseOver3=false"
@
mouseout
.
stop=
"imgMouseOver3=false"
>
>
<i
class=
"el-icon-delete"
></i>
<i
class=
"el-icon-delete"
></i>
</div>
</div>
...
@@ -184,64 +184,66 @@
...
@@ -184,64 +184,66 @@
<div
style=
"color:#666666;font-size:10px;"
>
讲师(必填)
</div>
<div
style=
"color:#666666;font-size:10px;"
>
讲师(必填)
</div>
<el-col
:span=
"10"
>
<el-col
:span=
"10"
>
<el-form-item
label=
"姓名"
prop=
"lecturesUserName"
label-width=
"60px;"
>
<el-form-item
label=
"姓名"
prop=
"lecturesUserName"
label-width=
"60px;"
>
<el-input
size=
"small"
v-model=
"formData.lecturesUserName"
placeholder=
"请输入姓名"
style=
"width:70%;"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"13"
>
<el-form-item
label=
"手机"
prop=
"lecturesPhone"
>
<el-input
maxlength=
"11"
size=
"small"
v-model=
"formData.lecturesPhone"
placeholder=
"请输入手机号"
style=
"width:70%;"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"15"
>
<div
style=
"color:#666666;font-size:10px;"
>
嘉宾(选填)
</div>
</el-col>
<div
v-for=
"(item, index) in formData.guests"
:key=
"index"
>
<el-col
:span=
"10"
>
<el-form-item
label=
"姓名"
label-width=
"60px;"
>
<el-input
<el-input
size=
"small"
size=
"small"
v-model=
"
item.usern
ame"
v-model=
"
formData.lecturesUserN
ame"
placeholder=
"请输入姓名"
placeholder=
"请输入姓名"
style=
"width:70%;"
style=
"width:70%;"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"13"
>
<el-col
:span=
"13"
>
<el-form-item
label=
"手机"
>
<el-form-item
label=
"手机"
prop=
"lecturesPhone"
>
<el-input
maxlength=
"11"
<el-input
maxlength=
"11"
size=
"small"
size=
"small"
v-model=
"
item.p
hone"
v-model=
"
formData.lecturesP
hone"
placeholder=
"请输入手机号"
placeholder=
"请输入手机号"
style=
"width:70%;"
style=
"width:70%;"
></el-input>
></el-input>
<img
@
click=
"addGuest(index)"
class=
"edit-img"
src=
"../../assets/image/plus.png"
v-if=
"isPreview!=1"
/>
<img
@
click=
"delGuest(index)"
v-if=
"index >= 1 && isPreview!=1"
class=
"edit-img"
src=
"../../assets/image/trash.png"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"15"
>
<div
style=
"color:#666666;font-size:10px;"
>
嘉宾(选填)
</div>
</el-col>
<div
v-for=
"(item, index) in formData.guests"
:key=
"index"
>
<el-col
:span=
"10"
>
<el-form-item
label=
"姓名"
label-width=
"60px;"
>
<el-input
size=
"small"
v-model=
"item.username"
placeholder=
"请输入姓名"
style=
"width:70%;"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"13"
>
<el-form-item
label=
"手机"
>
<el-input
maxlength=
"11"
size=
"small"
v-model=
"item.phone"
placeholder=
"请输入手机号"
style=
"width:70%;"
></el-input>
<img
@
click=
"addGuest(index)"
class=
"edit-img"
src=
"../../assets/image/plus.png"
v-if=
"isPreview!=1"
/>
<img
@
click=
"delGuest(index)"
v-if=
"index >= 1 && isPreview!=1"
class=
"edit-img"
src=
"../../assets/image/trash.png"
/>
</el-form-item>
</el-col>
</div>
</div>
<!--
<el-col
:span=
"15"
>
-->
<!--
<el-col
:span=
"15"
>
-->
<!--
<p
class=
"err-text"
v-if=
"guestErrFlag"
><img
src=
"../../assets/image/err-icon.svg"
alt=
""
>
{{
guestErrText
}}
</p>
-->
<!--
<p
class=
"err-text"
v-if=
"guestErrFlag"
><img
src=
"../../assets/image/err-icon.svg"
alt=
""
>
{{
guestErrText
}}
</p>
-->
<!--
</el-col>
-->
<!--
</el-col>
-->
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -250,632 +252,669 @@
...
@@ -250,632 +252,669 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniu-util"
;
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniu-util"
;
import
{
checkMobile
}
from
'../../utils/patients/checkValid'
;
import
{
checkMobile
}
from
"../../utils/patients/checkValid"
;
import
{
getRtcInfo
}
from
"../../utils/yqrange/yqrangeApi"
;
import
{
getRtcInfo
}
from
"../../utils/yqrange/yqrangeApi"
;
// import { checkPhone } from "../login.vue";
// import { checkPhone } from "../login.vue";
let
vm
=
null
;
let
vm
=
null
;
export
default
{
export
default
{
components
:
{
components
:
{
BreadCrumb
BreadCrumb
},
},
data
(){
data
()
{
let
checkProjectStr
=
(
rule
,
value
,
callback
)
=>
{
let
checkProjectStr
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
indexOf
(
"
\
\"
) != -1) {
if
(
value
.
indexOf
(
"
\
\"
) != -1) {
//存在
//存在
callback(new Error("
请勿输入字符“
\\
”
"));
callback(new Error("
请勿输入字符“
\\
”
"));
} else if (value.indexOf("
.
") != -1) {
} else if (value.indexOf("
.
") != -1) {
callback(new Error("
请勿输入字符“
.
”
"));
callback(new Error("
请勿输入字符“
.
”
"));
} else {
} else {
callback();
callback();
}
}
};
};
return{
return {
curmbFirst: '云鹊小圈',
curmbFirst: "
云鹊小圈
",
curmbSecond: '直播管理',
curmbSecond: "
直播管理
",
curmbThird: '新建直播',
curmbThird: "
新建直播
",
//页面展示位置
//页面展示位置
isCollectShow: false,
isCollectShow: false,
formData: {
formData: {
circleId: "
1
",// 圈子ID
circleId: "
1
", // 圈子ID
name: '',// 直播名称
name: "", // 直播名称
scope: "
1
",// 直播范围 1-非公开 2-公开
scope: "
1
", // 直播范围 1-非公开 2-公开
infoCollect: "
0
",// 是否采集用户信息 0-否 1-是
infoCollect: "
0
", // 是否采集用户信息 0-否 1-是
openTime: '',// 直播开始时间
openTime: "", // 直播开始时间
rtcIntroduces:[{
rtcIntroduces: [
{
seqNo: "",
seqNo: "",
content:
''
,
content:
""
,
type: "
1
" // 文字
type: "
1
" // 文字
},
},
{
{
seqNo: "",
seqNo: "",
content: '',
content: "",
type: "
2
" // 图片
type: "
2
" // 图片
}
],// 直播简介
cover: '', // 直播封面url 直播第一帧图片
preImage: '', // 直播预告图url
textContent: '', // 直播简介文字版
imageContent: '',// 直播简介图片版
// imgUrl2: '',
// imgUrl2More: {},
// imgUrl3: '',
// imgUrl3More: {},
intro:'',
hostName: '',
guestName: '',
hostMobile: '',
guestMobile: '',
mobile1: '',
lecturesUserName: '',
lecturesPhone: '',
lecturers: [{
username: '',
phone: ''
}],// 讲师
guests: [{
phone: '',
username: ''
}] // 嘉宾
},
// imgUrl1: '',
imgUrl1More: {},
guestErrFlag: false,
guestErrText: '嘉宾最多5位!',
isPreview: 0,
imgMouseOver1: false,
uploadImgMessage1: false,//未上传图片,校验提示语
imgMouseOver2: false,
uploadImgMessage2: false,
imgMouseOver3: false,
uploadImgMessage3:false,
pickerOptions0: {
disabledDate: time => {
// 在科学计数法中,为了使公式简便,可以用带“E”的格式表示。例如1.03乘10的8次方,可简写为“1.03e8”的形式
// 一天是24*60*60*1000 = 86400000 = 8.64e7
// console.log('this.maxDate',this.maxDate)
return time.getTime() < Date.now() - 8.64e7
}
}
},
], // 直播简介
rules: {
cover: "", // 直播封面url 直播第一帧图片
name: [
preImage: "", // 直播预告图url
{ required: true, message: "
请输入直播标题
", trigger: "
blur
" },
textContent: "", // 直播简介文字版
{
imageContent: "", // 直播简介图片版
min: 2,
// imgUrl2: '',
max: 24,
// imgUrl2More: {},
message: "
输入长度为
2
-
24
的内容,可包含中英文、数字及特殊符号
",
// imgUrl3: '',
trigger: "
blur
"
// imgUrl3More: {},
},
intro: "",
{ validator: checkProjectStr, trigger: "
blur
" }
hostName: "",
],
guestName: "",
scope:[
hostMobile: "",
{required: true}
guestMobile: "",
],
mobile1: "",
infoCollect: [
lecturesUserName: "",
{required: true, message: "
请选择是否收集用户信息
", trigger: "
blur
"}
lecturesPhone: "",
],
lecturers: [
openTime: [
{
{required: true, message: "
请选择直播开始时间
", trigger: "
blur
"}
username: "",
],
phone: ""
// // 直播简介
}
// introduce: [
], // 讲师
// {required: true, message: "
请选择文字版或图片版
", trigger: "
blur
"}
guests: [
// ],
{
lecturesUserName: [
phone: "",
{required: true, message: "
请输入姓名
", trigger: "
blur
"},
username: ""
],
}
// guestName: [
] // 嘉宾
// {required: true, message: "
请输入姓名
", trigger: "
blur
"},
},
// ],
// imgUrl1: '',
lecturesPhone: [
imgUrl1More: {},
{required: true, message: "
请输入手机号
", trigger: ['change','blur']},
guestErrFlag: false,
{validator: checkMobile, trigger: ['change','blur']}
guestErrText: "
嘉宾最多
5
位!
",
],
isPreview: 0,
imgMouseOver1: false,
// introduce: [
uploadImgMessage1: false, //未上传图片,校验提示语
// { required: true, message: "
请输入
", trigger: "
blur
" },
imgMouseOver2: false,
// {
uploadImgMessage2: false,
// min: 2,
imgMouseOver3: false,
// max: 24,
uploadImgMessage3: false,
// message: "
输入长度为
2
-
24
的内容,可包含中英文、数字及特殊符号
",
pickerOptions0: {
// trigger: "
blur
"
disabledDate: time => {
// },
// 在科学计数法中,为了使公式简便,可以用带“E”的格式表示。例如1.03乘10的8次方,可简写为“1.03e8”的形式
// { validator: checkProjectStr, trigger: "
blur
" }
// 一天是24*60*60*1000 = 86400000 = 8.64e7
// ],
// console.log('this.maxDate',this.maxDate)
return time.getTime() < Date.now() - 8.64e7;
}
}
}
},
},
rules: {
created() {
name: [
// 区分内部用户和外部用户
{ required: true, message: "
请输入直播标题
", trigger: "
blur
" },
let idType = localStorage.getItem('storageIdType');
{
// vm = this;
min: 2,
// vm.entryId = vm.getUrlSearch(window.location.href, "
entryId
");
max: 24,
// vm.peopleLevel = vm.getUrlSearch(window.location.href, "
level
");
message: "
输入长度为
2
-
24
的内容,可包含中英文、数字及特殊符号
",
// vm.init();
trigger: "
blur
"
},
{ validator: checkProjectStr, trigger: "
blur
" }
],
scope: [{ required: true }],
infoCollect: [
{ required: true, message: "
请选择是否收集用户信息
", trigger: "
blur
" }
],
openTime: [
{ required: true, message: "
请选择直播开始时间
", trigger: "
blur
" }
],
// // 直播简介
// introduce: [
// {required: true, message: "
请选择文字版或图片版
", trigger: "
blur
"}
// ],
lecturesUserName: [
{ required: true, message: "
请输入姓名
", trigger: "
blur
" }
],
// guestName: [
// {required: true, message: "
请输入姓名
", trigger: "
blur
"},
// ],
lecturesPhone: [
{
required: true,
message: "
请输入手机号
",
trigger: ["
change
", "
blur
"]
},
{ validator: checkMobile, trigger: ["
change
", "
blur
"] }
]
// introduce: [
// { required: true, message: "
请输入
", trigger: "
blur
" },
// {
// min: 2,
// max: 24,
// message: "
输入长度为
2
-
24
的内容,可包含中英文、数字及特殊符号
",
// trigger: "
blur
"
// },
// { validator: checkProjectStr, trigger: "
blur
" }
// ],
},
circleId: null,
};
},
created() {
// 区分内部用户和外部用户
let idType = localStorage.getItem("
storageIdType
");
// vm = this;
// vm.entryId = vm.getUrlSearch(window.location.href, "
entryId
");
// vm.peopleLevel = vm.getUrlSearch(window.location.href, "
level
");
// vm.init();
this.circleId = this.$route.query.circleId;
},
mounted() {
const rtcId = this.$route.query.rtcId;
// if(rtcId){
// this.curmbThird = "
编辑直播
";
// }
if (rtcId) {
this.curmbThird = "
编辑直播
";
this.initRtcInfo(rtcId);
}
},
},
methods: {
mounted() {
checkPhone(val) {
const rtcId = this.$route.query.rtcId;
if (!/^1[3456789]
\
d{9}$/.test(val)) {
// if(rtcId){
return false;
// this.curmbThird = "
编辑直播
";
} else {
// }
return true;
if(rtcId){
this.curmbThird = "
编辑直播
";
this.initRtcInfo(rtcId);
}
}
},
},
// 初始化直播
methods: {
initRtcInfo(rtcId) {
checkPhone(val) {
getRtcInfo({
if(!(/^1[3456789]
\
d{9}$/.test(val))) {
rtcId
return false;
})
} else {
.then(data => {
return true;
if (data.code == "
000000
") {
}
},
// 初始化直播
initRtcInfo(rtcId){
getRtcInfo({
rtcId
}).then((data) => {
if(data.code == "
000000
") {
this.formData = data.data;
this.formData = data.data;
this.initFormData();
this.initFormData();
console.log(this.formData);
console.log(this.formData);
}
}
}).catch((error) => {
})
.catch(error => {
this.$message({
this.$message({
message: error,
message: error,
type:
'error'
type:
"
error
"
});
});
})
})
;
},
},
//上传直播简介
//上传直播简介
beforeUploadPic1(file) {
beforeUploadPic1(file) {
let fileLimit = {
let fileLimit = {
width: 750,
width: 750,
height: "",
height: "",
size: 0.5,
size: 0.5,
sizeText: "
500
K
",
sizeText: "
500
K
",
key: "
imageContent
",
key: "
imageContent
",
more: "
imgUrl1More
",
more: "
imgUrl1More
",
show: "
uploadImgMessage1
"
show: "
uploadImgMessage1
"
};
};
this.beforeUpload(file, fileLimit);
this.beforeUpload(file, fileLimit);
},
},
// 上传直播封面
// 上传直播封面
beforeUploadPic2(file) {
beforeUploadPic2(file) {
let fileLimit = {
let fileLimit = {
width: 160,
width: 160,
height: 120,
height: 120,
size: 2,
size: 2,
sizeText: "
2
Mb
",
sizeText: "
2
Mb
",
key: "
cover
",
key: "
cover
",
more: "
imgUrl2More
",
more: "
imgUrl2More
",
show: "
uploadImgMessage2
"
show: "
uploadImgMessage2
"
};
};
this.beforeUpload(file, fileLimit);
this.beforeUpload(file, fileLimit);
},
},
// 上传直播预告图
// 上传直播预告图
beforeUploadPic3(file) {
beforeUploadPic3(file) {
let fileLimit = {
let fileLimit = {
width: 750,
width: 750,
height: 420,
height: 420,
size: 2,
size: 2,
sizeText: "
2
Mb
",
sizeText: "
2
Mb
",
key: "
preImage
",
key: "
preImage
",
more: "
imgUrl3More
",
more: "
imgUrl3More
",
show: "
uploadImgMessage3
"
show: "
uploadImgMessage3
"
};
};
this.beforeUpload(file, fileLimit);
this.beforeUpload(file, fileLimit);
},
},
//上传图片
//上传图片
beforeUpload(file, fileLimit) {
beforeUpload(file, fileLimit) {
let vm = this;
let vm = this;
const isJPG = file.type === "
image
/
jpeg
";
const isJPG = file.type === "
image
/
jpeg
";
const isPNG = file.type === "
image
/
png
";
const isPNG = file.type === "
image
/
png
";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) {
if (!isJPG && !isPNG) {
vm.$message.error("
图片格式不符合规范,请根据规范上传图片
");
vm.$message.error("
图片格式不符合规范,请根据规范上传图片
");
// return;
// return;
}
}
if (!isLt2M) {
if (!isLt2M) {
vm.$message.error("
图片大小不符合规范,请根据规范上传图片
");
vm.$message.error("
图片大小不符合规范,请根据规范上传图片
");
// return;
// return;
}
}
let _img = new FileReader();
let _img = new FileReader();
_img.readAsDataURL(file);
_img.readAsDataURL(file);
_img.onload = function(theFile) {
_img.onload = function(theFile) {
let image = new Image();
let image = new Image();
image.src = theFile.target.result;
image.src = theFile.target.result;
image.onload = function() {
image.onload = function() {
let _this = this;
let _this = this;
if(fileLimit.key == "
imageContent
" & _this.width != fileLimit.width){
if (
vm.$message.error("
图片尺寸不符合规范,请根据规范上传图片
");
(fileLimit.key == "
imageContent
") &
}
(_this.width != fileLimit.width)
else if (fileLimit.key != "
imageContent
" & (_this.width != fileLimit.width || _this.height != fileLimit.height)) {
) {
vm.$message.error("
图片尺寸不符合规范,请根据规范上传图片
");
vm.$message.error("
图片尺寸不符合规范,请根据规范上传图片
");
} else {
} else if (
openLoading(vm);
(fileLimit.key != "
imageContent
") &
doUpload(vm, file, getFilePath(file, null), "
preview4
", "
progress1
", 1).then(function(path) {
(_this.width != fileLimit.width || _this.height != fileLimit.height)
closeLoading(vm);
) {
console.log('上传成功后路径',path);
vm.$message.error("
图片尺寸不符合规范,请根据规范上传图片
");
if (fileLimit.show == "
uploadImgMessage1
") {
} else {
vm.uploadImgMessage1 = false;
openLoading(vm);
} else if (fileLimit.show == "
uploadImgMessage2
") {
doUpload(
vm.uploadImgMessage2 = false;
vm,
}
file,
else if (fileLimit.show == "
uploadImgMessage3
") {
getFilePath(file, null),
vm.uploadImgMessage3 = false;
"
preview4
",
}
"
progress1
",
vm.formData[fileLimit.key] = path.fullPath;
1
vm.formData[fileLimit.more] = {
).then(function(path) {
attachmentName: path.name,
closeLoading(vm);
attachmentExt: path.ext,
console.log("
上传成功后路径
", path);
attachmentSize: path.size
if (fileLimit.show == "
uploadImgMessage1
") {
};
vm.uploadImgMessage1 = false;
vm.$message.success("
上传成功
");
} else if (fileLimit.show == "
uploadImgMessage2
") {
});
vm.uploadImgMessage2 = false;
}
} else if (fileLimit.show == "
uploadImgMessage3
") {
};
vm.uploadImgMessage3 = false;
}
vm.formData[fileLimit.key] = path.fullPath;
vm.formData[fileLimit.more] = {
attachmentName: path.name,
attachmentExt: path.ext,
attachmentSize: path.size
};
vm.$message.success("
上传成功
");
});
}
};
};
return isJPG && isLt2M
;
}
;
},
return isJPG && isLt2M;
// 是否公开
},
changeScope(value){
// 是否公开
if(value == 2)
{
changeScope(value)
{
this.isCollectShow = true;
if (value == 2) {
}
this.isCollectShow = true;
else {
}
else {
this.isCollectShow = false;
this.isCollectShow = false;
}
}
},
},
// 校验直播简介文字版或图片版
// 校验直播简介文字版或图片版
checkIntroduce()
{
checkIntroduce()
{
// console.log(this.formData.rtcIntroduces[0].content);
// console.log(this.formData.rtcIntroduces[0].content);
console.log(this.formData.rtcIntroduces[1].content);
console.log(this.formData.rtcIntroduces[1].content);
let flag = true;
let flag = true;
if(this.formData.textContent == ""
if (
& this.formData.imageContent == ""){
(this.formData.textContent == "") &
flag = false;
(this.formData.imageContent == "")
this.$message.error("
直播简介中可选择仅文字版,仅图片版或文字版
+
图片版
");
) {
}
flag = false;
return flag;
this.$message.error(
},
"
直播简介中可选择仅文字版,仅图片版或文字版
+
图片版
"
//删除图片
);
deleteImg(type) {
}
if (type == 1) {
return flag;
this.imageContent = "";
},
this.imgMouseOver1 = false;
//删除图片
}
deleteImg(type) {
else if (type == 2) {
if (type == 1) {
this.formData.cover = "";
this.imageContent = "";
this.imgMouseOver2 = false;
this.imgMouseOver1 = false;
}
} else if (type == 2) {
else if (type == 3) {
this.formData.cover = "";
this.formData.preImage = "";
this.imgMouseOver2 = false;
this.imgMouseOver3 = false;
} else if (type == 3) {
}
this.formData.preImage = "";
},
this.imgMouseOver3 = false;
// 校验直播封面
}
checkCover(){
},
let flag = true;
// 校验直播封面
if(this.formData.cover == ""){
checkCover() {
flag = false;
let flag = true;
this.$message.error("
请上传直播封面!
");
if (this.formData.cover == "") {
}
flag = false;
this.$message.error("
请上传直播封面!
");
}
return flag;
return flag;
},
},
// 校验直播预告图
// 校验直播预告图
checkPreImage()
{
checkPreImage()
{
let flag = true;
let flag = true;
if(this.formData.preImage == "")
{
if (this.formData.preImage == "")
{
flag = false;
flag = false;
this.$message.error("
请上传直播预告图!
");
this.$message.error("
请上传直播预告图!
");
}
}
return flag;
return flag;
},
},
// 校验嘉宾姓名和手机号
// 校验嘉宾姓名和手机号
checkGuests(){
checkGuests() {
let flag = true;
let flag = true;
if(this.formData.guests != null & this.formData.guests.length >= 1){
if ((this.formData.guests != null) & (this.formData.guests.length >= 1)) {
for(let i=0;i<this.formData.guests.length;i++) {
for (let i = 0; i < this.formData.guests.length; i++) {
if(this.formData.guests[i].username != "" & this.formData.guests[i].phone == ""){
if (
this.$message.error("
请输入嘉宾
'" + this.formData.guests[i].username + "'
的手机号
");
(this.formData.guests[i].username != "") &
(this.formData.guests[i].phone == "")
) {
this.$message.error(
"
请输入嘉宾
'" + this.formData.guests[i].username + "'
的手机号
"
);
flag = false;
break;
} else if (
(this.formData.guests[i].username != "") &
(this.formData.guests[i].phone != "")
) {
if (!this.checkPhone(this.formData.guests[i].phone)) {
this.$message.error(
"
请输入嘉宾
'" +
this.formData.guests[i].username +
"'
的正确手机号
"
);
flag = false;
flag = false;
break;
break;
}
}
else if(this.formData.guests[i].username != "" & this.formData.guests[i].phone != ""){
// 检查讲师和嘉宾手机号是否相同
if (
if(!this.checkPhone(this.formData.guests[i].phone)){
!this.checkUniquePhone(
this.$message.error("
请输入嘉宾
'" + this.formData.guests[i].username + "'
的正确手机号
");
this.formData.lecturesPhone,
flag = false;
this.formData.guests[i].phone
break;
)
}
) {
// 检查讲师和嘉宾手机号是否相同
this.$message.error("
请输入不同的手机号
");
if(!this.checkUniquePhone(this.formData.lecturesPhone, this.formData.guests[i].phone)){
this.$message.error("
请输入不同的手机号
");
flag = false;
break;
}
// 检查嘉宾手机号是否相同
if(this.formData.guests.length > 1){
for(let j= i + 1;j<this.formData.guests.length;j++) {
if(!this.checkUniquePhone(this.formData.guests[i].phone, this.formData.guests[j].phone)){
this.$message.error("
请输入不同的手机号
");
flag = false;
break;
}
}
}
}
else if(this.formData.guests[i].username == "" & this.formData.guests[i].phone != ""){
this.$message.error("
请输入手机号为
'" + this.formData.guests[i].phone + "'
嘉宾的姓名
");
flag = false;
flag = false;
break;
break;
}
}
// 检查嘉宾手机号是否相同
if (this.formData.guests.length > 1) {
for (let j = i + 1; j < this.formData.guests.length; j++) {
if (
!this.checkUniquePhone(
this.formData.guests[i].phone,
this.formData.guests[j].phone
)
) {
this.$message.error("
请输入不同的手机号
");
flag = false;
break;
}
}
}
} else if (
(this.formData.guests[i].username == "") &
(this.formData.guests[i].phone != "")
) {
this.$message.error(
"
请输入手机号为
'" + this.formData.guests[i].phone + "'
嘉宾的姓名
"
);
flag = false;
break;
}
}
}
}
}
return flag;
return flag;
},
},
checkUniquePhone(phone1, phone2){
let flag = true;
if(phone1 != "" & phone2 != "" & phone1 == phone2){
flag = false;
}
return flag;
checkUniquePhone(phone1, phone2) {
},
let flag = true;
// 增加嘉宾
if ((phone1 != "") & (phone2 != "") & (phone1 == phone2)) {
addGuest(index) {
flag = false;
}
if(!this.checkGuests()){
return flag;
return;
},
}
// 增加嘉宾
if(this.formData.guests != null & this.formData.guests.length >= 5){
addGuest(index) {
this.$message.error("
嘉宾最多
5
位!
");
if (!this.checkGuests()) {
// this.guestErrFlag = true;
return;
// setTimeout(function () {
}
// this.guestErrFlag = false;
if ((this.formData.guests != null) & (this.formData.guests.length >= 5)) {
// }, 3000)
this.$message.error("
嘉宾最多
5
位!
");
}
// this.guestErrFlag = true;
else {
// setTimeout(function () {
this.formData.guests.push({username: "", phone: ""});
// this.guestErrFlag = false;
// this.formData.guests.splice(index + 1, 0, "");
// }, 3000)
}
} else {
},
this.formData.guests.push({ username: "", phone: "" });
// this.formData.guests.splice(index + 1, 0, "");
}
},
// 删除嘉宾
// 删除嘉宾
delGuest(index) {
delGuest(index) {
this.formData.guests.splice(index, 1);
this.formData.guests.splice(index, 1);
},
},
// 封装数据
// 封装数据
initFormData(){
initFormData() {
this.formData.scope = String(this.formData.scope);
this.formData.scope = String(this.formData.scope);
if(this.formData.scope == "
2
"){
if (this.formData.scope == "
2
") {
this.isCollectShow = true;
this.isCollectShow = true;
}
}
this.formData.infoCollect = String(this.formData.infoCollect);
this.formData.infoCollect = String(this.formData.infoCollect);
if(this.formData.rtcIntroduces != null){
if (this.formData.rtcIntroduces != null) {
for(let i=0;i<this.formData.rtcIntroduces.length;i++) {
for (let i = 0; i < this.formData.rtcIntroduces.length; i++) {
if(this.formData.rtcIntroduces[i].type == "
1
"){
if (this.formData.rtcIntroduces[i].type == "
1
") {
this.formData.textContent = this.formData.rtcIntroduces[i].content;
this.formData.textContent = this.formData.rtcIntroduces[i].content;
}
} else if (this.formData.rtcIntroduces[i].type == "
2
") {
else if(this.formData.rtcIntroduces[i].type == "
2
"){
this.formData.imageContent = this.formData.rtcIntroduces[i].content;
this.formData.imageContent = this.formData.rtcIntroduces[i].content;
}
}
}
}
}
// 设置讲师
}
if(this.formData.lecturers != null){
// 设置讲师
this.formData.lecturesUserName = this.formData.lecturers[0].username;
if (this.formData.lecturers != null) {
this.formData.lecturesPhone = this.formData.lecturers[0].phone;
this.formData.lecturesUserName = this.formData.lecturers[0].username;
}
this.formData.lecturesPhone = this.formData.lecturers[0].phone;
}
},
},
// 封装数据
// 封装数据
setFormData(){
setFormData() {
if(!this.formData.circleId){
if (!this.formData.circleId) {
this.formData.circleId = 1;// 测试用
this.formData.circleId = 1; // 测试用
}
}
if(this.formData.textContent){
if (this.formData.textContent) {
this.formData.rtcIntroduces[0].type = 1;
this.formData.rtcIntroduces[0].type = 1;
this.formData.rtcIntroduces[0].content = this.formData.textContent;
this.formData.rtcIntroduces[0].content = this.formData.textContent;
}
}
// 直播简介图片版
// 直播简介图片版
if(this.formData.imageContent){
if (this.formData.imageContent) {
this.formData.rtcIntroduces[1].type = 2;
this.formData.rtcIntroduces[1].type = 2;
this.formData.rtcIntroduces[1].content = this.formData.imageContent;
this.formData.rtcIntroduces[1].content = this.formData.imageContent;
}
}
// 设置讲师
// 设置讲师
// if(this.formData.lecturers == undefined){
// if(this.formData.lecturers == undefined){
// this.formData.lecturers
// this.formData.lecturers
// }
// }
// if(this.formData.lecturers != undefined & this.formData.lecturers.length == 0){
// if(this.formData.lecturers != undefined & this.formData.lecturers.length == 0){
//
//
// this.formData.lecturers.push({username: this.formData.lecturesUserName, phone: this.formData.lecturesPhone});
// this.formData.lecturers.push({username: this.formData.lecturesUserName, phone: this.formData.lecturesPhone});
// }
// }
this.formData.lecturers[0].username = this.formData.lecturesUserName;
this.formData.lecturers[0].phone = this.formData.lecturesPhone;
},
complete(formName) {
this.formData.lecturers[0].username = this.formData.lecturesUserName;
console.log(this.formData);
this.formData.lecturers[0].phone = this.formData.lecturesPhone;
this.$refs[formName].validate((valid) => {
},
if (valid) {
this.submit();
} else {
console.log('error submit!!');
return false;
}
});
},
//完成
complete(formName) {
submit() {
console.log(this.formData);
this.setFormData();
this.$refs[formName].validate(valid => {
// 校验直播简介文字版或图片版
if (valid) {
if(!this.checkIntroduce()){
this.submit();
return;
} else {
}
console.log("
error
submit
!!
");
// 校验直播封面、预告图
return false;
if(!this.checkCover() || !this.checkPreImage()){
return;
}
// 校验嘉宾姓名和手机号
if(!this.checkGuests()){
return;
}
}
});
},
let req = this.formData;
//完成
openLoading(this);
submit() {
this.POST('rtc/liveAdmin', req).then((res) => {
this.setFormData();
closeLoading(this);
// 校验直播简介文字版或图片版
if( res.code == '000000'
) {
if (!this.checkIntroduce()
) {
this.$message.success("
操作成功
")
;
return
;
this.$router.push({
}
path: '/live-manage',
// 校验直播封面、预告图
})
if (!this.checkCover() || !this.checkPreImage()) {
}
return;
else {
}
this.$message.error("
操作失败,请重试
");
// 校验嘉宾姓名和手机号
}
if (!this.checkGuests()) {
})
return;
}
},
let req = this.formData;
},
openLoading(this);
this.POST("
rtc
/
liveAdmin
", req).then(res => {
closeLoading(this);
if (res.code == "
000000
") {
this.$message.success("
操作成功
");
this.$router.push({
// path: '/live-manage',
path: "
/
live
-
manage
?
id
=
" + this.circleId
});
} else {
this.$message.error("
操作失败,请重试
");
}
});
}
}
}
};
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
.yqrange-index-wrapper
{
.yqrange-index-wrapper
{
.yqrange-index-content
{
.yqrange-index-content
{
background
:
#fff
;
background
:
#fff
;
padding
:
10px
;
padding
:
10px
;
.step-content
{
.step-content
{
overflow
:
hidden
;
overflow
:
hidden
;
height
:
60px
;
height
:
60px
;
padding
:
15px
0
50px
0
;
padding
:
15px
0
50px
0
;
border-bottom
:
1px
solid
#efefef
;
border-bottom
:
1px
solid
#efefef
;
.is-text
{
.is-text
{
display
:
none
;
display
:
none
;
}
}
.el-steps--simple
{
.el-steps--simple
{
background
:
#fff
;
background
:
#fff
;
padding
:
10px
8%
;
padding
:
10px
8%
;
}
.step-num
{
display
:
block
;
margin-top
:
1
.5px
;
font-size
:
12px
;
border
:
1px
solid
#999
!
important
;
border-radius
:
50%
;
width
:
25px
;
height
:
18px
;
line-height
:
15px
;
text-align
:
center
;
color
:
#999
;
}
.el-step__title.is-wait
{
color
:
#999
;
}
.el-step__title.is-process
{
color
:
#449284
;
}
.is-finish
{
color
:
#999
!
important
;
}
.on-step
{
color
:
#449284
;
border
:
1px
solid
#449284
!
important
;
}
}
.first-step
{
margin-top
:
20px
;
.p-title
{
padding-left
:
10px
;
margin-bottom
:
15px
;
}
.basic-item-icon
{
position
:
relative
;
.require
{
position
:
absolute
;
left
:
67px
;
top
:
11px
;
color
:
#f56c6c
;
}
}
.step-num
{
.upload-message
{
display
:
block
;
position
:
absolute
;
margin-top
:
1
.5px
;
left
:
160px
;
top
:
105px
;
font-size
:
12px
;
font-size
:
12px
;
border
:
1px
solid
#999
!
important
;
color
:
#f56c6c
;
border-radius
:
50%
;
width
:
25px
;
height
:
18px
;
line-height
:
15px
;
text-align
:
center
;
color
:
#999
;
}
.el-step__title.is-wait
{
color
:
#999
;
}
}
.el-step__title.is-process
{
.img-delete
{
color
:
#449284
;
position
:
absolute
;
}
left
:
0px
;
.is-finish
{
top
:
0px
;
color
:
#999
!
important
;
width
:
84px
;
}
height
:
100px
;
.on-step
{
background
:
#000
;
color
:
#449284
;
opacity
:
0
.7
;
border
:
1px
solid
#449284
!
important
;
z-index
:
999
;
}
i
{
}
color
:
#fff
;
.first-step
{
margin-top
:
39px
;
margin-top
:
20px
;
margin-left
:
0px
;
.p-title
{
padding-left
:
10px
;
margin-bottom
:
15px
;
}
.basic-item-icon
{
position
:
relative
;
.require
{
position
:
absolute
;
left
:
67px
;
top
:
11px
;
color
:
#f56c6c
;
}
.upload-message
{
position
:
absolute
;
left
:
160px
;
top
:
105px
;
font-size
:
12px
;
color
:
#f56c6c
;
}
.img-delete
{
position
:
absolute
;
left
:
0px
;
top
:
0px
;
width
:
84px
;
height
:
100px
;
background
:
#000
;
opacity
:
0
.7
;
z-index
:
999
;
i
{
color
:
#fff
;
margin-top
:
39px
;
margin-left
:
0px
;
}
}
}
}
}
.word-num
{
}
font-size
:
12px
;
.word-num
{
color
:
#999
;
font-size
:
12px
;
padding-top
:
5px
;
color
:
#999
;
}
padding-top
:
5px
;
.line
{
}
.line
{
margin-left
:
10px
;
width
:
20px
;
}
.bg-uploader
{
.bg-img
{
float
:
left
;
width
:
84px
;
height
:
100px
;
}
.limit-text
{
float
:
left
;
margin-left
:
10px
;
margin-left
:
10px
;
width
:
20px
;
margin-top
:
-10px
;
}
p
{
.bg-uploader
{
font-size
:
12px
;
.bg-img
{
color
:
#999
;
float
:
left
;
width
:
84px
;
height
:
100px
;
}
.limit-text
{
float
:
left
;
margin-left
:
10px
;
margin-top
:
-10px
;
p
{
font-size
:
12px
;
color
:
#999
;
}
}
}
}
}
.el-upload__tip
{
}
position
:
absolute
;
.el-upload__tip
{
top
:
-6px
;
position
:
absolute
;
left
:
130
px
;
top
:
-6
px
;
}
left
:
130px
;
}
}
}
}
}
}
.
required-label
.
el-form-item__label
:
:
before
{
}
content
:
'*'
;
.
required-label
.
el-form-item__label
:
:
before
{
color
:
#F56C6C
;
content
:
"*"
;
margin-right
:
4px
;
color
:
#f56c6c
;
}
margin-right
:
4px
;
</
style
>
}
</
style
>
src/views/yqrange/live-manage.vue
浏览文件 @
7b0c59e1
...
@@ -210,7 +210,7 @@ export default {
...
@@ -210,7 +210,7 @@ export default {
//新建直播
//新建直播
createLive
()
{
createLive
()
{
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
"/create-live
"
path
:
"/create-live
?circleId="
+
this
.
circleId
,
});
});
},
},
//弹出直播链接弹窗
//弹出直播链接弹窗
...
@@ -304,7 +304,8 @@ export default {
...
@@ -304,7 +304,8 @@ export default {
path
:
"/create-live"
,
path
:
"/create-live"
,
query
:
{
query
:
{
// rtcId: "16"
// rtcId: "16"
rtcId
:
row
.
id
rtcId
:
row
.
id
,
}
}
});
});
},
},
...
@@ -323,8 +324,8 @@ export default {
...
@@ -323,8 +324,8 @@ export default {
circleId
:
this
.
circleId
,
circleId
:
this
.
circleId
,
name
:
name
,
name
:
name
,
liveStatus
:
status
,
liveStatus
:
status
,
pageNo
:
1
,
pageNo
:
this
.
searchForm
.
pageNo
,
pageSize
:
10
pageSize
:
this
.
searchForm
.
pageSize
};
};
console
.
log
(
"alex name = "
+
name
+
", status = "
+
status
);
console
.
log
(
"alex name = "
+
name
+
", status = "
+
status
);
vm
.
POST
(
"rtc/liveAdmin/list"
,
req
).
then
(
res
=>
{
vm
.
POST
(
"rtc/liveAdmin/list"
,
req
).
then
(
res
=>
{
...
@@ -344,6 +345,8 @@ export default {
...
@@ -344,6 +345,8 @@ export default {
listData
.
push
(
obj
);
listData
.
push
(
obj
);
}
}
this
.
tableData
=
listData
;
this
.
tableData
=
listData
;
this
.
totalRows
=
res
.
data
.
totalRows
;
}
else
{
}
else
{
this
.
tableData
=
[];
this
.
tableData
=
[];
}
}
...
...
src/views/yqrange/role-manage.vue
浏览文件 @
7b0c59e1
...
@@ -65,49 +65,31 @@
...
@@ -65,49 +65,31 @@
<el-table-column
label=
"操作"
min-width=
"300"
align=
"center"
>
<el-table-column
label=
"操作"
min-width=
"300"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
<el-button
v-if=
"this.idType != 1 && scope.row.level == 0"
v-if=
"(idType == 1 && scope.row.level == 0) ||
(idType != 1 && scope.row.level == 0 && selfRoleId > scope.row.level)"
@
click=
"promote(scope.row, 1)"
@
click=
"promote(scope.row, 1)"
type=
"text"
type=
"text"
size=
"small"
size=
"small"
>
升为管理员
</el-button>
>
升为管理员
</el-button>
<el-button
<el-button
v-if=
"this.idType != 1 && scope.row.level == 0"
v-if=
"(idType == 1 && scope.row.level == 1) ||
@
click=
"promote(scope.row, 2)"
(idType != 1 && scope.row.level == 1 && selfRoleId > scope.row.level)"
type=
"text"
size=
"small"
>
升为主管理员
</el-button>
<el-button
v-if=
"this.idType != 1 && scope.row.level == 1"
@
click=
"promote(scope.row, 2)"
type=
"text"
size=
"small"
>
升为主管理员
</el-button>
<el-button
v-if=
"this.idType != 1 && scope.row.level == 1"
@
click=
"promote(scope.row, 0)"
type=
"text"
size=
"small"
>
降为普通成员
</el-button>
<el-button
v-if=
"this.idType != 1 && scope.row.level == 2"
@
click=
"promote(scope.row, 1)"
type=
"text"
size=
"small"
>
降为管理员
</el-button>
<el-button
v-if=
"this.idType != 1 && scope.row.level == 2"
@
click=
"promote(scope.row, 0)"
@
click=
"promote(scope.row, 0)"
type=
"text"
type=
"text"
size=
"small"
size=
"small"
>
降为普通成员
</el-button>
>
降为普通成员
</el-button>
<el-button
<el-button
v-if=
"this.idType != 1 && scope.row.status == 1"
v-if=
"scope.row.level != 2 &&
(idType == 1 || selfRoleId > scope.row.level) &&
scope.row.status == 1"
@
click=
"addBlackList(scope.row)"
@
click=
"addBlackList(scope.row)"
type=
"text"
type=
"text"
size=
"small"
size=
"small"
>
加入黑名单
</el-button>
>
加入黑名单
</el-button>
<el-button
<el-button
v-if=
"this.idType != 1 && scope.row.status == 2"
v-if=
"scope.row.level != 2 &&
(idType == 1 || selfRoleId > scope.row.level) &&
scope.row.status == 2"
@
click=
"addBlackList(scope.row)"
@
click=
"addBlackList(scope.row)"
type=
"text"
type=
"text"
size=
"small"
size=
"small"
...
@@ -215,26 +197,27 @@ export default {
...
@@ -215,26 +197,27 @@ export default {
name
:
"第二医院"
name
:
"第二医院"
}
}
],
],
id
:
null
id
:
null
,
selfRoleId
:
0
};
};
},
},
created
()
{
created
()
{
vm
=
this
;
vm
=
this
;
this
.
id
=
this
.
$route
.
query
.
id
;
this
.
id
=
this
.
$route
.
query
.
id
;
// vm.getOrganization();
// vm.getOrganization();
this
.
searchList
();
this
.
idType
=
localStorage
.
getItem
(
"storageIdType"
);
this
.
idType
=
localStorage
.
getItem
(
"storageIdType"
);
console
.
log
(
"storageIdType = "
+
localStorage
.
getItem
(
"storageIdType"
));
console
.
log
(
"storageIdType = "
+
this
.
idType
);
this
.
searchList
();
},
},
methods
:
{
methods
:
{
searchList
()
{
searchList
()
{
console
.
log
(
"查询"
);
console
.
log
(
"查询"
);
let
req
=
{
let
req
=
{
name
:
this
.
searchForm
.
searchName
,
name
:
this
.
searchForm
.
searchName
,
hospitaName
:
this
.
searchForm
.
searchHospital
,
hospita
l
Name
:
this
.
searchForm
.
searchHospital
,
id
:
this
.
id
,
id
:
this
.
id
,
pageNo
:
1
,
pageNo
:
this
.
searchForm
.
pageNo
,
pageSize
:
10
pageSize
:
this
.
searchForm
.
pageSize
};
};
vm
.
POST
(
"circle/circle/members"
,
req
)
vm
.
POST
(
"circle/circle/members"
,
req
)
.
then
(
res
=>
{
.
then
(
res
=>
{
...
@@ -253,9 +236,9 @@ export default {
...
@@ -253,9 +236,9 @@ export default {
let
listData
=
[];
let
listData
=
[];
for
(
let
i
=
0
;
i
<
res
.
data
.
memberList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
memberList
.
length
;
i
++
)
{
let
roleName
=
""
;
let
roleName
=
""
;
switch
(
res
.
data
.
memberList
[
i
].
role
_i
d
)
{
switch
(
res
.
data
.
memberList
[
i
].
role
I
d
)
{
case
0
:
case
0
:
roleName
=
"普通成员
1:管理员 2:主管理员 3:审核人员
"
;
roleName
=
"普通成员"
;
break
;
break
;
case
1
:
case
1
:
roleName
=
"管理员"
;
roleName
=
"管理员"
;
...
@@ -276,13 +259,20 @@ export default {
...
@@ -276,13 +259,20 @@ export default {
proTitle
:
res
.
data
.
memberList
[
i
].
title
,
proTitle
:
res
.
data
.
memberList
[
i
].
title
,
department
:
res
.
data
.
memberList
[
i
].
departmentName
,
department
:
res
.
data
.
memberList
[
i
].
departmentName
,
hospital
:
res
.
data
.
memberList
[
i
].
hospitalName
,
hospital
:
res
.
data
.
memberList
[
i
].
hospitalName
,
level
:
res
.
data
.
memberList
[
i
].
role
_i
d
,
level
:
res
.
data
.
memberList
[
i
].
role
I
d
,
doctorId
:
res
.
data
.
memberList
[
i
].
id
,
doctorId
:
res
.
data
.
memberList
[
i
].
id
,
status
:
res
.
data
.
memberList
[
i
].
status
status
:
res
.
data
.
memberList
[
i
].
status
};
};
listData
.
push
(
obj
);
listData
.
push
(
obj
);
}
}
this
.
tableData
=
listData
;
this
.
tableData
=
listData
;
this
.
selfRoleId
=
res
.
data
.
roleId
;
// console.log("searchList() : this.selfRoleId = " + this.selfRoleId +
// ", name = " + tableData[1].name + ", level = " + tableData[1].level +
// ", doctorId = " + tableData[1].doctorId + ", status = " + tableData[1].status);
console
.
log
(
"searchList() : this.selfRoleId = "
+
this
.
selfRoleId
)
this
.
totalRows
=
res
.
data
.
count
;
}
else
{
}
else
{
// vm.$message.info(res.message);
// vm.$message.info(res.message);
// vm.$message.info("操作失败,请重试");
// vm.$message.info("操作失败,请重试");
...
@@ -291,20 +281,6 @@ export default {
...
@@ -291,20 +281,6 @@ export default {
.
catch
(
function
(
error
)
{
.
catch
(
function
(
error
)
{
vm
.
$message
.
error
(
error
);
vm
.
$message
.
error
(
error
);
});
});
//model data
// let listData = [];
// let obj = {
// role: "大总管",
// name: "小小",
// proTitle: "妇科老大",
// department: "总经办",
// hospital: "青山神经病院",
// level: 3,
// doctorId: 789
// };
// listData.push(obj);
// this.tableData = listData;
},
},
resetForm
()
{
resetForm
()
{
console
.
log
(
"重置"
);
console
.
log
(
"重置"
);
...
@@ -437,9 +413,9 @@ export default {
...
@@ -437,9 +413,9 @@ export default {
//加入黑名单
//加入黑名单
addBlackList
(
row
)
{
addBlackList
(
row
)
{
vm
=
this
;
vm
=
this
;
let
option
=
"加入黑名单"
let
option
=
"加入黑名单"
;
if
(
row
.
status
==
2
)
{
if
(
row
.
status
==
2
)
{
option
=
"移出黑名单"
option
=
"移出黑名单"
;
}
}
this
.
$confirm
(
`确定将“
${
row
.
name
}
”
${
option
}
吗`
,
""
,
{
this
.
$confirm
(
`确定将“
${
row
.
name
}
”
${
option
}
吗`
,
""
,
{
confirmButtonText
:
"确定"
,
confirmButtonText
:
"确定"
,
...
@@ -453,10 +429,12 @@ export default {
...
@@ -453,10 +429,12 @@ export default {
);
);
let
req
=
{
let
req
=
{
id
:
this
.
id
,
id
:
this
.
id
,
doctorId
:
row
.
doctorId
,
doctorId
:
row
.
doctorId
};
};
vm
.
GET
(
vm
.
GET
(
"circle/circle/"
+
this
.
id
+
"/"
+
row
.
doctorId
+
"/freeControl"
,
req
)
"circle/circle/"
+
this
.
id
+
"/"
+
row
.
doctorId
+
"/freeControl"
,
req
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
vm
.
$message
({
vm
.
$message
({
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录