Преглед на файлове

修改应用显示问题

11wqe1 преди 4 седмици
родител
ревизия
d4256a6a8b
променени са 3 файла, в които са добавени 127 реда и са изтрити 92 реда
  1. 2 2
      src/components/topPage.vue
  2. 27 25
      src/store/modules/user.js
  3. 98 65
      src/views/HomeView.vue

+ 2 - 2
src/components/topPage.vue

@@ -89,7 +89,7 @@
 
                             <img
                             style="margin-bottom: 12px;height: 40px;width: 40px;object-fit: contain;"  
-                            v-else :src="item.json.icon" alt="">
+                            v-else :src="JSON.parse(item.json).icon" alt="">
                         </div>
                            
                             
@@ -120,7 +120,7 @@
                             <img v-if="fromL.admin.cocoFlow2[index] && fromL.admin.cocoFlow2[index].setIcon" 
                                 class="footListConimgPic"
                                 :src="fromL.admin.cocoFlow2[index].setIcon" alt="">
-                            <img v-else class="footListConimgPic" :src="item.json.icon" alt="">
+                            <img v-else class="footListConimgPic" :src="JSON.parse(item.json).icon" alt="">
                             
                             <!-- <img v-else class="footListConimgPic" :src="require('../assets/img/cocoflow2.svg')" alt=""> -->
                         </div>

+ 27 - 25
src/store/modules/user.js

@@ -166,7 +166,7 @@ const actions = {
       // 第一步
       let res = await axios.post(API_CONFIG.baseUrl, params)
       let perData= JSON.parse(res.data[0][0].json)
-
+      
       // 第二步
       let params2 = [
 				{
@@ -212,31 +212,32 @@ const actions = {
 				}
 			});
       
-      if (perData.admin.cocoFlow) {
-				perData.admin.cocoFlow.forEach((i, index) => {
-					let _index = appList.findIndex((i2) => i.id == i2.id);
-					if (_index != -1) {
-						let _setData = appList[_index];
-						_setData.setIcon = i.setIcon;
-						perData.admin.cocoFlow[index] = _setData;
-					} else {
-						console.log("无应用", i);
-					}
-				});
-			}
+      
+      // if (perData.admin.cocoFlow) {
+			// 	perData.admin.cocoFlow.forEach((i, index) => {
+			// 		let _index = appList.findIndex((i2) => i.id == i2.id);
+			// 		if (_index != -1) {
+			// 			let _setData = appList[_index];
+			// 			_setData.setIcon = i.setIcon;
+			// 			perData.admin.cocoFlow[index] = _setData;
+			// 		} else {
+			// 			console.log("无应用", i);
+			// 		}
+			// 	});
+			// }
 
-      if (perData.admin.cocoFlow2) {
-        perData.admin.cocoFlow2.forEach((i, index) => {
-          let _index = appList.findIndex((i2) => i.id == i2.id);
-          if (_index != -1) {
-          let _setData = appList[_index];
-          _setData.setIcon = i.setIcon;
-          perData.admin.cocoFlow2[index] = _setData;
-        } else {
-          console.log("无应用", i);
-        }
-        });
-      }
+      // if (perData.admin.cocoFlow2) {
+      //   perData.admin.cocoFlow2.forEach((i, index) => {
+      //     let _index = appList.findIndex((i2) => i.id == i2.id);
+      //     if (_index != -1) {
+      //     let _setData = appList[_index];
+      //     _setData.setIcon = i.setIcon;
+      //     perData.admin.cocoFlow2[index] = _setData;
+      //   } else {
+      //     console.log("无应用", i);
+      //   }
+      //   });
+      // }
 
 
       if (perData.admin.CampusF && perData.admin.CampusF.appList) {
@@ -251,6 +252,7 @@ const actions = {
 						console.log("无应用", i);
 					}
 				});
+        perData.admin.CampusF.appList = perData.admin.CampusF.appList.filter(Boolean);
 			}
 
 

+ 98 - 65
src/views/HomeView.vue

@@ -2,7 +2,11 @@
 	<div class="body">
 		<div class="container">
 			<div class="leftBar" style="height: 100%">
-				<sidebarL @getPer="getPer" @AddAppJson="AddAppJson" ref="sidebarLRef"></sidebarL>
+				<sidebarL
+					@getPer="getPer"
+					@AddAppJson="AddAppJson"
+					ref="sidebarLRef"
+				></sidebarL>
 			</div>
 			<div class="table-container">
 				<div class="top">
@@ -15,16 +19,22 @@
 						</div>
 						<div class="person">
 							<div class="person_name">
-								<img @click="openData()" style="
+								<img
+									@click="openData()"
+									style="
 										width: 40px;
 										height: 40px;
 										object-fit: cover;
 										border-radius: 50%;
 										cursor: pointer;
-									" :src="roleUser.headportrait
+									"
+									:src="
+										roleUser.headportrait
 											? roleUser.headportrait
 											: require('../assets/img/toux2.png')
-										" alt="" />
+									"
+									alt=""
+								/>
 								<div class="personInfo">
 									<div class="personInfoTit">
 										{{ roleUser.username }}
@@ -34,13 +44,22 @@
 									</div>
 								</div>
 							</div>
-							<el-button type="text" @click="handleLogout" style="margin-left: 20px">退出</el-button>
+							<el-button
+								type="text"
+								@click="handleLogout"
+								style="margin-left: 20px"
+								>退出</el-button
+							>
 						</div>
 					</div>
 				</div>
 
 				<!-- 首页 -->
-				<homepageL @AddAppJson="AddAppJson" v-show="!appSign" ref="homepageLRef"></homepageL>
+				<homepageL
+					@AddAppJson="AddAppJson"
+					v-show="!appSign"
+					ref="homepageLRef"
+				></homepageL>
 
 				<!-- 循环数组展示iframe  -->
 				<div v-for="(item, index) in AppJSon" :key="index">
@@ -49,13 +68,17 @@
 						<iframe
 							allow="camera *; microphone *;display-capture;midi;encrypted-media;fullscreen *;"
 							frameborder="no"
-							style="border: 0; width: 100%; height: calc(100vh - 60px)" :src="item.json"
-							:ref="item.toolId">
+							style="border: 0; width: 100%; height: calc(100vh - 60px)"
+							:src="item.json"
+							:ref="item.toolId"
+						>
 						</iframe>
 					</div>
 				</div>
 
-				<div v-if="loading" style="
+				<div
+					v-if="loading"
+					style="
 						position: absolute;
 						left: 0;
 						top: 0;
@@ -65,9 +88,16 @@
 						display: flex;
 						justify-content: center;
 						align-items: center;
-					">
-					<div style="display: flex; flex-direction: column; align-items: center">
-						<img style="height: 75px; transform: scale(2)" src="../assets/img/cocoloading.gif" alt="" />
+					"
+				>
+					<div
+						style="display: flex; flex-direction: column; align-items: center"
+					>
+						<img
+							style="height: 75px; transform: scale(2)"
+							src="../assets/img/cocoloading.gif"
+							alt=""
+						/>
 						<div style="color: #0354d7">拼命加载中...</div>
 					</div>
 				</div>
@@ -92,7 +122,6 @@ export default {
 	},
 	data() {
 		return {
-
 			AppJSon: [],
 			loading: false,
 		};
@@ -241,7 +270,6 @@ export default {
 					lim: 9999999,
 				},
 			];
-			
 
 			let res2 = await this.$ajax.post(API_CONFIG.baseUrl, params2);
 			let toolList = res2.data[0];
@@ -251,23 +279,23 @@ export default {
 				i.argumentList = JSON.parse(i.argumentList);
 			});
 
-			let params3 = [
-				{
-					functionName: "select_schUsuallyApp",
-					userid: "",
-					stand: "cn",
-				},
-			];
+			// let params3 = [
+			// 	{
+			// 		functionName: "select_schUsuallyApp",
+			// 		userid: "",
+			// 		stand: "cn",
+			// 	},
+			// ];
 
-			let res3 = await this.$ajax.post(API_CONFIG.baseUrl, params3)
+			// let res3 = await this.$ajax.post(API_CONFIG.baseUrl, params3);
 
-			let _list = res3.data[0]
+			// let _list = res3.data[0];
 
-			_list.forEach((i) => {
-				i.json = JSON.parse(i.json);
-			});
+			// _list.forEach((i) => {
+			// 	i.json = JSON.parse(i.json);
+			// });
 
-			let appList = _list;
+			// let appList = _list;
 
 			// 第三步
 			perData.desktop.list.forEach((i, index) => {
@@ -278,43 +306,48 @@ export default {
 					console.log("无工具", i);
 				}
 			});
-			if (perData.admin.cocoFlow) {
-				perData.admin.cocoFlow.forEach((i, index) => {
-					let _index = appList.findIndex((i2) => i.id == i2.id);
-					if (_index != -1) {
-						let _setData = appList[_index];
-						_setData.setIcon = i.setIcon;
-						perData.admin.cocoFlow[index] = _setData;
-					} else {
-						console.log("无应用", i);
-					}
-				});
-			}
-			if (perData.admin.cocoFlow2) {
-				perData.admin.cocoFlow2.forEach((i, index) => {
-					let _index = appList.findIndex((i2) => i.id == i2.id);
-					if (_index != -1) {
-						let _setData = appList[_index];
-						_setData.setIcon = i.setIcon;
-						perData.admin.cocoFlow2[index] = _setData;
-					} else {
-						console.log("无应用", i);
-					}
-				});
-			}
-			if (perData.admin.CampusF && perData.admin.CampusF.appList) {
-				perData.admin.CampusF.appList.forEach((i, index) => {
-					let _index = appList.findIndex((i2) => i.id == i2.id);
-          
-					if (_index != -1) {
-						let _setData = appList[_index];
-						_setData.setIcon = i.setIcon;
-						perData.admin.CampusF.appList[index] = _setData;
-					} else {
-						console.log("无应用", i);
-					}
-				});
-			}
+			// console.log(
+			// 	"perData.admin.cocoFlow",
+			// 	JSON.parse(JSON.stringify(perData.admin))
+			// );
+
+			// if (perData.admin.cocoFlow) {
+			// 	perData.admin.cocoFlow.forEach((i, index) => {
+			// 		let _index = appList.findIndex((i2) => i.id == i2.id);
+			// 		if (_index != -1) {
+			// 			let _setData = appList[_index];
+			// 			_setData.setIcon = i.setIcon;
+			// 			perData.admin.cocoFlow[index] = _setData;
+			// 		} else {
+			// 			console.log("无应用", i);
+			// 		}
+			// 	});
+			// }
+			// if (perData.admin.cocoFlow2) {
+			// 	perData.admin.cocoFlow2.forEach((i, index) => {
+			// 		let _index = appList.findIndex((i2) => i.id == i2.id);
+			// 		if (_index != -1) {
+			// 			let _setData = appList[_index];
+			// 			_setData.setIcon = i.setIcon;
+			// 			perData.admin.cocoFlow2[index] = _setData;
+			// 		} else {
+			// 			console.log("无应用", i);
+			// 		}
+			// 	});
+			// }
+			// if (perData.admin.CampusF && perData.admin.CampusF.appList) {
+			// 	perData.admin.CampusF.appList.forEach((i, index) => {
+			// 		let _index = appList.findIndex((i2) => i.id == i2.id);
+
+			// 		if (_index != -1) {
+			// 			let _setData = appList[_index];
+			// 			_setData.setIcon = i.setIcon;
+			// 			perData.admin.CampusF.appList[index] = _setData;
+			// 		} else {
+			// 			console.log("无应用", i);
+			// 		}
+			// 	});
+			// }
 
 			perData.admin.index.list.forEach((i, index) => {
 				let _index = toolList.findIndex((i2) => i == i2.id);
@@ -443,7 +476,7 @@ export default {
 	height: 100vh;
 }
 
-.container>>>.el-loading-mask {
+.container >>> .el-loading-mask {
 	z-index: 0;
 }