|
@@ -1,14 +1,15 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="5">
|
|
|
|
|
|
+ <el-col :span="8">
|
|
<tree-nav @renderTable="updateDeptId" treeType="zjk"></tree-nav>
|
|
<tree-nav @renderTable="updateDeptId" treeType="zjk"></tree-nav>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="19">
|
|
|
|
|
|
+ <el-col :span="16">
|
|
<el-container>
|
|
<el-container>
|
|
<el-main>
|
|
<el-main>
|
|
- <div class="position:relative">
|
|
|
|
|
|
+ <div style="margin-bottom: 20px;">
|
|
<el-button type="primary" @click="showDialog('add')" class="el-icon-plus">新增</el-button>
|
|
<el-button type="primary" @click="showDialog('add')" class="el-icon-plus">新增</el-button>
|
|
|
|
+ <el-button type="primary" @click="" class="el-icon-plus" v-show="activeName === 'waipin'">导入</el-button>
|
|
|
|
|
|
<div style="
|
|
<div style="
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -23,96 +24,41 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<el-tabs v-model="activeName" @tab-click="(instance) => (tableParams.type = instance.name)">
|
|
<el-tabs v-model="activeName" @tab-click="(instance) => (tableParams.type = instance.name)">
|
|
- <el-tab-pane label="外聘" name="waipin">
|
|
|
|
- <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%">
|
|
|
|
- <el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
- <el-table-column label="用户名">
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
- scope.row.user_name
|
|
|
|
- }}</template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="姓名">
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
- scope.row.user_realname
|
|
|
|
- }}</template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="部门">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{
|
|
|
|
- scope.row.org_info.dept_full.reduce(function (
|
|
|
|
- path,
|
|
|
|
- data
|
|
|
|
- ) {
|
|
|
|
- return (path += "/" + data.dept_name || "");
|
|
|
|
- },
|
|
|
|
- "")
|
|
|
|
- }}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="角色">
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
- scope.row.user_role_name
|
|
|
|
- }}</template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <!-- <el-table-column label="管理活动类型" width="200" :show-overflow-tooltip="true">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{
|
|
|
|
- scope.row.my_cates.hh_ids_full.reduce(function (
|
|
|
|
- result,
|
|
|
|
- item
|
|
|
|
- ) {
|
|
|
|
- return (result += item.hh_name + ",");
|
|
|
|
- },
|
|
|
|
- "")
|
|
|
|
- }}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column> -->
|
|
|
|
- <el-table-column label="账号类型">
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
- scope.row.user_level === "1" ? "普通账号" : "临时账号"
|
|
|
|
- }}</template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="操作" width="120">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-link type="primary" @click="delUser(scope.row.user_id)">删除</el-link>
|
|
|
|
- <span style="color: #409eff; margin: 0 10px">|</span>
|
|
|
|
- <el-link type="primary" @click="showDialog('edit', scope.row)">编辑</el-link>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- </el-tab-pane>
|
|
|
|
- <el-tab-pane label="本地" name="bendi">
|
|
|
|
- <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%">
|
|
|
|
- <el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
- <el-table-column label="用户名">
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
- scope.row.user_name
|
|
|
|
- }}</template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="姓名">
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
- scope.row.user_realname
|
|
|
|
- }}</template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="部门">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- {{
|
|
|
|
- scope.row.org_info.dept_full.reduce(function (
|
|
|
|
- path,
|
|
|
|
- data
|
|
|
|
- ) {
|
|
|
|
- return (path += "/" + data.dept_name || "");
|
|
|
|
- },
|
|
|
|
- "")
|
|
|
|
- }}
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="角色">
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
- scope.row.user_role_name
|
|
|
|
- }}</template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <!-- <el-table-column label="管理活动类型" width="200" :show-overflow-tooltip="true">
|
|
|
|
|
|
+ <el-tab-pane label="外聘" name="waipin"> </el-tab-pane>
|
|
|
|
+ <el-tab-pane label="本地" name="bendi"></el-tab-pane>
|
|
|
|
+ </el-tabs>
|
|
|
|
+
|
|
|
|
+ <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%">
|
|
|
|
+ <!-- <el-table-column type="selection" width="55"></el-table-column> -->
|
|
|
|
+ <el-table-column label="用户名" width="160">
|
|
|
|
+ <template slot-scope="scope">{{
|
|
|
|
+ scope.row.user_name
|
|
|
|
+ }}</template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="姓名" width="160">
|
|
|
|
+ <template slot-scope="scope">{{
|
|
|
|
+ scope.row.user_realname
|
|
|
|
+ }}</template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="部门" width="auto" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{
|
|
|
|
+ scope.row.org_info.dept_full.reduce(function (
|
|
|
|
+ path,
|
|
|
|
+ data
|
|
|
|
+ ) {
|
|
|
|
+ return (path += "/" + data.dept_name || "");
|
|
|
|
+ },
|
|
|
|
+ "")
|
|
|
|
+ }}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="角色" width="100">
|
|
|
|
+ <template slot-scope="scope">{{
|
|
|
|
+ scope.row.user_role_name
|
|
|
|
+ }}</template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <!-- <el-table-column label="管理活动类型" width="200" :show-overflow-tooltip="true">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{
|
|
{{
|
|
scope.row.my_cates.hh_ids_full.reduce(function (
|
|
scope.row.my_cates.hh_ids_full.reduce(function (
|
|
@@ -125,21 +71,19 @@
|
|
}}
|
|
}}
|
|
</template>
|
|
</template>
|
|
</el-table-column> -->
|
|
</el-table-column> -->
|
|
- <el-table-column label="账号类型">
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
- scope.row.user_level === "1" ? "普通账号" : "临时账号"
|
|
|
|
- }}</template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="操作" width="120">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-link type="primary" @click="delUser(scope.row.user_id)">删除</el-link>
|
|
|
|
- <span style="color: #409eff; margin: 0 10px">|</span>
|
|
|
|
- <el-link type="primary" @click="showDialog('edit', scope.row)">编辑</el-link>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- </el-tab-pane>
|
|
|
|
- </el-tabs>
|
|
|
|
|
|
+ <el-table-column label="账号类型" width="100">
|
|
|
|
+ <template slot-scope="scope">{{
|
|
|
|
+ scope.row.user_level === "1" ? "普通账号" : "临时账号"
|
|
|
|
+ }}</template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="操作" width="120">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-link type="primary" @click="delUser(scope.row.user_id)">删除</el-link>
|
|
|
|
+ <span style="color: #409eff; margin: 0 10px">|</span>
|
|
|
|
+ <el-link type="primary" @click="showDialog('edit', scope.row)">编辑</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
</el-main>
|
|
</el-main>
|
|
<el-footer style="text-align: right">
|
|
<el-footer style="text-align: right">
|
|
<el-pagination background hide-on-single-page layout="prev, pager, next" :page-size="tableParams.limit"
|
|
<el-pagination background hide-on-single-page layout="prev, pager, next" :page-size="tableParams.limit"
|
|
@@ -167,14 +111,14 @@
|
|
<el-input v-model="user_main.user_realname"></el-input>
|
|
<el-input v-model="user_main.user_realname"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="12">
|
|
|
|
|
|
+ <!-- <el-col :span="12">
|
|
<el-form-item label="账号类型" prop="user_level">
|
|
<el-form-item label="账号类型" prop="user_level">
|
|
<el-select v-model="user_main.user_level" placeholder="请选择">
|
|
<el-select v-model="user_main.user_level" placeholder="请选择">
|
|
<el-option label="临时账号" value="0"></el-option>
|
|
<el-option label="临时账号" value="0"></el-option>
|
|
<el-option label="普通账号" value="1"></el-option>
|
|
<el-option label="普通账号" value="1"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col> -->
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-form-item label="部门" prop="dept_id">
|
|
<el-form-item label="部门" prop="dept_id">
|
|
<el-cascader :options="deptOptions" :props="{ checkStrictly: true, emitPath: false }" clearable filterable
|
|
<el-cascader :options="deptOptions" :props="{ checkStrictly: true, emitPath: false }" clearable filterable
|
|
@@ -229,13 +173,13 @@ export default {
|
|
TreeNav,
|
|
TreeNav,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
- const validatePass = (rule, value, callback) => {
|
|
|
|
- if (this.dialogType === "add" && value.trim() === "") {
|
|
|
|
- callback(new Error("请输入密码"));
|
|
|
|
- } else {
|
|
|
|
- callback();
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
|
|
+ // const validatePass = (rule, value, callback) => {
|
|
|
|
+ // if (this.dialogType === "add" && value.trim() === "") {
|
|
|
|
+ // callback(new Error("请输入密码"));
|
|
|
|
+ // } else {
|
|
|
|
+ // callback();
|
|
|
|
+ // }
|
|
|
|
+ // };
|
|
return {
|
|
return {
|
|
roleList: [], // 角色列表
|
|
roleList: [], // 角色列表
|
|
deptOptions: [], // 部门组织级联
|
|
deptOptions: [], // 部门组织级联
|
|
@@ -256,16 +200,23 @@ export default {
|
|
},
|
|
},
|
|
form_rules: {
|
|
form_rules: {
|
|
user_name: [
|
|
user_name: [
|
|
- { required: true, message: "请输入用户名", trigger: "blur" },
|
|
|
|
|
|
+ { required: true, message: "请输入用户名", trigger: "submit" },
|
|
|
|
+ { message: "用户名包含非法字符", trigger: "submit", pattern: '^[a-zA-Z0-9_]+$' },
|
|
|
|
+ { min: 3, message: "用户名长度不小于 3 个字符", trigger: "submit" },
|
|
|
|
+ ],
|
|
|
|
+ user_password: [
|
|
|
|
+ // { validator: validatePass, trigger: "submit" },
|
|
|
|
+ { required: true, message: "请输入密码", trigger: "submit" },
|
|
|
|
+ // { message: "用户名包含非法字符", trigger: "submit", pattern: '^[a-zA-Z0-9_]+$' },
|
|
|
|
+ { min: 6, message: "密码长度不小于 6 个字符", trigger: "submit" },
|
|
],
|
|
],
|
|
- user_password: [{ validator: validatePass, trigger: "blur" }],
|
|
|
|
user_realname: [
|
|
user_realname: [
|
|
- { required: true, message: "请输入用户姓名", trigger: "blur" },
|
|
|
|
|
|
+ { required: true, message: "请输入用户姓名", trigger: "submit" },
|
|
],
|
|
],
|
|
user_level: [
|
|
user_level: [
|
|
- { required: true, message: "请选择账号类型", trigger: "change" },
|
|
|
|
|
|
+ { required: true, message: "请选择账号类型", trigger: "submit" },
|
|
],
|
|
],
|
|
- dept_id: [{ required: true, message: "请选择部门", trigger: "change" }],
|
|
|
|
|
|
+ dept_id: [{ required: true, message: "请选择部门", trigger: "submit" }],
|
|
},
|
|
},
|
|
activeDeptName: "",
|
|
activeDeptName: "",
|
|
activeTableChecked: [],
|
|
activeTableChecked: [],
|
|
@@ -357,6 +308,7 @@ export default {
|
|
_this.user_main[key] = data[key];
|
|
_this.user_main[key] = data[key];
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ _this.user_main['user_password'] = data['user_password_origin']
|
|
}
|
|
}
|
|
this.dialogType = type;
|
|
this.dialogType = type;
|
|
this.userDialogVisible = true;
|
|
this.userDialogVisible = true;
|