Commit d6913cc6 by 前端

v1.22.0版本需求

1 parent c08d2843
......@@ -47,7 +47,7 @@
v-if="item.visibleFunc"
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
:filterable="item.filterable || false"
:filterable="item.filterable || false"
@change="selectChange"
@visible-change="item.visibleFunc"
>
......@@ -64,7 +64,7 @@
v-else
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
:filterable="item.filterable || false"
:filterable="item.filterable || false"
@change="selectChange"
>
<el-option
......@@ -86,16 +86,17 @@
</template>
<template v-else-if="item.type === 'radio'">
<el-radio-group
@change="radioChange($event,item.prop)"
@change="radioChange($event, item.prop)"
v-model="ruleForm[item.prop]"
:disabled="item.disabled"
>
{{ruleForm[item.prop]}}
{{ ruleForm[item.prop] }}
<el-radio
v-for="(child,childIndex) in item.children"
v-for="(child, childIndex) in item.children"
:key="childIndex"
:label="childIndex"
>{{child}}</el-radio>
>{{ child }}</el-radio
>
</el-radio-group>
<el-select
v-if="item.hasSelect"
......@@ -114,11 +115,7 @@
</el-select>
</template>
<template v-else-if="item.type == 'customize'">
<slot
:scope="scope"
:name="item.slotName"
>
</slot>
<slot :scope="scope" :name="item.slotName"> </slot>
</template>
</template>
</el-form-item>
......@@ -128,62 +125,61 @@
<script>
export default {
name: 'rule-form',
name: "rule-form",
data() {
return {
// labelPosition: 'left'
}
};
},
props: {
// 表单数据
ruleData: {
type: Array,
default: () => {
return []
}
return [];
},
},
// 表单model
ruleForm: {
type: Object,
default: () => {
return {}
}
return {};
},
},
// 表单验证规则
rules: {
type: Object,
default: () => {
return {}
}
return {};
},
},
// 标签位置
labelPosition: {
type: String,
default: 'right'
default: "right",
},
size: {
type: String,
default: 'small'
default: "small",
},
labelWidth: {
type: String,
default: '100px'
}
},
mounted() {
default: "100px",
},
},
mounted() {},
methods: {
selectChange(val) {
this.$emit('selectChange', val)
this.$emit("selectChange", val);
},
radioChange(event, prop) {
this.$emit('radioChange', event, prop)
this.$emit("radioChange", event, prop);
},
update(e) {
this.$forceUpdate()
}
}
}
this.$forceUpdate();
},
},
};
</script>
<style lang="scss">
.pointer input {
......
......@@ -94,5 +94,10 @@ export const JUDGE_USER_BINDVEHICLE = params => {
return request(params,'/trialdrive/data/sniff','POST')
}
// 重置用户uuid
export const REST_USER_UUID = params => {
return request(params,'/usercenter/user/resetUID')
}
export { getUserList, getSuperUser, addUser, editUser, detailUser, deleteUser, roleList, dictInfo, resetPassword}
......@@ -4,30 +4,73 @@
<div class="user-tree-top">
<span>组织架构</span>
</div>
<el-input size="mini" placeholder="输入内容搜索" v-model="orgName" @input="treeInput"></el-input>
<el-tree :data="treedata" accordion node-key="id" highlight-current @node-click="handleNodeClick" :render-content="renderContent">
<el-input
size="mini"
placeholder="输入内容搜索"
v-model="orgName"
@input="treeInput"
></el-input>
<el-tree
:data="treedata"
accordion
node-key="id"
highlight-current
@node-click="handleNodeClick"
:render-content="renderContent"
>
</el-tree>
</div>
<div class="user-container">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="userFormList">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="userFormList"
>
<span class="inline-b" slot="form-slot">
<el-button type="primary" :size="btn_size" icon="el-icon-search" :id="tableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="tableParams.btnId"
>搜索</el-button
>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
@click="refresh"
>重置</el-button
>
</span>
</search-form>
<h3>
用户管理
<div class="pull-right">
<el-button type="primary" :size="btn_size" icon="el-icon-plus" @click="btnClick('create')">新增</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-plus"
@click="btnClick('create')"
>新增</el-button
>
</div>
</h3>
<basic-table ref="userTable" :tableParams="tableParams" :searchForm="searchForm" :getListApi="getListApi" :hasNum="false">
<basic-table
ref="userTable"
:tableParams="tableParams"
:searchForm="searchForm"
:getListApi="getListApi"
:hasNum="false"
>
<span slot="status" slot-scope="scope">
<span class="dot" :class="
<span
class="dot"
:class="
scope.scope.enableStatus
? USERSTATUS[scope.scope.enableStatus].split(',')[1]
: ''
"></span>
"
></span>
<span class="statusText">{{
scope.scope.enableStatus
? USERSTATUS[scope.scope.enableStatus].split(",")[0]
......@@ -35,39 +78,134 @@
}}</span>
</span>
<span slot="table-button" slot-scope="scope">
<el-button v-for="(j, idx) in tableParams.tableOption.btnList" :key="idx" :type="j.type || 'text'" :size="btn_size" @click="btnClick(j.pType, scope.scope)">{{ j.name }}</el-button>
<el-button
v-for="(j, idx) in tableParams.tableOption.btnList"
:key="idx"
:type="j.type || 'text'"
:size="btn_size"
@click="btnClick(j.pType, scope.scope)"
>{{ j.name }}</el-button
>
<!-- <el-link @click="openDialog(scope.scope)">指定数据</el-link> -->
<auth-link type="primary" size="mini" class="auth_link" name="指定数据" @click.native="openDialog(scope.scope)">指定数据</auth-link>
<auth-link
type="primary"
size="mini"
class="auth_link"
name="指定数据"
@click.native="openDialog(scope.scope)"
>指定数据</auth-link
>
</span>
</basic-table>
<basic-dialog :title="userDialogTitle" :isVisible="userVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose" :btnLoading="btnLoading">
<basic-dialog
:title="userDialogTitle"
:isVisible="userVisible"
@confirmDialog="handleConfirm"
@closeDialog="handleClose"
:btnLoading="btnLoading"
>
<slot>
<rule-form :ruleForm="userForm" :rules="userRules" :ruleData="userData" ref="userForm"></rule-form>
<rule-form
:ruleForm="userForm"
:rules="userRules"
:ruleData="userData"
ref="userForm"
>
<div class="" slot="specialLogin">
<el-switch
v-model="userForm.specialLogin"
active-text="开"
inactive-text="关"
:active-value="1"
:inactive-value="0"
></el-switch>
<el-tooltip
class="item"
effect="dark"
content="“特殊登录”开关打开后,会限制用户只能在某一台电脑登录,并且无法登录“e盾+”小程序,请谨慎使用!"
placement="top-start"
>
<i class="el-icon-question form_tips"></i>
</el-tooltip>
<template v-if="userForm.id">
<el-button
type="primary"
size="mini"
class="rest_button"
@click="restLogin(userForm.id)"
>重置UID</el-button
>
<el-tooltip
class="item"
effect="dark"
content="用户更换常用电脑后,无法正常登录新e盾系统,可使用“重置UID”功能重置认证状态,二次确定即生效。"
placement="top-start"
>
<i class="el-icon-question form_tips"></i>
</el-tooltip>
</template>
</div>
</rule-form>
</slot>
</basic-dialog>
<basic-dialog :title="filterDialogTitle" :isVisible="filterVisible" @confirmDialog="filterConfirm" @closeDialog="closeFilter">
<basic-dialog
:title="filterDialogTitle"
:isVisible="filterVisible"
@confirmDialog="filterConfirm"
@closeDialog="closeFilter"
>
<slot>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small">
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
size="small"
>
</el-input>
<el-tree class="filter-tree" :data="filterTextData" :filter-node-method="filterNode" highlight-current ref="tree" node-key="id" check-on-click-node>
<el-tree
class="filter-tree"
:data="filterTextData"
:filter-node-method="filterNode"
highlight-current
ref="tree"
node-key="id"
check-on-click-node
>
</el-tree>
</slot>
</basic-dialog>
</div>
<!-- 指定数据弹框 开始 -->
<glsx-dialog :show="showDialog" title="指定数据" @close="closeDialog()" width="900px">
<glsx-dialog
:show="showDialog"
title="指定数据"
@close="closeDialog()"
width="900px"
>
<div>
<assign-info ref="assignInfo" v-if="showDialog" :id="currentUserId" @showBtnFlags="showBtnFlags"></assign-info>
<assign-info
ref="assignInfo"
v-if="showDialog"
:id="currentUserId"
@showBtnFlags="showBtnFlags"
></assign-info>
</div>
<template slot="footer">
<el-button type="default" size="small" @click="closeDialog">取消</el-button>
<el-button type="primary" size="small" :loading="loading" @click="saveInfo" v-show="showFlags">确定</el-button>
<el-button type="default" size="small" @click="closeDialog"
>取消</el-button
>
<el-button
type="primary"
size="small"
:loading="loading"
@click="saveInfo"
v-show="showFlags"
>确定</el-button
>
</template>
</glsx-dialog>
<!-- 指定数据弹框 end -->
</div>
</template>
......@@ -83,6 +221,7 @@ import {
dictInfo,
resetPassword,
JUDGE_USER_BINDVEHICLE,
REST_USER_UUID,
} from "services/user";
import { getSimpleList, getTreeOrg } from "services/orginizaManage";
import GlsxDialog from "@/components/dialog";
......@@ -250,6 +389,13 @@ export default {
},
{ label: "状态:", prop: "enableStatus", type: "switch" },
{
label: "特殊登录:",
prop: "specialLogin",
type: "customize",
slotName: "specialLogin",
tips: "",
},
{
label: "岗位:",
prop: "position",
type: "select",
......@@ -314,7 +460,7 @@ export default {
showDialog: false,
loading: false,
currentUserId: "",
showFlags: true
showFlags: true,
};
},
watch: {
......@@ -338,7 +484,7 @@ export default {
},
methods: {
showBtnFlags(val) {
this.showFlags = val
this.showFlags = val;
},
init() {
this.getTreeOrg();
......@@ -370,6 +516,7 @@ export default {
this.btnLoading = true;
let params = JSON.parse(JSON.stringify(this.userForm));
params.enableStatus = this.userForm.enableStatus ? 1 : 2;
//params.specialLogin = this.userForm.specialLogin ? 1 : 0;
delete params.departmentName;
delete params.superiorName;
delete params.createdDate;
......@@ -514,7 +661,7 @@ export default {
async deleteEvent(id) {
const that = this;
let res = await JUDGE_USER_BINDVEHICLE({ userId: id, types: [1] });
let res = await JUDGE_USER_BINDVEHICLE({ userId: id, types: [1] });
// true:可以删除,false:不能删除用户
if (!res.data) {
showModal({
......@@ -744,6 +891,24 @@ export default {
this.$refs.assignInfo.saveInfo();
},
// 重置uuid
restLogin(id) {
let _this = this;
showModal({
message: "是否删除当前记录?",
showCancelButton: true,
success: function () {
REST_USER_UUID({ id: id }).then((res) => {
if (res.code == 200) {
showToast({
message: "重置成功",
type: "success",
});
}
});
},
});
},
},
};
</script>
......@@ -756,4 +921,11 @@ export default {
.auth_link {
font-size: 12px;
}
.form_tips {
margin: 0 10px;
cursor: pointer;
}
.rest_button {
margin-left: 10px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!