|
@@ -53,22 +53,60 @@
|
|
|
</span>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
+ <div class="cha" v-if="userinfo.type == 1 && userinfo.role == 1" @click.stop="delApp(item.lid)">
|
|
|
+ ✖
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <!-- <div class="footListCon footListCon2">
|
|
|
+ <div v-if="userinfo.type == 1 && userinfo.role == 1" @click="openUsuallyApp" class="footListCon footListCon2">
|
|
|
<div style="margin-bottom: 8px;font-size: 40px;color: #0354D7;">+</div>
|
|
|
<div class="TabListBri">添加常用应用</div>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 常见应用弹框 -->
|
|
|
+ <el-dialog
|
|
|
+ title="应用列表"
|
|
|
+ :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;height: 300px;overflow: auto;">
|
|
|
+ <div v-for="(item,index) in isAdd(usuallyList)" class="tabCon" @click="addApp(item.id)" :key="index" style="min-width: 308px;">
|
|
|
+ <div class="AppList">
|
|
|
+ <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>
|
|
|
+ <div style="position: absolute;top: 6px;right: 15px;" v-if="tab.includes(item.id)">
|
|
|
+ ✔
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="height: 45px;line-height: 45px;text-align: end;">
|
|
|
+ <el-button @click="handleClose">取消</el-button>
|
|
|
+ <el-button @click="addUsuallyApp" type="primary">确认</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex';
|
|
|
import store from '../store'
|
|
|
+import { API_CONFIG } from "@/common/apiConfig";
|
|
|
|
|
|
export default {
|
|
|
- props:['CocoFlowList'],
|
|
|
computed: {
|
|
|
...mapGetters(['userinfo','fromL']),
|
|
|
// 如果hk,com没有图标,默认使用cn的
|
|
@@ -111,30 +149,182 @@ import store from '../store'
|
|
|
}
|
|
|
return data
|
|
|
}
|
|
|
+ },
|
|
|
+ isAdd(){
|
|
|
+ return function(val){
|
|
|
+ const difference = val.filter(item1 =>
|
|
|
+ !this.CocoFlowList.some(item2 => item1.id === item2.id)
|
|
|
+ );
|
|
|
+ // console.log('difference',difference);
|
|
|
+
|
|
|
+ // let data = val.filter(e=>{
|
|
|
+ // return !this.CocoFlowList.includes(e.id)
|
|
|
+ // })
|
|
|
+ return difference
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ dialogVisible:false,
|
|
|
+ //常见ai应用列表
|
|
|
+ usuallyList:[],
|
|
|
+ loading:false,
|
|
|
+ //选中应用列表
|
|
|
+ tab:[],
|
|
|
+ // 已添加ai应用数组
|
|
|
+ CocoFlowList:[]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async openApp(val){
|
|
|
+ // 删除应用
|
|
|
+ delApp(val){
|
|
|
+ console.log(val);
|
|
|
+
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ functionName: API_CONFIG.ajax_del_usuallyApp.functionName,
|
|
|
+ aid: val,
|
|
|
+ },
|
|
|
+ ];
|
|
|
|
|
|
+ this.$ajax
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
+ .then(() => {
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ this.getData()
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ this.$message.error("删除失败");
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ handleClose(){
|
|
|
+ this.usuallyList= []
|
|
|
+ this.tab= []
|
|
|
+ this.dialogVisible = false
|
|
|
+ },
|
|
|
+ // 弹框选着添加应用
|
|
|
+ addApp(val){
|
|
|
+
|
|
|
+ let data = this.CocoFlowList.filter(e=>{
|
|
|
+ return e.id == val
|
|
|
+ })
|
|
|
+ if (data.length != 0) return this.$message.info('常用列表已添加')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ const index = this.tab.indexOf(val);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.tab.splice(index, 1); // 删除第一个匹配项
|
|
|
+ } else {
|
|
|
+ this.tab.push(val); // 添加元素到末尾
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 打开常见应用弹框
|
|
|
+ openUsuallyApp(){
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.loading = true
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ functionName: API_CONFIG.ajax_usuallyApp.functionName,
|
|
|
+ uid: this.userinfo.userid,
|
|
|
+ cn: this.userinfo.schoolArea ? this.userinfo.schoolArea : this.userinfo.orgArea, //学校id
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ this.$ajax
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
+ .then((res) => {
|
|
|
+ this.usuallyList = res.data[0]
|
|
|
+
|
|
|
+
|
|
|
+ this.loading = false
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error("获取工具数据失败");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 添加常用确定按钮
|
|
|
+ async addUsuallyApp(){
|
|
|
+
|
|
|
+ const uploadYn = async files => {
|
|
|
+ for (let index = 0; index < files.length; index++) {
|
|
|
+ await this.XAdd(files[index]);
|
|
|
+ console.log(index);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ await uploadYn(this.tab);
|
|
|
+ console.log('完成了');
|
|
|
+
|
|
|
+
|
|
|
+ this.getData()
|
|
|
+
|
|
|
+ },
|
|
|
+ XAdd(val){
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ functionName: API_CONFIG.ajax_add_usuallyApp.functionName,
|
|
|
+ oid:this.userinfo.organizeid,
|
|
|
+ aid: val,
|
|
|
+ uid: this.userinfo.userid,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ this.$ajax
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
+ .then(() => {
|
|
|
+ resolve(1)
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取已添加cocoFlow应用
|
|
|
+ getData(){
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ functionName: API_CONFIG.ajax_addedUsuallyApp.functionName,
|
|
|
+ oid: this.userinfo.organizeid,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ this.$ajax
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
+ .then((res) => {
|
|
|
+ this.CocoFlowList = res.data[0]
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ this.$message.error("获取工具数据失败");
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // 打开平台应用
|
|
|
+ async openApp(val){
|
|
|
// 点击相同应用不刷新
|
|
|
if (this.appSign == val.toolId) return
|
|
|
// 更新标识
|
|
|
await store.commit('user/SET_AppSIGN', val.toolId)
|
|
|
|
|
|
-
|
|
|
let url = ''
|
|
|
val.url.forEach(e => {
|
|
|
- if (e.region == this.userinfo.schoolArea || e.region == this.userinfo.orgArea) {
|
|
|
+ // if (e.region == this.userinfo.schoolArea || e.region == this.userinfo.orgArea) {
|
|
|
+ if (e.region == "beta") {
|
|
|
url = e.url
|
|
|
}
|
|
|
});
|
|
|
- console.log('url111111111111',url);
|
|
|
-
|
|
|
|
|
|
let _userinfo = this.userinfo, //登录用户信息
|
|
|
{ userid: _userid, organizeid: _oid, type: _type, org: _org, role: _role, classid: _classId } = _userinfo; // 解构赋值获取用户信息
|
|
@@ -186,6 +376,7 @@ import store from '../store'
|
|
|
// window.topU.U.MD.D.I.openApplicationWai(val.toolId, url, dom,val.argumentList)
|
|
|
|
|
|
},
|
|
|
+ // 打开CocoFlow应用
|
|
|
openNewWindow(val) {
|
|
|
console.log(val);
|
|
|
|
|
@@ -197,7 +388,64 @@ import store from '../store'
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+.moreDia >>> .el-dialog{
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+.moreDia >>> .el-dialog__body{
|
|
|
+ height: 345px;
|
|
|
+ /* overflow: auto; */
|
|
|
+ border-top: 1px #e7e7e7 solid;
|
|
|
+}
|
|
|
+.conBlock{
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 24px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-bottom: 24px;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+.tabCon{
|
|
|
+ transition: all 0.3s ease; /* 统一过渡效果 */
|
|
|
+ border-radius: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
|
|
|
+.con{
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 12px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+.tit{
|
|
|
+ color: #1f2937;font-size: 16px;height: 24px;line-height: 24px;
|
|
|
+ -webkit-line-clamp: 1;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
+.bri{
|
|
|
+ color: #6b7280;font-size: 12px;height: 16px;line-height: 16px;
|
|
|
+ overflow: hidden;
|
|
|
+ -webkit-line-clamp: 1;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
+.appImg{
|
|
|
+ width: 48px;
|
|
|
+ height: 48px;
|
|
|
+ border-radius: 50%;
|
|
|
+ object-fit: cover;
|
|
|
+}
|
|
|
+.AppList{
|
|
|
+ flex-wrap: wrap;display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ border: 1px rgb(243 244 246 / var(--tw-border-opacity, 1)) solid;
|
|
|
+ border-radius: 10px;padding: 16px;box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
.footCon{
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
@@ -213,7 +461,7 @@ import store from '../store'
|
|
|
justify-content: center;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
-
|
|
|
+ max-width: 187px;
|
|
|
}
|
|
|
.footListCon{
|
|
|
background-color: #fff;
|
|
@@ -226,11 +474,18 @@ import store from '../store'
|
|
|
background-image: radial-gradient(#E6F0FF 1px, transparent 1px);
|
|
|
background-size: 20px 20px;
|
|
|
cursor: pointer;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
.footListCon: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);
|
|
|
}
|
|
|
+.cha{
|
|
|
+ display: none;position: absolute;top: 10px;right: 10px;
|
|
|
+}
|
|
|
+.footListCon:hover .cha{
|
|
|
+ display: block;
|
|
|
+}
|
|
|
.footConLeft{
|
|
|
padding: 25px;
|
|
|
min-width: 50px;
|