Prechádzať zdrojové kódy

添加学生导航权限

11wqe1 1 mesiac pred
rodič
commit
7d853f0234

+ 10 - 3
src/components/dialog/addMenuDialog.vue

@@ -36,7 +36,7 @@
 							</el-image>
 						</el-tooltip>
 					</el-form-item>
-					<el-form-item label="菜单激活图标" v-if="['admin-sidebar'].includes(this.tagType)">
+					<el-form-item label="菜单激活图标" v-if="['admin-sidebar','stuAdmin-sidebar'].includes(this.tagType)">
 						<el-tooltip
 							class="item"
 							effect="dark"
@@ -111,8 +111,15 @@ export default {
 			};
 		},
 		submit() {
-			if(!this.form.menuName || !this.form.menuIcon || (!['admin-school'].includes(this.tagType) && !this.form.menuActiveIcon ))return this.$message.error("请完善表单")
-			this.$emit("success", {item:this.form,type:this.type,tagType:this.tagType});
+			if(!this.form.menuName ||
+			!this.form.menuIcon ||
+			(!['admin-school'].includes(this.tagType) &&
+			!this.form.menuActiveIcon ))return this.$message.error("请完善表单")
+			if (this.tagType == 'admin-sidebar') {
+				this.$emit("success", {item:this.form,type:this.type,tagType:this.tagType});
+			}else if (this.tagType == 'stuAdmin-sidebar') {
+				this.$emit("success", {item:this.form,type:this.type,tagType:this.tagType});
+			}
 		},
 		async addUrlIcon(type = "menuIcon") {
 			let _url = await this.uploadFile("image/*");

+ 569 - 24
src/components/dialog/permissionSettingDialog.vue

@@ -14,12 +14,16 @@
 							@click="changeTagType('admin-banner')">平台Banner</span>
 						<span :class="{ pa_a_h_active: tagType == 'admin-index' }"
 							@click="changeTagType('admin-index')">平台首页</span>
+						<span :class="{ pa_a_h_active: tagType == 'stuAdmin-index' }"
+							@click="changeTagType('stuAdmin-index')">平台首页(学生版)</span>
 						<span :class="{ pa_a_h_active: tagType == 'admin-cocoFlow' }"
 							@click="changeTagType('admin-cocoFlow')">平台首页CocoFlow</span>
-						<span :class="{ pa_a_h_active: tagType == 'admin-cocoFlow2' }"
-							@click="changeTagType('admin-cocoFlow2')">平台首页CocoFlow2</span>
+						<!-- <span :class="{ pa_a_h_active: tagType == 'admin-cocoFlow2' }"
+							@click="changeTagType('admin-cocoFlow2')">平台首页CocoFlow2</span> -->
 						<span :class="{ pa_a_h_active: tagType == 'admin-sidebar' }"
 							@click="changeTagType('admin-sidebar')">平台侧边栏</span>
+						<span :class="{ pa_a_h_active: tagType == 'stuAdmin-sidebar' }"
+							@click="changeTagType('stuAdmin-sidebar')">平台侧边栏(学生版)</span>
 						<span :class="{ pa_a_h_active: tagType == 'admin-school' }"
 							@click="changeTagType('admin-school')" v-if="type == 'org'">学校设置</span>
 						<span :class="{ pa_a_h_active: tagType == 'area-purview' }"
@@ -29,7 +33,7 @@
 						<!-- v-if="data.parentid" -->
 					</div>
 					<div class="ea_add">
-						<el-button size="mini" v-if="['admin-sidebar', 'admin-school'].includes(tagType)" type="primary"
+						<el-button size="mini" v-if="['admin-sidebar', 'admin-school','stuAdmin-sidebar'].includes(tagType)" type="primary"
 							@click="addMenu(tagType)">添加菜单</el-button>
 						<el-button size="mini" v-if="['admin-banner'].includes(tagType)" type="primary"
 							@click="addBanner()">添加Banner</el-button>
@@ -37,7 +41,7 @@
 							v-if="['admin-cocoFlow', 'admin-cocoFlow2', 'admin-feature'].includes(tagType)"
 							type="primary" @click="addApp()">添加应用</el-button>
 						<el-button size="mini" v-if="
-							['desktop', 'admin-index', 'admin-sidebar'].includes(tagType)
+							['desktop', 'admin-index','stuAdmin-index', 'admin-sidebar','stuAdmin-sidebar'].includes(tagType)
 						" type="primary" @click="addTool(tagType)">添加工具</el-button>
 					</div>
 				</div>
@@ -142,7 +146,7 @@
 
 								<el-table-column label="工具设置" min-width="80" show-overflow-tooltip>
 									<template slot-scope="scope">
-										<el-popover placement="bottom" width="840" trigger="hover">
+										<el-popover placement="bottom" width="840" trigger="click">
 											<div class="urlItemBox">
 												<div class="urlItem" v-for="(item, index) in scope.row.url"
 													:key="scope.row.id + '-' + index">
@@ -279,7 +283,7 @@
 						</template>
 					</div>
 
-					<div class="editArea appList" v-show="tagType == 'admin-cocoFlow2'">
+					<!-- <div class="editArea appList" v-show="tagType == 'admin-cocoFlow2'">
 						<template v-if="form.admin.cocoFlow2">
 							<div class="appItem" v-for="(item, index) in form.admin.cocoFlow2" :key="item.id">
 								<div class="ai_left">
@@ -311,7 +315,7 @@
 								</div>
 							</div>
 						</template>
-					</div>
+					</div> -->
 
 					<div class="editArea pa_a_eb_admin-index" v-show="tagType == 'admin-index'">
 						<div class="ea_table">
@@ -349,7 +353,129 @@
 
 								<el-table-column label="工具设置" min-width="80" show-overflow-tooltip>
 									<template slot-scope="scope">
-										<el-popover placement="bottom" width="840" trigger="hover">
+										<el-popover placement="bottom" width="840" trigger="click">
+											<div class="urlItemBox">
+												<div class="urlItem" v-for="(item, index) in scope.row.url"
+													:key="scope.row.id + '-' + index">
+													<span>{{ item.region }}</span>
+													<div class="ui_message">
+														<div>名称:{{ item.name ? item.name : "-" }}</div>
+														<div>
+															<span>链接:</span><a :href="item.url" v-if="item.url"
+																target="_blank">{{ item.url }}</a><span v-else>-</span>
+														</div>
+														<div>
+															<span>桌面图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.icon"
+																	style="width: 100%; height: 100%" :src="item.icon"
+																	fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+														<div>
+															<span>平台图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.platformIcon"
+																	style="width: 100%; height: 100%"
+																	:src="item.platformIcon" fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+														<div>
+															<span>默认图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.defaultIcon"
+																	style="width: 100%; height: 100%"
+																	:src="item.defaultIcon" fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+														<div>
+															<span>激活图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.activeIcon"
+																	style="width: 100%; height: 100%"
+																	:src="item.activeIcon" fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+
+														<div>
+															<span>hover图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.hoverIcon"
+																	style="width: 100%; height: 100%"
+																	:src="item.hoverIcon" fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+													</div>
+												</div>
+											</div>
+											<el-button slot="reference" size="small">查看设置</el-button>
+										</el-popover>
+									</template>
+								</el-table-column>
+								<el-table-column label="仅管理员显示" min-width="80" show-overflow-tooltip>
+									<template slot-scope="scope">{{
+										scope.row.isAdmin == "1" ? "是" : "否"
+									}}</template>
+								</el-table-column>
+								<el-table-column label="操作" width="200px" show-overflow-tooltip>
+									<template slot-scope="scope">
+										<button @click="moveUp(scope.row)" v-if="scope.$index > 0" style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											">
+											上移
+										</button>
+										<button @click="moveDown(scope.row)"
+											v-if="form.admin.index.list.length - 1 > scope.$index" style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											">
+											下移
+										</button>
+
+										<button @click="del(scope.row)" style="
+												color: #ff2570;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											">
+											删除
+										</button>
+									</template>
+								</el-table-column>
+							</el-table>
+						</div>
+					</div>
+					<div class="editArea pa_a_eb_admin-index" v-show="tagType == 'stuAdmin-index'">
+						<div class="ea_table">
+							<el-table :data="form.admin.index.stuList" stripe border style="width: 100%"
+								:header-cell-style="headerCellStyle">
+								<el-table-column label="标识" min-width="100" show-overflow-tooltip>
+									<template slot-scope="scope">{{
+										scope.row.toolId ? scope.row.toolId : "-"
+									}}</template>
+								</el-table-column>
+								<el-table-column label="描述" min-width="200" show-overflow-tooltip>
+									<template slot-scope="scope">{{
+										scope.row.description ? scope.row.description : "-"
+									}}</template>
+								</el-table-column>
+
+								<el-table-column label="工具设置" min-width="80" show-overflow-tooltip>
+									<template slot-scope="scope">
+										<el-popover placement="bottom" width="840" trigger="click">
 											<div class="urlItemBox">
 												<div class="urlItem" v-for="(item, index) in scope.row.url"
 													:key="scope.row.id + '-' + index">
@@ -527,7 +653,7 @@
 							</el-table>
 						</div>
 					</div>
-					<div class="editArea pa_a_eb_admin-sidebar" v-show="tagType == 'admin-sidebar'">
+					<div class="editArea pa_a_eb_admin-sidebar" v-if="tagType == 'admin-sidebar'">
 						<div class="ea_table">
 							<el-table :data="form.admin.sidebar.list" stripe border style="width: 100%" row-key="typeId"
 								:header-cell-style="headerCellStyle" :tree-props="{
@@ -577,7 +703,7 @@
 
 								<el-table-column label="工具设置" min-width="110" show-overflow-tooltip>
 									<template slot-scope="scope">
-										<el-popover placement="bottom" width="840" trigger="hover" v-if="scope.row.url">
+										<el-popover placement="bottom" width="840" trigger="click" v-if="scope.row.url">
 											<div class="urlItemBox">
 												<div class="urlItem" v-for="(item, index) in scope.row.url"
 													:key="scope.row.id + '-' + index">
@@ -704,8 +830,185 @@
 							</el-table>
 						</div>
 					</div>
+					<div class="editArea pa_a_eb_admin-sidebar" v-if="tagType == 'stuAdmin-sidebar'">
+						<div class="ea_table">
+							<el-table :data="form.admin.sidebar.stuList" stripe border style="width: 100%" row-key="typeId"
+								:header-cell-style="headerCellStyle" :tree-props="{
+									children: 'children',
+									hasChildren: 'hasChildren',
+								}">
+								<el-table-column label="标识" min-width="100" show-overflow-tooltip>
+									<template slot-scope="scope">{{
+										scope.row.toolId ? scope.row.toolId : "-"
+									}}</template>
+								</el-table-column>
+								<el-table-column label="描述" min-width="200" show-overflow-tooltip>
+									<template slot-scope="scope">{{
+										scope.row.description ? scope.row.description : "-"
+									}}</template>
+								</el-table-column>
+
+								<el-table-column label="菜单名称" min-width="200" show-overflow-tooltip>
+									<template slot-scope="scope">{{
+										scope.row.menuName ? scope.row.menuName : "-"
+									}}</template>
+								</el-table-column>
+
+								<el-table-column label="菜单默认图标" min-width="200" show-overflow-tooltip>
+									<template slot-scope="scope">
+										<el-image v-if="scope.row.menuIcon" style="width: 50px; height: 50px"
+											:src="scope.row.menuIcon" fit="cover">
+											<div slot="error" class="image-slot">
+												<i class="el-icon-picture-outline"></i>
+											</div>
+										</el-image>
+										<span v-else>-</span>
+									</template>
+								</el-table-column>
+
+								<el-table-column label="菜单激活图标" min-width="200" show-overflow-tooltip>
+									<template slot-scope="scope">
+										<el-image v-if="scope.row.menuActiveIcon" style="width: 50px; height: 50px"
+											:src="scope.row.menuActiveIcon" fit="cover">
+											<div slot="error" class="image-slot">
+												<i class="el-icon-picture-outline"></i>
+											</div>
+										</el-image>
+										<span v-else>-</span>
+									</template>
+								</el-table-column>
+
+								<el-table-column label="工具设置" min-width="110" show-overflow-tooltip>
+									<template slot-scope="scope">
+										<el-popover placement="bottom" width="840" trigger="click" v-if="scope.row.url">
+											<div class="urlItemBox">
+												<div class="urlItem" v-for="(item, index) in scope.row.url"
+													:key="scope.row.id + '-' + index">
+													<span>{{ item.region }}</span>
+													<div class="ui_message">
+														<div>名称:{{ item.name ? item.name : "-" }}</div>
+														<div>
+															<span>链接:</span><a :href="item.url" v-if="item.url"
+																target="_blank">{{ item.url }}</a><span v-else>-</span>
+														</div>
+														<div>
+															<span>桌面图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.icon"
+																	style="width: 100%; height: 100%" :src="item.icon"
+																	fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+														<div>
+															<span>平台图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.platformIcon"
+																	style="width: 100%; height: 100%"
+																	:src="item.platformIcon" fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+														<div>
+															<span>默认图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.defaultIcon"
+																	style="width: 100%; height: 100%"
+																	:src="item.defaultIcon" fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+														<div>
+															<span>激活图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.activeIcon"
+																	style="width: 100%; height: 100%"
+																	:src="item.activeIcon" fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+
+														<div>
+															<span>hover图标:</span>
+															<div class="ui_m_image">
+																<el-image v-if="item.hoverIcon"
+																	style="width: 100%; height: 100%"
+																	:src="item.hoverIcon" fit="cover"></el-image>
+																<span v-else>-</span>
+															</div>
+														</div>
+													</div>
+												</div>
+											</div>
+											<el-button slot="reference" size="small">查看设置</el-button>
+										</el-popover>
+										<span v-else>-</span>
+									</template>
+								</el-table-column>
+								<el-table-column label="仅管理员显示" min-width="80" show-overflow-tooltip>
+									<template slot-scope="scope">
+										<span v-if="scope.row.isAdmin">{{
+											scope.row.isAdmin == "1" ? "是" : "否"
+										}}</span>
+										<span v-else>-</span>
+									</template>
+								</el-table-column>
+								<el-table-column label="操作" width="320px" fixed="right" show-overflow-tooltip>
+									<template slot-scope="scope">
+										<button @click="addToolSidebar(scope.row.id)" v-if="scope.row.menuName" style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											">
+											添加工具1
+										</button>
+
+										<button @click="editMenu(scope.row)" v-if="scope.row.menuName" style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											">
+											修改
+										</button>
+										<button @click="moveUp(scope.row, scope.row.typeId)" style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											">
+											上移
+										</button>
+										<button @click="moveDown(scope.row, scope.row.typeId)" style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											">
+											下移
+										</button>
+
+										<button @click="del(scope.row, scope.row.typeId)" style="
+												color: #ff2570;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											">
+											删除
+										</button>
+									</template>
+								</el-table-column>
+							</el-table>
+						</div>
+					</div>
 
-					<div class="editArea pa_a_eb_admin-sidebar" v-show="tagType == 'admin-school'">
+					<div class="editArea pa_a_eb_admin-sidebar" v-if="tagType == 'admin-school'">
 						<div class="ea_table">
 							<el-table :data="form.admin.school.list" stripe border style="width: 100%" row-key="typeId"
 								:header-cell-style="headerCellStyle" :tree-props="{
@@ -976,7 +1279,6 @@
 							</el-switch>
 						</div>
 					</div>
-
 				</div>
 			</div>
 			<!-- 按钮区域 -->
@@ -1051,9 +1353,11 @@ export default {
 					index: {
 						list: [],
 						cocoFlow: [],
+						stuList:[],
 					},
 					sidebar: {
 						list: [],
+						stuList: [],
 					},
 					school: {
 						list: [],
@@ -1131,10 +1435,15 @@ export default {
 
 			if (_data.json) {
 				let _form = JSON.parse(_data.json);
-
+				if (!_form.admin.sidebar.stuList) {
+					_form.admin.sidebar.stuList = [];
+				}
 				if (!('cocoFlowShow' in _form.admin)) {
 					_form.admin.cocoFlowShow = true
 				}
+				if (!('stuList' in _form.admin.index)) {
+					_form.admin.index.stuList = []
+				}
 				if (!_form.admin.school) {
 					_form.admin.school = { list: [] };
 				}
@@ -1191,12 +1500,14 @@ export default {
 					index: {
 						list: [],
 						cocoFlow: [],
+						stuList:[]
 					},
 					sidebar: {
 						list: [],
 					},
 					school: {
 						list: [],
+						stuList: []
 					},
 					CampusF: {
 						GroupBri: '',
@@ -1303,11 +1614,13 @@ export default {
 			let selectList = [];
 			if (type == "desktop") selectList = this.form.desktop.list;
 			if (type == "admin-index") selectList = this.form.admin.index.list;
+			if (type == 'stuAdmin-index') selectList = this.form.admin.index.stuList;
 			if (type == "admin-sidebar") selectList = this.form.admin.sidebar.list;
+			if (type == "stuAdmin-sidebar") selectList = this.form.admin.sidebar.stuList;
 			this.$refs.selectToolDialogRef.open(
 				selectList,
 				type,
-				["admin-index", "admin-sidebar"].includes(type)
+				["admin-index","stuAdmin-index", "admin-sidebar","stuAdmin-sidebar"].includes(type)
 					? this.form.desktop.list
 					: []
 			);
@@ -1333,6 +1646,15 @@ export default {
 					type: "user_op",
 					content: `修改了${this.data.name}的平台首页工具`,
 				});
+			} else if (type == 'stuAdmin-index') {
+				this.form.admin.index.stuList = list;
+				this.$refs.selectToolDialogRef.close();
+				await addOp({
+					uid: this.userid,
+					cid: this.data.id,
+					type: "user_op",
+					content: `修改了${this.data.name}的学生平台首页工具`,
+				});
 			} else if (type == "admin-sidebar" || type == "admin-sidebar2") {
 				if (this.addToolIndex != null) {
 					let _index = this.form.admin.sidebar.list.findIndex(
@@ -1357,6 +1679,30 @@ export default {
 					content: `修改了${this.data.name}的平台侧边栏工具`,
 				});
 				this.$refs.selectToolDialogRef.close();
+			} else if (type == "stuAdmin-sidebar") {
+				if (this.addToolIndex != null) {
+					let _index = this.form.admin.sidebar.stuList.findIndex(
+						(i) => i.id == this.addToolIndex
+					);
+					if (_index == -1) return this.$message.error("未找到对应的菜单");
+					list.forEach((i) => (i.typeId = this.addToolIndex + "," + i.id));
+					this.form.admin.sidebar.stuList[_index].children.push(
+						...JSON.parse(JSON.stringify(list))
+					);
+					this.addToolIndex = null;
+				} else {
+					list.forEach((i) => (i.typeId = i.id));
+					this.form.admin.sidebar.stuList.push(
+						...JSON.parse(JSON.stringify(list))
+					);
+				}
+				await addOp({
+					uid: this.userid,
+					cid: this.data.id,
+					type: "user_op",
+					content: `修改了${this.data.name}的学生平台侧边栏工具`,
+				});
+				this.$refs.selectToolDialogRef.close();
 			}
 			this.$forceUpdate();
 		},
@@ -1407,6 +1753,14 @@ export default {
 					const itemToMove = this.form.admin.index.list.splice(_index, 1)[0];
 					this.form.admin.index.list.splice(_index - 1, 0, itemToMove);
 				}
+			} else if (this.tagType == 'stuAdmin-index') {
+				let _index = this.form.admin.index.stuList.findIndex(
+					(i) => i.id == row.id
+				);
+				if (_index > 0) {
+					const itemToMove = this.form.admin.index.stuList.splice(_index, 1)[0];
+					this.form.admin.index.stuList.splice(_index - 1, 0, itemToMove);
+				}
 			} else if (this.tagType == "admin-sidebar") {
 				let typeIdList = typeId.split(",");
 				console.log(typeIdList);
@@ -1440,6 +1794,39 @@ export default {
 						);
 					}
 				}
+			} else if (this.tagType == "stuAdmin-sidebar") {
+				let typeIdList = typeId.split(",");
+				console.log(typeIdList);
+				if (typeIdList.length == 1) {
+					let _index = this.form.admin.sidebar.stuList.findIndex(
+						(i) => i.typeId == typeIdList[0]
+					);
+					if (_index > 0) {
+						const itemToMove = this.form.admin.sidebar.stuList.splice(
+							_index,
+							1
+						)[0];
+						this.form.admin.sidebar.stuList.splice(_index - 1, 0, itemToMove);
+					}
+				} else if (typeIdList.length == 2) {
+					let _index = this.form.admin.sidebar.stuList.findIndex(
+						(i) => i.typeId == typeIdList[0]
+					);
+					let _index2 = this.form.admin.sidebar.stuList[_index].children.findIndex(
+						(i) => i.id == typeIdList[1]
+					);
+					console.log(_index2);
+					if (_index2 > 0) {
+						const itemToMove = this.form.admin.sidebar.stuList[
+							_index
+						].children.splice(_index2, 1)[0];
+						this.form.admin.sidebar.stuList[_index].children.splice(
+							_index2 - 1,
+							0,
+							itemToMove
+						);
+					}
+				}
 			} else if (this.tagType == "admin-banner") {
 				let _index = this.form.admin.banner.findIndex((i) => i.id == row.id);
 				if (_index > 0) {
@@ -1494,6 +1881,14 @@ export default {
 					const itemToMove = this.form.admin.index.list.splice(_index, 1)[0];
 					this.form.admin.index.list.splice(_index + 1, 0, itemToMove);
 				}
+			} else if (this.tagType == 'stuAdmin-index') {
+				let _index = this.form.admin.index.stuList.findIndex(
+					(i) => i.id == row.id
+				);
+				if (_index < this.form.admin.index.stuList.length - 1) {
+					const itemToMove = this.form.admin.index.stuList.splice(_index, 1)[0];
+					this.form.admin.index.stuList.splice(_index + 1, 0, itemToMove);
+				}
 			} else if (this.tagType == "admin-sidebar") {
 				let typeIdList = typeId.split(",");
 				if (typeIdList.length == 1) {
@@ -1528,6 +1923,40 @@ export default {
 						);
 					}
 				}
+			} else if (this.tagType == "stuAdmin-sidebar") {
+				let typeIdList = typeId.split(",");
+				if (typeIdList.length == 1) {
+					let _index = this.form.admin.sidebar.stuList.findIndex(
+						(i) => i.typeId == typeIdList[0]
+					);
+					if (_index < this.form.admin.sidebar.stuList.length - 1) {
+						const itemToMove = this.form.admin.sidebar.stuList.splice(
+							_index,
+							1
+						)[0];
+						this.form.admin.sidebar.stuList.splice(_index + 1, 0, itemToMove);
+					}
+				} else if (typeIdList.length == 2) {
+					let _index = this.form.admin.sidebar.stuList.findIndex(
+						(i) => i.typeId == typeIdList[0]
+					);
+					let _index2 = this.form.admin.sidebar.stuList[_index].children.findIndex(
+						(i) => i.id == typeIdList[1]
+					);
+					if (
+						_index2 <
+						this.form.admin.sidebar.stuList[_index].children.length - 1
+					) {
+						const itemToMove = this.form.admin.sidebar.stuList[
+							_index
+						].children.splice(_index2, 1)[0];
+						this.form.admin.sidebar.stuList[_index].children.splice(
+							_index2 + 1,
+							0,
+							itemToMove
+						);
+					}
+				}
 			} else if (this.tagType == "admin-banner") {
 				let _index = this.form.admin.banner.findIndex((i) => i.id == row.id);
 				if (_index < this.form.admin.banner.length - 1) {
@@ -1580,6 +2009,13 @@ export default {
 				if (index > -1) {
 					this.form.admin.index.list.splice(index, 1);
 				}
+			} else if (this.tagType == 'stuAdmin-index') {
+				const index = this.form.admin.index.stuList.findIndex(
+					(i) => i.id === row.id
+				);
+				if (index > -1) {
+					this.form.admin.index.stuList.splice(index, 1);
+				}
 			} else if (this.tagType == "admin-sidebar") {
 				let typeIdList = typeId.split(",");
 				if (typeIdList.length == 1) {
@@ -1597,6 +2033,23 @@ export default {
 					this.form.admin.sidebar.list[_index].children.splice(_index2, 1);
 				}
 				// this.form.admin.sidebar.list.splice(_index, 1);
+			} else if (this.tagType == "stuAdmin-sidebar") {
+				let typeIdList = typeId.split(",");
+				if (typeIdList.length == 1) {
+					let _index = this.form.admin.sidebar.stuList.findIndex(
+						(i) => i.typeId == typeIdList[0]
+					);
+					this.form.admin.sidebar.stuList.splice(_index, 1);
+				} else if (typeIdList.length == 2) {
+					let _index = this.form.admin.sidebar.stuList.findIndex(
+						(i) => i.typeId == typeIdList[0]
+					);
+					let _index2 = this.form.admin.sidebar.stuList[_index].children.findIndex(
+						(i) => i.typeId == typeId
+					);
+					this.form.admin.sidebar.stuList[_index].children.splice(_index2, 1);
+				}
+				// this.form.admin.sidebar.list.splice(_index, 1);
 			} else if (this.tagType == "admin-banner") {
 				const index = this.form.admin.banner.findIndex((i) => i.id === row.id);
 				if (index > -1) {
@@ -1688,6 +2141,8 @@ export default {
 			let _form = JSON.parse(JSON.stringify(this.form));
 			_form.desktop.list = _form.desktop.list.map((i) => i.id);
 			_form.admin.index.list = _form.admin.index.list.map((i) => i.id);
+			_form.admin.index.stuList = _form.admin.index.stuList.map((i) => i.id);
+
 			_form.admin.sidebar.list.forEach((i, index) => {
 				if (i.children) {
 					_form.admin.sidebar.list[index].children = i.children.map(
@@ -1697,6 +2152,15 @@ export default {
 					_form.admin.sidebar.list[index] = i.id;
 				}
 			});
+			_form.admin.sidebar.stuList.forEach((i, index) => {
+				if (i.children) {
+					_form.admin.sidebar.stuList[index].children = i.children.map(
+						(i) => i.id
+					);
+				} else {
+					_form.admin.sidebar.stuList[index] = i.id;
+				}
+			});
 			_form.admin.cocoFlow = _form.admin.cocoFlow
 				? _form.admin.cocoFlow.map((i) => {
 					return { id: i.id, setIcon: i.setIcon }
@@ -1808,6 +2272,17 @@ export default {
 					console.log("无工具", i);
 				}
 			});
+			if (_form.admin.index.stuList) {
+				_form.admin.index.stuList.forEach((i, index) => {
+					let _index = toolList.findIndex((i2) => i == i2.id);
+					if (_index != -1) {
+						_form.admin.index.stuList[index] = toolList[_index];
+					} else {
+						console.log("无工具", i);
+					}
+				});
+			}
+			
 			_form.admin.sidebar.list.forEach((i, index) => {
 				if (i.children) {
 					i.children.forEach((i2, index2) => {
@@ -1837,22 +2312,64 @@ export default {
 					}
 				}
 			});
+			_form.admin.sidebar.stuList.forEach((i, index) => {
+				if (i.children) {
+					i.children.forEach((i2, index2) => {
+						let _toolList = JSON.parse(JSON.stringify(toolList));
+						let _index = _toolList.findIndex((i3) => i2 == i3.id);
 
+						if (_index != -1) {
+							_form.admin.sidebar.stuList[index].children[index2] =
+								_toolList[_index];
+							_form.admin.sidebar.stuList[index].children[index2].typeId =
+								_form.admin.sidebar.stuList[index].typeId +
+								"," +
+								_toolList[_index].id;
+						} else {
+							console.log("无工具", i);
+						}
+					});
+				} else {
+					let _toolList = JSON.parse(JSON.stringify(toolList));
+					let _index = _toolList.findIndex((i2) => i == i2.id);
+					if (_index != -1) {
+						_form.admin.sidebar.stuList[index] = _toolList[_index];
+						_form.admin.sidebar.stuList[index].typeId =
+							_form.admin.sidebar.stuList[index].id;
+					} else {
+						console.log("无工具", i);
+					}
+				}
+			});
 			this.form = _form;
 			this.$forceUpdate();
 		},
 		addToolSidebar(id) {
 			this.addToolIndex = id;
-			let index = this.form.admin.sidebar.list.findIndex((i) => i.id == id);
-			if (index == -1) return this.$message.error("未找到对应菜单");
-			let selectList = [];
-			selectList = this.form.admin.sidebar.list[index].children;
-			this.$refs.selectToolDialogRef.open(
-				selectList,
-				"admin-sidebar",
-				this.form.desktop.list
-			);
+			if (this.tagType == 'admin-sidebar') {
+				let index = this.form.admin.sidebar.list.findIndex((i) => i.id == id);
+				if (index == -1) return this.$message.error("未找到对应菜单");
+				let selectList = [];
+				selectList = this.form.admin.sidebar.list[index].children;
+				this.$refs.selectToolDialogRef.open(
+					selectList,
+					"admin-sidebar",
+					this.form.desktop.list
+				);
+			}else if (this.tagType == 'stuAdmin-sidebar') {
+				let index = this.form.admin.sidebar.stuList.findIndex((i) => i.id == id);
+				if (index == -1) return this.$message.error("未找到对应菜单");
+				let selectList = [];
+				selectList = this.form.admin.sidebar.stuList[index].children;
+				this.$refs.selectToolDialogRef.open(
+					selectList,
+					"stuAdmin-sidebar",
+					this.form.desktop.list
+				);
+			}
+			
 		},
+		// 修改与添加菜单
 		async addMenuSuccess({ item, type, tagType }) {
 			console.log(item, type);
 			if (tagType == "admin-sidebar") {
@@ -1883,6 +2400,34 @@ export default {
 						});
 					}
 				}
+			} else if (tagType == "stuAdmin-sidebar") {
+				if (type == "add") {
+					item.id = String(new Date().getTime());
+					item.typeId = item.id;
+					this.form.admin.sidebar.stuList.push(item);
+					await addOp({
+						uid: this.userid,
+						cid: "",
+						type: "user_op",
+						content: `添加了学生侧边栏一级菜单:${item.menuName}`,
+					});
+				} else if (type == "edit") {
+					let _index = this.form.admin.sidebar.stuList.findIndex(
+						(i) => i.typeId == item.typeId
+					);
+					if (_index != -1) {
+						let _sidebar = JSON.parse(JSON.stringify(this.form.admin.sidebar));
+						_sidebar.stuList[_index] = item;
+						this.form.admin.sidebar = JSON.parse(JSON.stringify(_sidebar));
+						this.$forceUpdate();
+						await addOp({
+							uid: this.userid,
+							cid: "",
+							type: "user_op",
+							content: `修改了学生侧边栏一级菜单:${item.menuName}`,
+						});
+					}
+				}
 			} else if (tagType == "admin-school") {
 				if (type == "add") {
 					item.id = String(new Date().getTime());
@@ -2068,6 +2613,7 @@ export default {
 	align-items: center;
 	box-sizing: border-box;
 	overflow: auto;
+	gap: 10px;
 }
 
 .pa_a_h_tag>span {
@@ -2075,7 +2621,6 @@ export default {
 	display: block;
 	width: auto;
 	height: 100%;
-	padding: 0 20px;
 	display: flex;
 	justify-content: center;
 	align-items: center;

+ 10 - 4
src/components/dialog/selectToolDialog.vue

@@ -57,7 +57,7 @@
 							show-overflow-tooltip
 						>
 							<template slot-scope="scope">
-								<el-popover placement="bottom" width="840" trigger="hover">
+								<el-popover placement="bottom" width="840" trigger="click">
 									<div class="urlItemBox">
 										<div
 											class="urlItem"
@@ -188,7 +188,7 @@ export default {
 			return { backgroundColor: "#f1f1f1" };
 		},
 		selectable(row){
-			if(this.type && ['desktop','admin-index','admin-sidebar2'].includes(this.type)){
+			if(this.type && ['desktop','admin-index','stuAdmin-index','admin-sidebar2'].includes(this.type)){
 				return true;
 			}else if(this.type && ['admin-sidebar'].includes(this.type)){
 				let _result = true;
@@ -196,6 +196,12 @@ export default {
 					_result = false
 				}
 				return _result;
+			} else if(this.type && ['stuAdmin-sidebar'].includes(this.type)){
+				let _result = true;
+				if(this.disableSelectList.findIndex(i=>i.id==row.id)!=-1){
+					_result = false
+				}
+				return _result;
 			}
 
 		},
@@ -203,13 +209,13 @@ export default {
 			this.show = true;
 
 			this.init();
-			if(type!='admin-sidebar')this.selectList = data;
+			if(type!='admin-sidebar' && type!='stuAdmin-sidebar') this.selectList = data;
 			this.disableSelectList = JSON.parse(JSON.stringify(data))
 			this.type = type;
 
 
 			this.$nextTick(() => {
-				if (data.length > 0 && type!='admin-sidebar') {
+				if (data.length > 0 && (type!='admin-sidebar' && type!='stuAdmin-sidebar')) {
 					this.setTableSelect(data);
 				}
 			});