index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <div class="KanBan">
  3. <div class="top">
  4. <div class="topCon">
  5. <div class="title">
  6. <span v-if="userinfo.orgName">{{userinfo.orgName}}</span >
  7. <span style="color: #0663FE;font-weight: 600;">{{ userinfo.schoolName }}</span>
  8. <span style="color: #0663FE;cursor: pointer;font-weight: 600;" v-if="isIndex2 == 2" @click="gotoli">返回校区</span>
  9. </div>
  10. <div class="person">
  11. <div class="person_name">
  12. <img
  13. @click="openData()"
  14. style="width: 40px;height: 40px;object-fit: cover;border-radius: 50%; cursor: pointer;"
  15. :src="userinfo.headportrait ? userinfo.headportrait : require('../../assets/img/toux2.png')" alt="">
  16. <div class="personInfo">
  17. <div class="personInfoTit">
  18. {{ userinfo.username }}
  19. </div>
  20. <div class="personInfoBri">
  21. {{ userSuffix(userinfo.accountNumber) }}
  22. </div>
  23. </div>
  24. </div>
  25. <el-button type="text" @click="handleLogout" style="margin-left: 20px">退出</el-button>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="midBlo">
  30. <div class="buttonArea">
  31. <div :style="{width: '500px',display: 'flex',justifyContent : userinfo.role == 1 && userinfo.rrole == 1 && userinfo.type ==1? 'space-between' : 'center'}">
  32. <div class="btnDiv" :class="{ active: isActive === 1 }" >
  33. <div v-if="userinfo.role == 1 && userinfo.rrole == 1 && userinfo.type ==1" @click="setActive(1)">
  34. 数据看板
  35. </div>
  36. </div>
  37. <div class="btnDiv" :class="{ active: isActive === 2 }" @click="setActive(2)">校区特色</div>
  38. <div class="btnDiv" :class="{ active: isActive === 3 }" >
  39. <div v-if="userinfo.role == 1 && userinfo.rrole == 1 && userinfo.type ==1" @click="setActive(3)">
  40. 校区入口
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="mainArea">
  46. <div v-if="(isActive === 1 || isActive === 2) && fromL.admin.school.list.length">
  47. <schoolArea :schId="schId" :schOrg="schOrg" @cutSch="cutSch"/>
  48. </div>
  49. <div class="right_content">
  50. <div class="Con" v-if="isActive === 1">
  51. <!-- <AdataKanban></AdataKanban> -->
  52. <dataBoardNew :oid="schId" :org="schOrg" :userid="userinfo.userid"/>
  53. </div>
  54. <div class="Con" v-if="isActive === 2">
  55. <AschoolFeature :schId="schId" :schOrg="schOrg"></AschoolFeature>
  56. </div>
  57. <div class="Con" v-if="isActive === 3">
  58. <AquickEntrance :key="isActive"></AquickEntrance>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import schoolArea from '../../components/schoolArea.vue';
  67. // import AdataKanban from './components/AdataKanban';
  68. import dataBoardNew from './components/dataBoardNew';
  69. import AquickEntrance from './components/AquickEntrance';
  70. import AschoolFeature from './components/AschoolFeature';
  71. import { mapGetters, mapActions } from 'vuex';
  72. import { loginOut } from '@/api/user';
  73. import store from '../../store'
  74. export default {
  75. name:'kanBan',
  76. components: {
  77. schoolArea,
  78. // AdataKanban,
  79. dataBoardNew,
  80. AquickEntrance,
  81. AschoolFeature
  82. },
  83. computed: {
  84. ...mapGetters(['userinfo','userinfo2','fromL','appSign']),
  85. // 去除账号后缀
  86. userSuffix(){
  87. return function(val) {
  88. let userName = JSON.parse(JSON.stringify(val))
  89. const regEmail = new RegExp("^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$");
  90. // // 判断用户输入账户带不带后缀
  91. if (!regEmail.test(userName)) {
  92. console.log('111');
  93. } else {
  94. const parts = userName.split('@');
  95. userName = parts[0];
  96. }
  97. return userName
  98. }
  99. },
  100. },
  101. data() {
  102. return {
  103. isActive: 1,
  104. isIndex2:'',
  105. schId:'',
  106. schOrg:''
  107. }
  108. },
  109. methods: {
  110. cutSch(val){
  111. console.log('val',val);
  112. this.schId = val.oid
  113. this.schOrg = val.org
  114. },
  115. ...mapActions({
  116. logout: 'user/logout'
  117. }),
  118. // 返回首页
  119. async gotoli(){
  120. await store.commit('user/SET_AppSIGN', '')
  121. this.$router.push('/homepageL');
  122. },
  123. // 退出登录
  124. async handleLogout() {
  125. this.$confirm('确定退出吗', '提示', {
  126. confirmButtonText: '确定',
  127. cancelButtonText: '取消',
  128. type: 'warning'
  129. }).then(async () => {
  130. loginOut()
  131. .then(async () => {
  132. this.$message({
  133. message: '退出成功',
  134. type: 'success'
  135. });
  136. await this.logout();
  137. // this.$router.push('/login');
  138. })
  139. .catch(err => {
  140. console.error(err);
  141. });
  142. }).catch(() => {
  143. // 取消操作
  144. });
  145. },
  146. // 导航栏切换
  147. setActive(Index) {
  148. this.isActive = Index;
  149. }
  150. },
  151. mounted() {
  152. const index = this.$route.query.index; // 123
  153. console.log(index);
  154. if (this.userinfo.role == 1
  155. && this.userinfo.rrole == 1
  156. && this.userinfo.type ==1
  157. && this.fromL.admin.school.list
  158. && this.fromL.admin.school.list[0]
  159. && this.fromL.admin.school.list[0].children
  160. && this.fromL.admin.school.list[0].children.length) {
  161. console.log('111');
  162. this.schId = this.fromL.admin.school.list[0].children[0].schoolid
  163. this.schOrg = this.fromL.admin.school.list[0].children[0].orgid
  164. }else{
  165. console.log('222');
  166. this.schId = this.userinfo.organizeid
  167. this.schOrg = this.userinfo.org
  168. }
  169. if (index == 2) {
  170. this.isActive = 2
  171. this.isIndex2 = 2
  172. }else if (index == 1) {
  173. this.isIndex2 = 2
  174. }
  175. }
  176. }
  177. </script>
  178. <style scoped>
  179. .top{
  180. width: 100%;
  181. display: flex;
  182. height: 60px;
  183. box-sizing: border-box;
  184. padding-right: 10px;
  185. }
  186. .midBlo{
  187. height: calc(100% - 60px);
  188. overflow: hidden;
  189. }
  190. .topCon{
  191. display: flex;
  192. width: 100%;
  193. justify-content: space-between;
  194. align-items: center;
  195. }
  196. .title{
  197. font-family: PingFang SC;
  198. font-weight: 400;
  199. font-size: 14px;
  200. line-height: 100%;
  201. letter-spacing: 0%;
  202. color: #969BA3;
  203. display: flex;
  204. gap: 11px;
  205. display: flex;
  206. }
  207. .person{
  208. display: flex;
  209. align-items: center;
  210. }
  211. .person_name{
  212. display: flex;
  213. gap: 9px;
  214. }
  215. .personInfo{
  216. display: flex;
  217. flex-direction: column;
  218. justify-content: space-between;
  219. padding: 5px 0 2px;
  220. box-sizing: border-box;
  221. }
  222. .personInfoTit{
  223. font-family: PingFang SC;
  224. font-weight: 500;
  225. font-size: 14px;
  226. line-height: 100%;
  227. color: #000000;
  228. }
  229. .personInfoBri{
  230. font-family: PingFang SC;
  231. font-weight: 300;
  232. font-size: 10px;
  233. line-height: 100%;
  234. color: #969BA3;
  235. }
  236. .KanBan {
  237. background-color: #FAFAFA;
  238. /* 设置高度为视口高度 */
  239. height: 100%;
  240. padding: 0 120px;
  241. box-sizing: border-box;
  242. font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  243. }
  244. .KanBan_top {
  245. border-radius: 10px;
  246. width: 69vw;
  247. height: 144px;
  248. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  249. margin: 0px auto;
  250. display: flex;
  251. justify-content: space-between;
  252. align-items: center;
  253. }
  254. .Con{
  255. width: 100%;
  256. }
  257. .top_textArea {
  258. margin-left: 23px;
  259. }
  260. .top_title {
  261. font-size: 30px;
  262. font-weight: bold;
  263. display: flex;
  264. margin-bottom: 8px;
  265. }
  266. .top_title div {
  267. color: #0354d7;
  268. margin: 0 7px;
  269. }
  270. .imgArea {
  271. margin-right: 23px;
  272. }
  273. .imgArea img {
  274. width: 96px;
  275. height: 96px;
  276. }
  277. .buttonArea {
  278. display: flex;
  279. justify-content: center;
  280. padding-top: 20px;
  281. border-bottom: 1px #e7e7e7 solid;
  282. }
  283. .btnDiv {
  284. height: 48px;
  285. width: 72px;
  286. text-align: center;
  287. line-height: 48px;
  288. font-size: 18px;
  289. /* margin-left: 15px; */
  290. cursor: pointer;
  291. }
  292. .btnDiv.active {
  293. font-weight: 600;
  294. border-bottom: 3px #0663FE solid;
  295. }
  296. .mainArea {
  297. width: 100%;
  298. margin-top: 30px;
  299. display: flex;
  300. gap: 30px;
  301. height: 100%;
  302. }
  303. .right_content{
  304. width: 100%;
  305. height: calc(100% - 101px);
  306. overflow: auto;
  307. overflow: auto;
  308. padding-right: 10px;
  309. padding-bottom: 50px;
  310. box-sizing: border-box;
  311. }
  312. </style>