home.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <template>
  2. <div>
  3. <div>
  4. <div class="flex-box">
  5. <div class="flex-1" style="margin-right: 10px;">
  6. <div style="background-color: #fff;padding:20px;margin-bottom: 10px;" class="br-5 ">
  7. <div class="flex-box-ce">
  8. <div style="margin-right: 10px;">
  9. <userImage :id="user_info.id" :img_url="user_info.img_url" :user_name="user_info.name" width="50px" height="50px"></userImage>
  10. </div>
  11. <div class="flex-1">
  12. <div class="flex-box-ce" style="margin-bottom: 6px;font-size: 14px;color: #666;font-weight: 700;">
  13. <div style="font-size: 16px;font-weight: 700;padding-right:15px;" class="black">你好,{{ user_info.name }}</div>
  14. </div>
  15. <div class="fontColorC font-flex-word" style="max-width: 180px;">{{returnDeptName()}}</div>
  16. </div>
  17. <template v-if="user_info.post_info.length>0">
  18. <div class="flex-box-v flex-center-center" v-for="(item,index) in user_info.post_info" :key="index" style="border-radius: 3px;margin-left: 10px;padding: 10px;background-color: #f0f4fa;">
  19. <i style="font-size: 18px;" class="el-icon-s-custom fontColorC"></i>
  20. <span class="fontColorB">{{item.name}}</span>
  21. </div>
  22. </template>
  23. </div>
  24. <div class="flex-1" style="background-color: #f7f8fa;padding: 20px;border-radius:5px;margin-top: 20px;min-height: 229px;">
  25. <div class="flex-box-ce" style="margin-bottom: 20px;">
  26. <div><i style="font-size: 20px;margin-right: 5px;" class="el-icon-bell orange"></i></div>
  27. <div class="black" style="font-size: 18px;margin-right: 10px;">企业公告</div>
  28. <div class="blue cursor" @click="openUrl(1)" v-if="isAdministrator"> +发布公告</div>
  29. <div class="flex-1"></div>
  30. <div class="fontColorB cursor" @click="openUrl(1)">查看更多</div>
  31. </div>
  32. <ul class="flex-1" style="min-width: 550px;" v-if="gongaoList.length>0">
  33. <li class="flex-box-ce item" @click="openUrl(1,item.id)" v-for="(item, index) in gongaoList" :key="index">
  34. <div class="flex-1 flex-box-ce font-flex-word" style="min-width: 300px;">
  35. <span style="width: 6px;height: 6px;border-radius: 50%;background-color: #ccc;margin-right: 10px;"></span>
  36. {{item.name}}
  37. </div>
  38. <div class="fontColorC">{{item.create_time}}</div>
  39. </li>
  40. </ul>
  41. <noData isSolt v-else imgW="200px" imgH="150px" imgUrl="static/images/nodata_default.png">
  42. <div v-else class="fontColorC" style="text-align: center;" v-if="isAdministrator">暂无公告,去<span class="blue cursor" @click="openUrl(1)">添加</span></div>
  43. </noData>
  44. </div>
  45. </div>
  46. <div class="raiders_box">
  47. <div class="flex-box-ce">
  48. <div class="flex-1">管理学习中心</div>
  49. </div>
  50. <div class="flex-box-ce fontColorB flex-d-center flex-d-wrap" style="text-align: center;margin: 20px 0;font-size: 16px;">
  51. <div @click="openCursor(item)" class="cursor" style="padding: 30px 0;background-color: #f0f4fa;width: 49%;margin-bottom: 16px;border-radius: 5px;" v-for="(item,index) in courseList" :key="index">
  52. <svg-icon :icon-class="item.icon" class="blue"></svg-icon> {{item.name}}
  53. </div>
  54. </div>
  55. <div class="articles">
  56. <div class="article" v-for="(item,index) in consultAll" :key="index" @click="openContent(3,item)">
  57. <div class="img-box"><img :src="item.thumb" alt="static/images/logo2.png"></div>
  58. <div style="flex:1;margin-left: 10px;">
  59. <div class="article-content">{{item.summary}}</div>
  60. <div class="flex-box-ce" style="font-size: 12px;">
  61. <div class="fontColorC">{{item.publish_date}}</div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <div style="width: 300px;">
  69. <div style="margin-bottom: 10px;" v-if="announcement.length>0">
  70. <CarouselContainer @confirm="openContent(2,$event)" :slide-list="announcement" currentIndex="1"></CarouselContainer>
  71. </div>
  72. <div>
  73. <div class="flex-box-ce title-green">
  74. <i class="el-icon-discount green" style="font-size: 18px;"></i>
  75. <div class="flex-1" style="font-size: 16px;font-weight: 600;padding-left: 10px;">系统通知</div>
  76. <div style="font-size: 13px;" class="fontColorC cursor" @click="openContent(1)">查看更多</div>
  77. </div>
  78. <div style="background-color: #fff;padding: 16px;">
  79. <div v-for="(item,index) in updataAll" :key="index" class="versions" @click="openContent(1,item)">
  80. <div style="margin-bottom: 5px;">{{item.title}}</div>
  81. <div class="fontColorC" style="font-size: 13px;" :v-html="item.focus"></div>
  82. </div>
  83. </div>
  84. <div class="blue cursor" style="background-color: #fff;padding: 16px;border-top: 1px solid #f1f1f1;text-align: center;" @click="isShowJy=true">
  85. 有需求、建议?马上提 <i class="el-icon-arrow-right"></i>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <!-- 建议 -->
  92. <Suggest :visible.sync="isShowJy"></Suggest>
  93. </div>
  94. </template>
  95. <script>
  96. import CarouselContainer from '@/components/CarouselContainer.vue'
  97. import Suggest from '@/components/Suggest';
  98. import { mapGetters, mapState } from 'vuex';
  99. export default {
  100. components:{CarouselContainer,Suggest},
  101. data() {
  102. return {
  103. // 7.0
  104. time: this.$moment().format('HH'),
  105. isAdministrator:this.$getIsAdministrator(),
  106. isShowJy:false,
  107. noticeLoad:false,
  108. gongaoList:[],//客户公告
  109. updataAll:[],//版本更新
  110. announcement:[],//系统版本
  111. consultAll:[],//管理咨询
  112. functionAll:[],//功能预告
  113. courseList:[
  114. {name:'OKR目标管理-帮助手册',icon:'#icon-zhiyeshengyamubiao',id:1},
  115. {name:'绩效考核与管理-帮助手册',icon:'#icon-jixiao',id:2},
  116. {name:'积分制管理-帮助手册',icon:'#icon-PC_gongzuotai_ABfen',id:3},
  117. {name:'巡检、现场管理-帮助手册',icon:'#icon-tongxunlu_tianjiabumen',id:4},
  118. ]
  119. };
  120. },
  121. computed: {
  122. ...mapGetters(['user_info','site_info'])
  123. },
  124. methods: {
  125. openCursor(item){
  126. let urls=['https://www.yuque.com/xbddba/usmcgl?#','https://www.yuque.com/xbddba/qmvgbb?#','https://www.yuque.com/xbddba/pea8fp?#','https://www.yuque.com/xbddba/rtl7hs?#']
  127. window.open(urls[item.id-1],'_blank');
  128. },
  129. getGongaoList() {
  130. let params = {page: 1,page_size: 5};
  131. this.$axiosUser('get', '/api/pro/information/list/page', params).then(res => {
  132. let list = res.data.data.list;
  133. this.gongaoList =list;
  134. });
  135. },
  136. openContent(index,item){
  137. let data=item? {id:item.id}:{}
  138. this.$router.push({ path: '/update_notice',query:data})
  139. },
  140. openUrl(index,id){
  141. if(index==1){
  142. this.$router.push({ path: '/inform',query:{id:id}})
  143. }
  144. },
  145. noticeList() {
  146. this.noticeLoad = true;
  147. let http1=this.$axiosUser('get', '/api/pro/announcement/list', {page: 1,page_size: 10,type:0});//版本更新
  148. // let http2=this.$axiosUser('get', '/api/pro/article/list', {page: 1,page_size: 5,type:2});//系统公告
  149. // let http3=this.$axiosUser('get', '/api/pro/article/list', {page: 1,page_size: 6,type:3});//管理资讯
  150. // let http4=this.$axiosUser('get', '/api/pro/article/list', {page: 1,page_size: 1,type:4});//版本预告
  151. Promise.all([http1]).then(res => {
  152. this.updataAll=res[0].data.data.list;//
  153. // this.announcement=res[1].data.data.list;//
  154. // this.consultAll=res[2].data.data.list;//
  155. // this.functionAll=res[3].data.data.list;//
  156. }).finally(()=>{
  157. this.noticeLoad = false;
  158. })
  159. },
  160. returnDeptName(){
  161. let str='';
  162. let dept_list=this.user_info.employee_detail.dept_list;
  163. dept_list.forEach((e,index)=>{
  164. if(dept_list.length-index>1){
  165. str+=e.dept_name+','
  166. }else{
  167. str+=e.dept_name
  168. }
  169. })
  170. return str
  171. },
  172. },
  173. created() {
  174. this.noticeList();
  175. this.getGongaoList();
  176. },
  177. };
  178. </script>
  179. <style scoped>
  180. .menu-item2{
  181. background-color: #F7F7F7;
  182. width: 170px;
  183. position: relative;
  184. height: 34px;
  185. line-height: 34px;
  186. border: 1px solid #F7F7F7;
  187. padding: 0 16px;
  188. margin-bottom: 12px;
  189. transition: all .3s;
  190. cursor: pointer;
  191. margin-right: 20px;
  192. }
  193. .isSelect{
  194. background-color: #fff;
  195. color: #005bea;
  196. border: 1px solid #005bea;
  197. }
  198. .menu-item{
  199. background-color: #fff;
  200. width: 170px;
  201. position: relative;
  202. height: 36px;
  203. line-height: 36px;
  204. padding: 0px 16px;
  205. transition: all .3s;
  206. cursor: move;
  207. margin-bottom: 12px;
  208. margin-right: 17px;
  209. }
  210. .menu-item:hover i{
  211. display: block !important;
  212. color: #f56c6c !important;
  213. }
  214. .versions{
  215. position: relative;
  216. padding:6px 0;
  217. padding-left:24px;
  218. cursor: pointer;
  219. }
  220. .versions::after{
  221. content: "";
  222. position: absolute;
  223. width: 12px;
  224. height: 12px;
  225. border: 3px solid #64CBBA;
  226. border-radius: 100%;
  227. left: 0px;
  228. top: 10px;
  229. z-index: 2;
  230. }
  231. .versions2{
  232. position: relative;
  233. padding-left:24px;
  234. margin-bottom: 16px;
  235. cursor: pointer;
  236. }
  237. .versions2::after{
  238. content: "";
  239. position: absolute;
  240. width: 12px;
  241. height: 12px;
  242. border: 3px solid #F5C37B;
  243. border-radius: 100%;
  244. left: 0px;
  245. top: 5px;
  246. z-index: 2;
  247. }
  248. .versions:hover {
  249. color: #409eff;
  250. background-color: #f5f7fa;
  251. }
  252. .title-green{
  253. background-image: linear-gradient(to right, #CAEDEF 0%, #fff 100%);
  254. padding: 12px;
  255. }
  256. .title-orange{
  257. background-image: linear-gradient(to right, #FEF9F1 0%, #fff 100%);
  258. padding: 12px;
  259. }
  260. .articles{
  261. display: flex;
  262. flex-direction: row;
  263. justify-content: space-between;
  264. flex-wrap: wrap;
  265. }
  266. .article{
  267. width:49%;
  268. display: flex;
  269. margin-bottom: 16px;
  270. cursor: pointer;
  271. transition: all .3s;
  272. }
  273. .img-box img{
  274. width: 100px;
  275. height: 70px;
  276. display: block;
  277. }
  278. .article-content{
  279. overflow: hidden;
  280. text-overflow: ellipsis;
  281. word-break: break-all;
  282. display: -webkit-box;
  283. -webkit-line-clamp: 2;
  284. -webkit-box-orient: vertical;
  285. height: 40px;
  286. margin-bottom: 12px;
  287. padding-top: 3px;
  288. }
  289. .article:hover .article-content{
  290. color: #409eff;
  291. }
  292. .item {
  293. font-size: 14px;
  294. cursor: pointer;
  295. padding: 5px;
  296. }
  297. .item:hover {
  298. color: #409eff;
  299. }
  300. .raiders_box{
  301. padding: 20px;
  302. border-radius: 5px;
  303. background-color: #fff;
  304. }
  305. .inCommonUseStyle {
  306. border-radius: 5px;
  307. cursor: pointer;
  308. padding: 0 10px;
  309. text-align: center;
  310. margin-right: 16px;
  311. margin-bottom: 20px;
  312. }
  313. .inCommonUseStyle:hover {
  314. color: #409eff;
  315. background-color: #f5f7fa;
  316. }
  317. </style>