|
@@ -3,14 +3,14 @@
|
|
|
<div class="search-list">
|
|
|
<div class="search-left">
|
|
|
<Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
|
|
|
- <FormItem label="" prop="lineId">
|
|
|
- <Select v-model="tableParams.lineId" placeholder="线路" @on-select="changeLine" label-in-value>
|
|
|
- <Option v-for="item in lineTypeData" :value="item.id" :key="item.id">{{ item.lineName }}</Option>
|
|
|
+ <FormItem label="" prop="orgType">
|
|
|
+ <Select v-model="tableParams.orgType" placeholder="" label-in-value>
|
|
|
+ <Option v-for="item in orgTypeData" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem label="" prop="roleId">
|
|
|
<Select v-model="tableParams.roleId" placeholder="角色名称">
|
|
|
- <Option v-for="item in roleData" :value="item.id" :key="item.id">{{ item.stationName }}</Option>
|
|
|
+ <Option v-for="item in roleData" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem label="" prop="isEnabled">
|
|
@@ -18,19 +18,14 @@
|
|
|
<Option v-for="item in enabledData" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="" prop="userCode">
|
|
|
- <Input placeholder="输入用户号" clearable search v-model="tableParams.userCode" />
|
|
|
- </FormItem>
|
|
|
<FormItem label="" prop="userName">
|
|
|
- <Input placeholder="输入姓名关键词" clearable search v-model="tableParams.userName" />
|
|
|
+ <Input placeholder="输入用户号" clearable search v-model="tableParams.userName" />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="" prop="realName">
|
|
|
+ <Input placeholder="输入姓名关键词" clearable search v-model="tableParams.realName" />
|
|
|
</FormItem>
|
|
|
- <!-- <FormItem label="" prop="equipmentType">
|
|
|
- <Select v-model="tableParams.equipmentType" placeholder="用户类型">
|
|
|
- <Option v-for="item in equipTypeData" :value="(item.id)" :key="item.id">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- </FormItem> -->
|
|
|
<FormItem label="">
|
|
|
- <DatePicker type="daterange" :value="dateRange" :clearable="false" :editable="false" class="common-date-picker date-picker-main" placement="bottom-start" placeholder="启用日期范围" @on-change="changePicker"></DatePicker>
|
|
|
+ <DatePicker type="datetimerange" :value="dateRange" format="yyyy-MM-dd HH:mm:ss" placeholder="更新时间范围" class="common-date-picker date-picker-main" :clearable="false" :editable="false" @on-change="changePicker"></DatePicker>
|
|
|
</FormItem>
|
|
|
<FormItem label="" >
|
|
|
<Button type="primary" class="common-btn-search" @click="searchClick">
|
|
@@ -51,15 +46,9 @@
|
|
|
<template slot="loading">
|
|
|
<Loading-animation></Loading-animation>
|
|
|
</template>
|
|
|
- <!-- <template slot-scope="{ row }" slot="lineName">
|
|
|
- <span>{{!row.lineName ? '/' : row.lineName}}</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row }" slot="stationName">
|
|
|
- <span>{{!row.stationName ? '/' : row.stationName}}</span>
|
|
|
- </template> -->
|
|
|
<template slot-scope="{ row }" slot="action">
|
|
|
<Tooltip content="重置密码" placement="top">
|
|
|
- <i class="iconfont icon-mima" style="cursor:pointer;color:#858aea;fontSize:16px;marginRight:6px;vertical-align: middle;" @click="detailClick(row)"></i>
|
|
|
+ <i class="iconfont icon-mima" style="cursor:pointer;color:#858aea;fontSize:16px;marginRight:6px;vertical-align: middle;" @click="resetPwd(row)"></i>
|
|
|
</Tooltip>
|
|
|
<Tooltip content="详情" placement="top">
|
|
|
<i class="iconfont icon-xiangqingmingxi" style="cursor:pointer;color:#B8B532;fontSize:20px;marginRight:6px;vertical-align: middle;" @click="detailClick(row)"></i>
|
|
@@ -89,50 +78,32 @@
|
|
|
@on-visible-change="modalChange"
|
|
|
:mask-closable="false"
|
|
|
class-name="common-modal">
|
|
|
- <Form class="common-form" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="120" inline>
|
|
|
- <FormItem label="归属线路:" prop="lineId" style="width:48%">
|
|
|
- <Select v-model="formOption.lineId" placeholder="线路" @on-change="selectModalLine" label-in-value>
|
|
|
- <Option v-for="item in lineTypeData" :value="String(item.id)" :key="item.id">{{ item.lineName }}</Option>
|
|
|
- </Select>
|
|
|
+ <Form class="common-form common-form-modal" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="120">
|
|
|
+ <FormItem label="用户号:" prop="userName">
|
|
|
+ <Input v-model.trim="formOption.userName" placeholder="请输入用户号" />
|
|
|
+ <div class="common-form-item-text">可使用工号、学号等唯一不重复身份识别号</div>
|
|
|
</FormItem>
|
|
|
- <FormItem label="归属站点:" prop="stationId" style="width:48%">
|
|
|
- <Select v-model="formOption.stationId" placeholder="站点" @on-change="selectModalStation" label-in-value>
|
|
|
- <Option v-for="item in stationTypeData" :value="String(item.id)" :key="item.id">{{ item.stationName }}</Option>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label="归属应用:" prop="appId" style="width:48%">
|
|
|
- <Select v-model="formOption.appId" placeholder="归属应用" @on-change="selectModalApp">
|
|
|
- <Option v-for="item in equipAppModalData" :value="item.id" :key="item.id">{{ item.appName }}</Option>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label="用户类型:" prop="equipmentType" style="width:48%">
|
|
|
- <Select v-model="formOption.equipmentType" placeholder="用户类型">
|
|
|
- <Option v-for="item in equipTypeModalData" :value="item.equipmentTypeId" :key="item.equipmentTypeId">{{ item.equipmentName }}</Option>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem label="用户ID:" style="width:100%">
|
|
|
- <span v-show="title=='新增用户'">系统自动生成,唯一不重复</span>
|
|
|
- <span v-show="title=='编辑用户'">{{formOption.equipmentId}}</span>
|
|
|
- </FormItem>
|
|
|
- <FormItem label="用户名称:" prop="equipmentName" style="width:100%">
|
|
|
- <Input v-model.trim="formOption.equipmentName" type="textarea" :rows="3" maxlength="100" show-word-limit />
|
|
|
- </FormItem>
|
|
|
- <FormItem label="用户状态:" prop="equipmentStatus" style="width:48%">
|
|
|
- <Select v-model="formOption.equipmentStatus" placeholder="用户状态">
|
|
|
- <Option v-for="item in equipStateModalData" :value="item.id" :key="item.id">{{ item.value }}</Option>
|
|
|
- </Select>
|
|
|
+ <FormItem label="用户名:" prop="realName">
|
|
|
+ <Input v-model.trim="formOption.realName" maxlength="10" show-word-limit />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="组织机构:" prop="orgIdArr">
|
|
|
+ <Cascader :data="stationData[0].children" :render-format="format" :clearable="false" change-on-select v-model="formOption.orgIdArr" placeholder="选择组织机构" class="common-cascader" v-if="stationData && stationData.length>0"></Cascader>
|
|
|
</FormItem>
|
|
|
- <FormItem label="启用日期:" prop="useDate" style="width:48%">
|
|
|
- <DatePicker type="date" :value="formOption.useDate" :editable="false" class="common-date-picker" placement="bottom-start" placeholder="启用日期" style="width: 100%" @on-change="changeMoldaPicker"></DatePicker>
|
|
|
+ <FormItem label="角色名称:" prop="roleId">
|
|
|
+ <Select v-model="formOption.roleId" placeholder="角色名称">
|
|
|
+ <Option v-for="item in roleModalData" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
+ </Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="用户型号:" prop="equipmentVersion" style="width:100%">
|
|
|
- <Input v-model="formOption.equipmentVersion" maxlength="20" show-word-limit />
|
|
|
+ <FormItem label="手机号码:" prop="mobilePhone">
|
|
|
+ <Input v-model.trim="formOption.mobilePhone" placeholder="手机号格式校验" />
|
|
|
</FormItem>
|
|
|
- <FormItem label="供应商:" prop="supplier" style="width:100%">
|
|
|
- <Input v-model="formOption.supplier" maxlength="20" show-word-limit />
|
|
|
+ <FormItem label="邮箱:" prop="userMail">
|
|
|
+ <Input v-model.trim="formOption.userMail" placeholder="邮箱格式校验"/>
|
|
|
</FormItem>
|
|
|
- <FormItem label="说明:" prop="remark" style="width:100%">
|
|
|
- <Input v-model="formOption.remark" type="textarea" :rows="6" maxlength="200" show-word-limit />
|
|
|
+ <FormItem label="启用状态:" prop="isEnable" v-if="title == '新增用户'">
|
|
|
+ <i-switch true-color="#57C44F" v-model="formOption.isEnable" disabled></i-switch>
|
|
|
+ <span style="color: #718EBD;margin-left:6px">关</span>
|
|
|
+ <span style="color: #718EBD;margin-left:12px">(所有新增状态均为关闭,需在列表打开)</span>
|
|
|
</FormItem>
|
|
|
</Form>
|
|
|
<div slot="footer">
|
|
@@ -159,71 +130,70 @@
|
|
|
<Modal
|
|
|
v-model="detailStatus"
|
|
|
title="用户详情"
|
|
|
- width="45"
|
|
|
+ width="30"
|
|
|
ref="modalGrag"
|
|
|
draggable
|
|
|
reset-drag-position
|
|
|
footer-hide
|
|
|
:mask-closable="false"
|
|
|
class-name="common-modal">
|
|
|
- <div v-for="(item,index) in detailLabel" :key="index">
|
|
|
- <div class="common-modal-top">
|
|
|
- <span class="common-modal-top-text">{{item.name}}</span>
|
|
|
- </div>
|
|
|
- <div class="common-modal-content">
|
|
|
- <div class="modal-content-item" v-for="(val,i) in item.value" :key="i" :class="{'item-especial': val.name == '说明'|| val.name == '最后通讯时间' && item.value.length%2!=0,'item-especial-bot':(i==item.value.length-1 || i==item.value.length-2) && item.value.length%2==0}">
|
|
|
- <div class="modal-content-item-name">
|
|
|
- {{val.name}}
|
|
|
- </div>
|
|
|
- <div class="modal-content-item-value">
|
|
|
- <Tooltip placement="top-start" transfer max-width="350" v-if="val.name == '归属线路' || val.name == '归属站点' || val.value || val.value===0">
|
|
|
- <span v-if="val.name == '归属线路' || val.name == '归属站点'">{{!val.value ? '/' : val.value}}</span>
|
|
|
- <span v-else>{{val.value}}</span>
|
|
|
- <div slot="content">
|
|
|
- <span v-if="val.name == '归属线路' || val.name == '归属站点'">{{!val.value ? '/' : val.value}}</span>
|
|
|
- <span v-else>{{val.value}}</span>
|
|
|
- </div>
|
|
|
- </Tooltip>
|
|
|
- <span v-else>{{val.value}}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <!-- <Form class="common-form common-form-modal" :model="detailData" :label-width="120">
|
|
|
+ <FormItem label="用户号:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.userName}}</div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="用户名:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.realName}}</div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="组织机构:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.orgName}}</div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="角色名称:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.roleName}}</div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="手机号码:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.mobilePhone}}</div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="邮箱:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.userMail}}</div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="启用状态:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.isEnable == 1 ? '开启' : '关闭'}}</div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="更新时间:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.updateTime}}</div>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="最后登录时间:">
|
|
|
+ <div class="common-form-detail-text">{{detailData.lastLoginTime}}</div>
|
|
|
+ </FormItem>
|
|
|
+ </Form> -->
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-const defaultFrom = {lineId: '',stationId: '',appId:'',equipmentName: '',equipmentType:'',equipmentStatus: '',equipmentVersion: '',supplier: '',remark: ''}
|
|
|
+const defaultFrom = {userName: '',realName: '',orgId: '',orgIdArr: [],roleId: '',mobilePhone: '',userMail: '',isEnable:0}
|
|
|
export default {
|
|
|
name: "UserManagementIndex",
|
|
|
- components:{
|
|
|
+ props: {
|
|
|
+ stationData: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ currentOrgId: [String,Number]
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- applicationParams: {
|
|
|
- level: '',
|
|
|
- lineId: '',
|
|
|
- stationId: '',
|
|
|
- equipmentCheck: '',
|
|
|
- instrumentCheck: '',
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 9999
|
|
|
- },
|
|
|
- appParams: {
|
|
|
- applicationId: '',
|
|
|
- equipmentTypeId: '',
|
|
|
- keywords: '',
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 9999
|
|
|
- },
|
|
|
loading: true,
|
|
|
dateRange: [],
|
|
|
tableParams: {
|
|
|
- lineId: '',
|
|
|
+ keywords: '',
|
|
|
+ orgType: 'all',
|
|
|
+ orgId: '',
|
|
|
roleId: '',
|
|
|
isEnabled: '',
|
|
|
- userCode:'',
|
|
|
- userName: '',
|
|
|
+ userName:'',
|
|
|
+ realName: '',
|
|
|
beginUpdateTime: '',
|
|
|
endUpdateTime: '',
|
|
|
pageNum: 1,
|
|
@@ -247,7 +217,18 @@ export default {
|
|
|
label: '关闭'
|
|
|
},
|
|
|
],
|
|
|
+ orgTypeData: [
|
|
|
+ {
|
|
|
+ value: 'all',
|
|
|
+ label: '当前及下级节点所有用户'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'cur',
|
|
|
+ label: '仅当前节点用户'
|
|
|
+ },
|
|
|
+ ],
|
|
|
roleData: [],
|
|
|
+ roleModalData: [],
|
|
|
stationTypeData: [],
|
|
|
equipStateData: [],
|
|
|
equipStateModalData: [],
|
|
@@ -255,24 +236,21 @@ export default {
|
|
|
equipTypeModalData: [],
|
|
|
equipAppModalData: [],
|
|
|
columns: [
|
|
|
- {
|
|
|
+ {
|
|
|
title: '序号',
|
|
|
type: 'index',
|
|
|
- align: 'center'
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true,
|
|
|
+ tooltip: true
|
|
|
},
|
|
|
- // {
|
|
|
- // type: 'selection',
|
|
|
- // width: 60,
|
|
|
- // align: 'center'
|
|
|
- // },
|
|
|
{
|
|
|
- title: '用户ID',
|
|
|
- key: 'userId',
|
|
|
+ title: '用户号',
|
|
|
+ key: 'userName',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '用户名',
|
|
|
- key: 'userName',
|
|
|
+ key: 'realName',
|
|
|
align: 'center',
|
|
|
ellipsis: true,
|
|
|
tooltip: true
|
|
@@ -300,38 +278,37 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '启用状态',
|
|
|
- key: 'isEnabled',
|
|
|
+ key: 'isEnable',
|
|
|
align: 'center',
|
|
|
width: 120,
|
|
|
render: (h, params) => {
|
|
|
return h('div', [
|
|
|
h('i-switch', {
|
|
|
- props: { value: params.row.isEnabled,'true-color': '#57C44F', trueValue:1,falseValue: 0
|
|
|
+ props: { value: params.row.isEnable,'true-color': '#57C44F', trueValue:1,falseValue: 0
|
|
|
},
|
|
|
nativeOn:{
|
|
|
"mousedown":(event)=>{ // 监听组件原生事件mousedown,此事件在click之前触发
|
|
|
this.rowObj = params.row
|
|
|
- this.isClickOrg = false
|
|
|
- if (params.row.isEnabled == 1) {
|
|
|
- this.commonTitle = '确认关闭'
|
|
|
- this.activeColor = '#E92E2E'
|
|
|
- this.activeClass = 'icon-guanbi'
|
|
|
- this.modalTitle = '关闭后线路下所有站点将同时关闭,线路及站点统计数据不可见。'
|
|
|
- this.modalStatus = true
|
|
|
- } else {
|
|
|
- this.commonTitle = '确认启用'
|
|
|
- this.activeColor = '#57C44F'
|
|
|
- this.activeClass = 'icon-qiyong'
|
|
|
- this.modalTitle = '启用后此线路统计数据将在各管理模块及前端显示页面生效。'
|
|
|
- this.modalStatus = true
|
|
|
- }
|
|
|
+ // if (params.row.isEnable == 1) {
|
|
|
+ // this.commonTitle = '确认关闭'
|
|
|
+ // this.activeColor = '#E92E2E'
|
|
|
+ // this.activeClass = 'icon-guanbi'
|
|
|
+ // this.modalTitle = '关闭后,用户无法登录。关闭不影响用户已经产生的操作记录。'
|
|
|
+ // this.modalStatus = true
|
|
|
+ // } else {
|
|
|
+ // this.commonTitle = '确认启用'
|
|
|
+ // this.activeColor = '#57C44F'
|
|
|
+ // this.activeClass = 'icon-qiyong'
|
|
|
+ // this.modalTitle = '启用后,用户即可正常登录使用。'
|
|
|
+ // this.modalStatus = true
|
|
|
+ // }
|
|
|
},
|
|
|
}
|
|
|
}),
|
|
|
])
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
+ {
|
|
|
title: '操作',
|
|
|
align: 'center',
|
|
|
slot: 'action',
|
|
@@ -346,60 +323,57 @@ export default {
|
|
|
activeColor: '#E92E2E',
|
|
|
activeClass: '',
|
|
|
modalTitle: '',
|
|
|
- formOption: {lineId: '',stationId: '',appId:'',equipmentName: '',equipmentType:'',equipmentStatus: '',useDate:'',equipmentVersion: '',supplier: '',remark: ''},
|
|
|
+ formOption: {userName: '',realName: '',orgId: '',orgIdArr: [],roleId: '',mobilePhone: '',userMail: '',isEnable:0},
|
|
|
ruleValidate: {
|
|
|
- lineId: [{
|
|
|
- required: true,
|
|
|
- message: '请选择所属线路',
|
|
|
- trigger: 'change'
|
|
|
- }],
|
|
|
- stationId: [{
|
|
|
- required: true,
|
|
|
- message: '请选择所属站点',
|
|
|
- trigger: 'change'
|
|
|
- }],
|
|
|
- appId: [{
|
|
|
+ userName: [{
|
|
|
required: true,
|
|
|
- type: 'number',
|
|
|
- message: '请选择归属应用',
|
|
|
- trigger: 'change'
|
|
|
- }],
|
|
|
- equipmentName: [{
|
|
|
- required: true,
|
|
|
- message: '请输入用户名称',
|
|
|
- trigger: 'change'
|
|
|
+ message: '请输入用户ID',
|
|
|
+ trigger: 'blur'
|
|
|
}],
|
|
|
- appName: [{
|
|
|
+ realName: [{
|
|
|
required: true,
|
|
|
- message: '请输入用户名称',
|
|
|
+ message: '请输入用户名',
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
- equipmentType: [{
|
|
|
+ orgIdArr: [{
|
|
|
required: true,
|
|
|
- type: 'number',
|
|
|
- message: '请选择用户类型',
|
|
|
+ type: 'array',
|
|
|
+ message: '请选择组织机构',
|
|
|
trigger: 'change'
|
|
|
}],
|
|
|
- equipmentStatus: [{
|
|
|
+ roleId: [{
|
|
|
required: true,
|
|
|
type: 'number',
|
|
|
- message: '请选择用户状态',
|
|
|
+ message: '请选择角色名称',
|
|
|
trigger: 'change'
|
|
|
- }]
|
|
|
+ }],
|
|
|
+ mobilePhone: [
|
|
|
+ { required: true, message: "请输入手机号码", trigger: "blur" },
|
|
|
+ { pattern: /^1[3456789]\d{9}$/, message: "手机号码格式不正确", trigger: "blur" } ///^[1][345789]\d{9}$/
|
|
|
+ ],
|
|
|
+ userMail: [
|
|
|
+ { type: 'email', message: '请输入正确格式的邮箱', trigger: 'blur'}
|
|
|
+ ]
|
|
|
},
|
|
|
- detailLabel: [],
|
|
|
+ detailData: {},
|
|
|
+ curOrgId: '',
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ currentOrgId: {
|
|
|
+ handler(newValue, oldValue) {
|
|
|
+ this.curOrgId = newValue
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.getType()
|
|
|
- this.getAppApplicate()
|
|
|
- this.getTableData()
|
|
|
},
|
|
|
methods: {
|
|
|
- go (){
|
|
|
- // this.$router.push({path:'//ApplicationManage'})
|
|
|
- // this.$router.push({path:'/MainPage/ApplicationManage/2'})
|
|
|
- this.$router.push({ name: 'ApplicationManage', params: { type:2 }}) // -> /home/123
|
|
|
+ format (labels, selectedData) {
|
|
|
+ const index = labels.length - 1;
|
|
|
+ this.formOption.orgId = selectedData.length >0 ? selectedData[selectedData.length-1].nodeId : ''
|
|
|
+ return labels[index];
|
|
|
},
|
|
|
changePicker (date) {
|
|
|
this.tableParams.beginUpdateTime = date[0]
|
|
@@ -437,71 +411,29 @@ export default {
|
|
|
//获取角色名称
|
|
|
this.$get('metroapi/role/box').then(res=>{
|
|
|
if (res.httpCode == 1 ){
|
|
|
+ this.roleModalData = JSON.parse(JSON.stringify(res.data))
|
|
|
this.roleData = res.data
|
|
|
- this.roleData.unshift({ id: '-1', value: '角色名称' })
|
|
|
+ this.roleData.unshift({ value: '-1', label: '角色名称' })
|
|
|
} else {
|
|
|
this.roleData = []
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 获取归属应用
|
|
|
- getAppApplicate () {
|
|
|
- this.$get('metroapi/application/info/list', this.applicationParams).then(res=>{
|
|
|
- if (res.httpCode == 1 ){
|
|
|
- this.equipAppModalData = res.data.data
|
|
|
+ // 获取表格数据
|
|
|
+ getTableData (keywords,orgId) {
|
|
|
+ if (typeof(orgId) == 'number' && orgId>0) {
|
|
|
+ this.tableParams.orgId = orgId
|
|
|
+ } else {
|
|
|
+ if (!orgId) {
|
|
|
+ this.tableParams.orgId = ''
|
|
|
} else {
|
|
|
- this.equipAppModalData = []
|
|
|
+ this.tableParams.orgId = this.curOrgId
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- changeLine (val) {
|
|
|
- // 获取站点类型
|
|
|
- this.tableParams.stationId = ''
|
|
|
- this.tableParams.lineId = val.value
|
|
|
- if (this.tableParams.lineId) {
|
|
|
- this.getStationData(val.value)
|
|
|
}
|
|
|
- },
|
|
|
- // 获取所属站点
|
|
|
- getStationData (lineId) {
|
|
|
- if(lineId == '-1') {
|
|
|
- this.stationTypeData = [{ id: '-1', stationName: '站点' }]
|
|
|
- } else {
|
|
|
- this.$get('metroapi/lineStation/queryStationByLineId', {lineId:lineId}).then(res=>{
|
|
|
- if (res.httpCode == 1 ){
|
|
|
- this.stationTypeData = res.data
|
|
|
- this.stationTypeData.unshift({ id: '-1', stationName: '站点' })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取表格数据
|
|
|
- getTableData (keywords,arr,level) {
|
|
|
- // if (level) {
|
|
|
- // this.tableParams.keywords = ''
|
|
|
- // if (level == 2) {
|
|
|
- // this.tableParams.applicationId = arr[arr.length-1]
|
|
|
- // this.tableParams.equipmentType = ''
|
|
|
- // } else if (level == 3) {
|
|
|
- // this.tableParams.applicationId = arr[arr.length-2]
|
|
|
- // this.tableParams.equipmentType = arr[arr.length-1]
|
|
|
- // } else {
|
|
|
- // this.tableParams.applicationId = ''
|
|
|
- // this.tableParams.equipmentType = ''
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.tableParams.applicationId = ''
|
|
|
- // this.tableParams.equipmentType = ''
|
|
|
- // if (keywords == '合肥轨道交通' || keywords == '' || !keywords) {
|
|
|
- // this.tableParams.keywords = ''
|
|
|
- // } else {
|
|
|
- // this.tableParams.keywords = keywords
|
|
|
- // }
|
|
|
- // }
|
|
|
+ this.tableParams.keywords = keywords ? keywords : ''
|
|
|
let params = JSON.parse(JSON.stringify(this.tableParams))
|
|
|
- // params.lineId = params.lineId == '-1' || !params.lineId ? '':params.lineId
|
|
|
- // params.stationId = params.stationId == '-1' || !params.stationId ?'':params.stationId
|
|
|
- // params.equipmentStatus = params.equipmentStatus == '-1' || !params.equipmentStatus ?'':params.equipmentStatus
|
|
|
+ params.roleId = params.roleId == '-1' ? '' : params.roleId
|
|
|
+ params.isEnabled = params.isEnabled == '-1' ? '' : params.isEnabled
|
|
|
this.loading = true
|
|
|
this.$get('metroapi/user/querySysUserPage', params).then(res=>{
|
|
|
this.loading = false
|
|
@@ -523,24 +455,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- selectModalLine (val) {
|
|
|
- this.formOption.stationId = ''
|
|
|
- if (val) {
|
|
|
- this.getStationData(val.value)
|
|
|
- }
|
|
|
- },
|
|
|
- selectModalStation (val) {
|
|
|
- if (val) {
|
|
|
- this.formOption.stationId =val.value
|
|
|
- }
|
|
|
- },
|
|
|
- selectModalApp (val) {
|
|
|
- this.appParams.applicationId = val
|
|
|
- this.formOption.equipmentType = ''
|
|
|
- if (val) {
|
|
|
- this.getAddEquipType(this.appParams)
|
|
|
- }
|
|
|
- },
|
|
|
// 获取新增用户类型
|
|
|
getAddEquipType (params) {
|
|
|
this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
|
|
@@ -554,13 +468,11 @@ export default {
|
|
|
searchClick () {
|
|
|
this.tableParams.pageNum = 1
|
|
|
this.getTableData()
|
|
|
- // this.$router.push({ path: '/MainPage/ApplicationManage', query: {deptName: "2"}})
|
|
|
},
|
|
|
resetClick (name) {
|
|
|
this.dateRange = []
|
|
|
this.tableParams.beginUpdateTime = ''
|
|
|
this.tableParams.endUpdateTime = ''
|
|
|
- this.stationTypeData = [{ id: '-1', stationName: '站点' }]
|
|
|
this.$refs[name].resetFields()
|
|
|
this.tableParams.pageNum = 1
|
|
|
this.getTableData()
|
|
@@ -576,9 +488,9 @@ export default {
|
|
|
detailClick (row) {
|
|
|
this.rowObj = row
|
|
|
this.detailStatus = true
|
|
|
- this.$get('metroapi/equipment/equipmentDetail', {equipmentId:row.id}).then(res=>{
|
|
|
+ this.$get('metroapi/user/userView', {userId:row.userId}).then(res=>{
|
|
|
if (res.httpCode == 1 ){
|
|
|
- this.detailLabel = res.data
|
|
|
+ this.detailData = res.data
|
|
|
} else {
|
|
|
this.$Message.info(res.msg)
|
|
|
}
|
|
@@ -587,11 +499,7 @@ export default {
|
|
|
editClick (row) {
|
|
|
this.rowObj = row
|
|
|
this.formOption = JSON.parse(JSON.stringify(row));
|
|
|
- this.formOption.lineId = this.formOption.lineId ? String(this.formOption.lineId) : '-1'
|
|
|
- this.formOption.stationId = this.formOption.stationId ? String(this.formOption.stationId) : '-1'
|
|
|
- this.getStationData(this.formOption.lineId)
|
|
|
- this.appParams.applicationId = this.formOption.appId
|
|
|
- this.getAddEquipType(this.appParams)
|
|
|
+ this.formOption.orgIdArr = [row.orgId]
|
|
|
this.title = '编辑用户'
|
|
|
this.showModal = true
|
|
|
},
|
|
@@ -600,25 +508,29 @@ export default {
|
|
|
this.commonTitle = '确认删除'
|
|
|
this.activeColor = '#E92E2E'
|
|
|
this.activeClass = ''
|
|
|
- this.modalTitle = '删除不影响已产生的操作和记录。'
|
|
|
+ this.modalTitle = '删除不影响用户已经产生的操作记录。'
|
|
|
+ this.modalStatus = true
|
|
|
+ },
|
|
|
+ resetPwd (row) {
|
|
|
+ this.rowObj = row
|
|
|
+ this.commonTitle = '密码重置'
|
|
|
+ this.activeColor = '#858aea'
|
|
|
+ this.activeClass = ''
|
|
|
+ this.modalTitle = '用户密码将被重置为123456。'
|
|
|
this.modalStatus = true
|
|
|
},
|
|
|
modalChange (modalStatus) {
|
|
|
if (!modalStatus) {
|
|
|
this.$refs.formOption.resetFields();
|
|
|
- this.stationTypeData = [{ id: '-1', stationName: '站点' }]
|
|
|
- this.equipTypeModalData = []
|
|
|
}
|
|
|
},
|
|
|
modalOk (formName) {
|
|
|
let params = JSON.parse(JSON.stringify(this.formOption)) //把对象中的数据给了某个变量,改变一个对象的值,另一个对象也变化的解决方法
|
|
|
- params.lineId = params.lineId == '-1' ? '':params.lineId
|
|
|
- params.stationId = params.stationId == '-1' ? '':params.stationId
|
|
|
if (this.title == '新增用户') {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.$post('metroapi/equipment/addEquipment', params).then(res=>{
|
|
|
- if ( res.httpCode == 1 ){
|
|
|
+ this.$post('metroapi/user/addSysUser', params).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
this.showModal = false
|
|
|
this.$Message.info(res.msg)
|
|
|
this.getTableData()
|
|
@@ -633,7 +545,7 @@ export default {
|
|
|
} else {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.$post('metroapi/equipment/editEquipment', params).then(res=>{
|
|
|
+ this.$post('metroapi/user/updateUser', params).then(res=>{
|
|
|
if (res.httpCode == 1 ){
|
|
|
this.showModal = false
|
|
|
this.$Message.info(res.msg)
|
|
@@ -652,17 +564,68 @@ export default {
|
|
|
this.showModal = false
|
|
|
},
|
|
|
commonOk () {
|
|
|
- let params = {
|
|
|
- id: this.rowObj.id
|
|
|
+ if (this.commonTitle == '确认启用') {
|
|
|
+ let params = {
|
|
|
+ userId: this.rowObj.userId,
|
|
|
+ enabled: 1,
|
|
|
+ type: 0
|
|
|
+ }
|
|
|
+ this.getSwitchStatus(params)
|
|
|
+ } else if (this.commonTitle == '确认关闭') {
|
|
|
+ let params = {
|
|
|
+ userId: this.rowObj.userId,
|
|
|
+ enabled:0,
|
|
|
+ type: 0
|
|
|
+ }
|
|
|
+ this.getSwitchStatus(params)
|
|
|
+ } else if(this.commonTitle == '确认删除'){
|
|
|
+ let params = {
|
|
|
+ userId: this.rowObj.userId,
|
|
|
+ type: 2
|
|
|
+ }
|
|
|
+ this.delData(params)
|
|
|
+ } else {
|
|
|
+ let params = {
|
|
|
+ userId: this.rowObj.userId
|
|
|
+ }
|
|
|
+ console.log(typeof(this.rowObj.userId))
|
|
|
+ this.resetPwdData(params)
|
|
|
}
|
|
|
- this.delData(params)
|
|
|
},
|
|
|
commonCancel () {
|
|
|
this.modalStatus = false
|
|
|
},
|
|
|
+ // 启用 关闭/接口
|
|
|
+ getSwitchStatus (params) {
|
|
|
+ this.$get('metroapi/user/operation',params).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ if (params.enabled == 0) {
|
|
|
+ this.rowObj.isEnable = 0
|
|
|
+ } else {
|
|
|
+ this.rowObj.isEnable = 1
|
|
|
+ }
|
|
|
+ this.modalStatus = false
|
|
|
+ } else {
|
|
|
+ this.rowObj.isEnable = 0
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 删除接口
|
|
|
delData (params) {
|
|
|
- this.$get('metroapi/equipment/delEquipment',params).then(res=>{
|
|
|
+ this.$get('metroapi/user/operation',params).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ this.modalStatus = false
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ this.getTableData()
|
|
|
+ } else {
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重置密码
|
|
|
+ resetPwdData (params) {
|
|
|
+ this.$put('metroapi/user/intial',params).then(res=>{
|
|
|
if (res.httpCode == 1 ){
|
|
|
this.modalStatus = false
|
|
|
this.$Message.info(res.msg)
|
|
@@ -688,18 +651,18 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
.ivu-select {
|
|
|
- width: 150px;
|
|
|
+ width: 165px;
|
|
|
height: 32px;
|
|
|
}
|
|
|
.ivu-select-single .ivu-select-selection {
|
|
|
height: 100%;
|
|
|
}
|
|
|
>>> .ivu-input {
|
|
|
- width: 165px;
|
|
|
+ width: 155px;
|
|
|
height: 32px;
|
|
|
}
|
|
|
>>> .ivu-date-picker-editor .ivu-input {
|
|
|
- width: 210px;
|
|
|
+ width: 315px;
|
|
|
}
|
|
|
>>> .ivu-input-prefix, >>> .ivu-input-suffix {
|
|
|
height: 32px;
|
|
@@ -722,6 +685,10 @@ export default {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
}
|
|
|
+.common-form-modal {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
>>> .common-form-list .ivu-form-item {
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
@@ -779,90 +746,25 @@ export default {
|
|
|
color #409EFF;
|
|
|
}
|
|
|
}
|
|
|
->>> .modal-tabs-item {
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
->>> .common-modal-top-text {
|
|
|
- font-size: 14px;
|
|
|
- font-weight: bold;
|
|
|
- color: #29A0FF;
|
|
|
- line-height: 42px;
|
|
|
- border-left: 3px solid #1590F1;
|
|
|
- padding-left: 12px;
|
|
|
-}
|
|
|
->>> .common-modal-content {
|
|
|
- display: flex;
|
|
|
- width: 100%;
|
|
|
- justify-content: space-between;
|
|
|
- flex-wrap: wrap;
|
|
|
- margin-bottom: 15px;
|
|
|
- border-right: 1px solid #21437B;
|
|
|
+.common-form-item-text {
|
|
|
+ font-size: 11px;
|
|
|
+ color: #85A3D4;
|
|
|
}
|
|
|
->>> .modal-content-item {
|
|
|
- width: 50%;
|
|
|
- display: flex;
|
|
|
-}
|
|
|
->>> .item-especial {
|
|
|
- width: 100%;
|
|
|
-}
|
|
|
->>> .modal-content-item-name {
|
|
|
- width: 50%;
|
|
|
- height: 45px;
|
|
|
- line-height: 45px;
|
|
|
- background: #13305F;
|
|
|
- border-top: 1px solid #21437B;
|
|
|
- border-left: 1px solid #21437B;
|
|
|
- font-size: 14px;
|
|
|
- color: #F5F5F5;
|
|
|
- padding-left: 20px;
|
|
|
-}
|
|
|
->>> .modal-content-item-value {
|
|
|
- width: 50%;
|
|
|
- height: 45px;
|
|
|
- line-height: 45px;
|
|
|
- background: #06214D;
|
|
|
- border-top: 1px solid #21437B;
|
|
|
- border-left: 1px solid #21437B;
|
|
|
- font-size: 14px;
|
|
|
- color: #F5F5F5;
|
|
|
- padding-left: 20px;
|
|
|
-}
|
|
|
->>> .item-especial .modal-content-item-name{
|
|
|
- width: 25%;
|
|
|
- height: 45px;
|
|
|
- line-height: 45px;
|
|
|
- border-bottom: 1px solid #21437B;
|
|
|
-}
|
|
|
->>> .item-especial .modal-content-item-value{
|
|
|
- width: 75%;
|
|
|
- height: 45px;
|
|
|
- line-height: 45px;
|
|
|
- border-bottom: 1px solid #21437B;
|
|
|
-}
|
|
|
->>> .item-especial-bot .modal-content-item-name {
|
|
|
- border-bottom: 1px solid #21437B;
|
|
|
-}
|
|
|
->>> .item-especial-bot .modal-content-item-value {
|
|
|
- border-bottom: 1px solid #21437B;
|
|
|
+.common-form-detail-text {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 14PX;
|
|
|
}
|
|
|
-/deep/ .ivu-input::-webkit-input-placeholder{
|
|
|
+/* 对话框里的input里的placeholder样式修改 */
|
|
|
+/deep/ .ivu-input::-webkit-input-placeholder , /deep/ .ivu-input-number-input::-webkit-input-placeholder{
|
|
|
color: #718EBD;
|
|
|
}
|
|
|
-/deep/ .ivu-input::-moz-placeholder{ /* Mozilla Firefox 19+ */
|
|
|
+/deep/ .ivu-input::-moz-placeholder, /deep/ .ivu-input-number-input::-webkit-input-placeholder{ /* Mozilla Firefox 19+ */
|
|
|
color: #718EBD;
|
|
|
}
|
|
|
-/deep/ .ivu-input::-moz-placeholder{ /* Mozilla Firefox 4 to 18 */
|
|
|
- color: #718EBD;
|
|
|
+/deep/ .ivu-input::-moz-placeholde, /deep/ .ivu-input-number-input::-webkit-input-placeholderr{ /* Mozilla Firefox 4 to 18 */
|
|
|
+ color: #718EBD;
|
|
|
}
|
|
|
-/deep/ .ivu-input::-ms-input-placeholder{ /* Internet Explorer 10-11 */
|
|
|
+/deep/ .ivu-input::-ms-input-placeholder, /deep/ .ivu-input-number-input::-webkit-input-placeholder{ /* Internet Explorer 10-11 */
|
|
|
color: #718EBD;
|
|
|
}
|
|
|
->>> .modal-content-item-value .ivu-tooltip {
|
|
|
- width: 100%;
|
|
|
-}
|
|
|
->>> .modal-content-item-value .ivu-tooltip-rel {
|
|
|
- overflow: hidden;
|
|
|
- text-overflow:ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
-}
|
|
|
</style>
|