综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2024-01-03 09:23:11
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2024-02-27 14:12:01
  6. -->
  7. <template>
  8. <div class="app-container home">
  9. <div class="left">
  10. <!-- 用户信息 -->
  11. <div class="user-info">
  12. <el-row align="bottom" :gutter="40">
  13. <el-col :span="4">
  14. <h3 style="font-weight: bold;text-align: right;font-size: 18px;"> {{ user.nickName }},您好! </h3>
  15. <!-- <h2 style="text-align: right;font-size: 24px;font-weight: bold;"> {{ 10 }}℃ </h2> -->
  16. <el-row style="font-size:12px;text-align: right;"> {{ "2024-01-22" }} {{ "星期一" }} </el-row>
  17. </el-col>
  18. <el-col :span="4" style="text-align: center;">
  19. <img :src="avatar" class="user-avatar" />
  20. </el-col>
  21. <el-col :span="16">
  22. <el-row style="font-size: 20px;font-weight: bold;margin-bottom: 20px;">
  23. {{ user.nickName }} <el-tag type="warning">{{ titles }}</el-tag>
  24. </el-row>
  25. <el-row>
  26. <el-col :span="4">
  27. <el-row class="userinfo-item">
  28. 入职时间
  29. </el-row>
  30. <el-row class="userinfo-data">
  31. {{ user.entryDate != null ? user.entryDate.substring(0, 7) : user.entryDate }}
  32. </el-row>
  33. </el-col>
  34. <el-col :span="4">
  35. <el-row class="userinfo-item">
  36. 工龄
  37. </el-row>
  38. <el-row class="userinfo-data">
  39. {{ getObtainSeniority(user.entryDate) }}
  40. </el-row>
  41. </el-col>
  42. <el-col :span="4">
  43. <el-row class="userinfo-item">
  44. 所在部门
  45. </el-row>
  46. <el-row class="userinfo-data">
  47. {{ user.dept ? user.dept.deptName : '' }}
  48. </el-row>
  49. </el-col>
  50. <el-col :span="4">
  51. <el-row class="userinfo-item">
  52. 岗级
  53. </el-row>
  54. <el-row class="userinfo-data">
  55. {{ engineerLevel }}
  56. </el-row>
  57. </el-col>
  58. <el-col :span="4">
  59. <el-row class="userinfo-item">
  60. 技术职称
  61. </el-row>
  62. <el-row class="userinfo-data">
  63. {{ titles }}
  64. </el-row>
  65. </el-col>
  66. </el-row>
  67. </el-col>
  68. </el-row>
  69. </div>
  70. <!-- 快捷菜单 -->
  71. <el-row class="meau" type="flex">
  72. <el-col :span="12" class="meau-left">
  73. <div class="titles">
  74. <span class="title-line"></span>
  75. <span class="title-text">快捷菜单</span>
  76. <span class="title-more">更多</span>
  77. </div>
  78. <el-row style="text-align: center;">
  79. <el-col :span="4" class="item" style="background-color: #42b983;padding:3px" @click.native="gotoTask">
  80. <el-row class="item-icon"><i class="el-icon-tickets"></i></el-row>
  81. <el-row>新建申请</el-row>
  82. </el-col>
  83. <!-- <el-col :span="4" class="item" style="background-color: #40A9FF;padding:3px">
  84. <el-row class="item-icon"><i class="el-icon-s-order"></i></el-row>
  85. <el-row>已办任务</el-row>
  86. </el-col> -->
  87. </el-row>
  88. </el-col>
  89. <el-col :span="12" class="meau-right">
  90. <div class="titles">
  91. <span class="title-line"></span>
  92. <span class="title-text">我的待办</span>
  93. </div>
  94. <el-row>
  95. <el-col :span="6" class="db-item" @click.native="$router.push({ path: '/task/todo' })">
  96. <el-row class="db-text">考核待审</el-row>
  97. <el-row class="db-number">{{ detail }}</el-row>
  98. </el-col>
  99. <el-col :span="6" class="db-item" @click.native="$router.push({ path: '/task/finished' })">
  100. <el-row class="db-text">已办任务</el-row>
  101. <el-row class="db-number">{{ finish }}</el-row>
  102. </el-col>
  103. </el-row>
  104. </el-col>
  105. </el-row>
  106. <!-- 公告列表和日历 -->
  107. <el-row class="notice">
  108. <el-col :span="16">
  109. <div class="titles">
  110. <span class="title-line"></span>
  111. <span class="title-text">公告列表</span>
  112. </div>
  113. <el-table :data="noticeData" style="width: 100%">
  114. <el-table-column prop="type" label="公告分类">
  115. </el-table-column>
  116. <el-table-column prop="name" label="公告标题">
  117. </el-table-column>
  118. <el-table-column prop="time" label="发布时间">
  119. </el-table-column>
  120. </el-table>
  121. </el-col>
  122. <el-col :span="8">
  123. <el-calendar v-model="times" style="margin-top: 80px;">
  124. </el-calendar>
  125. </el-col>
  126. </el-row>
  127. </div>
  128. <div class="right">
  129. <div class="titles">
  130. <span class="title-line"></span>
  131. <span class="title-text">项目列表</span>
  132. </div>
  133. <el-table :data="projectData" style="width: 100%">
  134. <el-table-column prop="isFinshed" label="状态" width="90px">
  135. <template slot-scope="scope">
  136. <el-tag :type="scope.row.isFinished === '0' ? 'success' : 'warning'" disable-transitions>
  137. {{ scope.row.isFinished == '0' ? '进行中' : '已结束' }}
  138. </el-tag>
  139. </template>
  140. </el-table-column>
  141. <el-table-column prop="projectNumber" label="项目编号" width="90px">
  142. </el-table-column>
  143. <el-table-column prop="projectLeader" label="项目负责人" width="90px">
  144. </el-table-column>
  145. <el-table-column prop="projectName" label="项目名称">
  146. </el-table-column>
  147. </el-table>
  148. <div style="text-align: right;margin-top: 20px;">
  149. <el-pagination @current-change="getProject" :current-page.sync="projectQueryParams.pageNum"
  150. :page-size="projectQueryParams.pageSize" layout="total, prev, pager, next,jumper" :total="projectTotal">
  151. </el-pagination>
  152. </div>
  153. </div>
  154. </div>
  155. </template>
  156. <script>
  157. import { mapGetters } from "vuex";
  158. import { getUserProfile } from "@/api/system/user";
  159. import { listProject } from "@/api/oa/project/project";
  160. import { todoList } from "@/api/flowable/todo";
  161. import { finishedList } from "@/api/flowable/finished";
  162. import { getDicts as getDicts, getData } from '@/api/system/dict/data'
  163. export default {
  164. name: "index",
  165. computed: {
  166. ...mapGetters(["avatar"]),
  167. },
  168. dicts: ['sys_user_engineerlevel', 'sys_user_titles'],
  169. data() {
  170. return {
  171. user: {},
  172. weather: {},
  173. noticeData: [],
  174. projectData: [],
  175. projectQueryParams: {
  176. pageNum: 1,
  177. pageSize: 16
  178. },
  179. projectTotal: 0,
  180. times: new Date(),
  181. detail: 0,
  182. finish: 0,
  183. engineerLevel: '',
  184. titles: '',
  185. };
  186. },
  187. created() {
  188. this.getUser();
  189. this.getDetail();
  190. this.getProject();
  191. },
  192. methods: {
  193. goTarget(href) {
  194. window.open(href, "_blank");
  195. },
  196. getUser() {
  197. getUserProfile().then(response => {
  198. this.user = response.data;
  199. for (let d of this.dict.type.sys_user_engineerlevel) {
  200. if (d.value == response.data.engineerLevel) {
  201. console.log(d);
  202. this.engineerLevel = d.label
  203. }
  204. }
  205. for (let t of this.dict.type.sys_user_titles) {
  206. if (t.value == response.data.titles) {
  207. console.log(t);
  208. this.titles = t.label
  209. }
  210. }
  211. });
  212. },
  213. gotoTask() {
  214. this.$router.push({ path: "/task/process" });
  215. },
  216. goTodo() {
  217. this.$router.push({ path: "/task/todo" });
  218. },
  219. getProject() {
  220. listProject(this.projectQueryParams).then(response => {
  221. this.projectData = response.rows;
  222. this.projectTotal = response.total;
  223. })
  224. },
  225. // 获取考核待办
  226. getDetail() {
  227. todoList({
  228. pageNum: 1,
  229. pageSize: 10,
  230. name: null,
  231. category: 'assess'
  232. }).then(response => {
  233. this.detail = response.data.total;
  234. });
  235. },
  236. getFinish() {
  237. finishedList({
  238. pageNum: 1,
  239. pageSize: 10,
  240. name: null,
  241. category: null,
  242. key: null,
  243. tenantId: null,
  244. deployTime: null,
  245. derivedFrom: null,
  246. derivedFromRoot: null,
  247. parentDeploymentId: null,
  248. engineVersion: null
  249. }).then(response => {
  250. this.finish = response.data.total;
  251. })
  252. },
  253. // 获取工龄
  254. getObtainSeniority(entryDate) {
  255. if (entryDate != "" && entryDate != undefined && entryDate != null) {
  256. let curYear = new Date();
  257. let e = entryDate.substring(0, 4);
  258. return (curYear.getFullYear() - parseInt(e)) + '年'
  259. }
  260. }
  261. },
  262. };
  263. </script>
  264. <style scoped lang="scss">
  265. .home {
  266. display: flex;
  267. background-color: #f5f5f5;
  268. }
  269. .left {
  270. flex: 2;
  271. margin-right: 20px;
  272. .user-info {
  273. width: 100%;
  274. height: 160px;
  275. padding: 10px;
  276. margin-bottom: 20px;
  277. background-color: #fff;
  278. .user-avatar {
  279. width: 120px;
  280. height: 120px;
  281. border-radius: 50%;
  282. }
  283. .userinfo-item {
  284. font-size: 18px;
  285. font-family: 'Times New Roman', '黑体', Times, serif, ;
  286. font-weight: bold;
  287. color: #6D6D6D;
  288. margin: 5px;
  289. }
  290. .userinfo-data {
  291. font-size: 14px;
  292. font-family: '微软雅黑';
  293. font-weight: bold;
  294. margin: 5px;
  295. }
  296. }
  297. .meau {
  298. height: 150px;
  299. margin-bottom: 20px;
  300. .meau-left {
  301. background-color: #fff;
  302. padding: 0px 20px 10px;
  303. margin-right: 20px;
  304. }
  305. .meau-right {
  306. background-color: #fff;
  307. padding: 0px 20px 10px;
  308. margin-left: 20px;
  309. .db-item {
  310. text-align: center;
  311. background-color: #F5F5F5;
  312. padding: 10px 20px;
  313. margin: 0 5px;
  314. cursor: pointer;
  315. .db-text {}
  316. .db-number {
  317. font-weight: bold;
  318. color: #e67153;
  319. line-height: 30px;
  320. font-size: 19px;
  321. }
  322. }
  323. }
  324. .item {
  325. color: #fff;
  326. margin: 0 10px;
  327. cursor: pointer;
  328. }
  329. .item-icon {
  330. width: 100%;
  331. height: 100%;
  332. text-align: center;
  333. i {
  334. display: inline-block;
  335. font-size: 40px;
  336. color: #fff;
  337. }
  338. }
  339. }
  340. .notice {
  341. padding: 0px 20px 10px;
  342. background-color: #fff;
  343. }
  344. }
  345. .right {
  346. padding: 0px 20px 10px;
  347. background-color: #fff;
  348. flex: 1;
  349. }
  350. .border {
  351. border: 1px solid #CDCDCD;
  352. }
  353. .titles {
  354. line-height: 55px;
  355. vertical-align: middle;
  356. font-weight: bold;
  357. position: relative;
  358. margin-bottom: 10px;
  359. .title-line {
  360. position: absolute;
  361. top: 50%;
  362. left: 0;
  363. transform: translate(0%, -50%);
  364. width: 5px;
  365. height: 30px;
  366. background-color: #42b983;
  367. }
  368. .title-text {
  369. display: inline-block;
  370. padding-left: 15px;
  371. }
  372. .title-more {
  373. position: absolute;
  374. top: 50%;
  375. right: 0;
  376. transform: translate(0%, -50%);
  377. color: #40A9FF;
  378. font-size: 14px;
  379. cursor: pointer;
  380. }
  381. .title-more:hover {
  382. color: #e4b82a;
  383. }
  384. }
  385. </style>