|
@@ -2,25 +2,24 @@
|
|
|
<div class="app-container post-page">
|
|
|
<div class="post-page-min" v-if="pageType == 1">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" >
|
|
|
-
|
|
|
<el-form-item label="关键字" prop="searchValue">
|
|
|
<el-input
|
|
|
v-model="queryParams.searchValue"
|
|
|
- placeholder="请输入职位编码"
|
|
|
+ placeholder="请输入身份编码"
|
|
|
clearable
|
|
|
size="small"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="职位状态" clearable size="small">
|
|
|
- <el-option
|
|
|
- v-for="dict in statusOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictLabel"
|
|
|
- :value="dict.dictValue"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+ <!--<el-form-item label="状态" prop="status">-->
|
|
|
+ <!--<el-select v-model="queryParams.status" placeholder="身份状态" clearable size="small">-->
|
|
|
+ <!--<el-option-->
|
|
|
+ <!--v-for="dict in statusOptions"-->
|
|
|
+ <!--:key="dict.dictValue"-->
|
|
|
+ <!--:label="dict.dictLabel"-->
|
|
|
+ <!--:value="dict.dictValue"-->
|
|
|
+ <!--/>-->
|
|
|
+ <!--</el-select>-->
|
|
|
+ <!--</el-form-item>-->
|
|
|
<el-form-item style="float: right;">
|
|
|
<el-col :span="1.5" style="margin-right:20px">
|
|
|
<p class="add-button-one-120"
|
|
@@ -39,7 +38,7 @@
|
|
|
<el-table-column label="身份名称" align="left" prop="postName" :show-overflow-tooltip="true" width="200"/>
|
|
|
<el-table-column label="身份编码" align="left" prop="postCode" :show-overflow-tooltip="true" width="200"/>
|
|
|
<el-table-column label="权限组" align="left" prop="roleNameStr" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column label="状态" align="left" prop="status" :formatter="statusFormat" :show-overflow-tooltip="true" width="80"/>
|
|
|
+ <!--<el-table-column label="状态" align="left" prop="status" :formatter="statusFormat" :show-overflow-tooltip="true" width="80"/>-->
|
|
|
<el-table-column label="创建时间" align="left" prop="createTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
@@ -70,7 +69,7 @@
|
|
|
<!--icon="el-icon-edit"-->
|
|
|
<!--@click="handleUpdate(scope.row)"-->
|
|
|
<!--v-hasPermi="['system:post:edit']"-->
|
|
|
- <!-->分配职位</el-button>-->
|
|
|
+ <!-->分配身份</el-button>-->
|
|
|
<!--<el-button-->
|
|
|
<!--size="mini"-->
|
|
|
<!--type="text"-->
|
|
@@ -97,21 +96,21 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
</div>
|
|
|
- <!-- 添加或修改职位对话框 -->
|
|
|
+ <!-- 添加或修改身份对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body
|
|
|
:close-on-click-modal="false">
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="身份名称" prop="postName">
|
|
|
- <el-input v-model="form.postName" placeholder="请输入职位名称" maxlength="10" />
|
|
|
+ <el-input v-model="form.postName" placeholder="请输入身份名称" maxlength="10" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="身份编码" prop="postCode">
|
|
|
<el-input v-model="form.postCode" placeholder="请输入编码名称" maxlength="20" />
|
|
|
</el-form-item>
|
|
|
- <!--<el-form-item label="职位顺序" prop="postSort">-->
|
|
|
+ <!--<el-form-item label="身份顺序" prop="postSort">-->
|
|
|
<!--<el-input-number v-model="form.postSort" controls-position="right" :min="0" style="width: 380px"/>-->
|
|
|
<!--</el-form-item>-->
|
|
|
|
|
|
- <el-form-item label="角色" prop="status">
|
|
|
+ <el-form-item label="权限组" prop="roleIds">
|
|
|
<el-select
|
|
|
style="width:380px;"
|
|
|
v-model="form.roleIds"
|
|
@@ -126,15 +125,15 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="身份状态" prop="status">
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
- <el-radio
|
|
|
- v-for="dict in statusOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictValue"
|
|
|
- >{{dict.dictLabel}}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
+ <!--<el-form-item label="身份状态" prop="status">-->
|
|
|
+ <!--<el-radio-group v-model="form.status">-->
|
|
|
+ <!--<el-radio-->
|
|
|
+ <!--v-for="dict in statusOptions"-->
|
|
|
+ <!--:key="dict.dictValue"-->
|
|
|
+ <!--:label="dict.dictValue"-->
|
|
|
+ <!-->{{dict.dictLabel}}</el-radio>-->
|
|
|
+ <!--</el-radio-group>-->
|
|
|
+ <!--</el-form-item>-->
|
|
|
<!--<el-form-item label="备注" prop="remark">-->
|
|
|
<!--<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />-->
|
|
|
<!--</el-form-item>-->
|
|
@@ -151,6 +150,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { positionByList } from "@/api/system/user";
|
|
|
import { listPost, getPost, delPost, addPost, updatePost, optionselect } from "@/api/system/post";
|
|
|
import authUser from "./authUser.vue";
|
|
|
|
|
@@ -174,7 +174,7 @@ export default {
|
|
|
showSearch: true,
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
- // 职位表格数据
|
|
|
+ // 身份表格数据
|
|
|
postList: [],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
@@ -198,16 +198,20 @@ export default {
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
postName: [
|
|
|
- { required: true, message: "身份名称不能为空", trigger: "blur" },
|
|
|
- { required: true, message: "身份名称不能为空", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
+ { required: true, message: "请输入身份名称", trigger: "blur" },
|
|
|
+ { required: true, message: "请输入身份名称", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
],
|
|
|
postCode: [
|
|
|
- { required: true, message: "身份编码不能为空", trigger: "blur" },
|
|
|
- { required: true, message: "身份编码不能为空", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
+ { required: true, message: "请输入身份编码", trigger: "blur" },
|
|
|
+ { required: true, message: "请输入身份编码", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
],
|
|
|
postSort: [
|
|
|
- { required: true, message: "身份顺序不能为空", trigger: "blur" },
|
|
|
- { required: true, message: "身份顺序不能为空", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
+ { required: true, message: "请输入身份顺序", trigger: "blur" },
|
|
|
+ { required: true, message: "请输入身份顺序", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
+ ],
|
|
|
+ roleIds: [
|
|
|
+ { required: true, message: "请选择权限组", trigger: "blur" },
|
|
|
+ { required: true, message: "请选择权限组", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
]
|
|
|
},
|
|
|
//权限组列表
|
|
@@ -216,9 +220,9 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
- this.getDicts("sys_normal_disable").then(response => {
|
|
|
- this.statusOptions = response.data;
|
|
|
- });
|
|
|
+ // this.getDicts("sys_normal_disable").then(response => {
|
|
|
+ // this.statusOptions = response.data;
|
|
|
+ // });
|
|
|
this.optionselect();
|
|
|
},
|
|
|
methods: {
|
|
@@ -227,7 +231,7 @@ export default {
|
|
|
this.pageType = type;
|
|
|
}
|
|
|
},
|
|
|
- /** 查询职位列表 */
|
|
|
+ /** 查询身份列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
listPost(this.queryParams).then(response => {
|
|
@@ -242,7 +246,7 @@ export default {
|
|
|
this.optionselectList = response.data;
|
|
|
});
|
|
|
},
|
|
|
- // 职位状态字典翻译
|
|
|
+ // 身份状态字典翻译
|
|
|
statusFormat(row, column) {
|
|
|
return this.selectDictLabel(this.statusOptions, row.status);
|
|
|
},
|
|
@@ -258,7 +262,6 @@ export default {
|
|
|
postCode: undefined,
|
|
|
postName: undefined,
|
|
|
postSort: 0,
|
|
|
- status: "0",
|
|
|
remark: undefined
|
|
|
};
|
|
|
this.resetForm("form");
|
|
@@ -276,14 +279,17 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize:20,
|
|
|
searchValue:"",
|
|
|
- status:"",
|
|
|
});
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
/** 分配用户操作 */
|
|
|
handleAuthUser: function(row) {
|
|
|
- this.postId=row.postId;
|
|
|
- this.pageType=2;
|
|
|
+ if(row.roleIds){
|
|
|
+ this.postId=row.postId;
|
|
|
+ this.pageType=2;
|
|
|
+ }else{
|
|
|
+ this.msgError('未配置权限组的身份无法分配用户')
|
|
|
+ }
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
@@ -310,7 +316,7 @@ export default {
|
|
|
}
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
- this.title = "修改职位";
|
|
|
+ this.title = "修改身份";
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
@@ -337,17 +343,23 @@ export default {
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const postIds = row.postId || this.ids;
|
|
|
- this.$confirm('是否确认删除职位?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delPost(postIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ positionByList({position:row.postId}).then(response => {
|
|
|
+ if(response.total<1){
|
|
|
+ const postIds = row.postId || this.ids;
|
|
|
+ this.$confirm('是否确认删除身份?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delPost(postIds);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ }else{
|
|
|
+ this.msgError('该身份下还有用户无法删除')
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|