123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- <template>
- <div style="width: 100%;">
- <div style="color: #1f2937;font-weight: 600;font-size: 20px;margin-bottom: 16px;">
- 热门应用
- </div>
- <div class="hotAppBlo" >
- <div class="BigBlo" v-for="(k,ind) in hotApp" :key="ind+'p'" >
- <div class="conBlock">
- <div class="conBlockOne conW1" @click="openNewWindow(k[0])" >
- <div class="conBlockTwo">
- <img class="appImg" :src="JSON.parse(k[0].json).icon" alt="">
- <div class="con">
- <div class="tit">{{ k[0].name }}</div>
- <div class="bri">
- <el-tooltip class="item" effect="light" :content="k[0].detail" placement="bottom">
- <span>
- {{ k[0].detail }}
- </span>
- </el-tooltip>
- </div>
- </div>
- </div>
-
- <img class="hg" style="width: 20px;" src="../assets/img/hg1.svg" alt="">
- </div>
- <div style="display: flex;" class="conBlock2">
- <div v-for="(item,index) in list(k)"
- class="tabCon" @click="openNewWindow(item)" :key="index">
- <div style="display: flex;flex-direction: column; gap: 12px;">
- <img class="appImg" :src="JSON.parse(item.json).icon" alt="">
- <div class="con">
- <div class="tit">{{ item.name }}</div>
- <div class="bri">
- <el-tooltip class="item" effect="light" :content="item.detail" placement="bottom">
- <span>
- {{ item.detail }}
- </span>
- </el-tooltip>
- </div>
- </div>
- <img class="hg" style="width: 20px;" v-if="index == 0" src="../assets/img/hg2.svg" alt="">
- <img class="hg" style="width: 20px;" v-if="index == 1" src="../assets/img/hg3.svg" alt="">
- </div>
- </div>
- </div>
- </div>
- <div style="display: flex;justify-content: space-between;">
- <div class="AppTit">{{ tab[ind].name }}</div>
- <div class="AppBri" @click="lookMore(ind)">查看全部</div>
- </div>
- </div>
-
- </div>
- <el-dialog
- :title="diaTit"
- :visible.sync="dialogVisible"
- class="moreDia"
- :close-on-click-modal="false"
- :modal="false"
- width="60%"
- :before-close="handleClose">
- <div v-loading="loading" style="display: grid;grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));gap: 16px;">
- <div v-for="(item,index) in moreList"
- class="tabConDia" @click="openNewWindow(item)"
- :key="index" >
- <div style="display: flex;align-items: center;">
- <img class="appImg" :src="JSON.parse(item.json).icon" alt="">
- <div class="con" style="height: auto;">
- <div class="tit">{{ item.name }}</div>
- <div class="bri">
- <el-tooltip class="item" effect="light" :content="item.detail" placement="bottom">
- <span>
- {{ item.detail }}
- </span>
- </el-tooltip>
- </div>
- </div>
- </div>
- <img class="hg" style="width: 20px;" v-if="index == 0" src="../assets/img/hg1.svg" alt="">
- <img class="hg" style="width: 20px;" v-if="index == 1" src="../assets/img/hg2.svg" alt="">
- <img class="hg" style="width: 20px;" v-if="index == 2" src="../assets/img/hg3.svg" alt="">
- </div>
- </div>
- </el-dialog>
-
- </div>
- </template>
- <script>
- import { API_CONFIG } from "@/common/apiConfig";
- import { mapGetters } from 'vuex';
- export default {
- props:['hotApp'],
- computed: {
- ...mapGetters(['userinfo','userinfo2']),
- list(){
- return function(val) {
- // console.log(val);
- let newArr = val.slice(1)
- return newArr
- }
- },
- roleUser(){
- return this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&& this.userinfo2 !== '' ? this.userinfo2 : this.userinfo
- }
- },
- data() {
- return {
- tab:[
- {name:'项目式学习',type:'63915be8-cefa-11ef-a2d1-005056b86db5'},
- {name:'教学工具',type:'38111096-cc11-11ef-a2d1-005056b86db5'},
- {name:'学习工具',type:'917a5a56-abd5-11ef-b887-005056b86db5'},
- {name:'效率工具',type:'9b257041-abd5-11ef-b887-005056b86db5'},
- ],
- // 控制弹框展开
- dialogVisible:false,
- // 查看更多标题
- diaTit:'',
- // 查看更多弹框list
- moreList:[],
- loading:false
- }
- },
- methods: {
- openNewWindow(val) {
- console.log(val);
-
- // // 基本用法:打开指定 URL
- window.open(val.url, "_blank");
- },
- handleClose(){
- this.dialogVisible = false
- },
- lookMore(index){
- this.dialogVisible = true
- this.diaTit = this.tab[index].name
- this.loading = true
- let params = [
- {
- functionName: API_CONFIG.ajax_morHotApp.functionName,
- uid: this.roleUser.userid,
- type: this.tab[index].type,
- cn: this.roleUser.schoolArea ? this.roleUser.schoolArea : this.roleUser.orgArea, //学校id
- },
- ];
- this.$ajax
- .post(API_CONFIG.baseUrl, params)
- .then((res) => {
- this.moreList = res.data[0]
-
-
- this.loading = false
- })
- .catch((err) => {
- console.log(err);
- this.loading = false
- this.$message.error("获取工具数据失败");
- });
- }
- },
- }
- </script>
- <style scoped>
- .hotAppBlo{
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: 20px;
-
- }
- .BigBlo{
- background-color: #EFEFEF;
- border-radius: 10px;
- padding: 20px;
- border: 1px solid #BDBDBD;
- box-shadow: 0px 0px 40px 0px #0000000D;
- }
- .conBlock{
- display: flex;
- box-sizing: border-box;
- margin-bottom: 10px;
- border-radius: 10px;
- height: calc(100% - 20px);
- gap: 10px;
- flex-direction: column;
- justify-content: space-around;
- }
- .AppBri{
- font-family: PingFang SC;
- font-weight: 600;
- font-size: 14px;
- line-height: 100%;
- letter-spacing: 0%;
- text-align: right;
- color: #969BA3;
- cursor: pointer;
- }
- .AppTit{
- font-family: PingFang SC;
- font-weight: 600;
- font-size: 16px;
- line-height: 100%;
- }
- .conBlockOne{
- background-color: #fff;
- border-radius: 10px;
- padding: 26px 14px;
- box-sizing: border-box;
- position: relative;
- overflow: hidden;
- justify-content: flex-start;
- position: relative;
- cursor: pointer;
- transition: all 0.3s ease; /* 统一过渡效果 */
- }
- .conBlockOne:hover{
- transform: translateY(-5px); /* 向上位移 */
- box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
- }
- .conBlockTwo{
- width: 100%;
- height: 90px;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- margin-top: auto; /* 将子元素推到底部 */
- gap: 12px;
- }
- .conBlock2{
- justify-content: space-between;
- gap: 10px;
- }
- .moreDia >>> .el-dialog{
- border-radius: 10px;
- }
- .moreDia >>> .el-dialog__body{
- height: 300px;
- overflow: auto;
- border-top: 1px #e7e7e7 solid;
- }
- .AppList{
- position: relative;
- flex-wrap: wrap;display: flex;
- justify-content: space-between;
- overflow: hidden;
- background: #fff;
- border: 1px rgb(243 244 246 / var(--tw-border-opacity, 1)) solid;
- border-radius: 10px;
- padding: 16px;box-sizing: border-box;
- }
- .conW1{
- /* height: 100%; */
-
- width: 100%;
- height: 50%;
- min-height: 100px;
- }
- .tabCon{
- transition: all 0.3s ease; /* 统一过渡效果 */
- border-radius: 10px;
- cursor: pointer;
- display: flex;
- width: 50%;
- height: 100%;
- min-height: 115px;
- background: #fff;
- padding: 26px 14px;
- box-sizing: border-box;
- position: relative;
- overflow: hidden;
- }
- .tabConDia{
- border-radius: 10px;
- cursor: pointer;
- display: grid;grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
- min-height: 80px;
- background: #fff;
- padding: 15px;
- box-sizing: border-box;
- position: relative;
- overflow: hidden;
- min-width: 308px;border: 1px #e7e7e7 solid;
- }
- .tabCon:hover{
- transform: translateY(-5px); /* 向上位移 */
- box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
- }
- .hg {
- width: 28px !important;
- height: 28px;
- position: absolute;
- top: 0;
- right: 0;
- }
- .con{
- flex: 1;
- display: flex;
- flex-direction: column;
- gap: 6px;
- height: 54px;
- justify-content: flex-end;
- }
- .appImg{
- width: 32px;
- height: 32px;
- border-radius: 50%;
- object-fit: cover;
- margin-right: 10px;
- }
- .tit{
- color: #000000;
- -webkit-line-clamp: 1;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
- text-overflow: ellipsis;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 14px;
- line-height: 100%;
- }
- .bri{
- color: #969BA3;
- -webkit-line-clamp: 1;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
- text-overflow: ellipsis;
- font-family: PingFang SC;
- font-weight: 300;
- font-size: 10px;
- line-height: 12px;
- }
- </style>
|