Sfoglia il codice sorgente

调整修改密码后手机号无法登录

huangguoce 4 mesi fa
parent
commit
1623edf91a

+ 47 - 40
src/layout/components/userbar.vue

@@ -5,42 +5,30 @@
 		</div>
 		<div @click="backlogClick()" class="panel-item">
 			<span :style="{ fontSize: '15px' }">待办</span>
-			<el-badge class="mark" v-if="backlogCount !== 0" :value="backlogCount" :max="99" style="top:-10px;left: -8px;"/>
+			<el-badge class="mark" v-if="backlogCount !== 0" :value="backlogCount" :max="99"
+				style="top:-10px;left: -8px;" />
 		</div>
 
-		<el-dropdown
-			class="user panel-item"
-			trigger="hover"
-			@command="handleUser"
-			style="margin-right: 30px"
-		>
+		<el-dropdown class="user panel-item" trigger="hover" @command="handleUser" style="margin-right: 30px">
 			<div class="user-avatar">
-				<el-avatar :size="30" :src="photo === ''?'/static/img/avatar.png':photo"></el-avatar>
+				<el-avatar :size="30" :src="photo === '' ? '/static/img/avatar.png' : photo"></el-avatar>
 				<label>{{ userName }}</label>
 			</div>
 			<template #dropdown>
 				<el-dropdown-menu>
 					<el-dropdown-item command="pw">修改密码</el-dropdown-item>
 					<el-dropdown-item command="uc">帐号信息</el-dropdown-item>
-					<el-dropdown-item command="clearCache"
-						>清除缓存</el-dropdown-item
-					>
-					<el-dropdown-item divided command="outLogin"
-						>退出登录</el-dropdown-item
-					>
+					<el-dropdown-item command="clearCache">清除缓存</el-dropdown-item>
+					<el-dropdown-item divided command="outLogin">退出登录</el-dropdown-item>
 				</el-dropdown-menu>
 			</template>
 		</el-dropdown>
 		<div class="panel-item hidden-sm-and-down" @click="openSetting">
-			<el-icon><MoreFilled style="transform: rotate(90deg)" /></el-icon>
+			<el-icon>
+				<MoreFilled style="transform: rotate(90deg)" />
+			</el-icon>
 		</div>
-		<el-drawer
-			title="新消息"
-			v-model="msg"
-			:size="400"
-			append-to-body
-			destroy-on-close
-		>
+		<el-drawer title="新消息" v-model="msg" :size="400" append-to-body destroy-on-close>
 			<el-container>
 				<el-main class="nopadding">
 					<el-scrollbar>
@@ -49,10 +37,7 @@
 								<router-link to="/notify/MyNotifyList">
 									<div class="msg-list__icon">
 										<el-badge is-dot type="danger">
-											<el-avatar
-												:size="40"
-												:src="item.createBy.photo"
-											></el-avatar>
+											<el-avatar :size="40" :src="item.createBy.photo"></el-avatar>
 										</el-badge>
 									</div>
 									<div class="msg-list__main">
@@ -64,11 +49,7 @@
 									</div>
 								</router-link>
 							</li>
-							<el-empty
-								v-if="msgList.length == 0"
-								description="暂无新消息"
-								:image-size="150"
-							>
+							<el-empty v-if="msgList.length == 0" description="暂无新消息" :image-size="150">
 								<template #image>
 									<img src="@/assets/img/empty.svg" />
 								</template>
@@ -77,9 +58,7 @@
 					</el-scrollbar>
 				</el-main>
 				<el-footer style="text-align: center">
-					<el-button type="primary" @click="toCenter"
-						>消息中心</el-button
-					>
+					<el-button type="primary" @click="toCenter">消息中心</el-button>
 					<!-- <el-button  @click="markRead">全部设为已读</el-button> -->
 				</el-footer>
 			</el-container>
@@ -87,7 +66,8 @@
 	</div>
 	<setting ref="setting"></setting>
 
-	<UpdatePassword ref="updatePassword" :innerVisible="innerVisible" v-on:innerDialog="getInnerStatus($event)"></UpdatePassword>
+	<UpdatePassword ref="updatePassword" :innerVisible="innerVisible" v-on:innerDialog="getInnerStatus($event)">
+	</UpdatePassword>
 
 </template>
 
@@ -125,12 +105,15 @@ export default {
 		});
 		this.msgList = data.records;
 		this.fetchBacklogCount();
-		const fetchInterval = 30000;
-		this.fetchIntervalId = setInterval(this.fetchBacklogCount, fetchInterval);
+		const fetchInterval = 2000;
+		if (this.$store.state.user.timer3 == null) {
+			this.$store.state.user.timer3 = setInterval(this.fetchBacklogCount, fetchInterval);
+		}
 		// 在页面创建时获取共享值
 	},
 	beforeDestroy() {
-		clearInterval(this.fetchIntervalId);
+		clearInterval(this.$store.state.user.timer3);
+		this.$store.state.user.timer3 = null
 	},
 	components: {
 		setting,
@@ -138,7 +121,7 @@ export default {
 		UpdatePassword
 	},
 	computed: {
-		backlogCount(){
+		backlogCount() {
 			return this.$store.state.global.backlogCount
 		},
 		language() {
@@ -203,6 +186,18 @@ export default {
 				})
 					.then(() => {
 						loginService.logout().then(() => {
+							if (this.$store.state.user.timer2) {
+								clearInterval(this.$store.state.user.timer2)
+								this.$store.state.user.timer2 = null
+							}
+							if (this.$store.state.user.timer1) {
+								clearInterval(this.$store.state.user.timer1)
+								this.$store.state.user.timer1 = null
+							}
+							if (this.$store.state.user.timer3) {
+								clearInterval(this.$store.state.user.timer3)
+								this.$store.state.user.timer3 = null
+							}
 							this.$cookies.remove(config.TOKEN);
 							this.$TOOL.data.remove(config.TOKEN);
 							this.$router.push({ path: "/login" });
@@ -238,7 +233,7 @@ export default {
 		search() {
 			this.searchVisible = true;
 		},
-		backlogClick () {
+		backlogClick() {
 			this.$router.push({
 				path: '/sys/dashboard/workBench/PendingList',
 				query: {
@@ -256,6 +251,7 @@ export default {
 	align-items: center;
 	height: 100%;
 }
+
 .user-bar .panel-item {
 	padding: 0 10px;
 	margin-left: 10px;
@@ -264,17 +260,21 @@ export default {
 	display: flex;
 	align-items: center;
 }
+
 .user-bar .panel-item i {
 	font-size: 16px;
 }
+
 .user-bar .panel-item:hover {
 	background: rgba(0, 0, 0, 0.1);
 }
+
 .user-bar .user-avatar {
 	height: 49px;
 	display: flex;
 	align-items: center;
 }
+
 .user-bar .user-avatar label {
 	display: inline-block;
 	margin-left: 5px;
@@ -285,31 +285,38 @@ export default {
 .msg-list li {
 	border-top: 1px solid #eee;
 }
+
 .msg-list li a {
 	display: flex;
 	padding: 20px;
 }
+
 .msg-list li a:hover {
 	background: #ecf5ff;
 }
+
 .msg-list__icon {
 	width: 40px;
 	margin-right: 15px;
 }
+
 .msg-list__main {
 	flex: 1;
 }
+
 .msg-list__main h2 {
 	font-size: 15px;
 	font-weight: normal;
 	color: #333;
 }
+
 .msg-list__main p {
 	font-size: 12px;
 	color: #999;
 	line-height: 1.8;
 	margin-top: 5px;
 }
+
 .msg-list__time {
 	width: 100px;
 	text-align: right;

+ 3 - 0
src/store/modules/user.js

@@ -15,6 +15,9 @@ export default {
 			name: tool.data.get("USER_INFO")?.companyDTO?.name,
 		},
 		photo: tool.data.get("USER_INFO")?.photo,
+		timer1: null,
+		timer2: null,
+		timer3: null,
 	},
 	mutations: {
 		updateId(state, id) {

+ 236 - 285
src/views/dashboard/widgets/components/TodoList.vue

@@ -3,7 +3,8 @@
 		<template #header>
 			<div class="card-header">
 				<span>我的待办
-				<el-badge class="mark" v-if="backlogCount !== 0" :value="backlogCount" :max="99" style="line-height: 0;margin-top: 8px"/>
+					<el-badge class="mark" v-if="backlogCount !== 0" :value="backlogCount" :max="99"
+						style="line-height: 0;margin-top: 8px" />
 				</span>
 
 				<div style="float:right;">
@@ -12,99 +13,55 @@
 				</div>
 			</div>
 		</template>
-		<el-table :data="dataList" style="width: 100%" height="480" border="inner" :menu-config="{}" @sort-change="sortChangeHandle"
-				  :sort-config="{remote:true}"  resizable>
-			<el-table-column
-				min-width="400px"
-				label="实例标题"
-				prop="vars.title"
-				show-overflow-tooltip
-			>
+		<el-table :data="dataList" style="width: 100%" height="480" border="inner" :menu-config="{}"
+			@sort-change="sortChangeHandle" :sort-config="{ remote: true }" resizable>
+			<el-table-column min-width="400px" label="实例标题" prop="vars.title" show-overflow-tooltip>
 				<template #default="scope">
-					<el-link  type="primary" :underline="false" v-if="scope.row.belongProject === 'ccpm'"
-							  @click="todoCcpm(scope.row)">{{scope.row.vars.title}}</el-link>
+					<el-link type="primary" :underline="false" v-if="scope.row.belongProject === 'ccpm'"
+						@click="todoCcpm(scope.row)">{{ scope.row.vars.title }}</el-link>
 					<el-link type="primary" :underline="false" v-if="scope.row.status === 'todo'"
-							 @click="todo(scope.row)">{{scope.row.vars.title}}
+						@click="todo(scope.row)">{{ scope.row.vars.title }}
 					</el-link>
-					<span v-else>{{scope.row.vars.title}}</span>
+					<span v-else>{{ scope.row.vars.title }}</span>
 				</template>
 			</el-table-column>
-			<el-table-column
-				width="90px"
-				label="流程名称"
-				show-overflow-tooltip
-				prop="processDefinitionName"
-			>
+			<el-table-column width="90px" label="流程名称" show-overflow-tooltip prop="processDefinitionName">
 			</el-table-column>
-			<el-table-column
-				width="100px"
-				label="发起人"
-				show-overflow-tooltip
-				prop="vars.userName"
-			></el-table-column>
-			<el-table-column
-				fixed="right"
-				width="100px"
-				label="当前环节"
-				show-overflow-tooltip
-				prop="task.name"
-			>
+			<el-table-column width="100px" label="发起人" show-overflow-tooltip prop="vars.userName"></el-table-column>
+			<el-table-column fixed="right" width="100px" label="当前环节" show-overflow-tooltip prop="task.name">
 				<template #default="scope">
 					<el-tag>{{ scope.row.task.name }}</el-tag>
 				</template>
 			</el-table-column>
-			<el-table-column
-				fixed="right"
-				width="100px"
-				prop="task.createTime"
-				show-overflow-tooltip
-				label="发起时间"
-			>
+			<el-table-column fixed="right" width="100px" prop="task.createTime" show-overflow-tooltip label="发起时间">
 			</el-table-column>
-			<el-table-column
-				label="操作"
-				width="100px"
-				fixed="right"
-				align="center"
-			>
+			<el-table-column label="操作" width="100px" fixed="right" align="center">
 				<template #default="scope">
 					<div v-if="scope.row.belongProject === 'ccpm'">
 						<el-button type="text" size="small" @click="todoCcpm(scope.row)">ccpm审核</el-button>
 					</div>
 					<div v-else>
-					<el-button type="primary" text @click="todo(scope.row)"
-					>办理</el-button
-					>
-					<el-button type="primary" text @click="trace(scope.row)"
-					>进度</el-button
-					>
+						<el-button type="primary" text @click="todo(scope.row)">办理</el-button>
+						<el-button type="primary" text @click="trace(scope.row)">进度</el-button>
 					</div>
 				</template>
 			</el-table-column>
 		</el-table>
-		<vxe-pager
-			background
-			size="small"
-			:current-page="tablePage.currentPage"
-			:page-size="tablePage.pageSize"
-			:total="tablePage.total"
-			:page-sizes="[
+		<vxe-pager background size="small" :current-page="tablePage.currentPage" :page-size="tablePage.pageSize"
+			:total="tablePage.total" :page-sizes="[
 				10,
 				20,
 				100,
 				1000,
 				{ label: '全量数据', value: 1000000 },
-			]"
-			:layouts="[
+			]" :layouts="[
 				'PrevPage',
 				'JumpNumber',
 				'NextPage',
 				'FullJump',
 				'Sizes',
 				'Total',
-			]"
-			@page-change="currentChangeHandle"
-		>
+			]" @page-change="currentChangeHandle">
 		</vxe-pager>
 		<!--<div style="height: calc(100% - 55px);margin-top: 5px">
 			<vxe-table
@@ -160,248 +117,242 @@
 			</vxe-pager>
 		</div>-->
 	</el-card>
-	<v-dialog
-		title="查看进度"
-		:close-on-click-modal="true"
-		append-to-body
-		v-model="visible"
-		width="70%"
-		height="600px"
-	>
-		<flow-chart
-			ref="preview"
-			:processInstanceId="processInstanceId"
-		></flow-chart>
+	<v-dialog title="查看进度" :close-on-click-modal="true" append-to-body v-model="visible" width="70%" height="600px">
+		<flow-chart ref="preview" :processInstanceId="processInstanceId"></flow-chart>
 	</v-dialog>
 
-	<UpdatePassword ref="updatePassword" :innerVisible="innerVisible" v-on:innerDialog="getInnerStatus($event)"></UpdatePassword>
+	<UpdatePassword ref="updatePassword" :innerVisible="innerVisible" v-on:innerDialog="getInnerStatus($event)">
+	</UpdatePassword>
 </template>
 
 <script>
-	// import FlowChart from '../modeler/FlowChart'
-	import pick from "lodash.pick";
-	import UserSelect from "@/components/userSelect/UserSelectDialog";
-	import taskService from "@/api/flowable/taskService";
-	import userService from "@/api/sys/UserService";
-	import UpdatePassword from "@/views/layout/UpdatePassword2.vue";
-	export default {
-		title: "我的待办",
-		icon: "wodedaiban",
-		description: "我的待办任务",
-		layout: {
-			w: 6,
-			h: 15,
-		},
-		data() {
-			return {
-				dataList: [],
-				tablePage: {
-					total: 0,
-					currentPage: 1,
-					pageSize: 10,
-					orders: [],
-				},
-				loading: false,
-				visible: false,
-				currentTask: null,
-				processInstanceId: "",
-				timer: null,
-			};
-		},
-		computed:{
-			backlogCount(){
-				return this.$store.state.global.backlogCount
+// import FlowChart from '../modeler/FlowChart'
+import pick from "lodash.pick";
+import UserSelect from "@/components/userSelect/UserSelectDialog";
+import taskService from "@/api/flowable/taskService";
+import userService from "@/api/sys/UserService";
+import UpdatePassword from "@/views/layout/UpdatePassword2.vue";
+export default {
+	title: "我的待办",
+	icon: "wodedaiban",
+	description: "我的待办任务",
+	layout: {
+		w: 6,
+		h: 15,
+	},
+	data() {
+		return {
+			dataList: [],
+			tablePage: {
+				total: 0,
+				currentPage: 1,
+				pageSize: 10,
+				orders: [],
 			},
+			loading: false,
+			visible: false,
+			currentTask: null,
+			processInstanceId: "",
+			timer: null,
+		};
+	},
+	computed: {
+		backlogCount() {
+			return this.$store.state.global.backlogCount
 		},
-		mounted() {
+	},
+	mounted() {
 
-			// 页面加载后
-			// 1.在执行定时器前先执行一次获取接口数据的操作函数, 否则接口会1秒钟后才调用
-			// 2.为了避免退出当前页面后,在其他页面也继续调用接口,退出前需要清除定时器.
-			this.refreshList();
-			this.timer = setInterval(() => {
-				setTimeout(this.refreshList, 0)
+		// 页面加载后
+		// 1.在执行定时器前先执行一次获取接口数据的操作函数, 否则接口会1秒钟后才调用
+		// 2.为了避免退出当前页面后,在其他页面也继续调用接口,退出前需要清除定时器.
+		this.refreshList();
+		if (this.$store.state.user.timer1 == null) {
+			this.$store.state.user.timer1 = setInterval(() => {
+				this.refreshList()
 			}, 60000)
+		}
 
 
+	},
+	created() {
+		// 判断当前用户是否为管理员
+		userService.is().then((data) => {
+			if (!data) {
+				// 如果当前用户不是管理员,则判断是否修改过密码
+				userService.isUpdatePassword().then((data) => {
+					if (!data) {
+						// 如果没有修改过密码,则弹出密码修改窗口
+						this.innerVisible = true
+						this.$refs.updatePassword.init(!data)
+					}
+				})
+			}
+		})
+	},
+	beforeDestroy() {
+		if (this.$store.state.user.timer1) {
+			clearInterval(this.$store.state.user.timer1); // 如果是 setInterval
+			this.$store.state.user.timer1 = null;
+		}
+	},
+	activated() {
+		this.refreshList();
+	},
+	components: {
+		UserSelect,
+		UpdatePassword,
+		// FlowChart
+	},
+	methods: {
+		getInnerStatus(status) {
+			this.innerVisible = status
 		},
-		created(){
-			// 判断当前用户是否为管理员
-			userService.is().then((data) => {
-				if (!data) {
-					// 如果当前用户不是管理员,则判断是否修改过密码
-					userService.isUpdatePassword().then((data) => {
-						if (!data) {
-							// 如果没有修改过密码,则弹出密码修改窗口
-							this.innerVisible = true
-							this.$refs.updatePassword.init(!data)
-						}
-					})
-				}
-			})
-		},
-		beforeDestroy () {
-			clearInterval(this.timer)
-			this.timer = null
+		// 获取数据列表
+		refreshList() {
+			this.loading = true;
+			taskService
+				.todoList({
+					current: this.tablePage.currentPage,
+					size: this.tablePage.pageSize,
+					orders: this.tablePage.orders,
+					...this.searchForm,
+				})
+				.then((data) => {
+					console.log('data', data.records)
+					this.dataList = data.records;
+					this.tablePage.total = data.total;
+					this.$store.state.global.backlogCount = data.total
+					this.loading = false;
+				});
 		},
-		activated() {
+		// 当前页
+		currentChangeHandle({ currentPage, pageSize }) {
+			this.tablePage.currentPage = currentPage;
+			this.tablePage.pageSize = pageSize;
 			this.refreshList();
 		},
-		components: {
-			UserSelect,
-			UpdatePassword,
-			// FlowChart
-		},
-		methods: {
-			getInnerStatus(status){
-				this.innerVisible = status
-			},
-			// 获取数据列表
-			refreshList() {
-				this.loading = true;
-				taskService
-					.todoList({
-						current: this.tablePage.currentPage,
-						size: this.tablePage.pageSize,
-						orders: this.tablePage.orders,
-						...this.searchForm,
-					})
-					.then((data) => {
-						console.log('data',data.records)
-						this.dataList = data.records;
-						this.tablePage.total = data.total;
-						this.$store.state.global.backlogCount = data.total
-						this.loading = false;
-					});
-			},
-			// 当前页
-			currentChangeHandle({ currentPage, pageSize }) {
-				this.tablePage.currentPage = currentPage;
-				this.tablePage.pageSize = pageSize;
-				this.refreshList();
-			},
-			todo(row) {
-				taskService
-					.getTaskDef({
-						taskId: row.task.id,
-						taskName: row.task.name,
-						taskDefKey: row.task.taskDefinitionKey,
-						procInsId: row.task.processInstanceId,
-						procDefId: row.task.processDefinitionId,
-						procDefKey: row.task.processDefKey,
-						status: row.status,
-					})
-					.then((data) => {
-						var cs = "cs"
-						this.$router.push({
-							path: "/flowable/task/TaskForm",
-							query: {
-								wareHouseId: row.processDefinitionName === '物资管理-入库修改' ? data.businessId : '',
-								returnId: row.processDefinitionName === '物资管理-领用退回申请' ? data.businessId : '',
-								cwArchiveId: row.processDefinitionName === '会计-项目报告归档' ? data.businessId : '',
-								formTitle: `${row.vars.title}`,
-								title: `审批【${row.task.name || ""}】`,
-								cs: cs,
-								...pick(
-									data,
-									"formType",
-									"formReadOnly",
-									"formUrl",
-									"procDefKey",
-									"taskDefKey",
-									"procInsId",
-									"procDefId",
-									"taskId",
-									"status",
-									"title",
-									"businessId"
-								),
-							},
-						});
-					});
-			},
-			toPendingList () {
-				// this.$router.push('./PendingList')
-				this.$router.push({
-					path: '/sys/dashboard/workBench/PendingList',
-					query: {
-						num: 3
-					}
+		todo(row) {
+			taskService
+				.getTaskDef({
+					taskId: row.task.id,
+					taskName: row.task.name,
+					taskDefKey: row.task.taskDefinitionKey,
+					procInsId: row.task.processInstanceId,
+					procDefId: row.task.processDefinitionId,
+					procDefKey: row.task.processDefKey,
+					status: row.status,
 				})
-			},
-			trace(row) {
-				this.processInstanceId = row.task.processInstanceId;
-				this.visible = true;
-				this.$nextTick(() => {
-					this.$refs.preview.init();
+				.then((data) => {
+					var cs = "cs"
+					this.$router.push({
+						path: "/flowable/task/TaskForm",
+						query: {
+							wareHouseId: row.processDefinitionName === '物资管理-入库修改' ? data.businessId : '',
+							returnId: row.processDefinitionName === '物资管理-领用退回申请' ? data.businessId : '',
+							cwArchiveId: row.processDefinitionName === '会计-项目报告归档' ? data.businessId : '',
+							formTitle: `${row.vars.title}`,
+							title: `审批【${row.task.name || ""}】`,
+							cs: cs,
+							...pick(
+								data,
+								"formType",
+								"formReadOnly",
+								"formUrl",
+								"procDefKey",
+								"taskDefKey",
+								"procInsId",
+								"procDefId",
+								"taskId",
+								"status",
+								"title",
+								"businessId"
+							),
+						},
+					});
 				});
-			},
-			// // 审核方法
-			todoCcpm (row) {
-				console.log('row',row)
-				if (row.task.processDefKey === '108' || row.task.processDefKey === '109'|| row.task.processDefKey === '13'|| row.task.processDefKey === '102') {
-					let id = row.vars.notifyId
-					let title = '报销申请审批'
-					this.toCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
-				} else if (row.task.processDefKey === '21' || row.task.processDefKey === '213') {
-					let id = row.vars.notifyId
-					let title = '发票申请审批'
-					this.toInvoiceUpdateCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
-
-					// if (row.task.name === '财务部门审批'){
-					// }else {
-					// 	this.toInvoiceCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
-					// }
-				} else{
-					this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行审核')
+		},
+		toPendingList() {
+			// this.$router.push('./PendingList')
+			this.$router.push({
+				path: '/sys/dashboard/workBench/PendingList',
+				query: {
+					num: 3
 				}
-			},
-			// 审核页面跳转
-			toCenterForm (id, title, processDefKey, type) {
-				this.$router.push({ // 跳转
-					path: '/generateForm/GenerateForm',
-					query: {
-						id: id,
-						backPath: '/dashboard/index',
-						title: title,
-						processDefKey: processDefKey,
-						type: type
-					}
-				})
-			},
-			// // 发票审核页面跳转(财务审批)
-			toInvoiceUpdateCenterForm (id, title, processDefKey, type) {
-				this.$router.push({ // 跳转
-					path: '/generateForm/InvoiceUpdateGenerateForm',
-					query: {
-						id: id,
-						backPath: '/flowable/task/TodoList',
-						title: title,
-						processDefKey: processDefKey,
-						type: type
-					}
-				})
-			},
-			// // 发票审核页面跳转
-			toInvoiceCenterForm (id, title, processDefKey, type) {
-				this.$router.push({ // 跳转
-					path: '/generateForm/InvoiceGenerateForm',
-					query: {
-						id: id,
-						backPath: '/flowable/task/TodoList',
-						title: title,
-						processDefKey: processDefKey,
-						type: type
-					}
-				})
-			}
+			})
+		},
+		trace(row) {
+			this.processInstanceId = row.task.processInstanceId;
+			this.visible = true;
+			this.$nextTick(() => {
+				this.$refs.preview.init();
+			});
+		},
+		// // 审核方法
+		todoCcpm(row) {
+			console.log('row', row)
+			if (row.task.processDefKey === '108' || row.task.processDefKey === '109' || row.task.processDefKey === '13' || row.task.processDefKey === '102') {
+				let id = row.vars.notifyId
+				let title = '报销申请审批'
+				this.toCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
+			} else if (row.task.processDefKey === '21' || row.task.processDefKey === '213') {
+				let id = row.vars.notifyId
+				let title = '发票申请审批'
+				this.toInvoiceUpdateCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
 
+				// if (row.task.name === '财务部门审批'){
+				// }else {
+				// 	this.toInvoiceCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
+				// }
+			} else {
+				this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行审核')
+			}
+		},
+		// 审核页面跳转
+		toCenterForm(id, title, processDefKey, type) {
+			this.$router.push({ // 跳转
+				path: '/generateForm/GenerateForm',
+				query: {
+					id: id,
+					backPath: '/dashboard/index',
+					title: title,
+					processDefKey: processDefKey,
+					type: type
+				}
+			})
+		},
+		// // 发票审核页面跳转(财务审批)
+		toInvoiceUpdateCenterForm(id, title, processDefKey, type) {
+			this.$router.push({ // 跳转
+				path: '/generateForm/InvoiceUpdateGenerateForm',
+				query: {
+					id: id,
+					backPath: '/flowable/task/TodoList',
+					title: title,
+					processDefKey: processDefKey,
+					type: type
+				}
+			})
 		},
-	};
+		// // 发票审核页面跳转
+		toInvoiceCenterForm(id, title, processDefKey, type) {
+			this.$router.push({ // 跳转
+				path: '/generateForm/InvoiceGenerateForm',
+				query: {
+					id: id,
+					backPath: '/flowable/task/TodoList',
+					title: title,
+					processDefKey: processDefKey,
+					type: type
+				}
+			})
+		}
+
+	},
+};
 </script>
 <style scoped>
-	.box-card {
-		height: 100%;
-	}
-
+.box-card {
+	height: 100%;
+}
 </style>

+ 165 - 188
src/views/home/components/TodoList2.vue

@@ -3,7 +3,8 @@
 		<template #header>
 			<div class="card-header">
 				<span>我的待办
-				<el-badge class="mark" v-if="backlogCount !== 0" :value="backlogCount" :max="99" style="line-height: 0;margin-top: 8px"/>
+					<el-badge class="mark" v-if="backlogCount !== 0" :value="backlogCount" :max="99"
+						style="line-height: 0;margin-top: 8px" />
 				</span>
 				<div style="float:right;">
 					<el-button type="text" @click="refreshList()">刷新</el-button>
@@ -12,230 +13,206 @@
 			</div>
 		</template>
 		<div style="height: 250px;margin-top: 5px">
-			<vxe-table
-				border="inner"
-				:loading="loading"
-				size="small"
-				ref="todoTable"
-				show-header-overflow
-				show-overflow
-				highlight-hover-row
-				:menu-config="{}"
-				:print-config="{}"
-				:import-config="{}"
-				:export-config="{}"
-				:data="dataList"
-				header-align="center"
-				:checkbox-config="{}">
-				<vxe-column title="实例标题"  field="vars.title">
+			<vxe-table border="inner" :loading="loading" size="small" ref="todoTable" show-header-overflow show-overflow
+				highlight-hover-row :menu-config="{}" :print-config="{}" :import-config="{}" :export-config="{}"
+				:data="dataList" header-align="center" :checkbox-config="{}">
+				<vxe-column title="实例标题" field="vars.title">
 				</vxe-column>
 				<vxe-column title="流程名称" field="processDefinitionName"></vxe-column>
 				<vxe-column title="当前环节" field="task.name">
 					<template #default="scope">
-						<el-tag>{{scope.row.task.name}}</el-tag>
+						<el-tag>{{ scope.row.task.name }}</el-tag>
 					</template>
 				</vxe-column>
 				<vxe-column title="流程发起人" field="vars.userName"></vxe-column>
-				<vxe-column
-					field="task.createTime"
-					title="发起时间">
+				<vxe-column field="task.createTime" title="发起时间">
 				</vxe-column>
 				<vxe-column title="操作" width="100px" fixed="right" align="center">
 					<template #default="scope">
 						<div>
 							<el-button text type="primary" @click="todo(scope.row)">办理</el-button>
-							<el-button  text type="primary" @click="trace(scope.row)">进度</el-button>
+							<el-button text type="primary" @click="trace(scope.row)">进度</el-button>
 						</div>
 					</template>
 				</vxe-column>
 			</vxe-table>
-			<vxe-pager
-				background
-				style="margin-top: 5px"
-				size="small"
-				:current-page="tablePage.currentPage"
-				:page-size="tablePage.pageSize"
-				:total="tablePage.total"
-				:page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+			<vxe-pager background style="margin-top: 5px" size="small" :current-page="tablePage.currentPage"
+				:page-size="tablePage.pageSize" :total="tablePage.total"
+				:page-sizes="[10, 20, 100, 1000, { label: '全量数据', value: 1000000 }]"
 				:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
 				@page-change="currentChangeHandle">
 			</vxe-pager>
 		</div>
 	</el-card>
-	<v-dialog
-		title="查看进度"
-		:close-on-click-modal="true"
-		append-to-body
-		v-model="visible"
-		width="70%"
-		height="600px"
-	>
-		<flow-chart
-			ref="preview"
-			:processInstanceId="processInstanceId"
-		></flow-chart>
+	<v-dialog title="查看进度" :close-on-click-modal="true" append-to-body v-model="visible" width="70%" height="600px">
+		<flow-chart ref="preview" :processInstanceId="processInstanceId"></flow-chart>
 	</v-dialog>
 
-	<UpdatePassword ref="updatePassword" :innerVisible="innerVisible" v-on:innerDialog="getInnerStatus($event)"></UpdatePassword>
+	<UpdatePassword ref="updatePassword" :innerVisible="innerVisible" v-on:innerDialog="getInnerStatus($event)">
+	</UpdatePassword>
 </template>
 
 <script>
-	// import FlowChart from '../modeler/FlowChart'
-	import pick from "lodash.pick";
-	import UserSelect from "@/components/userSelect/UserSelectDialog";
-	import taskService from "@/api/flowable/taskService";
-	import userService from "@/api/sys/UserService";
-	import UpdatePassword from "@/views/layout/UpdatePassword2.vue";
-	export default {
-		// title: "我的待办",
-		// icon: "wodedaiban",
-		// description: "我的待办任务",
-		// layout: {
-		// 	w: 6,
-		// 	h: 15,
-		// },
-		data() {
-			return {
-				dataList: [],
-				tablePage: {
-					total: 0,
-					currentPage: 1,
-					pageSize: 10,
-					orders: [],
-				},
-				loading: false,
-				visible: false,
-				currentTask: null,
-				processInstanceId: "",
-				timer: null,
-			};
-		},
-		computed:{
-			backlogCount(){
-				return this.$store.state.global.backlogCount
+// import FlowChart from '../modeler/FlowChart'
+import pick from "lodash.pick";
+import UserSelect from "@/components/userSelect/UserSelectDialog";
+import taskService from "@/api/flowable/taskService";
+import userService from "@/api/sys/UserService";
+import UpdatePassword from "@/views/layout/UpdatePassword2.vue";
+export default {
+	// title: "我的待办",
+	// icon: "wodedaiban",
+	// description: "我的待办任务",
+	// layout: {
+	// 	w: 6,
+	// 	h: 15,
+	// },
+	data() {
+		return {
+			dataList: [],
+			tablePage: {
+				total: 0,
+				currentPage: 1,
+				pageSize: 10,
+				orders: [],
 			},
+			loading: false,
+			visible: false,
+			currentTask: null,
+			processInstanceId: "",
+			timer: null,
+		};
+	},
+	computed: {
+		backlogCount() {
+			return this.$store.state.global.backlogCount
 		},
-		mounted() {
-			// 页面加载后
-			// 1.在执行定时器前先执行一次获取接口数据的操作函数, 否则接口会1秒钟后才调用
-			// 2.为了避免退出当前页面后,在其他页面也继续调用接口,退出前需要清除定时器.
-			this.refreshList();
-			this.timer = setInterval(() => {
-				setTimeout(this.refreshList, 0)
+	},
+	mounted() {
+		// 页面加载后
+		// 1.在执行定时器前先执行一次获取接口数据的操作函数, 否则接口会1秒钟后才调用
+		// 2.为了避免退出当前页面后,在其他页面也继续调用接口,退出前需要清除定时器.
+		this.refreshList();
+		if (this.$store.state.user.timer2 == null) {
+			this.$store.state.user.timer2 = setInterval(() => {
+				this.refreshList()
 			}, 60000)
-			// 判断当前用户是否为管理员
-			userService.is().then((data) => {
-				if (!data) {
-					// 如果当前用户不是管理员,则判断是否修改过密码
-					userService.isUpdatePassword().then((data) => {
-						if (!data) {
-							// 如果没有修改过密码,则弹出密码修改窗口
-							this.innerVisible = true
-							this.$refs.updatePassword.init(!data)
+		}
+		// 判断当前用户是否为管理员
+		userService.is().then((data) => {
+			if (!data) {
+				// 如果当前用户不是管理员,则判断是否修改过密码
+				userService.isUpdatePassword().then((data) => {
+					if (!data) {
+						// 如果没有修改过密码,则弹出密码修改窗口
+						this.innerVisible = true
+						this.$refs.updatePassword.init(!data)
 						//
-						}
-					})
-				}
-			})
+					}
+				})
+			}
+		})
 
+	},
+	beforeDestroy() {
+		if (this.$store.state.user.timer2) {
+			clearInterval(this.$store.state.user.timer2); // 如果是 setInterval
+			this.$store.state.user.timer2 = null;
+		}
+	},
+	components: {
+		UserSelect,
+		UpdatePassword
+		// FlowChart
+	},
+	methods: {
+		getInnerStatus(status) {
+			this.innerVisible = status
 		},
-		beforeDestroy () {
-			clearInterval(this.timer)
-			this.timer = null
+		// 获取数据列表
+		refreshList() {
+			this.loading = true;
+			taskService
+				.todoList({
+					current: this.tablePage.currentPage,
+					size: this.tablePage.pageSize,
+					orders: this.tablePage.orders,
+					...this.searchForm,
+				})
+				.then((data) => {
+					this.dataList = data.records;
+					this.tablePage.total = data.total;
+					this.loading = false;
+					this.$store.state.global.backlogCount = data.total
+				});
 		},
-		components: {
-			UserSelect,
-			UpdatePassword
-			// FlowChart
+		// 当前页
+		currentChangeHandle({ currentPage, pageSize }) {
+			this.tablePage.currentPage = currentPage;
+			this.tablePage.pageSize = pageSize;
+			this.refreshList();
 		},
-		methods: {
-			getInnerStatus(status){
-				this.innerVisible = status
-			},
-			// 获取数据列表
-			refreshList() {
-				this.loading = true;
-				taskService
-					.todoList({
-						current: this.tablePage.currentPage,
-						size: this.tablePage.pageSize,
-						orders: this.tablePage.orders,
-						...this.searchForm,
-					})
-					.then((data) => {
-						this.dataList = data.records;
-						this.tablePage.total = data.total;
-						this.loading = false;
-						this.$store.state.global.backlogCount = data.total
-					});
-			},
-			// 当前页
-			currentChangeHandle({ currentPage, pageSize }) {
-				this.tablePage.currentPage = currentPage;
-				this.tablePage.pageSize = pageSize;
-				this.refreshList();
-			},
-			todo(row) {
-				taskService
-					.getTaskDef({
-						taskId: row.task.id,
-						taskName: row.task.name,
-						taskDefKey: row.task.taskDefinitionKey,
-						procInsId: row.task.processInstanceId,
-						procDefId: row.task.processDefinitionId,
-						procDefKey: row.task.processDefKey,
-						status: row.status,
-					})
-					.then((data) => {
-						var cs = "cs2"
-						this.$router.push({
-							path: "/flowable/task/TaskForm",
-							query: {
-								wareHouseId: row.processDefinitionName === '物资管理-入库修改' ? data.businessId : '',
-								cwArchiveId: row.processDefinitionName === '会计-项目报告归档' ? data.businessId : '',
-								returnId: row.processDefinitionName === '物资管理-领用退回申请' ? data.businessId : '',
-								formTitle: `${row.vars.title}`,
-								title: `审批【${row.task.name || ""}】`,
-								cs: cs,
-								...pick(
-									data,
-									"formType",
-									"formReadOnly",
-									"formUrl",
-									"procDefKey",
-									"taskDefKey",
-									"procInsId",
-									"procDefId",
-									"taskId",
-									"status",
-									"title",
-									"businessId"
-								),
-							},
-						});
-					});
-			},
-			toPendingList () {
-				// this.$router.push('./PendingList')
-				this.$router.push({
-					path: '/sys/dashboard/workBench/PendingList',
-					query: {
-						num: 3
-					}
+		todo(row) {
+			taskService
+				.getTaskDef({
+					taskId: row.task.id,
+					taskName: row.task.name,
+					taskDefKey: row.task.taskDefinitionKey,
+					procInsId: row.task.processInstanceId,
+					procDefId: row.task.processDefinitionId,
+					procDefKey: row.task.processDefKey,
+					status: row.status,
 				})
-			},
-			trace(row) {
-				this.processInstanceId = row.task.processInstanceId;
-				this.visible = true;
-				this.$nextTick(() => {
-					this.$refs.preview.init();
+				.then((data) => {
+					var cs = "cs2"
+					this.$router.push({
+						path: "/flowable/task/TaskForm",
+						query: {
+							wareHouseId: row.processDefinitionName === '物资管理-入库修改' ? data.businessId : '',
+							cwArchiveId: row.processDefinitionName === '会计-项目报告归档' ? data.businessId : '',
+							returnId: row.processDefinitionName === '物资管理-领用退回申请' ? data.businessId : '',
+							formTitle: `${row.vars.title}`,
+							title: `审批【${row.task.name || ""}】`,
+							cs: cs,
+							...pick(
+								data,
+								"formType",
+								"formReadOnly",
+								"formUrl",
+								"procDefKey",
+								"taskDefKey",
+								"procInsId",
+								"procDefId",
+								"taskId",
+								"status",
+								"title",
+								"businessId"
+							),
+						},
+					});
 				});
-			},
 		},
-	};
+		toPendingList() {
+			// this.$router.push('./PendingList')
+			this.$router.push({
+				path: '/sys/dashboard/workBench/PendingList',
+				query: {
+					num: 3
+				}
+			})
+		},
+		trace(row) {
+			this.processInstanceId = row.task.processInstanceId;
+			this.visible = true;
+			this.$nextTick(() => {
+				this.$refs.preview.init();
+			});
+		},
+	},
+};
 </script>
 <style scoped>
-	.box-card {
-		height: 100%;
-	}
+.box-card {
+	height: 100%;
+}
 </style>

+ 47 - 80
src/views/sys/login/components/login-form.vue

@@ -36,38 +36,21 @@
 						>
 					</el-dropdown-menu>
 				</template>
-			</el-dropdown>-->
+</el-dropdown>-->
 		</div>
 		<div v-if="whichPage === '1'" class="login-border">
 			<div class="login-form-title">登录</div>
 			<div class="login-form-sub-title">{{ $t2("t_login_description") }}</div>
 			<div class="login-form-error-msg">{{ errorMessage }}</div>
-			<el-form
-				ref="loginForm"
-				:model="inputForm"
-				size="large"
-				:rules="rules"
-				class="login-form"
-				@keyup.enter="login()"
-				@submit.prevent
-			>
+			<el-form ref="loginForm" :model="inputForm" size="large" :rules="rules" class="login-form"
+				@keyup.enter="login()" @submit.prevent>
 				<el-form-item prop="username">
-					<el-input
-						prefix-icon="user"
-						placeholder="请输入账号"
-						clearable
-						v-model="inputForm.username"
-						@blur="getLoginCodeNumber($event.target.value)"
-					></el-input>
+					<el-input prefix-icon="user" placeholder="请输入账号" clearable v-model="inputForm.username"
+						@blur="getLoginCodeNumber($event.target.value)"></el-input>
 				</el-form-item>
 				<el-form-item prop="password">
-					<el-input
-						type="password"
-						prefix-icon="lock"
-						placeholder="请输入密码"
-						clearable
-						v-model="inputForm.password"
-					></el-input>
+					<el-input type="password" prefix-icon="lock" placeholder="请输入密码" clearable
+						v-model="inputForm.password"></el-input>
 				</el-form-item>
 
 
@@ -75,86 +58,70 @@
 					<el-row :gutter="10" v-if="inputForm.isShow">
 						<el-col :span="16">
 							<el-form-item prop="code">
-								<el-input
-									placeholder="请输入验证码"
-									v-model="inputForm.code"
-									text
-									clearable
-								></el-input>
+								<el-input placeholder="请输入验证码" v-model="inputForm.code" text clearable></el-input>
 							</el-form-item>
 						</el-col>
-						<el-col :span="8"
-						><el-image
-							@click="getCaptcha"
-							:src="captchaImg"
-							style="height: 34px"
-						></el-image
-						></el-col>
+						<el-col :span="8"><el-image @click="getCaptcha" :src="captchaImg"
+								style="height: 34px"></el-image></el-col>
 					</el-row>
 				</el-form-item>
 
 				<el-form-item>
 					<div style="width: 100%">
-						<div style ="margin-left: 5px;margin-bottom: 20px; float: left;height: 40px;line-height:40px;">
+						<div style="margin-left: 5px;margin-bottom: 20px; float: left;height: 40px;line-height:40px;">
 							<!-- 记住我 -->
 							<el-checkbox v-model="checked" class="rememberMe">记住我</el-checkbox>
 						</div>
 						<!-- 找回密码 -->
 						<div style="float:right;margin-bottom: 20px;margin-right: 5px;color: #1890ff;">
-							<el-button style="float: right" type="text" @click="openForgetPassword" class="forgetPw">忘记密码</el-button>
+							<el-button style="float: right" type="text" @click="openForgetPassword"
+								class="forgetPw">忘记密码</el-button>
 						</div>
 					</div>
 
 				</el-form-item>
 
 				<el-form-item>
-					<el-button
-						type="primary"
-						:loading="loading"
-						class="login-submit"
-						@click="login"
-						:disabled="isLoginDisabled"
-					>登录</el-button>
+					<el-button type="primary" :loading="loading" class="login-submit" @click="login"
+						:disabled="isLoginDisabled">登录</el-button>
 				</el-form-item>
-			</el-form></div>
+			</el-form>
+		</div>
 		<div v-else-if="whichPage === '2'" class="login-border">
 			<div class="login-main">
 				<div class="login-form-title">修改密码</div>
 				<div class="login-form-sub-title">使用账号绑定的手机号找回密码</div>
-				<el-form
-					size="large"
-					ref="loginForm2"
-					:model="inputForm"
-					:loading="loading"
-					:rules="rules"
-					class="login-form"
-					@keyup.enter.native="saveNewPass()"
-					@submit.native.prevent>
-					<el-form-item  prop="phoneNumber">
+				<el-form size="large" ref="loginForm2" :model="inputForm" :loading="loading" :rules="rules"
+					class="login-form" @keyup.enter.native="saveNewPass()" @submit.native.prevent>
+					<el-form-item prop="phoneNumber">
 						<el-input type="text" placeholder="请输入绑定手机号" v-model="inputForm.phoneNumber"></el-input>
 					</el-form-item>
-					<el-form-item  prop="phoneCode">
-						<el-input type="text" placeholder="请输入验证码" v-model="inputForm.phoneCode" style="width: 300px"></el-input>
-							<el-button slot="append" type="primary" @click="pushPhoneCode" :loading="!showPhoneCode" style="background-color: #3595f9;width: 100px">
+					<el-form-item prop="phoneCode">
+						<el-input type="text" placeholder="请输入验证码" v-model="inputForm.phoneCode"
+							style="width: 300px"></el-input>
+						<el-button slot="append" type="primary" @click="pushPhoneCode" :loading="!showPhoneCode"
+							style="background-color: #3595f9;width: 100px">
 							<span v-if="showPhoneCode" style="color: white">获取验证码</span>
-							<span v-else class="count" style="color: white">请等待 {{count}} s</span>
+							<span v-else class="count" style="color: white">请等待 {{ count }} s</span>
 						</el-button>
 					</el-form-item>
 					<el-form-item prop="newPassword" :error="passwordError">
-						<el-input type="password" placeholder="新密码" v-model="inputForm.newPassword" @input="validatePassword"></el-input>
+						<el-input type="password" placeholder="新密码" v-model="inputForm.newPassword"
+							@input="validatePassword"></el-input>
 					</el-form-item>
 					<el-form-item prop="newPasswordAgain">
 						<el-input type="password" placeholder="确认密码" v-model="inputForm.newPasswordAgain"></el-input>
 					</el-form-item>
 					<el-form-item style="float:right;margin-bottom: 20px;color: #1890ff;">
 						<!-- 返回登录页面 -->
-						<div >
+						<div>
 							<el-button type="text" @click="backLogin()" class="forgetPw">前往登录页面</el-button>
 						</div>
 					</el-form-item>
 
 					<el-form-item>
-						<el-button type="primary" :loading="loading" class="login-submit" @click="saveNewPass">保存</el-button>
+						<el-button type="primary" :loading="loading" class="login-submit"
+							@click="saveNewPass">保存</el-button>
 					</el-form-item>
 
 
@@ -189,8 +156,8 @@ export default {
 				uuid: "",
 				captcha: "",
 				/*修改密码*/
-				phoneNumber:'',
-				phoneCode:'',
+				phoneNumber: '',
+				phoneCode: '',
 				oldPassword: '',
 				newPassword: '',
 				newPasswordAgain: ''
@@ -218,13 +185,13 @@ export default {
 					},
 				],
 				phoneNumber: [
-					{required: true, message: '手机号不能为空', trigger: 'blur'}
+					{ required: true, message: '手机号不能为空', trigger: 'blur' }
 				],
 				phoneCode: [
-					{required: true, message: '验证码不能为空', trigger: 'blur'}
+					{ required: true, message: '验证码不能为空', trigger: 'blur' }
 				],
 				oldPassword: [
-					{required: true, message: '旧密码不能为空', trigger: 'blur'}
+					{ required: true, message: '旧密码不能为空', trigger: 'blur' }
 				],
 				newPassword: [
 					{ required: true, message: '新的密码不能为空', trigger: 'blur' },
@@ -244,7 +211,7 @@ export default {
 					}
 				],
 				newPasswordAgain: [
-					{required: true, message: '再次输入的新密码不能为空', trigger: 'blur'},
+					{ required: true, message: '再次输入的新密码不能为空', trigger: 'blur' },
 					{
 						validator: (rule, value, callback) => {
 							const passwordRegex = /^(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*\d))|(?=(.*[A-Z]))(?=(.*[a-z]))(?=(.*[!@#$%^&*.,]))|(?=(.*[A-Z]))(?=(.*\d))(?=(.*[!@#$%^&*.,]))|(?=(.*[a-z]))(?=(.*\d))(?=(.*[!@#$%^&*.,]))[A-Za-z\d!@#$%^&*.,]{8,20}$/;
@@ -422,13 +389,13 @@ export default {
 		getLoginCodeNumber(username) {
 			loginService.getLoginCodeNumber(username).then((data) => {
 				if (data.redisLoginNumber >= data.loginNumber) {
-					if (data.redisLoginNumber >= 5 && data.redisLoginNumber <10){
+					if (data.redisLoginNumber >= 5 && data.redisLoginNumber < 10) {
 						if (!this.inputForm.isShow) {
 							this.getCaptcha()
 							this.inputForm.isShow = true
 							this.isLoginDisabled = false
 						}
-					}else if (data.redisLoginNumber >= 10){
+					} else if (data.redisLoginNumber >= 10) {
 						this.inputForm.isShow = false
 						this.isLoginDisabled = true
 						this.$message.error('当日登录已达最大次数,请明天再登录')
@@ -442,7 +409,7 @@ export default {
 			})
 		},
 		// 设置cookie
-		setCookie (username, password, days) {
+		setCookie(username, password, days) {
 			let date = new Date() // 获取时间
 			date.setTime(date.getTime() + 24 * 60 * 60 * 1000 * days) // 保存的天数
 			// 字符串拼接cookie
@@ -453,7 +420,7 @@ export default {
 		},
 
 		// 读取cookie 将用户名和密码回显到input框中
-		getCookie () {
+		getCookie() {
 			// let Base64 = require('js-base64').Base64
 			if (document.cookie.length > 0) {
 				let arr = document.cookie.split('; ') // 分割成一个个独立的“key=value”的形式
@@ -474,7 +441,7 @@ export default {
 			this.$TOOL.data.set("APP_LANG", language);
 			this.$store.commit("updateLanguage", language);
 		},
-		openForgetPassword () {
+		openForgetPassword() {
 			this.inputForm.username = ''
 			this.inputForm.password = ''
 			this.inputForm.code = ''
@@ -483,7 +450,7 @@ export default {
 				this.whichPage = '2' // 打开忘记密码页面
 			})
 		},
-		backLogin () {
+		backLogin() {
 			this.inputForm.phoneNumber = ''
 			this.inputForm.phoneCode = ''
 			this.inputForm.newPassword = ''
@@ -491,7 +458,7 @@ export default {
 			this.$refs.loginForm2.resetFields()
 			this.whichPage = '1' // 打开登录页面
 		},
-		pushPhoneCode () {
+		pushPhoneCode() {
 			// 验证手机号码格式是否正确
 			if (this.commonJS.isNotEmpty(this.inputForm.phoneNumber) && this.validateXG.isMobile(this.inputForm.phoneNumber)) {
 				// 向手机号发送验证码
@@ -521,7 +488,7 @@ export default {
 				this.$message.error('请填写正确的手机号')
 			}
 		},
-		saveNewPass () {
+		saveNewPass() {
 			this.loading = true
 			this.$refs['loginForm2'].validate((valid) => {
 				if (valid) {
@@ -560,6 +527,7 @@ export default {
 	top: 60px;
 	right: 60px;
 }
+
 .login-form {
 	&-wrapper {
 		width: 400px;
@@ -594,6 +562,7 @@ export default {
 	&-register-btn {
 		color: #86909c !important;
 	}
+
 	.login-submit {
 		width: 100%;
 		color: #fff;
@@ -604,6 +573,4 @@ export default {
 
 
 }
-
-
 </style>

+ 123 - 316
src/views/sys/user/UserList.vue

@@ -3,60 +3,40 @@
 		<pane size="20">
 			<el-container class="jp-container">
 				<el-header class="m-p-13-15">
-					<el-input
-						placeholder="请输入关键字过滤"
-						clearable
-						v-model="filterText"
-					>
+					<el-input placeholder="请输入关键字过滤" clearable v-model="filterText">
 					</el-input>
 				</el-header>
 				<el-main class="nopadding">
-					<el-tree
-						class="filter-tree"
-						:data="officeTreeData"
-						:props="{
-							value: 'id', // ID字段名
-							label: 'name', // 显示名称
-							children: 'children', // 子级字段名
-						}"
-						node-key="id"
-						default-expand-all
-						:filter-node-method="filterNode"
-						:expand-on-click-node="false"
-						highlight-current
-						@node-click="handleNodeClick"
-						ref="officeTree"
-					>
+					<el-tree class="filter-tree" :data="officeTreeData" :props="{
+						value: 'id', // ID字段名
+						label: 'name', // 显示名称
+						children: 'children', // 子级字段名
+					}" node-key="id" default-expand-all :filter-node-method="filterNode" :expand-on-click-node="false"
+						highlight-current @node-click="handleNodeClick" ref="officeTree">
 						<template #default="{ node, data }">
 							<span class="custom-tree-node el-tree-node__label">
 								<span class="label">
 									<el-icon class="m-r-5">
-										<qiye
-											v-if="data.type === '1'"
-											:style="{
-												color:
-													$TOOL.data.get(
-														'IS_PRIMARY_TENANT'
-													) &&
-													data.tenantDTO &&
-													$utils.getTenantColorById(
-														data.tenantDTO.id
-													),
-											}"
-										></qiye>
-										<bumen
-											v-else
-											:style="{
-												color:
-													$TOOL.data.get(
-														'IS_PRIMARY_TENANT'
-													) &&
-													data.tenantDTO &&
-													$utils.getTenantColorById(
-														data.tenantDTO.id
-													),
-											}"
-										></bumen>
+										<qiye v-if="data.type === '1'" :style="{
+											color:
+												$TOOL.data.get(
+													'IS_PRIMARY_TENANT'
+												) &&
+												data.tenantDTO &&
+												$utils.getTenantColorById(
+													data.tenantDTO.id
+												),
+										}"></qiye>
+										<bumen v-else :style="{
+											color:
+												$TOOL.data.get(
+													'IS_PRIMARY_TENANT'
+												) &&
+												data.tenantDTO &&
+												$utils.getTenantColorById(
+													data.tenantDTO.id
+												),
+										}"></bumen>
 									</el-icon>
 									{{ node.label }}
 								</span>
@@ -70,131 +50,56 @@
 			<el-container class="jp-container">
 				<el-header v-if="searchVisible">
 					<div class="left-panel">
-						<el-form
-							:inline="true"
-							class="query-form"
-							ref="searchForm"
-							:model="searchForm"
-							@keyup.enter="refreshList()"
-							@submit.prevent
-						>
+						<el-form :inline="true" class="query-form" ref="searchForm" :model="searchForm"
+							@keyup.enter="refreshList()" @submit.prevent>
 							<el-form-item prop="loginName" label="登录名:">
-								<el-input
-									v-model="searchForm.loginName"
-									placeholder="请输入登录名"
-									clearable
-								></el-input>
+								<el-input v-model="searchForm.loginName" placeholder="请输入登录名" clearable></el-input>
 							</el-form-item>
 							<el-form-item prop="name" label="姓名:">
-								<el-input
-									v-model="searchForm.name"
-									placeholder="请输入姓名"
-									clearable
-								></el-input>
+								<el-input v-model="searchForm.name" placeholder="请输入姓名" clearable></el-input>
 							</el-form-item>
 						</el-form>
 					</div>
 					<div class="right-panel">
-						<el-button
-							type="primary"
-							class="round"
-							@click="refreshList()"
-							icon="search"
-						>
-							查询</el-button
-						>
-						<el-button
-							type="default"
-							@click="resetSearch()"
-							icon="refresh-right"
-							>重置</el-button
-						>
+						<el-button type="primary" class="round" @click="refreshList()" icon="search">
+							查询</el-button>
+						<el-button type="default" @click="resetSearch()" icon="refresh-right">重置</el-button>
 					</div>
 				</el-header>
 				<el-main class="nopadding page2">
 					<div class="jp-table">
-						<vxe-toolbar
-							ref="userToolbar"
-							:refresh="{ query: refreshList }"
-							import
-							export
-							print
-							resizable
-							custom
-						>
+						<vxe-toolbar ref="userToolbar" :refresh="{ query: refreshList }" import export print resizable
+							custom>
 							<template #buttons>
-								<el-button
-									v-if="hasPermission('sys:user:add')"
-									type="primary"
-									icon="plus"
-									@click="add()"
-									>新建</el-button
-								>
-								<el-button
-									v-if="hasPermission('sys:user:edit')"
-									type="warning"
-									icon="edit-filled"
-									@click="edit()"
-									v-show="
-										$refs.userTable &&
+								<el-button v-if="hasPermission('sys:user:add')" type="primary" icon="plus"
+									@click="add()">新建</el-button>
+								<el-button v-if="hasPermission('sys:user:edit')" type="warning" icon="edit-filled"
+									@click="edit()" v-show="$refs.userTable &&
 										$refs.userTable.getCheckboxRecords()
 											.length === 1
-									"
-									>修改</el-button
-								>
-								<el-button
-									v-if="hasPermission('sys:user:del')"
-									type="danger"
-									icon="del-filled"
-									@click="del()"
-									v-show="
-										$refs.userTable &&
+										">修改</el-button>
+								<el-button v-if="hasPermission('sys:user:del')" type="danger" icon="del-filled"
+									@click="del()" v-show="$refs.userTable &&
 										$refs.userTable.getCheckboxRecords()
 											.length > 0
-									"
-									>删除</el-button
-								>
+										">删除</el-button>
 							</template>
 							<template #tools>
-								<vxe-button
-									type="text"
-									:title="
-										searchVisible ? '收起检索' : '展开检索'
-									"
-									icon="vxe-icon-search"
-									class="tool-btn"
-									@click="searchVisible = !searchVisible"
-								></vxe-button>
-								<vxe-button
-									type="text"
-									title="下载导入模板"
-									v-if="hasPermission('sys:user:import')"
-									icon="vxe-icon-copy"
-									class="tool-btn m-l-0"
-									@click="downloadTpl()"
-								>
+								<vxe-button type="text" :title="searchVisible ? '收起检索' : '展开检索'
+									" icon="vxe-icon-search" class="tool-btn" @click="searchVisible = !searchVisible"></vxe-button>
+								<vxe-button type="text" title="下载导入模板" v-if="hasPermission('sys:user:import')"
+									icon="vxe-icon-copy" class="tool-btn m-l-0" @click="downloadTpl()">
 								</vxe-button>
 							</template>
 						</vxe-toolbar>
 						<div class="jp-table-body">
-							<vxe-table
-								border="inner"
-								auto-resize
-								resizable
-								height="auto"
-								:loading="loading"
-								size="small"
-								ref="userTable"
-								show-header-overflow
-								show-overflow
-								highlight-hover-row
-								:print-config="{}"
-								:import-config="{
+							<vxe-table border="inner" auto-resize resizable height="auto" :loading="loading"
+								size="small" ref="userTable" show-header-overflow show-overflow highlight-hover-row
+								:print-config="{}" :import-config="{
 									importMethod: importMethod,
 									types: ['csv', 'xls', 'xlsx'],
 									remote: true,
-								}"
-								:export-config="{
+								}" :export-config="{
 									remote: true,
 									filename: `用户数据${moment(
 										new Date()
@@ -203,102 +108,58 @@
 									exportMethod: exportMethod,
 									types: ['xlsx'],
 									modes: ['current', 'selected', 'all'],
-								}"
-								@sort-change="sortChangeHandle"
-								:sort-config="{ remote: true }"
-								:data="dataList"
-							>
-								<vxe-table-column
-									v-if="$TOOL.data.get('IS_PRIMARY_TENANT')"
-									width="60"
-								>
+								}" @sort-change="sortChangeHandle" :sort-config="{ remote: true }" :data="dataList">
+								<vxe-table-column v-if="$TOOL.data.get('IS_PRIMARY_TENANT')" width="60">
 									<template #default="{ row }">
-										<el-avatar
-											:size="30"
-											:style="{
-												background:
-													row.tenantDTO &&
-													$utils.getTenantColorById(
-														row.tenantDTO.id
-													),
-											}"
-										>
+										<el-avatar :size="30" :style="{
+											background:
+												row.tenantDTO &&
+												$utils.getTenantColorById(
+													row.tenantDTO.id
+												),
+										}">
 											{{ row.name.substring(0, 1) }}
 										</el-avatar>
 									</template>
 								</vxe-table-column>
-								<vxe-column
-									type="checkbox"
-									width="40px"
-								></vxe-column>
+								<vxe-column type="checkbox" width="40px"></vxe-column>
 								<vxe-column title="头像" field="photo">
 									<template #default="{ row }">
-										<img
-											:src="
-												row.photo === ''
-													? '/static/img/avatar.png'
-													: row.photo
-											"
-											style="height: 35px"
-										/>
+										<img :src="row.photo === ''
+											? '/static/img/avatar.png'
+											: row.photo
+											" style="height: 35px" />
 									</template>
 								</vxe-column>
-								<vxe-column
-									title="登录名"
-									field="loginName"
-									sortable
-								>
+								<vxe-column title="登录名" field="loginName" sortable>
 									<template #default="{ row }">
-										<el-link
-											v-bind:class="{
-												'disabled-user':
-													row.loginFlag === '0',
-											}"
-											type="primary"
-											:underline="false"
-											v-if="
-												hasPermission('sys:user:edit')
-											"
-											@click="
-												edit(row.id, row.tenantDTO?.id)
-											"
-											>{{ row.loginName }}</el-link
-										>
-										<el-link
-											v-bind:class="{
-												'disabled-user':
-													row.loginFlag === '0',
-											}"
-											type="primary"
-											:underline="false"
-											v-else-if="
-												hasPermission('sys:user:view')
-											"
-											@click="
-												view(row.id, row.tenantDTO?.id)
-											"
-											>{{ row.loginName }}</el-link
-										>
-										<span
-											v-bind:class="{
-												'disabled-user':
-													row.loginFlag === '0',
-											}"
-											v-else
-											>{{ row.loginName }}</span
-										>
+										<el-link v-bind:class="{
+											'disabled-user':
+												row.loginFlag === '0',
+										}" type="primary" :underline="false" v-if="
+											hasPermission('sys:user:edit')
+										" @click="
+											edit(row.id, row.tenantDTO?.id)
+											">{{ row.loginName }}</el-link>
+										<el-link v-bind:class="{
+											'disabled-user':
+												row.loginFlag === '0',
+										}" type="primary" :underline="false" v-else-if="
+											hasPermission('sys:user:view')
+										" @click="
+											view(row.id, row.tenantDTO?.id)
+											">{{ row.loginName }}</el-link>
+										<span v-bind:class="{
+											'disabled-user':
+												row.loginFlag === '0',
+										}" v-else>{{ row.loginName }}</span>
 									</template>
 								</vxe-column>
 
 								<vxe-column title="姓名" field="name" sortable>
 								</vxe-column>
-								<vxe-column
-									title="所属租户"
-									v-if="$TOOL.data.get('IS_PRIMARY_TENANT')"
-									field="tenantDTO.id"
-									sort-by="a.tenant_id"
-									sortable
-								>
+								<vxe-column title="所属租户" v-if="$TOOL.data.get('IS_PRIMARY_TENANT')" field="tenantDTO.id"
+									sort-by="a.tenant_id" sortable>
 									<template #default="{ row }">
 										{{
 											row.tenantDTO &&
@@ -308,12 +169,7 @@
 										}}
 									</template>
 								</vxe-column>
-								<vxe-column
-									title="公司"
-									sort-by="c.name"
-									field="companyDTO.name"
-									sortable
-								>
+								<vxe-column title="公司" sort-by="c.name" field="companyDTO.name" sortable>
 									<template #default="{ row }">
 										{{
 											row.companyDTO &&
@@ -321,102 +177,52 @@
 										}}
 									</template>
 								</vxe-column>
-								<vxe-column
-									title="部门"
-									sort-by="o.name"
-									field="officeDTO.name"
-									sortable
-								>
+								<vxe-column title="部门" sort-by="o.name" field="officeDTO.name" sortable>
 									<template #default="{ row }">
 										{{
 											row.officeDTO && row.officeDTO.name
 										}}
 									</template>
 								</vxe-column>
-								<vxe-column
-									title="状态"
-									field="loginFlag"
-									sortable
-								>
+								<vxe-column title="状态" field="loginFlag" sortable>
 									<template #default="{ row }">
-										<el-tag
-											v-if="row.loginFlag === '1'"
-											type="success"
-											>正常</el-tag
-										>
-										<el-tag
-											v-else-if="row.loginFlag === '0'"
-											type="danger"
-											>禁用</el-tag
-										>
+										<el-tag v-if="row.loginFlag === '1'" type="success">正常</el-tag>
+										<el-tag v-else-if="row.loginFlag === '0'" type="danger">禁用</el-tag>
 									</template>
 								</vxe-column>
-								<vxe-column
-									title="操作"
-									width="350px"
-									fixed="right"
-									align="center"
-								>
+								<vxe-column title="操作" width="350px" fixed="right" align="center">
 									<template #default="{ row }">
-										<el-button
-											v-if="
-												hasPermission('sys:user:view')
-											"
-											type="primary"
-											text
-											icon="view-filled"
-											@click="
-												view(row.id, row.tenantDTO?.id)
-											"
-											>查看</el-button
-										>
-										<el-button
-											v-if="
-												hasPermission('sys:user:edit')
-											"
-											type="primary"
-											text
-											icon="edit-filled"
-											@click="
-												edit(row.id, row.tenantDTO?.id)
-											"
-											>修改</el-button
-										>
-										<el-button
-											v-if="hasPermission('sys:user:del')"
-											type="danger"
-											text
-											icon="del-filled"
-											@click="del(row.id)"
-											>删除</el-button
-										>
-										<el-button  text type="primary" @click="removeRedis(row.d)">清除登录缓存</el-button>
+										<el-button v-if="
+											hasPermission('sys:user:view')
+										" type="primary" text icon="view-filled" @click="
+											view(row.id, row.tenantDTO?.id)
+											">查看</el-button>
+										<el-button v-if="
+											hasPermission('sys:user:edit')
+										" type="primary" text icon="edit-filled" @click="
+											edit(row.id, row.tenantDTO?.id)
+											">修改</el-button>
+										<el-button v-if="hasPermission('sys:user:del')" type="danger" text
+											icon="del-filled" @click="del(row.id)">删除</el-button>
+										<el-button text type="primary" @click="removeRedis(row.id)">清除登录缓存</el-button>
 									</template>
 								</vxe-column>
 							</vxe-table>
-							<vxe-pager
-								background
-								size="small"
-								:current-page="tablePage.currentPage"
-								:page-size="tablePage.pageSize"
-								:total="tablePage.total"
-								:page-sizes="[
+							<vxe-pager background size="small" :current-page="tablePage.currentPage"
+								:page-size="tablePage.pageSize" :total="tablePage.total" :page-sizes="[
 									10,
 									20,
 									100,
 									1000,
 									{ label: '全量数据', value: 1000000 },
-								]"
-								:layouts="[
+								]" :layouts="[
 									'PrevPage',
 									'JumpNumber',
 									'NextPage',
 									'FullJump',
 									'Sizes',
 									'Total',
-								]"
-								@page-change="currentChangeHandle"
-							>
+								]" @page-change="currentChangeHandle">
 							</vxe-pager>
 						</div>
 					</div>
@@ -662,15 +468,7 @@ export default {
 					}
 				});
 		},
-		resetSearch() {
-			this.searchForm.companyDTO.id = "";
-			this.searchForm.officeDTO.id = "";
-			this.filterText = "";
-			this.$refs.officeTree.setCurrentKey(null);
-			this.$refs.searchForm.resetFields();
-			this.refreshList();
-		},
-		removeRedis(userId){
+		removeRedis(userId) {
 			this.$confirm(`确定清除所选项登录缓存吗?`, '提示', {
 				confirmButtonText: '确定',
 				cancelButtonText: '取消',
@@ -683,7 +481,16 @@ export default {
 					this.loading = false
 				})
 			})
-		}
+		},
+		resetSearch() {
+			this.searchForm.companyDTO.id = "";
+			this.searchForm.officeDTO.id = "";
+			this.filterText = "";
+			this.$refs.officeTree.setCurrentKey(null);
+			this.$refs.searchForm.resetFields();
+			this.refreshList();
+		},
+
 	},
 };
 </script>