botPage.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <div style="width: 100%;">
  3. <div style="color: #1f2937;font-weight: 600;font-size: 20px;margin-bottom: 16px;">
  4. 热门应用
  5. </div>
  6. <div class="hotAppBlo" >
  7. <div class="BigBlo" v-for="(k,ind) in hotApp" :key="ind+'p'" >
  8. <div class="conBlock">
  9. <div class="conBlockOne conW1" @click="openNewWindow(k[0])" >
  10. <div class="conBlockTwo">
  11. <img class="appImg" :src="JSON.parse(k[0].json).icon" alt="">
  12. <div class="con">
  13. <div class="tit">{{ k[0].name }}</div>
  14. <div class="bri">
  15. <el-tooltip class="item" effect="light" :content="k[0].detail" placement="bottom">
  16. <span>
  17. {{ k[0].detail }}
  18. </span>
  19. </el-tooltip>
  20. </div>
  21. </div>
  22. </div>
  23. <img class="hg" style="width: 20px;" src="../assets/img/hg1.svg" alt="">
  24. </div>
  25. <div style="display: flex;" class="conBlock2">
  26. <div v-for="(item,index) in list(k)"
  27. class="tabCon" @click="openNewWindow(item)" :key="index">
  28. <div style="display: flex;flex-direction: column; gap: 12px;">
  29. <img class="appImg" :src="JSON.parse(item.json).icon" alt="">
  30. <div class="con">
  31. <div class="tit">{{ item.name }}</div>
  32. <div class="bri">
  33. <el-tooltip class="item" effect="light" :content="item.detail" placement="bottom">
  34. <span>
  35. {{ item.detail }}
  36. </span>
  37. </el-tooltip>
  38. </div>
  39. </div>
  40. <img class="hg" style="width: 20px;" v-if="index == 0" src="../assets/img/hg2.svg" alt="">
  41. <img class="hg" style="width: 20px;" v-if="index == 1" src="../assets/img/hg3.svg" alt="">
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div style="display: flex;justify-content: space-between;">
  47. <div class="AppTit">{{ tab[ind].name }}</div>
  48. <div class="AppBri" @click="lookMore(ind)">查看全部</div>
  49. </div>
  50. </div>
  51. </div>
  52. <el-dialog
  53. :title="diaTit"
  54. :visible.sync="dialogVisible"
  55. class="moreDia"
  56. :close-on-click-modal="false"
  57. :modal="false"
  58. width="60%"
  59. :before-close="handleClose">
  60. <div v-loading="loading" style="display: grid;grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));gap: 16px;">
  61. <div v-for="(item,index) in moreList"
  62. class="tabConDia" @click="openNewWindow(item)"
  63. :key="index" >
  64. <div style="display: flex;align-items: center;">
  65. <img class="appImg" :src="JSON.parse(item.json).icon" alt="">
  66. <div class="con" style="height: auto;">
  67. <div class="tit">{{ item.name }}</div>
  68. <div class="bri">
  69. <el-tooltip class="item" effect="light" :content="item.detail" placement="bottom">
  70. <span>
  71. {{ item.detail }}
  72. </span>
  73. </el-tooltip>
  74. </div>
  75. </div>
  76. </div>
  77. <img class="hg" style="width: 20px;" v-if="index == 0" src="../assets/img/hg1.svg" alt="">
  78. <img class="hg" style="width: 20px;" v-if="index == 1" src="../assets/img/hg2.svg" alt="">
  79. <img class="hg" style="width: 20px;" v-if="index == 2" src="../assets/img/hg3.svg" alt="">
  80. </div>
  81. </div>
  82. </el-dialog>
  83. </div>
  84. </template>
  85. <script>
  86. import { API_CONFIG } from "@/common/apiConfig";
  87. import { mapGetters } from 'vuex';
  88. export default {
  89. props:['hotApp'],
  90. computed: {
  91. ...mapGetters(['userinfo','userinfo2']),
  92. list(){
  93. return function(val) {
  94. // console.log(val);
  95. let newArr = val.slice(1)
  96. return newArr
  97. }
  98. },
  99. roleUser(){
  100. return this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&& this.userinfo2 !== '' ? this.userinfo2 : this.userinfo
  101. }
  102. },
  103. data() {
  104. return {
  105. tab:[
  106. {name:'项目式学习',type:'63915be8-cefa-11ef-a2d1-005056b86db5'},
  107. {name:'教学工具',type:'38111096-cc11-11ef-a2d1-005056b86db5'},
  108. {name:'学习工具',type:'917a5a56-abd5-11ef-b887-005056b86db5'},
  109. {name:'效率工具',type:'9b257041-abd5-11ef-b887-005056b86db5'},
  110. ],
  111. // 控制弹框展开
  112. dialogVisible:false,
  113. // 查看更多标题
  114. diaTit:'',
  115. // 查看更多弹框list
  116. moreList:[],
  117. loading:false
  118. }
  119. },
  120. methods: {
  121. openNewWindow(val) {
  122. console.log(val);
  123. // // 基本用法:打开指定 URL
  124. window.open(val.url, "_blank");
  125. },
  126. handleClose(){
  127. this.dialogVisible = false
  128. },
  129. lookMore(index){
  130. this.dialogVisible = true
  131. this.diaTit = this.tab[index].name
  132. this.loading = true
  133. let params = [
  134. {
  135. functionName: API_CONFIG.ajax_morHotApp.functionName,
  136. uid: this.roleUser.userid,
  137. type: this.tab[index].type,
  138. cn: this.roleUser.schoolArea ? this.roleUser.schoolArea : this.roleUser.orgArea, //学校id
  139. },
  140. ];
  141. this.$ajax
  142. .post(API_CONFIG.baseUrl, params)
  143. .then((res) => {
  144. this.moreList = res.data[0]
  145. this.loading = false
  146. })
  147. .catch((err) => {
  148. console.log(err);
  149. this.loading = false
  150. this.$message.error("获取工具数据失败");
  151. });
  152. }
  153. },
  154. }
  155. </script>
  156. <style scoped>
  157. .hotAppBlo{
  158. display: grid;
  159. grid-template-columns: repeat(4, 1fr);
  160. gap: 20px;
  161. }
  162. .BigBlo{
  163. background-color: #EFEFEF;
  164. border-radius: 10px;
  165. padding: 20px;
  166. border: 1px solid #BDBDBD;
  167. box-shadow: 0px 0px 40px 0px #0000000D;
  168. }
  169. .conBlock{
  170. display: flex;
  171. box-sizing: border-box;
  172. margin-bottom: 10px;
  173. border-radius: 10px;
  174. height: calc(100% - 20px);
  175. gap: 10px;
  176. flex-direction: column;
  177. justify-content: space-around;
  178. }
  179. .AppBri{
  180. font-family: PingFang SC;
  181. font-weight: 600;
  182. font-size: 14px;
  183. line-height: 100%;
  184. letter-spacing: 0%;
  185. text-align: right;
  186. color: #969BA3;
  187. cursor: pointer;
  188. }
  189. .AppTit{
  190. font-family: PingFang SC;
  191. font-weight: 600;
  192. font-size: 16px;
  193. line-height: 100%;
  194. }
  195. .conBlockOne{
  196. background-color: #fff;
  197. border-radius: 10px;
  198. padding: 26px 14px;
  199. box-sizing: border-box;
  200. position: relative;
  201. overflow: hidden;
  202. justify-content: flex-start;
  203. position: relative;
  204. cursor: pointer;
  205. transition: all 0.3s ease; /* 统一过渡效果 */
  206. }
  207. .conBlockOne:hover{
  208. transform: translateY(-5px); /* 向上位移 */
  209. box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  210. }
  211. .conBlockTwo{
  212. width: 100%;
  213. height: 90px;
  214. box-sizing: border-box;
  215. display: flex;
  216. flex-direction: column;
  217. margin-top: auto; /* 将子元素推到底部 */
  218. gap: 12px;
  219. }
  220. .conBlock2{
  221. justify-content: space-between;
  222. gap: 10px;
  223. }
  224. .moreDia >>> .el-dialog{
  225. border-radius: 10px;
  226. }
  227. .moreDia >>> .el-dialog__body{
  228. height: 300px;
  229. overflow: auto;
  230. border-top: 1px #e7e7e7 solid;
  231. }
  232. .AppList{
  233. position: relative;
  234. flex-wrap: wrap;display: flex;
  235. justify-content: space-between;
  236. overflow: hidden;
  237. background: #fff;
  238. border: 1px rgb(243 244 246 / var(--tw-border-opacity, 1)) solid;
  239. border-radius: 10px;
  240. padding: 16px;box-sizing: border-box;
  241. }
  242. .conW1{
  243. /* height: 100%; */
  244. width: 100%;
  245. height: 50%;
  246. min-height: 100px;
  247. }
  248. .tabCon{
  249. transition: all 0.3s ease; /* 统一过渡效果 */
  250. border-radius: 10px;
  251. cursor: pointer;
  252. display: flex;
  253. width: 50%;
  254. height: 100%;
  255. min-height: 115px;
  256. background: #fff;
  257. padding: 26px 14px;
  258. box-sizing: border-box;
  259. position: relative;
  260. overflow: hidden;
  261. }
  262. .tabConDia{
  263. border-radius: 10px;
  264. cursor: pointer;
  265. display: grid;grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  266. min-height: 80px;
  267. background: #fff;
  268. padding: 15px;
  269. box-sizing: border-box;
  270. position: relative;
  271. overflow: hidden;
  272. min-width: 308px;border: 1px #e7e7e7 solid;
  273. }
  274. .tabCon:hover{
  275. transform: translateY(-5px); /* 向上位移 */
  276. box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  277. }
  278. .hg {
  279. width: 28px !important;
  280. height: 28px;
  281. position: absolute;
  282. top: 0;
  283. right: 0;
  284. }
  285. .con{
  286. flex: 1;
  287. display: flex;
  288. flex-direction: column;
  289. gap: 6px;
  290. height: 54px;
  291. justify-content: flex-end;
  292. }
  293. .appImg{
  294. width: 32px;
  295. height: 32px;
  296. border-radius: 50%;
  297. object-fit: cover;
  298. margin-right: 10px;
  299. }
  300. .tit{
  301. color: #000000;
  302. -webkit-line-clamp: 1;
  303. display: -webkit-box;
  304. -webkit-box-orient: vertical;
  305. overflow: hidden;
  306. text-overflow: ellipsis;
  307. font-family: PingFang SC;
  308. font-weight: 500;
  309. font-size: 14px;
  310. line-height: 100%;
  311. }
  312. .bri{
  313. color: #969BA3;
  314. -webkit-line-clamp: 1;
  315. display: -webkit-box;
  316. -webkit-box-orient: vertical;
  317. overflow: hidden;
  318. text-overflow: ellipsis;
  319. font-family: PingFang SC;
  320. font-weight: 300;
  321. font-size: 10px;
  322. line-height: 12px;
  323. }
  324. </style>