lz 3 years ago
parent
commit
70c4240ee3
48 changed files with 3715 additions and 3990 deletions
  1. 24 0
      src/api/components/userChoice/index.js
  2. 41 32
      src/api/system/employeenInfo.js
  3. 0 62
      src/api/system/stockLocation.js
  4. 1 0
      src/api/ware/saleAttrs/index.js
  5. 40 0
      src/api/ware/stockLocation/index.js
  6. 0 1
      src/components/Hamburger/index.vue
  7. 202 0
      src/components/UploadOne/index(old).vue
  8. 148 182
      src/components/UploadOne/index.vue
  9. 0 139
      src/components/deptTreeChoice/index.vue
  10. 5 10
      src/components/shortcutMenu/index.vue
  11. 48 41
      src/components/treeChoice/index.vue
  12. 1 1
      src/components/userChoice/index.vue
  13. 8 12
      src/directive/index.js
  14. 0 27
      src/directive/permission/hasPermi.js
  15. 0 27
      src/directive/permission/hasRole.js
  16. 1 5
      src/store/modules/oss.js
  17. 7 7
      src/store/modules/permission.js
  18. 8 8
      src/store/modules/user.js
  19. 14 15
      src/utils/oss.js
  20. 0 51
      src/utils/permission.js
  21. 2 10
      src/views/index.vue
  22. 223 221
      src/views/monitor/job/index.vue
  23. 119 128
      src/views/monitor/job/log.vue
  24. 98 107
      src/views/monitor/logininfor/index.vue
  25. 52 52
      src/views/monitor/online/index.vue
  26. 113 122
      src/views/monitor/operlog/index.vue
  27. 149 160
      src/views/system/config/index.vue
  28. 0 282
      src/views/system/dataPermissions/index.vue
  29. 167 177
      src/views/system/dept/index.vue
  30. 195 195
      src/views/system/dict/data.vue
  31. 147 158
      src/views/system/dict/index.vue
  32. 57 88
      src/views/system/employeenInfo/index.vue
  33. 161 159
      src/views/system/employeenInfo/profile/userAvatar.vue
  34. 454 466
      src/views/system/levelPosition/index.vue
  35. 167 175
      src/views/system/menu/index.vue
  36. 126 126
      src/views/system/notice/index.vue
  37. 331 331
      src/views/system/post/index.vue
  38. 11 5
      src/views/system/role/index.vue
  39. 199 205
      src/views/system/tableHead/index.vue
  40. 160 174
      src/views/tool/gen/index.vue
  41. 11 0
      src/views/ware/brand/index.vue
  42. 11 0
      src/views/ware/category/index.vue
  43. 11 0
      src/views/ware/goods/index.vue
  44. 11 0
      src/views/ware/goodsAttrs/index.vue
  45. 11 0
      src/views/ware/locationCategory/index.vue
  46. 151 0
      src/views/ware/saleAttrs/index.vue
  47. 27 26
      src/views/ware/stockLocation/index.vue
  48. 3 3
      vue.config.js

+ 24 - 0
src/api/components/userChoice/index.js

@@ -0,0 +1,24 @@
+import request from '@/utils/request'
+// 根据部门职务员工列表查询
+export function selectListByDeptId(deptId, levelJobId) {
+	return request({
+		url: '/system/user/selectListByDeptId?deptId=' + deptId + '&levelJobId=' + levelJobId,
+		method: 'get'
+	})
+}
+
+// 查询业务常用人信息列表
+export function getCommonPerson(belongUserId) {
+	return request({
+		url: '/system/commonPerson/list?belongUserId=' + belongUserId,
+		method: 'get'
+	})
+}
+// 更新业务常用人信息
+export function updateCommonPerson(data) {
+	return request({
+		url: '/system/commonPerson',
+		method: 'put',
+		data
+	})
+}

+ 41 - 32
src/api/system/employeenInfo.js

@@ -10,10 +10,10 @@ export function getStaffList(params) {
 
 // 根据员工序号获取责权信息
 export function getResponsibilityRight(userId) {
-    return request({
-        url: '/system/user/responsibilityRight/' + userId,
-        method: 'GET'
-    })
+	return request({
+		url: '/system/user/responsibilityRight/' + userId,
+		method: 'GET'
+	})
 }
 
 // 获取级别职务下拉树列表
@@ -43,11 +43,11 @@ export function levelList() {
 // 查询角色列表
 export function listRole(query) {
 	return request({
-	  url: '/system/role/list',
-	  method: 'get',
-	  params: query
+		url: '/system/role/list',
+		method: 'get',
+		params: query
 	})
-  }
+}
 
 // 新增员工账号信息
 export function addUser(data) {
@@ -61,17 +61,17 @@ export function addUser(data) {
 // 删除员工
 export function delUser(userIds) {
 	return request({
-	  url: 'system/user/' + userIds,
-	  method: 'delete'
+		url: 'system/user/' + userIds,
+		method: 'delete'
 	})
-  }
+}
 
 // 根据员工序号获取授权功能权限
 export function getAuthRole(userId) {
-    return request({
-        url: '/system/user/authRole/' + userId,
-        method: 'GET'
-    })
+	return request({
+		url: '/system/user/authRole/' + userId,
+		method: 'GET'
+	})
 }
 
 // 更新员工授权功能权限
@@ -86,18 +86,18 @@ export function updateAuthRole(data) {
 // 查询数据角色信息列表
 export function listDataRole(query) {
 	return request({
-	  url: '/system/dataRole/list',
-	  method: 'get',
-	  params: query
+		url: '/system/dataRole/list',
+		method: 'get',
+		params: query
 	})
-  }
+}
 
 // 根据员工序号获取授权数据权限
 export function getDataRole(userId) {
-    return request({
-        url: '/system/user/dataRole/' + userId,
-        method: 'GET'
-    })
+	return request({
+		url: '/system/user/dataRole/' + userId,
+		method: 'GET'
+	})
 }
 
 // 更新员工授权数据权限
@@ -111,18 +111,18 @@ export function updateDataRole(data) {
 
 // 根据员工序号获取账号信息
 export function getAccountInfo(userId) {
-    return request({
-        url: '/system/user/accountInfo/' + userId,
-        method: 'GET'
-    })
+	return request({
+		url: '/system/user/accountInfo/' + userId,
+		method: 'GET'
+	})
 }
 
 // 根据员工Id获取基本信息
 export function getPersonnel(userId) {
-    return request({
-        url: '/system/user/personnel/' + userId,
-        method: 'GET'
-    })
+	return request({
+		url: '/system/user/personnel/' + userId,
+		method: 'GET'
+	})
 }
 
 // 修改员工账号信息
@@ -132,4 +132,13 @@ export function updateUser(data) {
 		method: 'put',
 		data: data
 	})
-}
+}
+
+// 更新头像
+export function saveAvatal(data) {
+	return request({
+		url: '/system/user/avatar',
+		method: 'post',
+		data
+	})
+}

+ 0 - 62
src/api/system/stockLocation.js

@@ -1,62 +0,0 @@
-import request from '@/utils/request'
-//增
-export function stockAdd(data) {
-	return request({
-		url: '/system/location',
-		method: 'post',
-		data
-	})
-}
-//删
-export function stockDel(data) {
-	return request({
-		url: '/system/location/' + data,
-		method: 'delete'
-	})
-}
-//改
-export function stockUpd(data) {
-	return request({
-		url: '/system/location',
-		method: 'put',
-		data
-	})
-}
-//查
-export function stockList(params) {
-	return request({
-		url: '/system/location/list',
-		method: 'get',
-		params
-	})
-}
-// 根据部门职务员工列表查询
-export function selectListByDeptId(deptId, levelJobId) {
-	return request({
-		url: '/system/user/selectListByDeptId?deptId=' + deptId + '&levelJobId=' + levelJobId,
-		method: 'get',
-	})
-}
-// 更新库位保管员
-export function updateKeeper(data) {
-	return request({
-		url: '/system/location/updateKeeper',
-		method: 'put',
-		data
-	})
-}
-// 查询业务常用人信息列表
-export function getCommonPerson(belongUserId) {
-	return request({
-		url: '/system/commonPerson/list?belongUserId=' + belongUserId,
-		method: 'get',
-	})
-}
-// 更新业务常用人信息
-export function updateCommonPerson(data) {
-	return request({
-		url: '/system/commonPerson',
-		method: 'put',
-		data
-	})
-}

+ 1 - 0
src/api/ware/saleAttrs/index.js

@@ -0,0 +1 @@
+import request from '@/utils/request'

+ 40 - 0
src/api/ware/stockLocation/index.js

@@ -0,0 +1,40 @@
+import request from '@/utils/request'
+//增
+export function stockAdd(data) {
+	return request({
+		url: '/ware/location',
+		method: 'post',
+		data
+	})
+}
+//删
+export function stockDel(data) {
+	return request({
+		url: '/ware/location/' + data,
+		method: 'delete'
+	})
+}
+//改
+export function stockUpd(data) {
+	return request({
+		url: '/ware/location',
+		method: 'put',
+		data
+	})
+}
+//查
+export function stockList(params) {
+	return request({
+		url: '/ware/location/list',
+		method: 'get',
+		params
+	})
+}
+// 更新库位保管员
+export function updateKeeper(data) {
+	return request({
+		url: '/ware/location/updateKeeper',
+		method: 'put',
+		data
+	})
+}

+ 0 - 1
src/components/Hamburger/index.vue

@@ -36,7 +36,6 @@ export default {
   vertical-align: middle;
   width: 20px;
   height: 20px;
-  background: #AAA5A5;
 }
 
 .hamburger.is-active {

+ 202 - 0
src/components/UploadOne/index(old).vue

@@ -0,0 +1,202 @@
+<template>
+	<div class="upload">
+		<div class="upload-box" @click="choiceFile">
+			<div class="upload-btn" v-if="!preview">
+				<i class="el-icon-upload"></i>
+				<span class="upload-text">点击选择文件</span>
+				<span>
+					<small v-if="type == 'img'">允许上传格式:jpg/png/gif</small><br />
+					<small v-if="type == 'doc'">允许上传格式:excel/word/pdf/ppt/txt</small><br />
+					<small v-if="type == 'video'">允许上传格式:mp4/mpeg/ogg</small><br />
+					<small>文件大小不超过:{{ size }}M</small><br />
+				</span>
+			</div>
+			<div class="upload-show" v-else>
+				<div class="progress" v-show="progressStatus">
+					<div class="mask"></div>
+					<el-progress type="circle" :percentage="$store.state.oss.progress"></el-progress>
+				</div>
+				<img :src="preview" alt="" v-if="type == 'img'" />
+				<div v-if="type == 'doc'" class="doc-box">
+					<i class="el-icon-document"></i>
+					<span>{{ preview }}</span>
+				</div>
+				<div v-if="type == 'video'" class="video">
+					<Video :src="preview" />
+				</div>
+			</div>
+			<button @click="uploadPut">put</button>
+		</div>
+		<input type="file" name="file" ref="file" @change="getFile" style="display: none" :accept="accept" />
+	</div>
+</template>
+
+<script>
+import upload from '@/utils/oss.js'
+import Video from '@/components/Video/index.vue'
+export default {
+	props: {
+		//文件类型 img图片 doc文件 video视频
+		type: {
+			type: String,
+			default: 'img'
+		},
+		//限制文件大小
+		size: {
+			type: String,
+			default: '10'
+		}
+	},
+	components: {
+		Video
+	},
+	data() {
+		return {
+			//文件对象
+			fileObj: null,
+			//文件名称
+			preview: null,
+			//显示进度条
+			showProgress: false
+		}
+	},
+	computed: {
+		progressStatus() {
+			if (this.showProgress && this.$store.state.oss.progress != 100) {
+				return true
+			}
+			return false
+		},
+		accept() {
+			if (this.type == 'img') {
+				return 'image/jpg,image/jpeg,image/png,image/gif'
+			} else if (this.type == 'doc') {
+				return 'application/msexcel,application/msword,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,text/plain'
+			} else if (this.type == 'video') {
+				return 'audio/mp4,video/mp4,video/mpeg,application/ogg,audio/ogg,'
+			}
+		}
+	},
+	methods: {
+		//选择文件
+		choiceFile() {
+			this.$refs.file.click()
+		},
+		//获取文件对象
+		getFile(e) {
+			this.fileObj = e.target.files[0]
+			if (!this.fileObj) return
+			let types = this.accept.split(',')
+			let type = this.fileObj.type
+			let size = this.fileObj.size
+			if (!types.includes(type)) {
+				this.$msg({ type: 'error', message: '文件类型不符' })
+				return
+			}
+			if (size > this.size * 1024 * 1024) {
+				this.$msg({ type: 'error', message: `文件不能大于${this.size}M` })
+				return
+			}
+			switch (this.type) {
+				case 'img':
+					this.preview = URL.createObjectURL(this.fileObj)
+					break
+				case 'doc':
+					this.preview = this.fileObj.name
+					break
+				case 'video':
+					this.preview = URL.createObjectURL(this.fileObj)
+					break
+			}
+		},
+		//上传图片到oss并返回路径
+		uploadPut() {
+			console.log(this.fileObj)
+			return
+			if (!this.fileObj) return
+			this.showProgress = true
+			return upload(this.fileObj).then(res => res.url)
+		}
+	}
+}
+</script>
+
+<style scoped lang="scss">
+.upload-box {
+	width: 360px;
+	height: 300px;
+	user-select: none;
+	-webkit-user-select: none;
+	cursor: pointer;
+	.upload-btn {
+		width: 100%;
+		height: 100%;
+		border: 1px dashed #d9d9d9;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		color: #666;
+		text-align: left;
+		.upload-text {
+			display: inline-block;
+			margin: 10px 0;
+			font-weight: bolder;
+		}
+		i {
+			font-size: 50px;
+			color: #c0c4cc;
+		}
+	}
+	.upload-show {
+		width: 100%;
+		height: 100%;
+		border: 1px solid #d9d9d9;
+		padding: 10px;
+		box-sizing: border-box;
+		position: relative;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		.progress {
+			width: 100%;
+			height: 100%;
+			position: absolute;
+			top: 0;
+			left: 0;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			z-index: 9999;
+			.mask {
+				width: 100%;
+				height: 100%;
+				background-color: rgba($color: #ddd, $alpha: 0.8);
+				position: absolute;
+				top: 0;
+				left: 0;
+			}
+		}
+		img {
+			width: 100%;
+			height: 100%;
+		}
+		.doc-box {
+			width: 60%;
+			height: 100%;
+			display: flex;
+			justify-content: center;
+			flex-direction: column;
+			align-items: center;
+			i {
+				font-size: 100px;
+				color: #c0c4cc;
+			}
+		}
+		.video {
+			width: 100%;
+			height: 100%;
+		}
+	}
+}
+</style>

+ 148 - 182
src/components/UploadOne/index.vue

@@ -1,199 +1,165 @@
 <template>
-	<div class="upload">
-		<div class="upload-box" @click="choiceFile">
-			<div class="upload-btn" v-if="!preview">
-				<i class="el-icon-upload"></i>
-				<span class="upload-text">点击选择文件</span>
-				<span>
-					<small v-if="type == 'img'">允许上传格式:jpg/png/gif</small><br />
-					<small v-if="type == 'doc'">允许上传格式:excel/word/pdf/ppt/txt</small><br />
-					<small v-if="type == 'video'">允许上传格式:mp4/mpeg/ogg</small><br />
-					<small>文件大小不超过:{{ size }}M</small><br />
-				</span>
-			</div>
-			<div class="upload-show" v-else>
-				<div class="progress" v-show="progressStatus">
-					<div class="mask"></div>
-					<el-progress type="circle" :percentage="$store.state.oss.progress"></el-progress>
-				</div>
-				<img :src="preview" alt="" v-if="type == 'img'" />
-				<div v-if="type == 'doc'" class="doc-box">
-					<i class="el-icon-document"></i>
-					<span>{{ preview }}</span>
-				</div>
-				<div v-if="type == 'video'" class="video">
-					<Video :src="preview" />
-				</div>
-			</div>
-		</div>
-		<input type="file" name="file" ref="file" @change="getFile" style="display: none" :accept="accept" />
+	<div>
+		<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog">
+			<el-row>
+				<el-col :xs="24" :md="12" :style="{ height: '350px' }">
+					<vue-cropper
+						ref="cropper"
+						:img="options.img"
+						:info="true"
+						:autoCrop="options.autoCrop"
+						:autoCropWidth="options.autoCropWidth"
+						:autoCropHeight="options.autoCropHeight"
+						:fixedBox="options.fixedBox"
+						@realTime="realTime"
+						v-if="visible"
+					/>
+				</el-col>
+				<el-col :xs="24" :md="12" :style="{ height: '350px' }">
+					<div class="avatar-upload-preview">
+						<img :src="previews.url" :style="previews.img" />
+					</div>
+				</el-col>
+			</el-row>
+			<br />
+			<el-row>
+				<el-col :lg="2" :md="2">
+					<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
+						<el-button size="small">
+							选择
+							<i class="el-icon-upload el-icon--right"></i>
+						</el-button>
+					</el-upload>
+				</el-col>
+				<el-col :lg="{ span: 1, offset: 2 }" :md="2">
+					<el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
+				</el-col>
+				<el-col :lg="{ span: 1, offset: 1 }" :md="2">
+					<el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
+				</el-col>
+				<el-col :lg="{ span: 1, offset: 1 }" :md="2">
+					<el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
+				</el-col>
+				<el-col :lg="{ span: 1, offset: 1 }" :md="2">
+					<el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
+				</el-col>
+				<el-col :lg="{ span: 2, offset: 6 }" :md="2">
+					<el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
+				</el-col>
+			</el-row>
+		</el-dialog>
 	</div>
 </template>
 
 <script>
-	import upload from '@/utils/oss.js'
-	import Video from '@/components/Video/index.vue'
-	export default {
-		props: {
-			//文件类型 img图片 doc文件 video视频
-			type: {
-				type: String,
-				default: 'img'
+import upload from '@/utils/oss.js'
+import { VueCropper } from 'vue-cropper'
+
+export default {
+	dicts: ['sys_upload_img'],
+	components: { VueCropper },
+	props: {
+		title: {
+			type: String,
+			default: '上传图片'
+		}
+	},
+	data() {
+		return {
+			// 是否显示弹出层
+			open: false,
+			// 是否显示cropper
+			visible: false,
+			options: {
+				img: null, //裁剪图片的地址
+				autoCrop: true, // 是否默认生成截图框
+				autoCropWidth: 200, // 默认生成截图框宽度
+				autoCropHeight: 200, // 默认生成截图框高度
+				fixedBox: true // 固定截图框大小 不允许改变
 			},
-			//限制文件大小
-			size: {
-				type: String,
-				default: '10'
-			}
+			previews: {}
+		}
+	},
+	methods: {
+		// 编辑头像
+		init(imgUrl) {
+			this.options.img = this.$store.state.oss.ossBaseUrl + imgUrl
+			this.open = true
 		},
-		components: {
-			Video
+		// 打开弹出层结束时的回调
+		modalOpened() {
+			this.visible = true
 		},
-		data() {
-			return {
-				//文件对象
-				fileObj: null,
-				//文件名称
-				preview: null,
-				//显示进度条
-				showProgress: false
-			}
+		// 覆盖默认的上传行为
+		requestUpload() {},
+		// 向左旋转
+		rotateLeft() {
+			this.$refs.cropper.rotateLeft()
 		},
-		computed: {
-			progressStatus() {
-				if (this.showProgress && this.$store.state.oss.progress != 100) {
-					return true
-				}
-				return false
-			},
-			accept() {
-				if (this.type == 'img') {
-					return 'image/jpg,image/jpeg,image/png,image/gif'
-				} else if (this.type == 'doc') {
-					return 'application/msexcel,application/msword,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,text/plain'
-				} else if (this.type == 'video') {
-					return 'audio/mp4,video/mp4,video/mpeg,application/ogg,audio/ogg,'
-				}
-			}
+		// 向右旋转
+		rotateRight() {
+			this.$refs.cropper.rotateRight()
 		},
-		methods: {
-			//选择文件
-			choiceFile() {
-				this.$refs.file.click()
-			},
-			//获取文件对象
-			getFile(e) {
-				this.fileObj = e.target.files[0]
-				if (!this.fileObj) return
-				let types = this.accept.split(',')
-				let type = this.fileObj.type
-				let size = this.fileObj.size
-				if (!types.includes(type)) {
-					this.$msg({ type: 'error', message: '文件类型不符' })
-					return
-				}
-				if (size > this.size * 1024 * 1024) {
-					this.$msg({ type: 'error', message: `文件不能大于${this.size}M` })
-					return
-				}
-				switch (this.type) {
-					case 'img':
-						this.preview = URL.createObjectURL(this.fileObj)
-						break
-					case 'doc':
-						this.preview = this.fileObj.name
-						break
-					case 'video':
-						this.preview = URL.createObjectURL(this.fileObj)
-						break
+		// 图片缩放
+		changeScale(num) {
+			num = num || 1
+			this.$refs.cropper.changeScale(num)
+		},
+		// 上传预处理
+		beforeUpload(file) {
+			if (file.type.indexOf('image/') == -1) {
+				this.$modal.msgError('文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。')
+			} else {
+				const reader = new FileReader()
+				reader.readAsDataURL(file)
+				reader.onload = () => {
+					this.options.img = reader.result
 				}
-			},
-			//上传图片到oss并返回路径
-			uploadPut() {
-				if (!this.fileObj) return
-				this.showProgress = true
-				return upload(this.fileObj).then((res) => res.url)
 			}
+		},
+		// 上传图片
+		uploadImg() {
+			this.$refs.cropper.getCropBlob(data => {
+				upload(data, this.dict.type.sys_upload_img.find(item => item.value === 'avatar').label).then(res => {
+					this.$emit('saveUrl', res.url)
+					this.open = false
+				})
+			})
+		},
+		// 实时预览
+		realTime(data) {
+			this.previews = data
+		},
+		// 关闭窗口
+		closeDialog() {
+			this.options.img = null
+			this.visible = false
 		}
 	}
+}
 </script>
-
 <style scoped lang="scss">
-	.upload-box {
-		width: 360px;
-		height: 300px;
-		user-select: none;
-		-webkit-user-select: none;
-		cursor: pointer;
-		.upload-btn {
-			width: 100%;
-			height: 100%;
-			border: 1px dashed #d9d9d9;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			justify-content: center;
-			color: #666;
-			text-align: left;
-			.upload-text {
-				display: inline-block;
-				margin: 10px 0;
-				font-weight: bolder;
-			}
-			i {
-				font-size: 50px;
-				color: #c0c4cc;
-			}
-		}
-		.upload-show {
-			width: 100%;
-			height: 100%;
-			border: 1px solid #d9d9d9;
-			padding: 10px;
-			box-sizing: border-box;
-			position: relative;
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			.progress {
-				width: 100%;
-				height: 100%;
-				position: absolute;
-				top: 0;
-				left: 0;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-				z-index: 9999;
-				.mask {
-					width: 100%;
-					height: 100%;
-					background-color: rgba($color: #ddd, $alpha: 0.8);
-					position: absolute;
-					top: 0;
-					left: 0;
-				}
-			}
-			img {
-				width: 100%;
-				height: 100%;
-			}
-			.doc-box {
-				width: 60%;
-				height: 100%;
-				display: flex;
-				justify-content: center;
-				flex-direction: column;
-				align-items: center;
-				i {
-					font-size: 100px;
-					color: #c0c4cc;
-				}
-			}
-			.video {
-				width: 100%;
-				height: 100%;
-			}
-		}
-	}
+.user-info-head {
+	position: relative;
+	display: inline-block;
+	height: 120px;
+}
+
+.user-info-head:hover:after {
+	content: '+';
+	position: absolute;
+	left: 0;
+	right: 0;
+	top: 0;
+	bottom: 0;
+	color: #eee;
+	background: rgba(0, 0, 0, 0.5);
+	font-size: 24px;
+	font-style: normal;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+	cursor: pointer;
+	line-height: 110px;
+	border-radius: 50%;
+}
 </style>

+ 0 - 139
src/components/deptTreeChoice/index.vue

@@ -1,139 +0,0 @@
-<template>
-	<div class="tree-choice">
-		<el-input placeholder="输入名称搜索" v-model="filterText" style="margin-bottom: 10px"></el-input>
-		<el-tree
-			:data="dataList"
-			node-key="id"
-			default-expand-all
-			:highlight-current="true"
-			:expand-on-click-node="false"
-			:filter-node-method="filterNode"
-			ref="tree"
-			@node-click="nodeClick"
-			show-checkbox
-			:default-checked-keys="checkeds"
-			:props="{ disabled: () => true }"
-		>
-			<span class="custom-tree-node" slot-scope="{ data }">
-				<span>{{ data.label }}</span>
-			</span>
-		</el-tree>
-	</div>
-</template>
-
-<script>
-	import { treeselect } from '@/api/system/dept.js'
-	export default {
-		model: {
-			prop: 'modelValue',
-			event: 'dataChange'
-		},
-		props: {
-			modelValue: {
-				type: Array,
-				required: true
-			}
-		},
-		data() {
-			return {
-				//搜索字段
-				filterText: '',
-				//拥有权限的id数组
-				checkeds: [],
-				//部门数据
-				dataList: [],
-				//选中的部门信息
-				deptInfo: {}
-			}
-		},
-		computed: {
-			deptIds: {
-				get() {
-					return this.modelValue
-				},
-				set(val) {
-					this.$emit('dataChange', val)
-					this.$emit('click')
-				}
-			}
-		},
-		watch: {
-			filterText(val) {
-				this.$refs.tree.filter(val)
-			}
-		},
-		created() {
-			this.getDeptList()
-		},
-		methods: {
-			//获取部门数据
-			getDeptList() {
-				treeselect().then((res) => {
-					if (res.code === 200) {
-						this.dataList = res.data
-						this.checkeds = this.getDeptIds()
-					}
-				})
-			},
-			//搜索过滤节点
-			filterNode(value, data) {
-				if (!value) return true
-				return data.label.indexOf(value) !== -1
-			},
-			//获取拥有的数据权限
-			getDeptIds() {
-				let ids = this.$store.state.user.dataPermissions
-				if (ids.includes('*')) {
-					return this.getAllIds(this.dataList)
-				} else {
-					return ids
-				}
-			},
-			//节点点击
-			nodeClick(data, node) {
-				let ids = data.children && data.children.length ? this.getAllIds(data.children) : []
-				ids.push(data.id)
-				ids = ids.filter((item) => this.checkeds.includes(item))
-				if (!ids.length) {
-					return
-				}
-				this.deptIds = ids
-				let deptNames = data.label
-				let parent = node.parent
-				while (parent.data.constructor === Object) {
-					deptNames = parent.data.label + '\\' + deptNames
-					parent = parent.parent
-				}
-				this.$emit('getDeptInfo', {
-					deptId: data.id,
-					deptName: data.label,
-					deptNames
-				})
-			},
-			//递归获取所有部门id
-			getAllIds(parents) {
-				if (!parents) return []
-				let arrs = []
-				parents.forEach((item) => {
-					arrs.push(item.id)
-					if (item.children && item.children.length) {
-						arrs = [...arrs, ...this.getAllIds(item.children)]
-					}
-				})
-				return arrs
-			}
-		}
-	}
-</script>
-
-<style scoped lang="scss">
-	.tree-choice {
-		background-color: #fff;
-		padding: 10px 10px;
-		width: 280px;
-		margin-right: 7px;
-		flex-shrink: 0;
-		height: 100%;
-		overflow-y: auto;
-	}
-</style>

+ 5 - 10
src/components/shortcutMenu/index.vue

@@ -2,7 +2,7 @@
 	<div class="shortcut" :style="{ height: moreStatus ? 'auto' : '50px' }" @mouseleave="moreClose">
 		<div class="tags" @mouseenter="moreOpen">
 			<router-link v-for="i in 20" :key="i" to="/" class="tag">
-				<span class="font_name">系统管理</span>
+				<span>系统管理</span>
 				<i class="el-icon-error" v-show="delStatus"></i>
 			</router-link>
 		</div>
@@ -50,8 +50,8 @@
 
 <style scoped lang="scss">
 	.shortcut {
-		height: 40px;
-		line-height: 40px;
+		min-height: 50px;
+		line-height: 50px;
 		padding: 0 10px;
 		overflow: hidden;
 		display: flex;
@@ -59,15 +59,10 @@
 			flex: 1;
 			.tag {
 				font-size: 14px;
-				color: #fff;
-				margin-right: 5px;
+				color: #999093;
+				margin-right: 20px;
 				display: inline-block;
 				position: relative;
-				background: #4c9898;
-				border: #4c9898 1px solid;
-				border-radius: 5px;
-				margin-top: 7px;
-				padding: 0 15px;
 				i {
 					position: absolute;
 					top: 20%;

+ 48 - 41
src/components/treeChoice/index.vue

@@ -10,54 +10,61 @@
 </template>
 
 <script>
-	export default {
-		props: {
-			dataList: {
-				type: Array,
-				required: true
-			},
-			nodeKey: {
-				type: String,
-				default: 'id'
-			},
-			nodeVal: {
-				type: String,
-				default: 'label'
-			}
+export default {
+	props: {
+		dataList: {
+			type: Array,
+			required: true
 		},
-		data() {
-			return {
-				//搜索字段
-				filterText: ''
-			}
+		nodeKey: {
+			type: String,
+			default: 'id'
 		},
-		watch: {
-			filterText(val) {
-				this.$refs.tree.filter(val)
-			}
+		nodeVal: {
+			type: String,
+			default: 'label'
+		}
+	},
+	data() {
+		return {
+			//搜索字段
+			filterText: ''
+		}
+	},
+	watch: {
+		filterText(val) {
+			this.$refs.tree.filter(val)
+		}
+	},
+	methods: {
+		//搜索过滤节点
+		filterNode(value, data) {
+			if (!value) return true
+			return data[this.nodeVal].indexOf(value) !== -1
 		},
-		methods: {
-			//搜索过滤节点
-			filterNode(value, data) {
-				if (!value) return true
-				return data[this.nodeVal].indexOf(value) !== -1
-			},
-			//节点点击
-			nodeClick(data) {
-				this.$emit('itemClick', data)
+		//节点点击
+		nodeClick(data, node) {
+			let deptNames = data.label
+			let parent = node.parent
+			while (Object.prototype.toString.call(parent.data).slice(8, -1) !== 'Array') {
+				deptNames = parent.data.label + '\\' + deptNames
+				parent = parent.parent
 			}
+			data.deptNames = deptNames
+			this.$emit('itemClick', data)
 		}
 	}
+}
 </script>
 
 <style scoped lang="scss">
-	.tree-choice {
-		background-color: #fff;
-		padding: 10px 10px;
-		width: 280px;
-		margin-right: 7px;
-		flex-shrink: 0;
-		height: 100%;
-		overflow-y: auto;
-	}
+.tree-choice {
+	background-color: #fff;
+	padding: 10px 10px;
+	width: 280px;
+	margin-right: 7px;
+	flex-shrink: 0;
+	height: 100%;
+	overflow-y: auto;
+}
 </style>

+ 1 - 1
src/components/userChoice/index.vue

@@ -26,7 +26,7 @@
 </template>
 <script>
 import { getLevelTreeSelect } from '@/api/system/employeenInfo'
-import { selectListByDeptId, updateCommonPerson, getCommonPerson } from '@/api/system/stockLocation'
+import { selectListByDeptId, updateCommonPerson, getCommonPerson } from '@/api/components/userChoice/index.js'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 export default {

+ 8 - 12
src/directive/index.js

@@ -1,23 +1,19 @@
-import hasRole from './permission/hasRole'
-import hasPermi from './permission/hasPermi'
 import dialogDrag from './dialog/drag'
 import dialogDragWidth from './dialog/dragWidth'
 import dialogDragHeight from './dialog/dragHeight'
 import clipboard from './module/clipboard'
 
-const install = function(Vue) {
-  Vue.directive('hasRole', hasRole)
-  Vue.directive('hasPermi', hasPermi)
-  Vue.directive('clipboard', clipboard)
-  Vue.directive('dialogDrag', dialogDrag)
-  Vue.directive('dialogDragWidth', dialogDragWidth)
-  Vue.directive('dialogDragHeight', dialogDragHeight)
+const install = function (Vue) {
+	Vue.directive('clipboard', clipboard)
+	Vue.directive('dialogDrag', dialogDrag)
+	Vue.directive('dialogDragWidth', dialogDragWidth)
+	Vue.directive('dialogDragHeight', dialogDragHeight)
 }
 
 if (window.Vue) {
-  window['hasRole'] = hasRole
-  window['hasPermi'] = hasPermi
-  Vue.use(install); // eslint-disable-line
+	window['hasRole'] = hasRole
+	window['hasPermi'] = hasPermi
+	Vue.use(install) // eslint-disable-line
 }
 
 export default install

+ 0 - 27
src/directive/permission/hasPermi.js

@@ -1,27 +0,0 @@
-/**
- * v-hasPermi 操作权限处理
- */
-
-import store from '@/store'
-
-export default {
-	inserted(el, binding, vnode) {
-		const { value } = binding
-		const all_permission = '*:*:*'
-		const permissions = store.getters && store.getters.permissions
-
-		if (value && value instanceof Array && value.length > 0) {
-			const permissionFlag = value
-
-			const hasPermissions = permissions.some((permission) => {
-				return all_permission === permission || permissionFlag.includes(permission)
-			})
-
-			if (!hasPermissions) {
-				el.parentNode && el.parentNode.removeChild(el)
-			}
-		} else {
-			throw new Error(`请设置操作权限标签值`)
-		}
-	}
-}

+ 0 - 27
src/directive/permission/hasRole.js

@@ -1,27 +0,0 @@
-/**
- * v-hasRole 角色权限处理
- */
-
-import store from '@/store'
-
-export default {
-	inserted(el, binding, vnode) {
-		const { value } = binding
-		const super_admin = 'admin'
-		const roles = store.getters && store.getters.roles
-
-		if (value && value instanceof Array && value.length > 0) {
-			const roleFlag = value
-
-			const hasRole = roles.some((role) => {
-				return super_admin === role || roleFlag.includes(role)
-			})
-
-			if (!hasRole) {
-				el.parentNode && el.parentNode.removeChild(el)
-			}
-		} else {
-			throw new Error(`请设置角色权限标签值"`)
-		}
-	}
-}

+ 1 - 5
src/store/modules/oss.js

@@ -3,7 +3,6 @@ const state = {
 	accessKeyId: 'LTAI5tJe94eBRuNzuVFyt1C2',
 	accessKeySecret: 'YRhe8lc7vpbxX8Fi4qvosDqVERFdjJ',
 	bucket: 'yangguzhineng',
-	folder: 'test',
 	progress: 0,
 	ossBaseUrl: '',
 	stsToken: ''
@@ -21,13 +20,10 @@ const mutations = {
 	SET_BUCKET: (state, payload) => {
 		state.bucket = payload
 	},
-	SET_FOLDER: (state, payload) => {
-		state.folder = payload
-	},
 	SET_PROGRESS: (state, payload) => {
 		state.progress = payload
 	},
-	SET_OSS_BASE_URL: (state) => {
+	SET_OSS_BASE_URL: state => {
 		state.ossBaseUrl = `https://${state.bucket}.${state.region}.aliyuncs.com/`
 	}
 }

+ 7 - 7
src/store/modules/permission.js

@@ -37,11 +37,10 @@ const permission = {
 	actions: {
 		// 生成路由
 		GenerateRoutes({ commit }) {
-			return new Promise((resolve) => {
+			return new Promise(resolve => {
 				// 向后端请求路由数据
-				getRouters().then((res) => {
+				getRouters().then(res => {
 					const sdata = JSON.parse(JSON.stringify(res.data))
-					console.log(sdata)
 					const rdata = JSON.parse(JSON.stringify(res.data))
 					const sidebarRoutes = filterAsyncRouter(sdata)
 					const rewriteRoutes = filterAsyncRouter(rdata, false, true)
@@ -59,7 +58,8 @@ const permission = {
 
 // 遍历后台传来的路由字符串,转换为组件对象
 function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
-	return asyncRouterMap.filter((route) => {
+	return asyncRouterMap.filter(route => {
+		route.meta.perms = route.perms
 		if (type && route.children) {
 			route.children = filterChildren(route.children)
 		}
@@ -90,7 +90,7 @@ function filterChildren(childrenMap, lastRouter = false) {
 	childrenMap.forEach((el, index) => {
 		if (el.children && el.children.length) {
 			if (el.component === 'ParentView' && !lastRouter) {
-				el.children.forEach((c) => {
+				el.children.forEach(c => {
 					c.path = el.path + '/' + c.path
 					if (c.children && c.children.length) {
 						children = children.concat(filterChildren(c.children, c))
@@ -109,9 +109,9 @@ function filterChildren(childrenMap, lastRouter = false) {
 	return children
 }
 
-export const loadView = (view) => {
+export const loadView = view => {
 	if (process.env.NODE_ENV === 'development') {
-		return (resolve) => require([`@/views/${view}`], resolve)
+		return resolve => require([`@/views/${view}`], resolve)
 	} else {
 		// 使用 import 实现生产环境的路由懒加载
 		return () => import(`@/views/${view}`)

+ 8 - 8
src/store/modules/user.js

@@ -10,7 +10,7 @@ const user = {
 		roles: [],
 		permissions: [],
 		dataPermissions: [],
-		userId: '',
+		userId: ''
 	},
 
 	mutations: {
@@ -46,7 +46,7 @@ const user = {
 			const uuid = userInfo.uuid
 			return new Promise((resolve, reject) => {
 				login(username, password, code, uuid)
-					.then((res) => {
+					.then(res => {
 						if (res.code == 200) {
 							setToken(res.token)
 							commit('SET_TOKEN', res.token)
@@ -60,7 +60,7 @@ const user = {
 							})
 						}
 					})
-					.catch((error) => {
+					.catch(error => {
 						reject(error)
 					})
 			})
@@ -70,10 +70,10 @@ const user = {
 		GetInfo({ commit, state }) {
 			return new Promise((resolve, reject) => {
 				getInfo()
-					.then((res) => {
+					.then(res => {
 						if (res.code == 200) {
 							const user = res.user
-							const avatar = user.avatar == '' ? require('@/assets/images/profile.jpg') : process.env.VUE_APP_BASE_API + user.avatar
+							const avatar = user.avatar == '' ? require('@/assets/images/profile.jpg') : user.avatar
 							if (res.roles && res.roles.length > 0) {
 								// 验证返回的roles是否是一个非空数组
 								commit('SET_ROLES', res.roles)
@@ -89,7 +89,7 @@ const user = {
 							resolve(res)
 						}
 					})
-					.catch((error) => {
+					.catch(error => {
 						reject(error)
 					})
 			})
@@ -106,7 +106,7 @@ const user = {
 						removeToken()
 						resolve()
 					})
-					.catch((error) => {
+					.catch(error => {
 						reject(error)
 					})
 			})
@@ -114,7 +114,7 @@ const user = {
 
 		// 前端 登出
 		FedLogOut({ commit }) {
-			return new Promise((resolve) => {
+			return new Promise(resolve => {
 				commit('SET_TOKEN', '')
 				removeToken()
 				resolve()

+ 14 - 15
src/utils/oss.js

@@ -8,36 +8,34 @@ let client = new OSS({
 	accessKeySecret: store.state.oss.accessKeySecret,
 	bucket: store.state.oss.bucket
 })
-
-//  上传
-const CooOss = function (file) {
-	if (this instanceof CooOss) {
-		let objectKey = store.state.oss.folder + '/' + file.lastModified + '_' + getFileNameUUID()
-		return new Promise((resolve, reject) => {
+const CooOss = function (blob, folder) {
+	let objectKey = folder + '/' + getFileNameUUID()
+	return new Promise((resolve, reject) => {
+		const reader = new FileReader()
+		reader.readAsArrayBuffer(blob)
+		reader.onload = function (event) {
+			const buffer = new OSS.Buffer(event.target.result)
 			client
-				.multipartUpload(objectKey, file, {
+				.put(objectKey, buffer, {
 					progress: function (p) {
 						store.commit('oss/SET_PROGRESS', p * 100)
 					}
 				})
-				.then((result) => {
+				.then(result => {
 					resolve({
 						code: 200,
 						url: objectKey,
 						msg: 'ok'
 					})
 				})
-				.catch((err) => {
+				.catch(err => {
 					Message.error('上传出错了')
 					reject({ code: 500, url: '', objectKey: '', msg: '上传出错了' })
 				})
-		})
-	} else {
-		return new CooOss(file)
-	}
+		}
+	})
 }
 
-// 下载
 export const download = function (key, filename = '') {
 	const url = client.signatureUrl(key, {
 		response: {
@@ -50,7 +48,7 @@ export const download = function (key, filename = '') {
  *
  * @param {上传是设置文件key 一般是文件名} obecjtKey
  */
-CooOss.prototype.getOssFileUrl = (obecjtKey) => {
+CooOss.prototype.getOssFileUrl = obecjtKey => {
 	if (!obecjtKey) return new Error('object key 必须传')
 	return 'https://' + bucket + '.' + region + '.aliyuncs.com/' + obecjtKey
 }
@@ -60,4 +58,5 @@ const getFileNameUUID = () => {
 	}
 	return `${+new Date()}_${rx()}${rx()}`
 }
+
 export default CooOss

+ 0 - 51
src/utils/permission.js

@@ -1,51 +0,0 @@
-import store from '@/store'
-
-/**
- * 字符权限校验
- * @param {Array} value 校验值
- * @returns {Boolean}
- */
-export function checkPermi(value) {
-  if (value && value instanceof Array && value.length > 0) {
-    const permissions = store.getters && store.getters.permissions
-    const permissionDatas = value
-    const all_permission = "*:*:*";
-
-    const hasPermission = permissions.some(permission => {
-      return all_permission === permission || permissionDatas.includes(permission)
-    })
-
-    if (!hasPermission) {
-      return false
-    }
-    return true
-  } else {
-    console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
-    return false
-  }
-}
-
-/**
- * 角色权限校验
- * @param {Array} value 校验值
- * @returns {Boolean}
- */
-export function checkRole(value) {
-  if (value && value instanceof Array && value.length > 0) {
-    const roles = store.getters && store.getters.roles
-    const permissionRoles = value
-    const super_admin = "admin";
-
-    const hasRole = roles.some(role => {
-      return super_admin === role || permissionRoles.includes(role)
-    })
-
-    if (!hasRole) {
-      return false
-    }
-    return true
-  } else {
-    console.error(`need roles! Like checkRole="['admin','editor']"`)
-    return false
-  }
-}

+ 2 - 10
src/views/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="main1"></div>
+	<div></div>
 </template>
 
 <script>
@@ -11,12 +11,4 @@ export default {
 }
 </script>
 
-<style scoped lang="scss">
-.main1 {
-  height: calc(100vh - 83px);
-//   padding: 10px 10px 0 10px;
-  box-shadow: #dac488 0px 0px 14px inset;
-//   margin-top: -10px;
-//   margin-left: -10px;
-  background-color: #000;
-}</style>
+<style scoped lang="scss"></style>

+ 223 - 221
src/views/monitor/job/index.vue

@@ -28,9 +28,9 @@
 						<div class="tag">计划任务</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['monitor:job:add']">添加</el-button>
-						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['monitor:job:export']">导出</el-button>
-						<el-button type="info" plain icon="el-icon-s-operation" size="mini" @click="handleJobLog" v-hasPermi="['monitor:job:query']" style="margin-right: 10px">日志</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
+						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
+						<el-button type="info" plain icon="el-icon-s-operation" size="mini" @click="handleJobLog" style="margin-right: 10px">日志</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
@@ -51,14 +51,14 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['monitor:job:edit']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['monitor:job:remove']">删除</el-button>
-							<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['monitor:job:changeStatus', 'monitor:job:query']">
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+							<el-dropdown size="mini" @command="command => handleCommand(command, scope.row)">
 								<span class="el-dropdown-link"> <i class="el-icon-d-arrow-right el-icon--right"></i>更多 </span>
 								<el-dropdown-menu slot="dropdown">
-									<el-dropdown-item command="handleRun" icon="el-icon-caret-right" v-hasPermi="['monitor:job:changeStatus']">执行一次</el-dropdown-item>
-									<el-dropdown-item command="handleView" icon="el-icon-view" v-hasPermi="['monitor:job:query']">任务详细</el-dropdown-item>
-									<el-dropdown-item command="handleJobLog" icon="el-icon-s-operation" v-hasPermi="['monitor:job:query']">调度日志</el-dropdown-item>
+									<el-dropdown-item command="handleRun" icon="el-icon-caret-right">执行一次</el-dropdown-item>
+									<el-dropdown-item command="handleView" icon="el-icon-view">任务详细</el-dropdown-item>
+									<el-dropdown-item command="handleJobLog" icon="el-icon-s-operation">调度日志</el-dropdown-item>
 								</el-dropdown-menu>
 							</el-dropdown>
 						</template>
@@ -198,229 +198,231 @@
 </template>
 
 <script>
-	import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from '@/api/monitor/job'
-	import Crontab from '@/components/Crontab'
+import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from '@/api/monitor/job'
+import Crontab from '@/components/Crontab'
 
-	export default {
-		components: { Crontab },
-		name: 'Job',
-		dicts: ['sys_job_group', 'sys_job_status'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 定时任务表格数据
-				jobList: [],
-				// 弹出层标题
-				title: '',
-				// 是否显示弹出层
-				open: false,
-				// 是否显示详细弹出层
-				openView: false,
-				// 是否显示Cron表达式弹出层
-				openCron: false,
-				// 传入的表达式
-				expression: '',
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					jobName: undefined,
-					jobGroup: undefined,
-					status: undefined
-				},
-				// 表单参数
-				form: {},
-				// 表单校验
-				rules: {
-					jobName: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
-					invokeTarget: [{ required: true, message: '调用目标字符串不能为空', trigger: 'blur' }],
-					cronExpression: [{ required: true, message: 'cron执行表达式不能为空', trigger: 'blur' }]
+export default {
+	components: { Crontab },
+	name: 'Job',
+	dicts: ['sys_job_group', 'sys_job_status'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 定时任务表格数据
+			jobList: [],
+			// 弹出层标题
+			title: '',
+			// 是否显示弹出层
+			open: false,
+			// 是否显示详细弹出层
+			openView: false,
+			// 是否显示Cron表达式弹出层
+			openCron: false,
+			// 传入的表达式
+			expression: '',
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				jobName: undefined,
+				jobGroup: undefined,
+				status: undefined
+			},
+			// 表单参数
+			form: {},
+			// 表单校验
+			rules: {
+				jobName: [{ required: true, message: '任务名称不能为空', trigger: 'blur' }],
+				invokeTarget: [{ required: true, message: '调用目标字符串不能为空', trigger: 'blur' }],
+				cronExpression: [{ required: true, message: 'cron执行表达式不能为空', trigger: 'blur' }]
+			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询定时任务列表 */
+		getList() {
+			this.loading = true
+			listJob(this.queryParams).then(response => {
+				if (response.code === 200) {
+					this.jobList = response.rows
+					this.total = response.total
+					this.loading = false
 				}
+			})
+		},
+		// 任务组名字典翻译
+		jobGroupFormat(row, column) {
+			return this.selectDictLabel(this.dict.type.sys_job_group, row.jobGroup)
+		},
+		// 取消按钮
+		cancel() {
+			this.open = false
+			this.reset()
+		},
+		// 表单重置
+		reset() {
+			this.form = {
+				jobId: undefined,
+				jobName: undefined,
+				jobGroup: undefined,
+				invokeTarget: undefined,
+				cronExpression: undefined,
+				misfirePolicy: 1,
+				concurrent: 1,
+				status: '0'
 			}
+			this.resetForm('form')
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
 			this.getList()
 		},
-		methods: {
-			/** 查询定时任务列表 */
-			getList() {
-				this.loading = true
-				listJob(this.queryParams).then((response) => {
-					this.jobList = response.rows
-					this.total = response.total
-					this.loading = false
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		// 更多操作触发
+		handleCommand(command, row) {
+			switch (command) {
+				case 'handleRun':
+					this.handleRun(row)
+					break
+				case 'handleView':
+					this.handleView(row)
+					break
+				case 'handleJobLog':
+					this.handleJobLog(row)
+					break
+				default:
+					break
+			}
+		},
+		// 任务状态修改
+		handleStatusChange(row) {
+			let text = row.status === '0' ? '启用' : '停用'
+			this.$modal
+				.confirm('确认要"' + text + '""' + row.jobName + '"任务吗?')
+				.then(function () {
+					return changeJobStatus(row.jobId, row.status)
 				})
-			},
-			// 任务组名字典翻译
-			jobGroupFormat(row, column) {
-				return this.selectDictLabel(this.dict.type.sys_job_group, row.jobGroup)
-			},
-			// 取消按钮
-			cancel() {
-				this.open = false
-				this.reset()
-			},
-			// 表单重置
-			reset() {
-				this.form = {
-					jobId: undefined,
-					jobName: undefined,
-					jobGroup: undefined,
-					invokeTarget: undefined,
-					cronExpression: undefined,
-					misfirePolicy: 1,
-					concurrent: 1,
-					status: '0'
-				}
-				this.resetForm('form')
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			// 更多操作触发
-			handleCommand(command, row) {
-				switch (command) {
-					case 'handleRun':
-						this.handleRun(row)
-						break
-					case 'handleView':
-						this.handleView(row)
-						break
-					case 'handleJobLog':
-						this.handleJobLog(row)
-						break
-					default:
-						break
-				}
-			},
-			// 任务状态修改
-			handleStatusChange(row) {
-				let text = row.status === '0' ? '启用' : '停用'
-				this.$modal
-					.confirm('确认要"' + text + '""' + row.jobName + '"任务吗?')
-					.then(function () {
-						return changeJobStatus(row.jobId, row.status)
-					})
-					.then(() => {
-						this.$modal.msgSuccess(text + '成功')
-					})
-					.catch(function () {
-						row.status = row.status === '0' ? '1' : '0'
-					})
-			},
-			/* 立即执行一次 */
-			handleRun(row) {
-				this.$modal
-					.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?')
-					.then(function () {
-						return runJob(row.jobId, row.jobGroup)
-					})
-					.then(() => {
-						this.$modal.msgSuccess('执行成功')
-					})
-					.catch(() => {})
-			},
-			/** 任务详细信息 */
-			handleView(row) {
-				getJob(row.jobId).then((response) => {
-					this.form = response.data
-					this.openView = true
+				.then(() => {
+					this.$modal.msgSuccess(text + '成功')
 				})
-			},
-			/** cron表达式按钮操作 */
-			handleShowCron() {
-				this.expression = this.form.cronExpression
-				this.openCron = true
-			},
-			/** 确定后回传值 */
-			crontabFill(value) {
-				this.form.cronExpression = value
-			},
-			/** 任务日志列表查询 */
-			handleJobLog(row) {
-				const jobId = row.jobId || 0
-				this.$router.push({ path: '/monitor/job-log/index', query: { jobId: jobId } })
-			},
-			/** 新增按钮操作 */
-			handleAdd() {
-				this.reset()
-				this.open = true
-				this.title = '添加任务'
-			},
-			/** 修改按钮操作 */
-			handleUpdate(row) {
-				this.reset()
-				const jobId = row.jobId || this.ids
-				getJob(jobId).then((response) => {
-					this.form = response.data
-					this.open = true
-					this.title = '修改任务'
+				.catch(function () {
+					row.status = row.status === '0' ? '1' : '0'
 				})
-			},
-			/** 提交按钮 */
-			submitForm: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.jobId != undefined) {
-							updateJob(this.form).then((response) => {
-								if (response.code == 200) {
-									this.$msg({ message: '修改成功' })
-									this.open = false
-									this.getList()
-								} else {
-									this.$msg({ message: response.msg, type: 'error' })
-								}
-							})
-						} else {
-							addJob(this.form).then((response) => {
-								if (response.code == 200) {
-									this.$msg({ message: '新增成功' })
-									this.open = false
-									this.getList()
-								} else {
-									this.$msg({ message: response.msg, type: 'error' })
-								}
-							})
-						}
+		},
+		/* 立即执行一次 */
+		handleRun(row) {
+			this.$modal
+				.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?')
+				.then(function () {
+					return runJob(row.jobId, row.jobGroup)
+				})
+				.then(() => {
+					this.$modal.msgSuccess('执行成功')
+				})
+				.catch(() => {})
+		},
+		/** 任务详细信息 */
+		handleView(row) {
+			getJob(row.jobId).then(response => {
+				this.form = response.data
+				this.openView = true
+			})
+		},
+		/** cron表达式按钮操作 */
+		handleShowCron() {
+			this.expression = this.form.cronExpression
+			this.openCron = true
+		},
+		/** 确定后回传值 */
+		crontabFill(value) {
+			this.form.cronExpression = value
+		},
+		/** 任务日志列表查询 */
+		handleJobLog(row) {
+			const jobId = row.jobId || 0
+			this.$router.push({ path: '/monitor/job-log/index', query: { jobId: jobId } })
+		},
+		/** 新增按钮操作 */
+		handleAdd() {
+			this.reset()
+			this.open = true
+			this.title = '添加任务'
+		},
+		/** 修改按钮操作 */
+		handleUpdate(row) {
+			this.reset()
+			const jobId = row.jobId || this.ids
+			getJob(jobId).then(response => {
+				this.form = response.data
+				this.open = true
+				this.title = '修改任务'
+			})
+		},
+		/** 提交按钮 */
+		submitForm: function () {
+			this.$refs['form'].validate(valid => {
+				if (valid) {
+					if (this.form.jobId != undefined) {
+						updateJob(this.form).then(response => {
+							if (response.code == 200) {
+								this.$msg({ message: '修改成功' })
+								this.open = false
+								this.getList()
+							} else {
+								this.$msg({ message: response.msg, type: 'error' })
+							}
+						})
+					} else {
+						addJob(this.form).then(response => {
+							if (response.code == 200) {
+								this.$msg({ message: '新增成功' })
+								this.open = false
+								this.getList()
+							} else {
+								this.$msg({ message: response.msg, type: 'error' })
+							}
+						})
 					}
+				}
+			})
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const jobIds = row.jobId
+			this.$modal
+				.confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?')
+				.then(function () {
+					return delJob(jobIds)
 				})
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const jobIds = row.jobId
-				this.$modal
-					.confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?')
-					.then(function () {
-						return delJob(jobIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			},
-			/** 导出按钮操作 */
-			handleExport() {
-				this.download(
-					'monitor/job/export',
-					{
-						...this.queryParams
-					},
-					`job_${new Date().getTime()}.xlsx`
-				)
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
+				})
+				.catch(() => {})
+		},
+		/** 导出按钮操作 */
+		handleExport() {
+			this.download(
+				'monitor/job/export',
+				{
+					...this.queryParams
+				},
+				`job_${new Date().getTime()}.xlsx`
+			)
 		}
 	}
+}
 </script>

+ 119 - 128
src/views/monitor/job/log.vue

@@ -15,16 +15,7 @@
 				</el-select>
 			</el-form-item>
 			<el-form-item label="执行时间">
-				<el-date-picker
-					v-model="dateRange"
-					size="small"
-					style="width: 240px"
-					value-format="yyyy-MM-dd"
-					type="daterange"
-					range-separator="-"
-					start-placeholder="开始日期"
-					end-placeholder="结束日期"
-				></el-date-picker>
+				<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
 			</el-form-item>
 			<el-form-item>
 				<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -34,13 +25,13 @@
 
 		<el-row :gutter="10" class="mb8">
 			<el-col :span="1.5">
-				<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['monitor:job:remove']">删除</el-button>
+				<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
 			</el-col>
 			<el-col :span="1.5">
-				<el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleClean" v-hasPermi="['monitor:job:remove']">清空</el-button>
+				<el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleClean">清空</el-button>
 			</el-col>
 			<el-col :span="1.5">
-				<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['monitor:job:export']">导出</el-button>
+				<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
 			</el-col>
 			<el-col :span="1.5">
 				<el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose">关闭</el-button>
@@ -71,7 +62,7 @@
 			</el-table-column>
 			<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 				<template slot-scope="scope">
-					<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" v-hasPermi="['monitor:job:query']">详细</el-button>
+					<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">详细</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -115,127 +106,127 @@
 </template>
 
 <script>
-	import { getJob } from '@/api/monitor/job'
-	import { listJobLog, delJobLog, cleanJobLog } from '@/api/monitor/jobLog'
+import { getJob } from '@/api/monitor/job'
+import { listJobLog, delJobLog, cleanJobLog } from '@/api/monitor/jobLog'
 
-	export default {
-		name: 'JobLog',
-		dicts: ['sys_common_status', 'sys_job_group'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 选中数组
-				ids: [],
-				// 非多个禁用
-				multiple: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 调度日志表格数据
-				jobLogList: [],
-				// 是否显示弹出层
-				open: false,
-				// 日期范围
-				dateRange: [],
-				// 表单参数
-				form: {},
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					jobName: undefined,
-					jobGroup: undefined,
-					status: undefined
-				}
+export default {
+	name: 'JobLog',
+	dicts: ['sys_common_status', 'sys_job_group'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 选中数组
+			ids: [],
+			// 非多个禁用
+			multiple: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 调度日志表格数据
+			jobLogList: [],
+			// 是否显示弹出层
+			open: false,
+			// 日期范围
+			dateRange: [],
+			// 表单参数
+			form: {},
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				jobName: undefined,
+				jobGroup: undefined,
+				status: undefined
 			}
+		}
+	},
+	created() {
+		const jobId = this.$route.query.jobId
+		if (jobId !== undefined && jobId != 0) {
+			getJob(jobId).then(response => {
+				this.queryParams.jobName = response.data.jobName
+				this.queryParams.jobGroup = response.data.jobGroup
+				this.getList()
+			})
+		} else {
+			this.getList()
+		}
+	},
+	methods: {
+		/** 查询调度日志列表 */
+		getList() {
+			this.loading = true
+			listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+				this.jobLogList = response.rows
+				this.total = response.total
+				this.loading = false
+			})
+		},
+		// 返回按钮
+		handleClose() {
+			const obj = { path: '/monitor/job' }
+			this.$tab.closeOpenPage(obj)
+		},
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
+			this.getList()
+		},
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.dateRange = []
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		// 多选框选中数据
+		handleSelectionChange(selection) {
+			this.ids = selection.map(item => item.jobLogId)
+			this.multiple = !selection.length
+		},
+		/** 详细按钮操作 */
+		handleView(row) {
+			this.open = true
+			this.form = row
 		},
-		created() {
-			const jobId = this.$route.query.jobId
-			if (jobId !== undefined && jobId != 0) {
-				getJob(jobId).then((response) => {
-					this.queryParams.jobName = response.data.jobName
-					this.queryParams.jobGroup = response.data.jobGroup
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const jobLogIds = this.ids
+			this.$modal
+				.confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?')
+				.then(function () {
+					return delJobLog(jobLogIds)
+				})
+				.then(() => {
 					this.getList()
+					this.$modal.msgSuccess('删除成功')
 				})
-			} else {
-				this.getList()
-			}
+				.catch(() => {})
 		},
-		methods: {
-			/** 查询调度日志列表 */
-			getList() {
-				this.loading = true
-				listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-					this.jobLogList = response.rows
-					this.total = response.total
-					this.loading = false
+		/** 清空按钮操作 */
+		handleClean() {
+			this.$modal
+				.confirm('是否确认清空所有调度日志数据项?')
+				.then(function () {
+					return cleanJobLog()
 				})
-			},
-			// 返回按钮
-			handleClose() {
-				const obj = { path: '/monitor/job' }
-				this.$tab.closeOpenPage(obj)
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.dateRange = []
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			// 多选框选中数据
-			handleSelectionChange(selection) {
-				this.ids = selection.map((item) => item.jobLogId)
-				this.multiple = !selection.length
-			},
-			/** 详细按钮操作 */
-			handleView(row) {
-				this.open = true
-				this.form = row
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const jobLogIds = this.ids
-				this.$modal
-					.confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?')
-					.then(function () {
-						return delJobLog(jobLogIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			},
-			/** 清空按钮操作 */
-			handleClean() {
-				this.$modal
-					.confirm('是否确认清空所有调度日志数据项?')
-					.then(function () {
-						return cleanJobLog()
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('清空成功')
-					})
-					.catch(() => {})
-			},
-			/** 导出按钮操作 */
-			handleExport() {
-				this.download(
-					'/monitor/jobLog/export',
-					{
-						...this.queryParams
-					},
-					`log_${new Date().getTime()}.xlsx`
-				)
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('清空成功')
+				})
+				.catch(() => {})
+		},
+		/** 导出按钮操作 */
+		handleExport() {
+			this.download(
+				'/monitor/jobLog/export',
+				{
+					...this.queryParams
+				},
+				`log_${new Date().getTime()}.xlsx`
+			)
 		}
 	}
+}
 </script>

+ 98 - 107
src/views/monitor/logininfor/index.vue

@@ -14,16 +14,7 @@
 					</el-select>
 				</el-form-item>
 				<el-form-item label="登录时间">
-					<el-date-picker
-						v-model="dateRange"
-						size="small"
-						style="width: 240px"
-						value-format="yyyy-MM-dd"
-						type="daterange"
-						range-separator="-"
-						start-placeholder="开始日期"
-						end-placeholder="结束日期"
-					></el-date-picker>
+					<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
 				</el-form-item>
 				<el-form-item>
 					<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
@@ -38,8 +29,8 @@
 						<div class="tag">登录日志</div>
 					</div>
 					<div class="actions">
-						<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleClean" v-hasPermi="['monitor:logininfor:remove']">清空</el-button>
-						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['monitor:logininfor:export']" style="margin-right: 10px">导出</el-button>
+						<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleClean">清空</el-button>
+						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" style="margin-right: 10px">导出</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
@@ -70,107 +61,107 @@
 </template>
 
 <script>
-	import { list, delLogininfor, cleanLogininfor } from '@/api/monitor/logininfor'
+import { list, delLogininfor, cleanLogininfor } from '@/api/monitor/logininfor'
 
-	export default {
-		name: 'Logininfor',
-		dicts: ['sys_common_status'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 选中数组
-				ids: [],
-				// 非多个禁用
-				multiple: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 表格数据
-				list: [],
-				// 日期范围
-				dateRange: [],
-				// 默认排序
-				defaultSort: { prop: 'loginTime', order: 'descending' },
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					ipaddr: undefined,
-					userName: undefined,
-					status: undefined
-				}
+export default {
+	name: 'Logininfor',
+	dicts: ['sys_common_status'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 选中数组
+			ids: [],
+			// 非多个禁用
+			multiple: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 表格数据
+			list: [],
+			// 日期范围
+			dateRange: [],
+			// 默认排序
+			defaultSort: { prop: 'loginTime', order: 'descending' },
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				ipaddr: undefined,
+				userName: undefined,
+				status: undefined
 			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询登录日志列表 */
+		getList() {
+			this.loading = true
+			list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+				this.list = response.rows
+				this.total = response.total
+				this.loading = false
+			})
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
 			this.getList()
 		},
-		methods: {
-			/** 查询登录日志列表 */
-			getList() {
-				this.loading = true
-				list(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-					this.list = response.rows
-					this.total = response.total
-					this.loading = false
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.dateRange = []
+			this.resetForm('queryForm')
+			this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
+			this.handleQuery()
+		},
+		/** 排序触发事件 */
+		handleSortChange(column, prop, order) {
+			this.queryParams.orderByColumn = column.prop
+			this.queryParams.isAsc = column.order
+			this.getList()
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const infoIds = row.infoId || this.ids
+			this.$modal
+				.confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?')
+				.then(function () {
+					return delLogininfor(infoIds)
 				})
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.dateRange = []
-				this.resetForm('queryForm')
-				this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
-				this.handleQuery()
-			},
-			/** 排序触发事件 */
-			handleSortChange(column, prop, order) {
-				this.queryParams.orderByColumn = column.prop
-				this.queryParams.isAsc = column.order
-				this.getList()
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const infoIds = row.infoId || this.ids
-				this.$modal
-					.confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?')
-					.then(function () {
-						return delLogininfor(infoIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			},
-			/** 清空按钮操作 */
-			handleClean() {
-				this.$modal
-					.confirm('是否确认清空所有登录日志数据项?')
-					.then(function () {
-						return cleanLogininfor()
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('清空成功')
-					})
-					.catch(() => {})
-			},
-			/** 导出按钮操作 */
-			handleExport() {
-				this.download(
-					'monitor/logininfor/export',
-					{
-						...this.queryParams
-					},
-					`logininfor_${new Date().getTime()}.xlsx`
-				)
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
+				})
+				.catch(() => {})
+		},
+		/** 清空按钮操作 */
+		handleClean() {
+			this.$modal
+				.confirm('是否确认清空所有登录日志数据项?')
+				.then(function () {
+					return cleanLogininfor()
+				})
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('清空成功')
+				})
+				.catch(() => {})
+		},
+		/** 导出按钮操作 */
+		handleExport() {
+			this.download(
+				'monitor/logininfor/export',
+				{
+					...this.queryParams
+				},
+				`logininfor_${new Date().getTime()}.xlsx`
+			)
 		}
 	}
+}
 </script>

+ 52 - 52
src/views/monitor/online/index.vue

@@ -41,7 +41,7 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleForceLogout(scope.row)" v-hasPermi="['monitor:online:forceLogout']">强退</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleForceLogout(scope.row)">强退</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -53,63 +53,63 @@
 </template>
 
 <script>
-	import { list, forceLogout } from '@/api/monitor/online'
+import { list, forceLogout } from '@/api/monitor/online'
 
-	export default {
-		name: 'Online',
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 总条数
-				total: 0,
-				// 表格数据
-				list: [],
-				pageNum: 1,
-				pageSize: 10,
-				// 查询参数
-				queryParams: {
-					ipaddr: undefined,
-					userName: undefined
-				}
+export default {
+	name: 'Online',
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 总条数
+			total: 0,
+			// 表格数据
+			list: [],
+			pageNum: 1,
+			pageSize: 10,
+			// 查询参数
+			queryParams: {
+				ipaddr: undefined,
+				userName: undefined
 			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询登录日志列表 */
+		getList() {
+			this.loading = true
+			list(this.queryParams).then(response => {
+				this.list = response.rows
+				this.total = response.total
+				this.loading = false
+			})
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.pageNum = 1
 			this.getList()
 		},
-		methods: {
-			/** 查询登录日志列表 */
-			getList() {
-				this.loading = true
-				list(this.queryParams).then((response) => {
-					this.list = response.rows
-					this.total = response.total
-					this.loading = false
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		/** 强退按钮操作 */
+		handleForceLogout(row) {
+			this.$modal
+				.confirm('是否确认强退名称为"' + row.userName + '"的用户?')
+				.then(function () {
+					return forceLogout(row.tokenId)
 				})
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			/** 强退按钮操作 */
-			handleForceLogout(row) {
-				this.$modal
-					.confirm('是否确认强退名称为"' + row.userName + '"的用户?')
-					.then(function () {
-						return forceLogout(row.tokenId)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('强退成功')
-					})
-					.catch(() => {})
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('强退成功')
+				})
+				.catch(() => {})
 		}
 	}
+}
 </script>

+ 113 - 122
src/views/monitor/operlog/index.vue

@@ -19,16 +19,7 @@
 					</el-select>
 				</el-form-item>
 				<el-form-item label="操作时间">
-					<el-date-picker
-						v-model="dateRange"
-						size="small"
-						style="width: 240px"
-						value-format="yyyy-MM-dd"
-						type="daterange"
-						range-separator="-"
-						start-placeholder="开始日期"
-						end-placeholder="结束日期"
-					></el-date-picker>
+					<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
 				</el-form-item>
 				<el-form-item>
 					<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
@@ -43,8 +34,8 @@
 						<div class="tag">操作日志</div>
 					</div>
 					<div class="actions">
-						<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleClean" v-hasPermi="['monitor:operlog:remove']">清空</el-button>
-						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['monitor:operlog:export']" style="margin-right: 10px">导出</el-button>
+						<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleClean">清空</el-button>
+						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" style="margin-right: 10px">导出</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
@@ -72,7 +63,7 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row, scope.index)" v-hasPermi="['monitor:operlog:query']">详细</el-button>
+							<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row, scope.index)">详细</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -124,121 +115,121 @@
 </template>
 
 <script>
-	import { list, delOperlog, cleanOperlog } from '@/api/monitor/operlog'
+import { list, delOperlog, cleanOperlog } from '@/api/monitor/operlog'
 
-	export default {
-		name: 'Operlog',
-		dicts: ['sys_oper_type', 'sys_common_status'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 选中数组
-				ids: [],
-				// 非多个禁用
-				multiple: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 表格数据
-				list: [],
-				// 是否显示弹出层
-				open: false,
-				// 日期范围
-				dateRange: [],
-				// 默认排序
-				defaultSort: { prop: 'operTime', order: 'descending' },
-				// 表单参数
-				form: {},
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					title: undefined,
-					operName: undefined,
-					businessType: undefined,
-					status: undefined
-				}
+export default {
+	name: 'Operlog',
+	dicts: ['sys_oper_type', 'sys_common_status'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 选中数组
+			ids: [],
+			// 非多个禁用
+			multiple: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 表格数据
+			list: [],
+			// 是否显示弹出层
+			open: false,
+			// 日期范围
+			dateRange: [],
+			// 默认排序
+			defaultSort: { prop: 'operTime', order: 'descending' },
+			// 表单参数
+			form: {},
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				title: undefined,
+				operName: undefined,
+				businessType: undefined,
+				status: undefined
 			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询登录日志 */
+		getList() {
+			this.loading = true
+			list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+				this.list = response.rows
+				this.total = response.total
+				this.loading = false
+			})
+		},
+		// 操作日志类型字典翻译
+		typeFormat(row, column) {
+			return this.selectDictLabel(this.dict.type.sys_oper_type, row.businessType)
+		},
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
+			this.getList()
+		},
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.dateRange = []
+			this.resetForm('queryForm')
+			this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
+			this.handleQuery()
 		},
-		created() {
+		/** 排序触发事件 */
+		handleSortChange(column, prop, order) {
+			this.queryParams.orderByColumn = column.prop
+			this.queryParams.isAsc = column.order
 			this.getList()
 		},
-		methods: {
-			/** 查询登录日志 */
-			getList() {
-				this.loading = true
-				list(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-					this.list = response.rows
-					this.total = response.total
-					this.loading = false
+		/** 详细按钮操作 */
+		handleView(row) {
+			this.open = true
+			this.form = row
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const operIds = row.operId || this.ids
+			this.$modal
+				.confirm('是否确认删除日志编号为"' + operIds + '"的数据项?')
+				.then(function () {
+					return delOperlog(operIds)
 				})
-			},
-			// 操作日志类型字典翻译
-			typeFormat(row, column) {
-				return this.selectDictLabel(this.dict.type.sys_oper_type, row.businessType)
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.dateRange = []
-				this.resetForm('queryForm')
-				this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
-				this.handleQuery()
-			},
-			/** 排序触发事件 */
-			handleSortChange(column, prop, order) {
-				this.queryParams.orderByColumn = column.prop
-				this.queryParams.isAsc = column.order
-				this.getList()
-			},
-			/** 详细按钮操作 */
-			handleView(row) {
-				this.open = true
-				this.form = row
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const operIds = row.operId || this.ids
-				this.$modal
-					.confirm('是否确认删除日志编号为"' + operIds + '"的数据项?')
-					.then(function () {
-						return delOperlog(operIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			},
-			/** 清空按钮操作 */
-			handleClean() {
-				this.$modal
-					.confirm('是否确认清空所有操作日志数据项?')
-					.then(function () {
-						return cleanOperlog()
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('清空成功')
-					})
-					.catch(() => {})
-			},
-			/** 导出按钮操作 */
-			handleExport() {
-				this.download(
-					'monitor/operlog/export',
-					{
-						...this.queryParams
-					},
-					`operlog_${new Date().getTime()}.xlsx`
-				)
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
+				})
+				.catch(() => {})
+		},
+		/** 清空按钮操作 */
+		handleClean() {
+			this.$modal
+				.confirm('是否确认清空所有操作日志数据项?')
+				.then(function () {
+					return cleanOperlog()
+				})
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('清空成功')
+				})
+				.catch(() => {})
+		},
+		/** 导出按钮操作 */
+		handleExport() {
+			this.download(
+				'monitor/operlog/export',
+				{
+					...this.queryParams
+				},
+				`operlog_${new Date().getTime()}.xlsx`
+			)
 		}
 	}
+}
 </script>

+ 149 - 160
src/views/system/config/index.vue

@@ -14,16 +14,7 @@
 					</el-select>
 				</el-form-item>
 				<el-form-item label="创建时间">
-					<el-date-picker
-						v-model="dateRange"
-						size="small"
-						style="width: 240px"
-						value-format="yyyy-MM-dd"
-						type="daterange"
-						range-separator="-"
-						start-placeholder="开始日期"
-						end-placeholder="结束日期"
-					></el-date-picker>
+					<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
 				</el-form-item>
 				<el-form-item>
 					<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
@@ -38,11 +29,9 @@
 						<div class="tag">参数设置</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:config:add']">添加</el-button>
-						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:config:export']">导出</el-button>
-						<el-button type="danger" plain icon="el-icon-refresh" size="mini" @click="handleRefreshCache" v-hasPermi="['system:config:remove']" style="margin-right: 10px"
-							>刷新缓存</el-button
-						>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
+						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
+						<el-button type="danger" plain icon="el-icon-refresh" size="mini" @click="handleRefreshCache" style="margin-right: 10px">刷新缓存</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
@@ -64,8 +53,8 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:config:edit']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:config:remove']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -104,158 +93,158 @@
 </template>
 
 <script>
-	import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from '@/api/system/config'
+import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from '@/api/system/config'
 
-	export default {
-		name: 'Config',
-		dicts: ['sys_yes_no'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 选中数组
-				ids: [],
-				// 非单个禁用
-				single: true,
-				// 非多个禁用
-				multiple: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 参数表格数据
-				configList: [],
-				// 弹出层标题
-				title: '',
-				// 是否显示弹出层
-				open: false,
-				// 日期范围
-				dateRange: [],
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					configName: undefined,
-					configKey: undefined,
-					configType: undefined
-				},
-				// 表单参数
-				form: {},
-				// 表单校验
-				rules: {
-					configName: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }],
-					configKey: [{ required: true, message: '参数键名不能为空', trigger: 'blur' }],
-					configValue: [{ required: true, message: '参数键值不能为空', trigger: 'blur' }]
-				}
+export default {
+	name: 'Config',
+	dicts: ['sys_yes_no'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 选中数组
+			ids: [],
+			// 非单个禁用
+			single: true,
+			// 非多个禁用
+			multiple: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 参数表格数据
+			configList: [],
+			// 弹出层标题
+			title: '',
+			// 是否显示弹出层
+			open: false,
+			// 日期范围
+			dateRange: [],
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				configName: undefined,
+				configKey: undefined,
+				configType: undefined
+			},
+			// 表单参数
+			form: {},
+			// 表单校验
+			rules: {
+				configName: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }],
+				configKey: [{ required: true, message: '参数键名不能为空', trigger: 'blur' }],
+				configValue: [{ required: true, message: '参数键值不能为空', trigger: 'blur' }]
+			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询参数列表 */
+		getList() {
+			this.loading = true
+			listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+				this.configList = response.rows
+				this.total = response.total
+				this.loading = false
+			})
+		},
+		// 取消按钮
+		cancel() {
+			this.open = false
+			this.reset()
+		},
+		// 表单重置
+		reset() {
+			this.form = {
+				configId: undefined,
+				configName: undefined,
+				configKey: undefined,
+				configValue: undefined,
+				configType: 'Y',
+				remark: undefined
 			}
+			this.resetForm('form')
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
 			this.getList()
 		},
-		methods: {
-			/** 查询参数列表 */
-			getList() {
-				this.loading = true
-				listConfig(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-					this.configList = response.rows
-					this.total = response.total
-					this.loading = false
-				})
-			},
-			// 取消按钮
-			cancel() {
-				this.open = false
-				this.reset()
-			},
-			// 表单重置
-			reset() {
-				this.form = {
-					configId: undefined,
-					configName: undefined,
-					configKey: undefined,
-					configValue: undefined,
-					configType: 'Y',
-					remark: undefined
-				}
-				this.resetForm('form')
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.dateRange = []
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			/** 新增按钮操作 */
-			handleAdd() {
-				this.reset()
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.dateRange = []
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		/** 新增按钮操作 */
+		handleAdd() {
+			this.reset()
+			this.open = true
+			this.title = '添加参数'
+		},
+		/** 修改按钮操作 */
+		handleUpdate(row) {
+			this.reset()
+			const configId = row.configId || this.ids
+			getConfig(configId).then(response => {
+				this.form = response.data
 				this.open = true
-				this.title = '添加参数'
-			},
-			/** 修改按钮操作 */
-			handleUpdate(row) {
-				this.reset()
-				const configId = row.configId || this.ids
-				getConfig(configId).then((response) => {
-					this.form = response.data
-					this.open = true
-					this.title = '修改参数'
-				})
-			},
-			/** 提交按钮 */
-			submitForm: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.configId != undefined) {
-							updateConfig(this.form).then((response) => {
-								this.$modal.msgSuccess('修改成功')
-								this.open = false
-								this.getList()
-							})
-						} else {
-							addConfig(this.form).then((response) => {
-								this.$modal.msgSuccess('新增成功')
-								this.open = false
-								this.getList()
-							})
-						}
+				this.title = '修改参数'
+			})
+		},
+		/** 提交按钮 */
+		submitForm: function () {
+			this.$refs['form'].validate(valid => {
+				if (valid) {
+					if (this.form.configId != undefined) {
+						updateConfig(this.form).then(response => {
+							this.$modal.msgSuccess('修改成功')
+							this.open = false
+							this.getList()
+						})
+					} else {
+						addConfig(this.form).then(response => {
+							this.$modal.msgSuccess('新增成功')
+							this.open = false
+							this.getList()
+						})
 					}
+				}
+			})
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const configIds = row.configId || this.ids
+			this.$modal
+				.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?')
+				.then(function () {
+					return delConfig(configIds)
 				})
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const configIds = row.configId || this.ids
-				this.$modal
-					.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?')
-					.then(function () {
-						return delConfig(configIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			},
-			/** 导出按钮操作 */
-			handleExport() {
-				this.download(
-					'system/config/export',
-					{
-						...this.queryParams
-					},
-					`config_${new Date().getTime()}.xlsx`
-				)
-			},
-			/** 刷新缓存按钮操作 */
-			handleRefreshCache() {
-				refreshCache().then(() => {
-					this.$modal.msgSuccess('刷新成功')
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
 				})
-			}
+				.catch(() => {})
+		},
+		/** 导出按钮操作 */
+		handleExport() {
+			this.download(
+				'system/config/export',
+				{
+					...this.queryParams
+				},
+				`config_${new Date().getTime()}.xlsx`
+			)
+		},
+		/** 刷新缓存按钮操作 */
+		handleRefreshCache() {
+			refreshCache().then(() => {
+				this.$modal.msgSuccess('刷新成功')
+			})
 		}
 	}
+}
 </script>

+ 0 - 282
src/views/system/dataPermissions/index.vue

@@ -1,282 +0,0 @@
-<template>
-	<div class="page-container">
-		<div class="content-container">
-			<div class="main">
-				<div class="table-nav">
-					<div class="tags">
-						<div class="tag" :style="isActive(1)" @click="toTab1">数据角色</div>
-						<div class="tag" :style="isActive(2)" @click="toTab2">数据权限</div>
-					</div>
-					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini " v-show="tabIndex == 1" @click="addRole" v-hasPermi="['system:dataPermissions:addRole']">添加</el-button>
-					</div>
-				</div>
-				<!-- 数据角色表格 -->
-				<el-table v-loading="loading" :data="roleList" border highlight-current-row @current-change="rowHandler" :cell-style="{ cursor: 'pointer' }" v-show="tabIndex == 1">
-					<el-table-column label="名称" prop="dataRoleName" width="200">
-						<template slot-scope="scope">
-							<a href="javascript:void(0);" class="linked" @click="toTab2">{{ scope.row.dataRoleName }}</a>
-						</template>
-					</el-table-column>
-					<el-table-column label="描述" prop="remark" />
-					<el-table-column label="创建时间" prop="createTime" width="200" align="center" />
-					<el-table-column label="操作" class-name="small-padding fixed-width" width="300" align="center">
-						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="updRole(scope.row)" v-hasPermi="['	system:dataPermissions:updRole']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="delRole(scope.row)" v-hasPermi="['system:dataPermissions:delRole']">删除</el-button>
-							<el-button size="mini" type="text" icon="el-icon-remove" @click.stop="setRole(scope.row)" v-hasPermi="['system:dataPermissions:disabledRole']" v-if="scope.row.status == 0"
-								>禁用</el-button
-							>
-							<el-button
-								size="mini"
-								type="text"
-								icon="el-icon-circle-plus"
-								@click.stop="setRole(scope.row)"
-								v-hasPermi="['system:dataPermissions:disabledRole']"
-								v-if="scope.row.status == 1"
-								>启用</el-button
-							>
-						</template>
-					</el-table-column>
-				</el-table>
-				<pagination v-show="roleTotal > 0 && tabIndex == 1" :total="roleTotal" :page.sync="roleParams.pageNum" :limit.sync="roleParams.pageSize" @pagination="getRoleList" />
-				<!-- 数据权限表格 -->
-				<el-table
-					v-loading="loading"
-					:data="deptTreeList"
-					border
-					highlight-current-row
-					row-key="id"
-					:default-expand-all="true"
-					:cell-style="{ cursor: 'pointer' }"
-					:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
-					v-show="tabIndex == 2"
-				>
-					<el-table-column label="机构名称" prop="label" />
-					<el-table-column label="数据权限" class-name="small-padding fixed-width" width="300" align="center">
-						<template slot-scope="scope">
-							<input type="checkbox" :checked="authIds.includes(scope.row.id)" @change="checkboxClick(scope.row, $event)" :disabled="!checkPermi(['system:dataPermissions:updAuth'])" />
-						</template>
-					</el-table-column>
-				</el-table>
-				<!-- 编辑数据角色 -->
-				<el-dialog :title="roleTitle" :visible.sync="roleShow" width="30%">
-					<el-form ref="roleForm" :model="roleForm" :rules="roleRules" label-width="100px">
-						<el-form-item label="名称" prop="dataRoleName">
-							<div style="width: 200px"><el-input v-model="roleForm.dataRoleName" placeholder="请输入名称" /></div>
-						</el-form-item>
-						<el-form-item label="描述" prop="remark">
-							<div style="width: 300px"><el-input maxlength="80" v-model="roleForm.remark" placeholder="请输入描述" /></div>
-						</el-form-item>
-					</el-form>
-					<div slot="footer" class="dialog-footer">
-						<el-button size="small" @click="roleCancel">取 消</el-button>
-						<el-button type="primary" size="small" @click="roleSub">保 存</el-button>
-					</div>
-				</el-dialog>
-			</div>
-		</div>
-	</div>
-</template>
-
-<script>
-	import { roleAdd, roleList, roleUpd, roleDel, roleStatus, authUpd, deptList } from '@/api/system/dataPermissions.js'
-	import { checkPermi } from '@/utils/permission'
-	export default {
-		name: 'dataPermissions',
-		data() {
-			return {
-				loading: false,
-				//tab索引
-				tabIndex: 1,
-				//角色数据
-				roleList: [],
-				//角色弹窗
-				roleShow: false,
-				//角色表单
-				roleForm: {
-					//角色名称
-					dataRoleName: '',
-					//角色描述
-					remark: ''
-				},
-				//角色表单验证
-				roleRules: {
-					dataRoleName: [{ required: true, message: '名称不能为空', trigger: 'submit' }]
-				},
-				//角色总条数
-				roleTotal: 0,
-				// 角色查询参数
-				roleParams: {
-					pageNum: 1,
-					pageSize: 10
-				},
-				//权限数据ids
-				authIds: [],
-				//部门数据
-				deptList: [],
-				//选中的角色id
-				dataRoleId: 0,
-				//弹窗标题
-				roleTitle: ''
-			}
-		},
-		created() {
-			this.getRoleList()
-			deptList().then((res) => {
-				if (res.code === 200) {
-					this.deptList = res.data
-				}
-			})
-		},
-		computed: {
-			theme() {
-				return this.$store.state.settings.theme
-			},
-			deptTreeList() {
-				return this.dataRoleId ? this.deptList : []
-			}
-		},
-		methods: {
-			checkPermi,
-			//动态选中样式
-			isActive(index) {
-				if (this.tabIndex != index) return {}
-				return {
-					color: this.theme
-				}
-			},
-			//跳转到tab1
-			toTab1() {
-				this.tabIndex = 1
-			},
-			//跳转到tab2
-			toTab2() {
-				this.tabIndex = 2
-			},
-			//获取角色数据
-			getRoleList() {
-				if (!checkPermi(['system:dataPermissions:listRole'])) {
-					return
-				}
-				roleList(this.roleParams).then((res) => {
-					if (res.code === 200) {
-						this.roleList = res.rows
-						this.roleTotal = res.total
-					}
-				})
-			},
-			//添加角色
-			addRole() {
-				this.roleShow = true
-				this.roleTitle = '角色添加'
-			},
-			//数据角色行选中
-			rowHandler(e) {
-				this.dataRoleId = e.dataRoleId
-				if (e.deptIds && e.deptIds != '') {
-					this.authIds = e.deptIds.split(',')
-				} else {
-					this.authIds = []
-				}
-			},
-			//角色弹窗取消
-			roleCancel() {
-				this.resetRoleForm()
-				this.roleShow = false
-			},
-			//角色弹窗提交
-			roleSub() {
-				this.$refs.roleForm.validate((valid) => {
-					if (valid) {
-						if (this.roleForm.dataRoleId) {
-							roleUpd(this.roleForm).then((res) => {
-								if (res.code == 200) {
-									this.$msg({ message: '修改成功' })
-									this.roleCancel()
-									this.getRoleList()
-								}
-							})
-						} else {
-							roleAdd(this.roleForm).then((res) => {
-								if (res.code == 200) {
-									this.$msg({ message: '添加成功' })
-									this.roleCancel()
-									this.getRoleList()
-								}
-							})
-						}
-					} else {
-						return false
-					}
-				})
-			},
-			//角色表单重置,
-			resetRoleForm() {
-				this.roleForm = {
-					//角色名称
-					dataRoleName: '',
-					//角色描述
-					remark: ''
-				}
-			},
-			//修改角色
-			updRole(row) {
-				this.roleForm.dataRoleName = row.dataRoleName
-				this.roleForm.remark = row.remark
-				this.roleForm.dataRoleId = row.dataRoleId
-				this.roleTitle = '角色修改'
-				this.roleShow = true
-			},
-			//删除角色
-			delRole(row) {
-				this.$modal
-					.confirm('确定要删除吗')
-					.then(() => {
-						roleDel(row.dataRoleId).then((res) => {
-							if (res.code == 200) {
-								this.$msg({ message: '删除成功' })
-								this.getRoleList()
-							}
-						})
-					})
-					.catch(() => {})
-			},
-			//角色禁用
-			setRole(row) {
-				roleStatus({
-					dataRoleId: row.dataRoleId,
-					status: Math.abs(row.status - 1)
-				}).then((res) => {
-					if (res.code === 200) {
-						this.$msg({ message: '操作成功' })
-						row.status = Math.abs(row.status - 1)
-					}
-				})
-			},
-			//编辑权限
-			checkboxClick(d, e) {
-				let status = e.target.checked
-				let ids = [...this.authIds]
-				if (status) {
-					ids.push(d.id)
-				} else {
-					ids = ids.filter((item) => item != d.id)
-				}
-				authUpd({ dataRoleId: this.dataRoleId, deptIds: ids.join(',') }).then((res) => {
-					if (res.code === 200) {
-						if (status) {
-							this.authIds.push(d.id)
-						} else {
-							this.authIds = this.authIds.filter((item) => item != d.id)
-						}
-						let row = this.roleList.find((item) => item.dataRoleId == this.dataRoleId)
-						row.deptIds = this.authIds.join(',')
-					}
-				})
-			}
-		}
-	}
-</script>
-
-<style></style>

+ 167 - 177
src/views/system/dept/index.vue

@@ -23,20 +23,12 @@
 						<div class="tag">部门管理</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dept:add']">添加</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
 						<el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll" style="margin-right: 10px">展开/折叠</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
-				<el-table
-					v-if="refreshTable"
-					v-loading="loading"
-					border
-					:data="deptList"
-					row-key="deptId"
-					:default-expand-all="isExpandAll"
-					:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
-				>
+				<el-table v-if="refreshTable" v-loading="loading" border :data="deptList" row-key="deptId" :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
 					<el-table-column prop="deptName" label="部门名称"></el-table-column>
 					<el-table-column prop="orderNum" align="center" label="排序"></el-table-column>
 					<el-table-column prop="status" align="center" label="状态">
@@ -51,11 +43,9 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dept:edit']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']">新增</el-button>
-							<el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']"
-								>删除</el-button
-							>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)">新增</el-button>
+							<el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -114,177 +104,177 @@
 </template>
 
 <script>
-	import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from '@/api/system/dept'
-	import Treeselect from '@riophae/vue-treeselect'
-	import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from '@/api/system/dept'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 
-	export default {
-		name: 'Dept',
-		dicts: ['sys_normal_disable'],
-		components: { Treeselect },
-		data() {
+export default {
+	name: 'Dept',
+	dicts: ['sys_normal_disable'],
+	components: { Treeselect },
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 表格树数据
+			deptList: [],
+			// 部门树选项
+			deptOptions: [],
+			// 弹出层标题
+			title: '',
+			// 是否显示弹出层
+			open: false,
+			// 是否展开,默认全部展开
+			isExpandAll: true,
+			// 重新渲染表格状态
+			refreshTable: true,
+			// 查询参数
+			queryParams: {
+				deptName: undefined,
+				status: undefined
+			},
+			// 表单参数
+			form: {},
+			// 表单校验
+			rules: {
+				parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
+				deptName: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
+				orderNum: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],
+				email: [
+					{
+						type: 'email',
+						message: "'请输入正确的邮箱地址",
+						trigger: ['blur', 'change']
+					}
+				],
+				phone: [
+					{
+						pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+						message: '请输入正确的手机号码',
+						trigger: 'blur'
+					}
+				]
+			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询部门列表 */
+		getList() {
+			this.loading = true
+			listDept(this.queryParams).then(response => {
+				this.deptList = this.handleTree(response.data, 'deptId')
+				this.loading = false
+			})
+		},
+		/** 转换部门数据结构 */
+		normalizer(node) {
+			if (node.children && !node.children.length) {
+				delete node.children
+			}
 			return {
-				// 遮罩层
-				loading: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 表格树数据
-				deptList: [],
-				// 部门树选项
-				deptOptions: [],
-				// 弹出层标题
-				title: '',
-				// 是否显示弹出层
-				open: false,
-				// 是否展开,默认全部展开
-				isExpandAll: true,
-				// 重新渲染表格状态
-				refreshTable: true,
-				// 查询参数
-				queryParams: {
-					deptName: undefined,
-					status: undefined
-				},
-				// 表单参数
-				form: {},
-				// 表单校验
-				rules: {
-					parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
-					deptName: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
-					orderNum: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],
-					email: [
-						{
-							type: 'email',
-							message: "'请输入正确的邮箱地址",
-							trigger: ['blur', 'change']
-						}
-					],
-					phone: [
-						{
-							pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-							message: '请输入正确的手机号码',
-							trigger: 'blur'
-						}
-					]
-				}
+				id: node.deptId,
+				label: node.deptName,
+				children: node.children
+			}
+		},
+		// 取消按钮
+		cancel() {
+			this.open = false
+			this.reset()
+		},
+		// 表单重置
+		reset() {
+			this.form = {
+				deptId: undefined,
+				parentId: undefined,
+				deptName: undefined,
+				orderNum: undefined,
+				leader: undefined,
+				phone: undefined,
+				email: undefined,
+				status: '0'
 			}
+			this.resetForm('form')
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
 			this.getList()
 		},
-		methods: {
-			/** 查询部门列表 */
-			getList() {
-				this.loading = true
-				listDept(this.queryParams).then((response) => {
-					this.deptList = this.handleTree(response.data, 'deptId')
-					this.loading = false
-				})
-			},
-			/** 转换部门数据结构 */
-			normalizer(node) {
-				if (node.children && !node.children.length) {
-					delete node.children
-				}
-				return {
-					id: node.deptId,
-					label: node.deptName,
-					children: node.children
-				}
-			},
-			// 取消按钮
-			cancel() {
-				this.open = false
-				this.reset()
-			},
-			// 表单重置
-			reset() {
-				this.form = {
-					deptId: undefined,
-					parentId: undefined,
-					deptName: undefined,
-					orderNum: undefined,
-					leader: undefined,
-					phone: undefined,
-					email: undefined,
-					status: '0'
-				}
-				this.resetForm('form')
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			/** 新增按钮操作 */
-			handleAdd(row) {
-				this.reset()
-				if (row != undefined) {
-					this.form.parentId = row.deptId
-				}
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		/** 新增按钮操作 */
+		handleAdd(row) {
+			this.reset()
+			if (row != undefined) {
+				this.form.parentId = row.deptId
+			}
+			this.open = true
+			this.title = '添加部门'
+			listDept().then(response => {
+				this.deptOptions = this.handleTree(response.data, 'deptId')
+			})
+		},
+		/** 展开/折叠操作 */
+		toggleExpandAll() {
+			this.refreshTable = false
+			this.isExpandAll = !this.isExpandAll
+			this.$nextTick(() => {
+				this.refreshTable = true
+			})
+		},
+		/** 修改按钮操作 */
+		handleUpdate(row) {
+			this.reset()
+			getDept(row.deptId).then(response => {
+				this.form = response.data
 				this.open = true
-				this.title = '添加部门'
-				listDept().then((response) => {
-					this.deptOptions = this.handleTree(response.data, 'deptId')
-				})
-			},
-			/** 展开/折叠操作 */
-			toggleExpandAll() {
-				this.refreshTable = false
-				this.isExpandAll = !this.isExpandAll
-				this.$nextTick(() => {
-					this.refreshTable = true
-				})
-			},
-			/** 修改按钮操作 */
-			handleUpdate(row) {
-				this.reset()
-				getDept(row.deptId).then((response) => {
-					this.form = response.data
-					this.open = true
-					this.title = '修改部门'
-				})
-				listDeptExcludeChild(row.deptId).then((response) => {
-					this.deptOptions = this.handleTree(response.data, 'deptId')
-				})
-			},
-			/** 提交按钮 */
-			submitForm: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.deptId != undefined) {
-							updateDept(this.form).then((response) => {
-								this.$modal.msgSuccess('修改成功')
-								this.open = false
-								this.getList()
-							})
-						} else {
-							addDept(this.form).then((response) => {
-								this.$modal.msgSuccess('新增成功')
-								this.open = false
-								this.getList()
-							})
-						}
+				this.title = '修改部门'
+			})
+			listDeptExcludeChild(row.deptId).then(response => {
+				this.deptOptions = this.handleTree(response.data, 'deptId')
+			})
+		},
+		/** 提交按钮 */
+		submitForm: function () {
+			this.$refs['form'].validate(valid => {
+				if (valid) {
+					if (this.form.deptId != undefined) {
+						updateDept(this.form).then(response => {
+							this.$modal.msgSuccess('修改成功')
+							this.open = false
+							this.getList()
+						})
+					} else {
+						addDept(this.form).then(response => {
+							this.$modal.msgSuccess('新增成功')
+							this.open = false
+							this.getList()
+						})
 					}
+				}
+			})
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			this.$modal
+				.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?')
+				.then(function () {
+					return delDept(row.deptId)
 				})
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				this.$modal
-					.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?')
-					.then(function () {
-						return delDept(row.deptId)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
+				})
+				.catch(() => {})
 		}
 	}
+}
 </script>

+ 195 - 195
src/views/system/dict/data.vue

@@ -28,8 +28,8 @@
 						<div class="tag">字典数据</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']">添加</el-button>
-						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:dict:export']">导出</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
+						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
 						<el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose" style="margin-right: 10px">关闭</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
@@ -57,8 +57,8 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -108,206 +108,206 @@
 </template>
 
 <script>
-	import { listData, getData, delData, addData, updateData } from '@/api/system/dict/data'
-	import { listType, getType } from '@/api/system/dict/type'
+import { listData, getData, delData, addData, updateData } from '@/api/system/dict/data'
+import { listType, getType } from '@/api/system/dict/type'
 
-	export default {
-		name: 'Data',
-		dicts: ['sys_normal_disable'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 选中数组
-				ids: [],
-				// 非单个禁用
-				single: true,
-				// 非多个禁用
-				multiple: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 字典表格数据
-				dataList: [],
-				// 默认字典类型
-				defaultDictType: '',
-				// 弹出层标题
-				title: '',
-				// 是否显示弹出层
-				open: false,
-				// 数据标签回显样式
-				listClassOptions: [
-					{
-						value: 'default',
-						label: '默认'
-					},
-					{
-						value: 'primary',
-						label: '主要'
-					},
-					{
-						value: 'success',
-						label: '成功'
-					},
-					{
-						value: 'info',
-						label: '信息'
-					},
-					{
-						value: 'warning',
-						label: '警告'
-					},
-					{
-						value: 'danger',
-						label: '危险'
-					}
-				],
-				// 类型数据字典
-				typeOptions: [],
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					dictName: undefined,
-					dictType: undefined,
-					status: undefined
+export default {
+	name: 'Data',
+	dicts: ['sys_normal_disable'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 选中数组
+			ids: [],
+			// 非单个禁用
+			single: true,
+			// 非多个禁用
+			multiple: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 字典表格数据
+			dataList: [],
+			// 默认字典类型
+			defaultDictType: '',
+			// 弹出层标题
+			title: '',
+			// 是否显示弹出层
+			open: false,
+			// 数据标签回显样式
+			listClassOptions: [
+				{
+					value: 'default',
+					label: '默认'
+				},
+				{
+					value: 'primary',
+					label: '主要'
+				},
+				{
+					value: 'success',
+					label: '成功'
 				},
-				// 表单参数
-				form: {},
-				// 表单校验
-				rules: {
-					dictLabel: [{ required: true, message: '数据标签不能为空', trigger: 'blur' }],
-					dictValue: [{ required: true, message: '数据键值不能为空', trigger: 'blur' }],
-					dictSort: [{ required: true, message: '数据顺序不能为空', trigger: 'blur' }]
+				{
+					value: 'info',
+					label: '信息'
+				},
+				{
+					value: 'warning',
+					label: '警告'
+				},
+				{
+					value: 'danger',
+					label: '危险'
 				}
+			],
+			// 类型数据字典
+			typeOptions: [],
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				dictName: undefined,
+				dictType: undefined,
+				status: undefined
+			},
+			// 表单参数
+			form: {},
+			// 表单校验
+			rules: {
+				dictLabel: [{ required: true, message: '数据标签不能为空', trigger: 'blur' }],
+				dictValue: [{ required: true, message: '数据键值不能为空', trigger: 'blur' }],
+				dictSort: [{ required: true, message: '数据顺序不能为空', trigger: 'blur' }]
 			}
+		}
+	},
+	created() {
+		const dictId = this.$route.params && this.$route.params.dictId
+		this.getType(dictId)
+		this.getTypeList()
+	},
+	methods: {
+		/** 查询字典类型详细 */
+		getType(dictId) {
+			getType(dictId).then(response => {
+				this.queryParams.dictType = response.data.dictType
+				this.defaultDictType = response.data.dictType
+				this.getList()
+			})
 		},
-		created() {
-			const dictId = this.$route.params && this.$route.params.dictId
-			this.getType(dictId)
-			this.getTypeList()
+		/** 查询字典类型列表 */
+		getTypeList() {
+			listType().then(response => {
+				this.typeOptions = response.rows
+			})
 		},
-		methods: {
-			/** 查询字典类型详细 */
-			getType(dictId) {
-				getType(dictId).then((response) => {
-					this.queryParams.dictType = response.data.dictType
-					this.defaultDictType = response.data.dictType
-					this.getList()
-				})
-			},
-			/** 查询字典类型列表 */
-			getTypeList() {
-				listType().then((response) => {
-					this.typeOptions = response.rows
-				})
-			},
-			/** 查询字典数据列表 */
-			getList() {
-				this.loading = true
-				listData(this.queryParams).then((response) => {
-					this.dataList = response.rows
-					this.total = response.total
-					this.loading = false
-				})
-			},
-			// 取消按钮
-			cancel() {
-				this.open = false
-				this.reset()
-			},
-			// 表单重置
-			reset() {
-				this.form = {
-					dictCode: undefined,
-					dictLabel: undefined,
-					dictValue: undefined,
-					cssClass: undefined,
-					listClass: 'default',
-					dictSort: 0,
-					status: '0',
-					remark: undefined
-				}
-				this.resetForm('form')
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 返回按钮操作 */
-			handleClose() {
-				const obj = { path: '/system/dict' }
-				this.$tab.closeOpenPage(obj)
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.resetForm('queryForm')
-				this.queryParams.dictType = this.defaultDictType
-				this.handleQuery()
-			},
-			/** 新增按钮操作 */
-			handleAdd() {
-				this.reset()
+		/** 查询字典数据列表 */
+		getList() {
+			this.loading = true
+			listData(this.queryParams).then(response => {
+				this.dataList = response.rows
+				this.total = response.total
+				this.loading = false
+			})
+		},
+		// 取消按钮
+		cancel() {
+			this.open = false
+			this.reset()
+		},
+		// 表单重置
+		reset() {
+			this.form = {
+				dictCode: undefined,
+				dictLabel: undefined,
+				dictValue: undefined,
+				cssClass: undefined,
+				listClass: 'default',
+				dictSort: 0,
+				status: '0',
+				remark: undefined
+			}
+			this.resetForm('form')
+		},
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
+			this.getList()
+		},
+		/** 返回按钮操作 */
+		handleClose() {
+			const obj = { path: '/system/dict' }
+			this.$tab.closeOpenPage(obj)
+		},
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.resetForm('queryForm')
+			this.queryParams.dictType = this.defaultDictType
+			this.handleQuery()
+		},
+		/** 新增按钮操作 */
+		handleAdd() {
+			this.reset()
+			this.open = true
+			this.title = '添加字典数据'
+			this.form.dictType = this.queryParams.dictType
+		},
+		/** 修改按钮操作 */
+		handleUpdate(row) {
+			this.reset()
+			const dictCode = row.dictCode || this.ids
+			getData(dictCode).then(response => {
+				this.form = response.data
 				this.open = true
-				this.title = '添加字典数据'
-				this.form.dictType = this.queryParams.dictType
-			},
-			/** 修改按钮操作 */
-			handleUpdate(row) {
-				this.reset()
-				const dictCode = row.dictCode || this.ids
-				getData(dictCode).then((response) => {
-					this.form = response.data
-					this.open = true
-					this.title = '修改字典数据'
-				})
-			},
-			/** 提交按钮 */
-			submitForm: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.dictCode != undefined) {
-							updateData(this.form).then((response) => {
-								this.$modal.msgSuccess('修改成功')
-								this.open = false
-								this.getList()
-							})
-						} else {
-							addData(this.form).then((response) => {
-								this.$modal.msgSuccess('新增成功')
-								this.open = false
-								this.getList()
-							})
-						}
+				this.title = '修改字典数据'
+			})
+		},
+		/** 提交按钮 */
+		submitForm: function () {
+			this.$refs['form'].validate(valid => {
+				if (valid) {
+					if (this.form.dictCode != undefined) {
+						updateData(this.form).then(response => {
+							this.$modal.msgSuccess('修改成功')
+							this.open = false
+							this.getList()
+						})
+					} else {
+						addData(this.form).then(response => {
+							this.$modal.msgSuccess('新增成功')
+							this.open = false
+							this.getList()
+						})
 					}
+				}
+			})
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const dictCodes = row.dictCode || this.ids
+			this.$modal
+				.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?')
+				.then(function () {
+					return delData(dictCodes)
 				})
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const dictCodes = row.dictCode || this.ids
-				this.$modal
-					.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?')
-					.then(function () {
-						return delData(dictCodes)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			},
-			/** 导出按钮操作 */
-			handleExport() {
-				this.download(
-					'system/dict/data/export',
-					{
-						...this.queryParams
-					},
-					`data_${new Date().getTime()}.xlsx`
-				)
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
+				})
+				.catch(() => {})
+		},
+		/** 导出按钮操作 */
+		handleExport() {
+			this.download(
+				'system/dict/data/export',
+				{
+					...this.queryParams
+				},
+				`data_${new Date().getTime()}.xlsx`
+			)
 		}
 	}
+}
 </script>

+ 147 - 158
src/views/system/dict/index.vue

@@ -14,16 +14,7 @@
 					</el-select>
 				</el-form-item>
 				<el-form-item label="创建时间">
-					<el-date-picker
-						v-model="dateRange"
-						size="small"
-						style="width: 240px"
-						value-format="yyyy-MM-dd"
-						type="daterange"
-						range-separator="-"
-						start-placeholder="开始日期"
-						end-placeholder="结束日期"
-					></el-date-picker>
+					<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
 				</el-form-item>
 				<el-form-item>
 					<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
@@ -38,11 +29,9 @@
 						<div class="tag">字典管理</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']">添加</el-button>
-						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:dict:export']">导出</el-button>
-						<el-button type="danger" plain icon="el-icon-refresh" size="mini" @click="handleRefreshCache" v-hasPermi="['system:dict:remove']" style="margin-right: 10px"
-							>刷新缓存</el-button
-						>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
+						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
+						<el-button type="danger" plain icon="el-icon-refresh" size="mini" @click="handleRefreshCache" style="margin-right: 10px">刷新缓存</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
@@ -69,8 +58,8 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -106,156 +95,156 @@
 </template>
 
 <script>
-	import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type'
+import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type'
 
-	export default {
-		name: 'Dict',
-		dicts: ['sys_normal_disable'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 选中数组
-				ids: [],
-				// 非单个禁用
-				single: true,
-				// 非多个禁用
-				multiple: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 字典表格数据
-				typeList: [],
-				// 弹出层标题
-				title: '',
-				// 是否显示弹出层
-				open: false,
-				// 日期范围
-				dateRange: [],
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					dictName: undefined,
-					dictType: undefined,
-					status: undefined
-				},
-				// 表单参数
-				form: {},
-				// 表单校验
-				rules: {
-					dictName: [{ required: true, message: '字典名称不能为空', trigger: 'blur' }],
-					dictType: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }]
-				}
+export default {
+	name: 'Dict',
+	dicts: ['sys_normal_disable'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 选中数组
+			ids: [],
+			// 非单个禁用
+			single: true,
+			// 非多个禁用
+			multiple: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 字典表格数据
+			typeList: [],
+			// 弹出层标题
+			title: '',
+			// 是否显示弹出层
+			open: false,
+			// 日期范围
+			dateRange: [],
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				dictName: undefined,
+				dictType: undefined,
+				status: undefined
+			},
+			// 表单参数
+			form: {},
+			// 表单校验
+			rules: {
+				dictName: [{ required: true, message: '字典名称不能为空', trigger: 'blur' }],
+				dictType: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }]
+			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询字典类型列表 */
+		getList() {
+			this.loading = true
+			listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+				this.typeList = response.rows
+				this.total = response.total
+				this.loading = false
+			})
+		},
+		// 取消按钮
+		cancel() {
+			this.open = false
+			this.reset()
+		},
+		// 表单重置
+		reset() {
+			this.form = {
+				dictId: undefined,
+				dictName: undefined,
+				dictType: undefined,
+				status: '0',
+				remark: undefined
 			}
+			this.resetForm('form')
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
 			this.getList()
 		},
-		methods: {
-			/** 查询字典类型列表 */
-			getList() {
-				this.loading = true
-				listType(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-					this.typeList = response.rows
-					this.total = response.total
-					this.loading = false
-				})
-			},
-			// 取消按钮
-			cancel() {
-				this.open = false
-				this.reset()
-			},
-			// 表单重置
-			reset() {
-				this.form = {
-					dictId: undefined,
-					dictName: undefined,
-					dictType: undefined,
-					status: '0',
-					remark: undefined
-				}
-				this.resetForm('form')
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.dateRange = []
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			/** 新增按钮操作 */
-			handleAdd() {
-				this.reset()
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.dateRange = []
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		/** 新增按钮操作 */
+		handleAdd() {
+			this.reset()
+			this.open = true
+			this.title = '添加字典类型'
+		},
+		/** 修改按钮操作 */
+		handleUpdate(row) {
+			this.reset()
+			const dictId = row.dictId || this.ids
+			getType(dictId).then(response => {
+				this.form = response.data
 				this.open = true
-				this.title = '添加字典类型'
-			},
-			/** 修改按钮操作 */
-			handleUpdate(row) {
-				this.reset()
-				const dictId = row.dictId || this.ids
-				getType(dictId).then((response) => {
-					this.form = response.data
-					this.open = true
-					this.title = '修改字典类型'
-				})
-			},
-			/** 提交按钮 */
-			submitForm: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.dictId != undefined) {
-							updateType(this.form).then((response) => {
-								this.$modal.msgSuccess('修改成功')
-								this.open = false
-								this.getList()
-							})
-						} else {
-							addType(this.form).then((response) => {
-								this.$modal.msgSuccess('新增成功')
-								this.open = false
-								this.getList()
-							})
-						}
+				this.title = '修改字典类型'
+			})
+		},
+		/** 提交按钮 */
+		submitForm: function () {
+			this.$refs['form'].validate(valid => {
+				if (valid) {
+					if (this.form.dictId != undefined) {
+						updateType(this.form).then(response => {
+							this.$modal.msgSuccess('修改成功')
+							this.open = false
+							this.getList()
+						})
+					} else {
+						addType(this.form).then(response => {
+							this.$modal.msgSuccess('新增成功')
+							this.open = false
+							this.getList()
+						})
 					}
+				}
+			})
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const dictIds = row.dictId || this.ids
+			this.$modal
+				.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
+				.then(function () {
+					return delType(dictIds)
 				})
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const dictIds = row.dictId || this.ids
-				this.$modal
-					.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
-					.then(function () {
-						return delType(dictIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			},
-			/** 导出按钮操作 */
-			handleExport() {
-				this.download(
-					'system/dict/type/export',
-					{
-						...this.queryParams
-					},
-					`type_${new Date().getTime()}.xlsx`
-				)
-			},
-			/** 刷新缓存按钮操作 */
-			handleRefreshCache() {
-				refreshCache().then(() => {
-					this.$modal.msgSuccess('刷新成功')
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
 				})
-			}
+				.catch(() => {})
+		},
+		/** 导出按钮操作 */
+		handleExport() {
+			this.download(
+				'system/dict/type/export',
+				{
+					...this.queryParams
+				},
+				`type_${new Date().getTime()}.xlsx`
+			)
+		},
+		/** 刷新缓存按钮操作 */
+		handleRefreshCache() {
+			refreshCache().then(() => {
+				this.$modal.msgSuccess('刷新成功')
+			})
 		}
 	}
+}
 </script>

+ 57 - 88
src/views/system/employeenInfo/index.vue

@@ -20,7 +20,7 @@
 		</div>
 		<div class="content-container">
 			<!-- 公司部门 -->
-			<TreeChoice v-model="queryParams.deptIds" @click="deptClick" />
+			<TreeChoice :dataList="deptOptions" @itemClick="deptClick" />
 			<div class="main">
 				<div class="table-nav">
 					<div class="tags">
@@ -28,9 +28,9 @@
 					</div>
 					<!-- 操作 -->
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">添加</el-button>
-						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
-						<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:import']" style="margin-right: 10px">导入</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
+						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
+						<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" style="margin-right: 10px">导入</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
 					</div>
 				</div>
@@ -43,7 +43,7 @@
 					</el-table-column>
 					<el-table-column label="头像" align="center" v-if="columns[1].visible" width="60">
 						<template slot-scope="scope">
-							<img v-bind:src="scope.row.avatar" class="img-circle img_height" @click="modifyAvatar(scope.row)" />
+							<img v-bind:src="scope.row.avatar && $store.state.oss.ossBaseUrl + scope.row.avatar" class="img-circle img_height" @click="modifyAvatar(scope.row)" />
 						</template>
 					</el-table-column>
 					<el-table-column label="姓名" align="center" prop="realName" v-if="columns[2].visible" :show-overflow-tooltip="true" width="120" />
@@ -58,11 +58,11 @@
 					<el-table-column label="手机号码" align="center" prop="phoneNumber" v-if="columns[7].visible" width="150" />
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 						<template slot-scope="scope" v-if="scope.row.userId !== 1">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="getDutiesPowers(scope.row)" v-hasPermi="['system:user:edit']">职责权力</el-button>
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="getRolePermissions(scope.row)" v-hasPermi="['system:user:edit']">功能权限</el-button>
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="getDataRole(scope.row)" v-hasPermi="['system:user:edit']">数据权限</el-button>
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="getDutiesPowers(scope.row)">职责权力</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="getRolePermissions(scope.row)">功能权限</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="getDataRole(scope.row)">数据权限</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -124,45 +124,21 @@
 				<el-row>
 					<el-col :span="24">
 						<el-form-item label="公司部门" prop="deptIds">
-							<Treeselect
-								v-model="accountForm.deptIds"
-								noChildrenText="无数据"
-								:disable-branch-nodes="true"
-								search-nested
-								:options="deptOptions"
-								:multiple="true"
-								placeholder="选择公司部门"
-							/>
+							<Treeselect v-model="accountForm.deptIds" noChildrenText="无数据" :disable-branch-nodes="true" search-nested :options="deptOptions" :multiple="true" placeholder="选择公司部门" />
 						</el-form-item>
 					</el-col>
 				</el-row>
 				<el-row>
 					<el-col :span="24">
 						<el-form-item label="职称级别" prop="levelJobIds">
-							<Treeselect
-								v-model="accountForm.levelJobIds"
-								noChildrenText="无数据"
-								:disable-branch-nodes="true"
-								search-nested
-								:options="levelList"
-								:multiple="true"
-								placeholder="选择职称级别"
-							/>
+							<Treeselect v-model="accountForm.levelJobIds" noChildrenText="无数据" :disable-branch-nodes="true" search-nested :options="levelList" :multiple="true" placeholder="选择职称级别" />
 						</el-form-item>
 					</el-col>
 				</el-row>
 				<el-row>
 					<el-col :span="24">
 						<el-form-item label="性质岗位" prop="naturePostIds">
-							<Treeselect
-								v-model="accountForm.naturePostIds"
-								noChildrenText="无数据"
-								:disable-branch-nodes="true"
-								search-nested
-								:options="natureList"
-								:multiple="true"
-								placeholder="选择性质岗位"
-							/>
+							<Treeselect v-model="accountForm.naturePostIds" noChildrenText="无数据" :disable-branch-nodes="true" search-nested :options="natureList" :multiple="true" placeholder="选择性质岗位" />
 						</el-form-item>
 					</el-col>
 				</el-row>
@@ -293,9 +269,7 @@
 						</el-col>
 						<el-col :span="8">
 							<div style="margin-left: 40px">
-								<el-button class="addInfo" size="mini" type="primary" icon="el-icon-plus" @click="addDescription(item.id)" v-if="isLast(item.id)" :disabled="!isClick(item.id)"
-									>添加一条</el-button
-								>
+								<el-button class="addInfo" size="mini" type="primary" icon="el-icon-plus" @click="addDescription(item.id)" v-if="isLast(item.id)" :disabled="!isClick(item.id)">添加一条</el-button>
 								<el-button class="addInfo" size="mini" type="primary" icon="el-icon-plus" @click="delDescription(item.id)" v-if="item.id != 1">删除本条</el-button>
 							</div>
 						</el-col>
@@ -460,7 +434,7 @@
 				<i class="el-icon-upload"></i>
 				<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
 				<div class="el-upload__tip text-center" slot="tip">
-					<div class="el-upload__tip" slot="tip"> <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据 </div>
+					<div class="el-upload__tip" slot="tip"><el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据</div>
 					<span>仅允许导入xls、xlsx格式文件。</span>
 					<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
 				</div>
@@ -532,30 +506,17 @@
 		</el-dialog>
 
 		<!-- 修改头像对话框 -->
-		<userAvatar ref="userAvatar" />
+		<UploadOne title="上传头像" ref="uploadOne" @saveUrl="saveUrl" />
 	</div>
 </template>
 
 <script>
-import {
-	delUser,
-	addUser,
-	updateUser,
-	getStaffList,
-	getLevelTreeSelect,
-	getNatureTreeSelect,
-	getAuthRole,
-	updateAuthRole,
-	getDataRole,
-	updateDataRole,
-	getAccountInfo,
-	getPersonnel
-} from '@/api/system/employeenInfo'
+import { saveAvatal, delUser, addUser, updateUser, getStaffList, getLevelTreeSelect, getNatureTreeSelect, getAuthRole, updateAuthRole, getDataRole, updateDataRole, getAccountInfo, getPersonnel } from '@/api/system/employeenInfo'
 import { getToken } from '@/utils/auth'
 import { treeselect } from '@/api/system/dept'
-import userAvatar from './profile/userAvatar.vue'
+import UploadOne from '@/components/UploadOne/index.vue'
 import Treeselect from '@riophae/vue-treeselect'
-import TreeChoice from '@/components/deptTreeChoice/index.vue'
+import TreeChoice from '@/components/treeChoice/index.vue'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { deepClone } from '@/utils/index.js'
 
@@ -578,7 +539,7 @@ export default {
 		'sys_staff_criminalLaw',
 		'sys_spare_relationship'
 	],
-	components: { Treeselect, TreeChoice, userAvatar },
+	components: { Treeselect, TreeChoice, UploadOne },
 	data() {
 		return {
 			// 遮罩层
@@ -592,7 +553,7 @@ export default {
 			// 弹出层标题
 			title: '',
 			// 部门树选项
-			deptOptions: undefined,
+			deptOptions: [],
 			// 是否显示弹出层
 			open: false,
 			// 岗位选项
@@ -639,7 +600,7 @@ export default {
 				pageSize: 10,
 				realName: undefined,
 				phonenumber: undefined,
-				deptIds: []
+				deptId: 0
 			},
 			// 列信息
 			columns: [
@@ -741,17 +702,28 @@ export default {
 				pageSize: 10
 			},
 			dataRoleListAll: [], // 所有数据权限列表
-			dataRoleList: [] // 员工数据权限
+			dataRoleList: [], // 员工数据权限
+			avatarUser: null //正在修改头像的用户
 		}
 	},
 	created() {
 		this.getList()
+		this.getTreeselect()
 	},
 	methods: {
+		//保存图片路径
+		saveUrl(avatar) {
+			saveAvatal({ userId: this.avatarUser.userId, avatar }).then(res => {
+				if (res.code === 200) {
+					this.avatarUser.avatar = avatar
+					this.$msg({ message: '上传成功' })
+				}
+			})
+		},
 		/** 查询用户列表 */
 		getList() {
 			this.loading = true
-			getStaffList(this.queryParams).then((response) => {
+			getStaffList(this.queryParams).then(response => {
 				this.userList = response.rows
 				this.total = response.total
 				this.loading = false
@@ -759,7 +731,7 @@ export default {
 		},
 		/** 查询部门下拉树结构 */
 		getTreeselect() {
-			treeselect().then((response) => {
+			treeselect().then(response => {
 				this.deptOptions = response.data
 			})
 		},
@@ -796,13 +768,9 @@ export default {
 			this.queryParams.pageNum = 1
 			this.getList()
 		},
-		deptClick() {
-			// this.queryParams.pageNum = 1
-			if (this.queryParams.deptIds == []) {
-				return
-			} else {
-				this.getList()
-			}
+		deptClick(d) {
+			this.queryParams.deptId = d.id
+			this.getList()
 		},
 		/** 重置按钮操作 */
 		resetQuery() {
@@ -823,7 +791,7 @@ export default {
 		// 修改角色权限
 		getRolePermissions(row) {
 			this.userId = row.userId
-			getAuthRole(row.userId).then((res) => {
+			getAuthRole(row.userId).then(res => {
 				if (res.code === 200) {
 					this.roleList = res.roles
 					this.dialogTableRolePermissions = true
@@ -833,7 +801,7 @@ export default {
 		// 修改数据权限
 		getDataRole(row) {
 			this.userId = row.userId
-			getDataRole(row.userId).then((res) => {
+			getDataRole(row.userId).then(res => {
 				if (res.code === 200) {
 					this.dataRoleList = res.dataRoles
 					this.dialogTableDataRole = true
@@ -845,7 +813,7 @@ export default {
 			let newArr = this.dataRoleList.filter((item, index, c) => item.flag == true)
 			let dataRoleIds = newArr.map((item, index, c) => item.dataRoleId)
 			// let dataRoleIdsStr = dataRoleIds.join(',')
-			updateDataRole({ userId: this.userId, roleIds: dataRoleIds }).then((res) => {
+			updateDataRole({ userId: this.userId, roleIds: dataRoleIds }).then(res => {
 				if (res.code === 200) {
 					this.dialogTableDataRole = false
 					this.$msg({ message: '修改成功' })
@@ -870,7 +838,7 @@ export default {
 			let newArr = this.roleList.filter((item, index, c) => item.flag == true)
 			let roleIds = newArr.map((item, index, c) => item.roleId)
 			// let roleIdsStr = roleIds.join(',')
-			updateAuthRole({ userId: this.userId, roleIds: roleIds }).then((res) => {
+			updateAuthRole({ userId: this.userId, roleIds: roleIds }).then(res => {
 				if (res.code === 200) {
 					this.dialogTableRolePermissions = false
 					this.$msg({ message: '修改成功' })
@@ -906,7 +874,8 @@ export default {
 		},
 		// 修改头像
 		modifyAvatar(row) {
-			this.$refs.userAvatar.editCropper()
+			this.avatarUser = row
+			this.$refs.uploadOne.init(row.avatar)
 		},
 		// 关闭责权信息
 		handleClose() {
@@ -914,7 +883,7 @@ export default {
 		},
 		//获取级别数据
 		getLevelList() {
-			getLevelTreeSelect().then((res) => {
+			getLevelTreeSelect().then(res => {
 				if (res.code == 200) {
 					this.levelList = res.data
 					// this.levelList.map((item) => item.id.toString())
@@ -925,7 +894,7 @@ export default {
 		},
 		// 获取性质岗位数据
 		getNatureList() {
-			getNatureTreeSelect().then((res) => {
+			getNatureTreeSelect().then(res => {
 				if (res.code == 200) {
 					this.natureList = res.data
 					// this.natureList.map((item) => item.id.toString())
@@ -942,7 +911,7 @@ export default {
 			this.getLevelList()
 			this.getNatureList()
 			// 查询账号信息
-			getAccountInfo(row.userId).then((response) => {
+			getAccountInfo(row.userId).then(response => {
 				this.open = true
 				this.title = '修改用户'
 				this.accountForm = response.data
@@ -951,7 +920,7 @@ export default {
 				this.accountForm.naturePostIds = response.data.naturePostIds.split(',')
 			})
 			// 查询基础信息
-			getPersonnel(row.userId).then((res) => {
+			getPersonnel(row.userId).then(res => {
 				this.basicsForm = res.data
 				this.basicsForm.descriptionJson = JSON.parse(res.data.descriptionJson)
 				this.basicsForm.favorite = res.data.favorite.split(',')
@@ -973,16 +942,16 @@ export default {
 			let params = { ...accountStr, ...str }
 			params.userId = this.userId
 			console.log(params)
-			this.$refs['accountForm'].validate((valid) => {
+			this.$refs['accountForm'].validate(valid => {
 				if (valid) {
 					if (params.userId != null) {
-						updateUser(params).then((response) => {
+						updateUser(params).then(response => {
 							this.$modal.msgSuccess('修改成功')
 							this.open = false
 							this.getList()
 						})
 					} else {
-						addUser(params).then((response) => {
+						addUser(params).then(response => {
 							this.$modal.msgSuccess('新增成功')
 							this.open = false
 							this.getList()
@@ -1045,7 +1014,7 @@ export default {
 		},
 		//删除原单位
 		delDescription(id) {
-			this.basicsForm.descriptionJson = this.basicsForm.descriptionJson.filter((item) => item.id != id)
+			this.basicsForm.descriptionJson = this.basicsForm.descriptionJson.filter(item => item.id != id)
 		}
 	},
 	computed: {
@@ -1073,15 +1042,15 @@ export default {
 		},
 		isClick() {
 			return function (id) {
-				let obj = this.basicsForm.descriptionJson.find((item) => item.id == id)
-				let values = Object.values(obj).filter((item) => typeof item == 'string')
-				return values.every((item) => item != '')
+				let obj = this.basicsForm.descriptionJson.find(item => item.id == id)
+				let values = Object.values(obj).filter(item => typeof item == 'string')
+				return values.every(item => item != '')
 			}
 		},
 		//判断是不是最后一条
 		isLast() {
 			return function (id) {
-				let obj = this.basicsForm.descriptionJson.some((item) => item.id > id)
+				let obj = this.basicsForm.descriptionJson.some(item => item.id > id)
 				return !obj
 			}
 		}

+ 161 - 159
src/views/system/employeenInfo/profile/userAvatar.vue

@@ -1,172 +1,174 @@
 <template>
-  <div>
-    <!-- <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div> -->
-    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened"  @close="closeDialog">
-      <el-row>
-        <el-col :xs="24" :md="12" :style="{height: '350px'}">
-          <vue-cropper
-            ref="cropper"
-            :img="options.img"
-            :info="true"
-            :autoCrop="options.autoCrop"
-            :autoCropWidth="options.autoCropWidth"
-            :autoCropHeight="options.autoCropHeight"
-            :fixedBox="options.fixedBox"
-            @realTime="realTime"
-            v-if="visible"
-          />
-        </el-col>
-        <el-col :xs="24" :md="12" :style="{height: '350px'}">
-          <div class="avatar-upload-preview">
-            <img :src="previews.url" :style="previews.img" />
-          </div>
-        </el-col>
-      </el-row>
-      <br />
-      <el-row>
-        <el-col :lg="2" :md="2">
-          <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
-            <el-button size="small">
-              选择
-              <i class="el-icon-upload el-icon--right"></i>
-            </el-button>
-          </el-upload>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 2}" :md="2">
-          <el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :md="2">
-          <el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :md="2">
-          <el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :md="2">
-          <el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
-        </el-col>
-        <el-col :lg="{span: 2, offset: 6}" :md="2">
-          <el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
-        </el-col>
-      </el-row>
-    </el-dialog>
-  </div>
+	<div>
+		<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog">
+			<el-row>
+				<el-col :xs="24" :md="12" :style="{ height: '350px' }">
+					<vue-cropper
+						ref="cropper"
+						:img="options.img"
+						:info="true"
+						:autoCrop="options.autoCrop"
+						:autoCropWidth="options.autoCropWidth"
+						:autoCropHeight="options.autoCropHeight"
+						:fixedBox="options.fixedBox"
+						@realTime="realTime"
+						v-if="visible"
+					/>
+				</el-col>
+				<el-col :xs="24" :md="12" :style="{ height: '350px' }">
+					<div class="avatar-upload-preview">
+						<img :src="previews.url" :style="previews.img" />
+					</div>
+				</el-col>
+			</el-row>
+			<br />
+			<el-row>
+				<el-col :lg="2" :md="2">
+					<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
+						<el-button size="small">
+							选择
+							<i class="el-icon-upload el-icon--right"></i>
+						</el-button>
+					</el-upload>
+				</el-col>
+				<el-col :lg="{ span: 1, offset: 2 }" :md="2">
+					<el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
+				</el-col>
+				<el-col :lg="{ span: 1, offset: 1 }" :md="2">
+					<el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
+				</el-col>
+				<el-col :lg="{ span: 1, offset: 1 }" :md="2">
+					<el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
+				</el-col>
+				<el-col :lg="{ span: 1, offset: 1 }" :md="2">
+					<el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
+				</el-col>
+				<el-col :lg="{ span: 2, offset: 6 }" :md="2">
+					<el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
+				</el-col>
+			</el-row>
+		</el-dialog>
+	</div>
 </template>
 
 <script>
-import store from "@/store";
-import { VueCropper } from "vue-cropper";
-import { uploadAvatar } from "@/api/system/user";
+import store from '@/store'
+import { VueCropper } from 'vue-cropper'
+import { uploadAvatar } from '@/api/system/user'
 
 export default {
-  components: { VueCropper },
-  props: {
-    user: {
-      type: Object
-    }
-  },
-  data() {
-    return {
-      // 是否显示弹出层
-      open: false,
-      // 是否显示cropper
-      visible: false,
-      // 弹出层标题
-      title: "修改头像",
-      options: {
-        img: store.getters.avatar, //裁剪图片的地址
-        autoCrop: true, // 是否默认生成截图框
-        autoCropWidth: 200, // 默认生成截图框宽度
-        autoCropHeight: 200, // 默认生成截图框高度
-        fixedBox: true // 固定截图框大小 不允许改变
-      },
-      previews: {}
-    };
-  },
-  methods: {
-    // 编辑头像
-    editCropper() {
-      this.open = true;
-    },
-    // 打开弹出层结束时的回调
-    modalOpened() {
-      this.visible = true;
-    },
-    // 覆盖默认的上传行为
-    requestUpload() {
-    },
-    // 向左旋转
-    rotateLeft() {
-      this.$refs.cropper.rotateLeft();
-    },
-    // 向右旋转
-    rotateRight() {
-      this.$refs.cropper.rotateRight();
-    },
-    // 图片缩放
-    changeScale(num) {
-      num = num || 1;
-      this.$refs.cropper.changeScale(num);
-    },
-    // 上传预处理
-    beforeUpload(file) {
-      if (file.type.indexOf("image/") == -1) {
-        this.$modal.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
-      } else {
-        const reader = new FileReader();
-        reader.readAsDataURL(file);
-        reader.onload = () => {
-          this.options.img = reader.result;
-        };
-      }
-    },
-    // 上传图片
-    uploadImg() {
-      this.$refs.cropper.getCropBlob(data => {
-        let formData = new FormData();
-        formData.append("avatarfile", data);
-        uploadAvatar(formData).then(response => {
-          this.open = false;
-          this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
-          store.commit('SET_AVATAR', this.options.img);
-          this.$modal.msgSuccess("修改成功");
-          this.visible = false;
-        });
-      });
-    },
-    // 实时预览
-    realTime(data) {
-      this.previews = data;
-    },
-    // 关闭窗口
-    closeDialog() {
-      this.options.img = store.getters.avatar
-      this.visible = false;
-    }
-  }
-};
+	dicts: ['sys_upload_img'],
+	components: { VueCropper },
+	props: {
+		user: {
+			type: Object
+		}
+	},
+	data() {
+		return {
+			// 是否显示弹出层
+			open: false,
+			// 是否显示cropper
+			visible: false,
+			// 弹出层标题
+			title: '修改头像',
+			options: {
+				img: store.getters.avatar, //裁剪图片的地址
+				autoCrop: true, // 是否默认生成截图框
+				autoCropWidth: 200, // 默认生成截图框宽度
+				autoCropHeight: 200, // 默认生成截图框高度
+				fixedBox: true // 固定截图框大小 不允许改变
+			},
+			previews: {}
+		}
+	},
+	methods: {
+		test() {
+			console.log(this.dict.type.sys_upload_img.find(item => item.value === 'avatar').label)
+		},
+		// 编辑头像
+		editCropper() {
+			this.open = true
+		},
+		// 打开弹出层结束时的回调
+		modalOpened() {
+			this.visible = true
+		},
+		// 覆盖默认的上传行为
+		requestUpload() {},
+		// 向左旋转
+		rotateLeft() {
+			this.$refs.cropper.rotateLeft()
+		},
+		// 向右旋转
+		rotateRight() {
+			this.$refs.cropper.rotateRight()
+		},
+		// 图片缩放
+		changeScale(num) {
+			num = num || 1
+			this.$refs.cropper.changeScale(num)
+		},
+		// 上传预处理
+		beforeUpload(file) {
+			if (file.type.indexOf('image/') == -1) {
+				this.$modal.msgError('文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。')
+			} else {
+				const reader = new FileReader()
+				reader.readAsDataURL(file)
+				reader.onload = () => {
+					this.options.img = reader.result
+				}
+			}
+		},
+		// 上传图片
+		uploadImg() {
+			this.$refs.cropper.getCropBlob(data => {
+				let formData = new FormData()
+				formData.append('avatarfile', data)
+				uploadAvatar(formData).then(response => {
+					this.open = false
+					this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl
+					store.commit('SET_AVATAR', this.options.img)
+					this.$modal.msgSuccess('修改成功')
+					this.visible = false
+				})
+			})
+		},
+		// 实时预览
+		realTime(data) {
+			this.previews = data
+		},
+		// 关闭窗口
+		closeDialog() {
+			this.options.img = store.getters.avatar
+			this.visible = false
+		}
+	}
+}
 </script>
 <style scoped lang="scss">
 .user-info-head {
-  position: relative;
-  display: inline-block;
-  height: 120px;
+	position: relative;
+	display: inline-block;
+	height: 120px;
 }
 
 .user-info-head:hover:after {
-  content: '+';
-  position: absolute;
-  left: 0;
-  right: 0;
-  top: 0;
-  bottom: 0;
-  color: #eee;
-  background: rgba(0, 0, 0, 0.5);
-  font-size: 24px;
-  font-style: normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-  cursor: pointer;
-  line-height: 110px;
-  border-radius: 50%;
+	content: '+';
+	position: absolute;
+	left: 0;
+	right: 0;
+	top: 0;
+	bottom: 0;
+	color: #eee;
+	background: rgba(0, 0, 0, 0.5);
+	font-size: 24px;
+	font-style: normal;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+	cursor: pointer;
+	line-height: 110px;
+	border-radius: 50%;
 }
-</style>
+</style>

+ 454 - 466
src/views/system/levelPosition/index.vue

@@ -8,8 +8,8 @@
 						<div class="tag" :style="isActive(2)" @click="toTab2">职务</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini " v-show="tabIndex == 1" @click="addLevel" v-hasPermi="['system:levelPosition:addLevel']">添加</el-button>
-						<el-button type="primary" icon="el-icon-plus" size="mini " v-show="tabIndex == 2" @click="addPost" v-hasPermi="['system:levelPosition:addPost']">添加</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini " v-show="tabIndex == 1" @click="addLevel">添加</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini " v-show="tabIndex == 2" @click="addPost">添加</el-button>
 					</div>
 				</div>
 				<!-- 级别表格 -->
@@ -24,10 +24,10 @@
 					<el-table-column label="描述" prop="remarks" />
 					<el-table-column align="center" label="操作" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="updLevel(scope.row)" v-hasPermi="['system:levelPosition:updLevel']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="delLevel(scope.row)" v-hasPermi="['system:levelPosition:delLevel']">删除</el-button>
-							<el-button size="mini" type="text" icon="el-icon-top" @click.stop="levelUpOrder(scope.row)" v-hasPermi="['system:levelPosition:upLevel']">上升</el-button>
-							<el-button size="mini" type="text" icon="el-icon-bottom" @click.stop="levelDownOrder(scope.row)" v-hasPermi="['system:levelPosition:downLevel']">下降</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="updLevel(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="delLevel(scope.row)">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-top" @click.stop="levelUpOrder(scope.row)">上升</el-button>
+							<el-button size="mini" type="text" icon="el-icon-bottom" @click.stop="levelDownOrder(scope.row)">下降</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -47,16 +47,16 @@
 					<el-table-column label="描述" prop="remarks" />
 					<el-table-column align="center" label="操作" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="updPost(scope.row)" v-hasPermi="['system:levelPosition:updPost']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="delPost(scope.row)" v-hasPermi="['system:levelPosition:delPost']">删除</el-button>
-							<el-button size="mini" type="text" icon="el-icon-top" @click="postUpOrder(scope.row)" v-hasPermi="['system:levelPosition:upPost']">上升</el-button>
-							<el-button size="mini" type="text" icon="el-icon-bottom" @click="postDownOrder(scope.row)" v-hasPermi="['system:levelPosition:downPost']">下降</el-button>
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="editPower(scope.row)" v-hasPermi="['system:levelPosition:power']">责权</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="updPost(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="delPost(scope.row)">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-top" @click="postUpOrder(scope.row)">上升</el-button>
+							<el-button size="mini" type="text" icon="el-icon-bottom" @click="postDownOrder(scope.row)">下降</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="editPower(scope.row)">责权</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
 				<!-- 添加修改级别弹窗 -->
-				<el-dialog title="编辑级别" :visible.sync="levelShow" width="30%">
+				<el-dialog title="编辑级别" :visible.sync="levelShow" width="30%" @close="levelCancel">
 					<el-form ref="levelForm" :model="levelForm" :rules="levelRules" label-width="100px">
 						<el-form-item label="级别" prop="levelName">
 							<div style="width: 200px"><el-input v-model="levelForm.levelName" placeholder="请输入级别" /></div>
@@ -77,19 +77,13 @@
 					</div>
 				</el-dialog>
 				<!-- 添加修改职务弹窗 -->
-				<el-dialog title="编辑职务" :visible.sync="postShow" width="30%">
+				<el-dialog title="编辑职务" :visible.sync="postShow" width="30%" @close="postCancel">
 					<el-form ref="postForm" :model="postForm" :rules="postRules" label-width="100px">
 						<el-form-item label="职务" prop="jobName">
 							<div style="width: 200px"><el-input v-model="postForm.jobName" placeholder="请输入职务" /></div>
 						</el-form-item>
 						<el-form-item label="部门" prop="deptId">
-							<el-cascader
-								v-model="deptIds"
-								:options="deptTree"
-								:props="{ expandTrigger: 'hover', value: 'deptId', label: 'deptName', checkStrictly: true }"
-								@change="deptChange"
-								:show-all-levels="false"
-							></el-cascader>
+							<el-cascader v-model="deptIds" :options="deptTree" :props="{ expandTrigger: 'hover', value: 'deptId', label: 'deptName', checkStrictly: true }" @change="deptChange" :show-all-levels="false"></el-cascader>
 						</el-form-item>
 						<el-form-item label="级别" prop="levelName">
 							<div style="width: 200px"><el-input disabled v-model="postForm.levelName" placeholder="请输入职务" /></div>
@@ -127,494 +121,488 @@
 </template>
 
 <script>
-	import { levelAdd, levelList, levelUpd, levelDel, levelOrder, postAdd, postList, postUpd, postDel, postOrder, powerUpd } from '@/api/system/levelPosition.js'
-	import { listDept } from '@/api/system/dept.js'
-	import { checkPermi } from '@/utils/permission'
-	export default {
-		name: 'levelPosition',
-		data() {
+import { levelAdd, levelList, levelUpd, levelDel, levelOrder, postAdd, postList, postUpd, postDel, postOrder, powerUpd } from '@/api/system/levelPosition.js'
+import { listDept } from '@/api/system/dept.js'
+export default {
+	name: 'levelPosition',
+	data() {
+		return {
+			loading: false,
+			//级别职务 选项
+			tabIndex: 1,
+			//级别数据
+			levelList: [],
+			//级别新增弹窗显示
+			levelShow: false,
+			//级别弹窗表单信息
+			levelForm: {
+				//黑星
+				blackStar: 0,
+				//级别id
+				levelId: 0,
+				//级别名称
+				levelName: '',
+				//级别排序
+				levelSort: 0,
+				//红星
+				redStar: 0,
+				//描述
+				remarks: ''
+			},
+			//级别弹窗表单验证
+			levelRules: {
+				levelName: [{ required: true, message: '级别名称不能为空', trigger: 'submit' }]
+			},
+			//职务数据
+			postList: [],
+			//职务新增弹窗显示
+			postShow: false,
+			//职务弹窗表单信息
+			postForm: {
+				//部门id
+				deptId: '',
+				//职务id
+				jobId: 0,
+				//职务名称
+				jobName: '',
+				//职务排序
+				jobSort: 0,
+				//级别id
+				levelId: 0,
+				//级别名称
+				levelName: '',
+				//描述
+				remarks: ''
+			},
+			//职务弹窗表单验证
+			postRules: {
+				jobName: [{ required: true, message: '职务名称不能为空', trigger: 'submit' }],
+				deptId: [{ required: true, message: '未选择部门', trigger: 'submit' }]
+			},
+			//部门数据
+			deptList: [],
+			//部门树型数据
+			deptTree: [],
+			deptIds: [],
+			//责权弹窗显示
+			powerShow: false,
+			//责权表单
+			powerForm: {
+				//责任
+				responsibility: '',
+				//权力
+				right: '',
+				//职务名称
+				jobName: ''
+			}
+		}
+	},
+	created() {
+		console.log(this.$route)
+		this.getLevelList()
+		listDept().then(res => {
+			if (res.code == 200) {
+				this.deptList = res.data
+				this.deptTree = this.handleTree(res.data, 'deptId')
+			}
+		})
+	},
+	computed: {
+		theme() {
+			return this.$store.state.settings.theme
+		}
+	},
+	methods: {
+		isActive(index) {
+			if (this.tabIndex != index) return {}
 			return {
-				loading: false,
-				//级别职务 选项
-				tabIndex: 1,
-				//级别数据
-				levelList: [],
-				//级别新增弹窗显示
-				levelShow: false,
-				//级别弹窗表单信息
-				levelForm: {
-					//黑星
-					blackStar: 0,
-					//级别id
-					levelId: 0,
-					//级别名称
-					levelName: '',
-					//级别排序
-					levelSort: 0,
-					//红星
-					redStar: 0,
-					//描述
-					remarks: ''
-				},
-				//级别弹窗表单验证
-				levelRules: {
-					levelName: [{ required: true, message: '级别名称不能为空', trigger: 'submit' }]
-				},
-				//职务数据
-				postList: [],
-				//职务新增弹窗显示
-				postShow: false,
-				//职务弹窗表单信息
-				postForm: {
-					//部门id
-					deptId: '',
-					//职务id
-					jobId: 0,
-					//职务名称
-					jobName: '',
-					//职务排序
-					jobSort: 0,
-					//级别id
-					levelId: 0,
-					//级别名称
-					levelName: '',
-					//描述
-					remarks: ''
-				},
-				//职务弹窗表单验证
-				postRules: {
-					jobName: [{ required: true, message: '职务名称不能为空', trigger: 'submit' }],
-					deptId: [{ required: true, message: '未选择部门', trigger: 'submit' }]
-				},
-				//部门数据
-				deptList: [],
-				//部门树型数据
-				deptTree: [],
-				deptIds: [],
-				//责权弹窗显示
-				powerShow: false,
-				//责权表单
-				powerForm: {
-					//责任
-					responsibility: '',
-					//权力
-					right: '',
-					//职务名称
-					jobName: ''
-				}
+				color: this.theme
 			}
 		},
-		created() {
-			this.getLevelList()
-			listDept().then((res) => {
+		//获取级别数据
+		getLevelList() {
+			this.loading = true
+			levelList().then(res => {
 				if (res.code == 200) {
-					this.deptList = res.data
-					this.deptTree = this.handleTree(res.data, 'deptId')
+					this.levelList = res.data
+					this.loading = false
+				} else {
+					this.$msg({ type: 'error', message: res.msg })
 				}
 			})
 		},
-		computed: {
-			theme() {
-				return this.$store.state.settings.theme
+		//级别表单字段重置
+		resetLevelForm() {
+			this.levelForm = {
+				//黑星
+				blackStar: 0,
+				//级别id
+				levelId: 0,
+				//级别名称
+				levelName: '',
+				//级别排序
+				levelSort: 0,
+				//红星
+				redStar: 0,
+				//描述
+				remarks: ''
 			}
 		},
-		methods: {
-			isActive(index) {
-				if (this.tabIndex != index) return {}
-				return {
-					color: this.theme
-				}
-			},
-			//获取级别数据
-			getLevelList() {
-				if (!checkPermi(['system:levelPosition:listLevel'])) {
-					return
-				}
-				this.loading = true
-				levelList().then((res) => {
-					if (res.code == 200) {
-						this.levelList = res.data
-						this.loading = false
-					} else {
-						this.$msg({ type: 'error', message: res.msg })
-					}
+		//职务表单字段重置
+		resetPostForm() {
+			this.postForm = {
+				//部门id
+				deptId: '',
+				//职务id
+				jobId: 0,
+				//职务名称
+				jobName: '',
+				//职务排序
+				jobSort: 0,
+				//描述
+				remarks: ''
+			}
+		},
+		//新增级别
+		addLevel() {
+			this.levelShow = true
+		},
+		//级别弹窗取消
+		levelCancel() {
+			this.resetLevelForm()
+			this.levelShow = false
+		},
+		//修改级别
+		updLevel(row) {
+			this.levelForm = { ...row }
+			this.levelShow = true
+		},
+		//删除级别
+		delLevel(row) {
+			this.$modal
+				.confirm('确定要删除吗')
+				.then(() => {
+					levelDel(row.levelId).then(res => {
+						if (res.code == 200) {
+							this.$msg({ message: '删除成功' })
+							this.getLevelList()
+						} else {
+							this.$msg({ type: 'error', message: res.msg })
+						}
+					})
 				})
-			},
-			//级别表单字段重置
-			resetLevelForm() {
-				this.levelForm = {
-					//黑星
-					blackStar: 0,
-					//级别id
-					levelId: 0,
-					//级别名称
-					levelName: '',
-					//级别排序
-					levelSort: 0,
-					//红星
-					redStar: 0,
-					//描述
-					remarks: ''
-				}
-			},
-			//职务表单字段重置
-			resetPostForm() {
-				this.postForm = {
-					//部门id
-					deptId: '',
-					//职务id
-					jobId: 0,
-					//职务名称
-					jobName: '',
-					//职务排序
-					jobSort: 0,
-					//描述
-					remarks: ''
-				}
-			},
-			//新增级别
-			addLevel() {
-				this.levelShow = true
-			},
-			//级别弹窗取消
-			levelCancel() {
-				this.resetLevelForm()
-				this.levelShow = false
-			},
-			//修改级别
-			updLevel(row) {
-				this.levelForm = { ...row }
-				this.levelShow = true
-			},
-			//删除级别
-			delLevel(row) {
-				this.$modal
-					.confirm('确定要删除吗')
-					.then(() => {
-						levelDel(row.levelId).then((res) => {
+				.catch(() => {})
+		},
+		//级别重名检测
+		checkLevelName(data) {
+			let o = this.levelList.find(item => item.levelName == data.levelName && item.levelId != data.levelId)
+			if (o) {
+				return '级别名称重复'
+			}
+			return false
+		},
+		//职务重名检测
+		checkPostName(data) {
+			let o = this.postList.find(item => item.jobName == data.jobName && item.jobId != data.jobId)
+			if (o) {
+				return '职务名称重复'
+			}
+			return false
+		},
+		//编辑级别提交
+		levelSub() {
+			this.$refs.levelForm.validate(valid => {
+				if (valid) {
+					let checkFiled = this.checkLevelName(this.levelForm)
+					if (checkFiled) {
+						this.$msg({ type: 'error', message: checkFiled })
+						return
+					}
+					if (this.levelForm.levelId) {
+						levelUpd(this.levelForm).then(res => {
 							if (res.code == 200) {
-								this.$msg({ message: '删除成功' })
+								this.$msg({ message: '修改成功' })
 								this.getLevelList()
-							} else {
-								this.$msg({ type: 'error', message: res.msg })
+								this.levelCancel()
 							}
 						})
-					})
-					.catch(() => {})
-			},
-			//级别重名检测
-			checkLevelName(data) {
-				let o = this.levelList.find((item) => item.levelName == data.levelName && item.levelId != data.levelId)
-				if (o) {
-					return '级别名称重复'
-				}
-				return false
-			},
-			//职务重名检测
-			checkPostName(data) {
-				let o = this.postList.find((item) => item.jobName == data.jobName && item.jobId != data.jobId)
-				if (o) {
-					return '职务名称重复'
-				}
-				return false
-			},
-			//编辑级别提交
-			levelSub() {
-				this.$refs.levelForm.validate((valid) => {
-					if (valid) {
-						let checkFiled = this.checkLevelName(this.levelForm)
-						if (checkFiled) {
-							this.$msg({ type: 'error', message: checkFiled })
-							return
-						}
-						if (this.levelForm.levelId) {
-							levelUpd(this.levelForm).then((res) => {
-								if (res.code == 200) {
-									this.$msg({ message: '修改成功' })
-									this.getLevelList()
-									this.levelCancel()
-								}
-							})
-						} else {
-							this.levelForm.levelSort = this.levelList.length ? this.levelList[0].levelSort + 1 : 1
-							levelAdd(this.levelForm).then((res) => {
-								if (res.code === 200) {
-									this.$msg({ message: '添加成功' })
-									this.getLevelList()
-									this.levelCancel()
-								}
-							})
-						}
 					} else {
-						return false
+						this.levelForm.levelSort = this.levelList.length ? this.levelList[0].levelSort + 1 : 1
+						levelAdd(this.levelForm).then(res => {
+							if (res.code === 200) {
+								this.$msg({ message: '添加成功' })
+								this.getLevelList()
+								this.levelCancel()
+							}
+						})
 					}
-				})
-			},
-			//级别上升
-			levelUpOrder(row) {
-				console.log(row)
-				let prevList = this.levelList.filter((item) => item.levelSort > row.levelSort)
-				prevList.sort((a, b) => {
-					return a.levelSort - b.levelSort
-				})
-				let prev = prevList[0]
-				if (!prev) {
-					this.$msg({ type: 'info', message: '已经是最高级了' })
 				} else {
-					let d = [
-						{ levelId: row.levelId, levelSort: prev.levelSort },
-						{ levelId: prev.levelId, levelSort: row.levelSort }
-					]
-					levelOrder(d).then((res) => {
-						if (res.code == 200) {
-							let pSort = prev.levelSort
-							prev.levelSort = row.levelSort
-							row.levelSort = pSort
-							this.levelList.sort((a, b) => {
-								return b.levelSort - a.levelSort
-							})
-							this.$msg({ message: '设置成功' })
-						}
-					})
+					return false
 				}
-			},
-			//级别下降
-			levelDownOrder(row) {
-				let nextList = this.levelList.filter((item) => item.levelSort < row.levelSort)
-				nextList.sort((a, b) => {
-					return b.levelSort - a.levelSort
+			})
+		},
+		//级别上升
+		levelUpOrder(row) {
+			console.log(row)
+			let prevList = this.levelList.filter(item => item.levelSort > row.levelSort)
+			prevList.sort((a, b) => {
+				return a.levelSort - b.levelSort
+			})
+			let prev = prevList[0]
+			if (!prev) {
+				this.$msg({ type: 'info', message: '已经是最高级了' })
+			} else {
+				let d = [
+					{ levelId: row.levelId, levelSort: prev.levelSort },
+					{ levelId: prev.levelId, levelSort: row.levelSort }
+				]
+				levelOrder(d).then(res => {
+					if (res.code == 200) {
+						let pSort = prev.levelSort
+						prev.levelSort = row.levelSort
+						row.levelSort = pSort
+						this.levelList.sort((a, b) => {
+							return b.levelSort - a.levelSort
+						})
+						this.$msg({ message: '设置成功' })
+					}
 				})
-				let next = nextList[0]
-				if (!next) {
-					this.$msg({ type: 'info', message: '已经是最下级了' })
-				} else {
-					let d = [
-						{ levelId: row.levelId, levelSort: next.levelSort },
-						{ levelId: next.levelId, levelSort: row.levelSort }
-					]
-					levelOrder(d).then((res) => {
-						if (res.code == 200) {
-							let nSort = next.levelSort
-							next.levelSort = row.levelSort
-							row.levelSort = nSort
-							this.levelList.sort((a, b) => {
-								return b.levelSort - a.levelSort
-							})
-							this.$msg({ message: '设置成功' })
-						}
-					})
-				}
-			},
-			//跳转到级别
-			toTab1() {
-				this.tabIndex = 1
-			},
-			//级别行单击
-			rowHandler(e) {
-				if (!e) return
-				this.postForm.levelId = e.levelId
-				this.postForm.levelName = e.levelName
-				this.postList = []
-				this.getPostList()
-			},
-			//跳转到职务
-			toTab2() {
-				this.tabIndex = 2
-			},
-			//获取职务数据
-			getPostList() {
-				if (!checkPermi(['system:levelPosition:listPost'])) {
-					return
-				}
-				postList({ levelId: this.postForm.levelId }).then((res) => {
+			}
+		},
+		//级别下降
+		levelDownOrder(row) {
+			let nextList = this.levelList.filter(item => item.levelSort < row.levelSort)
+			nextList.sort((a, b) => {
+				return b.levelSort - a.levelSort
+			})
+			let next = nextList[0]
+			if (!next) {
+				this.$msg({ type: 'info', message: '已经是最下级了' })
+			} else {
+				let d = [
+					{ levelId: row.levelId, levelSort: next.levelSort },
+					{ levelId: next.levelId, levelSort: row.levelSort }
+				]
+				levelOrder(d).then(res => {
 					if (res.code == 200) {
-						this.postList = res.data
-					} else {
-						this.$msg({ type: 'error', message: res.msg })
+						let nSort = next.levelSort
+						next.levelSort = row.levelSort
+						row.levelSort = nSort
+						this.levelList.sort((a, b) => {
+							return b.levelSort - a.levelSort
+						})
+						this.$msg({ message: '设置成功' })
 					}
 				})
-			},
-			//添加职务
-			addPost() {
-				this.postShow = true
-			},
-			//修改职务
-			updPost(row) {
-				this.postForm = { ...row }
-				this.postShow = true
-				this.deptIds = this.getDeptIds(row.deptId)
-			},
-			//查找部门ids
-			getDeptIds(id) {
-				let res = [id]
-				let self = this.deptList.find((item) => item.deptId == id)
-				let p = this.deptList.find((item) => item.deptId == self.parentId)
-				while (p) {
-					res.unshift(p.deptId)
-					p = this.deptList.find((item) => item.deptId == p.parentId)
+			}
+		},
+		//跳转到级别
+		toTab1() {
+			this.tabIndex = 1
+		},
+		//级别行单击
+		rowHandler(e) {
+			if (!e) return
+			this.postForm.levelId = e.levelId
+			this.postForm.levelName = e.levelName
+			this.postList = []
+			this.getPostList()
+		},
+		//跳转到职务
+		toTab2() {
+			this.tabIndex = 2
+		},
+		//获取职务数据
+		getPostList() {
+			postList({ levelId: this.postForm.levelId }).then(res => {
+				if (res.code == 200) {
+					this.postList = res.data
+				} else {
+					this.$msg({ type: 'error', message: res.msg })
 				}
+			})
+		},
+		//添加职务
+		addPost() {
+			this.postShow = true
+		},
+		//修改职务
+		updPost(row) {
+			this.postForm = { ...row }
+			this.postShow = true
+			this.deptIds = this.getDeptIds(row.deptId)
+		},
+		//查找部门ids
+		getDeptIds(id) {
+			let res = [id]
+			let self = this.deptList.find(item => item.deptId == id)
+			let p = this.deptList.find(item => item.deptId == self.parentId)
+			while (p) {
+				res.unshift(p.deptId)
+				p = this.deptList.find(item => item.deptId == p.parentId)
+			}
 
-				return res
-			},
-			//删除职务
-			delPost(row) {
-				this.$modal
-					.confirm('确定要删除吗')
-					.then(() => {
-						postDel(row.jobId).then((res) => {
+			return res
+		},
+		//删除职务
+		delPost(row) {
+			this.$modal
+				.confirm('确定要删除吗')
+				.then(() => {
+					postDel(row.jobId).then(res => {
+						if (res.code == 200) {
+							this.$msg({ message: '删除成功' })
+							this.getPostList()
+						} else {
+							this.$msg({ type: 'error', message: res.msg })
+						}
+					})
+				})
+				.catch(() => {})
+		},
+		//职务提交
+		postSub() {
+			this.$refs.postForm.validate(valid => {
+				if (valid) {
+					let checkFiled = this.checkPostName(this.postForm)
+					if (checkFiled) {
+						this.$msg({ type: 'error', message: checkFiled })
+						return
+					}
+					if (this.postForm.jobId) {
+						postUpd(this.postForm).then(res => {
 							if (res.code == 200) {
-								this.$msg({ message: '删除成功' })
+								this.$msg({ message: '修改成功' })
 								this.getPostList()
+								this.postCancel()
 							} else {
 								this.$msg({ type: 'error', message: res.msg })
 							}
 						})
-					})
-					.catch(() => {})
-			},
-			//职务提交
-			postSub() {
-				this.$refs.postForm.validate((valid) => {
-					if (valid) {
-						let checkFiled = this.checkPostName(this.postForm)
-						if (checkFiled) {
-							this.$msg({ type: 'error', message: checkFiled })
-							return
-						}
-						if (this.postForm.jobId) {
-							postUpd(this.postForm).then((res) => {
-								if (res.code == 200) {
-									this.$msg({ message: '修改成功' })
-									this.getPostList()
-									this.postCancel()
-								} else {
-									this.$msg({ type: 'error', message: res.msg })
-								}
-							})
-						} else {
-							this.postForm.jobSort = this.postList.length ? this.postList[0].jobSort + 1 : 1
-							postAdd(this.postForm).then((res) => {
-								if (res.code == 200) {
-									this.$msg({ message: '添加成功' })
-									this.getPostList()
-									this.postCancel()
-								} else {
-									this.$msg({ type: 'error', message: res.msg })
-								}
-							})
-						}
 					} else {
-						return false
+						this.postForm.jobSort = this.postList.length ? this.postList[0].jobSort + 1 : 1
+						postAdd(this.postForm).then(res => {
+							if (res.code == 200) {
+								this.$msg({ message: '添加成功' })
+								this.getPostList()
+								this.postCancel()
+							} else {
+								this.$msg({ type: 'error', message: res.msg })
+							}
+						})
 					}
-				})
-			},
-			//职务取消
-			postCancel() {
-				this.resetPostForm()
-				this.postShow = false
-				this.deptIds = []
-			},
-			//部门改变
-			deptChange(e) {
-				this.postForm.deptId = e[e.length - 1]
-			},
-			//获取级别名称
-			getLevelName(id) {
-				let o = this.levelList.find((item) => item.levelId == id)
-				if (o) {
-					return o.levelName
-				}
-				return ''
-			},
-			//获取部门名称
-			getDeptName(id) {
-				let o = this.deptList.find((item) => item.deptId == id)
-				if (o) {
-					return o.deptName
-				}
-				return ''
-			},
-			//职务上升排序
-			postUpOrder(row) {
-				let prevList = this.postList.filter((item) => item.jobSort > row.jobSort)
-				prevList.sort((a, b) => {
-					return a.jobSort - b.jobSort
-				})
-				let prev = prevList[0]
-				if (!prev) {
-					this.$msg({ type: 'info', message: '已经是最高级了' })
 				} else {
-					let d = [
-						{ jobId: row.jobId, jobSort: prev.jobSort },
-						{ jobId: prev.jobId, jobSort: row.jobSort }
-					]
-					postOrder(d).then((res) => {
-						if (res.code == 200) {
-							let pSort = prev.jobSort
-							prev.jobSort = row.jobSort
-							row.jobSort = pSort
-							this.postList.sort((a, b) => {
-								return b.jobSort - a.jobSort
-							})
-							this.$msg({ message: '设置成功' })
-						}
-					})
+					return false
 				}
-			},
-			//职务下降排序
-			postDownOrder(row) {
-				let nextList = this.postList.filter((item) => item.jobSort < row.jobSort)
-				nextList.sort((a, b) => {
-					return b.jobSort - a.jobSort
+			})
+		},
+		//职务取消
+		postCancel() {
+			this.resetPostForm()
+			this.postShow = false
+			this.deptIds = []
+		},
+		//部门改变
+		deptChange(e) {
+			this.postForm.deptId = e[e.length - 1]
+		},
+		//获取级别名称
+		getLevelName(id) {
+			let o = this.levelList.find(item => item.levelId == id)
+			if (o) {
+				return o.levelName
+			}
+			return ''
+		},
+		//获取部门名称
+		getDeptName(id) {
+			let o = this.deptList.find(item => item.deptId == id)
+			if (o) {
+				return o.deptName
+			}
+			return ''
+		},
+		//职务上升排序
+		postUpOrder(row) {
+			let prevList = this.postList.filter(item => item.jobSort > row.jobSort)
+			prevList.sort((a, b) => {
+				return a.jobSort - b.jobSort
+			})
+			let prev = prevList[0]
+			if (!prev) {
+				this.$msg({ type: 'info', message: '已经是最高级了' })
+			} else {
+				let d = [
+					{ jobId: row.jobId, jobSort: prev.jobSort },
+					{ jobId: prev.jobId, jobSort: row.jobSort }
+				]
+				postOrder(d).then(res => {
+					if (res.code == 200) {
+						let pSort = prev.jobSort
+						prev.jobSort = row.jobSort
+						row.jobSort = pSort
+						this.postList.sort((a, b) => {
+							return b.jobSort - a.jobSort
+						})
+						this.$msg({ message: '设置成功' })
+					}
 				})
-				let next = nextList[0]
-				if (!next) {
-					this.$msg({ type: 'info', message: '已经是最下级了' })
-				} else {
-					let d = [
-						{ jobId: row.jobId, jobSort: next.jobSort },
-						{ jobId: next.jobId, jobSort: row.jobSort }
-					]
-					postOrder(d).then((res) => {
-						if (res.code == 200) {
-							let nSort = next.jobSort
-							next.jobSort = row.jobSort
-							row.jobSort = nSort
-							this.postList.sort((a, b) => {
-								return b.jobSort - a.jobSort
-							})
-							this.$msg({ message: '设置成功' })
-						}
-					})
-				}
-			},
-			//编辑责权
-			editPower(row) {
-				this.powerForm.responsibility = row.responsibility
-				this.powerForm.right = row.right
-				this.powerForm.jobName = row.jobName
-				this.powerForm.jobId = row.jobId
-				this.powerShow = true
-			},
-			//保存责权
-			powerSub() {
-				delete this.powerForm.jobName
-				powerUpd(this.powerForm).then((res) => {
+			}
+		},
+		//职务下降排序
+		postDownOrder(row) {
+			let nextList = this.postList.filter(item => item.jobSort < row.jobSort)
+			nextList.sort((a, b) => {
+				return b.jobSort - a.jobSort
+			})
+			let next = nextList[0]
+			if (!next) {
+				this.$msg({ type: 'info', message: '已经是最下级了' })
+			} else {
+				let d = [
+					{ jobId: row.jobId, jobSort: next.jobSort },
+					{ jobId: next.jobId, jobSort: row.jobSort }
+				]
+				postOrder(d).then(res => {
 					if (res.code == 200) {
-						this.$msg({ message: '修改成功' })
-						let o = this.postList.find((item) => item.jobId == this.powerForm.jobId)
-						o.responsibility = this.powerForm.responsibility
-						o.right = this.powerForm.right
-						this.powerShow = false
+						let nSort = next.jobSort
+						next.jobSort = row.jobSort
+						row.jobSort = nSort
+						this.postList.sort((a, b) => {
+							return b.jobSort - a.jobSort
+						})
+						this.$msg({ message: '设置成功' })
 					}
 				})
 			}
+		},
+		//编辑责权
+		editPower(row) {
+			this.powerForm.responsibility = row.responsibility
+			this.powerForm.right = row.right
+			this.powerForm.jobName = row.jobName
+			this.powerForm.jobId = row.jobId
+			this.powerShow = true
+		},
+		//保存责权
+		powerSub() {
+			delete this.powerForm.jobName
+			powerUpd(this.powerForm).then(res => {
+				if (res.code == 200) {
+					this.$msg({ message: '修改成功' })
+					let o = this.postList.find(item => item.jobId == this.powerForm.jobId)
+					o.responsibility = this.powerForm.responsibility
+					o.right = this.powerForm.right
+					this.powerShow = false
+				}
+			})
 		}
 	}
+}
 </script>
 
 <style scoped lang="scss">
-	.power > div {
-		margin-bottom: 10px;
-	}
+.power > div {
+	margin-bottom: 10px;
+}
 </style>

+ 167 - 175
src/views/system/menu/index.vue

@@ -23,20 +23,12 @@
 						<div class="tag">菜单管理</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:menu:add']">添加</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
 						<el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll" style="margin-right: 10px">展开/折叠</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
-				<el-table
-					v-if="refreshTable"
-					v-loading="loading"
-					border
-					:data="menuList"
-					row-key="menuId"
-					:default-expand-all="isExpandAll"
-					:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
-				>
+				<el-table v-if="refreshTable" v-loading="loading" border :data="menuList" row-key="menuId" :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
 					<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
 					<el-table-column prop="icon" label="图标" align="center" width="100">
 						<template slot-scope="scope">
@@ -58,9 +50,9 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:menu:edit']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)" v-hasPermi="['system:menu:add']">新增</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:menu:remove']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)">新增</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -215,177 +207,177 @@
 </template>
 
 <script>
-	import { listMenu, getMenu, delMenu, addMenu, updateMenu } from '@/api/system/menu'
-	import Treeselect from '@riophae/vue-treeselect'
-	import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-	import IconSelect from '@/components/IconSelect'
+import { listMenu, getMenu, delMenu, addMenu, updateMenu } from '@/api/system/menu'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import IconSelect from '@/components/IconSelect'
 
-	export default {
-		name: 'Menu',
-		dicts: ['sys_show_hide', 'sys_normal_disable'],
-		components: { Treeselect, IconSelect },
-		data() {
+export default {
+	name: 'Menu',
+	dicts: ['sys_show_hide', 'sys_normal_disable'],
+	components: { Treeselect, IconSelect },
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 菜单表格树数据
+			menuList: [],
+			// 菜单树选项
+			menuOptions: [],
+			// 弹出层标题
+			title: '',
+			// 是否显示弹出层
+			open: false,
+			// 是否展开,默认全部折叠
+			isExpandAll: false,
+			// 重新渲染表格状态
+			refreshTable: true,
+			// 查询参数
+			queryParams: {
+				menuName: undefined,
+				visible: undefined
+			},
+			// 表单参数
+			form: {},
+			// 表单校验
+			rules: {
+				menuName: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }],
+				orderNum: [{ required: true, message: '菜单顺序不能为空', trigger: 'blur' }],
+				path: [{ required: true, message: '路由地址不能为空', trigger: 'blur' }]
+			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		// 选择图标
+		selected(name) {
+			this.form.icon = name
+		},
+		/** 查询菜单列表 */
+		getList() {
+			this.loading = true
+			listMenu(this.queryParams).then(response => {
+				this.menuList = this.handleTree(response.data, 'menuId')
+				this.loading = false
+			})
+		},
+		/** 转换菜单数据结构 */
+		normalizer(node) {
+			if (node.children && !node.children.length) {
+				delete node.children
+			}
 			return {
-				// 遮罩层
-				loading: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 菜单表格树数据
-				menuList: [],
-				// 菜单树选项
-				menuOptions: [],
-				// 弹出层标题
-				title: '',
-				// 是否显示弹出层
-				open: false,
-				// 是否展开,默认全部折叠
-				isExpandAll: false,
-				// 重新渲染表格状态
-				refreshTable: true,
-				// 查询参数
-				queryParams: {
-					menuName: undefined,
-					visible: undefined
-				},
-				// 表单参数
-				form: {},
-				// 表单校验
-				rules: {
-					menuName: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }],
-					orderNum: [{ required: true, message: '菜单顺序不能为空', trigger: 'blur' }],
-					path: [{ required: true, message: '路由地址不能为空', trigger: 'blur' }]
-				}
+				id: node.menuId,
+				label: node.menuName,
+				children: node.children
+			}
+		},
+		/** 查询菜单下拉树结构 */
+		getTreeselect() {
+			listMenu().then(response => {
+				this.menuOptions = []
+				const menu = { menuId: 0, menuName: '主类目', children: [] }
+				menu.children = this.handleTree(response.data, 'menuId')
+				this.menuOptions.push(menu)
+			})
+		},
+		// 取消按钮
+		cancel() {
+			this.open = false
+			this.reset()
+		},
+		// 表单重置
+		reset() {
+			this.form = {
+				menuId: undefined,
+				parentId: 0,
+				menuName: undefined,
+				icon: undefined,
+				menuType: 'M',
+				orderNum: undefined,
+				isFrame: '1',
+				isCache: '0',
+				visible: '0',
+				status: '0'
 			}
+			this.resetForm('form')
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
 			this.getList()
 		},
-		methods: {
-			// 选择图标
-			selected(name) {
-				this.form.icon = name
-			},
-			/** 查询菜单列表 */
-			getList() {
-				this.loading = true
-				listMenu(this.queryParams).then((response) => {
-					this.menuList = this.handleTree(response.data, 'menuId')
-					this.loading = false
-				})
-			},
-			/** 转换菜单数据结构 */
-			normalizer(node) {
-				if (node.children && !node.children.length) {
-					delete node.children
-				}
-				return {
-					id: node.menuId,
-					label: node.menuName,
-					children: node.children
-				}
-			},
-			/** 查询菜单下拉树结构 */
-			getTreeselect() {
-				listMenu().then((response) => {
-					this.menuOptions = []
-					const menu = { menuId: 0, menuName: '主类目', children: [] }
-					menu.children = this.handleTree(response.data, 'menuId')
-					this.menuOptions.push(menu)
-				})
-			},
-			// 取消按钮
-			cancel() {
-				this.open = false
-				this.reset()
-			},
-			// 表单重置
-			reset() {
-				this.form = {
-					menuId: undefined,
-					parentId: 0,
-					menuName: undefined,
-					icon: undefined,
-					menuType: 'M',
-					orderNum: undefined,
-					isFrame: '1',
-					isCache: '0',
-					visible: '0',
-					status: '0'
-				}
-				this.resetForm('form')
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			/** 新增按钮操作 */
-			handleAdd(row) {
-				this.reset()
-				this.getTreeselect()
-				if (row != null && row.menuId) {
-					this.form.parentId = row.menuId
-				} else {
-					this.form.parentId = 0
-				}
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		/** 新增按钮操作 */
+		handleAdd(row) {
+			this.reset()
+			this.getTreeselect()
+			if (row != null && row.menuId) {
+				this.form.parentId = row.menuId
+			} else {
+				this.form.parentId = 0
+			}
+			this.open = true
+			this.title = '添加菜单'
+		},
+		/** 展开/折叠操作 */
+		toggleExpandAll() {
+			this.refreshTable = false
+			this.isExpandAll = !this.isExpandAll
+			this.$nextTick(() => {
+				this.refreshTable = true
+			})
+		},
+		/** 修改按钮操作 */
+		handleUpdate(row) {
+			this.reset()
+			this.getTreeselect()
+			getMenu(row.menuId).then(response => {
+				this.form = response.data
 				this.open = true
-				this.title = '添加菜单'
-			},
-			/** 展开/折叠操作 */
-			toggleExpandAll() {
-				this.refreshTable = false
-				this.isExpandAll = !this.isExpandAll
-				this.$nextTick(() => {
-					this.refreshTable = true
-				})
-			},
-			/** 修改按钮操作 */
-			handleUpdate(row) {
-				this.reset()
-				this.getTreeselect()
-				getMenu(row.menuId).then((response) => {
-					this.form = response.data
-					this.open = true
-					this.title = '修改菜单'
-				})
-			},
-			/** 提交按钮 */
-			submitForm: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.menuId != undefined) {
-							updateMenu(this.form).then((response) => {
-								this.$modal.msgSuccess('修改成功')
-								this.open = false
-								this.getList()
-							})
-						} else {
-							addMenu(this.form).then((response) => {
-								this.$modal.msgSuccess('新增成功')
-								this.open = false
-								this.getList()
-							})
-						}
+				this.title = '修改菜单'
+			})
+		},
+		/** 提交按钮 */
+		submitForm: function () {
+			this.$refs['form'].validate(valid => {
+				if (valid) {
+					if (this.form.menuId != undefined) {
+						updateMenu(this.form).then(response => {
+							this.$modal.msgSuccess('修改成功')
+							this.open = false
+							this.getList()
+						})
+					} else {
+						addMenu(this.form).then(response => {
+							this.$modal.msgSuccess('新增成功')
+							this.open = false
+							this.getList()
+						})
 					}
+				}
+			})
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			this.$modal
+				.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?')
+				.then(function () {
+					return delMenu(row.menuId)
 				})
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				this.$modal
-					.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?')
-					.then(function () {
-						return delMenu(row.menuId)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
+				})
+				.catch(() => {})
 		}
 	}
+}
 </script>

+ 126 - 126
src/views/system/notice/index.vue

@@ -26,7 +26,7 @@
 						<div class="tag">通知公告</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:notice:add']" style="margin-right: 10px">添加</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" style="margin-right: 10px">添加</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
@@ -51,8 +51,8 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:notice:edit']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice:remove']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -100,137 +100,137 @@
 </template>
 
 <script>
-	import { listNotice, getNotice, delNotice, addNotice, updateNotice } from '@/api/system/notice'
+import { listNotice, getNotice, delNotice, addNotice, updateNotice } from '@/api/system/notice'
 
-	export default {
-		name: 'Notice',
-		dicts: ['sys_notice_status', 'sys_notice_type'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 选中数组
-				ids: [],
-				// 非单个禁用
-				single: true,
-				// 非多个禁用
-				multiple: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 公告表格数据
-				noticeList: [],
-				// 弹出层标题
-				title: '',
-				// 是否显示弹出层
-				open: false,
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					noticeTitle: undefined,
-					createBy: undefined,
-					status: undefined
-				},
-				// 表单参数
-				form: {},
-				// 表单校验
-				rules: {
-					noticeTitle: [{ required: true, message: '公告标题不能为空', trigger: 'blur' }],
-					noticeType: [{ required: true, message: '公告类型不能为空', trigger: 'change' }]
-				}
+export default {
+	name: 'Notice',
+	dicts: ['sys_notice_status', 'sys_notice_type'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 选中数组
+			ids: [],
+			// 非单个禁用
+			single: true,
+			// 非多个禁用
+			multiple: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 公告表格数据
+			noticeList: [],
+			// 弹出层标题
+			title: '',
+			// 是否显示弹出层
+			open: false,
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				noticeTitle: undefined,
+				createBy: undefined,
+				status: undefined
+			},
+			// 表单参数
+			form: {},
+			// 表单校验
+			rules: {
+				noticeTitle: [{ required: true, message: '公告标题不能为空', trigger: 'blur' }],
+				noticeType: [{ required: true, message: '公告类型不能为空', trigger: 'change' }]
+			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询公告列表 */
+		getList() {
+			this.loading = true
+			listNotice(this.queryParams).then(response => {
+				this.noticeList = response.rows
+				this.total = response.total
+				this.loading = false
+			})
+		},
+		// 取消按钮
+		cancel() {
+			this.open = false
+			this.reset()
+		},
+		// 表单重置
+		reset() {
+			this.form = {
+				noticeId: undefined,
+				noticeTitle: undefined,
+				noticeType: undefined,
+				noticeContent: undefined,
+				status: '0'
 			}
+			this.resetForm('form')
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
 			this.getList()
 		},
-		methods: {
-			/** 查询公告列表 */
-			getList() {
-				this.loading = true
-				listNotice(this.queryParams).then((response) => {
-					this.noticeList = response.rows
-					this.total = response.total
-					this.loading = false
-				})
-			},
-			// 取消按钮
-			cancel() {
-				this.open = false
-				this.reset()
-			},
-			// 表单重置
-			reset() {
-				this.form = {
-					noticeId: undefined,
-					noticeTitle: undefined,
-					noticeType: undefined,
-					noticeContent: undefined,
-					status: '0'
-				}
-				this.resetForm('form')
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			/** 新增按钮操作 */
-			handleAdd() {
-				this.reset()
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		/** 新增按钮操作 */
+		handleAdd() {
+			this.reset()
+			this.open = true
+			this.title = '添加公告'
+		},
+		/** 修改按钮操作 */
+		handleUpdate(row) {
+			this.reset()
+			const noticeId = row.noticeId || this.ids
+			getNotice(noticeId).then(response => {
+				this.form = response.data
 				this.open = true
-				this.title = '添加公告'
-			},
-			/** 修改按钮操作 */
-			handleUpdate(row) {
-				this.reset()
-				const noticeId = row.noticeId || this.ids
-				getNotice(noticeId).then((response) => {
-					this.form = response.data
-					this.open = true
-					this.title = '修改公告'
-				})
-			},
-			/** 提交按钮 */
-			submitForm: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.noticeId != undefined) {
-							updateNotice(this.form).then((response) => {
-								this.$modal.msgSuccess('修改成功')
-								this.open = false
-								this.getList()
-							})
-						} else {
-							addNotice(this.form).then((response) => {
-								this.$modal.msgSuccess('新增成功')
-								this.open = false
-								this.getList()
-							})
-						}
+				this.title = '修改公告'
+			})
+		},
+		/** 提交按钮 */
+		submitForm: function () {
+			this.$refs['form'].validate(valid => {
+				if (valid) {
+					if (this.form.noticeId != undefined) {
+						updateNotice(this.form).then(response => {
+							this.$modal.msgSuccess('修改成功')
+							this.open = false
+							this.getList()
+						})
+					} else {
+						addNotice(this.form).then(response => {
+							this.$modal.msgSuccess('新增成功')
+							this.open = false
+							this.getList()
+						})
 					}
+				}
+			})
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const noticeIds = row.noticeId || this.ids
+			this.$modal
+				.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?')
+				.then(function () {
+					return delNotice(noticeIds)
 				})
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const noticeIds = row.noticeId || this.ids
-				this.$modal
-					.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?')
-					.then(function () {
-						return delNotice(noticeIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			}
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
+				})
+				.catch(() => {})
 		}
 	}
+}
 </script>

+ 331 - 331
src/views/system/post/index.vue

@@ -22,8 +22,8 @@
 					<el-table-column label="描述" prop="remarks" />
 					<el-table-column label="操作" class-name="small-padding fixed-width" width="300" align="center">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['system:role:edit']" @click="handleUpdate(scope.row)">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete-solid" v-hasPermi="['system:role:remove']" @click="handleDelete(scope.row)">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete-solid" @click="handleDelete(scope.row)">删除</el-button>
 							<el-button size="mini" type="text" icon="el-icon-top" @click="natureRise(scope.row, scope.$index)">上升</el-button>
 							<el-button size="mini" type="text" icon="el-icon-bottom" @click="natureDecline(scope.row, scope.$index)">下降</el-button>
 						</template>
@@ -86,368 +86,368 @@
 </template>
 
 <script>
-	import { listPost, getPost, delPost, addPost, updatePost, updateSortPost, getNature, addNature, delNature, updateNature, getNatureByNatureId, updateSortNature } from '@/api/system/post'
+import { listPost, getPost, delPost, addPost, updatePost, updateSortPost, getNature, addNature, delNature, updateNature, getNatureByNatureId, updateSortNature } from '@/api/system/post'
 
-	export default {
-		name: 'Post',
-		dicts: ['sys_normal_disable'],
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 岗位表格数据
-				postList: [],
-				// 弹出层标题
-				title: '',
-				// 是否显示弹出层
-				natureOpen: false,
-				// 查询参数
-				queryParams: {
-					natureId: 0,
-					postName: ''
-				},
-				// 表单参数
-				form: {},
-				// 表单校验
-				rules: {
-					natureName: [{ required: true, message: '性质不能为空', trigger: 'blur' }]
-				},
-				rulesPost: {
-					postName: [{ required: true, message: '岗位不能为空', trigger: 'blur' }]
-				},
-				over: 1,
-				natureShow: true,
-				postShow: false, //
-				postOpen: false,
-				getIndex: 0,
-				getIndex1: 0,
-				natureList: [], // 性质列表
-				perId: 0, // 前一个id
-				decId: 0, // 后一个id
-				natureName: '',
-				formPost: {},
-				nature: {},
-				perPostId: 0,
-				decPostId: 0,
-				natureObj: {}
-			}
-		},
-		created() {
-			this.getList()
-		},
-		methods: {
-			/** 查询岗位列表 */
-			getList() {
-				this.loading = true
-				getNature().then((response) => {
-					this.natureList = response.data
-					this.loading = false
-				})
-			},
-			// 性质列表
-			getNature() {
-				this.getList()
-				this.over = 1
-				this.natureShow = true
-				this.postShow = false
-			},
-			// 岗位列表
-			getPostList() {
-				this.getList()
-				this.over = 2
-				this.natureShow = false
-				this.postShow = true
-				this.natureLineDbclick(this.natureObj)
-			},
-			//为行对象(row)设置index属性
-			tableRowClassName({ row, rowIndex }) {
-				row.index = rowIndex
-			},
-			// 单击性质表格某一行
-			natureLineClick(row, event, column) {
-				this.getIndex = row.index
-				this.natureObj = row
-			},
-			// 双击性质表格某一行
-			natureLineDbclick(row) {
-				console.log(row)
-				this.queryParams.natureId = row.natureId
-				this.natureName = row.natureName
-				this.nature = row
-				listPost(this.queryParams).then((res) => {
-					if (res.code === 200) {
-						this.postList = res.data
-						this.natureShow = false
-						this.postShow = true
-						this.over = 2
-					}
-				})
-			},
-			// 单击岗位表格某一行
-			postLineClick(row, event, column) {
-				this.getIndex1 = row.index
+export default {
+	name: 'Post',
+	dicts: ['sys_normal_disable'],
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 岗位表格数据
+			postList: [],
+			// 弹出层标题
+			title: '',
+			// 是否显示弹出层
+			natureOpen: false,
+			// 查询参数
+			queryParams: {
+				natureId: 0,
+				postName: ''
 			},
-			// 取消按钮
-			cancelNature() {
-				this.natureOpen = false
-				this.form = {}
+			// 表单参数
+			form: {},
+			// 表单校验
+			rules: {
+				natureName: [{ required: true, message: '性质不能为空', trigger: 'blur' }]
 			},
-			// 取消岗位
-			cancelPost() {
-				this.postOpen = false
-				this.formPost = {}
+			rulesPost: {
+				postName: [{ required: true, message: '岗位不能为空', trigger: 'blur' }]
 			},
-			// 岗位添加提交
-			submitFormPost() {
-				this.$refs['formPost'].validate((valid) => {
-					if (valid) {
-						if (this.formPost.postId != undefined) {
-							updatePost(this.formPost).then((response) => {
-								this.$msg({ message: '修改成功' })
+			over: 1,
+			natureShow: true,
+			postShow: false, //
+			postOpen: false,
+			getIndex: 0,
+			getIndex1: 0,
+			natureList: [], // 性质列表
+			perId: 0, // 前一个id
+			decId: 0, // 后一个id
+			natureName: '',
+			formPost: {},
+			nature: {},
+			perPostId: 0,
+			decPostId: 0,
+			natureObj: {}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	methods: {
+		/** 查询岗位列表 */
+		getList() {
+			this.loading = true
+			getNature().then(response => {
+				this.natureList = response.data
+				this.loading = false
+			})
+		},
+		// 性质列表
+		getNature() {
+			this.getList()
+			this.over = 1
+			this.natureShow = true
+			this.postShow = false
+		},
+		// 岗位列表
+		getPostList() {
+			this.getList()
+			this.over = 2
+			this.natureShow = false
+			this.postShow = true
+			this.natureLineDbclick(this.natureObj)
+		},
+		//为行对象(row)设置index属性
+		tableRowClassName({ row, rowIndex }) {
+			row.index = rowIndex
+		},
+		// 单击性质表格某一行
+		natureLineClick(row, event, column) {
+			this.getIndex = row.index
+			this.natureObj = row
+		},
+		// 双击性质表格某一行
+		natureLineDbclick(row) {
+			console.log(row)
+			this.queryParams.natureId = row.natureId
+			this.natureName = row.natureName
+			this.nature = row
+			listPost(this.queryParams).then(res => {
+				if (res.code === 200) {
+					this.postList = res.data
+					this.natureShow = false
+					this.postShow = true
+					this.over = 2
+				}
+			})
+		},
+		// 单击岗位表格某一行
+		postLineClick(row, event, column) {
+			this.getIndex1 = row.index
+		},
+		// 取消按钮
+		cancelNature() {
+			this.natureOpen = false
+			this.form = {}
+		},
+		// 取消岗位
+		cancelPost() {
+			this.postOpen = false
+			this.formPost = {}
+		},
+		// 岗位添加提交
+		submitFormPost() {
+			this.$refs['formPost'].validate(valid => {
+				if (valid) {
+					if (this.formPost.postId != undefined) {
+						updatePost(this.formPost).then(response => {
+							this.$msg({ message: '修改成功' })
+							this.postOpen = false
+							this.getList()
+							this.natureLineDbclick(this.nature)
+						})
+					} else {
+						if (this.postList.length > 0) {
+							this.formPost.natureId = this.queryParams.natureId
+							this.formPost.postSort = parseInt(this.postList[0].postSort) + 1
+							addPost(this.formPost).then(response => {
+								this.$msg({ message: '添加成功' })
+								this.formPost = {}
 								this.postOpen = false
 								this.getList()
 								this.natureLineDbclick(this.nature)
 							})
 						} else {
-							if (this.postList.length > 0) {
-								this.formPost.natureId = this.queryParams.natureId
-								this.formPost.postSort = parseInt(this.postList[0].postSort) + 1
-								addPost(this.formPost).then((response) => {
-									this.$msg({ message: '添加成功' })
-									this.formPost = {}
-									this.postOpen = false
-									this.getList()
-									this.natureLineDbclick(this.nature)
-								})
-							} else {
-								this.formPost.postSort = 1
-								this.formPost.natureId = this.queryParams.natureId
-								addPost(this.formPost).then((response) => {
-									this.$msg({ message: '添加成功' })
-									this.formPost = {}
-									this.formPost.postSort = null
-									this.postOpen = false
-									this.getList()
-									this.natureLineDbclick(this.nature)
-								})
-							}
+							this.formPost.postSort = 1
+							this.formPost.natureId = this.queryParams.natureId
+							addPost(this.formPost).then(response => {
+								this.$msg({ message: '添加成功' })
+								this.formPost = {}
+								this.formPost.postSort = null
+								this.postOpen = false
+								this.getList()
+								this.natureLineDbclick(this.nature)
+							})
 						}
 					}
-				})
-			},
-			/** 新增性质按钮操作 */
-			handleAddNature() {
+				}
+			})
+		},
+		/** 新增性质按钮操作 */
+		handleAddNature() {
+			this.natureOpen = true
+			this.title = '性质添加'
+		},
+		// 新增岗位
+		handleAddPost() {
+			this.title = '岗位添加'
+			this.postOpen = true
+		},
+		/** 修改性质按钮操作 */
+		handleUpdate(row) {
+			getNatureByNatureId(row.natureId).then(response => {
+				this.form = response.data
 				this.natureOpen = true
-				this.title = '性质添加'
-			},
-			// 新增岗位
-			handleAddPost() {
-				this.title = '岗位添加'
+				this.title = '修改性质'
+			})
+		},
+		// 修改岗位按钮
+		updataPost(row) {
+			getPost(row.postId).then(res => {
+				this.formPost = res.data
 				this.postOpen = true
-			},
-			/** 修改性质按钮操作 */
-			handleUpdate(row) {
-				getNatureByNatureId(row.natureId).then((response) => {
-					this.form = response.data
-					this.natureOpen = true
-					this.title = '修改性质'
+				this.title = '修改岗位'
+			})
+		},
+		// 删除岗位
+		deletePost(row) {
+			this.$modal
+				.confirm('是否确认删除岗位为"' + row.postName + '"的数据项?')
+				.then(function () {
+					return delPost(row.postId)
 				})
-			},
-			// 修改岗位按钮
-			updataPost(row) {
-				getPost(row.postId).then((res) => {
-					this.formPost = res.data
-					this.postOpen = true
-					this.title = '修改岗位'
+				.then(res => {
+					console.log(res)
+					if (res.code === 200) {
+						this.getList()
+						this.natureLineDbclick(this.nature)
+						this.$msg({ message: '删除成功' })
+					} else if (res.code === 500) {
+						this.getList()
+						this.$notify({ title: '警告', message: res.msg, type: 'warning' })
+					}
 				})
-			},
-			// 删除岗位
-			deletePost(row) {
-				this.$modal
-					.confirm('是否确认删除岗位为"' + row.postName + '"的数据项?')
-					.then(function () {
-						return delPost(row.postId)
-					})
-					.then((res) => {
-						console.log(res)
-						if (res.code === 200) {
-							this.getList()
-							this.natureLineDbclick(this.nature)
-							this.$msg({ message: '删除成功' })
-						} else if (res.code === 500) {
+				.catch(() => {})
+		},
+		/** 性质提交按钮 */
+		submitFormNature: function () {
+			this.$refs['form'].validate(valid => {
+				if (valid) {
+					if (this.form.natureId != undefined) {
+						updateNature(this.form).then(response => {
+							this.$modal.msgSuccess('修改成功')
+							this.natureOpen = false
 							this.getList()
-							this.$notify({ title: '警告', message: res.msg, type: 'warning' })
-						}
-					})
-					.catch(() => {})
-			},
-			/** 性质提交按钮 */
-			submitFormNature: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.natureId != undefined) {
-							updateNature(this.form).then((response) => {
-								this.$modal.msgSuccess('修改成功')
+						})
+					} else {
+						if (this.natureList.length > 0) {
+							this.form.natureSort = parseInt(this.natureList[0].natureSort) + 1
+							addNature(this.form).then(response => {
+								this.$modal.msgSuccess('新增成功')
+								this.form = {}
 								this.natureOpen = false
 								this.getList()
 							})
 						} else {
-							if (this.natureList.length > 0) {
-								this.form.natureSort = parseInt(this.natureList[0].natureSort) + 1
-								addNature(this.form).then((response) => {
-									this.$modal.msgSuccess('新增成功')
-									this.form = {}
-									this.natureOpen = false
-									this.getList()
-								})
-							} else {
-								this.form.natureSort = 1
-								addNature(this.form).then((response) => {
-									console.log(response)
-									this.$modal.msgSuccess('新增成功')
-									this.form = {}
-									this.form.natureSort = null
-									this.natureOpen = false
-									this.getList()
-								})
-							}
+							this.form.natureSort = 1
+							addNature(this.form).then(response => {
+								console.log(response)
+								this.$modal.msgSuccess('新增成功')
+								this.form = {}
+								this.form.natureSort = null
+								this.natureOpen = false
+								this.getList()
+							})
 						}
 					}
-				})
-			},
-			// 性质上升
-			natureRise(row, rowIndex) {
-				console.log(rowIndex)
-				this.perId = row.natureSort
-				let sysNatureEditBOs = []
-				let item = {}
-				let previous = {}
-				if (rowIndex === 0) {
-					this.$notify({ title: '警告', message: '已经是最高级,无法上升!', type: 'warning' })
-				} else {
-					row.natureSort = this.natureList[rowIndex - 1].natureSort
-					this.natureList[rowIndex - 1].natureSort = this.perId
-					item = {
-						natureId: row.natureId,
-						natureSort: row.natureSort
-					}
-					previous = {
-						natureId: this.natureList[rowIndex - 1].natureId,
-						natureSort: this.natureList[rowIndex - 1].natureSort
-					}
-					sysNatureEditBOs = [item, previous]
-					updateSortNature(sysNatureEditBOs).then((res) => {
-						if (res.code === 200) {
-							this.$msg({ message: '设置成功' })
-							this.getList()
-						}
-					})
 				}
-			},
-			// 岗位上升
-			postRise(row, rowIndex) {
-				this.perPostId = row.postSort
-				let sysNatureEditBOs = []
-				let item = {}
-				let previous = {}
-				if (rowIndex === 0) {
-					this.$notify({ title: '警告', message: '已经是最高级,无法上升!', type: 'warning' })
-				} else {
-					row.postSort = this.postList[rowIndex - 1].postSort
-					this.postList[rowIndex - 1].postSort = this.perPostId
-					item = {
-						postId: row.postId,
-						postSort: row.postSort
-					}
-					previous = {
-						postId: this.postList[rowIndex - 1].postId,
-						postSort: this.postList[rowIndex - 1].postSort
-					}
-					sysNatureEditBOs = [item, previous]
-					updateSortPost(sysNatureEditBOs).then((res) => {
-						if (res.code === 200) {
-							this.$msg({ message: '设置成功' })
-							this.getList()
-							this.natureLineDbclick(this.nature)
-						}
-					})
+			})
+		},
+		// 性质上升
+		natureRise(row, rowIndex) {
+			console.log(rowIndex)
+			this.perId = row.natureSort
+			let sysNatureEditBOs = []
+			let item = {}
+			let previous = {}
+			if (rowIndex === 0) {
+				this.$notify({ title: '警告', message: '已经是最高级,无法上升!', type: 'warning' })
+			} else {
+				row.natureSort = this.natureList[rowIndex - 1].natureSort
+				this.natureList[rowIndex - 1].natureSort = this.perId
+				item = {
+					natureId: row.natureId,
+					natureSort: row.natureSort
 				}
-			},
-			// 性质下降
-			natureDecline(row, rowIndex) {
-				this.decId = row.natureSort
-				let sysNatureEditBOs = []
-				let item = {}
-				let previous = {}
-				if (rowIndex === this.natureList.length - 1) {
-					this.$notify({ title: '警告', message: '已经是最低级,无法下降!', type: 'warning' })
-				} else {
-					row.natureSort = this.natureList[rowIndex + 1].natureSort
-					this.natureList[rowIndex + 1].natureSort = this.decId
-					item = {
-						natureId: row.natureId,
-						natureSort: row.natureSort
-					}
-					previous = {
-						natureId: this.natureList[rowIndex + 1].natureId,
-						natureSort: this.natureList[rowIndex + 1].natureSort
+				previous = {
+					natureId: this.natureList[rowIndex - 1].natureId,
+					natureSort: this.natureList[rowIndex - 1].natureSort
+				}
+				sysNatureEditBOs = [item, previous]
+				updateSortNature(sysNatureEditBOs).then(res => {
+					if (res.code === 200) {
+						this.$msg({ message: '设置成功' })
+						this.getList()
 					}
-					sysNatureEditBOs = [item, previous]
-					updateSortNature(sysNatureEditBOs).then((res) => {
-						if (res.code === 200) {
-							this.$msg({ message: '设置成功' })
-							this.getList()
-						}
-					})
+				})
+			}
+		},
+		// 岗位上升
+		postRise(row, rowIndex) {
+			this.perPostId = row.postSort
+			let sysNatureEditBOs = []
+			let item = {}
+			let previous = {}
+			if (rowIndex === 0) {
+				this.$notify({ title: '警告', message: '已经是最高级,无法上升!', type: 'warning' })
+			} else {
+				row.postSort = this.postList[rowIndex - 1].postSort
+				this.postList[rowIndex - 1].postSort = this.perPostId
+				item = {
+					postId: row.postId,
+					postSort: row.postSort
 				}
-			},
-			// 岗位下降
-			postDecline(row, rowIndex) {
-				this.decPostId = row.postSort
-				let sysNatureEditBOs = []
-				let item = {}
-				let previous = {}
-				if (rowIndex === this.postList.length - 1) {
-					this.$notify({ title: '警告', message: '已经是最低级,无法下降!', type: 'warning' })
-				} else {
-					row.postSort = this.postList[rowIndex + 1].postSort
-					this.postList[rowIndex + 1].postSort = this.decPostId
-					item = {
-						postId: row.postId,
-						postSort: row.postSort
+				previous = {
+					postId: this.postList[rowIndex - 1].postId,
+					postSort: this.postList[rowIndex - 1].postSort
+				}
+				sysNatureEditBOs = [item, previous]
+				updateSortPost(sysNatureEditBOs).then(res => {
+					if (res.code === 200) {
+						this.$msg({ message: '设置成功' })
+						this.getList()
+						this.natureLineDbclick(this.nature)
 					}
-					previous = {
-						postId: this.postList[rowIndex + 1].postId,
-						postSort: this.postList[rowIndex + 1].postSort
+				})
+			}
+		},
+		// 性质下降
+		natureDecline(row, rowIndex) {
+			this.decId = row.natureSort
+			let sysNatureEditBOs = []
+			let item = {}
+			let previous = {}
+			if (rowIndex === this.natureList.length - 1) {
+				this.$notify({ title: '警告', message: '已经是最低级,无法下降!', type: 'warning' })
+			} else {
+				row.natureSort = this.natureList[rowIndex + 1].natureSort
+				this.natureList[rowIndex + 1].natureSort = this.decId
+				item = {
+					natureId: row.natureId,
+					natureSort: row.natureSort
+				}
+				previous = {
+					natureId: this.natureList[rowIndex + 1].natureId,
+					natureSort: this.natureList[rowIndex + 1].natureSort
+				}
+				sysNatureEditBOs = [item, previous]
+				updateSortNature(sysNatureEditBOs).then(res => {
+					if (res.code === 200) {
+						this.$msg({ message: '设置成功' })
+						this.getList()
 					}
-					sysNatureEditBOs = [item, previous]
-					updateSortPost(sysNatureEditBOs).then((res) => {
-						if (res.code === 200) {
-							this.$msg({ message: '设置成功' })
-							this.getList()
-							this.natureLineDbclick(this.nature)
-						}
-					})
+				})
+			}
+		},
+		// 岗位下降
+		postDecline(row, rowIndex) {
+			this.decPostId = row.postSort
+			let sysNatureEditBOs = []
+			let item = {}
+			let previous = {}
+			if (rowIndex === this.postList.length - 1) {
+				this.$notify({ title: '警告', message: '已经是最低级,无法下降!', type: 'warning' })
+			} else {
+				row.postSort = this.postList[rowIndex + 1].postSort
+				this.postList[rowIndex + 1].postSort = this.decPostId
+				item = {
+					postId: row.postId,
+					postSort: row.postSort
 				}
-			},
-			/** 删除性质按钮操作 */
-			handleDelete(row) {
-				this.$modal
-					.confirm('是否确认删除性质为"' + row.natureName + '"的数据项?')
-					.then(function () {
-						return delNature(row.natureId)
-					})
-					.then(() => {
+				previous = {
+					postId: this.postList[rowIndex + 1].postId,
+					postSort: this.postList[rowIndex + 1].postSort
+				}
+				sysNatureEditBOs = [item, previous]
+				updateSortPost(sysNatureEditBOs).then(res => {
+					if (res.code === 200) {
+						this.$msg({ message: '设置成功' })
 						this.getList()
-						this.$msg({ message: '删除成功' })
-					})
-					.catch(() => {})
+						this.natureLineDbclick(this.nature)
+					}
+				})
 			}
+		},
+		/** 删除性质按钮操作 */
+		handleDelete(row) {
+			this.$modal
+				.confirm('是否确认删除性质为"' + row.natureName + '"的数据项?')
+				.then(function () {
+					return delNature(row.natureId)
+				})
+				.then(() => {
+					this.getList()
+					this.$msg({ message: '删除成功' })
+				})
+				.catch(() => {})
 		}
 	}
+}
 </script>
 <style scoped>
-	.activeClass {
-		color: #409eff;
-	}
+.activeClass {
+	color: #409eff;
+}
 </style>

+ 11 - 5
src/views/system/role/index.vue

@@ -9,7 +9,7 @@
 						<div class="tag" :class="{ activeClass: over == 3 }" @click="getHeaderPermission">表头权限</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini " @click="handleAdd" v-show="roleShow" v-hasPermi="['system:role:add']">添加</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini " @click="handleAdd" v-show="roleShow">添加</el-button>
 					</div>
 				</div>
 
@@ -33,10 +33,10 @@
 					</el-table-column>
 					<el-table-column align="center" label="操作" class-name="small-padding fixed-width" width="300">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['system:role:edit']" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
 							<el-button size="mini" type="text" icon="el-icon-remove-outline" @click="handleStatusChange(scope.row)">{{ scope.row.status == '0' ? '禁用' : '启用' }}</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete-solid" v-hasPermi="['system:role:remove']" @click="handleDelete(scope.row)">删除</el-button>
-							<el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['system:role:edit']" @click="roleDepartments(scope.row)">角色部门</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete-solid" @click="handleDelete(scope.row)">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="roleDepartments(scope.row)">角色部门</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -220,6 +220,10 @@ export default {
 		},
 		// 表头权限;列表
 		getHeaderPermission() {
+			if (Object.keys(this.objFun).length === 0) {
+				this.$msg({ type: 'warning', message: '请选择菜单' })
+				return
+			}
 			this.functionalLineDbclick(this.objFun)
 			this.getList()
 		},
@@ -290,7 +294,9 @@ export default {
 			this.menuId = row.menuId
 			this.checkStatus = this.isChecked(row) ? 0 : 1
 			getTableHeadList(this.roleId, row.menuId, this.checkStatus).then(res => {
-				this.headList = res.data
+				if (res.code === 200) {
+					this.headList = res.data
+				}
 			})
 		},
 		// 单击表头权限表格某一行

+ 199 - 205
src/views/system/tableHead/index.vue

@@ -3,7 +3,7 @@
 		<div class="search-container" v-show="menuId">
 			<span style="margin-right: 12px"><strong>表头名称</strong></span>
 			<el-input v-model="queryParams.columnName" placeholder="输入表头名称" clearable size="small" style="width: 150px" />
-			<el-button type="primary" icon="el-icon-search" size="small " style="margin-left: 20px" @click="getList" v-hasPermi="['system:tableHead:listTable']">搜索</el-button>
+			<el-button type="primary" icon="el-icon-search" size="small " style="margin-left: 20px" @click="getList">搜索</el-button>
 		</div>
 		<div class="content-container">
 			<TreeChoice :dataList="menuList" nodeKey="id" nodeVal="menuName" @itemClick="menuClick" />
@@ -13,9 +13,7 @@
 						<div class="tag">表头管理</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini " style="margin: 0 0 10px 3px" @click="handleAdd" v-hasPermi="['system:tableHead:addTable']" :disabled="!menuId"
-							>添加</el-button
-						>
+						<el-button type="primary" icon="el-icon-plus" size="mini " style="margin: 0 0 10px 3px" @click="handleAdd" :disabled="!menuId">添加</el-button>
 					</div>
 				</div>
 				<el-table v-loading="loading" :data="tableHeadList" border>
@@ -30,8 +28,8 @@
 					</el-table-column>
 					<el-table-column label="操作" align="center" class-name="small-padding" width="300">
 						<template slot-scope="scope" v-if="scope.row.roleId !== 1">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:tableHead:updTable']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:tableHead:delTable']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -39,7 +37,7 @@
 				<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
 			</div>
 		</div>
-		<el-dialog title="添加表头" :visible.sync="open" width="500px" append-to-body>
+		<el-dialog title="添加表头" :visible.sync="open" width="500px" append-to-body @close="cancel">
 			<el-form ref="form" :model="form" :rules="rules" label-width="100px">
 				<el-form-item label="所属菜单" prop="menuId">
 					<el-input disabled :value="menuName" />
@@ -71,220 +69,216 @@
 </template>
 
 <script>
-	import { listMenu, tableHeadAdd, tableHeadList, tableHeadUpd, tableHeadDel } from '@/api/system/tableHead'
-	import { checkPermi } from '@/utils/permission'
-	import TreeChoice from '@/components/treeChoice/index.vue'
-	export default {
-		name: 'TableHead',
-		dicts: ['sys_tableHead_required'],
-		components: {
-			TreeChoice
-		},
-		data() {
-			return {
-				tabIndex: 1,
-				//遮罩层
-				loading: false,
-				//菜单数据
-				menuList: [],
-				//选中的菜单id
-				menuId: 0,
-				//选中菜单名称
-				menuName: '',
-				//表头数据
-				tableHeadList: [],
-				//总条数
-				total: 0,
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					columnName: undefined
-				},
-				//弹窗显示
-				open: false,
-				form: {
-					menuId: null,
-					columnName: '',
-					uiColumn: '',
-					apiColum: '',
-					required: '0',
-					orderNum: ''
-				},
-				//表单验证
-				rules: {
-					columnName: [{ required: true, message: '列名称不能为空', trigger: 'submit' }],
-					uiColumn: [{ required: true, message: '前端列名不能为空', trigger: 'submit' }],
-					apiColum: [{ required: true, message: '后端列名不能为空', trigger: 'submit' }],
-					orderNum: [
-						{ required: true, message: '排序值不能为空', trigger: 'submit' },
-						{ type: 'number', message: '排序值只能为数字', trigger: 'submit' }
-					]
-				}
+import { listMenu, tableHeadAdd, tableHeadList, tableHeadUpd, tableHeadDel } from '@/api/system/tableHead'
+import TreeChoice from '@/components/treeChoice/index.vue'
+export default {
+	name: 'TableHead',
+	dicts: ['sys_tableHead_required'],
+	components: {
+		TreeChoice
+	},
+	data() {
+		return {
+			tabIndex: 1,
+			//遮罩层
+			loading: false,
+			//菜单数据
+			menuList: [],
+			//选中的菜单id
+			menuId: 0,
+			//选中菜单名称
+			menuName: '',
+			//表头数据
+			tableHeadList: [],
+			//总条数
+			total: 0,
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				columnName: undefined
+			},
+			//弹窗显示
+			open: false,
+			form: {
+				menuId: null,
+				columnName: '',
+				uiColumn: '',
+				apiColum: '',
+				required: '0',
+				orderNum: ''
+			},
+			//表单验证
+			rules: {
+				columnName: [{ required: true, message: '列名称不能为空', trigger: 'submit' }],
+				uiColumn: [{ required: true, message: '前端列名不能为空', trigger: 'submit' }],
+				apiColum: [{ required: true, message: '后端列名不能为空', trigger: 'submit' }],
+				orderNum: [
+					{ required: true, message: '排序值不能为空', trigger: 'submit' },
+					{ type: 'number', message: '排序值只能为数字', trigger: 'submit' }
+				]
 			}
+		}
+	},
+	created() {
+		this.getMenuList()
+	},
+	methods: {
+		//获取菜单
+		getMenuList() {
+			listMenu().then(res => {
+				if (res.code == 200) {
+					this.menuList = this.handleTree(res.data, 'menuId', 'parentId')
+				}
+			})
 		},
-		created() {
-			this.getMenuList()
-		},
-		methods: {
-			//获取菜单
-			getMenuList() {
-				listMenu().then((res) => {
-					if (res.code == 200) {
-						this.menuList = this.handleTree(res.data, 'menuId', 'parentId')
-					}
-				})
-			},
 
-			//点击菜单
-			menuClick(data) {
-				this.tableHeadList = []
-				this.menuId = data.menuId
-				this.menuName = data.menuName
-				this.getList()
-			},
-			//获取表头数据
-			getList() {
-				if (!checkPermi(['system:tableHead:listTable']) || !this.menuId) {
-					return
+		//点击菜单
+		menuClick(data) {
+			this.tableHeadList = []
+			this.menuId = data.menuId
+			this.menuName = data.menuName
+			this.getList()
+		},
+		//获取表头数据
+		getList() {
+			tableHeadList({ menuId: this.menuId, ...this.queryParams }).then(res => {
+				if (res.code == 200) {
+					this.total = res.total
+					this.tableHeadList = res.rows.sort((a, b) => {
+						return a.orderNum - b.orderNum
+					})
 				}
-				tableHeadList({ menuId: this.menuId, ...this.queryParams }).then((res) => {
-					if (res.code == 200) {
-						this.total = res.total
-						this.tableHeadList = res.rows.sort((a, b) => {
-							return a.orderNum - b.orderNum
-						})
-					}
+			})
+		},
+		handleStatusChange(data) {
+			tableHeadUpd({
+				...data,
+				required: Number(!data.required)
+			}).then(res => {
+				if (res.code == 200) {
+					this.$msg({ message: '修改成功' })
+					this.updateData(data)
+				}
+			})
+		},
+		//新增表头数据
+		handleAdd() {
+			this.form.menuId = this.menuId
+			this.open = true
+		},
+		//修改表头数据
+		handleUpdate(data) {
+			this.form = this.copyFormFiled(this.form, data, 'id')
+			this.open = true
+		},
+		//删除表头数据
+		handleDelete(data) {
+			this.$modal
+				.confirm('确定要删除吗')
+				.then(() => {
+					tableHeadDel(data.id).then(res => {
+						if (res.code == 200) {
+							this.$msg({ message: '删除成功' })
+							this.tableHeadList = this.tableHeadList.filter(item => item.id != data.id)
+						}
+					})
 				})
-			},
-			handleStatusChange(data) {
-				tableHeadUpd({
-					...data,
-					required: Number(!data.required)
-				}).then((res) => {
-					if (res.code == 200) {
-						this.$msg({ message: '修改成功' })
-						this.updateData(data)
+				.catch(() => {})
+		},
+		//弹窗确定
+		submitForm() {
+			this.$refs.form.validate(valid => {
+				if (valid) {
+					let checkFiled = this.checkName(this.form)
+					if (checkFiled) {
+						this.$msg({ type: 'error', message: checkFiled })
+						return
 					}
-				})
-			},
-			//新增表头数据
-			handleAdd() {
-				this.form.menuId = this.menuId
-				this.open = true
-			},
-			//修改表头数据
-			handleUpdate(data) {
-				this.form = this.copyFormFiled(this.form, data, 'id')
-				this.open = true
-			},
-			//删除表头数据
-			handleDelete(data) {
-				this.$modal
-					.confirm('确定要删除吗')
-					.then(() => {
-						tableHeadDel(data.id).then((res) => {
+					if (this.form.id) {
+						tableHeadUpd(this.form).then(res => {
 							if (res.code == 200) {
-								this.$msg({ message: '删除成功' })
-								this.tableHeadList = this.tableHeadList.filter((item) => item.id != data.id)
+								this.$msg({ message: '修改成功' })
+								this.updateData(this.form)
+							} else {
+								this.$msg({ type: 'error', message: res.msg })
 							}
 						})
-					})
-					.catch(() => {})
-			},
-			//弹窗确定
-			submitForm() {
-				this.$refs.form.validate((valid) => {
-					if (valid) {
-						let checkFiled = this.checkName(this.form)
-						if (checkFiled) {
-							this.$msg({ type: 'error', message: checkFiled })
-							return
-						}
-						if (this.form.id) {
-							tableHeadUpd(this.form).then((res) => {
-								if (res.code == 200) {
-									this.$msg({ message: '修改成功' })
-									this.updateData(this.form)
-								} else {
-									this.$msg({ type: 'error', message: res.msg })
-								}
-							})
-						} else {
-							tableHeadAdd(this.form).then((res) => {
-								if (res.code == 200) {
-									this.$msg({ message: '添加成功' })
-									this.form.id = res.data
-									this.updateData(this.form)
-								} else {
-									this.$msg({ type: 'error', message: res.msg })
-								}
-							})
-						}
 					} else {
-						return false
-					}
-				})
-			},
-			//前端更新数据
-			updateData(data) {
-				let obj = this.tableHeadList.find((item) => item.id == data.id)
-				if (obj) {
-					this.tableHeadList = this.tableHeadList.map((item) => {
-						if (item.id == data.id) {
-							return {
-								...this.copyFormFiled(item, data)
+						tableHeadAdd(this.form).then(res => {
+							if (res.code == 200) {
+								this.$msg({ message: '添加成功' })
+								this.form.id = res.data
+								this.updateData(this.form)
+							} else {
+								this.$msg({ type: 'error', message: res.msg })
 							}
-						}
-						return {
-							...item
-						}
-					})
-					this.tableHeadList.sort((a, b) => {
-						return a.orderNum - b.orderNum
-					})
+						})
+					}
 				} else {
-					this.tableHeadList.push(data)
-				}
-				this.cancel()
-			},
-			//弹窗取消
-			cancel() {
-				this.resetForm()
-				this.open = false
-			},
-			//重名检测
-			checkName(data) {
-				let checkColumnName = this.tableHeadList.find((item) => item.columnName == data.columnName && item.id != data.id)
-				let checkUiColumn = this.tableHeadList.find((item) => item.uiColumn == data.uiColumn && item.id != data.id)
-				let checkApiColum = this.tableHeadList.find((item) => item.apiColum == data.apiColum && item.id != data.id)
-				if (checkColumnName) {
-					return '列名称重复'
-				}
-				if (checkUiColumn) {
-					return '前端列名重复'
-				}
-				if (checkApiColum) {
-					return '后端列名重复'
-				}
-				return false
-			},
-			//表单重置
-			resetForm() {
-				if (this.$refs.form) {
-					this.$refs.form.clearValidate()
-				}
-				this.form = {
-					menuId: null,
-					columnName: '',
-					uiColumn: '',
-					apiColum: '',
-					required: '0',
-					orderNum: ''
+					return false
 				}
+			})
+		},
+		//前端更新数据
+		updateData(data) {
+			let obj = this.tableHeadList.find(item => item.id == data.id)
+			if (obj) {
+				this.tableHeadList = this.tableHeadList.map(item => {
+					if (item.id == data.id) {
+						return {
+							...this.copyFormFiled(item, data)
+						}
+					}
+					return {
+						...item
+					}
+				})
+				this.tableHeadList.sort((a, b) => {
+					return a.orderNum - b.orderNum
+				})
+			} else {
+				this.tableHeadList.push(data)
+			}
+			this.cancel()
+		},
+		//弹窗取消
+		cancel() {
+			this.resetForm()
+			this.open = false
+		},
+		//重名检测
+		checkName(data) {
+			let checkColumnName = this.tableHeadList.find(item => item.columnName == data.columnName && item.id != data.id)
+			let checkUiColumn = this.tableHeadList.find(item => item.uiColumn == data.uiColumn && item.id != data.id)
+			let checkApiColum = this.tableHeadList.find(item => item.apiColum == data.apiColum && item.id != data.id)
+			if (checkColumnName) {
+				return '列名称重复'
+			}
+			if (checkUiColumn) {
+				return '前端列名重复'
+			}
+			if (checkApiColum) {
+				return '后端列名重复'
+			}
+			return false
+		},
+		//表单重置
+		resetForm() {
+			if (this.$refs.form) {
+				this.$refs.form.clearValidate()
+			}
+			this.form = {
+				menuId: null,
+				columnName: '',
+				uiColumn: '',
+				apiColum: '',
+				required: '0',
+				orderNum: ''
 			}
 		}
 	}
+}
 </script>
 
 <style scoped lang="scss"></style>

+ 160 - 174
src/views/tool/gen/index.vue

@@ -9,16 +9,7 @@
 					<el-input v-model="queryParams.tableComment" placeholder="请输入表描述" clearable size="small" @keyup.enter.native="handleQuery" />
 				</el-form-item>
 				<el-form-item label="创建时间">
-					<el-date-picker
-						v-model="dateRange"
-						size="small"
-						style="width: 240px"
-						value-format="yyyy-MM-dd"
-						type="daterange"
-						range-separator="-"
-						start-placeholder="开始日期"
-						end-placeholder="结束日期"
-					></el-date-picker>
+					<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
 				</el-form-item>
 				<el-form-item>
 					<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
@@ -33,7 +24,7 @@
 						<div class="tag">代码生成</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-download" size="mini" @click="handleGenTable" v-hasPermi="['tool:gen:code']" style="margin-right: 10px">生成</el-button>
+						<el-button type="primary" icon="el-icon-download" size="mini" @click="handleGenTable" style="margin-right: 10px">生成</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 					</div>
 				</div>
@@ -51,11 +42,11 @@
 					<el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
 					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 						<template slot-scope="scope">
-							<el-button type="text" size="small" icon="el-icon-view" @click="handlePreview(scope.row)" v-hasPermi="['tool:gen:preview']">预览</el-button>
-							<el-button type="text" size="small" icon="el-icon-edit" @click="handleEditTable(scope.row)" v-hasPermi="['tool:gen:edit']">编辑</el-button>
-							<el-button type="text" size="small" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['tool:gen:remove']">删除</el-button>
-							<el-button type="text" size="small" icon="el-icon-refresh" @click="handleSynchDb(scope.row)" v-hasPermi="['tool:gen:edit']">同步</el-button>
-							<el-button type="text" size="small" icon="el-icon-download" @click="handleGenTable(scope.row)" v-hasPermi="['tool:gen:code']">生成代码</el-button>
+							<el-button type="text" size="small" icon="el-icon-view" @click="handlePreview(scope.row)">预览</el-button>
+							<el-button type="text" size="small" icon="el-icon-edit" @click="handleEditTable(scope.row)">编辑</el-button>
+							<el-button type="text" size="small" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+							<el-button type="text" size="small" icon="el-icon-refresh" @click="handleSynchDb(scope.row)">同步</el-button>
+							<el-button type="text" size="small" icon="el-icon-download" @click="handleGenTable(scope.row)">生成代码</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -66,12 +57,7 @@
 		<!-- 预览界面 -->
 		<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body class="scrollbar">
 			<el-tabs v-model="preview.activeName">
-				<el-tab-pane
-					v-for="(value, key) in preview.data"
-					:label="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))"
-					:name="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))"
-					:key="key"
-				>
+				<el-tab-pane v-for="(value, key) in preview.data" :label="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))" :name="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))" :key="key">
 					<el-link :underline="false" icon="el-icon-document-copy" v-clipboard:copy="value" v-clipboard:success="clipboardSuccess" style="float: right">复制</el-link>
 					<pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre>
 				</el-tab-pane>
@@ -82,167 +68,167 @@
 </template>
 
 <script>
-	import { listTable, previewTable, delTable, genCode, synchDb } from '@/api/tool/gen'
-	import importTable from './importTable'
-	import hljs from 'highlight.js/lib/highlight'
-	import 'highlight.js/styles/github-gist.css'
-	hljs.registerLanguage('java', require('highlight.js/lib/languages/java'))
-	hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'))
-	hljs.registerLanguage('html', require('highlight.js/lib/languages/xml'))
-	hljs.registerLanguage('vue', require('highlight.js/lib/languages/xml'))
-	hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'))
-	hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql'))
+import { listTable, previewTable, delTable, genCode, synchDb } from '@/api/tool/gen'
+import importTable from './importTable'
+import hljs from 'highlight.js/lib/highlight'
+import 'highlight.js/styles/github-gist.css'
+hljs.registerLanguage('java', require('highlight.js/lib/languages/java'))
+hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'))
+hljs.registerLanguage('html', require('highlight.js/lib/languages/xml'))
+hljs.registerLanguage('vue', require('highlight.js/lib/languages/xml'))
+hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'))
+hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql'))
 
-	export default {
-		name: 'Gen',
-		components: { importTable },
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 唯一标识符
-				uniqueId: '',
-				// 选中数组
-				ids: [],
-				// 选中表数组
-				tableNames: [],
-				// 非单个禁用
-				single: true,
-				// 非多个禁用
-				multiple: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 表数据
-				tableList: [],
-				// 日期范围
-				dateRange: '',
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					tableName: undefined,
-					tableComment: undefined
-				},
-				// 预览参数
-				preview: {
-					open: false,
-					title: '代码预览',
-					data: {},
-					activeName: 'domain.java'
-				}
+export default {
+	name: 'Gen',
+	components: { importTable },
+	data() {
+		return {
+			// 遮罩层
+			loading: true,
+			// 唯一标识符
+			uniqueId: '',
+			// 选中数组
+			ids: [],
+			// 选中表数组
+			tableNames: [],
+			// 非单个禁用
+			single: true,
+			// 非多个禁用
+			multiple: true,
+			// 显示搜索条件
+			showSearch: true,
+			// 总条数
+			total: 0,
+			// 表数据
+			tableList: [],
+			// 日期范围
+			dateRange: '',
+			// 查询参数
+			queryParams: {
+				pageNum: 1,
+				pageSize: 10,
+				tableName: undefined,
+				tableComment: undefined
+			},
+			// 预览参数
+			preview: {
+				open: false,
+				title: '代码预览',
+				data: {},
+				activeName: 'domain.java'
 			}
+		}
+	},
+	created() {
+		this.getList()
+	},
+	activated() {
+		const time = this.$route.query.t
+		if (time != null && time != this.uniqueId) {
+			this.uniqueId = time
+			this.queryParams.pageNum = Number(this.$route.query.pageNum)
+			this.getList()
+		}
+	},
+	methods: {
+		/** 查询表集合 */
+		getList() {
+			this.loading = true
+			listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+				this.tableList = response.rows
+				this.total = response.total
+				this.loading = false
+			})
 		},
-		created() {
+		/** 搜索按钮操作 */
+		handleQuery() {
+			this.queryParams.pageNum = 1
 			this.getList()
 		},
-		activated() {
-			const time = this.$route.query.t
-			if (time != null && time != this.uniqueId) {
-				this.uniqueId = time
-				this.queryParams.pageNum = Number(this.$route.query.pageNum)
-				this.getList()
+		/** 生成代码操作 */
+		handleGenTable(row) {
+			const tableNames = row.tableName || this.tableNames
+			if (tableNames == '') {
+				this.$modal.msgError('请选择要生成的数据')
+				return
+			}
+			if (row.genType === '1') {
+				genCode(row.tableName).then(response => {
+					this.$modal.msgSuccess('成功生成到自定义路径:' + row.genPath)
+				})
+			} else {
+				this.$download.zip('/tool/gen/batchGenCode?tables=' + tableNames, 'tiegu')
 			}
 		},
-		methods: {
-			/** 查询表集合 */
-			getList() {
-				this.loading = true
-				listTable(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-					this.tableList = response.rows
-					this.total = response.total
-					this.loading = false
+		/** 同步数据库操作 */
+		handleSynchDb(row) {
+			const tableName = row.tableName
+			this.$modal
+				.confirm('确认要强制同步"' + tableName + '"表结构吗?')
+				.then(function () {
+					return synchDb(tableName)
 				})
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 生成代码操作 */
-			handleGenTable(row) {
-				const tableNames = row.tableName || this.tableNames
-				if (tableNames == '') {
-					this.$modal.msgError('请选择要生成的数据')
-					return
-				}
-				if (row.genType === '1') {
-					genCode(row.tableName).then((response) => {
-						this.$modal.msgSuccess('成功生成到自定义路径:' + row.genPath)
-					})
-				} else {
-					this.$download.zip('/tool/gen/batchGenCode?tables=' + tableNames, 'tiegu')
-				}
-			},
-			/** 同步数据库操作 */
-			handleSynchDb(row) {
-				const tableName = row.tableName
-				this.$modal
-					.confirm('确认要强制同步"' + tableName + '"表结构吗?')
-					.then(function () {
-						return synchDb(tableName)
-					})
-					.then(() => {
-						this.$modal.msgSuccess('同步成功')
-					})
-					.catch(() => {})
-			},
-			/** 打开导入表弹窗 */
-			openImportTable() {
-				this.$refs.import.show()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.dateRange = []
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			/** 预览按钮 */
-			handlePreview(row) {
-				previewTable(row.tableId).then((response) => {
-					this.preview.data = response.data
-					this.preview.open = true
-					this.preview.activeName = 'domain.java'
+				.then(() => {
+					this.$modal.msgSuccess('同步成功')
 				})
-			},
-			/** 高亮显示 */
-			highlightedCode(code, key) {
-				const vmName = key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))
-				var language = vmName.substring(vmName.indexOf('.') + 1, vmName.length)
-				const result = hljs.highlight(language, code || '', true)
-				return result.value || '&nbsp;'
-			},
-			/** 复制代码成功 */
-			clipboardSuccess() {
-				this.$modal.msgSuccess('复制成功')
-			},
-			// 多选框选中数据
-			handleSelectionChange(selection) {
-				this.ids = selection.map((item) => item.tableId)
-				this.tableNames = selection.map((item) => item.tableName)
-				this.single = selection.length != 1
-				this.multiple = !selection.length
-			},
-			/** 修改按钮操作 */
-			handleEditTable(row) {
-				const tableId = row.tableId || this.ids[0]
-				this.$router.push({ path: '/tool/gen-edit/index', query: { tableId: tableId, pageNum: this.queryParams.pageNum } })
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const tableIds = row.tableId || this.ids
-				this.$modal
-					.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?')
-					.then(function () {
-						return delTable(tableIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			}
+				.catch(() => {})
+		},
+		/** 打开导入表弹窗 */
+		openImportTable() {
+			this.$refs.import.show()
+		},
+		/** 重置按钮操作 */
+		resetQuery() {
+			this.dateRange = []
+			this.resetForm('queryForm')
+			this.handleQuery()
+		},
+		/** 预览按钮 */
+		handlePreview(row) {
+			previewTable(row.tableId).then(response => {
+				this.preview.data = response.data
+				this.preview.open = true
+				this.preview.activeName = 'domain.java'
+			})
+		},
+		/** 高亮显示 */
+		highlightedCode(code, key) {
+			const vmName = key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))
+			var language = vmName.substring(vmName.indexOf('.') + 1, vmName.length)
+			const result = hljs.highlight(language, code || '', true)
+			return result.value || '&nbsp;'
+		},
+		/** 复制代码成功 */
+		clipboardSuccess() {
+			this.$modal.msgSuccess('复制成功')
+		},
+		// 多选框选中数据
+		handleSelectionChange(selection) {
+			this.ids = selection.map(item => item.tableId)
+			this.tableNames = selection.map(item => item.tableName)
+			this.single = selection.length != 1
+			this.multiple = !selection.length
+		},
+		/** 修改按钮操作 */
+		handleEditTable(row) {
+			const tableId = row.tableId || this.ids[0]
+			this.$router.push({ path: '/tool/gen-edit/index', query: { tableId: tableId, pageNum: this.queryParams.pageNum } })
+		},
+		/** 删除按钮操作 */
+		handleDelete(row) {
+			const tableIds = row.tableId || this.ids
+			this.$modal
+				.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?')
+				.then(function () {
+					return delTable(tableIds)
+				})
+				.then(() => {
+					this.getList()
+					this.$modal.msgSuccess('删除成功')
+				})
+				.catch(() => {})
 		}
 	}
+}
 </script>

+ 11 - 0
src/views/ware/brand/index.vue

@@ -0,0 +1,11 @@
+<template>
+	<h1>品牌信息</h1>
+</template>
+
+<script>
+export default {
+	name: 'brand'
+}
+</script>
+
+<style></style>

+ 11 - 0
src/views/ware/category/index.vue

@@ -0,0 +1,11 @@
+<template>
+	<h1>品类设置</h1>
+</template>
+
+<script>
+export default {
+	name: 'category'
+}
+</script>
+
+<style></style>

+ 11 - 0
src/views/ware/goods/index.vue

@@ -0,0 +1,11 @@
+<template>
+	<h1>商品信息</h1>
+</template>
+
+<script>
+export default {
+	name: 'goods'
+}
+</script>
+
+<style></style>

+ 11 - 0
src/views/ware/goodsAttrs/index.vue

@@ -0,0 +1,11 @@
+<template>
+	<h1>商品属性</h1>
+</template>
+
+<script>
+export default {
+	name: 'goodsAttrs'
+}
+</script>
+
+<style></style>

+ 11 - 0
src/views/ware/locationCategory/index.vue

@@ -0,0 +1,11 @@
+<template>
+	<h1>库位品类</h1>
+</template>
+
+<script>
+export default {
+	name: 'locationCategory'
+}
+</script>
+
+<style></style>

+ 151 - 0
src/views/ware/saleAttrs/index.vue

@@ -0,0 +1,151 @@
+<template>
+	<div class="page-container">
+		<div class="search-container">
+			<span style="margin-right: 12px"><strong>属性组名称</strong></span>
+			<el-input v-model="searchValue" placeholder="输入属性组名称" clearable size="small" style="width: 150px" />
+			<el-button type="primary" icon="el-icon-search" size="small " style="margin-left: 20px" @click="getList">搜索</el-button>
+			<el-button icon="el-icon-refresh" size="small " @click="resetSearch">重置</el-button>
+		</div>
+		<div class="content-container">
+			<div class="main">
+				<div class="table-nav">
+					<div class="tags">
+						<div class="tag">销售属性组</div>
+					</div>
+					<div class="actions">
+						<el-button type="primary" icon="el-icon-plus" size="mini " style="margin: 0 0 10px 3px" @click="handleAdd">添加</el-button>
+					</div>
+				</div>
+				<el-table v-loading="loading" :data="dataList" border>
+					<el-table-column type="index" width="100" align="center" label="序号" />
+					<el-table-column label="列名称" prop="columnName" />
+					<el-table-column label="前端列名" prop="uiColumn" :show-overflow-tooltip="true" width="300" />
+					<el-table-column label="后端列名" prop="apiColum" :show-overflow-tooltip="true" width="300" />
+					<el-table-column label="是否必须显示" align="center" width="100">
+						<template slot-scope="scope">
+							<input type="checkbox" :checked="scope.row.required == '0'" @change="handleStatusChange(scope.row)" />
+						</template>
+					</el-table-column>
+					<el-table-column label="操作" align="center" class-name="small-padding" width="300">
+						<template slot-scope="scope" v-if="scope.row.roleId !== 1">
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+			</div>
+			<el-dialog :title="groupTitle" :visible.sync="open" width="800px" append-to-body @close="cancel">
+				<el-form ref="groupForm" :model="groupForm" :rules="rules" label-width="100px">
+					<el-row>
+						<el-col :span="12">
+							<el-form-item label="属性组名称" prop="attrGroupName">
+								<el-input v-model="groupForm.attrGroupName" placeholder="请输入属性组名称" />
+							</el-form-item>
+						</el-col>
+						<el-col :span="12">
+							<el-form-item label="属性组描述">
+								<el-input v-model="groupForm.descript" placeholder="请输入属性组描述" />
+							</el-form-item>
+						</el-col>
+						<el-col :span="24">
+							<el-form-item align="right">
+								<el-button size="mini" @click="addAttr">添加属性</el-button>
+							</el-form-item>
+						</el-col>
+						<el-col :span="24">
+							<el-collapse v-model="activeName" accordion>
+								<el-collapse-item v-for="(item, index) in groupForm.attrs" :key="index" :name="index">
+									<template slot="title">
+										<el-button size="mini" type="text" icon="el-icon-error">删除</el-button>
+									</template>
+									<div>属性名称:</div>
+								</el-collapse-item>
+							</el-collapse>
+						</el-col>
+					</el-row>
+				</el-form>
+				<div slot="footer" class="dialog-footer">
+					<el-button size="small" @click="cancel">取 消</el-button>
+					<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
+				</div>
+			</el-dialog>
+		</div>
+	</div>
+</template>
+
+<script>
+import {} from '@/api/ware/saleAttrs/index.js'
+export default {
+	name: 'saleAttrs',
+	data() {
+		return {
+			//加载框状态
+			loading: false,
+			//数据数组
+			dataList: [],
+			//弹窗标题
+			groupTitle: '',
+			//属性组表单
+			groupForm: {
+				//属性组类型 0销售 1商品
+				groupType: 0,
+				//属性组名称
+				attrGroupName: '',
+				//属性组描述
+				descript: '',
+				//属性数组
+				attrs: []
+			},
+			//搜索框绑定值
+			searchValue: '',
+			//弹窗状态
+			open: false,
+			//表单验证
+			rules: {},
+			//表单属性区域展开索引
+			activeName: 0
+		}
+	},
+	methods: {
+		//获取数据
+		getList() {},
+		//重置搜索
+		resetSearch() {},
+		//添加属性组
+		handleAdd() {
+			this.groupTitle = '属性组添加'
+			this.open = true
+		},
+		//表单保存
+		submitForm() {},
+		//弹窗取消
+		cancel() {
+			this.open = false
+			this.resetForm()
+		},
+		//表单重置
+		resetForm() {},
+		//添加属性
+		addAttr() {
+			this.groupForm.attrs.push({
+				//属性名称
+				attrName: '',
+				//属性类型 0下拉 1文本
+				attrCategory: 0,
+				//属性类型 0销售 1商品
+				attrType: 0,
+				//属性的值
+				searchValue: []
+			})
+			this.activeName = this.groupForm.attrs.length - 1
+		}
+	}
+}
+</script>
+
+<style scoped lang="scss">
+.el-collapse-item {
+	border-left: 1px solid #e6ebf5;
+	border-right: 1px solid #e6ebf5;
+}
+</style>

+ 27 - 26
src/views/system/stockLocation/index.vue → src/views/ware/stockLocation/index.vue

@@ -1,14 +1,14 @@
 <template>
 	<div class="page-container">
 		<div class="content-container">
-			<TreeChoice v-model="hasDeptIds" @click="getList" @getDeptInfo="getDeptInfo" />
+			<TreeChoice :dataList="deptList" @itemClick="treeClick" />
 			<div class="main">
 				<div class="table-nav">
 					<div class="tags">
 						<div class="tag">库位信息</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" icon="el-icon-plus" size="mini" v-hasPermi="['system:dataPermissions:addRole']" style="margin-right: 10px" @click="addStockShow" v-if="hasDeptIds.length">添加</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini" style="margin-right: 10px" @click="addStockShow" v-if="stockForm.deptId">添加</el-button>
 						<right-toolbar @queryTable="getList" :isShowSearch="false"></right-toolbar>
 					</div>
 				</div>
@@ -20,14 +20,14 @@
 					<el-table-column label="描述" prop="remark" />
 					<el-table-column label="操作" class-name="small-padding fixed-width" width="300" align="center">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="choiceUser(scope.row)" v-hasPermi="['system:dataPermissions:updRole']">保管员</el-button>
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="updStock(scope.row)" v-hasPermi="['system:dataPermissions:updRole']">修改</el-button>
-							<el-button size="mini" type="text" icon="el-icon-delete" @click="delStock(scope.row)" v-hasPermi="['system:dataPermissions:delRole']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="choiceUser(scope.row)">保管员</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="updStock(scope.row)">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click="delStock(scope.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
 				<!-- 编辑弹窗 -->
-				<el-dialog :title="title" :visible.sync="stockShow" width="30%">
+				<el-dialog :title="title" :visible.sync="stockShow" width="30%" @close="stockCancel">
 					<el-form ref="stockForm" :model="stockForm" :rules="stockRules" label-width="100px">
 						<el-form-item label="名称" prop="locationName">
 							<div style="width: 300px"><el-input v-model="stockForm.locationName" placeholder="请输入名称" /></div>
@@ -51,10 +51,11 @@
 </template>
 
 <script>
-import { stockList, stockAdd, stockUpd, stockDel, updateKeeper } from '@/api/system/stockLocation.js'
+import { stockList, stockAdd, stockUpd, stockDel, updateKeeper } from '@/api/ware/stockLocation/index.js'
 import { treeselect } from '@/api/system/dept'
-import TreeChoice from '@/components/deptTreeChoice/index.vue'
+import TreeChoice from '@/components/treeChoice/index.vue'
 import UserChoice from '@/components/userChoice/index.vue'
+import { deepClone } from '@/utils/index.js'
 export default {
 	name: 'stockLocation',
 	components: {
@@ -64,8 +65,6 @@ export default {
 	data() {
 		return {
 			loading: false,
-			//拥有权限的部门id数组
-			hasDeptIds: [],
 			//数据
 			dataList: [],
 			//库位编辑弹窗显示
@@ -73,7 +72,7 @@ export default {
 			//库位编辑弹窗标题
 			title: '',
 			// 部门信息
-			deptOptions: [],
+			deptList: [],
 			//库位表单
 			stockForm: { deptId: '', locationName: '', remark: '', deptName: '' },
 			//库位表单验证
@@ -81,26 +80,30 @@ export default {
 			locationId: '' // 库位id
 		}
 	},
+	created() {
+		//获取部门
+		treeselect().then(res => {
+			if (res.code === 200) {
+				this.deptList = res.data
+			}
+		})
+	},
 	methods: {
 		//获取数据
+		treeClick(d) {
+			this.stockForm.deptId = d.id
+			this.stockForm.deptName = d.deptNames
+			this.getList()
+		},
 		getList() {
-			if (!this.hasDeptIds.length) {
-				this.dataList = []
-				return
-			}
 			this.loading = true
-			stockList({ deptIds: this.hasDeptIds }).then(res => {
+			stockList({ deptIds: this.stockForm.deptId }).then(res => {
 				if (res.code === 200) {
 					this.dataList = res.data
 					this.loading = false
 				}
 			})
 		},
-		//获取部门信息
-		getDeptInfo(d) {
-			this.stockForm.deptId = d.deptId
-			this.stockForm.deptName = d.deptName
-		},
 		//显示库位弹窗
 		addStockShow() {
 			this.title = '库位添加'
@@ -165,11 +168,9 @@ export default {
 		//选择人员
 		choiceUser(row) {
 			this.locationId = row.locationId
-			treeselect().then(response => {
-				this.deptOptions = response.data
-				this.deptOptions.unshift({ id: '0', label: '全部部门' })
-				this.$refs.userChoice.init(true, this.deptOptions)
-			})
+			let depts = deepClone(this.deptList)
+			depts.unshift({ id: '0', label: '全部部门' })
+			this.$refs.userChoice.init(true, depts)
 			this.$refs.userChoice.selectPerson()
 		},
 		//人员回调

+ 3 - 3
vue.config.js

@@ -21,7 +21,7 @@ module.exports = {
 		open: true,
 		proxy: {
 			[process.env.VUE_APP_BASE_API]: {
-				target: `http://192.168.0.105:8080`,
+				target: `http://192.168.1.105:8080`,
 				changeOrigin: true,
 				pathRewrite: {
 					['^' + process.env.VUE_APP_BASE_API]: ''
@@ -54,7 +54,7 @@ module.exports = {
 			})
 			.end()
 
-		config.when(process.env.NODE_ENV !== 'development', (config) => {
+		config.when(process.env.NODE_ENV !== 'development', config => {
 			config
 				.plugin('ScriptExtHtmlWebpackPlugin')
 				.after('html')
@@ -67,7 +67,7 @@ module.exports = {
 			config.optimization
 				.minimize(true)
 				.minimizer('terser')
-				.tap((args) => {
+				.tap(args => {
 					let { terserOptions } = args[0]
 					terserOptions.compress.drop_console = true
 					terserOptions.compress.drop_debugger = true