Browse Source

修改校区特色

11wqe1 3 days ago
parent
commit
0f4ecb45dd

+ 5 - 0
src/assets/Slog.svg

@@ -0,0 +1,5 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M10.0001 9.16667C10.4603 9.16667 10.8334 8.79357 10.8334 8.33333C10.8334 7.8731 10.4603 7.5 10.0001 7.5C9.53984 7.5 9.16675 7.8731 9.16675 8.33333C9.16675 8.79357 9.53984 9.16667 10.0001 9.16667Z" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="M5.00008 14.1667V14.175M5.00008 10.8333V10.8417M15.0001 14.1667V14.175M15.0001 10.8333V10.8417M18.3334 16.6667V6.66668H15.0001L10.0001 3.33334L5.00008 6.66668H1.66675V16.6667C1.66675 17.1087 1.84234 17.5326 2.1549 17.8452C2.46746 18.1577 2.89139 18.3333 3.33341 18.3333H16.6667C17.1088 18.3333 17.5327 18.1577 17.8453 17.8452C18.1578 17.5326 18.3334 17.1087 18.3334 16.6667Z" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="M11.6668 18.3333V14.1667C11.6668 13.7246 11.4912 13.3007 11.1787 12.9882C10.8661 12.6756 10.4422 12.5 10.0002 12.5C9.55814 12.5 9.13421 12.6756 8.82165 12.9882C8.50909 13.3007 8.3335 13.7246 8.3335 14.1667V18.3333" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
+</svg>

+ 120 - 97
src/components/schoolArea.vue

@@ -1,114 +1,137 @@
 <template>
-    <div class="schoolArea">
-        <div class="allView" :class="{ active: activeSchool === 'allView' }">
-            <div class="allView_icon"></div>
-            <div>总览</div>
-        </div>
+	<div class="schoolArea">
+		<div class="allView">
+			<div class="allView_icon"></div>
+			<div>集团特色</div>
+		</div>
 
-        <div v-if="fromL.admin.school">
-            <div class="priSchBox" v-for="(i,index) in fromL.admin.school.list" :key="index+'a'">
-                <div class="primarySch" :class="{ active: activeSchool === 'primarySch' }" >
-                    <img :src="i.menuIcon" style="margin-right: 8px;" alt="">
-                    <div>{{ i.menuName }}</div>
-                </div>
-                <div class="priSchArea">
-                    <div class="schArea" v-for="(item, index) in i.children" :key="index"
-                        :class="{ active: activeSchool === item }" >
-                        {{ item.name }}
-                    </div>
-                </div>
-            </div>
-        </div>
-
-    </div>
+		<div v-if="fromL.admin.school">
+			<div
+				class="priSchBox"
+				v-for="(i, index) in fromL.admin.school.list"
+				:key="index + 'a'"
+			>
+				<div class="primarySch" @click="cutS(item.schoolid)">
+					<img src="../assets/Slog.svg" style="margin-right: 8px" alt="" />
+					<div>{{ i.menuName }}</div>
+				</div>
+				<div class="priSchArea">
+					<div
+						class="schArea"
+						@click="cutS(item.schoolid)"
+						v-for="(item, index) in i.children"
+						:key="index"
+						:class="{ active: activeSchool == item.schoolid }"
+					>
+						{{ item.name }}
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
 </template>
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters } from "vuex";
 
 export default {
-    data() {
-        return {
-            activeSchool: '',
-            priSchList: [
-                "通新岭校区",
-                "百花校区",
-                "玮鹏校区",
-                "园岭校区",
-                "众孚校区",
-                "八卦岭校区",
-            ],
-            midList: [
-                "笔架山学校",
-            ]
-        }
-    },
-    computed: {
-        ...mapGetters(['fromL']),
-    },
-    methods: {
-        setActive(school) {
-            this.activeSchool = school  // 切换高亮状态
-        }
-
-    }
-}
+	props: ["schId"],
+	data() {
+		return {
+			activeSchool: "",
+			priSchList: [
+				"通新岭校区",
+				"百花校区",
+				"玮鹏校区",
+				"园岭校区",
+				"众孚校区",
+				"八卦岭校区",
+			],
+			midList: ["笔架山学校"],
+		};
+	},
+	computed: {
+		...mapGetters(["fromL",'userinfo']),
+	},
+	watch: {
+		schId(newValue) {
+			this.activeSchool = newValue;
+		},
+	},
+	methods: {
+		cutS(val) {
+			if (
+				this.userinfo.role == 1 &&
+				this.userinfo.rrole == 1 &&
+				this.userinfo.type == 1
+			) {
+				this.activeSchool = val;
+				this.$emit("cutSch", val);
+			}
+		},
+	},
+	mounted() {
+		this.activeSchool = this.schId;
+	},
+};
 </script>
 <style scoped>
 .schoolArea {
-    /* max-width: 192px;
+	/* max-width: 192px;
     min-width: 192px; */
-    min-height: 600px;
-    width: 267px;
-    min-width: 100px;
-    display: flex;
-    flex-direction: column;
-    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
-    border-radius: 10px;
-    padding: 19px 13px;
-    box-sizing: border-box;
-    gap: 8px;
-    background: #fff;
+	min-height: 600px;
+	width: 267px;
+	min-width: 100px;
+	display: flex;
+	flex-direction: column;
+	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
+	border-radius: 10px;
+	padding: 19px 13px;
+	box-sizing: border-box;
+	gap: 8px;
+	background: #fff;
 }
-.allView{
-    display: flex;
-    width: 230px;
-    height: 54px;
-    font-size: 18px;
-    align-items: center;
-    padding: 16px;
-    box-sizing: border-box;
+.allView {
+	display: flex;
+	width: 230px;
+	height: 54px;
+	font-size: 18px;
+	align-items: center;
+	padding: 16px;
+	box-sizing: border-box;
 }
-.primarySch{
-    display: flex;
-    padding: 16px;
-    padding-bottom: 4px;
+.primarySch {
+	display: flex;
+	padding: 16px;
+	padding-bottom: 4px;
 }
-.priSchArea{
-    margin: 8px 0;
-    display: flex;
-    flex-direction: column;
-    gap: 8px;
+.priSchArea {
+	margin: 8px 0;
+	display: flex;
+	flex-direction: column;
+	gap: 8px;
 }
-.schArea{
-    width: 100%;
-    height: 36px;
-    display: flex;
-    align-items: center;
-    border-radius: 6px;
-    padding: 7px 16px;
-    padding-left: 36px;
-    box-sizing: border-box;
-    font-size: 14px;
-    cursor: pointer;
+.schArea {
+	width: 100%;
+	height: 36px;
+	display: flex;
+	align-items: center;
+	border-radius: 6px;
+	padding: 7px 16px;
+	padding-left: 36px;
+	box-sizing: border-box;
+	font-size: 14px;
+	cursor: pointer;
 }
 .allView_icon {
-    background: url('../assets/img/zl.svg') no-repeat;
-    width: 18px;
-    height: 18px;
-    display: inline-block;
-    background-size: contain;
-    margin-right: 8px;
+	background: url("../assets/img/zl.svg") no-repeat;
+	width: 18px;
+	height: 18px;
+	display: inline-block;
+	background-size: contain;
+	margin-right: 8px;
 }
-
-
-</style>
+.active {
+	background: #e7e7e7;
+	color: #453cca;
+}
+</style>

+ 182 - 54
src/views/kanBan/components/AschoolFeature.vue

@@ -1,15 +1,15 @@
 <template>
-    <div style="display: flex; flex-direction: column; gap: 20px; height: 100%">
+    <div  v-if="Object.keys(Alldata).length > 0" v-loading="AllLoading" style="display: flex; flex-direction: column; gap: 20px; height: 100%">
         <div class="top">
             <div class="topTit">
                 <div>
                     <div>集团简介</div>
                     <div style="
-							height: 4px;
-							background-color: #0663fe;
-							width: 2rem;
-							margin-top: 6px;
-						"></div>
+                        height: 4px;
+                        background-color: #0663fe;
+                        width: 2rem;
+                        margin-top: 6px;
+                    "></div>
                 </div>
                 <div>
                     <img v-if="userinfo.role == 1 && userinfo.type == 1" class="topTitEdit" @click="editregion(0)"
@@ -17,7 +17,7 @@
                 </div>
             </div>
             <div class="Topbri">
-                {{ fromL.admin.CampusF ? fromL.admin.CampusF.GroupBri : "暂无简介" }}
+                {{ Alldata.admin.CampusF ? Alldata.admin.CampusF.GroupBri : "暂无简介" }}
             </div>
         </div>
 
@@ -73,10 +73,10 @@
                 </div>
             </div>
             <div class="Topbri">
-                <el-tooltip class="item" effect="dark" :content="fromL.admin.CampusF ? fromL.admin.CampusF.teacherN.teaBri : '暂无数据'
+                <el-tooltip class="item" effect="dark" :content="Alldata.admin.CampusF ? Alldata.admin.CampusF.teacherN.teaBri : '暂无数据'
                     " placement="bottom">
                     <span>
-                        {{ fromL.admin.CampusF ? fromL.admin.CampusF.teacherN.teaBri : "暂无简介" }}
+                        {{ Alldata.admin.CampusF ? Alldata.admin.CampusF.teacherN.teaBri : "暂无简介" }}
                     </span>
                 </el-tooltip>
             </div>
@@ -114,12 +114,7 @@
                     <div class="AppStore" v-for="(i, index) in CampusF.appList" :key="index" @click="openNewWindow(i)">
                         <!-- <img style="width: 24px;" src="../../../assets/img/bianji.svg" alt=""> -->
                         <div class="AppStoreCon">
-                            <img style="
-									width: 32px;
-									height: 32px;
-									margin-bottom: 10px;
-									object-fit: contain;
-								" :src="i.setIcon ? i.setIcon : i.json.icon" alt="" />
+                            <img :src="i.setIcon ? i.setIcon : i.json.icon" alt="" />
                             <div class="AppStoreConTit">{{ i.name }}</div>
                             <el-tooltip class="item" effect="dark" :content="i.detail" placement="bottom">
                                 <div class="AppStoreConBri">{{ i.detail }}</div>
@@ -302,7 +297,7 @@
 								">
                                 修改
                             </button>
-                            <button v-if="fromL.admin.CampusF.appList.length > 1" @click="delFe(scope.$index, 2)" style="
+                            <button v-if="Alldata.admin.CampusF.appList.length > 1" @click="delFe(scope.$index, 2)" style="
 									color: red;
 									background: none;
 									border: none;
@@ -358,11 +353,11 @@ import addCampusDialog from "./addCampusDialog";
 import { myMixin } from "@/mixins/mixin.js";
 
 import axios from "@/common/axios.config"; // 引入 axios 配置实例
-import store from "../../../store";
+// import store from "../../../store";
 
 export default {
     mixins: [myMixin],
-
+    props:['schId'],
     components: {
         addCampusDialog,
     },
@@ -394,20 +389,24 @@ export default {
             CampusType: 0,
             // 0 办学特色 1 师资力量
             CampusNum: 0,
+
+            // 整体数据
+            Alldata:{},
+            AllLoading:false
         };
     },
     computed: {
-        ...mapGetters(["fromL", "userinfo"]),
+        ...mapGetters(["userinfo"]),
         featureList() {
-            if (this.fromL.admin.CampusF) {
-                return this.fromL.admin.CampusF.feature; // 从 Vuex 的 fromL 中获取 featureList
+            if (this.Alldata.admin.CampusF) {
+                return this.Alldata.admin.CampusF.feature; // 从 Alldata 中获取 featureList
             } else {
                 return [];
             }
         },
         teaData() {
-            if (this.fromL.admin.CampusF) {
-                return this.fromL.admin.CampusF.teacherN.list; // 从 Vuex 的 fromL 中获取 teaData
+            if (this.Alldata.admin.CampusF) {
+                return this.Alldata.admin.CampusF.teacherN.list; // 从  Alldata 中获取 teaData
             } else {
                 return [];
             }
@@ -438,6 +437,13 @@ export default {
             else return ""; // 默认值
         },
     },
+    watch: {
+		schId(newValue) {
+            console.log('newValue',newValue);
+            
+			this.getSchFacility(newValue)
+		},
+    },
     methods: {
         // 点击区块编辑
         async editregion(type) {
@@ -457,8 +463,8 @@ export default {
             // 0 办学特色 1 师资力量
             this.CampusNum = 0;
 
-            if (this.fromL.admin.CampusF) {
-                this.CampusF = JSON.parse(JSON.stringify(this.fromL.admin.CampusF));
+            if (this.Alldata.admin.CampusF) {
+                this.CampusF = JSON.parse(JSON.stringify(this.Alldata.admin.CampusF));
             }
         },
         // 上移
@@ -499,13 +505,7 @@ export default {
                 );
             }
         },
-        // // 添加师资力量
-        // add2() {
-        // 	this.CampusType = 1;
-        // 	this.$refs.addCampusDialogRef.open({ bri: "", name: "" }, 1);
 
-        // 	// this.CampusF.teacherN.list.push()
-        // },
         // 修改办学特色
         editRunS(index, val, type) {
             this.CampusData = val;
@@ -549,7 +549,6 @@ export default {
                     this.$message.error('已取消删除');
                 });
         },
-        moveApp() { },
         getAppData() {
             return new Promise((resolve) => {
                 let params = [
@@ -617,7 +616,7 @@ export default {
         setJson() {
             this.loading = true;
 
-            let _form = JSON.parse(JSON.stringify(this.fromL));
+            let _form = JSON.parse(JSON.stringify(this.Alldata));
 
             _form.desktop.list = _form.desktop.list.map((i) => i.id);
 
@@ -648,7 +647,7 @@ export default {
             let params = [
                 {
                     functionName: "update_orgOroid_json_byId",
-                    id: this.userinfo.organizeid,
+                    id: this.schId,
                     ujson: JSON.stringify(_form),
                     type: "school",
                 },
@@ -661,7 +660,8 @@ export default {
                         this.$message.success("修改权限成功");
                         // this.$emit("getData");
 
-                        await store.dispatch("user/getschPerInfo");
+                        this.getSchFacility(this.schId)
+                        // await store.dispatch("user/getschPerInfo");
 
                         // await addOp({
                         // 	uid: this.userid,
@@ -705,28 +705,149 @@ export default {
                     );
                 });
         },
-    },
-    mounted() {
-        if (this.fromL.admin.CampusF) {
-            this.CampusF = JSON.parse(JSON.stringify(this.fromL.admin.CampusF));
-        } else {
-            this.CampusF = {
-                GroupBri: "暂无简介",
-                feature: [
+        async getSchFacility(val){
+            this.AllLoading=true
+            let params = [{
+                functionName: API_CONFIG.ajax_schoolPermission.functionName, // 调用存储过程的名称
+                org: this.userinfo.org, //组织id
+                oid: val, //学校id
+            }];
+
+            console.log('params',params);
+            // 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
+            // 第一步
+            let res = await axios.post(API_CONFIG.baseUrl, params)
+            let perData= JSON.parse(res.data[0][0].json)
+            
+            // 第二步
+            let params2 = [
                     {
-                        bri: "暂无简介",
-                        icon: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/tese1745913146000.svg",
-                        name: "默认标题",
+                        functionName: "select_desktopToolByPage",
+                        status: "",
+                        page: 1,
+                        lim: 9999999,
                     },
-                ],
-                teacherN: {
-                    teaBri: "暂无简介",
-                    list: [{ bri: "默认标题", name: "暂无数据" }],
-                },
-                appList: [],
-            };
+                    ];
+            let res2 = await axios.post(API_CONFIG.baseUrl, params2)
+            let toolList = res2.data[0];
+            toolList.forEach((i) => {
+                i.url = JSON.parse(i.url);
+                i.json = JSON.parse(i.json);
+                i.argumentList = JSON.parse(i.argumentList);
+            });
+
+            let params3 = [
+                    {
+                        functionName: "select_schUsuallyApp",
+                        userid: "",
+                        stand: "cn",
+                    },
+                ];
+                let res3 = await axios.post(API_CONFIG.baseUrl, params3)
+        
+
+                let _list = res3.data[0]
+
+                _list.forEach((i) => {
+                    i.json = JSON.parse(i.json);
+                });
+
+                let appList = _list;
+
+                // 第三步
+                perData.desktop.list.forEach((i, index) => {
+                    let _index = toolList.findIndex((i2) => i == i2.id);
+                    if (_index != -1) {
+                        perData.desktop.list[index] = toolList[_index];
+                    } 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.CampusF.appList = perData.admin.CampusF.appList.filter(Boolean);
+                }
+
+
+                perData.admin.index.list.forEach((i, index) => {
+                    let _index = toolList.findIndex((i2) => i == i2.id);
+                    if (_index != -1) {
+                        perData.admin.index.list[index] = toolList[_index];
+                        perData.admin.index.list[index].hovered = false
+                    } else {
+                        console.log("无工具", i);
+                    }
+                });
+                perData.admin.sidebar.list.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) {
+                                perData.admin.sidebar.list[index].children[index2] = _toolList[_index];
+                                perData.admin.sidebar.list[index].children[index2].typeId = perData.admin.sidebar.list[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) {
+                            perData.admin.sidebar.list[index] = _toolList[_index];
+                            perData.admin.sidebar.list[index].typeId =
+                            perData.admin.sidebar.list[index].id;
+                        } else {
+                            console.log("无工具", i);
+                        } 
+                    }
+                });
+                console.log('perData',perData);
+
+                this.Alldata = perData
+                this.AllLoading=false
+
+                if (perData.admin.CampusF) {
+                    this.CampusF = JSON.parse(JSON.stringify(perData.admin.CampusF));
+                } else {
+                    this.CampusF = {
+                        GroupBri: "暂无简介",
+                        feature: [
+                            {
+                                bri: "暂无简介",
+                                icon: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/tese1745913146000.svg",
+                                name: "默认标题",
+                            },
+                        ],
+                        teacherN: {
+                            teaBri: "暂无简介",
+                            list: [{ bri: "默认标题", name: "暂无数据" }],
+                        },
+                        appList: [],
+                    };
+                }
+
+    //   commit('SET_FROM', perData)
         }
-        console.log("CampusF", this.CampusF.appList);
+    },
+    mounted() {
+        this.getSchFacility(this.schId)
+        
+        // console.log("CampusF", this.CampusF.appList);
     },
 };
 </script>
@@ -867,6 +988,13 @@ export default {
     box-sizing: border-box;
     background: #fff;
 }
+.AppStoreCon img{
+    width: 32px;
+    height: 32px;
+    margin-bottom: 10px;
+    object-fit: cover;
+    border-radius: 50%;
+}
 
 .AppAdd {
     height: 171px;

+ 21 - 4
src/views/kanBan/index.vue

@@ -46,15 +46,15 @@
             
             <div class="mainArea">
                 <div v-if="isActive === 1 || isActive === 2">
-                    <schoolArea />
+                    <schoolArea :schId="schId" @cutSch="cutSch"/>
                 </div>
 
                 <div class="right_content">
                     <div class="Con" v-if="isActive === 1">
-                    <AdataKanban></AdataKanban>
+                        <AdataKanban></AdataKanban>
                     </div>
                     <div class="Con" v-if="isActive === 2">
-                    <AschoolFeature></AschoolFeature>
+                        <AschoolFeature :schId="schId"></AschoolFeature>
                     </div>
                     <div class="Con" v-if="isActive === 3">
                         <AquickEntrance :key="isActive"></AquickEntrance>
@@ -105,9 +105,14 @@ export default {
         return {
             isActive: 1,
             isIndex2:'',
+            schId:'',
         }
     },
     methods: {
+        cutSch(val){
+            console.log('val',val);
+            this.schId = val
+        },
         ...mapActions({
             logout: 'user/logout'
         }),
@@ -148,7 +153,19 @@ export default {
     mounted() {
         const index = this.$route.query.index; // 123
         console.log(index);
-        
+        if (this.userinfo.role == 1 
+        && this.userinfo.rrole == 1 
+        && this.userinfo.type ==1 
+        && this.fromL.admin.school.list 
+        && this.fromL.admin.school.list[0]
+        && this.fromL.admin.school.list[0].children
+        && this.fromL.admin.school.list[0].children.length) {
+            this.schId = this.fromL.admin.school.list[0].children[0].schoolid
+        }else{
+            this.schId = this.userinfo.organizeid
+        }
+
+
         if (index == 2) {
             this.isActive = 2
             this.isIndex2 = 2