From e222c8492392016ae31d89754e52825d6d2ed19b Mon Sep 17 00:00:00 2001 From: DIAMOND <276397553@qq.com> Date: Wed, 28 Dec 2022 17:20:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86-=E5=A2=9E?= =?UTF-8?q?=E5=88=A0=E6=9F=A5=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/page/aside/rightMenuItem/userEdit.vue | 1 + .../page/aside/rightMenuItem/userEditModal.vue | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/views/page/aside/rightMenuItem/userEdit.vue b/src/views/page/aside/rightMenuItem/userEdit.vue index 39315c6..f5b4441 100644 --- a/src/views/page/aside/rightMenuItem/userEdit.vue +++ b/src/views/page/aside/rightMenuItem/userEdit.vue @@ -35,6 +35,7 @@ const columns = [ { title: '序号', dataIndex: 'key' }, { title: '相机名称', dataIndex: 'name' }, { title: '相机IP', dataIndex: 'ip' }, + { title: '相机ID', dataIndex: 'cbCameraParamsId' }, { title: '登录名', dataIndex: 'userName' }, { title: '密码', dataIndex: 'password' }, // { title: '用户类型', dataIndex: 'userType' }, diff --git a/src/views/page/aside/rightMenuItem/userEditModal.vue b/src/views/page/aside/rightMenuItem/userEditModal.vue index 76b895f..bbf0ce5 100644 --- a/src/views/page/aside/rightMenuItem/userEditModal.vue +++ b/src/views/page/aside/rightMenuItem/userEditModal.vue @@ -42,6 +42,7 @@ import { onMounted, reactive, toRaw, UnwrapRef, watch } from 'vue'; import * as cameraApi from '@/axios/cameraBase/cameraApi'; import Msg from '@/utils/message'; interface FormState { + id: string name: string; ip: string; CbCameraParamsId: string; @@ -58,6 +59,7 @@ const props = defineProps({ let labelCol = { span: 6 } let wrapperCol = { span: 14 } const formState: UnwrapRef = reactive({ + id: '', name: '', ip: '', CbCameraParamsId: '', @@ -90,6 +92,20 @@ function add() { //编辑 function edit() { console.log('编辑!', toRaw(formState)); + return cameraApi.Update(toRaw(formState)).then(res => { + console.log(res); + if (res.data.data == true) { + Msg.success('编辑成功') + return true + } + else { + Msg.error('编辑失败,' + res.data.message) + return false + } + }).catch((err: any) => { + Msg.error('编辑失败,' + err) + return false + }) } //暴露方法 @@ -102,6 +118,7 @@ defineExpose({ onMounted(() => { console.log("收到了", props.editData); if (props.editData != null || props.editData != undefined){ + formState.id = props.editData.id; formState.name = props.editData.name; formState.ip = props.editData.ip; formState.CbCameraParamsId = props.editData.cbCameraParamsId;