Bläddra i källkod

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pblUserManage

lzw 6 månader sedan
förälder
incheckning
b75c90af60

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/css/app.3f7a372b.css


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/css/app.4b5a86a4.css


+ 1 - 1
dist/index.html

@@ -36,4 +36,4 @@
         width: 100%;
         background: #e6eaf0;
         font-family: '黑体';
-      }</style><script defer="defer" src="/js/chunk-vendors.ac8f9183.js"></script><script defer="defer" src="/js/app.4ae988ab.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.4b5a86a4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
+      }</style><script defer="defer" src="/js/chunk-vendors.3a922260.js"></script><script defer="defer" src="/js/app.96b84faa.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.3f7a372b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/js/app.4ae988ab.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/js/app.4ae988ab.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/js/app.96b84faa.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/js/app.96b84faa.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/js/chunk-vendors.3a922260.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/js/chunk-vendors.3a922260.js.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4 - 0
src/common/aws-sdk-2.235.1.min.js


+ 482 - 0
src/components/desktopToolList.vue

@@ -0,0 +1,482 @@
+<template>
+	<div class="desktopToolList">
+		<div class="title_examine">
+			<div class="pub_title">工具列表</div>
+			<div class="t_right">
+				<el-button type="primary" size="small" @click="addTool()"
+					>添加工具</el-button
+				>
+			</div>
+		</div>
+
+		<div class="table_content tableArea">
+			<div class="button_top">
+				<div @click="changeStatus('')">全部({{ pageData.total }})</div>
+			</div>
+			<el-table
+				:data="desktopList"
+				stripe
+				border
+				style="width: 100%"
+				v-loading="loading"
+				:header-cell-style="headerCellStyle"
+			>
+			<el-table-column label="标识" min-width="45" show-overflow-tooltip>
+					<template slot-scope="scope">{{
+						scope.row.toolId ? scope.row.toolId : "-"
+					}}</template>
+				</el-table-column>
+				<el-table-column label="宽度" min-width="45" show-overflow-tooltip>
+					<template slot-scope="scope">{{
+						scope.row.dialogWidth ? scope.row.dialogWidth : "-"
+					}}</template>
+				</el-table-column>
+				<el-table-column label="高度" min-width="45" show-overflow-tooltip>
+					<template slot-scope="scope">{{
+						scope.row.dialogHeight ? scope.row.dialogHeight : "-"
+					}}</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="45" show-overflow-tooltip>
+					<template slot-scope="scope">
+						<el-popover placement="bottom" width="840" trigger="hover">
+							<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>
+								</div>
+							</div>
+							<el-button slot="reference">查看设置</el-button>
+						</el-popover>
+					</template>
+				</el-table-column>
+				<el-table-column label="参数" min-width="150" show-overflow-tooltip>
+					<template slot-scope="scope">
+						<div v-if="scope.row.argumentList.length">
+							<el-tag
+								v-for="(item, index) in scope.row.argumentList"
+								:key="index"
+								style="margin-right: 10px"
+								effect="plain"
+								>{{ item }}</el-tag
+							>
+						</div>
+						<span v-else>-</span>
+					</template>
+				</el-table-column>
+
+				<el-table-column
+					label="仅管理员显示"
+					min-width="45"
+					show-overflow-tooltip
+				>
+					<template slot-scope="scope">{{
+						scope.row.isAdmin == "1" ? "是" : "否"
+					}}</template>
+				</el-table-column>
+
+				<el-table-column label="工具状态" min-width="50" show-overflow-tooltip>
+					<template slot-scope="scope">{{
+						statusList[scope.row.status]
+					}}</template>
+				</el-table-column>
+
+				<el-table-column label="操作" width="200px" show-overflow-tooltip>
+					<template slot-scope="scope">
+						<button
+							@click="editTool(scope.row)"
+							style="
+								color: #308fff;
+								background: none;
+								border: none;
+								cursor: pointer;
+								margin-left: 25px;
+							"
+						>
+							修改
+						</button>
+
+						<button
+							v-if="scope.row.status == '0'"
+							@click="changeToolStatus(scope.row, '1')"
+							style="
+								color: #ff2570;
+								background: none;
+								border: none;
+								cursor: pointer;
+								margin-left: 25px;
+							"
+						>
+							停用
+						</button>
+
+						<button
+							v-if="scope.row.status == '1'"
+							@click="changeToolStatus(scope.row, '0')"
+							style="
+								color: #67C23A;
+								background: none;
+								border: none;
+								cursor: pointer;
+								margin-left: 25px;
+							"
+						>
+							启用
+						</button>
+					</template>
+				</el-table-column>
+			</el-table>
+
+			<el-pagination
+				style="margin-top: 10px"
+				:current-page="pageData.nowPage"
+				:page-size="pageData.lim"
+				:total="pageData.total"
+				@current-change="handlePageChange"
+				layout="total,prev, pager, next, jumper"
+			>
+			</el-pagination>
+		</div>
+		<addDesktopToolDialog
+			ref="addDesktopToolDialogRef"
+			@success="addDesktopToolSuccess"
+		/>
+	</div>
+</template>
+
+<script>
+import { API_CONFIG } from "@/common/apiConfig";
+import addDesktopToolDialog from "./dialog/addDesktopToolDialog.vue";
+export default {
+	components: {
+		addDesktopToolDialog,
+	},
+	data() {
+		return {
+			desktopList: [],
+			selectStatus: "",
+			pageData: {
+				nowPage: 1,
+				lim: 10,
+				total: 0,
+			},
+			loading: false,
+			statusList: ["正常使用", "已停用", "已删除"],
+		};
+	},
+	methods: {
+		// 表头的背景色
+		headerCellStyle() {
+			return { backgroundColor: "#f1f1f1" };
+		},
+		//获取数据
+		getData() {
+			let params = [
+				{
+					functionName: "select_desktopToolByPage",
+					status: this.selectStatus,
+					page: this.pageData.nowPage,
+					lim: this.pageData.lim,
+				},
+			];
+			this.loading = true;
+			this.$ajax
+				.post(API_CONFIG.baseUrl, params)
+				.then((res) => {
+					let _data = res.data;
+					let _list = _data[0];
+					let _total = _data[1][0].total;
+					_list.forEach((i) => {
+						i.url = JSON.parse(i.url);
+						i.json = JSON.parse(i.json);
+						i.argumentList = JSON.parse(i.argumentList);
+					});
+					this.desktopList = _list;
+					this.pageData.total = _total;
+					this.loading = false;
+					// console.log(_data)
+				})
+				.catch((err) => {
+					console.log(err);
+					this.loading = false;
+					this.$message.error("获取工具数据失败");
+				});
+		},
+		handlePageChange(newPage) {
+			this.pageData.nowPage = newPage;
+			this.getData();
+		},
+		addTool() {
+			this.$refs.addDesktopToolDialogRef.open();
+		},
+		addDesktopToolSuccess(form) {
+			if (form.id) {
+				let params = [
+					{
+						functionName: "update_desktopToolById",
+						id: form.id,
+						toolId:form.toolId,
+						width: form.dialogWidth,
+						height: form.dialogHeight,
+						description: form.description,
+						admin: form.isAdmin,
+						argumentList: JSON.stringify(form.argumentList),
+						url: JSON.stringify(form.url),
+						json: JSON.stringify(form.json),
+						status: form.status,
+					},
+				];
+				this.$refs.addDesktopToolDialogRef.loading = true;
+				this.$ajax
+					.post(API_CONFIG.baseUrl, params)
+					.then((res) => {
+						if (res.data == 1) {
+							this.$refs.addDesktopToolDialogRef.close();
+							this.$message.success("修改工具成功");
+						} else if(res.data[0][0].message == "repeat toolId"){
+							this.$message.error("工具标识重复!")
+						} else {
+							this.$message.error("修改工具失败");
+						}
+						this.$refs.addDesktopToolDialogRef.loading = false;
+						this.getData();
+					})
+					.catch((err) => {
+						console.log(err);
+						this.$message.error("修改工具失败");
+						this.$refs.addDesktopToolDialogRef.loading = false;
+					});
+			} else {
+				let params = [
+					{
+						functionName: "insert_desktopTool",
+						toolId:form.toolId,
+						width: form.dialogWidth,
+						height: form.dialogHeight,
+						description: form.description,
+						admin: form.isAdmin,
+						argumentList: JSON.stringify(form.argumentList),
+						url: JSON.stringify(form.url),
+						json: JSON.stringify(form.json),
+					},
+				];
+				this.$refs.addDesktopToolDialogRef.loading = true;
+				this.$ajax
+					.post(API_CONFIG.baseUrl, params)
+					.then((res) => {
+						console.log(res)
+						if (res.data == 1) {
+							this.$refs.addDesktopToolDialogRef.close();
+							this.$message.success("添加工具成功");
+						} else if(res.data[0][0].message == "repeat toolId"){
+							this.$message.error("工具标识重复!")
+						}else{
+							this.$message.error("添加工具失败");
+						}
+						this.$refs.addDesktopToolDialogRef.loading = false;
+						this.getData();
+					})
+					.catch((err) => {
+						console.log(err);
+						this.$message.error("添加工具失败");
+						this.$refs.addDesktopToolDialogRef.loading = false;
+					});
+			}
+		},
+		editTool(item) {
+			this.$refs.addDesktopToolDialogRef.open(item);
+		},
+		changeStatus() {
+			this.pageData.nowPage = 1;
+			this.getData();
+		},
+		changeToolStatus(item, newValue) {
+			let _data = JSON.parse(JSON.stringify(item));
+			_data.status = newValue;
+			this.loading = true;
+			let params = [
+				{
+					functionName: "update_desktopToolById",
+					id: _data.id,
+					toolId:_data.toolId,
+					width: _data.dialogWidth,
+					height: _data.dialogHeight,
+					description: _data.description,
+					admin: _data.isAdmin,
+					argumentList: JSON.stringify(_data.argumentList),
+					url: JSON.stringify(_data.url),
+					json: JSON.stringify(_data.json),
+					status: _data.status,
+				},
+			];
+			this.$ajax
+				.post(API_CONFIG.baseUrl, params)
+				.then((res) => {
+					if (res.data == 1) {
+						this.$message.success("已停用");
+					} else {
+						this.$message.error("停用失败");
+					}
+					this.loading = false;
+					this.getData();
+				})
+				.catch((err) => {
+					console.log(err);
+					this.loading = false;
+					this.$message.error("停用失败");
+				});
+		},
+	},
+	mounted() {
+		this.getData();
+	},
+};
+</script>
+
+<style scoped>
+.desktopToolList {
+	width: 100%;
+	height: 100%;
+	box-sizing: border-box;
+	padding: 10px;
+	overflow: auto;
+}
+
+.tableArea {
+	margin: 10px 0;
+}
+
+.button_top {
+	width: 100%;
+	display: flex;
+	align-items: center;
+	margin: 10px 0;
+}
+
+.button_top > div {
+	font-weight: bold;
+	margin-right: 20px;
+	cursor: pointer;
+}
+
+.title_examine {
+	display: flex;
+	justify-content: space-between;
+}
+
+.urlItemBox {
+	display: flex;
+	flex-wrap: wrap;
+}
+
+.urlItem {
+	width: 400px;
+	height: 250px;
+	overflow: auto;
+	position: relative;
+	box-sizing: border-box;
+	border-bottom: solid 1px #ebeef5;
+}
+
+/* .urlItem::after{
+	content: "";
+	height: 2px;
+	width: 100%;
+	background-color: #ebeef5;
+	position: absolute;
+	bottom: 10px;
+} */
+
+.urlItem:nth-child(2n) {
+	margin-left: 20px;
+}
+
+.urlItem > span {
+	font-size: 18px;
+	font-weight: bold;
+}
+
+.ui_m_image {
+	width: 40px;
+	height: 40px;
+	float: left;
+	display: flex;
+	align-items: center;
+}
+
+.ui_message > div {
+	display: flex;
+	align-items: center;
+}
+
+.ui_message > div > span {
+	white-space: nowrap;
+}
+</style>

+ 510 - 0
src/components/dialog/addDesktopToolDialog.vue

@@ -0,0 +1,510 @@
+<template>
+	<div>
+		<el-dialog
+			:title="form.id?'修改工具':'新增工具'"
+			class="table"
+			:visible.sync="show"
+			:close-on-click-modal="false"
+			width="800px"
+			top="8vh"
+		>
+			<div v-loading="loading">
+				<el-form ref="form" :model="form" label-width="80px">
+					<div class="f_aRow">
+						<el-form-item label="标识">
+							<el-input style="width: 150px" v-model="form.toolId"></el-input>
+						</el-form-item>
+						<el-form-item label="宽度">
+							<el-input style="width: 80px" v-model="form.dialogWidth"></el-input>
+						</el-form-item>
+						<el-form-item label="高度">
+							<el-input style="width: 80px" v-model="form.dialogHeight"></el-input>
+						</el-form-item>
+
+						<el-form-item label="仅管理员可见" label-width="140px">
+							<el-switch
+								v-model="form.isAdmin"
+								active-color="#13ce66"
+								inactive-color=""
+								active-value="1"
+								inactive-value="0"
+							>
+							</el-switch>
+						</el-form-item>
+					</div>
+
+					<el-form-item label="描述">
+						<el-input
+							type="textarea"
+							v-model="form.description"
+							:rows="3"
+							resize="none"
+						></el-input>
+					</el-form-item>
+
+					<div>
+						<el-form-item label="参数">
+							<div class="argumentList">
+								<el-tag
+									:key="tag"
+									v-for="tag in form.argumentList"
+									closable
+									:disable-transitions="false"
+									effect="plain"
+									@close="addArg(tag)"
+								>
+									{{ tag }}
+								</el-tag>
+								<el-dropdown :hide-on-click="false" @command="addArg">
+									<el-button
+										type="primary"
+										size="small"
+										style="margin-left: 10px"
+									>
+										添加参数<i class="el-icon-arrow-down el-icon--right"></i>
+									</el-button>
+									<el-dropdown-menu slot="dropdown">
+										<el-dropdown-item
+											v-for="(item, index) in argumentSelectList"
+											:command="item.value"
+											:key="index"
+											><span
+												:class="{
+													activeArg: form.argumentList.includes(item.value),
+												}"
+												>{{ item.label }}</span
+											></el-dropdown-item
+										>
+									</el-dropdown-menu>
+								</el-dropdown>
+							</div>
+						</el-form-item>
+					</div>
+
+					<el-form-item label="应用设置">
+						<div v-for="(item, index) in form.url" :key="index">
+							<div class="regionTitle">{{ item.region }}</div>
+							<div class="f_aRow">
+								<div class="f_ar_input">
+									<span>工具名称</span>
+									<el-input style="width: 200px" v-model="item.name"></el-input>
+								</div>
+
+								<div class="f_ar_input" style="margin-left: 20px">
+									<span>地址链接</span>
+									<el-input style="width: 300px" v-model="item.url"></el-input>
+								</div>
+							</div>
+							<div class="f_aRow" style="margin: 10px 0">
+								<div class="f_aRow f_ar_icon">
+									<span>桌面图标</span>
+									<div class="f_icon">
+										<el-tooltip
+											class="item"
+											effect="dark"
+											:content="item.icon ? '更改图标' : '上传图标'"
+											placement="top"
+										>
+											<el-image
+												style="width: 100%; height: 100%"
+												:src="item.icon"
+												fit="cover"
+												@click="addUrlIcon(index, 'icon')"
+											>
+												<div
+													slot="error"
+													class="image-slot"
+													@click="addUrlIcon(index, 'icon')"
+												>
+													<i class="el-icon-picture-outline"></i>
+												</div>
+											</el-image>
+										</el-tooltip>
+									</div>
+								</div>
+								<div class="f_aRow f_ar_icon">
+									<span>平台图标</span>
+									<div class="f_icon" style="margin-left: 10px">
+										<el-tooltip
+											class="item"
+											effect="dark"
+											:content="item.platformIcon ? '更改图标' : '上传图标'"
+											placement="top"
+										>
+											<el-image
+												style="width: 100%; height: 100%"
+												:src="item.platformIcon"
+												fit="cover"
+												@click="addUrlIcon(index, 'platformIcon')"
+											>
+												<div
+													slot="error"
+													class="image-slot"
+													@click="addUrlIcon(index, 'platformIcon')"
+												>
+													<i class="el-icon-picture-outline"></i>
+												</div>
+											</el-image>
+										</el-tooltip>
+									</div>
+								</div>
+
+								<div class="f_aRow f_ar_icon">
+									<span>默认图标</span>
+									<div class="f_icon" style="margin-left: 10px">
+										<el-tooltip
+											class="item"
+											effect="dark"
+											:content="item.defaultIcon ? '更改图标' : '上传图标'"
+											placement="top"
+										>
+											<el-image
+												style="width: 100%; height: 100%"
+												:src="item.defaultIcon"
+												fit="cover"
+													@click="addUrlIcon(index, 'defaultIcon')"
+											>
+												<div
+													slot="error"
+													class="image-slot"
+													@click="addUrlIcon(index, 'defaultIcon')"
+												>
+													<i class="el-icon-picture-outline"></i>
+												</div>
+											</el-image>
+										</el-tooltip>
+									</div>
+								</div>
+
+								<div class="f_aRow f_ar_icon">
+									<span>激活图标</span>
+									<div class="f_icon" style="margin-left: 10px">
+										<el-tooltip
+											class="item"
+											effect="dark"
+											:content="item.activeIcon ? '更改图标' : '上传图标'"
+											placement="top"
+										>
+											<el-image
+												style="width: 100%; height: 100%"
+												:src="item.activeIcon"
+												fit="cover"
+												@click="addUrlIcon(index, 'activeIcon')"
+											>
+												<div
+													slot="error"
+													class="image-slot"
+														@click="addUrlIcon(index, 'activeIcon')"
+												>
+													<i class="el-icon-picture-outline"></i>
+												</div>
+											</el-image>
+										</el-tooltip>
+									</div>
+								</div>
+							</div>
+							<div class="f_hr"></div>
+						</div>
+						<span class="tips">如果未设置内容则使用cn的内容</span>
+					</el-form-item>
+				</el-form>
+			</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: {
+				toolId:"",
+				dialogWidth: "100",
+				dialogHeight: "100",
+				argumentList: [],
+				url: [
+					{
+						region: "cn",
+						url: "",
+						icon: "",
+						name: "",
+						platformIcon: "",
+						activeIcon: "",
+						defaultIcon: "",
+					},
+					{
+						region: "beta",
+						url: "",
+						icon: "",
+						name: "",
+						platformIcon: "",
+						activeIcon: "",
+						defaultIcon: "",
+					},
+					{
+						region: "hk",
+						url: "",
+						icon: "",
+						name: "",
+						platformIcon: "",
+						activeIcon: "",
+						defaultIcon: "",
+					},
+					{
+						region: "com",
+						url: "",
+						icon: "",
+						name: "",
+						platformIcon: "",
+						activeIcon: "",
+						defaultIcon: "",
+					},
+				],
+				json: "",
+				isAdmin: false,
+				description: "",
+				status: "0",
+			},
+			argumentSelectList: [
+				{ value: "userid", label: "userid" },
+				{ value: "oid", label: "oid" },
+				{ value: "org", label: "org" },
+				{ value: "type", label: "type" },
+				{ value: "role", label: "role" },
+				{ value: "classId", label: "classId" },
+				{ value: "TscreenType", label: "TscreenType" },
+				{ value: "SscreenType", label: "SscreenType" },
+			],
+		};
+	},
+	methods: {
+		open(data) {
+			if(data){
+				this.form = JSON.parse(JSON.stringify(data));
+			}else{
+				this.init();
+			}
+			this.show = true;
+		},
+		close() {
+			this.show = false;
+			this.init();
+		},
+		init() {
+			this.form = {
+				toolId:"",
+				dialogWidth: "100",
+				dialogHeight: "100",
+				argumentList: [],
+				url: [
+					{
+						region: "cn",
+						url: "",
+						icon: "",
+						name: "",
+						platformIcon: "",
+						activeIcon: "",
+						defaultIcon: "",
+					},
+					{
+						region: "beta",
+						url: "",
+						icon: "",
+						name: "",
+						platformIcon: "",
+						activeIcon: "",
+						defaultIcon: "",
+					},
+					{
+						region: "hk",
+						url: "",
+						icon: "",
+						name: "",
+						platformIcon: "",
+						activeIcon: "",
+						defaultIcon: "",
+					},
+					{
+						region: "com",
+						url: "",
+						icon: "",
+						name: "",
+						platformIcon: "",
+						activeIcon: "",
+						defaultIcon: "",
+					},
+				],
+				json: "",
+				isAdmin: false,
+				description: "",
+				status: "0",
+			};
+		},
+		submit() {
+			let _rule = this.form.url[0];
+			if(!this.form.toolId){
+				return this.$message.error("请完善工具标识的设置!");
+			}
+			if(!_rule.url || !_rule.icon || !_rule.name || !_rule.platformIcon || !_rule.activeIcon || !_rule.defaultIcon){
+				return this.$message.error("请完善cn站点的设置!")
+			}
+			
+			this.$emit("success", this.form);
+		},
+		async addUrlIcon(index, type = "icon") {
+			let _url = await this.uploadFile("image/*");
+			if (_url) {
+				this.form.url[index][type] = _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();
+			});
+		},
+		addArg(value) {
+			if (this.form.argumentList.includes(value)) {
+				this.form.argumentList.splice(this.form.argumentList.indexOf(value), 1);
+			} else {
+				this.form.argumentList.push(value);
+			}
+		},
+	},
+};
+</script>
+
+<style scoped>
+.table >>> .el-dialog__header {
+	padding: 15px 20px;
+	background: #454545;
+}
+
+.table >>> .el-dialog__title {
+	color: #fff;
+}
+
+.f_aRow {
+	display: flex;
+	justify-content: flex-start;
+	align-items: center;
+}
+
+.f_icon {
+	width: 40px;
+	height: 40px;
+	margin-left: 10px;
+	cursor: pointer;
+}
+
+.f_icon >>> .image-slot {
+	width: 100%;
+	height: 100%;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+
+.el-tag + .el-tag {
+	margin-left: 10px;
+}
+.button-new-tag {
+	margin-left: 10px;
+	height: 32px;
+	line-height: 30px;
+	padding-top: 0;
+	padding-bottom: 0;
+}
+.input-new-tag {
+	width: 90px;
+	margin-left: 10px;
+	vertical-align: bottom;
+}
+
+.f_ar_input > span {
+	margin-right: 10px;
+	white-space: nowrap;
+}
+.tips {
+	color: #949494;
+	margin-left: -65px;
+}
+
+.regionTitle {
+	font-size: 16px;
+	font-weight: bold;
+}
+
+.f_hr {
+	width: 100%;
+	height: 2px;
+	margin-top: 10px;
+	background-color: #ebeef5;
+}
+
+.f_ar_icon {
+	margin-right: 20px;
+}
+
+.activeArg {
+	color: #409eff;
+}
+</style>

+ 54 - 10
src/components/organList.vue

@@ -28,7 +28,7 @@
                         <div class="operate">
                             <button @click="update(scope.row)">编辑</button>
                             <button @click="toPage(scope.row)">批量创建</button>
-                            <button @click="delete_organ(scope.row.id)" style="color:red;">删除</button>
+                            <button @click="delete_organ(scope.row)" style="color:red;">删除</button>
                             
                         </div>
                     </template>
@@ -153,6 +153,7 @@
 </template>
 <script>
 import { API_CONFIG } from '@/common/apiConfig';
+import { addOp } from "@/api/user";
 import { mapGetters } from 'vuex';
 export default {
     name: 'onList',
@@ -290,7 +291,7 @@ export default {
             // 发起请求
             this.$ajax
                 .post(API_CONFIG.baseUrl, params)
-                .then((res) => {
+                .then(async (res) => {
                     console.log(res.data);
                     // 检查返回的结果
                     if (res.data && res.data[0] && res.data[0][0]) {
@@ -305,6 +306,12 @@ export default {
                                 type: "success",
                                 message: "添加成功!",
                             });
+                            await addOp({
+                                uid: this.userid,
+                                cid: "",
+                                type: "user_op",
+                                content: `添加了组织 ${orgName}`,
+                            });
                         }
                     } else {
                         this.$message.error("插入失败,未返回有效结果");
@@ -346,7 +353,7 @@ export default {
             ];
             this.$ajax
                 .post(API_CONFIG.baseUrl, params)
-                .then((res) => {
+                .then(async (res) => {
                     console.log("👉", res.data);
                     this.add_organ_dialog2 = false;
                     this.$message({
@@ -354,15 +361,20 @@ export default {
                         type: 'success'
                     });
                     this.getOrgan();
-
+                    await addOp({
+                        uid: this.userid,
+                        cid: "",
+                        type: "user_op",
+                        content: `修改了组织 ${this.orgName} ${this.nid}`,
+                    });
                 })
                 .catch((err) => {
                     this.$message.error("修改失败");
                     console.log(err);
                 });
         },
-        delete_organ(id) {
-            this.nid = id;
+        delete_organ(row) {
+            this.nid = row.id;
 
             let params = [
                 {
@@ -378,14 +390,19 @@ export default {
                 .then(() => {
                     this.$ajax
                         .post(API_CONFIG.baseUrl, params)
-                        .then((res) => {
+                        .then(async (res) => {
                             console.log("👉", res.data);
                             this.$message({
                                 message: '删除成功',
                                 type: 'success'
                             });
                             this.getOrgan();
-
+                            await addOp({
+                                uid: this.userid,
+                                cid: "",
+                                type: "user_op",
+                                content: `删除了组织 ${row.name} ${row.id}`,
+                            });
                         })
                 })
                 .catch((err) => {
@@ -393,10 +410,37 @@ export default {
                     console.log(err);
                 });
         },
-        toPage(row) {
+        async getUserId(oid, org) {
+            let params = [
+                {
+                functionName: "select_Suffix", // 调用存储过程的名称
+                org: org, //组织id
+                oid: oid, //学校id
+                },
+            ];
+
+            try {
+                const res = await this.$ajax.post(API_CONFIG.baseUrl, params);
+                console.log('getSuffix', res);
+                let data = res.data[0];
+                let orgData = res.data[1];
+                let ap = data.length > 0 ? data[0].userid : orgData.length > 0 ? orgData[0].userid : "";
+                return ap
+            } catch (err) {
+                console.error("请求失败,错误信息:", err);
+            }
+        },
+        async toPage(row) {
             const oid = "";
             const org = row.id;
-            const url=`https://pbl.cocorobo.cn/pbl-teacher-table/dist/?#/teacher?userid=${this.userid}&oid=${oid}&org=${org}`;
+            await addOp({
+              uid: this.userid,
+              cid: "",
+              type: "user_op",
+              content: `点击了批量添加 ${row.name}${row.id}`,
+            });
+            let userid = await this.getUserId(oid, org);
+            const url=`https://pbl.cocorobo.cn/pbl-teacher-table/dist/?#/teacher?userid=${userid ? userid : this.userid}&oid=${oid}&org=${org}`;
             window.open(url,'_blank');
         }
 

+ 55 - 11
src/components/schoolList.vue

@@ -41,7 +41,7 @@
                         <div class="operate">
                             <button @click="update(scope.row)">编辑</button>
                             <button @click="toPage(scope.row)">批量创建</button>
-                            <button @click="delete_school(scope.row.id)" style="color:red;">删除</button>
+                            <button @click="delete_school(scope.row)" style="color:red;">删除</button>
 
                         </div>
                     </template>
@@ -227,6 +227,7 @@
     </div>
 </template>
 <script>
+import { addOp } from "@/api/user";
 import { API_CONFIG } from '@/common/apiConfig';
 import { mapGetters } from 'vuex';
 
@@ -417,7 +418,7 @@ export default {
             // 发起请求
             this.$ajax
                 .post(API_CONFIG.baseUrl, params)
-                .then((res) => {
+                .then(async (res) => {
                     // console.log("👉", res.data);
                     if (res.data && res.data[0] && res.data[0][0]) {
                         if (res.data[0][0].name === 1) {
@@ -431,6 +432,12 @@ export default {
                                 type: "success",
                                 message: "添加成功!",
                             });
+                            await addOp({
+                                uid: this.userid,
+                                cid: "",
+                                type: "user_op",
+                                content: `添加了学校 ${this.sch_name}`,
+                            });
                         }
                     } else {
                         this.$message.error("插入失败,未返回有效结果");
@@ -478,7 +485,7 @@ export default {
             ];
             this.$ajax
                 .post(API_CONFIG.baseUrl, params)
-                .then((res) => {
+                .then(async (res) => {
                     console.log("👉", res.data);
                     this.add_school_dialog2 = false;
                     this.$message({
@@ -486,15 +493,20 @@ export default {
                         type: 'success'
                     });
                     this.getSchool();
-
+                    await addOp({
+                        uid: this.userid,
+                        cid: "",
+                        type: "user_op",
+                        content: `修改了学校 ${this.sch_name}${this.nid}`,
+                    });
                 })
                 .catch((err) => {
                     this.$message.error("修改失败");
                     console.log(err);
                 });
         },
-        delete_school(id) {
-            this.nid = id;
+        delete_school(row) {
+            this.nid = row.id;
 
             let params = [
                 {
@@ -510,14 +522,19 @@ export default {
                 .then(() => {
                     this.$ajax
                         .post(API_CONFIG.baseUrl, params)
-                        .then((res) => {
+                        .then(async (res) => {
                             console.log("👉", res.data);
                             this.$message({
                                 message: '删除成功',
                                 type: 'success'
                             });
                             this.getSchool();
-
+                            await addOp({
+                                uid: this.userid,
+                                cid: "",
+                                type: "user_op",
+                                content: `删除了学校 ${row.name}${row.id}`,
+                            });
                         })
                 })
                 .catch((err) => {
@@ -525,11 +542,38 @@ export default {
                     console.log(err);
                 });
         },
-        toPage(row) {
+        async getUserId(oid, org) {
+            let params = [
+                {
+                functionName: "select_Suffix", // 调用存储过程的名称
+                org: org, //组织id
+                oid: oid, //学校id
+                },
+            ];
+
+            try {
+                const res = await this.$ajax.post(API_CONFIG.baseUrl, params);
+                console.log('getSuffix', res);
+                let data = res.data[0];
+                let orgData = res.data[1];
+                let ap = data.length > 0 ? data[0].userid : orgData.length > 0 ? orgData[0].userid : "";
+                return ap
+            } catch (err) {
+                console.error("请求失败,错误信息:", err);
+            }
+        },
+        async toPage(row) {
             const oid = row.id;
             const org = row.org;
-            const url = `https://pbl.cocorobo.cn/pbl-teacher-table/dist/?#/teacher?userid=${this.userid}&oid=${oid}&org=${org}`;
-            window.open(url, '_blank');
+            let userid = await this.getUserId(oid, org);
+            await addOp({
+                uid: this.userid,
+                cid: "",
+                type: "user_op",
+                content: `点击了批量添加 ${row.name}${row.id}`,
+            });
+            const url=`https://pbl.cocorobo.cn/pbl-teacher-table/dist/?#/teacher?userid=${userid ? userid : this.userid}&oid=${oid}&org=${org}`;
+            window.open(url,'_blank');
         }
 
     },

+ 6 - 1
src/router/index.js

@@ -8,7 +8,7 @@ import OrganList from '@/components/organList.vue';
 import SchoolList from '@/components/schoolList.vue';
 import versionInstr from '@/views/versionInstr.vue';//版本说明组件
 import updateDate from '@/views/updateDate.vue';
-
+import desktopToolList from '@/components/desktopToolList.vue';
 
 Vue.use(VueRouter);
 
@@ -53,6 +53,11 @@ const routes = [
         name: 'schoolList',
         component: SchoolList,
       },
+			{
+				path:"desktopTool-list",
+				name:"desktopToolList",
+				component:desktopToolList
+			}
     ],
   },
   {

+ 2 - 1
src/store/modules/user.js

@@ -60,7 +60,8 @@ const actions = {
             "b7ccc834-aae5-11ea-a8d4-52540005ab01",
             "a77e9404-efec-11e9-96f9-028edca3b798",
             "0e8d50c3-50b5-2f1c-9f1a-bd346a0bf817",
-            "5943e08c-b7d4-11ed-8d51-005056b86db5"
+            "5943e08c-b7d4-11ed-8d51-005056b86db5",
+						"6c56ec0e-2c74-11ef-bee5-005056b86db5"
           ];
           if (allowedIds.includes(_user.userid)) {
             commit("SET_ID", _user.userid);

+ 3 - 0
src/views/HomeView.vue

@@ -25,6 +25,9 @@
           <!-- <router-link class="menu_left" to="/version-add">
             <i class="el-icon-office-building"></i>版本更新
           </router-link> -->
+					<router-link class="menu_left" to="/desktopTool-list">
+						<i class="el-icon-s-grid"></i>工具列表
+					</router-link>
         </ul>
       </div>
       <div class="table-container">

Vissa filer visades inte eftersom för många filer har ändrats