11wqe1 před 3 měsíci
rodič
revize
891b7cc3d2

+ 185 - 0
src/components/dialog/addCampusDialog.vue

@@ -0,0 +1,185 @@
+<template>
+	<div>
+		<el-dialog
+			:title="type == 'edit' ? '编辑办学特色' : '编辑师资力量'"
+			class="table"
+			:visible.sync="show"
+			:close-on-click-modal="false"
+			width="800px"
+			top="8vh"
+		>
+			<div v-loading="loading">
+				<el-image
+					style="
+						width: 50px;
+						height: 50px;
+						cursor: pointer;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+					"
+					:src="form.icon"
+					fit="cover"
+					v-if="this.type == 0"
+					@click="addUrlIcon()"
+				>
+					<div slot="error" class="image-slot" @click="addUrlIcon()">
+						<i class="el-icon-picture-outline"></i>
+					</div>
+				</el-image>
+
+				<div>
+					<div class="Tit">标题</div>
+					<div>
+						<el-input v-model="form.name" placeholder="请输入内容"></el-input>
+					</div>
+				</div>
+
+				<div>
+					<div class="Tit">描述</div>
+					<div>
+                        <el-input
+                            type="textarea"
+                            :rows="3"
+                            resize="none"
+                            placeholder="请输入描述"
+                            v-model="form.bri">
+                        </el-input>
+					</div>
+				</div>
+			</div>
+			<!-- 按钮区域 -->
+			<div slot="footer" class="el-dialog__footer">
+				<el-button @click="close()">取 消</el-button>
+				<el-button type="primary" @click="submit()">确认</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+import "@/common/aws-sdk-2.235.1.min.js";
+export default {
+	data() {
+		return {
+			show: false,
+			loading: false,
+			form: {
+				name: "",
+				icon: "",
+				bri: "",
+			},
+			type: null,
+		};
+	},
+	methods: {
+		open(data, type) {
+			this.form = JSON.parse(JSON.stringify(data));
+
+			this.type = type;
+			this.show = true;
+		},
+		close() {
+			this.show = false;
+			this.init();
+		},
+		init() {
+			this.form = {
+				name: "",
+				icon: "",
+				bri: "",
+			};
+		},
+		submit() {
+			if (this.type == 0) {
+				if (!this.form.name || !this.form.icon || !this.form.bri)
+					return this.$message.error("请完善表单");
+			} else {
+				if (!this.form.name || !this.form.bri)
+					return this.$message.error("请完善表单");
+			}
+			this.$emit("success", { item: this.form });
+            this.close()
+		},
+		async addUrlIcon() {
+			let _url = await this.uploadFile("image/*");
+			console.log("addUrlIcon", _url);
+
+			if (_url) {
+				this.form.icon = _url;
+			} else {
+				return console.log("无图片");
+			}
+		},
+		uploadFile(accept = "*") {
+			return new Promise((resolve) => {
+				const input = document.createElement("input");
+				input.type = "file";
+				input.accept = accept;
+				input.onchange = (event) => {
+					const file = event.target.files[0];
+					if (file) {
+						let credentials = {
+							accessKeyId: "AKIATLPEDU37QV5CHLMH",
+							secretAccessKey: "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",
+						}; //秘钥形式的登录上传
+						window.AWS.config.update(credentials);
+						window.AWS.config.region = "cn-northwest-1"; //设置区域
+						let bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+						// let _name = file.name;
+						// let size = file.size;
+						let params = {
+							Key:
+								file.name.split(".")[0] +
+								new Date().getTime() +
+								"." +
+								file.name.split(".")[file.name.split(".").length - 1],
+							ContentType: file.type,
+							Body: file,
+							"Access-Control-Allow-Credentials": "*",
+							ACL: "public-read",
+						}; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+						let options = {
+							partSize: 2048 * 1024 * 1024,
+							queueSize: 2,
+							leavePartsOnError: true,
+						};
+
+						bucket
+							.upload(params, options)
+							.on("httpUploadProgress", (evt) => {
+								console.log(evt);
+							})
+							.send((err, data) => {
+								if (err) {
+									this.$message.error("上传失败");
+									return resolve("");
+								} else {
+									return resolve(data.Location);
+								}
+							});
+					} else {
+						resolve("");
+					}
+				};
+				input.click();
+			});
+		},
+	},
+};
+</script>
+
+<style scoped>
+.table >>> .el-dialog__header {
+	padding: 15px 20px;
+	background: #454545;
+}
+
+.table >>> .el-dialog__title {
+	color: #fff;
+}
+.Tit{
+    padding: 15px 0;
+    font-size: 14px;
+}
+</style>

+ 342 - 13
src/components/dialog/permissionSettingDialog.vue

@@ -53,6 +53,11 @@
 							v-if="type == 'org'"
 							>学校设置</span
 						>
+						<span
+							:class="{ pa_a_h_active: tagType == 'admin-feature' }"
+							@click="changeTagType('admin-feature')"
+							>校区特色</span
+						>
 						<!-- v-if="data.parentid" -->
 					</div>
 					<div class="ea_add">
@@ -72,7 +77,7 @@
 						>
 						<el-button
 							size="mini"
-							v-if="['admin-cocoFlow', 'admin-cocoFlow2'].includes(tagType)"
+							v-if="['admin-cocoFlow', 'admin-cocoFlow2','admin-feature'].includes(tagType)"
 							type="primary"
 							@click="addApp()"
 							>添加应用</el-button
@@ -1272,6 +1277,209 @@
 							</el-table>
 						</div>
 					</div>
+
+					<div class="editArea pa_a_eb_feature" v-show="tagType == 'admin-feature'">
+						<div class="ea_appList">
+							<div class="ea_appListTit">集团简介</div>
+							<el-input
+								type="textarea"
+								:rows="2"
+								resize="none"
+								placeholder="请输入内容"
+								v-model="form.admin.CampusF.GroupBri">
+							</el-input>
+						</div>
+
+						<div class="ea_appList">
+							<div class="ea_appListTit">办学特色</div>
+							<el-table
+								:data="form.admin.CampusF.feature"
+								stripe
+								border
+								style="width: 100%"
+								:header-cell-style="headerCellStyle"
+							>
+								<el-table-column
+									label="icon"
+									min-width="200"
+									show-overflow-tooltip
+								>
+									<template slot-scope="scope">
+										<img style="height: 30px;width: 30px;object-fit: cover;" :src="scope.row.icon" alt="">
+									</template>
+								</el-table-column>
+
+								<el-table-column
+									label="标题"
+									min-width="200"
+									show-overflow-tooltip
+								>
+									<template slot-scope="scope">{{
+										scope.row.name ? scope.row.name : "-"
+									}}</template>
+								</el-table-column>
+
+								<el-table-column
+									label="简介"
+									min-width="200"
+									show-overflow-tooltip
+								>
+									<template slot-scope="scope">{{
+										scope.row.bri ? scope.row.bri : "-"
+									}}</template>
+								</el-table-column>
+
+								<el-table-column
+									label="修改"
+									min-width="200"
+									show-overflow-tooltip
+								>
+									<template  slot-scope="scope">
+										<button
+											@click="editRunS(scope.$index,scope.row,0)"
+											style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											"
+										>
+											修改
+										</button>
+									</template>
+								</el-table-column>
+							</el-table>
+						</div>
+
+						<div class="ea_appList">
+							<div class="ea_appListTit">师资力量</div>
+							<el-input
+								style="margin-bottom: 10px;"
+								type="textarea"
+								:rows="2"
+								resize="none"
+								placeholder="请输入描述"
+								v-model="form.admin.CampusF.teacherN.teaBri">
+							</el-input>
+							<el-table
+								:data="form.admin.CampusF.teacherN.list"
+								stripe
+								border
+								style="width: 100%"
+								:header-cell-style="headerCellStyle"
+							>
+								<el-table-column
+									label="标题"
+									min-width="200"
+									show-overflow-tooltip
+								>
+									<template slot-scope="scope">{{
+										scope.row.name ? scope.row.name : "-"
+									}}</template>
+								</el-table-column>
+
+								<el-table-column
+									label="简介"
+									min-width="200"
+									show-overflow-tooltip
+								>
+									<template slot-scope="scope">{{
+										scope.row.bri ? scope.row.bri : "-"
+									}}</template>
+								</el-table-column>
+
+								<el-table-column
+									label="修改"
+									min-width="200"
+									show-overflow-tooltip
+								>
+									<template  slot-scope="scope">
+										<button
+											@click="editRunS(scope.$index,scope.row,1)"
+											style="
+												color: #308fff;
+												background: none;
+												border: none;
+												cursor: pointer;
+												margin-left: 25px;
+											"
+										>
+											修改
+										</button>
+									</template>
+								</el-table-column>
+							</el-table>
+						</div>
+
+						<div class="ea_appList">
+							<div class="ea_appListTit">
+								特色应用
+							</div>
+							<div style="display: flex;flex-wrap: wrap;">
+								<template v-if="form.admin.CampusF.appList.length">
+									<div
+										class="appItem"
+										v-for="(item, index) in form.admin.CampusF.appList"
+										:key="item.id"
+									>
+										<div class="ai_left">
+											<el-image
+												style="width: 100%; height: 100%; cursor: pointer"
+												:src="item.setIcon ? item.setIcon : item.json.icon"
+												fit="cover"
+												@click="updateIconCocoFLow(index)"
+											></el-image>
+										</div>
+										<div class="ai_right">
+											<div>{{ item.name }}</div>
+											<div class="ai_r_btn">
+												<svg
+													@click="moveApp(item.id, 0)"
+													v-if="index != 0"
+													t="1744598539024"
+													class="icon"
+													viewBox="0 0 1470 1024"
+													version="1.1"
+													xmlns="http://www.w3.org/2000/svg"
+													p-id="2613"
+													width="200"
+													height="200"
+												>
+													<path
+														d="M664.965051 36.390373L20.010522 880.212016c-44.471546 58.191134-2.978155 142.114864 70.271066 142.114863h1289.8254c73.232489 0 114.725879-83.923729 70.271065-142.114863L805.473719 36.390373a88.441155 88.441155 0 0 0-140.508668 0z"
+														p-id="2614"
+													></path>
+												</svg>
+												<svg
+													@click="moveApp(item.id, 1)"
+													v-if="index != form.admin.cocoFlow.length - 1"
+													style="transform: rotate(180deg)"
+													t="1744598539024"
+													class="icon"
+													viewBox="0 0 1470 1024"
+													version="1.1"
+													xmlns="http://www.w3.org/2000/svg"
+													p-id="2613"
+													width="200"
+													height="200"
+												>
+													<path
+														d="M664.965051 36.390373L20.010522 880.212016c-44.471546 58.191134-2.978155 142.114864 70.271066 142.114863h1289.8254c73.232489 0 114.725879-83.923729 70.271065-142.114863L805.473719 36.390373a88.441155 88.441155 0 0 0-140.508668 0z"
+														p-id="2614"
+													></path>
+												</svg>
+											</div>
+											<span>{{ item.detail }}</span>
+										</div>
+									</div>
+								</template>
+							</div>
+							
+						</div>
+					</div>
+
+
 				</div>
 			</div>
 			<!-- 按钮区域 -->
@@ -1289,6 +1497,7 @@
 			@success="selectSchoolSuccess"
 			:id="data ? data.id : ''"
 		/>
+		<addCampusDialog ref="addCampusDialogRef" @success="addCampusSuccess" />
 	</div>
 </template>
 
@@ -1302,6 +1511,8 @@ import { mapGetters } from "vuex";
 import selectAppDialog from "./selectAppDialog.vue";
 import selectSchoolDialog from "./selectSchoolDialog.vue";
 import addBannerDialog from "./addBannerDialog";
+import addCampusDialog from "./addCampusDialog";
+
 export default {
 	components: {
 		selectToolDialog,
@@ -1309,6 +1520,7 @@ export default {
 		selectAppDialog,
 		addBannerDialog,
 		selectSchoolDialog,
+		addCampusDialog
 	},
 	computed: {
 		...mapGetters(["userid"]),
@@ -1336,6 +1548,12 @@ export default {
 				desktop: {
 					list: [],
 				},
+				// 修改小区特色信息
+				CampusData:'',
+				CampusType:0,
+				// 0 办学特色 1 师资力量
+				CampusNum:0,
+
 				admin: {
 					index: {
 						list: [],
@@ -1347,19 +1565,70 @@ export default {
 					school: {
 						list: [],
 					},
+					CampusF: {
+						GroupBri:'',
+						feature:[],
+						teacherN:{
+							teaBri:'',
+							list: [],
+						},
+						appList: [],
+					},
 				},
 			},
 		};
 	},
 	methods: {
+		// 修改 0办学特色 1师资力量
+		editRunS(index,val,type){
+			this.CampusData = val
+			this.CampusType = type
+			this.CampusNum = index
+			this.$refs.addCampusDialogRef.open(val, type);
+		},
+		// 修改数据0办学特色 1师资力量
+		addCampusSuccess(val){
+			if (this.CampusType == 0) {
+				this.form.admin.CampusF.feature.splice(this.CampusNum,1,val.item)
+			}else{
+				this.form.admin.CampusF.teacherN.list.splice(this.CampusNum,1,val.item)
+			}
+		},
 		open(data, type) {
 			this.init();
 			let _data = JSON.parse(JSON.stringify(data));
+			console.log('_data',_data);
+			
 			if (_data.json) {
 				let _form = JSON.parse(_data.json);
 				if (!_form.admin.school) {
 					_form.admin.school = { list: [] };
 				}
+				if (!_form.admin.CampusF) {
+					_form.admin.CampusF = {
+						GroupBri:'',
+						feature:[
+							{icon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/tese1745913146000.svg',
+							name:'智能教育',bri:'引入AI技术,打造智能化学习环境,提供个性化教学服务。'},
+							{icon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/tese1745913146000.svg',
+							name:'小班教学',bri:'采用小班制教学模式,确保每个学生都能得到充分关注。'},
+							{icon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/tese1745913146000.svg',
+							name:'国际视野',bri:'开展国际交流项目,培养学生国际化视野和跨文化交际能力'},
+							{icon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/tese1745913146000.svg',
+							name:'艺术教育',bri:'引入AI技术,打造智能化学习环境,提供个性化教学服务。'}
+						],
+						teacherN:{
+							teaBri:'',
+							list: [
+								{name:'专职教师',bri:'120+'},
+								{name:'硕士及以上',bri:'90%'},
+								{name:'市级奖项',bri:'30+'},
+								{name:'特级教师',bri:'15+'},
+							],
+						},
+						appList: [],
+					};
+				}
 				this.form = _form;
 			}
 			Promise.all([this.getToolData(), this.getAppData()])
@@ -1402,6 +1671,15 @@ export default {
 					school: {
 						list: [],
 					},
+					CampusF: {
+						GroupBri:'',
+						feature:[],
+						teacherN:{
+							teaBri:'',
+							list: [],
+						},
+						appList: [],
+					}
 				},
 			};
 			this.type = null;
@@ -1893,6 +2171,12 @@ export default {
 				? _form.admin.cocoFlow2.map((i) => {
 						return { id: i.id, setIcon: i.setIcon }})
 				: [];
+
+				_form.admin.CampusF.appList = _form.admin.CampusF.appList
+				? _form.admin.CampusF.appList.map((i) => {
+						return { id: i.id, setIcon: i.setIcon }})
+				: [];
+
 			let params = [
 				{
 					functionName: "update_orgOroid_json_byId",
@@ -1901,7 +2185,7 @@ export default {
 					type: this.type,
 				},
 			];
-			console.log(_form);
+			console.log('_form',_form);
 			this.loading = true;
 			this.$ajax
 				.post(API_CONFIG.baseUrl, params)
@@ -1965,6 +2249,19 @@ export default {
 				});
 			}
 
+			if (_form.admin.CampusF.appList) {
+				_form.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;
+						_form.admin.CampusF.appList[index] = _setData;
+					} else {
+						console.log("无应用", i);
+					}
+				});
+			}
+			
 			_form.admin.index.list.forEach((i, index) => {
 				let _index = toolList.findIndex((i2) => i == i2.id);
 				if (_index != -1) {
@@ -1973,7 +2270,6 @@ export default {
 					console.log("无工具", i);
 				}
 			});
-
 			_form.admin.sidebar.list.forEach((i, index) => {
 				if (i.children) {
 					i.children.forEach((i2, index2) => {
@@ -2097,6 +2393,9 @@ export default {
 			} else if (this.tagType == "admin-cocoFlow2") {
 				_list = this.form.admin.cocoFlow2 ? this.form.admin.cocoFlow2 : [];
 				_max = 4;
+			} else if (this.tagType == "admin-feature") {
+				_list = this.form.admin.CampusF.appList ? this.form.admin.CampusF.appList : [];
+				_max = 3;
 			}
 			this.$refs.selectAppDialogRef.open({
 				select: _list,
@@ -2118,16 +2417,28 @@ export default {
 			}
 			}else if(this.tagType=='admin-cocoFlow2'){
 				let _index = this.form.admin.cocoFlow2.findIndex((i) => i.id == id);
-			if (type == 0 && _index != 0) {
-				//上移
-				let temp = this.form.admin.cocoFlow2[_index - 1];
-				this.form.admin.cocoFlow2[_index - 1] = this.form.admin.cocoFlow2[_index];
-				this.form.admin.cocoFlow2[_index] = temp;
-			} else if (type == 1 && _index != this.form.admin.cocoFlow2.length - 1) {
-				let temp = this.form.admin.cocoFlow2[_index + 1];
-				this.form.admin.cocoFlow2[_index + 1] = this.form.admin.cocoFlow2[_index];
-				this.form.admin.cocoFlow2[_index] = temp;
-			}
+				if (type == 0 && _index != 0) {
+					//上移
+					let temp = this.form.admin.cocoFlow2[_index - 1];
+					this.form.admin.cocoFlow2[_index - 1] = this.form.admin.cocoFlow2[_index];
+					this.form.admin.cocoFlow2[_index] = temp;
+				} else if (type == 1 && _index != this.form.admin.cocoFlow2.length - 1) {
+					let temp = this.form.admin.cocoFlow2[_index + 1];
+					this.form.admin.cocoFlow2[_index + 1] = this.form.admin.cocoFlow2[_index];
+					this.form.admin.cocoFlow2[_index] = temp;
+				}
+			}else if(this.tagType=='admin-feature'){
+				let _index = this.form.admin.CampusF.appList.findIndex((i) => i.id == id);
+				if (type == 0 && _index != 0) {
+					//上移
+					let temp = this.form.admin.CampusF.appList[_index - 1];
+					this.form.admin.CampusF.appList[_index - 1] = this.form.admin.CampusF.appList[_index];
+					this.form.admin.CampusF.appList[_index] = temp;
+				} else if (type == 1 && _index != this.form.admin.CampusF.appList.length - 1) {
+					let temp = this.form.admin.CampusF.appList[_index + 1];
+					this.form.admin.CampusF.appList[_index + 1] = this.form.admin.CampusF.appList[_index];
+					this.form.admin.CampusF.appList[_index] = temp;
+				}
 			}
 			this.$forceUpdate();
 		},
@@ -2136,6 +2447,8 @@ export default {
 				this.form.admin.cocoFlow = JSON.parse(JSON.stringify(data));
 			} else if (this.tagType == "admin-cocoFlow2") {
 				this.form.admin.cocoFlow2 = JSON.parse(JSON.stringify(data));
+			} else if (this.tagType == "admin-feature") {
+				this.form.admin.CampusF.appList = JSON.parse(JSON.stringify(data));
 			}
 			this.$forceUpdate();
 			this.$refs.selectAppDialogRef.close();
@@ -2167,6 +2480,10 @@ export default {
 					let _data = JSON.parse(JSON.stringify(this.form.admin.cocoFlow2));
 					_data[index].setIcon = _url;
 					this.form.admin.cocoFlow2 = _data;
+				} else if (this.tagType == "admin-feature") {
+					let _data = JSON.parse(JSON.stringify(this.form.admin.CampusF.appList));
+					_data[index].setIcon = _url;
+					this.form.admin.CampusF.appList = _data;
 				}
 				this.$forceUpdate();
 			} else {
@@ -2426,4 +2743,16 @@ export default {
 	overflow: hidden;
 	text-overflow: ellipsis;
 }
+.pa_a_eb_feature{
+	display: flex;
+	flex-direction: column;
+}
+
+.ea_appListTit{
+	height: 40px;
+	line-height: 40px;
+	margin: 20px 0 0;
+}
+.ea_appList{
+}
 </style>