Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
ddd4786b
提交
ddd4786b
编写于
6月 17, 2020
作者:
alex.zhang
浏览文件
操作
浏览文件
下载
差异文件
fix fetch.js conflict
上级
e8883767
fab7d821
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
2057 行增加
和
17 行删除
+2057
-17
package-lock.json
package-lock.json
+37
-7
router.js
src/router/router.js
+12
-1
fetch.js
src/utils/fetch.js
+3
-1
create-live.vue
src/views/yqrange/create-live.vue
+621
-0
edit-range.vue
src/views/yqrange/edit-range.vue
+1340
-0
live-manage.vue
src/views/yqrange/live-manage.vue
+39
-7
yq-range.vue
src/views/yqrange/yq-range.vue
+5
-1
未找到文件。
package-lock.json
浏览文件 @
ddd4786b
...
...
@@ -2718,10 +2718,6 @@
"loader-utils"
:
"~0.2.5"
}
},
"file-saver"
:
{
"version"
:
"github:eligrey/FileSaver.js#e865e37af9f9947ddcced76b549e27dc45c1cb2e"
,
"from"
:
"github:eligrey/FileSaver.js#1.3.8"
},
"filename-regex"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz"
,
...
...
@@ -4376,6 +4372,10 @@
"base64-arraybuffer"
:
"^0.1.5"
}
},
"file-saver"
:
{
"version"
:
"github:eligrey/FileSaver.js#e865e37af9f9947ddcced76b549e27dc45c1cb2e"
,
"from"
:
"github:eligrey/FileSaver.js#e865e37af9f9947ddcced76b549e27dc45c1cb2e"
},
"html2canvas"
:
{
"version"
:
"1.0.0-alpha.12"
,
"resolved"
:
"https://registry.npmjs.org/html2canvas/-/html2canvas-1.0.0-alpha.12.tgz"
,
...
...
@@ -9167,9 +9167,39 @@
"dev"
:
true
},
"vue-ueditor-wrap"
:
{
"version"
:
"2.4.1"
,
"resolved"
:
"http://192.168.110.93:4873/vue-ueditor-wrap/-/vue-ueditor-wrap-2.4.1.tgz"
,
"integrity"
:
"sha512-UjZz0I5Fy8ADrmvjCqTJm+XJVkf52hi6/yajcTyjqG20DTS2IVByFF26TI69by9PZApwbC+eHkV/lALcvEFgjw=="
"version"
:
"2.4.2"
,
"resolved"
:
"https://registry.npmjs.org/vue-ueditor-wrap/-/vue-ueditor-wrap-2.4.2.tgz"
,
"integrity"
:
"sha512-bZZdUmhT/n9QPdVwR10b8u2A9+Q2L6vyfr3Nls2EDKI3GmuWQwGqBwcgjBWbaM50twyHjXwAPXiKlUhn3JAFtA=="
},
"vuedraggable"
:
{
"version"
:
"2.23.2"
,
"resolved"
:
"https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.23.2.tgz"
,
"integrity"
:
"sha512-PgHCjUpxEAEZJq36ys49HfQmXglattf/7ofOzUrW2/rRdG7tu6fK84ir14t1jYv4kdXewTEa2ieKEAhhEMdwkQ=="
,
"requires"
:
{
"sortablejs"
:
"^1.10.1"
},
"dependencies"
:
{
"sortablejs"
:
{
"version"
:
"1.10.2"
,
"resolved"
:
"https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz"
,
"integrity"
:
"sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
}
}
},
"vuedraggable"
:
{
"version"
:
"2.23.2"
,
"resolved"
:
"http://192.168.110.93:4873/vuedraggable/-/vuedraggable-2.23.2.tgz"
,
"integrity"
:
"sha512-PgHCjUpxEAEZJq36ys49HfQmXglattf/7ofOzUrW2/rRdG7tu6fK84ir14t1jYv4kdXewTEa2ieKEAhhEMdwkQ=="
,
"requires"
:
{
"sortablejs"
:
"^1.10.1"
},
"dependencies"
:
{
"sortablejs"
:
{
"version"
:
"1.10.2"
,
"resolved"
:
"http://192.168.110.93:4873/sortablejs/-/sortablejs-1.10.2.tgz"
,
"integrity"
:
"sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
}
}
},
"vuedraggable"
:
{
"version"
:
"2.23.2"
,
...
...
src/router/router.js
浏览文件 @
ddd4786b
...
...
@@ -52,6 +52,8 @@ const yqRange = r => require.ensure([], () => r(require('../views/yqrange/yq-ran
const
liveManage
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'../views/yqrange/live-manage.vue'
)),
'live-manage'
)
const
roleManage
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'../views/yqrange/role-manage.vue'
)),
'role-manage'
)
const
createRange
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'../views/yqrange/create-range.vue'
)),
'create-range'
)
const
editRange
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'../views/yqrange/edit-range.vue'
)),
'edit-range'
)
const
createLive
=
r
=>
require
.
ensure
([],
()
=>
r
(
require
(
'../views/yqrange/create-live.vue'
)),
'create-live'
)
export
default
[{
path
:
'/'
,
...
...
@@ -192,7 +194,7 @@ export default [{
{
path
:
'/edu-role'
,
component
:
eduRole
},
},
{
path
:
'/notice-editor'
,
component
:
noticeEditor
...
...
@@ -213,6 +215,15 @@ export default [{
path
:
'/create-range'
,
component
:
createRange
},
{
path
:
'/create-live'
,
component
:
createLive
},
{
path
:
'/edit-range'
,
component
:
editRange
},
// {
// path: '/followup',
// name: 'followUp',
...
...
src/utils/fetch.js
浏览文件 @
ddd4786b
...
...
@@ -52,9 +52,11 @@ service.interceptors.request.use(config => {
if
(
config
.
headers
[
'sysCode'
]
==
undefined
)
{
config
.
headers
[
'sysCode'
]
=
12
}
if
(
process
.
env
.
BUILD_ENV
==
"development"
){
// 本地开发环境
if
(
process
.
env
.
BUILD_ENV
==
"development"
){
// 本地开发环境
qgit
// console.log('环境变量>>>> ', process.env.BUILD_ENV);
config
.
headers
[
'token'
]
=
'1C7A1CC89FD24B8A8EAA0A54A06F7C9A'
;
// config.headers['token'] = '4559D8D1D615430991878A1264830A04';
// config.headers['token'] = 'B6A38C32790E4462BC451C335F65848E';
// config.headers['token'] = localStorage.getItem('storageToken')
}
else
{
config
.
headers
[
'token'
]
=
localStorage
.
getItem
(
'storageToken'
)
...
...
src/views/yqrange/create-live.vue
0 → 100644
浏览文件 @
ddd4786b
<
template
>
<div
class=
"yqrange-index-wrapper"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
:curmbThird=
"curmbThird"
></bread-crumb>
<div
class=
"yqrange-index-content screenSet"
id=
"screenSet"
>
<el-row
class=
"step-content"
>
<el-col
:span=
"12"
>
<div
style=
"color:#666666;font-size:14px;"
>
新建直播
</div>
<!--
<el-steps
:active=
"active"
simple
class
>
-->
<!--
<span
class=
"step-num"
:class=
"
{ 'on-step': stepData[0] }">1
</span>
-->
<!--
<el-step
title=
"基础信息"
></el-step>
-->
<!--
<span
class=
"step-num"
:class=
"
{ 'on-step': stepData[1] }">2
</span>
-->
<!--
<el-step
title=
"选择范围"
>
2
</el-step>
-->
<!--
</el-steps>
-->
</el-col>
<el-col
:span=
"6"
:offset=
"5"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"complete"
>
完成
</el-button>
</el-col>
</el-row>
<div
class=
"first-step"
>
<!--
<p
class=
"p-title"
>
基础信息
</p>
-->
<el-form
ref=
"formData"
:model=
"formData"
:rules=
"rules"
label-width=
"150px"
label-suffix=
":"
class=
"basic-form"
>
<el-form-item
label=
"直播标题"
prop=
"name"
>
<el-col
:span=
"13"
>
<el-input
size=
"small"
v-model=
"formData.name"
placeholder=
"请输入直播标题"
style=
"width:70%;"
></el-input>
<span
class=
"word-num"
>
{{
(
formData
.
name
).
replace
(
/
\s
+/g
,
""
).
length
}}
/24
</span>
</el-col>
</el-form-item>
<el-form-item
label=
"是否公开"
prop=
"isPublicFlag"
>
<el-radio-group
v-model=
"formData.scope"
size=
"small"
@
change=
"changePublicFlag"
>
<el-radio
label=
"1"
>
否(仅限圈内人观看)
</el-radio>
<el-radio
label=
"2"
>
是(任何人可观看)
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"是否收集用户信息"
prop=
"isCollectFlag"
v-if=
"isCollectShow"
>
<el-radio-group
v-model=
"formData.infoCollect"
size=
"small"
>
<el-radio
label=
"0"
>
否
</el-radio>
<el-radio
label=
"1"
>
是(收集姓名等信息)
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"直播开始时间"
prop=
"openTime"
>
<el-col
:span=
"6"
>
<el-date-picker
v-model=
"formData.openTime"
size=
"small"
type=
"datetime"
placeholder=
"请选择直播开始时间"
value-format=
"yyyy-MM-dd HH:mm:ss"
:picker-options=
"pickerOptions0"
style=
"width: 100%;"
></el-date-picker>
</el-col>
</el-form-item>
<el-form-item
label=
"直播简介:"
prop=
"introduce"
>
<el-col
:span=
"14"
>
<div
style=
"color:#666666;font-size:10px;"
>
直播图片可选择仅文字版,仅图片版或文字版+图片版
</div>
<el-input
type=
"textarea"
v-model=
"formData.rtcIntroduces[0].content"
placeholder=
"请输入直播简介"
maxlength=
"30"
rows=
"3"
style=
"width:60%;"
></el-input>
<div
style=
"color:#666666;font-size:12px;"
>
文字版
</div>
</el-col>
<el-col
:span=
"8"
>
<el-upload
v-model=
"formData.rtcIntroduces[1].content"
class=
"bg-uploader"
action=
"#"
:show-file-list=
"false"
:before-upload=
"beforeUploadPic1"
>
<img
v-if=
"formData.imgUrl3"
:src=
"formData.imgUrl3"
@
mouseover
.
stop=
"imgMouseOver3=true"
class=
"bg-img"
/>
<img
v-if=
"!formData.imgUrl3"
class=
"bg-img"
src=
"../../assets/image/small.png"
/>
<div
class=
"img-delete"
v-show=
"imgMouseOver3"
@
click
.
stop=
"deleteImg(3)"
@
mouseout
.
stop=
"imgMouseOver3=false"
>
<i
class=
"el-icon-delete"
></i>
</div>
<div
class=
"limit-text"
>
<p>
尺寸:48*48
</p>
<p>
限制大小: 500kb
</p>
<p>
支持.jpg,.png格式
</p>
</div>
</el-upload>
<div
style=
"color:#666666;font-size:12px;"
>
图片版
</div>
</el-col>
</el-form-item>
<div
class=
"basic-item-icon"
>
<el-form-item
label=
"直播封面"
class=
"required-label"
>
<el-upload
v-model=
"formData.cover"
class=
"bg-uploader"
action=
"#"
:show-file-list=
"false"
:before-upload=
"beforeUploadPic1"
>
<img
v-if=
"formData.imgUrl1"
:src=
"formData.imgUrl1"
@
mouseover
.
stop=
"imgMouseOver1=true"
class=
"bg-img"
/>
<img
v-if=
"!formData.imgUrl1"
class=
"bg-img"
src=
"../../assets/image/small.png"
/>
<div
class=
"img-delete"
v-show=
"imgMouseOver1"
@
click
.
stop=
"deleteImg(1)"
@
mouseout
.
stop=
"imgMouseOver1=false"
>
<i
class=
"el-icon-delete"
></i>
</div>
<div
class=
"limit-text"
>
<p>
尺寸:48*48
</p>
<p>
限制大小: 500kb
</p>
<p>
支持.jpg,.png格式
</p>
</div>
</el-upload>
</el-form-item>
<p
class=
"upload-message"
v-if=
"uploadImgMessage1"
>
请选择直播封面
</p>
</div>
<div
class=
"basic-item-icon"
>
<el-form-item
label=
"直播预告图"
class=
"required-label"
>
<el-upload
v-model=
"formData.preImage"
class=
"bg-uploader"
action=
"#"
:show-file-list=
"false"
:before-upload=
"beforeUploadPic2"
>
<img
v-if=
"formData.imgUrl2"
:src=
"formData.imgUrl2"
@
mouseover
.
stop=
"imgMouseOver2=true"
class=
"bg-img"
/>
<img
v-if=
"!formData.imgUrl2"
class=
"bg-img"
src=
"../../assets/image/small.png"
/>
<div
class=
"img-delete"
v-show=
"imgMouseOver2"
@
click
.
stop=
"deleteImg(2)"
@
mouseout
.
stop=
"imgMouseOver2=false"
>
<i
class=
"el-icon-delete"
></i>
</div>
<div
class=
"limit-text"
>
<p>
尺寸:750*420
</p>
<p>
限制大小: 2Mb
</p>
<p>
支持.jpg,.png格式
</p>
</div>
</el-upload>
</el-form-item>
<p
class=
"upload-message"
v-if=
"uploadImgMessage2"
>
请选择直播预告图
</p>
</div>
<el-form-item
label=
"直播角色"
prop=
"introduce"
>
<div
style=
"color:#666666;font-size:10px;"
>
讲师(必填)
</div>
<el-col
:span=
"10"
>
<el-form-item
label=
"姓名"
prop=
"username1"
label-width=
"60px;"
>
<el-input
size=
"small"
v-model=
"formData.lectures[0].username"
placeholder=
"请输入姓名"
style=
"width:70%;"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"13"
>
<el-form-item
label=
"手机"
prop=
"phone1"
>
<el-input
maxlength=
"11"
size=
"small"
v-model=
"formData.mobile"
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
size=
"small"
v-model=
"formData.guests[index].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=
"formData.guests[index].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>
</el-form-item>
</el-form>
</div>
</div>
</div>
</
template
>
<
script
>
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniu-util"
;
import
{
checkMobile
}
from
'../../utils/patients/checkValid'
;
let
vm
=
null
;
export
default
{
components
:
{
BreadCrumb
},
data
(){
let
checkProjectStr
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
indexOf
(
"
\
\"
) != -1) {
//存在
callback(new Error("
请勿输入字符“
\\
”
"));
} else if (value.indexOf("
.
") != -1) {
callback(new Error("
请勿输入字符“
.
”
"));
} else {
callback();
}
};
// // 校验手机号
// let checkMobile = (rule, value, callback) => {
// var reg = /^1[3|4|5|6|7|8|9][0-9]{9}$/; //验证规则
// const flag = reg.test(value);
// if(flag){
// callback()
// }else{
// callback(new Error(`请输入正确的手机号码`))
// }
// };
return{
curmbFirst: '云鹊小圈',
curmbSecond: '直播管理',
curmbThird: '新建直播',
active: 0,
//页面展示位置
stepData: [true, false, false],
showStorage: true,
isCollectShow: false,
formData: {
name: '',// 直播名称
scope: 1,// 直播范围 1-非公开 2-公开
infoCollect: 1,// 是否采集用户信息 0-否 1-是
openTime: '',// 直播开始时间
isPublicFlag: false,
rtcIntroduces:[{
seqNo: 1,
content: '',
type: 1 // 文字
},
{
seqNo: 2,
content: '',
type: 2 // 图片
}
],
cover: '', // 直播封面url 直播第一帧图片
preImage: '', // 直播预告图url
imgUrl1: '',
imgUrl1More: {},
imgUrl2: '',
imgUrl2More: {},
imgUrl3: '',
imgUrl3More: {},
intro:'',
introduce: '',
hostName: '',
guestName: '',
hostMobile: '',
guestMobile: '',
contentRole: '',
mobile: '',
lectures: [{
username: '',
phone: ''
}],// 讲师
guests: [{
phone: '',
username: ''
}] // 嘉宾
},
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() > new Date(this.maxDate).getTime() || time.getTime() < new Date(this.minDate).getTime() - 8.64e7;
}
},
contentList: [
{
value: '1',
label: '所有人可发布动态'
},{
value: '2',
label: '嘉宾可发布动态'
},
],
rules: {
name: [
{ required: true, message: "
请输入直播标题
", trigger: "
blur
" },
{
min: 2,
max: 24,
message: "
输入长度为
2
-
24
的内容,可包含中英文、数字及特殊符号
",
trigger: "
blur
"
},
{ validator: checkProjectStr, trigger: "
blur
" }
],
isPublicFlag:[
{required: true}
],
liveStartTime: [
{required: true}
],
username1: [
{required: true, message: "
请输入姓名
", trigger: "
blur
"},
],
// guestName: [
// {required: true, message: "
请输入姓名
", trigger: "
blur
"},
// ],
phone1: [
{required: true, message: "
请输入手机号
", trigger: 'blur'},
{ validator: checkMobile, trigger: 'blur'}
],
introduce: [
{ required: true, message: "
请输入圈子名称
", trigger: "
blur
" },
{
min: 2,
max: 24,
message: "
输入长度为
2
-
24
的内容,可包含中英文、数字及特殊符号
",
trigger: "
blur
"
},
{ validator: checkProjectStr, trigger: "
blur
" }
],
contentRole: [
{ required: true, message: "
请选择内容发布权限
", trigger: "
blur
" },
]
}
}
},
methods: {
//上传圈子头像
beforeUploadPic1(file) {
let fileLimit = {
width: 48,
height: 48,
size: 0.5,
sizeText: "
500
K
",
key: "
imgUrl1
",
more: "
imgUrl1More
",
show: "
uploadImgMessage1
"
};
this.beforeUpload(file, fileLimit);
},
beforeUploadPic2(file) {
let fileLimit = {
width: 750,
height: 420,
size: 2,
sizeText: "
2
Mb
",
key: "
imgUrl2
",
more: "
imgUrl2More
",
show: "
uploadImgMessage2
"
};
this.beforeUpload(file, fileLimit);
},
//上传图片
beforeUpload(file, fileLimit) {
let vm = this;
const isJPG = file.type === "
image
/
jpeg
";
const isPNG = file.type === "
image
/
png
";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) {
vm.$message.error("
图片格式不符合规范,请根据规范上传图片
");
// return;
}
if (!isLt2M) {
vm.$message.error("
图片大小不符合规范,请根据规范上传图片
");
// return;
}
let _img = new FileReader();
_img.readAsDataURL(file);
_img.onload = function(theFile) {
let image = new Image();
image.src = theFile.target.result;
image.onload = function() {
let _this = this;
if (_this.width != fileLimit.width || _this.height != fileLimit.height) {
vm.$message.error("
图片尺寸不符合规范,请根据规范上传图片
");
} else {
openLoading(vm);
doUpload(vm, file, getFilePath(file, null), "
preview4
", "
progress1
", 1).then(function(path) {
closeLoading(vm);
console.log('上传成功后路径',path);
if (fileLimit.show == "
uploadImgMessage1
") {
vm.uploadImgMessage1 = false;
} else if (fileLimit.show == "
uploadImgMessage2
") {
vm.uploadImgMessage2 = 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;
},
// 是否公开
changePublicFlag(value){
if(value == 2){
this.isCollectShow = true;
}
else {
this.isCollectShow = false;
}
},
//删除图片
deleteImg(type) {
if (type == 1) {
vm.formData.imgUrl1 = "";
vm.imgMouseOver1 = false;
}
},
// 增加嘉宾
addGuest(index) {
this.formData.guestList.splice(index + 1, 0, "");
},
// 删除嘉宾
delGuest(index) {
this.formData.guestList.splice(index, 1);
},
//完成
complete() {
this.$router.push({
path: '/live-manage',
})
},
},
}
</
script
>
<
style
lang=
"scss"
>
.yqrange-index-wrapper
{
.yqrange-index-content
{
background
:
#fff
;
padding
:
10px
;
.step-content
{
overflow
:
hidden
;
height
:
60px
;
padding
:
15px
0
50px
0
;
border-bottom
:
1px
solid
#efefef
;
.is-text
{
display
:
none
;
}
.el-steps--simple
{
background
:
#fff
;
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
;
}
.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
;
color
:
#999
;
padding-top
:
5px
;
}
.line
{
margin-left
:
10px
;
width
:
20px
;
}
.bg-uploader
{
.bg-img
{
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
;
top
:
-6px
;
left
:
130px
;
}
}
}
}
.
required-label
.
el-form-item__label
:
:
before
{
content
:
'*'
;
color
:
#F56C6C
;
margin-right
:
4px
;
}
</
style
>
src/views/yqrange/edit-range.vue
0 → 100644
浏览文件 @
ddd4786b
<
template
>
<div
class=
"add-manager-wrap"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
></bread-crumb>
<div
class=
"add-content screenSet"
id=
"screenSet"
>
<el-row
class=
"step-content"
>
<el-col
:span=
"5"
:offset=
"5"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"nextStep"
>
提交
</el-button>
</el-col>
</el-row>
<div
class=
"second-step"
>
<div
>
<el-form
:inline=
"true"
:model=
"formOrganization"
class=
"demo-form-inline"
>
<el-form-item
label
>
<el-cascader
size=
"small"
ref=
"cascaderRegion"
:options=
"optionsRegion"
:props=
"props"
v-model=
"formOrganization.administrativeIdList"
@
change=
"handleChangeRegion"
filterable
change-on-select
placeholder=
"请选择地区"
></el-cascader>
</el-form-item>
<el-form-item>
<el-select
size=
"small"
v-model=
"formOrganization.level"
placeholder=
"全部医院级别"
>
<el-option
v-for=
"(item, index) in organizationRank"
:key=
"index"
:label=
"item.label"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label
>
<el-input
style=
"width:140px;"
size=
"small"
v-model=
"formOrganization.name"
placeholder=
"请输入机构名称"
></el-input>
</el-form-item>
<el-form-item>
<el-button
size=
"small"
type=
"primary"
@
click=
"searchOrganization()"
>
搜索
</el-button>
</el-form-item>
<el-form-item>
<el-button
size=
"small"
type=
"primary"
@
click=
"resetOrgOrPerson('org')"
>
重置
</el-button>
</el-form-item>
</el-form>
<!--
:row-key="getRowKeys"
:reserve-selection="true"
@selection-change="selectionChangeOrganization"
-->
<el-table
class=
"rim"
ref=
"multipleOrganization"
:data=
"tableOrganization"
tooltip-effect=
"dark"
style=
"width: 100%"
@
select-all=
"selectAllOrganization"
@
select=
"selectOrganization"
>
<el-table-column
type=
"selection"
width=
"55"
:selectable=
"selectableTableList"
></el-table-column>
<el-table-column
prop=
"name"
label=
"医院名称"
min-width=
"100"
align=
"center"
></el-table-column>
<el-table-column
prop=
"hospitalLevelName"
label=
"医院级别"
align=
"center"
></el-table-column>
<el-table-column
prop=
"provinceName"
label=
"所属省份"
align=
"center"
></el-table-column>
<el-table-column
prop=
"cityName"
label=
"所属城市"
align=
"center"
></el-table-column>
<el-table-column
prop=
"countyName"
label=
"所属区县"
align=
"center"
></el-table-column>
<el-table-column
prop=
"townName"
label=
"所属街道"
align=
"center"
></el-table-column>
<div
slot=
"empty"
>
<div
class=
"table-empty"
>
<img
src=
"../../assets/image/no-content1.png"
>
<p>
没有机构信息
</p>
</div>
</div>
</el-table>
<div
class=
"pagination"
>
<el-pagination
background
@
size-change=
"handleSizeOrganization"
@
current-change=
"handleCurrentOrganization"
:current-page=
"formOrganization.pageNum"
:page-sizes=
"[10, 20, 40]"
:page-size=
"formOrganization.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalOrganization"
></el-pagination>
</div>
</el-tabs>
</div>
<el-dialog
title=
"导入成功"
:visible
.
sync=
"dialogSuccess"
width=
"30%"
class=
"dialog-success"
center
>
<p>
本次成功导入
<span
class=
"upload-text"
>
{{
updateNum
}}
条
</span>
数据
</p>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"dialogSuccess = false"
>
关闭
</el-button>
</span>
</el-dialog>
<el-dialog
title=
"导入失败"
:visible
.
sync=
"dialogFail"
width=
"30%"
class=
"dialog-fail"
center
>
<div
class=
"fail-type"
v-if=
"failType == 1"
>
<p>
导入数据量已超限额,请修正后再次导入
</p>
<p
class=
"fail-notice"
>
仅支持一次导入5000条数据
</p>
</div>
<div
class=
"fail-type"
v-if=
"failType == 2"
>
<p>
有
<span
class=
"fail-num"
>
{{
failNum
}}
条
</span>
数据不符合格式要求,请修正后再次导入
</p>
<p
class=
"fail-notice"
>
仅支持xlsx格式的文件
</p>
<p
class=
"fail-link"
@
click=
"download('fail')"
>
下载错误数据>
</p>
</div>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-upload
v-if=
"uploadType == 'org'"
class=
"upload-button"
action=
"#"
accept=
".xlsx"
multiple
:limit=
"1"
:before-upload=
"uploadOrganization"
>
<el-button
slot=
"tip"
class=
"down-button-close"
size=
"small"
@
click=
"dialogFail = false"
>
取消
</el-button>
<el-button
stype=
"position: absolute;top: -14px;"
type=
"primary"
size=
"small"
@
click=
"closeFail()"
>
重新导入
</el-button>
</el-upload>
<el-upload
v-if=
"uploadType == 'person'"
class=
"upload-button"
action=
"#"
accept=
".xlsx"
multiple
:limit=
"1"
:before-upload=
"uploadPerson"
>
<el-button
slot=
"tip"
class=
"down-button-close"
size=
"small"
@
click=
"dialogFail = false"
>
取消
</el-button>
<el-button
stype=
"position: absolute;top: -14px;"
type=
"primary"
size=
"small"
@
click=
"closeFail()"
>
重新导入
</el-button>
</el-upload>
</span>
</el-dialog>
</div>
</div>
</div>
</
template
>
<
script
>
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
{
doUpload
,
getFilePath
}
from
"../../utils/qiniu-util"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
*
as
commonUtil
from
"../../utils/utils"
;
import
*
as
operationData
from
"../../utils/operation"
;
import
{
getExeclUrl
}
from
"@/utils/index"
;
import
{
uploadOrgExcel
,
uploadPersonExcel
}
from
"@/utils/education/educationApi"
;
import
Sortable
from
"sortablejs"
;
let
vm
=
null
;
export
default
{
components
:
{
BreadCrumb
},
data
()
{
let
checkProjectStr
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
indexOf
(
"
\
\"
) != -1) {
//存在
callback(new Error("
请勿输入字符“
\\
”
"));
} else if (value.indexOf("
.
") != -1) {
callback(new Error("
请勿输入字符“
.
”
"));
} else {
callback();
}
};
let checkNormalInt = (rule, value, callback) => {
const val = parseFloat(value);
const isInteger = Number.isInteger(val);
// if((isInteger && val > 0) || checkNeedRule(val)){
if (!value || (isInteger && val >= 0 && val <= 100)) {
callback();
} else {
callback(new Error(`请输入0~100正整数`));
}
};
let checkOrgListName = (rule, value, callback) => {
console.log(rule, value, callback);
// const val = parseFloat(value);
// const isInteger = Number.isInteger(val);
// // if((isInteger && val > 0) || checkNeedRule(val)){
// if (!value || (isInteger && val >= 0 && val <= 100)) {
// callback();
// } else {
// callback(new Error(`请输入0~100正整数`));
// }
};
return {
idTypeProject: "",
customError: {
standard: {
className: "",
error: ""
},
certificate: {
className: "",
error: ""
},
passTotalLearnTime: {
className: "",
error: ""
},
passExamCount: {
className: "",
error: ""
},
passAverageScore: {
className: "",
error: ""
}
},
projectId: null,
peopleLevel: null,
orgListIndex: 0,
pickerOptions0: {
disabledDate: time => {
if (
this.formData.projectEndtime != "" &&
this.formData.projectEndtime != null
) {
return (
time.getTime() > new Date(this.formData.projectEndtime).getTime()
);
}
}
},
pickerOptions1: {
disabledDate: time => {
return (
time.getTime() < new Date(this.formData.projectBegintime).getTime()
); //减去一天的时间代表可以选择同一天;
}
},
fileList: [],
//设定机构 数据
getRowKeys(row) {
return row.id;
},
checkTableState: {
multipleOrganization: "",
multipleDepartment: "",
multiplePerson: ""
},
updatedOrganization: false,
formOrganization: {
name: "",
administrativeId: "
0
",
administrativeIdList: ["
0
"],
level: "
-
1
",
chechAll: true,
pageNum: 1,
pageSize: 10
},
organizationRegion: [],
organizationRank: [],
hasOrganizationInit: false,
tableOrganization: new Array(),
multipleSelectionOrganization: [],
currentOrganization: 1,
totalOrganization: 10,
pageSizeOrganization: 2,
lookedOrganization: [],
changedOrganization: [],
changedOrganization2: [],
//搜索类型
searchOrganizationType: "",
searchPeopleType: "",
//v2.2.0更新
warnType: 0,
nowCheck: {},
administrativeValue: "",
optionsRegion: [],
dialogUpload: false,
searchName: "",
getRowKeysDepartment(row) {
return row.id;
},
failType: 2,
failNum: 0,
failExcelUrl: "",
dialogFail: false,
uploadType: "",
props: {
lazy: true,
lazyLoad(node, resolve) {
const { level } = node;
console.log("
node
", node);
if (node.level == 1) {
let req = {
provinceId: node.data.value
};
vm.GET("
basic
-
data
/
position
/
cities
", req).then(res => {
let newData = vm.setMoreOption(res.data.cityList, "
cities
");
resolve(newData);
});
} else if (node.level == 2) {
let req = {
cityId: node.data.value
};
vm.GET("
basic
-
data
/
position
/
counties
", req).then(res => {
let newData = vm.setMoreOption(res.data.countyList, "
counties
");
resolve(newData);
});
} else if (node.level == 3) {
let req = {
countyId: node.data.value
};
vm.GET("
basic
-
data
/
position
/
towns
", req).then(res => {
let newData = vm.setMoreOption(res.data.townList, "
towns
");
resolve(newData);
});
}
}
},
};
},
computed: {
...mapGetters(["
_token
"])
},
created() {
vm = this;
(this.projectId = 775),
(this.peopleLevel = vm.getUrlSearch(window.location.href, "
level
"));
this.initRange();
//this.editManager();
vm.idType = localStorage.getItem("
storageIdType
");
console.log("
this
.
idType
:
" + vm.idType);
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
plusOrg(index) {
vm.formData.organizationNameList.splice(index + 1, 0, '');
},
deleteOrg(index) {
vm.formData.organizationNameList.splice(index, 1);
},
focusFun(ev, parm, index) {
if (index != undefined) {
if (parseInt(ev) < 0 || !this.checkIntFun(ev)) {
console.log(typeof index);
this.formExam.exam[index][parm] = "";
}
if (parm == "
rangeMax
" && parseInt(ev) > 100) {
this.formExam.exam[index][parm] = "
100
";
}
if (ev != "") {
if (parm == "
rangeMax
") {
this.formExam.exam[index].maxClass = "";
this.formExam.exam[index].maxError = "";
}
if (parm == "
rangeMin
") {
this.formExam.exam[index].minClass = "";
this.formExam.exam[index].minError = "";
}
}
} else {
if (parseInt(ev) < 0 || !this.checkIntFun(ev)) {
this.formComponent[parm] = "";
}
if (parm == "
passAverageScore
" && parseInt(ev) > 100) {
this.formComponent[parm] = "
100
";
}
if (ev != "") {
this.customError[parm] = {
className: "",
error: ""
};
}
}
},
//第二步 选择范围 初始化
initRange() {
let projectId = this.projectId;
this.getRegionOption();
this.listLevels();
this.getOrganization();
this.activeName = "
second
";
this.formOrganization.pageNum = 1;
this.formOrganization.name = "";
this.formOrganization.administrativeIdList = ["
0
"];
this.formOrganization.level = "
-
1
";
},
//初始化范围树
setTreeData(administrative) {
let treeIdList = [];
let checkList = [];
for (let i = 0; i < administrative.length; i++) {
treeIdList.push(administrative[i].id);
checkList[i] = {};
checkList[i].name = administrative[i].label;
checkList[i].key = administrative[i].id;
}
//console.log(treeIdList);
this.$refs.tree.setCheckedKeys(treeIdList);
this.tagsRegion = checkList;
},
//列举选中地区
initCheckList(allSelectedKeys) {
this.tagsRegion = [];
// console.log(allSelectedKeys);
// console.log(this.$refs.tree.getCheckedNodes());
let nodeData = this.$refs.tree.getCheckedNodes();
for (let i = 0; i < nodeData.length; i++) {
for (let j = 0; j < allSelectedKeys.length; j++) {
if (
allSelectedKeys[j].type == 1 &&
nodeData[i].id == allSelectedKeys[j].key
) {
let tagObj = {};
tagObj.name = nodeData[i].label;
tagObj.key = nodeData[i].id;
this.tagsRegion.push(tagObj);
}
}
}
},
//子节点选中
appendCheck(administrative, checked) {
//console.log(checked,administrative)
let checkList = [];
checkList = this.$refs.tree.getCheckedKeys();
if (checked) {
for (let i = 0; i < administrative.length; i++) {
checkList.push(administrative[i].id);
// console.log(checkList);
}
}
this.$nextTick(function() {
this.$refs.tree.setCheckedKeys(checkList);
});
},
//添加子节点
append(data, node) {
console.log("
data
:
", data);
console.log("
node
:
", node);
if (data.children.length == 0) {
//let id = data.id + "
add
";
let statusValue = 0;
if (node.checked == true) {
statusValue = 1;
}
let req = {
id: data.id,
status: statusValue,
disabled: data.disabled
};
vm.GET("
portal
/
scope
/
v1
/
administrative
/
children
", req).then(res => {
if (res.code == "
000000
") {
let administrative = res.data.administrative;
//console.log(administrative);
data.children = administrative;
this.appendCheck(administrative, node.checked);
}
});
}
},
getCheckedKeys() {
console.log(this.$refs.tree.getCheckedKeys());
},
onChecked(node, data) {
vm.checkUpdate(node, data);
//重构归并树
let checkedTree = operationData.getSimpleCheckedNodes(
this.$refs.tree.store
);
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys();
let allSelectedKeys = operationData.setSelectedKeys(
checkedTree,
halfCheckedTree
);
//重构内容
this.allSelectedKeys = allSelectedKeys;
this.initCheckList(allSelectedKeys);
//console.log("
allSelectedKeys
", allSelectedKeys);
//改变行政范围后,更新设定机构和设定人员
this.updateOrganizationAndPerson(allSelectedKeys);
this.updatedTree = true;
},
getTreeCheck() {
//重构归并树
let checkedTree = operationData.getSimpleCheckedNodes(
this.$refs.tree.store
);
let halfCheckedTree = this.$refs.tree.getHalfCheckedKeys();
let allSelectedKeys = operationData.setSelectedKeys(
checkedTree,
halfCheckedTree
);
vm.allSelectedKeys = allSelectedKeys;
//重构内容
return allSelectedKeys;
},
//通过key设置tree
setCheckedKeys(tagsRegion) {
console.log(tagsRegion);
let treeKeyList = [];
for (let index = 0; index < tagsRegion.length; index++) {
treeKeyList[index] = tagsRegion[index].key;
}
console.log(treeKeyList);
this.$refs.tree.setCheckedKeys(treeKeyList);
},
//删除label节点 同步树结构
handleCloseTree(tag) {
if (this.status4Flag != 1) {
this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1);
this.setCheckedKeys(this.tagsRegion);
}
},
//获取医院等级
listLevels() {
let req = {};
vm.GET("
contents
/
courseDoctor
/
listLevels
?
sysCode
=
10
", req).then(res => {
if (res.code == "
000000
") {
// console.log(res);
this.organizationRank = operationData.getLevelList(res.data.list);
} else {
this.organizationRank = [
{
id: "
0
",
label: "
全部医院等级
"
}
];
}
});
},
selectableTableList(row, index) {
// if (this.status4Flag == 1) {
if (row.modifyFlag == 1) {
return false;
}
return true;
// }
// return true;
},
selectableTableEcology(row, index) {
return false;
},
//改变 设定机构选项
selectionChangeOrganization(rows) {
this.changedOrganization = [];
this.changedOrganization2 = [];
if (rows) {
rows.forEach(row => {
if (row) {
this.changedOrganization.push(row.id);
}
});
}
this.changedOrganization2 = operationData.getDifference(
this.lookedOrganization,
this.changedOrganization
);
console.log(
"
选
",
this.changedOrganization,
"
没
",
this.changedOrganization2
);
this.updatePerson();
this.$refs.multiplePerson.clearSelection();
},
//改变机构 table 的check状态
selectionChangeDepartment(val) {
this.multipleSelectionDepartment = val;
},
//改变人员 table的check状态
selectionChangePerson(rows) {
this.changedPerson = [];
this.changedPerson2 = [];
if (rows) {
rows.forEach(row => {
if (row) {
this.changedPerson.push(row.id);
}
});
}
this.changedPerson2 = operationData.getDifference(
this.lookedPerson,
this.changedPerson
);
console.log("
选
", this.changedPerson, "
没
", this.changedPerson2);
},
//改变小生态 table check
selectionChangeEcology(rows) {
this.changedEcology = [];
this.changedEcology2 = [];
if (rows) {
rows.forEach(row => {
if (row) {
this.changedEcology.push(row.id);
}
});
}
this.changedEcology2 = operationData.getDifference(
this.lookedEcology,
this.changedEcology
);
console.log("
选
", this.changedEcology, "
没
", this.changedEcology2);
},
resetPeople() {
this.checkTableState.multiplePerson = "";
this.lookedPerson = [];
this.changedPerson = [];
this.changedPerson2 = [];
},
initOrganizationStatus() {
let tableStatus = this.tableOrganization;
tableStatus.forEach(row => {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(row);
});
}
});
},
//选择搜索机构方式
searchOrganization() {
this.formOrganization.pageNum = 1;
let searchForm = this.formOrganization;
if (
searchForm.administrativeId == "
0
" &&
searchForm.administrativeIdList[
searchForm.administrativeIdList.length - 1
] == "
0
" &&
searchForm.level == "
-
1
" &&
searchForm.name == ""
) {
console.log("
wei
")
this.searchOrganizationType = "";
this.getOrganization();
} else {
console.log("
choose
")
this.searchOrganizationType = "
choose
";
this.getOrganizationChoose();
}
},
//初始化搜索机构状态
initOrganizationChoose() {
let tableStatus = this.tableOrganization;
if (typeof tableStatus === "
undefined
") {
return;
}
tableStatus.forEach(row => {
let idList = [];
idList[0] = row.id;
//console.log('this.changedOrganization2',this.changedOrganization2);
let intersect = operationData.getIntersect(
idList,
this.changedOrganization
);
let intersect2 = operationData.getIntersect(
idList,
this.changedOrganization2
);
if (intersect.length > 0) {
//选中
//this.$refs.multipleOrganization.toggleRowSelection(row);
} else if (intersect2.length > 0) {
//不选
} else {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(row);
});
}
}
});
},
//设定的行政范围内容
getScope(type) {
console.log(type)
let scope = "";
let noChangeTree = this.getTreeCheck();
if (type == "
administrative
") {
for (let i = 0; i < this.tagsRegion.length; i++) {
scope += this.tagsRegion[i].key;
if (i < this.tagsRegion.length - 1) {
scope += "
|
";
}
}
} else if (type == "
administrativeUpdate
") {
console.log("
this
.
allSelectedKeys
", this.allSelectedKeys);
if (this.allSelectedKeys.length > 0) {
for (let i = 0; i < this.allSelectedKeys.length; i++) {
scope +=
this.allSelectedKeys[i].key + "
:
" + this.allSelectedKeys[i].type;
if (i < this.allSelectedKeys.length - 1) {
scope += "
|
";
}
}
} else {
// let noChangeTree = this.getTreeCheck();
console.log("
noChangeTree
值
", noChangeTree);
if (noChangeTree.length > 0) {
for (let i = 0; i < noChangeTree.length; i++) {
scope += noChangeTree[i].key + "
:
" + noChangeTree[i].type;
if (i < noChangeTree.length - 1) {
scope += "
|
";
}
}
} else {
//选全国项目
if (this.tagsRegion.length > 0 && this.tagsRegion[0].key == "
000
") {
scope = "
000
:
1
";
console.log(this.tagsRegion, "
scope
", scope);
}
}
}
}
//console.log(scope);
if (scope == "") {
return null;
}
return scope;
},
//机构搜索
getOrganizationChoose() {
console.log('formOrganization',this.formOrganization);
let administrativeIdItem = operationData.setAdministrativeId(
this.formOrganization.administrativeIdList
);
console.log('administrativeIdItem',administrativeIdItem);
let req = {
projectId: 775,
administrativeId: administrativeIdItem,
hospitalLevel: this.formOrganization.level,
hospitalName: this.formOrganization.name,
pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize,
scope: this.getScope("
administrative
")
};
openLoading(vm);
// vm.POST("
portal
/
scope
/
v1
/
organization
/
choose
", req).then(res => {
vm.POST("
portal
/
new
/scope/
org
/
v1
/
organization
/
search
", req).then(res => {
closeLoading(vm);
console.log(res);
if (res.code == "
000000
") {
this.tableOrganization = res.data.organizationList;
this.totalOrganization = res.data.total;
vm.initOrganizationStatus();
} else {
vm.$message(res.message);
}
});
},
//查询机构列表
getOrganization() {
let req = {
projectId: 775,
administrativeId: "",
hospitalLevel: "",
hospitalLevel: "",
scope: "
000
_110
",
pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize
};
openLoading(vm);
// vm.POST("
portal
/
scope
/
v1
/
organization
", req).then(res => {
vm.POST("
portal
/
new
/scope/
org
/
v1
/
organization
", req).then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
this.tableOrganization = res.data.organizationList;
this.totalOrganization = res.data.total;
vm.initOrganizationStatus();
} else {
vm.$message(res.message);
}
});
},
//获取机构id列表
getScopeOrganization(type) {
let scope = "";
//2:去掉 3:选中
if (type == 2) {
// console.log(this.scopeOfOrganizationLast,this.changedOrganization);
let differenceScope = operationData.getDifference(
this.scopeOfOrganizationLast,
this.changedOrganization
);
//console.log('differenceScope',differenceScope);
let unionScope = operationData.getUnion(
this.changedOrganization2,
differenceScope
);
//console.log('unionScope',unionScope);
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "
|
";
}
} else if (type == 3) {
console.log(this.scopeOfOrganizationLast, this.changedOrganization2);
let differenceScope = operationData.getDifference(
this.scopeOfOrganizationLast,
this.changedOrganization2
);
let unionScope = operationData.getUnion(
this.changedOrganization,
differenceScope
);
for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "
|
";
}
}
scope = scope.substring(0, scope.length - 1);
console.log("
scope
", scope);
return scope;
},
//选择搜索机构方式
searchPeople() {
this.formPerson.pageNum = 1;
let searchForm = this.formPerson;
if (searchForm.hospitalName === "" && searchForm.doctorName === "") {
this.searchPeopleType = "";
this.getPeople();
} else {
this.searchPeopleType = "
choose
";
this.getPeopleChoose();
}
},
//判断项目范围选择
showScopeType() {
if (this.projectStatus == "" || this.projectStatus == 1) {
if (this.peopleLevel != "
L3
") {
return false;
}
}
return true;
},
//机构table修改
handleSizeOrganization(val) {
console.log(`每页 ${val} 条`);
this.formOrganization.pageSize = val;
this.searchOrganization();
},
handleCurrentOrganization(val) {
//console.log(`当前页: ${val}`);
this.formOrganization.pageNum = val;
if (this.searchOrganizationType == "
choose
") {
this.getOrganizationChoose();
} else {
this.getOrganization();
}
},
//角色table修改
handleSizePerson(val) {
console.log(`每页 ${val} 条`);
this.formPerson.pageSize = val;
this.searchPeople();
},
handleCurrentPerson(val) {
console.log(`当前页: ${val}`);
this.formPerson.pageNum = val;
if (this.searchPeopleType == "
choose
") {
this.getPeopleChoose();
} else {
this.getPeople();
}
},
handleSizeEcology(val) {
console.log(`每页 ${val} 条`);
this.formEcology.pageSize = val;
this.getEcology();
},
handleCurrentEcology(val) {
console.log(`当前页: ${val}`);
this.formEcology.pageNum = val;
this.getEcology();
},
//行政范围改变更新设定机构和设定人员
updateOrganizationAndPerson(allSelectedKeys) {
this.tableOrganization = [];
this.tablePerson = [];
this.$refs.multipleOrganization.clearSelection();
this.lookedOrganization = [];
this.changedOrganization = [];
this.changedOrganization2 = [];
},
initTags(value) {
//console.log('value',value,'optionsComponent',this.optionsComponent);
this.tagsComponent = [];
let len = 0;
for (let i = 0; i < value.length; i++) {
for (let j = 0; j < this.optionsComponent.length; j++) {
if (value[i] == this.optionsComponent[j].value) {
this.tagsComponent[len] = {};
this.tagsComponent[len].value = this.optionsComponent[j].value;
this.tagsComponent[len].name = this.optionsComponent[j].label;
if (vm.status4Flag == 1) {
this.optionsComponent[j].disabled = true;
this.tagsComponent[len].disabled = true;
}
len++;
}
}
}
console.log("
this
.
optionsComponent
值:
", this.optionsComponent);
},
// add 校验输入是否为整数
checkIntFun(str) {
let r = /^
\
+?[0-9]*$/;
return r.test(str);
},
hideErrorInfo(str) {
if (str) {
this.customError[str] = {
className: "",
error: ""
};
} else {
this.customError = {};
}
},
dioErrorPop(str) {
return this.$message({
message: str,
type: "
warning
"
});
},
blurName() {
vm.visibleName = false;
setTimeout(function() {
// console.log('失去焦点');
vm.submitForm("
formData
");
}, 200);
},
focusName(index) {
let textLength = vm.formData.organizationNameList[index].length;
if (textLength == 0) {
this.orgListIndex = index;
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
changeOrganizationName() {
let textLength = vm.formData.organizationName.length;
console.log("
文字长度
", textLength);
if (textLength == 0) {
vm.visibleName = true;
} else {
vm.visibleName = false;
}
},
checkDefault() {
// vm.formData.organizationNameList[0] = vm.organizationContent;
vm.formData.organizationNameList.splice(this.orgListIndex, 1, vm.organizationContent);
// vm.formData.organizationNameList.push(vm.organizationContent);
// vm.formData.organizationName = vm.organizationContent;
vm.visibleName = false;
},
//v2.2教培更新
checkUpdate(node, data) {
let flag = -1;
flag = data.checkedKeys.indexOf(node.id);
if (vm.status4Flag == 1 && flag >= 0) {
console.log(node, data, flag, vm.status4Flag);
vm.nowCheck = node;
vm.warnType = 0;
vm.dialogWarn = true;
// this.$refs.tree.setChecked(data,false)
}
},
handleChangeRegion(value) {
let areaId = "
000
";
for (let i = 0; i < value.length; i++) {
areaId += "
_
" + value[i];
}
vm.administrativeValue = areaId;
console.log(value, vm.administrativeValue);
},
setMoreOption(data, type) {
let option = [];
for (let i = 0; i < data.length; i++) {
let obj = data[i];
if (type == "
cities
") {
obj.label = data[i].cityName;
obj.value = data[i].cityId;
} else if (type == "
counties
") {
obj.label = data[i].countyName;
obj.value = data[i].countyId;
// obj.leaf = true;
} else if (type == "
towns
") {
obj.label = data[i].townName;
obj.value = data[i].townId;
obj.leaf = true;
}
option.push(obj);
}
return option;
},
//获取地区
getRegionOption() {
let req = {};
openLoading(vm);
vm.GET("
basic
-
data
/
position
/
provinces
", req).then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
vm.optionsRegion = operationData.setRegionOption2(
res.data.provinceList
);
}
});
},
//机构table中勾选一排
selectAllOrganization(selection) {
let setList = [];
let selectList = [];
for (let i = 0; i < vm.tableOrganization.length; i++) {
if (vm.tableOrganization[i].modifyFlag == 0) {
setList.push(vm.tableOrganization[i].id);
}
}
for (let j = 0; j < selection.length; j++) {
selectList.push(selection[j].id);
}
let intersect = operationData.getIntersect(setList, selectList);
let typeStatus = 0;
if (intersect.length > 0) {
typeStatus = 1;
}
// let = this.$refs.multipleTable.selection
console.log(selection, setList, selectList);
if (setList.length > 0) {
let req = {
ids: setList,
projectId: this.projectId,
type: typeStatus
};
openLoading(vm);
vm.PUT("
portal
/
new
/scope/
org
/
v1
/
organization
/
option
", req).then(res => {
closeLoading(vm);
});
}
},
//机构table中勾选一个
selectOrganization(selection, row) {
console.log("
select
", selection, row);
let flag = false;
for (let i = 0; i < selection.length; i++) {
if (selection[i].id == row.id) {
flag = true;
}
}
let req = {
ids: [row.id],
projectId: this.projectId,
type: flag === false ? 0 : 1
};
openLoading(vm);
vm.PUT("
portal
/
new
/scope/
org
/
v1
/
organization
/
option
", req).then(res => {
closeLoading(vm);
});
},
//
//人员table中勾选一排
selectAllPerson(selection) {
let setList = [];
let selectList = [];
for (let i = 0; i < vm.tablePerson.length; i++) {
if (vm.tablePerson[i].modifyFlag == 0) {
setList.push(vm.tablePerson[i].id);
}
}
for (let j = 0; j < selection.length; j++) {
selectList.push(selection[j].id);
}
let intersect = operationData.getIntersect(setList, selectList);
let typeStatus = 0;
if (intersect.length > 0) {
typeStatus = 1;
}
console.log(selection, setList, selectList);
if (setList.length > 0) {
let req = {
ids: setList,
projectId: this.projectId,
type: typeStatus
};
openLoading(vm);
vm.PUT("
portal
/
new
/scope/
doctor
/
v1
/
doctor
/
option
", req).then(res => {
closeLoading(vm);
});
}
},
//人员table中勾选一个
selectPerson(selection, row) {
console.log("
select
", selection, row);
let flag = false;
for (let i = 0; i < selection.length; i++) {
if (selection[i].id == row.id) {
flag = true;
}
}
let req = {
ids: [row.id],
projectId: this.projectId,
type: flag === false ? 0 : 1
};
openLoading(vm);
vm.PUT("
portal
/
new
/scope/
doctor
/
v1
/
doctor
/
option
", req).then(res => {
closeLoading(vm);
});
},
//重置机构、人员查询
resetOrgOrPerson(type) {
if (type == "
org
") {
vm.formOrganization.name = "";
vm.formOrganization.administrativeId = "
0
";
vm.formOrganization.administrativeIdList = ["
0
"];
vm.formOrganization.level = "
-
1
";
vm.formOrganization.pageNum = 1;
vm.searchOrganization();
} else if (type == "
person
") {
vm.formPerson.hospitalName = "";
vm.formPerson.doctorName = "";
vm.formPerson.pageNum = 1;
vm.searchPeople();
}
}
}
};
</
script
>
<
style
lang=
"scss"
>
.min-label
{
.el-form-item__label
{
line-height
:
26px
;
}
.el-form-item__content
{
line-height
:
26px
;
}
}
.add-manager-wrap
{
.add-content
{
background
:
#fff
;
}
.rim
{
border
:
1px
solid
#dddddd
;
}
.mleft60
{
margin-left
:
60px
;
}
.soure-configure
{
background
:
#f9f9f9
;
padding
:
15px
;
width
:
550px
;
font-size
:
12px
;
color
:
#606266
;
position
:
relative
;
margin-bottom
:
20px
;
.configure-option
{
position
:
absolute
;
right
:
-95px
;
top
:
50%
;
margin-top
:
-15px
;
}
.mb15
{
margin-bottom
:
15px
;
}
.configure-item
{
overflow
:
hidden
;
.configure-item-l
{
display
:
inline-block
;
width
:
60px
;
text-align
:
right
;
}
}
}
.mini-source
{
background
:
#f9f9f9
;
width
:
650px
;
padding
:
15px
;
margin-bottom
:
20px
;
.source-item
{
padding-top
:
0px
;
font-size
:
12px
;
line-height
:
28px
;
color
:
#606266
;
}
}
.second-step
{
margin
:
10px
0
0
20px
;
.area-p
{
margin-bottom
:
15px
;
font-size
:
14px
;
}
.span_ecology
{
line-height
:
45px
;
margin-left
:
8px
;
}
.dialog-p
{
text-align
:
center
;
span
{
color
:
#449284
;
}
}
//隐藏树展开
.table-empty
{
img
{
width
:
100px
;
}
p
{
margin-top
:
-50px
;
}
}
.el-tree-node__expand-icon
{
display
:
none
;
}
.department
{
margin-top
:
20px
;
border
:
1px
solid
#dddddd
;
}
.
el-tabs__nav-wrap
:
:
after
{
display
:
none
;
}
.el-tabs__active-bar
{
display
:
none
;
}
#tab-first
,
#tab-second
,
#tab-third
{
padding-right
:
0px
;
}
#
tab-first
:
:
after
,
#tab
-
second
::
after
,
#tab
-
third
::
after
{
color
:
#c7cbd2
;
margin-left
:
20px
;
content
:
"•"
;
}
.el-tabs__item.is-active
{
color
:
#fff
;
}
.el-tag
{
margin
:
0
10px
10px
0
;
border
:
1
.3px
solid
#48a8fe
;
color
:
#1e92fe
;
background-color
:
#e7f6fe
;
.el-icon-close
{
width
:
13px
;
height
:
13px
;
line-height
:
13px
;
font-size
:
12px
;
background-color
:
#0486fe
;
border-radius
:
50%
;
color
:
#d4edfe
;
}
}
.down-button
{
margin-left
:
10px
;
}
.down-button-close
{
margin-left
:
100px
;
float
:
left
;
}
.dialog-success
{
p
{
text-align
:
center
;
.upload-text
{
color
:
#449284
;
}
}
}
.dialog-fail
{
.fail-type
{
p
{
margin-top
:
10px
;
}
.fail-num
{
color
:
#db3f52
;
}
.fail-notice
{
color
:
#e3e3e3
;
font-size
:
13px
;
}
.fail-link
{
text-align
:
center
;
color
:
#449284
;
cursor
:
pointer
;
}
}
}
}
}
.edit-img
{
width
:
20px
;
}
.popover-content
{
position
:
relative
;
top
:
0
;
left
:
0
;
}
</
style
>
\ No newline at end of file
src/views/yqrange/live-manage.vue
浏览文件 @
ddd4786b
...
...
@@ -45,9 +45,9 @@
<el-table-column
prop=
"endTime"
label=
"结束时间"
min-width=
"100"
align=
"center"
></el-table-column>
<el-table-column
label=
"操作"
min-width=
"300"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
@
click=
"reviewLive(scope.row)"
type=
"text"
size=
"small"
>
设置回放
</el-button>
<el-button
@
click=
"liveLink(scope.row)"
type=
"text"
size=
"small"
>
直播链接
</el-button>
<el-button
@
click=
"reviewLive(scope.row)"
type=
"text"
size=
"small"
>
回放
</el-button>
<el-button
@
click=
"shareLive(scope.row)"
type=
"text"
size=
"small"
>
分享直播
</el-button>
<el-button
@
click=
"countLive(scope.row)"
type=
"text"
size=
"small"
>
数据统计
</el-button>
<el-button
@
click=
"editLive(scope.row)"
type=
"text"
size=
"small"
>
编辑
</el-button>
<el-button
@
click=
"deleteLive(scope.row)"
type=
"text"
size=
"small"
>
删除
</el-button>
</
template
>
...
...
@@ -114,17 +114,49 @@
console
.
log
(
'重置'
)
},
//新建直播
createLive
()
{},
createLive
()
{
this
.
$router
.
push
({
path
:
'/create-live'
,
})
},
//直播链接
liveLink
(
row
)
{},
//回放
reviewLive
(
row
)
{},
//分享直播
shareLive
(
row
)
{},
//数据统计
countLive
(
row
)
{
this
.
$msgbox
({
title
:
'直播链接'
,
message
:
'这是一段内容'
,
showCancelButton
:
true
// confirmButtonText: '确定',
// cancelButtonText: '取消'
}).
then
(
action
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'action: '
+
action
});
})
},
//编辑直播
editLive
(
row
)
{},
editLive
(
row
)
{
this
.
$router
.
push
({
path
:
'/create-live'
,
})
},
//删除直播
deleteLive
(
row
)
{},
deleteLive
(
row
)
{
this
.
$confirm
(
`确定删除“
${
row
.
liveName
}
”吗?`
,
''
,
{
confirmButtonText
:
'删除'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
customClass
:
'range-make-box'
,
}).
then
(()
=>
{
// confirm
}).
catch
(()
=>
{
// cancel
});
},
handleSizeChange
(
val
)
{
this
.
searchForm
.
pageSize
=
val
;
this
.
searchForm
.
pageNo
=
1
;
...
...
src/views/yqrange/yq-range.vue
浏览文件 @
ddd4786b
...
...
@@ -151,7 +151,11 @@ export default {
})
},
//编辑
editRange
(
row
)
{},
editRange
(
row
)
{
this
.
$router
.
push
(
{
path
:
'/edit-range'
,
})
},
//解散圈子
deleteRange
(
row
)
{
this
.
$confirm
(
`确定解散“
${
row
.
name
}
”吗?`
,
''
,
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录