Home.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. <template>
  2. <el-row class="container">
  3. <el-col :span="24" class="header">
  4. <el-col :span="10" class="logo" :class="collapsed?'logo-collapse-width':'logo-width'" :style="collapsed?'padding:0':''">
  5. <img v-if="collapsed" class="headImg" src="../assets/image/head_logo.png" />
  6. <div v-else class="logo-sys">
  7. <img class="headImg" src="../assets/image/head_logo.png" />
  8. <span>{{$t('workingHoursHousekeeper')}}</span>
  9. </div>
  10. </el-col>
  11. <el-col :span="4">
  12. <div class="tools" @click.prevent="collapse" style="position: relative;">
  13. <i class="fa fa-align-justify"></i>
  14. <span style="position: absolute;width: 350px;left: 60px;">
  15. <span v-if="user.userNameNeedTranslate == '0'">{{user.companyName}}</span>
  16. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='user.companyName'></ww-open-data></span>
  17. </span>
  18. </div>
  19. </el-col>
  20. <el-col :span="10" class="userinfo">
  21. <!-- 中英文切换入口 -->
  22. <!-- <el-dropdown trigger="click" @command="langChange" style="margin-right:30px;">
  23. <span class="el-dropdown-link userinfo-inner">
  24. {{language}} <i class="el-icon-caret-bottom"></i>
  25. </span>
  26. <el-dropdown-menu slot="dropdown">
  27. <el-dropdown-item divided command="zh">中文</el-dropdown-item>
  28. <el-dropdown-item divided command="en">English</el-dropdown-item>
  29. </el-dropdown-menu>
  30. </el-dropdown> -->
  31. <el-dropdown trigger="hover" style="margin-right:30px;">
  32. <span class="el-dropdown-link userinfo-inner">
  33. <i class="el-icon-user" style="font-size:18px" ></i>
  34. {{$t('other.customerService')}}
  35. </span>
  36. <el-dropdown-menu slot="dropdown">
  37. <el-dropdown-item >
  38. <div>
  39. <div>{{$t('other.sweepWeChatYards')}}</div>
  40. <img
  41. style="width: 120px; height: 120px"
  42. src="../assets/image/code.jpg" />
  43. </div>
  44. </el-dropdown-item>
  45. </el-dropdown-menu>
  46. </el-dropdown>
  47. {{$t('time.dueDate')}}:{{remainingTime}}
  48. <el-badge class="itemNew" :value="num" :hidden="num == 0">
  49. <i class="el-icon-message-solid" style="font-size:24px" v-popover:popover1 @click="drawer = true"></i>
  50. </el-badge>
  51. <el-drawer :title="$t('other.messageCenter')" :visible.sync="drawer" direction="rtl" :with-header="false" size="35%">
  52. <el-table :data="popoverData" :height="tableHeight" size="small">
  53. <el-table-column property="type" :label="$t('other.messageContent')" align="left">
  54. <template slot-scope="scope">
  55. <el-link type="primary" :underline="false" @click="locationHerf(scope.row.id,scope.row.content, scope.row.type)">
  56. <span style="font-size:13px;">{{scope.row.msg==null?msgTypeTxt[scope.row.type]:scope.row.msg}}</span>
  57. </el-link>
  58. </template>
  59. </el-table-column>
  60. <el-table-column property="type" :label="$t('state.states')" align="center" width="60">
  61. <template slot-scope="scope">
  62. <span v-if="scope.row.checked == 0" style="color:red">{{$t('other.unread')}}</span>
  63. <span v-else style="color:green">{{$t('other.read')}}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column property="time" :label="$t('time.times')" align="center" width="120"></el-table-column>
  67. </el-table>
  68. </el-drawer>
  69. <el-dropdown trigger="hover" style="margin-left:10px;">
  70. <span class="el-dropdown-link userinfo-inner">
  71. <img src="../assets/image/userHead.png" />
  72. {{sysUserName}}
  73. </span>
  74. <el-dropdown-menu slot="dropdown">
  75. <!-- <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-view" ></i>{{roleArray[user.role]}}</span></el-dropdown-item> -->
  76. <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-view" ></i>{{user.roleName}}</span></el-dropdown-item>
  77. <el-dropdown-item @click.native="reset">{{$t('other.changeThePassword')}}</el-dropdown-item>
  78. <!-- <el-dropdown-item @click.native="editInfoOpen">修改信息</el-dropdown-item> -->
  79. <el-dropdown-item divided @click.native="logout">{{$t('other.launchTheLogin')}}</el-dropdown-item>
  80. </el-dropdown-menu>
  81. </el-dropdown>
  82. </el-col>
  83. </el-col>
  84. <el-col :span="24" class="main">
  85. <aside :class="collapsed?'menu-collapsed':'menu-expanded'">
  86. <el-scrollbar style="height:100%">
  87. <!--导航菜单-->
  88. <el-menu :default-active="$route.path" class="el-menu-vertical-demo" unique-opened router v-if="!collapsed">
  89. <template v-for="(item, index) in $router.options.routes" v-if="!item.hidden">
  90. <el-submenu :index="index+''" v-if="!item.leaf">
  91. <template slot="title">
  92. <i :class="item.iconCls"></i>
  93. <!-- <span class="itemName">{{item.name}}</span> -->
  94. <span class="itemName bosx" v-if="$t(item.meta.text).length < 16">{{$t(item.meta.text)}}</span>
  95. <el-tooltip class="itemName bosx" v-if="$t(item.meta.text).length > 16" effect="dark" :content="$t(item.meta.text)" placement="top">
  96. <span>{{$t(item.meta.text)}}</span>
  97. </el-tooltip>
  98. </template>
  99. <el-menu-item v-for="child in item.children" :index="child.path" :key="child.path" v-if="!child.hidden"><i :class="child.iconCls"></i>
  100. <!-- {{child.name}} -->
  101. <span class="bosx" v-if="$t(child.meta.text).length < 16">{{$t(child.meta.text)}}</span>
  102. <el-tooltip class="bosx" v-if="$t(child.meta.text).length > 16" effect="dark" :content="$t(child.meta.text)" placement="top">
  103. <span>{{$t(child.meta.text)}}</span>
  104. </el-tooltip>
  105. </el-menu-item>
  106. </el-submenu>
  107. <el-menu-item v-if="item.leaf && item.children.length > 0" :index="item.children[0].path">
  108. <i :class="item.iconCls"></i>
  109. <!-- {{item.children[0].name}} -->
  110. <span class="bosx" v-if="$t(item.meta.text).length < 16">{{$t(item.meta.text)}}</span>
  111. <el-tooltip class="itemName bosx" v-if="$t(item.meta.text).length > 16" effect="dark" :content="$t(item.meta.text)" placement="top">
  112. <span>{{$t(item.meta.text)}}</span>
  113. </el-tooltip>
  114. <!-- {{$t('navigation.reports')}} -->
  115. <!-- this.$t('navigation.reports')  // js-->
  116. </el-menu-item>
  117. </template>
  118. </el-menu>
  119. <!--导航菜单-折叠后-->
  120. <ul class="el-menu el-menu-vertical-demo collapsed" v-if="collapsed" ref="menuCollapsed">
  121. <li v-for="(item,index) in $router.options.routes" v-if="!item.hidden" class="el-submenu item" :style="{overflow:!item.leaf?'':'hidden'}">
  122. <template v-if="!item.leaf">
  123. <div class="el-submenu__title" style="padding-left: 20px;" @mouseover="showMenu(index,true)" @mouseout="showMenu(index,false)">
  124. <i :class="item.iconCls"></i>
  125. </div>
  126. <ul class="el-menu submenu" :class="'submenu-hook-'+index" @mouseover="showMenu(index,true)" @mouseout="showMenu(index,false)">
  127. <li v-for="child in item.children" v-if="!child.hidden" :key="child.path" class="el-menu-item" style="padding-left: 40px;" :class="$route.path==child.path?'is-active':''" @click="$router.push(child.path)">
  128. {{child.name}}
  129. </li>
  130. </ul>
  131. </template>
  132. <template v-else>
  133. <li class="el-submenu">
  134. <div class="el-submenu__title el-menu-item" :class="$route.path==item.children[0].path?'is-active':''" @click="$router.push(item.children[0].path)"
  135. style="padding-left: 20px;height: 56px;line-height: 56px;padding: 0 20px;">
  136. <i :class="item.iconCls"></i>
  137. </div>
  138. </li>
  139. </template>
  140. </li>
  141. </ul>
  142. </el-scrollbar>
  143. </aside>
  144. <section class="content-container">
  145. <div class="grid-content bg-purple-light">
  146. <el-col :span="24" class="content-wrapper">
  147. <transition name="fade" mode="out-in">
  148. <router-view></router-view>
  149. </transition>
  150. </el-col>
  151. </div>
  152. <!--修改密码-->
  153. <el-dialog :title="$t('other.changeThePassword')" width='450px' v-if="editPassWord" :visible.sync="editPassWord" :close-on-click-modal="false" customClass="customWidth">
  154. <el-form :model="addForm" label-width="auto" :rules="passRule" ref="addForm">
  155. <el-form-item :label="$t('lable.originalPassword')" prop="originPassword">
  156. <el-input v-model="addForm.originPassword" autocomplete="off" :placeholder="$t('defaultText.pleaseEnterTheOldPassword')" show-password></el-input>
  157. </el-form-item>
  158. <el-form-item :label="$t('lable.newPassword')" prop="newPassword">
  159. <el-input v-model="addForm.newPassword" autocomplete="off" :placeholder="$t('defaultText.pleaseEnterTheNewPassword')" show-password></el-input>
  160. </el-form-item>
  161. </el-form>
  162. <div slot="footer" class="dialog-footer">
  163. <el-button @click.native="editPassWord = false">{{$t('btn.cancel')}}</el-button>
  164. <el-button type="primary" @click.native="resetPwd" :loading="editLoading">{{$t('btn.submit')}}</el-button>
  165. </div>
  166. </el-dialog>
  167. <!--修改信息-->
  168. <el-dialog :title="$t('title.modifyTheInformation')" width='450px' v-if="editInformation" :visible.sync="editInformation" :close-on-click-modal="false" customClass="customWidth">
  169. <el-form :model="editInfoForm" label-width="auto" :rules="passRule" ref="editInfoForm">
  170. <el-form-item :label="$t('lable.name')" prop="username">
  171. <el-input v-model="editInfoForm.username" autocomplete="off" :placeholder="$t('defaultText.PleaseEnterYourName')"></el-input>
  172. </el-form-item>
  173. </el-form>
  174. <el-form :model="editInfoForm" label-width="auto" :rules="passRule" ref="editInfoForm">
  175. <el-form-item :label="$t('lable.phone')" prop="mobile">
  176. <el-input v-model="editInfoForm.mobile" autocomplete="off" :placeholder="$t('defaultText.PleaseEnterYourPhone')" :disabled="true"></el-input>
  177. </el-form-item>
  178. </el-form>
  179. <div slot="footer" class="dialog-footer">
  180. <el-button @click.native="editInformation = false">{{$t('btn.cancel')}}</el-button>
  181. <el-button type="primary" @click.native="editInfo" :loading="editLoading2">{{$t('btn.submit')}}</el-button>
  182. </div>
  183. </el-dialog>
  184. </section>
  185. </el-col>
  186. </el-row>
  187. </template>
  188. <script>
  189. import util from "../common/js/util";
  190. export default {
  191. // 引用 app.vue reloads 方法
  192. inject:['reloads'],
  193. data() {
  194. return {
  195. // roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","财务管理员", "项目管理员","公司领导"],
  196. roleArray:[this.$t('role.ordinaryEmployees'),this.$t('role.superAdministrator'),this.$t('role.systemAdministrator'),this.$t('role.companyTop'),this.$t('role.financialAdministrator'),this.$t('role.projectManager'),this.$t('role.companyLeadership')],
  197. helpImg: '../assets/image/userHead.png',
  198. user: sessionStorage.getItem("user"),
  199. collapsed: sessionStorage.collapsed!=null?(sessionStorage.collapsed=='true'?true:false):false,
  200. sysUserName: "",
  201. menu: [],
  202. // msgTypeTxt:["审批未通过","有新任务啦","任务有新进展","项目日报审核通过"],
  203. msgTypeTxt:[this.$t('state.notApproved'),this.$t('state.ThereIsAnewTask'),this.$t('state.TheresBeen'),this.$t('state.approvedProject')],
  204. editInformation: false,
  205. editPassWord: false,
  206. editLoading: false,
  207. editLoading2: false,
  208. addForm: {
  209. id: "",
  210. originPassword: "",
  211. newPassword: ""
  212. },
  213. editInfoForm: {
  214. id: "",
  215. username: "",
  216. mobile: "",
  217. companyName: ""
  218. },
  219. passRule: {
  220. originPassword: [{ required: true, message: this.$t('defaultText.pleaseEnterTheOldPassword'), trigger: "blur" }],
  221. newPassword: [{ required: true, message: this.$t('defaultText.pleaseEnterTheNewPassword'), trigger: "blur" }],
  222. username: [{ required: true, message: this.$t('defaultText.PleaseEnterYourName'), trigger: "blur" }]
  223. },
  224. //时间
  225. activeDate: new Date(),
  226. timer: null,
  227. remainingTime: '',
  228. drawer: false,
  229. tableHeight: 0,
  230. popoverData: [],
  231. num: 0,
  232. language: ''
  233. };
  234. },
  235. methods: {
  236. // 中英文切换
  237. langChange(command) {
  238. let flg = this.language
  239. this.$i18n.locale = command
  240. localStorage.setItem("lang", command)
  241. if(command == 'en') {
  242. this.language = 'English'
  243. } else if (command == 'zh') {
  244. this.language = '中文'
  245. }
  246. if(flg != this.language) {
  247. this.reloads()
  248. }
  249. },
  250. //退出登录
  251. logout: function() {
  252. var _this = this;
  253. this.$confirm(this.$t('other.confirmExit') + '?', this.$t('other.prompts'), {
  254. //type: 'warning'
  255. confirmButtonText: this.$t('btn.submit'),
  256. cancelButtonText: this.$t('btn.cancel'),
  257. }).then(() => {
  258. sessionStorage.removeItem("user");
  259. location.reload();
  260. _this.$router.push("/login");
  261. });
  262. },
  263. //折叠导航栏
  264. collapse: function() {
  265. this.collapsed = !this.collapsed;
  266. sessionStorage.collapsed = this.collapsed;
  267. },
  268. showMenu(i, status) {
  269. this.$refs.menuCollapsed.getElementsByClassName(
  270. "submenu-hook-" + i
  271. )[0].style.display = status ? "block" : "none";
  272. },
  273. //打开编辑信息界面
  274. editInfoOpen() {
  275. this.editInformation = true;
  276. this.editInfoForm.id = JSON.parse(sessionStorage.getItem("user")).id;
  277. this.editInfoForm.username = JSON.parse(
  278. sessionStorage.getItem("user")
  279. ).username;
  280. this.editInfoForm.mobile = JSON.parse(
  281. sessionStorage.getItem("user")
  282. ).account;
  283. this.editInfoForm.companyName = JSON.parse(
  284. sessionStorage.getItem("user")
  285. ).companyName;
  286. },
  287. //编辑信息
  288. editInfo() {
  289. this.$refs.editInfoForm.validate(valid => {
  290. if (valid) {
  291. this.editLoading2 = true;
  292. this.http.post(
  293. this.port.pwd.resetPwd,
  294. { id: this.editInfoForm.id, username: this.editInfoForm.username },
  295. res => {
  296. this.editLoading2 = false;
  297. this.editInformation = false;
  298. if (res.code == "ok") {
  299. this.$message({
  300. message: this.$t('message.modifyTheSuccess'),
  301. type: "success"
  302. });
  303. //读取并覆盖session storage
  304. var userObject = JSON.parse(sessionStorage.getItem("user"));
  305. userObject.username = this.editInfoForm.username;
  306. sessionStorage.setItem("user", JSON.stringify(userObject));
  307. this.sysUserName = this.editInfoForm.username;
  308. } else {
  309. this.$message({
  310. message: res.msg,
  311. type: "error"
  312. });
  313. }
  314. },
  315. error => {
  316. this.editLoading2 = false;
  317. this.editInformation = false;
  318. this.$message({
  319. message: error,
  320. type: "error"
  321. });
  322. }
  323. );
  324. }
  325. });
  326. },
  327. reset() {
  328. this.editPassWord = true;
  329. this.addForm.id = JSON.parse(sessionStorage.getItem("user")).id;
  330. this.addForm.account = JSON.parse(sessionStorage.getItem("user")).account;
  331. },
  332. resetPwd() {
  333. this.$refs.addForm.validate(valid => {
  334. if (valid) {
  335. this.editLoading = true;
  336. this.http.post( this.port.manage.editPassword, this.addForm,
  337. res => {
  338. this.editLoading = false;
  339. this.editPassWord = false;
  340. if (res.code == "ok") {
  341. this.$message({
  342. // message: "修改成功,请重新登录",
  343. message: this.$t('message.logAganin'),
  344. type: "success"
  345. });
  346. this.$router.push("/login");
  347. } else {
  348. this.$message({
  349. message: res.msg,
  350. type: "error"
  351. });
  352. }
  353. },
  354. error => {
  355. this.editLoading = false;
  356. this.editPassWord = false;
  357. this.$message({
  358. message: error,
  359. type: "error"
  360. });
  361. });
  362. }
  363. });
  364. },
  365. setTime() {
  366. var d = util.formatDate.cdTime(new Date(new Date().getTime() + this.user.remainingTime), new Date(), 'd');
  367. var h = util.formatDate.cdTime(new Date(new Date().getTime() + this.user.remainingTime), new Date(), 'h');
  368. var m = util.formatDate.cdTime(new Date(new Date().getTime() + this.user.remainingTime), new Date(), 'm');
  369. var s = util.formatDate.cdTime(new Date(new Date().getTime() + this.user.remainingTime), new Date(), 's');
  370. this.remainingTime = d+'天'+h+'时'+m+'分'+s+'秒';
  371. },
  372. // 加载消息
  373. loadNotice() {
  374. this.http.post( this.port.manage.msgList, {},
  375. res => {
  376. if (res.code == "ok") {
  377. var list = res.data;
  378. this.popoverData = res.data;
  379. var num = 0;
  380. for(var i in list) {
  381. if(list[i].checked != 1) {
  382. num ++;
  383. }
  384. }
  385. this.num = num;
  386. } else {
  387. this.$message({
  388. message: res.msg,
  389. type: "error"
  390. });
  391. }
  392. },
  393. error => {
  394. this.$message({
  395. message: error,
  396. type: "error"
  397. });
  398. });
  399. },
  400. //点击消息的跳转
  401. locationHerf(id, date, type) {
  402. this.http.post( this.port.manage.check, { id: id },
  403. res => {
  404. if (res.code == "ok") {
  405. this.loadNotice();
  406. if (type == 0 || type == 3) {
  407. //审批未通过的消息, 也包括审批通过的通知
  408. sessionStorage.msg = date;
  409. sessionStorage.from = 1;
  410. //本页面再点的话强制转移一下
  411. var currentRoute = this.$route.path.split("/");
  412. if (currentRoute[1] == "daily") {
  413. this.$router.go(0);
  414. this.drawer = false;
  415. return false;
  416. }
  417. this.$router.push("/daily");
  418. this.drawer = false;
  419. } else if (type == 1) {
  420. //1- 有新任务待执行
  421. this.$router.push("/projectInside/"+date);
  422. this.drawer = false;
  423. } else if (type == 2) {
  424. //2- 任务有新进展
  425. this.$router.push("/projectInside/"+date);
  426. this.drawer = false;
  427. }
  428. } else {
  429. this.$message({
  430. message: res.msg,
  431. type: "error"
  432. });
  433. }
  434. },
  435. error => {
  436. this.$message({
  437. message: error,
  438. type: "error"
  439. });
  440. });
  441. },
  442. // 获取企业微信的参数
  443. agentConfig() {
  444. var curUrl = location.href.split("#")[0];
  445. this.http.post("/wxcorp/getCorpWXConfig", {url: curUrl, token: this.user.id}, (res) => {
  446. if (res.code == "ok") {
  447. wx.config({
  448. beta: true,
  449. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  450. appId: res.data.appid, // 必填,公众号的唯一标识
  451. timestamp: res.data.timestamp, // 必填,生成签名的时间戳
  452. nonceStr: res.data.noncestr, // 必填,生成签名的随机串
  453. signature: res.data.sign, // 必填,签名,见附录1
  454. jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig']
  455. });
  456. var that = this;
  457. wx.ready(function(){
  458. // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
  459. that.http.post("/wxcorp/getCorpWXAgentConfig", {url: curUrl, token: that.user.id}, (res) => {
  460. if (res.code == "ok") {
  461. console.log()
  462. wx.agentConfig({
  463. corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
  464. agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
  465. timestamp: res.data.timestamp, // 必填,生成签名的时间戳
  466. nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
  467. signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  468. jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
  469. success: function (result) {
  470. console.log(result, '请求微信成功')
  471. console.log(window, 'window')
  472. // wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
  473. window.WWOpenData.bind(document.querySelector('ww-open-data'))
  474. },
  475. fail: function (res) {
  476. console.log('查看错误信息', res)
  477. if (res.errMsg.indexOf('function not exist') > -1) {
  478. alert('版本过低请升级')
  479. }
  480. },
  481. })
  482. }
  483. }, (error) => {
  484. console.log('查看错误信息' + res)
  485. if (error.errMsg.indexOf('function not exist') > -1) {
  486. alert('版本过低请升级')
  487. }
  488. })
  489. });
  490. }
  491. }, (error) => {
  492. console.log(error, '哦耶')
  493. })
  494. },
  495. },
  496. mounted() {
  497. // console.log(this.$router.options.routes, '看看')
  498. console.log(this.$router.options.routes, '路由')
  499. let langse = localStorage.getItem("lang") || 'zh'
  500. if(langse == 'en') {
  501. this.language = 'English'
  502. } else if (langse == 'zh') {
  503. this.language = '中文'
  504. }
  505. let height = window.innerHeight;
  506. this.tableHeight = height - 15;
  507. const that = this;
  508. window.onresize = function temp() {
  509. that.tableHeight = window.innerHeight - 15;
  510. };
  511. if (this.user) {
  512. var user = JSON.parse(this.user);
  513. this.user = user;
  514. this.sysUserName = user.name || "";
  515. this.loadNotice();
  516. if(this.user.remainingTime != "" && this.user.remainingTime != 0) {
  517. this.remainingTime = util.formatDate.format(new Date(new Date().getTime() + this.user.remainingTime), "yyyy-MM-dd")
  518. } else {
  519. this.remainingTime = this.$t('other.expired');
  520. clearInterval(this.timer);
  521. }
  522. } else {
  523. this.$router.push("/login");
  524. }
  525. // console.log('啊,我被触发了呀')
  526. // 获取企业微信参数
  527. if(this.user.userNameNeedTranslate == '1') {
  528. this.agentConfig()
  529. }
  530. },
  531. };
  532. </script>
  533. <style scoped lang="scss">
  534. .el-menu-vertical-demo i {
  535. margin-right: 10px;
  536. }
  537. .container {
  538. position: absolute;
  539. top: 0px;
  540. bottom: 0px;
  541. width: 100%;
  542. .header {
  543. height: 60px;
  544. line-height: 60px;
  545. background: #20a0ff;
  546. color: #fff;
  547. .userinfo {
  548. text-align: right;
  549. padding-right: 35px;
  550. float: right;
  551. .userinfo-inner {
  552. cursor: pointer;
  553. color: #fff;
  554. img {
  555. width: 40px;
  556. height: 40px;
  557. border-radius: 20px;
  558. margin: 10px 10px 10px 10px;
  559. float: left;
  560. }
  561. }
  562. .itemNew {
  563. height: 25px;
  564. margin: 0 0 0 10px;
  565. i {
  566. vertical-align: top;
  567. }
  568. }
  569. }
  570. .logo {
  571. height: 60px;
  572. font-size: 21px;
  573. padding-left: 20px;
  574. padding-right: 20px;
  575. border-color: rgba(238, 241, 146, 0.3);
  576. border-right-width: 1px;
  577. border-right-style: solid;
  578. img {
  579. width: 40px;
  580. float: left;
  581. margin: 10px 10px 10px 18px;
  582. }
  583. img.headImg {
  584. margin: 0;
  585. width: 40px;
  586. height: 40px;
  587. margin: 10px 0 0 10px;
  588. }
  589. .logo-sys {
  590. height: 100%;
  591. line-height: 100%;
  592. img.headImg {
  593. width: 40px;
  594. height: 40px;
  595. margin: 10px 0 0 10px;
  596. vertical-align: middle;
  597. }
  598. span {
  599. display: inline-block;
  600. height: 100%;
  601. line-height: 60px;
  602. margin-left: 15px;
  603. font-size: 18px;
  604. // margin: 20px 0 0 15px;
  605. vertical-align: middle;
  606. }
  607. }
  608. .txt {
  609. color: #fff;
  610. }
  611. }
  612. .logo-width {
  613. width: 200px;
  614. }
  615. .logo-collapse-width {
  616. width: 60px;
  617. }
  618. .tools {
  619. padding: 0px 23px;
  620. width: 14px;
  621. height: 60px;
  622. line-height: 60px;
  623. cursor: pointer;
  624. }
  625. }
  626. .main {
  627. display: flex;
  628. position: absolute;
  629. top: 60px;
  630. bottom: 0px;
  631. overflow: hidden;
  632. aside {
  633. flex: 0 0 230px;
  634. width: 230px;
  635. .el-menu {
  636. height: 100%;
  637. }
  638. .collapsed {
  639. width: 60px;
  640. .item {
  641. position: relative;
  642. }
  643. .submenu {
  644. position: absolute;
  645. top: 0px;
  646. left: 60px;
  647. z-index: 99999;
  648. height: auto;
  649. display: none;
  650. box-shadow: 5px 5px 10px #ddd;
  651. }
  652. }
  653. }
  654. .menu-collapsed {
  655. flex: 0 0 60px;
  656. width: 60px;
  657. }
  658. .menu-expanded {
  659. flex: 0 0 200px;
  660. width: 200px;
  661. }
  662. .content-container {
  663. flex: 1;
  664. width: 80%;
  665. overflow-y: auto;
  666. overflow-x: hidden;
  667. .breadcrumb-container {
  668. .title {
  669. width: 200px;
  670. float: left;
  671. color: #475669;
  672. }
  673. .breadcrumb-inner {
  674. float: right;
  675. }
  676. }
  677. .content-wrapper {
  678. background-color: #fff;
  679. box-sizing: border-box;
  680. }
  681. }
  682. }
  683. }
  684. .popover-item {
  685. padding: 10px;
  686. border-bottom: 1px #eee solid;
  687. }
  688. .popover-item > div > p {
  689. margin: 0;
  690. line-height: 18px;
  691. }
  692. .popover-title {
  693. color: #409eff;
  694. padding-bottom: 8px;
  695. }
  696. .popover-type {
  697. color: #aaa;
  698. font-size: 8px;
  699. float: right;
  700. }
  701. .popover-button {
  702. font-weight: 900;
  703. padding: 10px;
  704. text-align: center;
  705. cursor: pointer;
  706. }
  707. .isRead {
  708. color: #999 !important;
  709. }
  710. .bosx {
  711. width: 110px;
  712. display: inline-block;
  713. overflow: hidden;
  714. white-space: nowrap;
  715. text-overflow: ellipsis;
  716. }
  717. </style>