Commit 9db04671 authored by 罗超's avatar 罗超

临时提交

parent a23fbae5
...@@ -47,9 +47,9 @@ module.exports = function (ctx) { ...@@ -47,9 +47,9 @@ module.exports = function (ctx) {
vueRouterMode: 'hash', // available values: 'hash', 'history' vueRouterMode: 'hash', // available values: 'hash', 'history'
env: ctx.dev ? { env: ctx.dev ? {
// API: 'https://localhost:5001/api', API: 'http://localhost:5001/api',
// API: 'http://192.168.20.24:8300/api', // API: 'http://192.168.20.24:8300/api',
API: 'http://192.168.10.46:8300/api', // API: 'http://192.168.10.46:8300/api',
// API: 'http://192.168.20.17:8017/api', // API: 'http://192.168.20.17:8017/api',
......
...@@ -331,34 +331,34 @@ ...@@ -331,34 +331,34 @@
B2CRatio: 0, //直客首次报名优惠比例 B2CRatio: 0, //直客首次报名优惠比例
B2CReNewRatio: 0, //直客续费优惠比例 B2CReNewRatio: 0, //直客续费优惠比例
B2BRebateRatio: 0, //一般同行首次报名返佣比例 B2BRebateRatio: 0, //一般同行首次报名返佣比例
B2BRebateRatioType: 1, B2BRebateRatioType: 3,
B2BRebateRatioValue: '', B2BRebateRatioValue: '',
B2BReNewRatio: 0, //一般同行续费返佣比例 B2BReNewRatio: 0, //一般同行续费返佣比例
B2BReNewRatioType: 1, B2BReNewRatioType: 3,
B2BReNewRatioValue: '', B2BReNewRatioValue: '',
SchoolRebateRatio: 0, //校代同行首次返佣比例 SchoolRebateRatio: 0, //校代同行首次返佣比例
SchoolRebateRatioType: 1, SchoolRebateRatioType: 3,
SchoolRebateRatioValue: '', SchoolRebateRatioValue: '',
SchoolReNewRatio: 0, //校代同行续费返佣比例 SchoolReNewRatio: 0, //校代同行续费返佣比例
SchoolReNewRatioType: 1, SchoolReNewRatioType: 3,
SchoolReNewRatioValue: '', SchoolReNewRatioValue: '',
TransIntroductceRatio: 0, //转介首次报名返佣比例 TransIntroductceRatio: 0, //转介首次报名返佣比例
TransIntroductceRatioType: 1, TransIntroductceRatioType: 3,
TransIntroductceRatioValue: '', TransIntroductceRatioValue: '',
TransIntroductceReNewRatio: 0, //转介续费返佣比例 TransIntroductceReNewRatio: 0, //转介续费返佣比例
TransIntroductceReNewRatioType: 1, TransIntroductceReNewRatioType: 3,
TransIntroductceReNewRatioValue: '', TransIntroductceReNewRatioValue: '',
InnerRecommendRatio: 0, //內推首次报名返佣比例 InnerRecommendRatio: 0, //內推首次报名返佣比例
InnerRecommendRatioType: 1, InnerRecommendRatioType: 3,
InnerRecommendRatioValue: '', InnerRecommendRatioValue: '',
InnerRecommendReNewRatio: 0, //內推续费返佣比例 InnerRecommendReNewRatio: 0, //內推续费返佣比例
InnerRecommendReNewRatioType: 1, InnerRecommendReNewRatioType: 3,
InnerRecommendReNewRatioValue: '', InnerRecommendReNewRatioValue: '',
B2CRbRatio:0,//直客首次报名返佣比例 B2CRbRatio:0,//直客首次报名返佣比例
B2CRbRatioType:1,//直客首次报名返佣类型 B2CRbRatioType:3,//直客首次报名返佣类型
B2CRbRatioValue:"",// 直客首次报名返佣类型值 B2CRbRatioValue:"",// 直客首次报名返佣类型值
B2CRNRatio:0,//直客续费返佣比例 B2CRNRatio:0,//直客续费返佣比例
B2CRNRatioType:1,//直客续费返佣类型 B2CRNRatioType:3,//直客续费返佣类型
B2CRNRatioValue:"",//直客续费返佣类型值 B2CRNRatioValue:"",//直客续费返佣类型值
}, },
priceList: [] //价格列表 priceList: [] //价格列表
...@@ -379,7 +379,7 @@ ...@@ -379,7 +379,7 @@
getFanyong(){ getFanyong(){
GetCourseRebateSetList().then(res => { GetCourseRebateSetList().then(res => {
if(res.Code==1){ if(res.Code==1){
this.CourseRebateList = res.Data; this.CourseRebateList = res.Data.filter(x=>x.Id==3);
} }
}); });
}, },
......
<template> <template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale"> <q-dialog
v-model="persistent"
content-class="bg-grey-1"
persistent
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 800px;max-width:900px;"> <q-card style="width: 800px;max-width:900px;">
<q-card-section> <q-card-section>
<div class="text-h6">{{objOption.AccountId==0?'新增员工信息':'修改员工信息'}}</div> <div class="text-h6">
{{ objOption.AccountId == 0 ? "新增员工信息" : "修改员工信息" }}
</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-md q-px-xs text-grey-6">基本资料</div> <div class="text-caption q-mb-md q-px-xs text-grey-6">基本资料</div>
<div class="row wrap"> <div class="row wrap">
<q-select filled v-if="isEditShow" stack-label option-value="SId" option-label="SName" <q-select
v-model="objOption.School_Id" ref="School_Id" :options="schoolList" label="所属校区" filled
class="col-6 q-pb-lg q-pr-lg" emit-value map-options @input="schoolChagne" /> v-if="isEditShow"
<selectTree :treeData='DeptList' v-if="isEditShow" :defaultArray="returnString" nodeKey="DeptId" stack-label
:multiple="false" labelKey="DeptName" childrenKey="ChildList" tipText="选择部门" @getChild="getChild" option-value="SId"
classStr="col-6 q-pr-lg q-pb-lg"></selectTree> option-label="SName"
<q-select filled stack-label v-if="isEditShow" option-value="PostId" option-label="PostName" v-model="objOption.School_Id"
v-model="objOption.Post_Id" ref="Post_Id" :options="PostList" label="岗位" :dense="false" ref="School_Id"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options /> :options="schoolList"
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.EmployeeName" ref="EmployeeName" label="所属校区"
class="col-6 q-pr-lg q-pb-lg" label="员工姓名" :rules="[val => !!val || '请填写员工姓名']" /> class="col-6 q-pb-lg q-pr-lg"
emit-value
map-options
@input="schoolChagne"
/>
<selectTree
:treeData="DeptList"
v-if="isEditShow"
:defaultArray="returnString"
nodeKey="DeptId"
:multiple="false"
labelKey="DeptName"
childrenKey="ChildList"
tipText="选择部门"
@getChild="getChild"
classStr="col-6 q-pr-lg q-pb-lg"
></selectTree>
<q-select
filled
stack-label
v-if="isEditShow"
option-value="PostId"
option-label="PostName"
v-model="objOption.Post_Id"
ref="Post_Id"
:options="PostList"
label="岗位"
:dense="false"
class="col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
<q-input
filled
stack-label
maxlength="20"
:dense="false"
v-model="objOption.EmployeeName"
ref="EmployeeName"
class="col-6 q-pr-lg q-pb-lg"
label="员工姓名"
:rules="[val => !!val || '请填写员工姓名']"
/>
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.IDCard" ref="IDCard" <q-input
class="col-6 q-pr-lg q-pb-lg" label="身份证号码" :rules="[val => !!val || '请填写身份证号码']" /> filled
stack-label
maxlength="20"
:dense="false"
v-model="objOption.IDCard"
ref="IDCard"
class="col-6 q-pr-lg q-pb-lg"
label="身份证号码"
:rules="[val => !!val || '请填写身份证号码']"
/>
<q-select filled stack-label option-value="Id" option-label="Name" ref="ID" v-model="objOption.Sex" <q-select
:options="SexList" label="性别" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value map-options /> filled
stack-label
option-value="Id"
option-label="Name"
ref="ID"
v-model="objOption.Sex"
:options="SexList"
label="性别"
:dense="false"
class="col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
<q-select filled stack-label option-value="Id" option-label="Name" v-model="objOption.Education" <q-select
ref="Education" :options="EducationList" label="学历" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value filled
map-options /> stack-label
<q-input type="tel" filled stack-label maxlength="100" :dense="false" v-model="objOption.EmployeeTel" option-value="Id"
ref="EmployeeTel" class="col-6 q-pr-lg q-pb-lg" label="联系电话" /> option-label="Name"
<q-input filled v-model="objOption.EntryTime" class="col-6 q-pr-lg q-pb-lg" mask="date" label="入职时间"> v-model="objOption.Education"
ref="Education"
:options="EducationList"
label="学历"
:dense="false"
class="col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
<q-input
type="tel"
filled
stack-label
maxlength="100"
:dense="false"
v-model="objOption.EmployeeTel"
ref="EmployeeTel"
class="col-6 q-pr-lg q-pb-lg"
label="联系电话"
/>
<q-input
filled
v-model="objOption.EntryTime"
class="col-6 q-pr-lg q-pb-lg"
mask="date"
label="入职时间"
>
<template v-slot:append> <template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy1" transition-show="scale" transition-hide="scale"> <q-popup-proxy
<q-date v-model="objOption.EntryTime" @input="() => $refs.qDateProxy1.hide()" /> ref="qDateProxy1"
transition-show="scale"
transition-hide="scale"
>
<q-date
v-model="objOption.EntryTime"
@input="() => $refs.qDateProxy1.hide()"
/>
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
<q-input filled v-model="objOption.BirthDate" class="col-6 q-pr-lg q-pb-lg" mask="date" label="生日"> <q-input
filled
v-model="objOption.BirthDate"
class="col-6 q-pr-lg q-pb-lg"
mask="date"
label="生日"
>
<template v-slot:append> <template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy3" transition-show="scale" transition-hide="scale"> <q-popup-proxy
<q-date v-model="objOption.BirthDate" @input="() => $refs.qDateProxy3.hide()" /> ref="qDateProxy3"
transition-show="scale"
transition-hide="scale"
>
<q-date
v-model="objOption.BirthDate"
@input="() => $refs.qDateProxy3.hide()"
/>
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
<q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.Address" ref="Address" <q-input
class="col-6 q-pr-lg q-pb-lg" label="地址" /> filled
<q-input filled stack-label maxlength="60" :dense="false" v-model="objOption.Email" ref="Email" stack-label
class="col-6 q-pr-lg q-pb-lg" label="邮箱" /> maxlength="100"
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Account" ref="Account" :dense="false"
class="col-6 q-pr-lg q-pb-lg" label="账号" :rules="[val => !!val || '账号']" /> v-model="objOption.Address"
<q-input v-if="objOption.AccountId==0" filled stack-label maxlength="20" :dense="false" ref="Address"
v-model="objOption.Password" ref="Password" class="col-6 q-pr-lg q-pb-lg" label="密码" class="col-6 q-pr-lg q-pb-lg"
:rules="[val => !!val || '密码']" /> label="地址"
<q-select filled stack-label option-value="Id" option-label="Name" v-model="objOption.LeaveStatus" @input='getLeave' />
ref="Education" :options="LeaveStatusList" label="在职状态" :dense="false" class="col-6 q-pr-lg q-pb-lg" <q-input
emit-value map-options /> filled
<q-input v-show="objOption.AccountId>0 && objOption.LeaveStatus==4" filled v-model="objOption.LeaveTime" stack-label
class="col-6 q-pr-lg q-pb-lg" mask="date" label="离职时间"> maxlength="60"
:dense="false"
v-model="objOption.Email"
ref="Email"
class="col-6 q-pr-lg q-pb-lg"
label="邮箱"
/>
<q-input
filled
stack-label
maxlength="20"
:dense="false"
v-model="objOption.Account"
ref="Account"
class="col-6 q-pr-lg q-pb-lg"
label="账号"
:rules="[val => !!val || '账号']"
/>
<q-input
v-if="objOption.AccountId == 0"
filled
stack-label
maxlength="20"
:dense="false"
v-model="objOption.Password"
ref="Password"
class="col-6 q-pr-lg q-pb-lg"
label="密码"
:rules="[val => !!val || '密码']"
/>
<q-select
filled
stack-label
option-value="Id"
option-label="Name"
v-model="objOption.LeaveStatus"
@input="getLeave"
ref="Education"
:options="LeaveStatusList"
label="在职状态"
:dense="false"
class="col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
<q-input
v-show="objOption.AccountId > 0 && objOption.LeaveStatus == 4"
filled
v-model="objOption.LeaveTime"
class="col-6 q-pr-lg q-pb-lg"
mask="date"
label="离职时间"
>
<template v-slot:append> <template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy2" transition-show="scale" transition-hide="scale"> <q-popup-proxy
<q-date v-model="objOption.LeaveTime" @input="() => $refs.qDateProxy2.hide()" /> ref="qDateProxy2"
transition-show="scale"
transition-hide="scale"
>
<q-date
v-model="objOption.LeaveTime"
@input="() => $refs.qDateProxy2.hide()"
/>
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
<q-select filled stack-label :disable="objOption.AccountId==0?false:true" option-value="Id" <q-select
option-label="Value" ref="ID" v-model="objOption.AccountType" :options="AccountTypeList" label="用户类型" filled
:dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value map-options /> stack-label
<q-select filled stack-label option-value="Id" option-label="EmployeeName" ref="ID" :disable="objOption.AccountId == 0 ? false : true"
v-model="objOption.DirectSupervisor" :options="EmployeeList" label="直属上级" :dense="false" option-value="Id"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options /> option-label="Value"
<q-select filled stack-label option-value="Id" option-label="Name" ref="UserRole" clearable ref="ID"
v-model="objOption.UserRole" :options="roleList" label="用户角色" :dense="false" v-model="objOption.AccountType"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options /> :options="AccountTypeList"
label="用户类型"
:dense="false"
class="col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
<q-select
filled
stack-label
option-value="Id"
option-label="EmployeeName"
ref="ID"
v-model="objOption.DirectSupervisor"
:options="EmployeeList"
label="直属上级"
:dense="false"
class="col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
<q-select
filled
stack-label
option-value="Id"
option-label="Name"
ref="UserRole"
clearable
v-model="objOption.UserRole"
:options="roleList"
label="用户角色"
:dense="false"
class="col-6 q-pr-lg q-pb-lg"
emit-value
map-options
/>
<div class="col-6 q-pb-lg">
<q-toggle
label="人工客服"
v-model="objOption.IsTenCccUser"
:true-value="1"
:false-value="0"
></q-toggle>
</div>
<div class="col-6 q-pb-lg" style="margin-top:20px;"> <div class="col-6 q-pb-lg" style="margin-top:20px;">
<q-uploader style="display: inline-block;max-height: 320px;max-width: 100%; background-repeat:no-repeat" <q-uploader
:style="{'background-image':'url(' + objOption.UserIcon + ')'}" max-files="1" hide-upload-btn style="display: inline-block;max-height: 320px;max-width: 100%; background-repeat:no-repeat"
@rejected="onRejected" label="头像" accept=".jpg, image/*" auto-upload :factory="uploadFile" no-thumbnails> :style="{ 'background-image': 'url(' + objOption.UserIcon + ')' }"
max-files="1"
hide-upload-btn
@rejected="onRejected"
label="头像"
accept=".jpg, image/*"
auto-upload
:factory="uploadFile"
no-thumbnails
>
</q-uploader> </q-uploader>
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" /> <q-btn
<q-btn label="立即提交" color="accent" class="q-px-md" style="font-weight:400 !important" :loading="saveLoading" label="取消"
@click="setStudent" /> flat
color="grey-10"
style="font-weight:400 !important"
@click="closeSaveForm"
/>
<q-btn
label="立即提交"
color="accent"
class="q-px-md"
style="font-weight:400 !important"
:loading="saveLoading"
@click="setStudent"
/>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>
<script> <script>
import { import {
getSchoolDropdown, getSchoolDropdown,
saveManager, saveManager,
queryEmployeeInfo, queryEmployeeInfo,
getEducation, getEducation,
GetLeaveStatus, GetLeaveStatus,
getUserLeaveOrderCommission getUserLeaveOrderCommission
} from '../../../api/school/index' } from "../../../api/school/index";
//部门 //部门
import { import { getDeptTree } from "../../../api/system/dept";
getDeptTree //岗位
} from '../../../api/system/dept' import { queryDeptPostList } from "../../../api/system/post";
//岗位 import { UploadSelfFile } from "../../../api/common/common";
import { import selectTree from "../../common/select-tree";
queryDeptPostList import {
} from '../../../api/system/post' queryEmployee, //员工列表
import { GetUserRoleList
UploadSelfFile, } from "../../../api/users/user";
} from '../../../api/common/common' export default {
import selectTree from '../../common/select-tree' components: {},
import { props: {
queryEmployee, //员工列表 saveObj: {
GetUserRoleList type: Object,
} from '../../../api/users/user' default: null
export default { }
components: {}, },
props: { components: {
saveObj: { selectTree
type: Object, },
default: null data() {
} return {
}, persistent: true,
components: { objOption: {
selectTree Id: 0, //管理者编号
}, School_Id: 0, //学校编号
data() { EmployeeName: "", //管理者姓名
return { EmployeeTel: "", //管理者电话
persistent: true, UserIcon: "", //头像
objOption: { Dept_Id: 0, //部门编号
Id: 0, //管理者编号 Post_Id: 0, //岗位编号
School_Id: 0, //学校编号 IDCard: "", //身份证
EmployeeName: "", //管理者姓名 Sex: 0, //性别(0-男,1-女)
EmployeeTel: '', //管理者电话 Education: 0, //学历
UserIcon: '', //头像 EntryTime: "", //入职时间
Dept_Id: 0, //部门编号 LeaveTime: "", //离职时间
Post_Id: 0, //岗位编号 BirthDate: "", //生日、
IDCard: '', //身份证 Address: "", //地址
Sex: 0, //性别(0-男,1-女) LeaveStatus: 0, //在职状态
Education: 0, //学历 Account: "", //账号
EntryTime: '', //入职时间 Password: "", //密码
LeaveTime: '', //离职时间 AccountType: 1, // 是否是老师
BirthDate: '', //生日、 AccountId: 0, //账号对应的表主键编号
Address: '', //地址 Email: "", //邮箱
LeaveStatus: 0, //在职状态 DirectSupervisor: 0, //直属上级
Account: '', //账号 UserRole: "", //用户角色(1-市场人员,2-课程顾问)
Password: '', //密码 IsTenCccUser: 0 //电话客服
AccountType: 1, // 是否是老师 },
AccountId: 0, //账号对应的表主键编号 optionTitle: "",
Email: "", //邮箱 schoolList: [],
DirectSupervisor: 0, //直属上级 saveLoading: false,
UserRole: '' //用户角色(1-市场人员,2-课程顾问) DeptList: [], //部门列表
}, PostList: [], //岗位列表
optionTitle: "", returnString: [], //默认岗位
schoolList: [], SexList: [
saveLoading: false, {
DeptList: [], //部门列表 //性别
PostList: [], //岗位列表
returnString: [], //默认岗位
SexList: [{ //性别
Id: 0, Id: 0,
Name: '男' Name: "男"
}, { },
{
Id: 1, Id: 1,
Name: '女' Name: "女"
}], }
roleList:[], ],
EducationList: [], //学历数组 roleList: [],
LeaveStatusList: [], //在职状态 EducationList: [], //学历数组
isEditShow: false, //是否显示修改应该隐藏 LeaveStatusList: [], //在职状态
//账号类型 isEditShow: false, //是否显示修改应该隐藏
AccountTypeList: [{ //账号类型
Id: 1, AccountTypeList: [
Value: "后台用户" {
}, Id: 1,
{ Value: "后台用户"
Id: 2, },
Value: "教师" {
}, Id: 2,
{ Value: "教师"
Id: 3, },
Value: "助教" {
}, Id: 3,
], Value: "助教"
EmployeeList: [], //员工列表
errdata:'',//提示语言
}
},
created() {
this.queryDeptTree(0);
this.queryPostList(0);
this.getSchool();
this.getEducationList();
this.getLeaveState();
this.Employee();
this.getRoleList();
},
mounted() {
this.initObj();
},
methods: {
getRoleList(){
GetUserRoleList().then(res => {
if (res.Code == 1) {
this.roleList = res.Data;
}
})
},
Employee() {
var qMsg = {
EmployeeName: ''
} }
queryEmployee(qMsg).then(res => { ],
EmployeeList: [], //员工列表
errdata: "" //提示语言
};
},
created() {
this.queryDeptTree(0);
this.queryPostList(0);
this.getSchool();
this.getEducationList();
this.getLeaveState();
this.Employee();
this.getRoleList();
},
mounted() {
this.initObj();
},
methods: {
getRoleList() {
GetUserRoleList().then(res => {
if (res.Code == 1) {
this.roleList = res.Data;
}
});
},
Employee() {
var qMsg = {
EmployeeName: ""
};
queryEmployee(qMsg)
.then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.EmployeeList = res.Data; this.EmployeeList = res.Data;
var obj = { var obj = {
EmployeeName: '请选择', EmployeeName: "请选择",
Id: 0 Id: 0
} };
this.EmployeeList.unshift(obj); this.EmployeeList.unshift(obj);
} }
}).catch(() => {
}) })
}, .catch(() => {});
//学校改变 },
schoolChagne() { //学校改变
this.objOption.Dept_Id = 0; schoolChagne() {
this.returnString = [0]; this.objOption.Dept_Id = 0;
this.objOption.Post_Id = 0; this.returnString = [0];
this.PostList = []; this.objOption.Post_Id = 0;
this.queryDeptTree(); this.PostList = [];
}, this.queryDeptTree();
},
//部门改变
deptChange() { //部门改变
this.objOption.Post_Id = 0; deptChange() {
this.PostList = []; this.objOption.Post_Id = 0;
}, this.PostList = [];
getChild(deptArray) { },
var tempStr = ""; getChild(deptArray) {
if (deptArray && deptArray != '') { var tempStr = "";
tempStr = deptArray; if (deptArray && deptArray != "") {
} tempStr = deptArray;
this.objOption.Dept_Id = tempStr; }
if (this.saveObj) { this.objOption.Dept_Id = tempStr;
if (this.objOption.Dept_Id != this.saveObj.Dept_Id) { if (this.saveObj) {
this.deptChange(); if (this.objOption.Dept_Id != this.saveObj.Dept_Id) {
this.queryPostList();
}
} else {
this.deptChange(); this.deptChange();
this.queryPostList(); this.queryPostList();
} }
}, } else {
//获取部门结构树 this.deptChange();
queryDeptTree() { this.queryPostList();
var msg = { }
School_Id: 0 },
}; //获取部门结构树
if (this.objOption.School_Id && this.objOption.School_Id != '') { queryDeptTree() {
msg.School_Id = this.objOption.School_Id; var msg = {
School_Id: 0
};
if (this.objOption.School_Id && this.objOption.School_Id != "") {
msg.School_Id = this.objOption.School_Id;
}
getDeptTree(msg).then(res => {
if (res.Code == 1) {
this.DeptList = res.Data;
} }
getDeptTree(msg).then(res => { });
if (res.Code == 1) { },
this.DeptList = res.Data; //获取岗位列表
} queryPostList() {
}) var postMsg = {
}, QDeptIds: ""
//获取岗位列表 };
queryPostList() { if (this.objOption.Dept_Id) {
var postMsg = { postMsg.QDeptIds = this.objOption.Dept_Id;
QDeptIds: "", }
}; queryDeptPostList(postMsg).then(res => {
if (this.objOption.Dept_Id) { if (res.Code == 1) {
postMsg.QDeptIds = this.objOption.Dept_Id; this.PostList = res.Data;
this.$forceUpdate();
} }
queryDeptPostList(postMsg).then(res => { });
},
GetUserLeave(UserId) {
getUserLeaveOrderCommission({ UserId: UserId })
.then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.PostList = res.Data; this.errdata = "";
this.$forceUpdate();
} }
}) })
}, .catch(err => {
GetUserLeave(UserId){ if (err.Code == 0) {
getUserLeaveOrderCommission({UserId:UserId}).then(res => { ///返回来是0 的时候保存提示语言
if(res.Code == 1){
this.errdata= ''
}
}).catch(err=>{
if(err.Code == 0){///返回来是0 的时候保存提示语言
this.errdata = err.Message; this.errdata = err.Message;
} }
}) });
}, },
getLeave(val){ getLeave(val) {
if(val == 4){ if (val == 4) {
this.GetUserLeave(this.saveObj.EmAccountId) this.GetUserLeave(this.saveObj.EmAccountId);
} }
}, },
initObj() { initObj() {
if (this.saveObj) { if (this.saveObj) {
this.optionTitle = "修改员工信息" this.optionTitle = "修改员工信息";
this.isEditShow = false; //是否显示修改隐藏项 this.isEditShow = false; //是否显示修改隐藏项
queryEmployeeInfo({ queryEmployeeInfo({
Id: this.saveObj.Id, Id: this.saveObj.Id,
AccountId: this.saveObj.AccountId, AccountId: this.saveObj.AccountId,
AccountType: this.saveObj.AccountType AccountType: this.saveObj.AccountType
}).then(res => { }).then(res => {
this.objOption.Id = res.Data.Id; this.objOption.Id = res.Data.Id;
this.objOption.School_Id = res.Data.School_Id; this.objOption.School_Id = res.Data.School_Id;
this.objOption.EmployeeName = res.Data.EmployeeName; this.objOption.EmployeeName = res.Data.EmployeeName;
this.objOption.EmployeeTel = res.Data.EmployeeTel; this.objOption.EmployeeTel = res.Data.EmployeeTel;
this.objOption.UserIcon = res.Data.UserIcon; this.objOption.UserIcon = res.Data.UserIcon;
this.objOption.Post_Id = res.Data.Post_Id; this.objOption.Post_Id = res.Data.Post_Id;
this.objOption.Dept_Id = res.Data.Dept_Id; this.objOption.Dept_Id = res.Data.Dept_Id;
this.objOption.IDCard = res.Data.IDCard; this.objOption.IDCard = res.Data.IDCard;
this.objOption.Sex = res.Data.Sex; this.objOption.Sex = res.Data.Sex;
this.objOption.Education = res.Data.Education; this.objOption.Education = res.Data.Education;
this.objOption.EntryTime = res.Data.EntryTime; this.objOption.EntryTime = res.Data.EntryTime;
this.objOption.LeaveTime = res.Data.LeaveTime; this.objOption.LeaveTime = res.Data.LeaveTime;
this.objOption.BirthDate = res.Data.BirthDate; this.objOption.BirthDate = res.Data.BirthDate;
this.objOption.Address = res.Data.Address; this.objOption.Address = res.Data.Address;
this.objOption.LeaveStatus = res.Data.LeaveStatus; this.objOption.LeaveStatus = res.Data.LeaveStatus;
this.objOption.Account = res.Data.Account; this.objOption.Account = res.Data.Account;
this.objOption.AccountType = res.Data.AccountType; this.objOption.AccountType = res.Data.AccountType;
this.objOption.AccountId = res.Data.AccountId; this.objOption.AccountId = res.Data.AccountId;
this.objOption.Email = res.Data.Email; this.objOption.Email = res.Data.Email;
this.objOption.DirectSupervisor = res.Data.DirectSupervisor; this.objOption.DirectSupervisor = res.Data.DirectSupervisor;
this.objOption.UserRole = res.Data.UserRole; this.objOption.UserRole = res.Data.UserRole;
if (this.objOption.School_Id) { this.objOption.IsTenCccUser = res.Data.IsTenCccUser;
this.queryDeptTree(); if (this.objOption.School_Id) {
} this.queryDeptTree();
if (this.objOption.Dept_Id) {
this.queryPostList();
this.returnString.push(this.objOption.Dept_Id.toString());
}
this.$forceUpdate();
})
} else {
this.optionTitle = "新增员工";
this.isEditShow = true;
}
},
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
var obj = {
SName: '全部',
SId: 0
}
this.schoolList.unshift(obj);
this.$forceUpdate();
})
},
onRejected(rejectedEntries) {
this.$q.notify({
type: 'negative',
position: "top",
message: `文件验证失败,请重新上传`
})
},
uploadFile(files) {
UploadSelfFile('studentIcon', files[0], res => {
if (res.Code == 1) {
this.objOption.UserIcon = res.FileUrl;
}
})
},
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
setStudent() {
if (this.objOption.AccountId == 0) {
if (this.objOption.Dept_Id == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择部门`
})
return;
}
if (this.objOption.Post_Id == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请选择岗位`
})
return;
} }
if (this.objOption.Password == '') { if (this.objOption.Dept_Id) {
this.$q.notify({ this.queryPostList();
type: 'negative', this.returnString.push(this.objOption.Dept_Id.toString());
position: "top",
message: `请填写密码`
})
return;
} }
this.$forceUpdate();
});
} else {
this.optionTitle = "新增员工";
this.isEditShow = true;
}
},
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
var obj = {
SName: "全部",
SId: 0
};
this.schoolList.unshift(obj);
this.$forceUpdate();
});
},
onRejected(rejectedEntries) {
this.$q.notify({
type: "negative",
position: "top",
message: `文件验证失败,请重新上传`
});
},
uploadFile(files) {
UploadSelfFile("studentIcon", files[0], res => {
if (res.Code == 1) {
this.objOption.UserIcon = res.FileUrl;
} }
if (this.objOption.EmployeeName == '') { });
},
closeSaveForm() {
this.$emit("close");
this.persistent = false;
},
setStudent() {
if (this.objOption.AccountId == 0) {
if (this.objOption.Dept_Id == "") {
this.$q.notify({ this.$q.notify({
type: 'negative', type: "negative",
position: "top", position: "top",
message: `请填写员工姓名` message: `请选择部门`
}) });
return; return;
} }
if (this.objOption.Account == '') { if (this.objOption.Post_Id == 0) {
this.$q.notify({ this.$q.notify({
type: 'negative', type: "negative",
position: "top", position: "top",
message: `请填写账号` message: `请选择岗位`
}) });
return; return;
} }
if (this.saveObj && this.saveObj.PropertyNumber&& this.saveObj.PropertyNumber>0&&this.objOption.LeaveStatus===4) { if (this.objOption.Password == "") {
this.$q.notify({ this.$q.notify({
type: 'negative', type: "negative",
position: "top", position: "top",
message: `有正在使用的资产,不能设置离职` message: `请填写密码`
}) });
return; return;
} }
if(this.objOption.LeaveStatus==4 && this.errdata!=''){//选择离职的时候看接口返回是否可以离职 }
if (this.objOption.EmployeeName == "") {
this.$q.notify({
type: "negative",
position: "top",
message: `请填写员工姓名`
});
return;
}
if (this.objOption.Account == "") {
this.$q.notify({
type: "negative",
position: "top",
message: `请填写账号`
});
return;
}
if (this.objOption.IsTenCccUser == 1) {
if (this.objOption.Email == "") {
this.$q.notify({ this.$q.notify({
type: 'negative', type: "negative",
position: "top", position: "top",
message: this.errdata, message: `电话客服必须填入正确的邮箱,否则无法保存`
}) });
return return;
} }
if (this.objOption.EmployeeTel == "") {
this.saveLoading = true;
saveManager(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', type: "negative",
color: 'accent', position: "top",
message: `电话客服必须填入正确的使用电话,否则会造成无法正常使用`
});
return;
}
}
if (
this.saveObj &&
this.saveObj.PropertyNumber &&
this.saveObj.PropertyNumber > 0 &&
this.objOption.LeaveStatus === 4
) {
this.$q.notify({
type: "negative",
position: "top",
message: `有正在使用的资产,不能设置离职`
});
return;
}
if (this.objOption.LeaveStatus == 4 && this.errdata != "") {
//选择离职的时候看接口返回是否可以离职
this.$q.notify({
type: "negative",
position: "top",
message: this.errdata
});
return;
}
this.saveLoading = true;
saveManager(this.objOption)
.then(res => {
this.saveLoading = false;
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000, timeout: 2000,
message: '数据保存成功!', message: "数据保存成功!",
position: 'top' position: "top"
}) });
this.$emit("success") this.$emit("success");
this.closeSaveForm() this.closeSaveForm();
}).catch(() => {
this.saveLoading = false
}) })
}, .catch(() => {
//获取学历数据 this.saveLoading = false;
getEducationList() { });
getEducation({}).then(res => {
if (res.Code == 1) {
this.EducationList = res.Data;
}
})
},
//获取在职状态
getLeaveState() {
GetLeaveStatus({}).then(res => {
if (res.Code == 1) {
this.LeaveStatusList = res.Data;
}
})
}
}, },
watch: { //获取学历数据
getEducationList() {
getEducation({}).then(res => {
if (res.Code == 1) {
this.EducationList = res.Data;
}
});
},
//获取在职状态
getLeaveState() {
GetLeaveStatus({}).then(res => {
if (res.Code == 1) {
this.LeaveStatusList = res.Data;
}
});
} }
} },
watch: {}
};
</script> </script>
<style> <style>
.upload-assiatant-box .q-uploader__list { .upload-assiatant-box .q-uploader__list {
display: none; display: none;
} }
.upload-assiatant-box .q-uploader {
width: auto;
}
.upload-assiatant-box .q-uploader {
width: auto;
}
</style> </style>
...@@ -3,31 +3,69 @@ ...@@ -3,31 +3,69 @@
<q-header bordered reveal height-hint="98" class="head-bg text-dark"> <q-header bordered reveal height-hint="98" class="head-bg text-dark">
<q-toolbar style="height:60px;" class="q-pr-lg q-pl-lg"> <q-toolbar style="height:60px;" class="q-pr-lg q-pl-lg">
<q-avatar style="width:38px" square> <q-avatar style="width:38px" square>
<img :src="logo"> <img :src="logo" />
</q-avatar> </q-avatar>
<q-toolbar-title style="font-family:perfectFont;margin-right:50px"> <q-toolbar-title style="font-family:perfectFont;margin-right:50px">
{{name}} {{ name }}
</q-toolbar-title> </q-toolbar-title>
<q-tabs v-model="tab" @input="changeNavs" inline-label <q-tabs
style="margin:0 auto;height:60px;flex:1;justify-content: left;font-weight:bold;" shrink stretch v-model="tab"
v-if="userInfo" active-color="primary"> @input="changeNavs"
<q-tab v-for="(x, i) in userInfo.MenuList" class="q-mr-md" :key="i" @click="setNavs(i)" :name="`navs_${i}`" inline-label
:label="x.MenuName" :icon="x.MenuIcon" /> style="margin:0 auto;height:60px;flex:1;justify-content: left;font-weight:bold;"
shrink
stretch
v-if="userInfo"
active-color="primary"
>
<q-tab
v-for="(x, i) in userInfo.MenuList"
class="q-mr-md"
:key="i"
@click="setNavs(i)"
:name="`navs_${i}`"
:label="x.MenuName"
:icon="x.MenuIcon"
/>
</q-tabs> </q-tabs>
<div class="q-pl-lg flex items-center"> <div class="q-pl-lg flex items-center">
<div class="wave_wrapper" @click="showNotify"> <div class="wave_wrapper" @click="showNotify">
<!-- <span class="dona wave_scale"> <!-- <span class="dona wave_scale">
</span> --> </span> -->
<span :class="{'dona':socektArr.length>0,'wave_scale':socektArr.length>0}"> <span
:class="{
dona: socektArr.length > 0,
wave_scale: socektArr.length > 0
}"
>
</span> </span>
<inline-svg class="svg-icon svg-icon-primary" src="icons/svg/Code/Compiling.svg"></inline-svg> <inline-svg
class="svg-icon svg-icon-primary"
src="icons/svg/Code/Compiling.svg"
></inline-svg>
</div> </div>
<q-btn flat color="text-black" style="height:50px" @click="showInfo"> <q-btn flat color="text-black" style="height:50px" @click="showInfo">
<span class="text-grey q-mr-xs">Hi</span> <span class="text-grey q-mr-xs">Hi</span>
<span class="text-dark q-mr-md">{{(userInfo&& userInfo.AccountName? userInfo.AccountName:"")}} </span> <span class="text-dark q-mr-md"
<q-avatar size="35px" rounded style="background:#C9F7F5" text-color="white"> >{{
<img :src="userInfo.UserIcon" v-if="userInfo&&userInfo.UserIcon"> userInfo && userInfo.AccountName ? userInfo.AccountName : ""
<span v-else>{{(userInfo&& userInfo.AccountName? userInfo.AccountName.substring(0,1):"") }}</span> }}
</span>
<q-avatar
size="35px"
rounded
style="background:#C9F7F5"
text-color="white"
>
<img
:src="userInfo.UserIcon"
v-if="userInfo && userInfo.UserIcon"
/>
<span v-else>{{
userInfo && userInfo.AccountName
? userInfo.AccountName.substring(0, 1)
: ""
}}</span>
</q-avatar> </q-avatar>
</q-btn> </q-btn>
</div> </div>
...@@ -35,32 +73,58 @@ ...@@ -35,32 +73,58 @@
</q-header> </q-header>
<q-page-container class="window-height"> <q-page-container class="window-height">
<div class="row items-stretch full-height"> <div class="row items-stretch full-height">
<div style="box-shadow: 2px 0 10px 0 rgba(237,238,240,0.50);background-color:#f5f6f7" <div
class="text-subtitle2 second-menu-bg" :style="{'width':IsShowLeft?'0':'180px'}" style="box-shadow: 2px 0 10px 0 rgba(237,238,240,0.50);background-color:#f5f6f7"
v-if="secondNavs && secondNavs.length>0"> class="text-subtitle2 second-menu-bg"
:style="{ width: IsShowLeft ? '0' : '180px' }"
v-if="secondNavs && secondNavs.length > 0"
>
<div class="full-width left-menu-box q-pt-md"> <div class="full-width left-menu-box q-pt-md">
<div class="is-show-menu-2" @click="changeLeft"> <div class="is-show-menu-2" @click="changeLeft">
<!-- <a v-if="!IsShowLeft" title="收起"><<</a> --> <!-- <a v-if="!IsShowLeft" title="收起"><<</a> -->
<i v-if="!IsShowLeft" class="iconfont icon-shouqi" title="收起"></i> <i
<i v-else class="iconfont icon-zhankai is_Show_menu_3" title="展开"></i> v-if="!IsShowLeft"
class="iconfont icon-shouqi"
title="收起"
></i>
<i
v-else
class="iconfont icon-zhankai is_Show_menu_3"
title="展开"
></i>
<!-- <a v-else class="is_Show_menu_3" title="展开">>></a> --> <!-- <a v-else class="is_Show_menu_3" title="展开">>></a> -->
</div> </div>
<q-list style="width:180px;overflow:hidden"> <q-list style="width:180px;overflow:hidden">
<template v-for="(x,i) in secondNavs"> <template v-for="(x, i) in secondNavs">
<q-item :to="x.MenuUrl" clickable v-ripple :active="currentPath==x.MenuUrl" <q-item
v-if="x.SubList&&x.SubList.length==0" :key="i"> :to="x.MenuUrl"
clickable
v-ripple
:active="currentPath == x.MenuUrl"
v-if="x.SubList && x.SubList.length == 0"
:key="i"
>
<q-item-section avatar style="min-width:30px;"> <q-item-section avatar style="min-width:30px;">
<q-icon :name="x.MenuIcon" size="20px" /> <q-icon :name="x.MenuIcon" size="20px" />
</q-item-section> </q-item-section>
<q-item-section>{{x.MenuName}}</q-item-section> <q-item-section>{{ x.MenuName }}</q-item-section>
</q-item> </q-item>
<q-expansion-item v-else :label="x.MenuName"> <q-expansion-item v-else :label="x.MenuName">
<q-item :to="y.MenuUrl" clickable v-ripple :active="currentPath==y.MenuUrl" <q-item
v-for="(y, yi) in x.SubList" :key="yi"> :to="y.MenuUrl"
<q-item-section avatar style="padding-right:0;min-width:30px;"> clickable
v-ripple
:active="currentPath == y.MenuUrl"
v-for="(y, yi) in x.SubList"
:key="yi"
>
<q-item-section
avatar
style="padding-right:0;min-width:30px;"
>
<q-icon :name="y.MenuIcon" size="20px" /> <q-icon :name="y.MenuIcon" size="20px" />
</q-item-section> </q-item-section>
<q-item-section>{{y.MenuName}}</q-item-section> <q-item-section>{{ y.MenuName }}</q-item-section>
</q-item> </q-item>
</q-expansion-item> </q-expansion-item>
</template> </template>
...@@ -68,415 +132,442 @@ ...@@ -68,415 +132,442 @@
</div> </div>
</div> </div>
<div class="col" style="background: #f2f4f7;"> <div class="col" style="background: #f2f4f7;">
<q-scroll-area :thumb-style="thumbStyle" :bar-style="barStyle" visible <q-scroll-area
class="fit content-scroll full-width full-height"> :thumb-style="thumbStyle"
:bar-style="barStyle"
visible
class="fit content-scroll full-width full-height"
>
<router-view /> <router-view />
</q-scroll-area> </q-scroll-area>
</div> </div>
</div> </div>
</q-page-container> </q-page-container>
<user-info-box v-if="persistent" :show-obj="userInfo" @close="closeSaveForm"></user-info-box> <user-info-box
<notify v-if="persistentNotify" :show-obj="userInfo" :socekt-obj="socektArr" @close="closeSaveForm"></notify> v-if="persistent"
:show-obj="userInfo"
@close="closeSaveForm"
></user-info-box>
<notify
v-if="persistentNotify"
:show-obj="userInfo"
:socekt-obj="socektArr"
@close="closeSaveForm"
></notify>
</q-layout> </q-layout>
</template> </template>
<script> <script>
import { import { mapGetters } from "vuex";
mapGetters import userInfoBox from "../components/global/user-right-box";
} from 'vuex' import notify from "../components/global/notify";
import userInfoBox from '../components/global/user-right-box'
import notify from '../components/global/notify' import { GetMsgLogList } from "../api/course/index";
import { import { sendSock } from "../api/common/socket";
GetMsgLogList export default {
} from '../api/course/index' name: "MainLayout",
data() {
import { return {
sendSock tab: "navs_0",
} from '../api/common/socket' currentPath: "",
export default { secondNavs: [],
name: 'MainLayout', thumbStyle: {
data() { right: "0px",
return { borderRadius: "0px",
tab: "navs_0", backgroundColor: "#1d1d1d",
currentPath: "", width: "6px",
secondNavs: [], opacity: 1
thumbStyle: { },
right: '0px', barStyle: {
borderRadius: '0px', right: "0px",
backgroundColor: '#1d1d1d', borderRadius: "0px",
width: '6px', backgroundColor: "#999",
opacity: 1 width: "6px",
}, opacity: 0.5
barStyle: { },
right: '0px', persistent: false,
borderRadius: '0px', persistentNotify: false,
backgroundColor: '#999', isExpend: false,
width: '6px', IsShowLeft: true,
opacity: 0.5 userCenterMenuList: [], //用户中心菜单
}, socektArr: [] //消息数组
persistent: false, };
persistentNotify: false, },
isExpend: false, components: {
IsShowLeft: true, userInfoBox,
userCenterMenuList: [], //用户中心菜单 notify
socektArr: [], //消息数组 },
} watch: {
}, $route: {
components: { handler: function(route) {
userInfoBox, var newPath = route.path.split("?")[0].toLowerCase();
notify this.IsShowLeft = false;
switch (newPath) {
case "/course/chapter":
this.IsShowLeft = true;
break;
case "/course/teachplan":
this.IsShowLeft = true;
break;
case "/course/courseinfo":
this.IsShowLeft = true;
break;
case "/course/coursejob":
this.IsShowLeft = true;
break;
}
this.currentPath = route.path;
},
immediate: true
}, },
watch: { userInfo: {
$route: { handler: function(newVal) {
handler: function (route) { let i = this.tab.split("_")[1];
var newPath = route.path.split("?")[0].toLowerCase(); if (newVal && newVal.MenuList) {
this.IsShowLeft = false; this.secondNavs =
switch (newPath) { newVal.MenuList.length > 0
case "/course/chapter": ? newVal.MenuList[i] && newVal.MenuList[i].SubList
this.IsShowLeft = true; ? newVal.MenuList[i].SubList
break; : []
case "/course/teachplan": : [];
this.IsShowLeft = true; }
break; if (newVal && newVal.UserCenterList) {
case "/course/courseinfo": this.userCenterMenuList = newVal.UserCenterList;
this.IsShowLeft = true; }
break;
case "/course/coursejob":
this.IsShowLeft = true;
break;
}
this.currentPath = route.path
},
immediate: true
}, },
userInfo: { immediate: true
handler: function (newVal) { }
let i = this.tab.split('_')[1]; },
if (newVal && newVal.MenuList) { computed: {
this.secondNavs = newVal.MenuList.length > 0 ? (newVal.MenuList[i] && newVal.MenuList[i].SubList ? newVal ...mapGetters(["userInfo", "logo", "name"])
.MenuList[i].SubList : []) : []; },
} mounted() {
if (newVal && newVal.UserCenterList) { let i = 0;
this.userCenterMenuList = newVal.UserCenterList; if (sessionStorage.getItem("current_navs")) {
} i = sessionStorage.getItem("current_navs");
}, }
immediate: true this.tab = `navs_${i}`;
} if (this.userInfo && this.userInfo.MenuList) {
this.secondNavs =
this.userInfo.MenuList.length > 0
? this.userInfo.MenuList[i] && this.userInfo.MenuList[i].SubList
? this.userInfo.MenuList[i].SubList
: []
: [];
}
this.$root.$on("goworkobj", data => {
this.secondNavs = [];
});
this.getLogList();
this.getMsg();
if (this.userInfo.IsTenCccUser == 1) {
this.injectTCCC(
this.userInfo.TenCccToken.Token,
1400617921,
this.userInfo.Email,
this.userInfo.TenCccToken.SdkURL
);
}
},
methods: {
injectTCCC(token, sdkAppId, userId, sdkUrl) {
const scriptDom = document.createElement("script");
scriptDom.dataset.token = token;
scriptDom.dataset.sdkAppId = sdkAppId;
scriptDom.dataset.userid = userId;
//定制是否需要在登录后展示 坐席工作台。默认为true,这里可以通过设为false关闭
scriptDom.dataset.showWorkBenchAtFirstLogin = false;
scriptDom.src = sdkUrl;
document.body.appendChild(scriptDom);
}, },
computed: { changeLeft() {
...mapGetters([ this.IsShowLeft = !this.IsShowLeft;
'userInfo',
'logo',
'name'
]),
}, },
mounted() { showInfo() {
let i = 0 this.persistent = true;
if (sessionStorage.getItem("current_navs")) { },
i = sessionStorage.getItem("current_navs") showNotify() {
} this.persistentNotify = true;
this.tab = `navs_${i}` },
if (this.userInfo && this.userInfo.MenuList) { changeNavs(val) {
this.secondNavs = this.userInfo.MenuList.length > 0 ? (this.userInfo.MenuList[i] && this.userInfo.MenuList[i] let i = val.split("_")[1];
.SubList ? this.userInfo.MenuList[i].SubList : []) : [] this.secondNavs = this.userInfo.MenuList[i].SubList;
} },
this.$root.$on("goworkobj", (data) => { closeSaveForm() {
this.secondNavs = [] this.persistent = false;
this.persistentNotify = false;
},
setNavs(val) {
//防止页面数据丢失
sessionStorage.setItem("current_navs", val);
this.tab = `navs_${val}`;
this.secondNavs = this.userInfo.MenuList[val].SubList;
this.$router.push({
path: this.userInfo.MenuList[val].MenuUrl
}); });
this.getLogList();
this.getMsg();
}, },
methods: { //获取日志列表
changeLeft() { getLogList() {
this.IsShowLeft = !this.IsShowLeft; GetMsgLogList().then(res => {
}, if (res.Code == 1) {
showInfo() { this.socektArr = res.Data;
this.persistent = true
},
showNotify() {
this.persistentNotify = true
},
changeNavs(val) {
let i = val.split('_')[1]
this.secondNavs = this.userInfo.MenuList[i].SubList
},
closeSaveForm() {
this.persistent = false
this.persistentNotify = false
},
setNavs(val) {
//防止页面数据丢失
sessionStorage.setItem("current_navs", val)
this.tab = `navs_${val}`
this.secondNavs = this.userInfo.MenuList[val].SubList
this.$router.push({
path: this.userInfo.MenuList[val].MenuUrl
})
},
//获取日志列表
getLogList() {
GetMsgLogList().then(res => {
if (res.Code == 1) {
this.socektArr = res.Data;
}
})
},
getMsg() {
let userinfo = this.getLocalStorage();
var SendData = {
AppId: "JiaHeJiaoYu",
ClientId: userinfo.Id,
};
sendSock(SendData, this.getDataFunc)
},
getDataFunc(e) {
if (e.data) {
var newData = JSON.parse(e.data)
if (newData.length > 0) {
for (var i = 0; i < newData.length; i++) {
this.socektArr.unshift(newData[i])
}
}
// this.socektArr = this.socektArr.concat(newData)
this.showNotification(newData[0].Title, newData[0].Content, newData.CoverImg)
} }
}, });
/** },
* 通过Html调用显示系统通知 getMsg() {
* @param title let userinfo = this.getLocalStorage();
* @param msg var SendData = {
* @param imgUrl AppId: "JiaHeJiaoYu",
*/ ClientId: userinfo.Id
showNotification(title, msg, imgUrl) { };
var Notification = window.Notification || window.mozNotification || window.webkitNotification; sendSock(SendData, this.getDataFunc);
// 判断浏览器是否支持桌面通知 },
if (Notification) { getDataFunc(e) {
Notification.requestPermission(function (result) { if (e.data) {
//result 默认值'default'等同于拒绝 'denied' -用户选择了拒绝 'granted' -用户同意启用通知 var newData = JSON.parse(e.data);
if ("granted" != result) { if (newData.length > 0) {
console.log('请授权浏览器能够进行通知!'); for (var i = 0; i < newData.length; i++) {
return false; this.socektArr.unshift(newData[i]);
} else { }
var tag = "sds" + Math.random();
var notify = new Notification(
title, {
dir: 'auto',
lang: 'zh-CN',
tag: tag, //实例化的notification的id
icon: imgUrl, //通知的缩略图,icon 支持ico、png、jpg、jpeg格式
title: title, //通知的标题
body: msg //通知的具体内容
}
);
// 定义通知窗口点击函数
notify.onclick = function () {
//如果通知消息被点击,通知窗口将被激活
window.focus();
};
// 定义通知错误事件
notify.onerror = function () {
};
// 定义通知显示事件 可以设置多少秒之后关闭 也可以不设置关闭
notify.onshow = function () {
// 窗口显示3S后关闭
setTimeout(function () {
notify.close();
}, 3000);
};
// 定义通知关闭事件
notify.onclose = function () {
};
}
});
} else {
// 提示不支持系统通知
console.log('您的浏览器不支持系统通知,建议使用Chrome浏览');
} }
}, // this.socektArr = this.socektArr.concat(newData)
this.showNotification(
newData[0].Title,
newData[0].Content,
newData.CoverImg
);
}
}, },
/**
* 通过Html调用显示系统通知
* @param title
* @param msg
* @param imgUrl
*/
showNotification(title, msg, imgUrl) {
var Notification =
window.Notification ||
window.mozNotification ||
window.webkitNotification;
// 判断浏览器是否支持桌面通知
if (Notification) {
Notification.requestPermission(function(result) {
//result 默认值'default'等同于拒绝 'denied' -用户选择了拒绝 'granted' -用户同意启用通知
if ("granted" != result) {
console.log("请授权浏览器能够进行通知!");
return false;
} else {
var tag = "sds" + Math.random();
var notify = new Notification(title, {
dir: "auto",
lang: "zh-CN",
tag: tag, //实例化的notification的id
icon: imgUrl, //通知的缩略图,icon 支持ico、png、jpg、jpeg格式
title: title, //通知的标题
body: msg //通知的具体内容
});
// 定义通知窗口点击函数
notify.onclick = function() {
//如果通知消息被点击,通知窗口将被激活
window.focus();
};
// 定义通知错误事件
notify.onerror = function() {};
// 定义通知显示事件 可以设置多少秒之后关闭 也可以不设置关闭
notify.onshow = function() {
// 窗口显示3S后关闭
setTimeout(function() {
notify.close();
}, 3000);
};
// 定义通知关闭事件
notify.onclose = function() {};
}
});
} else {
// 提示不支持系统通知
console.log("您的浏览器不支持系统通知,建议使用Chrome浏览");
}
}
} }
};
</script> </script>
<style> <style>
@import url('~assets/css/common.css'); @import url("~assets/css/common.css");
.content-scroll>.scroll>.full-width { .content-scroll > .scroll > .full-width {
height: 100%; height: 100%;
} }
.is-show-menu-2 { .is-show-menu-2 {
position: absolute; position: absolute;
color: #a1a4a9; color: #a1a4a9;
cursor: pointer; cursor: pointer;
right: 75px; right: 75px;
bottom: 7px; bottom: 7px;
z-index: 999; z-index: 999;
} }
.is-show-menu-2 i { .is-show-menu-2 i {
font-size: 30px; font-size: 30px;
} }
.is_Show_menu_3 { .is_Show_menu_3 {
position: absolute; position: absolute;
left: 75px; left: 75px;
bottom: 7px; bottom: 7px;
cursor: pointer; cursor: pointer;
z-index: 10; z-index: 10;
} }
.head-bg { .head-bg {
/*background-image: url('~assets/images/page/top.png'); /*background-image: url('~assets/images/page/top.png');
background-position: right; background-position: right;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: auto 100%;*/ background-size: auto 100%;*/
background-color: #FFF; background-color: #fff;
} }
.head-bg .q-tab__label { .head-bg .q-tab__label {
font-weight: bold !important; font-weight: bold !important;
font-size: 15px; font-size: 15px;
} }
.second-menu-bg { .second-menu-bg {
background-image: url('~assets/images/page/left.png'); background-image: url("~assets/images/page/left.png");
background-position: bottom; background-position: bottom;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% auto; background-size: 100% auto;
height: 100%; height: 100%;
position: relative; position: relative;
} }
.hide-scrollbar { .hide-scrollbar {
scrollbar-width: 5px !important; scrollbar-width: 5px !important;
-ms-overflow-style: marquee, panner !important; -ms-overflow-style: marquee, panner !important;
} }
.suojin { .suojin {
height: 40px; height: 40px;
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, 0.5);
}
}
.suojin i {
.suojin i { font-size: 24px;
font-size: 24px; color: #636363;
color: #636363; }
}
.left-menu-box {
.left-menu-box { overflow-x: hidden;
overflow-x: hidden; overflow-y: auto;
overflow-y: auto; max-height: calc(100% - 50px);
max-height: calc(100% - 50px); height: calc(100% - 50px);
height: calc(100% - 50px); background-color: rgba(255, 255, 255, 0.3);
background-color: rgba(255, 255, 255, 0.3); }
}
.left-menu-box::-webkit-scrollbar {
.left-menu-box::-webkit-scrollbar { width: 4px;
width: 4px; height: 4px;
height: 4px; }
}
.left-menu-box::-webkit-scrollbar-thumb {
.left-menu-box::-webkit-scrollbar-thumb { border-radius: 4px;
border-radius: 4px; box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); background: #bbb;
background: #bbb; }
}
/* .left-menu-box::-webkit-scrollbar-track {
/* .left-menu-box::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 10px; border-radius: 10px;
background: #EDEDED; background: #EDEDED;
} */ } */
@keyframes shouqidonghua { @keyframes shouqidonghua {
from { from {
width: 180px; width: 180px;
}
to {
width: 60px;
}
} }
.changeShowqidonghua { to {
animation: shouqidonghua 0.5s linear; width: 60px;
width: 60px !important;
overflow-x: hidden;
} }
}
@keyframes shouqidonghua { .changeShowqidonghua {
from { animation: shouqidonghua 0.5s linear;
width: 180px; width: 60px !important;
} overflow-x: hidden;
}
to { @keyframes shouqidonghua {
width: 60px; from {
} width: 180px;
} }
.changeShowqidonghua { to {
animation: shouqidonghua 0.5s linear; width: 60px;
width: 60px !important;
overflow-x: hidden;
} }
}
.wave_wrapper {
margin: 0px 20px 0px 0; .changeShowqidonghua {
width: 50px; animation: shouqidonghua 0.5s linear;
height: 50px; width: 60px !important;
position: relative; overflow-x: hidden;
display: flex; }
align-items: center;
justify-content: center; .wave_wrapper {
border-radius: 5px; margin: 0px 20px 0px 0;
cursor: pointer; width: 50px;
} height: 50px;
position: relative;
.wave_wrapper:hover { display: flex;
background-color: #f3f6f9; align-items: center;
justify-content: center;
border-radius: 5px;
cursor: pointer;
}
.wave_wrapper:hover {
background-color: #f3f6f9;
}
.wave_wrapper .dona {
position: absolute;
width: 50%;
height: 50%;
top: 25%;
left: 25%;
border: 1px solid var(--q-color-primary) !important;
border-radius: 50%;
z-index: 2;
}
.wave_wrapper span.wave_scale {
animation: wave_scale 2s both infinite;
}
@keyframes wave_scale {
0% {
transform: translate3d(-41px, -41px, 0px) scale(1, 1);
-webkit-transform: scale(1, 1);
opacity: 1;
} }
.wave_wrapper .dona { 50% {
position: absolute; transform: translate3d(-41px, -41px, 0px) scale(10, 10);
width: 50%; -webkit-transform: scale(2.5, 2.5);
height: 50%; opacity: 0;
top: 25%;
left: 25%;
border: 1px solid var(--q-color-primary) !important;
border-radius: 50%;
z-index: 2;
} }
.wave_wrapper span.wave_scale { 100% {
animation: wave_scale 2s both infinite; transform: translate3d(-41px, -41px, 0px) scale(1, 1);
-webkit-transform: scale(1, 1);
opacity: 0;
} }
}
@keyframes wave_scale {
0% {
transform: translate3d(-41px, -41px, 0px) scale(1, 1);
-webkit-transform: scale(1, 1);
opacity: 1;
}
50% {
transform: translate3d(-41px, -41px, 0px) scale(10, 10);
-webkit-transform: scale(2.5, 2.5);
opacity: 0;
}
100% {
transform: translate3d(-41px, -41px, 0px) scale(1, 1);
-webkit-transform: scale(1, 1);
opacity: 0;
}
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment