|
@@ -45,87 +45,63 @@
|
|
|
<el-button type="primary" @click="showDialog('add')"
|
|
|
>新增用户</el-button
|
|
|
> -->
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="hdlxglDialogShow"
|
|
|
- style="position: absolute; top: 0px; right: 0px"
|
|
|
- >设为活动管理</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="hdlxglDialogShow" style="position: absolute; top: 0px; right: 0px">
|
|
|
+ 设为活动管理</el-button>
|
|
|
<!-- <el-button type="danger" @click="delUser">批量删除</el-button> -->
|
|
|
</el-row>
|
|
|
<el-row style="margin-top: 45px; margin-bottom: 15px">
|
|
|
- <el-input
|
|
|
- placeholder="请输入搜索关键字"
|
|
|
- v-model="searchText"
|
|
|
- clearable
|
|
|
- @clear="tableParams.keyword = searchText"
|
|
|
- style="width: 300px; margin-right: 10px"
|
|
|
- ></el-input>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="tableParams.keyword = searchText"
|
|
|
- >搜索</el-button
|
|
|
- >
|
|
|
+ <el-input placeholder="请输入搜索关键字" v-model="searchText" clearable @clear="tableParams.keyword = searchText"
|
|
|
+ style="width: 300px; margin-right: 10px"></el-input>
|
|
|
+ <el-button type="primary" @click="tableParams.keyword = searchText">搜索</el-button>
|
|
|
</el-row>
|
|
|
- <el-table
|
|
|
- ref="multipleTable"
|
|
|
- :data="tableData"
|
|
|
- tooltip-effect="dark"
|
|
|
- style="width: 100%"
|
|
|
- @selection-change="changeChecked"
|
|
|
- >
|
|
|
+ <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
|
|
|
+ @selection-change="changeChecked">
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column label="用户名">
|
|
|
<template slot-scope="scope">{{
|
|
|
- scope.row.user_name
|
|
|
+ scope.row.user_name
|
|
|
}}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="姓名">
|
|
|
<template slot-scope="scope">{{
|
|
|
- scope.row.user_realname
|
|
|
+ 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 || "");
|
|
|
- }, "")
|
|
|
+ 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
|
|
|
+ scope.row.user_role_name
|
|
|
}}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="管理活动类型"
|
|
|
- width="200"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
+ <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 + ",");
|
|
|
- },
|
|
|
- "")
|
|
|
+ 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" ? "普通账号" : "临时账号"
|
|
|
+ scope.row.user_level === "1" ? "普通账号" : "临时账号"
|
|
|
}}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-link type="primary" @click="showAccessDialog(scope.row)"
|
|
|
- >权限</el-link
|
|
|
- >
|
|
|
+ <el-link type="primary" @click="showAccessDialog(scope.row)">权限</el-link>
|
|
|
<!--<span style="color: #409eff; margin: 0 10px">|</span>
|
|
|
<el-link type="primary" @click="showDialog('edit', scope.row)"
|
|
|
>编辑</el-link
|
|
@@ -135,33 +111,16 @@
|
|
|
</el-table>
|
|
|
</el-main>
|
|
|
<el-footer style="text-align: right">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- hide-on-single-page
|
|
|
- layout="prev, pager, next"
|
|
|
- :page-size="tableParams.limit"
|
|
|
- :total="total_rows"
|
|
|
- @current-change="pageChange"
|
|
|
- ></el-pagination>
|
|
|
+ <el-pagination background hide-on-single-page layout="prev, pager, next" :page-size="tableParams.limit"
|
|
|
+ :total="total_rows" @current-change="pageChange"></el-pagination>
|
|
|
</el-footer>
|
|
|
</el-container>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<!-- 用户信息 -->
|
|
|
- <el-dialog
|
|
|
- :title="dialogType === 'add' ? '新增用户' : '编辑用户'"
|
|
|
- v-if="userDialogVisible"
|
|
|
- :visible.sync="userDialogVisible"
|
|
|
- :close-on-click-modal="false"
|
|
|
- @closed="resetDialog('user_main')"
|
|
|
- width="700px"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- ref="user_main"
|
|
|
- :model="user_main"
|
|
|
- :rules="form_rules"
|
|
|
- label-width="120px"
|
|
|
- >
|
|
|
+ <el-dialog :title="dialogType === 'add' ? '新增用户' : '编辑用户'" v-if="userDialogVisible"
|
|
|
+ :visible.sync="userDialogVisible" :close-on-click-modal="false" @closed="resetDialog('user_main')" width="700px">
|
|
|
+ <el-form ref="user_main" :model="user_main" :rules="form_rules" label-width="120px">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="用户名" prop="user_name">
|
|
@@ -188,13 +147,8 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="部门" prop="dept_id">
|
|
|
- <el-cascader
|
|
|
- :options="deptOptions"
|
|
|
- :props="{ checkStrictly: true, emitPath: false }"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- v-model="user_main.dept_id"
|
|
|
- ></el-cascader>
|
|
|
+ <el-cascader :options="deptOptions" :props="{ checkStrictly: true, emitPath: false }" clearable filterable
|
|
|
+ v-model="user_main.dept_id"></el-cascader>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
@@ -205,20 +159,14 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="用户角色" prop="user_role_id">
|
|
|
<el-select v-model="user_main.user_role_id" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="role in roleList"
|
|
|
- :key="role.role_id"
|
|
|
- :label="role.role_name"
|
|
|
- :value="role.role_id"
|
|
|
- ></el-option>
|
|
|
+ <el-option v-for="role in roleList" :key="role.role_id" :label="role.role_name" :value="role.role_id">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="onSubmit('user_main')"
|
|
|
- >提交</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="onSubmit('user_main')">提交</el-button>
|
|
|
<el-button @click="onReset('user_main')">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -226,47 +174,27 @@
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
<!-- 权限信息 -->
|
|
|
- <el-dialog
|
|
|
- :title="activeUserName + '的权限修改'"
|
|
|
- :visible.sync="accessDialogVisible"
|
|
|
- v-if="accessDialogVisible"
|
|
|
- :destroy-on-close="true"
|
|
|
- width="360px"
|
|
|
- >
|
|
|
- <el-switch
|
|
|
- v-model="accessSwitch"
|
|
|
- @change="changeAccess($event, 'depart')"
|
|
|
- active-text="部门管理员"
|
|
|
- class="accessContle"
|
|
|
- ></el-switch>
|
|
|
- <el-switch
|
|
|
- v-model="HDaccessSwitch"
|
|
|
- @change="changeAccess($event, 'active')"
|
|
|
- active-text="管理活动公告"
|
|
|
- class="accessContle"
|
|
|
- ></el-switch>
|
|
|
- <el-switch
|
|
|
- v-model="LDaccessSwitch"
|
|
|
- @change="changeAccess($event, 'onlyread')"
|
|
|
- active-text="领导权限(只看活动评比呈现和数据)"
|
|
|
- class="accessContle"
|
|
|
- ></el-switch>
|
|
|
+ <el-dialog :title="activeUserName + '的权限修改'" :visible.sync="accessDialogVisible" v-if="accessDialogVisible"
|
|
|
+ :destroy-on-close="true" width="360px" @close="renderTable">
|
|
|
+ <!-- <el-switch v-model="accessForm.activity" @change="changeAccess($event, 'activity')" active-text="活动管理员"
|
|
|
+ class="accessContle" :active-value="1" :inactive-value="0"></el-switch>
|
|
|
+ <el-switch v-model="accessForm.dept_master" @change="changeAccess($event, 'dept_master')" active-text="系统管理员"
|
|
|
+ class="accessContle" :active-value="1" :inactive-value="0"></el-switch>
|
|
|
+ <el-switch v-model="accessForm.readonly" @change="changeAccess($event, 'readonly')" active-text="领导"
|
|
|
+ class="accessContle" :active-value="1" :inactive-value="0"></el-switch> -->
|
|
|
+
|
|
|
+ <el-radio-group v-model="accessValue" @change="handleChangeAccess" size="medium"
|
|
|
+ :style="{ display: 'flex', 'flex-direction': 'column','justify-content':'space-between',height:'110px' }">
|
|
|
+ <el-radio label="activity">活动管理员</el-radio>
|
|
|
+ <el-radio label="dept_master">系统管理员</el-radio>
|
|
|
+ <el-radio label="readonly">领导</el-radio>
|
|
|
+ <el-radio label="none">无</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-dialog>
|
|
|
<!-- 活动类型选择 -->
|
|
|
- <el-dialog
|
|
|
- title="活动类型选择"
|
|
|
- :visible.sync="hdlxxzDialogVisible"
|
|
|
- width="700px"
|
|
|
- :close-on-click-modal="false"
|
|
|
- >
|
|
|
- <el-cascader
|
|
|
- :options="hdlxOptions"
|
|
|
- :props="{ checkStrictly: true }"
|
|
|
- placeholder="请选择活动类型"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- v-model="hdlxCheckedId"
|
|
|
- ></el-cascader>
|
|
|
+ <el-dialog title="活动类型选择" :visible.sync="hdlxxzDialogVisible" width="700px" :close-on-click-modal="false">
|
|
|
+ <el-cascader :options="hdlxOptions" :props="{ checkStrictly: true }" placeholder="请选择活动类型" clearable filterable
|
|
|
+ v-model="hdlxCheckedId"></el-cascader>
|
|
|
<el-divider></el-divider>
|
|
|
<el-button type="primary" @click="addHdlxAdmin">提交设置</el-button>
|
|
|
</el-dialog>
|
|
@@ -312,9 +240,15 @@ export default {
|
|
|
total_rows: 0,
|
|
|
userDialogVisible: false,
|
|
|
accessDialogVisible: false,
|
|
|
- accessSwitch: false,
|
|
|
- HDaccessSwitch: false,
|
|
|
- LDaccessSwitch: false,
|
|
|
+ // accessSwitch: false,
|
|
|
+ // HDaccessSwitch: false,
|
|
|
+ // LDaccessSwitch: false,
|
|
|
+ accessForm: {
|
|
|
+ activity: 0,
|
|
|
+ dept_master: 0,
|
|
|
+ readonly: 0
|
|
|
+ },
|
|
|
+ accessValue: 'none',
|
|
|
user_main: {
|
|
|
user_name: "",
|
|
|
user_password: "",
|
|
@@ -430,38 +364,69 @@ export default {
|
|
|
},
|
|
|
showAccessDialog(row) {
|
|
|
this.activeUserId = row.user_id;
|
|
|
- this.activeUserName = row.user_name;
|
|
|
- this.accessSwitch = row.org_info.is_matser === "1";
|
|
|
- (this.HDaccessSwitch = row.power.announce === 1),
|
|
|
- (this.LDaccessSwitch = row.power.readonly === 1),
|
|
|
- (this.accessDialogVisible = true);
|
|
|
+ this.activeUserName = row.user_realname;
|
|
|
+ // this.accessSwitch = row.org_info.dept_master === "1";
|
|
|
+ // (this.HDaccessSwitch = row.power.announce === 1);
|
|
|
+ // (this.LDaccessSwitch = row.power.readonly === 1);
|
|
|
+ // (this.accessDialogVisible = true);
|
|
|
+
|
|
|
+ this.accessForm.dept_master = row.org_info.is_matser * 1
|
|
|
+ this.accessForm.activity = row.power.activity * 1
|
|
|
+ this.accessForm.readonly = row.power.readonly * 1
|
|
|
+
|
|
|
+ this.accessValue = row.org_info.is_matser * 1 ? 'dept_master' : row.power.activity * 1 ? 'activity' : row.power.readonly * 1 ? 'readonly' : 'none'
|
|
|
+ this.accessDialogVisible = true
|
|
|
},
|
|
|
/**权限控制*/
|
|
|
+ handleChangeAccess(val) {
|
|
|
+ user_set_access(
|
|
|
+ {
|
|
|
+ user_id: this.activeUserId,
|
|
|
+ access: {
|
|
|
+ [val]: 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ).then((res) => {
|
|
|
+ if (res.code === "1") {
|
|
|
+ this.$message.success(res.msg);
|
|
|
+ // this.renderTable();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
changeAccess($event, mark) {
|
|
|
- let val = $event;
|
|
|
- let data = {};
|
|
|
- data.user_id = this.activeUserId;
|
|
|
- switch (mark) {
|
|
|
- case "depart":
|
|
|
- data.access = {
|
|
|
- dept_master: val ? 1 : 0,
|
|
|
- };
|
|
|
- break;
|
|
|
- case "active":
|
|
|
- data.access = {
|
|
|
- announce: val ? 1 : 0,
|
|
|
- };
|
|
|
- break;
|
|
|
- case "onlyread":
|
|
|
- data.access = {
|
|
|
- readonly: val ? 1 : 0,
|
|
|
- };
|
|
|
- break;
|
|
|
- }
|
|
|
+ // let val = $event;
|
|
|
+ let data = {
|
|
|
+ user_id: this.activeUserId,
|
|
|
+ access: {
|
|
|
+ // activity: 0,
|
|
|
+ // dept_master: 0,
|
|
|
+ // readonly: 0
|
|
|
+ }
|
|
|
+ };
|
|
|
+ // this.accessForm
|
|
|
+ // data.user_id = this.activeUserId;
|
|
|
+ // switch (mark) {
|
|
|
+ // case "depart":
|
|
|
+ // data.access = {
|
|
|
+ // dept_master: val ? 1 : 0,
|
|
|
+ // };
|
|
|
+ // break;
|
|
|
+ // case "active":
|
|
|
+ // data.access = {
|
|
|
+ // announce: val ? 1 : 0,
|
|
|
+ // };
|
|
|
+ // break;
|
|
|
+ // case "onlyread":
|
|
|
+ // data.access = {
|
|
|
+ // readonly: val ? 1 : 0,
|
|
|
+ // };
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ data.access[mark] = $event
|
|
|
user_set_access(data).then((res) => {
|
|
|
if (res.code === "1") {
|
|
|
this.$message.success(res.msg);
|
|
|
- this.renderTable();
|
|
|
+ // this.renderTable();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -653,6 +618,7 @@ header {
|
|
|
::v-deep .el-cascader {
|
|
|
display: block;
|
|
|
}
|
|
|
+
|
|
|
.accessContle {
|
|
|
display: block;
|
|
|
margin-bottom: 10px;
|