소스 검색

Merge branch 'master' of http://182.92.174.150:3000/tiegu/czo

dukai 3 년 전
부모
커밋
a1c87a600d

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

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+// 新增角色
+export function roleAdd(data) {
+	return request({
+		url: '/system/dataRole',
+		method: 'post',
+		data
+	})
+}
+//查询角色
+export function roleList(params) {
+	return request({
+		url: '/system/dataRole/list',
+		method: 'get',
+		params
+	})
+}
+//修改角色
+export function roleUpd(data) {
+	return request({
+		url: '/system/dataRole',
+		method: 'put',
+		data
+	})
+}
+//删除角色
+export function roleDel(data) {
+	return request({
+		url: '/system/dataRole/' + data,
+		method: 'delete'
+	})
+}
+//禁用角色
+export function roleStatus(data) {
+	return request({
+		url: '/system/dataRole/changeStatus',
+		method: 'put',
+		data
+	})
+}
+//获取角色的权限信息
+export function authList(params) {
+	return request({
+		url: '/system/dataRole/' + params,
+		method: 'get'
+	})
+}
+//修改角色的权限信息
+export function authUpd(data) {
+	return request({
+		url: '/system/dataRole/changeDept',
+		method: 'put',
+		data
+	})
+}
+//获取部门树
+export function deptList() {
+	return request({
+		url: '/system/dept/treeselect',
+		method: 'get'
+	})
+}

+ 8 - 0
src/assets/styles/element-ui.scss

@@ -57,10 +57,18 @@
 .el-dialog__header {
 	border-bottom: 1px solid #d9d9d9;
 }
+.el-dialog__title {
+	font-weight: bolder;
+}
 .el-dialog__footer {
 	border-top: 1px solid #d9d9d9;
 	padding-bottom: 10px;
 }
+//表格样式
+.el-table__cell {
+	height: 40px !important;
+	padding: 0 !important;
+}
 // refine element ui upload
 .upload-container {
 	.el-upload {

+ 0 - 40
src/router/index.js

@@ -67,46 +67,6 @@ export const constantRoutes = [
 			}
 		]
 	},
-	{
-		path: '/user',
-		component: Layout,
-		hidden: true,
-		redirect: 'noredirect',
-		children: [
-			{
-				path: 'profile',
-				component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
-				name: 'Profile',
-				meta: { title: '个人中心', icon: 'user' }
-			}
-		]
-	},
-	{
-		path: '/system/user-auth',
-		component: Layout,
-		hidden: true,
-		children: [
-			{
-				path: 'role/:userId(\\d+)',
-				component: (resolve) => require(['@/views/system/user/authRole'], resolve),
-				name: 'AuthRole',
-				meta: { title: '分配角色', activeMenu: '/system/user' }
-			}
-		]
-	},
-	{
-		path: '/system/role-auth',
-		component: Layout,
-		hidden: true,
-		children: [
-			{
-				path: 'user/:roleId(\\d+)',
-				component: (resolve) => require(['@/views/system/role/authUser'], resolve),
-				name: 'AuthUser',
-				meta: { title: '分配用户', activeMenu: '/system/role' }
-			}
-		]
-	},
 	{
 		path: '/system/dict-data',
 		component: Layout,

+ 3 - 3
src/views/monitor/job/index.vue

@@ -138,8 +138,8 @@
 				</el-row>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
+				<el-button size="small" @click="cancel">取 消</el-button>
+				<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
 			</div>
 		</el-dialog>
 
@@ -191,7 +191,7 @@
 				</el-row>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button @click="openView = false">关 闭</el-button>
+				<el-button size="small" @click="openView = false">关 闭</el-button>
 			</div>
 		</el-dialog>
 	</div>

+ 231 - 289
src/views/monitor/job/log.vue

@@ -1,299 +1,241 @@
 <template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="任务名称" prop="jobName">
-        <el-input
-          v-model="queryParams.jobName"
-          placeholder="请输入任务名称"
-          clearable
-          size="small"
-          style="width: 240px"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="任务组名" prop="jobGroup">
-        <el-select
-          v-model="queryParams.jobGroup"
-          placeholder="请任务组名"
-          clearable
-          size="small"
-          style="width: 240px"
-        >
-          <el-option
-            v-for="dict in dict.type.sys_job_group"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="执行状态" prop="status">
-        <el-select
-          v-model="queryParams.status"
-          placeholder="请选择执行状态"
-          clearable
-          size="small"
-          style="width: 240px"
-        >
-          <el-option
-            v-for="dict in dict.type.sys_common_status"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </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-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
+	<div class="app-container">
+		<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+			<el-form-item label="任务名称" prop="jobName">
+				<el-input v-model="queryParams.jobName" placeholder="请输入任务名称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
+			</el-form-item>
+			<el-form-item label="任务组名" prop="jobGroup">
+				<el-select v-model="queryParams.jobGroup" placeholder="请任务组名" clearable size="small" style="width: 240px">
+					<el-option v-for="dict in dict.type.sys_job_group" :key="dict.value" :label="dict.label" :value="dict.value" />
+				</el-select>
+			</el-form-item>
+			<el-form-item label="执行状态" prop="status">
+				<el-select v-model="queryParams.status" placeholder="请选择执行状态" clearable size="small" style="width: 240px">
+					<el-option v-for="dict in dict.type.sys_common_status" :key="dict.value" :label="dict.label" :value="dict.value" />
+				</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-form-item>
+			<el-form-item>
+				<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+				<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+			</el-form-item>
+		</el-form>
 
-    <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-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-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-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-close"
-          size="mini"
-          @click="handleClose"
-        >关闭</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+		<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-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-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-col>
+			<el-col :span="1.5">
+				<el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose">关闭</el-button>
+			</el-col>
+			<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+		</el-row>
 
-    <el-table v-loading="loading" :data="jobLogList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="日志编号" width="80" align="center" prop="jobLogId" />
-      <el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
-      <el-table-column label="任务组名" align="center" prop="jobGroup" :show-overflow-tooltip="true">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_job_group" :value="scope.row.jobGroup"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
-      <el-table-column label="日志信息" align="center" prop="jobMessage" :show-overflow-tooltip="true" />
-      <el-table-column label="执行状态" align="center" prop="status">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="执行时间" align="center" prop="createTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime) }}</span>
-        </template>
-      </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>
-        </template>
-      </el-table-column>
-    </el-table>
+		<el-table v-loading="loading" :data="jobLogList" @selection-change="handleSelectionChange">
+			<el-table-column type="selection" width="55" align="center" />
+			<el-table-column label="日志编号" width="80" align="center" prop="jobLogId" />
+			<el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
+			<el-table-column label="任务组名" align="center" prop="jobGroup" :show-overflow-tooltip="true">
+				<template slot-scope="scope">
+					<dict-tag :options="dict.type.sys_job_group" :value="scope.row.jobGroup" />
+				</template>
+			</el-table-column>
+			<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
+			<el-table-column label="日志信息" align="center" prop="jobMessage" :show-overflow-tooltip="true" />
+			<el-table-column label="执行状态" align="center" prop="status">
+				<template slot-scope="scope">
+					<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status" />
+				</template>
+			</el-table-column>
+			<el-table-column label="执行时间" align="center" prop="createTime" width="180">
+				<template slot-scope="scope">
+					<span>{{ parseTime(scope.row.createTime) }}</span>
+				</template>
+			</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>
+				</template>
+			</el-table-column>
+		</el-table>
 
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+		<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
 
-    <!-- 调度日志详细 -->
-    <el-dialog title="调度日志详细" :visible.sync="open" width="700px" append-to-body>
-      <el-form ref="form" :model="form" label-width="100px" size="mini">
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="日志序号:">{{ form.jobLogId }}</el-form-item>
-            <el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="任务分组:">{{ form.jobGroup }}</el-form-item>
-            <el-form-item label="执行时间:">{{ form.createTime }}</el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="调用方法:">{{ form.invokeTarget }}</el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="日志信息:">{{ form.jobMessage }}</el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="执行状态:">
-              <div v-if="form.status == 0">正常</div>
-              <div v-else-if="form.status == 1">失败</div>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="异常信息:" v-if="form.status == 1">{{ form.exceptionInfo }}</el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="open = false">关 闭</el-button>
-      </div>
-    </el-dialog>
-  </div>
+		<!-- 调度日志详细 -->
+		<el-dialog title="调度日志详细" :visible.sync="open" width="700px" append-to-body>
+			<el-form ref="form" :model="form" label-width="100px" size="mini">
+				<el-row>
+					<el-col :span="12">
+						<el-form-item label="日志序号:">{{ form.jobLogId }}</el-form-item>
+						<el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="任务分组:">{{ form.jobGroup }}</el-form-item>
+						<el-form-item label="执行时间:">{{ form.createTime }}</el-form-item>
+					</el-col>
+					<el-col :span="24">
+						<el-form-item label="调用方法:">{{ form.invokeTarget }}</el-form-item>
+					</el-col>
+					<el-col :span="24">
+						<el-form-item label="日志信息:">{{ form.jobMessage }}</el-form-item>
+					</el-col>
+					<el-col :span="24">
+						<el-form-item label="执行状态:">
+							<div v-if="form.status == 0">正常</div>
+							<div v-else-if="form.status == 1">失败</div>
+						</el-form-item>
+					</el-col>
+					<el-col :span="24">
+						<el-form-item label="异常信息:" v-if="form.status == 1">{{ form.exceptionInfo }}</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
+			<div slot="footer" class="dialog-footer">
+				<el-button size="small" @click="open = false">关 闭</el-button>
+			</div>
+		</el-dialog>
+	</div>
 </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
-      }
-    };
-  },
-  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;
-    },
-    /** 删除按钮操作 */
-    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`)
-    }
-  }
-};
+	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
+			},
+			/** 删除按钮操作 */
+			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`
+				)
+			}
+		}
+	}
 </script>

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

@@ -9,8 +9,8 @@
 					<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable size="small" @keyup.enter.native="handleQuery" />
 				</el-form-item>
 				<el-form-item>
-					<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-					<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+					<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
+					<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
 				</el-form-item>
 			</el-form>
 		</div>

+ 1 - 1
src/views/monitor/operlog/index.vue

@@ -117,7 +117,7 @@
 				</el-row>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button @click="open = false">关 闭</el-button>
+				<el-button @click="open = false" size="small">关 闭</el-button>
 			</div>
 		</el-dialog>
 	</div>

+ 0 - 72
src/views/stock/goods/index.vue

@@ -1,72 +0,0 @@
-<template>
-	<div class="goods">
-		<el-row :gutter="20">
-			<el-col :span="4" :xs="24">
-				<div class="cate">
-					<el-input placeholder="输入分类名称搜索" v-model="filterText" style="margin-bottom: 20px"></el-input>
-					<el-tree :data="cateList" node-key="id" default-expand-all :highlight-current="true" :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree">
-						<span class="custom-tree-node" slot-scope="{ data }">
-							<span @click="cateClick(data)">{{ data.name }}</span>
-							<span style="margin-left: 20px" v-if="false">
-								<el-button type="text" size="mini" @click="() => addCate(data)">添加</el-button>
-								<el-button type="text" size="mini" @click="() => updCate(data)">修改</el-button>
-								<el-button type="text" size="mini" @click="() => delCate(data)">删除</el-button>
-							</span>
-						</span>
-					</el-tree>
-				</div>
-			</el-col>
-			<el-col :span="20" :xs="24"> </el-col>
-		</el-row>
-	</div>
-</template>
-
-<script>
-	export default {
-		name: 'Goods',
-		data() {
-			return {
-				cateData: [
-					{ id: 1, name: '电子设备', pid: 0 },
-					{ id: 2, name: '食品', pid: 0 },
-					{ id: 3, name: '服装', pid: 0 },
-					{ id: 4, name: '鞋子', pid: 0 },
-					{ id: 5, name: '手机', pid: 1 },
-					{ id: 6, name: '电脑', pid: 1 },
-					{ id: 7, name: '照相机', pid: 1 },
-					{ id: 8, name: '水果', pid: 2 },
-					{ id: 9, name: '熟食', pid: 2 },
-					{ id: 10, name: '零食', pid: 2 },
-					{ id: 11, name: '饮料', pid: 2 },
-					{ id: 12, name: '外套', pid: 3 },
-					{ id: 13, name: '上衣', pid: 3 },
-					{ id: 14, name: '裤子', pid: 3 },
-					{ id: 15, name: '衬衫', pid: 3 },
-					{ id: 16, name: '毛衣', pid: 3 },
-					{ id: 17, name: '休闲鞋', pid: 4 },
-					{ id: 18, name: '篮球鞋', pid: 4 },
-					{ id: 19, name: '滑板鞋', pid: 4 },
-					{ id: 20, name: '高跟鞋', pid: 4 }
-				],
-				filterText: ''
-			}
-		},
-		computed: {
-			cateList() {
-				return this.handleTree(this.cateData, 'id', 'pid')
-			}
-		},
-		methods: {
-			filterNode() {}
-		},
-		components: {}
-	}
-</script>
-
-<style scoped lang="scss">
-	.goods {
-		.cate {
-			padding: 10px;
-		}
-	}
-</style>

+ 9 - 9
src/views/system/config/index.vue

@@ -47,22 +47,22 @@
 					</div>
 				</div>
 				<el-table v-loading="loading" :data="configList" border>
-					<el-table-column label="参数主键" align="center" prop="configId" />
-					<el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" />
-					<el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true" />
-					<el-table-column label="参数键值" align="center" prop="configValue" />
-					<el-table-column label="系统内置" align="center" prop="configType">
+					<el-table-column label="参数主键" align="center" prop="configId" width="100" />
+					<el-table-column label="参数名称" align="left" prop="configName" :show-overflow-tooltip="true" />
+					<el-table-column label="参数键名" align="left" prop="configKey" :show-overflow-tooltip="true" />
+					<el-table-column label="参数键值" align="left" prop="configValue" />
+					<el-table-column label="系统内置" align="center" prop="configType" width="100">
 						<template slot-scope="scope">
 							<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType" />
 						</template>
 					</el-table-column>
-					<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
+					<el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true" />
 					<el-table-column label="创建时间" align="center" prop="createTime" width="180">
 						<template slot-scope="scope">
 							<span>{{ parseTime(scope.row.createTime) }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+					<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>
@@ -96,8 +96,8 @@
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
+				<el-button size="small" @click="cancel">取 消</el-button>
+				<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
 			</div>
 		</el-dialog>
 	</div>

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

@@ -0,0 +1,267 @@
+<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:levelPosition:addLevel']">添加</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:levelPosition:updLevel']">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="delRole(scope.row)" v-hasPermi="['system:levelPosition:delLevel']">删除</el-button>
+							<el-button size="mini" type="text" icon="el-icon-remove" @click.stop="setRole(scope.row)" v-hasPermi="['system:levelPosition:upLevel']" 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:levelPosition:upLevel']" 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)" />
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- 编辑数据角色 -->
+				<el-dialog title="编辑角色" :visible.sync="roleShow" width="30%" :close-on-press-escape="false" :close-on-click-modal="false">
+					<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'
+	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
+			}
+		},
+		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: {
+			//动态选中样式
+			isActive(index) {
+				if (this.tabIndex != index) return {}
+				return {
+					color: this.theme
+				}
+			},
+			//跳转到tab1
+			toTab1() {
+				this.tabIndex = 1
+			},
+			//跳转到tab2
+			toTab2() {
+				this.tabIndex = 2
+			},
+			//获取角色数据
+			getRoleList() {
+				roleList(this.roleParams).then((res) => {
+					if (res.code === 200) {
+						this.roleList = res.rows
+						this.roleTotal = res.total
+					}
+				})
+			},
+			//添加角色
+			addRole() {
+				this.roleShow = true
+			},
+			//数据角色行选中
+			rowHandler(e) {
+				this.dataRoleId = e.dataRoleId
+				if (e.deptIds && e.deptIds != '') {
+					this.authIds = e.deptIds.split(',').map((item) => Number(item))
+				} 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.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>

+ 6 - 6
src/views/system/dept/index.vue

@@ -37,14 +37,14 @@
 					:default-expand-all="isExpandAll"
 					:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
 				>
-					<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
-					<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
-					<el-table-column prop="status" label="状态" width="100">
+					<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="状态">
 						<template slot-scope="scope">
 							<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
 						</template>
 					</el-table-column>
-					<el-table-column label="创建时间" align="center" prop="createTime" width="200">
+					<el-table-column label="创建时间" align="center" prop="createTime">
 						<template slot-scope="scope">
 							<span>{{ parseTime(scope.row.createTime) }}</span>
 						</template>
@@ -106,8 +106,8 @@
 				</el-row>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
+				<el-button size="small" @click="cancel">取 消</el-button>
+				<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
 			</div>
 		</el-dialog>
 	</div>

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

@@ -35,7 +35,7 @@
 					</div>
 				</div>
 				<el-table v-loading="loading" :data="dataList" border>
-					<el-table-column label="字典编码" align="center" prop="dictCode" />
+					<el-table-column label="字典编码" align="center" prop="dictCode" width="100" />
 					<el-table-column label="字典标签" align="center" prop="dictLabel">
 						<template slot-scope="scope">
 							<span v-if="scope.row.listClass == '' || scope.row.listClass == 'default'">{{ scope.row.dictLabel }}</span>
@@ -55,7 +55,7 @@
 							<span>{{ parseTime(scope.row.createTime) }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+					<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>
@@ -100,8 +100,8 @@
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
+				<el-button size="small" @click="cancel">取 消</el-button>
+				<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
 			</div>
 		</el-dialog>
 	</div>

+ 8 - 8
src/views/system/dict/index.vue

@@ -47,27 +47,27 @@
 					</div>
 				</div>
 				<el-table v-loading="loading" :data="typeList" border>
-					<el-table-column label="字典编号" align="center" prop="dictId" />
-					<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
-					<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
+					<el-table-column label="字典编号" align="center" prop="dictId" width="100" />
+					<el-table-column label="字典名称" align="left" prop="dictName" :show-overflow-tooltip="true" />
+					<el-table-column label="字典类型" align="left" :show-overflow-tooltip="true">
 						<template slot-scope="scope">
 							<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
 								<span>{{ scope.row.dictType }}</span>
 							</router-link>
 						</template>
 					</el-table-column>
-					<el-table-column label="状态" align="center" prop="status">
+					<el-table-column label="状态" align="center" prop="status" width="100">
 						<template slot-scope="scope">
 							<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
 						</template>
 					</el-table-column>
-					<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
+					<el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true" />
 					<el-table-column label="创建时间" align="center" prop="createTime" width="180">
 						<template slot-scope="scope">
 							<span>{{ parseTime(scope.row.createTime) }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+					<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>
@@ -98,8 +98,8 @@
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
+				<el-button size="small" @click="cancel">取 消</el-button>
+				<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
 			</div>
 		</el-dialog>
 	</div>

+ 15 - 29
src/views/system/levelPosition/index.vue

@@ -13,27 +13,18 @@
 					</div>
 				</div>
 				<!-- 级别表格 -->
-				<el-table
-					v-loading="loading"
-					:data="levelList"
-					border
-					:header-cell-style="{ 'text-align': 'center' }"
-					:cell-style="{ textAlign: 'center', cursor: 'pointer' }"
-					highlight-current-row
-					@current-change="rowHandler"
-					v-show="tabIndex == 1"
-				>
+				<el-table v-loading="loading" :data="levelList" border :cell-style="{ cursor: 'pointer' }" highlight-current-row @current-change="rowHandler" v-show="tabIndex == 1">
 					<el-table-column label="级别" prop="levelName" width="200">
 						<template slot-scope="scope">
 							<a href="javascript:void(0);" class="linked" @click="toTab2">{{ scope.row.levelName }}</a>
 						</template>
 					</el-table-column>
-					<el-table-column label="黑星" prop="blackStar" width="100" />
-					<el-table-column label="红星" prop="redStar" width="100" />
+					<el-table-column align="center" label="黑星" prop="blackStar" width="100" />
+					<el-table-column align="center" label="红星" prop="redStar" width="100" />
 					<el-table-column label="描述" prop="remarks" />
-					<el-table-column label="操作" class-name="small-padding fixed-width" width="300">
+					<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-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>
@@ -41,15 +32,7 @@
 					</el-table-column>
 				</el-table>
 				<!-- 职务表格 -->
-				<el-table
-					v-loading="loading"
-					:data="postList"
-					border
-					:header-cell-style="{ 'text-align': 'center' }"
-					:cell-style="{ 'text-align': 'center' }"
-					highlight-current-row
-					v-show="tabIndex == 2"
-				>
+				<el-table v-loading="loading" :data="postList" border :cell-style="{ cursor: 'pointer' }" highlight-current-row v-show="tabIndex == 2">
 					<el-table-column label="职务" prop="jobName" width="200" />
 					<el-table-column label="级别" width="200">
 						<template slot-scope="scope">
@@ -62,9 +45,9 @@
 						</template>
 					</el-table-column>
 					<el-table-column label="描述" prop="remarks" />
-					<el-table-column label="操作" class-name="small-padding fixed-width" width="300">
+					<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-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>
@@ -116,8 +99,8 @@
 						</el-form-item>
 					</el-form>
 					<div slot="footer" class="dialog-footer">
-						<el-button size="medium" @click="postCancel">取 消</el-button>
-						<el-button type="primary" size="medium" @click="postSub">保 存</el-button>
+						<el-button size="small" @click="postCancel">取 消</el-button>
+						<el-button type="primary" size="small" @click="postSub">保 存</el-button>
 					</div>
 				</el-dialog>
 				<!-- 责权弹窗 -->
@@ -134,8 +117,8 @@
 						</div>
 					</div>
 					<div slot="footer" class="dialog-footer">
-						<el-button size="medium" @click="powerShow = false">取 消</el-button>
-						<el-button size="medium" type="primary" @click="powerSub">保 存</el-button>
+						<el-button size="small" @click="powerShow = false">取 消</el-button>
+						<el-button size="small" type="primary" @click="powerSub">保 存</el-button>
 					</div>
 				</el-dialog>
 			</div>
@@ -148,6 +131,7 @@
 	import { listDept } from '@/api/system/dept.js'
 	import { checkPermi } from '@/utils/permission'
 	export default {
+		name: 'levelPosition',
 		data() {
 			return {
 				loading: false,
@@ -246,9 +230,11 @@
 				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 })
 					}

+ 4 - 4
src/views/system/menu/index.vue

@@ -46,7 +46,7 @@
 					<el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
 					<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
 					<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
-					<el-table-column prop="status" label="状态" width="80">
+					<el-table-column prop="status" label="状态" width="80" align="center">
 						<template slot-scope="scope">
 							<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
 						</template>
@@ -56,7 +56,7 @@
 							<span>{{ parseTime(scope.row.createTime) }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+					<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>
@@ -207,8 +207,8 @@
 				</el-row>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
+				<el-button size="small" @click="cancel">取 消</el-button>
+				<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
 			</div>
 		</el-dialog>
 	</div>

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

@@ -32,7 +32,7 @@
 				</div>
 				<el-table v-loading="loading" :data="noticeList" border>
 					<el-table-column label="序号" align="center" prop="noticeId" width="100" />
-					<el-table-column label="公告标题" align="center" prop="noticeTitle" :show-overflow-tooltip="true" />
+					<el-table-column label="公告标题" align="left" prop="noticeTitle" :show-overflow-tooltip="true" />
 					<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
 						<template slot-scope="scope">
 							<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType" />
@@ -49,7 +49,7 @@
 							<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+					<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>
@@ -92,8 +92,8 @@
 				</el-row>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
+				<el-button size="small" @click="cancel">取 消</el-button>
+				<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
 			</div>
 		</el-dialog>
 	</div>

+ 344 - 362
src/views/system/post/index.vue

@@ -8,30 +8,21 @@
 						<div class="tag" :class="{ activeClass: over == 2 }" @click="getPostList">岗位</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" plain size="small " @click="handleAddNature" v-show="natureShow">添加</el-button>
-						<el-button type="primary" plain size="small " @click="handleAddPost" v-show="postShow">添加</el-button>
+						<el-button type="primary" size="mini " @click="handleAddNature" v-show="natureShow">添加</el-button>
+						<el-button type="primary" size="mini " @click="handleAddPost" v-show="postShow">添加</el-button>
 					</div>
 				</div>
 				<!-- 性质列表 -->
-				<el-table
-					v-loading="loading"
-					:data="natureList"
-					:header-cell-style="{ 'text-align': 'center' }"
-					:cell-style="{ textAlign: 'center', cursor: 'pointer' }"
-					border
-					highlight-current-row
-					@row-click="natureLineClick"
-					v-show="natureShow"
-				>
+				<el-table v-loading="loading" :data="natureList" :cell-style="{ cursor: 'pointer' }" border highlight-current-row @row-click="natureLineClick" v-show="natureShow">
 					<el-table-column label="性质" prop="natureName" width="200">
 						<template slot-scope="scope">
 							<a href="javascript:void(0);" class="linked" @click="natureLineDbclick(scope.row)">{{ scope.row.natureName }}</a>
 						</template>
 					</el-table-column>
-					<el-table-column label="描述" prop="remarks" width="1200" />
-					<el-table-column label="操作" class-name="small-padding fixed-width">
+					<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-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-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>
@@ -39,24 +30,15 @@
 					</el-table-column>
 				</el-table>
 				<!-- 岗位列表 -->
-				<el-table
-					v-loading="loading"
-					:data="postList"
-					border
-					:header-cell-style="{ 'text-align': 'center' }"
-					highlight-current-row
-					:cell-style="{ textAlign: 'center', cursor: 'pointer' }"
-					@row-click="postLineClick"
-					v-show="postShow"
-				>
+				<el-table v-loading="loading" :data="postList" border highlight-current-row :cell-style="{ cursor: 'pointer' }" @row-click="postLineClick" v-show="postShow">
 					<el-table-column label="岗位" prop="postName" width="200" />
 					<el-table-column label="性质" width="200">
 						{{ natureName }}
 					</el-table-column>
-					<el-table-column label="描述" prop="remark" width="800" />
-					<el-table-column label="操作" class-name="small-padding fixed-width">
+					<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="updataPost(scope.row)">编辑</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="updataPost(scope.row)">修改</el-button>
 							<el-button size="mini" type="text" icon="el-icon-delete-solid" @click="deletePost(scope.row)">删除</el-button>
 							<el-button size="mini" type="text" icon="el-icon-top" @click="postRise(scope.row, scope.$index)">上升</el-button>
 							<el-button size="mini" type="text" icon="el-icon-bottom" @click="postDecline(scope.row, scope.$index)">下降</el-button>
@@ -76,8 +58,8 @@
 						</el-form-item>
 					</el-form>
 					<div slot="footer" class="dialog-footer">
-						<el-button @click="cancelNature">取 消</el-button>
-						<el-button type="primary" @click="submitFormNature">保 存</el-button>
+						<el-button size="small" @click="cancelNature">取 消</el-button>
+						<el-button size="small" type="primary" @click="submitFormNature">保 存</el-button>
 					</div>
 				</el-dialog>
 				<!-- 岗位添加或修改对话框 -->
@@ -94,8 +76,8 @@
 						</el-form-item>
 					</el-form>
 					<div slot="footer" class="dialog-footer">
-						<el-button @click="cancelPost">取 消</el-button>
-						<el-button type="primary" @click="submitFormPost">保 存</el-button>
+						<el-button size="small" @click="cancelPost">取 消</el-button>
+						<el-button size="small" type="primary" @click="submitFormPost">保 存</el-button>
 					</div>
 				</el-dialog>
 			</div>
@@ -104,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
+	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: {}
+			}
 		},
-		// 岗位列表
-		getPostList() {
+		created() {
 			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 = {}
+		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 {
-							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)
-							})
+							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)
+								})
+							}
 						}
 					}
-				}
-			})
-		},
-		/** 新增性质按钮操作 */
-		handleAddNature() {
-			this.natureOpen = true
-			this.title = '性质添加'
-		},
-		// 新增岗位
-		handleAddPost() {
-			this.title = '岗位添加'
-			this.postOpen = true
-		},
-		/** 修改性质按钮操作 */
-		handleUpdate(row) {
-			getNatureByNatureId(row.natureId).then((response) => {
-				this.form = response.data
+				})
+			},
+			/** 新增性质按钮操作 */
+			handleAddNature() {
 				this.natureOpen = true
-				this.title = '修改性质'
-			})
-		},
-		// 修改岗位按钮
-		updataPost(row) {
-			getPost(row.postId).then((res) => {
-				this.formPost = res.data
+				this.title = '性质添加'
+			},
+			// 新增岗位
+			handleAddPost() {
+				this.title = '岗位添加'
 				this.postOpen = true
-				this.title = '修改岗位'
-			})
-		},
-		// 删除岗位
-		deletePost(row) {
-			this.$modal
-				.confirm('是否确认删除岗位为"' + row.postName + '"的数据项?')
-				.then(function () {
-					return delPost(row.postId)
+			},
+			/** 修改性质按钮操作 */
+			handleUpdate(row) {
+				getNatureByNatureId(row.natureId).then((response) => {
+					this.form = response.data
+					this.natureOpen = 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' })
-					}
+			},
+			// 修改岗位按钮
+			updataPost(row) {
+				getPost(row.postId).then((res) => {
+					this.formPost = res.data
+					this.postOpen = true
+					this.title = '修改岗位'
 				})
-				.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
+			},
+			// 删除岗位
+			deletePost(row) {
+				this.$modal
+					.confirm('是否确认删除岗位为"' + row.postName + '"的数据项?')
+					.then(function () {
+						return delPost(row.postId)
+					})
+					.then((res) => {
+						console.log(res)
+						if (res.code === 200) {
 							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.natureLineDbclick(this.nature)
+							this.$msg({ message: '删除成功' })
+						} else if (res.code === 500) {
+							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('修改成功')
 								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()
-							})
+							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()
+								})
+							}
 						}
 					}
-				}
-			})
-		},
-		// 性质上升
-		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
+					}
+					sysNatureEditBOs = [item, previous]
+					updateSortNature(sysNatureEditBOs).then((res) => {
+						if (res.code === 200) {
+							this.$msg({ message: '设置成功' })
+							this.getList()
+						}
+					})
 				}
-				previous = {
-					natureId: this.natureList[rowIndex + 1].natureId,
-					natureSort: this.natureList[rowIndex + 1].natureSort
+			},
+			// 岗位上升
+			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)
+						}
+					})
 				}
-				sysNatureEditBOs = [item, previous]
-				updateSortNature(sysNatureEditBOs).then((res) => {
-					if (res.code === 200) {
-						this.$msg({ message: '设置成功' })
-						this.getList()
+			},
+			// 性质下降
+			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
 					}
-				})
-			}
-		},
-		// 岗位下降
-		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 = {
+						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()
+						}
+					})
 				}
-				previous = {
-					postId: this.postList[rowIndex + 1].postId,
-					postSort: this.postList[rowIndex + 1].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)
+						}
+					})
 				}
-				sysNatureEditBOs = [item, previous]
-				updateSortPost(sysNatureEditBOs).then((res) => {
-					if (res.code === 200) {
-						this.$msg({ message: '设置成功' })
+			},
+			/** 删除性质按钮操作 */
+			handleDelete(row) {
+				this.$modal
+					.confirm('是否确认删除性质为"' + row.natureName + '"的数据项?')
+					.then(function () {
+						return delNature(row.natureId)
+					})
+					.then(() => {
 						this.getList()
-						this.natureLineDbclick(this.nature)
-					}
-				})
+						this.$msg({ message: '删除成功' })
+					})
+					.catch(() => {})
 			}
-		},
-		/** 删除性质按钮操作 */
-		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;
-}
-</style>
+	.activeClass {
+		color: #409eff;
+	}
+</style>

+ 0 - 201
src/views/system/role/authUser.vue

@@ -1,201 +0,0 @@
-<template>
-  <div class="app-container">
-     <el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true">
-      <el-form-item label="用户名称" prop="userName">
-        <el-input
-          v-model="queryParams.userName"
-          placeholder="请输入用户名称"
-          clearable
-          size="small"
-          style="width: 240px"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="手机号码" prop="phonenumber">
-        <el-input
-          v-model="queryParams.phonenumber"
-          placeholder="请输入手机号码"
-          clearable
-          size="small"
-          style="width: 240px"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="openSelectUser"
-          v-hasPermi="['system:role:add']"
-        >添加用户</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-circle-close"
-          size="mini"
-          :disabled="multiple"
-          @click="cancelAuthUserAll"
-          v-hasPermi="['system:role:remove']"
-        >批量取消授权</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-close"
-          size="mini"
-          @click="handleClose"
-        >关闭</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
-      <el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
-      <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
-      <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
-      <el-table-column label="状态" align="center" prop="status">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime) }}</span>
-        </template>
-      </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-circle-close"
-            @click="cancelAuthUser(scope.row)"
-            v-hasPermi="['system:role:remove']"
-          >取消授权</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-    <select-user ref="select" :roleId="queryParams.roleId" @ok="handleQuery" />
-  </div>
-</template>
-
-<script>
-import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role";
-import selectUser from "./selectUser";
-
-export default {
-  name: "AuthUser",
-  dicts: ['sys_normal_disable'],
-  components: { selectUser },
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中用户组
-      userIds: [],
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 用户表格数据
-      userList: [],
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        roleId: undefined,
-        userName: undefined,
-        phonenumber: undefined
-      }
-    };
-  },
-  created() {
-    const roleId = this.$route.params && this.$route.params.roleId;
-    if (roleId) {
-      this.queryParams.roleId = roleId;
-      this.getList();
-    }
-  },
-  methods: {
-    /** 查询授权用户列表 */
-    getList() {
-      this.loading = true;
-      allocatedUserList(this.queryParams).then(response => {
-          this.userList = response.rows;
-          this.total = response.total;
-          this.loading = false;
-        }
-      );
-    },
-    // 返回按钮
-    handleClose() {
-      const obj = { path: "/system/role" };
-      this.$tab.closeOpenPage(obj);
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.userIds = selection.map(item => item.userId)
-      this.multiple = !selection.length
-    },
-    /** 打开授权用户表弹窗 */
-    openSelectUser() {
-      this.$refs.select.show();
-    },
-    /** 取消授权按钮操作 */
-    cancelAuthUser(row) {
-      const roleId = this.queryParams.roleId;
-      this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function() {
-        return authUserCancel({ userId: row.userId, roleId: roleId });
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("取消授权成功");
-      }).catch(() => {});
-    },
-    /** 批量取消授权按钮操作 */
-    cancelAuthUserAll(row) {
-      const roleId = this.queryParams.roleId;
-      const userIds = this.userIds.join(",");
-      this.$modal.confirm('是否取消选中用户授权数据项?').then(function() {
-        return authUserCancelAll({ roleId: roleId, userIds: userIds });
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("取消授权成功");
-      }).catch(() => {});
-    }
-  }
-};
-</script>

+ 594 - 611
src/views/system/role/index.vue

@@ -9,39 +9,31 @@
 						<div class="tag" :class="{ activeClass: over == 3 }" @click="getHeaderPermission">表头权限</div>
 					</div>
 					<div class="actions">
-						<el-button type="primary" plain size="small " @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" v-hasPermi="['system:role:add']">添加</el-button>
 					</div>
 				</div>
 
 				<!-- 角色列表 -->
-				<el-table
-					v-loading="loading"
-					:data="roleList"
-					:header-cell-style="{ 'text-align': 'center' }"
-					:cell-style="{ textAlign: 'center', cursor: 'pointer' }"
-					border
-					@row-click="roleLineClick"
-					v-show="roleShow"
-				>
+				<el-table v-loading="loading" :data="roleList" :cell-style="{ cursor: 'pointer' }" border @row-click="roleLineClick" v-show="roleShow">
 					<el-table-column label="名称" prop="roleName" width="200">
 						<template slot-scope="scope">
 							<a href="javascript:void(0);" class="linked" @click="roleLineDbclick(scope.row)">{{ scope.row.roleName }}</a>
 						</template>
 					</el-table-column>
-					<el-table-column label="描述" prop="remark" width="950" />
-					<el-table-column label="创建时间" prop="createTime" width="200">
+					<el-table-column label="描述" prop="remark" />
+					<el-table-column align="center" label="创建时间" prop="createTime" width="200">
 						<template slot-scope="scope">
 							<span>{{ parseTime(scope.row.createTime) }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="状态" width="117" prop="status">
+					<el-table-column align="center" label="状态" width="117" prop="status">
 						<template slot-scope="scope">
 							<span>{{ scope.row.status == 0 ? '正常' : '停用' }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="操作" class-name="small-padding fixed-width">
+					<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" v-hasPermi="['system:role: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>
 						</template>
@@ -55,8 +47,7 @@
 					row-key="menuId"
 					:tree-props="{ children: 'children' }"
 					border
-					:header-cell-style="{ 'text-align': 'center' }"
-					:cell-style="{ textAlign: 'center', cursor: 'pointer' }"
+					:cell-style="{ cursor: 'pointer' }"
 					@row-click="functionalLineClick"
 					v-show="functionalShow"
 				>
@@ -87,15 +78,7 @@
 				</el-table>
 
 				<!-- 表头权限列表 -->
-				<el-table
-					v-loading="loading"
-					:data="headList"
-					border
-					:header-cell-style="{ 'text-align': 'center' }"
-					:cell-style="{ textAlign: 'center', cursor: 'pointer' }"
-					@row-click="headlLineClick"
-					v-show="headShow"
-				>
+				<el-table v-loading="loading" :data="headList" border :cell-style="{ cursor: 'pointer' }" @row-click="headlLineClick" v-show="headShow">
 					<el-table-column label="列表名称" width="200">{{ listName }}</el-table-column>
 					<el-table-column label="列名称" prop="columnName" width="200" />
 					<el-table-column label="状态" class-name="small-padding fixed-width">
@@ -131,8 +114,8 @@
 						</el-form-item>
 					</el-form>
 					<div slot="footer" class="dialog-footer">
-						<el-button type="primary" @click="submitForm">确 定</el-button>
-						<el-button @click="cancel">取 消</el-button>
+						<el-button size="small" type="primary" @click="submitForm">确 定</el-button>
+						<el-button size="small" @click="cancel">取 消</el-button>
 					</div>
 				</el-dialog>
 			</div>
@@ -141,622 +124,622 @@
 </template>
 
 <script>
-import {
-	listRole,
-	getRole,
-	delRole,
-	addRole,
-	updateRole,
-	dataScope,
-	changeRoleStatus,
-	getRoleMenuTreeselect,
-	saveRoleMenu,
-	getTableHeadList,
-	authUserCancelAll,
-	setSysTableCfgIsShow
-} from '@/api/system/role'
-import { treeselect as menuTreeselect, roleMenuTreeselect } from '@/api/system/menu'
-import { treeselect as deptTreeselect, roleDeptTreeselect } from '@/api/system/dept'
-import pinyin from 'js-pinyin'
+	import {
+		listRole,
+		getRole,
+		delRole,
+		addRole,
+		updateRole,
+		dataScope,
+		changeRoleStatus,
+		getRoleMenuTreeselect,
+		saveRoleMenu,
+		getTableHeadList,
+		authUserCancelAll,
+		setSysTableCfgIsShow
+	} from '@/api/system/role'
+	import { treeselect as menuTreeselect, roleMenuTreeselect } from '@/api/system/menu'
+	import { treeselect as deptTreeselect, roleDeptTreeselect } from '@/api/system/dept'
+	import pinyin from 'js-pinyin'
 
-export default {
-	name: 'Role',
-	dicts: ['sys_normal_disable'],
-	data() {
-		return {
-			// 遮罩层
-			loading: true,
-			// 总条数
-			total: 0,
-			// 角色表格数据
-			roleList: [],
-			// 弹出层标题
-			title: '',
-			// 是否显示弹出层
-			open: false,
-			// 是否显示弹出层(数据权限)
-			openDataScope: false,
-			menuExpand: false,
-			menuNodeAll: false,
-			deptExpand: true,
-			deptNodeAll: false,
-			// 日期范围
-			dateRange: [],
-			// 菜单列表
-			menuOptions: [],
-			// 部门列表
-			deptOptions: [],
-			// 查询参数
-			queryParams: {
-				pageNum: 1,
-				pageSize: 10,
-				roleName: undefined,
-				roleKey: undefined,
-				status: undefined
-			},
-			// 表单参数
-			form: {},
-			form1: {},
-			// 表单校验
-			rules: {
-				roleName: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }]
-			},
-			roleShow: true,
-			functionalShow: false,
-			headShow: false,
-			over: 1,
-			background: '',
-			getIndex: null,
-			getIndex1: null,
-			getIndex2: null,
-			functionList: [], // 功能权限列表
-			btnList: [], // 功能权限按钮列表
-			headList: [],
-			FuncList: [],
-			FuncListTree: [],
-			objRole: {},
-			objFun: {},
-			btnsLists: [],
-			btnsList: [],
-			checkedKeys: [],
-			checked: false,
-			roleId: '',
-			listName: '',
-			menuId: '',
-			checkStatus: -1,
-			disabled: false
-		}
-	},
-	created() {
-		this.getList()
-	},
-	filters: {},
-	methods: {
-		// 角色列表
-		getRole() {
-			this.getList()
-			this.over = 1
-			this.roleShow = true
-			this.functionalShow = false
-			this.headShow = false
-		},
-		// 功能权限列表
-		getFunctionalAuthority() {
-			this.getList()
-			this.roleLineDbclick(this.objRole)
-			this.headShow = false
+	export default {
+		name: 'Role',
+		dicts: ['sys_normal_disable'],
+		data() {
+			return {
+				// 遮罩层
+				loading: true,
+				// 总条数
+				total: 0,
+				// 角色表格数据
+				roleList: [],
+				// 弹出层标题
+				title: '',
+				// 是否显示弹出层
+				open: false,
+				// 是否显示弹出层(数据权限)
+				openDataScope: false,
+				menuExpand: false,
+				menuNodeAll: false,
+				deptExpand: true,
+				deptNodeAll: false,
+				// 日期范围
+				dateRange: [],
+				// 菜单列表
+				menuOptions: [],
+				// 部门列表
+				deptOptions: [],
+				// 查询参数
+				queryParams: {
+					pageNum: 1,
+					pageSize: 10,
+					roleName: undefined,
+					roleKey: undefined,
+					status: undefined
+				},
+				// 表单参数
+				form: {},
+				form1: {},
+				// 表单校验
+				rules: {
+					roleName: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }]
+				},
+				roleShow: true,
+				functionalShow: false,
+				headShow: false,
+				over: 1,
+				background: '',
+				getIndex: null,
+				getIndex1: null,
+				getIndex2: null,
+				functionList: [], // 功能权限列表
+				btnList: [], // 功能权限按钮列表
+				headList: [],
+				FuncList: [],
+				FuncListTree: [],
+				objRole: {},
+				objFun: {},
+				btnsLists: [],
+				btnsList: [],
+				checkedKeys: [],
+				checked: false,
+				roleId: '',
+				listName: '',
+				menuId: '',
+				checkStatus: -1,
+				disabled: false
+			}
 		},
-		// 表头权限;列表
-		getHeaderPermission() {
-			this.functionalLineDbclick(this.objFun)
+		created() {
 			this.getList()
 		},
-		/** 查询角色列表 */
-		getList() {
-			this.loading = true
-			listRole(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-				this.roleList = response.rows
-				this.total = response.total
-				this.loading = false
-			})
-		},
-		// 单击角色表格某一行 行点击事件,这里获取到的行对象(row)是没有index属性的
-		roleLineClick(row) {
-			this.getIndex = row.index
-			this.objRole = row
-		},
-		//为行对象(row)设置index属性
-		tableRowClassName({ row, rowIndex }) {
-			row.index = rowIndex
-		},
-		// 双击角色表格某一行
-		roleLineDbclick(row) {
-			this.roleId = ''
-			this.functionList = []
-			this.checkedKeys = []
-			this.btnList = []
-			this.FuncList = []
-			this.FuncListTree = []
-			this.roleId = row.roleId
-			getRoleMenuTreeselect(row.roleId).then((res) => {
-				this.checkedKeys = res.data.checkedKeys
-				this.functionList = res.data.menus
-				this.btnList = this.functionList.filter((item, index, c) => item.menuType == 'F')
-				this.btnsLists = this.functionList.filter((item, index, c) => item.menuType == 'C')
-				this.FuncList = this.functionList.filter((item, index, c) => item.menuType == 'M' || item.menuType == 'C')
-				this.FuncListTree = this.handleTree(this.FuncList, 'menuId', 'parentId')
-			})
-			this.functionalShow = true
-			this.roleShow = false
-			this.over = 2
-		},
-		// 单击功能权限表格某一行
-		functionalLineClick(row, event, column) {
-			this.getIndex1 = row.index
-			this.objFun = row
-		},
-		// 双击功能权限表格某一行
-		functionalLineDbclick(row, event, column) {
-			this.disabled = this.isChecked(row) ? false : true
-			this.headList = []
-			this.functionalShow = false
-			this.headShow = true
-			this.over = 3
-			this.listName = row.menuName
-			this.menuId = row.menuId
-			this.checkStatus = this.isChecked(row) ? 0 : 1
-			getTableHeadList(this.roleId, row.menuId, this.checkStatus).then((res) => {
-				this.headList = res.data
-			})
-		},
-		// 单击表头权限表格某一行
-		headlLineClick(row, event, column) {
-			this.getIndex2 = row.index
-		},
-		/** 查询菜单树结构 */
-		getMenuTreeselect() {
-			menuTreeselect().then((response) => {
-				this.menuOptions = response.data
-			})
-		},
-		/** 查询部门树结构 */
-		getDeptTreeselect() {
-			deptTreeselect().then((response) => {
-				this.deptOptions = response.data
-			})
-		},
-		// 所有菜单节点数据
-		// getMenuAllCheckedKeys() {
-		//   // 目前被选中的菜单节点
-		//   let checkedKeys = this.$refs.menu.getCheckedKeys();
-		//   // 半选中的菜单节点
-		//   let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
-		//   checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
-		//   return checkedKeys;
-		// },
-		// // 所有部门节点数据
-		// getDeptAllCheckedKeys() {
-		//   // 目前被选中的部门节点
-		//   let checkedKeys = this.$refs.dept.getCheckedKeys();
-		//   // 半选中的部门节点
-		//   let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
-		//   checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
-		//   return checkedKeys;
-		// },
-		/** 根据角色ID查询菜单树结构 */
-		getRoleMenuTreeselect(roleId) {
-			return roleMenuTreeselect(roleId).then((response) => {
-				this.menuOptions = response.menus
-				return response
-			})
-		},
-		/** 根据角色ID查询部门树结构 */
-		getRoleDeptTreeselect(roleId) {
-			return roleDeptTreeselect(roleId).then((response) => {
-				this.deptOptions = response.depts
-				return response
-			})
-		},
-		// 角色状态修改
-		handleStatusChange(row) {
-			let text = row.status === '0' ? '禁用' : '启用'
-			this.$modal
-				.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?')
-				.then(function () {
-					row.status = row.status === '0' ? '1' : '0'
-					return changeRoleStatus(row.roleId, row.status)
+		filters: {},
+		methods: {
+			// 角色列表
+			getRole() {
+				this.getList()
+				this.over = 1
+				this.roleShow = true
+				this.functionalShow = false
+				this.headShow = false
+			},
+			// 功能权限列表
+			getFunctionalAuthority() {
+				this.getList()
+				this.roleLineDbclick(this.objRole)
+				this.headShow = false
+			},
+			// 表头权限;列表
+			getHeaderPermission() {
+				this.functionalLineDbclick(this.objFun)
+				this.getList()
+			},
+			/** 查询角色列表 */
+			getList() {
+				this.loading = true
+				listRole(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
+					this.roleList = response.rows
+					this.total = response.total
+					this.loading = false
 				})
-				.then(() => {
-					this.$modal.msgSuccess(text + '成功')
+			},
+			// 单击角色表格某一行 行点击事件,这里获取到的行对象(row)是没有index属性的
+			roleLineClick(row) {
+				this.getIndex = row.index
+				this.objRole = row
+			},
+			//为行对象(row)设置index属性
+			tableRowClassName({ row, rowIndex }) {
+				row.index = rowIndex
+			},
+			// 双击角色表格某一行
+			roleLineDbclick(row) {
+				this.roleId = ''
+				this.functionList = []
+				this.checkedKeys = []
+				this.btnList = []
+				this.FuncList = []
+				this.FuncListTree = []
+				this.roleId = row.roleId
+				getRoleMenuTreeselect(row.roleId).then((res) => {
+					this.checkedKeys = res.data.checkedKeys
+					this.functionList = res.data.menus
+					this.btnList = this.functionList.filter((item, index, c) => item.menuType == 'F')
+					this.btnsLists = this.functionList.filter((item, index, c) => item.menuType == 'C')
+					this.FuncList = this.functionList.filter((item, index, c) => item.menuType == 'M' || item.menuType == 'C')
+					this.FuncListTree = this.handleTree(this.FuncList, 'menuId', 'parentId')
 				})
-				.catch(function () {
-					row.status = row.status === '0' ? '1' : '0'
+				this.functionalShow = true
+				this.roleShow = false
+				this.over = 2
+			},
+			// 单击功能权限表格某一行
+			functionalLineClick(row, event, column) {
+				this.getIndex1 = row.index
+				this.objFun = row
+			},
+			// 双击功能权限表格某一行
+			functionalLineDbclick(row, event, column) {
+				this.disabled = this.isChecked(row) ? false : true
+				this.headList = []
+				this.functionalShow = false
+				this.headShow = true
+				this.over = 3
+				this.listName = row.menuName
+				this.menuId = row.menuId
+				this.checkStatus = this.isChecked(row) ? 0 : 1
+				getTableHeadList(this.roleId, row.menuId, this.checkStatus).then((res) => {
+					this.headList = res.data
 				})
-		},
-		// 修改功能操作权限
-		updateBtn(e, obj1) {
-			let obj = {
-				menuId: e.menuId,
-				roleId: this.roleId
-			}
-			let arr = []
-			arr.push(obj)
-			// let parent = this.functionList.find((item) => item.menuId == e.parentId)
-			// let parents = []
-			// while (parent) {
-			// 	parents.push(parent)
-			// 	parent = this.functionList.find((item) => item.menuId == parent.parentId)
-			// }
-			if (this.checkedKeys.includes(e.menuId)) {
-				authUserCancelAll(arr).then((res) => {
-					if (res.code == 200) {
-						this.checkedKeys = this.checkedKeys.filter((item) => item != e.menuId)
-						this.$msg({ message: '修改成功' })
-					}
+			},
+			// 单击表头权限表格某一行
+			headlLineClick(row, event, column) {
+				this.getIndex2 = row.index
+			},
+			/** 查询菜单树结构 */
+			getMenuTreeselect() {
+				menuTreeselect().then((response) => {
+					this.menuOptions = response.data
 				})
-			} else {
-				// let arrs = []
-				// arrs.push(obj)
-				// parents.forEach(element => {
-				// 	let e = {
-				// 		menuId: element.menuId,
-				// 		roleId: this.roleId
-				// 	}
-				// 	arrs.push(e)
-				// });
-				saveRoleMenu(arr).then((res) => {
-					if (res.code == 200) {
-						this.checkedKeys.push(e.menuId)
-						this.$msg({ message: '修改成功' })
-						// this.checkedKeys.push(obj1.menuId)
-						// parents.forEach(element => {
-						//   this.checkedKeys.push(element.menuId)
-						// });
-					}
+			},
+			/** 查询部门树结构 */
+			getDeptTreeselect() {
+				deptTreeselect().then((response) => {
+					this.deptOptions = response.data
 				})
-			}
-
-			// let checked = !this.checkedKeys.includes(e.menuId)
-			// let obj = {
-			// 	menuId: e.menuId,
-			// 	roleId: this.roleId
-			// }
-			// let arr = []
-			// arr.push(obj)
-			// saveRoleMenu(arr).then((res) => {
-			// 		if (res.code == 200) {
-			// 			this.checkedKeys.push(e.menuId)
-			// 		}
-			// 	})
-			// if (checked) {
-			// 	let sArr = [...this.checkedKeys, e.menuId]
-			// 	parents.forEach((p) => {
-			// 		if (this.findChildrenIds(p).every((item) => sArr.includes(item))) {
-			// 			arr.push({
-			// 				menuId: p.menuId,
-			// 				roleId: this.roleId
-			// 			})
-			// 		}
-			// 	})
-			// } else {
-			// 	parents.forEach((p) => {
-			// 		arr.push({
-			// 			menuId: p.menuId,
-			// 			roleId: this.roleId
-			// 		})
-			// 	})
-			// }
-			// let req = JSON.stringify(arr)
-			// this.form1.json = req
-			// if (!checked) {
-			// 	authUserCancelAll(arr).then((res) => {
-			// 		if (res.code == 200) {
-			// 			this.checkedKeys = this.checkedKeys.filter((item) => item != e.menuId)
-			// 		}
-			// 	})
-			// } else {
-			// 	saveRoleMenu(arr).then((res) => {
-			// 		if (res.code == 200) {
-			// 			this.checkedKeys.push(e.menuId)
-			// 		}
-			// 	})
-			// }
-		},
-		// 表头权限显示
-		showOrHide(row) {
-			let iss = row.isShow === '1' ? '0' : '1'
-			setSysTableCfgIsShow(row.id, iss, this.menuId, this.roleId).then((res) => {
-				if (res.code == 200) {
-					row.isShow = row.isShow == '1' || row.isShow == null ? '0' : '1'
-					this.$msg({ message: '修改成功' })
-				}
-			})
-		},
-		// 取消按钮
-		cancel() {
-			this.open = false
-			this.reset()
-		},
-		// 取消按钮(数据权限)
-		cancelDataScope() {
-			this.openDataScope = false
-			this.reset()
-		},
-		// 表单重置
-		reset() {
-			// if (this.$refs.menu != undefined) {
-			//   this.$refs.menu.setCheckedKeys([]);
-			// }
-			;(this.menuExpand = false),
-				(this.menuNodeAll = false),
-				(this.deptExpand = true),
-				(this.deptNodeAll = false),
-				(this.form = {
-					roleId: undefined,
-					roleName: undefined,
-					roleKey: undefined,
-					roleSort: 0,
-					status: '0',
-					menuIds: [],
-					deptIds: [],
-					menuCheckStrictly: true,
-					deptCheckStrictly: true,
-					remark: undefined
+			},
+			// 所有菜单节点数据
+			// getMenuAllCheckedKeys() {
+			//   // 目前被选中的菜单节点
+			//   let checkedKeys = this.$refs.menu.getCheckedKeys();
+			//   // 半选中的菜单节点
+			//   let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
+			//   checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
+			//   return checkedKeys;
+			// },
+			// // 所有部门节点数据
+			// getDeptAllCheckedKeys() {
+			//   // 目前被选中的部门节点
+			//   let checkedKeys = this.$refs.dept.getCheckedKeys();
+			//   // 半选中的部门节点
+			//   let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
+			//   checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
+			//   return checkedKeys;
+			// },
+			/** 根据角色ID查询菜单树结构 */
+			getRoleMenuTreeselect(roleId) {
+				return roleMenuTreeselect(roleId).then((response) => {
+					this.menuOptions = response.menus
+					return response
 				})
-			this.resetForm('form')
-		},
-		// /** 搜索按钮操作 */
-		// handleQuery() {
-		// 	this.queryParams.pageNum = 1
-		// 	this.getList()
-		// },
-		// /** 重置按钮操作 */
-		// resetQuery() {
-		// 	this.dateRange = []
-		// 	this.resetForm('queryForm')
-		// 	this.handleQuery()
-		// },
-		// 树权限(展开/折叠)
-		// handleCheckedTreeExpand(value, type) {
-		// 	if (type == 'menu') {
-		// 		let treeList = this.menuOptions
-		// 		for (let i = 0; i < treeList.length; i++) {
-		// 			this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value
-		// 		}
-		// 	} else if (type == 'dept') {
-		// 		let treeList = this.deptOptions
-		// 		for (let i = 0; i < treeList.length; i++) {
-		// 			this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value
-		// 		}
-		// 	}
-		// },
-		// 树权限(全选/全不选)
-		// handleCheckedTreeNodeAll(value, type) {
-		//   if (type == 'menu') {
-		//     this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
-		//   } else if (type == 'dept') {
-		//     this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
-		//   }
-		// },
-		// 树权限(父子联动)
-		handleCheckedTreeConnect(e, type, item) {
-			let value = e.target.checked
-			// if (item.parentId) {
-
-			// }
-			// let ms = this.functionList.filter((item, index, c) => item.menuType == 'M')
-			// let mss = this.functionList.filter((it, index, c) => it.parentId == item.parentId)
-			// let m = ms.filter(i => i.menuId == item.parentId)
-			// console.log(mss)
-			// let ids = this.findChildrenIds(item)
-			// let objs = ids.map((m) => {
-			// 	return {
-			// 		menuId: m,
-			// 		roleId: this.roleId
-			// 	}
-			// })
-			// objs.push({
-			// 	menuId: item.menuId,
-			// 	roleId: this.roleId
-			// })
-			if (value) {
-				this.checkStatus = 0
-				this.disabled = false
-				this.checkedKeys.push(item.menuId)
-				let obj = {
-					menuId: item.menuId,
-					roleId: this.roleId
-				}
-				let arr = []
-				arr.push(obj)
-				saveRoleMenu(arr).then((res) => {
-					if (res.code == 200) {
-						this.$msg({ message: '修改成功' })
-					}
+			},
+			/** 根据角色ID查询部门树结构 */
+			getRoleDeptTreeselect(roleId) {
+				return roleDeptTreeselect(roleId).then((response) => {
+					this.deptOptions = response.depts
+					return response
 				})
-			} else {
-				this.checkedKeys = this.checkedKeys.filter((f) => f != item.menuId)
-				this.checkStatus = 1
-				this.disabled = true
+			},
+			// 角色状态修改
+			handleStatusChange(row) {
+				let text = row.status === '0' ? '禁用' : '启用'
+				this.$modal
+					.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?')
+					.then(function () {
+						row.status = row.status === '0' ? '1' : '0'
+						return changeRoleStatus(row.roleId, row.status)
+					})
+					.then(() => {
+						this.$modal.msgSuccess(text + '成功')
+					})
+					.catch(function () {
+						row.status = row.status === '0' ? '1' : '0'
+					})
+			},
+			// 修改功能操作权限
+			updateBtn(e, obj1) {
 				let obj = {
-					menuId: item.menuId,
+					menuId: e.menuId,
 					roleId: this.roleId
 				}
 				let arr = []
 				arr.push(obj)
-				authUserCancelAll(arr).then((res) => {
+				// let parent = this.functionList.find((item) => item.menuId == e.parentId)
+				// let parents = []
+				// while (parent) {
+				// 	parents.push(parent)
+				// 	parent = this.functionList.find((item) => item.menuId == parent.parentId)
+				// }
+				if (this.checkedKeys.includes(e.menuId)) {
+					authUserCancelAll(arr).then((res) => {
+						if (res.code == 200) {
+							this.checkedKeys = this.checkedKeys.filter((item) => item != e.menuId)
+							this.$msg({ message: '修改成功' })
+						}
+					})
+				} else {
+					// let arrs = []
+					// arrs.push(obj)
+					// parents.forEach(element => {
+					// 	let e = {
+					// 		menuId: element.menuId,
+					// 		roleId: this.roleId
+					// 	}
+					// 	arrs.push(e)
+					// });
+					saveRoleMenu(arr).then((res) => {
+						if (res.code == 200) {
+							this.checkedKeys.push(e.menuId)
+							this.$msg({ message: '修改成功' })
+							// this.checkedKeys.push(obj1.menuId)
+							// parents.forEach(element => {
+							//   this.checkedKeys.push(element.menuId)
+							// });
+						}
+					})
+				}
+
+				// let checked = !this.checkedKeys.includes(e.menuId)
+				// let obj = {
+				// 	menuId: e.menuId,
+				// 	roleId: this.roleId
+				// }
+				// let arr = []
+				// arr.push(obj)
+				// saveRoleMenu(arr).then((res) => {
+				// 		if (res.code == 200) {
+				// 			this.checkedKeys.push(e.menuId)
+				// 		}
+				// 	})
+				// if (checked) {
+				// 	let sArr = [...this.checkedKeys, e.menuId]
+				// 	parents.forEach((p) => {
+				// 		if (this.findChildrenIds(p).every((item) => sArr.includes(item))) {
+				// 			arr.push({
+				// 				menuId: p.menuId,
+				// 				roleId: this.roleId
+				// 			})
+				// 		}
+				// 	})
+				// } else {
+				// 	parents.forEach((p) => {
+				// 		arr.push({
+				// 			menuId: p.menuId,
+				// 			roleId: this.roleId
+				// 		})
+				// 	})
+				// }
+				// let req = JSON.stringify(arr)
+				// this.form1.json = req
+				// if (!checked) {
+				// 	authUserCancelAll(arr).then((res) => {
+				// 		if (res.code == 200) {
+				// 			this.checkedKeys = this.checkedKeys.filter((item) => item != e.menuId)
+				// 		}
+				// 	})
+				// } else {
+				// 	saveRoleMenu(arr).then((res) => {
+				// 		if (res.code == 200) {
+				// 			this.checkedKeys.push(e.menuId)
+				// 		}
+				// 	})
+				// }
+			},
+			// 表头权限显示
+			showOrHide(row) {
+				let iss = row.isShow === '1' ? '0' : '1'
+				setSysTableCfgIsShow(row.id, iss, this.menuId, this.roleId).then((res) => {
 					if (res.code == 200) {
+						row.isShow = row.isShow == '1' || row.isShow == null ? '0' : '1'
 						this.$msg({ message: '修改成功' })
 					}
 				})
-			}
-		},
-		/** 新增按钮操作 */
-		handleAdd() {
-			this.reset()
-			this.getMenuTreeselect()
-			this.open = true
-			this.title = '添加角色'
-		},
-		/** 修改按钮操作 */
-		handleUpdate(row) {
-			this.reset()
-			const roleId = row.roleId || this.ids
-			// const roleMenu = this.getRoleMenuTreeselect(roleId);
-			getRole(roleId).then((response) => {
-				this.form = response.data
-				this.open = true
-				// this.$nextTick(() => {
-				//   roleMenu.then(res => {
-				//     let checkedKeys = res.checkedKeys
-				//     checkedKeys.forEach((v) => {
-				//         this.$nextTick(()=>{
-				//             this.$refs.menu.setChecked(v, true ,false);
-				//         })
-				//     })
-				//   });
-				// });
-				this.title = '修改角色'
-			})
-		},
-		/** 选择角色权限范围触发 */
-		// dataScopeSelectChange(value) {
-		//   if(value !== '2') {
-		//     this.$refs.dept.setCheckedKeys([]);
-		//   }
-		// },
-		/** 分配数据权限操作 */
-		handleDataScope(row) {
-			this.reset()
-			const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId)
-			getRole(row.roleId).then((response) => {
-				this.form = response.data
-				this.openDataScope = true
-				// this.$nextTick(() => {
-				//   roleDeptTreeselect.then(res => {
-				//     this.$refs.dept.setCheckedKeys(res.checkedKeys);
-				//   });
-				// });
-				this.title = '分配数据权限'
-			})
-		},
-		/** 分配用户操作 */
-		// handleAuthUser: function (row) {
-		// 	const roleId = row.roleId
-		// 	this.$router.push('/system/role-auth/user/' + roleId)
-		// },
-		/** 提交按钮 */
-		submitForm: function () {
-			this.$refs['form'].validate((valid) => {
-				if (valid) {
-					if (this.form.roleId != undefined) {
-						// this.form.menuIds = this.getMenuAllCheckedKeys();
-						this.form.menuIds = []
-						updateRole(this.form).then((response) => {
-							console.log(response)
-							this.$modal.msgSuccess('修改成功')
-							this.open = false
-							this.getList()
-						})
-					} else {
-						// this.form.menuIds = this.getMenuAllCheckedKeys();
-						let val = this.form.roleName
-						this.form.roleKey = pinyin.getFullChars(val)
-						addRole(this.form).then((response) => {
-							this.$modal.msgSuccess('新增成功')
-							this.open = false
-							this.getList()
-						})
+			},
+			// 取消按钮
+			cancel() {
+				this.open = false
+				this.reset()
+			},
+			// 取消按钮(数据权限)
+			cancelDataScope() {
+				this.openDataScope = false
+				this.reset()
+			},
+			// 表单重置
+			reset() {
+				// if (this.$refs.menu != undefined) {
+				//   this.$refs.menu.setCheckedKeys([]);
+				// }
+				;(this.menuExpand = false),
+					(this.menuNodeAll = false),
+					(this.deptExpand = true),
+					(this.deptNodeAll = false),
+					(this.form = {
+						roleId: undefined,
+						roleName: undefined,
+						roleKey: undefined,
+						roleSort: 0,
+						status: '0',
+						menuIds: [],
+						deptIds: [],
+						menuCheckStrictly: true,
+						deptCheckStrictly: true,
+						remark: undefined
+					})
+				this.resetForm('form')
+			},
+			// /** 搜索按钮操作 */
+			// handleQuery() {
+			// 	this.queryParams.pageNum = 1
+			// 	this.getList()
+			// },
+			// /** 重置按钮操作 */
+			// resetQuery() {
+			// 	this.dateRange = []
+			// 	this.resetForm('queryForm')
+			// 	this.handleQuery()
+			// },
+			// 树权限(展开/折叠)
+			// handleCheckedTreeExpand(value, type) {
+			// 	if (type == 'menu') {
+			// 		let treeList = this.menuOptions
+			// 		for (let i = 0; i < treeList.length; i++) {
+			// 			this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value
+			// 		}
+			// 	} else if (type == 'dept') {
+			// 		let treeList = this.deptOptions
+			// 		for (let i = 0; i < treeList.length; i++) {
+			// 			this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value
+			// 		}
+			// 	}
+			// },
+			// 树权限(全选/全不选)
+			// handleCheckedTreeNodeAll(value, type) {
+			//   if (type == 'menu') {
+			//     this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
+			//   } else if (type == 'dept') {
+			//     this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
+			//   }
+			// },
+			// 树权限(父子联动)
+			handleCheckedTreeConnect(e, type, item) {
+				let value = e.target.checked
+				// if (item.parentId) {
+
+				// }
+				// let ms = this.functionList.filter((item, index, c) => item.menuType == 'M')
+				// let mss = this.functionList.filter((it, index, c) => it.parentId == item.parentId)
+				// let m = ms.filter(i => i.menuId == item.parentId)
+				// console.log(mss)
+				// let ids = this.findChildrenIds(item)
+				// let objs = ids.map((m) => {
+				// 	return {
+				// 		menuId: m,
+				// 		roleId: this.roleId
+				// 	}
+				// })
+				// objs.push({
+				// 	menuId: item.menuId,
+				// 	roleId: this.roleId
+				// })
+				if (value) {
+					this.checkStatus = 0
+					this.disabled = false
+					this.checkedKeys.push(item.menuId)
+					let obj = {
+						menuId: item.menuId,
+						roleId: this.roleId
+					}
+					let arr = []
+					arr.push(obj)
+					saveRoleMenu(arr).then((res) => {
+						if (res.code == 200) {
+							this.$msg({ message: '修改成功' })
+						}
+					})
+				} else {
+					this.checkedKeys = this.checkedKeys.filter((f) => f != item.menuId)
+					this.checkStatus = 1
+					this.disabled = true
+					let obj = {
+						menuId: item.menuId,
+						roleId: this.roleId
 					}
+					let arr = []
+					arr.push(obj)
+					authUserCancelAll(arr).then((res) => {
+						if (res.code == 200) {
+							this.$msg({ message: '修改成功' })
+						}
+					})
 				}
-			})
-		},
-		/** 提交按钮(数据权限) */
-		submitDataScope: function () {
-			if (this.form.roleId != undefined) {
-				this.form.deptIds = this.getDeptAllCheckedKeys()
-				dataScope(this.form).then((response) => {
-					this.$modal.msgSuccess('修改成功')
-					this.openDataScope = false
-					this.getList()
+			},
+			/** 新增按钮操作 */
+			handleAdd() {
+				this.reset()
+				this.getMenuTreeselect()
+				this.open = true
+				this.title = '添加角色'
+			},
+			/** 修改按钮操作 */
+			handleUpdate(row) {
+				this.reset()
+				const roleId = row.roleId || this.ids
+				// const roleMenu = this.getRoleMenuTreeselect(roleId);
+				getRole(roleId).then((response) => {
+					this.form = response.data
+					this.open = true
+					// this.$nextTick(() => {
+					//   roleMenu.then(res => {
+					//     let checkedKeys = res.checkedKeys
+					//     checkedKeys.forEach((v) => {
+					//         this.$nextTick(()=>{
+					//             this.$refs.menu.setChecked(v, true ,false);
+					//         })
+					//     })
+					//   });
+					// });
+					this.title = '修改角色'
 				})
-			}
-		},
-		/** 删除按钮操作 */
-		handleDelete(row) {
-			const roleIds = row.roleId || this.ids
-			this.$modal
-				.confirm('是否确认删除角色为"' + row.roleName + '"的数据项?')
-				.then(function () {
-					return delRole(roleIds)
+			},
+			/** 选择角色权限范围触发 */
+			// dataScopeSelectChange(value) {
+			//   if(value !== '2') {
+			//     this.$refs.dept.setCheckedKeys([]);
+			//   }
+			// },
+			/** 分配数据权限操作 */
+			handleDataScope(row) {
+				this.reset()
+				const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId)
+				getRole(row.roleId).then((response) => {
+					this.form = response.data
+					this.openDataScope = true
+					// this.$nextTick(() => {
+					//   roleDeptTreeselect.then(res => {
+					//     this.$refs.dept.setCheckedKeys(res.checkedKeys);
+					//   });
+					// });
+					this.title = '分配数据权限'
 				})
-				.then((res) => {
-					if (res.code === 200) {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					} else if (res.code === 500) {
+			},
+			/** 分配用户操作 */
+			// handleAuthUser: function (row) {
+			// 	const roleId = row.roleId
+			// 	this.$router.push('/system/role-auth/user/' + roleId)
+			// },
+			/** 提交按钮 */
+			submitForm: function () {
+				this.$refs['form'].validate((valid) => {
+					if (valid) {
+						if (this.form.roleId != undefined) {
+							// this.form.menuIds = this.getMenuAllCheckedKeys();
+							this.form.menuIds = []
+							updateRole(this.form).then((response) => {
+								console.log(response)
+								this.$modal.msgSuccess('修改成功')
+								this.open = false
+								this.getList()
+							})
+						} else {
+							// this.form.menuIds = this.getMenuAllCheckedKeys();
+							let val = this.form.roleName
+							this.form.roleKey = pinyin.getFullChars(val)
+							addRole(this.form).then((response) => {
+								this.$modal.msgSuccess('新增成功')
+								this.open = false
+								this.getList()
+							})
+						}
+					}
+				})
+			},
+			/** 提交按钮(数据权限) */
+			submitDataScope: function () {
+				if (this.form.roleId != undefined) {
+					this.form.deptIds = this.getDeptAllCheckedKeys()
+					dataScope(this.form).then((response) => {
+						this.$modal.msgSuccess('修改成功')
+						this.openDataScope = false
 						this.getList()
-						this.$notify({
-							title: '警告',
-							message: res.msg,
-							type: 'warning'
-						})
+					})
+				}
+			},
+			/** 删除按钮操作 */
+			handleDelete(row) {
+				const roleIds = row.roleId || this.ids
+				this.$modal
+					.confirm('是否确认删除角色为"' + row.roleName + '"的数据项?')
+					.then(function () {
+						return delRole(roleIds)
+					})
+					.then((res) => {
+						if (res.code === 200) {
+							this.getList()
+							this.$modal.msgSuccess('删除成功')
+						} else if (res.code === 500) {
+							this.getList()
+							this.$notify({
+								title: '警告',
+								message: res.msg,
+								type: 'warning'
+							})
+						}
+					})
+					.catch(() => {})
+			},
+			/** 导出按钮操作 */
+			// handleExport() {
+			// 	this.download(
+			// 		'system/role/export',
+			// 		{
+			// 			...this.queryParams
+			// 		},
+			// 		`role_${new Date().getTime()}.xlsx`
+			// 	)
+			// },
+			//寻找子id集合
+			findIds(parent) {
+				if (!parent.children) {
+					return
+				}
+				let res = []
+				parent.children.forEach((item) => {
+					if (item.menuType == 'C') {
+						res.push(item)
+					} else {
+						res = res.concat(this.findIds(item))
 					}
 				})
-				.catch(() => {})
-		},
-		/** 导出按钮操作 */
-		// handleExport() {
-		// 	this.download(
-		// 		'system/role/export',
-		// 		{
-		// 			...this.queryParams
-		// 		},
-		// 		`role_${new Date().getTime()}.xlsx`
-		// 	)
-		// },
-		//寻找子id集合
-		findIds(parent) {
-			if (!parent.children) {
-				return
-			}
-			let res = []
-			parent.children.forEach((item) => {
-				if (item.menuType == 'C') {
-					res.push(item)
-				} else {
-					res = res.concat(this.findIds(item))
+				return res
+			},
+			//寻找子id集合
+			findChildrenIds(parent) {
+				if (parent.menuType == 'M') {
+					let childIds = this.findIds(parent).map((item) => item.menuId)
+					return this.btnList.filter((item) => childIds.includes(item.parentId)).map((item) => item.menuId)
+				} else if (parent.menuType == 'C') {
+					return this.btnList.filter((item) => item.parentId == parent.menuId).map((item) => item.menuId)
 				}
-			})
-			return res
-		},
-		//寻找子id集合
-		findChildrenIds(parent) {
-			if (parent.menuType == 'M') {
-				let childIds = this.findIds(parent).map((item) => item.menuId)
-				return this.btnList.filter((item) => childIds.includes(item.parentId)).map((item) => item.menuId)
-			} else if (parent.menuType == 'C') {
-				return this.btnList.filter((item) => item.parentId == parent.menuId).map((item) => item.menuId)
-			}
-		}
-	},
-	computed: {
-		btnListss() {
-			return function (pid) {
-				return this.btnList.filter((item) => item.parentId == pid)
 			}
 		},
-		isChecked() {
-			return function (obj) {
-				// return this.findChildrenIds(obj).length > 0 && this.findChildrenIds(obj).every((item) => this.checkedKeys.includes(item))
-				return this.checkedKeys.includes(obj.menuId)
+		computed: {
+			btnListss() {
+				return function (pid) {
+					return this.btnList.filter((item) => item.parentId == pid)
+				}
+			},
+			isChecked() {
+				return function (obj) {
+					// return this.findChildrenIds(obj).length > 0 && this.findChildrenIds(obj).every((item) => this.checkedKeys.includes(item))
+					return this.checkedKeys.includes(obj.menuId)
+				}
 			}
 		}
 	}
-}
 </script>
 <style scoped>
-.activeClass {
-	color: #409eff;
-}
+	.activeClass {
+		color: #409eff;
+	}
 </style>

+ 0 - 140
src/views/system/role/selectUser.vue

@@ -1,140 +0,0 @@
-<template>
-  <!-- 授权用户 -->
-  <el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
-    <el-form :model="queryParams" ref="queryForm" :inline="true">
-      <el-form-item label="用户名称" prop="userName">
-        <el-input
-          v-model="queryParams.userName"
-          placeholder="请输入用户名称"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="手机号码" prop="phonenumber">
-        <el-input
-          v-model="queryParams.phonenumber"
-          placeholder="请输入手机号码"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-    <el-row>
-      <el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
-        <el-table-column type="selection" width="55"></el-table-column>
-        <el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
-        <el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
-        <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
-        <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
-        <el-table-column label="状态" align="center" prop="status">
-          <template slot-scope="scope">
-            <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
-          </template>
-        </el-table-column>
-        <el-table-column label="创建时间" align="center" prop="createTime" width="180">
-          <template slot-scope="scope">
-            <span>{{ parseTime(scope.row.createTime) }}</span>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination
-        v-show="total>0"
-        :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="getList"
-      />
-    </el-row>
-    <div slot="footer" class="dialog-footer">
-      <el-button type="primary" @click="handleSelectUser">确 定</el-button>
-      <el-button @click="visible = false">取 消</el-button>
-    </div>
-  </el-dialog>
-</template>
-
-<script>
-import { unallocatedUserList, authUserSelectAll } from "@/api/system/role";
-export default {
-  dicts: ['sys_normal_disable'],
-  props: {
-    // 角色编号
-    roleId: {
-      type: [Number, String]
-    }
-  },
-  data() {
-    return {
-      // 遮罩层
-      visible: false,
-      // 选中数组值
-      userIds: [],
-      // 总条数
-      total: 0,
-      // 未授权用户数据
-      userList: [],
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        roleId: undefined,
-        userName: undefined,
-        phonenumber: undefined
-      }
-    };
-  },
-  methods: {
-    // 显示弹框
-    show() {
-      this.queryParams.roleId = this.roleId;
-      this.getList();
-      this.visible = true;
-    },
-    clickRow(row) {
-      this.$refs.table.toggleRowSelection(row);
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.userIds = selection.map(item => item.userId);
-    },
-    // 查询表数据
-    getList() {
-      unallocatedUserList(this.queryParams).then(res => {
-        this.userList = res.rows;
-        this.total = res.total;
-      });
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    /** 选择授权用户操作 */
-    handleSelectUser() {
-      const roleId = this.queryParams.roleId;
-      const userIds = this.userIds.join(",");
-      if (userIds == "") {
-        this.$modal.msgError("请选择要分配的用户");
-        return;
-      }
-      authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => {
-        this.$modal.msgSuccess(res.msg);
-        if (res.code === 200) {
-          this.visible = false;
-          this.$emit("ok");
-        }
-      });
-    }
-  }
-};
-</script>

+ 11 - 8
src/views/system/tableHead/index.vue

@@ -20,15 +20,15 @@
 				</div>
 				<el-table v-loading="loading" :data="tableHeadList" border>
 					<el-table-column type="index" width="100" align="center" label="序号" />
-					<el-table-column label="列名称" prop="columnName" width="120" />
-					<el-table-column label="前端列名" prop="uiColumn" :show-overflow-tooltip="true" width="150" />
-					<el-table-column label="后端列名" prop="apiColum" :show-overflow-tooltip="true" width="150" />
+					<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">
-							<el-switch v-model="scope.row.required" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
+							<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 fixed-width">
+					<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>
@@ -63,8 +63,8 @@
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
+				<el-button size="small" @click="cancel">取 消</el-button>
+				<el-button size="small" type="primary" @click="submitForm">保 存</el-button>
 			</div>
 		</el-dialog>
 	</div>
@@ -159,7 +159,10 @@
 				})
 			},
 			handleStatusChange(data) {
-				tableHeadUpd(data).then((res) => {
+				tableHeadUpd({
+					...data,
+					required: Number(!data.required)
+				}).then((res) => {
 					if (res.code == 200) {
 						this.$msg({ message: '修改成功' })
 						this.updateData(data)

+ 0 - 117
src/views/system/user/authRole.vue

@@ -1,117 +0,0 @@
-<template>
-  <div class="app-container">
-    <h4 class="form-header h4">基本信息</h4>
-    <el-form ref="form" :model="form" label-width="80px">
-      <el-row>
-        <el-col :span="8" :offset="2">
-          <el-form-item label="用户昵称" prop="nickName">
-            <el-input v-model="form.nickName" disabled />
-          </el-form-item>
-        </el-col>
-        <el-col :span="8" :offset="2">
-          <el-form-item label="登录账号" prop="userName">
-            <el-input  v-model="form.userName" disabled />
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-
-    <h4 class="form-header h4">角色信息</h4>
-    <el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
-      <el-table-column label="序号" type="index" align="center">
-        <template slot-scope="scope">
-          <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
-      <el-table-column label="角色编号" align="center" prop="roleId" />
-      <el-table-column label="角色名称" align="center" prop="roleName" />
-      <el-table-column label="权限字符" align="center" prop="roleKey" />
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createTime) }}</span>
-        </template>
-      </el-table-column>
-    </el-table>
-    
-    <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
-
-    <el-form label-width="100px">
-      <el-form-item style="text-align: center;margin-left:-120px;margin-top:30px;">
-        <el-button type="primary" @click="submitForm()">提交</el-button>
-        <el-button @click="close()">返回</el-button>
-      </el-form-item>
-    </el-form>
-  </div>
-</template>
-
-<script>
-import { getAuthRole, updateAuthRole } from "@/api/system/user";
-
-export default {
-  name: "AuthRole",
-  data() {
-    return {
-       // 遮罩层
-      loading: true,
-      // 分页信息
-      total: 0,
-      pageNum: 1,
-      pageSize: 10,
-      // 选中角色编号
-      roleIds:[],
-      // 角色信息
-      roles: [],
-      // 用户信息
-      form: {}
-    };
-  },
-  created() {
-    const userId = this.$route.params && this.$route.params.userId;
-    if (userId) {
-      this.loading = true;
-      getAuthRole(userId).then((response) => {
-        this.form = response.user;
-        this.roles = response.roles;
-        this.total = this.roles.length;
-        this.$nextTick(() => {
-          this.roles.forEach((row) => {
-            if (row.flag) {
-              this.$refs.table.toggleRowSelection(row);
-            }
-          });
-        });
-        this.loading = false;
-      });
-    }
-  },
-  methods: {
-    /** 单击选中行数据 */
-    clickRow(row) {
-      this.$refs.table.toggleRowSelection(row);
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.roleIds = selection.map((item) => item.roleId);
-    },
-    // 保存选中的数据编号
-    getRowKey(row) {
-      return row.roleId;
-    },
-    /** 提交按钮 */
-    submitForm() {
-      const userId = this.form.userId;
-      const roleIds = this.roleIds.join(",");
-      updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
-        this.$modal.msgSuccess("授权成功");
-        this.close();
-      });
-    },
-    /** 关闭按钮 */
-    close() {
-      const obj = { path: "/system/user" };
-      this.$tab.closeOpenPage(obj);
-    },
-  },
-};
-</script>

+ 0 - 503
src/views/system/user/index.vue

@@ -1,503 +0,0 @@
-<template>
-	<div class="page-container">
-		<div class="search-container" v-show="showSearch">
-			<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
-				<el-form-item label="用户名称" prop="userName">
-					<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
-				</el-form-item>
-				<el-form-item label="手机号码" prop="phonenumber">
-					<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
-				</el-form-item>
-				<el-form-item label="状态" prop="status">
-					<el-select v-model="queryParams.status" placeholder="用户状态" clearable size="small" style="width: 240px">
-						<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
-					</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-form-item>
-				<el-form-item>
-					<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
-					<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
-				</el-form-item>
-			</el-form>
-		</div>
-		<div class="content-container">
-			<TreeChoice :dataList="deptOptions" nodeKey="id" nodeVal="label" @itemClick="handleNodeClick" />
-			<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" @click="handleAdd" v-hasPermi="['system:user:add']">添加</el-button>
-						<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
-						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:user:export']" style="margin-right: 10px">导出</el-button>
-						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-					</div>
-				</div>
-				<el-table v-loading="loading" border :data="userList">
-					<el-table-column label="用户编号" align="center" key="userId" prop="userId" />
-					<el-table-column label="用户名称" align="center" key="userName" prop="userName" :show-overflow-tooltip="true" />
-					<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" :show-overflow-tooltip="true" />
-					<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" :show-overflow-tooltip="true" />
-					<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" width="120" />
-					<el-table-column label="状态" align="center" key="status">
-						<template slot-scope="scope">
-							<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
-						</template>
-					</el-table-column>
-					<el-table-column label="创建时间" align="center" prop="createTime" width="160">
-						<template slot-scope="scope">
-							<span>{{ parseTime(scope.row.createTime) }}</span>
-						</template>
-					</el-table-column>
-					<el-table-column label="操作" align="center" width="160" 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="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-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
-								<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="handleResetPwd" icon="el-icon-key" v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
-									<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check" v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>
-								</el-dropdown-menu>
-							</el-dropdown>
-						</template>
-					</el-table-column>
-				</el-table>
-
-				<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
-			</div>
-		</div>
-		<!-- 添加或修改用户配置对话框 -->
-		<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
-			<el-form ref="form" :model="form" :rules="rules" label-width="80px">
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="用户昵称" prop="nickName">
-							<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
-						</el-form-item>
-					</el-col>
-					<el-col :span="12">
-						<el-form-item label="归属部门" prop="deptId">
-							<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="手机号码" prop="phonenumber">
-							<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
-						</el-form-item>
-					</el-col>
-					<el-col :span="12">
-						<el-form-item label="邮箱" prop="email">
-							<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
-							<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
-						</el-form-item>
-					</el-col>
-					<el-col :span="12">
-						<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
-							<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="用户性别">
-							<el-select v-model="form.sex" placeholder="请选择">
-								<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
-							</el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="12">
-						<el-form-item label="状态">
-							<el-radio-group v-model="form.status">
-								<el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
-							</el-radio-group>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="12">
-						<el-form-item label="岗位">
-							<el-select v-model="form.postIds" multiple placeholder="请选择">
-								<el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId" :disabled="item.status == 1"></el-option>
-							</el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :span="12">
-						<el-form-item label="角色">
-							<el-select v-model="form.roleIds" multiple placeholder="请选择">
-								<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
-							</el-select>
-						</el-form-item>
-					</el-col>
-				</el-row>
-				<el-row>
-					<el-col :span="24">
-						<el-form-item label="备注">
-							<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
-						</el-form-item>
-					</el-col>
-				</el-row>
-			</el-form>
-			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="cancel">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitForm">保 存</el-button>
-			</div>
-		</el-dialog>
-
-		<!-- 用户导入对话框 -->
-		<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
-			<el-upload
-				ref="upload"
-				:limit="1"
-				accept=".xlsx, .xls"
-				:headers="upload.headers"
-				:action="upload.url + '?updateSupport=' + upload.updateSupport"
-				:disabled="upload.isUploading"
-				:on-progress="handleFileUploadProgress"
-				:on-success="handleFileSuccess"
-				:auto-upload="false"
-				drag
-			>
-				<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>
-					<span>仅允许导入xls、xlsx格式文件。</span>
-					<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
-				</div>
-			</el-upload>
-			<div slot="footer" class="dialog-footer">
-				<el-button size="medium" @click="upload.open = false">取 消</el-button>
-				<el-button size="medium" type="primary" @click="submitFileForm">确 定</el-button>
-			</div>
-		</el-dialog>
-	</div>
-</template>
-
-<script>
-	import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from '@/api/system/user'
-	import { getToken } from '@/utils/auth'
-	import { treeselect } from '@/api/system/dept'
-	import Treeselect from '@riophae/vue-treeselect'
-	import TreeChoice from '@/components/treeChoice/index.vue'
-	import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-
-	export default {
-		name: 'User',
-		dicts: ['sys_normal_disable', 'sys_user_sex'],
-		components: { Treeselect, TreeChoice },
-		data() {
-			return {
-				// 遮罩层
-				loading: true,
-				// 显示搜索条件
-				showSearch: true,
-				// 总条数
-				total: 0,
-				// 用户表格数据
-				userList: null,
-				// 弹出层标题
-				title: '',
-				// 部门树选项
-				deptOptions: undefined,
-				// 是否显示弹出层
-				open: false,
-				// 部门名称
-				deptName: undefined,
-				// 默认密码
-				initPassword: undefined,
-				// 日期范围
-				dateRange: [],
-				// 岗位选项
-				postOptions: [],
-				// 角色选项
-				roleOptions: [],
-				// 表单参数
-				form: {},
-				defaultProps: {
-					children: 'children',
-					label: 'label'
-				},
-				// 用户导入参数
-				upload: {
-					// 是否显示弹出层(用户导入)
-					open: false,
-					// 弹出层标题(用户导入)
-					title: '',
-					// 是否禁用上传
-					isUploading: false,
-					// 是否更新已经存在的用户数据
-					updateSupport: 0,
-					// 设置上传的请求头部
-					headers: { Authorization: 'Bearer ' + getToken() },
-					// 上传的地址
-					url: process.env.VUE_APP_BASE_API + '/system/user/importData'
-				},
-				// 查询参数
-				queryParams: {
-					pageNum: 1,
-					pageSize: 10,
-					userName: undefined,
-					phonenumber: undefined,
-					status: undefined,
-					deptId: undefined
-				},
-				// 表单校验
-				rules: {
-					userName: [
-						{ required: true, message: '用户名称不能为空', trigger: 'blur' },
-						{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
-					],
-					nickName: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
-					password: [
-						{ required: true, message: '用户密码不能为空', trigger: 'blur' },
-						{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
-					],
-					email: [
-						{
-							type: 'email',
-							message: "'请输入正确的邮箱地址",
-							trigger: ['blur', 'change']
-						}
-					],
-					phonenumber: [
-						{
-							pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-							message: '请输入正确的手机号码',
-							trigger: 'blur'
-						}
-					]
-				}
-			}
-		},
-		created() {
-			this.getList()
-			this.getTreeselect()
-			this.getConfigKey('sys.user.initPassword').then((response) => {
-				this.initPassword = response.msg
-			})
-		},
-		methods: {
-			/** 查询用户列表 */
-			getList() {
-				this.loading = true
-				listUser(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
-					this.userList = response.rows
-					this.total = response.total
-					this.loading = false
-				})
-			},
-			/** 查询部门下拉树结构 */
-			getTreeselect() {
-				treeselect().then((response) => {
-					this.deptOptions = response.data
-				})
-			},
-			// 节点单击事件
-			handleNodeClick(data) {
-				this.queryParams.deptId = data.id
-				this.getList()
-			},
-			// 用户状态修改
-			handleStatusChange(row) {
-				let text = row.status === '0' ? '启用' : '停用'
-				this.$modal
-					.confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
-					.then(function () {
-						return changeUserStatus(row.userId, row.status)
-					})
-					.then(() => {
-						this.$modal.msgSuccess(text + '成功')
-					})
-					.catch(function () {
-						row.status = row.status === '0' ? '1' : '0'
-					})
-			},
-			// 取消按钮
-			cancel() {
-				this.open = false
-				this.reset()
-			},
-			// 表单重置
-			reset() {
-				this.form = {
-					userId: undefined,
-					deptId: undefined,
-					userName: undefined,
-					nickName: undefined,
-					password: undefined,
-					phonenumber: undefined,
-					email: undefined,
-					sex: undefined,
-					status: '0',
-					remark: undefined,
-					postIds: [],
-					roleIds: []
-				}
-				this.resetForm('form')
-			},
-			/** 搜索按钮操作 */
-			handleQuery() {
-				this.queryParams.pageNum = 1
-				this.getList()
-			},
-			/** 重置按钮操作 */
-			resetQuery() {
-				this.dateRange = []
-				this.resetForm('queryForm')
-				this.handleQuery()
-			},
-			// 更多操作触发
-			handleCommand(command, row) {
-				switch (command) {
-					case 'handleResetPwd':
-						this.handleResetPwd(row)
-						break
-					case 'handleAuthRole':
-						this.handleAuthRole(row)
-						break
-					default:
-						break
-				}
-			},
-			/** 新增按钮操作 */
-			handleAdd() {
-				this.reset()
-				this.getTreeselect()
-				getUser().then((response) => {
-					this.postOptions = response.posts
-					this.roleOptions = response.roles
-					this.open = true
-					this.title = '添加用户'
-					this.form.password = this.initPassword
-				})
-			},
-			/** 修改按钮操作 */
-			handleUpdate(row) {
-				this.reset()
-				this.getTreeselect()
-				const userId = row.userId || this.ids
-				getUser(userId).then((response) => {
-					this.form = response.data
-					this.postOptions = response.posts
-					this.roleOptions = response.roles
-					this.form.postIds = response.postIds
-					this.form.roleIds = response.roleIds
-					this.open = true
-					this.title = '修改用户'
-					this.form.password = ''
-				})
-			},
-			/** 重置密码按钮操作 */
-			handleResetPwd(row) {
-				this.$prompt('请输入"' + row.userName + '"的新密码', '提示', {
-					confirmButtonText: '确定',
-					cancelButtonText: '取消',
-					closeOnClickModal: false,
-					inputPattern: /^.{5,20}$/,
-					inputErrorMessage: '用户密码长度必须介于 5 和 20 之间'
-				})
-					.then(({ value }) => {
-						resetUserPwd(row.userId, value).then((response) => {
-							this.$modal.msgSuccess('修改成功,新密码是:' + value)
-						})
-					})
-					.catch(() => {})
-			},
-			/** 分配角色操作 */
-			handleAuthRole: function (row) {
-				const userId = row.userId
-				this.$router.push('/system/user-auth/role/' + userId)
-			},
-			/** 提交按钮 */
-			submitForm: function () {
-				this.$refs['form'].validate((valid) => {
-					if (valid) {
-						if (this.form.userId != undefined) {
-							updateUser(this.form).then((response) => {
-								this.$modal.msgSuccess('修改成功')
-								this.open = false
-								this.getList()
-							})
-						} else {
-							addUser(this.form).then((response) => {
-								this.$modal.msgSuccess('新增成功')
-								this.open = false
-								this.getList()
-							})
-						}
-					}
-				})
-			},
-			/** 删除按钮操作 */
-			handleDelete(row) {
-				const userIds = row.userId
-				this.$modal
-					.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
-					.then(function () {
-						return delUser(userIds)
-					})
-					.then(() => {
-						this.getList()
-						this.$modal.msgSuccess('删除成功')
-					})
-					.catch(() => {})
-			},
-			/** 导出按钮操作 */
-			handleExport() {
-				this.download(
-					'system/user/export',
-					{
-						...this.queryParams
-					},
-					`user_${new Date().getTime()}.xlsx`
-				)
-			},
-			/** 导入按钮操作 */
-			handleImport() {
-				this.upload.title = '用户导入'
-				this.upload.open = true
-			},
-			/** 下载模板操作 */
-			importTemplate() {
-				this.download('system/user/importTemplate', {}, `user_template_${new Date().getTime()}.xlsx`)
-			},
-			// 文件上传中处理
-			handleFileUploadProgress(event, file, fileList) {
-				this.upload.isUploading = true
-			},
-			// 文件上传成功处理
-			handleFileSuccess(response, file, fileList) {
-				this.upload.open = false
-				this.upload.isUploading = false
-				this.$refs.upload.clearFiles()
-				this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
-				this.getList()
-			},
-			// 提交上传文件
-			submitFileForm() {
-				this.$refs.upload.submit()
-			}
-		}
-	}
-</script>

+ 0 - 91
src/views/system/user/profile/index.vue

@@ -1,91 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-row :gutter="20">
-      <el-col :span="6" :xs="24">
-        <el-card class="box-card">
-          <div slot="header" class="clearfix">
-            <span>个人信息</span>
-          </div>
-          <div>
-            <div class="text-center">
-              <userAvatar :user="user" />
-            </div>
-            <ul class="list-group list-group-striped">
-              <li class="list-group-item">
-                <svg-icon icon-class="user" />用户名称
-                <div class="pull-right">{{ user.userName }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="phone" />手机号码
-                <div class="pull-right">{{ user.phonenumber }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="email" />用户邮箱
-                <div class="pull-right">{{ user.email }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="tree" />所属部门
-                <div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="peoples" />所属角色
-                <div class="pull-right">{{ roleGroup }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="date" />创建日期
-                <div class="pull-right">{{ user.createTime }}</div>
-              </li>
-            </ul>
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="18" :xs="24">
-        <el-card>
-          <div slot="header" class="clearfix">
-            <span>基本资料</span>
-          </div>
-          <el-tabs v-model="activeTab">
-            <el-tab-pane label="基本资料" name="userinfo">
-              <userInfo :user="user" />
-            </el-tab-pane>
-            <el-tab-pane label="修改密码" name="resetPwd">
-              <resetPwd :user="user" />
-            </el-tab-pane>
-          </el-tabs>
-        </el-card>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import userAvatar from "./userAvatar";
-import userInfo from "./userInfo";
-import resetPwd from "./resetPwd";
-import { getUserProfile } from "@/api/system/user";
-
-export default {
-  name: "Profile",
-  components: { userAvatar, userInfo, resetPwd },
-  data() {
-    return {
-      user: {},
-      roleGroup: {},
-      postGroup: {},
-      activeTab: "userinfo"
-    };
-  },
-  created() {
-    this.getUser();
-  },
-  methods: {
-    getUser() {
-      getUserProfile().then(response => {
-        this.user = response.data;
-        this.roleGroup = response.roleGroup;
-        this.postGroup = response.postGroup;
-      });
-    }
-  }
-};
-</script>

+ 0 - 68
src/views/system/user/profile/resetPwd.vue

@@ -1,68 +0,0 @@
-<template>
-  <el-form ref="form" :model="user" :rules="rules" label-width="80px">
-    <el-form-item label="旧密码" prop="oldPassword">
-      <el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" show-password/>
-    </el-form-item>
-    <el-form-item label="新密码" prop="newPassword">
-      <el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/>
-    </el-form-item>
-    <el-form-item label="确认密码" prop="confirmPassword">
-      <el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" show-password/>
-    </el-form-item>
-    <el-form-item>
-      <el-button type="primary" size="mini" @click="submit">保存</el-button>
-      <el-button type="danger" size="mini" @click="close">关闭</el-button>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-import { updateUserPwd } from "@/api/system/user";
-
-export default {
-  data() {
-    const equalToPassword = (rule, value, callback) => {
-      if (this.user.newPassword !== value) {
-        callback(new Error("两次输入的密码不一致"));
-      } else {
-        callback();
-      }
-    };
-    return {
-      user: {
-        oldPassword: undefined,
-        newPassword: undefined,
-        confirmPassword: undefined
-      },
-      // 表单校验
-      rules: {
-        oldPassword: [
-          { required: true, message: "旧密码不能为空", trigger: "blur" }
-        ],
-        newPassword: [
-          { required: true, message: "新密码不能为空", trigger: "blur" },
-          { min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" }
-        ],
-        confirmPassword: [
-          { required: true, message: "确认密码不能为空", trigger: "blur" },
-          { required: true, validator: equalToPassword, trigger: "blur" }
-        ]
-      }
-    };
-  },
-  methods: {
-    submit() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
-            this.$modal.msgSuccess("修改成功");
-          });
-        }
-      });
-    },
-    close() {
-      this.$tab.closePage();
-    }
-  }
-};
-</script>

+ 0 - 172
src/views/system/user/profile/userAvatar.vue

@@ -1,172 +0,0 @@
-<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>
-</template>
-
-<script>
-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;
-    }
-  }
-};
-</script>
-<style scoped lang="scss">
-.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 - 75
src/views/system/user/profile/userInfo.vue

@@ -1,75 +0,0 @@
-<template>
-  <el-form ref="form" :model="user" :rules="rules" label-width="80px">
-    <el-form-item label="用户昵称" prop="nickName">
-      <el-input v-model="user.nickName" maxlength="30" />
-    </el-form-item> 
-    <el-form-item label="手机号码" prop="phonenumber">
-      <el-input v-model="user.phonenumber" maxlength="11" />
-    </el-form-item>
-    <el-form-item label="邮箱" prop="email">
-      <el-input v-model="user.email" maxlength="50" />
-    </el-form-item>
-    <el-form-item label="性别">
-      <el-radio-group v-model="user.sex">
-        <el-radio label="0">男</el-radio>
-        <el-radio label="1">女</el-radio>
-      </el-radio-group>
-    </el-form-item>
-    <el-form-item>
-      <el-button type="primary" size="mini" @click="submit">保存</el-button>
-      <el-button type="danger" size="mini" @click="close">关闭</el-button>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-import { updateUserProfile } from "@/api/system/user";
-
-export default {
-  props: {
-    user: {
-      type: Object
-    }
-  },
-  data() {
-    return {
-      // 表单校验
-      rules: {
-        nickName: [
-          { required: true, message: "用户昵称不能为空", trigger: "blur" }
-        ],
-        email: [
-          { required: true, message: "邮箱地址不能为空", trigger: "blur" },
-          {
-            type: "email",
-            message: "'请输入正确的邮箱地址",
-            trigger: ["blur", "change"]
-          }
-        ],
-        phonenumber: [
-          { required: true, message: "手机号码不能为空", trigger: "blur" },
-          {
-            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-            message: "请输入正确的手机号码",
-            trigger: "blur"
-          }
-        ]
-      }
-    };
-  },
-  methods: {
-    submit() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          updateUserProfile(this.user).then(response => {
-            this.$modal.msgSuccess("修改成功");
-          });
-        }
-      });
-    },
-    close() {
-      this.$tab.closePage();
-    }
-  }
-};
-</script>