Commit d6913cc6 by 前端

v1.22.0版本需求

1 parent c08d2843
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
v-if="item.visibleFunc" v-if="item.visibleFunc"
v-model="ruleForm[item.prop]" v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'" :placeholder="item.placeholder || '请选择'"
:filterable="item.filterable || false" :filterable="item.filterable || false"
@change="selectChange" @change="selectChange"
@visible-change="item.visibleFunc" @visible-change="item.visibleFunc"
> >
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
v-else v-else
v-model="ruleForm[item.prop]" v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'" :placeholder="item.placeholder || '请选择'"
:filterable="item.filterable || false" :filterable="item.filterable || false"
@change="selectChange" @change="selectChange"
> >
<el-option <el-option
...@@ -86,16 +86,17 @@ ...@@ -86,16 +86,17 @@
</template> </template>
<template v-else-if="item.type === 'radio'"> <template v-else-if="item.type === 'radio'">
<el-radio-group <el-radio-group
@change="radioChange($event,item.prop)" @change="radioChange($event, item.prop)"
v-model="ruleForm[item.prop]" v-model="ruleForm[item.prop]"
:disabled="item.disabled" :disabled="item.disabled"
> >
{{ruleForm[item.prop]}} {{ ruleForm[item.prop] }}
<el-radio <el-radio
v-for="(child,childIndex) in item.children" v-for="(child, childIndex) in item.children"
:key="childIndex" :key="childIndex"
:label="childIndex" :label="childIndex"
>{{child}}</el-radio> >{{ child }}</el-radio
>
</el-radio-group> </el-radio-group>
<el-select <el-select
v-if="item.hasSelect" v-if="item.hasSelect"
...@@ -114,11 +115,7 @@ ...@@ -114,11 +115,7 @@
</el-select> </el-select>
</template> </template>
<template v-else-if="item.type == 'customize'"> <template v-else-if="item.type == 'customize'">
<slot <slot :scope="scope" :name="item.slotName"> </slot>
:scope="scope"
:name="item.slotName"
>
</slot>
</template> </template>
</template> </template>
</el-form-item> </el-form-item>
...@@ -128,62 +125,61 @@ ...@@ -128,62 +125,61 @@
<script> <script>
export default { export default {
name: 'rule-form', name: "rule-form",
data() { data() {
return { return {
// labelPosition: 'left' // labelPosition: 'left'
} };
}, },
props: { props: {
// 表单数据 // 表单数据
ruleData: { ruleData: {
type: Array, type: Array,
default: () => { default: () => {
return [] return [];
} },
}, },
// 表单model // 表单model
ruleForm: { ruleForm: {
type: Object, type: Object,
default: () => { default: () => {
return {} return {};
} },
}, },
// 表单验证规则 // 表单验证规则
rules: { rules: {
type: Object, type: Object,
default: () => { default: () => {
return {} return {};
} },
}, },
// 标签位置 // 标签位置
labelPosition: { labelPosition: {
type: String, type: String,
default: 'right' default: "right",
}, },
size: { size: {
type: String, type: String,
default: 'small' default: "small",
}, },
labelWidth: { labelWidth: {
type: String, type: String,
default: '100px' default: "100px",
} },
},
mounted() {
}, },
mounted() {},
methods: { methods: {
selectChange(val) { selectChange(val) {
this.$emit('selectChange', val) this.$emit("selectChange", val);
}, },
radioChange(event, prop) { radioChange(event, prop) {
this.$emit('radioChange', event, prop) this.$emit("radioChange", event, prop);
}, },
update(e) { update(e) {
this.$forceUpdate() this.$forceUpdate();
} },
} },
} };
</script> </script>
<style lang="scss"> <style lang="scss">
.pointer input { .pointer input {
......
...@@ -94,5 +94,10 @@ export const JUDGE_USER_BINDVEHICLE = params => { ...@@ -94,5 +94,10 @@ export const JUDGE_USER_BINDVEHICLE = params => {
return request(params,'/trialdrive/data/sniff','POST') 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} export { getUserList, getSuperUser, addUser, editUser, detailUser, deleteUser, roleList, dictInfo, resetPassword}
...@@ -4,30 +4,73 @@ ...@@ -4,30 +4,73 @@
<div class="user-tree-top"> <div class="user-tree-top">
<span>组织架构</span> <span>组织架构</span>
</div> </div>
<el-input size="mini" placeholder="输入内容搜索" v-model="orgName" @input="treeInput"></el-input> <el-input
<el-tree :data="treedata" accordion node-key="id" highlight-current @node-click="handleNodeClick" :render-content="renderContent"> 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> </el-tree>
</div> </div>
<div class="user-container"> <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"> <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
<el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</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> </span>
</search-form> </search-form>
<h3> <h3>
用户管理 用户管理
<div class="pull-right"> <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> </div>
</h3> </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 slot="status" slot-scope="scope">
<span class="dot" :class=" <span
class="dot"
:class="
scope.scope.enableStatus scope.scope.enableStatus
? USERSTATUS[scope.scope.enableStatus].split(',')[1] ? USERSTATUS[scope.scope.enableStatus].split(',')[1]
: '' : ''
"></span> "
></span>
<span class="statusText">{{ <span class="statusText">{{
scope.scope.enableStatus scope.scope.enableStatus
? USERSTATUS[scope.scope.enableStatus].split(",")[0] ? USERSTATUS[scope.scope.enableStatus].split(",")[0]
...@@ -35,39 +78,134 @@ ...@@ -35,39 +78,134 @@
}}</span> }}</span>
</span> </span>
<span slot="table-button" slot-scope="scope"> <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> --> <!-- <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> </span>
</basic-table> </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> <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> </slot>
</basic-dialog> </basic-dialog>
<basic-dialog :title="filterDialogTitle" :isVisible="filterVisible" @confirmDialog="filterConfirm" @closeDialog="closeFilter"> <basic-dialog
:title="filterDialogTitle"
:isVisible="filterVisible"
@confirmDialog="filterConfirm"
@closeDialog="closeFilter"
>
<slot> <slot>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small"> <el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
size="small"
>
</el-input> </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> </el-tree>
</slot> </slot>
</basic-dialog> </basic-dialog>
</div> </div>
<!-- 指定数据弹框 开始 --> <!-- 指定数据弹框 开始 -->
<glsx-dialog :show="showDialog" title="指定数据" @close="closeDialog()" width="900px"> <glsx-dialog
:show="showDialog"
title="指定数据"
@close="closeDialog()"
width="900px"
>
<div> <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> </div>
<template slot="footer"> <template slot="footer">
<el-button type="default" size="small" @click="closeDialog">取消</el-button> <el-button type="default" size="small" @click="closeDialog"
<el-button type="primary" size="small" :loading="loading" @click="saveInfo" v-show="showFlags">确定</el-button> >取消</el-button
>
<el-button
type="primary"
size="small"
:loading="loading"
@click="saveInfo"
v-show="showFlags"
>确定</el-button
>
</template> </template>
</glsx-dialog> </glsx-dialog>
<!-- 指定数据弹框 end --> <!-- 指定数据弹框 end -->
</div> </div>
</template> </template>
...@@ -83,6 +221,7 @@ import { ...@@ -83,6 +221,7 @@ import {
dictInfo, dictInfo,
resetPassword, resetPassword,
JUDGE_USER_BINDVEHICLE, JUDGE_USER_BINDVEHICLE,
REST_USER_UUID,
} from "services/user"; } from "services/user";
import { getSimpleList, getTreeOrg } from "services/orginizaManage"; import { getSimpleList, getTreeOrg } from "services/orginizaManage";
import GlsxDialog from "@/components/dialog"; import GlsxDialog from "@/components/dialog";
...@@ -250,6 +389,13 @@ export default { ...@@ -250,6 +389,13 @@ export default {
}, },
{ label: "状态:", prop: "enableStatus", type: "switch" }, { label: "状态:", prop: "enableStatus", type: "switch" },
{ {
label: "特殊登录:",
prop: "specialLogin",
type: "customize",
slotName: "specialLogin",
tips: "",
},
{
label: "岗位:", label: "岗位:",
prop: "position", prop: "position",
type: "select", type: "select",
...@@ -314,7 +460,7 @@ export default { ...@@ -314,7 +460,7 @@ export default {
showDialog: false, showDialog: false,
loading: false, loading: false,
currentUserId: "", currentUserId: "",
showFlags: true showFlags: true,
}; };
}, },
watch: { watch: {
...@@ -338,7 +484,7 @@ export default { ...@@ -338,7 +484,7 @@ export default {
}, },
methods: { methods: {
showBtnFlags(val) { showBtnFlags(val) {
this.showFlags = val this.showFlags = val;
}, },
init() { init() {
this.getTreeOrg(); this.getTreeOrg();
...@@ -370,6 +516,7 @@ export default { ...@@ -370,6 +516,7 @@ export default {
this.btnLoading = true; this.btnLoading = true;
let params = JSON.parse(JSON.stringify(this.userForm)); let params = JSON.parse(JSON.stringify(this.userForm));
params.enableStatus = this.userForm.enableStatus ? 1 : 2; params.enableStatus = this.userForm.enableStatus ? 1 : 2;
//params.specialLogin = this.userForm.specialLogin ? 1 : 0;
delete params.departmentName; delete params.departmentName;
delete params.superiorName; delete params.superiorName;
delete params.createdDate; delete params.createdDate;
...@@ -514,7 +661,7 @@ export default { ...@@ -514,7 +661,7 @@ export default {
async deleteEvent(id) { async deleteEvent(id) {
const that = this; 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:不能删除用户 // true:可以删除,false:不能删除用户
if (!res.data) { if (!res.data) {
showModal({ showModal({
...@@ -744,6 +891,24 @@ export default { ...@@ -744,6 +891,24 @@ export default {
this.$refs.assignInfo.saveInfo(); 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> </script>
...@@ -756,4 +921,11 @@ export default { ...@@ -756,4 +921,11 @@ export default {
.auth_link { .auth_link {
font-size: 12px; font-size: 12px;
} }
.form_tips {
margin: 0 10px;
cursor: pointer;
}
.rest_button {
margin-left: 10px;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!