index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. <template>
  2. <el-container class="box-all" v-loading="loading">
  3. <el-header>
  4. <div class="flex-box" style="height: 60px;min-width: 1200px;">
  5. <div class="logo-box flex-box flex-center-center" @click="openHome()">
  6. <img src="./assets/image/logo.png" class="logo" />
  7. <div>功道云积分制</div>
  8. </div>
  9. <div class="flex-1 hea-right flex-box flex-v-ce" >
  10. <div class="name" style="min-width: 200px;">{{ info.name }}</div>
  11. <div class="flex-1 flex-box-ce font-flex-word" style="cursor: pointer;padding: 0 20px;">
  12. <template v-if="$supremeAuthority()=='dept_manager'||$supremeAuthority()=='employee'">
  13. <template v-if="information.name">
  14. <img src="./assets/image/tz.png" style="width: 18px;height: 18px;"/>
  15. <span style="max-width: 500px;padding-left: 10px;" class="font-flex-word" @click="$router.push({path:'inform'})">{{information.name}}</span>
  16. </template>
  17. </template>
  18. <div v-else class="flex-box-ce" >
  19. <img src="./assets/image/tz.png" style="width: 18px;height: 18px;"/>
  20. <template v-if="information.name">
  21. <span style="max-width: 500px;padding-left: 10px;" class="font-flex-word" @click="$router.push({path:'inform'})">{{information.name}}</span>
  22. </template>
  23. <span v-else style="padding: 0 10px;cursor: pointer;color: #606266;" @click="$router.push({path:'inform'})">暂无公告,点击此处添加公告</span>
  24. </div>
  25. </div>
  26. <div class="flex-box flex-v-ce">
  27. <el-popover placement="bottom" width="240" trigger="hover" v-if="$supremeAuthority()!='dept_manager'&&$supremeAuthority()!='employee'">
  28. <div class="popoverText">
  29. <div class="flex-box-ce"><span>当前使用版本:</span><i>{{ corpMessage.package_name|| '试用规格' }}</i></div>
  30. <div class="flex-box-ce"><span>到期时间:</span><i class="orange">{{ corpMessage.expire_time}}</i></div>
  31. <div class="flex-box-ce"><span>企业使用人数:</span><i class="blue">{{ corpMessage.user_count }}</i>/{{ corpMessage.user_count_max }}人</div>
  32. <div class="flex-box-end">
  33. <el-button size="small" @click="isTz = true" class="upgrade" type="primary" icon="el-icon-upload">续费升级</el-button>
  34. </div>
  35. </div>
  36. <div slot="reference" class="flex-box-ce megData" style="cursor: pointer;margin: 0 10px;">
  37. <div>{{ corpMessage.package_name|| '试用规格' }}</div>
  38. <!-- <div>{{ corpMessage.user_count }}人</div> -->
  39. </div>
  40. </el-popover>
  41. <el-popover
  42. v-if="!this.$authoritys('employee') && !this.$authoritys('dept_manager')"
  43. placement="bottom"
  44. class="popoverBox"
  45. width="60"
  46. v-model="visible"
  47. trigger="manual">
  48. <div style="text-align: center;">这里再次打开</div>
  49. <div slot="reference" @click="showWn" class="flex-box-ce btnWn">
  50. <i class="el-icon-tickets" style="font-size: 18px;margin-right: 5px;"></i>
  51. <span>新手引导</span>
  52. </div>
  53. </el-popover>
  54. <userImage :user_name="userData.name" :img_url="userData.img_url" width="44px" height="44px"></userImage>
  55. </div>
  56. </div>
  57. </div>
  58. </el-header>
  59. <el-container class="main">
  60. <el-aside>
  61. <el-menu :default-active="defaultActive" class="el-menu-vertical-demo" :router="true" @select="activeRouter" :unique-opened="true">
  62. <template v-for="(item, index) in routers">
  63. <div v-if="item.children.length != 0" :key="index">
  64. <template v-if="item.children.length >= 1 && item.title != '首页' && item.title != '复核'">
  65. <template v-if="item.title=='福利'">
  66. <el-submenu :index="index.toString()" :key="index" v-if="returnConfig">
  67. <template slot="title">
  68. <span class="iconfont titleIcon" :class="item.icon" style="font-size: 20px;"></span>
  69. <span style="margin-left: 5px;">{{ item.title }}</span>
  70. </template>
  71. <template v-for="(item2, index2) in item.children">
  72. <el-menu-item :index="returnIndex(index, index2)" :ref="item2.path" :route="item2.path" :key="index2" class="font-flex-word">
  73. <span slot="title" style="margin-left: 10px;width:120px">{{ item2.title }}</span>
  74. </el-menu-item>
  75. </template>
  76. </el-submenu>
  77. </template>
  78. <el-submenu :index="index.toString()" :key="index" v-else>
  79. <template slot="title">
  80. <span class="iconfont titleIcon" :class="item.icon" style="font-size: 20px;"></span>
  81. <span style="margin-left: 5px;">{{ item.title }}</span>
  82. </template>
  83. <template v-for="(item2, index2) in item.children">
  84. <el-menu-item :index="returnIndex(index, index2)" :ref="item2.path" :route="item2.path" :key="index2" class="font-flex-word">
  85. <span slot="title" style="margin-left: 10px;width:120px">{{ item2.title }}</span>
  86. </el-menu-item>
  87. </template>
  88. </el-submenu>
  89. </template>
  90. <template v-else>
  91. <template v-if="item.title=='复核'">
  92. <el-menu-item v-if="isShowReview" :index="returnIndex(index, index)" :route="item.children[0].path" :ref="item.children[0].path">
  93. <span class="iconfont titleIcon" :class="item.icon" style="font-size: 20px;"></span>
  94. <span slot="title" style="margin-left: 5px;">{{ item.children[0].title }}</span>
  95. </el-menu-item>
  96. </template>
  97. <el-menu-item v-else :index="returnIndex(index, index)" :route="item.children[0].path" :ref="item.children[0].path">
  98. <span class="iconfont titleIcon" :class="item.icon" style="font-size: 20px;"></span>
  99. <span slot="title" style="margin-left: 5px;">{{ item.children[0].title }}</span>
  100. </el-menu-item>
  101. </template>
  102. </div>
  103. </template>
  104. </el-menu>
  105. </el-aside>
  106. <el-main id="main">
  107. <keep-alive :include="keepAliveView"><router-view/></keep-alive>
  108. <div class="fontColorC" style="text-align: center;margin: 10px 0;">Copyright © {{$moment().format('YYYY')}} 广东功道云数字科技有限公司</div>
  109. </el-main>
  110. </el-container>
  111. <!-- 续费升级 -->
  112. <el-dialog title="续费升级" :visible.sync="isTz" width="400px">
  113. <div style="border-radius: 15px;border: 1px solid #f1f1f1;padding: 10px; width: 276px;box-sizing: border-box;margin: 0 auto;">
  114. <img src="./assets/image/code.png" />
  115. </div>
  116. <div class="fontColorC" style="text-align: center;margin-top: 15px;font-size: 18px;">手机钉钉扫码,付费升级</div>
  117. </el-dialog>
  118. <el-dialog :close-on-click-modal="false" title="轻松四步落地积分制" :visible.sync="wn_show" width="680px">
  119. <el-row :gutter="0" class="set_role_div" style="border-top:1px solid rgb(234 234 234);">
  120. <el-col :span="8" style="padding:20px 0 20px 0;">
  121. <el-menu default-active="0" style="border: none">
  122. <el-menu-item
  123. :index="index.toString()"
  124. v-for="(item, index) in activeName"
  125. :key="index"
  126. @click="open_right(item)"
  127. style="margin-bottom:20px;position: relative;height:40px;line-height:40px;"
  128. >
  129. <b style="display: inline-block;font-size:16px;text-align:center;">{{ index + 1 }}&nbsp;&nbsp;</b>
  130. <span slot="title" style="padding-left: 10px;">{{ item.name }}</span>
  131. <span v-if="index < activeName.length - 1" style="width:1px;height:15px;border:1px solid rgb(224 224 224);position: absolute;bottom:-17px;left:23px;"></span>
  132. </el-menu-item>
  133. </el-menu>
  134. </el-col>
  135. <el-col :span="1" style="height:370px;border-right:1px solid rgb(234 234 234);"></el-col>
  136. <el-col :span="15" style="padding:20px 0 20px 0;">
  137. <div>
  138. <el-row>
  139. <div style="text-align:center;margin-top:25px;color: #35353a;font-size:16px;">{{ activeNameRig.name }}</div>
  140. <div
  141. v-if="activeNameRig.code == '0' || activeNameRig.code == '1'"
  142. :style="'display:flex;justify-content: space-around;margin:75px auto 0;width:' + usingwidth + 'px;flex-wrap:wrap;'"
  143. >
  144. <div v-for="(item, index) in activeNameRig.item" :key="index">
  145. <div style="text-align:center;display:flex;">
  146. <div @click="strategyClick(item.push)" style="cursor: pointer;">
  147. <img :src="item.image" alt="" style="width:50px;" />
  148. <p style="margin:0;padding:0;padding-top:10px;">{{ item.name }}</p>
  149. <p style="margin:0;padding:0;font-size:13px;color:#2ba5ec;padding-top:8px;cursor: pointer;">{{ item.conf }}</p>
  150. </div>
  151. <i class="el-icon-right" :style="'font-size:30px;margin-top:57px;margin-left:' + usingmarginL + 'px;'"
  152. v-if="index < activeNameRig.item.length - 1" />
  153. </div>
  154. </div>
  155. </div>
  156. <div v-if="activeNameRig.code == '2'" :style="'display:flex;justify-content: space-around;margin:20px auto 0;width:' + usingwidth + 'px;flex-wrap:wrap;'">
  157. <el-col :span="14"
  158. style="display:flex;flex-wrap:wrap;justify-content: space-around;text-align:center;margin-left:20px;position: relative;"
  159. >
  160. <i class="el-icon-plus" style="font-size:30px;position: absolute;top:45%;" />
  161. <div v-for="(item, index) in activeNameRig.item" :key="index" style="width:49%;margin-top:60px;">
  162. <div style="cursor: pointer;" v-if="index != 2" @click="strategyClick(item.push)">
  163. <img :src="item.image" alt="" style="width:50px;" />
  164. <p style="margin:0;padding:0;padding-top:10px;">{{ item.name }}</p>
  165. <p style="margin:0;padding:0;font-size:13px;color:#2ba5ec;padding-top:8px;cursor: pointer;">{{ item.conf }}</p>
  166. </div>
  167. </div>
  168. </el-col>
  169. <el-col :span="8" v-if="activeNameRig.code == '2'">
  170. <div v-for="(item, index) in activeNameRig.item" :key="index">
  171. <div style="text-align:center;display:flex;margin-top:60px;" v-if="index == 2">
  172. <i class="el-icon-right" style="font-size:30px;margin-top:57px;" />
  173. <div style="margin-left:25px;cursor: pointer;" @click="strategyClick(item.push)">
  174. <img :src="item.image" alt="" style="width:50px;" />
  175. <p style="margin:0;padding:0;padding-top:10px;">{{ item.name }}</p>
  176. <p style="margin:0;padding:0;font-size:13px;color:#2ba5ec;padding-top:8px;cursor: pointer;">{{ item.conf }}</p>
  177. </div>
  178. </div>
  179. </div>
  180. </el-col>
  181. </div>
  182. <div v-if="activeNameRig.code == '3'" :style="'display:flex;justify-content: space-around;margin:20px auto 0;width:' + usingwidth + 'px;flex-wrap:wrap;'">
  183. <el-col :span="24"
  184. style="display:flex;flex-wrap:wrap;justify-content: space-around;text-align:center;margin-left:20px;position: relative;"
  185. >
  186. <i class="el-icon-plus" style="font-size:30px;position: absolute;top:45%;" />
  187. <div v-for="(item, index) in activeNameRig.item" :key="index" style="width:49%;margin-top:20px;">
  188. <div style="cursor: pointer;" v-if="index != 4" @click="strategyClick(item.push)">
  189. <img :src="item.image" alt="" style="width:50px;" />
  190. <p style="margin:0;padding:0;padding-top:10px;">{{ item.name }}</p>
  191. <p style="margin:0;padding:0;font-size:13px;color:#2ba5ec;padding-top:8px;cursor: pointer;">{{ item.conf }}</p>
  192. </div>
  193. </div>
  194. </el-col>
  195. <el-col :span="8" v-if="activeNameRig.code == '2'">
  196. <div v-for="(item, index) in activeNameRig.item" :key="index">
  197. <div style="text-align:center;display:flex;margin-top:60px;" v-if="index == 4">
  198. <i class="el-icon-right" style="font-size:30px;margin-top:57px;" />
  199. <div style="margin-left:25px;cursor: pointer;" @click="strategyClick(item.push)">
  200. <img :src="item.image" alt="" style="width:50px;" />
  201. <p style="margin:0;padding:0;padding-top:10px;">{{ item.name }}</p>
  202. <p style="margin:0;padding:0;font-size:13px;color:#2ba5ec;padding-top:8px;cursor: pointer;">{{ item.conf }}</p>
  203. </div>
  204. </div>
  205. </div>
  206. </el-col>
  207. </div>
  208. </el-row>
  209. </div>
  210. </el-col>
  211. </el-row>
  212. </el-dialog>
  213. <el-dialog title="温馨提示" :visible.sync="isShowDate" width="400px" top="30vh">
  214. <template #title>
  215. <div style="font-weight: 600;font-size: 18px;margin-bottom: 10px;" class="black"><i class="el-icon-warning orange"></i> 系统即将到期</div>
  216. </template>
  217. <div style="margin-bottom: 20px;position: relative;top:-20px">
  218. <!-- <div style="font-weight: 600;font-size: 18px;margin-bottom: 10px;" class="black"><i class="el-icon-warning orange"></i> 系统即将到期</div> -->
  219. <div>
  220. 尊敬的【{{ info.name }}】用户!距离贵司开通的“功道云积分制”使用结束只剩下<span class="red">90</span>天,到期时间 {{ corpMessage.expire_time}} 00:00。
  221. 为避免使用期结束给您带来不便,请在钉钉手机端应用市场或点击下方【续费/升级】按钮进行续费升级。
  222. 如有任何问题,请联系客服或拨打电话400-6877-880进行咨询
  223. </div>
  224. </div>
  225. <div class="flex-box-ce flex-d-center">
  226. <div class="blue" @click="bundleOfServices">联系客服</div>
  227. <div class="flex-box-ce">
  228. <el-button size="small" @click="isShowDate=false">取消</el-button>
  229. <el-button size="small" @click="isTz = true" class="upgrade" type="primary" icon="el-icon-upload">续费升级</el-button>
  230. </div>
  231. </div>
  232. </el-dialog>
  233. </el-container>
  234. </template>
  235. <script>
  236. import { createSocket,sendWSPush,sendPing } from './api/websocket'
  237. import { removeCache } from './api/auth'
  238. export default {
  239. data() {
  240. return {
  241. loading: false,
  242. userData: {},
  243. routers: [],
  244. info: {},
  245. wn_show: false,
  246. defaultActive: '0-0',
  247. isTz: false,
  248. direction: 'rtl',
  249. corpMessage: {} ,//企业套餐信息
  250. information:{name:''},
  251. usingmarginL: '26',
  252. usingwidth: '220',
  253. activeNameRig: {
  254. name: '员工积极参与,管理者权责分明',
  255. code: '0',
  256. item: [
  257. { image: require('./assets/image/guild_dept_pic.png'), name: '组织架构', conf: '去配置', push: '/framework' },
  258. { image: require('./assets/image/role_manage.png'), name: '角色权限', conf: '去配置', push: '/jurisdiction' }
  259. ]
  260. },
  261. activeName: [
  262. { name: '完善部门人员信息及授权', code: '0' },
  263. { name: '建立积分奖扣制度', code: '1' },
  264. { name: '积分执行与实施', code: '2' },
  265. { name: '积分排名统计与分析', code: '3' }
  266. ],
  267. visible:false,
  268. keepAliveView:['dept_rank','total_rank','custom_rank','manager_statistics'], //需要缓存的组件名称列表,用逗号分隔
  269. keepAliveView2:['dept_rank','total_rank','custom_rank','manager_statistics'], //需要缓存的组件名称列表,用逗号分隔
  270. isShowDate:false,
  271. };
  272. },
  273. watch: {
  274. wn_show(val){
  275. if(!val){
  276. this.visible=true;
  277. setTimeout(()=>{
  278. this.visible=false;
  279. },3000)
  280. }
  281. },
  282. $route(to, from) {
  283. // 缓存页面,达到缓存页面条件的效果
  284. if(to.name=='dept_rank'&&from.name!='JfDetail'){//首页
  285. this.returnArr('dept_rank')
  286. }else if(to.name=='total_rank'&&from.name!='JfDetail'){//我管理的-更多
  287. this.returnArr('total_rank')
  288. }else if(to.name=='custom_rank'&&from.name!='JfDetail'){//我评分的-更多
  289. this.returnArr('custom_rank')
  290. }else if(to.name=='manager_statistics'&&from.name!='integral_event_two'){//考核管理
  291. this.returnArr('manager_statistics')
  292. }else{
  293. this.keepAliveView=JSON.parse(JSON.stringify(this.keepAliveView2));
  294. }
  295. var str = to.path;
  296. this.routers.map((item, index) => {
  297. if (item.children.length > 0) {
  298. item.children.map((item2, index2) => {
  299. if (item2.path == str) {
  300. this.defaultActive = index + '-' + index2;
  301. this.$setCache('path', index + '-' + index2);
  302. }
  303. });
  304. }
  305. });
  306. if(this.$getCache('inform')){
  307. this.getInform()
  308. removeCache('inform')
  309. }
  310. }
  311. },
  312. computed:{
  313. isShowReview(){
  314. if(this.$getIsCreator('creator')){
  315. return true
  316. }
  317. let is=false;
  318. let supremeAuthority=this.$supremeAuthority();
  319. if(this.$store.getters.config.event_special){
  320. if(this.$store.getters.config.event_review_manager==1){
  321. if(supremeAuthority=='admin'||supremeAuthority=='point_manager'){
  322. is=true;
  323. }
  324. }else{
  325. let event_special=this.$store.getters.config.event_special;
  326. if(event_special.length>0){
  327. let ids=event_special.map(e=> e.id);
  328. is=ids.indexOf(this.$getUserData().id)!=-1
  329. }else{
  330. is=false;
  331. }
  332. }
  333. }
  334. return is;
  335. },
  336. returnConfig(){
  337. return this.$store.getters.config.shop_status==1;
  338. }
  339. },
  340. created() {
  341. this.cheakAx();
  342. this.initRouter();
  343. this.getEmployee()//缓存人员列表
  344. this.getInform();
  345. },
  346. mounted() {
  347. this.$setCache('isUrl',false)//清楚代办进入
  348. this.getInfo();
  349. var url = window.location.href;
  350. var str = this.GetRequest(url).corpId || 'ding49b5c3bf0b205896bc961a6cb783455b';
  351. var corpId = str.split('#')[0];
  352. if (corpId) {
  353. this.getCorp(corpId);
  354. }
  355. this.$nextTick(function() {
  356. if (!this.$authoritys('employee') && !this.$authoritys('dept_manager')) {
  357. if (this.$getCache('wn_show')) {
  358. this.wn_show = false;
  359. } else {
  360. this.wn_show = true;
  361. this.$setCache('wn_show', 'true');
  362. }
  363. }
  364. });
  365. },
  366. methods: {
  367. subscribe() {
  368. openSubscribeMiniApp({
  369. panelHeight: 'percent40',
  370. path: 'pages/index/index',
  371. float: true,
  372. extraData: {
  373. clientId: '<!-- 小程序的appId -->',
  374. authToken: ' <!-- 通过前述获取授权ID方式获取 -->',
  375. },
  376. options:{}
  377. });
  378. },
  379. bundleOfServices(){
  380. this.$dd.biz.util.openSlidePanel({
  381. url:"https://page.dingtalk.com/wow/dingtalk/act/serviceconversation?wh_biz=tm&showmenu=false&goodsCode=DT_GOODS_881607043109331&corpId="+this.$getCache('corpId')+"&token=5784a3e6b5e025ee891517ea814180f4",
  382. title: '客服群',
  383. onSuccess : function(result) {},
  384. onFail : function(err) {
  385. console.log('onFail')
  386. }
  387. })
  388. },
  389. returnArr(str){
  390. this.keepAliveView=this.keepAliveView.filter(item=>{
  391. return item!=str;
  392. })
  393. setTimeout(()=>{
  394. this.keepAliveView=JSON.parse(JSON.stringify(this.keepAliveView2));
  395. },1000)
  396. },
  397. strategyClick(item) {
  398. this.wn_show = false;
  399. this.$router.push({ path: item });
  400. },
  401. open_right(item) {
  402. if (item.code == '0') {
  403. this.usingmarginL = '26';
  404. this.usingwidth = '220';
  405. this.activeNameRig = {
  406. name: '员工积极参与,管理者权责分明',
  407. code: '0',
  408. item: [
  409. { image: require('./assets/image/guild_dept_pic.png'), name: '组织架构', conf: '去配置', push: '/framework' },
  410. { image: require('./assets/image/role_manage.png'), name: '角色权限', conf: '去配置', push: '/jurisdiction' }
  411. ]
  412. };
  413. } else if (item.code == '1') {
  414. this.usingmarginL = '14';
  415. this.usingwidth = '300';
  416. this.activeNameRig = {
  417. name: '健全企业规章制度,建立公平的奖扣分体系',
  418. code: '1',
  419. item: [
  420. { image: require('./assets/image/rule.png'), name: '积分规则', conf: '去配置', push: '/rule' },
  421. { image: require('./assets/image/length_point.png'), name: '系统配置', conf: '去配置', push: '/systemLayout' },
  422. { image: require('./assets/image/base_point.png'), name: '自动积分', conf: '去配置', push: '/voluntarilyPoint' }
  423. ]
  424. };
  425. } else if (item.code == '2') {
  426. this.usingwidth = '380';
  427. this.activeNameRig = {
  428. name: '员工积极挣分,管理者奖罚分明',
  429. code: '2',
  430. item: [
  431. { image: require('./assets/image/entry_list.png'), name: '奖分/扣分', conf: '去奖扣', push: '/award_punish' },
  432. { image: require('./assets/image/my_publish.png'), name: '任务', conf: '去发布', push: '/my_issue' },
  433. { image: require('./assets/image/att_review.png'), name: '审批打分', conf: '去审批', push: '/approval_list' }
  434. ]
  435. };
  436. } else if (item.code == '3') {
  437. this.usingwidth = '380';
  438. this.activeNameRig = {
  439. name: '提高管理执行力,让优秀员工不吃亏',
  440. code: '3',
  441. item: [
  442. { image: require('./assets/image/add_ticket.png'), name: '积分排名', conf: '去查看', push: '/dept_rank' },
  443. { image: require('./assets/image/role_manage.png'), name: '管理者执行力', conf: '去查看', push: '/manager_statistics' },
  444. { image: require('./assets/image/data_team.png'), name: '部门分析', conf: '去查看', push: '/department_statistics' },
  445. { image: require('./assets/image/length_point.png'), name: '个人分析', conf: '去查看', push: '/individual_statistics' }
  446. ]
  447. };
  448. }
  449. },
  450. openWebSocket(){
  451. // 接收消息
  452. const getsocketData = e => { // 创建接收消息函数
  453. const data = e && e.detail.data
  454. }
  455. // 注册监听事件
  456. window.addEventListener('onmessageWS', getsocketData)
  457. // 在需要的时候卸载监听事件,比如离开页面
  458. window.removeEventListener('onmessageWS', getsocketData)
  459. },
  460. getInform(){
  461. let params = {
  462. page: 1,
  463. page_size: 1
  464. };
  465. this.$axios('get', '/api/information/index', params).then(res => {
  466. if (res.data.code == 1) {
  467. let data= res.data.data;
  468. if(data[0]){
  469. this.information=data[0]
  470. }else{
  471. this.information={name:''};
  472. }
  473. }
  474. });
  475. },
  476. async cheakAx(name) {
  477. await this.$axios('get', '/api/integral/site/config').then(res => {
  478. this.$store.dispatch('setConfig', res.data.data);
  479. })
  480. },
  481. initRouter() {
  482. this.routers = [
  483. { title: '首页', children: this.returnRoutersArr('home'), icon: 'icon-shouye' },
  484. { title: 'A/B分', children: this.returnRoutersArr('abPoint'), icon: 'icon-PC_gongzuotai_ABfen' },
  485. { title: '任务', children: this.returnRoutersArr('task'), icon: 'icon-kaoqin_kaoqinyuebaobiao' },
  486. // { title: '复核', children: this.returnRoutersArr('review'), icon: 'icon-jiedianyanshou-1' },
  487. { title: '复核', children: this.returnRoutersArr('integral_review'), icon: 'icon-jiedianyanshou-1' },
  488. { title: '统计', children: this.returnRoutersArr('ranking'), icon: 'icon-dingdingPC_tongji1' },
  489. { title: '奖票', children: this.returnRoutersArr('award'), icon: 'icon-piao' },
  490. ];
  491. //this.$authoritys('权限名') 判断权限
  492. if (this.$authoritys('creator') || this.$authoritys('admin') || this.$authoritys('point_manager') || this.$authoritys('dept_manager')) {
  493. this.routers.splice(3, 0, { title: '审批', children: this.returnRoutersArr('workbench'), icon: 'icon-shezhi_jifenguize' });
  494. }
  495. if (this.$authoritys('creator') || this.$authoritys('admin') || this.$authoritys('point_manager')) {
  496. this.routers.push({ title: '福利', children: this.returnRoutersArr('welfare'), icon: 'icon-fulizhongxin'});
  497. this.routers.push({ title: '设置', children: this.returnRoutersArr('set'), icon: 'icon-dingdingPC_shezhi1' });
  498. }
  499. //this.returnRoutersArr('set',true) 加true表示不限制路由
  500. this.userData = this.$getUserData();
  501. if (this.$route.path != '/home') {
  502. //当刷新页面是控制左边导航栏的选中
  503. this.defaultActive = this.$getCache('path');
  504. }
  505. },
  506. openHome() {
  507. this.$router.push({ path: '/home' });
  508. },
  509. GetRequest(urlStr) {
  510. if (typeof urlStr == 'undefined') {
  511. var url = decodeURI(location.search); //获取url中"?"符后的字符串
  512. } else {
  513. var url = '?' + urlStr.split('?')[1];
  514. }
  515. var theRequest = new Object();
  516. var strs;
  517. if (url.indexOf('?') != -1) {
  518. var str = url.substr(1);
  519. strs = str.split('&');
  520. for (var i = 0; i < strs.length; i++) {
  521. theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
  522. }
  523. }
  524. return theRequest;
  525. },
  526. //获取套餐信息
  527. getCorp(corpId) {
  528. this.$axios('get', 'api/order/corp', { corp_id: corpId }).then(res => {
  529. this.corpMessage = res.data.data;
  530. });
  531. },
  532. //当刷新页面是控制左边导航栏的选中
  533. activeRouter(index, indexPath) {
  534. this.$setCache('path', indexPath[1] ? indexPath[1] : indexPath[0]);
  535. },
  536. routerAstrict(data) {
  537. //限制路由
  538. let obj = [];
  539. let supAuthority = this.$supremeAuthority(); //$supremeAuthority获取当前登录者的最高权限
  540. data.forEach(item => {
  541. if (!item.hidden) {
  542. if (!item.meta.jurisdiction) {
  543. obj.push(item);
  544. } else {
  545. if (item.meta.jurisdiction.indexOf(supAuthority) == -1) {
  546. obj.push(item);
  547. }
  548. }
  549. }
  550. });
  551. return obj;
  552. },
  553. returnRoutersArr(str, bool) {
  554. var routers = this.$router.options.routes[0].children;
  555. var routersArr = [];
  556. routers.forEach(item => {
  557. if (item.meta.groupCode == str&&!item.meta.noShow) {
  558. //获取对应模块的路由
  559. routersArr.push(item);
  560. }
  561. });
  562. if (bool) {
  563. return routersArr;
  564. }
  565. return this.routerAstrict(routersArr);
  566. },
  567. returnIndex(str, str2) {
  568. return str + '-' + str2;
  569. },
  570. showWn() {
  571. this.wn_show = true;
  572. },
  573. getInfo() {
  574. var that = this;
  575. this.$axios('get', '/api/site/info').then(res => {
  576. that.info = res.data.data;
  577. });
  578. },
  579. //获取员工列表
  580. getEmployee() {
  581. this.$axios('get', '/api/employee/index', { dept_id: 0, page: 1, page_size: 3000,is_official:1 }).then(res => {
  582. let map={};
  583. res.data.data.list.map(item=>{
  584. map[item.id]=item
  585. })
  586. this.$setCache("userList",map)
  587. })
  588. },
  589. },
  590. };
  591. </script>
  592. <style scoped="scoped" lang="scss">
  593. .diy_tip_bg2 {
  594. background: #f5f6f9;
  595. overflow: hidden;
  596. .diy-tip2 {
  597. margin-bottom: 15px;
  598. border: 1px solid #67c23a;
  599. padding: 20px 16px;
  600. p {
  601. color: #67c23a !important;
  602. font-size: 14px;
  603. margin: 0 !important;
  604. padding: 4px 0;
  605. }
  606. }
  607. }
  608. .popoverText span{
  609. width: 100px;
  610. display: block;
  611. }
  612. .popoverText{
  613. line-height: 30px;
  614. font-size: 14px;
  615. }
  616. .megData div:nth-child(1) {
  617. background-image: linear-gradient(to bottom, #5e6e9b 0%, #232d48 100%);
  618. text-align: center;
  619. color: #e1bf66;
  620. border-radius: 25px;
  621. // border-top-left-radius: 25px;
  622. // border-bottom-left-radius: 25px;
  623. line-height: 35px;
  624. height: 35px;
  625. padding: 0 10px;
  626. }
  627. .megData div:nth-child(2) {
  628. background-image: linear-gradient(to bottom, #ffeab2 0%, #e1bf66 100%);
  629. text-align: center;
  630. color: #232d48;
  631. border-top-right-radius: 25px;
  632. border-bottom-right-radius: 25px;
  633. line-height: 35px;
  634. height: 35px;
  635. padding: 0 10px;
  636. }
  637. .wn-box {
  638. padding: 20px 0;
  639. }
  640. .wn-box .flex-1 {
  641. cursor: pointer;
  642. }
  643. .wn-box .flex-1 div:nth-child(1) {
  644. width: 55px;
  645. height: 55px;
  646. border-radius: 50%;
  647. text-align: center;
  648. line-height: 55px;
  649. background-color: #e0f2ff;
  650. color: #26a2ff;
  651. margin-bottom: 20px;
  652. }
  653. .wn-box .flex-1 div:nth-child(2) {
  654. width: 110px;
  655. border-radius: 25px;
  656. border: 1px solid #26a2ff;
  657. padding: 7px 10px;
  658. text-align: center;
  659. color: #26a2ff;
  660. }
  661. .wn-box .flex-1:hover div:nth-child(1) {
  662. color: #fff;
  663. background-color: #26a2ff;
  664. }
  665. .wn-box .flex-1:hover div:nth-child(2) {
  666. color: #fff;
  667. background-color: #26a2ff;
  668. }
  669. .el-menu-vertical-demo:not(.el-menu--collapse) {
  670. width: 180px;
  671. // min-height: 400px;
  672. }
  673. .el-header {
  674. background-color: #fff;
  675. // line-height: 60px;
  676. padding: 0 !important;
  677. border-bottom: 1px solid #f1f1f1;
  678. }
  679. .el-menu {
  680. overflow: hidden;
  681. border: none;
  682. }
  683. .el-aside {
  684. transition: width 0.28s;
  685. width: 180px !important;
  686. background-color: #fff;
  687. height: calc(100vh - 60px);
  688. }
  689. .el-aside::-webkit-scrollbar {
  690. width: 0px;
  691. background-color: #fff;
  692. }
  693. .el-aside::-webkit-scrollbar-thumb {
  694. background-color: #ccc;
  695. }
  696. .con_nav_left {
  697. background: #fff;
  698. overflow-y: scroll;
  699. }
  700. .box-all {
  701. height: 100%;
  702. overflow: hidden;
  703. }
  704. .el-main {
  705. background-color: #f4f6f9;
  706. height: calc(100vh - 60px);
  707. overflow-y: scroll;
  708. padding: 10px;
  709. min-width: 1000px;
  710. }
  711. .el-main::-webkit-scrollbar {
  712. width: 10px;
  713. height: 10px;
  714. background-color: #fff;
  715. }
  716. .el-main::-webkit-scrollbar-thumb {
  717. background-color: #ccc;
  718. }
  719. .logo-box {
  720. width: 180px;
  721. cursor: pointer;
  722. }
  723. .logo-box .logo {
  724. width: 30px;
  725. height: 30px;
  726. margin-right: 5px;
  727. border-radius: 6px;
  728. }
  729. .logo-box div {
  730. font-size: 16px;
  731. font-weight: 600;
  732. }
  733. .wn {
  734. height: 26px;
  735. width: 26px;
  736. margin-right: 5px;
  737. cursor: pointer;
  738. }
  739. .hea-right {
  740. padding: 0 20px;
  741. }
  742. .btnWn{
  743. cursor: pointer;
  744. border: 1px solid #ccc;
  745. border-radius: 4px;
  746. padding: 7px 10px;
  747. margin-right: 10px;
  748. background-color: #409eff;
  749. border-color: #409eff;
  750. color: #fff;
  751. }
  752. .upgrade {
  753. // margin-left: 10px;
  754. // margin-right: 10px;
  755. }
  756. ::v-deep .el-menu-item {
  757. padding-right: 10px !important;
  758. }
  759. ::v-deep .el-menu-item.is-active {
  760. color: #26a2ff;
  761. background-color: #ecf5ff;
  762. }
  763. .popoverBox {
  764. // background-color: #232d48;
  765. }
  766. </style>