|
|
|
@ -2,14 +2,12 @@ |
|
|
|
<div class="app-container"> |
|
|
|
<div class="app-container"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme"> |
|
|
|
<splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--设备档案--> |
|
|
|
<!--设备档案--> |
|
|
|
<pane size="84"> |
|
|
|
<pane size="84"> |
|
|
|
<el-col> |
|
|
|
<el-col> |
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|
|
|
<el-form-item label="设备名称" prop="userName"> |
|
|
|
<el-form-item label="设备名称" prop="Name"> |
|
|
|
<el-input v-model="queryParams.userName" placeholder="请输入设备名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
<el-input v-model="queryParams.Name" placeholder="请输入设备名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="安装位置" prop="phonenumber"> |
|
|
|
<el-form-item label="安装位置" prop="phonenumber"> |
|
|
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入安装位置" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入安装位置" clearable style="width: 240px" @keyup.enter.native="handleQuery" /> |
|
|
|
@ -46,54 +44,50 @@ |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['device:files:import']">导入</el-button> |
|
|
|
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['device:files:import']">导入</el-button> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
|
|
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['device:files:export']">导出</el-button> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> --> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> |
|
|
|
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="50" align="center" /> |
|
|
|
<el-table-column type="selection" width="50" align="center" /> |
|
|
|
<el-table-column label="设备编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> |
|
|
|
<el-table-column label="设备编号" align="center" key="Id" prop="Id" /> |
|
|
|
<el-table-column label="设备名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="设备名称" align="center" key="Name" prop="Name" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="设备版本" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="设备版本" align="center" key="Version" prop="Version" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="设备类型" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="设备类型" align="center" key="EquType" prop="EquType" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="设备级别" align="center" key="phonenumber" prop="phonenumber" v-if="columns[2].visible" width="120" /> |
|
|
|
<el-table-column label="设备级别" align="center" prop="phonenumber" width="120" /> |
|
|
|
<el-table-column label="启用状态" align="center" key="status" v-if="columns[5].visible"> |
|
|
|
<el-table-column label="启用状态" align="center" key="status"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch> |
|
|
|
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="带外管理IP" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="带外管理IP" align="center" key="Ip" prop="Ip" width="120" /> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="设备厂商" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="设备厂商" align="center" key="Manufacture" prop="Manufacture" width="120" /> |
|
|
|
<el-table-column label="安装位置" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="安装位置" align="center" key="Location" prop="Location" width="120" /> |
|
|
|
<el-table-column label="安装时间" align="center" prop="createTime" v-if="columns[6].visible" width="160"> |
|
|
|
<el-table-column label="安装时间" align="center" prop="InstallDate" width="160"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
<span>{{ parseTime(scope.row.InstallDate) }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="设备管理员" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="设备管理员" align="center" prop="phonenumber" width="120" /> |
|
|
|
<el-table-column label="预计年限" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="预计年限" align="center" key="LifeCycle" prop="LifeCycle" width="120" /> |
|
|
|
<el-table-column label="服役年限" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="服役年限" align="center" key="ServiceTime" prop="ServiceTime" width="120" /> |
|
|
|
<el-table-column label="质保时间" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="质保时间" align="center" key="warranty" prop="warranty" width="120" /> |
|
|
|
<el-table-column label="累计预警次数" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="累计预警次数" align="center" key="FailureFrequency" prop="FailureFrequency" width="120" /> |
|
|
|
<el-table-column label="累计维修次数" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="累计维修次数" align="center" key="RepairFrequency" prop="RepairFrequency" width="120" /> |
|
|
|
<el-table-column label="累计维修金额" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="累计维修金额" align="center" key="RepairCost" prop="RepairCost" width="120" /> |
|
|
|
<el-table-column label="设备添加人" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="设备添加人" align="center" key="CreateBy" prop="CreateBy" width="120" /> |
|
|
|
<el-table-column label="添加时间" align="center" prop="createTime" v-if="columns[6].visible" width="160"> |
|
|
|
<el-table-column label="添加时间" align="center" prop="CreateDate" width="160"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="修改人" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|
|
|
<el-table-column label="修改人" align="center" prop="UpdateBy" width="120" /> |
|
|
|
<el-table-column label="修改时间" align="center" prop="createTime" v-if="columns[6].visible" width="160"> |
|
|
|
<el-table-column label="修改时间" align="center" prop="createTime" width="160"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> |
|
|
|
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope" v-if="scope.row.userId !== 1"> |
|
|
|
<template slot-scope="scope" v-if="scope.row.Id !== 1"> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['device:files:edit']">修改</el-button> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['device:files:edit']">修改</el-button> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['device:files:remove']">删除</el-button> |
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['device:files:remove']">删除</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
@ -106,60 +100,67 @@ |
|
|
|
</splitpanes> |
|
|
|
</splitpanes> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="760px" append-to-body> |
|
|
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false"> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="90px"> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<!-- 设备昵称 + 手机号码 --> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="设备昵称" prop="nickName"> |
|
|
|
<el-form-item label="设备编号" prop="nickName"> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入设备昵称" maxlength="30" /> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入设备编号" maxlength="30" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="手机号码" prop="phonenumber"> |
|
|
|
<el-form-item label="设备名称" prop="nickName"> |
|
|
|
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" /> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入设备名称" maxlength="30" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 邮箱 + 设备名称 --> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="邮箱" prop="email"> |
|
|
|
<el-form-item label="设备版本" prop="nickName"> |
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" /> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入设备版本" maxlength="30" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item v-if="form.userId == undefined" label="设备名称" prop="userName"> |
|
|
|
<el-form-item label="设备类型" prop="nickName"> |
|
|
|
<el-input v-model="form.userName" placeholder="请输入设备名称" maxlength="30" /> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入设备类型" maxlength="30" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 设备密码(仅新增)+ 设备性别 --> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item v-if="form.userId == undefined" label="设备密码" prop="password"> |
|
|
|
<el-form-item label="设备级别" prop="nickName"> |
|
|
|
<el-input v-model="form.password" placeholder="请输入设备密码" type="password" maxlength="20" show-password /> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入设备级别" maxlength="30" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="设备性别"> |
|
|
|
<el-form-item label="带外管理IP" prop="nickName"> |
|
|
|
<el-select v-model="form.sex" placeholder="请选择性别" style="width: 100%"> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入带外管理IP" maxlength="30" /> |
|
|
|
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> |
|
|
|
</el-form-item> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
|
|
<el-form-item label="设备厂商" prop="nickName"> |
|
|
|
|
|
|
|
<el-input v-model="form.nickName" placeholder="请输入设备厂商" maxlength="30" /> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
|
|
<el-form-item label="安装位置" prop="nickName"> |
|
|
|
|
|
|
|
<el-input v-model="form.nickName" placeholder="请输入安装位置" maxlength="30" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 状态 + 角色 --> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="状态"> |
|
|
|
<el-form-item label="设备管理员" prop="nickName"> |
|
|
|
<el-radio-group v-model="form.status"> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入设备管理员" maxlength="30" /> |
|
|
|
<el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio> |
|
|
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="角色"> |
|
|
|
<el-form-item label="预计年限" prop="nickName"> |
|
|
|
<el-select v-model="form.roleIds" multiple placeholder="请选择角色" style="width: 100%"> |
|
|
|
<el-input v-model="form.nickName" placeholder="请输入预计年限" maxlength="30" /> |
|
|
|
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option> |
|
|
|
</el-form-item> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
|
|
<el-form-item label="服役年限" prop="nickName"> |
|
|
|
|
|
|
|
<el-input v-model="form.nickName" placeholder="请输入服役年限" maxlength="30" /> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
|
|
<el-form-item label="质保年限" prop="nickName"> |
|
|
|
|
|
|
|
<el-input v-model="form.nickName" placeholder="请输入质保年限" maxlength="30" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
@ -202,7 +203,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/device/files" |
|
|
|
import { getDict, list, getInfo, del, add, update } from "@/api/device/files" |
|
|
|
import { getToken } from "@/utils/auth" |
|
|
|
import { getToken } from "@/utils/auth" |
|
|
|
import Treeselect from "@riophae/vue-treeselect" |
|
|
|
import Treeselect from "@riophae/vue-treeselect" |
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css" |
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css" |
|
|
|
@ -228,7 +229,7 @@ export default { |
|
|
|
// 总条数 |
|
|
|
// 总条数 |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
// 设备表格数据 |
|
|
|
// 设备表格数据 |
|
|
|
userList: null, |
|
|
|
dataList: null, |
|
|
|
// 弹出层标题 |
|
|
|
// 弹出层标题 |
|
|
|
title: "", |
|
|
|
title: "", |
|
|
|
// 所有部门树选项 |
|
|
|
// 所有部门树选项 |
|
|
|
@ -266,13 +267,13 @@ export default { |
|
|
|
// 设置上传的请求头部 |
|
|
|
// 设置上传的请求头部 |
|
|
|
headers: { Authorization: "Bearer " + getToken() }, |
|
|
|
headers: { Authorization: "Bearer " + getToken() }, |
|
|
|
// 上传的地址 |
|
|
|
// 上传的地址 |
|
|
|
url: process.env.VUE_APP_BASE_API + "/system/user/importData" |
|
|
|
url: process.env.VUE_APP_BASE_API + "/equipment/import" |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查询参数 |
|
|
|
// 查询参数 |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
userName: undefined, |
|
|
|
Name: undefined, |
|
|
|
phonenumber: undefined, |
|
|
|
phonenumber: undefined, |
|
|
|
status: undefined, |
|
|
|
status: undefined, |
|
|
|
deptId: undefined |
|
|
|
deptId: undefined |
|
|
|
@ -290,31 +291,12 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
// 表单校验 |
|
|
|
// 表单校验 |
|
|
|
rules: { |
|
|
|
rules: { |
|
|
|
userName: [ |
|
|
|
Name: [ |
|
|
|
{ required: true, message: "设备名称不能为空", trigger: "blur" }, |
|
|
|
{ required: true, message: "设备名称不能为空", trigger: "blur" }, |
|
|
|
{ min: 2, max: 20, message: '设备名称长度必须介于 2 和 20 之间', trigger: 'blur' } |
|
|
|
{ min: 2, max: 20, message: '设备名称长度必须介于 2 和 20 之间', trigger: 'blur' } |
|
|
|
], |
|
|
|
], |
|
|
|
nickName: [ |
|
|
|
nickName: [ |
|
|
|
{ required: true, message: "设备昵称不能为空", trigger: "blur" } |
|
|
|
{ required: true, message: "设备昵称不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
|
|
|
|
password: [ |
|
|
|
|
|
|
|
{ required: true, message: "设备密码不能为空", trigger: "blur" }, |
|
|
|
|
|
|
|
{ min: 5, max: 20, message: '设备密码长度必须介于 5 和 20 之间', trigger: 'blur' }, |
|
|
|
|
|
|
|
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" } |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
email: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
type: "email", |
|
|
|
|
|
|
|
message: "请输入正确的邮箱地址", |
|
|
|
|
|
|
|
trigger: ["blur", "change"] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
phonenumber: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
|
|
|
|
|
|
|
message: "请输入正确的手机号码", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -333,11 +315,18 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
/** 查询设备列表 */ |
|
|
|
|
|
|
|
getDicts() { |
|
|
|
|
|
|
|
getDict().then(response => { |
|
|
|
|
|
|
|
console.log("%c 🗝️: getDict -> response ", "font-size:16px;background-color:#796b0d;color:white;", response) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}, |
|
|
|
/** 查询设备列表 */ |
|
|
|
/** 查询设备列表 */ |
|
|
|
getList() { |
|
|
|
getList() { |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => { |
|
|
|
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => { |
|
|
|
this.userList = response.rows |
|
|
|
this.dataList = response.rows |
|
|
|
this.total = response.total |
|
|
|
this.total = response.total |
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
|
} |
|
|
|
} |
|
|
|
@ -375,8 +364,8 @@ export default { |
|
|
|
// 设备状态修改 |
|
|
|
// 设备状态修改 |
|
|
|
handleStatusChange(row) { |
|
|
|
handleStatusChange(row) { |
|
|
|
let text = row.status === "0" ? "启用" : "停用" |
|
|
|
let text = row.status === "0" ? "启用" : "停用" |
|
|
|
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"设备吗?').then(function() { |
|
|
|
this.$modal.confirm('确认要"' + text + '""' + row.Name + '"设备吗?').then(function() { |
|
|
|
return changeUserStatus(row.userId, row.status) |
|
|
|
return changeUserStatus(row.Id, row.status) |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$modal.msgSuccess(text + "成功") |
|
|
|
this.$modal.msgSuccess(text + "成功") |
|
|
|
}).catch(function() { |
|
|
|
}).catch(function() { |
|
|
|
@ -391,9 +380,9 @@ export default { |
|
|
|
// 表单重置 |
|
|
|
// 表单重置 |
|
|
|
reset() { |
|
|
|
reset() { |
|
|
|
this.form = { |
|
|
|
this.form = { |
|
|
|
userId: undefined, |
|
|
|
Id: undefined, |
|
|
|
deptId: undefined, |
|
|
|
deptId: undefined, |
|
|
|
userName: undefined, |
|
|
|
Name: undefined, |
|
|
|
nickName: undefined, |
|
|
|
nickName: undefined, |
|
|
|
password: undefined, |
|
|
|
password: undefined, |
|
|
|
phonenumber: undefined, |
|
|
|
phonenumber: undefined, |
|
|
|
@ -414,33 +403,33 @@ export default { |
|
|
|
/** 重置按钮操作 */ |
|
|
|
/** 重置按钮操作 */ |
|
|
|
resetQuery() { |
|
|
|
resetQuery() { |
|
|
|
this.dateRange = [] |
|
|
|
this.dateRange = [] |
|
|
|
this.resetForm("queryForm") |
|
|
|
// this.resetForm("queryForm") |
|
|
|
this.queryParams.deptId = undefined |
|
|
|
// this.queryParams.deptId = undefined |
|
|
|
this.$refs.tree.setCurrentKey(null) |
|
|
|
// this.$refs.tree.setCurrentKey(null) |
|
|
|
this.handleQuery() |
|
|
|
// this.handleQuery() |
|
|
|
|
|
|
|
this.getDicts() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 多选框选中数据 |
|
|
|
// 多选框选中数据 |
|
|
|
handleSelectionChange(selection) { |
|
|
|
handleSelectionChange(selection) { |
|
|
|
this.ids = selection.map(item => item.userId) |
|
|
|
this.ids = selection.map(item => item.Id) |
|
|
|
this.single = selection.length != 1 |
|
|
|
this.single = selection.length != 1 |
|
|
|
this.multiple = !selection.length |
|
|
|
this.multiple = !selection.length |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 新增按钮操作 */ |
|
|
|
/** 新增按钮操作 */ |
|
|
|
handleAdd() { |
|
|
|
handleAdd() { |
|
|
|
this.reset() |
|
|
|
this.reset() |
|
|
|
getUser().then(response => { |
|
|
|
// getInfo().then(response => { |
|
|
|
this.postOptions = response.posts |
|
|
|
// this.postOptions = response.posts |
|
|
|
this.roleOptions = response.roles |
|
|
|
// this.roleOptions = response.roles |
|
|
|
|
|
|
|
// }) |
|
|
|
this.open = true |
|
|
|
this.open = true |
|
|
|
this.title = "添加设备" |
|
|
|
this.title = "添加设备" |
|
|
|
this.form.password = this.initPassword |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 修改按钮操作 */ |
|
|
|
/** 修改按钮操作 */ |
|
|
|
handleUpdate(row) { |
|
|
|
handleUpdate(row) { |
|
|
|
this.reset() |
|
|
|
this.reset() |
|
|
|
const userId = row.userId || this.ids |
|
|
|
const Id = row.Id || this.ids |
|
|
|
getUser(userId).then(response => { |
|
|
|
getInfo(Id).then(response => { |
|
|
|
this.form = response.data |
|
|
|
this.form = response.data |
|
|
|
this.postOptions = response.posts |
|
|
|
this.postOptions = response.posts |
|
|
|
this.roleOptions = response.roles |
|
|
|
this.roleOptions = response.roles |
|
|
|
@ -453,7 +442,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 重置密码按钮操作 */ |
|
|
|
/** 重置密码按钮操作 */ |
|
|
|
handleResetPwd(row) { |
|
|
|
handleResetPwd(row) { |
|
|
|
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", { |
|
|
|
this.$prompt('请输入"' + row.Name + '"的新密码', "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
cancelButtonText: "取消", |
|
|
|
closeOnClickModal: false, |
|
|
|
closeOnClickModal: false, |
|
|
|
@ -465,7 +454,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}).then(({ value }) => { |
|
|
|
}).then(({ value }) => { |
|
|
|
resetUserPwd(row.userId, value).then(response => { |
|
|
|
resetUserPwd(row.Id, value).then(response => { |
|
|
|
this.$modal.msgSuccess("修改成功,新密码是:" + value) |
|
|
|
this.$modal.msgSuccess("修改成功,新密码是:" + value) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
@ -474,14 +463,14 @@ export default { |
|
|
|
submitForm: function() { |
|
|
|
submitForm: function() { |
|
|
|
this.$refs["form"].validate(valid => { |
|
|
|
this.$refs["form"].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
if (this.form.userId != undefined) { |
|
|
|
if (this.form.Id != undefined) { |
|
|
|
updateUser(this.form).then(response => { |
|
|
|
update(this.form).then(response => { |
|
|
|
this.$modal.msgSuccess("修改成功") |
|
|
|
this.$modal.msgSuccess("修改成功") |
|
|
|
this.open = false |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
addUser(this.form).then(response => { |
|
|
|
add(this.form).then(response => { |
|
|
|
this.$modal.msgSuccess("新增成功") |
|
|
|
this.$modal.msgSuccess("新增成功") |
|
|
|
this.open = false |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
|
@ -492,9 +481,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 删除按钮操作 */ |
|
|
|
/** 删除按钮操作 */ |
|
|
|
handleDelete(row) { |
|
|
|
handleDelete(row) { |
|
|
|
const userIds = row.userId || this.ids |
|
|
|
const Ids = row.Id || this.ids |
|
|
|
this.$modal.confirm('是否确认删除设备编号为"' + userIds + '"的数据项?').then(function() { |
|
|
|
this.$modal.confirm('是否确认删除设备编号为"' + Ids + '"的数据项?').then(function() { |
|
|
|
return delUser(userIds) |
|
|
|
return del(Ids) |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
|
this.$modal.msgSuccess("删除成功") |
|
|
|
this.$modal.msgSuccess("删除成功") |
|
|
|
|