Home.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <div class="home">
  3. <Header />
  4. <Mainmenu />
  5. <section class="company-card">
  6. <div class="company wrap">
  7. <img v-if="companyLogo" class="logo" :src="companyLogo" alt="" />
  8. <img
  9. v-else
  10. class="logo"
  11. src="../../static/images/default-logo.png"
  12. alt=""
  13. />
  14. <div class="content">
  15. <div class="name">{{ companyInfo.companyName }}</div>
  16. <div class="addr">
  17. <i class="el-icon-location"></i>
  18. {{ companyInfo.companyAddress }}
  19. </div>
  20. <div class="company-bottom">
  21. <div class="left">
  22. <div class="data-cell">
  23. <div class="up">
  24. <span>{{ companyTotal.recruitWorkNum || 0 }}</span
  25. >个
  26. </div>
  27. <div class="down">
  28. 招聘职位
  29. <el-tooltip
  30. class="item"
  31. effect="dark"
  32. content="该公司的在招职位数量"
  33. placement="top-start"
  34. >
  35. <i class="el-icon-question"></i>
  36. </el-tooltip>
  37. </div>
  38. </div>
  39. <div class="data-cell">
  40. <div class="up">
  41. <span>{{ companyTotal.viewNum || 0 }}</span
  42. >个
  43. </div>
  44. <div class="down">
  45. 进行应聘
  46. <el-tooltip
  47. class="item"
  48. effect="dark"
  49. content="进行中的应聘数量"
  50. placement="top-start"
  51. >
  52. <i class="el-icon-question"></i>
  53. </el-tooltip>
  54. </div>
  55. </div>
  56. <div class="data-cell">
  57. <div class="up">
  58. <span>{{ companyTotal.receivedResumeNum || 0 }}</span
  59. >个
  60. </div>
  61. <div class="down">
  62. 收到简历
  63. <el-tooltip
  64. class="item"
  65. effect="dark"
  66. content="收到的简历数量"
  67. placement="top-start"
  68. >
  69. <i class="el-icon-question"></i>
  70. </el-tooltip>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="right">
  75. <div class="time">{{ companyInfo.recentLoginDate }}</div>
  76. <el-tooltip
  77. class="item"
  78. effect="dark"
  79. content="该公司管理者最近一次登录时间"
  80. placement="bottom"
  81. >
  82. <div class="tip">
  83. 企业最近登录<i class="el-icon-question"></i>
  84. </div>
  85. </el-tooltip>
  86. </div>
  87. </div>
  88. <!-- <div class="edit-btn"><i class="icon el-icon-edit"></i>编辑</div> -->
  89. </div>
  90. </div>
  91. </section>
  92. <!-- company-card end -->
  93. <section class="companymenu-wrap">
  94. <div class="companymenu wrap">
  95. <el-menu
  96. :default-active="companymenuIndex"
  97. class="el-menu-demo"
  98. mode="horizontal"
  99. @select="companymenuSelect"
  100. >
  101. <el-menu-item index="1">公司主页</el-menu-item>
  102. <el-menu-item index="2"
  103. >招聘职位({{ companyTotal.recruitWorkNum || 0 }})</el-menu-item
  104. >
  105. <el-menu-item index="3"
  106. >应聘信息({{ companyTotal.receivedResumeNum || 0 }})</el-menu-item
  107. >
  108. </el-menu>
  109. </div>
  110. </section>
  111. <!-- companymenu end -->
  112. <section class="page-con wrap">
  113. <div class="left-content">
  114. <div v-if="companymenuIndex == '1'" class="company-details">
  115. <!-- <ul class="company-label">
  116. <li>个人能力</li>
  117. <li>执行力</li>
  118. <li>团队精神</li>
  119. </ul> -->
  120. <div class="intro">
  121. <div class="company-details-til">公司介绍</div>
  122. {{ companyInfo.detatil }}
  123. </div>
  124. <div class="contact">
  125. <div class="company-details-til">联系方式</div>
  126. <p>地址: {{ companyInfo.companyAddress }}</p>
  127. <p>电话:{{ companyInfo.linkPhone }}</p>
  128. </div>
  129. <div class="environment" v-if="companyImg.length > 0">
  130. <div class="company-details-til">工作环境</div>
  131. <div class="img-wrap">
  132. <el-image
  133. v-for="item in companyImg"
  134. :key="item.id"
  135. class="img"
  136. :src="item.filesUrl"
  137. fit="cover"
  138. ></el-image>
  139. </div>
  140. </div>
  141. </div>
  142. <!-- company-details end -->
  143. <Jobs
  144. v-if="companymenuIndex == '2'"
  145. @getTotal="getCompanyInfo"
  146. :lastSecondNum="companyTotal.lastSecondNum"
  147. />
  148. <Applys
  149. v-if="companymenuIndex == '3'"
  150. :lastMonthRecruitNum="companyTotal.lastMonthRecruitNum"
  151. />
  152. </div>
  153. <div class="base-info">
  154. <div class="name">公司基本信息</div>
  155. <div class="base-info-item">
  156. <i class="el-icon-s-marketing"></i
  157. >{{ filterTradeStatus(companyInfo.trade) }}
  158. </div>
  159. <div class="base-info-item">
  160. <i class="el-icon-s-custom"></i
  161. >{{ filterScopeStatus(companyInfo.scope) }}
  162. </div>
  163. <div class="base-info-item">
  164. <i class="el-icon-location"></i>{{ companyInfo.companyAddress }}
  165. </div>
  166. </div>
  167. </section>
  168. </div>
  169. </template>
  170. <style lang="scss" scoped>
  171. @import "./home.scss";
  172. </style>
  173. <script>
  174. // @ is an alias to /src
  175. import Header from "@/components/header.vue";
  176. import Mainmenu from "@/components/mainmenu.vue";
  177. import Jobs from "@/components/jobs.vue";
  178. import Applys from "@/components/applys.vue";
  179. import {
  180. getCompanyInfo,
  181. getTrade,
  182. getScope,
  183. getCompanyTotalInfo,
  184. } from "@/utils/api";
  185. export default {
  186. name: "Home",
  187. components: {
  188. Header,
  189. Mainmenu,
  190. Jobs,
  191. Applys,
  192. },
  193. data() {
  194. return {
  195. companyLogo: "",
  196. activeName: "second",
  197. companymenuIndex: "1",
  198. companyInfo: {},
  199. companyImg: [],
  200. companyTotal: {},
  201. trade: [],
  202. scope: [],
  203. };
  204. },
  205. computed: {
  206. filterTradeStatus() {
  207. return function (value) {
  208. let v = "";
  209. for (let i = 0; i < this.trade.length; i++) {
  210. let item = this.trade[i];
  211. if (value == item.value) {
  212. v = item.label;
  213. break;
  214. }
  215. }
  216. return v;
  217. };
  218. },
  219. filterScopeStatus() {
  220. return function (value) {
  221. let v = "";
  222. for (let i = 0; i < this.scope.length; i++) {
  223. let item = this.scope[i];
  224. if (value == item.value) {
  225. v = item.label;
  226. break;
  227. }
  228. }
  229. return v;
  230. };
  231. },
  232. },
  233. created() {
  234. // console.log("localStorage.getItem", localStorage.getItem("lifeData"));
  235. // console.log("this.$router", this.$router);
  236. this.getinfo();
  237. this.handelGetTrade();
  238. this.handelGetScope();
  239. this.getCompanyInfo();
  240. },
  241. mounted() {
  242. let _this = this;
  243. if (_this.fromPage == "/applicant") {
  244. this.companymenuIndex = "3";
  245. } else if (_this.fromPage == "/jobdetails") {
  246. this.companymenuIndex = "2";
  247. }
  248. },
  249. beforeRouteEnter(to, from, next) {
  250. // console.log(from, "beforeRouteEnter");
  251. next((vm) => {
  252. // vm相当于上面的this
  253. vm.fromPage = from.path;
  254. });
  255. },
  256. methods: {
  257. companymenuSelect(key) {
  258. this.companymenuIndex = key;
  259. },
  260. getinfo() {
  261. getCompanyInfo()
  262. .then((res) => {
  263. this.companyInfo = res.data;
  264. console.log("getCompanyInfo", res);
  265. this.$mc.vuex("vuex_name", res.data.userName);
  266. this.$mc.vuex("vuex_company_id", res.data.id);
  267. this.$mc.vuex("vuex_user", res.data);
  268. this.companyLogo = res.data.logoFileList[0]?.filesUrl;
  269. this.companyImg = res.data.companyfileList;
  270. })
  271. .catch((err) => {
  272. console.log("fetchList err", err);
  273. });
  274. },
  275. getCompanyInfo() {
  276. getCompanyTotalInfo()
  277. .then((res) => {
  278. this.companyTotal = res.data;
  279. })
  280. .catch((err) => {});
  281. },
  282. handelGetTrade() {
  283. let that = this;
  284. getTrade()
  285. .then((res) => {
  286. console.log("getTrade", res);
  287. if (res.code == 200) {
  288. res.data.map(function (currentValue) {
  289. that.trade.push({
  290. value: currentValue.dictValue,
  291. label: currentValue.dictLabel,
  292. });
  293. });
  294. }
  295. })
  296. .catch((err) => {
  297. console.log("getTrade err", err);
  298. });
  299. },
  300. handelGetScope() {
  301. let that = this;
  302. getScope()
  303. .then((res) => {
  304. console.log("getScope", res);
  305. if (res.code == 200) {
  306. res.data.map(function (currentValue) {
  307. that.scope.push({
  308. value: currentValue.dictValue,
  309. label: currentValue.dictLabel,
  310. });
  311. });
  312. }
  313. })
  314. .catch((err) => {
  315. console.log("getScope err", err);
  316. });
  317. },
  318. },
  319. };
  320. </script>