Commit 1bcbfa2a by YG8429

设备人工修改密码

parent f74cd1d4
......@@ -35,6 +35,15 @@ export function updateDevice(data) {
})
}
// 修改设备密码
export function updateDevicePassword(data) {
return request({
url: '/system/device/updateDevicePassword',
method: 'post',
data: data
})
}
// 删除设备信息
export function delDevice(id) {
return request({
......
......@@ -87,6 +87,14 @@
v-hasPermi="['system:device:edit']"
>关门
</el-button>
<el-button v-if="scope.row.devType=='CCEE'"
size="mini"
type="text"
icon="el-icon-switch"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:device:edit']"
>修改密码
</el-button>
<el-button v-if="scope.row.devType=='0001'"
size="mini"
type="text"
......@@ -114,17 +122,38 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<selectDevice ref="select" :roomId="roomId" @ok="handleQuery"/>
</div>
<!-- 修改密码对话框-->
<el-dialog :title="passwordTitle" :visible.sync="passwordOpen" :append-to-body="true" width="80%px" append-to-bod>
<el-form ref="passwordForm" :model="passwordForm" label-width="120px">
<el-form-item label="设备名称" prop="devName">
<el-input v-model="passwordForm.devName" :disabled="true" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备ID" prop="devId">
<el-input v-model="passwordForm.devId" :disabled="true" placeholder="请输入设备ID" />
</el-form-item>
<el-form-item label="设备原密码" prop="devPsw">
<el-input v-model="passwordForm.devPsw" :disabled="true" placeholder="请输入设备密码" />
</el-form-item>
<el-form-item label="设备新密码" prop="newDevPsw">
<el-input v-model="passwordForm.newDevPsw" placeholder="请输入设备密码" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitPackForm">确 定</el-button>
<el-button @click="passwordCancel">取 消</el-button>
</div>
</el-dialog>
</el-drawer>
</template>
<script>
import {listByRoom, openOrClose} from "@/api/system/device";
import { deleteRoomDevice } from "@/api/system/room";
import { addDevice, getDevice, listByRoom, openOrClose, updateDevice, updateDevicePassword } from '@/api/system/device'
import { deleteRoomDevice, getRoom } from '@/api/system/room'
import selectDevice from "./selectDevice";
import { insertPack } from '@/api/system/pack'
export default {
name: "RoomDevice",
......@@ -132,6 +161,8 @@ export default {
components: {selectDevice},
data() {
return {
passwordTitle: "",
passwordOpen: false,
// 遮罩层
loading: true,
// 选中数组
......@@ -163,6 +194,7 @@ export default {
},
// 表单参数
form: {},
passwordForm: {},
};
},
created() {
......@@ -193,6 +225,7 @@ export default {
}
}
},
methods: {
/** 查询设备信息列表 */
getList() {
......@@ -204,11 +237,32 @@ export default {
this.loading = false;
});
},
passwordReset() {
this.passwordForm = {
devName: null,
devId: null,
devPsw: null,
newDevPsw: null
};
this.resetForm("passwordForm");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
passwordCancel() {
this.passwordOpen = false;
this.passwordReset();
},
handleUpdate(row) {
const id = row.id || this.ids
getDevice(id).then(response => {
this.passwordForm = response.data;
this.passwordOpen = true;
this.passwordTitle = "修改密码";
});
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
......@@ -246,6 +300,18 @@ export default {
this.$modal.msgSuccess(msg);
});
},
//修改密码
submitPackForm() {
this.$refs["passwordForm"].validate(valid => {
if (valid) {
updateDevicePassword(this.passwordForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.passwordOpen = false;
this.getList();
});
}
});
},
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment